2014-10-27 16:29:04 -06:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
""" A cross platform notification system.
|
|
|
|
Under Linux, the wx.NotificationMessage does not show a notification on the taskbar, so we decided to use dbus for showing notifications for linux and wx for Windows."""
|
2018-11-22 13:35:19 -06:00
|
|
|
from __future__ import absolute_import
|
2014-10-27 16:29:04 -06:00
|
|
|
import platform
|
|
|
|
|
|
|
|
notify = None
|
|
|
|
|
|
|
|
def setup():
|
|
|
|
global notify
|
|
|
|
if platform.system() == "Windows":
|
2018-11-22 13:35:19 -06:00
|
|
|
from . import windows
|
2014-10-27 16:29:04 -06:00
|
|
|
notify = windows.notification()
|
|
|
|
elif platform.system() == "Linux":
|
2018-11-22 13:35:19 -06:00
|
|
|
from . import linux
|
2014-10-27 16:29:04 -06:00
|
|
|
notify = linux.notification()
|
|
|
|
|
|
|
|
def send(title, text):
|
|
|
|
global notify
|
|
|
|
if not notify or notify is None:
|
|
|
|
setup()
|
|
|
|
notify.notify(title, text)
|