Пример #1
0
def fetch_data_async(blob, start_index, end_index, **options):
  """Async version of fetch_data()."""
  if isinstance(blob, BlobInfo):
    blob = blob.key()
  rpc = blobstore.create_rpc(**options)
  rpc = blobstore.fetch_data_async(blob, start_index, end_index, rpc=rpc)
  result = yield rpc
  raise tasklets.Return(result)
Пример #2
0
def fetch_data_async(blob, start_index, end_index, **options):
    """Async version of fetch_data()."""
    if isinstance(blob, BlobInfo):
        blob = blob.key()
    rpc = blobstore.create_rpc(**options)
    rpc = blobstore.fetch_data_async(blob, start_index, end_index, rpc=rpc)
    result = yield rpc
    raise tasklets.Return(result)
Пример #3
0
def create_upload_url_async(success_path,
                      max_bytes_per_blob=None,
                      max_bytes_total=None,
                      **options):
  """Async version of create_upload_url()."""
  rpc = blobstore.create_rpc(**options)
  rpc = blobstore.create_upload_url_async(success_path,
                                          max_bytes_per_blob=max_bytes_per_blob,
                                          max_bytes_total=max_bytes_total,
                                          rpc=rpc)
  result = yield rpc
  raise tasklets.Return(result)
Пример #4
0
def create_upload_url_async(success_path,
                            max_bytes_per_blob=None,
                            max_bytes_total=None,
                            **options):
    """Async version of create_upload_url()."""
    rpc = blobstore.create_rpc(**options)
    rpc = blobstore.create_upload_url_async(
        success_path,
        max_bytes_per_blob=max_bytes_per_blob,
        max_bytes_total=max_bytes_total,
        rpc=rpc)
    result = yield rpc
    raise tasklets.Return(result)
Пример #5
0
def delete_multi_async(blob_keys, **options):
    """Async version of delete_multi()."""
    if isinstance(blob_keys, (six.string_types, BlobKey)):
        raise TypeError('Expected a list, got %r' % (blob_key, ))
    rpc = blobstore.create_rpc(**options)
    yield blobstore.delete_async(blob_keys, rpc=rpc)
Пример #6
0
def delete_multi_async(blob_keys, **options):
  """Async version of delete_multi()."""
  if isinstance(blob_keys, (basestring, BlobKey)):
    raise TypeError('Expected a list, got %r' % (blob_key,))
  rpc = blobstore.create_rpc(**options)
  yield blobstore.delete_async(blob_keys, rpc=rpc)
Пример #7
0
def delete_async(blob_key, **options):
    """Async version of delete()."""
    if not isinstance(blob_key, (basestring, BlobKey)):
        raise TypeError('Expected blob key, got %r' % (blob_key, ))
    rpc = blobstore.create_rpc(**options)
    yield blobstore.delete_async(blob_key, rpc=rpc)