From 152ca2f3c50fdc364491654bf2dae067a4dbd7db Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Wed, 4 Oct 2017 13:12:00 +0200 Subject: [PATCH] Correcting comments or execution error behaviour --- src/daComposant/daCore/Aidsm.py | 18 +++++++++--------- src/daEficas/configuration_ADAO.py | 1 + .../daGUI/daEficasWrapper/adaoEficasWrapper.py | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/daComposant/daCore/Aidsm.py b/src/daComposant/daCore/Aidsm.py index 8cf2648..472bcb3 100644 --- a/src/daComposant/daCore/Aidsm.py +++ b/src/daComposant/daCore/Aidsm.py @@ -869,13 +869,13 @@ class Aidsm(object): "Lancement du calcul" self.__case.register("execute",dir(),locals(),None,True) Operator.CM.clearCache() - #~ try: - if Executor == "YACS": self.__executeYACSScheme( SaveCaseInFile ) - else: self.__executePythonScheme( SaveCaseInFile ) - #~ except Exception as e: - #~ if isinstance(e, SyntaxError): msg = "at %s: %s"%(e.offset, e.text) - #~ else: msg = "" - #~ raise ValueError("during execution, the following error occurs:\n\n%s %s\n\nSee also the potential messages, which can show the origin of the above error, in the launching terminal.\n"%(str(e),msg)) + try: + if Executor == "YACS": self.__executeYACSScheme( SaveCaseInFile ) + else: self.__executePythonScheme( SaveCaseInFile ) + except Exception as e: + if isinstance(e, SyntaxError): msg = "at %s: %s"%(e.offset, e.text) + else: msg = "" + raise ValueError("during execution, the following error occurs:\n\n%s %s\n\nSee also the potential messages, which can show the origin of the above error, in the launching terminal.\n"%(str(e),msg)) return 0 def __executePythonScheme(self, FileName=None): @@ -928,8 +928,8 @@ class Aidsm(object): if self.__adaoObject['AlgorithmParameters'].hasObserver( k ): self.__adaoObject['AlgorithmParameters'].removeObserver( k, "", True ) self.__StoredInputs[k] = self.__adaoObject['AlgorithmParameters'].pop(k, None) - del self.__adaoObject # Because it breaks pickle in Python 2 - del self.__case # Because it breaks pickle in Python 2 + del self.__adaoObject # Because it breaks pickle in Python 2. Not required for Python 3 + del self.__case # Because it breaks pickle in Python 2. Not required for Python 3 return 0 # ============================================================================== diff --git a/src/daEficas/configuration_ADAO.py b/src/daEficas/configuration_ADAO.py index 7d6862d..132d373 100644 --- a/src/daEficas/configuration_ADAO.py +++ b/src/daEficas/configuration_ADAO.py @@ -58,6 +58,7 @@ class CONFIG(configuration.CONFIG_BASE): # (code, version, catalogue, formatIn, formatOut) # Il faut les mettre dans un tuple self.catalogues = (("ADAO", "V0", os.path.join(self.rep_ini, 'ADAO_Cata_V0.py'), "adao"),) +# JPA 21/09/2017 : self.catalogues = (("ADAO", "V0", os.path.join(self.rep_ini, 'ADAO_Cata_V0.py'), "python", "adao"),) def make_config(appli,rep): diff --git a/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py b/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py index 3ae14f1..7e37a74 100644 --- a/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py +++ b/src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py @@ -57,7 +57,7 @@ class AdaoEficasWrapper(eficasSalome.MyEficas): # self.menubar.hide() # self.toolBar.hide() # self.frameEntete.close() - self.closeEntete() + # self.closeEntete() def addJdcInSalome(self, jdcPath): debug("addJdcInSalome is called " + str(jdcPath)) -- 2.39.2