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

Class MediaDownloadProgress

googleapiclient/http.py:259–282  ·  view source on GitHub ↗

Status of a resumable download.

Source from the content-addressed store, hash-verified

257
258
259class MediaDownloadProgress(object):
260 """Status of a resumable download."""
261
262 def __init__(self, resumable_progress, total_size):
263 """Constructor.
264
265 Args:
266 resumable_progress: int, bytes received so far.
267 total_size: int, total bytes in complete download.
268 """
269 self.resumable_progress = resumable_progress
270 self.total_size = total_size
271
272 def progress(self):
273 """Percent of download completed, as a float.
274
275 Returns:
276 the percentage complete as a float, returning 0.0 if the total size of
277 the download is unknown.
278 """
279 if self.total_size is not None and self.total_size != 0:
280 return float(self.resumable_progress) / float(self.total_size)
281 else:
282 return 0.0
283
284
285class MediaUpload(object):

Callers 1

next_chunkMethod · 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…