summaryrefslogtreecommitdiff
path: root/portato/plugins/notify.py
blob: db024cfde24127246afc9474b632339f5e1263e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from gettext import lgettext as _
import pynotify

from portato import listener

from portato.helper import warning, error, debug
from portato.constants import APP_ICON, APP

def notify (retcode, **kwargs):
	if retcode is None:
		warning(_("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

		listener.send_notify(base = text, descr = descr, icon = icon, urgency = urgency)
/td>Updated French translation to current code statusClement Bourgeois1-52/+56 2010-05-12Unused French translations purgedClement Bourgeois1-18/+0 2010-05-11Fix release script pathesv0.14René 'Necoro' Neumann1-1/+2 2010-05-11Add '--plugin-dir' optionRené 'Necoro' Neumann1-1/+9 2010-05-11Add a README message to the releaseRené 'Necoro' Neumann1-1/+14