Handle the new configuration.

        Args:
            new_config (dict): The new configuration
548918
def handle_config_change(self, new_config):
        
        if self.user_handler:
            self.user_handler(self.current_config, new_config)
        self._call_spec_handlers(new_config)
        self.current_config = copy.deepcopy(new_config)
1123028
def instantiate(self, config, *args, **kwargs):
        
        for plugin_config in config:
            self.new_plugin(plugin_config, *args, **kwargs)
787229
def config(config_dict: typing.Mapping) -> Config:
    
    logger.debug(f"Updating with {config_dict}")
    _cfg.update(config_dict)
    return _cfg
448372
def command_new_config(self):
        
        if len(self.args) == 1 and self.args[0] == "new-config":
            NewConfig().run()
        else:
            usage("")
815439
def register_config(self, cls, name):
        
        self._configs.add(cls)
        self._config_names.add(name)
1040388
def compare_and_update_config(config, update_config, changes, namespace=''):
    '''
    
    '''
    if isinstance(config, dict):
        if not update_config:
            if config:
                # the updated config is more valid--report that we are using it
                changes[namespace] = {
                    'new': config,
                    'old': update_config,
                }
            return config
        elif not isinstance(update_config, dict):
            # new config is a dict, other isn't--new one wins
            changes[namespace] = {
                'new': config,
                'old': update_config,
            }
            return config
        else:
            # compare each key in the base config with the values in the
            # update_config, overwriting the values that are different but
            # keeping any that are not defined in config
            for key, value in six.iteritems(config):
                _namespace = key
                if namespace:
                    _namespace = '{0}.{1}'.format(namespace, _namespace)
                update_config[key] = compare_and_update_config(
                    value,
                    update_config.get(key, None),
                    changes,
                    namespace=_namespace,
                )
            return update_config

    elif isinstance(config, list):
        if not update_config:
            if config:
                # the updated config is more valid--report that we are using it
                changes[namespace] = {
                    'new': config,
                    'old': update_config,
                }
            return config
        elif not isinstance(update_config, list):
            # new config is a list, other isn't--new one wins
            changes[namespace] = {
                'new': config,
                'old': update_config,
            }
            return config
        else:
            # iterate through config list, ensuring that each index in the
            # update_config list is the same
            for idx, item in enumerate(config):
                _namespace = '[{0}]'.format(idx)
                if namespace:
                    _namespace = '{0}{1}'.format(namespace, _namespace)
                _update = None
                if len(update_config) > idx:
                    _update = update_config[idx]
                if _update:
                    update_config[idx] = compare_and_update_config(
                        config[idx],
                        _update,
                        changes,
                        namespace=_namespace,
                    )
                else:
                    changes[_namespace] = {
                        'new': config[idx],
                        'old': _update,
                    }
                    update_config.append(config[idx])

            if len(update_config) > len(config):
                # trim any items in update_config that are not in config
                for idx, old_item in enumerate(update_config):
                    if idx < len(config):
                        continue
                    _namespace = '[{0}]'.format(idx)
                    if namespace:
                        _namespace = '{0}{1}'.format(namespace, _namespace)
                    changes[_namespace] = {
                        'new': None,
                        'old': old_item,
                    }
                del update_config[len(config):]
            return update_config

    else:
        if config != update_config:
            changes[namespace] = {
                'new': config,
                'old': update_config,
            }
        return config
861681
function(newValue,property,config) {
                var thesetter = config.setter;
                if ( typeof(config.setter) === 'string' ) {
                    record[config.setter](newValue, property, config,record);
                } else {
                    //assume function
                    thesetter.call(record,newValue, property, config,record);
                }

            }
1104639
function changeConfig(oldConfig, newConfig) {
  invariant(isObject(oldConfig), 'Old config is not valid');
  invariant(isObject(newConfig), 'Config is not valid');

  if (newConfig.host) {
    var host = newConfig.host;
    var prefix = '';

    if (host.indexOf('http://') < 0 && host.indexOf('https://') < 0) {
      prefix += 'http://';
    }

    oldConfig.host = prefix + newConfig.host;
  }

  if (newConfig.port) {
    oldConfig.port = newConfig.port;
  }
}
1277524
protected function loadConfig()
    {
        $this->hook->trigger(self::HOOK_LOAD_CONFIG_BEFORE);
        $this->config->load();
        $this->hook->trigger(self::HOOK_LOAD_CONFIG_AFTER);
    }
1289921
def configure(defaults, metadata, loader):
    
    config = Configuration(defaults)
    config.merge(loader(metadata))
    validate(defaults, metadata, config)
    return config
499872
def _add_new_items(self, config, seen):
        ''''''
        for (key, value) in self.items():
            if key not in seen:
                self._set_value(config, key, value)
603327
def from_config(config):
        
        result = Parameters()
        
        if config == None or len(config) == 0:
            return result
        
        for (key, value) in config.items():
            result.put(key, value)
        
        return result
149672
def _on_import_config(self, *args):
        
        def handle_import(dialog_text, path_name):
            chooser = Gtk.FileChooserDialog(dialog_text, None,
                                            Gtk.FileChooserAction.SAVE,
                                            (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
                                             Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT))
            chooser.set_current_folder(path_name)
            response = chooser.run()
            if response == Gtk.ResponseType.ACCEPT:
                # get_filename() returns the whole file path inclusively the filename
                config_file = chooser.get_filename()
                config_path = dirname(config_file)
                self._last_path = config_path
                config_dict = yaml_configuration.config.load_dict_from_yaml(config_file)
                config_type = config_dict.get("TYPE")
                if config_type == "SM_CONFIG":
                    del config_dict["TYPE"]
                    self.core_config_model.update_config(config_dict, config_file)
                    logger.info("Imported Core Config from {0}".format(config_file))
                elif config_type == "GUI_CONFIG":
                    del config_dict["TYPE"]
                    self.gui_config_model.update_config(config_dict, config_file)
                    logger.info("Imported GUI Config from {0}".format(config_file))
                else:
                    logger.error("{0} is not a valid config file".format(config_file))
            elif response == Gtk.ResponseType.CANCEL:
                logger.info("Import of configuration cancelled")
            chooser.destroy()

        handle_import("Import Config Config from", self._last_path)

        self.check_for_preliminary_config()
        self.update_path_labels()
69097
def _wait_new_conf(self):
        
        with self.app.conf_lock:
            logger.warning("My master Arbiter wants me to wait for a new configuration.")
            self.app.cur_conf = {}
1054558
def apply(self, config, raise_on_unknown_key=True):
        # type: (Dict[str, Any], bool) -> None
        
        _recursive_merge(self._data, config, raise_on_unknown_key)
1323174
public void setConfig(Config config) {
        if (mapperHelper == null) {
            mapperHelper = new MapperHelper();
        }
        mapperHelper.setConfig(config);
    }
998594
public static synchronized void update(Map<String, Object> newConfig) {
        if (newConfig == null)
            throw new NullPointerException("Updated config must not be null");

        // Update the logging configuration
        LogProviderConfig config = loggingConfig.get();
        if (config != null) {
            config.update(newConfig);
            // Propagate updates to the delegate
            getDelegate().update(config);
        }
    }