diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-09-24 15:41:13 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-09-24 15:41:13 +0200 |
commit | fb145cf68c0178b9551eaae3213ec01be112bf76 (patch) | |
tree | 61d8dd381a831da4c34359b5e471e11d687f4746 /module/threads/ThreadManager.py | |
parent | added some animations, code for show/hiding items (diff) | |
download | pyload-fb145cf68c0178b9551eaae3213ec01be112bf76.tar.xz |
fixed some things, so downloads works again
Diffstat (limited to 'module/threads/ThreadManager.py')
-rw-r--r-- | module/threads/ThreadManager.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/module/threads/ThreadManager.py b/module/threads/ThreadManager.py index e3407aac3..a0ece3463 100644 --- a/module/threads/ThreadManager.py +++ b/module/threads/ThreadManager.py @@ -26,7 +26,7 @@ from random import choice import pycurl -from module.datatypes import PyFile +from module.datatypes.PyFile import PyFile from module.network.RequestFactory import getURL from module.utils import lock, uniqify from module.utils.fs import free_space @@ -118,8 +118,11 @@ class ThreadManager: def setInfoResults(self, rid, result): self.infoResults[rid].update(result) + def getActiveDownloads(self): + return [x.active for x in self.threads if x.active and isinstance(x.active, PyFile)] + def getActiveFiles(self): - active = [x.active for x in self.threads if x.active and isinstance(x.active, PyFile)] + active = self.getActiveDownloads() for t in self.localThreads: active.extend(t.getActiveFiles()) @@ -130,6 +133,8 @@ class ThreadManager: """get a id list of all pyfiles processed""" return [x.id for x in self.getActiveFiles()] + def allProgressInfo(self): + pass #TODO def work(self): """run all task which have to be done (this is for repetetive call by core)""" @@ -138,16 +143,15 @@ class ThreadManager: except Exception, e: self.log.error(_("Reconnect Failed: %s") % str(e) ) self.reconnecting.clear() - if self.core.debug: - print_exc() + self.core.print_exc() + self.checkThreadCount() try: self.assignJob() except Exception, e: self.log.warning("Assign job error", e) - if self.core.debug: - print_exc() + self.core.print_exc() sleep(0.5) self.assignJob() |