WarMAC Main¶
__init__.py file is the file that is called when WarMAC is executed.
It pulls together all of the necessary modules and functions and executes
them.- main.SUBCMD_DISPATCH: dict[str, Callable[[Namespace], None]] = average.average()¶
A dictionary of all commands that can be executed by the user.
- main.fix_http_headers(http_headers: dict[str, str], platform: Literal['pc', 'ps4', 'xbox', 'switch', 'mobile'] = 'pc', *, crossplay: bool = True) None¶
Append the platform name and crossplay status to HTTP headers dict.
Append the platform name and crossplay status to a dictionary containing HTTP headers.
- Parameters:
http_headers – HTTP headers dictionary.
platform – Desired platform, defaults to “pc”.
crossplay – Crossplay status, defaults to True.
- main.process_cli_command(args: list[str] | None) str¶
Parse cli args, set up headers, and execute appropriate subcommand.
Call
cli_parser.handle_input()to create and parse acli_parser.WarMACParser, create http headers for the http request, and execute the function associated with the specified subcommand.- Parameters:
args – Optional cli args used for testing.
- Raises:
errors.CommandError – Raised if the
subparserfield ofargparse.Namespacedoes not exist inmain.SUBCMD_DISPATCH.- Returns:
The data returned from the subcommand handler.