summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bechtold <thomasbechtold@jpberlin.de>2021-01-11 19:27:05 +0000
committerThomas Bechtold <thomasbechtold@jpberlin.de>2021-01-11 19:27:05 +0000
commita47879d73d27b58fd61ebf46fe8d7717f02f157c (patch)
tree62105fc7b1e75653843e63a31b4bb7ba6d803cf1
parent7f82611161116cab77cd8b7f315ff1b95f3b5e28 (diff)
parent9215f2b196529a24e7b4920a25a8a9fa9a41941d (diff)
downloadd-feet-a47879d73d27b58fd61ebf46fe8d7717f02f157c.tar.gz
Merge branch 'fix-8' into 'master'
Escape markup in property values Closes #8 See merge request GNOME/d-feet!28
-rw-r--r--src/dfeet/introspection_helper.py4
-rwxr-xr-xsrc/tests/tests.py.in2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/dfeet/introspection_helper.py b/src/dfeet/introspection_helper.py
index 74789f5..13dfee6 100644
--- a/src/dfeet/introspection_helper.py
+++ b/src/dfeet/introspection_helper.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from gi.repository import GObject, Gio
+from gi.repository import GLib, GObject, Gio
from dfeet import dbus_utils
@@ -87,7 +87,7 @@ class DBusProperty(DBusInterface):
args_signature_markup(sig),
args_name_markup(self.property_info.name), " / ".join(readwrite))
if self.value is not None:
- s += " = %s" % (self.value,)
+ s += " = %s" % (GLib.markup_escape_text(str(self.value), -1),)
return s
@property
diff --git a/src/tests/tests.py.in b/src/tests/tests.py.in
index de40cf3..d508baf 100755
--- a/src/tests/tests.py.in
+++ b/src/tests/tests.py.in
@@ -74,7 +74,7 @@ class IntrospectionHelperTest(unittest.TestCase):
# get the markup string with value for struct prop (see bgo #702593)
obj_prop = DBusProperty(obj_iface, obj_iface.iface_info.properties[2])
obj_prop.value = ("string", 1, 2)
- self.assertIn("'string', 1, 2", obj_prop.markup_str)
+ self.assertIn("&apos;string&apos;, 1, 2", obj_prop.markup_str)
def test_dbus_signal(self):
"""test DBusSignal class"""