Python: Fix support for named exports

This commit is contained in:
Simon Hausmann 2024-08-13 10:56:12 +02:00 committed by Simon Hausmann
parent 2d5d53fba8
commit 636de6fc7c
7 changed files with 73 additions and 4 deletions

View file

@ -242,9 +242,15 @@ def load_file(path, quiet=False, style=None, include_paths=None, library_paths=N
setattr(module, comp_name, wrapper_class)
for name, struct_or_enum_prototype in result.structs_and_enums.items():
name = _normalize_prop(name)
struct_wrapper = _build_struct(name, struct_or_enum_prototype)
setattr(module, name, struct_wrapper)
for orig_name, new_name in result.named_exports:
orig_name = _normalize_prop(orig_name)
new_name = _normalize_prop(new_name)
setattr(module, new_name, getattr(module, orig_name))
return module