diff options
author | mkaay <mkaay@mkaay.de> | 2010-05-01 20:02:26 +0200 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-05-01 20:02:26 +0200 |
commit | 93dd7baa519d15712e4c578b472e448502ec2298 (patch) | |
tree | 6980b0eb4432de2bdf72c6271bd736c6fc35e4ab /module/CaptchaManager.py | |
parent | import fix (diff) | |
download | pyload-93dd7baa519d15712e4c578b472e448502ec2298.tar.xz |
updated captcha manager
Diffstat (limited to 'module/CaptchaManager.py')
-rw-r--r-- | module/CaptchaManager.py | 10 |
1 files changed, 7 insertions, 3 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): |