Environment.notify module

Defines one useful function notify() to (try to) send a desktop notification.

Warning

Experimental support of Mac OS X has been added since #143 (https://github.com/SMPyBandits/SMPyBandits/issues/143).

Environment.notify.PROGRAM_NAME = 'SMPyBandits'

Program name

Environment.notify.ICON_PATH = 'logo.png'

Icon to use

Environment.notify.load_icon()[source]

Load and open the icon.

Environment.notify.has_Notify = True

Trying to import gi.repository.Notify

Environment.notify.notify_gi(body, summary='SMPyBandits', icon='terminal', timeout=5)[source]

Send a notification, with gi.repository.Notify.

  • icon can be “dialog-information”, “dialog-warn”, “dialog-error”.

Environment.notify.notify_cli(body, summary='SMPyBandits', icon='terminal', timeout=5, gnulinux=True)[source]

Send a notification, with a subprocess call to ‘notify-send’.

Environment.notify.notify(body, summary='SMPyBandits', icon='terminal', timeout=5)[source]

Send a notification, using one of the previously defined method, until it works. Usually it works.