Apply configuration file's plugin settings
423390
def apply_plugin_settings(self, options):
        """"""
        for fig_browser in list(self.shellwidgets.values()):
            fig_browser.setup(**self.get_settings())
1307973
function envPlugin(dynamicConfig, options) {
    var self = this;
    var separator;
    var whitelist;

    if (options && typeof options === "object") {
        separator = options.separator;
        whitelist = options.whitelist;
    }

    this(dynamicConfig).after("loadConfigFile", function (result) {
        self.override.result = merge(result, process.env, separator, whitelist);
    });
}
964584
def use_config_file(self):
        """"""
        self.config_file = self.find_config_file()
        if self.config_file:
            self.apply_config_file(self.config_file)
278857
def plugins(all, plugins_dir):
    ""
    app = Datasette([], plugins_dir=plugins_dir)
    click.echo(json.dumps(app.plugins(all), indent=4))
1355728
def apply_config_file(
        command_function: Union[click.Command, click.Group],
        cli_params: Dict[str, Any],
        ctx,
        config_file_option_name='config_file',
):
    
    paramname_to_param = {param.name: param for param in command_function.params}
    path_params = {
        param.name
        for param in command_function.params
        if isinstance(param.type, (click.Path, click.File))
    }

    config_file_path = Path(cli_params[config_file_option_name])
    config_file_values = dict()
    try:
        with config_file_path.open() as config_file:
            config_file_values = load(config_file)
    except OSError as ex:
        # Silently ignore if 'file not found' and the config file path is the default
        config_file_param = paramname_to_param[config_file_option_name]
        config_file_default_path = Path(
            config_file_param.type.expand_default(config_file_param.get_default(ctx), cli_params),
        )
        default_config_missing = (
            ex.errno == errno.ENOENT and
            config_file_path.resolve() == config_file_default_path.resolve()
        )
        if default_config_missing:
            cli_params['config_file'] = None
        else:
            click.secho(f"Error opening config file: {ex}", fg='red')
            sys.exit(1)
    except TomlError as ex:
        click.secho(f'Error loading config file: {ex}', fg='red')
        sys.exit(1)

    for config_name, config_value in config_file_values.items():
        config_name_int = config_name.replace('-', '_')

        if config_name_int not in paramname_to_param:
            click.secho(
                f"Unknown setting '{config_name}' found in config file - ignoring.",
                fg='yellow',
            )
            continue

        if config_name_int in path_params:
            # Allow users to use `~` in paths in the config file
            config_value = os.path.expanduser(config_value)

        if config_name_int == LOG_CONFIG_OPTION_NAME:
            # Uppercase log level names
            config_value = {k: v.upper() for k, v in config_value.items()}
        else:
            # Pipe config file values through cli converter to ensure correct types
            # We exclude `log-config` because it already is a dict when loading from toml
            try:
                config_value = paramname_to_param[config_name_int].type.convert(
                    config_value,
                    paramname_to_param[config_name_int],
                    ctx,
                )
            except click.BadParameter as ex:
                click.secho(f"Invalid config file setting '{config_name}': {ex}", fg='red')
                sys.exit(1)

        # Use the config file value if the value from the command line is the default
        if cli_params[config_name_int] == paramname_to_param[config_name_int].get_default(ctx):
            cli_params[config_name_int] = config_value
481827
public function applyConfigOverrides()
    {
        // init
        $config_items = [];

        foreach ($this->settings_default as $key => $value) {
            if (ee()->config->item($key)) {
                $config_items[$key] = ee()->config->item($key);
            }
        }

        if (is_array($this->settings)) {
            $this->settings = array_merge($this->settings, $config_items);
        }
    }
754103
def setPlugins( self, plugins ):
        
        plugins = sorted(plugins, key = lambda x: x.title())
        
        breakdown = {}
        for plugin in plugins:
            breakdown.setdefault(plugin.configGroup(), [])
            breakdown[plugin.configGroup()].append(plugin)
        
        for grp in sorted(breakdown.keys()):
            gitem = XTreeWidgetItem([grp])
            gitem.initGroupStyle()
            gitem.setFixedHeight(22)
            
            for plugin in breakdown[grp]:
                item = PluginItem(plugin)
                gitem.addChild(item)
            
            self.uiPluginTREE.addTopLevelItem(gitem)
            gitem.setExpanded(True)
794097
def write_config(self):
        """"""
        config_file = os.path.join(self.config_dir, 'pueue.ini')
        with open(config_file, 'w') as file_descriptor:
            self.config.write(file_descriptor)
330049
def get_plugin_settings(plugin, directory=None):
    """"""
    repo = require_repo(directory)
    plugins = get_value(repo, 'plugins')
    return plugins.get(plugin) if isinstance(plugins, dict) else None
638639
private static void applyConfigs(final ClassLoader classloader, final GuiceConfig config)
	{
		// Load all the local configs
		for (String configFile : getPropertyFiles(config))
		{
			try
			{
				for (PropertyFile properties : loadConfig(classloader, configFile))
					config.setAll(properties);
			}
			catch (IOException e)
			{
				throw new IllegalArgumentException("Error loading configuration URLs from " + configFile, e);
			}
		}

		// Load the network config (if enabled)
		try
		{
			applyNetworkConfiguration(config);
		}
		catch (Throwable t)
		{
			throw new RuntimeException("Failed to retrieve configuration from network!", t);
		}
	}
1201973
def _apply_advanced_config(config_spec, advanced_config, vm_extra_config=None):
    '''
    
    '''
    log.trace('Configuring advanced configuration '
              'parameters %s', advanced_config)
    if isinstance(advanced_config, str):
        raise salt.exceptions.ArgumentValueError(
            'The specified \'advanced_configs\' configuration '
            'option cannot be parsed, please check the parameters')
    for key, value in six.iteritems(advanced_config):
        if vm_extra_config:
            for option in vm_extra_config:
                if option.key == key and option.value == str(value):
                    continue
        else:
            option = vim.option.OptionValue(key=key, value=value)
            config_spec.extraConfig.append(option)
436644
def _initialize_plugins(self):
        
        logger.debug('Initializing plugins')
        plugins = self._pm.hook.plugins(loop=self._loop)
        if plugins:
            for plugin in plugins:
                name = plugin.__name__
                registry_name = plugin.__registry__ or plugin.__name__
                config = self.config.get(name, {})

                priority = config.get('priority', 50)

                if priority:
                    self._plugins[name] = {
                        'plugin': plugin,
                        'config': config,
                        'priority': priority,
                        'factory': registry_name
                    }

                    self._start_priority[priority].append(name)
        else:
            logger.error('No plugins found')
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
1216440
protected function applyConfig()
    {
        parent::applyConfig();
        if (isset($this->config->servers)) {
            $servers = array_filter(array_map('trim', explode(',', $this->config->servers->value)), 'mb_orig_strlen');
            $this->servers = [];
            foreach ($servers as $s) {
                $this->addServer($s);
            }
        }
        if (isset($this->config->maxconnperserv)) {
            $this->maxConnPerServ = $this->config->maxconnperserv->value;
        }
    }
100859
private void mergePlugins() {
        final Element root = pluginsDoc.createElement(ELEM_PLUGINS);
        pluginsDoc.appendChild(root);
        if (!descSet.isEmpty()) {
            final URI b = new File(ditaDir, CONFIG_DIR + File.separator + "plugins.xml").toURI();
            for (final File descFile : descSet) {
                logger.debug("Read plug-in configuration " + descFile.getPath());
                final Element plugin = parseDesc(descFile);
                if (plugin != null) {
                    final URI base = getRelativePath(b, descFile.toURI());
                    plugin.setAttributeNS(XML_NS_URI, XML_NS_PREFIX + ":base", base.toString());
                    root.appendChild(pluginsDoc.importNode(plugin, true));
                }
            }
        }
    }
777825
function extendConfig(defaults, config) {

        var key;

        // plugins
        if (config.plugins) {

            config.plugins.forEach(function(item) {

                // {}
                if (typeof item === 'object') {

                    key = Object.keys(item)[0];

                    // custom
                    if (typeof item[key] === 'object' && item[key].fn && typeof item[key].fn === 'function') {
                        defaults.plugins.push(setupCustomPlugin(key, item[key]));

                    } else {
                        defaults.plugins.forEach(function(plugin) {

                            if (plugin.name === key) {
                                // name: {}
                                if (typeof item[key] === 'object') {
                                    plugin.params = EXTEND({}, plugin.params || {}, item[key]);
                                    plugin.active = true;

                                // name: false
                                } else if (item[key] === false) {
                                   plugin.active = false;

                                // name: true
                                } else if (item[key] === true) {
                                   plugin.active = true;
                                }
                            }
                        });
                    }

                }

            });

        }

        defaults.multipass = config.multipass;

        // svg2js
        if (config.svg2js) {
            defaults.svg2js = config.svg2js;
        }

        // js2svg
        if (config.js2svg) {
            defaults.js2svg = config.js2svg;
        }

        return defaults;

    }
1234079
private function updatePluginsInstalledConfig($plugins)
    {
        $section = PiwikConfig::getInstance()->PluginsInstalled;
        $section['PluginsInstalled'] = $plugins;
        PiwikConfig::getInstance()->PluginsInstalled = $section;
    }