diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-01 14:38:04 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-01 14:38:04 +0200 |
commit | b483255ff2f6da827dbbe92f418a1db9cb6c4621 (patch) | |
tree | cae06f6f85b2c0cced368c346786504b2b51715f /module/plugins | |
parent | plugin updates to new interface (diff) | |
download | pyload-b483255ff2f6da827dbbe92f418a1db9cb6c4621.tar.xz |
reconnect fix
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/Plugin.py | 17 |
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 """ |