Updated configure() to only take one argument (onStart) and switched all of

the onStart.append('load pluginName') calls to
conf.registerPlugin('pluginName', True)
This commit is contained in:
James Vega 2004-01-28 22:19:25 +00:00
parent 7bdf8210cb
commit bc11f76166
34 changed files with 74 additions and 74 deletions

View File

@ -47,13 +47,13 @@ import privmsgs
import callbacks
import structures
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Alias')
conf.registerPlugin('Alias', True)
class AliasError(Exception):
pass

View File

@ -49,7 +49,7 @@ import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
@ -59,7 +59,7 @@ def configure(onStart, afterConnect, advanced):
if yn('Do you have a license key?') == 'y':
key = anything('What is it?')
onStart.append('load Amazon')
conf.registerPlugin('Amazon', True)
conf.supybot.plugins.Amazon.licenseKey.set(key)
else:
print 'You\'ll need to get a key before you can use this plugin.'

View File

@ -47,13 +47,13 @@ import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Babelfish')
conf.registerPlugin('Babelfish', True)
class Babelfish(callbacks.Privmsg):
threaded = True

View File

@ -48,9 +48,9 @@ import ircmsgs
import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
from questions import expect, anything, something, yn
onStart.append('load BadWords')
conf.registerPlugin('BadWords', True)
while yn('Would you like to add some bad words?') == 'y':
words = anything('What words? (separate individual words by spaces)')
onStart.append('badwords add %s' % words)

View File

@ -90,9 +90,9 @@ class BugzillaError(Exception):
pass
def configure(onStart, afterConnect, advanced):
def configure(onStart):
from questions import expect, anything, yn
onStart.append('load Bugzilla')
conf.registerPlugin('Bugzilla', True)
print 'The Bugzilla plugin has the functionality to watch for URLs'
print 'that match a specific pattern (we call this a snarfer). When'
print 'supybot sees such a URL, he will parse the web page for'

View File

@ -50,13 +50,13 @@ import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load DCC')
conf.registerPlugin('DCC', True)
class DCC(callbacks.Privmsg):
def chat(self, irc, msg, args):

View File

@ -57,13 +57,13 @@ import webutils
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Debian')
conf.registerPlugin('Debian', True)
if not utils.findBinaryInPath('zegrep'):
if not advanced:
print 'I can\'t find zegrep in your path. This is necessary '

View File

@ -54,13 +54,13 @@ except ImportError:
dbfilename = os.path.join(conf.supybot.directories.data(), 'Dunno.db')
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Dunno')
conf.registerPlugin('Dunno', True)
class Dunno(callbacks.Privmsg):
priority = 100

View File

@ -52,13 +52,13 @@ import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Ebay')
conf.registerPlugin('Ebay', True)
print 'The Ebay plugin has the functionality to watch for URLs'
print 'that match a specific pattern (we call this a snarfer). When'
print 'supybot sees such a URL, he will parse the web page for'

View File

@ -46,16 +46,16 @@ import privmsgs
import ircutils
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
from questions import expect, anything, something, yn
onStart.append('load Enforcer')
conf.registerPlugin('Enforcer', True)
chanserv = something('What\'s the name of ChanServ on your network?')
if yn('Do you want the bot to take revenge on rule breakers?') == 'y':
revenge = True
else:
revenge = False
onStart.append('enforcer start %s' % chanserv)
onStart.append('enforcer config revenge %s' % revenge)
conf.supybot.plugins.Enforcer.takeRevenge.setValue(revenge)
conf.registerPlugin('Enforcer')
conf.registerChannelValue(conf.supybot.plugins.Enforcer, 'autoOp',

View File

@ -51,13 +51,13 @@ import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Gameknot')
conf.registerPlugin('Gameknot', True)
if advanced:
print 'The Gameknot plugin has the functionality to watch for URLs'
print 'that match a specific pattern (we call this a snarfer). When'

View File

@ -59,7 +59,7 @@ import privmsgs
import callbacks
import structures
def configure(onStart, afterConnect, advanced):
def configure(onStart):
from questions import expect, anything, something, yn
print 'To use Google\'t Web Services, you must have a license key.'
if yn('Do you have a license key?') == 'y':
@ -72,7 +72,7 @@ def configure(onStart, afterConnect, advanced):
key = ''
break
if key:
onStart.append('load Google')
conf.registerPlugin('Google', True)
conf.supybot.plugins.Google.licenseKey.setValue(key)
print 'The Google plugin has the functionality to watch for URLs'
print 'that match a specific pattern (we call this a snarfer).'
@ -88,10 +88,10 @@ def configure(onStart, afterConnect, advanced):
if yn('Do you want the Google search snarfer enabled by default?') \
== 'y':
conf.supybot.plugins.Google.searchSnarfer.setValue(True)
if 'load Alias' not in onStart:
if not conf.supybot.plugins.Alias():
print 'Google depends on the Alias module for some extra commands.'
if yn('Would you like to load the Alias module now?') == 'y':
onStart.append('load Alias')
conf.registerPlugin('Alias', True)
else:
print 'You can still use the Google module, but you won\'t ' \
'have these extra commands enabled.'

View File

@ -54,9 +54,9 @@ except ImportError:
dbfilename = os.path.join(conf.supybot.directories.data(), 'Infobot.db')
def configure(onStart, afterConnect, advanced):
def configure(onStart):
from questions import expect, anything, something, yn
onStart.append('load Infobot')
conf.registerPlugin('Infobot', True)
def makeDb(filename):
if os.path.exists(filename):

View File

@ -43,13 +43,13 @@ import ircmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load KillBold')
conf.registerPlugin('KillBold', True)
# For some stupid reason, this doesn't work.
## boldre = re.compile('(?:\x02([^\x02\x03\x0f]*\x03))|'

View File

@ -55,13 +55,13 @@ except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Lookup')
conf.registerPlugin('Lookup', True)
print 'This module allows you to define commands that do a simple key'
print 'lookup and return some simple value. It has a command "add"'
### TODO: fix conf.dataDir here. I'm waiting until we rewrite this with

View File

@ -53,13 +53,13 @@ except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Markov')
conf.registerPlugin('Markov', True)
class Markov(plugins.ChannelDBHandler, callbacks.Privmsg):
threaded = True

View File

@ -51,13 +51,13 @@ import callbacks
import convertcore
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Math')
conf.registerPlugin('Math', True)
class Math(callbacks.Privmsg):
###

View File

@ -67,13 +67,13 @@ except ImportError:
dbfilename = os.path.join(conf.supybot.directories.data(), 'MoobotFactoids')
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load MoobotFactoids')
conf.registerPlugin('MoobotFactoids', True)
allchars = string.maketrans('', '')

View File

@ -49,13 +49,13 @@ import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Movies')
conf.registerPlugin('Movies', True)
class Movies(callbacks.Privmsg):
threaded = True

View File

@ -47,13 +47,13 @@ import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Network')
conf.registerPlugin('Network', True)
class Network(callbacks.Privmsg):
threaded = True

View File

@ -53,13 +53,13 @@ except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load News')
conf.registerPlugin('News', True)
class News(plugins.ChannelDBHandler, callbacks.Privmsg):
def __init__(self):

View File

@ -45,13 +45,13 @@ import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load OSU')
conf.registerPlugin('OSU', True)
buildings = {
'AA': 'Agricultural Administration Building, ' \

View File

@ -49,9 +49,9 @@ import plugins
import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
from questions import something, yn
onStart.append('load Parter')
conf.registerPlugin('Parter', True)
s = ' '
while s:
if yn('Would you like to automatically part a channel?') == 'y':

View File

@ -54,13 +54,13 @@ except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Poll')
conf.registerPlugin('Poll', True)
class Poll(callbacks.Privmsg, plugins.ChannelDBHandler):
def __init__(self):

View File

@ -51,15 +51,15 @@ import privmsgs
import registry
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
from questions import expect, anything, something, yn
onStart.append('load RSS')
conf.registerPlugin('RSS', True)
prompt = 'Would you like to add an RSS feed?'
while yn(prompt) == 'y':
prompt = 'Would you like to add another RSS feed?'
name = something('What\'s the name of the website?')
url = something('What\'s the URL of the RSS feed?')
onStart.append('rss add %s %s' % (name, url))
registerFeed(name, url)
conf.registerPlugin('RSS')
conf.registerChannelValue(conf.supybot.plugins.RSS, 'bold', registry.Boolean(

View File

@ -53,10 +53,10 @@ import privmsgs
import callbacks
import configurable
def configure(onStart, afterConnect, advanced):
def configure(onStart):
import socket
from questions import expect, anything, something, yn
onStart.append('load Relay')
conf.registerPlugin('Relay', True)
startNetwork = anything('What is the name of the network you\'re ' \
'connecting to first?')
onStart.append('relay start %s' % startNetwork)

View File

@ -46,13 +46,13 @@ import schedule
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Scheduler')
conf.registerPlugin('Scheduler', True)
class Scheduler(callbacks.Privmsg):

View File

@ -52,13 +52,13 @@ import webutils
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Sourceforge')
conf.registerPlugin('Sourceforge', True)
print 'The Sourceforge plugin has the functionality to watch for URLs'
print 'that match a specific pattern (we call this a snarfer). When'
print 'supybot sees such a URL, he will parse the web page for'
@ -85,10 +85,10 @@ def configure(onStart, afterConnect, advanced):
print 'bug command). You may save some time by making an alias for'
print '"sourceforge". We like to make it "sf".'
if yn('Would you like to add sf as an alias for Sourceforge?') == 'y':
if 'load Alias' not in onStart:
if not conf.supybot.plugins.Alias():
print 'This depends on the Alias module.'
if yn('Would you like to load the Alias plugin now?') == 'y':
onStart.append('load Alias')
conf.registerPlugin('Alias', True)
else:
print 'Then I can\'t add such an alias.'
return

View File

@ -51,13 +51,13 @@ import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Status')
conf.registerPlugin('Status', True)
class Status(callbacks.Privmsg):
def __init__(self):

View File

@ -56,13 +56,13 @@ except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Todo')
conf.registerPlugin('Todo', True)
class TodoDB(plugins.DBHandler):
def makeDb(self, filename):

View File

@ -54,9 +54,9 @@ import privmsgs
import callbacks
import utils
def configure(onStart, afterConnect, advanced):
def configure(onStart):
from questions import expect, anything, something, yn
onStart.append('load Unix')
conf.registerPlugin('Unix', True)
spellCmd = utils.findBinaryInPath('aspell')
if not spellCmd:
spellCmd = utils.findBinaryInPath('ispell')

View File

@ -45,9 +45,9 @@ import ircutils
import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
from questions import expect, anything, yn
onStart.append('load Utilities')
conf.registerPlugin('Utilities', True)
class Utilities(callbacks.Privmsg):
def ignore(self, irc, msg, args):

View File

@ -44,13 +44,13 @@ import privmsgs
import callbacks
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Weather')
conf.registerPlugin('Weather', True)
class Weather(callbacks.Privmsg):

View File

@ -52,13 +52,13 @@ import ircutils
import registry
def configure(onStart, afterConnect, advanced):
def configure(onStart):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would
# like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn
onStart.append('load Words')
conf.registerPlugin('Words', True)
class WordsDB(plugins.DBHandler):