summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/knotty.py
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2022-03-08 15:32:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-11 06:56:01 +0000
commitaf7a4af979684234607b0fbacc92e0cfdd6e268e (patch)
treef88745998b4df8990c50bfa5f375c7381527d6c5 /bitbake/lib/bb/ui/knotty.py
parent553856138cd1078e8dae32775603f0af300717d9 (diff)
downloadpoky-af7a4af979684234607b0fbacc92e0cfdd6e268e.tar.gz
bitbake: knotty.py: Correct the width of the progress bar for the real tasks
In commit 8055ec36 (knotty: Improve setscene task display) the setscene tasks got their own line in the task output. However, the progress bar code does not handle newlines in its widgets, so the length of the setscene line was included when calculating how much space is available for the progress bar of the running tasks, making it much too short. Instead of trying to teach the progress bar code to handle newlines, separate the output of the setscene tasks from the progress bar for the real tasks. (Bitbake rev: a41f7792f17acdba8c7ea83b79e413ae6a49da68) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/knotty.py')
-rw-r--r--bitbake/lib/bb/ui/knotty.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index a520895da2..52e6eb96fe 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -278,22 +278,31 @@ class TerminalFilter(object):
278 content += ':' 278 content += ':'
279 print(content) 279 print(content)
280 else: 280 else:
281 scene_tasks = "%s of %s" % (self.helper.setscene_current, self.helper.setscene_total)
282 cur_tasks = "%s of %s" % (self.helper.tasknumber_current, self.helper.tasknumber_total)
283
284 content = ''
285 if not self.quiet:
286 msg = "Setscene tasks: %s" % scene_tasks
287 content += msg + "\n"
288 print(msg)
289
281 if self.quiet: 290 if self.quiet:
282 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) 291 msg = "Running tasks (%s, %s)" % (scene_tasks, cur_tasks)
283 elif not len(activetasks): 292 elif not len(activetasks):
284 content = "Setscene tasks: %s of %s\nNo currently running tasks (%s of %s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total) 293 msg = "No currently running tasks (%s)" % cur_tasks
285 else: 294 else:
286 content = "Setscene tasks: %s of %s\nCurrently %2s running tasks (%s of %s)" % (self.helper.setscene_current, self.helper.setscene_total, len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total) 295 msg = "Currently %2s running tasks (%s)" % (len(activetasks), cur_tasks)
287 maxtask = self.helper.tasknumber_total 296 maxtask = self.helper.tasknumber_total
288 if not self.main_progress or self.main_progress.maxval != maxtask: 297 if not self.main_progress or self.main_progress.maxval != maxtask:
289 widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()] 298 widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()]
290 self.main_progress = BBProgress("Running tasks", maxtask, widgets=widgets, resize_handler=self.sigwinch_handle) 299 self.main_progress = BBProgress("Running tasks", maxtask, widgets=widgets, resize_handler=self.sigwinch_handle)
291 self.main_progress.start(False) 300 self.main_progress.start(False)
292 self.main_progress.setmessage(content) 301 self.main_progress.setmessage(msg)
293 progress = self.helper.tasknumber_current - 1 302 progress = self.helper.tasknumber_current - 1
294 if progress < 0: 303 if progress < 0:
295 progress = 0 304 progress = 0
296 content = self.main_progress.update(progress) 305 content += self.main_progress.update(progress)
297 print('') 306 print('')
298 lines = self.getlines(content) 307 lines = self.getlines(content)
299 if self.quiet == 0: 308 if self.quiet == 0: