summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/buildmanager.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-03-24 16:56:12 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:32 +0100
commit7acc132cac873e60005516272473a55a8160b9c4 (patch)
tree2e4122862ffd856803160b6089fcb979d3efd630 /bitbake/lib/bb/ui/crumbs/buildmanager.py
parentbbf83fd988ca3cf9dae7d2b542a11a7c942b1702 (diff)
downloadpoky-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/buildmanager.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/buildmanager.py39
1 files changed, 19 insertions, 20 deletions
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
28class BuildConfiguration: 28class 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
187class BuildManagerModel (gtk.TreeStore): 187class 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