diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-26 15:47:08 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-26 15:47:08 +0200 |
commit | f7b955fa6ddb427d5c96120114cb7a333f8b2fa1 (patch) | |
tree | 5f74b0d3886b8ac24fabf22a2161d08a553b5200 | |
parent | introduced logger (diff) | |
download | pyload-f7b955fa6ddb427d5c96120114cb7a333f8b2fa1.tar.xz |
little request fix
-rw-r--r-- | Core.py | 1 | ||||
-rw-r--r-- | Logs/faild.txt | 29 | ||||
-rwxr-xr-x | module/network/Request.py | 5 |
3 files changed, 3 insertions, 32 deletions
@@ -26,7 +26,6 @@ from string import find, split from os import sep, chdir, mkdir, curdir, name, system, remove from os.path import exists, abspath, dirname, basename from sys import path, exit, stdout -from logging import warning, basicConfig import urllib2 import re from time import sleep, time diff --git a/Logs/faild.txt b/Logs/faild.txt deleted file mode 100644 index d77ca4862..000000000 --- a/Logs/faild.txt +++ /dev/null @@ -1,29 +0,0 @@ -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -testest -geloggt -geloggt diff --git a/module/network/Request.py b/module/network/Request.py index 510f6d069..1b94ed13f 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -105,17 +105,18 @@ class Request: file.write(chunk) file.close() self.dl = False + self.dl_finished = time.time() return True def get_speed(self): try: - return (self.dl_arrived / (time.time() - self.dl_time)) / 1024 + return (self.dl_arrived / ((time.time() if self.dl else self.dl_finished) - self.dl_time )) / 1024 except: return "No Download" def get_ETA(self): try: - return (self.dl_size - self.dl_arrived) / (self.dl_arrived / (time.time() - self.dl_time if self.dl else self.dl_finished)) + return (self.dl_size - self.dl_arrived) / (self.dl_arrived / (time.time() - self.dl_time)) except: return "No Download" |