From 6cc67512fcc81ec6069e3e8c31f2c70a5e9dadf0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Nov 2014 12:06:51 +0100 Subject: [CaptchaManager] Custom timeout support --- module/CaptchaManager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/CaptchaManager.py') 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 """ -- cgit v1.2.3