[v2] knotty: improve the UI information

Message ID 20220127202243.26972-1-twoerner@gmail.com
State New
Headers show
Series [v2] knotty: improve the UI information | expand

Commit Message

Trevor Woerner Jan. 27, 2022, 8:22 p.m. UTC
During a build you might end up with bitbake telling you:

	Currently 30 running tasks (2757 of 2757/3476 of 6390)

Which, to me, is really confusing. The forward slash separator and the two
numbers immediately on each side of which are likely to be interpreted as
being one unit (i.e. 2757/3476) but they're not. Also nothing is labeled,
leaving the user to wonder what these numbers are.

Add labels, spaces, etc. to help clarify the information bitbake is trying to
convey. The resulting line would appear as:

	30 running tasks (setscene:2757/2757 tasks:3476/6390)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes since v1:
- improve the commit message
- remove the redundant word "Currently" in order to help keep the total
  line length manageable for users of 80-column terminals
---
 lib/bb/ui/knotty.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Peter Kjellerstedt Jan. 27, 2022, 8:29 p.m. UTC | #1
> -----Original Message-----
> From: bitbake-devel@lists.openembedded.org <bitbake-
> devel@lists.openembedded.org> On Behalf Of Trevor Woerner
> Sent: den 27 januari 2022 21:23
> To: bitbake-devel@lists.openembedded.org
> Subject: [bitbake-devel] [PATCH v2] knotty: improve the UI information
> 
> During a build you might end up with bitbake telling you:
> 
> 	Currently 30 running tasks (2757 of 2757/3476 of 6390)
> 
> Which, to me, is really confusing. The forward slash separator and the two
> numbers immediately on each side of which are likely to be interpreted as
> being one unit (i.e. 2757/3476) but they're not. Also nothing is labeled,
> leaving the user to wonder what these numbers are.
> 
> Add labels, spaces, etc. to help clarify the information bitbake is trying to
> convey. The resulting line would appear as:
> 
> 	30 running tasks (setscene:2757/2757 tasks:3476/6390)
> 
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> ---
> changes since v1:
> - improve the commit message
> - remove the redundant word "Currently" in order to help keep the total
>   line length manageable for users of 80-column terminals
> ---
>  lib/bb/ui/knotty.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
> index 484545a6..c2a7d06e 100644
> --- a/lib/bb/ui/knotty.py
> +++ b/lib/bb/ui/knotty.py
> @@ -276,11 +276,11 @@ class TerminalFilter(object):
>              print(content)
>          else:
>              if self.quiet:
> -                content = "Running tasks (%s of %s/%s of %s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
> +                content = "Running tasks (setscene:%s/%s tasks:%s/%s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
>              elif not len(activetasks):
> -                content = "No currently running tasks (%s of %s/%s of %s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
> +                content = "No currently running tasks (setscene:%s/%s tasks:%s/%s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)

Remove "currently" to keep the formatting consistent.

>              else:
> -                content = "Currently %2s running tasks (%s of %s/%s of %s)" % (len(activetasks), self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
> +                content = "%2s running tasks (setscene:%s/%s  tasks:%s/%s)" % (len(activetasks), self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)

Remove one of the two spaces between setscene:%s/%s and tasks:%s/%s 
to keep the formatting consistent.

>              maxtask = self.helper.tasknumber_total
>              if not self.main_progress or self.main_progress.maxval != maxtask:
>                  widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()]
> --
> 2.34.1.75.gabe6bb3905

//Peter

Patch

diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 484545a6..c2a7d06e 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -276,11 +276,11 @@  class TerminalFilter(object):
             print(content)
         else:
             if self.quiet:
-                content = "Running tasks (%s of %s/%s of %s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
+                content = "Running tasks (setscene:%s/%s tasks:%s/%s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
             elif not len(activetasks):
-                content = "No currently running tasks (%s of %s/%s of %s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
+                content = "No currently running tasks (setscene:%s/%s tasks:%s/%s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
             else:
-                content = "Currently %2s running tasks (%s of %s/%s of %s)" % (len(activetasks), self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
+                content = "%2s running tasks (setscene:%s/%s  tasks:%s/%s)" % (len(activetasks), self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
             maxtask = self.helper.tasknumber_total
             if not self.main_progress or self.main_progress.maxval != maxtask:
                 widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()]