Run steps for a single app, and update corresponding progress bars.
(name, step_times, app_steps_task_id)
| 21 | |
| 22 | |
| 23 | def run_steps(name, step_times, app_steps_task_id): |
| 24 | """Run steps for a single app, and update corresponding progress bars.""" |
| 25 | |
| 26 | for idx, step_time in enumerate(step_times): |
| 27 | # add progress bar for this step (time elapsed + spinner) |
| 28 | action = step_actions[idx] |
| 29 | step_task_id = step_progress.add_task("", action=action, name=name) |
| 30 | |
| 31 | # run steps, update progress |
| 32 | for _ in range(step_time): |
| 33 | time.sleep(0.5) |
| 34 | step_progress.update(step_task_id, advance=1) |
| 35 | |
| 36 | # stop and hide progress bar for this step when done |
| 37 | step_progress.stop_task(step_task_id) |
| 38 | step_progress.update(step_task_id, visible=False) |
| 39 | |
| 40 | # also update progress bar for current app when step is done |
| 41 | app_steps_progress.update(app_steps_task_id, advance=1) |
| 42 | |
| 43 | |
| 44 | # progress bar for current app showing only elapsed time, |
no test coverage detected