diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-09-10 18:11:17 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-10 21:54:07 +0100 |
commit | 563ea5233a5ab1629c51e802d04280692f96c596 (patch) | |
tree | bee7d820935dfb66e22180a417981547114f15a8 /lib | |
parent | 56cee6a958843b03c5389d4a45245a04d1e03327 (diff) | |
download | bitbake-563ea5233a5ab1629c51e802d04280692f96c596.tar.gz |
hob: ensure error message text is properly escaped
Our poor implementation of markup escaping was causing invalid
markup, leading to the error dialog being blank. Use the glib markup
escaping function provided by PyGTK+ to do this properly and avoid the
blank error dialogs.
Partial fix for [YOCTO #2983].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/bb/ui/crumbs/builder.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py index 833577fc6..a203a06e5 100755 --- a/lib/bb/ui/crumbs/builder.py +++ b/lib/bb/ui/crumbs/builder.py @@ -21,6 +21,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +import glib import gtk import copy import os @@ -378,15 +379,6 @@ 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__() @@ -783,7 +775,7 @@ class Builder(gtk.Window): def show_error_dialog(self, msg): lbl = "<b>Error</b>\n" - lbl = lbl + "%s\n\n" % Builder.interpret_markup(msg) + lbl = lbl + "%s\n\n" % glib.markup_escape_text(msg) dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_ERROR) button = dialog.add_button("Close", gtk.RESPONSE_OK) HobButton.style_button(button) @@ -971,7 +963,7 @@ class Builder(gtk.Window): self.build_failed() def handler_no_provider_cb(self, running_build, msg): - dialog = CrumbsMessageDialog(self, Builder.interpret_markup(msg), gtk.STOCK_DIALOG_INFO) + dialog = CrumbsMessageDialog(self, glib.markup_escape_text(msg), gtk.STOCK_DIALOG_INFO) button = dialog.add_button("Close", gtk.RESPONSE_OK) HobButton.style_button(button) dialog.run() |