Override a hierarchical key in the config, setting it to the value.

    Note that yamlkeys should be a non-empty list of strings.
967948
def _override_cfg(container, yamlkeys, value):
    

    key = yamlkeys[0]
    rest = yamlkeys[1:]

    if len(rest) == 0:
        # no rest means we found the key to update.
        container[key] = value

    elif key in container:
        # still need to find the leaf in the tree, so recurse.
        _override_cfg(container[key], rest, value)

    else:
        # need to create a sub-tree down to the leaf to insert into.
        subtree = {}
        _override_cfg(subtree, rest, value)
        container[key] = subtree
734235
def _merge_config(self, config_override):
        
        if not isinstance(config_override, dict):
            raise TypeError("config override must be a dict")

        def recursion(config_value, override_value):
            for key, value in override_value.items():
                if key in config_value:
                    if isinstance(value, dict) and isinstance(config_value[key], dict):
                        recursion(config_value[key], value)
                    else:
                        config_value[key] = value
                else:
                    config_value[key] = value

        for key, value in config_override.items():
            if key in self._data:
                recursion(self._data[key], value)
            else:
                self._data[key] = value
380623
def setValue(self, key, value):
        
        LOG.debug("HMGeneric.setValue: address = '%s', key = '%s' value = '%s'" % (self._ADDRESS, key, value))
        try:
            self._proxy.setValue(self._ADDRESS, key, value)
            return True
        except Exception as err:
            LOG.error("HMGeneric.setValue: %s on %s Exception: %s", key,
                      self._ADDRESS, err)
            return False
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)
172681
def set_config(self, key, option, value):
        """"""
        if '_config' not in self.proxy:
            newopt = dict(default_cfg)
            newopt[option] = value
            self.proxy['_config'] = {key: newopt}
        else:
            if key in self.proxy['_config']:
                self.proxy['_config'][key][option] = value
            else:
                newopt = dict(default_cfg)
                newopt[option] = value
                self.proxy['_config'][key] = newopt
615605
def set(self, key, value):
        
        logger.debug("Settings %s -> %s" % (key, value))
        if key in self.DEFAULTS:
            vtype = type(self.DEFAULTS[key])
        else:
            vtype = type(value)

        if vtype not in self.VALID_KEY_TYPES:
            logger.warn("Invalid key type: %s" % vtype)
            return False

        #for gconf refer to the full key path
        key = self._fix_key(key)

        if vtype is bool:
            self._client.set_bool(key, value)
        elif vtype is str:
            self._client.set_string(key, value)
        elif vtype is int:
            self._client.set_int(key, value)
        elif vtype in (list, tuple):
            #Save every value as a string
            strvalues = [str(i) for i in value]
            #self._client.set_list(key, gconf.VALUE_STRING, strvalues)

        return True
718884
def config_value_for(key, default = nil, check_live = true)
      key = key.to_s
      value = check_live ? self[key.to_s] : nil
      value || config[key] || self.class.config_value_for(key) || default
    end
67460
def set_custom_values(self, key, values):
        
        for value in values:
            self.set_custom_value(key, value)
155919
def set_config(config, overwrite=False):
    '''
    
    '''

    if config is None:
        config = get_conf_path_from_env()

    # must be after the fallback other a bad fallback will incorrectly clear
    if overwrite is True:
        _runtime_conf.empty()

    if isinstance(config, six.string_types):
        config = conf_from_file(config)
        _runtime_conf.update(config)
        if config.__file__:
            _runtime_conf.__file__ = config.__file__
    elif isinstance(config, dict):
        _runtime_conf.update(conf_from_dict(config))
    else:
        raise TypeError('%s is neither a dictionary or a string.' % config)
438217
def setDefault(self, key, value):
        
        if value is None:
            self._defaults.pop(key, None)
        else:
            self._defaults[key] = value
284873
def add(self, key, value):
        
        self.configfile.add(self.name, key, value)
499940
def override(self, config_params):
        
        map = StringValueMap.from_maps(self, config_params)
        return ConfigParams(map)
112745
def setValue(self, key, value):
        
        if self._customFormat:
            self._customFormat.setValue(key, value)
        else:
            super(XSettings, self).setValue(key, wrapVariant(value))
124210
def update(self, **kwargs):
        
        # Override the template values with the override values.
        for s in config.sections():
            for o in config.options(s):
                override = kwargs.pop(o, None)
                if override:
                    config.set(s, o, override)
1022804
def set_default(self, key, value):
        
        k = self._real_key(key.lower())
        self._defaults[k] = value
972106
def set(self, key, value):
        

        changed = super().set(key=key, value=value)

        if not changed:
            return False

        self._log.info('Saving configuration to "%s"...', self._filename)

        with open(self._filename, 'w') as stream:
            stream.write(self.content)
            self._log.info('Saved configuration to "%s".', self._filename)

        return True
431177
def set_config(self, key, value):
        

        keyname = "config:" + key

        self.kvstore.set(keyname, value)