PUT /mapfiles/id: Update an existing item.
181952
def update(self, id):
        """"""
        map = self._get_map_from_user_by_id(c.user, id)
        if map is None:
            abort(404)

        # get json content from PUT request
        content = request.environ['wsgi.input'].read(int(request.environ['CONTENT_LENGTH']))
        #content = content.decode('utf8')

        # update mapfile
        mapfile = Mapfile()
        dict = simplejson.loads(content)
        mapfile.from_dict(dict)
        mapfile.to_file(os.path.join(config['mapfiles_dir'], map.filepath))
        if mapfile.get_name() != map.name:
            self._update_map(map, name=mapfile.get_name())

        response.status = 201
        return
1076418
def addFile(self, path, msg=""):
        """"""
        item = Item.from_path(repo=self.repo, path=path)
        self.addItem(item)
704434
def update(self, item, dry_run=None):
        """"""
        logger.debug('Updating item. Item: {item} Path: {data_file}'.format(
            item=item,
            data_file=self.data_file
        ))
        self.delete(item, dry_run=dry_run)
        return self.create(item, dry_run=dry_run)
1151221
def update(key, value):
    '''
    
    '''
    store = load()
    store[key] = value
    dump(store)
    return True
433860
def update(self, key, value=None, dir=False, ttl=None, refresh=False,
               prev_value=None, prev_index=None, timeout=None):
        """"""
        return self.adapter.set(key, value, dir=dir, ttl=ttl, refresh=refresh,
                                prev_value=prev_value, prev_index=prev_index,
                                prev_exist=True, timeout=timeout)
98828
def update(self, *args):
        
        for d in args:
            for (key, value) in d.items():
                self.__setitem__(key, value)
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
1020250
def update_without_overwrite(d, *args, **kwds):
    
    if args:
        assert len(args) == 1, \
            'At most one positional parameter is allowed: {0!r}'.format(args)

        (other,) = args
        if isinstance(other, Mapping):
            for key in other:
                setitem_without_overwrite(d, key, other[key])
        elif hasattr(other, "keys"):
            for key in other.keys():
                setitem_without_overwrite(d, key, other[key])
        else:
            for key, value in other:
                setitem_without_overwrite(d, key, value)

    for key, value in kwds.items():
        setitem_without_overwrite(d, key, value)
912911
def update_mapping(self):
        
        """
        self.mapping = dict([(f.name, f) for f in iter(self)])
396227
def update(self, document):
        
        if '_id' not in document:
            return self.insert(document)

        # Update the stored document, removing the id
        copy = document.copy()
        del copy['_id']

        self.db.execute("""
            update %s set data = ? where id = ?
        """ % self.name, (json.dumps(copy), document['_id']))

        return document
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
1077225
def update(self, data):
        
        for key, value in data.items():
            setattr(self, key, value)
1255650
def dynamic_content_item_variant_update(self, item_id, id, data, **kwargs):
        ""
        api_path = "/api/v2/dynamic_content/items/{item_id}/variants/{id}.json"
        api_path = api_path.format(item_id=item_id, id=id)
        return self.call(api_path, method="PUT", data=data, **kwargs)
390645
function updateFileData(filePath, newRelPath, oldRelPath, data) {
    return new Promise(async(res, rej) => {
        let file = editLinks(data, newRelPath, oldRelPath);
        try {
            await writeFile(filePath, file);
            res();
        } catch (err) {
            rej();
        }
    })
}
1349622
def update(self, id):
        """"""
        # url('DataStores', id=ID)
        content = request.environ['wsgi.input'].read(int(request.environ['CONTENT_LENGTH']))
        content = content.decode('utf8')
        content = simplejson.loads(content)        
        result = meta.Session.query(DataStore).get(id)
        result.name = content['name']
        result.type = content['type']
        result.ogrstring = content['ogrstring']
        meta.Session.commit()
        response.status = 201
348823
function updateItem(id, updater) {
  return new Promise((resolve, reject) => {
    return instance.pkgs.then(db => {
      const obj = db.transaction(db.name, 'readwrite')
        .objectStore(db.name);
      const req = obj.get(id);
      req.onerror = event => reject(event);
      req.onsuccess = event => {
        const res = event.target.result;
        updater(res);
        const upd = obj.put(res);
        upd.onsuccess = () => resolve();
        upd.onerror = event => reject(event);
      };
    });
  });
}
779655
def update(self, d):
        

        # Call __setitem__ for all keys in d
        for key in list(d.keys()):
            self.__setitem__(key, d[key])