From fac4c5624c5992db2a69b5659bca72cc03705187 Mon Sep 17 00:00:00 2001 From: James Vega Date: Thu, 29 Jan 2004 23:58:27 +0000 Subject: [PATCH] Removed any unnecessary configure methods (ones that only called conf.registerPlugin) and changed all other configure methods to accept the advanced argument instead of onStart. --- plugins/Alias.py | 8 -------- plugins/Amazon.py | 2 +- plugins/Babelfish.py | 9 --------- plugins/BadWords.py | 2 +- plugins/Bugzilla.py | 2 +- plugins/DCC.py | 9 --------- plugins/Dunno.py | 8 -------- plugins/Ebay.py | 2 +- plugins/Enforcer.py | 2 +- plugins/Gameknot.py | 2 +- plugins/Google.py | 2 +- plugins/Infobot.py | 4 ---- plugins/KillBold.py | 8 -------- plugins/Lookup.py | 2 +- plugins/Markov.py | 8 -------- plugins/Math.py | 8 -------- plugins/MoobotFactoids.py | 8 -------- plugins/Movies.py | 8 -------- plugins/Network.py | 8 -------- plugins/News.py | 8 -------- plugins/OSU.py | 8 -------- plugins/Parter.py | 2 +- plugins/Poll.py | 8 -------- plugins/Python.py | 2 +- plugins/RSS.py | 2 +- plugins/Relay.py | 2 +- plugins/Scheduler.py | 9 --------- plugins/Sourceforge.py | 2 +- plugins/Status.py | 8 -------- plugins/Todo.py | 8 -------- plugins/URL.py | 2 +- plugins/Unix.py | 2 +- plugins/Utilities.py | 4 ---- plugins/Weather.py | 9 --------- plugins/WordStats.py | 4 ---- plugins/Words.py | 9 --------- 36 files changed, 15 insertions(+), 176 deletions(-) diff --git a/plugins/Alias.py b/plugins/Alias.py index 98d8ee598..a05654e0c 100644 --- a/plugins/Alias.py +++ b/plugins/Alias.py @@ -47,14 +47,6 @@ import privmsgs import callbacks import structures -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 - conf.registerPlugin('Alias', True) - class AliasError(Exception): pass diff --git a/plugins/Amazon.py b/plugins/Amazon.py index b3c67f805..4d0e5cbfa 100644 --- a/plugins/Amazon.py +++ b/plugins/Amazon.py @@ -49,7 +49,7 @@ import privmsgs import callbacks -def configure(onStart): +def configure(advanced): # 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 diff --git a/plugins/Babelfish.py b/plugins/Babelfish.py index d61415796..ff36e0c65 100644 --- a/plugins/Babelfish.py +++ b/plugins/Babelfish.py @@ -46,15 +46,6 @@ import utils import privmsgs import callbacks - -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 - conf.registerPlugin('Babelfish', True) - class Babelfish(callbacks.Privmsg): threaded = True _abbrevs = utils.abbrev(imap(str.lower, babelfish.available_languages)) diff --git a/plugins/BadWords.py b/plugins/BadWords.py index 23dce6b2c..b0331b685 100644 --- a/plugins/BadWords.py +++ b/plugins/BadWords.py @@ -48,7 +48,7 @@ import ircmsgs import privmsgs import callbacks -def configure(onStart): +def configure(advanced): from questions import expect, anything, something, yn conf.registerPlugin('BadWords', True) while yn('Would you like to add some bad words?') == 'y': diff --git a/plugins/Bugzilla.py b/plugins/Bugzilla.py index e373ba346..4902286d8 100644 --- a/plugins/Bugzilla.py +++ b/plugins/Bugzilla.py @@ -90,7 +90,7 @@ class BugzillaError(Exception): pass -def configure(onStart): +def configure(advanced): from questions import expect, anything, yn conf.registerPlugin('Bugzilla', True) print 'The Bugzilla plugin has the functionality to watch for URLs' diff --git a/plugins/DCC.py b/plugins/DCC.py index 0ce98d420..6473864fb 100644 --- a/plugins/DCC.py +++ b/plugins/DCC.py @@ -49,15 +49,6 @@ import ircutils import privmsgs import callbacks - -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 - conf.registerPlugin('DCC', True) - class DCC(callbacks.Privmsg): def chat(self, irc, msg, args): """ diff --git a/plugins/Dunno.py b/plugins/Dunno.py index 415696a7b..b180d47f8 100644 --- a/plugins/Dunno.py +++ b/plugins/Dunno.py @@ -54,14 +54,6 @@ except ImportError: dbfilename = os.path.join(conf.supybot.directories.data(), 'Dunno.db') -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 - conf.registerPlugin('Dunno', True) - class Dunno(callbacks.Privmsg): priority = 100 def __init__(self): diff --git a/plugins/Ebay.py b/plugins/Ebay.py index 975e68dda..dc9f6d52e 100644 --- a/plugins/Ebay.py +++ b/plugins/Ebay.py @@ -52,7 +52,7 @@ import privmsgs import callbacks -def configure(onStart): +def configure(advanced): # 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 diff --git a/plugins/Enforcer.py b/plugins/Enforcer.py index 0b6ba4873..f93852c4f 100644 --- a/plugins/Enforcer.py +++ b/plugins/Enforcer.py @@ -46,7 +46,7 @@ import privmsgs import ircutils import callbacks -def configure(onStart): +def configure(advanced): from questions import expect, anything, something, yn conf.registerPlugin('Enforcer', True) chanserv = something('What\'s the name of ChanServ on your network?') diff --git a/plugins/Gameknot.py b/plugins/Gameknot.py index 9b1c71a79..3ec6f07b9 100644 --- a/plugins/Gameknot.py +++ b/plugins/Gameknot.py @@ -51,7 +51,7 @@ import privmsgs import callbacks -def configure(onStart): +def configure(advanced): # 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 diff --git a/plugins/Google.py b/plugins/Google.py index 009dd6c37..40846333f 100644 --- a/plugins/Google.py +++ b/plugins/Google.py @@ -59,7 +59,7 @@ import privmsgs import callbacks import structures -def configure(onStart): +def configure(advanced): 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': diff --git a/plugins/Infobot.py b/plugins/Infobot.py index 52c643904..e867f4f0b 100755 --- a/plugins/Infobot.py +++ b/plugins/Infobot.py @@ -54,10 +54,6 @@ except ImportError: dbfilename = os.path.join(conf.supybot.directories.data(), 'Infobot.db') -def configure(onStart): - from questions import expect, anything, something, yn - conf.registerPlugin('Infobot', True) - def makeDb(filename): if os.path.exists(filename): return sqlite.connect(filename) diff --git a/plugins/KillBold.py b/plugins/KillBold.py index abbf7e6de..d100251f5 100644 --- a/plugins/KillBold.py +++ b/plugins/KillBold.py @@ -43,14 +43,6 @@ import ircmsgs import callbacks -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 - conf.registerPlugin('KillBold', True) - # For some stupid reason, this doesn't work. ## boldre = re.compile('(?:\x02([^\x02\x03\x0f]*\x03))|' ## '(?:\x02([^\x02\x0f]*)(?:[\x02\x0f]|$))') diff --git a/plugins/Lookup.py b/plugins/Lookup.py index d72c9a74d..e22a24241 100644 --- a/plugins/Lookup.py +++ b/plugins/Lookup.py @@ -55,7 +55,7 @@ except ImportError: raise callbacks.Error, 'You need to have PySQLite installed to use this ' \ 'plugin. Download it at ' -def configure(onStart): +def configure(advanced): # 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 diff --git a/plugins/Markov.py b/plugins/Markov.py index 286e2f45e..24a5d18f1 100644 --- a/plugins/Markov.py +++ b/plugins/Markov.py @@ -53,14 +53,6 @@ except ImportError: raise callbacks.Error, 'You need to have PySQLite installed to use this ' \ 'plugin. Download it at ' -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 - conf.registerPlugin('Markov', True) - class Markov(plugins.ChannelDBHandler, callbacks.Privmsg): threaded = True def __init__(self): diff --git a/plugins/Math.py b/plugins/Math.py index 17996f087..782458eba 100644 --- a/plugins/Math.py +++ b/plugins/Math.py @@ -51,14 +51,6 @@ import callbacks import convertcore -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 - conf.registerPlugin('Math', True) - class Math(callbacks.Privmsg): ### # So this is how the 'calc' command works: diff --git a/plugins/MoobotFactoids.py b/plugins/MoobotFactoids.py index 10ef670d9..ba0870370 100644 --- a/plugins/MoobotFactoids.py +++ b/plugins/MoobotFactoids.py @@ -67,14 +67,6 @@ except ImportError: dbfilename = os.path.join(conf.supybot.directories.data(), 'MoobotFactoids') -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 - conf.registerPlugin('MoobotFactoids', True) - allchars = string.maketrans('', '') class OptionList(object): diff --git a/plugins/Movies.py b/plugins/Movies.py index b67b72e1d..58b66d293 100644 --- a/plugins/Movies.py +++ b/plugins/Movies.py @@ -49,14 +49,6 @@ import privmsgs import callbacks -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 - conf.registerPlugin('Movies', True) - class Movies(callbacks.Privmsg): threaded = True def _formatMovie(self, movie): diff --git a/plugins/Network.py b/plugins/Network.py index 1b52909ed..ab0d4f6c2 100644 --- a/plugins/Network.py +++ b/plugins/Network.py @@ -47,14 +47,6 @@ import privmsgs import callbacks -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 - conf.registerPlugin('Network', True) - class Network(callbacks.Privmsg): threaded = True def dns(self, irc, msg, args): diff --git a/plugins/News.py b/plugins/News.py index 10fcd9d7d..7071cf45f 100644 --- a/plugins/News.py +++ b/plugins/News.py @@ -53,14 +53,6 @@ except ImportError: raise callbacks.Error, 'You need to have PySQLite installed to use this ' \ 'plugin. Download it at ' -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 - conf.registerPlugin('News', True) - class News(plugins.ChannelDBHandler, callbacks.Privmsg): def __init__(self): plugins.ChannelDBHandler.__init__(self) diff --git a/plugins/OSU.py b/plugins/OSU.py index cf4377eeb..95a8838dd 100644 --- a/plugins/OSU.py +++ b/plugins/OSU.py @@ -45,14 +45,6 @@ import privmsgs import callbacks -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 - conf.registerPlugin('OSU', True) - buildings = { 'AA': 'Agricultural Administration Building, ' \ '2120 Fyffe Road, Columbus, Ohio, 43210', diff --git a/plugins/Parter.py b/plugins/Parter.py index f903547c2..a7a88eecf 100644 --- a/plugins/Parter.py +++ b/plugins/Parter.py @@ -49,7 +49,7 @@ import plugins import privmsgs import callbacks -def configure(onStart): +def configure(advanced): from questions import something, yn conf.registerPlugin('Parter', True) s = ' ' diff --git a/plugins/Poll.py b/plugins/Poll.py index f60fd153f..191515f71 100644 --- a/plugins/Poll.py +++ b/plugins/Poll.py @@ -54,14 +54,6 @@ except ImportError: raise callbacks.Error, 'You need to have PySQLite installed to use this ' \ 'plugin. Download it at ' -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 - conf.registerPlugin('Poll', True) - class Poll(callbacks.Privmsg, plugins.ChannelDBHandler): def __init__(self): callbacks.Privmsg.__init__(self) diff --git a/plugins/Python.py b/plugins/Python.py index ad46455c4..48cb487ce 100644 --- a/plugins/Python.py +++ b/plugins/Python.py @@ -65,7 +65,7 @@ if hasattr(math, '__file__'): L.append(math.__file__) pythonPath = map(os.path.dirname, L) -def configure(onStart): +def configure(advanced): from questions import expect, anything, something, yn conf.registerPlugin('Python', True) if yn("""This plugin provides a snarfer for ASPN Python Recipe URLs; diff --git a/plugins/RSS.py b/plugins/RSS.py index ef2172e7f..4c82d4c4c 100644 --- a/plugins/RSS.py +++ b/plugins/RSS.py @@ -51,7 +51,7 @@ import privmsgs import registry import callbacks -def configure(onStart): +def configure(advanced): from questions import expect, anything, something, yn conf.registerPlugin('RSS', True) prompt = 'Would you like to add an RSS feed?' diff --git a/plugins/Relay.py b/plugins/Relay.py index 27d8af8e5..a0d275b1c 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -53,7 +53,7 @@ import privmsgs import callbacks import configurable -def configure(onStart): +def configure(advanced): import socket from questions import expect, anything, something, yn conf.registerPlugin('Relay', True) diff --git a/plugins/Scheduler.py b/plugins/Scheduler.py index e2a8fa7d3..1d310e228 100644 --- a/plugins/Scheduler.py +++ b/plugins/Scheduler.py @@ -46,15 +46,6 @@ import schedule import callbacks -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 - conf.registerPlugin('Scheduler', True) - - class Scheduler(callbacks.Privmsg): def __init__(self): callbacks.Privmsg.__init__(self) diff --git a/plugins/Sourceforge.py b/plugins/Sourceforge.py index 2ec8e0f64..dc367f6ac 100644 --- a/plugins/Sourceforge.py +++ b/plugins/Sourceforge.py @@ -52,7 +52,7 @@ import webutils import callbacks -def configure(onStart): +def configure(advanced): # 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 diff --git a/plugins/Status.py b/plugins/Status.py index 6f8e422c5..274d8107f 100644 --- a/plugins/Status.py +++ b/plugins/Status.py @@ -51,14 +51,6 @@ import privmsgs import callbacks -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 - conf.registerPlugin('Status', True) - class Status(callbacks.Privmsg): def __init__(self): callbacks.Privmsg.__init__(self) diff --git a/plugins/Todo.py b/plugins/Todo.py index 044659623..ae14b2db6 100644 --- a/plugins/Todo.py +++ b/plugins/Todo.py @@ -56,14 +56,6 @@ except ImportError: raise callbacks.Error, 'You need to have PySQLite installed to use this ' \ 'plugin. Download it at ' -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 - conf.registerPlugin('Todo', True) - class TodoDB(plugins.DBHandler): def makeDb(self, filename): """create Todo database and tables""" diff --git a/plugins/URL.py b/plugins/URL.py index 5dbd95e6c..e61e13035 100644 --- a/plugins/URL.py +++ b/plugins/URL.py @@ -61,7 +61,7 @@ except ImportError: raise callbacks.Error, 'You need to have PySQLite installed to use this ' \ 'plugin. Download it at ' -def configure(onStart): +def configure(advanced): from questions import expect, anything, something, yn conf.registerPlugin('URL', True) if yn("""This plugin offers a snarfer that will go to tinyurl.com and get diff --git a/plugins/Unix.py b/plugins/Unix.py index 1c3bca42c..6478b1cd5 100644 --- a/plugins/Unix.py +++ b/plugins/Unix.py @@ -54,7 +54,7 @@ import privmsgs import callbacks import utils -def configure(onStart): +def configure(advanced): from questions import expect, anything, something, yn conf.registerPlugin('Unix', True) spellCmd = utils.findBinaryInPath('aspell') diff --git a/plugins/Utilities.py b/plugins/Utilities.py index c79002cfb..8d0cfbf0f 100644 --- a/plugins/Utilities.py +++ b/plugins/Utilities.py @@ -45,10 +45,6 @@ import ircutils import privmsgs import callbacks -def configure(onStart): - from questions import expect, anything, yn - conf.registerPlugin('Utilities', True) - class Utilities(callbacks.Privmsg): def ignore(self, irc, msg, args): """takes no arguments diff --git a/plugins/Weather.py b/plugins/Weather.py index a6bcbb235..bfec98330 100644 --- a/plugins/Weather.py +++ b/plugins/Weather.py @@ -44,15 +44,6 @@ import privmsgs import callbacks -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 - conf.registerPlugin('Weather', True) - - class Weather(callbacks.Privmsg): threaded = True def callCommand(self, method, irc, msg, *L): diff --git a/plugins/WordStats.py b/plugins/WordStats.py index 7f33cd4e1..4ba880990 100644 --- a/plugins/WordStats.py +++ b/plugins/WordStats.py @@ -42,10 +42,6 @@ import privmsgs import callbacks -def configure(advanced): - from questions import expect, anything, something, yn - conf.registerPlugin('WordStats', True) - conf.registerPlugin('WordStats') conf.registerChannelValue(conf.supybot.plugins.WordStats, 'wordstatsRankingDisplay', diff --git a/plugins/Words.py b/plugins/Words.py index 84b326ac0..22739838c 100644 --- a/plugins/Words.py +++ b/plugins/Words.py @@ -52,15 +52,6 @@ import ircutils import registry -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 - conf.registerPlugin('Words', True) - - class WordsDB(plugins.DBHandler): def makeDb(self, filename): if os.path.exists(filename):