Improve ifc patch arguments User Experience (#1655)

* Add description field to Attribute Container

* Add helper function to extract IFCPatch arguments

* Add Operator to populate Attributes with IFCPatch arguments

* Support int, float, bool and improve UX/UI

* Move all reflection logic inside helper module

* Improve UI

* Correctly unpack arguments when Patching IFC

* Refactor Attribute class to provide agnostic value access

* Take advantage of Attribute agnosticity refactor

* Use regular json if no docstring when Patching

* centralize docstring extraction in UI module

* Revert "centralize docstring extraction in UI module"

This reverts commit e7a63d2a0b.

* Place Patch description in recipe enum field

* Minor fixes

* Minor fixes

* Remove description field from Attribute

* Auto-update IFC Patch args on recipe change
This commit is contained in:
Gorgious56
2021-08-16 00:16:51 +02:00
committed by GitHub
parent d22c11c200
commit 296bf0387d
20 changed files with 247 additions and 325 deletions
+5 -1
View File
@@ -32,7 +32,11 @@ def execute(args, is_library=None):
print("# Loading patch recipe ...")
recipes = getattr(__import__("ifcpatch.recipes.{}".format(args["recipe"])), "recipes")
recipe = getattr(recipes, args["recipe"])
patcher = recipe.Patcher(args["input"], ifc_file, logger, args["arguments"])
try:
# We unpack the arguments if the Patcher has been type-hinted and docstringed
patcher = recipe.Patcher(args["input"], ifc_file, logger, *args["arguments"])
except TypeError:
patcher = recipe.Patcher(args["input"], ifc_file, logger, args["arguments"])
print("# Patching ...")
patcher.patch()
ifc_file = getattr(patcher, "file_patched", patcher.file)