Patchwork [bitbake-devel,v4,09/18] knotty2.py: Fix knotty2 to report something other than 0 of 0 for setscene tasks

login
register
mail settings
Submitter Jason Wessel
Date June 8, 2012, 1:41 p.m.
Message ID <1339162913-23759-10-git-send-email-jason.wessel@windriver.com>
Download mbox | patch
Permalink /patch/29497/
State New
Headers show

Comments

Jason Wessel - June 8, 2012, 1:41 p.m.
Any time knotty2 was running through the setscene tasks it was always
reporting the top line as follows for a core-image-minimal build.

    Currently 7 running tasks (0 of 0):

With this patch the number of SetScene tasks are tracked and reported
with knotty such that it nows looks something like:

    Currently 7 running SetScene tasks (342 of 479):

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 lib/bb/ui/knotty2.py  |    5 ++++-
 lib/bb/ui/uihelper.py |    5 +++++
 2 files changed, 9 insertions(+), 1 deletion(-)

Patch

diff --git a/lib/bb/ui/knotty2.py b/lib/bb/ui/knotty2.py
index 01693e9..9e3619b 100644
--- a/lib/bb/ui/knotty2.py
+++ b/lib/bb/ui/knotty2.py
@@ -97,7 +97,10 @@  class TerminalFilter2(object):
         if self.main.shutdown:
             print("Waiting for %s running tasks to finish:" % len(activetasks))
         else:
-            print("Currently %s running tasks (%s of %s):" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total))
+            if self.helper.tasknumber_current == 0:
+                print("Currently %s running SetScene tasks (%s of %s):" % (len(activetasks), self.helper.sc_tasknumber_current, self.helper.sc_tasknumber_total))
+            else:
+                print("Currently %s running tasks (%s of %s):" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total))
         for tasknum, task in enumerate(tasks):
             print("%s: %s" % (tasknum, task))
             lines = lines + 1
diff --git a/lib/bb/ui/uihelper.py b/lib/bb/ui/uihelper.py
index 2c78695..84af5a3 100644
--- a/lib/bb/ui/uihelper.py
+++ b/lib/bb/ui/uihelper.py
@@ -28,6 +28,8 @@  class BBUIHelper:
         self.failed_tasks = []
         self.tasknumber_current = 0
         self.tasknumber_total = 0
+        self.sc_tasknumber_current = 0
+        self.sc_tasknumber_current = 0
 
     def eventHandler(self, event):
         if isinstance(event, bb.build.TaskStarted):
@@ -48,6 +50,9 @@  class BBUIHelper:
             self.running_pids.remove(event.pid)
             self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)})
             self.needUpdate = True
+        if isinstance(event, bb.runqueue.sceneQueueTaskStarted):
+            self.sc_tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + 1
+            self.sc_tasknumber_total = event.stats.total
         if isinstance(event, bb.runqueue.runQueueTaskStarted):
             self.tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + 1
             self.tasknumber_total = event.stats.total