A wrapper around `Rich.Progress` that defines the OPTIMADE client progressbars.
| 98 | |
| 99 | |
| 100 | class OptimadeClientProgress(Progress): |
| 101 | """A wrapper around `Rich.Progress` that defines the OPTIMADE client progressbars.""" |
| 102 | |
| 103 | def __init__(self): |
| 104 | super().__init__( |
| 105 | SpinnerColumn(finished_text="[green]✓"), |
| 106 | TextColumn("[progress.description]{task.description}"), |
| 107 | BarColumn(), |
| 108 | TaskProgressColumn( |
| 109 | text_format="[progress.completed]{task.completed}/[progress.total]{task.total}", |
| 110 | text_format_no_percentage="[progress.completed]{task.completed}", |
| 111 | ), |
| 112 | TimeElapsedColumn(), |
| 113 | console=Console(stderr=True), |
| 114 | auto_refresh=True, |
| 115 | refresh_per_second=10, |
| 116 | ) |
| 117 | |
| 118 | def print(self, *args, **kwargs): |
| 119 | if not self.disable: |
| 120 | super().print(*args, **kwargs) |
| 121 | |
| 122 | |
| 123 | @contextmanager |
no outgoing calls
no test coverage detected