diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-26 13:36:22 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-15 22:56:16 +0000 |
commit | b1256965bb0d5e97862b5bcddc5864a491794741 (patch) | |
tree | 97c5491cf66bb94fe38a2bfbc4406ad84195e51c /bitbake | |
parent | 82b6146ef29f06bb2ded19aa320b1933e1560fe5 (diff) | |
download | poky-b1256965bb0d5e97862b5bcddc5864a491794741.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.
(Bitbake rev: 17e68cfc6018b93d19738a6a874dfdea23fbab11)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/uihelper.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/uihelper.py b/bitbake/lib/bb/ui/uihelper.py index 03fac593bd..c96f381c54 100644 --- a/bitbake/lib/bb/ui/uihelper.py +++ b/bitbake/lib/bb/ui/uihelper.py | |||
@@ -24,6 +24,8 @@ class BBUIHelper: | |||
24 | self.needUpdate = False | 24 | self.needUpdate = False |
25 | self.running_tasks = {} | 25 | self.running_tasks = {} |
26 | self.failed_tasks = [] | 26 | self.failed_tasks = [] |
27 | self.tasknumber_current = 0 | ||
28 | self.tasknumber_total = 0 | ||
27 | 29 | ||
28 | def eventHandler(self, event): | 30 | def eventHandler(self, event): |
29 | if isinstance(event, bb.build.TaskStarted): | 31 | if isinstance(event, bb.build.TaskStarted): |
@@ -40,6 +42,9 @@ class BBUIHelper: | |||
40 | del self.running_tasks[event.pid] | 42 | del self.running_tasks[event.pid] |
41 | self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)}) | 43 | self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)}) |
42 | self.needUpdate = True | 44 | self.needUpdate = True |
45 | if isinstance(event, bb.runqueue.runQueueTaskStarted): | ||
46 | self.tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + 1 | ||
47 | self.tasknumber_total = event.stats.total | ||
43 | 48 | ||
44 | def getTasks(self): | 49 | def getTasks(self): |
45 | self.needUpdate = False | 50 | self.needUpdate = False |