At least import the plugin module, so configuration is preserved.

This commit is contained in:
Jeremy Fincher 2004-02-04 05:56:51 +00:00
parent 0d6136610e
commit 285ac5ef6d
1 changed files with 12 additions and 8 deletions

View File

@ -140,14 +140,18 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
loadPluginClass(irc, m) loadPluginClass(irc, m)
self.log.info('Loading plugins/ plugins.') self.log.info('Loading plugins/ plugins.')
for (name, value) in conf.supybot.plugins.getValues(fullNames=False): for (name, value) in conf.supybot.plugins.getValues(fullNames=False):
if value() and irc.getCallback(name) is None: if irc.getCallback(name) is None:
if not irc.getCallback(name): if value():
self.log.info('Loading %s.' % name) if not irc.getCallback(name):
try: self.log.info('Loading %s.' % name)
m = loadPluginModule(name) try:
loadPluginClass(irc, m) m = loadPluginModule(name)
except Exception, e: loadPluginClass(irc, m)
log.exception('Failed to load %s:' % name) except Exception, e:
log.exception('Failed to load %s:' % name)
else:
# Let's import the module so configuration is preserved.
_ = loadPluginModule(name)
def disambiguate(self, irc, tokens, ambiguousCommands=None): def disambiguate(self, irc, tokens, ambiguousCommands=None):
"""Disambiguates the given tokens based on the plugins loaded and """Disambiguates the given tokens based on the plugins loaded and