summaryrefslogtreecommitdiffstats
path: root/pyload/manager/Addon.py
diff options
context:
space:
mode:
authorGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-10 01:07:51 +0200
committerGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-10 01:07:51 +0200
commit48a492bcffbf795577fed9f9b03b1e304c91409e (patch)
tree32f7bd233afb48596d9e9a7a138be56d173d7c38 /pyload/manager/Addon.py
parentfix: OboomCom and SmoozedCom with beaker >= v1.7.x (diff)
downloadpyload-48a492bcffbf795577fed9f9b03b1e304c91409e.tar.xz
more fixes. now running all plugins
Diffstat (limited to 'pyload/manager/Addon.py')
-rw-r--r--pyload/manager/Addon.py47
1 files changed, 24 insertions, 23 deletions
diff --git a/pyload/manager/Addon.py b/pyload/manager/Addon.py
index 6a9c59c45..0bd51c943 100644
--- a/pyload/manager/Addon.py
+++ b/pyload/manager/Addon.py
@@ -100,31 +100,32 @@ class AddonManager(object):
def createIndex(self):
plugins = []
- active = []
- deactive = []
- for pluginname in self.core.pluginManager.addonPlugins:
- try:
- if self.core.config.getPlugin(pluginname, "activated"):
- pluginClass = self.core.pluginManager.loadClass("addon", pluginname)
- if not pluginClass:
- continue
-
- plugin = pluginClass(self.core, self)
- plugins.append(plugin)
- self.pluginMap[pluginClass.__name__] = plugin
- if plugin.isActivated():
- active.append(pluginClass.__name__)
- else:
- deactive.append(pluginname)
-
- except Exception:
- self.core.log.warning(_("Failed activating %(name)s") % {"name": pluginname})
- if self.core.debug or True:
- traceback.print_exc()
+ for type in ("addon", "hook"):
+ active = []
+ deactive = []
+ for pluginname in getattr(self.core.pluginManager, "%sPlugins" % type):
+ try:
+ if self.core.config.getPlugin("%s_%s" % (pluginname, type), "activated"):
+ pluginClass = self.core.pluginManager.loadClass(type, pluginname)
+ if not pluginClass:
+ continue
+
+ plugin = pluginClass(self.core, self)
+ plugins.append(plugin)
+ self.pluginMap[pluginClass.__name__] = plugin
+ if plugin.isActivated():
+ active.append(pluginClass.__name__)
+ else:
+ deactive.append(pluginname)
+
+ except Exception:
+ self.core.log.warning(_("Failed activating %(name)s") % {"name": pluginname})
+ if self.core.debug or True:
+ traceback.print_exc()
- self.core.log.info(_("Activated addons: %s") % ", ".join(sorted(active)))
- self.core.log.info(_("Deactivated addons: %s") % ", ".join(sorted(deactive)))
+ self.core.log.info(_("Activated %ss: %s") % (type, ", ".join(sorted(active))))
+ self.core.log.info(_("Deactivated %ss: %s") % (type, ", ".join(sorted(deactive))))
self.plugins = plugins