From 342c799e611e5460e1c42eb50f898e24e6736fbf Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Tue, 11 Feb 2014 15:19:12 +0100 Subject: [PATCH] Changing the required of the debug variable to optional --- doc/en/reference.rst | 4 ++-- doc/fr/reference.rst | 4 ++-- src/daEficas/generator_adao.py | 5 ++++- src/daSalome/daYacsSchemaCreator/methods.py | 6 +++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/doc/en/reference.rst b/doc/en/reference.rst index dd35f17..eb64f0f 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -151,7 +151,7 @@ following: control, it has to be a void string ''. **Debug** - *Required command*. This define the level of trace and intermediary debug + *Optional command*. This define the level of trace and intermediary debug information. The choices are limited between 0 (for False) and 1 (for True). @@ -724,7 +724,7 @@ commands are the following: :math:`\mathbf{x}^b`. It is defined as a "*Vector*" type object. **Debug** - *Required command*. This define the level of trace and intermediary debug + *Optional command*. This define the level of trace and intermediary debug information. The choices are limited between 0 (for False) and 1 (for True). diff --git a/doc/fr/reference.rst b/doc/fr/reference.rst index f07ec3b..5c4701f 100644 --- a/doc/fr/reference.rst +++ b/doc/fr/reference.rst @@ -161,7 +161,7 @@ le calcul ou la v être une chaîne vide ''. **Debug** - *Commande obligatoire*. Elle définit le niveau de sorties et d'informations + *Commande optionnelle*. Elle définit le niveau de sorties et d'informations intermédiaires de débogage. Les choix sont limités entre 0 (pour False) and 1 (pour True). @@ -757,7 +757,7 @@ v :math:`\mathbf{x}`. Sa valeur est définie comme un objet de type "*Vector*". **Debug** - *Commande obligatoire*. Elle définit le niveau de sorties et d'informations + *Commande optionnelle*. Elle définit le niveau de sorties et d'informations intermédiaires de débogage. Les choix sont limités entre 0 (pour False) et 1 (pour True). diff --git a/src/daEficas/generator_adao.py b/src/daEficas/generator_adao.py index 98dbb99..6cbadde 100644 --- a/src/daEficas/generator_adao.py +++ b/src/daEficas/generator_adao.py @@ -104,7 +104,10 @@ class AdaoGenerator(PythonGenerator): # Extraction de Study_name self.text_da += "study_config['Name'] = '" + self.dictMCVal["__"+self.type_of_study+"__Study_name"] + "'\n" # Extraction de Debug - self.text_da += "study_config['Debug'] = '" + str(self.dictMCVal["__"+self.type_of_study+"__Debug"]) + "'\n" + if "__"+self.type_of_study+"__Debug" in self.dictMCVal.keys(): + self.text_da += "study_config['Debug'] = '" + str(self.dictMCVal["__"+self.type_of_study+"__Debug"]) + "'\n" + else: + self.text_da += "study_config['Debug'] = '0'\n" # Extraction de Algorithm self.text_da += "study_config['Algorithm'] = '" + self.dictMCVal["__"+self.type_of_study+"__Algorithm"] + "'\n" diff --git a/src/daSalome/daYacsSchemaCreator/methods.py b/src/daSalome/daYacsSchemaCreator/methods.py index 2328dbb..dde7d22 100644 --- a/src/daSalome/daYacsSchemaCreator/methods.py +++ b/src/daSalome/daYacsSchemaCreator/methods.py @@ -69,10 +69,10 @@ def create_yacs_proc(study_config): CAS_node = factory_CAS_node.cloneNode("CreateAssimilationStudy") CAS_node.getInputPort("Name").edInitPy(study_config["Name"]) CAS_node.getInputPort("Algorithm").edInitPy(study_config["Algorithm"]) - if study_config["Debug"] == "0": - CAS_node.getInputPort("Debug").edInitPy(False) - else: + if study_config.has_key("Debug") and study_config["Debug"] == "1": CAS_node.getInputPort("Debug").edInitPy(True) + else: + CAS_node.getInputPort("Debug").edInitPy(False) # Ajout des Variables InputVariablesNames = [] -- 2.39.2