From ded759f0060556b9076439336578b783b8b5e233 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Ribes?= Date: Mon, 4 Apr 2011 10:41:41 +0200 Subject: [PATCH] =?utf8?q?On=20backup=20le=20sch=C3=A9ma=20xml=20avant=20d?= =?utf8?q?e=20le=20reg=C3=A9ner=20afin=20de=20d=C3=A9tecter=20les=20erreur?= =?utf8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/daSalome/daGUI/daGuiImpl/adaoCase.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/daSalome/daGUI/daGuiImpl/adaoCase.py b/src/daSalome/daGUI/daGuiImpl/adaoCase.py index 8ad01a5..c76fac9 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoCase.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoCase.py @@ -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() -- 2.39.2