def read_xdg_config_dirs(name, extension):
    """
    Read from files found in XDG-specified system-wide configuration paths,
    defaulting to ``/etc/xdg``. Depends on ``XDG_CONFIG_DIRS`` environment
    variable.

    :param name: application or configuration set name
    :param extension: file extension to look for
    :return: a `.Configuration` instance with values read from XDG-specified
        directories
    """
    # find optional value of ${XDG_CONFIG_DIRS}
    config_dirs = environ.get('XDG_CONFIG_DIRS')
    if config_dirs:
        # PATH-like env vars operate in decreasing precedence, reverse this path set to mimic the end result
        config_dirs = reversed(config_dirs.split(path.pathsep))
    else:
        # XDG spec: "If $XDG_CONFIG_DIRS is either not set or empty, a value equal to /etc/xdg should be used."
        config_dirs = ['/etc/xdg']

    # load a file from all config dirs, default to NotConfigured
    fname = '{name}.{extension}'.format(name=name, extension=extension)
    return loadf(*(path.join(config_dir, fname) for config_dir in config_dirs),
                 default=NotConfigured)
def read_xdg_config_dirs ( name , extension ) : config_dirs = environ . get ( 'XDG_CONFIG_DIRS' ) if config_dirs : config_dirs = reversed ( config_dirs . split ( path . pathsep ) ) else : config_dirs = [ '/etc/xdg' ] fname = '{name}.{extension}' . format ( name = name , extension = extension ) return loadf ( * ( path . join ( config_dir , fname ) for config_dir in config_dirs ) , default = NotConfigured )
Read from files found in XDG-specified system-wide configuration paths,
    defaulting to ``/etc/xdg``. Depends on ``XDG_CONFIG_DIRS`` environment
    variable.

    :param name: application or configuration set name
    :param extension: file extension to look for
    :return: a `.Configuration` instance with values read from XDG-specified
        directories