summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/knotty.py
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-13 13:12:23 +0000
commitfbe8b3e3e97ee20e66cafdf2763f58fd39bcc5e5 (patch)
tree49ec7ed9d997837d1f3b46a294296d8f7c30b1b3 /bitbake/lib/bb/ui/knotty.py
parent5c935fb29c9293eb7b92828814b3e8500d8a1724 (diff)
downloadpoky-fbe8b3e3e97ee20e66cafdf2763f58fd39bcc5e5.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: 08f35c04f6e1ce4c4ca5c2bef4cd8a192e12e682) 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.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))