summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Plugin.py17
1 files changed, 14 insertions, 3 deletions
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 """