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:
parent
76b77c17ba
commit
d0cb2906c6
3 changed files with 4 additions and 4 deletions
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -8,7 +8,7 @@ from pathlib import Path
|
|||
|
||||
|
||||
class NotifySend(BaseNotifier):
|
||||
def __init__(self, *args, **kwargs):
|
||||
def __init__(self, **kwargs):
|
||||
pass
|
||||
|
||||
def notify(
|
||||
|
|
Loading…
Reference in a new issue