summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/uihelper.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/ui/uihelper.py')
-rw-r--r--bitbake/lib/bb/ui/uihelper.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/uihelper.py b/bitbake/lib/bb/ui/uihelper.py
new file mode 100644
index 0000000000..151ffc5854
--- /dev/null
+++ b/bitbake/lib/bb/ui/uihelper.py
@@ -0,0 +1,49 @@
1# ex:ts=4:sw=4:sts=4:et
2# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
3#
4# Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer
5# Copyright (C) 2006 - 2007 Richard Purdie
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 2 as
9# published by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program; if not, write to the Free Software Foundation, Inc.,
18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20class BBUIHelper:
21 def __init__(self):
22 self.needUpdate = False
23 self.running_tasks = {}
24 self.failed_tasks = {}
25
26 def eventHandler(self, event):
27 if isinstance(event, bb.build.TaskStarted):
28 self.running_tasks["%s %s\n" % (event._package, event._task)] = ""
29 self.needUpdate = True
30 if isinstance(event, bb.build.TaskSucceeded):
31 del self.running_tasks["%s %s\n" % (event._package, event._task)]
32 self.needUpdate = True
33 if isinstance(event, bb.build.TaskFailed):
34 del self.running_tasks["%s %s\n" % (event._package, event._task)]
35 self.failed_tasks["%s %s\n" % (event._package, event._task)] = ""
36 self.needUpdate = True
37
38 # Add runqueue event handling
39 #if isinstance(event, bb.runqueue.runQueueTaskCompleted):
40 # a = 1
41 #if isinstance(event, bb.runqueue.runQueueTaskStarted):
42 # a = 1
43 #if isinstance(event, bb.runqueue.runQueueTaskFailed):
44 # a = 1
45 #if isinstance(event, bb.runqueue.runQueueExitWait):
46 # a = 1
47
48 def getTasks(self):
49 return (self.running_tasks, self.failed_tasks)