FEM: writer base, use tempfile module for the temp directory

This commit is contained in:
Bernd Hahnebach
2021-10-04 16:58:50 +02:00
parent fa843ad084
commit 8bb582f23f

View File

@@ -72,11 +72,12 @@ class FemInputWriter():
)
make_tmp_dir = True
if make_tmp_dir is True:
dir_name = self.document.TransientDir.replace(
"\\", "/"
) + "/FemAnl_" + analysis_obj.Uid[-4:]
os.mkdir(dir_name)
from tempfile import mkdtemp
dir_name = mkdtemp(prefix="fcfem_")
FreeCAD.Console.PrintWarning(
"The working directory '{}' was created and will be used."
.format(dir_name)
)
self.dir_name = dir_name
# new class attributes