r154 - in /debtorrent/trunk: DebTorrent/BT1/AptListener.py DebTorrent/HTTPCache.py test.py

camrdale-guest at users.alioth.debian.org camrdale-guest at users.alioth.debian.org
Fri Jul 13 18:39:21 UTC 2007


Author: camrdale-guest
Date: Fri Jul 13 18:39:21 2007
New Revision: 154

URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=154
Log:
Modify the caching to use the download_dir option.

Modified:
    debtorrent/trunk/DebTorrent/BT1/AptListener.py
    debtorrent/trunk/DebTorrent/HTTPCache.py
    debtorrent/trunk/test.py

Modified: debtorrent/trunk/DebTorrent/BT1/AptListener.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/BT1/AptListener.py?rev=154&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/BT1/AptListener.py (original)
+++ debtorrent/trunk/DebTorrent/BT1/AptListener.py Fri Jul 13 18:39:21 2007
@@ -196,7 +196,10 @@
         
         self.uq_broken = unquote('+') != ' '
         self.Filter = Filter(rawserver.add_task)
-        self.Cache = HTTPCache(rawserver, self.handler.configdir.home_dir)
+        if config['download_dir']:
+            self.Cache = HTTPCache(rawserver, config['download_dir'])
+        else:
+            self.Cache = HTTPCache(rawserver, self.handler.configdir.home_dir)
         self.cache_waiting = {}
         
         self.request_queue = {}

Modified: debtorrent/trunk/DebTorrent/HTTPCache.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/HTTPCache.py?rev=154&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/HTTPCache.py (original)
+++ debtorrent/trunk/DebTorrent/HTTPCache.py Fri Jul 13 18:39:21 2007
@@ -293,7 +293,7 @@
             return None
         
         # Build the file name
-        file = path[0]
+        file = join(self.cachedir, path[0])
         for i in path[1:]:
             file = join(file, i)
 

Modified: debtorrent/trunk/test.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/test.py?rev=154&op=diff
==============================================================================
--- debtorrent/trunk/test.py (original)
+++ debtorrent/trunk/test.py Fri Jul 13 18:39:21 2007
@@ -464,6 +464,7 @@
     resetPeerIDs()
 
     pid = start(btlaunchmany.run, ['--cache_dir', downloader_dir,
+                                   '--download_dir', downloader_dir,
                                    '--port', str(num_down) + '988', 
                                    '--max_upload_rate', '100',
                                    '--minport', '1' + str(num_down) + '000', 




More information about the Debtorrent-commits mailing list