99from bwscanner .logger import setup_logging , log
1010from bwscanner .measurement import BwScan
1111from bwscanner .aggregate import write_aggregate_data
12- from bwscanner .config import TOR_OPTIONS
12+ from bwscanner .config import TOR_OPTIONS , DEFAULT , BW_FILES
1313from bwscanner import __version__
1414
1515
@@ -75,13 +75,15 @@ def cli(ctx, data_dir, loglevel, logfile, launch_tor, circuit_build_timeout):
7575@click .option ('--request-limit' , default = 10 ,
7676 help = 'Limit the number of simultaneous bandwidth measurements '
7777 '(default: %d).' % 10 )
78+ @click .option ('--baseurl' , default = DEFAULT .get ('baseurl' ),
79+ help = 'File server URL' )
7880@pass_scan
79- def scan (scan , partitions , current_partition , timeout , request_limit ):
81+ def scan (scan , partitions , current_partition , timeout , request_limit , baseurl ):
8082 """
8183 Start a scan through each Tor relay to measure it's bandwidth.
8284 """
8385 log .info ("Using {data_dir} as the data directory." , data_dir = scan .data_dir )
84-
86+ assert isinstance ( BW_FILES , dict )
8587 # XXX: check that each run is producing the same input set!
8688 scan_time = str (int (time .time ()))
8789 scan_data_dir = os .path .join (scan .measurement_dir , '{}.running' .format (scan_time ))
@@ -93,6 +95,8 @@ def rename_finished_scan(deferred):
9395 os .rename (scan_data_dir , os .path .join (scan .measurement_dir , scan_time ))
9496
9597 scan .tor_state .addCallback (BwScan , reactor , scan_data_dir ,
98+ baseurl = baseurl ,
99+ bw_files = BW_FILES ,
96100 request_timeout = timeout ,
97101 request_limit = request_limit ,
98102 partitions = partitions ,
0 commit comments