| Home | Trees | Indices | Help | 
|---|
|  | 
 
"Download media resources.
Note that the Python file object is compatible with io.Base and can be used
with this class also.
Example:
  request = farms.animals().get_media(id='cow')
  fh = io.FileIO('cow.png', mode='wb')
  downloader = MediaIoBaseDownload(fh, request, chunksize=1024*1024)
  done = False
  while done is False:
    status, done = downloader.next_chunk()
    if status:
      print "Download %d%%." % int(status.progress() * 100)
  print "Download Complete!"
| 
 | |||
| 
 | |||
| 
 | |||
| Inherited from  | |||
| 
 | |||
| Inherited from  | |||
| 
 | |||
| 
 
Constructor.
Args:
  fd: io.Base or file object, The stream in which to write the downloaded
    bytes.
  request: googleapiclient.http.HttpRequest, the media request to perform in
    chunks.
  chunksize: int, File will be downloaded in chunks of this many bytes.
 | 
| 
 
Get the next chunk of the download.
Args:
  num_retries: Integer, number of times to retry with randomized
        exponential backoff. If all retries fail, the raised HttpError
        represents the last request. If zero (default), we attempt the
        request only once.
Returns:
  (status, done): (MediaDownloadStatus, boolean)
     The value of 'done' will be True when the media has been fully
     downloaded.
Raises:
  googleapiclient.errors.HttpError if the response was not a 2xx.
  httplib2.HttpLib2Error if a transport error has occured.
 | 
| Home | Trees | Indices | Help | 
|---|
| Generated by Epydoc 3.0.1 on Tue Nov 1 17:02:50 2016 | http://epydoc.sourceforge.net |