culebra.tools.abc.GeneratorScript class¶
- class GeneratorScript(args: list[str] | None = None)¶
Bases:
ScriptConstruct the generator.
Generate an empty argument parser. Subclasses should add arguments to the parser.
Static methods¶
- static GeneratorScript.load(filename: str) Base¶
Load a serialized object from a file.
- Parameters:
filename (str) – The file name.
- Returns:
The loaded object
- Raises:
TypeError – If filename is not a valid file name
ValueError – If the filename extension is not
SERIALIZED_FILE_EXTENSION
Methods¶
- GeneratorScript.dump(filename: str) None¶
Serialize this object and save it to a file.
- Parameters:
filename (str) – The file name.
- Raises:
TypeError – If filename is not a valid file name
ValueError – If the filename extension is not
SERIALIZED_FILE_EXTENSION
- GeneratorScript.parse_args() None¶
Parse command-line arguments.
Subclasses should validate the arguments.
- Raises:
SystemExit – If the command-line arguments are invalid or
--helpis requested.

