From afa1de13f0576ace6dcbb0176490fd20922950cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 2 Sep 2008 13:01:17 +0200 Subject: Switch from tabs to 4 spaces --- plugins/notify.py | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'plugins/notify.py') diff --git a/plugins/notify.py b/plugins/notify.py index 6446812..7a3776a 100644 --- a/plugins/notify.py +++ b/plugins/notify.py @@ -13,9 +13,9 @@ disable = False try: - import pynotify + import pynotify except ImportError: - disable = True + disable = True from portato import get_listener @@ -23,27 +23,27 @@ from portato.helper import warning, error, debug from portato.constants import APP_ICON, APP class Notify (Plugin): - __author__ = "René 'Necoro' Neumann" - __description__ = "Show notifications when an emerge process finishes." - __dependency__ = ["dev-python/notify-python"] - - def init (self): - self.add_call("after_emerge", self.notify) - - def notify (self, retcode, **kwargs): - if retcode is None: - warning("NOTIFY :: %s", _("Notify called while process is still running!")) - else: - icon = APP_ICON - if retcode == 0: - text = _("Emerge finished!") - descr = "" - urgency = pynotify.URGENCY_NORMAL - else: - text = _("Emerge failed!") - descr = _("Error Code: %d") % retcode - urgency = pynotify.URGENCY_CRITICAL - - get_listener().send_notify(base = text, descr = descr, icon = icon, urgency = urgency) + __author__ = "René 'Necoro' Neumann" + __description__ = "Show notifications when an emerge process finishes." + __dependency__ = ["dev-python/notify-python"] + + def init (self): + self.add_call("after_emerge", self.notify) + + def notify (self, retcode, **kwargs): + if retcode is None: + warning("NOTIFY :: %s", _("Notify called while process is still running!")) + else: + icon = APP_ICON + if retcode == 0: + text = _("Emerge finished!") + descr = "" + urgency = pynotify.URGENCY_NORMAL + else: + text = _("Emerge failed!") + descr = _("Error Code: %d") % retcode + urgency = pynotify.URGENCY_CRITICAL + + get_listener().send_notify(base = text, descr = descr, icon = icon, urgency = urgency) register(Notify, disable) -- cgit v1.2.3