From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH] hob: ensure error message text is properly escaped
Date: Mon, 10 Sep 2012 18:11:17 +0100 [thread overview]
Message-ID: <1347297077-29053-1-git-send-email-paul.eggleton@linux.intel.com> (raw)
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>
---
bitbake/lib/bb/ui/crumbs/builder.py | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 833577f..a203a06 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/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()
--
1.7.9.5
reply other threads:[~2012-09-10 17:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347297077-29053-1-git-send-email-paul.eggleton@linux.intel.com \
--to=paul.eggleton@linux.intel.com \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox