diff --git a/scripts/supybot b/scripts/supybot index 9a5fb2871..5bb49d9e9 100755 --- a/scripts/supybot +++ b/scripts/supybot @@ -261,6 +261,7 @@ if __name__ == '__main__': import log import conf import world + world.starting = True def closeRegistry(): # We only print if world.dying so we don't see these messages during diff --git a/src/Owner.py b/src/Owner.py index c36f1f9ee..f3b2119f3 100644 --- a/src/Owner.py +++ b/src/Owner.py @@ -189,10 +189,14 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg): m = loadPluginModule(name) loadPluginClass(irc, m) except Exception, e: - log.exception('Failed to load %s:' % name) + log.exception('Failed to load %s:', name) else: # Let's import the module so configuration is preserved. - _ = loadPluginModule(name) + try: + _ = loadPluginModule(name) + except Exception, e: + log.exception('Failed to load %s:', name) + world.starting = False def disambiguate(self, irc, tokens, ambiguousCommands=None): """Disambiguates the given tokens based on the plugins loaded and diff --git a/src/world.py b/src/world.py index f319eddfa..faad1b506 100644 --- a/src/world.py +++ b/src/world.py @@ -55,6 +55,8 @@ import schedule startedAt = time.time() # Just in case it doesn't get set later. +starting = False + mainThread = threading.currentThread() assert 'MainThread' in repr(mainThread) @@ -86,7 +88,7 @@ def upkeep(): pass if gc.garbage: log.warning('Uncollectable garbage: %s', gc.garbage) - flushed = conf.supybot.flush() + flushed = conf.supybot.flush() and not starting if flushed: flush() # This is so registry._cache gets filled.