From b483255ff2f6da827dbbe92f418a1db9cb6c4621 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 1 Aug 2010 14:38:04 +0200 Subject: reconnect fix --- module/plugins/Plugin.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 5a53b4e47..69e398439 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -73,7 +73,8 @@ class Plugin(object): self.multiDL = True self.waitUntil = 0 # time() + wait in seconds - + self.waiting = False + self.premium = False self.ocr = None # captcha reader instance @@ -142,9 +143,19 @@ class Plugin(object): """ set the wait time to specified seconds """ self.pyfile.waitUntil = time() + int(seconds) - def wait(): + def wait(self): """ waits the time previously set """ - if self.pyfile.abort: raise Abort + self.waiting = True + + while self.pyfile.waitUntil < time(): + self.thread.m.reconnecting.wait(2) + + if self.pyfile.abort: raise Abort + if self.thread.m.reconnecting.isSet(): + self.waiting = False + raise Reconnect + + self.waiting = False def fail(self, reason): """ fail and give reason """ -- cgit v1.2.3