summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-08-02 16:59:01 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-03 17:51:56 +0100
commitf353148390e093719a9734e46629a6570ef92557 (patch)
tree3a394f50812ac8e9559db00752976656c22dffba /bitbake
parent647643b65479ab46e7cbbdcb620222322be0f618 (diff)
downloadpoky-f353148390e093719a9734e46629a6570ef92557.tar.gz
bb/ui/crumbs/runningbuild: optionally create list entries sequentially
In b947e7aa405966262c0614cae02e7978ec637095 Bob changed the behaviour of the RunningBuildModel such that the items are added to the model in a non-sequential order. The messages in the view being listed out of order from how they are received is undesirable for users of the hob UI, therefore this patch adds an optional sequential parameter to the RunningBuild initialiser which, when set to True, will always append new messages so that the order shown in the view is that the messages are received in. The parameter defaults to to False such that the behaviour added by Bob is preserved. Partially addresses [YOCTO #1311] CC: Bob Foerster <robert@erafx.com> (Bitbake rev: b16663e1919fddbf63d0ca7f9ad3ffdc7d1121fd) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/crumbs/runningbuild.py37
1 files changed, 21 insertions, 16 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py
index bdab34040c..c4d6d33de5 100644
--- a/bitbake/lib/bb/ui/crumbs/runningbuild.py
+++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py
@@ -63,9 +63,10 @@ class RunningBuild (gobject.GObject):
63 pids_to_task = {} 63 pids_to_task = {}
64 tasks_to_iter = {} 64 tasks_to_iter = {}
65 65
66 def __init__ (self): 66 def __init__ (self, sequential=False):
67 gobject.GObject.__init__ (self) 67 gobject.GObject.__init__ (self)
68 self.model = RunningBuildModel() 68 self.model = RunningBuildModel()
69 self.sequential = sequential
69 70
70 def handle_event (self, event, pbar=None): 71 def handle_event (self, event, pbar=None):
71 # Handle an event from the event queue, this may result in updating 72 # Handle an event from the event queue, this may result in updating
@@ -105,18 +106,18 @@ class RunningBuild (gobject.GObject):
105 106
106 # if we know which package we belong to, we'll append onto its list. 107 # if we know which package we belong to, we'll append onto its list.
107 # otherwise, we'll jump to the top of the master list 108 # otherwise, we'll jump to the top of the master list
108 if parent: 109 if self.sequential or not parent:
109 tree_add = self.model.append 110 tree_add = self.model.append
110 else: 111 else:
111 tree_add = self.model.prepend 112 tree_add = self.model.prepend
112 tree_add(parent, 113 tree_add(parent,
113 (None, 114 (None,
114 package, 115 package,
115 task, 116 task,
116 event.getMessage(), 117 event.getMessage(),
117 icon, 118 icon,
118 color, 119 color,
119 0)) 120 0))
120 121
121 elif isinstance(event, bb.build.TaskStarted): 122 elif isinstance(event, bb.build.TaskStarted):
122 (package, task) = (event._package, event._task) 123 (package, task) = (event._package, event._task)
@@ -130,13 +131,17 @@ class RunningBuild (gobject.GObject):
130 if ((package, None) in self.tasks_to_iter): 131 if ((package, None) in self.tasks_to_iter):
131 parent = self.tasks_to_iter[(package, None)] 132 parent = self.tasks_to_iter[(package, None)]
132 else: 133 else:
133 parent = self.model.prepend(None, (None, 134 if self.sequential:
134 package, 135 add = self.model.append
135 None, 136 else:
136 "Package: %s" % (package), 137 add = self.model.prepend
137 None, 138 parent = add(None, (None,
138 Colors.OK, 139 package,
139 0)) 140 None,
141 "Package: %s" % (package),
142 None,
143 Colors.OK,
144 0))
140 self.tasks_to_iter[(package, None)] = parent 145 self.tasks_to_iter[(package, None)] = parent
141 146
142 # Because this parent package now has an active child mark it as 147 # Because this parent package now has an active child mark it as