From 49cbc7be98dfc2b4fb81a8c8a0c08425766cbd8f Mon Sep 17 00:00:00 2001 From: Yoann AUDOUIN Date: Mon, 12 Jun 2017 10:53:42 +0200 Subject: [PATCH] Final modifications --- src/salome_hydro/study.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/salome_hydro/study.py b/src/salome_hydro/study.py index dfb0371..b4cecc5 100644 --- a/src/salome_hydro/study.py +++ b/src/salome_hydro/study.py @@ -181,27 +181,32 @@ class HydroStudyEditor: jdc = jdcfile.read() params = jdc_to_dict(jdc, ["TELEMAC2D", "_F"]) + yacs_scheme = generate_yacs_study(params) + file_dir, filename = os.path.split(filePath) + root, sfx = os.path.splitext(filename) + python_file = os.path.join(file_dir,root+".xml") + python_script = generate_study_script(params) - print python_script + with open(python_file,'w') as pfile: + pfile.write(python_script) def generate_study_yacs(self, filePath): """ Generating a yacs file from the eficas info """ # Create "Python script" item - from TelApy.api.generate_study import generate_yacs_study + from TelApy.api.generate_study import generate_study_yacs with open(filePath) as jdcfile: jdc = jdcfile.read() params = jdc_to_dict(jdc, ["TELEMAC2D", "_F"]) yacs_scheme = generate_yacs_study(params) - file_dir = os.path.basename(filePath) - root, sfx = filePath.splitext() + file_dir, filename = os.path.split(filePath) + root, sfx = os.path.splitext(filename) yacs_file = os.path.join(file_dir,root+".xml") - print yacs_file - print yacs_scheme - + yacs_scheme = generate_study_yacs(params) + yacs_scheme.saveScheme(yacs_file) def find_or_create_coupling1d2d_case(self, filePath): self.find_or_create_hydro_component() -- 2.39.2