[PATCHv3,4/4] knotty.py: Unify quiet and non-quiet output for the running tasks

Message ID 20220308143233.19972-4-pkj@axis.com
State New
Headers show
Series [PATCHv3,1/4] knotty.py: Improve the message while waiting for running tasks to finish | expand

Commit Message

Peter Kjellerstedt March 8, 2022, 2:32 p.m. UTC
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>

This adds the number of currently running tasks to the output in quiet
mode, and removes the word "currently" from the output for the non-quiet
output. Removing "currently" avoids having the text "jump around"
depending on whether any tasks are running or not, and it also gives a
little bit more space to the progress bar.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---

PATCHv2: New.
PATCHv3: No changes.

 bitbake/lib/bb/ui/knotty.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Patch

diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 78888f8bdd..704e688f48 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -287,12 +287,11 @@  class TerminalFilter(object):
                 content += msg + "\n"
                 print(msg)
 
+            msg = "%2s running tasks" % (len(activetasks) or "No")
             if self.quiet:
-                msg = "Running tasks (%s, %s)" % (scene_tasks, cur_tasks)
-            elif not len(activetasks):
-                msg = "No currently running tasks (%s)" % cur_tasks
+                msg += " (%s, %s)" % (scene_tasks, cur_tasks)
             else:
-                msg = "Currently %2s running tasks (%s)" % (len(activetasks), cur_tasks)
+                msg += " (%s)" % cur_tasks
             maxtask = self.helper.tasknumber_total
             if not self.main_progress or self.main_progress.maxval != maxtask:
                 widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()]