summaryrefslogtreecommitdiffstats
path: root/pyload/manager
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-02-16 22:38:45 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-02-16 22:38:45 +0100
commit270c1ee85edcd1e9e10511833b422d93dfca192a (patch)
treeeb846081ba3ec09721879ee237016b26d19c3c2f /pyload/manager
parentFix plugins to work on 0.4.10 (diff)
downloadpyload-270c1ee85edcd1e9e10511833b422d93dfca192a.tar.xz
Diffstat (limited to 'pyload/manager')
-rw-r--r--pyload/manager/Account.py2
-rw-r--r--pyload/manager/Addon.py14
-rw-r--r--pyload/manager/Plugin.py20
-rw-r--r--pyload/manager/Thread.py2
-rw-r--r--pyload/manager/thread/Plugin.py2
5 files changed, 15 insertions, 25 deletions
diff --git a/pyload/manager/Account.py b/pyload/manager/Account.py
index 3acf70311..2631e1c7d 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.__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 d293109c7..164068634 100644
--- a/pyload/manager/Addon.py
+++ b/pyload/manager/Addon.py
@@ -105,7 +105,7 @@ class AddonManager(object):
for pluginname in self.core.pluginManager.addonPlugins:
try:
- # hookClass = getattr(plugin, plugin.__name__)
+ # hookClass = getattr(plugin, plugin.__name)
if self.core.config.getPlugin(pluginname, "activated"):
pluginClass = self.core.pluginManager.loadClass("addon", pluginname)
if not pluginClass:
@@ -113,9 +113,9 @@ 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)
@@ -141,7 +141,7 @@ class AddonManager(object):
def activateAddon(self, pluginname):
# check if already loaded
for inst in self.plugins:
- if inst.__name__ == pluginname:
+ if inst.__name == pluginname:
return
pluginClass = self.core.pluginManager.loadClass("addon", pluginname)
@@ -153,14 +153,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.__name == pluginname:
addon = plugin
break
else:
@@ -174,7 +174,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.__name]
@try_catch
diff --git a/pyload/manager/Plugin.py b/pyload/manager/Plugin.py
index 879430be2..c6aad3fe5 100644
--- a/pyload/manager/Plugin.py
+++ b/pyload/manager/Plugin.py
@@ -20,10 +20,10 @@ class PluginManager(object):
USERROOT = "userplugins."
TYPES = ["account", "addon", "container", "crypter", "hook", "hoster", "internal", "ocr"]
- PATTERN = re.compile(r'__pattern__\s*=\s*u?r("|\')([^"\']+)')
- VERSION = re.compile(r'__version__\s*=\s*("|\')([\d.]+)')
- CONFIG = re.compile(r'__config__\s*=\s*\[([^\]]+)', re.M)
- DESC = re.compile(r'__description__\s*=\s*("|"""|\')([^"\']+)')
+ PATTERN = re.compile(r'__pattern\s*=\s*u?r("|\')([^"\']+)')
+ VERSION = re.compile(r'__version\s*=\s*("|\')([\d.]+)')
+ CONFIG = re.compile(r'__config\s*=\s*\[([^\]]+)', re.M)
+ DESC = re.compile(r'__description\s*=\s*("|"""|\')([^"\']+)')
def __init__(self, core):
@@ -93,8 +93,7 @@ class PluginManager(object):
pfolder = join(pypath, "pyload", "plugins", folder)
for f in listdir(pfolder):
- if (isfile(join(pfolder, f)) and f.endswith(".py") or f.endswith("_25.pyc") or f.endswith(
- "_26.pyc") or f.endswith("_27.pyc")) and not f.startswith("_"):
+ if isfile(join(pfolder, f)) and f.endswith(".py") and not f.startswith("_"):
try:
with open(join(pfolder, f)) as data:
@@ -104,15 +103,6 @@ class PluginManager(object):
self.core.log.error(str(e))
continue
- if f.endswith("_25.pyc") and version_info[0:2] != (2, 5): #@TODO: Remove in 0.4.10
- continue
-
- elif f.endswith("_26.pyc") and version_info[0:2] != (2, 6): #@TODO: Remove in 0.4.10
- continue
-
- elif f.endswith("_27.pyc") and version_info[0:2] != (2, 7): #@TODO: Remove in 0.4.10
- continue
-
name = f[:-3]
if name[-1] == ".":
name = name[:-4]
diff --git a/pyload/manager/Thread.py b/pyload/manager/Thread.py
index 2ace9c789..6c9304e87 100644
--- a/pyload/manager/Thread.py
+++ b/pyload/manager/Thread.py
@@ -266,7 +266,7 @@ class ThreadManager(object):
job.release()
return
- if job.plugin.__type__ == "hoster":
+ if job.plugin.__type == "hoster":
spaceLeft = freeSpace(self.core.config["general"]["download_folder"]) / 1024 / 1024
if spaceLeft < self.core.config["general"]["min_free_space"]:
self.core.log.warning(_("Not enough space left on device"))
diff --git a/pyload/manager/thread/Plugin.py b/pyload/manager/thread/Plugin.py
index 20d57c933..70ee747a8 100644
--- a/pyload/manager/thread/Plugin.py
+++ b/pyload/manager/thread/Plugin.py
@@ -72,7 +72,7 @@ class PluginThread(Thread):
def getDebugDump(self, pyfile):
dump = "pyLoad %s Debug Report of %s %s \n\nTRACEBACK:\n %s \n\nFRAMESTACK:\n" % (
- self.m.core.api.getServerVersion(), pyfile.pluginname, pyfile.plugin.__version__, format_exc())
+ self.m.core.api.getServerVersion(), pyfile.pluginname, pyfile.plugin.__version, format_exc())
tb = exc_info()[2]
stack = []