1212
1313
1414BWSCAN_VERSION = '0.0.1'
15-
15+ BASEURL = 'https://bwauth.torproject.org/bwauth.torproject.org'
1616
1717class ScanInstance (object ):
1818 """
@@ -65,6 +65,10 @@ def cli(ctx, data_dir, loglevel, logfile, launch_tor, circuit_build_timeout):
6565
6666
6767@cli .command (short_help = "Measure the Tor relays." )
68+ # FIXME: when having a configuration file the default will be given by it.
69+ @click .option ('--baseurl' ,
70+ help = 'URL that provides the files to perform the measurements with' ,
71+ default = BASEURL )
6872@click .option ('--partitions' , '-p' , default = 1 ,
6973 help = 'Divide the set of relays into subsets. 1 by default.' )
7074@click .option ('--current-partition' , '-c' , default = 1 ,
@@ -75,7 +79,7 @@ def cli(ctx, data_dir, loglevel, logfile, launch_tor, circuit_build_timeout):
7579 help = 'Limit the number of simultaneous bandwidth measurements '
7680 '(default: %d).' % 10 )
7781@pass_scan
78- def scan (scan , partitions , current_partition , timeout , request_limit ):
82+ def scan (scan , baseurl , partitions , current_partition , timeout , request_limit ):
7983 """
8084 Start a scan through each Tor relay to measure it's bandwidth.
8185 """
@@ -91,7 +95,7 @@ def rename_finished_scan(deferred):
9195 click .echo (deferred )
9296 os .rename (scan_data_dir , os .path .join (scan .measurement_dir , scan_time ))
9397
94- scan .tor_state .addCallback (BwScan , reactor , scan_data_dir ,
98+ scan .tor_state .addCallback (BwScan , reactor , scan_data_dir , baseurl ,
9599 request_timeout = timeout ,
96100 request_limit = request_limit ,
97101 partitions = partitions ,
0 commit comments