From: André Ribes Date: Mon, 4 Apr 2011 08:41:41 +0000 (+0200) Subject: On backup le schéma xml avant de le regéner afin de détecter les erreurs X-Git-Tag: V6_4_0rc3~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ded759f0060556b9076439336578b783b8b5e233;p=modules%2Fadao.git On backup le schéma xml avant de le regéner afin de détecter les erreurs --- 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()