1 # config.py - configuration settings and global variables for Arvados clients
3 # Arvados configuration settings are taken from $HOME/.config/arvados.
4 # Environment variables override settings in the config file.
10 default_config_file = os.environ['HOME'] + '/.config/arvados/settings.conf'
12 EMPTY_BLOCK_LOCATOR = 'd41d8cd98f00b204e9800998ecf8427e+0'
14 def initialize(config_file=default_config_file):
17 if os.path.exists(config_file):
18 with open(config_file, "r") as f:
20 if re.match('^\s*#', config_line):
22 var, val = config_line.rstrip().split('=', 2)
24 for var in os.environ:
25 if var.startswith('ARVADOS_'):
26 _settings[var] = os.environ[var]
28 def flag_is_true(key):
29 return get(key, '').lower() in set(['1', 't', 'true', 'y', 'yes'])
31 def get(key, default_val=None):
32 return settings().get(key, default_val)