From: Yoann AUDOUIN Date: Mon, 12 Jun 2017 08:53:42 +0000 (+0200) Subject: Final modifications X-Git-Tag: Salome_8_3_Hydro_2_0rc1~14^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=49cbc7be98dfc2b4fb81a8c8a0c08425766cbd8f;p=modules%2Fhydrosolver.git Final modifications --- 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()