summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/knotty.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/ui/knotty.py')
-rw-r--r--bitbake/lib/bb/ui/knotty.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index fa88e6ccdd..f362c23afc 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -222,6 +222,18 @@ class TerminalFilter(object):
222 sys.stdout.flush() 222 sys.stdout.flush()
223 self.footer_present = False 223 self.footer_present = False
224 224
225 def elapsed(self, sec):
226 hrs = int(sec / 3600.0)
227 sec -= hrs * 3600
228 min = int(sec / 60.0)
229 sec -= min * 60
230 if hrs > 0:
231 return "%dh%dm%ds" % (hrs, min, sec)
232 elif min > 0:
233 return "%dm%ds" % (min, sec)
234 else:
235 return "%ds" % (sec)
236
225 def updateFooter(self): 237 def updateFooter(self):
226 if not self.cuu: 238 if not self.cuu:
227 return 239 return
@@ -258,7 +270,7 @@ class TerminalFilter(object):
258 else: 270 else:
259 start_time = activetasks[t].get("starttime", None) 271 start_time = activetasks[t].get("starttime", None)
260 if start_time: 272 if start_time:
261 tasks.append("%s - %ds (pid %s)" % (activetasks[t]["title"], currenttime - start_time, t)) 273 tasks.append("%s - %s (pid %s)" % (activetasks[t]["title"], self.elapsed(currenttime - start_time), t))
262 else: 274 else:
263 tasks.append("%s (pid %s)" % (activetasks[t]["title"], t)) 275 tasks.append("%s (pid %s)" % (activetasks[t]["title"], t))
264 276