r161 - in /debtorrent/trunk: DebTorrent/download_bt1.py DebTorrent/launchmanycore.py btdownloadheadless.py btlaunchmany.py debtorrent.py test.py
camrdale-guest at users.alioth.debian.org
camrdale-guest at users.alioth.debian.org
Fri Jul 13 21:16:55 UTC 2007
Author: camrdale-guest
Date: Fri Jul 13 21:16:54 2007
New Revision: 161
URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=161
Log:
Rename the port option to apt_port.
Make a standardized list of options for launchmany type programs.
Remove the AptListener from btdonloadheadless as it doesn't work there.
Modified:
debtorrent/trunk/DebTorrent/download_bt1.py
debtorrent/trunk/DebTorrent/launchmanycore.py
debtorrent/trunk/btdownloadheadless.py
debtorrent/trunk/btlaunchmany.py
debtorrent/trunk/debtorrent.py
debtorrent/trunk/test.py
Modified: debtorrent/trunk/DebTorrent/download_bt1.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/download_bt1.py?rev=161&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/download_bt1.py (original)
+++ debtorrent/trunk/DebTorrent/download_bt1.py Fri Jul 13 21:16:54 2007
@@ -69,6 +69,7 @@
('download_dir', '',
'directory to save the download in, blank indicates use the user\'s ' +
'home directory'),
+ # saveas_style is in defaults_many below
('cache_dir', '', 'the directory to use to get/store cache files, if not ' +
'specified then a .DebTorrent directory in the user\'s home directory ' +
'will be used'),
@@ -115,33 +116,15 @@
('crypto_stealth', 0,
'whether to prevent all non-encrypted connection attempts; ' +
'will result in an effectively firewalled state on older trackers'),
- # APT Requests
- ('port', 9988, 'port to listen for apt on'),
- ('show_infopage', 1, 'whether to display an info page when the ' +
- 'APT requester\'s root directory is loaded'),
- ('infopage_redirect', '', 'a URL to redirect the info page to'),
- ('favicon', '',
- 'file containing x-icon data to return when browser requests favicon.ico'),
- ('allow_get', 0,
- 'adds a /file?infohash={hash} url that allows users to download the ' +
- 'dtorrent file'),
- ('logfile', '',
- 'file to write the APT request listener logs to (default is stdout)'),
- ('min_time_between_log_flushes', 3.0,
- 'minimum time it must have been since the last flush to do another one'),
- ('hupmonitor', 0,
- 'whether to reopen the log file upon receipt of HUP signal'),
- ('allowed_ips', '',
- 'only allow connections from IPs specified in the given file; '+
- 'file contains subnet data in the format: aa.bb.cc.dd/len'),
- ('banned_ips', '',
- 'don\'t allow connections from IPs specified in the given file; ' +
- 'file contains IP range data in the format: xxx:xxx:ip1-ip2'),
- ('parse_ip_files', 60,
- 'seconds between reloading of allowed_ips and banned_ips lists for apt'),
+ # APT Requests are in defaults_many below
# Backup HTTP Downloader
('disable_http_downloader', 0,
'(for testing purposes only) whether to disable the backup HTTP downloader'),
+ # Other Things
+ ('separate_all',0, 'whether to separate the architecture:all packages, ' +
+ '0 = don\'t separate, 1 = separate and run architecture:all, ' +
+ '2 = separate and run all architectures but all, ' +
+ '3 = separate and run both (not for btdownloadheadless)'),
# End of Normal Options
# BitTorrent Options
('keepalive_interval', 120.0,
@@ -219,6 +202,40 @@
('display_interval', .5,
'time between updates of displayed information'),
+ ]
+
+defaults_many = [
+ # Locations
+ ( 'saveas_style', 1,
+ "How to name torrent download directory " +
+ "(1 = <mirror>_dists_<suite>_<section>_binary-<arch>, " +
+ "2 = <mirror> (caution: experimental))" ),
+ # APT Requests
+ ('apt_port', 9988, 'port to listen for apt on'),
+ ('show_infopage', 1, 'whether to display an info page when the ' +
+ 'APT requester\'s root directory is loaded'),
+ ('infopage_redirect', '', 'a URL to redirect the info page to'),
+ ('favicon', '',
+ 'file containing x-icon data to return when browser requests favicon.ico'),
+ ('display_path', 0,
+ 'whether to display the full path or the torrent contents for each torrent'),
+ ('allow_get', 0,
+ 'adds a /file?infohash={hash} url that allows users to download the ' +
+ 'dtorrent file'),
+ ('logfile', '',
+ 'file to write the APT request listener logs to (default is stdout)'),
+ ('min_time_between_log_flushes', 3.0,
+ 'minimum time it must have been since the last flush to do another one'),
+ ('hupmonitor', 0,
+ 'whether to reopen the log file upon receipt of HUP signal'),
+ ('allowed_ips', '',
+ 'only allow connections from IPs specified in the given file; '+
+ 'file contains subnet data in the format: aa.bb.cc.dd/len'),
+ ('banned_ips', '',
+ 'don\'t allow connections from IPs specified in the given file; ' +
+ 'file contains IP range data in the format: xxx:xxx:ip1-ip2'),
+ ('parse_ip_files', 60,
+ 'seconds between reloading of allowed_ips and banned_ips lists for apt'),
]
argslistheader = 'Arguments are:\n\n'
Modified: debtorrent/trunk/DebTorrent/launchmanycore.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/launchmanycore.py?rev=161&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/launchmanycore.py (original)
+++ debtorrent/trunk/DebTorrent/launchmanycore.py Fri Jul 13 21:16:54 2007
@@ -364,11 +364,11 @@
return
self.aptlistener = AptListener(self, config, self.rawserver)
- self.rawserver.bind(config['port'], config['bind'],
+ self.rawserver.bind(config['apt_port'], config['bind'],
reuse = True, ipv6_socket_style = config['ipv6_binds_v4'])
self.rawserver.set_handler(HTTPHandler(self.aptlistener.get,
config['min_time_between_log_flushes']),
- config['port'])
+ config['apt_port'])
self.ratelimiter = RateLimiter(self.rawserver.add_task,
config['upload_unit_size'])
Modified: debtorrent/trunk/btdownloadheadless.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/btdownloadheadless.py?rev=161&op=diff
==============================================================================
--- debtorrent/trunk/btdownloadheadless.py (original)
+++ debtorrent/trunk/btdownloadheadless.py Fri Jul 13 21:16:54 2007
@@ -260,9 +260,6 @@
('save_options',0,
"whether to save the current options as the new default configuration " +
"(only for btdownloadheadless.py)"),
- ('separate_all',0, 'whether to separate the architecture:all packages, ' +
- "0 = don't separate, 1 = separate and run architecture:all, " +
- "2 = separate and run all architectures but all"),
])
defaultsToIgnore = ['configfile', 'priority', 'responsefile', 'url', 'save_options']
configdir.setDefaults(defaults,defaultsToIgnore)
@@ -299,13 +296,6 @@
h.failed()
return
- aptlistener = AptListener(config, rawserver)
- rawserver.bind(config['port'], config['bind'],
- reuse = True, ipv6_socket_style = config['ipv6_binds_v4'])
- rawserver.set_handler(HTTPHandler(aptlistener.get,
- config['min_time_between_log_flushes']),
- config['port'])
-
(response, response_all) = get_response(config['responsefile'], config['url'], h.error,
config['separate_all'], config['default_tracker'])
Modified: debtorrent/trunk/btlaunchmany.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/btlaunchmany.py?rev=161&op=diff
==============================================================================
--- debtorrent/trunk/btlaunchmany.py (original)
+++ debtorrent/trunk/btlaunchmany.py Fri Jul 13 21:16:54 2007
@@ -23,7 +23,7 @@
pass
from DebTorrent.launchmanycore import LaunchMany
-from DebTorrent.download_bt1 import defaults, get_usage
+from DebTorrent.download_bt1 import defaults, defaults_many, get_usage
from DebTorrent.parseargs import parseargs
from threading import Event
from sys import argv, exit
@@ -134,17 +134,7 @@
"""
- defaults.extend( [
- ( 'saveas_style', 1,
- "How to name torrent download directory " +
- "(1 = <mirror>_dists_<suite>_<section>_binary-<arch>, " +
- "2 = <mirror> (caution: experimental))" ),
- ( 'display_path', 0,
- "whether to display the full path or the torrent contents for each torrent" ),
- ('separate_all',0, 'whether to separate the architecture:all packages, ' +
- "0 = don't separate, 1 = separate and run architecture:all, " +
- "2 = separate and run all architectures but all, " + "3 = separate and run both"),
- ] )
+ defaults.extend(defaults_many)
configdefaults = {}
try:
configdir = ConfigDir('launchmany')
Modified: debtorrent/trunk/debtorrent.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/debtorrent.py?rev=161&op=diff
==============================================================================
--- debtorrent/trunk/debtorrent.py (original)
+++ debtorrent/trunk/debtorrent.py Fri Jul 13 21:16:54 2007
@@ -21,7 +21,7 @@
pass
from DebTorrent.launchmanycore import LaunchMany
-from DebTorrent.download_bt1 import defaults, get_usage
+from DebTorrent.download_bt1 import defaults, defaults_many, get_usage
from DebTorrent.parseargs import parseargs
from threading import Event
from sys import argv, exit
@@ -123,17 +123,7 @@
"""
- defaults.extend( [
- ( 'saveas_style', 1,
- "How to name torrent download directory " +
- "(1 = <mirror>_dists_<suite>_<section>_binary-<arch>, " +
- "2 = <mirror> (caution: experimental))" ),
- ( 'display_path', 0,
- "whether to display the full path or the torrent contents for each torrent" ),
- ('separate_all',0, 'whether to separate the architecture:all packages, ' +
- "0 = don't separate, 1 = separate and run architecture:all, " +
- "2 = separate and run all architectures but all, " + "3 = separate and run both"),
- ] )
+ defaults.extend(defaults_many)
configdefaults = {}
try:
configdir = ConfigDir('debtorrent')
Modified: debtorrent/trunk/test.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/test.py?rev=161&op=diff
==============================================================================
--- debtorrent/trunk/test.py (original)
+++ debtorrent/trunk/test.py Fri Jul 13 21:16:54 2007
@@ -465,7 +465,7 @@
pid = start(btlaunchmany.run, ['--cache_dir', downloader_dir,
'--download_dir', downloader_dir,
- '--port', str(num_down) + '988',
+ '--apt_port', str(num_down) + '988',
'--max_upload_rate', '100',
'--minport', '1' + str(num_down) + '000',
'--maxport', '1' + str(num_down) + '999'] + options,
More information about the Debtorrent-commits
mailing list