launcher¶
This launcher can run MayaPlugins in a maya standalone environment
It can also run the core standalone plugins but it is recommended to use the regular jukeboxcore launcher for that.
- class jukeboxmaya.launcher.Launcher[source]¶
Bases: object
Provides commands and handles argument parsing
Initialize parsers
Raises: None - setup_core_parser()[source]¶
Setup the core parser
Returns: the parser Return type: argparse.ArgumentParser Raises: None
- setup_cmd_subparsers(parser)[source]¶
Add a subparser for commands to the given parser
Parameters: parser (argparse.ArgumentParser) – the argument parser to setup Returns: the subparser action object Return type: action object Raises: None
- setup_launch_parser(parser)[source]¶
Setup the given parser for the launch command
Parameters: parser (argparse.ArgumentParser) – the argument parser to setup Returns: None Return type: None Raises: None
- launch(args, unknown)[source]¶
Launch something according to the provided arguments
Parameters: - args (Namespace) – arguments from the launch parser
- unknown (list) – list of unknown arguments
Returns: None
Return type: None
Raises: SystemExit
- setup_list_parser(parser)[source]¶
Setup the given parser for the list command
Parameters: parser (argparse.ArgumentParser) – the argument parser to setup Returns: None Return type: None Raises: None
- list(args, unknown)[source]¶
List all addons that can be launched
Parameters: - args (Namespace) – arguments from the launch parser
- unknown (list) – list of unknown arguments
Returns: None
Return type: None
Raises: None
- parse_args(args=None)[source]¶
Parse the given arguments
All commands should support executing a function, so you can use the arg Namespace like this:
launcher = Launcher() args, unknown = launcher.parse_args() args.func(args, unknown) # execute the command
Parameters: args – arguments to pass Returns: the parsed arguments and all unknown arguments Return type: (Namespace, list) Raises: None