summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorPeter Kjellerstedt <pkj@axis.com>2020-01-11 04:01:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-28 11:51:03 +0000
commita74b608224bd709f4723e76a8d92c3a58a927ed9 (patch)
treec296ca2d0dcca25ae6a0dfc36a026d6c9710b1c4 /bitbake/lib
parent3d92e6b49d50866fe9e920f6a1b8140df75f5f42 (diff)
downloadpoky-a74b608224bd709f4723e76a8d92c3a58a927ed9.tar.gz
bitbake: knotty: Be consistent when creating/updating progress bars
When creating a new progress bar (using BBProgress), a colon was appended to the supplied message. However, when updating the message, no colon was appended. Change this so that the colon is instead part of the widgets that make up the progress bar so that it does not matter when and how the message is updated, it always displays the same. (Bitbake rev: 1115a14c93dc44124c3ab95053142da78032a004) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 08f35c04f6e1ce4c4ca5c2bef4cd8a192e12e682) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/ui/knotty.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index ddcb214867..c6abb2a114 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -35,15 +35,15 @@ class BBProgress(progressbar.ProgressBar):
35 self.msg = msg 35 self.msg = msg
36 self.extrapos = extrapos 36 self.extrapos = extrapos
37 if not widgets: 37 if not widgets:
38 widgets = [progressbar.Percentage(), ' ', progressbar.Bar(), ' ', 38 widgets = [': ', progressbar.Percentage(), ' ', progressbar.Bar(),
39 progressbar.ETA()] 39 ' ', progressbar.ETA()]
40 self.extrapos = 4 40 self.extrapos = 5
41 41
42 if resize_handler: 42 if resize_handler:
43 self._resize_default = resize_handler 43 self._resize_default = resize_handler
44 else: 44 else:
45 self._resize_default = signal.getsignal(signal.SIGWINCH) 45 self._resize_default = signal.getsignal(signal.SIGWINCH)
46 progressbar.ProgressBar.__init__(self, maxval, [self.msg + ": "] + widgets, fd=sys.stdout) 46 progressbar.ProgressBar.__init__(self, maxval, [self.msg] + widgets, fd=sys.stdout)
47 47
48 def _handle_resize(self, signum=None, frame=None): 48 def _handle_resize(self, signum=None, frame=None):
49 progressbar.ProgressBar._handle_resize(self, signum, frame) 49 progressbar.ProgressBar._handle_resize(self, signum, frame)
@@ -255,10 +255,10 @@ class TerminalFilter(object):
255 start_time = activetasks[t].get("starttime", None) 255 start_time = activetasks[t].get("starttime", None)
256 if not pbar or pbar.bouncing != (progress < 0): 256 if not pbar or pbar.bouncing != (progress < 0):
257 if progress < 0: 257 if progress < 0:
258 pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], activetasks[t]["pid"]), 100, widgets=[progressbar.BouncingSlider(), ''], extrapos=2, resize_handler=self.sigwinch_handle) 258 pbar = BBProgress("0: %s (pid %s)" % (activetasks[t]["title"], activetasks[t]["pid"]), 100, widgets=[' ', progressbar.BouncingSlider(), ''], extrapos=3, resize_handler=self.sigwinch_handle)
259 pbar.bouncing = True 259 pbar.bouncing = True
260 else: 260 else:
261 pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], activetasks[t]["pid"]), 100, widgets=[progressbar.Percentage(), ' ', progressbar.Bar(), ''], extrapos=4, resize_handler=self.sigwinch_handle) 261 pbar = BBProgress("0: %s (pid %s)" % (activetasks[t]["title"], activetasks[t]["pid"]), 100, widgets=[' ', progressbar.Percentage(), ' ', progressbar.Bar(), ''], extrapos=5, resize_handler=self.sigwinch_handle)
262 pbar.bouncing = False 262 pbar.bouncing = False
263 activetasks[t]["progressbar"] = pbar 263 activetasks[t]["progressbar"] = pbar
264 tasks.append((pbar, progress, rate, start_time)) 264 tasks.append((pbar, progress, rate, start_time))