tomwer.utils.Launcher#

class tomwer.utils.Launcher(prog=None, usage=None, description=None, epilog=None, version=None)#

Manage launch of module.

Provides an API to describe available commands and feature to display help and execute the commands.

add_command(name=None, module_name=None, description=None, command=None)#

Add a command to the launcher.

See also LauncherCommand.

Parameters:
  • name – Name of the command

  • module_name – Module to execute

  • description – Description of the command

  • command (LauncherCommand) – A LauncherCommand

execute(argv=None)#

Execute the launcher.

Parameters:

argv – The list of arguments (the first one is the name of the application)

Returns:

The execution status

execute_help(argv)#

Execute the help command.

Parameters:

argv – The list of arguments (the first one is the name of the application with the help command)

Returns:

The execution status

print_help()#

Print the help to stdout.