Read information from our config file, so we know what to expect.
324531
protected function read_upgrade_config_file() {
		
		$config = parse_ini_file($this->upgradeConfigFile,true, INI_SCANNER_RAW);
		
		if(is_array($config)) {
			$myConfig = $config;
			if(isset($config['main'])) {
				if(isset($config['main']['initial_version'])) {
					$this->initialVersion = $config['main']['initial_version'];
				}
				unset($myConfig['main'], $myConfig['defaults']);
			}
			
			$lastVersion = null;
			foreach ($myConfig as $v => $d) {
				$myVersion = preg_replace('/^v/', '', $v);
				if (is_null($lastVersion)) {
					$lastVersion = $myVersion;
				} else {
					if (!$this->is_higher_version($lastVersion, $myVersion)) {
						throw new LogicException(__METHOD__ . ": version must be in order of lowest to highest");
					}
				}
				
				//certain indexes MUST be set.
				if(!isset($d['target_version'])) {
					throw new ErrorException(__METHOD__ .": missing target version for '". $myVersion ."'");
				}
				
				$this->matchingData[$myVersion] = $d;
			}
		} else {
			$this->initialVersion = $this->versionFileVersion;
		}
		
		return $this->matchingData;
	}
120219
def read_config(self):
        

        try:
            parsed_files = self._config.read(self._files, encoding="utf-8")
        except configparser.Error as e:
            log.error("Can't parse configuration file: %s", str(e))
            return
        if not parsed_files:
            log.warning("No configuration file could be found or read")
        else:
            for file in parsed_files:
                log.info("Load configuration file {}".format(file))
                self._watched_files[file] = os.stat(file).st_mtime
1128325
def parse_config(config_file):
    """"""
    try:
        with open(config_file, 'r') as f:
            return yaml.load(f)
    except IOError:
        print "Configuration file {} not found or not readable.".format(config_file)
        raise
8195
def config(self):
        """"""
        return ", ".join('%s:%s' % (key, value) for key, value in self.conf.items())
1237662
function readConfig() {
  let options = {}
  let cFile = ''

  if (program.config) {
    cFile = path.resolve(cwd, program.config)
    if (fs.existsSync(cFile)) {
      Object.assign(config, require(cFile))
    } else {
      console.warn(`Cannot find configuration file ${program.config}`)
      process.exit()
    }
  } else {
    cFile = path.resolve(cwd, 'deploy.js')
  }

  if (fs.existsSync(cFile)) {
    options = require(cFile)
  }

  ;['server', 'ignore'].forEach(function(name) {
    if (typeof program[name] !== 'undefined') {
      options[name] = program[name]
    }
  })

  if (program.args[0]) {
    options.workspace = path.resolve(cwd, program.args[0])
  }

  if (program.args[1]) {
    options.deployTo = program.args[1]
  }

  return options
}
443615
def _read_configfile(self):
        """"""
        rc = self.config_filename
        if not os.path.isabs(rc):
            rc = os.path.join(os.path.expanduser('~'), self.config_filename)
        # If there is a setup.cfg in the package, parse it
        files = [f for f in [rc, 'setup.cfg'] if os.path.exists(f)]
        if not files:
            self.config = None
            return
        self.config = ConfigParser()
        self.config.read(files)
        if (not self.is_old_pypi_config() and
                not self.is_new_pypi_config()):
            # Safety valve
            self.config = None
1223023
def read_conf_file
      conf = {}
      if File.exists?(CONF_PATH) && File.size?(CONF_PATH)
        # Store valid conf keys
        YAML.load_file(CONF_PATH).each do |key, value|
          if VALID_KEYS.include? key
            conf[key] = value
          else
            say "Invalid configuration key: #{key}"
          end
        end
      end
      conf
    end
466030
def read_config(self):
        """"""
        config_file = os.path.join(self.config_dir, 'pueue.ini')
        self.config = configparser.ConfigParser()
        # Try to get configuration file and return it
        # If this doesn't work, a new default config file will be created
        if os.path.exists(config_file):
            try:
                self.config.read(config_file)
                return
            except Exception:
                self.logger.error('Error while parsing config file. Deleting old config')
                self.logger.exception()

        self.config['default'] = {
            'resumeAfterStart': False,
            'maxProcesses': 1,
            'customShell': 'default',
        }
        self.config['log'] = {
            'logTime': 60*60*24*14,
        }
        self.write_config()
814583
def parse_config(self, config_file):
        

        with open(config_file, 'r') as f:
            config = json.load(f)
        self.params = config
        if self.params['proxy']['proxy_type']:
            self.params['proxy'] = {self.params['proxy']['proxy_type']:
                                    self.params['proxy']['proxy_url']}
1211818
def read_config(config_path):
    """"""
    result = {}
    with open(config_path, 'r') as fd:
        for line in fd.readlines():
            if '=' in line:
                key, value = line.split('=', 1)
                try:
                    result[key] = json.loads(value)
                except ValueError:
                    result[key] = value.rstrip('\n')
    return result
1119255
private void readConfigFile() {
    File configFile = new File(CONFIG_FILE_PATH);
    /* config file is not there -> create config file with default */
    if (!configFile.exists()) {
      resetConfigToDefault();
    }

    try {
      PropertiesConfiguration conf = new PropertiesConfiguration(CONFIG_FILE_PATH);
      chemistry = conf.getString(CHEMISTRY_PLUGIN);
    } catch (ConfigurationException e) {
      resetConfigToDefault();
      e.printStackTrace();
    }
  }
1234862
protected function scanLoadConfig(): void
    {
        /* @var SplFileInfo $directory */
        /* @var SplFileInfo $file */
        foreach (Finder::create()->directories()->depth(1)->name('Config')->in($this->modulePath()) as $directory) {
            foreach (Finder::create()->files()->name('*.php')->in($directory->getPathname()) as $file) {
                $this->mergeConfigFrom($file->getPathname(), Str::snake($directory->getRelativePath()));
            }
        }
    }
1190747
def _get_config(config_file):
    ''''''
    parser = ConfigParser.SafeConfigParser()
    if os.path.lexists(config_file):
        try:
            log.info('Reading config: %s', config_file)
            inp = open(config_file)
            parser.readfp(inp)
            return parser
        except (IOError, ConfigParser.ParsingError), err:
            raise ConfigError("Failed to read configuration %s\n%s" % (config_file, err))
    return None
759499
def read_config(path=None, final=False):
    """"""
    try:
        with open(config_path(path, final=final), 'r') as configfile:
            return yaml.safe_load(configfile) or {}
    except FileNotFoundError:
        return {}
33680
function Info(state) {
  this.state = state;
  this.conf = state.conf;
  this.stats = state.stats;
  this.name = pkg.name;
  this.version = pkg.version;
}
1299854
def _read_config(config_location):
    
    global LOGGING_CONFIG
    with open(config_location, "r") as config_loc:
        cfg_file = json.load(config_loc)
        if "logging" in cfg_file:
            log_dict = cfg_file.get("logging")
            with open(os.path.abspath(os.path.join(__file__,
                                                   os.path.pardir,
                                                   'logging_schema.json'))) as schema_file:
                logging_schema = json.load(schema_file)
                jsonschema.validate(log_dict, logging_schema)
                merged = jsonmerge.merge(LOGGING_CONFIG, log_dict)
                LOGGING_CONFIG = merged
467489
def read(self):
        """"""
        for config_file in self.config_file_paths():
            logger.info('Search glances.conf file in {}'.format(config_file))
            if os.path.exists(config_file):
                try:
                    with open(config_file, encoding='utf-8') as f:
                        self.parser.read_file(f)
                        self.parser.read(f)
                    logger.info("Read configuration file '{}'".format(config_file))
                except UnicodeDecodeError as err:
                    logger.error("Can not read configuration file '{}': {}".format(config_file, err))
                    sys.exit(1)
                # Save the loaded configuration file path (issue #374)
                self._loaded_config_file = config_file
                break

        # Quicklook
        if not self.parser.has_section('quicklook'):
            self.parser.add_section('quicklook')
        self.set_default_cwc('quicklook', 'cpu')
        self.set_default_cwc('quicklook', 'mem')
        self.set_default_cwc('quicklook', 'swap')

        # CPU
        if not self.parser.has_section('cpu'):
            self.parser.add_section('cpu')
        self.set_default_cwc('cpu', 'user')
        self.set_default_cwc('cpu', 'system')
        self.set_default_cwc('cpu', 'steal')
        # By default I/O wait should be lower than 1/number of CPU cores
        iowait_bottleneck = (1.0 / multiprocessing.cpu_count()) * 100.0
        self.set_default_cwc('cpu', 'iowait',
                             [str(iowait_bottleneck - (iowait_bottleneck * 0.20)),
                              str(iowait_bottleneck - (iowait_bottleneck * 0.10)),
                              str(iowait_bottleneck)])
        # Context switches bottleneck identification #1212
        ctx_switches_bottleneck = (500000 * 0.10) * multiprocessing.cpu_count()
        self.set_default_cwc('cpu', 'ctx_switches',
                             [str(ctx_switches_bottleneck - (ctx_switches_bottleneck * 0.20)),
                              str(ctx_switches_bottleneck - (ctx_switches_bottleneck * 0.10)),
                              str(ctx_switches_bottleneck)])

        # Per-CPU
        if not self.parser.has_section('percpu'):
            self.parser.add_section('percpu')
        self.set_default_cwc('percpu', 'user')
        self.set_default_cwc('percpu', 'system')

        # Load
        if not self.parser.has_section('load'):
            self.parser.add_section('load')
        self.set_default_cwc('load', cwc=['0.7', '1.0', '5.0'])

        # Mem
        if not self.parser.has_section('mem'):
            self.parser.add_section('mem')
        self.set_default_cwc('mem')

        # Swap
        if not self.parser.has_section('memswap'):
            self.parser.add_section('memswap')
        self.set_default_cwc('memswap')

        # NETWORK
        if not self.parser.has_section('network'):
            self.parser.add_section('network')
        self.set_default_cwc('network', 'rx')
        self.set_default_cwc('network', 'tx')

        # FS
        if not self.parser.has_section('fs'):
            self.parser.add_section('fs')
        self.set_default_cwc('fs')

        # Sensors
        if not self.parser.has_section('sensors'):
            self.parser.add_section('sensors')
        self.set_default_cwc('sensors', 'temperature_core', cwc=['60', '70', '80'])
        self.set_default_cwc('sensors', 'temperature_hdd', cwc=['45', '52', '60'])
        self.set_default_cwc('sensors', 'battery', cwc=['80', '90', '95'])

        # Process list
        if not self.parser.has_section('processlist'):
            self.parser.add_section('processlist')
        self.set_default_cwc('processlist', 'cpu')
        self.set_default_cwc('processlist', 'mem')