From: Renaud Barate Date: Fri, 7 Dec 2012 09:33:41 +0000 (+0100) Subject: When generating batch job, use Save Study instead of SaveAs when possible to avoid... X-Git-Tag: V6_6_0~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=484e053ca1826c0d15793a5ba0b3b8ac415085f6;p=modules%2Fparametric.git When generating batch job, use Save Study instead of SaveAs when possible to avoid changing the study name. --- diff --git a/src/salome/parametric/genjob.py b/src/salome/parametric/genjob.py index 351d4bd..c7ccc20 100644 --- a/src/salome/parametric/genjob.py +++ b/src/salome/parametric/genjob.py @@ -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), diff --git a/src/salome/parametric/gui/genjob.ui b/src/salome/parametric/gui/genjob.ui index ec126b3..8df9add 100644 --- a/src/salome/parametric/gui/genjob.ui +++ b/src/salome/parametric/gui/genjob.ui @@ -66,6 +66,14 @@ + + + + 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. + + +