Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix some messages not being displayed due to XML parsing of notificat…

…ion daemon
  • Loading branch information...
commit 77bd0cafd295c2b516a3ea0c299d13e0bafc2bb1 1 parent 0b21f86
@emoreth emoreth authored committed
Showing with 13 additions and 1 deletion.
  1. +13 −1 ui.py
View
14 ui.py
@@ -102,6 +102,18 @@ def warn_time_is_up(self):
dialog.run()
dialog.destroy()
+
+ def html_escape(self, text):
+ """Produce entities within text."""
+ html_escape_table = {
+ "&": "&",
+ '"': """,
+ "'": "'",
+ ">": ">",
+ "<": "&lt;",
+ }
+ return "".join(html_escape_table.get(c,c) for c in text)
+
def show_command_results(self, status, output):
"""
Shows the output to the users.
@@ -126,7 +138,7 @@ def show_command_results(self, status, output):
if pynotify is not None:
pynotify.init('dojotools')
- message = pynotify.Notification('Dojotools', output)
+ message = pynotify.Notification('Dojotools', self.html_escape(output))
message.attach_to_status_icon(self.status_icon)
message.set_urgency(
pynotify.URGENCY_NORMAL if status == 0
Please sign in to comment.
Something went wrong with that request. Please try again.