bitbake: knotty: Show elapsed time for tasks with progressbar
PATCH 1/1 bitbake: knotty: Show elapsed time for tasks with progressbar
Signed-off-by Ola x Nilsson <[email protected]>
--- bitbake/lib/bb/ui/knotty.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
bitbake/lib/bb/ui/knotty.py +7 -3
@@ -32,6 +32,7 @@ import fcntl import struct import copy import atexit +import re from bb.ui import uihelper
@@ -248,10 +249,10 @@ class TerminalFilter(object): start_time = activetasks[t].get("starttime", None) if not pbar or pbar.bouncing != (progress < 0): if progress < 0: - pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.BouncingSlider(), ''], extrapos=2, resize_handler=self.sigwinch_handle) + pbar = BBProgress("0: %s - 0s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.BouncingSlider(), ''], extrapos=2, resize_handler=self.sigwinch_handle) pbar.bouncing = True else: - pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.Percentage(), ' ', progressbar.Bar(), ''], extrapos=4, resize_handler=self.sigwinch_handle) + pbar = BBProgress("0: %s - 0s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.Percentage(), ' ', progressbar.Bar(), ''], extrapos=4, resize_handler=self.sigwinch_handle) pbar.bouncing = False activetasks[t]["progressbar"] = pbar tasks.append((pbar, progress, rate, start_time))
@@ -292,7 +293,10 @@ class TerminalFilter(object): pbar.start(False) if start_time: pbar.start_time = start_time - pbar.setmessage('%s:%s' % (tasknum, pbar.msg.split(':', 1)[1])) + m = re.match(r'\d+: (.*) - \d+s (\(pid \d+\))', pbar.msg) + pbar.setmessage('%s: %s - %ds %s' % + (tasknum, m.group(1), + currenttime - pbar.start_time, m.group(2))) if progress > -1: pbar.setextra(rate) content = pbar.update(progress)
Signature · 1 line
2.1.4