summaryrefslogtreecommitdiffstats
path: root/lib/bb/ui/uihelper.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-26 13:36:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-15 22:50:20 +0000
commit17e68cfc6018b93d19738a6a874dfdea23fbab11 (patch)
tree4ecf0cb4f99e6a9714f27da682ec775911ccb437 /lib/bb/ui/uihelper.py
parent0347e99ca5c232832f2b490584d76872c6d77311 (diff)
downloadbitbake-contrib-17e68cfc6018b93d19738a6a874dfdea23fbab11.tar.gz
ui/uihelper: Keep track of task numbers
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>
Diffstat (limited to 'lib/bb/ui/uihelper.py')
-rw-r--r--lib/bb/ui/uihelper.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/ui/uihelper.py b/lib/bb/ui/uihelper.py
index 03fac593b..c96f381c5 100644
--- a/lib/bb/ui/uihelper.py
+++ b/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):
@@ -40,6 +42,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