| 15 | |
| 16 | |
| 17 | class TqdmCallback(_TqdmCallback): |
| 18 | def __init__( |
| 19 | self, |
| 20 | size: Optional[int] = None, |
| 21 | value: int = 0, |
| 22 | progress_bar: Optional["tqdm"] = None, |
| 23 | tqdm_cls: Optional[type["tqdm"]] = None, |
| 24 | **tqdm_kwargs, |
| 25 | ): |
| 26 | tqdm_kwargs.pop("total", None) |
| 27 | super().__init__( |
| 28 | tqdm_kwargs=tqdm_kwargs, tqdm_cls=tqdm_cls or Tqdm, size=size, value=value |
| 29 | ) |
| 30 | if progress_bar is not None: |
| 31 | self.tqdm = progress_bar |
| 32 | |
| 33 | def branched(self, path_1: "Union[str, BinaryIO]", path_2: str, **kwargs): |
| 34 | desc = path_1 if isinstance(path_1, str) else path_2 |
| 35 | return TqdmCallback(bytes=True, desc=desc) |
| 36 | |
| 37 | |
| 38 | class RichCallback(Callback): |
no outgoing calls
no test coverage detected