Skip to content

notification

dev_tool.tui.components.notification

NotificationComponent

A component for rendering notifications.

The constructor for the NotificationComponent class.

Parameters:

  • terminal (Terminal) –

    The blessed Terminal instance.

Source code in dev_tool/tui/components/notification.py
def __init__(self, terminal: Terminal) -> None:
    """
    The constructor for the NotificationComponent class.

    :param terminal: The blessed Terminal instance.
    """

    self.notification = NotificationDisplay(terminal)
    self.terminal = terminal

notification = NotificationDisplay(terminal) instance-attribute

terminal = terminal instance-attribute

draw

A method that draws notification banners below the header.

Parameters:

  • output (list) –

    The list to append terminal output strings to.

Source code in dev_tool/tui/components/notification.py
def draw(self, output: list) -> None:
    """
    A method that draws notification banners below the header.

    :param output: The list to append terminal output strings to.
    """

    lines = self.notification.get_notification_lines()

    for index, line in enumerate(lines):
        output.append(self.terminal.move(2 + index, 0) + line)

get_notification_lines

A method that gets the current notification lines.

Returns:

  • list

    The list of notification lines.

Source code in dev_tool/tui/components/notification.py
def get_notification_lines(self) -> list:
    """
    A method that gets the current notification lines.

    :return: The list of notification lines.
    """

    return self.notification.get_notification_lines()