summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/ui/knotty.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 6fdaafedb7..c245c22dc7 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -89,6 +89,7 @@ class NonInteractiveProgress(object):
89 def __init__(self, msg, maxval): 89 def __init__(self, msg, maxval):
90 self.msg = msg 90 self.msg = msg
91 self.maxval = maxval 91 self.maxval = maxval
92 self.finished = False
92 93
93 def start(self, update=True): 94 def start(self, update=True):
94 self.fobj.write("%s..." % self.msg) 95 self.fobj.write("%s..." % self.msg)
@@ -99,8 +100,11 @@ class NonInteractiveProgress(object):
99 pass 100 pass
100 101
101 def finish(self): 102 def finish(self):
103 if self.finished:
104 return
102 self.fobj.write("done.\n") 105 self.fobj.write("done.\n")
103 self.fobj.flush() 106 self.fobj.flush()
107 self.finished = True
104 108
105def new_progress(msg, maxval): 109def new_progress(msg, maxval):
106 if interactive: 110 if interactive:
@@ -204,6 +208,8 @@ class TerminalFilter(object):
204 console.addFilter(InteractConsoleLogFilter(self, format)) 208 console.addFilter(InteractConsoleLogFilter(self, format))
205 errconsole.addFilter(InteractConsoleLogFilter(self, format)) 209 errconsole.addFilter(InteractConsoleLogFilter(self, format))
206 210
211 self.main_progress = None
212
207 def clearFooter(self): 213 def clearFooter(self):
208 if self.footer_present: 214 if self.footer_present:
209 lines = self.footer_present 215 lines = self.footer_present
@@ -246,11 +252,20 @@ class TerminalFilter(object):
246 252
247 if self.main.shutdown: 253 if self.main.shutdown:
248 content = "Waiting for %s running tasks to finish:" % len(activetasks) 254 content = "Waiting for %s running tasks to finish:" % len(activetasks)
249 elif not len(activetasks): 255 print(content)
250 content = "No currently running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total)
251 else: 256 else:
252 content = "Currently %s running tasks (%s of %s):" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total) 257 if not len(activetasks):
253 print(content) 258 content = "No currently running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total)
259 else:
260 content = "Currently %2s running tasks (%s of %s)" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total)
261 maxtask = self.helper.tasknumber_total + 1
262 if not self.main_progress or self.main_progress.maxval != maxtask:
263 widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()]
264 self.main_progress = BBProgress("Running tasks", maxtask, widgets=widgets)
265 self.main_progress.start(False)
266 self.main_progress.setmessage(content)
267 self.main_progress.update(self.helper.tasknumber_current)
268 print('')
254 lines = 1 + int(len(content) / (self.columns + 1)) 269 lines = 1 + int(len(content) / (self.columns + 1))
255 for tasknum, task in enumerate(tasks[:(self.rows - 2)]): 270 for tasknum, task in enumerate(tasks[:(self.rows - 2)]):
256 if isinstance(task, tuple): 271 if isinstance(task, tuple):