diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-11-22 20:04:29 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-11-22 20:04:29 +0100 |
commit | 0de6e675bb0c5a4adb79d16df55ada3071825ad5 (patch) | |
tree | 9ff782ba4c41873c8c7d06b239166d8a0806b335 /module/CaptchaManager.py | |
parent | Revert plugins to stable (diff) | |
download | pyload-0de6e675bb0c5a4adb79d16df55ada3071825ad5.tar.xz |
Revert remaining modules
Diffstat (limited to 'module/CaptchaManager.py')
-rw-r--r-- | module/CaptchaManager.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/module/CaptchaManager.py b/module/CaptchaManager.py index b7b81a5b7..02cd10a11 100644 --- a/module/CaptchaManager.py +++ b/module/CaptchaManager.py @@ -58,11 +58,11 @@ class CaptchaManager(): self.lock.release() return None - def handleCaptcha(self, task, timeout=50): + def handleCaptcha(self, task): cli = self.core.isClientConnected() if cli: #client connected -> should solve the captcha - task.setWaiting(timeout) #wait 50 sec for response + task.setWaiting(50) #wait 50 sec for response for plugin in self.core.hookManager.activePlugins(): try: @@ -125,10 +125,10 @@ class CaptchaTask(): self.status = "waiting" def isWaiting(self): - if self.result or self.error or self.timedOut(): + if self.result or self.error or time() > self.waitUntil: return False - else: - return True + + return True def isTextual(self): """ returns if text is written on the captcha """ @@ -149,12 +149,10 @@ class CaptchaTask(): def invalid(self): """ indicates the captcha was not correct """ - for x in self.handler: - x.captchaInvalid(self) + [x.captchaInvalid(self) for x in self.handler] def correct(self): - for x in self.handler: - x.captchaCorrect(self) + [x.captchaCorrect(self) for x in self.handler] def __str__(self): return "<CaptchaTask '%s'>" % self.id |