MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / MediaUploadProgress

Class MediaUploadProgress

googleapiclient/http.py:232–256  ·  view source on GitHub ↗

Status of a resumable upload.

Source from the content-addressed store, hash-verified

230
231
232class MediaUploadProgress(object):
233 """Status of a resumable upload."""
234
235 def __init__(self, resumable_progress, total_size):
236 """Constructor.
237
238 Args:
239 resumable_progress: int, bytes sent so far.
240 total_size: int, total bytes in complete upload, or None if the total
241 upload size isn't known ahead of time.
242 """
243 self.resumable_progress = resumable_progress
244 self.total_size = total_size
245
246 def progress(self):
247 """Percent of upload completed, as a float.
248
249 Returns:
250 the percentage complete as a float, returning 0.0 if the total size of
251 the upload is unknown.
252 """
253 if self.total_size is not None and self.total_size != 0:
254 return float(self.resumable_progress) / float(self.total_size)
255 else:
256 return 0.0
257
258
259class MediaDownloadProgress(object):

Callers 1

_process_responseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…