|
|
@ -29,9 +29,9 @@ from notification_client.notification_saver import NotificationSaver
|
|
|
|
|
|
|
|
|
|
|
|
class Client:
|
|
|
|
class Client:
|
|
|
|
BUFFER_SIZE = 1024
|
|
|
|
BUFFER_SIZE = 1024
|
|
|
|
NOTIFICATION_DIR = 'notifications'
|
|
|
|
NOTIFICATION_DIR = None
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, ip: str, port: int, notification_dir: str = 'notifications'):
|
|
|
|
def __init__(self, ip: str, port: int, notification_dir: str | None = None):
|
|
|
|
self.__ip = ip
|
|
|
|
self.__ip = ip
|
|
|
|
self.__port = port
|
|
|
|
self.__port = port
|
|
|
|
self.NOTIFICATION_DIR = notification_dir
|
|
|
|
self.NOTIFICATION_DIR = notification_dir
|
|
|
@ -65,6 +65,7 @@ class Client:
|
|
|
|
|
|
|
|
|
|
|
|
Notification.notify(title, message)
|
|
|
|
Notification.notify(title, message)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not self.NOTIFICATION_DIR is None:
|
|
|
|
NotificationSaver.save_notification(self.NOTIFICATION_DIR, title, message, now)
|
|
|
|
NotificationSaver.save_notification(self.NOTIFICATION_DIR, title, message, now)
|
|
|
|
|
|
|
|
|
|
|
|
except asyncio.CancelledError:
|
|
|
|
except asyncio.CancelledError:
|
|
|
|