From 4fe9554e65e8a87fce1d81bebbb2f18c63d8af99 Mon Sep 17 00:00:00 2001 From: Yoann AUDOUIN Date: Tue, 13 Jun 2017 07:57:01 +0200 Subject: [PATCH] Cleanup --- src/salome_hydro/study.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/salome_hydro/study.py b/src/salome_hydro/study.py index b4cecc5..f045f9b 100644 --- a/src/salome_hydro/study.py +++ b/src/salome_hydro/study.py @@ -181,12 +181,15 @@ class HydroStudyEditor: jdc = jdcfile.read() params = jdc_to_dict(jdc, ["TELEMAC2D", "_F"]) - yacs_scheme = generate_yacs_study(params) + # Generation script string + python_script = generate_study_script(params) + + # Computing name of the file (same as filePath) file_dir, filename = os.path.split(filePath) root, sfx = os.path.splitext(filename) - python_file = os.path.join(file_dir,root+".xml") + python_file = os.path.join(file_dir,root+".py") - python_script = generate_study_script(params) + # Writting to file with open(python_file,'w') as pfile: pfile.write(python_script) @@ -200,13 +203,16 @@ class HydroStudyEditor: jdc = jdcfile.read() params = jdc_to_dict(jdc, ["TELEMAC2D", "_F"]) - yacs_scheme = generate_yacs_study(params) + # Generation YACS scheme + yacs_scheme = generate_study_yacs(params) + + # Computing name of the file (same as filePath) file_dir, filename = os.path.split(filePath) root, sfx = os.path.splitext(filename) yacs_file = os.path.join(file_dir,root+".xml") - yacs_scheme = generate_study_yacs(params) - yacs_scheme.saveScheme(yacs_file) + # Writting to file + yacs_scheme.saveSchema(yacs_file) def find_or_create_coupling1d2d_case(self, filePath): self.find_or_create_hydro_component() -- 2.39.2