

@db.non_transactional
def put_empty(self, token):
    'Empty put is used to query upload progress.\n\n    The file must has not finished upload.\n\n    Args:\n      token: upload token returned by post_start_creation.\n\n    Returns:\n      last offset uploaded. -1 if none has been uploaded.\n\n    Raises:\n      ValueError: if token matches no in progress uploads.\n    '
    ns = namespace_manager.get_namespace()
    try:
        namespace_manager.set_namespace('')
        gcs_file = _AE_GCSFileInfo_.get_by_key_name(token)
        if (not gcs_file):
            raise ValueError('Invalid token', httplib.BAD_REQUEST)
        return (gcs_file.next_offset - 1)
    finally:
        namespace_manager.set_namespace(ns)

dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/ext/cloudstorage/cloudstorage_stub.py CloudStorageStub.put_empty/original