From f9d64b9ddda45bddfaf1267730b1b427de88c975 Mon Sep 17 00:00:00 2001 From: Geoffrey Thomas Date: Sun, 1 Mar 2009 03:23:58 -0500 Subject: [PATCH] avoid importing pynotify more than once --- barn-growl/barn-growl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.44.0