summaryrefslogtreecommitdiffstats
path: root/module/ThreadManager.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-11-14 14:08:38 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-11-14 14:08:38 +0100
commited3b4cd5e100b5df44b45c55a00d49b208cb0a11 (patch)
tree5f1a9ea5ae0cc7507413aeb707a92c277ada7e65 /module/ThreadManager.py
parentprevent more than one pyload instance, -q, --quit option (diff)
downloadpyload-ed3b4cd5e100b5df44b45c55a00d49b208cb0a11.tar.xz
LinkList fix, update fix, crypter fix
Diffstat (limited to 'module/ThreadManager.py')
-rw-r--r--module/ThreadManager.py39
1 files changed, 4 insertions, 35 deletions
diff --git a/module/ThreadManager.py b/module/ThreadManager.py
index a2a8b0411..eba23f28c 100644
--- a/module/ThreadManager.py
+++ b/module/ThreadManager.py
@@ -25,7 +25,6 @@ from threading import Event
from time import sleep
from traceback import print_exc
from random import choice
-from threading import Lock
import pycurl
import PluginThread
@@ -57,30 +56,8 @@ class ThreadManager:
for i in range(0, self.core.config.get("general", "max_downloads")):
self.createThread()
- self.occupiedCrypter = []
- self.occupiedCrypterLock = Lock()
-
- #----------------------------------------------------------------------
- def addOccupiedCrypter(self, name):
- self.occupiedCrypterLock.acquire()
- self.occupiedCrypter.append(name)
- self.occupiedCrypterLock.release()
-
- def removeOccupiedCrypter(self, name):
- self.occupiedCrypterLock.acquire()
- if name in self.occupiedCrypter:
- self.occupiedCrypter.remove(name)
- self.occupiedCrypterLock.release()
-
- def isOccupiedCrypter(self, name):
- self.occupiedCrypterLock.acquire()
- ret = 0
- for plugin in self.occupiedCrypter:
- if name == plugin:
- ret += 1
- self.occupiedCrypterLock.release()
- return ret
-
+
+
#----------------------------------------------------------------------
def createThread(self):
"""create a download thread"""
@@ -253,19 +230,11 @@ class ThreadManager:
job = self.core.files.getDecryptJob()
if job:
job.initPlugin()
- if job.plugin.multiDL or self.isOccupiedCrypter(job.pluginname) < job.plugin.limitDL:
- thread = PluginThread.DecrypterThread(self, job)
- if not job.plugin.multiDL:
- print "add"
- self.addOccupiedCrypter(job.pluginname)
+ thread = PluginThread.DecrypterThread(self, job)
else:
- if job.plugin.multiDL or self.isOccupiedCrypter(job.pluginname) < job.plugin.limitDL:
- thread = PluginThread.DecrypterThread(self, job)
- if not job.plugin.multiDL:
- print "add"
- self.addOccupiedCrypter(job.pluginname)
+ thread = PluginThread.DecrypterThread(self, job)
def cleanup(self):
"""do global cleanup"""