summaryrefslogtreecommitdiffstats
path: root/pyload/manager
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-16 21:02:39 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-16 21:02:39 +0200
commitbdb90b74ed973e9d61c9c6fd35d98ffe4c2d4c20 (patch)
tree896ff1eaae9151d83be150735c96a37a61d2d038 /pyload/manager
parent[api] Improve getConfigValue (diff)
parentfixed: more typos (diff)
downloadpyload-bdb90b74ed973e9d61c9c6fd35d98ffe4c2d4c20.tar.xz
Merge pull request #5 from ardi69/0.4.10
fix: assignJob and typos (__name vs. __name__) [2]
Diffstat (limited to 'pyload/manager')
-rw-r--r--pyload/manager/Thread.py6
-rw-r--r--pyload/manager/thread/Download.py1
-rw-r--r--pyload/manager/thread/Plugin.py3
3 files changed, 6 insertions, 4 deletions
diff --git a/pyload/manager/Thread.py b/pyload/manager/Thread.py
index 1f1a2dc5c..015bc9ab1 100644
--- a/pyload/manager/Thread.py
+++ b/pyload/manager/Thread.py
@@ -257,11 +257,11 @@ class ThreadManager(object):
free = [x for x in self.threads if not x.active]
- inuse = set([((x.active.plugintype, x.active.pluginname), self.getLimit(x)) for x in self.threads if x.active and x.active.hasPlugin() and x.active.plugin.account])
- inuse = map(lambda x: ('.'.join(x[0]), x[1], len([y for y in self.threads if y.active and y.active.plugintype == x[0][0] and y.active.pluginname == x[0][1]])), inuse)
+ inuse = set([((x.active.plugintype, x.active.pluginname), self.getLimit(x)) for x in self.threads if x.active and isinstance(x.active, PyFile) and x.active.hasPlugin() and x.active.plugin.account])
+ inuse = map(lambda x: ('.'.join(x[0]), x[1], len([y for y in self.threads if y.active and isinstance(y.active, PyFile) and y.active.plugintype == x[0][0] and y.active.pluginname == x[0][1]])), inuse)
onlimit = [x[0] for x in inuse if x[1] > 0 and x[2] >= x[1]]
- occ = [x.active.plugintype + '.' + x.active.pluginname for x in self.threads if x.active and x.active.hasPlugin() and not x.active.plugin.multiDL] + onlimit
+ occ = [x.active.plugintype + '.' + x.active.pluginname for x in self.threads if x.active and isinstance(x.active, PyFile) and x.active.hasPlugin() and not x.active.plugin.multiDL] + onlimit
occ.sort()
occ = tuple(set(occ))
diff --git a/pyload/manager/thread/Download.py b/pyload/manager/thread/Download.py
index fc76b655e..21db61ca4 100644
--- a/pyload/manager/thread/Download.py
+++ b/pyload/manager/thread/Download.py
@@ -39,6 +39,7 @@ class DownloadThread(PluginThread):
while True:
del pyfile
+ self.active = False # sets the thread inactive when it is ready to get next job
self.active = self.queue.get()
pyfile = self.active
diff --git a/pyload/manager/thread/Plugin.py b/pyload/manager/thread/Plugin.py
index d5b4cfefe..08a2664da 100644
--- a/pyload/manager/thread/Plugin.py
+++ b/pyload/manager/thread/Plugin.py
@@ -20,6 +20,7 @@ from pyload.utils.packagetools import parseNames
from pyload.utils import fs_join
from pyload.api import OnlineStatus
+
class PluginThread(Thread):
"""abstract base class for thread types"""
@@ -127,5 +128,5 @@ class PluginThread(Thread):
def clean(self, pyfile):
""" set thread unactive and release pyfile """
- self.active = False
+ self.active = True #release pyfile but lets the thread active
pyfile.release()