fdutils/config/__init__.py
def update_settings_with_user_settings(local_vars, section, settings=None, paths_vars=()):
    """ updates run_envi default settings with environment settings given by user
        the keys are case independent to allow the settings file to be written as lower case but still set the proper
        key in the settings.py file that is calling this method

    Args:
        local_vars (dict): dictionary from locals() from file calling this method
        section (str): section to apply config values from in the yaml file.
        settings (dict): if given we would use this settings as the default ones instead of the environment settings
        paths_vars (list): list of variables that are a file/dir path and that we want to normalize to avoid issues
                           with back/forward slashes on windows/unix systems

    Returns:

    """
    settings = settings or environment_settings
    settings_section = settings.get(section, {})

    if settings_section:

        settings_section_keys_lower = [k.lower() for k in settings_section.keys()]
        local_vars_lower = {l.lower(): l for l in local_vars}

        # settings take precendence over OS environment variable
        # augment settings with OS environment variables if settings does not already include a key for that variable
        if 'ENV_TO_VARS' in local_vars and local_vars['ENV_TO_VARS']:
            env_vars_lower = {e.lower(): e for e in local_vars['ENV_TO_VARS']}
            for v in (e for e in env_vars_lower if e not in settings_section_keys_lower
                                                   and os.environ.get(local_vars['ENV_TO_VARS'])):
                settings_section[local_vars[env_vars_lower[v]]] = os.environ.get(local_vars['ENV_TO_VARS'])

        for key, value in [(k, v) for (k, v) in settings_section.items() if k.lower() in local_vars_lower]:
            key = local_vars_lower[key.lower()]
            local_vars[key] = value
            if value and paths_vars and key in paths_vars:
                local_vars[key] = os.path.normpath(value)
 updates run_envi default settings with environment settings given by user
        the keys are case independent to allow the settings file to be written as lower case but still set the proper
        key in the settings.py file that is calling this method

    Args:
        local_vars (dict): dictionary from locals() from file calling this method
        section (str): section to apply config values from in the yaml file.
        settings (dict): if given we would use this settings as the default ones instead of the environment settings
        paths_vars (list): list of variables that are a file/dir path and that we want to normalize to avoid issues
                           with back/forward slashes on windows/unix systems

    Returns:

    
updates run_envi default settings with environment settings given by user
the keys are case independent to allow the settings file to be written as lower case but still set the proper
key in the settings.py file that is calling this method
updates run_envi default settings with environment settings given by user the keys are case independent to allow the settings file to be written as lower case but still set the proper key in the settings . py file that is calling this method
def update_settings_with_user_settings(local_vars, section, settings=None, paths_vars=()):
    settings = settings or environment_settings
    settings_section = settings.get(section, {})
    if settings_section:
        settings_section_keys_lower = [k.lower() for k in settings_section.keys()]
        local_vars_lower = {l.lower(): l for l in local_vars}
        if 'ENV_TO_VARS' in local_vars and local_vars['ENV_TO_VARS']:
            env_vars_lower = {e.lower(): e for e in local_vars['ENV_TO_VARS']}
            for v in (e for e in env_vars_lower if e not in settings_section_keys_lower
                                                   and os.environ.get(local_vars['ENV_TO_VARS'])):
                settings_section[local_vars[env_vars_lower[v]]] = os.environ.get(local_vars['ENV_TO_VARS'])
        for key, value in [(k, v) for (k, v) in settings_section.items() if k.lower() in local_vars_lower]:
            key = local_vars_lower[key.lower()]
            local_vars[key] = value
            if value and paths_vars and key in paths_vars:
                local_vars[key] = os.path.normpath(value)
def update_settings_with_user_settings ( local_vars , section , settings = None , paths_vars = ( ) ) : settings = settings or environment_settings settings_section = settings . get ( section , { } ) if settings_section : settings_section_keys_lower = [ k . lower ( ) for k in settings_section . keys ( ) ] local_vars_lower = { l . lower ( ) : l for l in local_vars } if 'ENV_TO_VARS' in local_vars and local_vars [ 'ENV_TO_VARS' ] : env_vars_lower = { e . lower ( ) : e for e in local_vars [ 'ENV_TO_VARS' ] } for v in ( e for e in env_vars_lower if e not in settings_section_keys_lower and os . environ . get ( local_vars [ 'ENV_TO_VARS' ] ) ) : settings_section [ local_vars [ env_vars_lower [ v ] ] ] = os . environ . get ( local_vars [ 'ENV_TO_VARS' ] ) for key , value in [ ( k , v ) for ( k , v ) in settings_section . items ( ) if k . lower ( ) in local_vars_lower ] : key = local_vars_lower [ key . lower ( ) ] local_vars [ key ] = value if value and paths_vars and key in paths_vars : local_vars [ key ] = os . path . normpath ( value )
updates run_envi default settings with environment settings given by user
the keys are case independent to allow the settings file to be written as lower case but still set the proper
key in the settings.py file that is calling this method
updates run_envi default settings with environment settings given by user the keys are case independent to allow the settings file to be written as lower case but still set the proper key in the settings . py file that is calling this method
""" updates run_envi default settings with environment settings given by user
        the keys are case independent to allow the settings file to be written as lower case but still set the proper
        key in the settings.py file that is calling this method

    Args:
        local_vars (dict): dictionary from locals() from file calling this method
        section (str): section to apply config values from in the yaml file.
        settings (dict): if given we would use this settings as the default ones instead of the environment settings
        paths_vars (list): list of variables that are a file/dir path and that we want to normalize to avoid issues
                           with back/forward slashes on windows/unix systems

    Returns:

    """ # settings take precendence over OS environment variable # augment settings with OS environment variables if settings does not already include a key for that variable
None
local_vars
dictionary from locals() from file calling this method
dictionary from locals () from file calling this method
section
section to apply config values from in the yaml file.
section to apply config values from in the yaml file .
settings
if given we would use this settings as the default ones instead of the environment settings
if given we would use this settings as the default ones instead of the environment settings
paths_vars
list of variables that are a file/dir path and that we want to normalize to avoid issues
with back/forward slashes on windows/unix systems
list of variables that are a file / dir path and that we want to normalize to avoid issues with back / forward slashes on windows / unix systems