ifgen.struct.python package#

Module contents#

A module implementing Python struct-generation interfaces.

ifgen.struct.python.cpp_ns_final(data: str) → str[source]#

Get only the final string in a C++ style namespace string.

ifgen.struct.python.python_dependencies(enums: list[str], structs: list[str], enum_prefix: str = '..enums', struct_prefix: str = '') → dict[str, list[str]][source]#

Get the names of external (to the module being generated) dependencies by type.

ifgen.struct.python.python_enums_structs(task: GenerateTask) → tuple[list[str], list[str]][source]#

Get enum and struct dependency information for this task.

ifgen.struct.python.python_struct_field(writer: IndentedFileWriter, types: TypeSystem, field: dict[str, Any], structs: list[str], enums: list[str]) → None[source]#

Write lines for a struct field.

ifgen.struct.python.python_struct_fields(task: GenerateTask, writer: IndentedFileWriter, structs: list[str], enums: list[str]) → None[source]#

Write protocol initialization code.

ifgen.struct.python.python_struct_header(task: GenerateTask, writer: IndentedFileWriter) → None[source]#

Create a Python module for a struct.