Patchwork [bitbake-devel,17/20] Hob: handle some steps for build-succeeded and build-failed by hob event handler itself

login
register
mail settings
Submitter Shane Wang
Date April 8, 2012, 10:21 a.m.
Message ID <c26c9c75b6ad71e96529b550e49eedd8ffabc516.1333880210.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/25331/
State New
Headers show

Comments

Shane Wang - April 8, 2012, 10:21 a.m.
Changing the state of building, clearing the commands_async queue, and resetting
initcmd should be the behaviours of hob event handler rather that builder,
because those are the members of hob event handler. So, the patch is to put those
steps from the builder into the hob event handler by adding two callback functions
in it.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py         |    2 --
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    7 +++++--
 2 files changed, 5 insertions(+), 4 deletions(-)

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index afd1d1b..4997cd4 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -668,7 +668,6 @@  class Builder(gtk.Window):
         elif self.current_step == self.PACKAGE_GENERATING:
             fraction = 1.0
         self.build_details_page.update_progress_bar("Build Completed: ", fraction)
-        self.handler.build_succeeded_async()
         self.stopping = False
 
     def build_failed(self):
@@ -688,7 +687,6 @@  class Builder(gtk.Window):
         self.build_details_page.update_progress_bar(message, fraction, status)
         self.build_details_page.show_back_button()
         self.build_details_page.hide_stop_button()
-        self.handler.build_failed_async()
         self.stopping = False
 
     def handler_build_succeeded_cb(self, running_build):
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 1a7427a..41ab593 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -81,6 +81,9 @@  class HobHandler(gobject.GObject):
         self.error_msg = ""
         self.initcmd = None
 
+        self.build.connect("build-succeeded", self.build_succeeded_cb)
+        self.build.connect("build-failed",    self.build_failed_cb)
+
     def set_busy(self):
         if not self.generating:
             self.emit("generating-data")
@@ -359,10 +362,10 @@  class HobHandler(gobject.GObject):
         self.commands_async.append(self.SUB_BUILD_IMAGE)
         self.run_next_command(self.GENERATE_IMAGE)
 
-    def build_succeeded_async(self):
+    def build_succeeded_cb(self, running_build):
         self.building = False
 
-    def build_failed_async(self):
+    def build_failed_cb(self, running_build):
         self.initcmd = None
         self.commands_async = []
         self.building = False