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 /pyLoadCore.py | |
parent | import fix (diff) | |
download | pyload-93dd7baa519d15712e4c578b472e448502ec2298.tar.xz |
updated captcha manager
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-x | pyLoadCore.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py index e59f8db10..16bfbbeae 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -718,16 +718,22 @@ class ServerMethods(): task = self.core.captchaManager.getTask() return not task == None - def get_captcha_task(self): + def get_captcha_task(self, exclusive=False): + self.core.lastGuiConnected = time.time() task = self.core.captchaManager.getTask() if task: - task.setWatingForUser() + task.setWatingForUser(exclusive=exclusive) c = task.getCaptcha() return str(task.getID()), Binary(c[0]), str(c[1]) else: return None, None, None + def get_task_status(self, tid): + self.core.lastGuiConnected = time.time() + return self.core.captchaManager.getTaskFromID(tid).getStatus() + def set_captcha_result(self, tid, result): + self.core.lastGuiConnected = time.time() task = self.core.captchaManager.getTaskFromID(tid) if task: task.setResult(result) |