Skip to content

Commit afc91fd

Browse files
committed
Resolve code quality issues.
#2
1 parent 8f34779 commit afc91fd

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tools/developer_tools/bely-mqtt-message-broker/examples/handlers/apprise_smart_notification/config_loader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Configuration loader for Apprise Smart Notification Handler.
33
"""
44

5-
import logging
5+
from logging import Logger
66
from pathlib import Path
77
from typing import Any, Dict
88

@@ -17,19 +17,19 @@
1717
class ConfigLoader:
1818
"""Handles loading and processing of YAML configuration files."""
1919

20-
def __init__(self, logger: logging.Logger):
20+
def __init__(self, logger: Logger):
2121
"""
2222
Initialize the config loader.
2323
2424
Args:
2525
logger: Logger instance for output
2626
"""
27+
self.logger = logger
28+
2729
if not YAML_AVAILABLE:
2830
self.logger.warning("PyYAML not installed. Install with: pip install pyyaml")
2931
raise ImportError("PyYAML is required for this handler")
3032

31-
self.logger = logger
32-
3333
def load_config(self, config_path: str) -> Dict[str, Any]:
3434
"""
3535
Load configuration from YAML file.

tools/developer_tools/bely-mqtt-message-broker/examples/handlers/apprise_smart_notification/notification_processor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Notification processor for Apprise Smart Notification Handler.
33
"""
44

5-
import logging
5+
from logging import Logger
66
from typing import Any, Dict, List, Optional
77

88
try:
@@ -16,19 +16,20 @@
1616
class NotificationProcessor:
1717
"""Handles processing and sending of notifications."""
1818

19-
def __init__(self, logger: logging.Logger):
19+
def __init__(self, logger: Logger):
2020
"""
2121
Initialize the notification processor.
2222
2323
Args:
2424
logger: Logger instance for output
2525
"""
2626

27+
self.logger = logger
28+
2729
if not APPRISE_AVAILABLE:
2830
self.logger.warning("Apprise not installed. Install with: pip install apprise")
2931
raise ImportError("Apprise is required for this handler")
3032

31-
self.logger = logger
3233
self.user_apprise_instances: Dict[str, apprise.Apprise] = {}
3334
self.user_notification_settings: Dict[str, Dict[str, bool]] = {}
3435

0 commit comments

Comments
 (0)