diff options
author | Armin <Armin@Armin-PC.diedering.lan> | 2015-04-10 01:07:51 +0200 |
---|---|---|
committer | Armin <Armin@Armin-PC.diedering.lan> | 2015-04-10 01:07:51 +0200 |
commit | 48a492bcffbf795577fed9f9b03b1e304c91409e (patch) | |
tree | 32f7bd233afb48596d9e9a7a138be56d173d7c38 /pyload/manager/Addon.py | |
parent | fix: OboomCom and SmoozedCom with beaker >= v1.7.x (diff) | |
download | pyload-48a492bcffbf795577fed9f9b03b1e304c91409e.tar.xz |
more fixes. now running all plugins
Diffstat (limited to 'pyload/manager/Addon.py')
-rw-r--r-- | pyload/manager/Addon.py | 47 |
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 |