python - Gtk notifications don't display body holding '<' -


i'm trying display notifications notification module of pygobject (version 3.16) in python. code works well, except when there < in body message. in case, body not displayed.

for example code, ok:

from gi.repository import gtk, notify  def callback(notification, action_name):     notification.close()     gtk.main_quit()  notify.init('test') notification = notify.notification.new('title', 'body') notification.set_timeout(notify.expires_never) notification.add_action('quit', 'quit', callback) notification.show()  gtk.main() 

but 1 there problem:

from gi.repository import gtk, notify  def callback(notification, action_name):     notification.close()     gtk.main_quit()  notify.init('test') notification = notify.notification.new('title', '<body') notification.set_timeout(notify.expires_never) notification.add_action('quit', 'quit', callback) notification.show()  gtk.main() 

i that: notification body not displayed

when < in title, or when use > there no problem.

i tried escape <, didn't anything. so, how display body text containing < ?

i've noticed in gtk there html code, when using set_markup.i tried hmtl equivalent &lt; , worked fine:

from gi.repository import gtk, notify  def callback(notification, action_name):     notification.close()     gtk.main_quit()  notify.init('test') notification = notify.notification.new('title', '&lt;body&gt;') notification.set_timeout(notify.expires_never) notification.add_action('quit', 'quit', callback) notification.show() 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -