class documentation

class TextUI(object):

Constructor: TextUI()

View In Hierarchy

TextUI plugin class. This class provides a textual user interface for the ACME CSE.

Method __init__ Initialize the TextUI plugin.
Method configUpdate Callback for the configUpdate event.
Method configure Configure the TextUI plugin with the given configuration.
Method refreshResources Refresh the resources.
Method registrationUpdate Callback for registration-related events.
Method restart Restart the TextUI service.
Method runUI Run the TextUI. This will block until the TextUI is exited.
Method scriptClearConsole Clear the script console.
Method scriptLog Print a line to the script log output.
Method scriptLogError Print a line to the script log output.
Method scriptPrint Print a line to the script output.
Method scriptShowConfirmation Show a confirmation dialog.
Method scriptShowNotification Show a notification.
Method scriptVisualBell Visual bell.
Method shutdown Stop the TextUI service.
Method start Start the TextUI service.
Method validate Validate the configuration for the TextUI plugin.
Class Variable __slots__ Slots for TextUI class.
Instance Variable tuiApp Instance of the ACMETuiApp class.
def __init__(self):

Initialize the TextUI plugin.

@onEvent(eventManager.configUpdate)
def configUpdate(self, eventData: EventData):

Callback for the configUpdate event.

Parameters
eventData:EventDataThe event data, containing the name of the updated configuration setting and its new value.
def configure(self, config: Configuration):

Configure the TextUI plugin with the given configuration.

Parameters
config:ConfigurationThe configuration to use for the TextUI plugin.
def refreshResources(self) -> bool:

Refresh the resources.

Returns
boolAlways returns True.
@onEvent(eventManager.aeHasRegistered)
@onEvent(eventManager.aeHasDeregistered)
@onEvent(eventManager.registeredToRegistrarCSE)
@onEvent(eventManager.registreeCSEHasRegistered)
@onEvent(eventManager.registreeCSEHasDeregistered)
@onEvent(eventManager.deregisteredFromRegistrarCSE)
@onEvent(eventManager.registeredToRemoteCSE)
@onEvent(eventManager.csrUpdated)
def registrationUpdate(self, eventData: EventData):

Callback for registration-related events.

This will trigger an update of the container registrations in the TextUI.

Parameters
eventData:EventDataThe event data, containing information about the registration event.
def restart(self):

Restart the TextUI service.

def runUI(self) -> bool:

Run the TextUI. This will block until the TextUI is exited.

Returns
boolTrue if the TextUI was exited with a restart request, False if it was exited with a quit request.
def scriptClearConsole(self, scriptName: str) -> bool:

Clear the script console.

Parameters
scriptName:strName of the script.
Returns
boolAlways returns True.
def scriptLog(self, scriptName: str, msg: str) -> bool:

Print a line to the script log output.

Parameters
scriptName:strName of the script.
msg:strMessage to print.
Returns
boolAlways returns True.
def scriptLogError(self, scriptName: str, msg: str) -> bool:

Print a line to the script log output.

Parameters
scriptName:strName of the script.
msg:strMessage to print.
Returns
boolAlways returns True.
def scriptPrint(self, scriptName: str, msg: str):

Print a line to the script output.

Parameters
scriptName:strName of the script.
msg:strMessage to print.
def scriptShowConfirmation(self, msg: str, title: str, confirmButtonText: str | None = 'Confirm', cancelButtonText: str | None = 'Cancel') -> bool | None:

Show a confirmation dialog.

Parameters
msg:strMessage to show.
title:strTitle of the dialog.
confirmButtonText:str | NoneText for the confirm button.
cancelButtonText:str | NoneText for the cancel button.
Returns
bool | NoneTrue if the user confirmed, False if the user cancelled, None if TUI is not available.
def scriptShowNotification(self, msg: str, title: str, severity: Literal['information', 'warning', 'error'], timeout: float):

Show a notification.

Parameters
msg:strMessage to show.
title:strTitle of the notification.
severity:Literal['information', 'warning', 'error']Severity of the notification.
timeout:floatTimeout in seconds.
def scriptVisualBell(self, scriptName: str) -> bool:

Visual bell.

Parameters
scriptName:strName of the script.
Returns
boolAlways returns True.
def shutdown(self) -> bool:

Stop the TextUI service.

Returns
boolAlways returns True.
def start(self):

Start the TextUI service.

def validate(self, config: Configuration):

Validate the configuration for the TextUI plugin.

Parameters
config:ConfigurationThe configuration to validate.
Raises
ConfigurationErrorIf the configuration is invalid.
__slots__: tuple[str, ...] =

Slots for TextUI class.

tuiApp: ACMETuiApp =

Instance of the ACMETuiApp class.