diff options
author | sebnapi <devnull@localhost> | 2009-05-10 20:41:41 +0200 |
---|---|---|
committer | sebnapi <devnull@localhost> | 2009-05-10 20:41:41 +0200 |
commit | a78e7b73331f34875b51ec145553d7434f286cec (patch) | |
tree | 8b36f68d55948ae213e17176613060a7bfa966d2 /download_thread.py | |
parent | Approach for Plugindesign (diff) | |
download | pyload-a78e7b73331f34875b51ec145553d7434f286cec.tar.xz |
new plugin-sys
Diffstat (limited to 'download_thread.py')
-rw-r--r-- | download_thread.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/download_thread.py b/download_thread.py index ee4d4deca..7808d22f1 100644 --- a/download_thread.py +++ b/download_thread.py @@ -26,8 +26,8 @@ import urllib class Status(object): """ Saves all status information """ - def __init__(self, id, status_queue): - self.status_queue = status_queue + def __init__(self, id): + self.status_queue = None self.id = id self.total_kb = 0 self.downloaded_kb = 0 @@ -37,6 +37,8 @@ class Status(object): self.url = None def __call__(self, blocks_read, block_size, total_size): + if self.status_queue == None: + return False self.start = time() self.last_status = time() self.total_kb = total_size / 1024 @@ -49,6 +51,9 @@ class Status(object): if self.last_status+0.2 < time(): self.status_queue.put(copy(self)) self.last_status = time() + + def set_status_queue(self, queue): + self.status_queue = queue class Download_Thread(threading.Thread): |