mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-01-19 08:41:06 -06:00
21 lines
576 B
Python
21 lines
576 B
Python
|
# -*- 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."""
|
||
|
import platform
|
||
|
|
||
|
notify = None
|
||
|
|
||
|
def setup():
|
||
|
global notify
|
||
|
if platform.system() == "Windows":
|
||
|
import windows
|
||
|
notify = windows.notification()
|
||
|
elif platform.system() == "Linux":
|
||
|
import linux
|
||
|
notify = linux.notification()
|
||
|
|
||
|
def send(title, text):
|
||
|
global notify
|
||
|
if not notify or notify is None:
|
||
|
setup()
|
||
|
notify.notify(title, text)
|