r277 - in branches/rewrite: . src

Otavio Salvador partial-mirror-devel@lists.alioth.debian.org
Tue, 09 Nov 2004 18:21:22 -0700


Author: otavio
Date: Tue Nov  9 18:21:20 2004
New Revision: 277

Modified:
   branches/rewrite/   (props changed)
   branches/rewrite/src/Download.py
Log:
 r194@nurf:  otavio | 2004-11-10T01:20:25.613917Z
 Free the counter when finish the download.


Modified: branches/rewrite/src/Download.py
==============================================================================
--- branches/rewrite/src/Download.py	(original)
+++ branches/rewrite/src/Download.py	Tue Nov  9 18:21:20 2004
@@ -87,6 +87,12 @@
             curl.close()
             f.close()
 
+            # Store counter information about it
+            self._Lock.acquire()
+            DownloadQueue.counter -= 1
+            self._counter = DownloadQueue.counter
+            self._Lock.release()
+
     def progress(self, download_t, download_d, upload_t, upload_d):
         self.ProgressBar.max = download_t
         self.ProgressBar.current = download_d
@@ -98,7 +104,7 @@
     """ Fetcher to use """
     fetchers = []
 
-    def __init__(self, uri, destine, max_threads=1):
+    def __init__(self, uri, destine, max_threads=2):
         self.queue.put((uri, destine))
 
         # Alloc all needed threads.