summaryrefslogtreecommitdiffstats
path: root/module/CaptchaManager.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-03 12:06:51 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-03 12:06:51 +0100
commit6cc67512fcc81ec6069e3e8c31f2c70a5e9dadf0 (patch)
tree6e79e3fd742abcfa49034c9e9b937eab2400cf3f /module/CaptchaManager.py
parent[XFSHoster] Fix handleOverriden (diff)
downloadpyload-6cc67512fcc81ec6069e3e8c31f2c70a5e9dadf0.tar.xz
[CaptchaManager] Custom timeout support
Diffstat (limited to 'module/CaptchaManager.py')
-rw-r--r--module/CaptchaManager.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/module/CaptchaManager.py b/module/CaptchaManager.py
index bd3058376..b7b81a5b7 100644
--- a/module/CaptchaManager.py
+++ b/module/CaptchaManager.py
@@ -58,11 +58,11 @@ class CaptchaManager():
self.lock.release()
return None
- def handleCaptcha(self, task):
+ def handleCaptcha(self, task, timeout=50):
cli = self.core.isClientConnected()
if cli: #client connected -> should solve the captcha
- task.setWaiting(50) #wait 50 sec for response
+ task.setWaiting(timeout) #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 time() > self.waitUntil:
+ if self.result or self.error or self.timedOut():
return False
-
- return True
+ else:
+ return True
def isTextual(self):
""" returns if text is written on the captcha """