pytower.tower
- class pytower.tower.PyTowerParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]
- pytower.tower.backup(mode, filename, backends=None, backend='Catbox', force=False)[source]
Prints list of tools
- Parameters:
mode (
str) – Either ‘save’ or ‘restore’filename (
str) – Path or file name of the CondoData/.map file to backupbackends (
Optional[list[ResourceBackend]]) – List of resource backends, if included avoids reloadingbackend (
str) – Backend to use when restoringforce (
bool) – Whether to force reupload of resources
- pytower.tower.convert(filename)[source]
Converts input into .json or vice versa, from the uesave tower-unite-suitebro .json format
- Parameters:
filename (
str) – Path or file name of the CondoData/.map file to convert
- pytower.tower.find_tool(tools, name)[source]
- Return type:
tuple[ModuleType|str,ToolMetadata] |None- Parameters:
tools (list[tuple[ModuleType | str, ToolMetadata]])
name (str)
- pytower.tower.fix(filename, backends=None, backend='Catbox', force=False)[source]
Scans a directory for tool scripts and registers detected tool scripts
- pytower.tower.get_parser(tool_names)[source]
- Parameters:
tool_names (
str) – List of tool names as a string. Used when running pytower- Return type:
- Returns:
The argparse parser used to parse the program input
- pytower.tower.get_resource_backends()[source]
- Return type:
- Returns:
List of ResourceBackends registered with PyTower
- pytower.tower.get_tool_names(tools)[source]
- Return type:
- Parameters:
tools (list[tuple[ModuleType | str, ToolMetadata]])
- pytower.tower.info_tool(tool_input, tools=None, tool_names='')[source]
Prints information about input tool name
- Parameters:
tool_input (
str) – Name of the tool to print info fortools (
Optional[list[tuple[ModuleType|str,ToolMetadata]]]) – List of tools, if included avoids reloading the tool indextool_names (
str) – Tool names, if included avoids recalculating
- pytower.tower.list_tools(tools=None)[source]
Prints list of tools
- Parameters:
tools (
Optional[list[tuple[ModuleType|str,ToolMetadata]]]) – List of tools, if included avoids reloading the tool index
- pytower.tower.parse_args(parser=None)[source]
- Parameters:
parser (PyTowerParser | None)
- pytower.tower.parse_parameters(param_input, meta)[source]
Parse input parameters into a ParameterDict to pass into tool’s main method
- Parameters:
param_input (
list[Any]) – List of strings in the format “parameter=value” to be parsedmeta (
ToolMetadata) – Accompanying metadata of the tool being run
- Return type:
- Returns:
ParameterDict object containing parsed parameters, which can be accessed with dot notation or like a dictionary
- pytower.tower.parse_resource_backend(backends, backend_input)[source]
- Return type:
- Parameters:
backends (list[ResourceBackend])
backend_input (str)
- pytower.tower.parse_selector(selection_input)[source]
Parses a single selector string input into a Selector object
- pytower.tower.parse_selectors(selection_input)[source]
Parses an input string, where each selector is separated with a ‘;’, into a sequence of Selector objects
- pytower.tower.run(input_filename, tool, selector=None, params=None)[source]
Mock run for rapid prototyping tools
- pytower.tower.scan(path, tools=None)[source]
Scans a directory for tool scripts and registers detected tool scripts
- Parameters:
path (
str) – Path of directory to scantools (
Optional[list[tuple[ModuleType|str,ToolMetadata]]]) – List of tools, if included avoids reloading the tool index
- Return type:
list[tuple[ModuleType|str,ToolMetadata]]