]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
On backup le schéma xml avant de le regéner afin de détecter les erreurs
authorAndré Ribes <andre.ribes@edf.fr>
Mon, 4 Apr 2011 08:41:41 +0000 (10:41 +0200)
committerAndré Ribes <andre.ribes@edf.fr>
Mon, 4 Apr 2011 08:41:41 +0000 (10:41 +0200)
src/daSalome/daGUI/daGuiImpl/adaoCase.py

index 8ad01a563bb065d440f0344331c2809314d30088..c76fac967fb8adf755578f6fa68be6e8317180e2 100644 (file)
@@ -66,6 +66,11 @@ class AdaoCase:
     if (self.filename == ""):
       return "You need to save your case to export it"
 
+    self.yacs_filename = self.filename[:self.filename.rfind(".")] + '.xml'
+    yacs_filename_backup = self.filename[:self.filename.rfind(".")] + '.xml.back'
+    if os.path.exists(self.yacs_filename):
+      os.rename(self.yacs_filename, yacs_filename_backup)
+
     self.eficas_editor.modified = True
     self.eficas_editor.saveFile()
     filename = self.filename[:self.filename.rfind(".")] + '.py'
@@ -79,7 +84,6 @@ class AdaoCase:
 
     adao_path = os.environ["ADAO_ROOT_DIR"]
     adao_exe = adao_path + "/bin/salome/AdaoYacsSchemaCreator.py"
-    self.yacs_filename = self.filename[:self.filename.rfind(".")] + '.xml'
     args = ["python", adao_exe, filename, self.yacs_filename]
     p = subprocess.Popen(args)
     (stdoutdata, stderrdata) = p.communicate()