summaryrefslogtreecommitdiffstats
path: root/pyload/manager
diff options
context:
space:
mode:
authorGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-09 20:11:11 +0200
committerGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-09 20:11:11 +0200
commitf53d57b902b71708f05a3125872ec5d34ebe65b9 (patch)
tree2f8756396411a98331cb937e42ded87da2c9f253 /pyload/manager
parentMerge remote-tracking branch 'origin/0.4.10' into 0.4.10 (diff)
downloadpyload-f53d57b902b71708f05a3125872ec5d34ebe65b9.tar.xz
fix: OboomCom and SmoozedCom with beaker >= v1.7.x
fix: run plugins this fix makes the plugin attribute "__name" obsolet
Diffstat (limited to 'pyload/manager')
-rw-r--r--pyload/manager/Account.py2
-rw-r--r--pyload/manager/Addon.py17
-rw-r--r--pyload/manager/Plugin.py4
3 files changed, 12 insertions, 11 deletions
diff --git a/pyload/manager/Account.py b/pyload/manager/Account.py
index 2631e1c7d..12fc970c2 100644
--- a/pyload/manager/Account.py
+++ b/pyload/manager/Account.py
@@ -176,7 +176,7 @@ class AccountManager(object):
if self.accounts[p]:
p = self.getAccountPlugin(p)
if p:
- data[p.__name] = p.getAllAccounts(force)
+ data[p.__class__.__name__] = p.getAllAccounts(force)
else: #@NOTE: When an account has been skipped, p is None
data[p] = []
else:
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
diff --git a/pyload/manager/Plugin.py b/pyload/manager/Plugin.py
index 72fabb33a..99778c3f3 100644
--- a/pyload/manager/Plugin.py
+++ b/pyload/manager/Plugin.py
@@ -60,7 +60,9 @@ class PluginManager(object):
self.plugins[type] = self.parse(type)
setattr(self, "%sPlugins" % type, self.plugins[type])
- self.plugins['addon'] = self.addonPlugins.update(self.hookPlugins)
+ # ???????? i don't understand this
+ # self.plugins['addon'] = self.addonPlugins.update(self.hookPlugins)
+ # ????????
self.core.log.debug("Created index of plugins")