diff options
| author | Richard Purdie <richard@openedhand.com> | 2008-09-30 15:08:33 +0000 |
|---|---|---|
| committer | Richard Purdie <richard@openedhand.com> | 2008-09-30 15:08:33 +0000 |
| commit | c30eddb243e7e65f67f656e62848a033cf6f2e5c (patch) | |
| tree | 110dd95788b76f55d31cb8d30aac2de8400b6f4a /bitbake-dev/lib/bb/ui/uihelper.py | |
| parent | 5ef0510474004eeb2ae8a99b64e2febb1920e077 (diff) | |
| download | poky-c30eddb243e7e65f67f656e62848a033cf6f2e5c.tar.gz | |
Add bitbake-dev to allow ease of testing and development of bitbake trunk
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5337 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake-dev/lib/bb/ui/uihelper.py')
| -rw-r--r-- | bitbake-dev/lib/bb/ui/uihelper.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/bitbake-dev/lib/bb/ui/uihelper.py b/bitbake-dev/lib/bb/ui/uihelper.py new file mode 100644 index 0000000000..246844c9d2 --- /dev/null +++ b/bitbake-dev/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 | |||
| 20 | class 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 event[0].startswith('bb.build.TaskStarted'): | ||
| 28 | self.running_tasks["%s %s\n" % (event[1]['_package'], event[1]['_task'])] = "" | ||
| 29 | self.needUpdate = True | ||
| 30 | if event[0].startswith('bb.build.TaskSucceeded'): | ||
| 31 | del self.running_tasks["%s %s\n" % (event[1]['_package'], event[1]['_task'])] | ||
| 32 | self.needUpdate = True | ||
| 33 | if event[0].startswith('bb.build.TaskFailed'): | ||
| 34 | del self.running_tasks["%s %s\n" % (event[1]['_package'], event[1]['_task'])] | ||
| 35 | self.failed_tasks["%s %s\n" % (event[1]['_package'], event[1]['_task'])] = "" | ||
| 36 | self.needUpdate = True | ||
| 37 | |||
| 38 | # Add runqueue event handling | ||
| 39 | #if event[0].startswith('bb.runqueue.runQueueTaskCompleted'): | ||
| 40 | # a = 1 | ||
| 41 | #if event[0].startswith('bb.runqueue.runQueueTaskStarted'): | ||
| 42 | # a = 1 | ||
| 43 | #if event[0].startswith('bb.runqueue.runQueueTaskFailed'): | ||
| 44 | # a = 1 | ||
| 45 | #if event[0].startswith('bb.runqueue.runQueueExitWait'): | ||
| 46 | # a = 1 | ||
| 47 | |||
| 48 | def getTasks(self): | ||
| 49 | return (self.running_tasks, self.failed_tasks) | ||
