Update the read-in configuration file.
492958
def update_file(self):
        
        if self._filename is None:
            raise NoConfigFileReadError()
        with open(self._filename, 'w') as fb:
            self.write(fb)
952267
def update_readme_for_modules(modules):
    
    readme = parse_readme()
    module_docstrings = core_module_docstrings()
    if modules == ["__all__"]:
        modules = core_module_docstrings().keys()
    for module in modules:
        if module in module_docstrings:
            print_stderr("Updating README.md for module {}".format(module))
            readme[module] = module_docstrings[module]
        else:
            print_stderr("Module {} not in core modules".format(module))

    # write the file
    readme_file = os.path.join(modules_directory(), "README.md")
    with open(readme_file, "w") as f:
        f.write(create_readme(readme))
454485
private function updateStubsPathsInConfigFile()
    {
        $updated = str_replace('vendor/bpocallaghan/generators/', '',
            File::get($this->getConfigPath()));
        File::put($this->getConfigPath(), $updated);
    }
904670
def _update_file_args(self, file_mapping):
        """"""
        for key, value in self.args.items():
            new_value = file_mapping.get(value, value)
            if new_value != value:
                self.args[key] = new_value
824013
public function modifyFile()
    {
        foreach (['chown', 'chgrp', 'chmod'] as $key) {
            $value = $this->{$key};
            if ($value) {
                $this->file->{$key}($value);
            }
        }
    }
582514
def update_config(updated_project):
    '''
    

    '''

    home = os.path.expanduser('~')
    if os.path.isfile(os.path.join(home, '.transfer', 'config.yaml')):
        with open(os.path.join(home, '.transfer', 'config.yaml'), 'r') as fp:
            projects = yaml.load(fp.read())
        replace_index = -1
        for i, project in enumerate(projects):
            if project['name'] == updated_project['name']:
                replace_index = i

        if replace_index > -1:
            projects[replace_index] = updated_project
            store_config(projects)
        else:
            print('Not saving configuration')
            print(colored('Project: ' + updated_project['name'] + ' was not found in configured projects!', 'red'))

    else:
        print('Transfer is not configured.')
        print('Please run:')
        print('')
        print(colored('    transfer --configure', 'cyan'))
        return
1260915
function updateConfigs (args, newVersion) {
  const dotgit = DotGitignore()
  Bump.pkgFiles.concat(Bump.lockFiles).forEach(function (filename) {
    let configPath = path.resolve(process.cwd(), filename)
    try {
      if (dotgit.ignore(configPath)) return
      let stat = fs.lstatSync(configPath)
      if (stat.isFile()) {
        let data = fs.readFileSync(configPath, 'utf8')
        let indent = detectIndent(data).indent
        let newline = detectNewline(data)
        let config = JSON.parse(data)
        checkpoint(args, 'bumping version in ' + filename + ' from %s to %s', [config.version, newVersion])
        config.version = newVersion
        writeFile(args, configPath, stringifyPackage(config, indent, newline))
        // flag any config files that we modify the version # for
        // as having been updated.
        configsToUpdate[filename] = true
      }
    } catch (err) {
      if (err.code !== 'ENOENT') console.warn(err.message)
    }
  })
}
733641
def update(self):
        """"""
        pids = fileops.readlines(self.paths['cgroup.procs'])
        self.pids = [int(pid) for pid in pids if pid != '']
        self.n_procs = len(pids)
974647
def update_ssh_config(self, path="~/.ssh/config"):
        """"""
        # Read the config file #
        import sshconf
        config = sshconf.read_ssh_config(os.path.expanduser(path))
        # In case it doesn't exist #
        if not config.host(self.instance_name): config.add(self.instance_name)
        # Add the new DNS #
        config.set(self.instance_name, Hostname=self.dns)
        # Write result #
        config.write(os.path.expanduser(path))
1333999
def _updateFilename(self):
        
        self._filename = self._filenameLineEdit.text()
        self._guessEncoding(self._filename)
        self._previewFile()
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")
966947
def update_config_mode(self, prompt=None):
        """"""
        # TODO: Fix the conflict with config mode attribute at connection
        if prompt:
            self.mode = self.driver.update_config_mode(prompt)
        else:
            self.mode = self.driver.update_config_mode(self.prompt)
1224291
def _update_config_file(username, password, email, url, config_path):
        """"""
        try:
            # read the existing config
            config = json.load(open(config_path, "r"))
        except ValueError:
            config = dict()

        if not config.get('auths'):
            config['auths'] = dict()

        if not config['auths'].get(url):
            config['auths'][url] = dict()
        encoded_credentials = dict(
            auth=base64.b64encode(username + b':' + password),
            email=email
        )
        config['auths'][url] = encoded_credentials
        try:
            json.dump(config, open(config_path, "w"), indent=5, sort_keys=True)
        except Exception as exc:
            raise exceptions.AnsibleContainerConductorException(
                u"Failed to write registry config to {0} - {1}".format(config_path, exc)
            )
1366767
protected void modifyConfig(Map<? extends IConfigKey, String> modifyConfig) throws IOException {
        if (propertiesFilePath == null) {
            LOGGER.warn("Config " + propertiesAbsoluteClassPath + " is not a file, maybe just a resource in library.");
        }
        if (configs == null) {
            loadConfigs();
        }
        for (IConfigKey key : modifyConfig.keySet()) {
            if (modifyConfig.get(key) != null) {
                configs.setProperty(key.getKeyString(), modifyConfig.get(key));
            }
        }
        PropertiesIO.store(propertiesFilePath, configs);
    }
516757
def update_mode(arg_namespace):
    """"""
    try:
        updater.update(custom_sources=arg_namespace.custom)
    except (PermissionError, FileNotFoundError) as exception:
        if isinstance(exception, PermissionError):
            print('No write permission for current working directory.')
        if isinstance(exception, FileNotFoundError):
            print('Necessary resources for updating not found in current '
                  'working directory.')
1202490
def update_configuration(configuration):
    
    for key, val in REQUIRED_SETTINGS.items():
        if val in ["$username", "$groupname"]:
            val = get_username()

        configuration = conf_writer.add_or_update(configuration, key, val)

    return configuration
31229
def _update_sub_file_dict(self, sub_files):
        """"""
        sub_files.file_dict.clear()
        for job_details in self.jobs.values():
            if job_details.file_dict is not None:
                sub_files.update(job_details.file_dict)
            if job_details.sub_file_dict is not None:
                sub_files.update(job_details.sub_file_dict)