Args: b: number of blocks transferred so far, default: 1. bsize: size of each block (in tqdm units), default: 1. tsize: total size (in tqdm units). if None, remains unchanged.
(self, b: int = 1, bsize: int = 1, tsize: int | None = None)
| 101 | """ |
| 102 | |
| 103 | def update_to(self, b: int = 1, bsize: int = 1, tsize: int | None = None) -> None: |
| 104 | """ |
| 105 | Args: |
| 106 | b: number of blocks transferred so far, default: 1. |
| 107 | bsize: size of each block (in tqdm units), default: 1. |
| 108 | tsize: total size (in tqdm units). if None, remains unchanged. |
| 109 | """ |
| 110 | if tsize is not None: |
| 111 | self.total = tsize |
| 112 | self.update(b * bsize - self.n) # will also set self.n = b * bsize |
| 113 | |
| 114 | with TqdmUpTo(unit="B", unit_scale=True, unit_divisor=1024, miniters=1, desc=_basename(filepath)) as t: |
| 115 | urlretrieve(url, filepath, reporthook=t.update_to) |