From 0de85a8f193c9ca775ef1eefca1fc98c518855ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Sat, 15 Apr 2023 05:34:48 +0200 Subject: [PATCH] more linting --- server/src/uds/core/messaging/processor.py | 2 +- server/src/uds/core/messaging/provider.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/server/src/uds/core/messaging/processor.py b/server/src/uds/core/messaging/processor.py index 33dc79bc5..891d87d45 100644 --- a/server/src/uds/core/messaging/processor.py +++ b/server/src/uds/core/messaging/processor.py @@ -130,7 +130,7 @@ class MessageProcessorThread(BaseThread): n.message, ) - for a in range(WAIT_TIME): + for _ in range(WAIT_TIME): if not self.keepRunning: break time.sleep(1) diff --git a/server/src/uds/core/messaging/provider.py b/server/src/uds/core/messaging/provider.py index 5006d69b8..f2de5c992 100644 --- a/server/src/uds/core/messaging/provider.py +++ b/server/src/uds/core/messaging/provider.py @@ -38,10 +38,12 @@ from uds.core.module import Module if typing.TYPE_CHECKING: from uds.core.environment import Environment + class NotificationLevel(enum.IntEnum): """ Notifier levels """ + INFO = 0 WARNING = 1 ERROR = 2 @@ -63,6 +65,7 @@ class Notifier(Module): this class provides an abstraction of a notifier system for administrator defined events This class will be responsible os sendig emails, messaging notifications, etc.. to administrators """ + # informational related data # : Name of type, used at administration interface to identify this # : notifier type (e.g. "Email", "SMS", etc.) @@ -108,7 +111,9 @@ class Notifier(Module): Default implementation does nothing """ - def notify(self, group: str, identificator: str, level: NotificationLevel, message: str) -> None: + def notify( + self, group: str, identificator: str, level: NotificationLevel, message: str + ) -> None: """ This method will be invoked from UDS to notify an event to this notifier. This method will be invoked in real time, so ensure this method does not block or @@ -117,6 +122,4 @@ class Notifier(Module): :param level: Level of event :param message: Message to be shown :return: None - """ - pass - + """