This method will update the config.xml file for the target platform. It will
add the icon tags to the config file.
342168
function updateConfig(target) {
	try {
		var contents = fs.readFileSync(path.join(__dirname, '../../config.xml'), 'utf-8');
		if (contents) {
			// Windows is the BOM. Skip the Byte Order Mark.
			contents = contents.substring(contents.indexOf('<'));
		}

		var doc = new et.ElementTree(et.XML(contents));
		var root = doc.getroot();

		if (root.tag !== 'widget') {
			throw new Error('config.xml has incorrect root node name (expected "widget", was "' + root.tag + '")');
		}

		var platformElement = doc.find('./platform/[@name="' + target + '"]');

		if (platformElement) {
			var icons = platformElement.findall('./icon');

			for (var i=0; i<icons.length; i++) {
				platformElement.remove(icons[i]);
			}
		} else {
			platformElement = new et.Element('platform');
			platformElement.attrib.name = target;

			doc.getroot().append(platformElement);
		}

		// Add all the icons
		for(var i=0; i<platforms[target].icons.length; i++) {
			var iconElement = new et.Element('icon');
			iconElement.attrib = {
				...platforms[target].icons[i].attributes,
				src: 'res/' + target + '/' + platforms[target].icons[i].file
			};

			platformElement.append(iconElement);
		}

		fs.writeFileSync(path.join(__dirname, '../../config.xml'), doc.write({indent: 4}), 'utf-8');
	} catch (e) {
		console.error('Could not load config.xml');
		throw e;
	}
}
257226
public function apply()
    {
        if (!($this->config->hasKey(self::HEIGHT) && $this->config->hasKey(self::WIDTH))) {
            return;
        }

        add_theme_support('custom-logo', [
            'height'      => $this->config->getKey(self::HEIGHT),
            'width'       => $this->config->getKey(self::WIDTH),
            'flex-height' => $this->config->hasKey(self::FLEX_HEIGHT) ? $this->config->getKey(self::FLEX_HEIGHT) : true,
            'flex-width'  => $this->config->hasKey(self::FLEX_WIDTH) ? $this->config->getKey(self::FLEX_WIDTH) : true,
        ]);

        add_filter('genesis_seo_title', [$this, 'inlineLogoMarkup'], 10, 3);

        if (false === $this->config->getKey(self::SITE_DESCRIPTION)) {
            add_filter('genesis_attr_site-description', [$this, 'hideSiteDescription']);
        }
    }
14321
protected void updateIssueManagement(IssueManagement value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleElement(innerCount, root, "system", value.getSystem(), null);
         findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null);
      }
   }
1179114
function (targetFile, configItems) {
            var infoPlist = plist.parse(fs.readFileSync(targetFile, 'utf-8')),
                tempInfoPlist;

            _.each(configItems, function (item) {
                var key = item.parent;
                var plistXml = '<plist><dict><key>' + key + '</key>';
                plistXml += platformConfig.eltreeToXmlString(item.data) + '</dict></plist>';

                var configPlistObj = plist.parse(plistXml);
                infoPlist[key] = configPlistObj[key];
            });

            tempInfoPlist = plist.build(infoPlist);
            tempInfoPlist = tempInfoPlist.replace(/<string>[\s\r\n]*<\/string>/g,'<string></string>');
            fs.writeFileSync(targetFile, tempInfoPlist, 'utf-8');
        }
920131
def _updateTargetFromNode(self):
        
        font = self.data
        if self.familyCti.configValue:
            font.setFamily(self.familyCti.configValue)
        else:
            font.setFamily(QtGui.QFont().family()) # default family
        font.setPointSize(self.pointSizeCti.configValue)
        font.setWeight(self.weightCti.configValue)
        font.setItalic(self.italicCti.configValue)
        self._targetWidget.setFont(font)
363840
def autoupdate(config_file, store, tags_only, repos=()):
    """"""
    migrate_config(config_file, quiet=True)
    retv = 0
    output_repos = []
    changed = False

    input_config = load_config(config_file)

    for repo_config in input_config['repos']:
        if (
            repo_config['repo'] in {LOCAL, META} or
            # Skip updating any repo_configs that aren't for the specified repo
            repos and repo_config['repo'] not in repos
        ):
            output_repos.append(repo_config)
            continue
        output.write('Updating {}...'.format(repo_config['repo']))
        try:
            new_repo_config = _update_repo(repo_config, store, tags_only)
        except RepositoryCannotBeUpdatedError as error:
            output.write_line(error.args[0])
            output_repos.append(repo_config)
            retv = 1
            continue

        if new_repo_config['rev'] != repo_config['rev']:
            changed = True
            output.write_line(
                'updating {} -> {}.'.format(
                    repo_config['rev'], new_repo_config['rev'],
                ),
            )
            output_repos.append(new_repo_config)
        else:
            output.write_line('already up to date.')
            output_repos.append(repo_config)

    if changed:
        output_config = input_config.copy()
        output_config['repos'] = output_repos
        _write_new_config_file(config_file, output_config)

    return retv
1037084
def update_repos(self):
        
        with open("{0}{1}".format(self.meta.conf_path,
                                  self.repositories_conf), "w") as new_conf:
            for line in self.conf.splitlines():
                line = line.lstrip()
                if self.tag in line:
                    self.tag_line = True
                if self.tag_line and line.startswith("#"):
                    repo = "".join(line.split("#")).strip()
                    if repo in self.selected:
                        new_conf.write(line.replace(line, repo + "\n"))
                        continue
                if (self.tag_line and not line.startswith("#") and
                        line != self.tag):
                    repo = line.strip()
                    if repo not in self.selected:
                        new_conf.write(line.replace(line, "# " + line + "\n"))
                        continue
                new_conf.write(line + "\n")
382599
protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
      updateActivation(value.getActivation(), "activation", innerCount, root);
      updateBuildBase(value.getBuild(), "build", innerCount, root);
      findAndReplaceSimpleLists(innerCount, root, value.getModules(), "modules", "module");
      iterateRepository(innerCount, root, value.getRepositories(), "repositories", "repository");
      iterateRepository(innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository");
      iterateDependency(innerCount, root, value.getDependencies(), "dependencies", "dependency");
      findAndReplaceXpp3DOM(innerCount, root, "reports", (Xpp3Dom) value.getReports());
      updateReporting(value.getReporting(), "reporting", innerCount, root);
      updateDependencyManagement(value.getDependencyManagement(), "dependencyManagement", innerCount, root);
      updateDistributionManagement(value.getDistributionManagement(), "distributionManagement", innerCount, root);
      findAndReplaceProperties(innerCount, root, "properties", value.getProperties());
   }
1100673
public static void modifyHavePathSelfConfig(IConfigKeyWithPath key, String value) throws IOException {
        String configAbsoluteClassPath = key.getConfigPath();
        OneProperties configs = otherConfigs.get(configAbsoluteClassPath);
        if (configs == null) {
            return;
        }
        configs.modifyConfig(key, value);
    }
240414
function parseConfigXml(platform) {
        var configData = {};
        parsePlatformPreferences(configData, platform);
        parseConfigFiles(configData, platform);

        return configData;
    }
1076447
def add_config_file(self, config_filename):
        
        with open(config_filename, 'rb') as f:
            content = f.read()
            config = yaml.load(content)
            self.add_config(config, config_filename)
560012
def add(name, **kwargs):
    
    _CONFIG.add_section(name)

    for (key, value) in kwargs.items():
        _CONFIG.set(name, key, value)

    with open(_CONFIG_FILEPATH, 'w') as configfile:
        _CONFIG.write(configfile)

    info('Configuration updated at %s' % _JUT_HOME)
138750
def add(self, config_files, galaxy_root=None):
        
        for config_file in config_files:
            config_file = abspath(expanduser(config_file))
            if self.is_registered(config_file):
                log.warning('%s is already registered', config_file)
                continue
            defaults = None
            if galaxy_root is not None:
                defaults={ 'galaxy_root' : galaxy_root }
            conf = ConfigManager.get_ini_config(config_file, defaults=defaults)
            if conf is None:
                raise Exception('Cannot add %s: File is unknown type' % config_file)
            if conf['instance_name'] is None:
                conf['instance_name'] = conf['config_type'] + '-' + hashlib.md5(os.urandom(32)).hexdigest()[:12]
            if conf['attribs']['virtualenv'] is None:
                conf['attribs']['virtualenv'] = abspath(join(expanduser(self.state_dir), 'virtualenv-' + conf['instance_name']))
            # create the virtualenv if necessary
            self.create_virtualenv(conf['attribs']['virtualenv'])
            conf_data = { 'config_type' : conf['config_type'],
                          'instance_name' : conf['instance_name'],
                          'attribs' : conf['attribs'],
                          'services' : [] } # services will be populated by the update method
            self._register_config_file(config_file, conf_data)
            log.info('Added %s config: %s', conf['config_type'], config_file)
819062
def update(self):
        
        with open(os.path.join(self.config_dir, CONFIG_FILE_NAME), 'w') as config_file:
            self.config.write(config_file)
658234
public function update()
    {
        $fs = $this->getFilesystem();
        if ($fs->isDirectory($this->getGitDirectory())) {
            $this->runGit('fetch origin --tags');
        } else {
            $this->initialize();
        }
    }
95945
def modify_config_file(updates):
    '''
    
    '''
    cmd = '/bin/sed '
    for key in updates:
        cmd = cmd + '-e \'s/^#*{key}.*=.*$/{key}={value}/\' '.format(key=key, value=updates[key])
    cmd = cmd + constants.default_conf_file
    status = run_command_get_output(cmd)
    write_to_disk(constants.default_conf_file, content=status['output'])
95927
protected final void setSystemTag(String name, String value) {
    systemTags.put(name, new SystemTagImpl(name, value));
  }