summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/ui/knotty.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index e8e169fe67..b92334b02d 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -40,9 +40,9 @@ logger = logging.getLogger("BitBake")
40interactive = sys.stdout.isatty() 40interactive = sys.stdout.isatty()
41 41
42class BBProgress(progressbar.ProgressBar): 42class BBProgress(progressbar.ProgressBar):
43 def __init__(self, msg, maxval, widgets=None): 43 def __init__(self, msg, maxval, widgets=None, extrapos=-1):
44 self.msg = msg 44 self.msg = msg
45 self.extrapos = -1 45 self.extrapos = extrapos
46 if not widgets: 46 if not widgets:
47 widgets = [progressbar.Percentage(), ' ', progressbar.Bar(), ' ', 47 widgets = [progressbar.Percentage(), ' ', progressbar.Bar(), ' ',
48 progressbar.ETA()] 48 progressbar.ETA()]
@@ -69,15 +69,16 @@ class BBProgress(progressbar.ProgressBar):
69 self.widgets[0] = msg 69 self.widgets[0] = msg
70 70
71 def setextra(self, extra): 71 def setextra(self, extra):
72 if extra: 72 if self.extrapos > -1:
73 extrastr = str(extra) 73 if extra:
74 if extrastr[0] != ' ': 74 extrastr = str(extra)
75 extrastr = ' ' + extrastr 75 if extrastr[0] != ' ':
76 if extrastr[-1] != ' ': 76 extrastr = ' ' + extrastr
77 extrastr += ' ' 77 if extrastr[-1] != ' ':
78 else: 78 extrastr += ' '
79 extrastr = ' ' 79 else:
80 self.widgets[self.extrapos] = extrastr 80 extrastr = ' '
81 self.widgets[self.extrapos] = extrastr
81 82
82 def _need_update(self): 83 def _need_update(self):
83 # We always want the bar to print when update() is called 84 # We always want the bar to print when update() is called
@@ -241,7 +242,7 @@ class TerminalFilter(object):
241 start_time = activetasks[t].get("starttime", None) 242 start_time = activetasks[t].get("starttime", None)
242 if not pbar or pbar.bouncing != (progress < 0): 243 if not pbar or pbar.bouncing != (progress < 0):
243 if progress < 0: 244 if progress < 0:
244 pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.BouncingSlider()]) 245 pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.BouncingSlider(), ''], extrapos=2)
245 pbar.bouncing = True 246 pbar.bouncing = True
246 else: 247 else:
247 pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100) 248 pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100)