|
|
@ -2,10 +2,17 @@ from notifypy import Notify
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Notification:
|
|
|
|
class Notification:
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
|
|
def truncatechars(message: str, size: int):
|
|
|
|
|
|
|
|
if len(message) > size:
|
|
|
|
|
|
|
|
return message[:(size-3)] + '...'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return message
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def notify(title: str, message: str):
|
|
|
|
def notify(title: str, message: str):
|
|
|
|
notification = Notify()
|
|
|
|
notification = Notify()
|
|
|
|
notification.title = title
|
|
|
|
notification.title = Notification.truncatechars(title, 80)
|
|
|
|
notification.message = message
|
|
|
|
notification.message = Notification.truncatechars(message, 100)
|
|
|
|
notification.send()
|
|
|
|
notification.send()
|
|
|
|
|
|
|
|
|
|
|
|