]> SALOME platform Git repositories - modules/parametric.git/commitdiff
Salome HOME
When generating batch job, use Save Study instead of SaveAs when possible to avoid...
authorRenaud Barate <renaud.barate@edf.fr>
Fri, 7 Dec 2012 09:33:41 +0000 (10:33 +0100)
committerRenaud Barate <renaud.barate@edf.fr>
Fri, 7 Dec 2012 09:33:41 +0000 (10:33 +0100)
src/salome/parametric/genjob.py
src/salome/parametric/gui/genjob.ui

index 351d4bdfe1db7ad7e0d43ed5d40a1ebec204fc44..c7ccc20c65884acab8ec3d8ec62052d9b8a00104 100644 (file)
@@ -52,9 +52,13 @@ def generate_job(param_study, result_study_file_name, result_dir, resource):
   # Save Salome study
   ed = getStudyEditor()
   name_wo_space = param_study.name.replace(" ", "_")
-  (fd, input_study) = tempfile.mkstemp(prefix = name_wo_space + "_Input_", suffix = ".hdf")
-  os.close(fd)
-  salome.myStudyManager.SaveAs(input_study, ed.study, False)
+  if ed.study._get_IsSaved():
+    input_study = ed.study._get_Name()
+    salome.myStudyManager.Save(ed.study, False)
+  else:
+    (fd, input_study) = tempfile.mkstemp(prefix = name_wo_space + "_", suffix = ".hdf")
+    os.close(fd)
+    salome.myStudyManager.SaveAs(input_study, ed.study, False)
 
   # Generate job script
   job_script = job_script_template % {"input_study": os.path.basename(input_study),
index ec126b3d73bf1de2f54f6e5dbabddd9d73160887..8df9addc5028278940966c2c0d0b5be056b85206 100644 (file)
      </item>
     </layout>
    </item>
+   <item>
+    <widget class="QLabel" name="label_4">
+     <property name="text">
+      <string>Please note that your Salome study will automatically be saved when the job is generated.
+Remember to make a copy before if you don't want to overwrite your study.</string>
+     </property>
+    </widget>
+   </item>
    <item>
     <spacer name="verticalSpacer">
      <property name="orientation">