Return string representing the configuration directory.

    Default is $HOME/.config/glymur.  You can override this with the
    XDG_CONFIG_HOME environment variable.
327817
def get_configdir():
    
    if 'XDG_CONFIG_HOME' in os.environ:
        return os.path.join(os.environ['XDG_CONFIG_HOME'], 'glymur')

    if 'HOME' in os.environ and os.name != 'nt':
        # HOME is set by WinPython to something unusual, so we don't
        # necessarily want that.
        return os.path.join(os.environ['HOME'], '.config', 'glymur')

    # Last stand.  Should handle windows... others?
    return os.path.join(os.path.expanduser('~'), 'glymur')
1267392
def get_default_path_config():
    
    if 'SAWTOOTH_HOME' in os.environ:
        home_dir = os.environ['SAWTOOTH_HOME']
        return PathConfig(
            config_dir=os.path.join(home_dir, 'etc'),
            log_dir=os.path.join(home_dir, 'logs'),
            data_dir=os.path.join(home_dir, 'data'),
            key_dir=os.path.join(home_dir, 'keys'),
            policy_dir=os.path.join(home_dir, 'policy'))

    if os.name == 'nt':
        # Paths appropriate for Windows.
        base_dir = \
            os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
        return PathConfig(
            config_dir=os.path.join(base_dir, 'conf'),
            log_dir=os.path.join(base_dir, 'logs'),
            data_dir=os.path.join(base_dir, 'data'),
            key_dir=os.path.join(base_dir, 'conf', 'keys'),
            policy_dir=os.path.join(base_dir, 'policy'))

    # Paths appropriate for modern Linux distributions.
    return PathConfig(
        config_dir='/etc/sawtooth',
        log_dir='/var/log/sawtooth',
        data_dir='/var/lib/sawtooth',
        key_dir='/etc/sawtooth/keys',
        policy_dir='/etc/sawtooth/policy')
291847
def get_configfile():
    

    ad = appdirs.AppDirs('pyfilemail')
    configdir = ad.user_data_dir
    configfile = os.path.join(configdir, 'pyfilemail.cfg')

    return configfile
387769
def config(self):
        
        return {
            key: self.__dict__[key]
            for key in dir(self)
            if key.isupper()
        }
483272
def get_config(ini_path=None, rootdir=None):
    
    config = Namespace()
    config.default_section = 'pylama'

    if not ini_path:
        path = get_default_config_file(rootdir)
        if path:
            config.read(path)
    else:
        config.read(ini_path)

    return config
1095965
private File getDefaultOutputDirectory()
    {
        //The default output directory is the configuration name
        String childOutputDirectory = getConfiguration();
        
        //However, for platforms others than Win32, the default output directory becomes platform/configuration
        if ( ! getPlatform().equals( "Win32" ) )
        {
            childOutputDirectory = new File( getPlatform(), childOutputDirectory ).getPath();
        }
        
        //Place the default output directory within the appropriate base directory
        return new File( getBaseDirectory(), childOutputDirectory );
    }
488510
def _get_config_dir():
    
    if 'SAWTOOTH_HOME' in os.environ:
        return os.path.join(os.environ['SAWTOOTH_HOME'], 'etc')

    if os.name == 'nt':
        base_dir = \
            os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
        return os.path.join(base_dir, 'conf')

    return '/etc/sawtooth'
798262
def get_srtm_dir(self):
        
        # Local cache path:
        result = ""
        if 'HOME' in mod_os.environ:
            result = mod_os.sep.join([mod_os.environ['HOME'], '.cache', 'srtm'])
        elif 'HOMEPATH' in mod_os.environ:
            result = mod_os.sep.join([mod_os.environ['HOMEPATH'], '.cache', 'srtm'])
        else:
            raise Exception('No default HOME directory found, please specify a path where to store files')

        if not mod_path.exists(result):
            mod_os.makedirs(result)

        return result
996000
def init_config_file_path_if_empty(self):
        

        if os.path.exists(self.cfg_directory_path):
            return

        user_choice = 'n'
        if self.no_confirm:
            user_choice = 'y'
        else:
            sys.stdout.write(
                "Config directory does not exist at '" + os.path.abspath(self.cfg_directory_path) + "'. "
                + "Should a default configuration be created at this path? [Y/n] ")
            if sys.version_info[0] < 3:
                user_choice = raw_input()
            else:
                user_choice = input()
            user_choice = user_choice.lower().replace("yes", "y").replace("no", "n")

        if not user_choice or user_choice == '':  # the default is yes
            user_choice = "y"
        if "y" not in user_choice and "n" not in user_choice:
            sys.stderr.write("Wrong input, aborting.")
            sys.exit(1)
        if "n" in user_choice:
            sys.stdout.write("Config file will not be created. Terminating.")
            sys.exit(1)

        # copy the default config file to the new path
        copy_tree(os.environ['CColon'] + os.path.sep + 'config', self.cfg_directory_path)
        return
879297
function getLocalConfig(thisConfig, directory) {
  var found,
    i,
    localConfig,
    localConfigFile,
    config = {},
    localConfigFiles = thisConfig.findLocalConfigFiles(directory),
    numFiles = localConfigFiles.length,
    rootPath,
    projectConfigPath = path.join(process.cwd(), LOCAL_CONFIG_FILENAME);

  for (i = 0; i < numFiles; i++) {

    localConfigFile = localConfigFiles[i];

        // Don't consider the personal config file in the home directory,
        // except if the home directory is the same as the current working directory
    if (localConfigFile === PERSONAL_CONFIG_PATH && localConfigFile !== projectConfigPath) {
      continue;
    }

        // If root flag is set, don't consider file if it is above root
    if (rootPath && !pathIsInside(path.dirname(localConfigFile), rootPath)) {
      continue;
    }

    localConfig = loadConfig(localConfigFile);

        // Don't consider a local config file found if the config is empty.
    if (!Object.keys(localConfig).length) {
      continue;
    }

        // Check for root flag
    if (localConfig.root === true) {
      rootPath = path.dirname(localConfigFile);
    }

    found = true;
    config = util.mergeConfigs(localConfig, config);
  }

    // Use the personal config file if there are no other local config files found.
  return found ? config : util.mergeConfigs(config, getPersonalConfig());
}
757251
def _get_program_dir(name, config):
    
    if config is None:
        raise ValueError("Could not find directory in config for %s" % name)
    elif isinstance(config, six.string_types):
        return config
    elif "dir" in config:
        return expand_path(config["dir"])
    else:
        raise ValueError("Could not find directory in config for %s" % name)
151843
def get_config_path(config_file):
    
    config_path = os.getenv('XDG_CONFIG_HOME')
    if not config_path:
        config_path = os.path.join(os.getenv('HOME'), ".config")
    if not config_file:
        config_file = "default"
    return os.path.join(config_path, "trovebox", config_file)
323923
def _load_configuration():
    """"""
    config = configparser.RawConfigParser()
    module_dir = os.path.dirname(sys.modules[__name__].__file__)
    if 'APPDATA' in os.environ:  # Windows
        os_config_path = os.environ['APPDATA']
    elif 'XDG_CONFIG_HOME' in os.environ:  # Modern Linux
        os_config_path = os.environ['XDG_CONFIG_HOME']
    elif 'HOME' in os.environ:  # Legacy Linux
        os_config_path = os.path.join(os.environ['HOME'], '.config')
    else:
        os_config_path = None
    locations = [os.path.join(module_dir, 'praw.ini'), 'praw.ini']
    if os_config_path is not None:
        locations.insert(1, os.path.join(os_config_path, 'praw.ini'))
    if not config.read(locations):
        raise Exception('Could not find config file in any of: {0}'
                        .format(locations))
    return config
82607
def getConfigFile():
    

    fileName = '.wakatime.cfg'

    home = os.environ.get('WAKATIME_HOME')
    if home:
        return os.path.join(os.path.expanduser(home), fileName)

    return os.path.join(os.path.expanduser('~'), fileName)
1332283
def default_config_filename(root_dir=None):
        
        root_dir = Path(root_dir) if root_dir else Path('.').abspath()
        locale_dir = root_dir / 'locale'
        if not os.path.exists(locale_dir):
            locale_dir = root_dir / 'conf' / 'locale'
        return locale_dir / BASE_CONFIG_FILENAME
1242381
def get_default_config_file_path(init_filename=None):
    """"""
    prm_dir = get_package_prm_dir()
    if not init_filename:
        init_filename = DEFAULT_FILENAME
    src = os.path.join(prm_dir, init_filename)
    return src
595455
def get_home():
    
    path = ''
    try:
        path = os.path.expanduser("~")
    except:
        pass
    if not os.path.isdir(path):
        for evar in ('HOME', 'USERPROFILE', 'TMP'):
            try:
                path = os.environ[evar]
                if os.path.isdir(path):
                    break
            except:
                pass
    if path:
        return path
    else:
        raise RuntimeError('please define environment variable $HOME')