Skip to content

Commit

Permalink
pw_build: Fix progress bar clear
Browse files Browse the repository at this point in the history
We were relying on a private function for prompt-toolkit
ProgressBars. This change removed the _app_loop var:
prompt-toolkit/python-prompt-toolkit@5a1484b

This patch switches to the correct public API.

Change-Id: I7ec47e411e954abbd6e48751fcc5f58fe41192aa
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/160791
Presubmit-Verified: CQ Bot Account <[email protected]>
Reviewed-by: Rob Mohr <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Pigweed-Auto-Submit: Anthony DiGirolamo <[email protected]>
  • Loading branch information
AnthonyDiGirolamo authored and CQ Bot Account committed Jul 28, 2023
1 parent 0ef2c2d commit 3656612
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pw_build/py/pw_build/project_builder_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,13 @@ def exit_progress(self) -> None:
def clear_progress_scrollback(self) -> None:
if not self.progress_bar:
return
self.progress_bar._app_loop.call_soon_threadsafe( # type: ignore # pylint: disable=all
self.progress_bar.app.renderer.clear
)
if (
self.progress_bar.app.is_running
and self.progress_bar.app.loop is not None
):
self.progress_bar.app.loop.call_soon_threadsafe(
self.progress_bar.app.renderer.clear
)

def redraw_progress(self) -> None:
if not self.progress_bar:
Expand Down

0 comments on commit 3656612

Please sign in to comment.