1212
1313
1414BWSCAN_VERSION = '0.0.1'
15+ BASEURL = 'https://bwauth.torproject.org/bwauth.torproject.org'
1516
1617
1718class ScanInstance (object ):
@@ -65,6 +66,10 @@ def cli(ctx, data_dir, loglevel, logfile, launch_tor, circuit_build_timeout):
6566
6667
6768@cli .command (short_help = "Measure the Tor relays." )
69+ # FIXME: when having a configuration file the default will be given by it.
70+ @click .option ('--baseurl' ,
71+ help = 'URL that provides the files to perform the measurements with' ,
72+ default = BASEURL )
6873@click .option ('--partitions' , '-p' , default = 1 ,
6974 help = 'Divide the set of relays into subsets. 1 by default.' )
7075@click .option ('--current-partition' , '-c' , default = 1 ,
@@ -75,7 +80,7 @@ def cli(ctx, data_dir, loglevel, logfile, launch_tor, circuit_build_timeout):
7580 help = 'Limit the number of simultaneous bandwidth measurements '
7681 '(default: %d).' % 10 )
7782@pass_scan
78- def scan (scan , partitions , current_partition , timeout , request_limit ):
83+ def scan (scan , baseurl , partitions , current_partition , timeout , request_limit ):
7984 """
8085 Start a scan through each Tor relay to measure it's bandwidth.
8186 """
@@ -91,7 +96,7 @@ def rename_finished_scan(deferred):
9196 click .echo (deferred )
9297 os .rename (scan_data_dir , os .path .join (scan .measurement_dir , scan_time ))
9398
94- scan .tor_state .addCallback (BwScan , reactor , scan_data_dir ,
99+ scan .tor_state .addCallback (BwScan , reactor , scan_data_dir , baseurl ,
95100 request_timeout = timeout ,
96101 request_limit = request_limit ,
97102 partitions = partitions ,
0 commit comments