All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <pkj@axis.com>
To: <bitbake-devel@lists.openembedded.org>
Subject: [PATCH 3/3] knotty.py: Separate the display of main tasks from running tasks
Date: Mon, 7 Mar 2022 14:36:20 +0100	[thread overview]
Message-ID: <20220307133620.12404-3-pkj@axis.com> (raw)
In-Reply-To: <20220307133620.12404-1-pkj@axis.com>

From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>

It can be confusing that the count of running tasks shown together with
the progress bar for the main tasks also includes any running setscene
tasks.

Separate the display so that the message for the main tasks' progress
bar only includes information on the main tasks, and the display of the
count of currently running tasks gets it own line.

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

This should be considered an RFC. With this change, the progress lines
for the setscene tasks and the main tasks (is that a good name for
those tasks?) look the same. The drawback is that it adds a line to
the display.

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

diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 179cea43fa..947fa73a13 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -293,10 +293,7 @@ class TerminalFilter(object):
 
             curtask = self.helper.tasknumber_current
             maxtask = self.helper.tasknumber_total
-            if not len(activetasks):
-                msg = "No running tasks (%s of %s)" % (curtask, maxtask)
-            else:
-                msg = "%2s running tasks (%s of %s)" % (len(activetasks), curtask, maxtask)
+            msg = "Main tasks (%s of %s)" % (curtask, maxtask)
             if not self.main_progress or self.main_progress.maxval != maxtask:
                 widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()]
                 self.main_progress = BBProgress("Running tasks", maxtask, widgets=widgets, resize_handler=self.sigwinch_handle)
@@ -307,6 +304,12 @@ class TerminalFilter(object):
             print('')
         lines = self.getlines(content)
         if not self.quiet:
+            if not len(activetasks):
+                content = "No running tasks"
+            else:
+                content = "%2s running tasks:" % len(activetasks)
+            print(content)
+            lines += self.getlines(content)
             for tasknum, task in enumerate(tasks[:(self.rows - 1 - lines)]):
                 if isinstance(task, tuple):
                     pbar, progress, rate, start_time = task


  parent reply	other threads:[~2022-03-07 13:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 13:36 [PATCH 1/3] knotty.py: Improve the message while waiting for running tasks to finish Peter Kjellerstedt
2022-03-07 13:36 ` [PATCH 2/3] knotty.py: Give the setscene tasks their own progress bar Peter Kjellerstedt
2022-03-07 15:48   ` [bitbake-devel] " Richard Purdie
2022-03-07 16:00     ` Peter Kjellerstedt
2022-03-07 13:36 ` Peter Kjellerstedt [this message]
2022-03-07 15:46   ` [bitbake-devel] [PATCH 3/3] knotty.py: Separate the display of main tasks from running tasks Richard Purdie
2022-03-07 16:01     ` Peter Kjellerstedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220307133620.12404-3-pkj@axis.com \
    --to=pkj@axis.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.