Salome HOME
Cleanup pre/V8_2_BR_Yoann
authorYoann AUDOUIN <B61570@dsp0761867.postes.calibre.edf.fr>
Tue, 13 Jun 2017 05:57:01 +0000 (07:57 +0200)
committerYoann AUDOUIN <B61570@dsp0761867.postes.calibre.edf.fr>
Tue, 13 Jun 2017 05:57:01 +0000 (07:57 +0200)
src/salome_hydro/study.py

index b4cecc5e281aba899bd0b0d4605526989f496792..f045f9b77d0a6d93d4b37bc5a0806cfc50280939 100644 (file)
@@ -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()