This repository was archived by the owner on Mar 2, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- include README LICENSE requirements.txt
1+ include README.rst requirements.txt bwscanner/data/config.ini
Original file line number Diff line number Diff line change 11import os .path
2- from shutil import copyfile
32from ConfigParser import SafeConfigParser
3+ from pkg_resources import resource_string
44
55from bwscanner .logger import log
66
@@ -21,8 +21,12 @@ def config_exists(cfg_path):
2121
2222
2323def copy_config (cfg_path , cfg_default_path = None ):
24+ # FIXME: obtain the path instead of the content
2425 if cfg_default_path is None :
25- cfg_default_path = os .path .join (os .path .dirname (os .path .dirname (
26- os .path .abspath (__file__ ))), 'data' , 'config.ini' )
26+ content = resource_string (__name__ , 'data/config.ini' )
27+ else :
28+ with open (cfg_default_path ) as fp :
29+ content = cfg_default_path .read ()
2730 log .debug ("cfg_default_path %s" % cfg_default_path )
28- copyfile (cfg_default_path , cfg_path )
31+ with open (cfg_path , 'w' ) as fp :
32+ fp .write (content )
Original file line number Diff line number Diff line change 1+ [default]
2+
3+ data_dir = ~/.config/bwscanner
4+ measurement_dir = ~/.config/bwscanner/measurements
5+ tor_dir = ~/.config/bwscanner/tordata
6+ loglevel = info
7+ logfile = bwscanner.log
8+ baseurl = https://siv.sunet.se/bwauth/
9+ launch_tor = True
10+ circuit_build_timeout = 20
11+ partitions = 1
12+ current_partition = 1
13+ timeout = 120
14+ request_limit = 10
15+ int_keys = partitions current_partition timeout request_limit
16+ bool_keys = launch_tor
17+
18+ [bw_files]
19+
20+ 64M = 6258de4f4d602be75a3458117b29d2c580c4bcb7ba5b9d2c4135c7603109f554
21+ 32M = 5a5d66d7865f09498d776f20c9e9791b055a4fff357185f84fb4ecfca7da93f0
22+ 16M = 6258de4f4d602be75a3458117b29d2c580c4bcb7ba5b9d2c4135c7603109f554
23+ 8M = 738c5604295b9377f7636ce0c2c116f093bb50372f589a6c2332a3bb6bba096a
24+ 4M = 4daaa42377d3c87577797d44a8fa569038e7a9d6a5d417a09d8ba41a69456164
25+ 2M = 3e39b0bb92912cf1ad6c01fb7c9d592e814a691c61de1f649416f6bba2d15082
Load diff This file was deleted.
Original file line number Diff line number Diff line change 2222 url = __url__ ,
2323 license = __license__ ,
2424 packages = find_packages (),
25- # data_files = [('path', ['filename'])]
26- data_files = [],
25+ include_package_data = True ,
2726 entry_points = {
2827 "console_scripts" : [
2928 'bwscan = bwscanner.scanner:cli' ,
You can’t perform that action at this time.
0 commit comments