From: Jean-Philippe ARGAUD Date: Fri, 19 Apr 2019 06:47:06 +0000 (+0200) Subject: [19282] Verify EFICAS files saving before exporting to YACS X-Git-Tag: V9_3_0rc2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a0d108b71eda0bcfc0c0c11107f526248959b71;p=modules%2Fadao.git [19282] Verify EFICAS files saving before exporting to YACS --- diff --git a/src/daSalome/daGUI/daGuiImpl/adaoCase.py b/src/daSalome/daGUI/daGuiImpl/adaoCase.py index 54c1f4f..cadcef9 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoCase.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoCase.py @@ -21,6 +21,7 @@ # import os +import time import subprocess import traceback import SalomePyQt @@ -66,8 +67,8 @@ class AdaoCase: def createYACSFile(self): rtn = "" - if (self.filename == ""): - return "You need to save your case to export it." + if (self.filename == "" or self.filename == "not yet defined"): + return "You need to save your case before exporting it." self.yacs_filename = self.filename[:self.filename.rfind(".")] + '.xml' yacs_filename_backup = self.filename[:self.filename.rfind(".")] + '.xml.back' @@ -77,6 +78,10 @@ class AdaoCase: self.eficas_editor.modified = True self.eficas_editor.saveFile() filename = self.filename[:self.filename.rfind(".")] + '.py' + retry = 0 + while (not os.path.exists(filename) and retry < 30): + time.sleep(0.1) + retry += 1 if not os.path.exists(filename): msg = "Cannot find the COMM/PY associated EFICAS/Python files for YACS\n" msg += "generation. Is your case correct? Try to close and re-open the\n"