aac.execute.aac_execution_result

Provides classes for representing the results of executing a plugin.

Classes

ExecutionMessage(message, level, source, ...)

Provides a message for the user.

ExecutionResult(plugin_name, ...[, messages])

Provides information regarding the results of the execution of a plugin.

ExecutionStatus(value[, names, module, ...])

An enumeration that represents status codes for AaC commands to return.

MessageLevel(value[, names, module, ...])

An enumeration that represents the level of a message.

Exceptions

ExecutionError(message)

A base class representing a plugin error condition.

OperationCancelled(message)

A base class representing an cancelled plugin operation condition.

exception aac.execute.aac_execution_result.ExecutionError(message: str)[source]

A base class representing a plugin error condition.

Parameters:

message (str)

Return type:

None

message

a textual description of the reason for the exception.

Type:

str

class aac.execute.aac_execution_result.ExecutionMessage(message: str, level: MessageLevel, source: AaCFile | None, location: SourceLocation | None)[source]

Provides a message for the user.

Parameters:
message

The textual content of the message.

Type:

str

level

value of MessageLevel.DEBUG, .INFO, .WARNING, or .ERROR

Type:

MessageLevel

source

(AaCFile): The file from whence the message came.

Type:

aac.in_out.files.aac_file.AaCFile | None

location

(SourceLocation): The col, row info within the source file.

Type:

aac.context.source_location.SourceLocation | None

class aac.execute.aac_execution_result.ExecutionResult(plugin_name: str, plugin_command_name: str, status_code: ExecutionStatus, messages: list[ExecutionMessage] = NOTHING)[source]

Provides information regarding the results of the execution of a plugin.

Parameters:
plugin_name

The name of the plugin whose results are included.

Type:

str

plugin_command_name

The name of the command which contributed to these results.

Type:

str

status_code

A status code for the plugin execution.

Type:

ExecutionStatus

messages

A list of messages for the user.

Type:

list[str]

add_message(message: ExecutionMessage) None[source]

Add a message to the list of messages.

Parameters:

message (ExecutionMessage)

Return type:

None

add_messages(messages: list[ExecutionMessage]) None[source]

Add messages to the list of messages.

Parameters:

messages (list[ExecutionMessage])

Return type:

None

get_messages_as_string() str[source]

Return the output messages as a combined string.

Return type:

str

is_success() bool[source]

Return True if the command succeeded; False, otherwise.

Return type:

bool

class aac.execute.aac_execution_result.ExecutionStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

An enumeration that represents status codes for AaC commands to return.

class aac.execute.aac_execution_result.MessageLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

An enumeration that represents the level of a message.

exception aac.execute.aac_execution_result.OperationCancelled(message: str)[source]

A base class representing an cancelled plugin operation condition.

Parameters:

message (str)

Return type:

None

message

a textual description of the reason for cancellation.

Type:

str