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 /module/network | |
parent | introduced logger (diff) | |
download | pyload-f7b955fa6ddb427d5c96120114cb7a333f8b2fa1.tar.xz |
little request fix
Diffstat (limited to 'module/network')
-rwxr-xr-x | module/network/Request.py | 5 |
1 files changed, 3 insertions, 2 deletions
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" |