diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-03-24 16:56:12 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:32 +0100 |
commit | 7acc132cac873e60005516272473a55a8160b9c4 (patch) | |
tree | 2e4122862ffd856803160b6089fcb979d3efd630 /bitbake/lib/bb/ui/crumbs | |
parent | bbf83fd988ca3cf9dae7d2b542a11a7c942b1702 (diff) | |
download | poky-7acc132cac873e60005516272473a55a8160b9c4.tar.gz |
Formatting cleanups
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/__init__.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/buildmanager.py | 39 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/runningbuild.py | 24 |
3 files changed, 30 insertions, 34 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/__init__.py b/bitbake/lib/bb/ui/crumbs/__init__.py index c6a377a8e6..a4805ed028 100644 --- a/bitbake/lib/bb/ui/crumbs/__init__.py +++ b/bitbake/lib/bb/ui/crumbs/__init__.py | |||
@@ -15,4 +15,3 @@ | |||
15 | # You should have received a copy of the GNU General Public License along | 15 | # You should have received a copy of the GNU General Public License along |
16 | # with this program; if not, write to the Free Software Foundation, Inc., | 16 | # with this program; if not, write to the Free Software Foundation, Inc., |
17 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 17 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
18 | |||
diff --git a/bitbake/lib/bb/ui/crumbs/buildmanager.py b/bitbake/lib/bb/ui/crumbs/buildmanager.py index f89e8eefd4..f5a15329d5 100644 --- a/bitbake/lib/bb/ui/crumbs/buildmanager.py +++ b/bitbake/lib/bb/ui/crumbs/buildmanager.py | |||
@@ -28,7 +28,7 @@ import time | |||
28 | class BuildConfiguration: | 28 | class BuildConfiguration: |
29 | """ Represents a potential *or* historic *or* concrete build. It | 29 | """ Represents a potential *or* historic *or* concrete build. It |
30 | encompasses all the things that we need to tell bitbake to do to make it | 30 | encompasses all the things that we need to tell bitbake to do to make it |
31 | build what we want it to build. | 31 | build what we want it to build. |
32 | 32 | ||
33 | It also stored the metadata URL and the set of possible machines (and the | 33 | It also stored the metadata URL and the set of possible machines (and the |
34 | distros / images / uris for these. Apart from the metdata URL these are | 34 | distros / images / uris for these. Apart from the metdata URL these are |
@@ -73,8 +73,8 @@ class BuildConfiguration: | |||
73 | return self.urls | 73 | return self.urls |
74 | 74 | ||
75 | # It might be a lot lot better if we stored these in like, bitbake conf | 75 | # It might be a lot lot better if we stored these in like, bitbake conf |
76 | # file format. | 76 | # file format. |
77 | @staticmethod | 77 | @staticmethod |
78 | def load_from_file (filename): | 78 | def load_from_file (filename): |
79 | f = open (filename, "r") | 79 | f = open (filename, "r") |
80 | 80 | ||
@@ -140,13 +140,13 @@ class BuildResult(gobject.GObject): | |||
140 | ".conf" in the directory for the build. | 140 | ".conf" in the directory for the build. |
141 | 141 | ||
142 | This is GObject so that it can be included in the TreeStore.""" | 142 | This is GObject so that it can be included in the TreeStore.""" |
143 | 143 | ||
144 | (STATE_COMPLETE, STATE_FAILED, STATE_ONGOING) = \ | 144 | (STATE_COMPLETE, STATE_FAILED, STATE_ONGOING) = \ |
145 | (0, 1, 2) | 145 | (0, 1, 2) |
146 | 146 | ||
147 | def __init__ (self, parent, identifier): | 147 | def __init__ (self, parent, identifier): |
148 | gobject.GObject.__init__ (self) | 148 | gobject.GObject.__init__ (self) |
149 | self.date = None | 149 | self.date = None |
150 | 150 | ||
151 | self.files = [] | 151 | self.files = [] |
152 | self.status = None | 152 | self.status = None |
@@ -181,7 +181,7 @@ class BuildResult(gobject.GObject): | |||
181 | self.add_file (file) | 181 | self.add_file (file) |
182 | 182 | ||
183 | def add_file (self, file): | 183 | def add_file (self, file): |
184 | # Just add the file for now. Don't care about the type. | 184 | # Just add the file for now. Don't care about the type. |
185 | self.files += [(file, None)] | 185 | self.files += [(file, None)] |
186 | 186 | ||
187 | class BuildManagerModel (gtk.TreeStore): | 187 | class BuildManagerModel (gtk.TreeStore): |
@@ -194,7 +194,7 @@ class BuildManagerModel (gtk.TreeStore): | |||
194 | 194 | ||
195 | def __init__ (self): | 195 | def __init__ (self): |
196 | gtk.TreeStore.__init__ (self, | 196 | gtk.TreeStore.__init__ (self, |
197 | gobject.TYPE_STRING, | 197 | gobject.TYPE_STRING, |
198 | gobject.TYPE_STRING, | 198 | gobject.TYPE_STRING, |
199 | gobject.TYPE_STRING, | 199 | gobject.TYPE_STRING, |
200 | gobject.TYPE_STRING, | 200 | gobject.TYPE_STRING, |
@@ -207,7 +207,7 @@ class BuildManager (gobject.GObject): | |||
207 | "results" directory but is also used for starting a new build.""" | 207 | "results" directory but is also used for starting a new build.""" |
208 | 208 | ||
209 | __gsignals__ = { | 209 | __gsignals__ = { |
210 | 'population-finished' : (gobject.SIGNAL_RUN_LAST, | 210 | 'population-finished' : (gobject.SIGNAL_RUN_LAST, |
211 | gobject.TYPE_NONE, | 211 | gobject.TYPE_NONE, |
212 | ()), | 212 | ()), |
213 | 'populate-error' : (gobject.SIGNAL_RUN_LAST, | 213 | 'populate-error' : (gobject.SIGNAL_RUN_LAST, |
@@ -220,13 +220,13 @@ class BuildManager (gobject.GObject): | |||
220 | date = long (time.mktime (result.date.timetuple())) | 220 | date = long (time.mktime (result.date.timetuple())) |
221 | 221 | ||
222 | # Add a top level entry for the build | 222 | # Add a top level entry for the build |
223 | 223 | ||
224 | self.model.set (iter, | 224 | self.model.set (iter, |
225 | BuildManagerModel.COL_IDENT, result.identifier, | 225 | BuildManagerModel.COL_IDENT, result.identifier, |
226 | BuildManagerModel.COL_DESC, result.conf.image, | 226 | BuildManagerModel.COL_DESC, result.conf.image, |
227 | BuildManagerModel.COL_MACHINE, result.conf.machine, | 227 | BuildManagerModel.COL_MACHINE, result.conf.machine, |
228 | BuildManagerModel.COL_DISTRO, result.conf.distro, | 228 | BuildManagerModel.COL_DISTRO, result.conf.distro, |
229 | BuildManagerModel.COL_BUILD_RESULT, result, | 229 | BuildManagerModel.COL_BUILD_RESULT, result, |
230 | BuildManagerModel.COL_DATE, date, | 230 | BuildManagerModel.COL_DATE, date, |
231 | BuildManagerModel.COL_STATE, result.state) | 231 | BuildManagerModel.COL_STATE, result.state) |
232 | 232 | ||
@@ -257,7 +257,7 @@ class BuildManager (gobject.GObject): | |||
257 | 257 | ||
258 | while (iter): | 258 | while (iter): |
259 | (ident, state) = self.model.get(iter, | 259 | (ident, state) = self.model.get(iter, |
260 | BuildManagerModel.COL_IDENT, | 260 | BuildManagerModel.COL_IDENT, |
261 | BuildManagerModel.COL_STATE) | 261 | BuildManagerModel.COL_STATE) |
262 | 262 | ||
263 | if state == BuildResult.STATE_ONGOING: | 263 | if state == BuildResult.STATE_ONGOING: |
@@ -422,29 +422,29 @@ class BuildManagerTreeView (gtk.TreeView): | |||
422 | 422 | ||
423 | # Misc descriptiony thing | 423 | # Misc descriptiony thing |
424 | renderer = gtk.CellRendererText () | 424 | renderer = gtk.CellRendererText () |
425 | col = gtk.TreeViewColumn (None, renderer, | 425 | col = gtk.TreeViewColumn (None, renderer, |
426 | text=BuildManagerModel.COL_DESC) | 426 | text=BuildManagerModel.COL_DESC) |
427 | self.append_column (col) | 427 | self.append_column (col) |
428 | 428 | ||
429 | # Machine | 429 | # Machine |
430 | renderer = gtk.CellRendererText () | 430 | renderer = gtk.CellRendererText () |
431 | col = gtk.TreeViewColumn ("Machine", renderer, | 431 | col = gtk.TreeViewColumn ("Machine", renderer, |
432 | text=BuildManagerModel.COL_MACHINE) | 432 | text=BuildManagerModel.COL_MACHINE) |
433 | self.append_column (col) | 433 | self.append_column (col) |
434 | 434 | ||
435 | # distro | 435 | # distro |
436 | renderer = gtk.CellRendererText () | 436 | renderer = gtk.CellRendererText () |
437 | col = gtk.TreeViewColumn ("Distribution", renderer, | 437 | col = gtk.TreeViewColumn ("Distribution", renderer, |
438 | text=BuildManagerModel.COL_DISTRO) | 438 | text=BuildManagerModel.COL_DISTRO) |
439 | self.append_column (col) | 439 | self.append_column (col) |
440 | 440 | ||
441 | # date (using a custom function for formatting the cell contents it | 441 | # date (using a custom function for formatting the cell contents it |
442 | # takes epoch -> human readable string) | 442 | # takes epoch -> human readable string) |
443 | renderer = gtk.CellRendererText () | 443 | renderer = gtk.CellRendererText () |
444 | col = gtk.TreeViewColumn ("Date", renderer, | 444 | col = gtk.TreeViewColumn ("Date", renderer, |
445 | text=BuildManagerModel.COL_DATE) | 445 | text=BuildManagerModel.COL_DATE) |
446 | self.append_column (col) | 446 | self.append_column (col) |
447 | col.set_cell_data_func (renderer, | 447 | col.set_cell_data_func (renderer, |
448 | self.date_format_custom_cell_data_func) | 448 | self.date_format_custom_cell_data_func) |
449 | 449 | ||
450 | # For status. | 450 | # For status. |
@@ -454,4 +454,3 @@ class BuildManagerTreeView (gtk.TreeView): | |||
454 | self.append_column (col) | 454 | self.append_column (col) |
455 | col.set_cell_data_func (renderer, | 455 | col.set_cell_data_func (renderer, |
456 | self.state_format_custom_cell_data_fun) | 456 | self.state_format_custom_cell_data_fun) |
457 | |||
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py index 18afd6674d..79e2c9060d 100644 --- a/bitbake/lib/bb/ui/crumbs/runningbuild.py +++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py | |||
@@ -24,7 +24,7 @@ import gobject | |||
24 | class RunningBuildModel (gtk.TreeStore): | 24 | class RunningBuildModel (gtk.TreeStore): |
25 | (COL_TYPE, COL_PACKAGE, COL_TASK, COL_MESSAGE, COL_ICON, COL_ACTIVE) = (0, 1, 2, 3, 4, 5) | 25 | (COL_TYPE, COL_PACKAGE, COL_TASK, COL_MESSAGE, COL_ICON, COL_ACTIVE) = (0, 1, 2, 3, 4, 5) |
26 | def __init__ (self): | 26 | def __init__ (self): |
27 | gtk.TreeStore.__init__ (self, | 27 | gtk.TreeStore.__init__ (self, |
28 | gobject.TYPE_STRING, | 28 | gobject.TYPE_STRING, |
29 | gobject.TYPE_STRING, | 29 | gobject.TYPE_STRING, |
30 | gobject.TYPE_STRING, | 30 | gobject.TYPE_STRING, |
@@ -34,7 +34,7 @@ class RunningBuildModel (gtk.TreeStore): | |||
34 | 34 | ||
35 | class RunningBuild (gobject.GObject): | 35 | class RunningBuild (gobject.GObject): |
36 | __gsignals__ = { | 36 | __gsignals__ = { |
37 | 'build-succeeded' : (gobject.SIGNAL_RUN_LAST, | 37 | 'build-succeeded' : (gobject.SIGNAL_RUN_LAST, |
38 | gobject.TYPE_NONE, | 38 | gobject.TYPE_NONE, |
39 | ()), | 39 | ()), |
40 | 'build-failed' : (gobject.SIGNAL_RUN_LAST, | 40 | 'build-failed' : (gobject.SIGNAL_RUN_LAST, |
@@ -82,12 +82,12 @@ class RunningBuild (gobject.GObject): | |||
82 | 82 | ||
83 | # Add the message to the tree either at the top level if parent is | 83 | # Add the message to the tree either at the top level if parent is |
84 | # None otherwise as a descendent of a task. | 84 | # None otherwise as a descendent of a task. |
85 | self.model.append (parent, | 85 | self.model.append (parent, |
86 | (event.__name__.split()[-1], # e.g. MsgWarn, MsgError | 86 | (event.__name__.split()[-1], # e.g. MsgWarn, MsgError |
87 | package, | 87 | package, |
88 | task, | 88 | task, |
89 | event._message, | 89 | event._message, |
90 | icon, | 90 | icon, |
91 | False)) | 91 | False)) |
92 | elif isinstance(event, bb.build.TaskStarted): | 92 | elif isinstance(event, bb.build.TaskStarted): |
93 | (package, task) = (event._package, event._task) | 93 | (package, task) = (event._package, event._task) |
@@ -101,10 +101,10 @@ class RunningBuild (gobject.GObject): | |||
101 | if (self.tasks_to_iter.has_key ((package, None))): | 101 | if (self.tasks_to_iter.has_key ((package, None))): |
102 | parent = self.tasks_to_iter[(package, None)] | 102 | parent = self.tasks_to_iter[(package, None)] |
103 | else: | 103 | else: |
104 | parent = self.model.append (None, (None, | 104 | parent = self.model.append (None, (None, |
105 | package, | 105 | package, |
106 | None, | 106 | None, |
107 | "Package: %s" % (package), | 107 | "Package: %s" % (package), |
108 | None, | 108 | None, |
109 | False)) | 109 | False)) |
110 | self.tasks_to_iter[(package, None)] = parent | 110 | self.tasks_to_iter[(package, None)] = parent |
@@ -114,10 +114,10 @@ class RunningBuild (gobject.GObject): | |||
114 | self.model.set(parent, self.model.COL_ICON, "gtk-execute") | 114 | self.model.set(parent, self.model.COL_ICON, "gtk-execute") |
115 | 115 | ||
116 | # Add an entry in the model for this task | 116 | # Add an entry in the model for this task |
117 | i = self.model.append (parent, (None, | 117 | i = self.model.append (parent, (None, |
118 | package, | 118 | package, |
119 | task, | 119 | task, |
120 | "Task: %s" % (task), | 120 | "Task: %s" % (task), |
121 | None, | 121 | None, |
122 | False)) | 122 | False)) |
123 | 123 | ||
@@ -176,5 +176,3 @@ class RunningBuildTreeView (gtk.TreeView): | |||
176 | renderer = gtk.CellRendererText () | 176 | renderer = gtk.CellRendererText () |
177 | col = gtk.TreeViewColumn ("Message", renderer, text=3) | 177 | col = gtk.TreeViewColumn ("Message", renderer, text=3) |
178 | self.append_column (col) | 178 | self.append_column (col) |
179 | |||
180 | |||