Patchwork [bitbake-devel] ui/knotty: give out start time of task

login
register
mail settings
Submitter Enrico Scholz
Date Aug. 22, 2012, 5:09 p.m.
Message ID <1345655353-13549-1-git-send-email-enrico.scholz@sigma-chemnitz.de>
Download mbox | patch
Permalink /patch/35143/
State New
Headers show

Comments

Enrico Scholz - Aug. 22, 2012, 5:09 p.m.
For long running tasks like compiling qt it might be interesting to know
when the task has been started.  Patch prints this information by using
the %X modifier (locale dependent presentation of time without date).

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
---
 lib/bb/ui/knotty.py   | 3 ++-
 lib/bb/ui/uihelper.py | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

Patch

diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 858cacf..60d5886 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -190,7 +190,8 @@  class TerminalFilter(object):
             return
         tasks = []
         for t in runningpids:
-            tasks.append("%s (pid %s)" % (activetasks[t]["title"], t))
+            tasks.append("%s - %s (pid %s)" %
+                         (activetasks[t]["started_str"], activetasks[t]["title"], t))
 
         if self.main.shutdown:
             content = "Waiting for %s running tasks to finish:" % len(activetasks)
diff --git a/lib/bb/ui/uihelper.py b/lib/bb/ui/uihelper.py
index e408b04..ae97c78 100644
--- a/lib/bb/ui/uihelper.py
+++ b/lib/bb/ui/uihelper.py
@@ -18,6 +18,7 @@ 
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 import bb.build
+import time
 
 class BBUIHelper:
     def __init__(self):
@@ -31,7 +32,8 @@  class BBUIHelper:
 
     def eventHandler(self, event):
         if isinstance(event, bb.build.TaskStarted):
-            self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task) }
+            self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task),
+                                              'started_str' : time.strftime("%X") }
             self.running_pids.append(event.pid)
             self.needUpdate = True
         if isinstance(event, bb.build.TaskSucceeded):