11'''Parses configuration file and sets project wide constants.
2-
32This file has intrinsic naming difficulties because it is trying to be platform
43agnostic but naming variables is inherently platform specific (i.e directory vs
54folder)
65'''
76__author__ = 'foxcarlos-TeamCreed' , 'Tobin Harding'
87
98import os
9+ from random import shuffle
1010from platform import platform
1111from os .path import expanduser , join , isfile
1212from ConfigParser import ConfigParser
@@ -53,12 +53,10 @@ def str_to_bool(s):
5353def _platform_agnostic_data_path (data_folder ):
5454 '''
5555 Create absolute path name, exported as DATA_FOLDER.
56-
5756 User may configure using relative path, absolute path or use default.
5857 Relative path puts named folder in users home directory.
5958 Absolute path uses (obviously) the named absolute path.
6059 Default is currently to use 'OpenBazaar' in home directory.
61-
6260 See issue #163
6361 '''
6462 if data_folder :
@@ -115,7 +113,6 @@ def _is_osx():
115113def _is_well_formed_seed_string (string ):
116114 '''
117115 Parse string url:port,key
118-
119116 '''
120117 if ',' in string :
121118 url , key = string .split (',' )
@@ -198,6 +195,7 @@ def _tuple_from_string(string):
198195 LIBBITCOIN_SERVERS .append (new_server )
199196 else :
200197 print 'Warning: please check your configuration file: %s' % server
198+ shuffle (LIBBITCOIN_SERVERS )
201199
202200items = cfg .items ('LIBBITCOIN_SERVERS_TESTNET' ) # this also includes items in DEFAULTS
203201for item in items :
@@ -211,6 +209,7 @@ def _tuple_from_string(string):
211209 LIBBITCOIN_SERVERS_TESTNET .append (new_server )
212210 else :
213211 print 'Warning: please check your configuration file: %s' % server
212+ shuffle (LIBBITCOIN_SERVERS_TESTNET )
214213
215214
216215def set_value (section , name , value ):
0 commit comments