ifctester - save results to temp directory

the way it was intended to originally but absolute paths of ifc and ids got in the way
Replaced TemporaryDirectory with mkdtemp as sometimes .html report doesn't open fast enough and directory gets deleted. Also need to keep the directory to make sure .ods is not removed.
This commit is contained in:
Andrej730
2024-11-27 16:13:22 +05:00
parent eca71032bf
commit b7db3da017
@@ -70,9 +70,11 @@ class ExecuteIfcTester(bpy.types.Operator):
def execute_tester(self, ifc_data: ifcopenshell.file, ifc_path: str, specs_path: str) -> Union[set[str], None]:
props = bpy.context.scene.IfcTesterProperties
with tempfile.TemporaryDirectory() as dirpath:
# No need for if-statement, just postponing lots of diffs.
if True:
dirpath = tempfile.mkdtemp()
start = time.time()
output = Path(os.path.join(dirpath, "{}_{}.html".format(ifc_path, os.path.basename(specs_path))))
output = Path(os.path.join(dirpath, "{}_{}.html".format(Path(ifc_path).name, Path(specs_path).name)))
try:
specs = ifctester.ids.open(specs_path)