[magneto] since notify-python is crap, use attach_to_status_icon and catch AttributeError

This commit is contained in:
Fabio Erculiani
2011-05-03 18:24:10 +02:00
parent b48a5caa9b
commit 553af1bdb0

View File

@@ -153,9 +153,11 @@ class Magneto(MagnetoCore):
elif urgency == 'low':
n.set_urgency(pynotify.URGENCY_LOW)
self.last_alert = (title, text)
if hasattr(n, "attach_to_status_icon"):
try:
# this has been dropped from libnotify 0.7
n.attach_to_status_icon(self.status_icon)
except AttributeError:
pass
n.show()
return False