(self, stats: OperationStats, unit: str = "auto")
| 183 | self._has_shown = False |
| 184 | |
| 185 | def update(self, stats: OperationStats, unit: str = "auto") -> None: |
| 186 | if not _should_show(stats, unit): |
| 187 | return |
| 188 | self._has_shown = True |
| 189 | if self._is_tty and self._live is None: |
| 190 | self._live = Live( |
| 191 | console=console.c, |
| 192 | transient=True, |
| 193 | refresh_per_second=4, |
| 194 | vertical_overflow="visible", |
| 195 | ) |
| 196 | self._live.start() |
| 197 | if self._live is not None: |
| 198 | self._live.update(_build_renderable(stats, unit), refresh=True) |
| 199 | |
| 200 | def close(self) -> None: |
| 201 | if self._live is not None: |
no test coverage detected