Patchwork [bitbake-devel,09/11] Hob: Emit command-failed signal even if error msg is None

login
register
mail settings
Submitter Dongxiao Xu
Date March 14, 2012, 9:26 a.m.
Message ID <b98ff9b3ffbb6e3e3a5a1fa7eb9f3b170d27e33e.1331716896.git.dongxiao.xu@intel.com>
Download mbox | patch
Permalink /patch/23301/
State Accepted
Commit f4b5a9f243fcfb48cf01fa6f8bce35897debbd20
Headers show

Comments

Dongxiao Xu - March 14, 2012, 9:26 a.m.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/builder.py         |   13 +++++++------
 lib/bb/ui/crumbs/hobeventhandler.py |    5 ++---
 2 files changed, 9 insertions(+), 9 deletions(-)
Joshua Lock - March 14, 2012, 7:37 p.m.
On 14/03/12 02:26, Dongxiao Xu wrote:
> Signed-off-by: Dongxiao Xu<dongxiao.xu@intel.com>

Signed-off-by: Joshua Lock <josh@linux.intel.com>

> ---
>   lib/bb/ui/crumbs/builder.py         |   13 +++++++------
>   lib/bb/ui/crumbs/hobeventhandler.py |    5 ++---
>   2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
> index f52b475..1363475 100755
> --- a/lib/bb/ui/crumbs/builder.py
> +++ b/lib/bb/ui/crumbs/builder.py
> @@ -430,12 +430,13 @@ class Builder(gtk.Window):
>                   self.switch_page(self.IMAGE_GENERATED)
>
>       def handler_command_failed_cb(self, handler, msg):
> -        lbl = "<b>Error</b>\n"
> -        lbl = lbl + "%s\n\n" % msg
> -        dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
> -        dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
> -        response = dialog.run()
> -        dialog.destroy()
> +        if msg:
> +            lbl = "<b>Error</b>\n"
> +            lbl = lbl + "%s\n\n" % msg
> +            dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
> +            dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
> +            response = dialog.run()
> +            dialog.destroy()
>           self.handler.clear_busy()
>           self.configuration.curr_mach = None
>           self.image_configuration_page.switch_machine_combo()
> diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
> index 9c82bfe..cd25754 100644
> --- a/lib/bb/ui/crumbs/hobeventhandler.py
> +++ b/lib/bb/ui/crumbs/hobeventhandler.py
> @@ -238,9 +238,8 @@ class HobHandler(gobject.GObject):
>
>           elif isinstance(event, bb.command.CommandFailed):
>               self.commands_async = []
> -            if self.error_msg:
> -                self.emit("command-failed", self.error_msg)
> -                self.error_msg = ""
> +            self.emit("command-failed", self.error_msg)
> +            self.error_msg = ""
>           elif isinstance(event, (bb.event.ParseStarted,
>                    bb.event.CacheLoadStarted,
>                    bb.event.TreeDataPreparationStarted,

Patch

diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index f52b475..1363475 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -430,12 +430,13 @@  class Builder(gtk.Window):
                 self.switch_page(self.IMAGE_GENERATED)
 
     def handler_command_failed_cb(self, handler, msg):
-        lbl = "<b>Error</b>\n"
-        lbl = lbl + "%s\n\n" % msg
-        dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
-        dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
-        response = dialog.run()
-        dialog.destroy()
+        if msg:
+            lbl = "<b>Error</b>\n"
+            lbl = lbl + "%s\n\n" % msg
+            dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
+            dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
+            response = dialog.run()
+            dialog.destroy()
         self.handler.clear_busy()
         self.configuration.curr_mach = None
         self.image_configuration_page.switch_machine_combo()
diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index 9c82bfe..cd25754 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -238,9 +238,8 @@  class HobHandler(gobject.GObject):
 
         elif isinstance(event, bb.command.CommandFailed):
             self.commands_async = []
-            if self.error_msg:
-                self.emit("command-failed", self.error_msg)
-                self.error_msg = ""
+            self.emit("command-failed", self.error_msg)
+            self.error_msg = ""
         elif isinstance(event, (bb.event.ParseStarted,
                  bb.event.CacheLoadStarted,
                  bb.event.TreeDataPreparationStarted,