diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-06-22 15:20:14 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-06-22 15:20:14 +0200 |
commit | 58de24c63f11f53137fab3854d6324c5a321a37c (patch) | |
tree | 5239c6f40b059d5bfd8caae45810e4e01a1494e6 /module/download_thread.py | |
parent | sharonline captcha method (diff) | |
download | pyload-58de24c63f11f53137fab3854d6324c5a321a37c.tar.xz |
reconnect works with new plugin system
Diffstat (limited to 'module/download_thread.py')
-rw-r--r-- | module/download_thread.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/module/download_thread.py b/module/download_thread.py index ce353d6f6..202ebcafb 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -50,6 +50,10 @@ class Status(object): return ((self.size()-self.kB_left()) * 100) / self.size() return 0 +class Reconnect(Exception): + pass + + class Download_Thread(threading.Thread): def __init__(self, parent): threading.Thread.__init__(self) @@ -66,10 +70,12 @@ class Download_Thread(threading.Thread): if self.loadedPyFile: try: self.download(self.loadedPyFile) + except Reconnect: + pass except Exception, e: traceback.print_exc() self.loadedPyFile.status.type = "failed" - self.loadedPyFile.status.error = e.message + self.loadedPyFile.status.error = str(e) finally: self.parent.job_finished(self.loadedPyFile) sleep(0.5) @@ -103,7 +109,7 @@ class Download_Thread(threading.Thread): if self.parent.init_reconnect() or self.parent.reconnecting: pyfile.status.type = "reconnected" pyfile.status.want_reconnect = False - return False + raise Reconnect sleep(1) pyfile.status.want_reconnect = False return True |