Usage:
          config print
          config reload
          config help
425861
def do_config(self, arg):
        
        if arg['print']:
            self.print_config(arg)
        elif arg['reload']:
            self.reload_config(arg)
        else:
            self.help_server()
38833
def print_config_values(self, prefix='- '):
        
        print('Configuration values from ' + self.config_dir)
        self.print_config_value(self.CONFIG_NAME_USER, prefix=prefix)
        self.print_config_value(self.CONFIG_NAME_PATH, prefix=prefix)
        self.print_config_value(self.CONFIG_NAME_PROXY, prefix=prefix)
        self.print_config_value(self.CONFIG_NAME_COMPETITION, prefix=prefix)
878621
def read_config(config_fname=None):
    """"""

    if not config_fname:
        config_fname = DEFAULT_CONFIG_FNAME

    try:
        with open(config_fname, 'r') as config_file:
            config = yaml.load(config_file)
    except IOError as exc:
        if exc.errno == errno.ENOENT:
            print('payu: warning: Configuration file {0} not found!'
                  .format(config_fname))
            config = {}
        else:
            raise

    collate_config = config.pop('collate', {})

    # Transform legacy collate config options
    if type(collate_config) is bool:
        collate_config = {'enable': collate_config}

    collatestr = 'collate_'
    foundkeys = []
    # Cycle through old collate config and convert to newer dict format
    for key in list(config.keys()):
        if key.startswith(collatestr):
            foundkeys.append(key)
            collate_config[key[len(collatestr):]] = config.pop(key)
    if foundkeys:
        print("Use of these keys is deprecated: {}.".format(
                ", ".join(foundkeys)))
        print("Instead use collate dictionary and subkey "
              "without 'collate_' prefix")

    config['collate'] = collate_config

    return config
871426
def reset(self):
        
        shutil.copy2(self.config_file + ".orig", self.config_file)
        if filecmp.cmp(self.config_file + ".orig", self.config_file):
            print("{0}The reset was done{1}".format(
                self.meta.color["GREEN"], self.meta.color["ENDC"]))
        else:
            print("{0}Reset failed{1}".format(self.meta.color["RED"],
                                              self.meta.color["ENDC"]))
735947
def reload(self, *modules):
        """"""
        self.notify('before_reload')

        if 'configfiles' in self.config:
            # reload configfiles
            self.log.info('Reloading configuration...')
            cfg = utils.parse_config(
                self.server and 'server' or 'bot', *self.config['configfiles'])
            self.config.update(cfg)

        self.log.info('Reloading python code...')
        if not modules:
            modules = self.registry.includes
        scanned = list(reversed(self.registry.scanned))

        # reset includes and events
        self.registry.reset()

        to_scan = []
        for module_name, categories in scanned:
            if module_name in modules:
                module = utils.maybedotted(module_name)
                reload_module(module)
            to_scan.append((module_name, categories))

        # rescan all modules
        for module_name, categories in to_scan:
            self.include(module_name, venusian_categories=categories)

        self.registry.reloading = {}

        self.notify('after_reload')
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]))
828337
def print_settings(settings, depth=0):
    """"""
    # handle the case where a single setting is passed
    if isinstance(settings, Setting):
        settings = [settings]
    for setting in settings:
        cur = setting.currentValue
        print(
            "%s* %s (%s, value: %s, type: %s)"
            % (
                " " * depth,
                setting.title,
                setting.target,
                click.style(cur, bold=True),
                setting.type,
            )
        )
        for opt in setting.candidate:
            if not opt.isAvailable:
                logging.debug("Unavailable setting %s", opt)
                continue
            click.echo(
                click.style(
                    "%s  - %s (%s)" % (" " * depth, opt.title, opt.value),
                    bold=opt.value == cur,
                )
            )
561233
def read(self):
        
        logger.info("Reloading %s ..." % self.__configfile)

        # smash the previous config
        self._configparser = configparser.SafeConfigParser()
        self._configparser.read([self.__configfile])

        sections = set()
        for setting in self.settings.values():
            sections.add(setting.section)
        for section in sections:
            # make sure that all the sections exist
            if not self._configparser.has_section(section):
                self._configparser.add_section(section)

        for setting in self.settings.values():
            setting.load(self._configparser)
231103
public function reload(): void
    {
        $config = [];
        foreach($this->configSources as $src) {
            // If it's a string, then it's a file or directory path
            if (is_string($src)) {
                // If directory, get all config files within it, recursively
                if (is_dir($src)) {
                    $getConfigFiles = function(string $path) use (&$getConfigFiles) {
                        $fragments = [];
                        if (is_dir($path)) {
                            $d = dir($path);
                            while (($f = $d->read()) !== false) {
                                if ($f[0] === '.') {
                                    continue;
                                }
                                if (is_dir("$path/$f")) {
                                    $fragments = array_merge($fragments, $getConfigFiles("$path/$f"));
                                } else {
                                    $fragments[] = "$path/$f";
                                }
                            }
                        }
                        return $fragments;
                    };
                    $fragments = $getConfigFiles($src);
                    sort($fragments);
                    foreach($fragments as $c) {
                        $config = array_replace_recursive($config, $this->parseConfig(file_get_contents($c)));
                    }

                // If it's a file, just merge it's contents over the current config array
                } elseif (is_file($src)) {
                    $config = array_replace_recursive($config, $this->parseConfig(file_get_contents($src)));

                // If it doesn't exist in the filesystem, and it's not optional, throw an exception
                } elseif (array_search($src, $this->optional) === false) {
                    throw (new MissingConfigFileException("Required config file or directory `$src` is missing."))
                        ->setMissingPath($src);
                }

            // If the source is an array, just merge it in
            } elseif (is_array($src)) {
                $config = array_replace_recursive($config, $src);
            }
        }
        $this->config = $config;
    }
1340926
def print_config(_run):
    
    final_config = _run.config
    config_mods = _run.config_modifications
    print(_format_config(final_config, config_mods))
777235
def reload(self):
        

        self.read_config()
        for section in self._override_config:
            self.set_section_config(section, self._override_config[section])
1308423
def checkConfig():
    """"""
    config_file_dir = os.path.join(cwd, "config.py")
    if os.path.exists(config_file_dir):
        print("Making a backup of your config file!")
        config_file_dir2 = os.path.join(cwd, "config.py.oldbak")
        copyfile(config_file_dir, config_file_dir2)
975220
def dump_config(self):  # pragma: no cover
        """"""
        with open(self.config_path, 'r') as cfg_fh:
            base_config = cfg_fh.read()

        print(base_config)
        exit(2)
1351204
private void reload() {
        try {
            if (!configFile.exists()) {
                LOGGER.warn("Config file deleted " + configFile + ", keeping old config.");
                return;
            }
            LOGGER.trace("Config reload triggered for " + configFile);
            if (parentSupplier != null) {
                set(loadConfig(parentSupplier.get()));
            } else {
                set(loadConfig(null));
            }
        } catch (ProvidenceConfigException e) {
            LOGGER.error("Exception when reloading " + configFile, e);
        }
    }
378466
def _load_config(self):
        
        config = import_module('config')
        variables = [var for var in dir(config) if not var.startswith('_')]
        return {var: getattr(config, var) for var in variables}
316443
def _print_config_text(tree, indentation=0):
    '''
    
    '''
    config = ''
    for key, value in six.iteritems(tree):
        config += '{indent}{line}\n'.format(indent=' '*indentation, line=key)
        if value:
            config += _print_config_text(value, indentation=indentation+1)
    return config
280600
def _update_config(self):
        
        if self._local_server:
            server_config = Config.instance().get_section_config("Server")
            self._local_server.user = server_config.get("user")
            self._local_server.password = server_config.get("password")