summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-05-26 15:47:08 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-05-26 15:47:08 +0200
commitf7b955fa6ddb427d5c96120114cb7a333f8b2fa1 (patch)
tree5f74b0d3886b8ac24fabf22a2161d08a553b5200
parentintroduced logger (diff)
downloadpyload-f7b955fa6ddb427d5c96120114cb7a333f8b2fa1.tar.xz
little request fix
-rw-r--r--Core.py1
-rw-r--r--Logs/faild.txt29
-rwxr-xr-xmodule/network/Request.py5
3 files changed, 3 insertions, 32 deletions
diff --git a/Core.py b/Core.py
index fd1ae9de2..43ebc79fd 100644
--- a/Core.py
+++ b/Core.py
@@ -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"