| 117 | |
| 118 | |
| 119 | def progress_iter(stages: dict[str, StageInfo]) -> Iterator[tuple[str, StageInfo]]: |
| 120 | total = len(stages) |
| 121 | desc = "Adding..." |
| 122 | with ui.progress( |
| 123 | stages.items(), total=total, desc=desc, unit="file", leave=True |
| 124 | ) as pbar: |
| 125 | if total == 1: |
| 126 | pbar.bar_format = desc |
| 127 | pbar.refresh() |
| 128 | |
| 129 | for item, stage_info in pbar: |
| 130 | if total > 1: |
| 131 | pbar.set_msg(str(stage_info.stage.outs[0])) |
| 132 | pbar.refresh() |
| 133 | yield item, stage_info |
| 134 | if total == 1: # restore bar format for stats |
| 135 | pbar.bar_format = pbar.BAR_FMT_DEFAULT |
| 136 | |
| 137 | |
| 138 | LINK_FAILURE_MESSAGE = ( |