Example #1
0
def _opt_stream_to_dict(s):
    d = {}

    for (name, val) in opt_stream_utils.opt_stream_to_dict(s).items():
        d[orig_to_lib_opt_rep(name)] = orig_to_lib_opt_rep(val)

    return d
Example #2
0
def _opt_stream_to_dict(s):
	d = {}
	
	for (name, val) in opt_stream_utils.opt_stream_to_dict(s).items():
		d[orig_to_lib_opt_rep(name)] = orig_to_lib_opt_rep(val)	
		
	return d
Example #3
0
def read_config_dict():
	"""
	Reads the configuration dictionary from a predefined file (defined in consts.py).
	"""
	log_utils.debug('reading config dict')

	data_dir = gen_utils.data_dir()	

	d = _default_config_dict()

	f_name = os.path.join(data_dir, consts.config_f_name)

	try:
		f = open(f_name, 'r')
		d = opt_stream_utils.opt_stream_to_dict(f)					
		f.close()
	except Exception, inst:		
		log_utils.warn(str(inst))
		log_utils.warn('couldn\'t read config dict from %s' % f_name)