fdutils/config/__init__.py
def parse_config(default_config_path=None, environment_var=None, environment_settings_config=False,
                 load_test_envi_key_as_environment=True):
    """ loads yaml config file and return dictionary with parameters parsed.
        If config data has a key called "run_envi" and load_test_envi_key_as_environment is True
        then we will also update run_envi global environment_settings data

    Args:
        environment_var (str): environment variable name to use as path to config file to substitute default. This
                               takes precedence over default_config_path
        default_config_path (str): filepath of default settings file. it should be located on same folder as
                                        module __file__ calling this function
        environment_settings_config (bool): flag to indicate that this data is to set the default run_envi configuration
        load_test_envi_key_as_environment (bool): flag to indicate that if run_envi is found set it as global environment
                                                  variable environment_settings

    Returns:
        dict

    """
    if not environment_var and not default_config_path:
        return

    if environment_var and os.environ.get(environment_var, None):
        test_envi_settings_path = os.environ.get(environment_var)
        found = 'environment variable {} with value'.format(environment_var)

    elif default_config_path:
        test_envi_settings_path = default_config_path
        found = 'file path '

    else:
        return

    found += test_envi_settings_path

    _, ext = os.path.splitext(test_envi_settings_path)
    loader = _get_settings_loaded_and_check_settings_exists(ext, found, test_envi_settings_path)

    with open(test_envi_settings_path) as f:
        new_environment_settings = loader(f)
        variables = _resolve_variables(new_environment_settings.pop('vars', {}))
        _replace_variables_in_settings(new_environment_settings, variables)

    new_environment_settings.pop('vars', None)

    global environment_settings

    if environment_settings_config:
        environment_settings.update(new_environment_settings)
        ret = environment_settings
    else:
        if 'run_envi' in new_environment_settings and load_test_envi_key_as_environment:
            environment_settings.update(new_environment_settings.pop('run_envi'))
        ret = new_environment_settings

    for section, values in registered_settings.items():
        update_settings_with_user_settings(values['local_vars'], section, paths_vars=values['paths_vars'])
        if values['after_update']:
            values['after_update']()

    return ret
 loads yaml config file and return dictionary with parameters parsed.
        If config data has a key called "run_envi" and load_test_envi_key_as_environment is True
        then we will also update run_envi global environment_settings data

    Args:
        environment_var (str): environment variable name to use as path to config file to substitute default. This
                               takes precedence over default_config_path
        default_config_path (str): filepath of default settings file. it should be located on same folder as
                                        module __file__ calling this function
        environment_settings_config (bool): flag to indicate that this data is to set the default run_envi configuration
        load_test_envi_key_as_environment (bool): flag to indicate that if run_envi is found set it as global environment
                                                  variable environment_settings

    Returns:
        dict

    
loads yaml config file and return dictionary with parameters parsed.
If config data has a key called "run_envi" and load_test_envi_key_as_environment is True
then we will also update run_envi global environment_settings data
loads yaml config file and return dictionary with parameters parsed . If config data has a key called " run_envi " and load_test_envi_key_as_environment is True then we will also update run_envi global environment_settings data
def parse_config(default_config_path=None, environment_var=None, environment_settings_config=False,
                 load_test_envi_key_as_environment=True):
    if not environment_var and not default_config_path:
        return
    if environment_var and os.environ.get(environment_var, None):
        test_envi_settings_path = os.environ.get(environment_var)
        found = 'environment variable {} with value'.format(environment_var)
    elif default_config_path:
        test_envi_settings_path = default_config_path
        found = 'file path '
    else:
        return
    found += test_envi_settings_path
    _, ext = os.path.splitext(test_envi_settings_path)
    loader = _get_settings_loaded_and_check_settings_exists(ext, found, test_envi_settings_path)
    with open(test_envi_settings_path) as f:
        new_environment_settings = loader(f)
        variables = _resolve_variables(new_environment_settings.pop('vars', {}))
        _replace_variables_in_settings(new_environment_settings, variables)
    new_environment_settings.pop('vars', None)
    global environment_settings
    if environment_settings_config:
        environment_settings.update(new_environment_settings)
        ret = environment_settings
    else:
        if 'run_envi' in new_environment_settings and load_test_envi_key_as_environment:
            environment_settings.update(new_environment_settings.pop('run_envi'))
        ret = new_environment_settings
    for section, values in registered_settings.items():
        update_settings_with_user_settings(values['local_vars'], section, paths_vars=values['paths_vars'])
        if values['after_update']:
            values['after_update']()
    return ret
def parse_config ( default_config_path = None , environment_var = None , environment_settings_config = False , load_test_envi_key_as_environment = True ) : if not environment_var and not default_config_path : return if environment_var and os . environ . get ( environment_var , None ) : test_envi_settings_path = os . environ . get ( environment_var ) found = 'environment variable {} with value' . format ( environment_var ) elif default_config_path : test_envi_settings_path = default_config_path found = 'file path ' else : return found += test_envi_settings_path _ , ext = os . path . splitext ( test_envi_settings_path ) loader = _get_settings_loaded_and_check_settings_exists ( ext , found , test_envi_settings_path ) with open ( test_envi_settings_path ) as f : new_environment_settings = loader ( f ) variables = _resolve_variables ( new_environment_settings . pop ( 'vars' , { } ) ) _replace_variables_in_settings ( new_environment_settings , variables ) new_environment_settings . pop ( 'vars' , None ) global environment_settings if environment_settings_config : environment_settings . update ( new_environment_settings ) ret = environment_settings else : if 'run_envi' in new_environment_settings and load_test_envi_key_as_environment : environment_settings . update ( new_environment_settings . pop ( 'run_envi' ) ) ret = new_environment_settings for section , values in registered_settings . items ( ) : update_settings_with_user_settings ( values [ 'local_vars' ] , section , paths_vars = values [ 'paths_vars' ] ) if values [ 'after_update' ] : values [ 'after_update' ] ( ) return ret
loads yaml config file and return dictionary with parameters parsed.
loads yaml config file and return dictionary with parameters parsed .
""" loads yaml config file and return dictionary with parameters parsed.
        If config data has a key called "run_envi" and load_test_envi_key_as_environment is True
        then we will also update run_envi global environment_settings data

    Args:
        environment_var (str): environment variable name to use as path to config file to substitute default. This
                               takes precedence over default_config_path
        default_config_path (str): filepath of default settings file. it should be located on same folder as
                                        module __file__ calling this function
        environment_settings_config (bool): flag to indicate that this data is to set the default run_envi configuration
        load_test_envi_key_as_environment (bool): flag to indicate that if run_envi is found set it as global environment
                                                  variable environment_settings

    Returns:
        dict

    """
None
default_config_path
filepath of default settings file. it should be located on same folder as
module __file__ calling this function
filepath of default settings file . it should be located on same folder as module __file__ calling this function
environment_var
environment variable name to use as path to config file to substitute default. This
takes precedence over default_config_path
environment variable name to use as path to config file to substitute default . This takes precedence over default_config_path
environment_settings_config
flag to indicate that this data is to set the default run_envi configuration
flag to indicate that this data is to set the default run_envi configuration
load_test_envi_key_as_environment
flag to indicate that if run_envi is found set it as global environment
variable environment_settings
flag to indicate that if run_envi is found set it as global environment variable environment_settings