summaryrefslogtreecommitdiffstats
path: root/module/network
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-24 15:41:13 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-24 15:41:13 +0200
commitfb145cf68c0178b9551eaae3213ec01be112bf76 (patch)
tree61d8dd381a831da4c34359b5e471e11d687f4746 /module/network
parentadded some animations, code for show/hiding items (diff)
downloadpyload-fb145cf68c0178b9551eaae3213ec01be112bf76.tar.xz
fixed some things, so downloads works again
Diffstat (limited to 'module/network')
-rw-r--r--module/network/Browser.py4
-rw-r--r--module/network/HTTPDownload.py9
2 files changed, 3 insertions, 10 deletions
diff --git a/module/network/Browser.py b/module/network/Browser.py
index 9cf6c2f30..25cbf669b 100644
--- a/module/network/Browser.py
+++ b/module/network/Browser.py
@@ -87,11 +87,11 @@ class Browser(object):
self.dl.abort = True
def httpDownload(self, url, filename, get={}, post={}, ref=True, cookies=True, chunks=1, resume=False,
- progressNotify=None, disposition=False):
+ disposition=False):
""" this can also download ftp """
self._size = 0
self.dl = HTTPDownload(url, filename, get, post, self.lastEffectiveURL if ref else None,
- self.cj if cookies else None, self.bucket, self.options, progressNotify, disposition)
+ self.cj if cookies else None, self.bucket, self.options, disposition)
name = self.dl.download(chunks, resume)
self._size = self.dl.size
diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py
index c6d2e1547..5a4436529 100644
--- a/module/network/HTTPDownload.py
+++ b/module/network/HTTPDownload.py
@@ -37,7 +37,7 @@ class HTTPDownload():
""" loads an url, http + ftp supported """
def __init__(self, url, filename, get={}, post={}, referer=None, cj=None, bucket=None,
- options={}, progressNotify=None, disposition=False):
+ options={}, disposition=False):
self.url = url
self.filename = filename #complete file destination, not only name
self.get = get
@@ -73,8 +73,6 @@ class HTTPDownload():
self.speeds = []
self.lastSpeeds = [0, 0]
- self.progressNotify = progressNotify
-
@property
def speed(self):
last = [sum(x) for x in self.lastSpeeds if x]
@@ -286,7 +284,6 @@ class HTTPDownload():
self.speeds = [float(a) / (t - lastTimeCheck) for a in diff]
self.lastArrived = [c.arrived for c in self.chunks]
lastTimeCheck = t
- self.updateProgress()
if self.abort:
raise Abort()
@@ -299,10 +296,6 @@ class HTTPDownload():
self._copyChunks()
- def updateProgress(self):
- if self.progressNotify:
- self.progressNotify(self.percent)
-
def findChunk(self, handle):
""" linear search to find a chunk (should be ok since chunk size is usually low) """
for chunk in self.chunks: