feat: Parse type "Literal" as enum property in the IFC Patch Panel

This commit is contained in:
Blender Defender
2024-07-25 19:18:13 +02:00
committed by Dion Moult
parent 74fbf29d5f
commit 9ac159e0af
2 changed files with 8 additions and 1 deletions
+3
View File
@@ -158,6 +158,9 @@ def _extract_docs(cls, method_name, boilerplate_args):
continue
if isinstance(type_hint, typing._UnionGenericAlias):
inputs[input_name]["type"] = [t.__name__ for t in typing.get_args(type_hint)]
elif type_hint.__name__ == "Literal":
inputs[input_name]["type"] = "Literal"
inputs[input_name]["enum_items"] = list(typing.get_args(type_hint))
else:
inputs[input_name]["type"] = type_hint.__name__