summaryrefslogtreecommitdiffstats
path: root/pyload/network
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/network')
-rw-r--r--pyload/network/Bucket.py5
-rw-r--r--pyload/network/HTTPDownload.py8
2 files changed, 6 insertions, 7 deletions
diff --git a/pyload/network/Bucket.py b/pyload/network/Bucket.py
index 33aa7c42e..408a1e240 100644
--- a/pyload/network/Bucket.py
+++ b/pyload/network/Bucket.py
@@ -2,10 +2,9 @@
# @author: RaNaN
from time import time
+from threading import Lock
-
-# 10kb minimum rate
-MIN_RATE = 10240
+MIN_RATE = 10240 #: 10kb minimum rate
class Bucket(object):
diff --git a/pyload/network/HTTPDownload.py b/pyload/network/HTTPDownload.py
index 270e81795..65c893ad7 100644
--- a/pyload/network/HTTPDownload.py
+++ b/pyload/network/HTTPDownload.py
@@ -19,7 +19,7 @@ class HTTPDownload(object):
""" loads a url http + ftp """
def __init__(self, url, filename, get={}, post={}, referer=None, cj=None, bucket=None,
- options={}, progressNotify=None, disposition=False):
+ options={}, progress=None, disposition=False):
self.url = url
self.filename = filename #complete file destination, not only name
self.get = get
@@ -55,7 +55,7 @@ class HTTPDownload(object):
self.speeds = []
self.lastSpeeds = [0, 0]
- self.progressNotify = progressNotify
+ self.progress = progress
@property
def speed(self):
@@ -280,8 +280,8 @@ class HTTPDownload(object):
self._copyChunks()
def updateProgress(self):
- if self.progressNotify:
- self.progressNotify(self.percent)
+ if self.progress:
+ self.progress(self.percent)
def findChunk(self, handle):
""" linear search to find a chunk (should be ok since chunk size is usually low) """