diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-06-18 13:17:18 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-06-18 13:17:18 +0200 |
commit | 0a705696089fdc28463d45598fde2ceb78220790 (patch) | |
tree | 17b8fa4dbd2c04075891e1cec44556e239484e96 /module/download_thread.py | |
parent | fixed disconnecting (diff) | |
download | pyload-0a705696089fdc28463d45598fde2ceb78220790.tar.xz |
plugin for gigasize
Diffstat (limited to 'module/download_thread.py')
-rw-r--r-- | module/download_thread.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/module/download_thread.py b/module/download_thread.py index a290bc4f7..f68cfedd7 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -17,9 +17,10 @@ # along with this program; if not, see <http://www.gnu.org/licenses/>. # ### - import threading -from time import time, sleep +import traceback +from time import sleep +from time import time class Status(object): @@ -45,7 +46,7 @@ class Status(object): return self.pyfile.plugin.req.dl_size / 1024 def percent(self): if not self.kB_left() == 0 and not self.size() == 0: - return ((self.size()-self.kB_left())*100)/self.size() + return ((self.size()-self.kB_left()) * 100) / self.size() return 0 class Download_Thread(threading.Thread): @@ -65,7 +66,7 @@ class Download_Thread(threading.Thread): try: self.download(self.loadedPyFile) except Exception, e: - print "Error:", e #catch up all error here + traceback.print_exc() self.loadedPyFile.status.type = "failed" finally: self.parent.job_finished(self.loadedPyFile) @@ -79,7 +80,7 @@ class Download_Thread(threading.Thread): pyfile.prepareDownload() if not status.exists: - raise "FileDontExists" #i know its deprecated, who cares^^ + raise "FileDontExists", "The file was not found on the server." #i know its deprecated, who cares^^ status.type = "waiting" |