lib/ramble/ramble/config.py [1263:1307]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    return update_fn


@contextlib.contextmanager
def use_configuration(*scopes_or_paths):
    """Use the configuration scopes passed as arguments within the
    context manager.

    Args:
        *scopes_or_paths: scope objects or paths to be used

    Returns:
        Configuration object associated with the scopes passed as arguments
    """
    global config

    # Normalize input and construct a Configuration object
    configuration = _config_from(scopes_or_paths)
    config.clear_caches(), configuration.clear_caches()

    # Save and clear the current compiler cache
    saved_compiler_cache = spack.compilers._cache_config_file
    spack.compilers._cache_config_file = []

    saved_config, config = config, configuration

    try:
        yield configuration
    finally:
        # Restore previous config files
        spack.compilers._cache_config_file = saved_compiler_cache
        config = saved_config


@llnl.util.lang.memoized
def _config_from(scopes_or_paths):
    scopes = []
    for scope_or_path in scopes_or_paths:
        # If we have a config scope we are already done
        if isinstance(scope_or_path, ConfigScope):
            scopes.append(scope_or_path)
            continue

        # Otherwise we need to construct it
        path = os.path.normpath(scope_or_path)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



lib/ramble/spack/config.py [1255:1299]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    return update_fn


@contextlib.contextmanager
def use_configuration(*scopes_or_paths):
    """Use the configuration scopes passed as arguments within the
    context manager.

    Args:
        *scopes_or_paths: scope objects or paths to be used

    Returns:
        Configuration object associated with the scopes passed as arguments
    """
    global config

    # Normalize input and construct a Configuration object
    configuration = _config_from(scopes_or_paths)
    config.clear_caches(), configuration.clear_caches()

    # Save and clear the current compiler cache
    saved_compiler_cache = spack.compilers._cache_config_file
    spack.compilers._cache_config_file = []

    saved_config, config = config, configuration

    try:
        yield configuration
    finally:
        # Restore previous config files
        spack.compilers._cache_config_file = saved_compiler_cache
        config = saved_config


@llnl.util.lang.memoized
def _config_from(scopes_or_paths):
    scopes = []
    for scope_or_path in scopes_or_paths:
        # If we have a config scope we are already done
        if isinstance(scope_or_path, ConfigScope):
            scopes.append(scope_or_path)
            continue

        # Otherwise we need to construct it
        path = os.path.normpath(scope_or_path)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



