mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 03:19:53 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user