Loaded plugins during __init__ rather than do001.

This commit is contained in:
Jeremy Fincher 2005-08-15 05:37:05 +00:00
parent 27656e5fef
commit 603cab6b0a
3 changed files with 6 additions and 4 deletions

View File

@ -203,10 +203,11 @@ class Owner(callbacks.Plugin):
if irc != newIrc:
newIrc.state.history = irc.state.history
driver = drivers.newDriver(newIrc)
self._loadPlugins(newIrc)
return newIrc
def do001(self, irc, msg):
self.log.info('Loading plugins (connected to %s).', irc.network)
def _loadPlugins(self, irc):
self.log.info('Loading plugins (connecting to %s).', irc.network)
alwaysLoadImportant = conf.supybot.plugins.alwaysLoadImportant()
important = conf.supybot.commands.defaultPlugins.importantPlugins()
for (name, value) in conf.supybot.plugins.getValues(fullNames=False):

View File

@ -328,7 +328,7 @@ if __name__ == '__main__':
import supybot.plugins.Owner as Owner
owner = Owner.Class()
irclib._callbacks.append(owner)
#irclib._callbacks.append(owner)
if options.profile:
import profile

View File

@ -82,7 +82,8 @@ class IrcCallback(IrcCommandDispatcher):
super(IrcCallback, self).__init__(*args, **kwargs)
def __repr__(self):
return '<%s %s>' % (self.__class__.__name__, self.name())
return '<%s %s %s>' % \
(self.__class__.__name__, self.name(), object.__repr__(self))
def name(self):
"""Returns the name of the callback."""