From bd6432b1e58beaa375af7a52ddee017727f97bd0 Mon Sep 17 00:00:00 2001 From: Schrolli Date: Thu, 9 Jul 2015 08:04:55 +0200 Subject: [PATCH] Fix error in pluginLoader.py see Issue #52 --- includes/pluginLoader.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/includes/pluginLoader.py b/includes/pluginLoader.py index 1adc4bd..a79a779 100644 --- a/includes/pluginLoader.py +++ b/includes/pluginLoader.py @@ -35,18 +35,19 @@ def loadPlugins(): logging.error("error loading plugin: %s", i["name"]) logging.debug("error loading plugin: %s", i["name"], exc_info=True) pass - - try: - # Try to call the .onLoad() routine for all active plugins - logging.debug("call %s.onLoad()", i["name"]) - plugin.onLoad() - # Add it to globals.pluginList - globals.pluginList[i["name"]] = plugin - except: - # call next plugin, if one has thrown an exception - logging.error("error calling %s.onLoad()", i["name"]) - logging.debug("error calling %s.onLoad()", exc_info=True) - pass + else: # only call onLoad() and insert into pluginList[] if import is succesfull + + try: + # Try to call the .onLoad() routine for all active plugins + logging.debug("call %s.onLoad()", i["name"]) + plugin.onLoad() + # Add it to globals.pluginList + globals.pluginList[i["name"]] = plugin + except: + # call next plugin, if one has thrown an exception + logging.error("error calling %s.onLoad()", i["name"]) + logging.debug("error calling %s.onLoad()", exc_info=True) + pass except: logging.error("cannot load plugins") logging.debug("cannot load plugins", exc_info=True)