Forgot to update when registerPlugin moved to conf.

This commit is contained in:
Jeremy Fincher 2004-01-19 22:38:09 +00:00
parent 4fa547c1c6
commit 8228f7d7a1

View File

@ -94,20 +94,13 @@ def loadPluginClass(irc, module):
assert not irc.getCallback(callback.name()) assert not irc.getCallback(callback.name())
irc.addCallback(callback) irc.addCallback(callback)
def registerPlugin(name, currentValue=None):
conf.supybot.plugins.registerGroup(name,
registry.GroupWithValue(registry.Boolean(False, """Determines
whether this plugin is loaded by default.""")))
if currentValue is not None:
conf.supybot.plugins.getChild(name).setValue(currentValue)
class Owner(privmsgs.CapabilityCheckingPrivmsg): class Owner(privmsgs.CapabilityCheckingPrivmsg):
# This plugin must be first; its priority must be lowest; otherwise odd # This plugin must be first; its priority must be lowest; otherwise odd
# things will happen when adding callbacks. # things will happen when adding callbacks.
priority = ~sys.maxint-1 # This must be first! priority = ~sys.maxint-1 # This must be first!
capability = 'owner' capability = 'owner'
_srcPlugins = ('Owner', 'Misc', 'Admin', 'User', 'Channel') _srcPlugins = ('Admin', 'Channel', 'Config', 'Misc', 'Owner', 'User')
def __init__(self): def __init__(self):
callbacks.Privmsg.__init__(self) callbacks.Privmsg.__init__(self)
if hasattr(self.__class__, '_exec'): if hasattr(self.__class__, '_exec'):
@ -122,7 +115,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
(_, _, name) = name.split('.') (_, _, name) = name.split('.')
except ValueError: #unpack list of wrong size. except ValueError: #unpack list of wrong size.
continue continue
registerPlugin(name) conf.registerPlugin(name)
def do001(self, irc, msg): def do001(self, irc, msg):
self.log.info('Loading other src/ plugins.') self.log.info('Loading other src/ plugins.')
@ -346,7 +339,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
irc.error(utils.exnToString(e)) irc.error(utils.exnToString(e))
return return
loadPluginClass(irc, module) loadPluginClass(irc, module)
registerPlugin(name, True) conf.registerPlugin(name, True)
irc.replySuccess() irc.replySuccess()
def reload(self, irc, msg, args): def reload(self, irc, msg, args):
@ -391,7 +384,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
callback.die() callback.die()
del callback del callback
gc.collect() gc.collect()
registerPlugin(name, False) conf.registerPlugin(name, False)
irc.replySuccess() irc.replySuccess()
else: else:
irc.error('There was no callback %s' % name) irc.error('There was no callback %s' % name)