uppaal2jetracer package

Subpackages

Submodules

uppaal2jetracer.cli module

Command line interface

This file contains all functionality required to run uppaal2jetracer in the command line.

The CLI accepts the following commands:

  • help: Get list of available commands.

  • parse: Parse an uppaal system to an executable model.

  • prj: Access projects which contain versions of parsed uppaal systems.

  • quit: Quit uppaal2jetracer.

  • run: Run a parsed uppaal system.

  • ver: Access saved versions of parsed uppaal systems.

This file can be imported as a module and contains the following classes:

  • Uppaal2JetRacer: Starts uppaal2jetracer.

  • CLI: Handles CLI input.

class CLI(version_manager: VersionManager, project_manager: ProjectManager)[source]

Bases: CommandHandler

A CommandHandler that handles CLI commands.

get_confirmation(message: str) bool[source]

Asks the user to confirm their input.

Parameters:

message (str) – The message to ask the user for.

Returns:

True if the user has confirmed, False otherwise.

Return type:

bool

handle_input()[source]

Handles command line input from a user.

class Uppaal2JetRacer[source]

Bases: object

The entry class for uppaal2jetracer.

static main()[source]

Start uppaal2jetracer.

uppaal2jetracer.command_system module

Command system

This file provides all interfaces required to access uppaal2jetracer commands.

This file can be imported as a module and contains the following classes:

  • CommandHandler: Interface for handling uppaal2jetracer commands.

  • CommandResult: Result of uppaal2jetracer commands.

  • CommandResultType: Result type of uppaal2jetracer commands.

  • Command: Interface for all uppaal2jetracer commands.

  • ParseCommand: Command for parsing UPPAAL automata.

  • ParseRunCommand: Command for parsing and running an UPPAAL system.

  • ProjectCommand: Command for managing projects.

  • QuitCommand: Command for quitting uppaal2jetracer.

  • RunCommand: Command for running a parsed UPPAAL system.

  • VersionCommand: Command for managing versions of parsed automata.

class Command[source]

Bases: ABC

Abstract base class for all u2j-commands.

abstract execute(args: List[str]) CommandResult[source]

Executes the command.

Parameters:

args (List[str]) – Arguments passed to the command.

Returns:

Result of the command.

Return type:

CommandResult

property help_message: str

Returns the help message for the command.

Returns:

The help message.

Return type:

str

property loggers: List[str]

Returns the debugger of the command.

Returns:

The debugger.

Return type:

str

class CommandHandler(version_manager: VersionManager, project_manager: ProjectManager)[source]

Bases: ABC

Abstract base class for all command handlers.

Variables:
static activate_debug(loggers: List[str])[source]

Activates debug mode for given loggers. :param loggers: List of logger names. :type loggers: List[str]

deactivate_debug()[source]

Deactivates debug mode for all loggers.

get_confirmation(message: str) bool[source]

Asks the user to confirm their input.

Parameters:

message (str) – The message to ask the user for.

Returns:

True if the user has confirmed, False otherwise.

Return type:

bool

abstract handle_input()[source]

Handles the input of an actor using the command system.

property parse_command_name: str

Returns the name of the parse command.

property parse_run_command_name: str

Returns the name of the parse and run command.

property project_command_name: str

Returns the name of the project command.

quit()[source]

Quits the program.

property quit_command_name: str

Returns the name of the quit command.

property run_command_name: str

Returns the name of the run command.

property version_command_name: str

Returns the name of the version command.

class CommandResult(message: str, result_type: CommandResultType, payload: List[ResponseObject] = None)[source]

Bases: object

A class capsuling the result of a command execution.

Variables:
  • _message (str) – The return message of the command.

  • _payload (List[ResponseObject]) – Response payload of the command.

  • _result_type (CommandResultType) – The type of the result. Either “success” or “failure”.

property message: str

The return message of the command.

property payload: List[ResponseObject]

The payload of the command.

property result_type: CommandResultType

The type of the result. Either “success” or “failure”.

class CommandResultType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

An enum class with result types of a command.

FAILURE = 1
SUCCESS = 0
class ParseCommand(version_manager: VersionManager)[source]

Bases: Command

A command to parse an UPPAAL system to an executable UPPAAL model.

execute(args: List[str]) CommandResult[source]

Executes the command.

Parameters:

args (List[str]) – Arguments passed to the command.

Returns:

Result of the command.

Return type:

CommandResult

class ParseRunCommand(parse_command: ParseCommand, run_command: RunCommand)[source]

Bases: Command

A command to parse and execute an UPPAAL system.

execute(args: List[str]) CommandResult[source]

Executes the command.

Parameters:

args (List[str]) – Arguments passed to the command.

Returns:

Result of the command.

Return type:

CommandResult

class ProjectCommand(project_manager: ProjectManager)[source]

Bases: Command

A command for managing projects.

execute(args: List[str]) CommandResult[source]

Executes the command.

Parameters:

args (List[str]) – Arguments passed to the command.

Returns:

Result of the command.

Return type:

CommandResult

class QuitCommand(command_handler: CommandHandler)[source]

Bases: Command

A command to quit uppaal2jetracer.

execute(args: List[str]) CommandResult[source]

Executes the command.

Parameters:

args (List[str]) – Arguments passed to the command.

Returns:

Result of the command.

Return type:

CommandResult

class RunCommand[source]

Bases: Command

A command to run an UPPAAL system.

execute(args: List[str]) CommandResult[source]

Executes the command.

Parameters:

args (List[str]) – Arguments passed to the command.

Returns:

Result of the command.

Return type:

CommandResult

class VersionCommand(command_handler: CommandHandler, version_manager: VersionManager)[source]

Bases: Command

A command to manage versions of parsed UPPAAL systems.

execute(args: List[str]) CommandResult[source]

Executes the command.

Parameters:

args (List[str]) – Arguments passed to the command.

Returns:

Result of the command.

Return type:

CommandResult

uppaal2jetracer.httphandler module

HTTP

This file tests the capabilities of an HTTP python client.

This file can be imported as a module and contains the following classes:

  • HTTPHandler: The main handler for the HTTP requests.

class HTTPHandler[source]

Bases: object

Class for sending updates to the webinterface via HTTP Requests.

async send_message(msg: str)[source]

Send an update message to the webinterface via an HTTP POST request.

Parameters:

msg (str) – The message you wish to send.

update_webinterface(msg: str)[source]

Asynchronously send an update message to the webinterface via an HTTP POST request.

Parameters:

msg (str) – The message you wish to send.

Module contents