From fae28ebcc48455038cd1fcb6cfc99c7967b0c6c7 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 12 Aug 2010 17:03:11 +0200 Subject: XMPP Interface --- module/PluginManager.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'module/PluginManager.py') diff --git a/module/PluginManager.py b/module/PluginManager.py index 44a426d31..f452e2b39 100644 --- a/module/PluginManager.py +++ b/module/PluginManager.py @@ -238,8 +238,16 @@ class PluginManager(): classes.append(value["class"]) continue - module = __import__(value["path"], globals(), locals(), [value["name"]] , -1) + if not self.core.config.getPlugin(name, "load"): + continue + try: + module = __import__(value["path"], globals(), locals(), [value["name"]] , -1) + except Exception, e: + self.log.error(_("Error importing %s: %s") % (name, str(e))) + self.log.error(_("You should fix dependicies or deactivate load on startup.")) + continue + pluginClass = getattr(module, name) value["class"] = pluginClass -- cgit v1.2.3 From 72abfb455275546e110e4daf811480dd47ffceea Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 12 Aug 2010 22:44:41 +0200 Subject: improvements --- module/PluginManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/PluginManager.py') diff --git a/module/PluginManager.py b/module/PluginManager.py index f452e2b39..8bb5a5ec6 100644 --- a/module/PluginManager.py +++ b/module/PluginManager.py @@ -132,7 +132,7 @@ class PluginManager(): config = [ [y.strip() for y in x.replace("'","").replace('"',"").replace(")","").split(",")] for x in config[0].split("(") if x.strip()] if folder == "hooks": - config.append( ["load", "bool", "Load on startup", True] ) + config.append( ["load", "bool", "Load on startup", True if name not in ("XMPPInterface", "MultiHome") else False] ) for item in config: self.core.config.addPluginConfig([name]+item) -- cgit v1.2.3