refactor: standardize constructor signatures for notifiers

Updated constructors in BaseNotifier, Matrix, and NotifySend classes
to consistently use kwargs for initialization. Simplifies the
BaseNotifier class and reduces the need for extra positional
arguments in derived classes, leading to clearer and more flexible
instantiation.
This commit is contained in:
Kumi 2024-07-02 08:25:39 +02:00
parent 76b77c17ba
commit d0cb2906c6
Signed by: kumi
GPG key ID: ECBCC9082395383F
3 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,5 @@
class BaseNotifier:
def __init__(self, *args, **kwargs):
def __init__(self, **kwargs):
pass
def notify(self, title: str, message: str, urgent: bool = False) -> None:

View file

@ -7,8 +7,8 @@ from ..classes.notifier import BaseNotifier
class Matrix(BaseNotifier):
def __init__(self, config: Dict[str, Any], *args, **kwargs):
self.config = config
def __init__(self, **kwargs):
self.config = kwargs["config"]
def enabled(self) -> bool:
return bool(self.config)

View file

@ -8,7 +8,7 @@ from pathlib import Path
class NotifySend(BaseNotifier):
def __init__(self, *args, **kwargs):
def __init__(self, **kwargs):
pass
def notify(