X-Git-Url: https://snippets.scripts.mit.edu/gitweb.cgi/.git/blobdiff_plain/2deb9d010d890ec4682210c363ec340877f7bfcf..f9d64b9ddda45bddfaf1267730b1b427de88c975:/barn-growl/barn-growl.py diff --git a/barn-growl/barn-growl.py b/barn-growl/barn-growl.py index 546cd69..799ea33 100755 --- a/barn-growl/barn-growl.py +++ b/barn-growl/barn-growl.py @@ -21,6 +21,7 @@ class Notifier(AbstractConsumer): import pynotify pynotify.init("Zephyr") self.pings = {} + self.pynotify = pynotify self.useprint = useprint return def feed(self, s): @@ -52,10 +53,9 @@ class Notifier(AbstractConsumer): g.stdin.write(message) g.stdin.close() if self.usenotify: - import pynotify if id in self.pings: self.pings[id].close() - self.pings[id] = pynotify.Notification(header, message) + self.pings[id] = self.pynotify.Notification(header, message) self.pings[id].show() def close(self): return