

def put_continue_creation(self, token, content, content_range, last=False):
    'Continue object upload with PUTs.\n\n    This implements the resumable upload XML API.\n\n    Args:\n      token: upload token returned by post_start_creation.\n      content: object content.\n      content_range: a (start, end) tuple specifying the content range of this\n        chunk. Both are inclusive according to XML API.\n      last: True if this is the last chunk of file content.\n\n    Raises:\n      ValueError: if token is invalid.\n    '
    gcs_file = _AE_GCSFileInfo_.get_by_key_name(token)
    if (not gcs_file):
        raise ValueError('Invalid token')
    if content:
        (start, end) = content_range
        if (len(content) != ((end - start) + 1)):
            raise ValueError(('Invalid content range %d-%d' % content_range))
        blobkey = ('%s-%d-%d' % (token, content_range[0], content_range[1]))
        self.blob_storage.StoreBlob(blobkey, StringIO.StringIO(content))
        new_content = _AE_GCSPartialFile_(parent=gcs_file, partial_content=blobkey, start=start, end=(end + 1))
        new_content.put()
    if last:
        self._end_creation(token)

dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/cloudstorage/cloudstorage_stub.py CloudStorageStub.put_continue_creation/original