diff options
Diffstat (limited to 'pyload/manager/Addon.py')
-rw-r--r-- | pyload/manager/Addon.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/pyload/manager/Addon.py b/pyload/manager/Addon.py index 164068634..6a9c59c45 100644 --- a/pyload/manager/Addon.py +++ b/pyload/manager/Addon.py @@ -71,7 +71,7 @@ class AddonManager(object): try: return func(*args) except Exception, e: - args[0].log.error(_("Error executing addon: %s") % e) + args[0].core.log.error(_("Error executing addon: %s") % e) if args[0].core.debug: traceback.print_exc() @@ -105,7 +105,6 @@ class AddonManager(object): for pluginname in self.core.pluginManager.addonPlugins: try: - # hookClass = getattr(plugin, plugin.__name) if self.core.config.getPlugin(pluginname, "activated"): pluginClass = self.core.pluginManager.loadClass("addon", pluginname) if not pluginClass: @@ -113,15 +112,15 @@ class AddonManager(object): plugin = pluginClass(self.core, self) plugins.append(plugin) - self.pluginMap[pluginClass.__name] = plugin + self.pluginMap[pluginClass.__name__] = plugin if plugin.isActivated(): - active.append(pluginClass.__name) + active.append(pluginClass.__name__) else: deactive.append(pluginname) except Exception: self.core.log.warning(_("Failed activating %(name)s") % {"name": pluginname}) - if self.core.debug: + if self.core.debug or True: traceback.print_exc() self.core.log.info(_("Activated addons: %s") % ", ".join(sorted(active))) @@ -141,7 +140,7 @@ class AddonManager(object): def activateAddon(self, pluginname): # check if already loaded for inst in self.plugins: - if inst.__name == pluginname: + if inst.__class__.__name__ == pluginname: return pluginClass = self.core.pluginManager.loadClass("addon", pluginname) @@ -153,14 +152,14 @@ class AddonManager(object): addon = pluginClass(self.core, self) self.plugins.append(addon) - self.pluginMap[pluginClass.__name] = addon + self.pluginMap[pluginClass.__name__] = addon addon.activate() def deactivateAddon(self, pluginname): for plugin in self.plugins: - if plugin.__name == pluginname: + if plugin.__class__.__name__ == pluginname: addon = plugin break else: @@ -174,7 +173,7 @@ class AddonManager(object): self.core.log.debug("Removed callback: %s" % self.core.scheduler.removeJob(addon.cb)) self.plugins.remove(addon) - del self.pluginMap[addon.__name] + del self.pluginMap[addon.__class__.__name__] @try_catch |