From 3211cc3722c3d5b5a24c939ef71000b01fda209f Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Fri, 23 Mar 2018 19:47:54 +0100 Subject: [PATCH] EFICAS compatibility corrections --- src/daEficas/configuration_ADAO.py | 4 ++-- src/daEficas/generator_adao.py | 15 ++++++++++----- src/daSalome/daGUI/daGuiImpl/adaoCase.py | 6 +++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/daEficas/configuration_ADAO.py b/src/daEficas/configuration_ADAO.py index 12abf36..b98df04 100644 --- a/src/daEficas/configuration_ADAO.py +++ b/src/daEficas/configuration_ADAO.py @@ -36,13 +36,13 @@ from InterfaceQT4 import configuration # Classe de base permettant de lire, afficher # et sauvegarder les fichiers utilisateurs -class CONFIG(configuration.CONFIG_BASE): +class CONFIG(configuration.configBase): def __init__(self,appli,repIni): # self.labels_eficas = ['lang'] self.labels_eficas = ['lang','rep_cata','catalogues','closeAutreCommande','closeFrameRechercheCommande','closeEntete','taille'] - configuration.CONFIG_BASE.__init__(self,appli,repIni) + configuration.configBase.__init__(self,appli,repIni) self.rep_user = os.environ["HOME"] self.appli = appli diff --git a/src/daEficas/generator_adao.py b/src/daEficas/generator_adao.py index 15fbadb..134abc7 100644 --- a/src/daEficas/generator_adao.py +++ b/src/daEficas/generator_adao.py @@ -85,7 +85,7 @@ class AdaoGenerator(PythonGenerator): Convertit un objet MCSIMP en texte python """ clef="" - for i in obj.get_genealogie() : + for i in obj.getGenealogie() : clef=clef+"__"+i self.dictMCVal[clef]=obj.valeur @@ -288,15 +288,20 @@ class AdaoGenerator(PythonGenerator): def add_AlgorithmParameters(self): - if "__"+self.type_of_study+"__AlgorithmParameters__Parameters" not in self.dictMCVal: return - data_name = "AlgorithmParameters" data_type = "Dict" - para_type = self.dictMCVal["__"+self.type_of_study+"__AlgorithmParameters__Parameters"] + # + if "__"+self.type_of_study+"__AlgorithmParameters__Parameters" in self.dictMCVal: + para_type = self.dictMCVal["__"+self.type_of_study+"__AlgorithmParameters__Parameters"] + else: + para_type = "Defaults" + # if para_type == "Defaults": from_type = para_type elif para_type == "Dict": from_type = self.dictMCVal["__"+self.type_of_study+"__AlgorithmParameters__Dict__data__FROM"] + else: + return if from_type == "Script": data = self.dictMCVal["__"+self.type_of_study+"__AlgorithmParameters__Dict__data__SCRIPT_DATA__SCRIPT_FILE"] @@ -315,7 +320,7 @@ class AdaoGenerator(PythonGenerator): elif from_type == "Defaults": base = "__"+self.type_of_study+"__AlgorithmParameters__Parameters" keys = [k for k in self.dictMCVal.keys() if base in k] - keys.remove(base) + if base in keys: keys.remove(base) keys = [k.replace(base,'') for k in keys] data = '{' for k in keys: diff --git a/src/daSalome/daGUI/daGuiImpl/adaoCase.py b/src/daSalome/daGUI/daGuiImpl/adaoCase.py index d1d31ad..8427a29 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoCase.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoCase.py @@ -51,9 +51,9 @@ class AdaoCase: # Connect to the jdc CONNECTOR.Connect(self.eficas_editor.jdc, "valid", self.editorValidEvent, ()) - # Rq on notera que l'on utilise isvalid dans isOk + # Rq on notera que l'on utilise isValid dans isOk # et que isOk appelle editorValidEvent - # il n'y a pas de boucle infini car isvalid n'émet + # il n'y a pas de boucle infini car isValid n'émet # son signal que si l'état a changé def editorValidEvent(self): adaoStudyEditor.updateItem(self.salome_study_id, self.salome_study_item, self) @@ -61,7 +61,7 @@ class AdaoCase: def isOk(self): if self.eficas_editor.jdc: - return self.eficas_editor.jdc.isvalid() + return self.eficas_editor.jdc.isValid() return False def createYACSFile(self): -- 2.39.2