mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-18 14:06:07 -04:00
Made code indentation to comply with PEP8
This commit is contained in:
@@ -8,16 +8,16 @@ import platform
|
||||
notify = None
|
||||
|
||||
def setup():
|
||||
global notify
|
||||
if platform.system() == "Windows":
|
||||
from . import windows
|
||||
notify = windows.notification()
|
||||
elif platform.system() == "Linux":
|
||||
from . import linux
|
||||
notify = linux.notification()
|
||||
global notify
|
||||
if platform.system() == "Windows":
|
||||
from . import windows
|
||||
notify = windows.notification()
|
||||
elif platform.system() == "Linux":
|
||||
from . import linux
|
||||
notify = linux.notification()
|
||||
|
||||
def send(title, text):
|
||||
global notify
|
||||
if not notify or notify is None:
|
||||
setup()
|
||||
notify.notify(title, text)
|
||||
global notify
|
||||
if not notify or notify is None:
|
||||
setup()
|
||||
notify.notify(title, text)
|
||||
|
@@ -5,23 +5,23 @@ import dbus
|
||||
import application
|
||||
|
||||
class notifications(object):
|
||||
"""Supports notifications on Linux.
|
||||
"""
|
||||
"""Supports notifications on Linux.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super(notifications, self).__init__()
|
||||
self.item = "org.freedesktop.Notifications"
|
||||
self.path = "/org/freedesktop/Notifications"
|
||||
self.interface = "org.freedesktop.Notifications"
|
||||
self.app_name = application.name
|
||||
self.id_num_to_replace = 0
|
||||
self.icon = "/usr/share/icons/Tango/32x32/status/sunny.png"
|
||||
def __init__(self):
|
||||
super(notifications, self).__init__()
|
||||
self.item = "org.freedesktop.Notifications"
|
||||
self.path = "/org/freedesktop/Notifications"
|
||||
self.interface = "org.freedesktop.Notifications"
|
||||
self.app_name = application.name
|
||||
self.id_num_to_replace = 0
|
||||
self.icon = "/usr/share/icons/Tango/32x32/status/sunny.png"
|
||||
|
||||
def notify(self, title="", text=""):
|
||||
actions_list = ''
|
||||
hint = ''
|
||||
time = 5000 # Use seconds x 1000
|
||||
bus = dbus.SessionBus()
|
||||
notif = bus.get_object(self.item, self.path)
|
||||
notify = dbus.Interface(notif, self.interface)
|
||||
notify.Notify(self.app_name, self.id_num_to_replace, self.icon, title, text, actions_list, hint, time)
|
||||
def notify(self, title="", text=""):
|
||||
actions_list = ''
|
||||
hint = ''
|
||||
time = 5000 # Use seconds x 1000
|
||||
bus = dbus.SessionBus()
|
||||
notif = bus.get_object(self.item, self.path)
|
||||
notify = dbus.Interface(notif, self.interface)
|
||||
notify.Notify(self.app_name, self.id_num_to_replace, self.icon, title, text, actions_list, hint, time)
|
||||
|
@@ -5,5 +5,5 @@ import wx
|
||||
|
||||
class notification(object):
|
||||
|
||||
def notify(self, title, text):
|
||||
wx.NotificationMessage(title, text).Show()
|
||||
def notify(self, title, text):
|
||||
wx.NotificationMessage(title, text).Show()
|
||||
|
Reference in New Issue
Block a user