diff --git a/plugins/Debian.py b/plugins/Debian.py index ae9efbf3f..e432031f9 100644 --- a/plugins/Debian.py +++ b/plugins/Debian.py @@ -66,7 +66,7 @@ def configure(advanced): to run the file command. I'll disable this command now. When you get zegrep in your path, use the command "enable file" to re-enable the command.""") - onStart.append('disable file') + conf.supybot.defaultCapabilities().add('Debian.file') else: output("""I can't find zegrep in your path. If you want to run the file command with any sort of expediency, you'll @@ -77,7 +77,7 @@ def configure(advanced): conf.supybot.plugins.Debian.pythonZegrep.setValue(True) else: output('I\'ll disable file now.') - onStart.append('disable file') + conf.supybot.defaultCapabilities().add('Debian.file') conf.registerPlugin('Debian') conf.registerGlobalValue(conf.supybot.plugins.Debian, 'pythonZegrep', diff --git a/plugins/Google.py b/plugins/Google.py index be9b614e2..7d4e9e5a8 100644 --- a/plugins/Google.py +++ b/plugins/Google.py @@ -95,9 +95,6 @@ def configure(advanced): output('You can still use the Google module, but you won\'t ' 'have these extra commands enabled.') return - onStart.append('alias add googlelinux "google --restrict=linux $1"') - onStart.append('alias add googlebsd "google --restrict=bsd $1"') - onStart.append('alias add googlemac "google --restrict=mac $1"') else: output("""You'll need to get a key before you can use this plugin. You can apply for a key at http://www.google.com/apis/""") diff --git a/plugins/Lookup.py b/plugins/Lookup.py index 2060e57e2..a41ff68a0 100644 --- a/plugins/Lookup.py +++ b/plugins/Lookup.py @@ -88,7 +88,6 @@ def configure(advanced): continue command = something('What would you like the command to be?') conf.registerGlobalValue(lookups,command, registry.String(filename,'')) - onStart.append('lookup add %s %s' % (command, filename)) conf.registerPlugin('Lookup') diff --git a/plugins/Parter.py b/plugins/Parter.py index 41bfbf825..88e399937 100644 --- a/plugins/Parter.py +++ b/plugins/Parter.py @@ -52,48 +52,31 @@ import callbacks def configure(advanced): from questions import something, yn conf.registerPlugin('Parter', True) - s = ' ' - while s: + channel = ' ' + while channel: + L = [] if yn('Would you like to automatically part a channel?'): - s = something('What channel?') + channel = something('What channel?') while not ircutils.isChannel(s): output('That\'s not a valid channel.') - s = something('What channel?') - onStart.append('autopartchannel %s' % s) + channel = something('What channel?') + L.append(channel) else: - s = '' + channel = '' + conf.supybot.plugins.Parter.channels.setValue(L) + +conf.registerPlugin('Parter') +conf.registerGlobalValue(conf.supybot.plugins.Parter, 'channels', + conf.SpaceSeparatedListOfChannels([], """Determines what channels the bot + will automatically part whenever it joins them.""")) class Parter(callbacks.Privmsg): - def __init__(self): - super(self.__class__, self).__init__() - self.channels = sets.Set([]) - - def autopart(self, irc, msg, args): - """ - - - Makes the bot part automatically, as soon as he joins it. - """ - channel = privmsgs.getArgs(args) - self.channels.add(channel) - irc.replySuccess() - autopart = privmsgs.checkCapability(autopart, 'admin') - - def removeautopart(self, irc, msg, args): - """ - - Removes the channel from the auto-part list. - """ - channel = privmsgs.getArgs(args) - self.channels.discard(channel) - irc.replySuccess() - removeautopart = privmsgs.checkCapability(removeautopart, 'admin') - def doJoin(self, irc, msg): if irc.nick == msg.nick: channels = msg.args[0].split(',') + autoParts = self.registryValue('channels') for channel in channels: - if channel in self.channels: + if channel in autoParts: irc.sendMsg(ircmsgs.part(channel)) diff --git a/plugins/Sourceforge.py b/plugins/Sourceforge.py index f9051f109..dae963580 100644 --- a/plugins/Sourceforge.py +++ b/plugins/Sourceforge.py @@ -48,6 +48,7 @@ __revision__ = "$Id$" import plugins import ircutils import privmsgs +import registry import webutils import callbacks @@ -90,7 +91,8 @@ def configure(advanced): else: output('Then I can\'t add such an alias.') return - onStart.append('alias add sf sourceforge $*') + conf.supybot.plugins.Alias.aliases.register('sf', + registry.String('sourceforge $*', '')) class TrackerError(Exception): pass diff --git a/plugins/Unix.py b/plugins/Unix.py index cdbd35973..90b00485a 100644 --- a/plugins/Unix.py +++ b/plugins/Unix.py @@ -65,14 +65,14 @@ def configure(advanced): function of this module will not work. You may choose to install it later. To re-enable this command then, remove the "disable spell" line from your configuration file.""") - onStart.append('disable spell') + conf.supybot.defaultCapabilities().add('Unix.spell') fortuneCmd = utils.findBinaryInPath('fortune') if not fortuneCmd: output("""NOTE: I couldn't find fortune in your path, so that function of this module will not work. You may choose to install it later. To re-enable this command then, remove the '"disable fortune" command from your configuration file.""") - onStart.append('disable fortune') + conf.supybot.defaultCapabilities().add('Unix.fortune') wtfCmd = utils.findBinaryInPath('wtf') if not wtfCmd: output("""NOTE: I couldn't find wtf in your path, so that function of @@ -80,14 +80,14 @@ def configure(advanced): to re-enable this command then, remove the "disable wtf" command from your configuration file or simply tell the bot "enable wtf" instead.""") - onStart.append('disable wtf') + conf.supybot.defaultCapabilities().add('Unix.wtf') output("""The "progstats" command can reveal potentially sensitive information about your machine. Here's an example of its output: %s\n""" % progstats()) if yn('Would you like to disable this command for non-owner users?', default=True): - onStart.append('disable progstats') + conf.supybot.defaultCapabilities().add('Unix.progstats') def progstats(): pw = pwd.getpwuid(os.getuid())