Loads the configuration file given as parameter
337405
def parse_config(file_path):
    """"""
    config_parser = configparser.ConfigParser()
    config_parser.read(file_path)
    plugin_config = {}
    options = config_parser.options(CONFIG_OPTION)
    for option in options:
        try:
            plugin_config[option] = config_parser.get(CONFIG_OPTION, option)
            if plugin_config[option] == -1:
                print("skip: %s" % option)
        except Exception as e:
            print("exception on %s!" % option)
            print(e.message)
            plugin_config[option] = None
    return plugin_config
991185
def _load_config(self, path):
        
        p = os.path.abspath(os.path.expanduser(path))
        logger.debug('Loading configuration from: %s', p)
        return read_json_file(p)
1328396
def _load(self, file_path: Text) -> None:
        

        # noinspection PyUnresolvedReferences
        module_ = types.ModuleType('settings')
        module_.__file__ = file_path

        try:
            with open(file_path, encoding='utf-8') as f:
                exec(compile(f.read(), file_path, 'exec'), module_.__dict__)
        except IOError as e:
            e.strerror = 'Unable to load configuration file ({})'\
                .format(e.strerror)
            raise

        for key in dir(module_):
            if CONFIG_ATTR.match(key):
                self[key] = getattr(module_, key)
867427
@Override
  public Configuration loadConfig() throws ConfigurationException, IOException {

    Configuration resultConfig = new Configuration();

    if (!Utils.localFileExists(this.getConfigFileName())) {
      // String configFileName = System.getenv(ConfigConstant.DDF_INI_ENV_VAR.getValue());
      File file = new File(this.locateConfigFileName(this.getConfigDir(), this.getConfigFileName()));
      mConfigDir = file.getParentFile().getName();
      mConfigFileName = file.getCanonicalPath();
    }

    if (!Utils.localFileExists(this.getConfigFileName())) return null;

    HierarchicalINIConfiguration config = new HierarchicalINIConfiguration(this.getConfigFileName());

    @SuppressWarnings("unchecked")
    Set<String> sectionNames = config.getSections();
    for (String sectionName : sectionNames) {
      SubnodeConfiguration section = config.getSection(sectionName);
      if (section != null) {
        Configuration.Section resultSection = resultConfig.getSection(sectionName);

        @SuppressWarnings("unchecked")
        Iterator<String> keys = section.getKeys();
        while (keys.hasNext()) {
          String key = keys.next();
          String value = section.getString(key);
          if (value != null) {
            resultSection.set(key, value);
          }
        }
      }
    }

    mConfig = resultConfig;
    return mConfig;
  }
95799
def load(self, config_file=None, path=None):
        
        if config_file is None:
            if path is None:
                path, config_file = split(resource_filename(__name__, CONFIG_FILE))
            else:
                config_file = CONFIG_FILE
        super(Config, self).load(config_file, path)
1054561
def load_config(path=None):
    """"""
    if not path or not op.exists(path):
        return Config()
    path = op.realpath(path)
    dirpath, filename = op.split(path)
    file_ext = op.splitext(path)[1]
    logger.debug("Load config file `%s`.", path)
    if file_ext == '.py':
        config = PyFileConfigLoader(filename, dirpath,
                                    log=logger).load_config()
    elif file_ext == '.json':
        config = JSONFileConfigLoader(filename, dirpath,
                                      log=logger).load_config()
    return config
1253771
def load(self):
        """"""
        try:
            with open(self.config_file) as configfile:
                self.config = yaml.load(configfile)
        except TypeError:
            # no config file (use environment variables)
            pass
        if self.config:
            self.prefix = self.config.get('config_prefix', None)
        if not self.prefix:
            if os.getenv(self.config_prefix):
                self.prefix = os.getenv(self.config_prefix)
            else:
                for path in [
                    os.path.join(self.basepath, self.default_file),
                    os.path.join(self.config_root, self.default_file)
                ]:
                    if os.path.exists(path):
                        with open(path) as conf:
                            config = yaml.load(conf)
                            prefix = config.get(
                                self.config_prefix.lower(), None
                            )
                            if prefix:
                                self.prefix = prefix
                                break
841913
def load_configuration_from_file(directory, args):
    """"""
    args = copy.copy(args)

    directory_or_file = directory
    if args.config is not None:
        directory_or_file = args.config

    options = _get_options(directory_or_file, debug=args.debug)

    args.report = options.get('report', args.report)
    threshold_dictionary = docutils.frontend.OptionParser.thresholds
    args.report = int(threshold_dictionary.get(args.report, args.report))

    args.ignore_language = get_and_split(
        options, 'ignore_language', args.ignore_language)

    args.ignore_messages = options.get(
        'ignore_messages', args.ignore_messages)

    args.ignore_directives = get_and_split(
        options, 'ignore_directives', args.ignore_directives)

    args.ignore_substitutions = get_and_split(
        options, 'ignore_substitutions', args.ignore_substitutions)

    args.ignore_roles = get_and_split(
        options, 'ignore_roles', args.ignore_roles)

    return args
261958
def load_config_file(config_path)
      abort "Can not find config file at #{config_path}" if !File.readable?(config_path)
      config = File.read(config_path)
      # trim off anything after __END__
      config.sub!(/^__END__\n.*/, '')
      @app.module_eval(config)
    end
881424
private void loadConfigurationFiles() {

        // Parse the first annotation found (manage overriding)
        final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);

        // Conf variable cannot be null because it was defined in this class
        // It's possible to discard default behaviour by setting an empty string to the value.

        // launch the configuration search engine
        ResourceBuilders.PARAMETER_BUILDER.searchConfigurationFiles(conf.value(), conf.extension());

    }
512887
function loadConfiguration() {
    let configuration;

    if (isInit()) {
        configuration = jsonReader('./.versionFilesList.json');

        // check configuration file's integrity
        if (!configuration.name || !configuration.currentVersion || !configuration.filesList || !configuration.versionPrefix) {
            sendError('E002');
        }

        // check .versionFilesList.json for missing informations
        if (configuration.name.length === 0 || configuration.currentVersion.length === 0) {
            sendError('E001');
        }
    }
    return configuration;
}
677725
def load_config(self, config_source, parameters_source):
        """"""
        with open(config_source) as config_source:
            config_raw = config_source.read()
            """Replace the parameters"""
            pattern = "(%[a-zA-Z_0-9]*%)"

            self.parameters = {}
            """Parameteres from file"""
            if os.path.isfile(parameters_source):
                self.parameters.update(self.load_parameters(parameters_source))

            """Overwrite parameteres with the environment variables"""
            self.parameters.update(os.environ)

            replaced_config = re.sub(pattern=pattern, repl=self._replace_function, string=config_raw)
            return json.loads(replaced_config)
1113511
def from_file(cls, filename, **kwargs):
        
        filename = os.path.expanduser(filename)
        if not os.path.isfile(filename):
            raise exceptions.PyKubeError("Configuration file {} not found".format(filename))
        with open(filename) as f:
            doc = yaml.safe_load(f.read())
        self = cls(doc, **kwargs)
        self.filename = filename
        return self
592409
def load_config(filename="logging.ini", *args, **kwargs):
    
    logging.config.fileConfig(filename, *args, **kwargs)
919084
def load(self, filename):
        ''' 
        '''
        if not os.path.exists(filename):
            #print 'Could not load config file [%s]' % (filename)
            raise AppConfigValueException('Could not load config file {0}'.
                    format(filename))
        cfl = open(filename, 'r')
        if PY2:
            self.readfp(cfl)
        else:
            self.read_file(cfl)
        cfl.close()
91543
def load_dynamic_config(config_file=DEFAULT_DYNAMIC_CONFIG_FILE):
    """"""
    dynamic_configurations = {}

    # Insert config path so we can import it
    sys.path.insert(0, path.dirname(path.abspath(config_file)))
    try:
        config_module = __import__('config')

        dynamic_configurations = config_module.CONFIG
    except ImportError:
        # Provide a default if config not found
        LOG.error('ImportError: Unable to load dynamic config. Check config.py file imports!')

    return dynamic_configurations
228613
def load(config_file):
    
    with open(config_file, "r") as f:

        def env_get():
            return dict(os.environ)
        tmpl = Template(f.read())
        return Config(yaml.load(tmpl.render(**env_get())))