diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-07-31 20:44:42 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-07-31 20:44:42 +0200 |
commit | b06286d2d6693931e7956dba10c07073e69b5909 (patch) | |
tree | e195016b9b58b4c0c3e996ffb3a0cb234cafc217 /module/ThreadManager.py | |
parent | daily commit (diff) | |
download | pyload-b06286d2d6693931e7956dba10c07073e69b5909.tar.xz |
some changes
Diffstat (limited to 'module/ThreadManager.py')
-rw-r--r-- | module/ThreadManager.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/module/ThreadManager.py b/module/ThreadManager.py index 5186c189e..e6d4747b0 100644 --- a/module/ThreadManager.py +++ b/module/ThreadManager.py @@ -54,12 +54,12 @@ class ThreadManager: #---------------------------------------------------------------------- def downloadingIds(self): """get a list of the currently downloading pyfile's ids""" - return [x.active.id for x in self.threads if x.active] + return [x.active.id for x in self.threads if x.active and x.active != "quit"] #---------------------------------------------------------------------- def processingIds(self): """get a id list of all pyfiles processed""" - return [x.active.id for x in self.threads+self.localThreads if x.active] + return [x.active.id for x in self.threads+self.localThreads if x.active and x.active != "quit"] #---------------------------------------------------------------------- @@ -73,7 +73,15 @@ class ThreadManager: #---------------------------------------------------------------------- def checkReconnect(self): """checks if reconnect needed""" - pass + active = [x.active.plugin.wantReconnect for x in self.threads if x.active] + + if active.count(True) > 0 and len(active) == active.count(True): + self.reconnecting.set() + + #Do reconnect + self.log.info(_("Reconnecting")) + + self.reconnecting.clear() #---------------------------------------------------------------------- def checkThreadCount(self): @@ -100,8 +108,8 @@ class ThreadManager: occ = [x.active.pluginname for x in self.threads if x.active and not x.active.plugin.multiDL ] occ.sort() - occ = set(occ) - job = self.core.files.getJob(tuple(occ)) + occ = tuple(set(occ)) + job = self.core.files.getJob(occ) if job: try: job.initPlugin() @@ -117,7 +125,7 @@ class ThreadManager: self.core.files.jobCache[occ].append(job.id) else: - thread = PluginThread.DecrypterThread(job) + thread = PluginThread.DecrypterThread(self, job) |