App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | List of all members
google.appengine.tools.appcfg.UploadBatcher Class Reference
Inheritance diagram for google.appengine.tools.appcfg.UploadBatcher:

Public Member Functions

def __init__
 
def SendBatch
 
def SendSingleFile
 
def Flush
 
def AddToBatch
 

Public Attributes

 what
 
 logging_context
 
 single_url
 
 batch_url
 
 batching
 
 batch
 
 batch_size
 

Detailed Description

Helper to batch file uploads.

Constructor & Destructor Documentation

def google.appengine.tools.appcfg.UploadBatcher.__init__ (   self,
  what,
  logging_context 
)
Constructor.

Args:
  what: Either 'file' or 'blob' or 'errorblob' indicating what kind of
objects this batcher uploads.  Used in messages and URLs.
  logging_context: The _ClientDeployLoggingContext for this upload.

Member Function Documentation

def google.appengine.tools.appcfg.UploadBatcher.AddToBatch (   self,
  path,
  payload,
  mime_type 
)
Batch a file, possibly flushing first, or perhaps upload it directly.

Args:
  path: The name of the file.
  payload: The contents of the file.
  mime_type: The MIME Content-type of the file, or None.

If mime_type is None, application/octet-stream is substituted.
def google.appengine.tools.appcfg.UploadBatcher.Flush (   self)
Flush the current batch.

This first attempts to send the batch as a single request; if that
fails because the server doesn't support batching, the files are
sent one by one, and self.batching is reset to False.

At the end, self.batch and self.batch_size are reset.
def google.appengine.tools.appcfg.UploadBatcher.SendBatch (   self)
Send the current batch on its way.

If successful, resets self.batch and self.batch_size.

Raises:
  HTTPError with code=404 if the server doesn't support batching.
def google.appengine.tools.appcfg.UploadBatcher.SendSingleFile (   self,
  path,
  payload,
  mime_type 
)
Send a single file on its way.

The documentation for this class was generated from the following file: