summaryrefslogtreecommitdiffstats
path: root/module/network/HTTPChunk.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-12-23 11:28:03 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2010-12-23 11:28:03 +0100
commita4ba4ba12aff34c967f958576db40806656c3de8 (patch)
tree57a26d6559279fa4ed9c28fadfa31f4d36a7eceb /module/network/HTTPChunk.py
parentnew download backend integrated so far, downloading works, but still big todo... (diff)
downloadpyload-a4ba4ba12aff34c967f958576db40806656c3de8.tar.xz
fixed eta and progress, ready for first test
Diffstat (limited to 'module/network/HTTPChunk.py')
-rw-r--r--module/network/HTTPChunk.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py
index f26e681b6..48ebc13f3 100644
--- a/module/network/HTTPChunk.py
+++ b/module/network/HTTPChunk.py
@@ -92,6 +92,10 @@ class HTTPChunk(HTTPBase):
self.speed = self.speedCalcLen
self.speedCalcTime = inttime()
self.speedCalcLen = 0
+ try:
+ self.deferred.progress("percent", 100-int((self.size - self.arrived)/float(self.size)*100))
+ except:
+ pass
size = len(data)
self.arrived += size