|
| what |
|
| logging_context |
|
| single_url |
|
| batch_url |
|
| batching |
|
| batch |
|
| batch_size |
|
Helper to batch file uploads.
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.
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:
- code/googleappengine-read-only/python/google/appengine/tools/appcfg.py