manager
dev_tool.services.notification.manager
NotificationManager
A manager class that coordinates between notification service and display.
This class orchestrates notification monitoring, display, and lifecycle without mixing the concerns of data management and presentation.
The constructor for the NotificationManager class.
Parameters:
-
display(NotificationDisplay) –The notification display instance for rendering.
-
service(NotificationService) –The notification service instance for data management.
Source code in dev_tool/services/notification/manager.py
display = display
instance-attribute
last_count = 0
instance-attribute
last_update = 0
instance-attribute
service = service
instance-attribute
clear
display_active
A method that displays all active notifications in command mode.
Source code in dev_tool/services/notification/manager.py
display_new
A method that displays any new notifications that haven't been shown yet.
Parameters:
-
displayed(set) –Set of already displayed notification keys.
Source code in dev_tool/services/notification/manager.py
error
get_active_count
A method that gets the count of active notifications.
Returns:
-
int–The number of active notifications.
info
is_changed
A method that checks if notifications have changed in a way that requires attention.
Returns:
-
bool–True if notifications have changed, False otherwise.
Source code in dev_tool/services/notification/manager.py
monitor
A context manager for monitoring and displaying notifications during command execution.
Returns:
-
Generator[None, None, None]–A generator for the context manager.
Source code in dev_tool/services/notification/manager.py
normal
A method that adds a normal notification.
Parameters:
-
message(str) –The notification message text.