Read server configuration from System properties and from server.properties.
333178
public static void init() {

        // Get configuration

        // Read from "server.properties" or custom file.
        String configFile = null;
        Properties serverProperties = new Properties();
        try {
            configFile = System.getProperty(PROPERTY_PREFIX + "config", "server.properties");
            LOG.info("Loading server configuration from " + configFile);

            try (InputStream is = new FileInputStream(configFile)) {
                serverProperties.load(is);
            }

        } catch (FileNotFoundException e) {
            LOG.warn(configFile + " not found.");
        } catch (IOException e) {
            LOG.error("Unexpected error reading " + configFile);
        }

        init(serverProperties);
    }
1292045
def read_config(config):
    
    for line in config.splitlines():
        line = line.lstrip()
        if line and not line.startswith("#"):
            return line
    return ""
722457
def set_config(self, data=None, **kwargs):
        """"""
        config = self.bot.config['server_config']
        for opt in data.split(' '):
            if '=' in opt:
                opt, value = opt.split('=', 1)
            else:
                value = True
            if opt.isupper():
                config[opt] = value
702869
private void readConfiguration( Map<String, String> parameters ) {
        String mountPath = parameters.get(MOUNT_PATH_CONFIG);
        this.mountPath = mountPath != null ? mountPath : DEFAULT_MOUNT_PATH;
        this.jcrConfig = RepositoryConfig.load(parameters);
    }
11775
def read_config(cls, configparser):
        """"""
        config = dict()
        section = cls.__name__
        option = "prefixes"
        if configparser.has_option(section, option):
            value = configparser.get(section, option)
            names = [x.strip().lower() for x in value.split(",")]
        else:
            names = []
        config[option] = names
        return config
635101
def process_settings(self, settings):
        """"""
        logging.debug("Using configuration from: %s", settings.name)
        exec(compile(settings.read(), settings.name, 'exec'), globals(), locals())
278169
def read_config(cls, configparser):
        """"""
        config = dict()
        config[cls._filename_re_key] = configparser.get(cls.__name__, cls._filename_re_key) \
            if configparser.has_option(cls.__name__, cls._filename_re_key) else None
        return config
250942
protected void readDatabaseConfig() {

        m_databaseKeys = new ArrayList<String>();
        m_databaseProperties = new HashMap<String, Properties>();

        FileInputStream input = null;
        File childResource = null;

        List<String> databaseKeys = new ArrayList<String>();
        Map<String, Properties> databaseProperties = new HashMap<String, Properties>();

        try {
            File databaseSetupFolder = new File(m_webAppRfsPath + FOLDER_SETUP + FOLDER_DATABASE);

            File[] childResources = databaseSetupFolder.listFiles();

            // collect all possible db configurations
            if (childResources != null) {
                for (int i = 0; i < childResources.length; i++) {
                    childResource = childResources[i];
                    if (childResource.exists() && childResource.isDirectory() && childResource.canRead()) {
                        databaseKeys.add(childResource.getName().trim());
                    }
                }
            }

            // create the properties with all possible configurations
            if (databaseSetupFolder.exists()) {
                for (String key : databaseKeys) {
                    String dbDir = m_webAppRfsPath + CmsSetupBean.FOLDER_SETUP + "database" + File.separatorChar + key;
                    String configPath = dbDir + File.separatorChar + "database.properties";
                    try {
                        input = new FileInputStream(new File(configPath));
                        Properties databaseProps = new Properties();
                        databaseProps.load(input);
                        databaseProperties.put(key, databaseProps);
                    } catch (Exception e) {
                        System.err.println(e.toString());
                        e.printStackTrace(System.err);
                        continue;
                    }
                }
            }

            // add the properties and the keys to the memeber variables if all needed files exist
            if (childResources != null) {
                for (int i = 0; i < childResources.length; i++) {
                    childResource = childResources[i];
                    if (childResource.exists() && childResource.isDirectory() && childResource.canRead()) {
                        String dataBasekey = childResource.getName().trim();
                        Properties props = databaseProperties.get(dataBasekey);
                        if (checkFilesExists(REQUIRED_SQL_DB_SETUP_FILES, childResource)) {
                            m_databaseKeys.add(childResource.getName().trim());
                            m_databaseProperties.put(dataBasekey, props);
                        }
                    }
                }
            }
        } catch (Exception e) {
            System.err.println(e.toString());
            e.printStackTrace(System.err);
        } finally {
            try {
                if (input != null) {
                    input.close();
                }
            } catch (Exception e) {
                // noop
            }
        }
    }
493104
def _read_config(self):
        """"""

        try:
            self.config = self.componentmodel.find_one(
                {'name': self.uniquename})
        except ServerSelectionTimeoutError:  # pragma: no cover
            self.log("No database access! Check if mongodb is running "
                     "correctly.", lvl=critical)
        if self.config:
            self.log("Configuration read.", lvl=verbose)
        else:
            self.log("No configuration found.", lvl=warn)
452948
public void setupServerConfigIfNeeds(BootLogger logger, Tomcat server, Connector connector, Properties props,
            List<String> readConfigList) {
        if (props == null) {
            return;
        }
        logger.info("...Reflecting configuration to server: config=" + readConfigList);
        doSetupServerConfig(logger, props, "URIEncoding", value -> connector.setURIEncoding(value));
        doSetupServerConfig(logger, props, "useBodyEncodingForURI", value -> {
            connector.setUseBodyEncodingForURI(isStringBooleanTrue(value));
        });
        doSetupServerConfig(logger, props, "secure", value -> connector.setSecure(isStringBooleanTrue(value)));
        doSetupServerConfig(logger, props, "scheme", value -> connector.setScheme(value));
        doSetupServerConfig(logger, props, "bindAddress", value -> connector.setProperty("address", value));
        doSetupServerConfig(logger, props, "proxyPort", value -> connector.setProxyPort(toInt("proxyPort(config)", value)));
        doSetupServerConfig(logger, props, "maxHttpHeaderSize", value -> {
            reflectPropertyMaxHttpHeaderSize(logger, server, connector, value);
        });
    }
482796
public final void server() {
    String port = parsedArguments.getString("port");
    String model = parsedArguments.getString(MODEL);
    String lexer = parsedArguments.getString("lexer");
    String dictTag = parsedArguments.getString("dictTag");
    String dictPath = parsedArguments.getString("dictPath");
    String clearFeatures = parsedArguments.getString("clearFeatures");
    String outputFormat = parsedArguments.getString("outputFormat");
    String lang = parsedArguments.getString("language");
    Properties serverproperties = setNameServerProperties(port, model, lang,
        lexer, dictTag, dictPath, clearFeatures, outputFormat);
    new NERTaggerServer(serverproperties);
  }
1061192
def config():
    ''''''
    if hasattr(current_app, 'settings_file'):
        log.info('Loaded configuration from %s', current_app.settings_file)

    log.info(white('Current configuration'))
    for key in sorted(current_app.config):
        if key.startswith('__') or not key.isupper():
            continue
        echo('{0}: {1}'.format(white(key), current_app.config[key]))
1071553
def read_config(ip, mac):
    """"""
    click.echo("Read configuration from %s" % ip)
    request = requests.get(
        'http://{}/{}/{}/'.format(ip, URI, mac), timeout=TIMEOUT)
    print(request.json())
1217397
def load_configuration(configuration):
    """"""
    if isinstance(configuration, dict):
        return configuration
    else:
        with open(configuration) as configfile:
            return json.load(configfile)
1021908
def load_config(self):
    """"""
    config = dict([(key, value) for key, value in iteritems(self.options)
                   if key in self.cfg.settings and value is not None])
    for key, value in iteritems(config):
      self.cfg.set(key.lower(), value)
443713
def read_checking_config (self):
        """"""
        section = "checking"
        self.read_int_option(section, "threads", min=-1)
        self.config['threads'] = max(0, self.config['threads'])
        self.read_int_option(section, "timeout", min=1)
        self.read_int_option(section, "aborttimeout", min=1)
        self.read_int_option(section, "recursionlevel", min=-1)
        self.read_string_option(section, "nntpserver")
        self.read_string_option(section, "useragent")
        self.read_int_option(section, "maxrequestspersecond", min=1)
        self.read_int_option(section, "maxnumurls", min=0)
        self.read_int_option(section, "maxfilesizeparse", min=1)
        self.read_int_option(section, "maxfilesizedownload", min=1)
        if self.has_option(section, "allowedschemes"):
            self.config['allowedschemes'] = [x.strip().lower() for x in \
                 self.get(section, 'allowedschemes').split(',')]
        self.read_boolean_option(section, "debugmemory")
        self.read_string_option(section, "cookiefile")
        self.read_string_option(section, "localwebroot")
        try:
            self.read_boolean_option(section, "sslverify")
        except ValueError:
            self.read_string_option(section, "sslverify")
        self.read_int_option(section, "maxrunseconds", min=0)
813692
def read_config(*args):
    '''
    
    '''

    ret = {}
    if _TRAFFICCTL:
        cmd = _traffic_ctl('config', 'get')
    else:
        cmd = _traffic_line('-r')

    try:
        for arg in args:
            log.debug('Querying: %s', arg)
            ret[arg] = _subprocess(cmd + [arg])
    except KeyError:
        pass

    return ret