Messages

Messages are the objects you use to send instructions to the manager, and they are the objects the manager uses to send data back to you.

Command Messages

These messages should be used by your application to control the manager running the terminal display. They should never be sent by the manager to the application.

class thurible.messages.Alert(name: str = 'alert', title: str = '', text: str = 'Error.', options: Sequence[Option] = (Option(name='Continue', hotkey=''),))[source]

Create a new thurible.messages.Alert object. This object is a command message used to instruct a manager to show an alert message to the user.

Parameters:
  • name – (Optional.) The name the manager will use to store the thurible.Dialog object created in response to this message. The default name is “alert”.

  • title – (Optional.) The title of the alert.

  • text – (Optional.) The text of the alert. The default value is “Error.”

  • options – (Optional.) The options given to the user for responding to the alert. The default is “Continue”.

Returns:

None.

Return type:

NoneType

class thurible.messages.Delete(name: str)[source]

Create a new thurible.messages.Delete object. This object is a command message used to instruct a manager to delete a stored panel.

Parameters:

name – The name of the panel to delete.

Returns:

None.

Return type:

NoneType

class thurible.messages.Dismiss(name: str = 'alert')[source]

Create a new thurible.messages.Dismiss object. This object is a command message used to stop displaying an alert.

Parameters:

name – (Optional.) The name of the panel to dismiss.

Returns:

None.

Return type:

NoneType

class thurible.messages.End(text: str = '')[source]

Create a new thurible.messages.End object. This object is a command message used to instruct a manager to end the manager loop and quit.

Parameters:

text – (Optional.) A message to print for the user after the manager loop ends.

Returns:

None.

Return type:

NoneType

class thurible.messages.Ping(name: str)[source]

Create a new thurible.messages.Ping object. This object is a command message used to instruct a manager to reply with a thurible.message.Pong message, proving the manager is still listening for and responding to messages.

Parameters:

name – A unique name used to identify the resulting thurible.message.Pong message as being caused by this message.

Returns:

None.

Return type:

NoneType

class thurible.messages.Show(name: str)[source]

Create a new thurible.messages.Show object. This object is a command message used to instruct a manager to display a stored panel.

Parameters:

name – The name of the panel to display.

Returns:

None.

Return type:

NoneType

class thurible.messages.Showing(name: str = '')[source]

Create a new thurible.messages.Showing object. This object is a command message used to instruct a manager to respond with a thurible.messages.Shown message with the name of the currently displayed panel.

Parameters:

name – (Optional.) A unique name used to identify the resulting thurible.message.Shown message as being caused by this message.

Returns:

None.

Return type:

NoneType

class thurible.messages.Store(name: str, display: Panel)[source]

Create a new thurible.messages.Store object. This object is a command message used to instruct a manager to store a panel for later display.

Parameters:
  • name – The name of the panel to store.

  • name – The panel to store.

Returns:

None.

Return type:

NoneType

class thurible.messages.Storing(name: str = '')[source]

Create a new thurible.messages.Storing object. This object is a command message used to instruct a manager to respond with a thurible.message.Stored object containing the names of the currently stored panels.

Parameters:

name – (Optional.) A unique name used to identify the resulting thurible.message.Stored message as being caused by this message.

Returns:

None.

Return type:

NoneType

class thurible.log.Update(text: str)[source]

Create a new thurible.log.Update object. This object is a command message used to instruct the currently displayed thurible.Log to add the text given in the message.

Parameters:

text – The message to add to the panel.

Returns:

None.

Return type:

NoneType

class thurible.progress.Tick(message: str = '')[source]

Create a new thurible.progress.Tick object. When sent to thurible.Progress.update(), this will cause the progress bar to advance.

Parameters:

message – A message to display.

Returns:

None.

Return type:

NoneType

class thurible.progress.NoTick(message: str = '')[source]

Create a new thurible.progress.NoTick object. When sent to thurible.Progress.update(), this will not cause the progress bar to advance.

Parameters:

message – A message to display.

Returns:

None.

Return type:

NoneType

Response Messages

These messages are used by managers to respond to or alert your application. They should never be sent by the application to the manager.

class thurible.messages.Data(value: str)[source]

Create a new thurible.messages.Data object. This object is a response message used to send data back to the application.

Parameters:

value – The data being sent to the application.

Returns:

None.

Return type:

NoneType

class thurible.messages.Ending(reason: str = '', ex: Exception | None = None)[source]

Create a new thurible.messages.Ending object. This object is a response message used to inform the application that the manager is ending.

Parameters:
  • reason – (Optional.) The reason the manager loop is ending.

  • ex – (Optional.) The exception causing the manager loop to end.

Returns:

None.

Return type:

NoneType

class thurible.messages.Pong(name: str)[source]

Create a new thurible.messages.Pong object. This object is a response message used to respond to a thurible.messages.Ping message.

Parameters:

name – The name of the thurible.messages.Ping message that caused this response.

Returns:

None.

Return type:

NoneType

class thurible.messages.Shown(name: str, display: str)[source]

Create a new thurible.messages.Shown object. This object is a response message used to respond to a thurible.messages.Showing message.

Parameters:
Returns:

None.

Return type:

NoneType

class thurible.messages.Stored(name: str, stored: tuple[str, ...])[source]

Create a new thurible.messages.Stored object. This object is a response message used to respond to a thurible.messages.Storing message.

Parameters:
Returns:

None.

Return type:

NoneType