summaryrefslogtreecommitdiff
path: root/plugins/notify.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-07-04 14:15:55 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-07-04 14:15:55 +0200
commit8e07fd436cfbf02fbf43c9e221badb55acdb546a (patch)
tree4b7df70393ecb9a1b3e5643ffb7aed4abcfd53cf /plugins/notify.py
parentdff240a07fc6150cf313db3f745f226f0203fe51 (diff)
downloadportato-8e07fd436cfbf02fbf43c9e221badb55acdb546a.tar.gz
portato-8e07fd436cfbf02fbf43c9e221badb55acdb546a.tar.bz2
portato-8e07fd436cfbf02fbf43c9e221badb55acdb546a.zip
Some more dependency awareness
Diffstat (limited to '')
-rw-r--r--plugins/notify.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/notify.py b/plugins/notify.py
index bc1b2ea..6446812 100644
--- a/plugins/notify.py
+++ b/plugins/notify.py
@@ -10,7 +10,12 @@
#
# Written by René 'Necoro' Neumann <necoro@necoro.net>
-import pynotify
+disable = False
+
+try:
+ import pynotify
+except ImportError:
+ disable = True
from portato import get_listener
@@ -22,8 +27,7 @@ class Notify (Plugin):
__description__ = "Show notifications when an emerge process finishes."
__dependency__ = ["dev-python/notify-python"]
- def __init__ (self):
- Plugin.__init__(self)
+ def init (self):
self.add_call("after_emerge", self.notify)
def notify (self, retcode, **kwargs):
@@ -42,4 +46,4 @@ class Notify (Plugin):
get_listener().send_notify(base = text, descr = descr, icon = icon, urgency = urgency)
-register(Notify)
+register(Notify, disable)