All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ui/uihelper: Keep track of task numbers
@ 2011-11-26 13:44 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2011-11-26 13:44 UTC (permalink / raw)
  To: bitbake-devel

Add code so the uihelper keeps track of how may tasks we've run and
how many tasks there are in total so UIs don't have to track
this information themselves.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/ui/uihelper.py b/bitbake/lib/bb/ui/uihelper.py
index 617d60d..a73bfbe 100644
--- a/bitbake/lib/bb/ui/uihelper.py
+++ b/bitbake/lib/bb/ui/uihelper.py
@@ -24,6 +24,8 @@ class BBUIHelper:
         self.needUpdate = False
         self.running_tasks = {}
         self.failed_tasks = []
+        self.tasknumber_current = 0
+        self.tasknumber_total = 0
 
     def eventHandler(self, event):
         if isinstance(event, bb.build.TaskStarted):
@@ -36,6 +38,9 @@ class BBUIHelper:
             del self.running_tasks[event.pid]
             self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)})
             self.needUpdate = True
+        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
 
     def getTasks(self):
         self.needUpdate = False





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-11-26 13:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-26 13:44 [PATCH] ui/uihelper: Keep track of task numbers Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.