From aae4f55d1b55764d5919174add728d15a33641f1 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Tue, 8 Mar 2022 15:32:32 +0100 Subject: bitbake: knotty.py: A little clean up of TerminalFilter::updateFooter() * Use max() to clamp progress to >= 0. * Be consistent when evaluating self.quiet (treat it as a boolean). (Bitbake rev: 160f71372ff93894d9314619e9d3b547c1f3cda3) Signed-off-by: Peter Kjellerstedt Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/knotty.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'bitbake/lib/bb/ui') diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 52e6eb96fe..78888f8bdd 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py @@ -299,13 +299,11 @@ class TerminalFilter(object): self.main_progress = BBProgress("Running tasks", maxtask, widgets=widgets, resize_handler=self.sigwinch_handle) self.main_progress.start(False) self.main_progress.setmessage(msg) - progress = self.helper.tasknumber_current - 1 - if progress < 0: - progress = 0 + progress = max(0, self.helper.tasknumber_current - 1) content += self.main_progress.update(progress) print('') lines = self.getlines(content) - if self.quiet == 0: + if not self.quiet: for tasknum, task in enumerate(tasks[:(self.rows - 1 - lines)]): if isinstance(task, tuple): pbar, progress, rate, start_time = task -- cgit v1.2.3-54-g00ecf