def get_config_directory(override_files=False):
    """
    Looks for the most specific configuration directory possible, in order to
    load individual configuration files.
    """
    if override_files:
        possible_dirs = [override_files]

    else:
        xdg_config_home = os.environ.get('XDG_CONFIG_HOME') or \
            os.path.expanduser('~/.config')
        possible_dirs = [os.path.join(xdg_config_home, "supernova.d/"),
                         os.path.expanduser("~/.supernova.d/"),
                         ".supernova.d/"]

    for config_dir in reversed(possible_dirs):
        if os.path.isdir(config_dir):
            return config_dir

    return False
def get_config_directory ( override_files = False ) : if override_files : possible_dirs = [ override_files ] else : xdg_config_home = os . environ . get ( 'XDG_CONFIG_HOME' ) or os . path . expanduser ( '~/.config' ) possible_dirs = [ os . path . join ( xdg_config_home , "supernova.d/" ) , os . path . expanduser ( "~/.supernova.d/" ) , ".supernova.d/" ] for config_dir in reversed ( possible_dirs ) : if os . path . isdir ( config_dir ) : return config_dir return False
Looks for the most specific configuration directory possible, in order to
    load individual configuration files.