display
dev_tool.services.notification.display
NotificationDisplay
A display class for rendering notifications in the terminal.
This class handles the formatting and styling of notifications for display in both banner and text formats with terminal color support.
The constructor for the NotificationDisplay class.
Parameters:
-
terminal(Terminal | None, default:None) –The blessed Terminal instance for display operations.
-
theme(Default | None, default:None) –The theme instance for styling notifications.
Source code in dev_tool/services/notification/display.py
notification = NotificationService()
instance-attribute
terminal = terminal or Terminal()
instance-attribute
theme = theme or Default(self.terminal)
instance-attribute
display_active
A method that displays all active notifications in command mode.
Parameters:
-
service(NotificationService) –The notification service to get active notifications from.
Source code in dev_tool/services/notification/display.py
display_new_notifications
A method that displays any new notifications that haven't been shown yet.
Parameters:
-
service(NotificationService) –The notification service to get active notifications from.
-
displayed(set) –Set of already displayed notification keys.
Source code in dev_tool/services/notification/display.py
format_notification_banner
A method that formats a notification for banner display.
Parameters:
-
notification(Notification) –The notification object to format.
Returns:
-
str–The formatted notification banner string.
Source code in dev_tool/services/notification/display.py
get_notification_lines
A method that gets formatted notification lines for display.
Returns:
Source code in dev_tool/services/notification/display.py
has_active_notifications
A method that checks if there are any active notifications.
Returns:
-
bool–True if there are active notifications, False otherwise.