diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-21 23:49:17 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-21 23:49:17 +0000 |
commit | 5ebad0d500562a132067b423bb6711e8893f2859 (patch) | |
tree | 395567a09b82a0bf89331d32f927fbe77496ec79 /bitbake/lib/bb/ui | |
parent | 5c62833766048b83c0d7ea9e77194b9ca6af7fb1 (diff) | |
download | openembedded-core-5ebad0d500562a132067b423bb6711e8893f2859.tar.gz openembedded-core-5ebad0d500562a132067b423bb6711e8893f2859.tar.bz2 openembedded-core-5ebad0d500562a132067b423bb6711e8893f2859.tar.xz openembedded-core-5ebad0d500562a132067b423bb6711e8893f2859.zip |
knotty: Improve task failure message handling using the uihelper code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 20 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/uihelper.py | 11 |
2 files changed, 26 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index c69fd6ca6..7264c7916 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py @@ -23,6 +23,9 @@ import os import sys import itertools import xmlrpclib +from bb import ui +from bb.ui import uihelper + parsespin = itertools.cycle( r'|/-\\' ) @@ -32,6 +35,8 @@ def init(server, eventHandler): includelogs = server.runCommand(["getVariable", "BBINCLUDELOGS"]) loglines = server.runCommand(["getVariable", "BBINCLUDELOGS_LINES"]) + helper = uihelper.BBUIHelper() + try: cmdline = server.runCommand(["getCmdLineAction"]) #print cmdline @@ -53,6 +58,19 @@ def init(server, eventHandler): if event is None: continue #print event + helper.eventHandler(event) + if isinstance(event, bb.runqueue.runQueueExitWait): + if not shutdown: + shutdown = 1 + if shutdown and helper.needUpdate: + activetasks, failedtasks = helper.getTasks() + if activetasks: + print "Waiting for %s active tasks to finish:" % len(activetasks) + tasknum = 1 + for task in activetasks: + print "%s: %s (pid %s)" % (tasknum, activetasks[task]["title"], task) + tasknum = tasknum + 1 + if isinstance(event, bb.msg.MsgPlain): print event._message continue @@ -139,6 +157,8 @@ def init(server, eventHandler): continue if isinstance(event, bb.runqueue.runQueueEvent): continue + if isinstance(event, bb.runqueue.runQueueExitWait): + continue if isinstance(event, bb.event.StampUpdate): continue if isinstance(event, bb.event.ConfigParsed): diff --git a/bitbake/lib/bb/ui/uihelper.py b/bitbake/lib/bb/ui/uihelper.py index 151ffc585..698de03f0 100644 --- a/bitbake/lib/bb/ui/uihelper.py +++ b/bitbake/lib/bb/ui/uihelper.py @@ -21,18 +21,18 @@ class BBUIHelper: def __init__(self): self.needUpdate = False self.running_tasks = {} - self.failed_tasks = {} + self.failed_tasks = [] def eventHandler(self, event): if isinstance(event, bb.build.TaskStarted): - self.running_tasks["%s %s\n" % (event._package, event._task)] = "" + self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task) } self.needUpdate = True if isinstance(event, bb.build.TaskSucceeded): - del self.running_tasks["%s %s\n" % (event._package, event._task)] + del self.running_tasks[event.pid] self.needUpdate = True if isinstance(event, bb.build.TaskFailed): - del self.running_tasks["%s %s\n" % (event._package, event._task)] - self.failed_tasks["%s %s\n" % (event._package, event._task)] = "" + del self.running_tasks[event.pid] + self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)}) self.needUpdate = True # Add runqueue event handling @@ -46,4 +46,5 @@ class BBUIHelper: # a = 1 def getTasks(self): + self.needUpdate = False return (self.running_tasks, self.failed_tasks) |