Fix processing ifcpatch docs after fe8c396e1

bim.update_ifc_patch_arguments in Bonsai wasn't ready for list[xxx] generic and was throwing errors and not showing browse file button.
This commit is contained in:
Andrej730
2024-11-11 12:08:39 +05:00
parent 6ece1648ab
commit 67f8c74c70
+7
View File
@@ -157,6 +157,13 @@ def _extract_docs(cls, method_name, boilerplate_args):
type_hint = type_hints.get(input_name, None)
if type_hint is None: # The argument is not type-hinted. (Or hinted to None ??)
continue
input_data = inputs[input_name]
# E.g. list[str].
if isinstance(type_hint, typing.GenericAlias):
input_data["generic_type"] = type_hint.__name__
type_hint = typing.get_args(type_hint)[0]
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":