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 | |
parent | bbf83fd988ca3cf9dae7d2b542a11a7c942b1702 (diff) | |
download | ast2050-yocto-poky-7acc132cac873e60005516272473a55a8160b9c4.zip ast2050-yocto-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')
-rw-r--r-- | bitbake/lib/bb/ui/__init__.py | 1 | ||||
-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 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/depexp.py | 3 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/goggle.py | 13 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/ncurses.py | 7 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/puccho.py | 110 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/uievent.py | 5 |
10 files changed, 98 insertions, 107 deletions
diff --git a/bitbake/lib/bb/ui/__init__.py b/bitbake/lib/bb/ui/__init__.py index c6a377a..a4805ed 100644 --- a/bitbake/lib/bb/ui/__init__.py +++ b/bitbake/lib/bb/ui/__init__.py @@ -15,4 +15,3 @@ # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - diff --git a/bitbake/lib/bb/ui/crumbs/__init__.py b/bitbake/lib/bb/ui/crumbs/__init__.py index c6a377a..a4805ed 100644 --- a/bitbake/lib/bb/ui/crumbs/__init__.py +++ b/bitbake/lib/bb/ui/crumbs/__init__.py @@ -15,4 +15,3 @@ # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - diff --git a/bitbake/lib/bb/ui/crumbs/buildmanager.py b/bitbake/lib/bb/ui/crumbs/buildmanager.py index f89e8ee..f5a1532 100644 --- a/bitbake/lib/bb/ui/crumbs/buildmanager.py +++ b/bitbake/lib/bb/ui/crumbs/buildmanager.py @@ -28,7 +28,7 @@ import time class BuildConfiguration: """ Represents a potential *or* historic *or* concrete build. It encompasses all the things that we need to tell bitbake to do to make it - build what we want it to build. + build what we want it to build. It also stored the metadata URL and the set of possible machines (and the distros / images / uris for these. Apart from the metdata URL these are @@ -73,8 +73,8 @@ class BuildConfiguration: return self.urls # It might be a lot lot better if we stored these in like, bitbake conf - # file format. - @staticmethod + # file format. + @staticmethod def load_from_file (filename): f = open (filename, "r") @@ -140,13 +140,13 @@ class BuildResult(gobject.GObject): ".conf" in the directory for the build. This is GObject so that it can be included in the TreeStore.""" - + (STATE_COMPLETE, STATE_FAILED, STATE_ONGOING) = \ (0, 1, 2) def __init__ (self, parent, identifier): gobject.GObject.__init__ (self) - self.date = None + self.date = None self.files = [] self.status = None @@ -181,7 +181,7 @@ class BuildResult(gobject.GObject): self.add_file (file) def add_file (self, file): - # Just add the file for now. Don't care about the type. + # Just add the file for now. Don't care about the type. self.files += [(file, None)] class BuildManagerModel (gtk.TreeStore): @@ -194,7 +194,7 @@ class BuildManagerModel (gtk.TreeStore): def __init__ (self): gtk.TreeStore.__init__ (self, - gobject.TYPE_STRING, + gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, @@ -207,7 +207,7 @@ class BuildManager (gobject.GObject): "results" directory but is also used for starting a new build.""" __gsignals__ = { - 'population-finished' : (gobject.SIGNAL_RUN_LAST, + 'population-finished' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), 'populate-error' : (gobject.SIGNAL_RUN_LAST, @@ -220,13 +220,13 @@ class BuildManager (gobject.GObject): date = long (time.mktime (result.date.timetuple())) # Add a top level entry for the build - - self.model.set (iter, + + self.model.set (iter, BuildManagerModel.COL_IDENT, result.identifier, BuildManagerModel.COL_DESC, result.conf.image, - BuildManagerModel.COL_MACHINE, result.conf.machine, - BuildManagerModel.COL_DISTRO, result.conf.distro, - BuildManagerModel.COL_BUILD_RESULT, result, + BuildManagerModel.COL_MACHINE, result.conf.machine, + BuildManagerModel.COL_DISTRO, result.conf.distro, + BuildManagerModel.COL_BUILD_RESULT, result, BuildManagerModel.COL_DATE, date, BuildManagerModel.COL_STATE, result.state) @@ -257,7 +257,7 @@ class BuildManager (gobject.GObject): while (iter): (ident, state) = self.model.get(iter, - BuildManagerModel.COL_IDENT, + BuildManagerModel.COL_IDENT, BuildManagerModel.COL_STATE) if state == BuildResult.STATE_ONGOING: @@ -422,29 +422,29 @@ class BuildManagerTreeView (gtk.TreeView): # Misc descriptiony thing renderer = gtk.CellRendererText () - col = gtk.TreeViewColumn (None, renderer, + col = gtk.TreeViewColumn (None, renderer, text=BuildManagerModel.COL_DESC) self.append_column (col) # Machine renderer = gtk.CellRendererText () - col = gtk.TreeViewColumn ("Machine", renderer, + col = gtk.TreeViewColumn ("Machine", renderer, text=BuildManagerModel.COL_MACHINE) self.append_column (col) # distro renderer = gtk.CellRendererText () - col = gtk.TreeViewColumn ("Distribution", renderer, + col = gtk.TreeViewColumn ("Distribution", renderer, text=BuildManagerModel.COL_DISTRO) self.append_column (col) # date (using a custom function for formatting the cell contents it # takes epoch -> human readable string) renderer = gtk.CellRendererText () - col = gtk.TreeViewColumn ("Date", renderer, + col = gtk.TreeViewColumn ("Date", renderer, text=BuildManagerModel.COL_DATE) self.append_column (col) - col.set_cell_data_func (renderer, + col.set_cell_data_func (renderer, self.date_format_custom_cell_data_func) # For status. @@ -454,4 +454,3 @@ class BuildManagerTreeView (gtk.TreeView): self.append_column (col) col.set_cell_data_func (renderer, self.state_format_custom_cell_data_fun) - diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py index 18afd66..79e2c90 100644 --- a/bitbake/lib/bb/ui/crumbs/runningbuild.py +++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py @@ -24,7 +24,7 @@ import gobject class RunningBuildModel (gtk.TreeStore): (COL_TYPE, COL_PACKAGE, COL_TASK, COL_MESSAGE, COL_ICON, COL_ACTIVE) = (0, 1, 2, 3, 4, 5) def __init__ (self): - gtk.TreeStore.__init__ (self, + gtk.TreeStore.__init__ (self, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, @@ -34,7 +34,7 @@ class RunningBuildModel (gtk.TreeStore): class RunningBuild (gobject.GObject): __gsignals__ = { - 'build-succeeded' : (gobject.SIGNAL_RUN_LAST, + 'build-succeeded' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), 'build-failed' : (gobject.SIGNAL_RUN_LAST, @@ -82,12 +82,12 @@ class RunningBuild (gobject.GObject): # Add the message to the tree either at the top level if parent is # None otherwise as a descendent of a task. - self.model.append (parent, + self.model.append (parent, (event.__name__.split()[-1], # e.g. MsgWarn, MsgError - package, + package, task, event._message, - icon, + icon, False)) elif isinstance(event, bb.build.TaskStarted): (package, task) = (event._package, event._task) @@ -101,10 +101,10 @@ class RunningBuild (gobject.GObject): if (self.tasks_to_iter.has_key ((package, None))): parent = self.tasks_to_iter[(package, None)] else: - parent = self.model.append (None, (None, - package, + parent = self.model.append (None, (None, + package, None, - "Package: %s" % (package), + "Package: %s" % (package), None, False)) self.tasks_to_iter[(package, None)] = parent @@ -114,10 +114,10 @@ class RunningBuild (gobject.GObject): self.model.set(parent, self.model.COL_ICON, "gtk-execute") # Add an entry in the model for this task - i = self.model.append (parent, (None, - package, + i = self.model.append (parent, (None, + package, task, - "Task: %s" % (task), + "Task: %s" % (task), None, False)) @@ -176,5 +176,3 @@ class RunningBuildTreeView (gtk.TreeView): renderer = gtk.CellRendererText () col = gtk.TreeViewColumn ("Message", renderer, text=3) self.append_column (col) - - diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py index cfa5b65..c596cad 100644 --- a/bitbake/lib/bb/ui/depexp.py +++ b/bitbake/lib/bb/ui/depexp.py @@ -233,7 +233,7 @@ def init(server, eventHandler): x = event.sofar y = event.total if x == y: - print("\nParsing finished. %d cached, %d parsed, %d skipped, %d masked, %d errors." + print("\nParsing finished. %d cached, %d parsed, %d skipped, %d masked, %d errors." % ( event.cached, event.parsed, event.skipped, event.masked, event.errors)) pbar.hide() gtk.gdk.threads_enter() @@ -269,4 +269,3 @@ def init(server, eventHandler): server.runCommand(["stateShutdown"]) shutdown = shutdown + 1 pass - diff --git a/bitbake/lib/bb/ui/goggle.py b/bitbake/lib/bb/ui/goggle.py index 94995d8..bcba38b 100644 --- a/bitbake/lib/bb/ui/goggle.py +++ b/bitbake/lib/bb/ui/goggle.py @@ -25,13 +25,13 @@ from bb.ui.crumbs.runningbuild import RunningBuildTreeView, RunningBuild def event_handle_idle_func (eventHandler, build): - # Consume as many messages as we can in the time available to us - event = eventHandler.getEvent() - while event: - build.handle_event (event) - event = eventHandler.getEvent() + # Consume as many messages as we can in the time available to us + event = eventHandler.getEvent() + while event: + build.handle_event (event) + event = eventHandler.getEvent() - return True + return True class MainWindow (gtk.Window): def __init__ (self): @@ -74,4 +74,3 @@ def init (server, eventHandler): running_build) gtk.main() - diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index ed26bb2..3261792 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py @@ -132,7 +132,7 @@ def init(server, eventHandler): sys.stdout.write("done.") sys.stdout.flush() if x == y: - print("\nParsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors." + print("\nParsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors." % ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors)) continue diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py index da3690e..0eb1cf0 100644 --- a/bitbake/lib/bb/ui/ncurses.py +++ b/bitbake/lib/bb/ui/ncurses.py @@ -136,7 +136,7 @@ class NCursesUI: """Thread Activity Window""" def __init__( self, x, y, width, height ): NCursesUI.DecoratedWindow.__init__( self, "Thread Activity", x, y, width, height ) - + def setStatus( self, thread, text ): line = "%02d: %s" % ( thread, text ) width = self.dimensions[WIDTH] @@ -225,7 +225,7 @@ class NCursesUI: helper = uihelper.BBUIHelper() shutdown = 0 - + try: cmdline = server.runCommand(["getCmdLineAction"]) if not cmdline: @@ -263,7 +263,7 @@ class NCursesUI: y = event.total if x == y: mw.setStatus("Idle") - mw.appendText("Parsing finished. %d cached, %d parsed, %d skipped, %d masked." + mw.appendText("Parsing finished. %d cached, %d parsed, %d skipped, %d masked." % ( event.cached, event.parsed, event.skipped, event.masked )) else: mw.setStatus("Parsing: %s (%04d/%04d) [%2d %%]" % ( parsespin.next(), x, y, x*100/y ) ) @@ -332,4 +332,3 @@ def init(server, eventHandler): except: import traceback traceback.print_exc() - diff --git a/bitbake/lib/bb/ui/puccho.py b/bitbake/lib/bb/ui/puccho.py index 713aa1f..dfcb0f7 100644 --- a/bitbake/lib/bb/ui/puccho.py +++ b/bitbake/lib/bb/ui/puccho.py @@ -38,7 +38,7 @@ class MetaDataLoader(gobject.GObject): on what machines are available. The distribution and images available for the machine and the the uris to use for building the given machine.""" __gsignals__ = { - 'success' : (gobject.SIGNAL_RUN_LAST, + 'success' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), 'error' : (gobject.SIGNAL_RUN_LAST, @@ -293,7 +293,7 @@ class BuildSetupDialog (gtk.Dialog): if (active_iter): self.configuration.machine = model.get(active_iter, 0)[0] - # Extract the chosen distro from the combo + # Extract the chosen distro from the combo model = self.distribution_combo.get_model() active_iter = self.distribution_combo.get_active_iter() if (active_iter): @@ -311,62 +311,62 @@ class BuildSetupDialog (gtk.Dialog): # # TODO: Should be a method on the RunningBuild class def event_handle_timeout (eventHandler, build): - # Consume as many messages as we can ... - event = eventHandler.getEvent() - while event: - build.handle_event (event) - event = eventHandler.getEvent() - return True + # Consume as many messages as we can ... + event = eventHandler.getEvent() + while event: + build.handle_event (event) + event = eventHandler.getEvent() + return True class MainWindow (gtk.Window): - # Callback that gets fired when the user hits a button in the - # BuildSetupDialog. - def build_dialog_box_response_cb (self, dialog, response_id): - conf = None - if (response_id == BuildSetupDialog.RESPONSE_BUILD): - dialog.update_configuration() - print dialog.configuration.machine, dialog.configuration.distro, \ - dialog.configuration.image - conf = dialog.configuration - - dialog.destroy() - - if conf: - self.manager.do_build (conf) - - def build_button_clicked_cb (self, button): - dialog = BuildSetupDialog () - - # For some unknown reason Dialog.run causes nice little deadlocks ... :-( - dialog.connect ("response", self.build_dialog_box_response_cb) - dialog.show() - - def __init__ (self): - gtk.Window.__init__ (self) - - # Pull in *just* the main vbox from the Glade XML data and then pack - # that inside the window - gxml = gtk.glade.XML (os.path.dirname(__file__) + "/crumbs/puccho.glade", - root = "main_window_vbox") - vbox = gxml.get_widget ("main_window_vbox") - self.add (vbox) - - # Create the tree views for the build manager view and the progress view - self.build_manager_view = BuildManagerTreeView() - self.running_build_view = RunningBuildTreeView() - - # Grab the scrolled windows that we put the tree views into - self.results_scrolledwindow = gxml.get_widget ("results_scrolledwindow") - self.progress_scrolledwindow = gxml.get_widget ("progress_scrolledwindow") - - # Put the tree views inside ... - self.results_scrolledwindow.add (self.build_manager_view) - self.progress_scrolledwindow.add (self.running_build_view) - - # Hook up the build button... - self.build_button = gxml.get_widget ("main_toolbutton_build") - self.build_button.connect ("clicked", self.build_button_clicked_cb) + # Callback that gets fired when the user hits a button in the + # BuildSetupDialog. + def build_dialog_box_response_cb (self, dialog, response_id): + conf = None + if (response_id == BuildSetupDialog.RESPONSE_BUILD): + dialog.update_configuration() + print dialog.configuration.machine, dialog.configuration.distro, \ + dialog.configuration.image + conf = dialog.configuration + + dialog.destroy() + + if conf: + self.manager.do_build (conf) + + def build_button_clicked_cb (self, button): + dialog = BuildSetupDialog () + + # For some unknown reason Dialog.run causes nice little deadlocks ... :-( + dialog.connect ("response", self.build_dialog_box_response_cb) + dialog.show() + + def __init__ (self): + gtk.Window.__init__ (self) + + # Pull in *just* the main vbox from the Glade XML data and then pack + # that inside the window + gxml = gtk.glade.XML (os.path.dirname(__file__) + "/crumbs/puccho.glade", + root = "main_window_vbox") + vbox = gxml.get_widget ("main_window_vbox") + self.add (vbox) + + # Create the tree views for the build manager view and the progress view + self.build_manager_view = BuildManagerTreeView() + self.running_build_view = RunningBuildTreeView() + + # Grab the scrolled windows that we put the tree views into + self.results_scrolledwindow = gxml.get_widget ("results_scrolledwindow") + self.progress_scrolledwindow = gxml.get_widget ("progress_scrolledwindow") + + # Put the tree views inside ... + self.results_scrolledwindow.add (self.build_manager_view) + self.progress_scrolledwindow.add (self.running_build_view) + + # Hook up the build button... + self.build_button = gxml.get_widget ("main_toolbutton_build") + self.build_button.connect ("clicked", self.build_button_clicked_cb) # I'm not very happy about the current ownership of the RunningBuild. I have # my suspicions that this object should be held by the BuildManager since we diff --git a/bitbake/lib/bb/ui/uievent.py b/bitbake/lib/bb/ui/uievent.py index 36302f4..5b3efff 100644 --- a/bitbake/lib/bb/ui/uievent.py +++ b/bitbake/lib/bb/ui/uievent.py @@ -19,7 +19,7 @@ """ -Use this class to fork off a thread to recieve event callbacks from the bitbake +Use this class to fork off a thread to recieve event callbacks from the bitbake server and queue them for the UI to process. This process must be used to avoid client/server deadlocks. """ @@ -116,10 +116,9 @@ class UIXMLRPCServer (SimpleXMLRPCServer): if request is None: return SimpleXMLRPCServer.close_request(self, request) - + def process_request(self, request, client_address): if request is None: return SimpleXMLRPCServer.process_request(self, request, client_address) - |