r153 - in /debtorrent/trunk: DebTorrent/BT1/AptListener.py DebTorrent/HTTPCache.py DebTorrent/download_bt1.py DebTorrent/launchmanycore.py config.debtorrent.ini
camrdale-guest at users.alioth.debian.org
camrdale-guest at users.alioth.debian.org
Fri Jul 13 00:07:17 UTC 2007
Author: camrdale-guest
Date: Fri Jul 13 00:07:17 2007
New Revision: 153
URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=153
Log:
Rename the saveas option to download_dir.
Modified:
debtorrent/trunk/DebTorrent/BT1/AptListener.py
debtorrent/trunk/DebTorrent/HTTPCache.py
debtorrent/trunk/DebTorrent/download_bt1.py
debtorrent/trunk/DebTorrent/launchmanycore.py
debtorrent/trunk/config.debtorrent.ini
Modified: debtorrent/trunk/DebTorrent/BT1/AptListener.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/BT1/AptListener.py?rev=153&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/BT1/AptListener.py (original)
+++ debtorrent/trunk/DebTorrent/BT1/AptListener.py Fri Jul 13 00:07:17 2007
@@ -196,7 +196,7 @@
self.uq_broken = unquote('+') != ' '
self.Filter = Filter(rawserver.add_task)
- self.Cache = HTTPCache(rawserver)
+ 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=153&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/HTTPCache.py (original)
+++ debtorrent/trunk/DebTorrent/HTTPCache.py Fri Jul 13 00:07:17 2007
@@ -141,19 +141,24 @@
@ivar rawserver: the server
@type downloads: C{list} of L{CacheRequest}
@ivar downloads: the list of all current downloads for the cache
+ @type cachedir: C{string}
+ @ivar cachedir: the directory to save cache files in
"""
- def __init__(self, rawserver):
+ def __init__(self, rawserver, cachedir):
"""Initialize the instance.
@type rawserver: L{Debtorrent.RawServer.RawServer}
@param rawserver: the server
+ @type cachedir: C{string}
+ @param cachedir: the directory to save cache files in
"""
self.rawserver = rawserver
self.downloads = []
+ self.cachedir = cachedir
def download_get(self, path, func):
"""Create a new download from a site.
Modified: debtorrent/trunk/DebTorrent/download_bt1.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/download_bt1.py?rev=153&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/download_bt1.py (original)
+++ debtorrent/trunk/DebTorrent/download_bt1.py Fri Jul 13 00:07:17 2007
@@ -97,8 +97,8 @@
('priority', '',
'a list of file priorities separated by commas, must be one per file, ' +
'0 = highest, 1 = normal, 2 = lowest, -1 = download disabled'),
- ('saveas', '',
- 'local file name to save the file as, null indicates query user'),
+ ('download_dir', '',
+ 'directory to save the download in, blank indicates use the user\'s home directory'),
('timeout', 300.0,
'time to wait between closing sockets which nothing has been received on'),
('timeout_check_interval', 60.0,
@@ -782,7 +782,7 @@
if self.info.has_key('length'):
file_length = self.info['length']
file = filefunc(self.response['name'], file_length,
- self.config['saveas'], False)
+ self.config['download_dir'], False)
if file is None:
return None
make(file)
@@ -792,7 +792,7 @@
for x in self.info['files']:
file_length += x['length']
file = filefunc(self.response['name'], file_length,
- self.config['saveas'], True)
+ self.config['download_dir'], True)
if file is None:
return None
Modified: debtorrent/trunk/DebTorrent/launchmanycore.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/launchmanycore.py?rev=153&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/launchmanycore.py (original)
+++ debtorrent/trunk/DebTorrent/launchmanycore.py Fri Jul 13 00:07:17 2007
@@ -576,12 +576,12 @@
if saveas:
saveas = os.path.join(saveas, name)
else:
- saveas = name
+ saveas = os.path.join(self.configdir.home_dir, name)
else:
if saveas:
saveas = os.path.join(saveas, x['mirror'])
else:
- saveas = x['mirror']
+ saveas = os.path.join(self.configdir.home_dir, x['mirror'])
if isdir:
if not os.path.exists(saveas):
Modified: debtorrent/trunk/config.debtorrent.ini
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/config.debtorrent.ini?rev=153&op=diff
==============================================================================
--- debtorrent/trunk/config.debtorrent.ini (original)
+++ debtorrent/trunk/config.debtorrent.ini Fri Jul 13 00:07:17 2007
@@ -21,13 +21,13 @@
# L O C A T I O N S
###############################################################################
#
-# SaveAs
+# Download Directory
#
# The directory to save the downloaded files in. If left blank then the user's
# home directory will be used.
#
-# saveas = "/var/cache/debtorrent"
+# download_dir = "/var/cache/debtorrent"
#
# SaveAs Style
More information about the Debtorrent-commits
mailing list