diff options
author | Shane Wang <shane.wang@intel.com> | 2012-06-02 12:54:38 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-06-08 12:13:15 +0100 |
commit | c0b92702d367466641f88371fbcbc0fdebdbbb96 (patch) | |
tree | 88ec17b35d440500ba3203123b8e9b2c3a48c619 | |
parent | 25785d8ddfccfc12af0c677cb519f133be158d1f (diff) | |
download | ast2050-yocto-poky-c0b92702d367466641f88371fbcbc0fdebdbbb96.zip ast2050-yocto-poky-c0b92702d367466641f88371fbcbc0fdebdbbb96.tar.gz |
Hob: Interpret some special characters for label markup
Interpret some special characters for label markup, such as &, <, >, etc.
Otherwise, the message dialog can't show them, and worsely, it makes the
whole message blank.
[Yocto #2492]
(Bitbake rev: fb82f6eb5405274f702bd6d64cbe995fd4b74145)
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builder.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index bcce41d..7861a6f 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py @@ -374,6 +374,15 @@ class Builder(gtk.Window): END_NOOP : None, } + @classmethod + def interpret_markup(cls, msg): + msg = msg.replace('&', '&') + msg = msg.replace('<', '<') + msg = msg.replace('>', '>') + msg = msg.replace('"', '"') + msg = msg.replace("'", "´") + return msg + def __init__(self, hobHandler, recipe_model, package_model): super(Builder, self).__init__() @@ -729,7 +738,7 @@ class Builder(gtk.Window): def show_error_dialog(self, msg): lbl = "<b>Error</b>\n" - lbl = lbl + "%s\n\n" % msg + lbl = lbl + "%s\n\n" % Builder.interpret_markup(msg) dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_ERROR) button = dialog.add_button("Close", gtk.RESPONSE_OK) HobButton.style_button(button) @@ -909,7 +918,7 @@ class Builder(gtk.Window): self.build_failed() def handler_no_provider_cb(self, running_build, msg): - dialog = CrumbsMessageDialog(self, msg, gtk.STOCK_DIALOG_INFO) + dialog = CrumbsMessageDialog(self, Builder.interpret_markup(msg), gtk.STOCK_DIALOG_INFO) button = dialog.add_button("Close", gtk.RESPONSE_OK) HobButton.style_button(button) dialog.run() |