update an export
514379
def update(self, volume_id, **kwargs):
        
        # These arguments are allowed
        self.allowed('update', kwargs,
                     ['status', 'instance_id',
                      'mountpoint', 'ip', 'initiator', 'session_ip',
                      'session_initiator'])
        # Remove parameters that are None
        params = self.unused(kwargs)
        return self.http_post('/volumes/%s/export' % volume_id, params=params)
338734
def export(self, path, session):
    """"""
    def variables_saver(variables_path):
      if self._saver:
        self._saver.save(
            session, variables_path,
            write_meta_graph=False,
            write_state=False)

    self._spec._export(path, variables_saver)
408938
def export(self, location):
        """"""
        temp_dir = tempfile.mkdtemp('-export', 'pip-')
        self.unpack(temp_dir)
        if os.path.exists(location):
            # Remove the location to make sure Bazaar can export it correctly
            rmtree(location)
        try:
            call_subprocess([self.cmd, 'export', location], cwd=temp_dir,
                            filter_stdout=self._filter, show_stdout=False)
        finally:
            rmtree(temp_dir)
283746
protected function export(): void {

		// Unexport first
		$this->unexport();

		// TODO review like PHPi
		file_put_contents(
			static::ROOT_FILESYSTEM . static::EXPORT,
			"{$this->linuxNumber}"
		);

		// Check
		if ( ! file_exists( static::ROOT_FILESYSTEM . static::GPIO . $this->linuxNumber ) ) {
			throw new ExportException( "Problem with export. GPIO {$this->linuxNumber} not found" );
		}
		$this->isExported = TRUE;
	}
200607
function update(itemName, isSnapshot, data) {
		var message, id = getIdFromItemName(itemName);
		message = proto.writeUpdate(id, itemName, isSnapshot, data);
		notify(message);
		return that;
	}
767763
def update_translations(self, project_id, file_path=None,
                            language_code=None, overwrite=False, fuzzy_trigger=None):
        
        return self._upload(
            project_id=project_id,
            updating=self.UPDATING_TRANSLATIONS,
            file_path=file_path,
            language_code=language_code,
            overwrite=overwrite,
            fuzzy_trigger=fuzzy_trigger
        )
138269
def update():
    '''
    
    '''
    try:
        salt.fileserver.reap_fileserver_cache_dir(
            os.path.join(__opts__['cachedir'], 'roots', 'hash'),
            find_file
        )
    except (IOError, OSError):
        # Hash file won't exist if no files have yet been served up
        pass

    mtime_map_path = os.path.join(__opts__['cachedir'], 'roots', 'mtime_map')
    # data to send on event
    data = {'changed': False,
            'files': {'changed': []},
            'backend': 'roots'}

    # generate the new map
    new_mtime_map = salt.fileserver.generate_mtime_map(__opts__, __opts__['file_roots'])

    old_mtime_map = {}
    # if you have an old map, load that
    if os.path.exists(mtime_map_path):
        with salt.utils.files.fopen(mtime_map_path, 'rb') as fp_:
            for line in fp_:
                line = salt.utils.stringutils.to_unicode(line)
                try:
                    file_path, mtime = line.replace('\n', '').split(':', 1)
                    old_mtime_map[file_path] = mtime
                    if mtime != new_mtime_map.get(file_path, mtime):
                        data['files']['changed'].append(file_path)
                except ValueError:
                    # Document the invalid entry in the log
                    log.warning(
                        'Skipped invalid cache mtime entry in %s: %s',
                        mtime_map_path, line
                    )

    # compare the maps, set changed to the return value
    data['changed'] = salt.fileserver.diff_mtime_map(old_mtime_map, new_mtime_map)

    # compute files that were removed and added
    old_files = set(old_mtime_map.keys())
    new_files = set(new_mtime_map.keys())
    data['files']['removed'] = list(old_files - new_files)
    data['files']['added'] = list(new_files - old_files)

    # write out the new map
    mtime_map_path_dir = os.path.dirname(mtime_map_path)
    if not os.path.exists(mtime_map_path_dir):
        os.makedirs(mtime_map_path_dir)
    with salt.utils.files.fopen(mtime_map_path, 'wb') as fp_:
        for file_path, mtime in six.iteritems(new_mtime_map):
            fp_.write(
                salt.utils.stringutils.to_bytes(
                    '{0}:{1}\n'.format(file_path, mtime)
                )
            )

    if __opts__.get('fileserver_events', False):
        # if there is a change, fire an event
        event = salt.utils.event.get_event(
                'master',
                __opts__['sock_dir'],
                __opts__['transport'],
                opts=__opts__,
                listen=False)
        event.fire_event(data,
                         salt.utils.event.tagify(['roots', 'update'], prefix='fileserver'))
799037
def update(connection, force_download):
    """"""
    manager.database.update(
        connection=connection,
        force_download=force_download
    )
913948
def update(self):
        '''
        
        '''
        self.updateIncomeProcess()
        self.updateAssetsGrid()
        self.updatepLvlNextFunc()
        self.updatepLvlGrid()
        self.updateMedShockProcess()
        self.updateSolutionTerminal()
147417
function backupOriginalPackageJson() {
  var originalContent = JSON.stringify(originalPackageJson, null, 2);
  fs.writeFileSync(tempPackageJsonPath, originalContent);
}
1119304
function update() {
		var f = self.fm.getSelected(0);
		reset();

		self._hash = f.hash;
		self.title.text(f.name);
		self.win.addClass(self.fm.view.mime2class(f.mime));
		self.name.text(f.name);
		self.kind.text(self.fm.view.mime2kind(f.link ? 'symlink' : f.mime)); 
		self.size.text(self.fm.view.formatSize(f.size));
		self.date.text(self.fm.i18n('Modified')+': '+self.fm.view.formatDate(f.date));
		f.dim && self.add.append('<span>'+f.dim+' px</span>').show();
		f.tmb && self.ico.css('background', 'url("'+f.tmb+'") 0 0 no-repeat');
		if (f.url) {
			self.url.text(f.url).attr('href', f.url).show();
			for (var i in self.plugins) {
				if (self.plugins[i].test && self.plugins[i].test(f.mime, self.mimes, f.name)) {
					self.plugins[i].show(self, f);
					return;
				}
			}
		} else {
			self.url.hide();
		}
		
		self.win.css({
			width  : '420px',
			height : 'auto'
		});
	}
1197130
public static void updateImports( Instance instance, Map<String,Collection<Import>> variablePrefixToImports ) {
		instance.getImports().clear();
		if( variablePrefixToImports != null )
			instance.getImports().putAll( variablePrefixToImports );
	}
1079785
def update(sc, filename, asset_id):
    '''
    
    '''
    addresses = []
    with open(filename) as hostfile:
        for line in hostfile.readlines():
            addresses.append(line.strip('\n'))
    sc.asset_update(asset_id, dns=addresses)
1319599
def export(name, path, replace=False):
    '''
    

    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    zones = __salt__['zoneadm.list'](installed=True, configured=True)
    if name in zones:
        ## zone exists
        if __opts__['test']:
            ## pretend we did the correct thing
            ret['result'] = True
            ret['comment'] = 'Zone configartion for {0} exported to {1}'.format(
                name,
                path,
            )
            ret['changes'][name] = 'exported'
            if __salt__['file.file_exists'](path) and not replace:
                ret['result'] = False
                ret['changes'] = {}
                ret['comment'] = 'File {0} exists, zone configuration for {1} not exported.'.format(
                    path,
                    name,
                )
        else:
            ## export and update file
            cfg_tmp = salt.utils.files.mkstemp()
            __salt__['zonecfg.export'](name, cfg_tmp)
            if not __salt__['file.file_exists'](path):
                ## move cfg_tmp to path
                try:
                    __salt__['file.move'](cfg_tmp, path)
                except CommandExecutionError:
                    if __salt__['file.file_exists'](cfg_tmp):
                        __salt__['file.remove'](cfg_tmp)
                    ret['result'] = False
                    ret['comment'] = 'Unable to export zone configuration for {0} to {1}!'.format(
                        name,
                        path,
                    )
                else:
                    ret['result'] = True
                    ret['comment'] = 'Zone configuration for {0} was exported to {1}.'.format(
                        name,
                        path,
                    )
                    ret['changes'][name] = 'exported'
            else:
                cfg_diff = __salt__['file.get_diff'](path, cfg_tmp)
                if not cfg_diff:
                    ret['result'] = True
                    ret['comment'] = 'Zone configuration for {0} was already exported to {1}.'.format(
                        name,
                        path
                    )
                    if __salt__['file.file_exists'](cfg_tmp):
                        __salt__['file.remove'](cfg_tmp)
                else:
                    if replace:
                        try:
                            __salt__['file.move'](cfg_tmp, path)
                        except CommandExecutionError:
                            if __salt__['file.file_exists'](cfg_tmp):
                                __salt__['file.remove'](cfg_tmp)
                            ret['result'] = False
                            ret['comment'] = 'Unable to be re-export zone configuration for {0} to {1}!'.format(
                                name,
                                path,
                            )
                        else:
                            ret['result'] = True
                            ret['comment'] = 'Zone configuration for {0} was re-exported to {1}.'.format(
                                name,
                                path,
                            )
                            ret['changes'][name] = 'exported'
                    else:
                        ret['result'] = False
                        ret['comment'] = 'Zone configuration for {0} is different from the one exported to {1}!'.format(
                            name,
                            path
                        )
                        if __salt__['file.file_exists'](cfg_tmp):
                            __salt__['file.remove'](cfg_tmp)
    else:
        ## zone does not exist
        ret['comment'] = []
        ret['comment'].append(
            'The zone {0} does not exist.'.format(name)
        )
        for zone in zones:
            if zones[zone]['uuid'] == name:
                ret['comment'].append(
                    'The zone {0} has a uuid of {1}, please use the zone name instead!'.format(
                        name,
                        path,
                    )
                )

        ret['result'] = False
        ret['comment'] = "\n".join(ret['comment'])

    return ret
1129797
def update_file path, matcher, currentVersion, nextVersion
      temp_path = "#{path}.autoversion"

      begin
        File.open(path) do |source|
          File.open(temp_path, 'w') do |target|
            source.each do |line|
              if matcher.call(line)
                target.write line.gsub currentVersion.to_s, nextVersion.to_s
              else
                target.write line
              end
            end
          end
        end

        File.rename temp_path, path
      ensure
        File.unlink temp_path if File.file? temp_path
      end
    end
760515
def update(
        self,
        filename=None,
        batch_id=None,
        prev_batch_id=None,
        producer=None,
        count=None,
    ):
        
        # TODO: refactor model enforce unique batch_id
        # TODO: refactor model to not allow NULLs
        if not filename:
            raise BatchHistoryError("Invalid filename. Got None")
        if not batch_id:
            raise BatchHistoryError("Invalid batch_id. Got None")
        if not prev_batch_id:
            raise BatchHistoryError("Invalid prev_batch_id. Got None")
        if not producer:
            raise BatchHistoryError("Invalid producer. Got None")
        if self.exists(batch_id=batch_id):
            raise IntegrityError("Duplicate batch_id")
        try:
            obj = self.model.objects.get(batch_id=batch_id)
        except self.model.DoesNotExist:
            obj = self.model(
                filename=filename,
                batch_id=batch_id,
                prev_batch_id=prev_batch_id,
                producer=producer,
                total=count,
            )
            obj.transaction_file.name = filename
            obj.save()
        return obj
2608
def export(defn):
    """"""
    globals()[defn.__name__] = defn
    __all__.append(defn.__name__)
    return defn