diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/CaptchaManager.py | 10 | ||||
-rw-r--r-- | module/Plugin.py | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/module/CaptchaManager.py b/module/CaptchaManager.py index 9fbff92a1..d6a8fd077 100644 --- a/module/CaptchaManager.py +++ b/module/CaptchaManager.py @@ -41,7 +41,8 @@ class CaptchaManager(): def getTask(self): self.lock.acquire() for task in self.tasks: - if task.getStatus() == "waiting": + status = task.getStatus() + if status == "waiting" or status == "shared-user": self.lock.release() return task self.lock.release() @@ -100,9 +101,12 @@ class CaptchaTask(): self.status = "waiting" self.lock.release() - def setWatingForUser(self): + def setWatingForUser(self, exclusive): self.lock.acquire() - self.status = "user" + if exclusive: + self.status = "user" + else: + self.status = "shared-user" self.lock.release() def removeTask(self): diff --git a/module/Plugin.py b/module/Plugin.py index 59aa9c1d1..1428e6235 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -24,6 +24,7 @@ from os.path import join from time import sleep import sys +from os.path import exists from module.network.Request import Request from os import makedirs @@ -175,7 +176,7 @@ class Plugin(): if self.pyfile.package.data["package_name"] != (self.parent.core.config['general']['link_file']) and self.parent.core.xmlconfig.get("general", "folder_per_package", False): self.pyfile.folder = self.pyfile.package.data["package_name"] location = join(download_folder, self.pyfile.folder.decode(sys.getfilesystemencoding())) - makedirs(location) + if not exists(location): makedirs(location) file_path = join(location.decode(sys.getfilesystemencoding()), self.pyfile.status.filename.decode(sys.getfilesystemencoding())) else: file_path = join(download_folder, self.pyfile.status.filename.decode(sys.getfilesystemencoding())) |