Salome HOME
reindent + copyright + merge manuel avec la V9_dev sauf repertoires metier
authorpascale.noyret <pascale.noyret@edf.fr>
Thu, 22 Jul 2021 11:10:45 +0000 (13:10 +0200)
committerpascale.noyret <pascale.noyret@edf.fr>
Thu, 22 Jul 2021 11:10:45 +0000 (13:10 +0200)
348 files changed:
Accas/A_ASSD.py
Accas/A_AU_MOINS_UN.py
Accas/A_AU_PLUS_UN.py
Accas/A_AVANT.py
Accas/A_ENSEMBLE.py
Accas/A_EXCLUS.py
Accas/A_FACT.py
Accas/A_MCSIMP.py
Accas/A_MEME_NOMBRE.py
Accas/A_NUPLET.py
Accas/A_PRESENT_ABSENT.py
Accas/A_PRESENT_PRESENT.py
Accas/A_TUPLE.py
Accas/A_UN_PARMI.py
Accas/__init__.py
CatasDeTests/cataListes.py
CatasDeTests/cata_FactFreresMemesNoms.py
CatasDeTests/cata_UserAssd.py
CatasDeTests/generateXML.py
CatasDeTests/generateXSD.py
CatasDeTests/log [deleted file]
CatasDeTests/prefs.py
CatasDeTests/qtEficasEssai.py
Editeur/Eficas_utils.py
Editeur/Objecttreeitem.py
Editeur/TroisDPal.py
Editeur/analyse_catalogue.py
Editeur/analyse_catalogue_initial.py
Editeur/autre_analyse_cata.py
Editeur/basestyle.py
Editeur/cata2Xml.py
Editeur/catadesc.py
Editeur/chercheBlocInto.py
Editeur/chercheNbElem.py
Editeur/comploader.py
Editeur/fontes.py
Editeur/import_code.py
Editeur/listePatrons.py
Editeur/session.py
Editeur/styles.py
Editeur/uiinfo.py
Efi2Xsd/AccasXsd.py
Efi2Xsd/MCAccasXML.py
Efi2Xsd/MCAccasXsd.py [deleted file]
Efi2Xsd/ajoutBalise.py [new file with mode: 0644]
Efi2Xsd/balises.py
Efi2Xsd/balisesXSD.py
Efi2Xsd/introspect.py
Efi2Xsd/mapDesTypes.py
Efi2Xsd/readerEfiXsd.py
Extensions/commande_comm.py
Extensions/commentaire.py
Extensions/eficas_exception.py
Extensions/etape_niveau.py
Extensions/interpreteur_formule.py
Extensions/jdc.py
Extensions/jdc_include.py
Extensions/localisation.py
Extensions/mcnuplet.py
Extensions/niveau.py
Extensions/nuplet.py
Extensions/param2.py
Extensions/parametre.py
Extensions/parametre_eval.py
Extensions/pluginloader.py
Extensions/translationQT5.py
Ihm/CONNECTOR.py
Ihm/I_ASSD.py
Ihm/I_AVANT.py
Ihm/I_A_CLASSER.py
Ihm/I_ENTITE.py
Ihm/I_ETAPE.py
Ihm/I_EVAL.py
Ihm/I_EXCLUS.py
Ihm/I_FICHIER.py
Ihm/I_FONCTION.py
Ihm/I_FORM_ETAPE.py
Ihm/I_JDC.py
Ihm/I_JDC_CATA.py
Ihm/I_LASSD.py
Ihm/I_MACRO_ETAPE.py
Ihm/I_MCBLOC.py
Ihm/I_MCCOMPO.py
Ihm/I_MCFACT.py
Ihm/I_MCLIST.py
Ihm/I_MCSIMP.py
Ihm/I_OBJECT.py
Ihm/I_PRESENT_ABSENT.py
Ihm/I_PRESENT_PRESENT.py
Ihm/I_PROC_ETAPE.py
Ihm/I_REGLE.py
Ihm/I_TUPLE.py [new file with mode: 0644]
Ihm/I_UN_PARMI.py
Ihm/I_VALIDATOR.py
InterfaceQT4/aiemonWidgetPlusieursBase.py [deleted file]
InterfaceQT4/bizarreEditorDu5aout.py [deleted file]
InterfaceQT4/browser.py
InterfaceQT4/compobloc.py
InterfaceQT4/compocomm.py
InterfaceQT4/compocommandecomm.py
InterfaceQT4/compofact.py
InterfaceQT4/compoformule.py
InterfaceQT4/compojdc.py
InterfaceQT4/compomacro.py
InterfaceQT4/compomclist.py
InterfaceQT4/compooper.py
InterfaceQT4/compoparam.py
InterfaceQT4/compoproc.py
InterfaceQT4/composimp.py
InterfaceQT4/configuration.py
InterfaceQT4/editor.py
InterfaceQT4/editorSsIhm.py
InterfaceQT4/eficas_go.py
InterfaceQT4/feuille.py
InterfaceQT4/gereIcones.py
InterfaceQT4/gereListe.py
InterfaceQT4/gereListeAvril11.py
InterfaceQT4/gereRegles.py
InterfaceQT4/gereTraduction.py
InterfaceQT4/groupe.py
InterfaceQT4/monBoutonValide.py
InterfaceQT4/monChoixCata.py
InterfaceQT4/monChoixCode.py
InterfaceQT4/monChoixCommande.py
InterfaceQT4/monChoixLangue.py
InterfaceQT4/monFonctionPanel.py
InterfaceQT4/monGroupeOptionnel.py
InterfaceQT4/monLabelClic.py
InterfaceQT4/monLayoutBouton.py
InterfaceQT4/monRecherche.py
InterfaceQT4/monRechercheCatalogue.py
InterfaceQT4/monSelectVal.py
InterfaceQT4/monViewRegles.py
InterfaceQT4/monViewTexte.py
InterfaceQT4/monVisu.py
InterfaceQT4/monWidget4a6RadioButton.py
InterfaceQT4/monWidget4a6RadioButtonSD.py
InterfaceQT4/monWidgetBloc.py
InterfaceQT4/monWidgetCB.py
InterfaceQT4/monWidgetCBIntoSug.py
InterfaceQT4/monWidgetCBSD.py
InterfaceQT4/monWidgetCommande.py
InterfaceQT4/monWidgetCommandeDeplie1Niveau.py
InterfaceQT4/monWidgetCommentaire.py
InterfaceQT4/monWidgetCreeParam.py
InterfaceQT4/monWidgetCreeUserAssd.py
InterfaceQT4/monWidgetDate.py
InterfaceQT4/monWidgetFact.py
InterfaceQT4/monWidgetFactPlie.py
InterfaceQT4/monWidgetFormule.py
InterfaceQT4/monWidgetHeure.py
InterfaceQT4/monWidgetInactif.py
InterfaceQT4/monWidgetInfo.py
InterfaceQT4/monWidgetIntoSug.py
InterfaceQT4/monWidgetMatrice.py
InterfaceQT4/monWidgetNiveauFact.py
InterfaceQT4/monWidgetOptionnel.py
InterfaceQT4/monWidgetParam.py
InterfaceQT4/monWidgetPlusieursASSDIntoOrdonne.py
InterfaceQT4/monWidgetPlusieursBase.py
InterfaceQT4/monWidgetPlusieursCreeUserAssd.py [new file with mode: 0644]
InterfaceQT4/monWidgetPlusieursInto.py
InterfaceQT4/monWidgetPlusieursIntoOrdonne.py
InterfaceQT4/monWidgetPlusieursPlie.py
InterfaceQT4/monWidgetPlusieursTuple.py
InterfaceQT4/monWidgetPlusieursTuple2.py [deleted file]
InterfaceQT4/monWidgetPlusieursTuple3.py [deleted file]
InterfaceQT4/monWidgetPlusieursTupleAvril11.py [deleted file]
InterfaceQT4/monWidgetPlusieursTupleN.py
InterfaceQT4/monWidgetRadioButton.py
InterfaceQT4/monWidgetSDCOInto.py
InterfaceQT4/monWidgetSimpBase.py
InterfaceQT4/monWidgetSimpBool.py
InterfaceQT4/monWidgetSimpComplexe.py
InterfaceQT4/monWidgetSimpFichier.py
InterfaceQT4/monWidgetSimpSalome.py
InterfaceQT4/monWidgetSimpTuple.py
InterfaceQT4/monWidgetSimpTuple2.py [deleted file]
InterfaceQT4/monWidgetSimpTuple3.py [deleted file]
InterfaceQT4/monWidgetSimpTupleN.py
InterfaceQT4/monWidgetSimpTxt.py
InterfaceQT4/monWidgetTableau.py
InterfaceQT4/monWidgetUniqueSDCO.py
InterfaceQT4/monWidgetVide.py
InterfaceQT4/politiquesValidation.py
InterfaceQT4/qtEficas.py
InterfaceQT4/qtEficasSsIhm.py
InterfaceQT4/qtEficas_with_log.py
InterfaceQT4/qtSaisie.py
InterfaceQT4/readercata.py
InterfaceQT4/readercataXML.py
InterfaceQT4/ssIhm.py
InterfaceQT4/typeNode.py
InterfaceQT4/viewManager.py
InterfaceQT4/viewManagerSsIhm.py
Med/Cata_MED_FAM.xml [deleted file]
Med/Cata_MED_FAM.xml.mini [deleted file]
Med/Cata_MED_FAM.xml.origin [deleted file]
Med/README.txt [deleted file]
Med/aide1 [deleted file]
Med/efficas.py [deleted file]
Med/model.xsd [deleted file]
Med/raw/__init__.py [deleted file]
Med/raw/efficas.py [deleted file]
Med/readerEfficas.py [deleted file]
Noyau/N_ASSD.py
Noyau/N_BLOC.py
Noyau/N_CONVERT.py
Noyau/N_CR.py
Noyau/N_ENTITE.py
Noyau/N_ETAPE.py
Noyau/N_Exception.py
Noyau/N_FACT.py
Noyau/N_FONCTION.py
Noyau/N_JDC.py
Noyau/N_JDC_CATA.py
Noyau/N_MACRO_ETAPE.py
Noyau/N_MCBLOC.py
Noyau/N_MCCOMPO.py
Noyau/N_MCFACT.py
Noyau/N_MCLIST.py
Noyau/N_MCSIMP.py
Noyau/N_OBJECT.py
Noyau/N_OPER.py
Noyau/N_OPS.py
Noyau/N_PROC.py
Noyau/N_REGLE.py
Noyau/N_SENSIBILITE.py
Noyau/N_SIMP.py
Noyau/N_TUPLE.py [new file with mode: 0644]
Noyau/N_UserASSD.py
Noyau/N_UserASSDMultiple.py [new file with mode: 0644]
Noyau/N_VALIDATOR.py
Noyau/N__F.py
Noyau/N_utils.py
Noyau/__init__.py
Noyau/context.py
Noyau/nommage.py
Noyau/strfunc.py
OldCodes/Med/Cata_MED_FAM.xml [new file with mode: 0755]
OldCodes/Med/Cata_MED_FAM.xml.mini [new file with mode: 0755]
OldCodes/Med/Cata_MED_FAM.xml.origin [new file with mode: 0755]
OldCodes/Med/README.txt [new file with mode: 0644]
OldCodes/Med/aide1 [new file with mode: 0644]
OldCodes/Med/efficas.py [new file with mode: 0644]
OldCodes/Med/model.xsd [new file with mode: 0755]
OldCodes/Med/raw/__init__.py [new file with mode: 0644]
OldCodes/Med/raw/efficas.py [new file with mode: 0644]
OldCodes/Med/readerEfficas.py [new file with mode: 0755]
Traducteur/calcG.py
Traducteur/changeValeur.py
Traducteur/dictErreurs.py
Traducteur/inseremocle.py
Traducteur/load.py
Traducteur/log.py
Traducteur/mocles.py
Traducteur/movemocle.py
Traducteur/parseur.py
Traducteur/regles.py
Traducteur/removemocle.py
Traducteur/renamemocle.py
Traducteur/toto.comm [deleted file]
Traducteur/traduitV10V11.py
Traducteur/traduitV11V12.py
Traducteur/traduitV7V8.py
Traducteur/traduitV8V9.py
Traducteur/traduitV9V10.py
Traducteur/utils.py
Traducteur/visiteur.py
UiQT5/GNUmakefile [new file with mode: 0644]
UiQT5/Tuple10.ui
UiQT5/Tuple2.ui
UiQT5/Tuple3.ui
UiQT5/Tuple4.ui
UiQT5/Tuple5.ui
UiQT5/Tuple6.ui
UiQT5/Tuple7.ui
UiQT5/Tuple8.ui
UiQT5/Tuple9.ui
UiQT5/desBaseWidget.ui
UiQT5/desWidget4a6RadioButton.ui
UiQT5/desWidgetPlusieursBase.ui
UiQT5/desWidgetPlusieursInto.ui
UiQT5/desWidgetPlusieursTuple.ui
UiQT5/desWidgetSimpBase.ui
UiQT5/desWidgetSimpComplexe.ui
UiQT5/desWidgetTuple10.ui
UiQT5/desWidgetTuple2.ui
UiQT5/desWidgetTuple3.ui
UiQT5/desWidgetTuple4.ui
UiQT5/desWidgetTuple5.ui
UiQT5/desWidgetTuple6.ui
UiQT5/desWidgetTuple7.ui
UiQT5/desWidgetTuple8.ui
UiQT5/desWidgetTuple9.ui
UiQT5/eficas_en.ts
Validation/V_AU_MOINS_UN.py
Validation/V_AU_PLUS_UN.py
Validation/V_A_CLASSER.py
Validation/V_ENSEMBLE.py
Validation/V_ETAPE.py
Validation/V_EXCLUS.py
Validation/V_JDC.py
Validation/V_MACRO_ETAPE.py
Validation/V_MCBLOC.py
Validation/V_MCCOMPO.py
Validation/V_MCFACT.py
Validation/V_MCLIST.py
Validation/V_MCSIMP.py
Validation/V_MEME_NOMBRE.py
Validation/V_PRESENT_ABSENT.py
Validation/V_PRESENT_PRESENT.py
Validation/V_PROC_ETAPE.py
Validation/V_UN_PARMI.py
Validation/__init__.py
VirtualPolymer/VP_Cata_V1.py
VirtualPolymer/VP_Cata_V2.py
VirtualPolymer/configuration_VP.py
VirtualPolymer/lienDB.py
VirtualPolymer/listesDB.py
VirtualPolymer/prefs.py
VirtualPolymer/prefs_VP.py
VirtualPolymer/properties.py
VirtualPolymer/qtEficasVP.py
convert/__init__.py
convert/autre_parseur.py
convert/convert_TELEMAC.py
convert/convert_XML.py
convert/convert_dico.py
convert/convert_map.py
convert/convert_pyth.py
convert/convert_python.py
convert/parseur_python.py
generator/Formatage.py
generator/__init__.py
generator/generator_GroupMA.py
generator/generator_PSEN.py
generator/generator_ProcessOutputs.py
generator/generator_TELEMAC.py
generator/generator_XML.py
generator/generator_aplat.py
generator/generator_dico.py
generator/generator_dicoImbrique.py
generator/generator_map.py
generator/generator_mapVP.py
generator/generator_modification.py
generator/generator_python.py
generator/generator_vers3DSalome.py

index 88cc13af3b84314ee9785c13a280d791c0d9b289..28b67b2a360a7b2f4bbaaf73fb5e0cd4517702f9 100644 (file)
@@ -27,6 +27,7 @@ from Noyau import N_GEOM
 from Noyau import N_FONCTION
 from Noyau import N_CO
 from Noyau import N_UserASSD
+from Noyau import N_UserASSDMultiple
 
 # On ajoute la classe ASSD dans l'heritage multiple pour recreer
 # une hierarchie d'heritage identique a celle de Noyau
@@ -37,6 +38,7 @@ class ASSD(I_ASSD.ASSD,N_ASSD.ASSD):pass
 #class LASSD(I_LASSD.LASSD,N_LASSD.LASSD):pass
 class LASSD(I_LASSD.LASSD):pass
 class UserASSD(N_UserASSD.UserASSD,ASSD): pass
+class UserASSDMultiple(N_UserASSDMultiple.UserASSDMultiple,UserASSD): pass
 
 class assd(N_ASSD.assd,I_ASSD.assd,ASSD):pass
 
index 743f7d03f50de11768da6cdb45db9cb4902c270d..1bcb4e003507fe659d69728cc9910ce6ef48c1ff 100644 (file)
@@ -26,5 +26,5 @@ class AU_MOINS_UN(V_AU_MOINS_UN.AU_MOINS_UN,I_REGLE.REGLE,N_REGLE.REGLE):
     """
         La classe utilise l'initialiseur de REGLE. Il n'est pas
         necessaire d'expliciter son initialiseur car
-        V_AU_MOINS_UN.AU_MOINS_UN n'en a pas
+        seule N_REGLE.REGLE en a un
     """
index 197f936ab50c03e1c80466a227f518bbe5b4164e..8bdcc34f2e118b31613e6b1796d1d9aaeee86175 100644 (file)
@@ -27,4 +27,5 @@ class AU_PLUS_UN(V_AU_PLUS_UN.AU_PLUS_UN,I_REGLE.REGLE,N_REGLE.REGLE):
         La classe utilise l'initialiseur de REGLE. Il n'est pas
         necessaire d'expliciter son initialiseur car
         V_AU_PLUS_UN.AU_PLUS_UN n'en a pas
+        V_UN_PARMI.UN_PARMI et I_REGLE.REGLE  n'en ont pas
     """
index 2f697723653bc9568a70bd3cabe8138d908b0d76..f32f1fa24940424477381e1dbcb6d2de88c7161d 100644 (file)
@@ -25,5 +25,5 @@ class AVANT(I_AVANT.I_AVANT,I_REGLE.REGLE,N_REGLE.REGLE):
     """
         La classe utilise l'initialiseur de REGLE. Il n'est pas
         necessaire d'expliciter son initialiseur car
-        I_AVANT.I_AVANT n'en a pas
+        I_AVANT.I_AVANT et I_REGLE.REGLE  n'en ont pas
     """
index e60c16beca010cb5b4ed047631d9214dddb1d83b..62d289fa9d5785b11400f8a09e81040327989426 100644 (file)
@@ -26,5 +26,6 @@ class ENSEMBLE(I_REGLE.REGLE,V_ENSEMBLE.ENSEMBLE,N_REGLE.REGLE):
     """
         La classe utilise l'initialiseur de REGLE. Il n'est pas
         necessaire d'expliciter son initialiseur car
-        V_ENSEMBLE.ENSEMBLE n'en a pas
+        seule N_REGLE.REGLE en a un
+    
     """
index d69af075b0899bd4f84cee949f34a0f52bcae37f..d302aaf24b23c67b300a4b6e9441834d98ea0936 100644 (file)
@@ -26,5 +26,5 @@ class EXCLUS(I_EXCLUS.EXCLUS,V_EXCLUS.EXCLUS,N_REGLE.REGLE):
     """
         La classe utilise l'initialiseur de REGLE. Il n'est pas
         necessaire d'expliciter son initialiseur car
-        V_EXCLUS.EXCLUS n'en a pas
+        I_EXCLUS.EXCLUS V_EXCLUS.EXCLUS n'en ont pas
     """
index 776c6f1034130c9a156b65a1412b39d7ed36eed3..27ee372d1eca949e6b56764c8b08e7de13676944 100644 (file)
@@ -26,8 +26,8 @@ from Efi2Xsd.AccasXsd  import X_FACT
 
 
 class FACT(N_FACT.FACT,X_FACT,I_ENTITE.ENTITE):
-    class_instance=A_MCFACT.MCFACT
-    list_instance=A_MCLIST.MCList
+    class_instance = A_MCFACT.MCFACT
+    list_instance  = A_MCLIST.MCList
     def __init__(self,*tup,**args):
         I_ENTITE.ENTITE.__init__(self)
         N_FACT.FACT.__init__(self,*tup,**args)
index d24cd7a6f456ca128786b604ce1acd192edf1c49..525262c7cf5e87030a499f1319c794fad701a5cd 100644 (file)
@@ -25,6 +25,6 @@ from Efi2Xsd.MCAccasXML  import X_MCSIMP
 
 class MCSIMP(I_MCSIMP.MCSIMP,N_MCSIMP.MCSIMP,X_MCSIMP,V_MCSIMP.MCSIMP):
     def __init__(self,val,definition,nom,parent,objPyxbDeConstruction=None):
-    #def __init__(self,val,definition,nom,parent,objPyxbDeConstruction) quand cela sera correct dans les update_etape. pour l instant on laisse le defaut a None : 9 Aout 18:
+    #le defaut de objPyxbDeConstruction permet de lire les comm avec des modeles sans equivalent XSD
         N_MCSIMP.MCSIMP.__init__(self,val,definition,nom,parent,objPyxbDeConstruction)
         V_MCSIMP.MCSIMP.__init__(self)
index 39f4dcb5dbe68149ae62c2c913faa399a71c23b4..0bf042893a9137e77828edb76af50d6e2858d3a0 100644 (file)
@@ -26,5 +26,5 @@ class MEME_NOMBRE(V_MEME_NOMBRE.MEME_NOMBRE,I_REGLE.REGLE,N_REGLE.REGLE):
     """
         La classe utilise l'initialiseur de REGLE. Il n'est pas
         necessaire d'expliciter son initialiseur car
-        V_MEME_NOMBRE.MEME_NOMBRE n'en a pas
+        seule N_REGLE.REGLE en a un
     """
index 6546f5a53791719cbb22a0cde142190541eb4211..89ac50028ba3d08ced2100a1789be885740f60c2 100644 (file)
@@ -23,5 +23,5 @@ from . import A_MCLIST
 from . import A_MCNUPLET
 
 class NUPL(nuplet.NUPL):
-    class_instance=A_MCNUPLET.MCNUPLET
-    list_instance=A_MCLIST.MCList
+    class_instance = A_MCNUPLET.MCNUPLET
+    list_instance  = A_MCLIST.MCList
index 3572b84af238ef3d50cbf0631b6aaf2f27cba9d7..b8a895f3cf1b257db8ff444df501b556fca3154e 100644 (file)
@@ -27,5 +27,5 @@ class PRESENT_ABSENT(I_PRESENT_ABSENT.PRESENT_ABSENT,V_PRESENT_ABSENT.PRESENT_AB
     """
         La classe utilise l'initialiseur de REGLE. Il n'est pas
         necessaire d'expliciter son initialiseur car
-        V_PRESENT_ABSENT.PRESENT_ABSENT n'en a pas
+        seule N_REGLE.REGLE.py en a un
     """
index f46b32f81f9e9a792e62b8f1e346c7280aec5c67..9da2781cccd9f5df6fff15f8c621e19bd8cc4cb3 100644 (file)
@@ -28,5 +28,5 @@ class PRESENT_PRESENT(I_PRESENT_PRESENT.PRESENT_PRESENT,
     """
         La classe utilise l'initialiseur de REGLE. Il n'est pas
         necessaire d'expliciter son initialiseur car
-        V_PRESENT_PRESENT.PRESENT_PRESENT n'en a pas
+        seule N_REGLE.REGLE en a un
     """
index cdc2e7da64c470b00c10c23bb47ab661ec39dfc3..3abdd0679f479c5f9ebbcd45563e328680fc8098 100644 (file)
@@ -1,15 +1,12 @@
-import types
-class Tuple:
-    def __init__(self,ntuple):
-        self.ntuple=ntuple
+#
+from __future__ import absolute_import
+from Noyau import N_TUPLE
+from Ihm  import I_TUPLE
 
-    def __convert__(self,valeur):
-        try:
-            if isinstance(valeur, basestring) : return None
-        except NameError:
-            if isinstance(valeur, str): return None
-        if len(valeur) != self.ntuple: return None
-        return valeur
-
-    def info(self):
-        return "Tuple de %s elements" % self.ntuple
+class Tuple (N_TUPLE.N_Tuple): pass
+class Matrice (I_TUPLE.I_Matrice,N_TUPLE.N_Matrice):pass
+#      def __init__(self,*tup,**args):
+#          I_TUPLE.I_Matrice.__init__(self)
+#          N_TUPLE.N_Matrice(self,*tup,**args)
+#          print (tup)
+#          print (args)
index af03b09a6d686b355dc4750fdb958888489c3ce1..f15504bdd017e6c5e13ad5453c2aacdb84460cbe 100644 (file)
@@ -26,5 +26,5 @@ class UN_PARMI(I_UN_PARMI.UN_PARMI,V_UN_PARMI.UN_PARMI,N_REGLE.REGLE):
     """
         La classe utilise l'initialiseur de REGLE. Il n'est pas
         necessaire d'expliciter son initialiseur car
-        V_UN_PARMI.UN_PARMI n'en a pas
+        V_UN_PARMI.UN_PARMI et I_UN_PARMI.UN_PARMI  n'en ont pas
     """
index ce4722dacd0385f6f7b2f48a4278fffcb18a58c3..b87034f77deb6e8ad8618f6ddafb889afb35bd1c 100644 (file)
    classes et leur implementation.
 """
 
-# permet de se proteger de l'oubli de carte coding
-# ce warning deviendra fatal en python 2.4
+
 from __future__ import absolute_import
 import warnings
 warnings.filterwarnings('error','Non-ASCII character.*pep-0263',DeprecationWarning)
 
 from .A_JDC_CATA import JDC_CATA
-from .A_OPER import OPER
-from .A_PROC import PROC
-from .A_MACRO import MACRO
-from .A_FORM import FORM
-from .A_BLOC import BLOC
-#from .A_BLOC import BLOC_EXCLUS_ABC
-#from .A_BLOC import BLOC_FICHIER
-from .A_FACT import FACT
-from .A_SIMP import SIMP
-from .A_EVAL import EVAL
-from .A_NUPLET import NUPL
-from .A_TUPLE import Tuple
+from .A_OPER     import OPER
+from .A_PROC     import PROC
+from .A_MACRO    import MACRO
+from .A_FORM     import FORM
+from .A_BLOC     import BLOC
+from .A_FACT     import FACT
+from .A_SIMP     import SIMP
+from .A_EVAL     import EVAL
+from .A_NUPLET   import NUPL
+from .A_TUPLE    import Tuple
+from .A_TUPLE    import Matrice
 
 
 from .A_JDC import JDC
@@ -72,7 +70,7 @@ from .A_ENSEMBLE import ENSEMBLE
 from .A_A_CLASSER import A_CLASSER
 from .A_AVANT import AVANT
 
-from .A_ASSD import ASSD,assd, UserASSD
+from .A_ASSD import ASSD,assd, UserASSD, UserASSDMultiple
 from .A_ASSD import GEOM,geom
 # Pour le moment on laisse fonction (ceinture et bretelles)
 from .A_ASSD import FONCTION, fonction
index e16fe0d9b11807935a387cb31c3d93ddadf33811..cf9b19bf7c229f2167c54503ff5986b294c5fc79 100644 (file)
@@ -30,7 +30,7 @@ VERSION_CATALOGUE='V_0'
 # tout est Facultatif car sinon, on ne peut pas supprimer et c 'est ce qu on veut tester
 
 
-DefinitionListe = PROC( nom='DefinitionListe', 
+DefinitionListe = PROC( nom='DefinitionListe',
         listeTexte = SIMP( statut='f', typ = 'TXM',max='**'),
         listeIntInto = SIMP( statut='f', typ = 'I',homo="SansOrdreNiDoublon",max='**', into=(1,2,3,4)),
         listeIntIntoOrdre = SIMP( statut='f', typ = 'I',max='**', into=(1,2,3,4)),
index 9ed00041b251d8125995aebf5e4fd2d398ca9319..dbf6436b0fe213c209a273d6a2526b1a637aca81 100644 (file)
@@ -27,7 +27,7 @@ JdC = JDC_CATA (
     )
 VERSION_CATALOGUE='V_0'
 
-#leProc = PROC(nom = 'leProc', 
+#leProc = PROC(nom = 'leProc',
 #      unSimp = SIMP(statut='o', typ ='I'),
 #      bloc1 = BLOC(condition = "UnSimp == 1",
 #         leFact1 = FACT(statut = 'o',
@@ -41,7 +41,7 @@ VERSION_CATALOGUE='V_0'
 #         ),
 #      )
 #)
-leProcV2 = PROC(nom = 'leProcV2', 
+leProcV2 = PROC(nom = 'leProcV2',
       unSimpV2 = SIMP(statut='o', typ ='I'),
       blocV21 = BLOC(condition = "UnSimpV2 == 1",
          leFactV21 = FACT(statut = 'o',
@@ -59,4 +59,3 @@ leProcV2 = PROC(nom = 'leProcV2',
          ),
       ), # fin bloc2
 )
-
index 5ff16c039766302b6ff89289ac3ebe4a32ce2467..c6e8d2a76bd890442ce71496b4470123709afa64 100644 (file)
@@ -46,16 +46,16 @@ DefinitionDsSimpDsOper = OPER( nom='DefinitionDsSimpDsOper', sd_prod=lASSD,
       creeUserAssd = SIMP( statut='f', typ = (laClasseUserDerive,'createObject'),),
 )
 
-DefinitionDsFactDsProc = PROC( nom='DefinitionDsFactDsProc', 
+DefinitionDsFactDsProc = PROC( nom='DefinitionDsFactDsProc',
      unFact = FACT(statut='f',
         creeUserAssd = SIMP( statut='f', typ = (laClasseUser,'createObject'),),
        ),
 )
-DefinitionDsSimpDsProc = PROC( nom='DefinitionDsSimpDsProc', 
+DefinitionDsSimpDsProc = PROC( nom='DefinitionDsSimpDsProc',
         creeUserAssd = SIMP( statut='f', typ = (laClasseUser,'createObject'),),
 )
 
-DefinitionDsSimpListe = PROC( nom='DefinitionDsSimpListe', 
+DefinitionDsSimpListe = PROC( nom='DefinitionDsSimpListe',
         creeUserAssd = SIMP( statut='f', typ = (laClasseUser,'createObject'),max='**'),
 )
 
@@ -66,4 +66,3 @@ UtiliseEtDefinitDsLeMemeProc = PROC( nom = 'UtiliseEtDefinitDsLeMemeProc',
         utiliseUserAssd  = SIMP(statut= 'o',typ= laClasseUser,max='**'),
         creeUserAssd = SIMP( statut='f', typ = (laClasseUser,'createObject'),),
 )
-
index b84bb643db6dac1b6a41186f5ca5cfb1ea2a8210..687b9c8ca7ec852faa370705f059b4879d0a1a9d 100755 (executable)
@@ -19,7 +19,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-   Ce module sert a lancer EFICAS configure pour Meteo 
+   Ce module sert a lancer EFICAS configure pour Meteo
 """
 # Modules Python
 # Modules Eficas
index de32610b48e3c803510603b680b1ce6331dfdad0..4ba4b9ff3579dd74c6b01aab5d06fac73f274e38 100755 (executable)
@@ -19,7 +19,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-   Ce module sert a lancer EFICAS configure pour Meteo 
+   Ce module sert a lancer EFICAS configure pour Meteo
 """
 # Modules Python
 # Modules Eficas
diff --git a/CatasDeTests/log b/CatasDeTests/log
deleted file mode 100644 (file)
index e63be55..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-avecEltAbstrait   ------------------- False
-self.importedBy ------------------- []
-self.code       ------------------- Essai
-self.implement       ------------------- Essai
-self.nomDuCodeDumpe   ------------------- Essai
-self.nomDuXsdPere  ------------------- Essai
-_________ dumpXsd___________ leProcV2 False True
-_________ dumpXsd___________ leFactV21 True 1
-________________________ leFactV21
-_________ dumpXsd___________ ScalarV2 False True
-<class 'Accas.A_FACT.FACT'>
-       <xs:complexType name="T_ScalarV2" >
-               <xs:sequence>
-                       <xs:element name="NameV2" type="Essai:T_NameV2" minOccurs="1" maxOccurs="1"/>
-                       <xs:element name="ScalarFluxModelV2" type="Essai:T_ScalarFluxModelV2" minOccurs="1" maxOccurs="1"/>
-               </xs:sequence>
-       </xs:complexType>
-
-fin ________________________ leFactV21
-                       <xs:element name="leFactV21" type="Essai:T_leFactV21" minOccurs="0" maxOccurs="1"/>
-
-       <xs:group name="T_blocV21_blocV22">
-               <xs:sequence>
-                       <xs:element name="leFactV21" type="Essai:T_leFactV21" minOccurs="0" maxOccurs="1"/>
-
-_________ dumpXsd___________ leFactV21 True False
-________________________ leFactV21
-_________ dumpXsd___________ ScalarV2 False True
-<class 'Accas.A_FACT.FACT'>
-
-fin ________________________ leFactV21
-__________________________ decommenter pour le texteXSD________________________
index 8eb6e5ee334fbada77d9e57c27ae4eda1f9d9596..6a364b8c5f1ea37bf20075864e1363962a1d673e 100644 (file)
@@ -16,7 +16,7 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-code="Essai" 
+code="Essai"
 import sys, os
 if os.path.dirname(os.path.abspath(__file__)) not in sys.path :
-   sys.path.insert(0,os.path.dirname(os.path.abspath(__file__)))
+    sys.path.insert(0,os.path.dirname(os.path.abspath(__file__)))
index 4fcb65362f0aaa08647700388ec7f2a2ecd1f168..5ccf18780c170f7a9fb5a53da8acbf7c8d1adb2a 100755 (executable)
@@ -19,7 +19,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-   Ce module sert a lancer EFICAS configure pour MAP 
+   Ce module sert a lancer EFICAS configure pour MAP
 """
 # Modules Python
 # Modules Eficas
index 4ed93f310d64e3cd0f19ef3789a8313197d4ab4c..06712372bb06bac01efbd564a9036d4b1f9e2dc6 100644 (file)
@@ -28,62 +28,60 @@ import codecs,types
 from Extensions.i18n import tr
 
 def substractList(liste1,liste2):
-  """ 
-      Enleve tous les elements de liste2 presents dans liste1 et retourne liste1
-  """
-  for item in liste2:
-    try:
-      liste1.remove(item)
-    except:
-      pass
-  return liste1
+    """
+        Enleve tous les elements de liste2 presents dans liste1 et retourne liste1
+    """
+    for item in liste2:
+        try:
+            liste1.remove(item)
+        except:
+            pass
+    return liste1
 
 def getRepUser(dir):
-  """
-      Determine sur quelle plate-forme s'execute Eficas et recherche
-      le repertoire de l'utilisateur /$home/Eficas_install
-  """
+    """
+        Determine sur quelle plate-forme s'execute Eficas et recherche
+        le repertoire de l'utilisateur /$home/Eficas_install
+    """
 
-  #rep_user_eficas= os.path.join(os.environ['HOME'],dir)
-  rep_user_eficas= os.path.join(os.path.expanduser("~"),dir)
-  if os.path.exists(rep_user_eficas):
-    if os.path.isfile(rep_user_eficas) :
-      print (tr("Un fichier de nom %s existe deja : impossible de creer un repertoire de meme nom", rep_user_eficas))
-      rep_user_eficas=None
-  else :
-    try:
-      os.mkdir(rep_user_eficas)
-    except:
-      print (tr("Creation du repertoire %s impossible\n Verifiez vos droits d'acces", rep_user_eficas))
-  return rep_user_eficas
+    #rep_user_eficas= os.path.join(os.environ['HOME'],dir)
+    rep_user_eficas= os.path.join(os.path.expanduser("~"),dir)
+    if os.path.exists(rep_user_eficas):
+        if os.path.isfile(rep_user_eficas) :
+            print (tr("Un fichier de nom %s existe deja : impossible de creer un repertoire de meme nom", rep_user_eficas))
+            rep_user_eficas=None
+    else :
+        try:
+            os.mkdir(rep_user_eficas)
+        except:
+            print (tr("Creation du repertoire %s impossible\n Verifiez vos droits d'acces", rep_user_eficas))
+    return rep_user_eficas
 
 def read_file(file):
-  """
-      ouvre le fichier file et retourne son contenu
-      si pbe retourne None
-  """
-  try :
-    f=open(file)
-    text=f.read()
-    f.close()
-    return text
-  except:
-    return None
+    """
+        ouvre le fichier file et retourne son contenu
+        si pbe retourne None
+    """
+    try :
+        with open(file) as fd :
+            text=fd.read()
+        return text
+    except:
+        return None
 
 def save_in_file(file,text,dir=None):
-  """
-      cree le fichier file (ou l'ecrase s'il existe) et ecrit text dedans
-      retourne 1 si OK 0 sinon
-  """
-  try :
-      if dir != None:
-         os.chdir(dir)
-      f=open(file,'w')
-      f.write(text)
-      f.close()
-      return 1
-  except:
-      return 0
+    """
+        cree le fichier file (ou l'ecrase s'il existe) et ecrit text dedans
+        retourne 1 si OK 0 sinon
+    """
+    try :
+        if dir != None:
+            os.chdir(dir)
+        with open(file) as fd :
+            fd.write(text)
+        return 1
+    except:
+        return 0
 
 def extension_fichier(pathAndFile):
     """ Return ext if path/filename.ext is given """
@@ -94,49 +92,48 @@ def stripPath(pathAndFile):
     return os.path.split(pathAndFile)[1]
 
 def initRep_CataDev(fic_cata,rep_goal):
-  """ 
-      Initialise le repertoire des catalogues developpeurs (chemin d'acces donne
-      dans le fichier eficas.ini cad :
-        - le cree s'il n'existe pas encore
-        - copie dedans les 3 fichiers necessaires :
-          * __init__.py (pour que ce repertoire puisse etre interprete comme un package)
-          * entete.py (pour realiser les import necessaires a l'interpretation des catalogues)
-          * declaration_concepts.py (idem)
-        - cree le fichier cata_developpeur.py qui sera par la suite importe
-  """
-  try :
-    if not os.path.isdir(rep_goal) :
-      os.mkdir(rep_goal)
-    #texte_entete = getEnteteCata(fic_cata)
-    texte_entete=""
-    # rep_goal doit contenir les catalogues du developpeur sous la forme *.capy
-    # il faut creer le catalogue developpeur par concatenation de entete,declaration_concepts
-    # et de tous ces fichiers
-    cur_dir = os.getcwd()
-    os.chdir(rep_goal)
-    l_cata_dev = glob.glob('*.capy')
-    if os.path.isfile('cata_developpeur.py') : os.remove('cata_developpeur.py')
-    if len(l_cata_dev) :
-      # des catalogues developpeurs sont effectivement presents : on cree cata_dev.py dans rep_goal
-      str = ''
-      str = str + texte_entete+'\n'
-      for file in l_cata_dev :
-        str = str + open(file,'r').read() +'\n'
-      open('cata_developpeur.py','w+').write(str)
-    os.chdir(cur_dir)
-  except:
-    traceback.print_exc()
-    print ( tr("Impossible de transferer les fichiers requis dans : %s", str(rep_goal)))
+    """
+        Initialise le repertoire des catalogues developpeurs (chemin d'acces donne
+        dans le fichier eficas.ini cad :
+          - le cree s'il n'existe pas encore
+          - copie dedans les 3 fichiers necessaires :
+            * __init__.py (pour que ce repertoire puisse etre interprete comme un package)
+            * entete.py (pour realiser les import necessaires a l'interpretation des catalogues)
+            * declaration_concepts.py (idem)
+          - cree le fichier cata_developpeur.py qui sera par la suite importe
+    """
+    try :
+        if not os.path.isdir(rep_goal) :
+            os.mkdir(rep_goal)
+        #texte_entete = getEnteteCata(fic_cata)
+        texte_entete=""
+        # rep_goal doit contenir les catalogues du developpeur sous la forme *.capy
+        # il faut creer le catalogue developpeur par concatenation de entete,declaration_concepts
+        # et de tous ces fichiers
+        cur_dir = os.getcwd()
+        os.chdir(rep_goal)
+        l_cata_dev = glob.glob('*.capy')
+        if os.path.isfile('cata_developpeur.py') : os.remove('cata_developpeur.py')
+        if len(l_cata_dev) :
+            # des catalogues developpeurs sont effectivement presents : on cree cata_dev.py dans rep_goal
+            str = ''
+            str = str + texte_entete+'\n'
+            for file in l_cata_dev :
+                str = str + open(file,'r').read() +'\n'
+            open('cata_developpeur.py','w+').write(str)
+        os.chdir(cur_dir)
+    except:
+        traceback.print_exc()
+        print ( tr("Impossible de transferer les fichiers requis dans : %s", str(rep_goal)))
 
 def getEnteteCata(fic_cata):
-  """ Retrouve l'entete du catalogue """
-  l_lignes = open(fic_cata,'r').readlines()
-  txt = ''
-  flag = 0
-  for ligne in l_lignes :
-    if re.match(u"# debut entete",ligne) : flag = 1
-    if re.match(u"# fin entete",ligne) : break
-    if not flag : continue
-    txt = txt + ligne
-  return txt
-
+    """ Retrouve l'entete du catalogue """
+    l_lignes = open(fic_cata,'r').readlines()
+    txt = ''
+    flag = 0
+    for ligne in l_lignes :
+        if re.match(u"# debut entete",ligne) : flag = 1
+        if re.match(u"# fin entete",ligne) : break
+        if not flag : continue
+        txt = txt + ligne
+    return txt
index 243315ce4055c2a31fa1e0f319699c116970aa05..8b6fbbd6835e944fa51ceb157ef6940b397aa041 100644 (file)
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except :
-   pass
+    pass
 import types,os,glob,imp,sys
 from copy import copy,deepcopy
 
@@ -37,9 +37,9 @@ from Extensions.i18n import tr
 from Extensions.eficas_exception import EficasException
 
 try :
-   from repr import Repr
+    from repr import Repr
 except :
-   from reprlib import Repr
+    from reprlib import Repr
 myrepr = Repr()
 myrepr.maxstring = 100
 myrepr.maxother = 100
@@ -169,7 +169,7 @@ class ObjectTreeItem(TreeItem,Delegate):
         return self._object
 
     def connect(self,channel,callable,args):
-        """ Connecte la fonction callable (avec arguments args) a l'item self sur le 
+        """ Connecte la fonction callable (avec arguments args) a l'item self sur le
             canal channel
         """
         #print self,channel,callable,args
@@ -186,13 +186,13 @@ class ObjectTreeItem(TreeItem,Delegate):
         fonction = deepcopy(self.setFunction)
         item = makeObjecttreeitem(appliEficas,labeltext,object,fonction)
         return item
-    
+
     def isActif(self):
         if hasattr(self.object,'actif'):
             return self.object.actif
         else:
             return 1
-    
+
     def update(self,item):
         """
           Met a jour l'item courant a partir d'un autre item passe en argument
@@ -210,27 +210,27 @@ class ObjectTreeItem(TreeItem,Delegate):
         return tr(self.labeltext),None,None
 
     def getNature(self) :
-        """ 
+        """
             Retourne la nature de l'item et de l'objet
-        """ 
+        """
         return self.object.nature
 
     def getRegles(self):
         """ retourne les regles de l'objet pointe par self """
         return self.object.getRegles()
-    
+
     def getListeMcPresents(self):
         """ Retourne la liste des mots-cles fils de l'objet pointe par self """
         return self.object.listeMcPresents()
-    
+
     def getVal(self):
         """ Retourne le nom de la valeur de l'objet pointe par self dans le cas
             ou celle-ci est un objet (ASSD) """
         return self.object.getVal()
-    
+
     def get_definition(self):
-        """ 
-           Retourne l'objet definition de l'objet pointe par self 
+        """
+           Retourne l'objet definition de l'objet pointe par self
         """
         return self.object.definition
 
@@ -249,7 +249,7 @@ class ObjectTreeItem(TreeItem,Delegate):
         d'une liste du type :ETAPE + MCFACT ou MCBLOC + ...
         """
         return self.object.getListeMcOrdonneeBrute(liste,dico)
-   
+
     def getGenealogie(self):
         """
         Retourne la liste des noms des ascendants (noms de MCSIMP,MCFACT,MCBLOC ou ETAPE)
@@ -279,7 +279,7 @@ class ObjectTreeItem(TreeItem,Delegate):
                 l.append(nom)
         # l contient les anciens mots-cles + le nouveau dans l'ordre
         return l.index(nom_fils)
-        
+
     def appendChild(self,name,pos=None):
         """
           Permet d'ajouter un item fils a self
@@ -289,7 +289,7 @@ class ObjectTreeItem(TreeItem,Delegate):
         elif pos == 'last':
             index = len(self.listeMcPresents())
         elif type(pos) == int :
-            # la position est fixee 
+            # la position est fixee
             index = pos
         #elif type(pos) == types.InstanceType:
         elif type(pos) == object :
@@ -320,7 +320,7 @@ class ObjectTreeItem(TreeItem,Delegate):
     def getCopieObjet(self):
         """ Retourne une copie de l'objet pointe par self """
         return self.object.copy()
-    
+
     def getPosition(self):
         """ Retourne la valeur de l'attribut position de l'objet pointe par self """
         definition = self.get_definition()
@@ -328,7 +328,7 @@ class ObjectTreeItem(TreeItem,Delegate):
             return getattr(definition,'position')
         except AttributeError:
             return 'local'
-        
+
     def getNom(self):
         """ Retourne le nom de l'objet pointe par self """
         return self.object.nom
@@ -336,7 +336,7 @@ class ObjectTreeItem(TreeItem,Delegate):
     def getJdc(self):
         """ Retourne le jdc auquel appartient l'objet pointe par self """
         return self.object.jdc
-    
+
     def getValeur(self):
         """ Retourne la valeur de l'objet pointe par self """
         return self.object.valeur
@@ -354,7 +354,7 @@ class ObjectTreeItem(TreeItem,Delegate):
         raise EficasException("MESSAGE AU DEVELOPPEUR : il faut \
                                  surcharger la methode getObjetCommentarise() \
                                  pour la classe %s", self.__class__.__name__)
-        
+
     def isValid(self):
         """ Retourne 1 si l'objet pointe par self est valide, 0 sinon"""
         return self.object.isValid()
@@ -365,7 +365,7 @@ class ObjectTreeItem(TreeItem,Delegate):
         Par defaut retourne 0
         """
         return 0
-    
+
     def getMcPresents(self):
         """ Retourne le dictionnaire des mots-cles presents de l'objet pointe par self """
         return self.object.dictMcPresents()
@@ -387,10 +387,10 @@ class ObjectTreeItem(TreeItem,Delegate):
     def setValeur(self,new_valeur):
         """ Remplace la valeur de l'objet pointe par self par new_valeur """
         return self.object.setValeur(new_valeur)
-        
+
     def getText(self):
         return myrepr.repr(self.object)
-    
+
     def getIconName(self):
         if not self.isExpandable():
             return "python"
@@ -407,7 +407,7 @@ class ObjectTreeItem(TreeItem,Delegate):
 
     def isExpandable(self):
         return 1
-        
+
     def getSubList(self):
         keys = dir(self.object)
         sublist = []
@@ -451,17 +451,17 @@ class SequenceTreeItem(ObjectTreeItem):
 
     def __len__(self) :
         return len(self._object)
-   
+
     def keys(self):
         return list(range(len(self._object)))
 
     def getIconName(self):
         if self._object.isValid():
-          return "ast-green-los"
+            return "ast-green-los"
         elif self._object.isOblig():
-          return "ast-red-los"
+            return "ast-red-los"
         else:
-          return "ast-yel-los"
+            return "ast-yel-los"
 
     def ajoutPossible(self):
         return self._object.ajoutPossible()
@@ -471,7 +471,7 @@ class SequenceTreeItem(ObjectTreeItem):
         return self._object.getIndex(child.getObject())
 
     def getText(self):
-      return  "    "
+        return  "    "
 
     def addItem(self,obj,pos):
         self._object.insert(pos,obj)
@@ -495,18 +495,18 @@ class SequenceTreeItem(ObjectTreeItem):
         self.sublist=[]
 
         while(1):
-           old_obj=obj=None
-           for item in isublist:
-              old_obj=item.getObject()
-              if old_obj in liste:break
-
-           for obj in iliste:
-              if obj is old_obj:break
-              # nouvel objet : on cree un nouvel item
-              def setFunction(value, object=obj):
-                  object=value
-              it = self.makeObjecttreeitem(self.appliEficas, obj.nom + " : ", obj, setFunction)
-              self.sublist.append(it)
-           if old_obj is None and obj is None:break
-           if old_obj is obj: self.sublist.append(item)
+            old_obj=obj=None
+            for item in isublist:
+                old_obj=item.getObject()
+                if old_obj in liste:break
+
+            for obj in iliste:
+                if obj is old_obj:break
+                # nouvel objet : on cree un nouvel item
+                def setFunction(value, object=obj):
+                    object=value
+                it = self.makeObjecttreeitem(self.appliEficas, obj.nom + " : ", obj, setFunction)
+                self.sublist.append(it)
+            if old_obj is None and obj is None:break
+            if old_obj is obj: self.sublist.append(item)
         return self.sublist
index 325e83e9d0e4ef54086ae747b604fb254d50914b..561ff1c7dc5614551b647235cb272a88b4325071 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-   Ce module contient la classe 3Dpilote qui va creer les ordres 
+   Ce module contient la classe 3Dpilote qui va creer les ordres
    de pilotage de l idl PAL pour un element de structure
 """
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import object
+    from builtins import object
 except :
-   pass
+    pass
 import generator
 from Extensions.i18n import tr
 
 class TroisDPilote(object):
 
-   def __init__(self,node,appliEficas):
-      self.node=node
-      self.appliEficas=appliEficas
+    def __init__(self,node,appliEficas):
+        self.node=node
+        self.appliEficas=appliEficas
 
-   def envoievisu(self):
-      """ 
-      """
-      format="vers3DSalome"
-      if format in generator.plugins :
-         # Le generateur existe on l'utilise
-         g=generator.plugins[format]()
-         g.initJdc(self.node.getJdc())
-         texte=g.gener(self.node)
-      else:
-         print ("Le generateur n'a pas ete trouve")
-         print ("Erreur ! Erreur!")
-         return ""
-      from Extensions.param2 import originalMath
-      originalMath.toOriginal()
-      self.appliEficas.envoievisu(texte)
-      originalMath.toSurcharge()
-  
+    def envoievisu(self):
+        """
+        """
+        format="vers3DSalome"
+        if format in generator.plugins :
+            # Le generateur existe on l'utilise
+            g=generator.plugins[format]()
+            g.initJdc(self.node.getJdc())
+            texte=g.gener(self.node)
+        else:
+            print ("Le generateur n'a pas ete trouve")
+            print ("Erreur ! Erreur!")
+            return ""
+        from Extensions.param2 import originalMath
+        originalMath.toOriginal()
+        self.appliEficas.envoievisu(texte)
+        originalMath.toSurcharge()
index 60d114b23e6e80e2fbc7af909ffdab5d094ce1ff..200f59942a8ea5fa1b15e804c94d344f9273bc21 100644 (file)
 #
 from __future__ import absolute_import
 from __future__ import print_function
-try : 
-   from builtins import str
-   from builtins import object
+try :
+    from builtins import str
+    from builtins import object
 except :
-   pass
+    pass
 
 import re,six.moves.cPickle,os
 
@@ -41,285 +41,271 @@ l_noms_simples=['SIMP',]
 l_noms=l_noms_composes+l_noms_simples
 
 def elimineCommentaires(text):
-        """ Elimine les lignes de commentaires dans text
-        Attention : supprime sauvagement tous les caracteres entre # et le retour chariot ..."""
-        comments = re.compile(r'#[^\n]*')
-        return comments.sub(u'',text)
+    """ Elimine les lignes de commentaires dans text
+    Attention : supprime sauvagement tous les caracteres entre # et le retour chariot ..."""
+    comments = re.compile(r'#[^\n]*')
+    return comments.sub(u'',text)
 
 def chercheNom(text):
-        Whitespace = r'[ \f\t]*'
-        Name = r'[a-zA-Z_]\w*'
-        myexpr = '(u'+Name+')'+Whitespace+'='+Whitespace+'$'
-        a=re.search(myexpr,text)
-        return a.group(1)
+    Whitespace = r'[ \f\t]*'
+    Name = r'[a-zA-Z_]\w*'
+    myexpr = '(u'+Name+')'+Whitespace+'='+Whitespace+'$'
+    a=re.search(myexpr,text)
+    return a.group(1)
 
 def chercheArgs(text):
-        text = text.strip()
-        longueur = len(text)
-        if text[0] != '(u':
-                return 'erreur !'
+    text = text.strip()
+    longueur = len(text)
+    if text[0] != '(u':
+        return 'erreur !'
+    else :
+        nbpar = 1
+        for i in range(1,longueur) :
+            if text[i] =='(u':
+                nbpar = nbpar + 1
+            elif text[i] == ')':
+                nbpar = nbpar - 1
+            else :
+                continue
+            if nbpar == 0:
+                break
+        if nbpar != 0 :
+            return tr('Erreur ! Erreur !')
         else :
-                nbpar = 1
-                for i in range(1,longueur) :
-                        if text[i] =='(u':
-                                nbpar = nbpar + 1
-                        elif text[i] == ')':
-                                nbpar = nbpar - 1
-                        else :
-                                continue
-                        if nbpar == 0:
-                                break
-                if nbpar != 0 :
-                        return tr('Erreur ! Erreur !')
-                else :
-                        try :
-                                return text[1:i],text[i+1:] # on enleve les premiere et derniere parentheses
-                        except :
-                                return text[1:i],''
+            try :
+                return text[1:i],text[i+1:] # on enleve les premiere et derniere parentheses
+            except :
+                return text[1:i],''
 
 class ENTITE(object):
-        def chercheEnfants(self):
-                try :
-                        self.text = self.text.strip()
-                        liste = re.split(u'=',self.text,1)
-                        if len(liste)>1 :
-                                arg1=liste[0]
-                                reste=liste[1]
-                                reste = reste.strip()
-                                if reste[0:4] in l_noms :
-                                        nom_mc = chercheNom(arg1+'=')
-                                        arg_mc, self.text = chercheArgs(reste[4:])
-                                        self.creeMc(nom_mc,arg_mc,reste[0:4])
-                                else :
-                                        self.text = reste
-                                self.chercheEnfants()
-                        else :
-                                # pas de = rencontre
-                                return
-                except Exception as e:
-                        self.cr.fatal(tr("Erreur rencontree dans rechercheEnfants : %s", e.__str()))
-                
-        def creeMc(self,nom_mc,arg_mc,test):
-                if test in l_noms_composes :
-                        mc = FACT_CATA(nom_mc,arg_mc,self)
-                        self.children.append(mc)
-                elif test in l_noms_simples :
-                        mc = SIMP_CATA(nom_mc,self)
-                        self.children.append(mc)
+    def chercheEnfants(self):
+        try :
+            self.text = self.text.strip()
+            liste = re.split(u'=',self.text,1)
+            if len(liste)>1 :
+                arg1=liste[0]
+                reste=liste[1]
+                reste = reste.strip()
+                if reste[0:4] in l_noms :
+                    nom_mc = chercheNom(arg1+'=')
+                    arg_mc, self.text = chercheArgs(reste[4:])
+                    self.creeMc(nom_mc,arg_mc,reste[0:4])
                 else :
-                        print (tr("Erreur dans la creation du mot-cle : %s", nom_mc) )
-
-        def construitListeDico(self):
-                l=[]
-                d={}
-                if len(self.children)==0:
-                        self.ordre_mc = l
-                        self.entites = d
-                        return
-                try :
-                        for child in self.children:
-                                l.append(child.nom)
-                                d[child.nom]=child
-                        self.ordre_mc = l
-                        self.entites = d
-                except:
-                        print (("erreur : ", self.nom,  self.__class__))
-                
-class COMMANDE_CATA(ENTITE) :
-        def __init__(self,nom,args,parent):
-                self.nom = nom
-                self.args = args
-                self.children = []
-                self.text = args
-                self.cr = CR()
-                self.cr.debut = "Debut commande %s" %self.nom
-                self.cr.fin = "Fin commande %s" %self.nom
+                    self.text = reste
                 self.chercheEnfants()
-                self.construitListeDico()
-                parent.cr.add(self.cr)
+            else :
+                # pas de = rencontre
+                return
+        except Exception as e:
+            self.cr.fatal(tr("Erreur rencontree dans rechercheEnfants : %s", e.__str()))
+
+    def creeMc(self,nom_mc,arg_mc,test):
+        if test in l_noms_composes :
+            mc = FACT_CATA(nom_mc,arg_mc,self)
+            self.children.append(mc)
+        elif test in l_noms_simples :
+            mc = SIMP_CATA(nom_mc,self)
+            self.children.append(mc)
+        else :
+            print (tr("Erreur dans la creation du mot-cle : %s", nom_mc) )
+
+    def construitListeDico(self):
+        l=[]
+        d={}
+        if len(self.children)==0:
+            self.ordre_mc = l
+            self.entites = d
+            return
+        try :
+            for child in self.children:
+                l.append(child.nom)
+                d[child.nom]=child
+            self.ordre_mc = l
+            self.entites = d
+        except:
+            print (("erreur : ", self.nom,  self.__class__))
 
-        def affiche(self):
-                texte_cmd = '\n'
-                texte_cmd = texte_cmd + 'Commande :' + self.nom + '\n'
-                for child in self.children :
-                        texte_cmd = texte_cmd + child.affiche(1)
-                return texte_cmd
+class COMMANDE_CATA(ENTITE) :
+    def __init__(self,nom,args,parent):
+        self.nom = nom
+        self.args = args
+        self.children = []
+        self.text = args
+        self.cr = CR()
+        self.cr.debut = "Debut commande %s" %self.nom
+        self.cr.fin = "Fin commande %s" %self.nom
+        self.chercheEnfants()
+        self.construitListeDico()
+        parent.cr.add(self.cr)
+
+    def affiche(self):
+        texte_cmd = '\n'
+        texte_cmd = texte_cmd + 'Commande :' + self.nom + '\n'
+        for child in self.children :
+            texte_cmd = texte_cmd + child.affiche(1)
+        return texte_cmd
 
 class SIMP_CATA(object) :
-        def __init__(self,nom,parent):
-                self.nom = nom
-                self.cr = CR()
-                self.cr.debut = "Debut mot-cle simple %s" %self.nom
-                self.cr.fin = "Fin mot-cle simple %s" %self.nom
-                parent.cr.add(self.cr)
+    def __init__(self,nom,parent):
+        self.nom = nom
+        self.cr = CR()
+        self.cr.debut = "Debut mot-cle simple %s" %self.nom
+        self.cr.fin = "Fin mot-cle simple %s" %self.nom
+        parent.cr.add(self.cr)
 
-        def affiche(self,ind):
-                sep = ' '*5
-                return sep*ind+self.nom+'\n'
+    def affiche(self,ind):
+        sep = ' '*5
+        return sep*ind+self.nom+'\n'
 
 class FACT_CATA(ENTITE) :
-        def __init__(self,nom,args,parent):
-                self.nom=nom
-                self.args=args
-                self.children = []
-                self.text=args
-                self.cr = CR()
-                self.cr.debut = "Debut mot-cle facteur ou bloc %s" %self.nom
-                self.cr.fin = "Fin mot-cle facteur ou bloc %s" %self.nom
-                self.chercheEnfants()
-                self.construitListeDico()
-                parent.cr.add(self.cr)
+    def __init__(self,nom,args,parent):
+        self.nom=nom
+        self.args=args
+        self.children = []
+        self.text=args
+        self.cr = CR()
+        self.cr.debut = "Debut mot-cle facteur ou bloc %s" %self.nom
+        self.cr.fin = "Fin mot-cle facteur ou bloc %s" %self.nom
+        self.chercheEnfants()
+        self.construitListeDico()
+        parent.cr.add(self.cr)
+
+    def affiche(self,ind):
+        sep = ' '*5
+        text = ''
+        text = text + sep*ind+self.nom+'\n'
+        for child in self.children :
+            text = text + child.affiche(ind+1)
+        return text
 
-        def affiche(self,ind):
-                sep = ' '*5
-                text = ''
-                text = text + sep*ind+self.nom+'\n'
-                for child in self.children :
-                        text = text + child.affiche(ind+1)
-                return text
-                
 class CATALOGUE_CATA(object):
-        def __init__(self,parent,fichier):
-                self.parent = parent
-                self.fichier=fichier
-                self.cr = CR()
-                self.cr.debut = "Debut compte-rendu catalogue %s" %self.fichier
-                self.cr.fin = "Fin compte-rendu catalogue %s" %self.fichier
-                self.ouvrirFichier()
-                self.liste_commandes=[]
-                self.liste_textes_commandes=[]
-
-        def ouvrirFichier(self):
-                try :
-                        f=open(self.fichier,'r')
-                        self.texte_complet=f.read()
-                        f.close()
-                except :
-                        print((tr("Impossible d'ouvrir le fichier : %s ", str(self.fichier))))
-                        self.cr.fatal(tr("Impossible d'ouvrir le fichier : %s ", str(self.fichier)))
-
-        def constrListTxtCmd(self,text):
-                text = elimineCommentaires(text)
-                pattern = '\) *;'
-                liste=re.split(pattern,text)
-                for i in range(0,len(liste)-1):
-                        self.liste_textes_commandes.append(liste[i]+')')
-
-        def analyseCommandeOld(self,text):
-                liste = re.split(u'OPER *\(u',text,1)
-                if len(liste) < 2 :
-                        liste = re.split(u'PROC *\(u',text,1)
-                if len(liste) < 2 :
-                        liste = re.split(u'MACRO *\(u',text,1)
-                if len(liste) < 2 :
-                        print ((tr("le texte a analyser n'est pas celui d'une commande ou d'un operateur : "), text))
-                        self.cr.fatal(tr("le texte a analyser n'est pas celui d'une commande ou \
-                                         d'un operateur : %s", text))
-                        return
-                debut = liste[0]
-                fin = liste[1]
-                nom_cmd = chercheNom(debut)
-                if nom_cmd == 'erreur !':
-                        print((tr("Erreur dans la recherche  du nom de la commande : "), debut))
-                args_cmd,toto = chercheArgs(u'(u'+fin)
-                if args_cmd == 'erreur !':
-                        print((tr("Erreur dans la recherche des  args de la commande :") , debut))
-                cmd=COMMANDE_CATA(nom_cmd,args_cmd,self)
-                self.liste_commandes.append(cmd)
-
-        def analyseCommande(self,text):
-                for nom_cmd in l_noms_commandes:
-                        liste = re.split(nom_cmd+' *\(u',text,1)
-                        if len(liste) == 2 : break
-                if len(liste) < 2 :
-                        print((tr("le texte a analyser n'est pas celui d'une commande connue : \
-                                        %(v_1)s %(v_2)s", {'v_1': str(l_noms_commandes), 'v_2': text})))
-                        self.cr.fatal(tr("le texte a analyser n'est pas celui d'une commande connue : \
-                                         %(v_1)s %(v_2)s", {'v_1': str(l_noms_commandes), 'v_2': text}))
-                        return
-                debut = liste[0]
-                fin = liste[1]
-                nom_cmd = chercheNom(debut)
-                if nom_cmd == 'erreur !':
-                        print(( tr("Erreur dans la recherche du  nom de la commande : "), debut))
-                args_cmd,toto = chercheArgs(u'(u'+fin)
-                if args_cmd == 'erreur !':
-                        print(( tr("Erreur dans la recherche des args de la commande : "), debut))
-                        print((tr(fin)))
-                cmd=COMMANDE_CATA(nom_cmd,args_cmd,self)
-                self.liste_commandes.append(cmd)
-                
-        def analyseTexte(self,texte):
-                self.constrListTxtCmd(texte)
-                try:
-                        self.parent.configure_barre(len(self.liste_textes_commandes))
-                except:
-                        pass
-                for texte_commande in self.liste_textes_commandes :
-                        try:
-                                self.parent.update_barre()
-                        except:
-                                pass
-                        self.analyseCommande(texte_commande)
-                self.construitListeDico()
-
-        def ecritLcmd(self):
-                f=open(u'U:\\EFICAS\\Accas\\cata.txt','w')
-                for cmd in self.liste_commandes :
-                        f.write(cmd.affiche())
-                f.close()
+    def __init__(self,parent,fichier):
+        self.parent = parent
+        self.fichier=fichier
+        self.cr = CR()
+        self.cr.debut = "Debut compte-rendu catalogue %s" %self.fichier
+        self.cr.fin = "Fin compte-rendu catalogue %s" %self.fichier
+        self.ouvrirFichier()
+        self.liste_commandes=[]
+        self.liste_textes_commandes=[]
+
+    def ouvrirFichier(self):
+        try :
+            with open(self.fichier) as fd:
+                self.texte_complet=fd.read()
+        except :
+            print((tr("Impossible d'ouvrir le fichier : %s ", str(self.fichier))))
+            self.cr.fatal(tr("Impossible d'ouvrir le fichier : %s ", str(self.fichier)))
+
+    def constrListTxtCmd(self,text):
+        text = elimineCommentaires(text)
+        pattern = '\) *;'
+        liste=re.split(pattern,text)
+        for i in range(0,len(liste)-1):
+            self.liste_textes_commandes.append(liste[i]+')')
+
+    def analyseCommandeOld(self,text):
+        liste = re.split(u'OPER *\(u',text,1)
+        if len(liste) < 2 :
+            liste = re.split(u'PROC *\(u',text,1)
+        if len(liste) < 2 :
+            liste = re.split(u'MACRO *\(u',text,1)
+        if len(liste) < 2 :
+            print ((tr("le texte a analyser n'est pas celui d'une commande ou d'un operateur : "), text))
+            self.cr.fatal(tr("le texte a analyser n'est pas celui d'une commande ou \
+                             d'un operateur : %s", text))
+            return
+        debut = liste[0]
+        fin = liste[1]
+        nom_cmd = chercheNom(debut)
+        if nom_cmd == 'erreur !':
+            print((tr("Erreur dans la recherche  du nom de la commande : "), debut))
+        args_cmd,toto = chercheArgs(u'(u'+fin)
+        if args_cmd == 'erreur !':
+            print((tr("Erreur dans la recherche des  args de la commande :") , debut))
+        cmd=COMMANDE_CATA(nom_cmd,args_cmd,self)
+        self.liste_commandes.append(cmd)
+
+    def analyseCommande(self,text):
+        for nom_cmd in l_noms_commandes:
+            liste = re.split(nom_cmd+' *\(u',text,1)
+            if len(liste) == 2 : break
+        if len(liste) < 2 :
+            print((tr("le texte a analyser n'est pas celui d'une commande connue : \
+                            %(v_1)s %(v_2)s", {'v_1': str(l_noms_commandes), 'v_2': text})))
+            self.cr.fatal(tr("le texte a analyser n'est pas celui d'une commande connue : \
+                             %(v_1)s %(v_2)s", {'v_1': str(l_noms_commandes), 'v_2': text}))
+            return
+        debut = liste[0]
+        fin = liste[1]
+        nom_cmd = chercheNom(debut)
+        if nom_cmd == 'erreur !':
+            print(( tr("Erreur dans la recherche du  nom de la commande : "), debut))
+        args_cmd,toto = chercheArgs(u'(u'+fin)
+        if args_cmd == 'erreur !':
+            print(( tr("Erreur dans la recherche des args de la commande : "), debut))
+            print((tr(fin)))
+        cmd=COMMANDE_CATA(nom_cmd,args_cmd,self)
+        self.liste_commandes.append(cmd)
+
+    def analyseTexte(self,texte):
+        self.constrListTxtCmd(texte)
+        try:
+            self.parent.configure_barre(len(self.liste_textes_commandes))
+        except:
+            pass
+        for texte_commande in self.liste_textes_commandes :
+            try:
+                self.parent.update_barre()
+            except:
+                pass
+            self.analyseCommande(texte_commande)
+        self.construitListeDico()
+
+    def ecritLcmd(self):
+        f=open(u'U:\\EFICAS\\Accas\\cata.txt','w')
+        for cmd in self.liste_commandes :
+            f.write(cmd.affiche())
+        f.close()
 
-        def construitListeDico(self):
-                l=[]
-                d={}
-                for cmd in self.liste_commandes:
-                        l.append(cmd.nom)
-                        d[cmd.nom]=cmd
-                self.ordre_mc = l
-                self.entites = d
+    def construitListeDico(self):
+        l=[]
+        d={}
+        for cmd in self.liste_commandes:
+            l.append(cmd.nom)
+            d[cmd.nom]=cmd
+        self.ordre_mc = l
+        self.entites = d
 
-        def report(self):
-                """ retourne l'objet rapport du catalogue de commande """
-                return self.cr
+    def report(self):
+        """ retourne l'objet rapport du catalogue de commande """
+        return self.cr
 
 def analyseCatalogue(parent,nom_cata):
-        cata = CATALOGUE_CATA(parent,nom_cata)
-        cata.analyseTexte(cata.texte_complet)
-        return cata
+    cata = CATALOGUE_CATA(parent,nom_cata)
+    cata.analyseTexte(cata.texte_complet)
+    return cata
 
 def analyseCatalogueCommande(parent,nom_cata):
-        cata = CATALOGUE_CATA(parent,nom_cata)
-        cata.analyseCommande(cata.texte_complet)
-        cata.construitListeDico()
-        return cata
+    cata = CATALOGUE_CATA(parent,nom_cata)
+    cata.analyseCommande(cata.texte_complet)
+    cata.construitListeDico()
+    return cata
 
 
 def makeCataPickle(ficCata):
-        """
-        Lance l'analyse de l'ordre des mots-cles dans le catalogue dont le nom
-        est passe en argument et sauvegarde ces infos dans le fichier pickle relu
-        par Eficas
-        """
-        ficCata_p = os.path.splitext(ficCata)[0]+'_pickled.py'
-        cata_ordonne = analyseCatalogue(None,ficCata)
-        f = open(ficCata_p,'w+')
-        p = six.moves.cPickle.Pickler(f)
-        p.dump(cata_ordonne.entites)
-        f.close()
-        
-if __name__ == "__main__" :
-        import profile
-        profile.run(u"analyseCatalogue(None,'U:\\EFICAS\\Cata\\cata_saturne.py')")
-
-
-
-
-
+    """
+    Lance l'analyse de l'ordre des mots-cles dans le catalogue dont le nom
+    est passe en argument et sauvegarde ces infos dans le fichier pickle relu
+    par Eficas
+    """
+    ficCata_p = os.path.splitext(ficCata)[0]+'_pickled.py'
+    cata_ordonne = analyseCatalogue(None,ficCata)
+    f = open(ficCata_p,'w+')
+    p = six.moves.cPickle.Pickler(f)
+    p.dump(cata_ordonne.entites)
+    f.close()
 
-
-
-
-
-
-                                
-                                
+if __name__ == "__main__" :
+    import profile
+    profile.run(u"analyseCatalogue(None,'U:\\EFICAS\\Cata\\cata_saturne.py')")
index 90e73d6b29a71922c0ce59f1119b4af910bebb4b..8a5bb62f21dc9c4b7daf00ed28e06689cefe372e 100644 (file)
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-  from builtins import str
-  from builtins import object
+    from builtins import str
+    from builtins import object
 except :
-  pass
+    pass
 import re,os
 
 from Extensions.i18n import tr
@@ -32,50 +32,36 @@ __Id__="$Id: analyseCatalogue_initial.py,v 1.2.4.1.2.2.2.4 2017-04-09 14:04:44 p
 __version__="$Name: V7_main $"
 #
 
-                
-class Catalogue_initial(object):
-        def __init__(self,fichier):
-                self.liste_commandes=[]
-                self.lignes=[]
-                self.fichier=fichier
-                self.ouvrirFichier()
-                self.constrListTxtCmd()
-
-        def ouvrirFichier(self):
-                try :
-                        f=open(self.fichier,'r')
-                        self.lignes=f.readlines()
-                        f.close()
-                except :
-                        print(tr("Impossible d'ouvrir le fichier : %s", str(self.fichier)))
 
-        def constrListTxtCmd(self):
-                pattern = '^# Ordre Catalogue '
-                for i in self.lignes :
-                    if (re.search(pattern,i)):
-                        i=i.replace('# Ordre Catalogue ','')
-                        i=i.replace('\n','')
-                        self.liste_commandes.append(i)
+class Catalogue_initial(object):
+    def __init__(self,fichier):
+        self.liste_commandes=[]
+        self.lignes=[]
+        self.fichier=fichier
+        self.ouvrirFichier()
+        self.constrListTxtCmd()
+
+    def ouvrirFichier(self):
+        try :
+            with open(self.fichier) as fd:
+                self.lignes=fd.readlines()
+        except :
+            print(tr("Impossible d'ouvrir le fichier : %s", str(self.fichier)))
+
+    def constrListTxtCmd(self):
+        pattern = '^# Ordre Catalogue '
+        for i in self.lignes :
+            if (re.search(pattern,i)):
+                i=i.replace('# Ordre Catalogue ','')
+                i=i.replace('\n','')
+                self.liste_commandes.append(i)
 
 
 def analyseCatalogue(nom_cata):
-        cata = Catalogue_initial(nom_cata)
-        return cata.liste_commandes
+    cata = Catalogue_initial(nom_cata)
+    return cata.liste_commandes
 
 
 if __name__ == "__main__" :
-        monCata="/local/noyret/Install_Eficas/EficasQT4/Openturns_StudyOpenTURNS_Cata_Study_V4.py"
-        analyseCatalogue(monCata)
-
-
-
-
-
-
-
-
-
-
-
-                                
-                                
+    monCata="/local/noyret/Install_Eficas/EficasQT4/Openturns_StudyOpenTURNS_Cata_Study_V4.py"
+    analyseCatalogue(monCata)
index 9699bcf2558cf7302807a0cbb0402b54d6120cc1..359b8bdfdb6409d50466be8ba5e608dd37efa19b 100644 (file)
 from __future__ import absolute_import
 from __future__ import print_function
 if __name__ == "__main__" :
-   import sys
-   sys.path[:0]=[".."]
-   sys.path[:0]=["../Aster"]
-   sys.path[:0]=["../Saturne"]
+    import sys
+    sys.path[:0]=[".."]
+    sys.path[:0]=["../Aster"]
+    sys.path[:0]=["../Saturne"]
 
 from Accas import NUPL
 
 def traiteEntiteNUPL(entite):
-   """
-       Fonction speciale pour les nuplets (classe NUPL)
-       Cette fonction ajoute a l'objet entite un attribut de nom ordre_mc
-       qui est une liste vide.
-   """
-   entite.ordre_mc=[]
+    """
+        Fonction speciale pour les nuplets (classe NUPL)
+        Cette fonction ajoute a l'objet entite un attribut de nom ordre_mc
+        qui est une liste vide.
+    """
+    entite.ordre_mc=[]
 
 def traiteEntite(entite,liste_simp_reel):
-   """
-       Cette fonction ajoute a l'objet entite un attribut de nom ordre_mc
-       qui est une liste contenant le nom des sous entites dans l'ordre 
-       de leur apparition dans le catalogue.
-       L'ordre d'apparition dans le catalogue est donne par l'attribut _no
-       de l'entite
-       La fonction active le meme type de traitement pour les sous entites
-       de entite
-   """
-   l=[]
-   for k,v in list(entite.entites.items()):
-      if isinstance(v,NUPL):
-         traiteEntiteNUPL(v)
-      else:
-         traiteReel(v,liste_simp_reel)
-         traiteEntite(v,liste_simp_reel)
-         traiteCache(v)
-      l.append((v._no,k))
-   l.sort()
-   entite.ordre_mc=[ item for index, item in l ]
+    """
+        Cette fonction ajoute a l'objet entite un attribut de nom ordre_mc
+        qui est une liste contenant le nom des sous entites dans l'ordre
+        de leur apparition dans le catalogue.
+        L'ordre d'apparition dans le catalogue est donne par l'attribut _no
+        de l'entite
+        La fonction active le meme type de traitement pour les sous entites
+        de entite
+    """
+    l=[]
+    for k,v in list(entite.entites.items()):
+        if isinstance(v,NUPL):
+            traiteEntiteNUPL(v)
+        else:
+            traiteReel(v,liste_simp_reel)
+            traiteEntite(v,liste_simp_reel)
+            traiteCache(v)
+        l.append((v._no,k))
+    l.sort()
+    entite.ordre_mc=[ item for index, item in l ]
 
 def traiteCache(objet):
     if not hasattr(objet, "cache"): return
@@ -67,63 +67,63 @@ def traiteCache(objet):
     clef=objet.nom
     if objet.equiv != None : clef=objet.equiv
     if hasattr(objet.pere,"mcOblig"):
-      objet.pere.mcOblig[clef]=objet.defaut
+        objet.pere.mcOblig[clef]=objet.defaut
     else :
-      objet.pere.mcOblig={}
-      objet.pere.mcOblig[clef]=objet.defaut
+        objet.pere.mcOblig={}
+        objet.pere.mcOblig[clef]=objet.defaut
 
 def traiteReel(objet,liste_simp_reel):
     if objet.__class__.__name__ == "SIMP":
-       if ( 'R' in objet.type):
-          if objet.nom not in liste_simp_reel :
-             liste_simp_reel.append(objet.nom)
+        if ( 'R' in objet.type):
+            if objet.nom not in liste_simp_reel :
+                liste_simp_reel.append(objet.nom)
 
 def analyseNiveau(cata_ordonne_dico,niveau,liste_simp_reel):
-   """
-       Analyse un niveau dans un catalogue de commandes
-   """
-   if niveau.l_niveaux == ():
-       # Il n'y a pas de sous niveaux
-       for oper in niveau.entites:
-           traiteEntite(oper,liste_simp_reel)
-           cata_ordonne_dico[oper.nom]=oper
-   else:
-       for niv in niveau.l_niveaux:
-           analyseNiveau(cata_ordonne_dico,niv)
-  
+    """
+        Analyse un niveau dans un catalogue de commandes
+    """
+    if niveau.l_niveaux == ():
+        # Il n'y a pas de sous niveaux
+        for oper in niveau.entites:
+            traiteEntite(oper,liste_simp_reel)
+            cata_ordonne_dico[oper.nom]=oper
+    else:
+        for niv in niveau.l_niveaux:
+            analyseNiveau(cata_ordonne_dico,niv)
+
 def analyseCatalogue(cata):
-   """
-      Cette fonction analyse le catalogue cata pour construire avec l'aide
-      de traiteEntite la structure de donnees ordre_mc qui donne l'ordre
-      d'apparition des mots cles dans le catalogue
-      Elle retourne un dictionnaire qui contient toutes les commandes
-      du catalogue indexees par leur nom
-   """
-   cata_ordonne_dico={}
-   liste_simp_reel=[]
-   if cata.JdC.l_niveaux == ():
-       # Il n'y a pas de niveaux
-       for oper in cata.JdC.commandes:
-           traiteEntite(oper,liste_simp_reel)
-           cata_ordonne_dico[oper.nom]=oper
-   else:
-       for niv in cata.JdC.l_niveaux:
-           analyseNiveau(cata_ordonne_dico,niv,liste_simp_reel)
-   return cata_ordonne_dico,liste_simp_reel
+    """
+       Cette fonction analyse le catalogue cata pour construire avec l'aide
+       de traiteEntite la structure de donnees ordre_mc qui donne l'ordre
+       d'apparition des mots cles dans le catalogue
+       Elle retourne un dictionnaire qui contient toutes les commandes
+       du catalogue indexees par leur nom
+    """
+    cata_ordonne_dico={}
+    liste_simp_reel=[]
+    if cata.JdC.l_niveaux == ():
+        # Il n'y a pas de niveaux
+        for oper in cata.JdC.commandes:
+            traiteEntite(oper,liste_simp_reel)
+            cata_ordonne_dico[oper.nom]=oper
+    else:
+        for niv in cata.JdC.l_niveaux:
+            analyseNiveau(cata_ordonne_dico,niv,liste_simp_reel)
+    return cata_ordonne_dico,liste_simp_reel
 
 
 if __name__ == "__main__" :
-   from Cata import cata_STA6
-   dico=analyseCatalogue(cata_STA6)
-   #import cata_saturne
-   #dico=analyseCatalogue(cata_saturne)
+    from Cata import cata_STA6
+    dico=analyseCatalogue(cata_STA6)
+    #import cata_saturne
+    #dico=analyseCatalogue(cata_saturne)
 
-   def print_entite(entite,dec='  '):
-       print (dec,entite.nom,entite.__class__.__name__)
-       for mocle in entite.ordre_mc:
-          print_entite(entite.entites[mocle],dec=dec+'  ')
+    def print_entite(entite,dec='  '):
+        print (dec,entite.nom,entite.__class__.__name__)
+        for mocle in entite.ordre_mc:
+            print_entite(entite.entites[mocle],dec=dec+'  ')
 
-   for k,v in list(dico.items()):
-      print_entite(v,dec='')
+    for k,v in list(dico.items()):
+        print_entite(v,dec='')
 
-   print (dico)
+    print (dico)
index 3cc104a360dad9732dc012d120919705d5bed90e..65fc785ce6d5256d5d735da4b7b8b82cb83d6dfd 100644 (file)
@@ -17,7 +17,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 try :
-  from builtins import object
+    from builtins import object
 except : pass
 
 class STYLE(object):
index 4bf5bb1f70cbd7234055e72455e7b171077b0f8a..516c8a59b48cefdf2fdbcabce6882f3182c4d658 100755 (executable)
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-  from builtins import str
-  from builtins import object
+    from builtins import str
+    from builtins import object
 except :
-  pass
+    pass
 import sys,os
 sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..'))
 sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../InterfaceQT4'))
@@ -46,64 +46,60 @@ def prettify(elem):
     reparsed = minidom.parseString(rough_string)
     return reparsed.toprettyxml(indent="  ")
 
-                
+
 class CatalogueXML(object):
-        def __init__(self,cata,cataName):
-                self.fichier="/tmp/XML/"+cataName+".xml"
-                self.cata=cata
-                self.first=ET.Element('cata')
-                comment=ET.Comment("catalogue "+str(cataName))
-                self.first.append(comment)
-                self.reglesUtilisees=[]
-                self.validatorsUtilises=[]
-                self.constrListTxtCmd()
-                self.ecrire_fichier()
-
-
-        def ecrire_fichier(self):
-                try :
-                   import codecs
-                  f = codecs.open(self.fichier, "w", "ISO-8859-1")
-                   #print prettify(self.first)
-                   f.write(prettify(self.first))
-                   f.close()
-                except :
-                   print(("Impossible d'ecrire le fichier : "+ str(self.fichier)))
-
-        def constrListTxtCmd(self):
-                mesCommandes=self.cata.JdC.commandes
-                self.commandes=ET.SubElement(self.first,'commandes')
-                for maCommande in mesCommandes:
-                    maCommande.enregistreXMLStructure(self.commandes,self)
+    def __init__(self,cata,cataName):
+        self.fichier="/tmp/XML/"+cataName+".xml"
+        self.cata=cata
+        self.first=ET.Element('cata')
+        comment=ET.Comment("catalogue "+str(cataName))
+        self.first.append(comment)
+        self.reglesUtilisees=[]
+        self.validatorsUtilises=[]
+        self.constrListTxtCmd()
+        self.ecrire_fichier()
+
+
+    def ecrire_fichier(self):
+        try :
+            import codecs
+            f = codecs.open(self.fichier, "w", "ISO-8859-1")
+            #print prettify(self.first)
+            f.write(prettify(self.first))
+            f.close()
+        except :
+            print(("Impossible d'ecrire le fichier : "+ str(self.fichier)))
+
+    def constrListTxtCmd(self):
+        mesCommandes=self.cata.JdC.commandes
+        self.commandes=ET.SubElement(self.first,'commandes')
+        for maCommande in mesCommandes:
+            maCommande.enregistreXMLStructure(self.commandes,self)
 
 
 if __name__ == "__main__" :
-       #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
-       #monCata="/local/noyret/Install_Eficas/Aster/Cata/cataSTA11/cata.py"
-       #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
-       #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
-        code="Aster"
-        version=None
-
-        from Editeur  import session
-        options=session.parse(sys.argv)
-        if options.code!= None :    code=options.code
-        if options.cata!= None : monCata=options.cata
-        if options.ssCode!= None :  ssCode=options.ssCode
-
-        sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..',code))
-
-        from InterfaceQT4.ssIhm  import QWParentSSIhm, appliEficasSSIhm
-        Eficas=appliEficasSSIhm(code=code)
-        parent=QWParentSSIhm(code,Eficas,version)
-
-        import readercata
-        monreadercata  = readercata.READERCATA( parent, parent )
-        Eficas.readercata=monreadercata
-        monCata=monreadercata.cata
-
-        monCataXML=CatalogueXML(monCata,code)
-
-
-
-
+    #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
+    #monCata="/local/noyret/Install_Eficas/Aster/Cata/cataSTA11/cata.py"
+    #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
+    #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
+    code="Aster"
+    version=None
+
+    from Editeur  import session
+    options=session.parse(sys.argv)
+    if options.code!= None :    code=options.code
+    if options.cata!= None : monCata=options.cata
+    if options.ssCode!= None :  ssCode=options.ssCode
+
+    sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..',code))
+
+    from InterfaceQT4.ssIhm  import QWParentSSIhm, appliEficasSSIhm
+    Eficas=appliEficasSSIhm(code=code)
+    parent=QWParentSSIhm(code,Eficas,version)
+
+    import readercata
+    monreadercata  = readercata.READERCATA( parent, parent )
+    Eficas.readercata=monreadercata
+    monCata=monreadercata.cata
+
+    monCataXML=CatalogueXML(monCata,code)
index 78d112d152d8d9c84e00defa3e207e933e38774b..3a30d15933eb54f05ab8837c27a67f2f40e9ce34 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 try :
-   from builtins import object
+    from builtins import object
 except : pass
 
 class CatalogDescription(object):
-    
+
     def __init__(self, labelCode, fichierCata, formatFichierOut = "python", formatFichierIn='python',
-                 default = False, code = None,ss_code=None,):
+                 default = False, code = None,ssCode=None, selectable = True, userName=None):
         """
         This class can be used to describe an Eficas catalog.
 
         :type  labelCode: string
         :param labelCode: unique labelCode for the catalog
-                
+
         :type  fichierCata: string
         :param fichierCata: path of the file containing the catalog itself
-                
+
         :type  fileFormatOut: string
         :param fileFormatOut: format of the files generated when using this catalog
-                
+
         :type  default: boolean
         :param default: indicate if this catalog is the default one (appear on the top of the catalogs list)
-                
+
         :type  code: string
         :param code: Used to indicate the code associated to this catalog
-                
-        :type  ss_code: string
-        :param ss_code: scheme associated to this catalog (Map only)
 
-                
+        :type  ssCode: string
+        :param ssCode: scheme associated to this catalog (Map only)
+
+        :type  userName: string
+        :param userName: name of the catalog as it will appear in the list
+
+        :type  selectable: boolean
+        :param selectable: indicate if this catalog appears in the list.
+                           Setting this parameter to False is useful to keep
+                           old catalogs to edit existing files but to forbid
+                           to use them to create new files.
+
+
+
+
         """
 
         self.labelCode = labelCode
         self.fichierCata = fichierCata
         self.formatFichierOut = formatFichierOut
-        self.formatFichierIn = formatFichierIn 
+        self.formatFichierIn = formatFichierIn
         self.default = default
         self.code = code
+        self.ssCode = ssCode
+        if userName is None:
+            self.userName = labelCode
+        else:
+            self.userName = userName
+        self.selectable = selectable
+
 
     @staticmethod
     def createFromTuple(cataTuple):
         #print "Warning: Describing a catalog with a tuple is deprecated. " \
         #      "Please create a CatalogDescription instance directly."
+        if cataTuple[0] == 'TELEMAC':
+            desc = CatalogDescription(code = cataTuple[0],
+                                      ssCode = cataTuple[1],
+                                      labelCode = cataTuple[0]+cataTuple[1],
+                                      fichierCata = cataTuple[2],
+                                      formatFichierOut = cataTuple[3],
+                                      formatFichierIn = cataTuple[4])
+            return desc
         if cataTuple[0] == 'MAP' :
-           desc = CatalogDescription(code = cataTuple[0],
-                                  labelCode = cataTuple[1],
-                                  fichierCata = cataTuple[2],
-                                  ssCode      = cataTuple[3],
-                                  formatFichierOut = 'MAP',
-                                  formatFichierIn  = 'MAP')
+            desc = CatalogDescription(code = cataTuple[0],
+                                   labelCode = cataTuple[1],
+                                   fichierCata = cataTuple[2],
+                                   ssCode      = cataTuple[3],
+                                   formatFichierOut = 'MAP',
+                                   formatFichierIn  = 'MAP')
         elif len(cataTuple) == 4:
-           desc = CatalogDescription(code = cataTuple[0],
-                                  labelCode = cataTuple[1],
-                                  fichierCata = cataTuple[2],
-                                  formatFichierOut = cataTuple[3],
-                                  formatFichierIn  = 'python')
-        elif len(cataTuple) == 5 : 
-           desc = CatalogDescription(code = cataTuple[0],
-                                  labelCode = cataTuple[1],
-                                  fichierCata = cataTuple[2],
-                                  formatFichierOut = cataTuple[3],
-                                  formatFichierIn  = cataTuple[4])
-        elif len(cataTuple) == 6 : 
-           desc = CatalogDescription(code = cataTuple[0],
-                                  labelCode = cataTuple[1],
-                                  fichierCata = cataTuple[2],
-                                  formatFichierOut = cataTuple[3],
-                                  formatFichierIn  = cataTuple[4],
-                                  defaut=cataTuple[5])
-        else : 
-           print ('pb a la description du catalogue avec les donnees')
-           print (cataTuple)
-           desc=None
-        
+            desc = CatalogDescription(code = cataTuple[0],
+                                   labelCode = cataTuple[1],
+                                   fichierCata = cataTuple[2],
+                                   formatFichierOut = cataTuple[3],
+                                   formatFichierIn  = 'python')
+        elif len(cataTuple) == 5 :
+            desc = CatalogDescription(code = cataTuple[0],
+                                   labelCode = cataTuple[1],
+                                   fichierCata = cataTuple[2],
+                                   formatFichierOut = cataTuple[3],
+                                   formatFichierIn  = cataTuple[4])
+        elif len(cataTuple) == 6 :
+            desc = CatalogDescription(code = cataTuple[0],
+                                   labelCode = cataTuple[1],
+                                   fichierCata = cataTuple[2],
+                                   formatFichierOut = cataTuple[3],
+                                   formatFichierIn  = cataTuple[4],
+                                   defaut=cataTuple[5])
+        else :
+            print ('pb a la description du catalogue avec les donnees')
+            print (cataTuple)
+            desc=None
+
         return desc
index 8aaa24ba032d78bae5ffe962b6bece201caa5b28..3349c1a1d1d2c82b9fb306b15295fa02b0054e35 100755 (executable)
@@ -30,48 +30,44 @@ import Accas
 
 
 class ChercheInto:
-        def __init__(self,cata,cataName):
-                self.cata=cata
-                self.dictInto={}
-                mesCommandes=self.cata.JdC.commandes
-                for maCommande in mesCommandes:
-                    self.construitListeInto(maCommande)
+    def __init__(self,cata,cataName):
+        self.cata=cata
+        self.dictInto={}
+        mesCommandes=self.cata.JdC.commandes
+        for maCommande in mesCommandes:
+            self.construitListeInto(maCommande)
 
 
-        def construitListeInto(self,e):
-            if isinstance(e,Accas.A_BLOC.BLOC) :
-               print (e.condition)
-            for nomFils, fils in e.entites.items():
-                self.construitListeInto(fils)
+    def construitListeInto(self,e):
+        if isinstance(e,Accas.A_BLOC.BLOC) :
+            print (e.condition)
+        for nomFils, fils in e.entites.items():
+            self.construitListeInto(fils)
 
 
 if __name__ == "__main__" :
-       #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
-       #monCata="/local/noyret/Install_Eficas/Aster/Cata/cataSTA11/cata.py"
-       #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
-       #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
-        code="Aster"
-        version=None
-
-        from Editeur  import session
-        options=session.parse(sys.argv)
-        if options.code!= None :    code=options.code
-        if options.cata!= None : monCata=options.cata
-        if options.ssCode!= None :  ssCode=options.ssCode
-
-        sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..',code))
-
-        from InterfaceQT4.ssIhm  import QWParentSSIhm, appliEficasSSIhm
-        Eficas=appliEficasSSIhm(code=code)
-        parent=QWParentSSIhm(code,Eficas,version)
-
-        import readercata
-        monreadercata  = readercata.READERCATA( parent, parent )
-        Eficas.readercata=monreadercata
-        monCata=monreadercata.cata
-
-        monConstruitInto=ChercheInto(monCata,code)
-
-
-
-
+    #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
+    #monCata="/local/noyret/Install_Eficas/Aster/Cata/cataSTA11/cata.py"
+    #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
+    #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
+    code="Aster"
+    version=None
+
+    from Editeur  import session
+    options=session.parse(sys.argv)
+    if options.code!= None :    code=options.code
+    if options.cata!= None : monCata=options.cata
+    if options.ssCode!= None :  ssCode=options.ssCode
+
+    sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..',code))
+
+    from InterfaceQT4.ssIhm  import QWParentSSIhm, appliEficasSSIhm
+    Eficas=appliEficasSSIhm(code=code)
+    parent=QWParentSSIhm(code,Eficas,version)
+
+    import readercata
+    monreadercata  = readercata.READERCATA( parent, parent )
+    Eficas.readercata=monreadercata
+    monCata=monreadercata.cata
+
+    monConstruitInto=ChercheInto(monCata,code)
index 3dcec6048a17ab9421444aadd592b6fb499a86ec..238903313a6a6a27743400dcd56c80ed3d416caf 100755 (executable)
@@ -30,14 +30,14 @@ import Accas
 
 
 class ChercheInto:
-        def __init__(self,cata,cataName):
-                self.cata=cata
-                self.dictInto={}
-                mesCommandes=self.cata.JdC.commandes
-                for maCommande in mesCommandes:
-                    print (maCommande.nom)
-                    print (maCommande.entites )
-                    print (len(maCommande.entites) )
+    def __init__(self,cata,cataName):
+        self.cata=cata
+        self.dictInto={}
+        mesCommandes=self.cata.JdC.commandes
+        for maCommande in mesCommandes:
+            print (maCommande.nom)
+            print (maCommande.entites )
+            print (len(maCommande.entites) )
 
 
 #        def construitListeInto(self,e):
@@ -48,32 +48,28 @@ class ChercheInto:
 
 
 if __name__ == "__main__" :
-       #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
-       #monCata="/local/noyret/Install_Eficas/Aster/Cata/cataSTA11/cata.py"
-       #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
-       monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
-        code="MAP"
-        version=None
-
-        from Editeur  import session
-        options=session.parse(sys.argv)
-        if options.code!= None :    code=options.code
-        if options.cata!= None : monCata=options.cata
-        if options.ssCode!= None :  ssCode=options.ssCode
-
-        sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..',code))
-
-        from InterfaceQT4.ssIhm  import QWParentSSIhm, appliEficasSSIhm
-        Eficas=appliEficasSSIhm(code=code)
-        parent=QWParentSSIhm(code,Eficas,version)
-
-        import readercata
-        monreadercata  = readercata.READERCATA( parent, parent )
-        Eficas.readercata=monreadercata
-        monCata=monreadercata.cata
-
-        monConstruitInto=ChercheInto(monCata,code)
-
-
-
-
+    #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
+    #monCata="/local/noyret/Install_Eficas/Aster/Cata/cataSTA11/cata.py"
+    #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
+    monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
+    code="MAP"
+    version=None
+
+    from Editeur  import session
+    options=session.parse(sys.argv)
+    if options.code!= None :    code=options.code
+    if options.cata!= None : monCata=options.cata
+    if options.ssCode!= None :  ssCode=options.ssCode
+
+    sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..',code))
+
+    from InterfaceQT4.ssIhm  import QWParentSSIhm, appliEficasSSIhm
+    Eficas=appliEficasSSIhm(code=code)
+    parent=QWParentSSIhm(code,Eficas,version)
+
+    import readercata
+    monreadercata  = readercata.READERCATA( parent, parent )
+    Eficas.readercata=monreadercata
+    monCata=monreadercata.cata
+
+    monConstruitInto=ChercheInto(monCata,code)
index a9470638b8d12508d7d61964e1b3ff607a90e542..c802862ce1ce8bd23f1e95478d2539ad3e0dfd53 100644 (file)
@@ -35,7 +35,7 @@ from __future__ import absolute_import
 import os,glob,types
 
 # Dictionnaire {object : item} permettant d'associer un item a un object
-# Ce dictionnaire est renseigne par la methode chargerComposants 
+# Ce dictionnaire est renseigne par la methode chargerComposants
 composants = {}
 
 def chargerComposants(Ihm="QT"):
@@ -61,25 +61,25 @@ def gettreeitem(object):
       Cette classe item depend bien sur de la nature de object, d'ou
       l'interrogation du dictionnaire composants
     """
-    # Si la definition de l'objet a un attribut itemeditor, il indique 
+    # Si la definition de l'objet a un attribut itemeditor, il indique
     # la classe a utiliser pour l'item
     try:
-       return object.definition.itemeditor
+        return object.definition.itemeditor
     except:
-       pass
+        pass
 
     # On cherche ensuite dans les composants (plugins)
     try:
-       itemtype= composants[object.__class__]
-       return itemtype
+        itemtype= composants[object.__class__]
+        return itemtype
     except:
-       pass
+        pass
 
     # Puis une eventuelle classe heritee (aleatoire car sans ordre)
     for e in list(composants.keys()):
         if e and isinstance(object,e):
-           itemtype= composants[e]
-           return itemtype
+            itemtype= composants[e]
+            return itemtype
 
     # Si on n'a rien trouve dans les composants on utilise l'objet par defaut
     itemtype=composants[None]
@@ -92,4 +92,3 @@ def makeObjecttreeitem(appliEficas,labeltext, object, setFunction=None):
     """
     c = gettreeitem(object)
     return c(appliEficas,labeltext, object, setFunction)
-
index 1c2b2439168995d32db43f4343969438f231dfb9..ab0c8b8d893d6f5363e527ff01cfb642451133e3 100644 (file)
@@ -32,4 +32,3 @@ standard12_gras = ("Times",12,'bold')
 standard12_gras_italique = ( "times",12,'bold','italic')
 
 standardcourier10 = ("Courier",10)
-
index 35df462fb5fc54fdcc8afa112058ca913d8c0de5..c9295e8485b1028ea0d87cfd6b77d72ad826d379 100644 (file)
@@ -18,7 +18,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-    Ce module realise toutes les mises a jour du chemin pour 
+    Ce module realise toutes les mises a jour du chemin pour
     les imports de modules Python
 """
 from __future__ import absolute_import
@@ -34,10 +34,10 @@ INSTALLDIR=prefs_Code.INSTALLDIR
 # representant le code utilise (si fourni)
 # Ensuite on utilise les packages de l'intallation
 if hasattr(prefs_Code,'CODE_PATH'):
-   if prefs_Code.CODE_PATH:
-      sys.path[:0]=[prefs_Code.CODE_PATH]
-      import Noyau,Validation
-      del sys.path[0]
+    if prefs_Code.CODE_PATH:
+        sys.path[:0]=[prefs_Code.CODE_PATH]
+        import Noyau,Validation
+        del sys.path[0]
 sys.path[:0]=[prefs_Code.INSTALLDIR]
 
 import Accas
index 3caea635bae8ca74e0ebd7f4f632a28d58c411fb..4300311367b91ef1e7a56e116e430b7aad421848 100644 (file)
 #
 from __future__ import absolute_import
 try :
-   from builtins import object
+    from builtins import object
 except : pass
 import os
 import re
 
 sous_menus={
-#          "OPENTURNS_STUDY" : {0:{"Essai":"Std.comm"}},
+#           "OPENTURNS_STUDY" : {0:{"Essai":"Std.comm"}},
 #            "OPENTURNS_WRAPPER" : {0:{"Essai":"wrapper_exemple.comm"}},
            }
 
 class listePatrons(object) :
 
     def __init__(self,code = "ASTER"):
-       repIni=os.path.dirname(os.path.abspath(__file__))
-       self.rep_patrons=repIni+"/Patrons/"+code
-       self.sous_menu={}
-       if code in sous_menus  :
-          self.sous_menu=sous_menus[code]
-       self.code=code
-       self.liste={}
-       self.traiteListe()
+        repIni=os.path.dirname(os.path.abspath(__file__))
+        self.rep_patrons=repIni+"/Patrons/"+code
+        self.sous_menu={}
+        if code in sous_menus  :
+            self.sous_menu=sous_menus[code]
+        self.code=code
+        self.liste={}
+        self.traiteListe()
 
     def traiteListe(self):
         if not (self.code in sous_menus) : return
@@ -48,8 +48,8 @@ class listePatrons(object) :
                 clef=list(self.sous_menu[i].keys())[0]
                 chaine=self.sous_menu[i][clef]
                 if re.search(chaine,file) :
-                   if clef in self.liste:
-                      self.liste[clef].append(file)
-                   else :
-                      self.liste[clef]=[file]
-                   break
+                    if clef in self.liste:
+                        self.liste[clef].append(file)
+                    else :
+                        self.liste[clef]=[file]
+                    break
index bd96e83b7eba3b305f70520333fe8293845d72e1..2fd87c62475a92da8481fac43fdc904b1360f5c2 100644 (file)
@@ -28,7 +28,7 @@ Un exemple typique d'utilisation est :
 
 qui demande a l'application d'ouvrir trois jeux de commandes.
 
-Le premier (aa) a un include (11,iii) et est la suite du fichier poursuite ppp 
+Le premier (aa) a un include (11,iii) et est la suite du fichier poursuite ppp
 qui a lui meme un include (22,ii).
 
 Le deuxieme bb est un jeu de commandes simple.
@@ -37,7 +37,7 @@ Le troisieme est decrit dans le fichier ff de type .ini
 qui est parse par le module Configparser.
 Chaque section du fichier decrit un jeu de commandes.
 Un include est specifie par: numero logique=nom du fichier
-Une poursuite est specifiee par: poursuite=reference a un jeu de commande 
+Une poursuite est specifiee par: poursuite=reference a un jeu de commande
 Cette reference correspond a un nom de section decrivant le jeu de commandes.
 Le jeu de commandes maitre est donne par l'entree globale jdc dans la section jdc.
 
@@ -58,15 +58,15 @@ La session utilisera le catalogue V7.3 en mode debug.
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-  from builtins import str
+    from builtins import str
 except :
-  pass
+    pass
 try:
-   import optparse
-   from optparse import OptionValueError
+    import optparse
+    from optparse import OptionValueError
 except:
-   from Tools import optparse
-   from Tools.optparse import OptionValueError
+    from Tools import optparse
+    from Tools.optparse import OptionValueError
 
 import os,traceback
 import six.moves.configparser
@@ -88,7 +88,7 @@ d_env={}
 #
 #
 #
-# Les informations (dictionnaire) associees au fichier de commandes en cours de traitement 
+# Les informations (dictionnaire) associees au fichier de commandes en cours de traitement
 # sont stockees dans parser.values.current
 # En general, il faut utiliser current et pas parser.values.studies car les informations
 # sont stockees hierarchiquement
@@ -96,10 +96,10 @@ d_env={}
 
 def checkComm(option, opt_str, value, parser):
     if not hasattr(parser.values,"studies"):
-       parser.values.studies=[]
-       parser.values.comm=[]
+        parser.values.studies=[]
+        parser.values.comm=[]
     if not os.path.isfile(value):
-       raise OptionValueError(tr("le fichier de commandes %s n'existe pas", value))
+        raise OptionValueError(tr("le fichier de commandes %s n'existe pas", value))
     parser.values.comm.append(value)
     d_study={"comm":value}
     parser.values.current=d_study
@@ -107,9 +107,9 @@ def checkComm(option, opt_str, value, parser):
 
 def checkPoursuite(option, opt_str, value, parser):
     if parser.values.comm is None:
-       raise OptionValueError(tr("un fichier de commandes doit etre defini avant une poursuite %s", value))
+        raise OptionValueError(tr("un fichier de commandes doit etre defini avant une poursuite %s", value))
     if not os.path.isfile(value):
-       raise OptionValueError(tr("le fichier poursuite %s n'existe pas", value))
+        raise OptionValueError(tr("le fichier poursuite %s n'existe pas", value))
     #current : fichier de commandes en cours de traitement (dictionnaire des infos)
     comm=parser.values.current
     d_study={"comm":value}
@@ -118,17 +118,17 @@ def checkPoursuite(option, opt_str, value, parser):
 
 def checkInclude(option, opt_str, value, parser):
     try:
-       args=[int(parser.rargs[0]),parser.rargs[1]]
+        args=[int(parser.rargs[0]),parser.rargs[1]]
     except:
-       raise OptionValueError(tr("include mal defini %s", parser.rargs[0:2]))
+        raise OptionValueError(tr("include mal defini %s", parser.rargs[0:2]))
 
     del parser.rargs[0]
     del parser.rargs[0]
 
     if parser.values.comm is None:
-       raise OptionValueError(tr("un fichier de commandes doit etre defini avant un include %s", args))
+        raise OptionValueError(tr("un fichier de commandes doit etre defini avant un include %s", args))
     if not os.path.isfile(args[1]):
-       raise OptionValueError(tr("le fichier include %s n'existe pas", args[1]))
+        raise OptionValueError(tr("le fichier include %s n'existe pas", args[1]))
 
     comm=parser.values.current
     comm[args[0]]=args[1]
@@ -148,75 +148,75 @@ def checkJdc(config,jdc,parser,fich):
     d_study={}
 
     for o in config.options(jdc):
-       if o == "poursuite":
-          p=config.get(jdc,"poursuite")
-
-          if not config.has_option(p,"comm"):
-             raise OptionValueError(tr(" jdc %(v_1)s manque \
-                                      fichier comm dans section %(v_2)s", \
-                                      {'v_1': fich, 'v_2': p}))
-          comm=config.get(p,"comm")
-          if not os.path.isfile(comm):
-             raise OptionValueError(tr("jdc %(v_1)s, le fichier\
-                                      de commandes %(v_2)s n'existe pas", \
-                                      {'v_1': fich, 'v_2': comm}))
-
-          pours=checkJdc(config,p,parser,fich)
-          pours["comm"]=comm
-          d_study["pours"]=pours
-          continue
-
-       try:
-          unit=int(o)
-          # si le parametre est un entier, il s'agit d'un include
-          inc=config.get(jdc,o)
-       except EficasException:
-          continue
-       if not os.path.isfile(inc):
-          raise OptionValueError(tr(" jdc %(v_1)s \
-                                   fichier include %(v_2)s, %(v_3)s \
-                                   n'existe pas", \
-                                   {'v_1': fich, 'v_2': unit, 'v_3': inc}))
-       d_study[unit]=inc
+        if o == "poursuite":
+            p=config.get(jdc,"poursuite")
+
+            if not config.has_option(p,"comm"):
+                raise OptionValueError(tr(" jdc %(v_1)s manque \
+                                         fichier comm dans section %(v_2)s", \
+                                         {'v_1': fich, 'v_2': p}))
+            comm=config.get(p,"comm")
+            if not os.path.isfile(comm):
+                raise OptionValueError(tr("jdc %(v_1)s, le fichier\
+                                         de commandes %(v_2)s n'existe pas", \
+                                         {'v_1': fich, 'v_2': comm}))
+
+            pours=checkJdc(config,p,parser,fich)
+            pours["comm"]=comm
+            d_study["pours"]=pours
+            continue
+
+        try:
+            unit=int(o)
+            # si le parametre est un entier, il s'agit d'un include
+            inc=config.get(jdc,o)
+        except EficasException:
+            continue
+        if not os.path.isfile(inc):
+            raise OptionValueError(tr(" jdc %(v_1)s \
+                                     fichier include %(v_2)s, %(v_3)s \
+                                     n'existe pas", \
+                                     {'v_1': fich, 'v_2': unit, 'v_3': inc}))
+        d_study[unit]=inc
 
     return d_study
 
 def checkFich(option, opt_str, fich, parser):
     """
         Fonction : parse le fichier fich (format .ini)
-        
+
         option : option en cours de traitement
         opt_str : chaine de caracteres utilisee par l'utilisateur
         fich : nom du fichier .ini donne par l'utilisateur
         parser : objet parseur des options de la ligne de commande
     """
     if not os.path.isfile(fich):
-       raise OptionValueError(tr(" le fichier jdc %s n'existe pas", str(fich)))
+        raise OptionValueError(tr(" le fichier jdc %s n'existe pas", str(fich)))
     if parser.values.fich is None:
-       parser.values.fich=[]
+        parser.values.fich=[]
     parser.values.fich.append(fich)
     if not hasattr(parser.values,"studies"):
-       parser.values.studies=[]
-       parser.values.comm=[]
-   # Python 2 to 3
+        parser.values.studies=[]
+        parser.values.comm=[]
+    # Python 2 to 3
     try :
-     import ConfigParser
-     config=ConfigParser.ConfigParser()
+        import ConfigParser
+        config=ConfigParser.ConfigParser()
     except :
-     import configparser
-     config=configparser.configparser()
+        import configparser
+        config=configparser.configparser()
     config.read([fich])
     if not config.has_option(u"jdc","jdc"):
-       raise OptionValueError(tr(" jdc %s manque option jdc dans section jdc", str(fich)))
+        raise OptionValueError(tr(" jdc %s manque option jdc dans section jdc", str(fich)))
     jdc=config.get(u"jdc","jdc")
 
     if not config.has_option(jdc,"comm"):
-       raise OptionValueError(tr(" jdc %(v_1)s manque fichier comm \
-                                dans section %(v_2)s", {'v_1': fich, 'v_2': jdc}))
+        raise OptionValueError(tr(" jdc %(v_1)s manque fichier comm \
+                                 dans section %(v_2)s", {'v_1': fich, 'v_2': jdc}))
     comm=config.get(jdc,"comm")
     if not os.path.isfile(comm):
-       raise OptionValueError(tr("jdc %(v_1)s, le fichier de commandes \
-                                %(v_2)s n'existe pas", {'v_1': fich, 'v_2': comm}))
+        raise OptionValueError(tr("jdc %(v_1)s, le fichier de commandes \
+                                 %(v_2)s n'existe pas", {'v_1': fich, 'v_2': comm}))
     parser.values.comm.append(comm)
 
     d_study=checkJdc(config,jdc,parser,fich)
@@ -226,19 +226,19 @@ def checkFich(option, opt_str, fich, parser):
 def printPours(d_pours,dec=''):
     # Les fichiers includes d'abord
     for k,v in list(d_pours.items()):
-       if k in (u"pours","comm"):continue
-       print(( tr("%(v_1)s include %(v_2)s : %(v_3)s", {'v_1': str(dec), 'v_2': str(k), 'v_3': str(v)})))
+        if k in (u"pours","comm"):continue
+        print(( tr("%(v_1)s include %(v_2)s : %(v_3)s", {'v_1': str(dec), 'v_2': str(k), 'v_3': str(v)})))
 
     if "pours" in d_pours:
-       # Description de la poursuite
-       print((tr("%(v_1)s fichier poursuite: %(v_2)s", {'v_1': dec, 'v_2': d_pours["pours"]["comm"]})))
-       printPours(d_pours["pours"],dec=dec+"++")
+        # Description de la poursuite
+        print((tr("%(v_1)s fichier poursuite: %(v_2)s", {'v_1': dec, 'v_2': d_pours["pours"]["comm"]})))
+        printPours(d_pours["pours"],dec=dec+"++")
 
 def printDEnv():
     if d_env.studies is None:return
     for study in d_env.studies:
-       print((tr("nom etude : %s", study["comm"])))
-       printPours(study,dec="++")
+        print((tr("nom etude : %s", study["comm"])))
+        printPours(study,dec="++")
 
 def createparser():
     # creation du parser des options de la ligne de commande
@@ -253,7 +253,7 @@ def createparser():
                   action="callback", callback=checkPoursuite,
                   help=tr("nom du fichier poursuite"))
 
-    parser.add_option(u"-i","--include", 
+    parser.add_option(u"-i","--include",
                   action="callback", callback=checkInclude,
                   nargs=2, help=tr("numero d'unite suivi du nom du fichier include"))
 
@@ -264,6 +264,9 @@ def createparser():
     parser.add_option(u"-c","--cata", action="store", type="string",dest="fichierCata",
                   help=tr("catalogue a utiliser"))
 
+    parser.add_option(u"-o","--fichierXMLOut", action="store", type="string",dest="fichierXMLOut",
+                  help=tr("nom du fichier xml genere"))
+
     parser.add_option(u"-v","--label", action="store", type="string",dest="labelCode",
                   help=tr("version de catalogue a utiliser"))
 
@@ -295,23 +298,24 @@ def parse(args):
     parser=createparser()
     (options,args)=parser.parse_args(args[1:])
     if not hasattr(options,"studies"):
-       options.studies=[]
-       options.comm=[]
+        options.studies=[]
+        options.comm=[]
     if not hasattr(options,"fichierCata"): options.fichierCata=None
     if not hasattr(options,"labelCode"): options.labelCode=None
+    if not hasattr(options,"fichierXMLOut"): options.fichierXMLOut=None
     if options.withXSD :
-       try : import pyxb
-       except : print ('Please, source pyxb environment'); exit()
+        try : import pyxb
+        except : print ('Please, source pyxb environment'); exit()
     try:
-       del parser.values.current
+        del parser.values.current
     except:
-       pass
+        pass
     for file in args:
-         if os.path.isfile(file):
+        if os.path.isfile(file):
             options.comm.append(file)
             options.studies.append({"comm":file})
             #print options.studies
-         elif len(args)==1 and (re.search('.comm',file) or re.search('.map',file) or re.search('.cas',file) or re.search('.xml',file)):
+        elif len(args)==1 and (re.search('.comm',file) or re.search('.map',file) or re.search('.cas',file) or re.search('.xml',file)):
             try :
                 f=open(file,'w')
                 f.close()
@@ -319,9 +323,12 @@ def parse(args):
                 parser.error(tr("Nombre incorrect d'arguments"))
             options.comm.append(file)
             options.studies.append({"comm":file})
-         elif len(args) == 1 and options.locale:
-            print((tr("Localisation specifiee pour l'application.")))
-         else:
+        elif len(args) == 2 :
+            if options.locale:
+                print((tr("Localisation specifiee pour l'application.")))
+            else:
+                parser.error(tr("Nombre incorrect d'arguments"))
+        else:
             parser.error(tr("Nombre incorrect d'arguments"))
 
     global d_env
@@ -338,7 +345,7 @@ def getUnit(d_study,appliEficas):
 
                   [None : nom_fichier, texte_source, unites_associees,           # poursuite
                    numero_include : nom_fichier, texte_source, unites_associees, # include
-                    ...] 
+                    ...]
 
        d_study : dictionnaire de l'etude
        appliEficas : objet application EFICAS (permet d'acceder aux services comme getSource)
@@ -348,15 +355,15 @@ def getUnit(d_study,appliEficas):
 def getDunit(d_unit,appliEficas):
     d={}
     if 'pours' in d_unit:
-       # on a une poursuite
-       comm=d_unit["pours"]["comm"]
-       g=getDunit(d_unit["pours"],appliEficas)
-       text=appliEficas.getSource(comm)
-       d[None]=comm,text,g
+        # on a une poursuite
+        comm=d_unit["pours"]["comm"]
+        g=getDunit(d_unit["pours"],appliEficas)
+        text=appliEficas.getSource(comm)
+        d[None]=comm,text,g
 
     for k,v in list(d_unit.items()):
-       if k in (u"pours","comm"): continue
-       text=appliEficas.getSource(v)
-       d[k]=v,text,d
+        if k in (u"pours","comm"): continue
+        text=appliEficas.getSource(v)
+        d[k]=v,text,d
 
     return d
index 3795f5349212885515846c4d643a25e3c48dfdf5..d87ae630706ef03f43f976c72e4a04bc2ee8ec61 100644 (file)
@@ -26,12 +26,10 @@ from basestyle import STYLE,style
 
 inistylefile=os.path.join(prefsCode.repIni,"style.py")
 if os.path.isfile(inistylefile):
-   exec(compile(open(inistylefile).read(), inistylefile, 'exec'))
+    exec(compile(open(inistylefile).read(), inistylefile, 'exec'))
 
 import fontes
 for attr in dir(style):
-   if attr[0]=='_':continue
-   if not hasattr(fontes,attr):continue
-   setattr(fontes,attr,getattr(style,attr))
-
-
+    if attr[0]=='_':continue
+    if not hasattr(fontes,attr):continue
+    setattr(fontes,attr,getattr(style,attr))
index 789fed3367240cad79c9972c8af87b011723d337..5ffe1af947222b22b9d9c2a6960025123969f3ab 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-   Ce module sert a construire les structures de donnees porteuses 
+   Ce module sert a construire les structures de donnees porteuses
    des informations liees aux groupes de commandes
 """
 from __future__ import absolute_import
 import types
 
 class UIINFO:
-   """
-       Pour le moment la classe UIINFO ne sait traiter que des infos
-       portant sur la definition des groupes de commandes
-       Les autres informations sont ignorees
-   """
-   def __init__(self,parent,groupes=None,**args):
-      """
-         Initialiseur de la classe UIINFO.
-         Initialise a partir du dictionnaire UIinfo passe a
-         un objet ENTITE les attributs de la classe
-      """
-      # L'attribut parent stocke le lien vers l'objet ENTITE relie a UIINFO
-      self.parent=parent
-      self.groupes=groupes
-      if groupes == None:
-         # L'entite n'a pas de groupe associe. On lui associe le groupe "DEFAUT"
-         self.groupes=("DEFAUT",)
-      if type(self.groupes) != tuple:
-         self.groupes=(self.groupes,)
+    """
+        Pour le moment la classe UIINFO ne sait traiter que des infos
+        portant sur la definition des groupes de commandes
+        Les autres informations sont ignorees
+    """
+    def __init__(self,parent,groupes=None,**args):
+        """
+           Initialiseur de la classe UIINFO.
+           Initialise a partir du dictionnaire UIinfo passe a
+           un objet ENTITE les attributs de la classe
+        """
+        # L'attribut parent stocke le lien vers l'objet ENTITE relie a UIINFO
+        self.parent=parent
+        self.groupes=groupes
+        if groupes == None:
+            # L'entite n'a pas de groupe associe. On lui associe le groupe "DEFAUT"
+            self.groupes=("DEFAUT",)
+        if type(self.groupes) != tuple:
+            self.groupes=(self.groupes,)
 
 def traiteCommande(commande,niveau):
     """
@@ -64,50 +64,47 @@ def traiteCommande(commande,niveau):
         niveau.dict_groupes[grp].append(commande.nom)
 
 def traiteNiveau(niveau):
-   if niveau.l_niveaux == ():
-       # Il n'y a pas de sous niveaux. niveau.entites ne contient que des commandes
-       niveau.dict_groupes={}
-       for oper in niveau.entites:
-           traiteCommande(oper,niveau)
-       # A la fin les cles du dictionnaire dict_groupes donnent la liste des groupes
-       # sans doublon
-       niveau.liste_groupes=list(niveau.dict_groupes.keys())
-       # On ordonne les listes alphabetiquement
-       niveau.liste_groupes.sort()
-       for v in niveau.dict_groupes.values():v.sort()
-       #print niveau.liste_groupes
-       #print niveau.dict_groupes
-   else:
-       for niv in niveau.l_niveaux:
-           traiteNiveau(niv)
+    if niveau.l_niveaux == ():
+        # Il n'y a pas de sous niveaux. niveau.entites ne contient que des commandes
+        niveau.dict_groupes={}
+        for oper in niveau.entites:
+            traiteCommande(oper,niveau)
+        # A la fin les cles du dictionnaire dict_groupes donnent la liste des groupes
+        # sans doublon
+        niveau.liste_groupes=list(niveau.dict_groupes.keys())
+        # On ordonne les listes alphabetiquement
+        niveau.liste_groupes.sort()
+        for v in niveau.dict_groupes.values():v.sort()
+        #print niveau.liste_groupes
+        #print niveau.dict_groupes
+    else:
+        for niv in niveau.l_niveaux:
+            traiteNiveau(niv)
 
 def traite_UIinfo(cata):
-   """
-      Cette fonction parcourt la liste des commandes d'un catalogue (cata)
-      construit les objets UIINFO a partir de l'attribut UIinfo de la commande
-      et construit la liste complete de tous les groupes presents
-   """
-   #dict_groupes["CACHE"]=[]
-   #XXX Ne doit pas marcher avec les niveaux
-   if cata.JdC.l_niveaux == ():
-       # Il n'y a pas de niveaux
-       # On stocke la liste des groupes et leur contenu dans le JdC
-       # dans les attributs liste_groupes et dict_groupes
-       cata.JdC.dict_groupes={}
-       for commande in cata.JdC.commandes:
-           traiteCommande(commande,cata.JdC)
-       # A la fin les cles du dictionnaire dict_groupes donnent la liste des groupes
-       # sans doublon
-       cata.JdC.liste_groupes=list(cata.JdC.dict_groupes.keys())
-       # On ordonne les listes alphabetiquement
-       cata.JdC.liste_groupes.sort()
-       for v in cata.JdC.dict_groupes.values():v.sort()
-       #print cata.JdC.liste_groupes
-       #print cata.JdC.dict_groupes
-   else:
-       # Le catalogue de commandes contient des definitions de niveau
-       for niv in cata.JdC.l_niveaux:
-          traiteNiveau(niv)
-
-
-
+    """
+       Cette fonction parcourt la liste des commandes d'un catalogue (cata)
+       construit les objets UIINFO a partir de l'attribut UIinfo de la commande
+       et construit la liste complete de tous les groupes presents
+    """
+    #dict_groupes["CACHE"]=[]
+    #XXX Ne doit pas marcher avec les niveaux
+    if cata.JdC.l_niveaux == ():
+        # Il n'y a pas de niveaux
+        # On stocke la liste des groupes et leur contenu dans le JdC
+        # dans les attributs liste_groupes et dict_groupes
+        cata.JdC.dict_groupes={}
+        for commande in cata.JdC.commandes:
+            traiteCommande(commande,cata.JdC)
+        # A la fin les cles du dictionnaire dict_groupes donnent la liste des groupes
+        # sans doublon
+        cata.JdC.liste_groupes=list(cata.JdC.dict_groupes.keys())
+        # On ordonne les listes alphabetiquement
+        cata.JdC.liste_groupes.sort()
+        for v in cata.JdC.dict_groupes.values():v.sort()
+        #print cata.JdC.liste_groupes
+        #print cata.JdC.dict_groupes
+    else:
+        # Le catalogue de commandes contient des definitions de niveau
+        for niv in cata.JdC.l_niveaux:
+            traiteNiveau(niv)
index 7954f4d02325531ea8462c7e7735ea4dd7f36076..1c1eaa6bad8282d8d494f3081c276d83f32d0aa9 100755 (executable)
@@ -1,6 +1,23 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
-# cette version ne fonctionne pas bien
+# Copyright (C) 2007-2021   EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 
 import sys,os
@@ -10,7 +27,6 @@ import imp
 from copy import deepcopy, copy
 import traceback
 
-
 # CONTEXT est accessible (__init__.py de Noyau)
 
 #import raw.efficas as efficas
@@ -31,595 +47,736 @@ from .mapDesTypes import Tuple
 PourTraduction = False
 
 from .balisesXSD import *
+
 # -----------------
 class X_definition:
 # -----------------
-
-   def adjoint(self, liste1, liste2):
-       #print ('adjoint', liste1, liste2)
-       l=[]
-       for elt1 in liste1:
-           for elt2 in liste2:
-               newListe=deepcopy(elt1)
-               if  elt2 != []: newListe.append(elt2)
-               l.append(newListe)
-       return l
-
-   def adjointUnMot(self, liste1, mot):
-       l=[]
-       for elt1 in liste1:
-           newListe=deepcopy(elt1)
-           newListe.append(mot)
-           l.append(newListe)
-       return l
-
-   def remplaceListeParContenuEtVide(self, liste1, liste2):
-       listeFinale=[]
-       for elt1 in liste1 :
-         for eltListe in liste2:
-              newListe=deepcopy(elt1)
-              if eltListe!=[] :newListe+=eltListe
-              if newListe not in listeFinale : listeFinale.append(newListe)
-       return listeFinale
-
-   #def remplaceNomListeParContenu(self, liste1, liste2):
-       #print ('remplaceNomListeParContenu', liste1, liste2)
-   #    listeFinale=[]
-   #    for elt1 in liste1 :
-   #      for eltListe in liste2:
-   #           if eltListe == [] : continue
-   #           newListe=deepcopy(elt1)
-   #           if eltListe!=[] :newListe+=eltListe
-   #           listeFinale.append(newListe)
-       #print ('listeFinale', listeFinale)
-   #    return listeFinale
-
-   def fusionne2Listes(self, liste1, liste2):
-       #print ('fusionne2Liste', liste1, liste2)
-       listeFinale=[]
-       for elt1 in liste1 :
-         for eltListe in liste2:
-              newListe=deepcopy(elt1)
-              if eltListe!=[] :newListe.append(eltListe)
-              listeFinale.append(newListe)
-       #print (listeFinale)
-       return listeFinale
-
-   def getNomDuCodeDumpe(self):
-       if hasattr(self,'nomDuCodeDumpe') : return
-       obj=self
-       while ( not hasattr(obj,'nomDuCodeDumpe') ): obj=obj.pere
-       self.nomDuCodeDumpe = obj.nomDuCodeDumpe
-       self.code=obj.code
-       
-   def getXPathComplet(self):
-       obj=self
-       textePath='/'+self.code+":"+self.nom
-       while ( hasattr(obj,'pere') ):
-           obj=obj.pere
-           if isinstance(obj, X_BLOC) : continue 
-           textePath= '/'+ self.code + ":" + obj.nom + textePath
-       textePath='.' + textePath
-       return textePath
-
-   def getXPathSansSelf(self):
-       obj=self
-       textePath=''
-       while ( hasattr(obj,'pere') ):
-           obj=obj.pere
-           if isinstance(obj, X_BLOC) : continue 
-           textePath=  self.code + ":" + obj.nom + '/' + textePath
-       textePath='./'+ self.code + ":" + textePath
-       return textePath
-
-   def getNomCompletAvecBloc(self):
-       obj=self
-       texteNom=self.nom
-       while ( hasattr(obj,'pere') ):
-           texteNom=obj.pere.nom+'_'+texteNom
-           obj=obj.pere
-       return texteNom
-       
-
-   def definitNomDuTypePyxb(self,forceACreer=False):
-       if hasattr(self,'nomDuTypePyxb') : 
-          self.aCreer = False
-          return self.nomDuTypePyxb
-       self.aCreer = True
-       cata = CONTEXT.getCurrentCata() 
-       nom='T_'+self.nom
-       if (hasattr (self, 'nomXML')) and self.nomXML != None : nom='T_'+self.nomXML
-       if not (nom in cata.dictTypesXSD.keys()) :
-          cata.dictTypesXSD[nom] = [self,]
-          self.nomDuTypePyxb=nom
-          return nom
-       self.aCreer = False
-       if nom == 'T_Consigne' : return nom
-       
-       listePossible=cata.dictTypesXSD[nom]
-       indice=0
-       while (indice < len(listePossible)) :
-          objAComparer=listePossible[indice]
-          if self.compare(objAComparer) : 
-             self.nomDuTypePyxb=objAComparer.nomDuTypePyxb
-             return objAComparer.nomDuTypePyxb
-          indice += 1
-       self.aCreer = True
-       cata.dictTypesXSD[nom].append(self)
-       nomAlter='T_'+self.nom+'_'+str(indice)
-       if (hasattr (self, 'nomXML')) and self.nomXML != None : 
-           nomAlter='T_'+self.nomXML+'_'+str(indice)
-       self.nomDuTypePyxb=nomAlter
-       #traceback.print_stack()
-       return nomAlter
+    def adjoint(self, liste1, liste2):
+        #print ('adjoint', liste1, liste2)
+        l=[]
+        for elt1 in liste1:
+            for elt2 in liste2:
+                newListe=deepcopy(elt1)
+                if  elt2 != []: newListe.append(elt2)
+                l.append(newListe)
+        return l
+
+    def adjointUnMot(self, liste1, mot):
+        l=[]
+        for elt1 in liste1:
+            newListe=deepcopy(elt1)
+            newListe.append(mot)
+            l.append(newListe)
+        return l
+
+    def remplaceListeParContenuEtVide(self, liste1, liste2):
+        listeFinale=[]
+        for elt1 in liste1 :
+            for eltListe in liste2:
+                newListe=deepcopy(elt1)
+                if eltListe!=[] :newListe+=eltListe
+                if newListe not in listeFinale : listeFinale.append(newListe)
+        return listeFinale
+
+
+    def fusionne2Listes(self, liste1, liste2):
+        #print ('fusionne2Liste', liste1, liste2)
+        listeFinale=[]
+        for elt1 in liste1 :
+            for eltListe in liste2:
+                newListe=deepcopy(elt1)
+                if eltListe!=[] :newListe.append(eltListe)
+                listeFinale.append(newListe)
+        #print (listeFinale)
+        return listeFinale
+
+    def getNomDuCodeDumpe(self):
+        if hasattr(self,'nomDuCodeDumpe') : return
+        obj=self
+        while ( not hasattr(obj,'nomDuCodeDumpe') ): obj=obj.pere
+        self.nomDuCodeDumpe = obj.nomDuCodeDumpe
+        self.code=obj.code
+
+    def getXPathComplet(self):
+        obj=self
+        textePath='/'+self.code+":"+self.nom
+        while ( hasattr(obj,'pere') ):
+            obj=obj.pere
+            if isinstance(obj, X_BLOC) : continue
+            textePath= '/'+ self.code + ":" + obj.nom + textePath
+        textePath='.' + textePath
+        return textePath
+
+    def getXPathSansSelf(self):
+        obj=self
+        textePath=''
+        while ( hasattr(obj,'pere') ):
+            obj=obj.pere
+            if isinstance(obj, X_BLOC) : continue
+            textePath=  self.code + ":" + obj.nom + '/' + textePath
+        textePath='./'+ self.code + ":" + textePath
+        return textePath
+
+    def getNomCompletAvecBloc(self):
+        obj=self
+        texteNom=self.nom
+        while ( hasattr(obj,'pere') ):
+            texteNom=obj.pere.nom+'_'+texteNom
+            obj=obj.pere
+        return texteNom
+
+    def metAJourPyxb(self,nomDuTypePyxb) :
+        self.aCreer=False
+        self.nomDuTypePyxb=nomDuTypePyxb
+        cata = CONTEXT.getCurrentCata()
+        nom='T_'+self.nom
+        if (hasattr (self, 'nomXML')) and self.nomXML != None : nom='T_'+self.nomXML
+        if not (nom in cata.dictTypesXSD.keys()) :
+            cata.dictTypesXSD[nom] = [self,]
+        else :
+            cata.dictTypesXSD[nom].append(self)
+
+    def definitNomDuTypePyxb(self,forceACreer=False,debug=False):
+        #if self.nom == 'SubgridScaleModel' : debug=True
+        #print ('definitNomDuTypePyxb', self, self.nom,self.nomComplet(),forceACreer)
+        #PNPN
+        if hasattr(self,'nomDuTypePyxb') : self.aCreer = False; return self.nomDuTypePyxb
+        #debug=False
+        if debug : print ('definitNomDuTypePyxb traitement pour ',  self.nom)
+        self.aCreer = True
+        cata = CONTEXT.getCurrentCata()
+        nom='T_'+self.nom
+        if (hasattr (self, 'nomXML')) and self.nomXML != None : nom='T_'+self.nomXML
+        if not (nom in cata.dictTypesXSD.keys()) :
+            if debug : print ('definitNomDuTypePyxb encore jamais traite ',  self.nom , ' a pour type' , nom)
+            cata.dictTypesXSD[nom] = [self,]
+            self.nomDuTypePyxb=nom
+            return nom
+
+        if nom == 'T_Consigne' : return nom
+
+        if not forceACreer :
+            self.aCreer = False
+            listePossible=cata.dictTypesXSD[nom]
+            indice=0
+            while (indice < len(listePossible)) :
+                objAComparer=listePossible[indice]
+                if debug : print (self.compare)
+                if self.compare(objAComparer) :
+                    self.nomDuTypePyxb=objAComparer.nomDuTypePyxb
+                    if debug : print (self, objAComparer)
+                    if debug : print (type(self), type(objAComparer))
+                    if debug : print ('definitNomDuTypePyxb',  self.nom , 'type identique', objAComparer.nomDuTypePyxb )
+                # c est nul pour la comparaison mais cela permet d etre ok dans le dictionnaire passe a Accas
+                    cata.dictTypesXSD[nom].append(self)
+                    if self.label != 'SIMP' :
+                        if objAComparer not in list(cata.dictTypesXSDJumeaux.keys()) : cata.dictTypesXSDJumeaux[objAComparer]=[self,]
+                        else : cata.dictTypesXSDJumeaux[objAComparer].append(self)
+                    return objAComparer.nomDuTypePyxb
+                indice += 1
+        self.aCreer = True
+        cata.dictTypesXSD[nom].append(self)
+        nomAlter='T_'+self.nom+'_'+str(indice)
+        if (hasattr (self, 'nomXML')) and self.nomXML != None :
+            nomAlter='T_'+self.nomXML+'_'+str(indice)
+        self.nomDuTypePyxb=nomAlter
+        return nomAlter
 
 
 # ----------------------------------------
 class X_compoFactoriseAmbigu(X_definition):
 # ----------------------------------------
 
-   def __init__(self,nom,listeDeCreation,pere):
-       #print ('__ X_compoFactoriseAmbigu', listeDeCreation)
-       #for (i,index) in listeDeCreation : print i.nom
-       self.label = 'compoAmbigu'
-       self.nom=nom
-       self.pere=pere
-       self.statut='f'
-       self.entites={}
-       self.mcXSD=[]
-       self.ordre_mc=[]
-       self.mcDejaDumpe=set()
-       #print (listeDeCreation)
-       for (mc, index) in listeDeCreation : 
-           self.mcXSD.append(mc)
-           self.ordre_mc.append(mc.nom)
-       #self.mcXSD=list(deepcopy(self.ordre_mc))
-       #for i in self.entites : print (i,self.entites[i])
-       #print ('creation de X_compoFactoriseAmbigu', self.nom, self.mcXSD)
-       self.construitEntites(self.mcXSD)
-       self.constructionArbrePossibles()
-       lesPossibles=deepcopy(self.arbrePossibles)
-      
-       self.getNomDuCodeDumpe()
-       self.nomDuTypePyxb = self.definitNomDuTypePyxb()
-       self.texteSimple = ''
-       self.texteComplexeVenantDesFils = ''
-       self.texteComplexe = debutTypeSubstDsBlocFactorise.format(self.nomDuTypePyxb)
-       # on enleve [] des possibles puisque l elt sera optionnel
-       lesPossibles.remove([])
-       #print ('________________ init de compoAmbigu',self.nom, lesPossibles)
-       #print ('self.entites', self.entites)
-       self.mcXSD=self.factoriseEtCreeDump(lesPossibles,nomAppel='Root')
-       #print ('self.mcXSD',self.mcXSD)
-       self.texteComplexe += finTypeSubstDsBlocFactorise
-       self.texteComplexe +=self.texteComplexeVenantDesFils
-       # PN ?? 12 mai self.texteComplexe=self.texteComplexe+self.texteComplexeVenantDesFils
-       self.label='BlocAmbigu'
-       #print ('fin pour prepareDumpXSD pour', self.nom)
-
-   def compare(self,autreMC):
-       if self.label != autreMC.label : return False
-       if self.arbrePossibles== autreMC.arbrePossible : return True
-       return False
-
-   def construitEntites(self, laListe):
-       for mc in laListe :
-           if mc.nom in self.entites.keys() : self.entites[mc.nom].append(mc)
-           else : self.entites[mc.nom] = [mc,]
-           if mc.label == 'BLOC' or  mc.label == 'BlocAmbigu':
-              self.ajouteLesMCFilsAEntite(mc)
-           
-
-   def ajouteLesMCFilsAEntite(self,blocMc):
-       for mcFilsNom in blocMc.entites.keys():
-         if mcFilsNom not in self.entites.keys(): self.entites[mcFilsNom]=[] 
-         if blocMc.label == 'BlocAmbigu' : 
-           for mc in blocMc.entites[mcFilsNom] : 
-             self.entites[mcFilsNom].append(mc) 
-             if mc.label == 'BLOC' or  mc.label == 'BlocAmbigu':
+    def __init__(self,nom,listeDeCreation,pere, debug=True):
+
+        if debug :
+            for i in listeDeCreation : print (i.nom)
+        self.label='BlocAmbigu'
+        self.nom=nom
+        self.pere=pere
+        self.statut='f'
+        self.entites={}
+        self.mcXSD=[]
+        self.typesXSDDejaDumpes=[]
+        self.ordre_mc=[]
+        self.lesConditions = 'Possible Conditions : '
+        for mc in listeDeCreation :
+            if hasattr(mc, 'condition'):self.lesConditions += '\n\t\t\t\t\t\t' + mc.condition
+            self.mcXSD.append(mc)
+            self.ordre_mc.append(mc.nom)
+
+        if debug : print (self.mcXSD)
+        if debug : print (self.ordre_mc)
+        self.construitEntites(self.mcXSD)
+        self.constructionArbrePossibles()
+        lesPossibles=deepcopy(self.arbrePossibles)
+        if debug : print ('lesPossibles ', lesPossibles)
+
+        self.getNomDuCodeDumpe()
+        self.nomDuTypePyxb = self.definitNomDuTypePyxb()
+        if debug : print (self.nomDuTypePyxb)
+        self.texteSimple = ''
+        self.texteComplexeVenantDesFils = ''
+        self.texteComplexe = debutTypeSubstDsBlocFactorise.format(self.nomDuTypePyxb)
+        # on enleve [] des possibles puisque l elt sera optionnel
+        lesPossibles.remove([])
+        if debug : print ('________________ init de compoAmbigu',self.nom, lesPossibles)
+        if debug : print ('self.entites', self.entites)
+        self.mcXSD=self.factoriseEtCreeDump(lesPossibles,nomAppel='Root')
+        if debug : print ('self.mcXSD',self.mcXSD)
+        self.texteComplexe += finTypeSubstDsBlocFactorise
+        self.texteComplexe +=self.texteComplexeVenantDesFils
+        #print ('fin pour prepareDumpXSD pour', self.nom)
+
+    def compare(self,autreMC):
+        if self.label != autreMC.label : return False
+        #PN : le bug est la
+        # arbre des possibles identiques mais les types different
+        # comment faire ?
+        #print (self.arbrePossibles)
+        #print (autreMC.arbrePossibles)
+        #if self.arbrePossibles== autreMC.arbrePossibles : return True
+        return False
+
+    def construitEntites(self, laListe):
+        for mc in laListe :
+            if mc.nom in self.entites.keys() : self.entites[mc.nom].append(mc)
+            else : self.entites[mc.nom] = [mc,]
+            if mc.label == 'BLOC' or  mc.label == 'BlocAmbigu':
                 self.ajouteLesMCFilsAEntite(mc)
-         else :
-           self.entites[mcFilsNom].append(blocMc.entites[mcFilsNom])
-           if blocMc.entites[mcFilsNom].label == 'BLOC' or  blocMc.entites[mcFilsNom].label == 'BlocAmbigu':
-                self.ajouteLesMCFilsAEntite(blocMc.entites[mcFilsNom])
-           
-
-           
-
-   def constructionArbrePossibles(self):
-       #print ('construction pour FACT ambigu _______________', self.nom)
-       toutesLesLignes=[[]]
-       for child in self.mcXSD :
-          if not hasattr(child, 'arbrePossibles') : child.construitArbrePossibles()
-          if child.label != 'BLOC' :
-              toutesLesLignes = deepcopy(self.fusionne2Listes(toutesLesLignes, child.arbrePossibles))
-          else :
-              toutesLesLignes = deepcopy(self.fusionne2Listes(toutesLesLignes, [child.nom, []]))
-
-       lignesAGarder=[]
-       for ligne in toutesLesLignes:
-           blocContenus=[]
-           aAjouter=True
-           for mc in ligne : 
-               objMC=self.entites[mc][0]
-               if objMC.label == 'BLOC' : 
-                  blocContenus.append(objMC)
-           for b in blocContenus :
-               for frere in blocContenus[blocContenus.index(b)+1:]:
-                   if b.isDisjoint(frere) : continue
-                   aAjouter=False
-                   break
-               if not aAjouter : break
-           if  aAjouter and ligne not in lignesAGarder : 
-               lignesAGarder.append(ligne)
-
-       #print ("______________________________________")
-       #for l in lignesAGarder : print (l)
-       #print (len(lignesAGarder))
-       #print ("______________________________________")
-       self.arbrePossibles=[]
-       for ligne in lignesAGarder :
-           #print ('lignesAGarder', ligne)
-           for newLigne in self.deploye(ligne): 
-               #print (newLigne)
-               if newLigne not in self.arbrePossibles : self.arbrePossibles.append(newLigne)
-       #for l in self.arbrePossibles : print (l)
-       #print ("______________________________________")
-       
-         
-   def deploye (self, ligne):
-       toutesLesLignes=[[]]
-       for mc in ligne :
-           #print ( 'mc in deploye', mc)
-           objMC=self.entites[mc][0]
-           #print ( 'nom', objMC.nom, objMC.label)
-           if objMC.label == 'BLOC' or objMC.label == 'BlocAmbigu': 
-              toutesLesLignes = deepcopy(self.remplaceListeParContenuEtVide(toutesLesLignes, objMC.arbrePossibles))
-           else :
-              toutesLesLignes = deepcopy(self.adjointUnMot(toutesLesLignes,mc ))
-       return toutesLesLignes
-
-   def construitArbrePossibles(self):
-   # inutile car on a deja l arbre mais appele parfois
-       #print ('dans X_factCompoAmbigue ne fait rien', self.nom, self.arbrePossibles)
-       pass
-
-   def dumpXsd(self, dansFactorisation=False, multiple = False, first=False):
-       # on ne fait rien, tout a ete fait dans le init
-       self.texteElt=substDsSequence.format(self.code,self.nomDuTypePyxb,0,1)
-
-   def nomComplet(self) :
-       print ('dans nomComplet pourquoi ?',self, self.nom)
 
-       
-   def factoriseEtCreeDump(self, laListe, indent=2 ,nomAppel=None):
-       #print ('_______________________________ factoriseEtCreeDump')
-       #print(self.nom, laListe, indent, nomAppel)
-       maListeRetour=[]
-       aReduire={}
-
-       if [] in laListe : 
-          declencheChoiceAvecSeqVid=True
-          while [] in laListe : laListe.remove([])
-          #min=0
-       else :
-          declencheChoiceAvecSeqVid=False
-          #min=1
-
-
-       for ligne in laListe :
-          if ligne[0] in aReduire.keys(): 
-             if len(ligne) == 1 :aReduire[ligne[0]].append([])
-             else : aReduire[ligne[0]].append(ligne[1:])
-          else : 
-             if len(ligne) == 1 : aReduire[ligne[0]]=[[]]
-             else : aReduire[ligne[0]]=[ligne[1:],]
 
+    def ajouteLesMCFilsAEntite(self,blocMc):
+        for mcFilsNom in blocMc.entites.keys():
+            if mcFilsNom == 'Consigne' or mcFilsNom == 'blocConsigne' : continue
+            if mcFilsNom not in self.entites.keys(): self.entites[mcFilsNom]=[]
+            if blocMc.label == 'BlocAmbigu' :
+                for mc in blocMc.entites[mcFilsNom] :
+                    self.entites[mcFilsNom].append(mc)
+                    if mc.label == 'BLOC' or  mc.label == 'BlocAmbigu':
+                        self.ajouteLesMCFilsAEntite(mc)
+            else :
+                self.entites[mcFilsNom].append(blocMc.entites[mcFilsNom])
+                if blocMc.entites[mcFilsNom].label == 'BLOC' or  blocMc.entites[mcFilsNom].label == 'BlocAmbigu':
+                    self.ajouteLesMCFilsAEntite(blocMc.entites[mcFilsNom])
+
+
+
+
+    def constructionArbrePossibles(self, debug = False):
+        if debug : print ('construction pour FACT ambigu _______________', self.nom)
+        toutesLesLignes=[[]]
+        for child in self.mcXSD :
+            if not hasattr(child, 'arbrePossibles') : child.construitArbrePossibles()
+            if child.label != 'BLOC' :
+                toutesLesLignes = deepcopy(self.fusionne2Listes(toutesLesLignes, child.arbrePossibles))
+            else :
+                toutesLesLignes = deepcopy(self.fusionne2Listes(toutesLesLignes, [child.nom, []]))
+
+        lignesAGarder=[]
+        for ligne in toutesLesLignes:
+            blocContenus=[]
+            aAjouter=True
+            for mc in ligne :
+                objMC=self.entites[mc][0]
+                if objMC.label == 'BLOC' :
+                    blocContenus.append(objMC)
+            for b in blocContenus :
+                for frere in blocContenus[blocContenus.index(b)+1:]:
+                    if b.isDisjoint(frere) : continue
+                    aAjouter=False
+                    break
+                if not aAjouter : break
+            if  aAjouter and ligne not in lignesAGarder :
+                lignesAGarder.append(ligne)
+
+        #print ("______________________________________")
+        #for l in lignesAGarder : print (l)
+        #print (len(lignesAGarder))
+        #print ("______________________________________")
+        self.arbrePossibles=[]
+        for ligne in lignesAGarder :
+            #print ('lignesAGarder', ligne)
+            for newLigne in self.deploye(ligne):
+                #print (newLigne)
+                if newLigne not in self.arbrePossibles : self.arbrePossibles.append(newLigne)
+        #for l in self.arbrePossibles : print (l)
+        #print ("______________________________________")
+
+
+    def deploye (self, ligne):
+        toutesLesLignes=[[]]
+        for mc in ligne :
+            #print ( 'mc in deploye', mc)
+            objMC=self.entites[mc][0]
+            #print ( 'nom', objMC.nom, objMC.label)
+            if objMC.label == 'BLOC' or objMC.label == 'BlocAmbigu':
+                toutesLesLignes = deepcopy(self.remplaceListeParContenuEtVide(toutesLesLignes, objMC.arbrePossibles))
+            else :
+                toutesLesLignes = deepcopy(self.adjointUnMot(toutesLesLignes,mc ))
+        return toutesLesLignes
+
+    def construitArbrePossibles(self):
+    # inutile car on a deja l arbre mais appele parfois
+        #print ('dans X_factCompoAmbigu ne fait rien', self.nom, self.arbrePossibles)
+        pass
+
+    def dumpXsd(self, dansFactorisation=False, multiple = False, first=False):
+        # on ne fait rien, tout a ete fait dans le init
+        self.texteElt=substDsSequence.format(self.code,self.nomDuTypePyxb,0,1, self.lesConditions)
+
+    def nomComplet(self) :
+        print ('dans nomComplet pourquoi ?',self, self.nom)
+
+
+    def factoriseEtCreeDump(self, laListe, indent=2 ,nomAppel=None, debug=False):
+        if debug : print ('_______________________________ factoriseEtCreeDump')
+        if debug : print(self.nom, laListe, indent, nomAppel)
+        maListeRetour=[]
+        aReduire={}
+
+        if [] in laListe :
+            declencheChoiceAvecSeqVid=True
+            while [] in laListe : laListe.remove([])
+            #min=0
+        else :
+            declencheChoiceAvecSeqVid=False
+            #min=1
+        
+
+
+        for ligne in laListe :
+            if ligne[0] in aReduire.keys():
+                if len(ligne) == 1 :aReduire[ligne[0]].append([])
+                else : aReduire[ligne[0]].append(ligne[1:])
+            else :
+                if len(ligne) == 1 : aReduire[ligne[0]]=[[]]
+                else : aReduire[ligne[0]]=[ligne[1:],]
+
+
+        if debug : print ('la Liste', laListe, declencheChoiceAvecSeqVid)
+        if debug : print (aReduire)
+        if len(aReduire.keys()) == 1 :
+            if declencheChoiceAvecSeqVid == False :
+                creeChoice=False
+                creeSequence=True
+                self.texteComplexe += '\t'*(indent) +  debSequenceDsBloc; indent=indent+1
+            else :
+                creeChoice=True
+                creeSequence=False
+                # pour regler le souci du 1er Niveau
+                self.texteComplexe += '\t'*indent + debutChoiceDsBloc; indent=indent+1
+                #if min == 1 : self.texteComplexe += '\t'*indent + debutChoiceDsBloc; indent=indent+1
+                #else        : self.texteComplexe += '\t'*indent + debutChoiceDsBlocAvecMin.format(min); indent=indent+1
+        else :
+            #self.texteComplexe += '\t'*indent + debutChoiceDsBlocAvecMin.format(min); indent=indent+1
+            self.texteComplexe += '\t'*indent + debutChoiceDsBloc; indent=indent+1
+            creeChoice=True
+            creeSequence=False
+
+        if debug : print ('creeSequence', creeSequence, aReduire)
+        for nomMC in aReduire.keys():
+            if debug : print (nomMC)
+            listeSuivante=aReduire[nomMC]
+            if creeChoice and  listeSuivante != [[]] :
+                self.texteComplexe += '\t'*(indent) +  debSequenceDsBloc; indent=indent+1
+            self.ajouteAuxTextes(nomMC,indent)
+            if listeSuivante == [[]] : continue # Est-ce toujours vrai ?
+            if len(listeSuivante) == 1 : self.ajouteAuxTextes(listeSuivante[0],indent)
+            else : self.factoriseEtCreeDump(listeSuivante, indent+int(creeSequence),nomMC)
+            if creeChoice   : indent=indent -1 ; self.texteComplexe += '\t'*(indent) + finSequenceDsBloc
+
+        if declencheChoiceAvecSeqVid :
+            self.texteComplexe +=  '\t'*indent +  debSequenceDsBloc
+            self.texteComplexe +=  '\t'*indent + finSequenceDsBloc
+        if creeChoice   : indent=indent -1 ; self.texteComplexe += '\t'*indent + finChoiceDsBloc
+        if creeSequence : indent=indent -1 ; self.texteComplexe += '\t'*(indent) + finSequenceDsBloc
+
+        #if doitFermerSequence : indent=indent-1;self.texteComplexe += '\t'*(indent) + finSequenceDsBloc
+        #print (self.texteSimple)
+        #print ('______',' self.texteComplexe')
+        #print (self.texteComplexe)
+        #print ('_____', 'self.texteComplexeVenantDesFils')
+        #print (self.texteComplexeVenantDesFils)
+        #print ('fin pour _______________________________', self.nom)
+        return (maListeRetour)
+
+
+    def ajouteAuxTextes(self,nomMC,indent,debug=False) :
+        if debug : 
+           print ('______________________________________________________')
+           print ('ajouteAuxTextes', nomMC, self.nom)
+        #  for i in self.entites.keys() : print (self.entites[i][0].nom)
+        if (indent  > 3) : indent = indent - 3
+
+        # PN change le 17 fevrier . Est-ce normal  d arriver la ?
+        # if faut traiter les Blocs exclusifs qui donnent des choices de sequences
+        # mais celles-ci risquent d etre ambigues
+        while (isinstance(nomMC,list)) :
+            nomMC=nomMC[0]
+
+        if nomMC == 'Consigne' or nomMC == 'blocConsigne' : return
+        if debug : print (nomMC, 'dans ajoute vraiment aux textes', self.entites )
+        if len(self.entites[nomMC]) == 1:
+            mc=self.entites[nomMC][0]
+            mc.dumpXsd(dansFactorisation=True)
+            self.texteComplexe += '\t'*(indent) + mc.texteElt
+            if mc.aCreer : self.texteComplexeVenantDesFils += mc.texteComplexe
+            if mc.aCreer : self.texteSimple   += mc.texteSimple
+            if mc.aCreer : mc.aCreer=False
+            return
+
+        leType=type(self.entites[nomMC][0])
+        for e in (self.entites[nomMC][1:]) :
+            if type(e) != leType:
+                print ('Projection XSD impossible, changez un des ', nomMC)
+                exit()
+
+        # cette boucle ne fonctionne que pour des SIMP
+        resteATraiter=copy(self.entites[nomMC])
+        #print ('________resteATraiter', resteATraiter)
+        listePourUnion=[]
+        first=1
+        while resteATraiter != [] :
+            nvlListeATraiter=[]
+            mc=resteATraiter[0]
+            listePourUnion.append(mc)
+            for autre in resteATraiter[1:]:
+                if not (mc.compare(autre)) :  nvlListeATraiter.append(autre)
+            resteATraiter=copy(nvlListeATraiter)
+
+        if len(listePourUnion) == 1:
+            mc=listePourUnion[0]
+            mc.dumpXsd(dansFactorisation=True,multiple=False,first=first)
+            self.texteComplexe += '\t'*(indent) + mc.texteElt
+            if mc.aCreer : self.texteComplexeVenantDesFils += mc.texteComplexe
+            if mc.aCreer : self.texteSimple   += mc.texteSimple
+            for mcIdent in self.entites[nomMC][1:]: mcIdent.metAJourPyxb(mc.nomDuTypePyxb)
+            if mc.aCreer : mc.aCreer=False
+            return
+
+        # on ajoute le nom de l element
+        if not (isinstance(self.entites[nomMC][0], Accas.SIMP)) :
+            sontTousDisjoint=True
+            index=1
+            if debug : print ('on cherche si ils sont disjoints : ',self.entites[nomMC])
+            for mc in self.entites[nomMC] :
+                if debug : print ('compare mc' , mc, ' avec :')
+                for mcFrere in self.entites[nomMC][index:]:
+                    ok = mc.isDisjoint(mcFrere) 
+                    if not ok : 
+                       sontTousDisjoint=False
+                       break
+                if not(sontTousDisjoint) : break 
+                index+=1
+            if not sontTousDisjoint: 
+               print ('2 blocs freres ont le meme nom et ne sont pas disjoints : pas encore traite')
+               print ('Projection XSD impossible, changez un des ', nomMC)
+               exit()
+            self.fusionneDsUnChoix(nomMC,indent)
+            if debug : print ('self.nom', self.nom)
+            if debug : print ('self.texteComplexe' , self.texteComplexe)
+            if debug : print ('self.texteSimple' , self.texteSimple)
+            if debug : print ('self.texteElt' , self.texteElt)
+            if debug : print ('________________________')
+            return
+        
        
-       if len(aReduire.keys()) == 1 :
-          if declencheChoiceAvecSeqVid == False : 
-             creeChoice=False
-             creeSequence=True
-             self.texteComplexe += '\t'*(indent) +  debSequenceDsBloc; indent=indent+1
-          else :
-             creeChoice=True
-             creeSequence=False
-             # pour regler le souci du 1er Niveau
-             self.texteComplexe += '\t'*indent + debutChoiceDsBloc; indent=indent+1
-             #if min == 1 : self.texteComplexe += '\t'*indent + debutChoiceDsBloc; indent=indent+1
-             #else        : self.texteComplexe += '\t'*indent + debutChoiceDsBlocAvecMin.format(min); indent=indent+1
-       else :                         
-          #self.texteComplexe += '\t'*indent + debutChoiceDsBlocAvecMin.format(min); indent=indent+1
-          self.texteComplexe += '\t'*indent + debutChoiceDsBloc; indent=indent+1
-          creeChoice=True
-          creeSequence=False
-
-       for nomMC in aReduire.keys():
-           listeSuivante=aReduire[nomMC]
-           if creeChoice and  listeSuivante != [[]] :
-              self.texteComplexe += '\t'*(indent) +  debSequenceDsBloc; indent=indent+1
-           self.ajouteAuxTextes(nomMC,indent)
-           if listeSuivante == [[]] : continue # Est-ce toujours vrai ? 
-           if len(listeSuivante) == 1 : self.ajouteAuxTextes(listeSuivante[0],indent)
-           else : self.factoriseEtCreeDump(listeSuivante, indent+int(creeSequence),nomMC)
-           if creeChoice   : indent=indent -1 ; self.texteComplexe += '\t'*(indent) + finSequenceDsBloc
-
-       if declencheChoiceAvecSeqVid : 
-          self.texteComplexe +=  '\t'*indent +  debSequenceDsBloc
-          self.texteComplexe +=  '\t'*indent + finSequenceDsBloc
-       if creeChoice   : indent=indent -1 ; self.texteComplexe += '\t'*indent + finChoiceDsBloc
-       if creeSequence : indent=indent -1 ; self.texteComplexe += '\t'*(indent) + finSequenceDsBloc
-
-       #if doitFermerSequence : indent=indent-1;self.texteComplexe += '\t'*(indent) + finSequenceDsBloc
-       #print (self.texteSimple)
-       #print ('______',' self.texteComplexe')
-       #print (self.texteComplexe)
-       #print ('_____', 'self.texteComplexeVenantDesFils')
-       #print (self.texteComplexeVenantDesFils)
-       print ('fin pour _______________________________', self.nom)
-       return (maListeRetour)
-       
-       
-   def ajouteAuxTextes(self,nomMC,indent) :
-       #print ('ajouteAuxTextes', nomMC, self.nom, self.entites)
-       #print ('ajouteAuxTextes', nomMC)
-       #for i in self.entites.keys() : print (self.entites[i][0].nom)
-       if (indent  > 3) : indent = indent - 3
-       else : indent = 0
-       if len(self.entites[nomMC]) == 1:
-           mc=self.entites[nomMC][0]
-           mc.dumpXsd(dansFactorisation=True)
-           self.texteComplexe += '\t'*(indent) + mc.texteElt
-           if mc.nomDuTypePyxb not in self.mcDejaDumpe :
-              self.texteComplexeVenantDesFils += mc.texteComplexe
-              self.texteSimple   += mc.texteSimple
-              self.mcDejaDumpe.add(mc.nomDuTypePyxb)
-           return
-
-       leType=type(self.entites[nomMC][0])
-       for e in (self.entites[nomMC][1:]) : 
-          if type(e) != leType:
-             print ('Projection XSD impossible, changez un des ', nomMC)
-             exit()
+        if hasattr(self.entites[nomMC][0], 'dejaDumpe') : # on a deja cree le type
+            if debug : print (self.entites[nomMC][0].nomDuTypePyxb, ' deja dumpe')
+        else :
+            if debug : print ('appel de dumpXsd')
+            self.entites[nomMC][0].dejaDumpe=True
+            self.entites[nomMC][0].dumpXsd(dansFactorisation=True,multiple=True,first=first)
+            if debug : print (self.entites[nomMC][0].nomDuTypePyxb)
+
+        texteDocUnion='\n'
+        i=1
+        for mc in self.entites[nomMC]:
+            if mc.ang != ''   : texteDocUnion += str(i) + '- ' + mc.ang + ' or \n'; i=i+1
+            elif mc .fr != '' : texteDocUnion += str(i) + '- ' + mc.fr  + ' ou \n'; i=i+1
+        if texteDocUnion == '\n' :
+            self.texteComplexe += '\t'*(indent) + self.entites[nomMC][0].texteElt
+        else :
+            texteDocUnion = texteDocUnion[0:-4]
+            debutTexteEltUnion = self.entites[nomMC][0].texteElt.split('maxOccurs=')[0]
+            self.texteComplexe += '\t'*(indent)+ reconstitueUnion.format(debutTexteEltUnion,texteDocUnion)
+        if self.entites[nomMC][0].nomDuTypePyxb in self.typesXSDDejaDumpes : return
+        self.typesXSDDejaDumpes.append(self.entites[nomMC][0].nomDuTypePyxb)
+        if debug : print ('et la j ajoute les definitions de type', self.entites[nomMC][0].nomDuTypePyxb)
+
+        nomTypePyxbUnion=self.entites[nomMC][0].nomDuTypePyxb
+        texteSimpleUnion = debutSimpleType.format(nomTypePyxbUnion)
+        texteSimpleUnion += debutUnion
+        texteSimpleUnion += '\t'*(indent)+self.entites[nomMC][0].texteSimplePart2
+        texteSimplePart1  = self.entites[nomMC][0].texteSimplePart1
+        for e in listePourUnion[1:] :
+            e.dumpXsd(dansFactorisation=True,multiple=True,first=False)
+            # si on ext un mc simple la ligne suivante est inutile
+            # en revanche on ajoute le texte a tous les coups
+            #self.texteComplexeVenantDesFils += e.texteComplexe
+            e.metAJourPyxb(nomTypePyxbUnion)
+            texteSimpleUnion += '\t'*(indent) + e.texteSimplePart2
+            texteSimplePart1 += e.texteSimplePart1
+        texteSimpleUnion += finUnion
+        texteSimpleUnion +=fermeSimpleType
+        self.texteSimple += texteSimplePart1 + texteSimpleUnion
+        if debug : 
+           print ('______________')
+           print (self.texteSimple)
+           print ('______________')
+        #print ('self.texteSimple', self.texteSimple)
+
+    def fusionneDsUnChoix(self, nomMC,indent, debug=False):
+        if debug : print ('_________________________________', self.nom, self, nomMC,indent)
+        if debug : print (self.texteComplexe)
+        texteDocUnion='\n'
+        texteComplexe=''
+        texteComplexeVenantDesFils=''
+        texteSimple=''
+        mcRef= self.entites[nomMC][0]
+        # max = 1 : a priori les choix sont exclusifs
+        if (hasattr (mcRef, 'aDejaEteDumpe')) : 
+          if debug : print ("je passe la NORMALEMENT car j ai deja ete dumpe")
+          return
+        leNomDuTypePyxb  = mcRef.definitNomDuTypePyxb(forceACreer=True)
+        if debug : print ('nomMC', nomMC)
+        for mc in self.entites[nomMC]:
+            if debug : print ('------------', mc)
+            # on laisse dansFactorisation a False car ce n est pas comme une fusion de bloc 
+            mc.texteComplexe = ''
+            mc.texteSimple = ''
+            mc.texteElt = ''
+            mc.dumpXsd(dansFactorisationDeFusion=True)
+            if debug : print ('texteSimple\n', mc.texteSimple, '\n fin\n')
+            if debug : print ('texteComplexeVenantDesFils\n',mc.texteComplexeVenantDesFils, '\n fin\n')
+            if debug : print ('texteComplexe\n', mc.texteComplexe, '\n fin\n')
+            if mc.ang != ''   : texteDocUnion += str(i) + '- ' + mc.ang + ' or \n'; i=i+1
+            elif mc .fr != '' : texteDocUnion += str(i) + '- ' + mc.fr  + ' ou \n'; i=i+1
+            texteComplexe += mc.texteComplexe
+            texteComplexeVenantDesFils += mc.texteComplexeVenantDesFils 
+            texteSimple += mc.texteSimple
+
+        if debug : print ('______________________________')
+        if debug : print ('textecomplexeVenantDesFils : \n' ,texteComplexeVenantDesFils )
+        if debug : print ('______________________________')
+        if debug : print ('______________________________')
+        if debug : print ('textecomplexe : \n' ,texteComplexe )
+        if debug : print ('______________________________')
+        self.entites[nomMC][0].aDejaEteDumpe=True 
+
+        self.texteElt = eltCompoDsSequence.format(nomMC, self.nomDuCodeDumpe,mcRef.nomDuTypePyxb,1,1)
+        self.texteDuFact = debutTypeCompo.format(self.entites[nomMC][0].nomDuTypePyxb)
+        self.texteDuFact += debutChoiceDsBloc
+        self.texteDuFact += texteComplexe 
+        self.texteDuFact += finChoiceDsBloc
+        self.texteDuFact += finTypeCompo
+        self.texteSimple += texteSimple
+        self.texteComplexeVenantDesFils   += texteComplexeVenantDesFils
+        self.texteComplexeVenantDesFils   += self.texteDuFact 
+        self.texteComplexe += self.texteElt 
+        if debug : print ('______________________________')
+        if debug : print ('texteSimple : \n' ,self.texteSimple )
+        if debug : print ('______________________________')
+        self.entites[nomMC][0].aDejaEteDumpe=True 
 
-       
-       # cette boucle ne fonctionne que pour des SIMP
-       resteATraiter=copy(self.entites[nomMC])
-       #print ('________resteATraiter', resteATraiter)
-       listePourUnion=[]
-       first=1
-       while resteATraiter != [] :
-          nvlListeATraiter=[]
-          mc=resteATraiter[0]
-          listePourUnion.append(mc)
-          for autre in resteATraiter[1:]:
-             if not (mc.compare(autre)) :  nvlListeATraiter.append(autre)
-          resteATraiter=copy(nvlListeATraiter)
-
-       if len(listePourUnion) == 1:
-           mc=listePourUnion[0]
-           mc.dumpXsd(dansFactorisation=True,multiple=False,first=first)
-           self.texteComplexe += '\t'*(indent) + mc.texteElt
-           if mc.nomDuTypePyxb not in self.mcDejaDumpe :
-              self.texteComplexeVenantDesFils += mc.texteComplexe
-              self.texteSimple   += mc.texteSimple
-              self.mcDejaDumpe.add(mc.nomDuTypePyxb)
-           return
-             
-       # on ajoute le nom de l element
-       self.entites[nomMC][0].dumpXsd(dansFactorisation=True,multiple=True,first=first)
-       self.texteComplexe += '\t'*(indent) + self.entites[nomMC][0].texteElt
-       texteSimpleUnion=debutSimpleType.format(self.entites[nomMC][0].nomDuTypePyxb)
-       texteSimpleUnion+=debutUnion
-       if len(listePourUnion) == 1 :
-           mc=self.entites[nomMC][0]
-           mc.dumpXsd(dansFactorisation=True,multiple=True,first=first)
-           if mc.nomDuTypePyxb not in self.mcDejaDumpe :
-              self.texteComplexeVenantDesFils += mc.texteComplexe
-              self.texteSimple   += mc.texteSimple
-              self.mcDejaDumpe.add(mc.nomDuTypePyxb)
-       else :
-           for e in listePourUnion :
-               e.dumpXsd(dansFactorisation=True,multiple=True,first=first)
-               if first and (e.nomDuTypePyxb not in self.mcDejaDumpe) :
-                  self.texteComplexeVenantDesFils += e.texteComplexe
-                  self.mcDejaDumpe.add(e.nomDuTypePyxb)
-                  texteSimpleUnion += '\t'*(indent)+e.texteSimple
-                  first=first * 0
-           texteSimpleUnion += finUnion
-       texteSimpleUnion+=fermeSimpleType
-       self.texteSimple   += texteSimpleUnion
-   
 
 
 # ----------------------------------------
 class X_definitionComposee (X_definition):
 # ------------------------------------------
-   
-   def CreeTexteComplexeVenantDesFils(self,dansFactorisation=False):
-       texteComplexeVenantDesFils=""
-       blocsDejaDumpes=set()
-       #for nom in self.ordre_mc:
-       #  mcFils = self.entites[nom]
-       #print (self.nom)
-       for mcFils in self.mcXSD :
-          if not (isinstance(mcFils, Accas.BLOC)) :
-             mcFils.dumpXsd(dansFactorisation)
-             self.texteComplexe += mcFils.texteElt
-             self.texteSimple   += mcFils.texteSimple 
-             texteComplexeVenantDesFils += mcFils.texteComplexe
-             continue
-          else   :
-             #print (mcFils.nom)
-             if hasattr(mcFils,'nomXML')  and mcFils.nomXML in blocsDejaDumpes and mcFils.nomXML != None : continue 
-             if hasattr(mcFils,'nomXML')  and mcFils.nomXML != None: blocsDejaDumpes.add(mcFils.nomXML)
-             mcFils.dumpXsd(dansFactorisation)
-             self.texteComplexe += mcFils.texteElt
-             self.texteSimple   += mcFils.texteSimple 
-             texteComplexeVenantDesFils += mcFils.texteComplexe
-       return texteComplexeVenantDesFils
-
-   def dumpXsd(self, dansFactorisation=False, multiple = False, first=False):
-       #print ('_________ dumpXsd___________', self.nom)
-       if PourTraduction  : print (self.nom)
-       self.prepareDumpXSD()
-       self.getNomDuCodeDumpe()
-       self.nomDuTypePyxb  = self.definitNomDuTypePyxb()
-       self.texteSimple    = "" # on n ajoute pas de type simple
-
-       self.traduitMinMax()
-       # pour accepter les PROC et ...
-       # 
-       if self.aCreer :
-          self.texteComplexe = debutTypeCompo.format(self.nomDuTypePyxb)
-          if isinstance(self,X_OPER) or isinstance(self,X_PROC) : 
-            self.texteComplexe += debutTypeCompoEtape.format(self.code)
-          self.texteComplexe += debutTypeCompoSeq
-          texteComplexeVenantDesFils=self.CreeTexteComplexeVenantDesFils(dansFactorisation)
-          self.texteComplexe  = texteComplexeVenantDesFils + self.texteComplexe
-          # la fin de l oper est traitee dans le dumpXSD de X_OPER
-          if not isinstance(self,X_OPER ) : self.texteComplexe += finTypeCompoSeq
-          if isinstance(self,X_PROC)      : self.texteComplexe += finTypeCompoEtape
-          if not isinstance(self,X_OPER ) : self.texteComplexe += finTypeCompo
-       else :
-          self.texteComplexe = ""
-
-       self.texteElt=eltCompoDsSequence.format(self.nom,self.nomDuCodeDumpe,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs)
-       #print (self.texteComplexe)
-       #print ('------------------------------------------------',self.nom)
-
-   def traduitMinMax(self):
-   # ______________________
-   # valable pour PROC et OPER
-      self.minOccurs = 0
-      self.maxOccurs = 1 
-
-   def compare(self,autreMC):
-       if self.label != autreMC.label : return False
-       if hasattr(self,'nomXML') and hasattr(autreMC,'nomXML') and self.nomXML==autreMC.nomXML and self.nomXML != None : return True
-       for attr in (  'regles', 'fr',  'defaut', 'min' ,'max', 'position' , 'docu' ) :
-           val1=getattr(self,attr)
-           val2=getattr(autreMC,attr)
-           if val1 != val2 : return False
-       for defFille in self.entites.keys():
-           if defFille not in autreMC.entites.keys() : return False
-           if not self.entites[defFille].compare(autreMC.entites[defFille]) : return False
-       return True
-
-   def prepareDumpXSD(self):
-       #print (' ************************ prepareDumpXSD pour', self.nom)
-       self.inUnion=False
-       self.tousLesFils=[]
-       self.mcXSD=[]
-       for nomMC in self.ordre_mc:
-           mc=self.entites[nomMC]
-           self.mcXSD.append(mc)
-           mc.prepareDumpXSD()
-       self.chercheListesDeBlocsNonDisjointsAvecIndex()
-       for l in list(self.listeDesBlocsNonDisjointsAvecIndex) :
-           #print ('je traite ', l, self.besoinDeFactoriserTrivial(l))
-           if not(self.besoinDeFactoriserTrivial(l)) : self.listeDesBlocsNonDisjointsAvecIndex.remove(l)
-           else : self.factorise(l)
-              #print (self.aUnPremierCommunDansLesPossibles(l))
-           #if self.aUnPremierCommunDansLesPossibles(l) :
-           #     print ('aUnCommunDansLesPossibles --> Factorisation')
-           #else : self.listeDesBlocsNonDisjointsAvecIndex.remove(l)
-           # trouver un cas test
-
-   def chercheListesDeBlocsNonDisjointsAvecIndex(self):
-       self.listeDesBlocsNonDisjointsAvecIndex=[]
-       index=-1
-       for nomChild in self.ordre_mc :
-         child=self.entites[nomChild]
-         index=index+1
-         if child.label != 'BLOC' : continue
-         if self.listeDesBlocsNonDisjointsAvecIndex == [] :
-             self.listeDesBlocsNonDisjointsAvecIndex.append([(child,index),])
-             continue
-         vraimentIndependant=True
-         for liste in list(self.listeDesBlocsNonDisjointsAvecIndex):
-             independant=True
-             for (bloc,indInListe) in liste :
-                 if bloc.isDisjoint(child) : continue
-                 if bloc.estLeMemeQue(child) : continue
-                 independant=False
-                 vraimentIndependant=False
-             if not (independant) :
-                 liste.append((child, index))
-         if vraimentIndependant:
-             self.listeDesBlocsNonDisjointsAvecIndex.append([(child,index),])
-       # on nettoye la liste des blocs tous seuls
-       for l in list(self.listeDesBlocsNonDisjointsAvecIndex) :
-           if len(l) ==1 : self.listeDesBlocsNonDisjointsAvecIndex.remove(l)
-
-   def estLeMemeQue(self,autreMC):
-       if hasattr(self,'nomXML') and hasattr(autreMC,'nomXML') and self.nomXML==autreMC.nomXML and self.nomXML != None: return True
-       return False
-
-   def aUnPremierCommunDansLesPossibles(self, laListe) :
-    # fonctionne avec liste de mc ou une liste(mc,index) 
-       import types
-       mesPremiers=set()
-       for elt,index in laListe :
-           if not type(e) == types.ListType :
-              if elt.nom in mesPremiers : return True
-              mesPremiers.add(elt.nom)
-           else :
-              if elt[0].nom in mesPremiers : return True
-              mesPremiers.add(elt[0].nom)
-       return False
-
-   def besoinDeFactoriserTrivial(self,laListe):
-       besoin=False
-       lesPremiers=set()
-       for mcBloc,indice in laListe  :
-          mc=mcBloc.mcXSD[0]
-          if mc.label == 'BLOC': return True
-          if not(mc.statut=='o') : return True
-          if mc.nom in lesPremiers  : return True
-          lesPremiers.add(mc.nom)
-       return False
-
-   def factorise(self,liste):
-       self.listeConstruction=liste
-       indexDebut=liste[0][1]
-       nomDebut=liste[0][0].nom
-       indexFin=liste[-1][1]+1
-       nomFin=liste[-1][0].nom
-       nom=nomDebut+'_'+nomFin
-       listeAFactoriser=[]
-       for  i in range(indexDebut, indexFin) :
-          listeAFactoriser.append((self.mcXSD[i],i))
-
-       newListe=self.mcXSD[0:indexDebut]
-       #print (newListe, newListe.__class__)
-       #print ('je factorise dans -->', self.nom)
-       monEltFacteur=X_compoFactoriseAmbigu(nom,listeAFactoriser,self)
-       newListe.append(monEltFacteur)
-       newListe=newListe+self.mcXSD[indexFin:]
-       self.mcXSD=newListe
-       #print (self.mcXSD)
-       #for i in self.mcXSD : print (i.nom)
-
-   def construitTousLesFils(self):
-       for nomChild in self.ordre_mc :
-         child=self.entites[nomChild]
-         if child.label != 'BLOC' :
-            self.tousLesFils.append(child.nom)
-         else:
-            if child.tousLesFils == [] : child.construitTousLesFils()
-            for nomPetitFils in child.tousLesFils : self.tousLesFils.append(nomPetitFils)
-       #print ('construitArbreEntier pour ', self.nom, self.tousLesFils)
-
-
-   def isDisjoint(self, mc1) :
-       if self.tousLesFils == [] : self.construitTousLesFils()
-       if not (hasattr(mc1, 'tousLesFils')) : mc1.tousLesFils  = []
-       if mc1.tousLesFils  == []  : mc1.construitTousLesFils()
-       for fils in mc1.tousLesFils :
-           if fils in  self.tousLesFils : return False
-       return True
+
+    def creeTexteComplexeVenantDesFils(self,dansFactorisation=False,debug=False):
+        texteComplexeVenantDesFils=""
+        blocsDejaDumpes=set()
+        #for nom in self.ordre_mc:
+        #  mcFils = self.entites[nom]
+        if debug : print ('creeTexteComplexeVenantDesFils', self.nom)
+        if self.nom == 'LeProc' : debug = True
+        for mcFils in self.mcXSD :
+            #print (mcFils,mcFils.nom)
+            if mcFils.nom == 'B1_B2' :debug=True 
+            else : debug=False
+            if not (isinstance(mcFils, Accas.BLOC)) :
+                mcFils.dumpXsd(dansFactorisation)
+                self.texteComplexe += mcFils.texteElt
+                if mcFils.aCreer : self.texteSimple   += mcFils.texteSimple
+                if mcFils.aCreer : texteComplexeVenantDesFils += mcFils.texteComplexe
+            else   :
+                if hasattr(mcFils,'nomXML')  and mcFils.nomXML in blocsDejaDumpes and mcFils.nomXML != None : continue
+                if hasattr(mcFils,'nomXML')  and mcFils.nomXML != None: blocsDejaDumpes.add(mcFils.nomXML)
+                mcFils.dumpXsd(dansFactorisation)
+                self.texteComplexe += mcFils.texteElt
+                if mcFils.aCreer : self.texteSimple   += mcFils.texteSimple
+                if mcFils.aCreer : texteComplexeVenantDesFils += mcFils.texteComplexe
+        return texteComplexeVenantDesFils
+
+    def dumpXsd(self, dansFactorisation=False, dansFactorisationDeFusion = False, multiple = False, first=True, debug=False):
+        if PourTraduction  : print (self.nom)
+        # le prepareDump est appele sur les fils
+        if not (self.dejaPrepareDump) : self.prepareDumpXSD()
+
+        self.getNomDuCodeDumpe()
+        if first :
+            if multiple : self.nomDuTypePyxb  = self.definitNomDuTypePyxb(forceACreer=True)
+            else        : self.nomDuTypePyxb  = self.definitNomDuTypePyxb()
+        self.texteSimple    = "" # on n ajoute pas de type simple
+
+        self.traduitMinMax()
+        # pour accepter les PROC et ...
+        #
+        if debug : print ('dumpXsd', self.nom, self.aCreer)
+        if self.aCreer or dansFactorisationDeFusion:
+            if not dansFactorisationDeFusion : self.texteComplexe = debutTypeCompo.format(self.nomDuTypePyxb)
+            if isinstance(self,X_OPER) or isinstance(self,X_PROC) :
+                self.texteComplexe += debutTypeCompoEtape.format(self.code)
+            self.texteComplexe += debutTypeCompoSeq
+            texteComplexeVenantDesFils= self.creeTexteComplexeVenantDesFils(dansFactorisation)
+            if not dansFactorisationDeFusion : 
+               self.texteComplexe  = texteComplexeVenantDesFils + self.texteComplexe
+               self.texteComplexeVenantDesFils  = ''
+            else : 
+               self.texteComplexeVenantDesFils  = texteComplexeVenantDesFils 
+            # la fin de l oper est traitee dans le dumpXSD de X_OPER
+            if not isinstance(self,X_OPER ) : self.texteComplexe += finTypeCompoSeq
+            if isinstance(self,X_PROC)      : self.texteComplexe += finTypeCompoEtape
+            if not isinstance(self,X_OPER ) and not dansFactorisationDeFusion: self.texteComplexe += finTypeCompo
+        else :
+            self.texteComplexe = ""
+
+        if self.ang != "" : self.texteElt=eltCompoDsSequenceWithHelp.format(self.nom,self.nomDuCodeDumpe,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs, self.ang)
+        elif self.fr != ""  : self.texteElt=eltCompoDsSequenceWithHelp.format(self.nom,self.nomDuCodeDumpe,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs, self.fr)
+        else : self.texteElt=eltCompoDsSequence.format(self.nom,self.nomDuCodeDumpe,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs)
+        #print ('------------------------------------------------',self.nom)
+        #print (self.texteComplexe)
+
+    def traduitMinMax(self):
+    # ______________________
+    # valable pour PROC et OPER
+        self.minOccurs = 0
+        self.maxOccurs = 1
+
+    def compare(self,autreMC):
+        if self.label != autreMC.label : return False
+        if hasattr(self,'nomXML') and hasattr(autreMC,'nomXML') and self.nomXML==autreMC.nomXML and self.nomXML != None : return True
+        for attr in (  'regles', 'fr',  'defaut', 'min' ,'max', 'position' , 'docu' ) :
+            val1=getattr(self,attr)
+            val2=getattr(autreMC,attr)
+            if val1 != val2 : return False
+        if len(self.entites) != len(autreMC.entites) : return False
+        for defFille in self.entites.keys():
+            if defFille not in autreMC.entites.keys() : return False
+            if not self.entites[defFille].compare(autreMC.entites[defFille]) : return False
+        return True
+
+    def prepareDumpXSD(self):
+        self.dejaPrepareDump=True
+        self.inUnion=False
+        self.tousLesFils=[]
+        self.mcXSD=[]
+        for nomMC in self.ordre_mc:
+            mc=self.entites[nomMC]
+            self.mcXSD.append(mc)
+            mc.prepareDumpXSD()
+        self.chercheListesDeBlocsNonDisjoints()
+        for l in list(self.listeDesBlocsNonDisjoints) :
+            if not(self.besoinDeFactoriserTrivial(l)) : self.listeDesBlocsNonDisjoints.remove(l)
+            else : self.factorise(l)
+
+    def chercheListesDeBlocsNonDisjoints(self):
+        self.listeDesBlocsNonDisjoints=[]
+        for nomChild in self.ordre_mc :
+            child=self.entites[nomChild]
+            if child.label != 'BLOC' : continue
+            if self.listeDesBlocsNonDisjoints == [] :
+                self.listeDesBlocsNonDisjoints.append([child])
+                continue
+            vraimentIndependant=True
+            for liste in list(self.listeDesBlocsNonDisjoints):
+                independant=True
+                for bloc in liste :
+                    if bloc.isDisjoint(child)   : continue
+                    if bloc.estLeMemeQue(child) : continue
+                    independant=False
+                    vraimentIndependant=False
+                if not (independant) :
+                    liste.append(child)
+            if vraimentIndependant:
+                self.listeDesBlocsNonDisjoints.append([child])
+        # on nettoye la liste des blocs tous seuls
+        for l in list(self.listeDesBlocsNonDisjoints) :
+            if len(l) ==1 : self.listeDesBlocsNonDisjoints.remove(l)
+
+    def estLeMemeQue(self,autreMC):
+        if hasattr(self,'nomXML') and hasattr(autreMC,'nomXML') and self.nomXML==autreMC.nomXML and self.nomXML != None: return True
+        return False
+
+    def aUnPremierCommunDansLesPossibles(self, laListe) :
+     # fonctionne avec liste de mc ou une liste(mc,index)
+        import types
+        mesPremiers=set()
+        for elt,index in laListe :
+            if not type(e) == types.ListType :
+                if elt.nom in mesPremiers : return True
+                mesPremiers.add(elt.nom)
+            else :
+                if elt[0].nom in mesPremiers : return True
+                mesPremiers.add(elt[0].nom)
+        return False
+
+    def besoinDeFactoriserTrivial(self,laListe):
+        # tout faux
+        # a revoir
+        return True
+        besoin=False
+        lesPremiers=set()
+        for mcBloc in laListe  :
+            mc=mcBloc.mcXSD[0]
+            if mc.label == 'BLOC'    : return True
+            if not(mc.statut=='o')   : return True
+            if mc.nom in lesPremiers : return True
+            lesPremiers.add(mc.nom)
+        return False
+
+    def factorise(self,liste,debug=False):
+        self.listeConstruction=liste
+        nomDebut=liste[0].nom
+        indexDebut=self.mcXSD.index(liste[0])
+        nomFin=liste[-1].nom
+        indexFin=self.mcXSD.index(liste[-1]) + 1
+        nom=nomDebut+'_'+nomFin
+        if debug : print ('___________ dans factorise', nom)
+        listeAFactoriser=[]
+        for  i in range(indexDebut, indexFin) :
+            listeAFactoriser.append(self.mcXSD[i])
+
+        newListe=self.mcXSD[0:indexDebut]
+
+        monEltFacteur=X_compoFactoriseAmbigu(nom,listeAFactoriser,self)
+        newListe.append(monEltFacteur)
+        newListe=newListe+self.mcXSD[indexFin:]
+        self.mcXSD=newListe
+        if debug :print ('___________ fin fin factorise', nom)
+
+    def construitTousLesFils(self):
+        for nomChild in self.ordre_mc :
+            if nomChild == 'Consigne' or nomChild == 'blocConsigne' : continue
+            child=self.entites[nomChild]
+            if child.label != 'BLOC' :
+                self.tousLesFils.append(child.nom)
+            else:
+                if child.tousLesFils == [] : child.construitTousLesFils()
+                for nomPetitFils in child.tousLesFils : self.tousLesFils.append(nomPetitFils)
+        #print ('construitArbreEntier pour ', self.nom, self.tousLesFils)
+
+
+    def isDisjoint(self, mc1) :
+        if self.tousLesFils == [] : self.construitTousLesFils()
+        if not (hasattr(mc1, 'tousLesFils')) : mc1.tousLesFils  = []
+        if mc1.tousLesFils  == []  : mc1.construitTousLesFils()
+        for fils in mc1.tousLesFils :
+            if fils in  self.tousLesFils : return False
+        return True
 
 
 
@@ -628,42 +785,43 @@ class X_definitionComposee (X_definition):
 class X_FACT (X_definitionComposee):
 #--------- ------------------------
 #Un FACT avec max=** doit se projeter en XSD sous forme d'une sequence a cardinalite 1 et
-# l'element qui porte la repetition du FACT  
-   def traduitMinMax(self):
-       if self.max     == '**' or self.max  == float('inf') : self.maxOccurs="unbounded"
-       else :                                                 self.maxOccurs = self.max
-       self.minOccurs = self.min
-       if self.statut =='f' : self.minOccurs=0
-
-   def construitArbrePossibles(self):
-       if self.statut   ==  'f' :
-          self.arbrePossibles = (self.nom,[])
-          self.arbreMCPossibles = (self,None)
-       else :
-          self.arbrePossibles = (self.nom,)
-          self.arbreMCPossibles = (self,)
-       #print ('XFACT arbre des possibles de ' ,self.nom, self.arbrePossibles)
+# l'element qui porte la repetition du FACT
+    def traduitMinMax(self):
+        if self.max     == '**' or self.max  == float('inf') : self.maxOccurs="unbounded"
+        else :                                                 self.maxOccurs = self.max
+        self.minOccurs = self.min
+        if self.statut =='f' : self.minOccurs=0
+        if self.statut =='o'  and self.min < 2: self.minOccurs=1
+
+    def construitArbrePossibles(self):
+        if self.statut   ==  'f' :
+            self.arbrePossibles = (self.nom,[])
+            self.arbreMCPossibles = (self,None)
+        else :
+            self.arbrePossibles = (self.nom,)
+            self.arbreMCPossibles = (self,)
+        #print ('XFACT arbre des possibles de ' ,self.nom, self.arbrePossibles)
 
 
 
 # ---------------------------------
 class X_OPER (X_definitionComposee):
 # ---------------------------------
-   def dumpXsd(self, dansFactorisation=False, multiple = False, first=False):
-       X_definitionComposee.dumpXsd(self,dansFactorisation)
-       self.texteComplexe += finTypeCompoSeq
-       self.texteComplexe += operAttributeName
-       self.texteComplexe += attributeTypeForASSD
-       self.texteComplexe += attributeTypeUtilisateurName.format(self.sd_prod.__name__)
-       self.texteComplexe += finTypeCompoEtape
-       self.texteComplexe += finTypeCompo
-
-
-       cata = CONTEXT.getCurrentCata() 
-       if self.sd_prod.__name__ not in list(cata.dictTypesASSDorUserASSDCrees) :
-          cata.dictTypesASSDorUserASSDCrees[self.sd_prod.__name__]=[self,]
-       else :
-          cata.dictTypesASSDorUserASSDCrees[self.sd_prod.__name__].append(self)
+    def dumpXsd(self, dansFactorisation=False, multiple = False, first=False):
+        X_definitionComposee.dumpXsd(self,dansFactorisation)
+        self.texteComplexe += finTypeCompoSeq
+        self.texteComplexe += attributeNameName
+        self.texteComplexe += attributeTypeForASSD
+        self.texteComplexe += attributeTypeUtilisateurName.format(self.sd_prod.__name__)
+        self.texteComplexe += finTypeCompoEtape
+        self.texteComplexe += finTypeCompo
+
+
+        cata = CONTEXT.getCurrentCata()
+        if self.sd_prod.__name__ not in list(cata.dictTypesASSDorUserASSDCrees) :
+            cata.dictTypesASSDorUserASSDCrees[self.sd_prod.__name__]=[self,]
+        else :
+            cata.dictTypesASSDorUserASSDCrees[self.sd_prod.__name__].append(self)
 
 
 # ----------------------------------
@@ -674,232 +832,422 @@ class X_PROC (X_definitionComposee):
 #-----------------------------------
 class X_BLOC (X_definitionComposee):
 #-----------------------------------
-   def dumpXsd(self, dansFactorisation=False, multiple = False, first=False):
-       self.tousLesFils=[]
-       
-       self.getNomDuCodeDumpe()
-       # dans ce cas les blocs successifs sont identiques et on ne dumpe que le 1er 
-
-       self.nomDuTypePyxb  = self.definitNomDuTypePyxb()
-       self.texteSimple    = "" # on n ajoute pas de type simple
-
-       # Pour les blocs le minOccurs vaut 0 et le max 1
-       #print ('dumpXsd Bloc', self.nom, self.aCreer)
-       if self.aCreer :
-          self.texteComplexe = debutTypeSubst.format(self.nomDuTypePyxb)
-          texteComplexeVenantDesFils=self.CreeTexteComplexeVenantDesFils(dansFactorisation)
-          self.texteComplexe  = texteComplexeVenantDesFils + self.texteComplexe
-          self.texteComplexe += finTypeSubst
-       else :
-          self.texteComplexe = ""
-
-       self.texteElt=substDsSequence.format(self.code,self.nomDuTypePyxb,0,1)
-
-       #print ('------------------------------------------------')
-
-   def compare(self,autreMC):
-       if self.label != autreMC.label : return False
-       if self.inUnion == True or autreMC.inUnion == True : return False
-       if hasattr(self,'nomXML') and hasattr(autreMC,'nomXML') and self.nomXML==autreMC.nomXML and self.nomXML != None : return True
-       for attr in ( 'condition', 'regles', ):
-           val1=getattr(self,attr)
-           val2=getattr(autreMC,attr)
-           if val1 != val2 : return False
-       for defFille in self.entites.keys():
-           if defFille not in autreMC.entites.keys() : return False
-           if not self.entites[defFille].compare(autreMC.entites[defFille]) : return False
-       return True
-
-   def construitArbrePossibles(self):
-       self.arbrePossibles=[[],]
-       #print ('X_BLOC je construis l arbre des possibles pour ', self.nom)
-       for child in self.mcXSD :
-          if not hasattr(child, 'arbrePossibles') : child.construitArbrePossibles()
-          #print (child.nom, child.label, child.arbrePossibles)
-          if child.label == 'BLOC' : 
-              self.arbrePossibles = deepcopy(self.remplaceListeParContenuEtVide(self.arbrePossibles, child.arbrePossibles))
-          elif child.label == 'BlocAmbigu':
-              #print ("je passe par la pour", self.nom, child.nom, self.arbrePossibles, child.arbrePossibles)
-              self.arbrePossibles = deepcopy(self.remplaceListeParContenuEtVide(self.arbrePossibles, child.arbrePossibles))
-              #print ('resultat', self.arbrePossibles)
-          else :
-              self.arbrePossibles = deepcopy(self.adjoint(self.arbrePossibles, child.arbrePossibles))
-       self.arbrePossibles.append([]) # un bloc n est pas obligatoire
-       #print ('arbre des possibles de ' ,self.nom, self.arbrePossibles)
+    def dumpXsd(self, dansFactorisation=False, multiple = False, first=False, debug = False):
+        if debug : print ('X_BLOC dumpXsd', self.nom)
+        self.tousLesFils=[]
+        if self.nom == 'blocConsigne' :
+            self.texteComplexe = ""
+            self.texteSimple   = ""
+            self.nomDuTypePyxb = "NonTraiteConsigne"
+            self.texteSimpleVenantDesFils = ""
+            self.aCreer = False
+            self.texteElt = ""
+
+            return
+        self.getNomDuCodeDumpe()
+        # dans ce cas les blocs successifs sont identiques et on ne dumpe que le 1er
+
+        self.nomDuTypePyxb  = self.definitNomDuTypePyxb()
+        self.texteSimple    = "" # on n ajoute pas de type simple
+
+        # Pour les blocs le minOccurs vaut 0 et le max 1
+        if self.aCreer :
+            self.texteComplexe = debutTypeSubst.format(self.nomDuTypePyxb)
+            texteComplexeVenantDesFils=self.creeTexteComplexeVenantDesFils(dansFactorisation)
+            self.texteComplexe  = texteComplexeVenantDesFils + self.texteComplexe
+            self.texteComplexe += finTypeSubst
+
+        else :
+            self.texteComplexe = ""
+
+        self.texteElt=substDsSequence.format(self.code,self.nomDuTypePyxb,0,1,'condition : ' +self.condition)
+
+        #print ('------------------------------------------------')
+
+    def compare(self,autreMC):
+        if self.label != autreMC.label : return False
+        if self.inUnion == True or autreMC.inUnion == True : return False
+        if hasattr(self,'nomXML') and hasattr(autreMC,'nomXML') and self.nomXML==autreMC.nomXML and self.nomXML != None : return True
+        for attr in ( 'condition', 'regles', ):
+            val1=getattr(self,attr)
+            val2=getattr(autreMC,attr)
+            if val1 != val2 : return False
+        if len(self.entites) != len(autreMC.entites) : return False
+        for defFille in self.entites.keys():
+            if defFille not in autreMC.entites.keys() : return False
+            if not self.entites[defFille].compare(autreMC.entites[defFille]) : return False
+        return True
+
+    def construitArbrePossibles(self):
+        self.arbrePossibles=[[],]
+        #print ('X_BLOC je construis l arbre des possibles pour ', self.nom)
+        for child in self.mcXSD :
+            if not hasattr(child, 'arbrePossibles') : child.construitArbrePossibles()
+            #print (child.nom, child.label, child.arbrePossibles)
+            if child.label == 'BLOC' :
+                self.arbrePossibles = deepcopy(self.remplaceListeParContenuEtVide(self.arbrePossibles, child.arbrePossibles))
+            elif child.label == 'BlocAmbigu':
+                #print ("je passe par la pour", self.nom, child.nom, self.arbrePossibles, child.arbrePossibles)
+                self.arbrePossibles = deepcopy(self.remplaceListeParContenuEtVide(self.arbrePossibles, child.arbrePossibles))
+                #print ('resultat', self.arbrePossibles)
+            else :
+                self.arbrePossibles = deepcopy(self.adjoint(self.arbrePossibles, child.arbrePossibles))
+        self.arbrePossibles.append([]) # un bloc n est pas obligatoire
+        #print ('arbre des possibles de ' ,self.nom, self.arbrePossibles)
 
 
 #--------------------------------
 class X_SIMP (X_definition):
 #--------------------------------
-   def dumpXsd(self, dansFactorisation=False, multiple = False, first=False):
-       #print ('_______________' , '*******************', 'je passe la dans dumpXsd SIMP', self.nom, multiple, first)
-       if PourTraduction  : print (self.nom)
-       self.prepareDumpXSD()
-       if multiple : self.inUnion=True
-       #print ('exploreObjet SIMP')
-       self.getNomDuCodeDumpe()
-       self.aCreer = True
-       self.texteComplexe = ""
-       self.texteSimple   = ""
-       self.texteElt      = ""
-       if self.nom =='Consigne' : return
-
-       #  --> homonymie on peut utiliser genealogie ?
-       self.nomDuTypeDeBase = self.traduitType()
-       if not multiple : 
-          self.nomDuTypePyxb   = self.definitNomDuTypePyxb()
-          if first : self.aCreer = True
-       elif first :
-          self.nomDuTypePyxb   = self.definitNomDuTypePyxb(forceACreer=1)
-          self.aCreer = True
-       #else : print ('multiple and not first', self.aCreer)
+    def dumpXsd(self, dansFactorisation=False, multiple=False, first=False, debug=False):
+        #debug = True
+        #if PourTraduction  : print (self.nom)
+        if debug : print ('X_SIMP dumpXsd pour', self.nom, '___________________________')
+        self.prepareDumpXSD()
+        # si inUnion la comparaison est fausse : on cree le nomDuType
+        if multiple : self.inUnion=True
+        #print ('exploreObjet SIMP')
+        self.getNomDuCodeDumpe()
+        self.aCreer = True
+        self.texteComplexe = ""
+        self.texteSimple   = ""
+        self.texteElt      = ""
+        if self.nom =='Consigne' : return
+
+        #  --> homonymie on peut utiliser genealogie ?
+        self.nomDuTypeDeBase = self.traduitType()
+        if debug : print ('nomDuTypeDeBase', self.nomDuTypeDeBase)
+        if debug : print ('multiple', multiple, 'first', first)
+        if not multiple :
+            self.nomDuTypePyxb   = self.definitNomDuTypePyxb()
+        else :
+            if first :
+                # on force la creation
+                self.nomDuTypePyxb   = self.definitNomDuTypePyxb()
+                self.aCreer = True
+            else :
+                self.nomDuTypePyxb='NonDetermine'
 
-    
-       
-       # on se sert des listes ou non pour  la gestion des minOccurs /maxOccurs est > 0
-       if self.statut =='f' : minOccurs = 0
-       else                 : minOccurs = 1
-       if dansFactorisation : minOccurs = 1
-
-       #print ('minOccurs',minOccurs)
-       # le defaut est dans l elt Name -> tester la coherence d existence avec Accas
-       # regles Accas
-       if (hasattr (self, 'nomXML')) and self.nomXML != None : nomUtil=self.nomXML
-       else : nomUtil = self.nom
-
-       # pas d elt si on est dans multiple
-       # sauf si on est le '1er'  dans un element ambigu 
-       if not multiple : 
-          #print ('je passe la pas multiple')
-          if self.defaut : 
-             if self.max > 1 or self.max == '**' or self.max ==  float('inf') : 
-                # a revoir pour les tuples avec defaut
-                txtDefaut=""
-                for val in self.defaut : txtDefaut+=str(val) +" "
-                self.texteElt = eltWithDefautDsSequence.format(nomUtil,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
-             else :
-                if str(self.defaut) == 'True' : txtDefaut = 'true'
-                else : txtDefaut = str(self.defaut)
-                self.texteElt = eltWithDefautDsSequence.format(nomUtil,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
-          else : self.texteElt = eltDsSequence.format(nomUtil,self.code,self.nomDuTypePyxb,minOccurs,1)
-       elif first: 
-          self.texteElt = eltDsSequence.format(nomUtil,self.code,self.nomDuTypePyxb,1,1)
-    
-       # self.aCreer est mis a jour ds definitNomDuTypePyxb
-       # ou si elt est le 1er d une liste identique
-       if not self.aCreer : return
-       if not multiple : self.texteSimple  += debutSimpleType.format(self.nomDuTypePyxb)
-       else : self.texteSimple  += debutSimpleTypeSsNom
-       # On est dans une liste
-       if self.max > 1 or self.max == '**' or self.max ==  float('inf') or  hasattr(self.type[0], 'ntuple') : 
-          self.texteSimple  += debutTypeSimpleListe
-          self.texteSimple  += "\t\t\t\t"+debutRestrictionBase.format(self.nomDuTypeDeBase)
-          if self.val_min != float('-inf')  : self.texteSimple += "\t\t\t\t"+minInclusiveBorne.format(self.val_min)
-          if self.val_max != float('inf') and self.val_max != '**' : self.texteSimple +="\t\t\t\t"+ maxInclusiveBorne.format(self.val_max) 
-          if self.into != None:
-             # PN --> traduction des into 
-             into=self.into
-             if self.intoXML != None : into = self.intoXML
-             for val in into : self.texteSimple += "\t\t\t\t"+enumeration.format(val)
-             if PourTraduction  : 
-                for val in into : print (str(val))
-          self.texteSimple  += fermeBalisesMileu
-          if  self.max !=1 and self.max != '**' and self.max !=  float('inf') : self.texteSimple  += maxLengthTypeSimple.format(self.max)
-          if  self.min !=1 and self.min !=  float('-inf') : self.texteSimple  += minLengthTypeSimple.format(self.min) 
-          self.texteSimple  += fermeRestrictionBase
-       else :
-       # ou pas
-         self.texteSimple  += debutRestrictionBase.format(self.nomDuTypeDeBase)
-         if self.val_min != float('-inf')  : self.texteSimple += minInclusiveBorne.format(self.val_min)
-         if self.val_max != float('inf') and self.val_max != '**' : self.texteSimple += maxInclusiveBorne.format(self.val_max) 
-         if self.into != None:
-            into=self.into
-            if self.intoXML != None : into = self.intoXML
-            for val in into : self.texteSimple += enumeration.format(val)
-            if PourTraduction  : 
-                for val in into : print (str(val))
-         self.texteSimple  += fermeRestrictionBase
-       self.texteSimple  += fermeSimpleType
-
-
-   def prepareDumpXSD(self):
-       self.inUnion=False
-       if self.statut   ==  'f' :
-          self.arbrePossibles = (self.nom,[])
-       else :
-          self.arbrePossibles = (self.nom,)
-       self.mcXSD=[]
-
-
-
-   def traduitType(self):
-       # il faut traduire le min et le max
-       # il faut ajouter les regles
-       # il faut gerer les types tuple et fichier
-       if hasattr(self.type[0], 'ntuple') : 
-          try :
-             leType=self.validators.typeDesTuples[0]
-             for i in range(self.type[0].ntuple):
-                 if self.validators.typeDesTuples[i] != leType : return ('XXXXXXXX')
-             typeATraduire=leType
-          except : 
-             return ('XXXXXXXX')
-       else : 
-             typeATraduire=self.type[0]
-       if not (typeATraduire in list(dictNomsDesTypes.keys())) :
-          if (isinstance(typeATraduire, Accas.ASSD) or issubclass(typeATraduire, Accas.ASSD)) : 
-             # cas d une creation
-             cata = CONTEXT.getCurrentCata() 
-             if len(self.type) == 2 and self.type[1]=='createObject' : 
-                if typeATraduire.__name__ not in list(cata.dictTypesASSDorUserASSDCrees) :
-                    cata.dictTypesASSDorUserASSDCrees[typeATraduire.__name__]=[self,]
+        if debug : print ('nomDuTypePyxb', self.nomDuTypePyxb)
+        if debug : print ('aCreer', self.aCreer)
+
+
+        # on se sert des listes ou non pour  la gestion des minOccurs /maxOccurs est > 0
+        if self.statut =='f' : minOccurs = 0
+        else                 : minOccurs = 1
+        if dansFactorisation : minOccurs = 1
+
+        if self.suisUneMatrice :
+           self.dumpSpecifiqueMatrice(minOccurs)
+           return
+
+        if self.suisUnTuple :
+           self.dumpSpecifiqueTuple(minOccurs)
+           return
+
+        if self.avecBlancs and self.max > 1 :
+           #print ('je suis avec blanc pour ', self.nom)
+           self.dumpSpecifiqueTexteAvecBlancs(minOccurs,multiple)
+           return
+
+        #print ('minOccurs',minOccurs)
+        # le defaut est dans l elt Name -> tester la coherence d existence avec Accas
+        # regles Accas
+
+        # pas d elt si on est dans multiple
+        # sauf si on est le '1er'  dans un element ambigu
+        if not multiple :
+            #print ('je passe la pas multiple')
+            texteAide = ""
+            if self.ang != '' : texteAide = self.ang
+            else : texteAide = self.fr
+            if self.intoXML and self.into :
+               if self.intoXML != self.into :
+                  #print ('je passe la pour ', self.nom)
+                  texteAide :texteAide =  texteAide+'\nPossible choices for '+ self.nom + 'at this place : \n'+str(self.into)+'\n'
+
+            if self.defaut :
+               if self.max > 1 or self.max == '**' or self.max ==  float('inf') : 
+                    txtDefaut=""
+                    for val in self.defaut : txtDefaut+=str(val) + " " 
+                    # cela ne fonctionne pas tres bien. a revoir
+                    txtDefaut+=txtDefaut[0:-1]
+                    if not('TXM' in (self.type)) : 
+                        # a revoir pour les tuples avec defaut
+                        if texteAide != ''  : self.texteElt = eltDsSequenceWithDefautAndHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,texteAide)
+                        else : self.texteElt = eltDsSequenceWithDefaut.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
+                    else :
+                        texteAide +=  texteAide+'\ndefault Value in MDM : \n'+txtDefaut
+                        self.texteElt = eltDsSequenceWithHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,texteAide)
+               else :
+                    if str(self.defaut)   == 'True'  : txtDefaut = 'true'
+                    elif str(self.defaut) == 'False' : txtDefaut = 'false'
+                    else : txtDefaut = str(self.defaut)
+                    if texteAide != ''  : self.texteElt = eltDsSequenceWithDefautAndHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,texteAide)
+                    else : self.texteElt = eltDsSequenceWithDefaut.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
+            else :
+               if texteAide  != '' : self.texteElt = eltDsSequenceWithHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,texteAide)
+               else : self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1)
+        elif first:
+            # l'aide est geree a la fusion 
+            self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,1,1)
+
+        # self.aCreer est mis a jour ds definitNomDuTypePyxb
+        # ou si elt est le 1er d une liste identique
+        if debug : print ('je suis aCreer', self.aCreer)
+        if not self.aCreer : return
+
+        typeATraduire=self.type[0]
+
+        self.texteSimplePart1=""
+        if not(isinstance(typeATraduire,str)) and not(isinstance(typeATraduire,Accas.Tuple)) and issubclass(typeATraduire, Accas.UserASSD) :
+            cata = CONTEXT.getCurrentCata()
+            if len(self.type) == 2 and self.type[1]=='createObject' : suffixe = 'C'
+            else : suffixe = 'U' 
+            #print (cata.listeUserASSDDumpes)
+            #print (typeATraduire.__name__)
+            #print (typeATraduire.__name__ in cata.listeUserASSDDumpes)
+            if typeATraduire.__name__  not in cata.listeUserASSDDumpes :
+                cata.listeUserASSDDumpes.add(typeATraduire.__name__)
+                if issubclass(typeATraduire, Accas.UserASSDMultiple) : 
+                   self.texteSimplePart1 = defUserASSDMultiple.format(typeATraduire.__name__)
+                   if cata.definitUserASSDMultiple == False  :
+                      cata.definitUserASSDMultiple = True
+                      cata.texteSimple = cata.texteSimple + defBaseXSDUserASSDMultiple
                 else :
-                    cata.dictTypesASSDorUserASSDCrees[typeATraduire.__name__].append(self)
-                return 'xs:string'
-
-             # cas d une consommation
-             if typeATraduire not in list(cata.dictTypesASSDorUserASSDUtilises) :
-                cata.dictTypesASSDorUserASSDUtilises[typeATraduire]=[self,]
-             else :
-                cata.dictTypesASSDorUserASSDUtilises[typeATraduire].append(self,)
-             return 'xs:string'
-          else : return ('YYYYY')
-       return dictNomsDesTypes[typeATraduire]
+                   self.texteSimplePart1 = defUserASSD.format(typeATraduire.__name__)
+                   if cata.definitUserASSD == False  :
+                      cata.definitUserASSD = True
+                      cata.texteSimple = cata.texteSimple + defBaseXSDUserASSD
+            if typeATraduire.__name__+'_'+suffixe not in cata.listeUserASSDDumpes :
+                cata.texteSimple = cata.texteSimple + defUserASSDOrUserASSDMultiple.format(typeATraduire.__name__, suffixe,typeATraduire.__name__)
+                cata.listeUserASSDDumpes.add(typeATraduire.__name__+'_'+suffixe)
+
+
+        if not multiple : self.texteSimple  += debutSimpleType.format(self.nomDuTypePyxb)
+        else : self.texteSimple  += debutSimpleTypeSsNom
+        # On est dans une liste
+        if self.max > 1 or self.max == '**' or self.max ==  float('inf') or  hasattr(self.type[0], 'ntuple') :
+            self.texteSimple  += debutTypeSimpleListe
+            self.texteSimple  += "\t\t\t\t"+debutRestrictionBase.format(self.nomDuTypeDeBase)
+            if self.val_min != float('-inf')  : self.texteSimple += "\t\t\t\t"+minInclusiveBorne.format(self.val_min)
+            if self.val_max != float('inf') and self.val_max != '**' : self.texteSimple +="\t\t\t\t"+ maxInclusiveBorne.format(self.val_max)
+            if self.into != None:
+                # PN --> traduction des into
+                into=self.into
+                if self.intoXML != None : into = self.intoXML
+                for val in into : self.texteSimple += "\t\t\t\t"+enumeration.format(val)
+                if PourTraduction  :
+                    for val in into : print (str(val))
+            self.texteSimple  += fermeBalisesMileu
+            if  self.max !=1 and self.max != '**' and self.max !=  float('inf') : self.texteSimple  += maxLengthTypeSimple.format(self.max)
+            if  self.min !=1 and self.min !=  float('-inf') : self.texteSimple  += minLengthTypeSimple.format(self.min)
+            self.texteSimple  += fermeRestrictionBase
+        else :
+        # ou pas
+            self.texteSimple  += debutRestrictionBase.format(self.nomDuTypeDeBase)
+            if self.val_min != float('-inf')  : self.texteSimple += minInclusiveBorne.format(self.val_min)
+            if self.val_max != float('inf') and self.val_max != '**' : self.texteSimple += maxInclusiveBorne.format(self.val_max)
+            if self.into != None:
+                into=self.into
+                if self.intoXML != None : into = self.intoXML
+                for val in into : self.texteSimple += enumeration.format(val)
+                if PourTraduction  :
+                    for val in into : print (str(val))
+            self.texteSimple  += fermeRestrictionBase
+        self.texteSimple  += fermeSimpleType
+        self.texteSimplePart2 = self.texteSimple
+        self.texteSimple = self.texteSimplePart1 + self.texteSimplePart2
+
+
+    def dumpSpecifiqueTexteAvecBlancs(self,minOccurs,multiple):
+        # attention multiple non traite
+        # pour l instant on n a pas max =1 et on ne traite pas les into
+
+        texteAide = ""
+        if  self.ang != '' : texteAide = self.ang
+        elif self.fr != '' : texteAide = self.fr
+
+        self.texteElt = eltDsSequenceWithHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,texteAide)
+        txtDefaut=""
+        # Pas de Defaut pour les string en XSD
+        # max sert pour la taille de la liste
+        if self.defaut : texteAide += ' Valeur par defaut dans le comm : '+str(self.defaut)
+        if texteAide != ''  : self.texteElt = eltDsSequenceWithHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,texteAide)
+        else : self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1)
+         
+        
+        if self.max == '**' or self.max ==  float('inf') : max='unbounded'
+        else  : max = self.max
   
-   def traduitValMinValMax(self):
-       self.maxInclusive=self.val_max
-       self.minInclusive=self.val_min
-       if self.val_min == float('-inf') and val_max== float('inf') : return
-       #print ('il faut affiner le type du SIMP ', self.nom)
-       if self.val_max == '**' or self.val_max == float('inf') : self.maxInclusive=None
-       else : self.maxInclusive = self.val_max
-       if self.val_min == '**' or self.val_max == float('-inf') : self.maxInclusive=None
-       else : self.minInclusive = self.val_min
-       
-   def traduitMinMax(self):
-       if self.min == 1 and self.max == 1 :  return
-       #print ('il faut creer une liste ' , self.nom)
-   def compare(self,autreMC):
-       if self.label != autreMC.label : return False
-       if self.inUnion == True or autreMC.inUnion == True : return False
-       listeAComparer = [ 'type', 'defaut', 'min' ,'max' ,'val_min' , 'val_max' ]
-       if self.intoXML != None : listeAComparer.append('intoXML')
-       else : listeAComparer.append('into')
-       if (hasattr (self, 'nomXML')) and self.nomXML != None : nomUtil=self.nomXML
-       for attr in listeAComparer :
-           val1=getattr(self,attr)
-           val2=getattr(autreMC,attr)
-           if val1 != val2 : return False
-       return True
-
-   def construitArbrePossibles(self):
-       if self.statut   ==  'f' :
-          self.arbrePossibles = (self.nom,[])
-       else :
-          self.arbrePossibles = (self.nom,)
-       #print ('SIMP arbre des possibles de ' ,self.nom, self.arbrePossibles)
+        if self.max > 1 : # juste au cas ou on traite 1 pareil
+            self.texteSimple = ''
+            cata = CONTEXT.getCurrentCata()
+            if self.nomDuTypePyxb in cata.listeTypeTXMAvecBlancs: return
+            cata.listeTypeTXMAvecBlancs.add(self.nomDuTypePyxb)
+            self.texteSimple = complexChaineAvecBlancs.format(self.nomDuTypePyxb,max,self.nomDuTypePyxb)
+            if self.intoXML != None : into = self.intoXML
+            else : into = self.into
+            if into  == None :
+               self.texteSimple += typeEltChaineAvecBlancSansInto.format(self.nomDuTypePyxb)
+            else : 
+               self.texteSimple += debutChaineAvecBlancsInto.format(self.nomDuTypePyxb)
+               for val in into : self.texteSimple += milieuChaineAvecBlancsInto.format(val)
+               self.texteSimple += finChaineAvecBlancsInto
+           
+        
+    def dumpSpecifiqueTuple(self,minOccurs):
+        self.nomDuTypeDeBase = self.traduitType()
+        tousPareil=True
+        # il faut gerer l aide et les defaut
+        if self.defaut : print ('il faut tester le defaut')
+        if self.max == '**' or self.max ==  float('inf') : max='unbounded'
+        else  : max = self.max
+        self.texteElt = tupleNonHomogeneElt.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,max)
+        leType=self.nomDuTypeDeBase[0]
+        for leTypeComp in self.nomDuTypeDeBase[1:] :
+            if leTypeComp != leType : 
+                tousPareil = False
+                break;
+        #if tousPareil :
+        #PN PN a statuer
+        #    self.texteSimple  += debutSimpleType.format(self.nomDuTypePyxb)
+        #    self.texteSimple  += debutTypeSimpleListe
+        #    self.texteSimple  += "\t\t\t\t"+debutRestrictionBase.format(leType)
+        #    if self.val_min != float('-inf')  : self.texteSimple += "\t\t\t\t"+minInclusiveBorne.format(self.val_min)
+        #    if self.val_max != float('inf') and self.val_max != '**' : self.texteSimple +="\t\t\t\t"+ maxInclusiveBorne.format(self.val_max)
+        #    if self.into != None:
+        #        into=self.into
+        #        if self.intoXML != None : into = self.intoXML
+        #        for val in into : self.texteSimple += "\t\t\t\t"+enumeration.format(val)
+        #        if PourTraduction  : 
+        #            for val in into : print (str(val))
+        #    self.texteSimple  += fermeBalisesMileu
+        #    if self.max !=1 and self.max != '**' and self.max !=  float('inf') : self.texteSimple  += maxLengthTypeSimple.format(self.max)
+        #    if self.min !=1 and self.min !=  float('-inf') : self.texteSimple  += minLengthTypeSimple.format(self.min)
+        #    self.texteSimple  += fermeSimpleType
+        #    return
+
+        self.texteSimple = ''
+        complexeTypeTuple = tupleDebutComplexeType.format(self.nomDuTypePyxb)
+        num = 1
+        for leType in self.nomDuTypeDeBase :
+            self.texteSimple  += tupleNonHomogeneSimpleType.format(self.nomDuTypePyxb,str(num),leType)
+            complexeTypeTuple += tupleMilieuComplexeType.format(str(num),self.nomDuTypePyxb,str(num))
+            num = num + 1
+        complexeTypeTuple += tupleFinComplexeType
+        self.texteSimple  += complexeTypeTuple
+              
+
+    def dumpSpecifiqueMatrice(self,minOccurs):
+    # if faut traiter le defaut
+        typeDeMatrice =self.type[0]
+
+        self.texteSimple  += debutSimpleType.format(self.nomDuTypePyxb+'_element')
+        self.texteSimple  += debutRestrictionBase.format(self.nomDuTypeDeBase)
+        if typeDeMatrice.typEltInto != None:
+            for val in typeDeMatrice.typEltInto : self.texteSimple += enumeration.format(val)
+        self.texteSimple  += fermeRestrictionBase
+        self.texteSimple += fermeSimpleType
+        nom=self.nomDuTypePyxb
+        nbCols=typeDeMatrice.nbCols
+        nbLigs=typeDeMatrice.nbCols
+        self.texteSimple += matriceSimpleType.format(nom,nom,nbCols,nom,self.code,nom,nbLigs,nbLigs,nom,self.code,nom,self.min,self.max)
+        self.texteElt = eltMatrice.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1)
+
+        
+    def prepareDumpXSD(self):
+        self.inUnion=False
+        if self.statut   ==  'f' : self.arbrePossibles = (self.nom,[])
+        else                     : self.arbrePossibles = (self.nom,)
+        self.mcXSD=[]
+
+
+
+    def traduitType(self,debug=False):
+        # il faut traduire le min et le max
+        # il faut ajouter les regles
+        # il faut gerer les types tuple et fichier
+        # on ne paut pas tester le type qui depend du cataloge
+        if hasattr(self.type[0], 'typElt') : 
+            #print ('je suis une Matrice de ' ,dictNomsDesTypes[self.type[0].typElt]) 
+            self.suisUneMatrice = True
+            # on presume que le type de l elt est un ASSD
+            if self.type[0].typElt not in dictNomsDesTypes.keys(): return 'xs:string'
+            return dictNomsDesTypes[self.type[0].typElt] 
+        else :
+            self.suisUneMatrice = False
+        if hasattr(self.type[0], 'ntuple') :
+            self.suisUnTuple = True
+            # Pour l instant pas de into dans les tuples non homogenes et pas de reference
+            # sinon, il faudra faire un for sur la suite avec les createObjet
+            leType=self.validators.typeDesTuples[0]
+            enRetour=[]
+            for i in range(self.type[0].ntuple):
+                enRetour.append(dictNomsDesTypes[self.validators.typeDesTuples[i]])
+            return enRetour
+            #typeATraduire=leType
+        else :
+            self.suisUnTuple = False
+            typeATraduire=self.type[0]
+        if not (typeATraduire in list(dictNomsDesTypes.keys())) :
+            #if (isinstance(typeATraduire, Accas.ASSD) or issubclass(typeATraduire, Accas.ASSD)) :
+            if (not(isinstance(typeATraduire,str)) and issubclass(typeATraduire, Accas.ASSD)) :
+            # cas d une creation
+                cata = CONTEXT.getCurrentCata()
+                # PNPNPN a Revoir pour la creation des keyrefs
+                if len(self.type) == 2 and self.type[1]=='createObject' :
+                    if typeATraduire.__name__ not in list(cata.dictTypesASSDorUserASSDCrees) :
+                        cata.dictTypesASSDorUserASSDCrees[typeATraduire.__name__]=[self,]
+                    else :
+                        cata.dictTypesASSDorUserASSDCrees[typeATraduire.__name__].append(self)
+                    if issubclass(typeATraduire, Accas.UserASSD) : return typeATraduire.__name__+'_C'
+                    else : return  'xs:string'
+
+                # cas d une consommation
+                if typeATraduire not in list(cata.dictTypesASSDorUserASSDUtilises) :
+                    cata.dictTypesASSDorUserASSDUtilises[typeATraduire]=[self,]
+                else :
+                    cata.dictTypesASSDorUserASSDUtilises[typeATraduire].append(self,)
+                if issubclass(typeATraduire, Accas.UserASSD) : return typeATraduire.__name__+'_U'
+                else : return  'xs:string'
+            else : return ('YYYYY')
+        return dictNomsDesTypes[typeATraduire]
+
+    def traduitValMinValMax(self):
+        self.maxInclusive=self.val_max
+        self.minInclusive=self.val_min
+        if self.val_min == float('-inf') and val_max== float('inf') : return
+        #print ('il faut affiner le type du SIMP ', self.nom)
+        if self.val_max == '**' or self.val_max == float('inf') : self.maxInclusive=None
+        else : self.maxInclusive = self.val_max
+        if self.val_min == '**' or self.val_max == float('-inf') : self.maxInclusive=None
+        else : self.minInclusive = self.val_min
+
+    def traduitMinMax(self):
+        if self.min == 1 and self.max == 1 :  return
+        #print ('il faut creer une liste ' , self.nom)
+
+    def compare(self,autreMC):
+        if self.label != autreMC.label : return False
+        if self.inUnion == True or autreMC.inUnion == True : return False
+        if hasattr(self,'nomXML') and hasattr(autreMC,'nomXML') and self.nomXML==autreMC.nomXML and self.nomXML != None : return True
+        listeAComparer = [ 'type', 'defaut', 'min' ,'max' ,'val_min' , 'val_max' ]
+        if self.intoXML != None : listeAComparer.append('intoXML')
+        else : listeAComparer.append('into')
+        if (hasattr (self, 'nomXML')) and self.nomXML != None : nomUtil=self.nomXML
+        for attr in listeAComparer :
+            val1=getattr(self,attr)
+            val2=getattr(autreMC,attr)
+            if val1 != val2 : return False
+        return True
+
+    def construitArbrePossibles(self):
+        if self.statut   ==  'f' :
+            self.arbrePossibles = (self.nom,[])
+        else :
+            self.arbrePossibles = (self.nom,)
+        #print ('SIMP arbre des possibles de ' ,self.nom, self.arbrePossibles)
 
 
 #-----------------
@@ -907,7 +1255,7 @@ class X_JDC_CATA :
 #-----------------
 
     def dumpXsd(self, avecEltAbstrait,  debug = True):
-        cata = CONTEXT.getCurrentCata() 
+        cata = CONTEXT.getCurrentCata()
         if debug : print ('avecEltAbstrait   -------------------', avecEltAbstrait)
 
         if debug : print ('self.importedBy -------------------', self.importedBy)
@@ -915,19 +1263,19 @@ class X_JDC_CATA :
 
         self.texteSimple   = ""
         self.texteComplexe = ""
-        self.texteCata     = ""  
+        self.texteCata     = ""
         self.texteDeclaration  = ""
         self.texteInclusion    = ""
         self.texteElt          = ""
         self.texteTypeAbstrait = ""
 
         if self.implement == "" :
-           self.nomDuCodeDumpe = self.code
-           self.implement      = self.code
-           self.nomDuXsdPere   = self.code
+            self.nomDuCodeDumpe = self.code
+            self.implement      = self.code
+            self.nomDuXsdPere   = self.code
         else :
-           self.implement,self.nomDuXsdPere=self.implement.split(':')
-           self.nomDuCodeDumpe = self.implement
+            self.implement,self.nomDuXsdPere=self.implement.split(':')
+            self.nomDuCodeDumpe = self.implement
 
         if debug : print ('self.implement       -------------------', self.implement)
         if debug : print ('self.nomDuCodeDumpe   -------------------', self.nomDuCodeDumpe)
@@ -937,13 +1285,16 @@ class X_JDC_CATA :
         self.dumpLesCommandes()
 
         if self.implement == self.code :
-           self.texteCata += eltAbstraitCataPPal.format(self.code)
-           self.texteCata += eltCataPPal.format(self.code,self.code,self.code)
+            self.texteCata += eltAbstraitCataPPal.format(self.code)
+            if 0 : pass
+            else  : self.texteCata += eltCataPPal.format(self.code,self.code,self.code)
         else :
-           self.texteCata += eltAbstraitCataFils.format(self.implement,self.nomDuXsdPere,self.nomDuXsdPere)
-           self.texteCata += eltCataFils.format(self.implement,self.nomDuXsdPere,self.nomDuXsdPere,self.nomDuXsdPere)
-           self.texteInclusion += includeCata.format(self.nomDuXsdPere)
+            self.texteCata += eltAbstraitCataFils.format(self.implement,self.nomDuXsdPere,self.nomDuXsdPere)
+            if 0 : pass
+            else : self.texteCata += eltCataFils.format(self.implement,self.nomDuXsdPere,self.nomDuXsdPere,self.nomDuXsdPere)
+            self.texteInclusion += includeCata.format(self.nomDuXsdPere)
 
+    
         self.texteCata += eltCata.format(self.implement,self.implement,self.implement,self.implement,self.nomDuXsdPere)
         #if self.implement == self.code :
         #   self.texteCata      += debutTypeCata.format(self.nomDuCodeDumpe)
@@ -954,7 +1305,7 @@ class X_JDC_CATA :
 
 
 
-        #for codeHeritant in self.importedBy: 
+        #for codeHeritant in self.importedBy:
         #    self.texteCata += eltCodeSpecDsCata.format(codeHeritant)
         #    self.texteTypeAbstrait += eltAbstrait.format(codeHeritant,codeHeritant,self.code,codeHeritant)
 
@@ -967,11 +1318,11 @@ class X_JDC_CATA :
         #   self.texteElt  = eltCata.format(self.nomDuCodeDumpe,self.code, self.nomDuTypePyxb)
 
         if self.implement == self.code :
-           self.texteXSD  = texteDebut.format(self.code,self.code,self.code,self.code,self.code,self.code)
+            self.texteXSD  = texteDebut.format(self.code,self.code,self.code,self.code,self.code,self.code)
         elif self.nomDuXsdPere ==  self.code :
-           self.texteXSD  = texteDebutNiveau2.format(self.code,self.implement,self.code,self.code,self.code, self.code,self.code,self.code,self.code,self.code)
-        else : 
-           self.texteXSD  = texteDebutNiveau3.format(self.code,self.implement,self.code,self.nomDuXsdPere,self.code,self.code,self.code, self.code,self.code,self.code,self.code,self.code)
+            self.texteXSD  = texteDebutNiveau2.format(self.code,self.implement,self.code,self.code,self.code, self.code,self.code,self.code,self.code,self.code)
+        else :
+            self.texteXSD  = texteDebutNiveau3.format(self.code,self.implement,self.code,self.nomDuXsdPere,self.code,self.code,self.code, self.code,self.code,self.code,self.code,self.code)
 
         if self.texteInclusion != ""   : self.texteXSD += self.texteInclusion
         self.texteXSD += self.texteSimple
@@ -980,114 +1331,144 @@ class X_JDC_CATA :
         #if self.texteTypeAbstrait != "" : self.texteXSD += self.texteTypeAbstrait
         self.texteXSD += self.texteCata
         #self.texteXSD += self.texteElt
-       
+
         toutesLesKeys=set()
         texteKeyRef = ""
-        # Pour le nom des key_ref en creation : le type ( une seule key-ref par type. facile a retrouver) 
+        # Pour le nom des key_ref en creation : le type ( une seule key-ref par type. facile a retrouver)
         for clef in self.dictTypesASSDorUserASSDCrees:
             existeASSD=0
             texteDesFields=""
-            for unOper in self.dictTypesASSDorUserASSDCrees[clef]: 
+            for unOper in self.dictTypesASSDorUserASSDCrees[clef]:
                 if  not(isinstance(unOper, Accas.OPER)) : continue
                 existeASSD=1
                 texteDesFields+=texteFieldUnitaire.format(self.code, unOper.nom)
             if existeASSD : texteDesFields=texteDesFields[0:-2]
             texteDesUserASSD=''
             existeunUserASSD=0
-            for unSimp in self.dictTypesASSDorUserASSDCrees[clef]: 
+            for unSimp in self.dictTypesASSDorUserASSDCrees[clef]:
                 if not (isinstance(unSimp, Accas.SIMP)) : continue
                 texteDesUserASSD += unSimp.getXPathSansSelf() + " | "
                 #print (unSimp.getXPathSansSelf())
                 #texteFieldUnitaire='/'+self.code+":"+unSimp.nom
                 existeunUserASSD=1
             if existeunUserASSD:
-               if existeASSD : texteDesFields = texteDesFields + texteDesUserASSD[0:-2] +"/>\n\t\t"
-               else: texteDesFields = texteDesUserASSD[0:-2]
-            print (texteDesUserASSD)
-            print (texteDesFields)
+                if existeASSD : texteDesFields = texteDesFields + texteDesUserASSD[0:-2] +"/>\n\t\t"
+                else: texteDesFields = texteDesUserASSD[0:-2]
+            #print (texteDesUserASSD)
+            #print (texteDesFields)
             if texteDesFields != "" :
-               texteKeyRef  += producingASSDkeyRefDeclaration.format( clef ,texteDesFields) 
+                texteKeyRef  += producingASSDkeyRefDeclaration.format( clef ,texteDesFields)
 
 
-        # Pour le nom des key-ref en utilisation : la genealogie complete  ( une  key-ref par utilisation et on retrouve facilement la ) 
+        # Pour le nom des key-ref en utilisation : la genealogie complete  ( une  key-ref par utilisation et on retrouve facilement la )
         for clef in self.dictTypesASSDorUserASSDUtilises:
-            for unSimp in self.dictTypesASSDorUserASSDUtilises[clef]: 
-               # il faut la genealogie
-               texteKeyRef  += UsingASSDkeyRefDeclaration.format(unSimp.getNomCompletAvecBloc(), unSimp.type[0].__name__,self.code, unSimp.type[0].__name__,unSimp.getXPathComplet() ) 
+            for unSimp in self.dictTypesASSDorUserASSDUtilises[clef]:
+                # il faut la genealogie
+                texteKeyRef  += UsingASSDkeyRefDeclaration.format(unSimp.getNomCompletAvecBloc(), unSimp.type[0].__name__,self.code, unSimp.type[0].__name__,unSimp.getXPathComplet() )
 
         #PNPN on debranche les keyref le temps de bien reflechir a leur forme
-        #if texteKeyRef != '' : 
+        #if texteKeyRef != '' :
         #   self.texteXSD = self.texteXSD[0:-3]+'>\n'
         #   self.texteXSD += texteKeyRef
-        #   self.texteXSD += fermeEltCata 
-
-        self.texteXSD += texteFin
+        #   self.texteXSD += fermeEltCata
 
 
 
         #if not PourTraduction : print (self.texteXSD)
+
+        import pprint
+        #pprint.pprint (cata.dictTypesXSDJumeaux)
+        #for k in cata.dictTypesXSDJumeaux:
+        #    print (k.nom, k.nomComplet())
+        #    print (cata.dictTypesXSDJumeaux[k][0].nom, cata.dictTypesXSDJumeaux[k][0].nomComplet())
+
+        #pprint.pprint (cata.dictTypesXSD)
+        #for k in cata.dictTypesXSD:
+        #    print (k)
+        #    print (cata.dictTypesXSD)
+
         dico = {}
         for  k in list(cata.dictTypesXSD.keys()):
-             if len(cata.dictTypesXSD[k]) > 1:
-                index=0
-                dico[k]={}
-                for definition in cata.dictTypesXSD[k] : 
-                    nom=definition.nomComplet()
-                    if index == 0 : dico[k][nom]=k+str(index)
-                    else :          dico[k][nom]=k+str(index)
-                    index=index+1
-  
+            dico[k]={}
+            different=False
+            for definition in cata.dictTypesXSD[k] :
+                if definition.label  == 'BLOC' or  definition.label == 'BlocAmbigu':continue
+                if definition.nomDuTypePyxb != 'T_'+definition.nom : different=True
+                listeATraiter=[definition.geneaCompleteSousFormeDeListe(),]
+                while listeATraiter != [] :
+                    listeGenea=listeATraiter[0]
+                    listeATraiter=listeATraiter[1:]
+                    txtNomComplet=''
+                    indexMC=0
+                    for MC in listeGenea:
+                        txtNomComplet=txtNomComplet+'_'+MC.nom
+                        if MC in list(cata.dictTypesXSDJumeaux.keys()) :
+                            for MCJumeau in cata.dictTypesXSDJumeaux[MC]:
+                                # attention nvlleGenalogie n a pas de sens en Accas
+                                nvlleGenalogie=listeGenea[:indexMC]+MCJumeau.geneaCompleteSousFormeDeListe()
+                                listeATraiter.append(nvlleGenalogie)
+                        indexMC=indexMC+1
+                    dico[k][txtNomComplet]=definition.nomDuTypePyxb
+            if dico[k]== {} or (not different) : del dico[k]
+        import pprint
+        #pprint.pprint(dico)
+        # PN reflechir a ce *** de nom
+        #if dico != {} : self.texteXSD += texteAnnotation.format(self.nomDuCodeDumpe,str(dico))
+        if dico != {} : self.texteXSD += texteAnnotation.format(str(dico))
+
         #import pprint
         #if (not PourTraduction) and  (dico != {}) : pprint.pprint(dico)
         print ('__________________________ decommenter pour le texteXSD________________________')
-        print (self.texteXSD)
+        #print (dico)
+        #print (self.texteXSD)
+        self.texteXSD += texteFin
         return self.texteXSD
 
-   
+
     def dumpLesCommandes(self):
-        cata = CONTEXT.getCurrentCata() 
+        cata = CONTEXT.getCurrentCata()
         fichierCataSourceExt=os.path.basename(cata.cata.__file__)
         fichierCataSource, extension=os.path.splitext(fichierCataSourceExt)
         importCataSource=__import__(fichierCataSource,{},{})
 
         texte=""
         for m in sys.modules:
-           monModule=sys.modules[m]
-           try :
-              if m in ('os', 'sys', 'inspect', 'six', 'pickle', 'codecs')      : continue
-              if m in ('cPickle', 'pprint', 'dis', '_sre', 'encodings.aliases'): continue
-              if m in ('numbers', 'optparse', 'binascii', 'posixpath')         : continue
-              if m in ('_locale', '_sysconfigdata_nd', 'gc', 'functools')      : continue
-              if m in ('posixpath', 'types', 'posix', 'prefs')                 : continue
-              if m in ('warnings', 'types', 'posix', 'prefs')                  : continue
-              if monModule.__name__[0:15] == '_sysconfigdata_' : continue
-              if monModule.__name__ == '__future__' :  continue
-              if monModule.__name__[0:3] == 'Ihm'   :  continue
-              if monModule.__name__[0:5] == 'numpy' :  continue
-              if monModule.__name__[0:5] == 'Noyau' :  continue
-              if monModule.__name__[0:5] == 'Accas' :  continue
-              if monModule.__name__[0:7] == 'convert'       :  continue
-              if monModule.__name__[0:7] == 'Efi2Xsd'       :  continue
-              if monModule.__name__[0:7] == 'Editeur'       :  continue
-              if monModule.__name__[0:9] == 'generator'     :  continue
-              if monModule.__name__[0:10] == 'Validation'   :  continue
-              if monModule.__name__[0:10] == 'Extensions'   :  continue
-              if monModule.__name__[0:12] == 'InterfaceQT4' :  continue
-              if monModule.__name__ == fichierCataSource    :  continue
-              texte= texte + "try : import "+ monModule.__name__ + " \n"
-              texte= texte + "except : pass \n"
-              texte= texte + "try : from  "+ monModule.__name__ + ' import * \n'
-              texte= texte + "except : pass \n"
-           except :
-              pass
+            monModule=sys.modules[m]
+            try :
+                if m in ('os', 'sys', 'inspect', 'six', 'pickle', 'codecs')      : continue
+                if m in ('cPickle', 'pprint', 'dis', '_sre', 'encodings.aliases'): continue
+                if m in ('numbers', 'optparse', 'binascii', 'posixpath')         : continue
+                if m in ('_locale', '_sysconfigdata_nd', 'gc', 'functools')      : continue
+                if m in ('posixpath', 'types', 'posix', 'prefs')                 : continue
+                if m in ('warnings', 'types', 'posix', 'prefs')                  : continue
+                if monModule.__name__[0:15] == '_sysconfigdata_' : continue
+                if monModule.__name__ == '__future__' :  continue
+                if monModule.__name__[0:3] == 'Ihm'   :  continue
+                if monModule.__name__[0:5] == 'numpy' :  continue
+                if monModule.__name__[0:5] == 'Noyau' :  continue
+                if monModule.__name__[0:5] == 'Accas' :  continue
+                if monModule.__name__[0:7] == 'convert'       :  continue
+                if monModule.__name__[0:7] == 'Efi2Xsd'       :  continue
+                if monModule.__name__[0:7] == 'Editeur'       :  continue
+                if monModule.__name__[0:9] == 'generator'     :  continue
+                if monModule.__name__[0:10] == 'Validation'   :  continue
+                if monModule.__name__[0:10] == 'Extensions'   :  continue
+                if monModule.__name__[0:12] == 'InterfaceQT4' :  continue
+                if monModule.__name__ == fichierCataSource    :  continue
+                texte= texte + "try : import "+ monModule.__name__ + " \n"
+                texte= texte + "except : pass \n"
+                texte= texte + "try : from  "+ monModule.__name__ + ' import * \n'
+                texte= texte + "except : pass \n"
+            except :
+                pass
 
         newModule=imp.new_module('__main__')
         exec (texte, newModule.__dict__)
         allClassToDump=[]
         for i in dir(importCataSource):
-             if i not in dir(newModule):
+            if i not in dir(newModule):
                 allClassToDump.append(importCataSource.__dict__[i])
-         
+
 
         self.texteSimple = ''
         self.texteComplexe = ''
@@ -1096,9 +1477,10 @@ class X_JDC_CATA :
             c.nomDuCodeDumpe=self.nomDuCodeDumpe
             c.code=self.implement
             c.dumpXsd()
-            
+
             self.texteSimple   += c.texteSimple
             self.texteComplexe += c.texteComplexe
-            #c.texteElt=eltCompoDsSequenceInExtension.format(c.nom,self.code,c.nomDuTypePyxb)
-            c.texteElt=eltEtape.format(c.nom,self.implement,c.nomDuTypePyxb,self.implement)
+            if  c.ang != '' : c.texteElt = eltEtapeWithHelp.format(c.nom,self.implement,c.nomDuTypePyxb,self.implement,c.ang)
+            elif c.fr != '' : c.texteElt = eltEtapeWithHelp.format(c.nom,self.implement,c.nomDuTypePyxb,self.implement,c.fr)
+            else : c.texteElt = eltEtape.format(c.nom,self.implement,c.nomDuTypePyxb,self.implement)
             self.texteCata   += c.texteElt
index 97f4407b363e42af47502dc7d107fbc6f4348331..06966aa1bb857fa2abce7c4161dd04a1be66c797 100755 (executable)
@@ -1,21 +1,40 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
+# Copyright (C) 2007-2021   EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
 import sys,os
 import inspect
 import traceback
 def trace():
-  traceback.print_stack()
+    traceback.print_stack()
 #import raw.efficas as efficas
 import types
 
 sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..')))
 
 try :
-  import pyxb
-  import pyxb.binding
-  import pyxb.binding.basis
-  #import pyxb.utils.utility
-  #import pyxb.utils.domutils
+    import pyxb
+    import pyxb.binding
+    import pyxb.binding.basis
+    #import pyxb.utils.utility
+    #import pyxb.utils.domutils
 except : pass
 
 from Accas import A_ASSD
@@ -23,488 +42,618 @@ from Accas import A_ASSD
 class X_OBJECT:
 # -------------
 
-  def delObjPyxb(self, debug=False):
-      if not self.cata or not self.cata.modeleMetier : return
-      if self.nom == 'Consigne' : return None
-      trouve = False
-      
-      if debug : print ('in delObjPyxb')
-      if debug : print (self.perePyxb.objPyxb.orderedContent())
-      if debug : print (list(map(lambda o:o.value, self.perePyxb.objPyxb.orderedContent())))
-      
-      elt=pyxb.binding.basis.ElementContent(self.objPyxb, instance=self.perePyxb.objPyxb, tag=pyxb.namespace.ExpandedName(self.cata.modeleMetier.Namespace, self.nom))
-      if debug : print ('element moi = ', elt, 'id de moi = ', id(self.objPyxb), self.objPyxb)
-      if (elt.elementDeclaration.isPlural()):
-        if debug : print ('je suis Plural')
-      #   monIndexInOrderedContent=0
-      #   for c in self.perePyxb.objPyxb.orderedContent(): 
-      #     if isinstance(c._Content__value,list) and  isinstance(c._Content__value[0], type(self.objPyxb)): monIndexInOrderedContent += 1
-      #   listeObjetsAccas=self.parent.getChild(self.nom,restreint='oui')
-      #   if len(listeObjetsAccas) == 1 : monIndex=0
-      #   else : monIndex=listeObjetsAccas.index(self)
-      #   listeObjetsPyxb=getattr(self.perePyxb.objPyxb,elt.elementDeclaration._ElementDeclaration__key)
-      #   listeObjetsPyxb.pop(monIndex)
-      #   self.perePyxb.objPyxb.orderedContent().pop(monIndexInOrderedContent)
-        for c in self.perePyxb.objPyxb.orderedContent(): 
-           trouve=False
-           if isinstance(c._Content__value,list) and  isinstance(c._Content__value[0],type(self.objPyxb)):
-              monIndex=c.value.index(self.objPyxb)
-              trouve = True
-           if trouve : break
-        if not trouve : print ("************ pas trouve au delete"); return
-        listeObjetsPyxb=getattr(self.perePyxb.objPyxb,elt.elementDeclaration._ElementDeclaration__key)
-        listeObjetsPyxb.pop(monIndex)
-        # si dernier ?
-      else :
-        newOrderedContent = []
-        for i in self.perePyxb.objPyxb.orderedContent(): 
-            if id(self.objPyxb) == id(i._Content__value) : trouve = True ;continue
-            newOrderedContent.append(i)
-        if not trouve : print ('elt a supprimer ', self.nom, 'non trouve')
-        for i in range(len(newOrderedContent)):
-          self.perePyxb.objPyxb.orderedContent()[i]=newOrderedContent[i]
-        self.perePyxb.objPyxb.orderedContent().pop(len(newOrderedContent))
-
-        setattr(self.perePyxb.objPyxb,elt.elementDeclaration._ElementDeclaration__key,None)
+    def delObjPyxb(self, debug=False):
+        if not self.cata or not self.cata.modeleMetier : return
+        if self.nom == 'Consigne' : return None
+        trouve = False
+
+        if debug : print ('--------------- in delObjPyxb pour ' , self.nom)
+        if debug : print (self.perePyxb.objPyxb.orderedContent())
+        if debug : print (list(map(lambda o:o.value, self.perePyxb.objPyxb.orderedContent())))
+
+        elt=pyxb.binding.basis.ElementContent(self.objPyxb, instance=self.perePyxb.objPyxb, tag=pyxb.namespace.ExpandedName(self.cata.modeleMetier.Namespace, self.nom))
+        if debug : print ('element moi = ', elt, 'id de moi = ', id(self.objPyxb), self.objPyxb)
+        if (elt.elementDeclaration.isPlural()):
+            if debug : print ('je suis Plural')
+        #   monIndexInOrderedContent=0
+        #   for c in self.perePyxb.objPyxb.orderedContent():
+        #     if isinstance(c._Content__value,list) and  isinstance(c._Content__value[0], type(self.objPyxb)): monIndexInOrderedContent += 1
+        #   listeObjetsAccas=self.parent.getChild(self.nom,restreint='oui')
+        #   if len(listeObjetsAccas) == 1 : monIndex=0
+        #   else : monIndex=listeObjetsAccas.index(self)
+        #   listeObjetsPyxb=getattr(self.perePyxb.objPyxb,elt.elementDeclaration._ElementDeclaration__key)
+        #   listeObjetsPyxb.pop(monIndex)
+        #   self.perePyxb.objPyxb.orderedContent().pop(monIndexInOrderedContent)
+            for c in self.perePyxb.objPyxb.orderedContent():
+                trouve=False
+                if isinstance(c._Content__value,list) and  isinstance(c._Content__value[0],type(self.objPyxb)):
+                    monIndex=c.value.index(self.objPyxb)
+                    trouve = True
+                if trouve : break
+            if not trouve : print ("************ pas trouve au delete"); return
+            listeObjetsPyxb=getattr(self.perePyxb.objPyxb,elt.elementDeclaration._ElementDeclaration__key)
+            listeObjetsPyxb.pop(monIndex)
+            # si dernier ?
+        else :
+            newOrderedContent = []
+            for i in self.perePyxb.objPyxb.orderedContent():
+                if id(self.objPyxb) == id(i._Content__value) : trouve = True ;continue
+                newOrderedContent.append(i)
+            if not trouve : print ('elt a supprimer ', self.nom, 'non trouve')
+            for i in range(len(newOrderedContent)):
+                self.perePyxb.objPyxb.orderedContent()[i]=newOrderedContent[i]
+            self.perePyxb.objPyxb.orderedContent().pop(len(newOrderedContent))
+
+            setattr(self.perePyxb.objPyxb,elt.elementDeclaration._ElementDeclaration__key,None)
+            if debug : print (list(map(lambda o:o.value, self.perePyxb.objPyxb.orderedContent())))
+
+
+
+    def addObjPyxb(self,indiceDsLeContenu,debug=False):
+        if not self.cata or not self.cata.modeleMetier : return
+        if debug :print ('_____________ addObjPyxb ds X_OBJECT', self.nom, indiceDsLeContenu)
+        # adherence Accas sur le parent
+        parent=self.parent
+        while (parent.isBLOC()):
+            if parent != self.parent : indiceDsLeContenu += parent.rangDsPyxb()
+            parent=parent.parent
+        self.perePyxb=parent
+
+        if debug :print ('indiceDsLeContenu',indiceDsLeContenu)
+        if debug :print (pyxb.namespace.ExpandedName(self.cata.modeleMetier.Namespace, self.nom))
+
+        #if self.objPyxb ! = None : self.objPyxb.objAccas=self
+        elt=pyxb.binding.basis.ElementContent(self.objPyxb, instance=self.perePyxb.objPyxb, tag=pyxb.namespace.ExpandedName(self.cata.modeleMetier.Namespace, self.nom))
+        self.perePyxb.objPyxb.orderedContent().insert(indiceDsLeContenu,elt)
+        if (elt.elementDeclaration.isPlural()):
+        # je suis donc un MCList
+            listeObjetsAccas=self.parent.getChild(self.nom,restreint='oui')
+            if len(listeObjetsAccas) == 1 : monIndex=1
+            else : monIndex=listeObjetsAccas.index(self)
+            listeObjetsPyxb=getattr(self.perePyxb.objPyxb,elt.elementDeclaration._ElementDeclaration__key)
+            listeObjetsPyxb.insert(monIndex,self.objPyxb)
+        else :
+            setattr(self.perePyxb.objPyxb,elt.elementDeclaration._ElementDeclaration__key,self.objPyxb)
         if debug : print (list(map(lambda o:o.value, self.perePyxb.objPyxb.orderedContent())))
+        if debug : print ('fin _____________ addObjPyxb ds X_OBJECT', self.nom, indiceDsLeContenu)
+
+
+    def rangDsPyxb(self):
+        monRangEnAccas=self.parent.mcListe.index(self)
+        rangEnPyxb=0
+        for frere in self.parent.mcListe[0: monRangEnAccas] :
+            rangEnPyxb += frere.longueurDsArbre()
+        return rangEnPyxb
 
-      
-
-  def addObjPyxb(self,indiceDsLeContenu,debug=False):
-      if not self.cata or not self.cata.modeleMetier : return
-      if debug :print ('_____________ addObjPyxb ds X_OBJECT', self.nom, indiceDsLeContenu)
-      # adherence Accas sur le parent
-      parent=self.parent
-      while (parent.isBLOC()): 
-           if parent != self.parent : indiceDsLeContenu += parent.rangDsPyxb()
-           parent=parent.parent
-      self.perePyxb=parent
-
-      if debug :print ('indiceDsLeConten',indiceDsLeContenu) 
-      if debug :print (pyxb.namespace.ExpandedName(self.cata.modeleMetier.Namespace, self.nom))
-
-      #if self.objPyxb ! = None : self.objPyxb.objAccas=self
-      elt=pyxb.binding.basis.ElementContent(self.objPyxb, instance=self.perePyxb.objPyxb, tag=pyxb.namespace.ExpandedName(self.cata.modeleMetier.Namespace, self.nom))
-      self.perePyxb.objPyxb.orderedContent().insert(indiceDsLeContenu,elt)
-      if (elt.elementDeclaration.isPlural()):
-      # je suis donc un MCList
-         listeObjetsAccas=self.parent.getChild(self.nom,restreint='oui')
-         if len(listeObjetsAccas) == 1 : monIndex=1
-         else : monIndex=listeObjetsAccas.index(self)
-         listeObjetsPyxb=getattr(self.perePyxb.objPyxb,elt.elementDeclaration._ElementDeclaration__key)
-         listeObjetsPyxb.insert(monIndex,self.objPyxb)
-      else :
-         setattr(self.perePyxb.objPyxb,elt.elementDeclaration._ElementDeclaration__key,self.objPyxb)
-      if debug : print (list(map(lambda o:o.value, self.perePyxb.objPyxb.orderedContent())))
-      print ('fin _____________ addObjPyxb ds X_OBJECT', self.nom, indiceDsLeContenu)
-
-  def rangDsPyxb(self):
-      monRangEnAccas=self.parent.mcListe.index(self)
-      rangEnPyxb=0
-      for frere in self.parent.mcListe[0: monRangEnAccas] :
-          rangEnPyxb += frere.longueurDsArbre()
-      return rangEnPyxb
-      
 
 class X_MCSIMP(X_OBJECT):
 # -----------------------
-      
-   def buildObjPyxb(self, debug=False) :
-      if not self.cata or not self.cata.modeleMetier : return
-      if self.nom == 'Consigne' : return None
-      if debug : print ('X_MCSIMP buildObjPyxb', self.nom, self,self.valeur)
-      if debug and self.objPyxbDeConstruction == None : print (self.nom, ' pas de pyxb')
-      elif debug : print ('objPyxbDeConstruction', self.objPyxbDeConstruction)
-
-      if self.objPyxbDeConstruction != None :
-        self.objPyxb = self.objPyxbDeConstruction
+
+    def buildObjPyxb(self, debug=True) :
+        if not self.cata or not self.cata.modeleMetier : return
+        if self.nom == 'Consigne' : return None
+        if debug : print (self.definition.nomComplet())
+        if debug : print ('_______________ X_MCSIMP buildObjPyxb', self.nom, self,self.valeur)
+        if debug and self.objPyxbDeConstruction == None : print (self.nom, ' pas de pyxb')
+        elif debug : print ('objPyxbDeConstruction', self.objPyxbDeConstruction)
+
+        if self.objPyxbDeConstruction != None :
+            self.objPyxb = self.objPyxbDeConstruction
+            self.maClasseModeleMetier =type(self.objPyxb)
+            self.objPyxbDeConstruction = None
+            if issubclass(self.maClasseModeleMetier, self.cata.modeleMetier.pyxb.binding.basis.STD_union):
+                self.needFactory=True
+                self.maClasseModeleMetierFactory=getattr(self.maClasseModeleMetier,'Factory')
+            else : self.needFactory=False
+        else :
+            self.monNomClasseModeleMetier ='T_'+self.nom
+            if hasattr(self.definition,'nomXML') and self.definition.nomXML != None : self.monNomClasseModeleMetier='T_'+self.definition.nomXML
+            if self.monNomClasseModeleMetier in list(self.cata.DicoNomTypeDifferentNomElt.keys()) :
+                nomComplet=self.definition.nomComplet()
+                if nomComplet in list(self.cata.DicoNomTypeDifferentNomElt[self.monNomClasseModeleMetier].keys()):
+                    self.monNomClasseModeleMetier=self.cata.DicoNomTypeDifferentNomElt[self.monNomClasseModeleMetier][nomComplet]
+            if debug : print ('Pour', self.nom, ' le type est ', self.monNomClasseModeleMetier)
+            self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
+
+            if self.waitMatrice() :
+               #PNPN : Attention rien ne relie les objets listeObjPyxb a un objAccas
+               # 27/04 je ne sais pas si cela posera pb
+               self.listeLines = []
+               self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
+               self.maClasseModeleMetier_line=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier+'_line')
+               if debug : print ('Matrice  de type ', self.maClasseModeleMetier)
+               for v in self.valeur: 
+                   l=self.maClasseModeleMetier_line(v)
+                   self.listeLines.append(l)
+               self.objPyxb=self.maClasseModeleMetier(*self.listeLines)
+               #if self.objPyxb !=None : self.objPyxb.objAccas=self
+               if debug : print ('Matrice ', self.nom, self.objPyxb)
+               return
+            if self.waitTuple() :
+               self.objPyxb = []
+               self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
+               # if faut traiter l autre cas
+               # et optimiser
+               if self.definition.max !=1 :
+                  for v in self.valeur :
+                    if debug : print ('je traite ', v)
+                    listeConstruction=[]
+                    for i in range(self.combienEltDsTuple()):
+                        num=i+1
+                        maClasseElt=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier+'_n'+str(num))
+                        listeConstruction.append(maClasseElt(v[i]))
+                    self.objPyxb.append(self.maClasseModeleMetier(*listeConstruction))
+                    if debug  : print (self.objPyxb)
+                  return
+            if self.waitChaineAvecBlancs() and self.definition.max > 1:
+               self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
+               if debug : print (self.valeur)
+               if self.valeur != None and self.valeur != [] : self.objPyxb = self.maClasseModeleMetier(*self.valeur)
+               else :self.objPyxb = self.maClasseModeleMetier()
+               if debug : print ('X_MCSIMP', self.nom, self.objPyxb, )
+               if debug : print ('__________ fin X_MCSIMP', self.objPyxb, self.nom, self, self.maClasseModeleMetier,self.valeur)
+               return
+
+                        
+            if issubclass(self.maClasseModeleMetier, self.cata.modeleMetier.pyxb.binding.basis.STD_union):
+                if debug : print ('needFactory')
+                self.needFactory=True
+                self.maClasseModeleMetierFactory=getattr(self.maClasseModeleMetier,'Factory')
+            else : self.needFactory=False
+
+            if self.valeur != None :
+                if self.needFactory :
+                    if self.definition.max > 1 :
+                       # PNPN A corriger 
+                       # self.objPyxb=self.maClasseModeleMetier(self.valeur)
+                            self.objPyxb=self.maClasseModeleMetierFactory(self.valeur)
+                    else :  self.objPyxb=self.maClasseModeleMetierFactory(self.valeur)
+                else                :  self.objPyxb=self.maClasseModeleMetier(self.valeur)
+            else                   :
+                if self.needFactory : self.objPyxb=None
+                else                : self.objPyxb=self.maClasseModeleMetier(_validate_constraints=False)
+
+
+            #if self.objPyxb !=None : self.objPyxb.objAccas=self
+        if debug : print ('X_MCSIMP', self.nom, self.objPyxb, )
+        if debug : print ('__________ fin X_MCSIMP', self.objPyxb, self.nom, self, self.maClasseModeleMetier,self.valeur)
+
+
+    def setValeurObjPyxb(self,newVal, debug=True):
+        if not self.cata or not self.cata.modeleMetier : return
+        if debug : print (' ___________________________ dans setValeurObjPyxb MCSIMP ', self.nom, newVal)
+        if debug : print (' self.perePyxb = ', self.perePyxb.nom)
+        if debug : print (self.nom , ' a pour pere', self.perePyxb, self.perePyxb.nom, self.perePyxb.objPyxb)
+        if debug : print ('debut du setValeurObjPyxb pour ', self.nom, self.perePyxb.objPyxb.orderedContent())
+
+        #if newVal != None : nvlObj=self.maClasseModeleMetier(newVal)
+        if newVal != None :
+            if self.needFactory : nvlObj=self.maClasseModeleMetierFactory(newVal)
+            else                : nvlObj=self.maClasseModeleMetier(newVal)
+        else                   :
+            if self.needFactory : nvlObj =None
+            else                : nvlObj=self.maClasseModeleMetier(_validate_constraints=False)
+        self.val=newVal
+        if debug : print ('fin du setValeurObjPyxb pour ', self.nom, self.perePyxb.objPyxb.orderedContent())
+
+        if inspect.isclass(newVal) and issubclass(newVal,A_ASSD)  :
+            newVal = newVal.nom
+        setattr(self.perePyxb.objPyxb,self.nom,nvlObj)
+        trouve=False
+        indice=0
+        for i in self.perePyxb.objPyxb.orderedContent():
+            if i.elementDeclaration.id() == self.nom:
+            #if isinstance(i._Content__value, self.maClasseModeleMetier) :
+                self.perePyxb.objPyxb.orderedContent()[indice]=self.perePyxb.objPyxb.orderedContent()[-1]
+                del(self.perePyxb.objPyxb.orderedContent()[-1])
+                trouve=True
+                break
+            indice+=1
+        if not trouve : print ('Attention souci au changement de valeur de ', self.nom)
+        self.objPyxb=nvlObj
         #self.objPyxb.objAccas=self
-        self.maClasseModeleMetier =type(self.objPyxb)
-        self.objPyxbDeConstruction = None
-        if issubclass(self.maClasseModeleMetier, self.cata.modeleMetier.pyxb.binding.basis.STD_union): 
-              self.needFactory=True
-              self.maClasseModeleMetierFactory=getattr(self.maClasseModeleMetier,'Factory')
-        else : self.needFactory=False
-      else :
-        self.monNomClasseModeleMetier='T_'+self.nom
-        if self.nom in list(self.cata.DicoNomTypeDifferentNomElt.keys()) : 
-           self.monNomClasseModeleMetier=self.cata.DicoNomTypeDifferentNomElt[self.nom][self.nomComplet()]
-        self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
-        if issubclass(self.maClasseModeleMetier, self.cata.modeleMetier.pyxb.binding.basis.STD_union): 
-              if debug : print ('needFactory')
-              self.needFactory=True
-              self.maClasseModeleMetierFactory=getattr(self.maClasseModeleMetier,'Factory')
-        else : self.needFactory=False
-           
-        if self.valeur != None : 
-           if self.needFactory :  self.objPyxb=self.maClasseModeleMetierFactory(self.valeur)
-           else                :  self.objPyxb=self.maClasseModeleMetier(self.valeur)
-        else                   :  
-           if self.needFactory : self.objPyxb=None
-           else                : self.objPyxb=self.maClasseModeleMetier(_validate_constraints=False)
-
-
-        # c est la que le bat blesse
-        #if self.objPyxb !=None : self.objPyxb.objAccas=self
-      #if debug : print ('X_MCSIMP', self.nom, self.objPyxb, )
-      if debug : print ('fin X_MCSIMP', self.objPyxb, self.nom, self, self.maClasseModeleMetier,self.valeur)
-
-
-   def setValeurObjPyxb(self,newVal, debug=False):
-       if not self.cata or not self.cata.modeleMetier : return
-       if debug : print (' ___________________________ dans setValeurObjPyxb MCSIMP ', self.nom, newVal)
-       if debug : print (' self.perePyxb = ', self.perePyxb.nom)
-       if inspect.isclass(newVal) and issubclass(newVal,A_ASSD)  : newVal = newVal.nom
-       if debug : print (self.nom , ' a pour pere', self.perePyxb, self.perePyxb.nom, self.perePyxb.objPyxb)
-       
-       #if newVal != None : nvlObj=self.maClasseModeleMetier(newVal)
-       if newVal != None : 
-           if self.needFactory : nvlObj=self.maClasseModeleMetierFactory(newVal)
-           else                : nvlObj=self.maClasseModeleMetier(newVal)
-       else                   : 
-           if self.needFactory : nvlObj =None
-           else                : nvlObj=self.maClasseModeleMetier(_validate_constraints=False)
-       self.val=newVal
-
-       setattr(self.perePyxb.objPyxb,self.nom,nvlObj)
-       trouve=False
-       indice=0
-       for i in self.perePyxb.objPyxb.orderedContent(): 
-           if isinstance(i._Content__value, self.maClasseModeleMetier) : 
-              self.perePyxb.objPyxb.orderedContent()[indice]=self.perePyxb.objPyxb.orderedContent()[-1]
-              del(self.perePyxb.objPyxb.orderedContent()[-1])
-              trouve=True
-              break
-           indice+=1
-       if not trouve : print ('Attention souci au changement de valeur de ', self.nom)
-       self.objPyxb=nvlObj
-       #self.objPyxb.objAccas=self
-       if debug : print ('fin du setValeurObjPyxb pour ', self.nom, self.perePyxb.objPyxb.orderedContent())
-
-        
-      
+        if debug : print ('fin du setValeurObjPyxb pour ', self.nom, self.perePyxb.objPyxb.orderedContent())
+
+
+
 
 class X_MCCOMPO(X_OBJECT) :
 # -------------------------
-# 
-   def buildObjPyxb(self,mc_list, debug=False) :
-      if not self.cata or not self.cata.modeleMetier : return
-      print ('X_MCCOMPO', self.nom)
-      self.listArg=[]
-      self.dicoArg={}
-      for objAccas in mc_list :
-        if objAccas.nature == 'MCBLOC' :
-           self.exploreBLOC(objAccas)
-        elif objAccas.nature == 'MCList' :
-           if objAccas[0].definition.max > 1 :
-              self.listArg.append(objAccas) # les MCList n ont pas objPyxb
-              self.dicoArg[objAccas.nom]=[]
-              for fils in objAccas : 
-                  fils.perePyxb=self
-                  self.dicoArg[objAccas.nom].append(fils.objPyxb)
-           else : 
-               objAccas[0].perePyxb=self
-               self.dicoArg[objAccas.nom]=objAccas[0].objPyxb
-               self.listArg.append(objAccas[0].objPyxb)
-        else :
-           if objAccas.nom == 'Consigne'     : continue 
-           self.listArg.append(objAccas.objPyxb)
-           self.dicoArg[objAccas.nom]=objAccas.objPyxb
-           objAccas.perePyxb=self
-
-      if debug : print('X_MCCOMPO -- listArg ---',self.nom,self.listArg)
-      if debug : print('X_MCCOMPO -- dicoArg ---',self.nom,self.dicoArg)
-        
-      self.monNomClasseModeleMetier='T_'+self.nom
-      if self.nom in list(self.cata.DicoNomTypeDifferentNomElt.keys()) : 
-         self.monNomClasseModeleMetier=self.cata.DicoNomTypeDifferentNomElt[self.nom][self.nomComplet()]
-      self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
-      
-      # PN : Ne doit-on pas tester avant
-      if self.objPyxbDeConstruction != None :
-        self.objPyxb = self.objPyxbDeConstruction
-        self.objPyxbDeConstruction = None
-        if debug : print ('je passe dans le if pour ', self.nom, self.objPyxb, self)
-        if debug : print ('X_MCCOMPO', self, self.nom, self.objPyxb,self.listArg,self.objPyxb.orderedContent())
-      else :
-        if debug : print (self.nom)
-        if debug : print (self.listArg)
-        # self.objPyxb=self.maClasseModeleMetier(*self.listArg)
-        self.objPyxb=self.maClasseModeleMetier(**self.dicoArg)
-        newOrderedContent=[]
-        for obj in self.listArg:
-           # on teste le caractere pluriel
-           if (hasattr(obj, 'nature')) : # attention on a un object Accas et non un pyxb car les MCList n ont pas de objPyxb
-               max=obj[0].definition.max 
-           else : max = 1
-           if  max == 1 :
-            if not(issubclass(type(obj), pyxb.binding.basis.enumeration_mixin) ):
-               newOrderedContent.append(self.objPyxb.orderedContent()[list(map(lambda o:id(o.value), self.objPyxb.orderedContent())).index(id(obj))] )
+#
+    def buildObjPyxb(self,mc_list, debug=False) :
+        if not self.cata or not self.cata.modeleMetier : return
+
+        #if self.nom == 'Scenario_data' : debug=1
+        if debug : print ('X_MCCOMPO', self.nom)
+        deepDebug=False
+        self.listArg=[]
+        self.dicoArg={}
+        for objAccas in mc_list :
+            if objAccas.nature == 'MCBLOC' :
+                self.exploreBLOC(objAccas)
+            elif objAccas.nature == 'MCList' :
+                if objAccas[0].definition.max > 1 :
+                    self.listArg.append(objAccas) # les MCList n ont pas objPyxb
+                    self.dicoArg[objAccas.nom]=[]
+                    for fils in objAccas :
+                        fils.perePyxb=self
+                        self.dicoArg[objAccas.nom].append(fils.objPyxb)
+                else :
+                    objAccas[0].perePyxb=self
+                    self.dicoArg[objAccas.nom]=objAccas[0].objPyxb
+                    self.listArg.append(objAccas[0].objPyxb)
             else :
-               newOrderedContent.append(self.objPyxb.orderedContent()[list(map(lambda o:type(o.value), self.objPyxb.orderedContent())).index(type(obj))] )
-           else  : # element Pural
-            for c in self.objPyxb.orderedContent() :
-               if isinstance(c._Content__value,list) and  isinstance(c._Content__value[0], type(obj[0].objPyxb)): newOrderedContent.append(c)
-
-        for i in range(len(self.listArg)):
-          self.objPyxb.orderedContent()[i]=newOrderedContent[i]
-        if debug : print ('X_MCCOMPO', self, self.nom, self.objPyxb,self.listArg,newOrderedContent,self.objPyxb.orderedContent())
-      #self.objPyxb.objAccas=self
-      if debug : print ('fin buildObjetPyxb _______________________________________')
-      # assert(self.objPyxb.validateBinding())
-
-
-   def exploreBLOC(self,objAccas):
-      print (' ds exploreBLOC', objAccas .nom)
-      laListeSsLesBlocs=[]
-      for fils in objAccas.mcListe:
-        if fils.nature == 'MCBLOC' :
-           self.exploreBLOC(fils)
-        elif fils.nature == 'MCList' :
-           #print ('exploreBLOC des MCList', fils.nom)
-           self.dicoArg[fils.nom]=[]
-           if fils[0].definition.max > 1 :
-              #print ('ajout de ', fils)
-              self.listArg.append(fils) # les MCList n ont pas objPyxb
-              for objFils in fils : 
-                  objFils.perePyxb=self
-                  self.dicoArg[fils.nom].append(objFils.objPyxb)
-           else:
-             fils[0].perePyxb=self
-             self.dicoArg[fils.nom]=fils[0].objPyxb
-             self.listArg.append(fils[0].objPyxb)
+                if objAccas.nom == 'Consigne'     : continue
+                print ('______________', objAccas.nom, objAccas.objPyxb)
+                self.listArg.append(objAccas.objPyxb)
+                self.dicoArg[objAccas.nom]=objAccas.objPyxb
+                objAccas.perePyxb=self
+
+        if debug : print('X_MCCOMPO -- listArg ---',self.nom,self.listArg)
+        if debug : print('X_MCCOMPO -- dicoArg ---',self.nom,self.dicoArg)
+
+
+        self.monNomClasseModeleMetier='T_'+self.nom
+        if self.monNomClasseModeleMetier in list(self.cata.DicoNomTypeDifferentNomElt.keys()) :
+            self.nomComplet=self.definition.nomComplet()
+            self.monNomClasseModeleMetier=self.cata.DicoNomTypeDifferentNomElt[self.monNomClasseModeleMetier][self.nomComplet]
+        self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
+
+        # PN : Ne doit-on pas tester avant
+        if self.objPyxbDeConstruction != None :
+            self.objPyxb = self.objPyxbDeConstruction
+            self.objPyxbDeConstruction = None
+            if debug : print ('je passe dans le if pour ', self.nom, self.objPyxb, self)
+            if debug : print ('X_MCCOMPO', self, self.nom, self.objPyxb,self.listArg,self.objPyxb.orderedContent())
         else :
-           if fils.nom == "Consigne" : continue
-           #print ('ajout de 2', fils.objPyxb)
-           self.listArg.append(fils.objPyxb)
-           self.dicoArg[fils.nom]=fils.objPyxb
-           fils.perePyxb=self
-           print (fils.nom ,' est un SIMP a pour pere Pyxb', self, self.nom)
-          
-   
-
-  
+            if debug : print (self.listArg)
+            if debug : print (self.maClasseModeleMetier)
+            # self.objPyxb=self.maClasseModeleMetier(*self.listArg)
+            self.objPyxb=self.maClasseModeleMetier(**self.dicoArg)
+            if deepDebug :
+                print ('debut de __________ new ordered content')
+                for o in self.objPyxb.orderedContent():
+                    print ('o', o)
+                    print ('value', o.value)
+                    print ('type', type(o.value))
+                    print ('id', id(o.value))
+                print ('fin __________ new ordered content')
+                print ('debut de  __________ listArg')
+                for obj in self.listArg:
+                    print ('obj',obj)
+                    print ('type obj', type(obj))
+                    print ('id(obj)', id(obj))
+                print ('fin __________  listArg')
+
+            newOrderedContent=[]
+            if debug  : print ('list Arg')
+            for obj in self.listArg:
+                if debug :
+                    print ('obj',obj)
+                    print ('type obj', type(obj))
+                    print ('id(obj)', id(obj))
+
+                # on teste le caractere pluriel
+                if  isinstance(obj, list):
+                    for c in self.objPyxb.orderedContent() :
+                        if hasattr (c,'value') and c.value == obj :
+                           newOrderedContent.append(c)
+                    continue
+                if (hasattr(obj, 'nature')) : # attention on a un object Accas et non un pyxb car les MCList n ont pas de objPyxb
+                    max=obj[0].definition.max
+                else : max = 1
+                if  max == 1 :
+                    #if not(issubclass(type(obj), pyxb.binding.basis.enumeration_mixin) ):
+                    #   newOrderedContent.append(self.objPyxb.orderedContent()[list(map(lambda o:id(o.value), self.objPyxb.orderedContent())).index(id(obj))] )
+                    #else :
+                    #   newOrderedContent.append(self.objPyxb.orderedContent()[list(map(lambda o:type(o.value), self.objPyxb.orderedContent())).index(type(obj))] )
+                    # PN 22 sept 2020 . pourquoi pas toujours l id. le tyoe ne convient pas en cas d union d enum
+                    newOrderedContent.append(self.objPyxb.orderedContent()[list(map(lambda o:id(o.value), self.objPyxb.orderedContent())).index(id(obj))] )
+                else  : # element Pural
+                    for c in self.objPyxb.orderedContent() :
+                        if isinstance(c._Content__value,list) and  isinstance(c._Content__value[0], type(obj[0].objPyxb)): newOrderedContent.append(c)
+
+            for i in range(len(self.listArg)):
+                self.objPyxb.orderedContent()[i]=newOrderedContent[i]
+            debug=True
+            if debug : print ('X_MCCOMPO', self, self.nom, self.objPyxb)
+            if debug : print ('X_MCCOMPO', self.listArg)
+            if debug : print ('X_MCCOMPO', newOrderedContent)
+            if debug : print ( 'X_MCCOMPO',self.objPyxb.orderedContent())
+        if debug : print ('fin buildObjetPyxb _______________________________________')
+        # assert(self.objPyxb.validateBinding())
+
+
+    def exploreBLOC(self,objAccas,debug=False):
+        if debug : print (' ds exploreBLOC', objAccas.nom)
+        laListeSsLesBlocs=[]
+        for fils in objAccas.mcListe:
+            if fils.nature == 'MCBLOC' :
+                self.exploreBLOC(fils)
+            elif fils.nature == 'MCList' :
+                #print ('exploreBLOC des MCList', fils.nom)
+                self.dicoArg[fils.nom]=[]
+                if fils[0].definition.max > 1 :
+                    #print ('ajout de ', fils)
+                    self.listArg.append(fils) # les MCList n ont pas objPyxb
+                    for objFils in fils :
+                        objFils.perePyxb=self
+                        self.dicoArg[fils.nom].append(objFils.objPyxb)
+                else:
+                    fils[0].perePyxb=self
+                    self.dicoArg[fils.nom]=fils[0].objPyxb
+                    self.listArg.append(fils[0].objPyxb)
+            else :
+                if fils.nom == "Consigne" : continue
+                self.listArg.append(fils.objPyxb)
+                self.dicoArg[fils.nom]=fils.objPyxb
+                fils.perePyxb=self
+                if debug : print (fils.nom ,' est un SIMP a pour pere Pyxb', self, self.nom)
+        if debug : print ('fin  ds exploreBLOC', objAccas .nom)
+
+
+
+
 class X_MCBLOC (X_MCCOMPO):
 # --------------------------
-   def buildObjPyxb(self,mc_list,debug=False):
-      if not self.cata or not self.cata.modeleMetier : return
-      if debug : print ('X_MCBLOC buildObjPyxb', self.nom, self, mc_list, 'ne fait rien')
-      self.perePyxb=None
-      self.objPyxb=None
-        
-   def addObjPyxb(self, indiceDsLeContenu, debug=False):
-      if not self.cata or not self.cata.modeleMetier : return
-      if debug : print ('X_MCBLOC addObjPyxb', self.nom, self, self.mcListe, indiceDsLeContenu)
-      rangDeLObjet=indiceDsLeContenu
-      for obj in self.mcListe:
-          obj.addObjPyxb( rangDeLObjet)
-          rangDeLObjet=rangDeLObjet+obj.longueurDsArbre()
-       
-   def delObjPyxb(self, debug=False):
-      if not self.cata or not self.cata.modeleMetier : return
-      if debug : print ('X_MCBLOC delObjPyxb', self.nom, ' --------------------------')
-      for obj in self.mcListe:
-          obj.delObjPyxb()
-      if debug : print ('fin X_MCBLOC delObjPyxb --------------------------')
+    def buildObjPyxb(self,mc_list,debug=False):
+        if not self.cata or not self.cata.modeleMetier : return
+        if debug : print ('X_MCBLOC buildObjPyxb', self.nom, self, mc_list, 'ne fait rien')
+        self.perePyxb=None
+        self.objPyxb=None
+
+    def addObjPyxb(self, indiceDsLeContenu, debug=False):
+        if not self.cata or not self.cata.modeleMetier : return
+        if debug : print ('X_MCBLOC addObjPyxb', self.nom, self, self.mcListe, indiceDsLeContenu)
+        rangDeLObjet=indiceDsLeContenu
+        for obj in self.mcListe:
+            obj.addObjPyxb( rangDeLObjet)
+            rangDeLObjet=rangDeLObjet+obj.longueurDsArbre()
+
+    def delObjPyxb(self, debug=False):
+        if not self.cata or not self.cata.modeleMetier : return
+        if debug : print ('X_MCBLOC delObjPyxb', self.nom, ' --------------------------')
+        for obj in self.mcListe:
+            obj.delObjPyxb()
+        if debug : print ('fin X_MCBLOC delObjPyxb --------------------------')
 
 class X_MCLIST (X_MCCOMPO):
 # --------------------------
-  def buildObjPyxb(self,mc_list, debug=False):
-      if debug : print ('X_MCLIST buildObjPyxb ne fait rien', self.nom, self, mc_list)
-      pass
-    
-  def addObjPyxb(self,indiceDsLeContenu, debug=False):
-      if debug : print ('X_MCLIST addObjPyxb', self.nom, indiceDsLeContenu)
-      rangDeLObjet=indiceDsLeContenu
-      for objFils in self :
-          objFils.addObjPyxb(rangDeLObjet)
-          rangDeLObjet= rangDeLObjet + 1
-
-  def delObjPyxb(self, debug=False):
-      if not self.cata or not self.cata.modeleMetier : return
-      if debug : print ('X_MCLIST delObjPyxb', self.nom, ' --------------------------')
-      for obj in self:
-          obj.delObjPyxb()
-      if debug : print ('fin X_MCLIST delObjPyxb --------------------------')
+
+    def buildObjPyxb(self,mc_list, debug=False):
+        if debug : print ('X_MCLIST buildObjPyxb ne fait rien', self.nom, self, mc_list)
+        pass
+
+    def addObjPyxb(self,indiceDsLeContenu, debug=False):
+        if debug : print ('X_MCLIST addObjPyxb', self.nom, indiceDsLeContenu)
+        rangDeLObjet=indiceDsLeContenu
+        for objFils in self :
+            objFils.addObjPyxb(rangDeLObjet)
+            rangDeLObjet= rangDeLObjet + 1
+
+    def delObjPyxb(self, debug=False):
+        if not self.cata or not self.cata.modeleMetier : return
+        if debug : print ('X_MCLIST delObjPyxb', self.nom, ' --------------------------')
+        for obj in self:
+            obj.delObjPyxb()
+        if debug : print ('fin X_MCLIST delObjPyxb --------------------------')
 
 
 class X_MCFACT (X_MCCOMPO):
 # -------------------------
-  pass
+    pass
 
 class X_ETAPE(X_MCCOMPO) :
 # -------------------------
 
-   def metAJourNomASSD(self, nom,debug=False):
-      if not self.cata or not self.cata.modeleMetier : return
-      if debug : print ('X_ETAPE metAJourLesAttributs', self.nom, nom,' --------------------------')
-      self.objPyxb.name=nom
+    def metAJourNomASSD(self, nom,debug=False):
+        if not self.cata or not self.cata.modeleMetier : return
+        if debug : print ('X_ETAPE metAJourLesAttributs', self.nom, nom,' --------------------------')
+        self.objPyxb.sdName=nom
 
 class X_JDC (X_MCCOMPO):
 # ---------------------
-   def  __init__(self):
-      self.perePyxb=None
-      if not self.cata or not self.cata.modeleMetier : return
-      #if hasattr(self.cata,'DicoNomTypeDifferentNomElt') : print ('jkllllllllllllllll')
-      if not(hasattr(self.cata,'DicoNomTypeDifferentNomElt')) : self.cata.DicoNomTypeDifferentNomElt={}
-      self.monNomClasseModeleMetier=self.code
-      self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
-      self.objPyxb=self.maClasseModeleMetier()
-      #self.objPyxb.objAccas=self
-      pyxb.GlobalValidationConfig._setContentInfluencesGeneration(pyxb.GlobalValidationConfig.NEVER)
-      pyxb.GlobalValidationConfig._setInvalidElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION)
-      pyxb.GlobalValidationConfig._setOrphanElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION)
-      
-      
-
-   def enregistreEtapePyxb(self,etape,indice=0):
-     # ne fonctionne pas : a reecrire avec les fonctions addObjPyxb et ReconstruitPerePyxb
-     # ne contient pas indice pour l insant
-      #print ( 'hhhhhhhhhhhhhhh enregistreEtapePyxb hhhhhhhhhhhhhhhhhhhhhhhhh')
-      #print ('enregistre ds ',self, etape.nom, 'indice = ', indice)
-      if not self.cata.modeleMetier : return
-      self.objPyxb.append(etape.objPyxb)
-      etape.perePyxb = self
-
-      #print (self.objPyxb.orderedContent())
-      #if indice   != (len(self.objPyxb.orderedContent()) ) : 
-      #  tampon=self.objPyxb.orderedContent()[-1]
-      #  for i in reversed(range(len(self.objPyxb.orderedContent()))):
-      #    self.objPyxb.orderedContent()[i]=self.objPyxb.orderedContent()[i-1]
-      #    if i == indice + 1 : break
-      #  self.objPyxb.orderedContent()[indice]=tampon
-
-      #print (self.objPyxb.orderedContent())
-      #try:
-      #   self.objPyxb.validateBinding()
-      #except pyxb.ValidationError as e:
-      #   print(e.details())
-
-   def toXml(self,fichier=None):
-      print ('ds to XML')
-      if not self.cata or not self.cata.modeleMetier : return
-      print (' to xml ***************',self.objPyxb,'***************',)
-      print (' to xml ***************',self,'***************',)
-      print (' to xml ***************',self.objPyxb.orderedContent(),'***************',)
-      print(self.objPyxb.toDOM().toprettyxml())
-      print(self.objPyxb.toxml())
-      return (self.objPyxb.toDOM().toprettyxml())
-        
-
-   def analyseFromXML(self):
-      print ("je suis ds analyseFromXML -- > appel ds analyseXML de I_JDC.py")
-      print (self.procedure)
-      if self.procedure == "" : return
-      self.objPyxb=self.cata.modeleMetier.CreateFromDocument(self.procedure)
-      for contentObjEtape in self.objPyxb.orderedContent():
-          objEtape=contentObjEtape.value
-          objEtape.dictArgs=(self.pyxbToDict(objEtape))
-          objEtape.monNomClasseAccas=objEtape._ExpandedName.localName()
-          objEtape.monNomClasseAccas=objEtape.monNomClasseAccas[2:]
-          # doute sur les 2 lignes suivantes : objEtape peut etre contentObjEtape 2juin20
-          objEtape.dictPyxb['objEnPyxb']=objEtape
-          objEtape.dictArgs['dicoPyxbDeConstruction']=objEtape.dictPyxb
-          print ('dicoPyxbDeConstruction', objEtape.dictArgs['dicoPyxbDeConstruction'])
-          maClasseAccas=getattr(self.cata,objEtape.monNomClasseAccas)
-          print ( 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh')
-          print (maClasseAccas)
-          print (objEtape , type(objEtape))
-          print (objEtape.dictPyxb)
-          print (objEtape.monNomClasseAccas, type(objEtape.monNomClasseAccas))
-          print (objEtape._ExpandedName, type(objEtape._ExpandedName))
-          print ('dictArgs',objEtape.dictArgs)
-          print ('dictPyxb',objEtape.dictPyxb)
-          objAccasEtape=maClasseAccas(**(objEtape.dictArgs))
-          print (objAccasEtape)
-          print ( 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh')
-          print ( 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh')
-          print ( 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh')
-          print ( 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh')
-      
-
-   def pyxbToDict(self,objAAnalyser):
-    # la transformation de l objAAnalyser en type lu par eficas ne fonctionne pas pour tout
-    # faudrait - il travailler sur les types des objets ?
-    # c est a revoir -> fonction cast a prevoir ds les 2 sens
-    if objAAnalyser is None: return
-    print ('debut pour_____________________________ ',objAAnalyser)
-    dictArgs = {}
-    # traitement SIMP
-    # ---------------
-    if isinstance(objAAnalyser, pyxb.binding.basis.simpleTypeDefinition): 
-       #print ('je suis un MCSimple')
-    # il faut traiter les UserASSD
-       # traitement scalaire
-       objAAnalyser.dictPyxb=objAAnalyser
-       if not (isinstance(objAAnalyser,pyxb.binding.basis.STD_list)):
-          #print ('je suis un scalaire')
-          #try :  # python 3
-          if isinstance(objAAnalyser, str)  : return str(objAAnalyser)
-          if isinstance(objAAnalyser, int)  : return int(objAAnalyser)
-          if isinstance(objAAnalyser, float): return float(objAAnalyser)
-          if isinstance(objAAnalyser, pyxb.binding.basis.enumeration_mixin):    return str(objAAnalyser)
-          #except : # python 2
-          #if isinstance(objAAnalyser, types.StringTypes):  return str(objAAnalyser)
-          #if isinstance(objAAnalyser, types.FloatType):  return float(objAAnalyser)
-          #if isinstance(objAAnalyser, (types.IntType, types.LongType)):  return int(objAAnalyser)
-          #print ('________ fin pour ', objAAnalyser, 'retour', repr(objAAnalyser))
-          return objAAnalyser
-       else :
-          #print ('je suis une liste')
-          laListe=[]
-          for obj in objAAnalyser :
-              if isinstance(obj, str): laListe.append (str(obj))
-              elif isinstance(obj, int): laListe.append (int(obj))
-              elif isinstance(obj, float): laListe.append (float(obj))
-              elif isinstance(obj, pyxb.binding.basis.enumeration_mixin): laListe.append(str(obj))
-              else :  laListe.append(obj)
-          return (laListe)
-       #  if debug : print ('je suis Plural')
-       # ou ? return objAAnalyser
-       #if isinstance(objAAnalyser, types.StringTypes): return pyxb.utils.utility.QuotedEscaped(objAAnalyser,)
-       #pour une enum getattr(value dans le type)
-       # return pythonLiteral(ReferenceFacet(facet=value, **kw))
-    #print ('je suis un mot complexe')
-    # traitement FACT ou BLOC
-    # ------------------------
-    # il faut traiter les fact multiples
-    objAAnalyser.dictPyxb = {} 
-    objAAnalyser.dictPyxb['objEnPyxb']=objAAnalyser
-    #for expandedName, elementDeclaration in objAAnalyser._ElementMap.items():
-    #    objPyxbName  = expandedName.localName()
-    #    objPyxbValue = getattr(objAAnalyser, objPyxbName)
-    for objEltContentFils in objAAnalyser.orderedContent():
-        objPyxbValue = objEltContentFils.value
-        objPyxbName  = objEltContentFils.elementDeclaration.id()
-        elementDeclaration = objEltContentFils.elementDeclaration
-        #if objPyxbValue == None or objPyxbValue == [] : continue
-        if elementDeclaration.isPlural():
-            if objPyxbName not in list(dictArgs.keys()) : dictArgs[objPyxbName]=[] 
-            if objPyxbName not in list(objAAnalyser.dictPyxb.keys()) : objAAnalyser.dictPyxb[objPyxbName]=[] 
-            dictArgs[objPyxbName].append(self.pyxbToDict(objPyxbValue))
-            objAAnalyser.dictPyxb[objPyxbName].append(objPyxbValue.dictPyxb)
-        else:
-             dictArgs[objPyxbName] = self.pyxbToDict(getattr(objAAnalyser, objPyxbName))
-             objAAnalyser.dictPyxb[objPyxbName] = objPyxbValue.dictPyxb
-            # print ('ajout dans dictPyxb', objPyxbName, objPyxbValue.dictPyxb)
-            #print ('avec la valeur', 'de',  objAAnalyser.dictPyxb[objPyxbName])
-       
-    #print ("***********************************")
-    #print ('pyxbToDict  fin pour ********** ', objAAnalyser)
-    #print ('pyxbToDict ', objAAnalyser, objAAnalyser.dictPyxb)
-    #print ('pyxbToDict  fin pour ********** ', objAAnalyser)
-    #print ("***********************************")
-    #print (dictArgs)
-    #print (dictPyxb)
-    #for i in dictArgs.keys(): print (i, " ", dictArgs[i], " ", type(dictArgs[i]))
-    #print ('fin pour ',objAAnalyser)
-    return dictArgs
-
-   
+
+    def  __init__(self):
+        self.perePyxb=None
+        if not self.cata or not self.cata.modeleMetier : return
+        #if hasattr(self.cata,'DicoNomTypeDifferentNomElt') : print ('jkllllllllllllllll')
+        if not(hasattr(self.cata,'DicoNomTypeDifferentNomElt')) : self.cata.DicoNomTypeDifferentNomElt={}
+        self.monNomClasseModeleMetier=self.code
+        self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
+        self.objPyxb=self.maClasseModeleMetier()
+        #self.objPyxb.objAccas=self
+        pyxb.GlobalValidationConfig._setContentInfluencesGeneration(pyxb.GlobalValidationConfig.NEVER)
+        pyxb.GlobalValidationConfig._setInvalidElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION)
+        pyxb.GlobalValidationConfig._setOrphanElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION)
+
+
+
+    def enregistreEtapePyxb(self,etape,indice=0):
+      # ne fonctionne pas : a reecrire avec les fonctions addObjPyxb et ReconstruitPerePyxb
+      # ne contient pas indice pour l insant
+      # print ( 'hhhhhhhhhhhhhhh enregistreEtapePyxb hhhhhhhhhhhhhhhhhhhhhhhhh')
+      # print ('enregistre ds ',self, etape.nom, 'indice = ', indice)
+        if not self.cata.modeleMetier : return
+        self.objPyxb.append(etape.objPyxb)
+        etape.perePyxb = self
+
+        #print (self.objPyxb.orderedContent())
+        #if indice   != (len(self.objPyxb.orderedContent()) ) :
+        #  tampon=self.objPyxb.orderedContent()[-1]
+        #  for i in reversed(range(len(self.objPyxb.orderedContent()))):
+        #    self.objPyxb.orderedContent()[i]=self.objPyxb.orderedContent()[i-1]
+        #    if i == indice + 1 : break
+        #  self.objPyxb.orderedContent()[indice]=tampon
+
+        #print (self.objPyxb.orderedContent())
+        #try:
+        #   self.objPyxb.validateBinding()
+        #except pyxb.ValidationError as e:
+        #   print(e.details())
+
+    def toXml(self,fichier=None, debug=False):
+        if debug : print ('ds to XML')
+        if not self.cata or not self.cata.modeleMetier : return
+        if debug : print (' to xml ***************',self.objPyxb,'***************',)
+        if debug : print (' to xml ***************',self,'***************',)
+        if debug : print (' to xml ***************',self.objPyxb.orderedContent(),'***************',)
+        if debug : print(self.objPyxb.toDOM().toprettyxml())
+        if debug : print(self.objPyxb.toxml())
+        return (self.objPyxb.toDOM().toprettyxml())
+
+
+    def analyseFromXML(self,debug=False):
+        print ("je suis ds analyseFromXML -- > appel ds analyseXML de I_JDC.py")
+        if self.procedure == "" : return
+        self.objPyxb=self.cata.modeleMetier.CreateFromDocument(self.procedure)
+        if not hasattr(self.cata.modeleMetier,'AccasUserAssd'):
+            from Accas import UserASSD
+            self.cata.modeleMetier.AccasUserAssd=UserASSD
+        for contentObjEtape in self.objPyxb.orderedContent():
+            objEtape=contentObjEtape.value
+            objEtape.dictArgs=(self.pyxbToDict(objEtape))
+            objEtape.monNomClasseAccas=objEtape._ExpandedName.localName()
+            objEtape.monNomClasseAccas=objEtape.monNomClasseAccas[2:]
+            # doute sur les 2 lignes suivantes : objEtape peut etre contentObjEtape 2juin20
+            objEtape.dictPyxb['objEnPyxb']=objEtape
+            objEtape.dictArgs['dicoPyxbDeConstruction']=objEtape.dictPyxb
+            if debug : print ('dicoPyxbDeConstruction', objEtape.dictArgs['dicoPyxbDeConstruction'])
+            maClasseAccas=getattr(self.cata,objEtape.monNomClasseAccas)
+            if debug : print ( 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh')
+            if debug : print ('maClasseAccas ', maClasseAccas)
+            if debug : print ('objEtape ', objEtape , type(objEtape))
+            if debug : print ('nomClasseAccas ',objEtape.monNomClasseAccas, type(objEtape.monNomClasseAccas))
+            if debug : print ('_ExpandedName ', objEtape._ExpandedName, type(objEtape._ExpandedName))
+            if debug : print ('dictArgs ',objEtape.dictArgs)
+            if debug : print ('dictPyxb ',objEtape.dictPyxb)
+            # attention au call d Oper qui renomme l objet pyxb
+            if hasattr(objEtape,'sdName') :
+                if debug and hasattr(objEtape,'sdName') :print ('sdName',objEtape.sdName)
+                objAccasEtape=maClasseAccas(nomXML=objEtape.sdName, **(objEtape.dictArgs))
+            else : objAccasEtape=maClasseAccas(**(objEtape.dictArgs))
+            if debug : print ( 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh')
+
+
+    def pyxbToDict(self,objAAnalyser, debug=True):
+        # la transformation de l objAAnalyser en type lu par eficas ne fonctionne pas pour tout
+        if objAAnalyser is None: return
+        if debug : print ('debut pour_____________________________ ',objAAnalyser)
+        dictArgs = {}
+        # traitement SIMP
+        # ---------------
+        # a revoir pour les matrices
+        # et les tuples
+        debug = 1
+        if isinstance(objAAnalyser, pyxb.binding.basis.simpleTypeDefinition):
+            if debug : print ('je suis un MCSimple', objAAnalyser)
+            # traitement scalaire
+            objAAnalyser.dictPyxb=objAAnalyser
+            if not (isinstance(objAAnalyser,pyxb.binding.basis.STD_list)):
+                if debug :  print ('je suis un scalaire')
+                if isinstance(objAAnalyser,self.cata.modeleMetier.AccasUserAssd) or isinstance(objAAnalyser,self.cata.modeleMetier.AccasUserAssdMultiple):
+                    if debug : print ('je suis un UserASSD')
+                    laClassePyxbUserAssd=type(objAAnalyser)
+                    return self.creeUserAssd(objAAnalyser,laClassePyxbUserAssd)
+                if isinstance(objAAnalyser, pyxb.binding.datatypes.boolean) : return bool(objAAnalyser)
+                if isinstance(objAAnalyser, str)  : return str(objAAnalyser)
+                if isinstance(objAAnalyser, int)  : return int(objAAnalyser)
+                if isinstance(objAAnalyser, float): return float(objAAnalyser)
+                if isinstance(objAAnalyser, pyxb.binding.basis.enumeration_mixin):    return str(objAAnalyser)
+                return objAAnalyser
+            else :
+                if debug : print ('je suis une liste')
+                laListe=[]
+                # liste homogene
+                if len(objAAnalyser)>0:
+                    if issubclass(objAAnalyser[0].__class__,self.cata.modeleMetier.AccasUserAssd) or issubclass(objAAnalyser[0].__class__,self.cata.modeleMetier.AccasUserAssdMultiple): estUnUserASSDorUserASSDMultiple = True
+                    else : estUnUserASSDorUserASSDMultiple=False
+                else : estUnUserASSDorUserASSDMultiple=False
+                if debug : print ('estUnUserASSDorUserASSDMultiple', estUnUserASSDorUserASSDMultiple)
+                for obj in objAAnalyser :
+                    if estUnUserASSDorUserASSDMultiple:
+                       laClassePyxbUserAssd=obj.__class__
+                       laListe.append(self.creeUserAssd(obj,laClassePyxbUserAssd))
+                    elif isinstance(obj, str): laListe.append (str(obj))
+                    elif isinstance(obj, int): laListe.append (int(obj))
+                    elif isinstance(obj, float): laListe.append (float(obj))
+                    elif isinstance(obj, pyxb.binding.basis.enumeration_mixin): laListe.append(str(obj))
+                    else :  laListe.append(obj)
+                return (laListe)
+            #  if debug : print ('je suis Plural')
+            # ou ? return objAAnalyser
+            #if isinstance(objAAnalyser, types.StringTypes): return pyxb.utils.utility.QuotedEscaped(objAAnalyser,)
+            #pour une enum getattr(value dans le type)
+            # return pythonLiteral(ReferenceFacet(facet=value, **kw))
+        #print ('je suis un mot complexe')
+        # traitement FACT ou BLOC
+        # ------------------------
+        # il faut traiter les fact multiples
+        objAAnalyser.dictPyxb = {}
+        objAAnalyser.dictPyxb['objEnPyxb']=objAAnalyser
+        #for expandedName, elementDeclaration in objAAnalyser._ElementMap.items():
+        #    objPyxbName  = expandedName.localName()
+        #    objPyxbValue = getattr(objAAnalyser, objPyxbName)
+        for objEltContentFils in objAAnalyser.orderedContent():
+            objPyxbValue = objEltContentFils.value
+            objPyxbName  = objEltContentFils.elementDeclaration.id()
+            elementDeclaration = objEltContentFils.elementDeclaration
+            #if objPyxbValue == None or objPyxbValue == [] : continue
+            if elementDeclaration.isPlural():
+                if objPyxbName not in list(dictArgs.keys()) : dictArgs[objPyxbName]=[]
+                if objPyxbName not in list(objAAnalyser.dictPyxb.keys()) : objAAnalyser.dictPyxb[objPyxbName]=[]
+                dictArgs[objPyxbName].append(self.pyxbToDict(objPyxbValue))
+                objAAnalyser.dictPyxb[objPyxbName].append(objPyxbValue.dictPyxb)
+            else:
+                dictArgs[objPyxbName] = self.pyxbToDict(getattr(objAAnalyser, objPyxbName))
+                objAAnalyser.dictPyxb[objPyxbName] = objPyxbValue.dictPyxb
+                # print ('ajout dans dictPyxb', objPyxbName, objPyxbValue.dictPyxb)
+                #print ('avec la valeur', 'de',  objAAnalyser.dictPyxb[objPyxbName])
+
+        #print ("***********************************")
+        #print ('pyxbToDict  fin pour ********** ', objAAnalyser)
+        #print ('pyxbToDict ', objAAnalyser, objAAnalyser.dictPyxb)
+        #print ('pyxbToDict  fin pour ********** ', objAAnalyser)
+        #print ("***********************************")
+        #print (dictArgs)
+        #print (dictPyxb)
+        #for i in dictArgs.keys(): print (i, " ", dictArgs[i], " ", type(dictArgs[i]))
+        #print ('fin pour ',objAAnalyser)
+        return dictArgs
+
+    def creeUserAssd(self,objAAnalyser,laClassePyxbUserAssd,debug=True):
+
+        enCreation=False
+        if debug : print ('creeUserAssd ', objAAnalyser, ' ',laClassePyxbUserAssd)
+        leTypeIntermediaire=laClassePyxbUserAssd.XsdSuperType()  
+        if debug : print ('leTypeIntermediaire ', leTypeIntermediaire)
+        if debug : print ('leTypeIntermediaire ', leTypeIntermediaire.XsdSuperType())
+        if leTypeIntermediaire.__name__[-2:]== '_C' : enCreation = True
+        elif leTypeIntermediaire.__name__[-2:] != '_U' : print ('pb avec', laClassePyxbUserAssd); return None #exit() 
+        nomClasseAccasUserAssd=leTypeIntermediaire.XsdSuperType().__name__
+        if debug : print ('nomClasseAccasUserAssd', nomClasseAccasUserAssd)
+        laClasseAccas=getattr(self.cata,nomClasseAccasUserAssd)
+        print (laClasseAccas)
+        if not(enCreation):
+            if str(objAAnalyser) in self.g_context.keys():return self.g_context[str(objAAnalyser)]
+            else :
+                obj=laClasseAccas()
+                self.g_context[str(objAAnalyser)]=obj
+                return obj
+        if str(objAAnalyser) in self.g_context.keys():
+            if isinstance(self.g_context[str(objAAnalyser)],laClasseAccas):
+                return self.g_context[str(objAAnalyser)]
+            else :
+                nvlObj=laClasseAccas()
+                oldObj=self.g_context[str(objAAnalyser)]
+                nvlObj.transfere(oldObj)
+                self.g_context[str(objAAnalyser)]=nvlObj
+                return nvlObj
+        else :
+            obj=laClasseAccas()
+            self.g_context[str(objAAnalyser)]=obj
+            return obj
+
 #   def analyseContent(self,objAAnalyser):
 #       objAAnalyser.dictArgs={}
 #       for objContenu in objAAnalyser.content():
@@ -522,12 +671,12 @@ class X_JDC (X_MCCOMPO):
 #          else :
 #             self.analyseContent(objContenu)
 #             objAAnalyser.dictArgs[objContenu.monNomClasseAccas]=objContenu.dictArgs
-       #print ( '________________')
-       #print (objAAnalyser.monNomClasseAccas)
-       #for i in objAAnalyser.dictArgs : print (i, objAAnalyser.dictArgs[i])
-       #print ( '________________')
-        
-  
+            #print ( '________________')
+            #print (objAAnalyser.monNomClasseAccas)
+            #for i in objAAnalyser.dictArgs : print (i, objAAnalyser.dictArgs[i])
+            #print ( '________________')
+
+
 
 if __name__ == "__main__":
-   print ('a faire')
+    print ('a faire')
diff --git a/Efi2Xsd/MCAccasXsd.py b/Efi2Xsd/MCAccasXsd.py
deleted file mode 100644 (file)
index 1365685..0000000
+++ /dev/null
@@ -1,408 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-import sys,os
-import traceback
-#import raw.efficas as efficas
-import types
-
-sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..')))
-
-try :
-  import pyxb
-  import pyxb.binding
-  import pyxb.binding.basis
-except : 
-  pass
-#import pyxb.utils.utility
-#import pyxb.utils.domutils
-
-class X_OBJECT:
-# -------------
-
-  def deletePyxbObject(self):
-      if not self.cata or  not self.cata.modeleMetier : return
-      print ('----------- deletePyxbObject', self.nom)  
-      indice = 0
-      trouve = False
-      for i in self.perePyxb.objPyxb.orderedContent(): 
-            if id(self.objPyxb) == id(i._Content__value) : trouve = True ;break
-            indice = indice + 1
-      if not trouve : print ('objet pas trouve')
-      print (self.perePyxb.objPyxb.description)
-      del self.perePyxb.objPyxb.__dict__[self.nom]
-      print (self.perePyxb.objPyxb.__delattr__)
-      #delattr(self.perePyxb.objPyxb,self.nom)
-      # PNPN
-      
-      print ('delattr', self.perePyxb.objPyxb,self.nom)
-      del self.perePyxb.objPyxb.orderedContent()[indice]
-
-
-class X_MCSIMP(X_OBJECT):
-# -----------------------
-      
-   def buildObjPyxb(self) :
-      # self.valeur tient compte de la valeur par defaut
-      # utiliser getValeur ? expression numpy
-      if not self.cata or  not self.cata.modeleMetier : return
-      #print ('X_MCSIMP buildObjPyxb', self.nom, self,self.valeur)
-      #if self.nom == 'diameter' : 
-      #    traceback.print_stack()
-      #    print ('****************************************************')
-      # print ('objPyxbDeConstruction', self.objPyxbDeConstruction)
-      #if self.objPyxbDeConstruction == None : print (self.nom, ' pas de pyxb')
-      if self.objPyxbDeConstruction != None :
-        self.objPyxb = self.objPyxbDeConstruction
-        self.maClasseModeleMetier =type(self.objPyxb)
-        #print (self.maClasseModeleMetier)
-        self.objPyxbDeConstruction = None
-      else :
-        self.monNomClasseModeleMetier='T_'+self.nom
-        self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
-        #print (self.maClasseModeleMetier)
-        #print (self.valeur)
-        #print (type(self.valeur))
-        if self.valeur != None : self.objPyxb=self.maClasseModeleMetier(self.valeur)
-        elif self.definition.into != None and 'TXM' in self.definition.type  : self.objPyxb = None
-        else                   : self.objPyxb=self.maClasseModeleMetier(); 
-      self.filsPyxb=None
-      #print ('X_MCSIMP', self.nom, self.objPyxb)
-      #print ('fin X_MCSIMP', self.objPyxb, self.nom,self)
-
-
-   def setValeurObjPyxb(self,newVal):
-       if not self.cata or  not self.cata.modeleMetier : return
-       print ('dans setValeurObjPyxb MCSIMP')
-       #  print (self.nom , ' a pour pere', self.perePyxb, self.perePyxb.nom, self.perePyxb.objPyxb)
-       if newVal != None : nvlObj=self.maClasseModeleMetier(newVal)
-       else              : nvlObj=self.maClasseModeleMetier()
-       self.val=newVal
-       setattr(self.perePyxb.objPyxb,self.nom,nvlObj)
-       print ('setattr', self.perePyxb.objPyxb,self.nom)
-       trouve=False
-       indice=0
-       for i in self.perePyxb.objPyxb.orderedContent(): 
-           if isinstance(i._Content__value, self.maClasseModeleMetier) : 
-              self.perePyxb.objPyxb.orderedContent()[indice]=self.perePyxb.objPyxb.orderedContent()[-1]
-              del(self.perePyxb.objPyxb.orderedContent()[-1])
-              trouve=True
-              break
-           indice+=1
-       if not trouve : print ('Attention souci au changement de valeur de ', self.nom)
-       self.objPyxb=nvlObj
-       print ('iiiiiiiiiiiiiiiiiiiiiiiiiiiiii', nvlObj, id(nvlObj))
-       #for i in self.perePyxb.objPyxb.orderedContent(): 
-       #    print ('ds le for pour i')
-       #    print (i._Content__value)
-       #    print (id(i._Content__value))
-       #    print (type((i._Content__value)))
-       #    if id(i._Content__value) == id(self.objPyxb) : break
-       #    indexOC +=1
-
-       #maValeur = getattr(self.perePyxb.objPyxb, self.nom)
-       #print ('je change', indexOC)
-       #if isinstance(maValeur, pyxb.binding.basis.simpleTypeDefinition):
-       #if 1 :
-       #   print ('jkjkljkljklj')
-       #   setattr(self.perePyxb.objPyxb,self.nom,nvlObj)
-       #   self.perePyxb.objPyxb.orderedContent()[indexOC]=self.perePyxb.objPyxb.orderedContent()[-1]
-       #   del(self.perePyxb.objPyxb.orderedContent()[-1])
-       #print ('apres',self.nom, self.perePyxb.objPyxb.orderedContent())
-       #else :
-       #   index=0
-       #   trouve=False
-       #   try :
-       #     for i in maValeur: 
-       #       if id(i) == id(self.objPyxb) :trouve = True ; break
-       #       index=index+1
-       #     maValeur[index]=nvlObj
-       #     self.perePyxb.objPyxb.orderedContent()[indexOC]._Content__value=nvlObj
-       #   except : pass
-       #   if not trouve : print (self.nom , 'pas trouve')
-
-       #print ('arret programme'); exit()
-
-       #print ('id objPyxb',id(self.objPyxb))
-       #print ('id objPyxb[0]',id(self.objPyxb[0]))
-       #print ('id elt ', id(self.objPyxb._element), self.objPyxb._element, type(self.objPyxb._element), type(self.objPyxb._element()))
-       #print ('        perePyxb _ElementMap')
-       #print (self.perePyxb.objPyxb._ElementMap)
-       #index=0
-       #for i in self.perePyxb.objPyxb._ElementMap.keys() : 
-       #    print (id(i), ' ',  id(self.perePyxb.objPyxb._ElementMap[i]))
-           #print (dir(self.perePyxb.objPyxb._ElementMap[i]))
-       #    print (id(self.perePyxb.objPyxb._ElementMap[i]))
-#         index=index+1
-       #print ('        objPyxb monBinding id')
-       #monBinding = getattr(self.perePyxb.objPyxb, self.nom)
-       #for i in monBinding : print id(i)
-       #print ('        perePyxb orderedContent')
-       #for i in self.perePyxb.objPyxb.orderedContent(): 
-       #    print id(i._Content__value)
-       #    print (i._Content__value, type(i._Content__value))
-       #print ('        perePyxb orderedContent')
-       #for i in self.perePyxb.objPyxb.content(): print id(i)
-       
-       #print (self.perePyxb.objPyxb.orderedContent())
-       #print (monBinding)
-        
-      
-   def addPyxbObject(self, indiceDsLeContenu):
-      if not self.cata or  not self.cata.modeleMetier : return
-
-      # adherence Accas sur le parent
-      parent=self.parent
-      while (parent.isBLOC() ): parent=parent.parent
-      self.perePyxb=parent
-
-      self.monNomClasseModeleMetier='T_'+self.nom
-      self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
-      nvlObj=self.maClasseModeleMetier() 
-      print ('setattr', self.perePyxb.objPyxb,self.nom)
-      setattr(self.perePyxb.objPyxb,self.nom,nvlObj)
-      tampon=self.perePyxb.objPyxb.orderedContent()[-1]
-      self.objPyxb  = nvlObj
-      indexOC=-1
-      longueur=len(self.perePyxb.objPyxb.orderedContent())
-      for i in reversed(range(longueur)):
-          self.perePyxb.objPyxb.orderedContent()[i]=self.perePyxb.objPyxb.orderedContent()[i-1]
-          if i == indiceDsLeContenu + 1 : break
-      self.perePyxb.objPyxb.orderedContent()[indiceDsLeContenu]=tampon
-
-
-      #for i in self.perePyxb.objPyxb.orderedContent() :
-      #    print (i._Content__value, type(i._Content__value))
-      #print ('----------------')
-
-      #print self.perePyxb.objPyxb.orderedContent()
-      #for i in  self.perePyxb.objPyxb.orderedContent():
-      #     print ('valeur de ', i)
-      #     print (i._Content__value)
-      #     print (type(i._Content__value))
-      #     if isinstance(i._Content__value, self.maClasseModeleMetier) : 
-      #        print dir(i._Content__value)
-      #        self.objPyxb = i._Content__value 
-      #        setattr(self.perePyxb.objPyxb, self.nom, nvlObj)
-      #        self.perePyxb.objPyxb.orderedContent()[indexOC]=self.perePyxb.objPyxb.orderedContent()[-1]
-      #        del(self.perePyxb.objPyxb.orderedContent()[-1])
-      #     indexOC+=1
-      #PNPNPNPNPNPNPNPNP
-
-class X_MCCOMPO(X_OBJECT) :
-# -------------------------
-# 
-   def buildObjPyxb(self,mc_list) :
-      #print ('________________________________________________')
-      #print ('X_MCCOMPO buildObjPyxb', self.nom, self, mc_list)
-      if not self.cata or  not self.cata.modeleMetier : return
-
-      self.listArg=[]
-      for objAccas in mc_list :
-        if objAccas.nature == 'MCBLOC' :
-           self.exploreBLOC(objAccas)
-        elif objAccas.nature == 'MCList' :
-           for fils in objAccas : 
-               fils.perePyxb=self
-               self.listArg.append(fils.objPyxb)
-        else :
-           self.listArg.append(objAccas.objPyxb)
-           objAccas.perePyxb=self
-           print (objAccas.nom ,' a pour pere Pyxb', self, self.nom)
-
-      self.monNomClasseModeleMetier='T_'+self.nom
-      self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
-      if self.objPyxbDeConstruction != None :
-        self.objPyxb = self.objPyxbDeConstruction
-        self.objPyxbDeConstruction = None
-        #print ('je passe dans le if pour ', self.nom, self.objPyxb, self)
-      else :
-        self.objPyxb=self.maClasseModeleMetier(*self.listArg)
-      #print ('Fin __________ ', self.nom, self.objPyxb)
-      #print ('X_MCCOMPO', self.nom, self.objPyxb)
-      #print ('_______________________________________')
-
-   def deletePyxbObject(self):
-      if not self.cata or  not self.cata.modeleMetier : return
-      print ('******************************************')
-      print ('je passe ds deletePyxbObject pour ', self, self.nom)
-      print (self.perePyxb)
-      print (dir(self)) 
-      print ('******************************************')
-
-   def exploreBLOC(self,objAccas):
-      if not self.cata or  not self.cata.modeleMetier : return
-      laListeSsLesBlocs=[]
-      for fils in objAccas.mcListe:
-        if fils.nature == 'MCBLOC' :
-           self.exploreBLOC(fils)
-        elif fils.nature == 'MCList' :
-           for objFils in fils : 
-               fils.perePyxb=self
-               self.listArg.append(fils.objPyxb)
-               #print (fils.nom ,' a pour pere Pyxb', self, self.nom)
-        else :
-           self.listArg.append(fils.objPyxb)
-           fils.perePyxb=self
-           #print (fils.nom ,' a pour pere Pyxb', self, self.nom)
-          
-   
-
-  
-class X_MCBLOC (X_MCCOMPO):
-# --------------------------
-   def buildObjPyxb(self,mc_list):
-      if not self.cata or  not self.cata.modeleMetier : return
-      # mise a none ? le bloc n a pas d existence en pyxb
-      self.perePyxb=None
-      #print ('_______________________________________')
-      #print ('X_MCBLOC buildObjPyxb', self.nom, self, mc_list)
-      # on rattache ses fils au bloc mais leur pere sera ensuite le MCCOMPO qui contient le bloc 
-      # Pas sur d en avoir besoin du filsPyxb
-      self.filsPyxb=[]
-      self.objPyxb=None
-      for objAccas in mc_list :
-         self.filsPyxb.append(objAccas.objPyxb)
-      #print (self.filsPyxb)
-      #print ('Fin ', self.nom, self.objPyxb)
-      #print ('_______________________________________')
-
-        
-       
-
-class X_MCLIST (X_MCCOMPO):
-# --------------------------
-   def buildObjPyxb(self,mc_list):
-      #print ('__________________________________________________________________')
-      #print ('X_MCLIST buildObjPyxb traite ds X_MCLIST', self.nom, self)
-      #print ('on ne fait rien pour les MCLISTs, cela sera fait dans chaque MCFACT')
-      #print ('__________________________________________________________________')
-      pass
-
-
-class X_MCFACT (X_MCCOMPO):
-# -------------------------
-# on gere  au niveau du MCCOMPO
-      pass
-
-
-class X_JDC (X_MCCOMPO):
-# ---------------------
-   def  __init__(self):
-      #print ('_______________________________________')
-      #print ('X_JDC buildObjPyxb',  self)
-      if not self.cata or  not self.cata.modeleMetier : return
-      self.monNomClasseModeleMetier=self.code
-      self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
-      self.objPyxb=self.maClasseModeleMetier()
-      pyxb.GlobalValidationConfig._setContentInfluencesGeneration(pyxb.GlobalValidationConfig.ALWAYS)
-      pyxb.GlobalValidationConfig._setInvalidElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION)
-      pyxb.GlobalValidationConfig._setOrphanElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION)
-      #print ('fin buildObjPyxb _______________________________________')
-
-   def enregistreEtapePyxb(self,etape):
-     # OK seulement si sequence (choice ? ...)
-      if not self.cata or  not self.cata.modeleMetier : return
-      print ('enregistreEtapePyxb' , etape)
-      self.objPyxb.append(etape.objPyxb)
-      etape.perePyxb = self
-      #self.toXml()
-
-   def toXml(self):
-      if not self.cata or  not self.cata.modeleMetier : return
-      print ('***************',self.objPyxb,'***************',)
-      print ('***************',self.objPyxb.orderedContent(),'***************',)
-      print(self.objPyxb.toDOM().toprettyxml())
-      print(self.objPyxb.toxml())
-      return (self.objPyxb.toDOM().toprettyxml())
-        
-
-   def analyseFromXML(self):
-      print ("je suis ds analyseFromXML -- > appel ds analyse de I_JDC.py")
-      if not self.cata or  not self.cata.modeleMetier : return
-      if self.procedure == "" : return
-      self.objPyxb=self.cata.modeleMetier.CreateFromDocument(self.procedure)
-      for objEtape in self.objPyxb.content():
-          objEtape.dictArgs= (self.pyxbToDict(objEtape))
-          objEtape.monNomClasseAccas=objEtape._ExpandedName.localName()
-          objEtape.monNomClasseAccas=objEtape.monNomClasseAccas[2:]
-          objEtape.dictPyxb['objEnPyxb']=objEtape
-          objEtape.dictArgs['dicoPyxbDeConstruction']=objEtape.dictPyxb
-          maClasseAccas=getattr(self.cata,objEtape.monNomClasseAccas)
-          objAccasEtape=maClasseAccas(**(objEtape.dictArgs))
-          # attention objAccasEtape = None normal (cf buildSd)
-          #print ( 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh')
-          #print (objEtape , type(objEtape))
-          #print (objEtape.dictPyxb)
-          #print (maClasseAccas)
-          #print (objAccasEtape)
-          #print (objEtape.monNomClasseAccas, type(objEtape.monNomClasseAccas))
-          #print (objEtape._ExpandedName, type(objEtape._ExpandedName))
-          #print (objEtape.dictPyxb[u'experience'])
-          #print (objEtape.dictArgs)
-          #print (objEtape.dictPyxb)
-          #print ( 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh')
-          #exit()
-      
-
-   def pyxbToDict(self,objAAnalyser):
-    # la transformation de l objAAnalyser en type lu par eficas ne fonctionne pas pour tout
-    # faudrait - il travailler sur les types des objets ?
-    # c est a revoir -> fonction cast a prevoir ds les 2 sens
-    if not self.cata or  not self.cata.modeleMetier : return
-    if objAAnalyser is None: return
-    #print ('debut pour ',objAAnalyser)
-    dictArgs = {}
-    if isinstance(objAAnalyser, pyxb.binding.basis.simpleTypeDefinition): 
-       objAAnalyser.dictPyxb=objAAnalyser
-       #print (objAAnalyser.dictPyxb , type(objAAnalyser.dictPyxb))
-       if isinstance(objAAnalyser, pyxb.binding.basis.enumeration_mixin):    return str(objAAnalyser)
-       if isinstance(objAAnalyser, types.StringTypes):  return str(objAAnalyser)
-       if isinstance(objAAnalyser, types.FloatType):  return float(objAAnalyser)
-       if isinstance(objAAnalyser, (types.IntType, types.LongType)):  return int(objAAnalyser)
-       #if isinstance(objAAnalyser, (types.NoneType, types.BooleanType, types.FloatType, types.IntType, types.LongType)):
-       return repr(objAAnalyser)
-       # ou ? return objAAnalyser
-       #if isinstance(objAAnalyser, types.StringTypes): return pyxb.utils.utility.QuotedEscaped(objAAnalyser,)
-       #pour une enum getattr(value dans le type)
-       # return pythonLiteral(ReferenceFacet(facet=value, **kw))
-    objAAnalyser.dictPyxb = {} 
-    for expandedName, elementDeclaration in objAAnalyser._ElementMap.items():
-        objPyxbName  = expandedName.localName()
-        objPyxbValue = getattr(objAAnalyser, objPyxbName)
-        if objPyxbValue == None or objPyxbValue == [] : continue
-        if elementDeclaration.isPlural():
-            dictArgs[objPyxbName] = []
-            #objAAnalyser.dictPyxb[objPyxbName]={} 
-            objAAnalyser.dictPyxb[objPyxbName]=[] 
-            #objAAnalyser.dictPyxb['objEnPyxb']=objAAnalyser
-            for objPyxb in objPyxbValue : 
-                #print ('-------------',objPyxb)
-                dictArgs[objPyxbName].append(self.pyxbToDict(objPyxb))
-                objPyxb.dictPyxb['objEnPyxb'] = objPyxb
-                objAAnalyser.dictPyxb[objPyxbName].append(objPyxb.dictPyxb)
-        else:
-            dictArgs[objPyxbName] = self.pyxbToDict(getattr(objAAnalyser, objPyxbName))
-            #print ('ajout ds dico de ', objAAnalyser , 'de',  objPyxbName, objPyxbValue)
-            objAAnalyser.dictPyxb[objPyxbName] = objPyxbValue.dictPyxb
-            #print ('ajout ds dico de ', objPyxbValue.dictPyxb, 'de',  objPyxbName)
-            objAAnalyser.dictPyxb['objEnPyxb']=objAAnalyser
-    #print ("***********************************")
-    #print ('pyxbToDict  fin pour ********** ', objAAnalyser)
-    #print ('pyxbToDict ', objAAnalyser, objAAnalyser.dictPyxb)
-    #print ('pyxbToDict  fin pour ********** ', objAAnalyser)
-    #print ("***********************************")
-    #print (dictArgs)
-    #print (dictPyxb)
-    #for i in dictArgs.keys(): print (i, " ", dictArgs[i], " ", type(dictArgs[i]))
-    #print ('fin pour ',objAAnalyser)
-    return dictArgs
-
-   
-  
-
-if __name__ == "__main__":
-   print ('a faire')
diff --git a/Efi2Xsd/ajoutBalise.py b/Efi2Xsd/ajoutBalise.py
new file mode 100644 (file)
index 0000000..21b8487
--- /dev/null
@@ -0,0 +1,6 @@
+debuttypeChaineAvecBlancs = '\t\t<xs:simpleType name="T_stg">\n\t\t\t <xs:restriction>\n\t\t\t <xs:simpleType>\n\t\t\t\t <xs:list>\n\t\t\t\t <xs:simpleType>\n\t\t\t\t\t <xs:restriction base="xs:string">'
+fintypeChaineAvecBlancs = '\t\t</xs:restriction>\n\t\t </xs:simpleType>\n\t\t </xs:list>\n\t\t </xs:simpleType>\n\t\t'
+
+SequenceChaineAvecBlancs = '\t\t<xs:complexType name="T_{}">\n\t\t\t  <xs:sequence> <xs:element name="stg" type="Vimmp:T_stg" minOccurs="1" maxOccurs="1" default="{}">n\t\t\t  <\xs:sequence>\n\t\t<xs:complexType name>\n'
+
+
index 4f2a4636888a2dd5823c4a5e5f69d3caaa1776ae..697629723eb5d1a0221a109a8b89764ec8dcc7ad 100644 (file)
@@ -27,27 +27,26 @@ eltCata = '\t<element name="{}" type="{}:{}"/>\n'
 
 
 if __name__ == '__main__' :
-   nomElt='Simple'
-   nomDuType='T_Simple'
-   nomDuTypeBase='int'
-   nomDuComplexe='T_Complexe'
-   nomDuCode='monCode'
-   minOccurs=1
-   maxOccurs=1
-
-   texteSimple=typeSimple.format(nomDuType, nomDuTypeBase)
-   texteElt=eltDsSequence.format(nomElt,nomDuCode,nomDuType,minOccurs,maxOccurs)
-
-   minOccurs=0
-   texteComplexe=debutTypeComplexe.format(nomDuComplexe)
-   texteComplexe+=texteElt
-   texteComplexe+=finTypeComplexe
-   texteEltComplexe=eltDsSequence.format(nomElt,nomDuCode,nomDuType,minOccurs,maxOccurs)
-
-   texteCata=debutTypeCata.format(nomDuCode)
-   texteCata+=texteEltComplexe
-   texteCata+=finTypeCata
-
-   eltRacine=eltCata.format(nomDuCode, 'T_'+nomDuCode)
-   print (texteSimple+texteComplexe+texteCata+eltRacine)
-
+    nomElt='Simple'
+    nomDuType='T_Simple'
+    nomDuTypeBase='int'
+    nomDuComplexe='T_Complexe'
+    nomDuCode='monCode'
+    minOccurs=1
+    maxOccurs=1
+
+    texteSimple=typeSimple.format(nomDuType, nomDuTypeBase)
+    texteElt=eltDsSequence.format(nomElt,nomDuCode,nomDuType,minOccurs,maxOccurs)
+
+    minOccurs=0
+    texteComplexe=debutTypeComplexe.format(nomDuComplexe)
+    texteComplexe+=texteElt
+    texteComplexe+=finTypeComplexe
+    texteEltComplexe=eltDsSequence.format(nomElt,nomDuCode,nomDuType,minOccurs,maxOccurs)
+
+    texteCata=debutTypeCata.format(nomDuCode)
+    texteCata+=texteEltComplexe
+    texteCata+=finTypeCata
+
+    eltRacine=eltCata.format(nomDuCode, 'T_'+nomDuCode)
+    print (texteSimple+texteComplexe+texteCata+eltRacine)
index ffff48796951bdda8816a13e820ef9b742076b90..a9becb59757f5dac4eb9bea77189db3715dca3c3 100644 (file)
@@ -3,6 +3,9 @@ texteDebutNiveau2='<?xml version="1.0" encoding="UTF-8"?>\n<xs:schema xmlns:xs="
 texteDebutNiveau3='<?xml version="1.0" encoding="UTF-8"?>\n<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"\nxmlns="http://chercheurs.edf.com/logiciels/{}"\nxmlns:{}="http://chercheurs.edf.com/logiciels/{}"\nxmlns:{}="http://chercheurs.edf.com/logiciels/{}"\nxmlns:{}="http://chercheurs.edf.com/logiciels/{}"\ntargetNamespace="http://chercheurs.edf.com/logiciels/{}"\nelementFormDefault="qualified" attributeFormDefault="unqualified" version="0">\n'
 texteFin='</xs:schema>'
 
+#texteAnnotation= '\t<xs:simpleType name="PNEFdico_{}">\n\t\t<xs:annotation>\n\t\t<xs:documentation>{}\n\t\t</xs:documentation>\n\t\t</xs:annotation>\n\t<xs:restriction base="xs:string"></xs:restriction>\n\t</xs:simpleType>\n'
+texteAnnotation= '\t<xs:simpleType name="PNEFdico">\n\t\t<xs:annotation>\n\t\t<xs:documentation>{}\n\t\t</xs:documentation>\n\t\t</xs:annotation>\n\t<xs:restriction base="xs:string"></xs:restriction>\n\t</xs:simpleType>\n'
+
 # SIMP
 debutSimpleType      = '\t<xs:simpleType name="{}">\n'
 debutSimpleTypeSsNom = '\t<xs:simpleType>\n'
@@ -15,12 +18,14 @@ minInclusiveBorne    = '\t\t\t<xs:minInclusive value = "{}"/>\n'
 
 debutTypeSimpleListe = '\t\t<xs:restriction>\n\t\t\t<xs:simpleType>\n\t\t\t\t<xs:list>\n\t\t\t\t\t<xs:simpleType>\n'
 finTypeSimpleListe   = '\t\t</xs:restriction>\n\t\t\t</xs:simpleType>\n\t\t\t\t</xs:list>\n\t\t\t\t\t</xs:simpleType>\n'
-fermeBalisesMileu   = '\t\t\t\t\t\t</xs:restriction>\n\t\t\t\t\t</xs:simpleType>\n\t\t\t\t</xs:list>\n\t\t\t </xs:simpleType>\n'
-
-maxLengthTypeSimple = '\t\t\t<xs:maxLength value = "{}"/>\n'
-minLengthTypeSimple = '\t\t\t<xs:minLength value = "{}"/>\n'
-eltDsSequence       = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
-eltWithDefautDsSequence    = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}" default="{}"/>\n'
+fermeBalisesMileu    = '\t\t\t\t\t\t</xs:restriction>\n\t\t\t\t\t</xs:simpleType>\n\t\t\t\t</xs:list>\n\t\t\t </xs:simpleType>\n'
+
+maxLengthTypeSimple   = '\t\t\t<xs:maxLength value = "{}"/>\n'
+minLengthTypeSimple   = '\t\t\t<xs:minLength value = "{}"/>\n'
+eltDsSequence         = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
+eltDsSequenceWithHelp = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
+eltDsSequenceWithDefautAndHelp  = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}" default="{}">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
+eltDsSequenceWithDefaut    = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}" default="{}"/>\n'
 UsingASSDkeyRefDeclaration = '\n\t<xs:keyref name="{}_Name_ref_a{}" refer="{}:Key_Name_For_{}"> \n\t\t<xs:selector xpath="{}"/>\n\t\t<xs:field xpath="."/>\n\t</xs:keyref>\n'
 #    <xs:key name="Key_Name_For_ElementarySurface">
 #            <xs:selector xpath="./Vimmp:CDM/Vimmp:Geometric_Domain/Vimmp:Surface"/>
@@ -41,34 +46,46 @@ debutTypeCompoSeq   = '\t\t<xs:sequence>\n'
 finTypeCompoSeq     = '\t\t</xs:sequence>\n'
 finTypeCompo        = '\t</xs:complexType>\n'
 eltCompoDsSequence  = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
+eltCompoDsSequenceWithHelp = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n' 
+#name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
 #eltCompoDsSequenceInExtension = '\t\t\t<xs:element name="{}" type="{}:{}"/>\n'
 
-# ETAPE 
+# ETAPE
 eltEtape = '\t<xs:element name="{}" type="{}:{}" substitutionGroup="step_{}"/>\n'
+eltEtapeWithHelp = '\t<xs:element name="{}" type="{}:{}" substitutionGroup="step_{}">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
 
 # BLOC
 debutTypeSubst    = '\t<xs:group name="{}">   \n\t\t<xs:sequence>\n'
 finTypeSubst      = '\t\t</xs:sequence>\n\t</xs:group>\n'
-substDsSequence   = '\t\t\t<xs:group ref="{}:{}"  minOccurs="{}" maxOccurs="{}"/>\n'
+substDsSequence   = '\t\t\t<xs:group ref="{}:{}"  minOccurs="{}" maxOccurs="{}">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:group>\n'
 #choiceDsBloc     = '\t\t\t<xs:choice minOccurs={}>\n'
-debutChoiceDsBloc = '<xs:choice>\n'
+debutChoiceDsBloc = '\t\t<xs:choice>\n'
 debutChoiceDsBlocAvecMin = '<xs:choice minOccurs="{}">\n'
-finChoiceDsBloc   = '</xs:choice>\n'
+finChoiceDsBloc   = '\t\t</xs:choice>\n'
 debSequenceDsBloc = '<xs:sequence>\n'
 finSequenceDsBloc = '</xs:sequence>\n'
 debutTypeSubstDsBlocFactorise = '\t<xs:group name="{}">\n'
 finTypeSubstDsBlocFactorise   = '\t</xs:group>\n'
 debutUnion        = '\t\t\t<xs:union>\n'
 finUnion          = '\t\t\t</xs:union>\n'
+reconstitueUnion  = '{} maxOccurs="1">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
 
 
 
 # User OR ASSD
-operAttributeName    = '\t\t<xs:attribute name="name" type="xs:string"/>\n'
-attributeTypeForASSD = '\t\t<xs:attribute name="accasType" type="xs:string" fixed="ASSD"/>\n'
+attributeNameName    = '\t\t<xs:attribute name="sdName" type="xs:string"/>\n'
+attributeTypeForASSD = '\t\t<xs:attribute name="sdType" type="xs:string" fixed="ASSD"/>\n'
 attributeTypeUtilisateurName = '\t\t<xs:attribute name="typeUtilisateur" type="xs:string" fixed="{}"/>\n'
 producingASSDkeyRefDeclaration='\t<xs:key name="Key_Name_For_{}">\n\t\t<xs:selector xpath="."/>\n\t\t<xs:field xpath="{}"/>\n\t</xs:key>\n'
 texteFieldUnitaire="./{}:{}/@name |"
+defBaseXSDUserASSD='\t<xs:simpleType name="AccasUserAssd">\n\t\t<xs:restriction base="xs:string">\n\t\t</xs:restriction>\n\t</xs:simpleType>\n'
+defBaseXSDUserASSDMultiple='\t<xs:simpleType name="AccasUserAssdMultiple">\n\t\t<xs:restriction base="xs:string">\n\t\t</xs:restriction>\n\t</xs:simpleType>\n'
+
+defUserASSDMultiple='\t<xs:simpleType name="{}">\n\t\t<xs:restriction base="AccasUserAssdMultiple">\n\t\t</xs:restriction>\n\t</xs:simpleType>\n'
+defUserASSD ='\t<xs:simpleType name="{}">\n\t\t<xs:restriction base="AccasUserAssd">\n\t\t</xs:restriction>\n\t</xs:simpleType>\n'
+
+defUserASSDOrUserASSDMultiple='\t<xs:simpleType name="{}_{}">\n\t\t<xs:restriction base="{}">\n\t\t</xs:restriction>\n\t</xs:simpleType>\n'
+
 
 # CATA
 debutTypeCata     = '\t<xs:complexType name="T_{}">\n\t\t<xs:choice minOccurs="0" maxOccurs="unbounded">\n'
@@ -89,12 +106,44 @@ finExtension  = '\t\t</xs:choice>\n\t\t</xs:extension>\n\t\t</xs:complexContent>
 eltAbstraitCataPPal  = '\t<xs:complexType name="T_step_{}" abstract="true"/>\n'
 eltAbstraitCataFils  = '\t<xs:complexType name="T_step_{}" abstract="true">\n\t\t<xs:complexContent>\n\t\t\t<xs:extension base="{}:T_step_{}"/>\n\t\t</xs:complexContent>\n\t</xs:complexType>\n'
 eltCataPPal = '\t<xs:element name="step_{}" type="{}:T_step_{}"/>\n'
+eltCataPPalWithHelp = '\t<xs:element name="step_{}" type="{}:T_step_{}"/>\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
 eltCataFils = '\t<xs:element name="step_{}" type="{}:T_step_{}" substitutionGroup="step_{}"/>\n'
+eltCataFilsWithHelp = '\t<xs:element name="step_{}" type="{}:T_step_{}" substitutionGroup="step_{}"/>\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
+
 eltCata = '\t<xs:element name="{}" type="{}:T_{}"/>\n\t\t<xs:complexType name="T_{}">\n\t\t  <xs:choice minOccurs="0" maxOccurs="unbounded">\n\t\t\t<xs:element ref="step_{}" minOccurs="0" maxOccurs="1"/>\n\t\t  </xs:choice>\n\t\t</xs:complexType>\n'
 
 #\n\t<xs:element name="{}_Abstract" type="{}:T_{}_Abstract"/>\n'
 #implementeAbstrait  = '\t<xs:element name="{}" type="{}:{}" substitutionGroup="{}:{}_Abstract"/>\n'
 
+# MATRICE oldVersion
+# (_matrix ou pas ?)
+#matriceSimpleType = '\t<xs:simpleType name="{}_matrix">\n\t\t<xs:restriction>\n\t\t\t<xs:simpleType>\n\t\t\t\t<xs:list>\n\t\t\t\t\t<xs:simpleType>\n\t\t\t\t\t\t<xs:restriction  base="{}_element"/>\n\t\t\t\t\t</xs:simpleType>\n\t\t\t\t</xs:list>\n\t\t\t</xs:simpleType>\n\t\t\t<xs:length value="{}"/>\n\t\t</xs:restriction>\n\t</xs:simpleType>\n'
+#matriceSimpleType = '\t<xs:simpleType name="{}">\n\t\t<xs:restriction>\n\t\t\t<xs:simpleType>\n\t\t\t\t<xs:list>\n\t\t\t\t\t<xs:simpleType>\n\t\t\t\t\t\t<xs:restriction  base="{}_element"/>\n\t\t\t\t\t</xs:simpleType>\n\t\t\t\t</xs:list>\n\t\t\t</xs:simpleType>\n\t\t\t<xs:length value="{}"/>\n\t\t</xs:restriction>\n\t</xs:simpleType>\n'
+#matriceSimpleType +='\t<xs:group name="{}_lines">\n\t\t<xs:sequence>\n\t\t\t<xs:element name="{}" type="{}:{}_matrix" minOccurs="{}" maxOccurs="{}"/>\t\n\t\t</xs:sequence>\n\t</xs:group>\n\t\n'
+#matriceSimpleType +='\t<xs:group name="{}_lines">\n\t\t<xs:sequence>\n\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\t\n\t\t</xs:sequence>\n\t</xs:group>\n\t\n'
+#matriceSimpleType +='\t<xs:group name="{}_content">\n\t\t<xs:sequence>\n\t\t\t<xs:group ref="{}:{}_lines" minOccurs="1" maxOccurs="1"/>\t\n\t\t</xs:sequence>\n\t</xs:group>'
+#eltMatrice = ' <xs:group ref="{}:{}_content" minOccurs="{}" maxOccurs="{}"/>'
+
+# TUPLE
+tupleNonHomogeneSimpleType = '\t<xs:simpleType name="{}_n{}_tuple">\n\t\t<xs:restriction base="{}"/>\n\t\t</xs:simpleType>\n'
+tupleNonHomogeneElt        = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
+tupleDebutComplexeType     = '\t<xs:complexType name="{}">\n\t\t<xs:sequence>'
+tupleMilieuComplexeType    = '\n\t\t\t<xs:element name="n{}" type="{}_n{}_tuple" minOccurs="1" maxOccurs="1"/>'
+tupleFinComplexeType       = '\n\t\t</xs:sequence>\n\t</xs:complexType>\n'
+
+# MATRICE
+eltMatrice = '\t\t\t <xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
+matriceSimpleType = '\t<xs:simpleType name="{}_line">\n\t\t<xs:restriction>\n\t\t\t<xs:simpleType>\n\t\t\t\t<xs:list>\n\t\t\t\t\t<xs:simpleType>\n\t\t\t\t\t\t<xs:restriction  base="{}_element"/>\n\t\t\t\t\t</xs:simpleType>\n\t\t\t\t</xs:list>\n\t\t\t</xs:simpleType>\n\t\t\t<xs:length value="{}"/>\n\t\t</xs:restriction>\n\t</xs:simpleType>\n'
+matriceSimpleType +='\t<xs:group name="{}_matrix">\n\t\t<xs:sequence>\n\t\t\t<xs:element name="line" type="{}:{}_line" minOccurs="{}" maxOccurs="{}"/>\n\t\t </xs:sequence>\n\t</xs:group>\n'
+matriceSimpleType +='\t<xs:complexType name="{}"> \n\t\t<xs:group ref="{}:{}_matrix" minOccurs="1" maxOccurs="1"/>\n\t</xs:complexType>\n'
+
+# CHAINES AVEC BLANC
+debutChaineAvecBlancsInto  = '\t<xs:simpleType name="{}_enum">\n\t\t<xs:restriction base="xs:string">\n'
+milieuChaineAvecBlancsInto = '\t\t\t<xs:enumeration value="{}"/>\n'
+finChaineAvecBlancsInto    = '\t\t</xs:restriction>\n\t\t</xs:simpleType>\n'
+       
+complexChaineAvecBlancs = '\t<xs:complexType name="{}">\n\t\t<xs:sequence maxOccurs="{}">\n\t\t\t\t<xs:element name="s__" type="{}_enum"/>\n\t\t\t</xs:sequence>\n\t</xs:complexType>\n'
+
+typeEltChaineAvecBlancSansInto = '\t\t<xs:simpleType name="{}_enum">\n\t\t\t<xs:restriction base="xs:string">\n\t\t\t</xs:restriction>\n\t\t</xs:simpleType>'
 if __name__ == '__main__' :
     print ('ne fait rien')
-
index cf099b11e34c5e846f7d0443b101e45f6a38a52b..85254f9431ff2d44f01b9cfd58ce3f0c71c87896 100644 (file)
@@ -15,7 +15,7 @@ import Atmo.raw.atmo_test3 as raw_custom
 
 import inspect
 def creationAccasSimp(c):
-    print c 
+    print c
 
 class toto
 def __init__(self,*args):
@@ -23,7 +23,7 @@ def __init__(self,*args):
     mro = type(self).mro()
     for next_class in mro[mro.index(ChildB) + 1:] :
         if hasattr(next_class, '__init__'):
-           next_class.__init__(self,args)
+            next_class.__init__(self,args)
 
 # Utility function to identify classes of interest
 def _isSupersedable (cls):
@@ -32,14 +32,14 @@ def _isSupersedable (cls):
 def _injectClasses ():
     import sys
     import pyxb.binding.basis
-    
+
     # All PyXB complex type definitions in the original module
     raw_classes = set([_o for (_, _o) in inspect.getmembers(raw_custom) if _isSupersedable(_o)])
     raw_classes_compo=set()
     raw_classes_simp=set()
     for c in raw_classes :
-      if issubclass(c,pyxb.binding.basis.complexTypeDefinition) : raw_classes_compo.add(c)
-      else : raw_classes_simp.add(c)
+        if issubclass(c,pyxb.binding.basis.complexTypeDefinition) : raw_classes_compo.add(c)
+        else : raw_classes_simp.add(c)
     #print 'Original classes complex type: %s' % (raw_classes_compo,)
     print 'Original classes simple type: %s' % (raw_classes_simp,)
     for c in raw_classes_simp:
@@ -48,14 +48,14 @@ def _injectClasses ():
         print c.__class__
         #setattr(c,'__init__',__init__)
         print c.__mro__
-    
+
     # PyXB complex type definitions in this module that did not come
     # from the original import *.
     this_module = sys.modules[__name__]
     this_classes = set([_o for (_, _o) in inspect.getmembers(this_module) if _isSupersedable(_o) and _o not in raw_classes])
     this_classes_tuple = tuple(this_classes)
     #print 'This classes: %s' % (this_classes,)
-    
+
     # Raw classes superseded by something in this module
     superseded_classes = set([ _o for _o in raw_classes if _o._SupersedingClass() in this_classes ])
     superseded_classes_tuple = tuple(superseded_classes)
index 4667b08bf1b4445014e8905cc96941d7d1b5f773..5d8126db0cb212e5a64adcee8d210a69f709abb4 100755 (executable)
@@ -1,19 +1,19 @@
 class Tuple:
-  def __init__(self,ntuple):
-    self.ntuple=ntuple
+    def __init__(self,ntuple):
+        self.ntuple=ntuple
 
-  def __convert__(self,valeur):
-    if type(valeur) == types.StringType:
-      return None
-    if len(valeur) != self.ntuple:
-      return None
-    return valeur
+    def __convert__(self,valeur):
+        if type(valeur) == types.StringType:
+            return None
+        if len(valeur) != self.ntuple:
+            return None
+        return valeur
 
-  def info(self):
-    return "Tuple de %s elements" % self.ntuple
+    def info(self):
+        return "Tuple de %s elements" % self.ntuple
 
-  __repr__=info
-  __str__=info
+    __repr__=info
+    __str__=info
 
 
 
@@ -22,38 +22,38 @@ def inverseDico(dicoSource) :
     dicoInverse = {}
     for (clef,valeur) in dicoSource.items():
         if not(type(valeur) is tuple):
-           dicoInverse[valeur]=clef
-           continue
+            dicoInverse[valeur]=clef
+            continue
         (elt,att)=valeur
         if elt not in dicoInverse : dicoInverse[elt]={}
         dicoInverse[elt][att]=clef
     return dicoInverse
-     
+
 dictSIMPEficasXML= { 'typ'        : 'nomTypeAttendu',
-                     'statut'     : 'statut', 
+                     'statut'     : 'statut',
                      'min'        : 'minOccurences',
-                     'max'        : 'maxOccurences', 
-                     'homo'       : 'homo'       , 
-                     'position'   : 'portee', 
-                     'validators' : 'validators' , 
+                     'max'        : 'maxOccurences',
+                     'homo'       : 'homo'       ,
+                     'position'   : 'portee',
+                     'validators' : 'validators' ,
                      'sug'        : 'valeurSugg',
-                     'defaut'     : 'valeurDef' , 
-                     'into'       : ('plageValeur','into'), 
-                     'val_min'    : ('plageValeur','borneInf'), 
+                     'defaut'     : 'valeurDef' ,
+                     'into'       : ('plageValeur','into'),
+                     'val_min'    : ('plageValeur','borneInf'),
                      'val_max'    : ('plageValeur','borneSup'),
-                     'ang'        : ('doc','ang'), 
+                     'ang'        : ('doc','ang'),
                      'fr'         : ('doc','fr',),
                      'docu'       : ('doc','docu'),
                    }
 
 dictSIMPXMLEficas= inverseDico(dictSIMPEficasXML)
 
 
-dictFACTEficasXML = { 'statut'     : 'statut', 
+
+dictFACTEficasXML = { 'statut'     : 'statut',
                       'min'        : 'minOccurences',
-                      'max'        : 'maxOccurences', 
-                      'ang'        : ('doc','ang'), 
+                      'max'        : 'maxOccurences',
+                      'ang'        : ('doc','ang'),
                       'fr'         : ('doc','fr',),
                       'docu'       : ('doc','docu'),
                       'regles'     : 'regles',
@@ -62,8 +62,8 @@ dictFACTEficasXML = { 'statut'     : 'statut',
 
 dictFACTXMLEficas =  inverseDico(dictFACTEficasXML)
 
-dictBLOCEficasXML = { 'statut'     : 'statut', 
-                      'ang'        : ('doc','ang'), 
+dictBLOCEficasXML = { 'statut'     : 'statut',
+                      'ang'        : ('doc','ang'),
                       'fr'         : ('doc','fr',),
                       'regles'     : 'regles',
                       'condition'  : 'condition' ,
@@ -73,7 +73,7 @@ dictBLOCXMLEficas =  inverseDico(dictBLOCEficasXML)
 
 dictPROCEficasXML =  { 'nom'        : 'nom',
                        'regles'     : 'regles',
-                       'ang'        : ('doc','ang'), 
+                       'ang'        : ('doc','ang'),
                        'fr'         : ('doc','fr',),
                        'docu'       : ('doc','docu'),
                       }
@@ -90,28 +90,28 @@ listeParamDeTypeTypeAttendu = ( 'defaut', 'sug', 'val_min', 'val_max', 'into', '
 listeParamDeTypeStr         = ('fr', 'docu', 'ang', 'nom' )
 
 listeParamTjsSequence        = ('into' , 'intoSug')
-listeParamSelonType           = ('defaut', 'sug', 'into', 'intoSug') 
+listeParamSelonType           = ('defaut', 'sug', 'into', 'intoSug')
 
 if __name__ == "__main__":
-   import pprint
-   pp=pprint.PrettyPrinter(indent=4)
-   print ('dictSIMPEficasXML')
-   pp.pprint(dictSIMPEficasXML)
-   print ('\n\n')
-   print ('dictSIMPXMLEficas')
-   pp.pprint(dictSIMPXMLEficas)
-   print ('\n\n')
-   print ('dictFACTEficasXML')
-   pp.pprint(dictFACTEficasXML)
-   print ('\n\n')
-   print ('dictFACTXMLEficas')
-   pp.pprint(dictFACTXMLEficas)
-   print ('\n\n')
-   print ('dictPROCEficasXML')
-   pp.pprint(dictPROCEficasXML)
-   print ('\n\n')
-   print ('dictPROCXMLEficas')
-   pp.pprint(dictPROCXMLEficas)
-   print ('\n\n')
-   print ('dictNomsDesTypes')
-   pp.pprint(dictNomsDesTypes )
+    import pprint
+    pp=pprint.PrettyPrinter(indent=4)
+    print ('dictSIMPEficasXML')
+    pp.pprint(dictSIMPEficasXML)
+    print ('\n\n')
+    print ('dictSIMPXMLEficas')
+    pp.pprint(dictSIMPXMLEficas)
+    print ('\n\n')
+    print ('dictFACTEficasXML')
+    pp.pprint(dictFACTEficasXML)
+    print ('\n\n')
+    print ('dictFACTXMLEficas')
+    pp.pprint(dictFACTXMLEficas)
+    print ('\n\n')
+    print ('dictPROCEficasXML')
+    pp.pprint(dictPROCEficasXML)
+    print ('\n\n')
+    print ('dictPROCXMLEficas')
+    pp.pprint(dictPROCXMLEficas)
+    print ('\n\n')
+    print ('dictNomsDesTypes')
+    pp.pprint(dictNomsDesTypes )
index c98a16cda8a423454f7e6e7f9549812b5f9c123c..b519e99a2336b993b07249209dac64eccee33b06 100755 (executable)
@@ -303,7 +303,8 @@ if __name__ == "__main__":
 #   print dir(efficas.T_SIMP)
 
    #xml = open('cata_test1.xml').read()
-   xml = open('cata.xml').read()
+   with open('cata.xml') as fd :
+     xml=fd.read()
    SchemaMed = efficas.CreateFromDocument(xml)
    SchemaMed.exploreCata()
    #SchemaMed.dumpXSD()
index dd23124b79dece8334c99f4a2d889d65a67c41f8..33c46e9ce5f41328881d4fc2aea72158861dadf9 100644 (file)
@@ -20,7 +20,7 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-  from builtins import str
+    from builtins import str
 except : pass
 import os,traceback
 import re
@@ -37,7 +37,7 @@ class COMMANDE_COMM(N_OBJECT.OBJECT,I_OBJECT.OBJECT) :
     """
     nature = "COMMANDE_COMMENTARISEE"
     idracine='_comm'
-    
+
     def __init__(self,texte='',parent=None,reg='oui'):
         self.valeur = texte
         if not parent :
@@ -45,9 +45,9 @@ class COMMANDE_COMM(N_OBJECT.OBJECT,I_OBJECT.OBJECT) :
         else:
             self.jdc = self.parent = parent
         if hasattr(self.parent,'etape'):
-          self.etape = self.parent.etape
+            self.etape = self.parent.etape
         else :
-          self.etape = None
+            self.etape = None
         self.definition=self
         self.nom = ''
         self.niveau = self.parent.niveau
@@ -55,7 +55,7 @@ class COMMANDE_COMM(N_OBJECT.OBJECT,I_OBJECT.OBJECT) :
         self.state="unchanged"
         #self.appel = N_utils.calleeWhere(niveau=2)
         if reg=='oui' : self.register()
-            
+
     def isValid(self):
         return 1
 
@@ -76,7 +76,7 @@ class COMMANDE_COMM(N_OBJECT.OBJECT,I_OBJECT.OBJECT) :
 
     def initModif(self):
         self.state = 'modified'
-        self.parent.initModif()    
+        self.parent.initModif()
 
     def setValeur(self,new_valeur):
         """
@@ -115,16 +115,16 @@ class COMMANDE_COMM(N_OBJECT.OBJECT,I_OBJECT.OBJECT) :
         """
         Indique si self est repetable ou non : retourne toujours 1
         """
-        return 1        
+        return 1
 
     def getAttribut(self,nom_attribut) :
         """
         Retourne l'attribut de nom nom_attribut de self (ou herite)
         """
         if hasattr(self,nom_attribut) :
-          return getattr(self,nom_attribut)
+            return getattr(self,nom_attribut)
         else :
-          return None
+            return None
 
     def getFr(self):
         """
@@ -132,17 +132,17 @@ class COMMANDE_COMM(N_OBJECT.OBJECT,I_OBJECT.OBJECT) :
         """
         if self.jdc.code=='ASTER' : return self.definition.fr
         try :
-          return getattr(self.definition,self.jdc.lang)
+            return getattr(self.definition,self.jdc.lang)
         except:
-          return ''
+            return ''
 
     def listeMcPresents(self):
         return []
 
     def supprime(self):
-        """ 
+        """
         Methode qui supprime toutes les boucles de references afin que l'objet puisse
-        etre correctement detruit par le garbage collector 
+        etre correctement detruit par le garbage collector
         """
         self.parent = None
         self.etape = None
@@ -185,7 +185,7 @@ class COMMANDE_COMM(N_OBJECT.OBJECT,I_OBJECT.OBJECT) :
             # on essaie de creer un objet JDC...
             CONTEXT.unsetCurrentStep()
             if re.search('Fin Commentaire',self.valeur) :
-               self.valeur=self.valeur.replace('Fin Commentaire','')
+                self.valeur=self.valeur.replace('Fin Commentaire','')
             J=self.jdc.__class__(procedure=self.valeur,
                                  definition=self.jdc.definition,
                                  cata=self.jdc.cata,
@@ -238,47 +238,46 @@ class COMMANDE_COMM(N_OBJECT.OBJECT,I_OBJECT.OBJECT) :
         Booleenne qui retourne 1 si self est valide, 0 sinon
         """
         return self.actif
-    
+
     def verifConditionBloc(self):
-      """
-          Evalue les conditions de tous les blocs fils possibles
-          (en fonction du catalogue donc de la definition) de self et
-          retourne deux listes :
-            - la premiere contient les noms des blocs a rajouter
-            - la seconde contient les noms des blocs a supprimer
-      """
-      return [],[]
+        """
+            Evalue les conditions de tous les blocs fils possibles
+            (en fonction du catalogue donc de la definition) de self et
+            retourne deux listes :
+              - la premiere contient les noms des blocs a rajouter
+              - la seconde contient les noms des blocs a supprimer
+        """
+        return [],[]
 
     def verifConditionRegles(self,liste_presents):
-      """
-          Retourne la liste des mots-cles a rajouter pour satisfaire les regles
-          en fonction de la liste des mots-cles presents
-      """
-      return []
+        """
+            Retourne la liste des mots-cles a rajouter pour satisfaire les regles
+            en fonction de la liste des mots-cles presents
+        """
+        return []
 
     def reparent(self,parent):
-      """
-          Cette methode sert a reinitialiser la parente de l'objet
-      """
-      self.parent=parent
-      self.jdc=parent.getJdcRoot()
-      self.etape=self
+        """
+            Cette methode sert a reinitialiser la parente de l'objet
+        """
+        self.parent=parent
+        self.jdc=parent.getJdcRoot()
+        self.etape=self
 
     def verifExistenceSd(self):
-      """
-         Verifie que les structures de donnees utilisees dans self existent bien dans le contexte
-         avant etape, sinon enleve la reference a ces concepts
-         --> sans objet pour les commandes commentarisees
-      """
-      pass
-        
+        """
+           Verifie que les structures de donnees utilisees dans self existent bien dans le contexte
+           avant etape, sinon enleve la reference a ces concepts
+           --> sans objet pour les commandes commentarisees
+        """
+        pass
+
     def controlSdprods(self,d):
-      """sans objet pour les commandes commentarisees"""
-      pass
+        """sans objet pour les commandes commentarisees"""
+        pass
 
     def close(self):
-      pass
+        pass
 
     def resetContext(self):
-      pass
-
+        pass
index 7108920e155cbdf774d68df62942c7354ba5ca63..3ea378fb6390077cce50e3523b87c92f4554d5d3 100644 (file)
@@ -29,177 +29,175 @@ from Ihm import I_OBJECT
 from Extensions.i18n import tr
 
 class COMMENTAIRE(N_OBJECT.OBJECT,I_OBJECT.OBJECT) :
-  """ 
-      Cette classe permet de creer des objets de type COMMENTAIRE 
-  """
-  nature = 'COMMENTAIRE'
-  idracine = '_comm'
-
-  def __init__(self,valeur,parent=None):
-    # parent est un objet de type OBJECT (ETAPE ou MC ou JDC...)
-    self.valeur=valeur
-    if not parent :
-      self.jdc = self.parent = CONTEXT.getCurrentStep()
-    else:
-      self.jdc = self.parent = parent
-    # La classe COMMENTAIRE n'a pas de definition. On utilise self
-    # pour completude
-    self.definition=self
-    self.nom=''
-    self.niveau = self.parent.niveau
-    self.actif=1
-    self.state="unchanged"
-    self.register()
-    self.fenetreIhm=None
-
-  def register(self):
-    """ 
-        Enregistre le commentaire dans la liste des etapes de son parent
-        lorsque celui-ci est un JDC 
     """
-    if self.parent.nature == 'JDC':
-      # le commentaire est entre deux commandes:
-      # il faut l'enregistrer dans la liste des etapes
-      self.parent.register(self)
-
-  def copy(self):
-    c=COMMENTAIRE(valeur=self.valeur,parent=self.jdc)
-    return c
-
-  def isValid(self):
-    """
-    Retourne 1 si self est valide, 0 sinon
-    Retourne toujours 1 car un commentaire est toujours valide
-    """
-    return 1
-
-  def isOblig(self):
-    """ Indique si self est obligatoire ou non : retourne toujours 0 """
-    return 0
-
-  def isRepetable(self):
-    """ Indique si self est repetable ou non : retourne toujours 1 """
-    return 1
-
-  def active(self):
-      """
-      Rend l'etape courante active
-      """
-      self.actif = 1
-
-  def inactive(self):
-      """
-      Rend l'etape courante inactive
-      NB : un commentaire est toujours actif !
-      """
-      self.actif = 1
-
-  def isActif(self):
-      """
-      Booleenne qui retourne 1 si self est valide, 0 sinon
-      """
-      return self.actif
-
-  def supprime(self):
-      """
-      Methode qui supprime toutes les boucles de references afin que 
-      l'objet puisse etre correctement detruit par le garbage collector
-      """
-      self.parent=None
-      self.jdc=None
-      self.definition = None
-      self.niveau = None
-
-  def listeMcPresents(self):
-      return []
-
-  def getValeur(self) :
-    """ Retourne la valeur de self, cad le contenu du commentaire """
-    try :
-      return self.valeur
-    except:
-      return None
-
-  def setValeur(self,new_valeur):
-    """ 
-        Remplace la valeur de self(si elle existe) par new_valeur
-    """
-    self.valeur = new_valeur
-    self.initModif()
-
-  def initModif(self):
-    self.state = 'modified'
-    if self.parent:
-      self.parent.initModif()
-
-  def supprimeSdProds(self):
-    pass
-
-  def updateContext(self,d):
-    """
-        Update le dictionnaire d avec les concepts ou objets produits par self
-        --> ne fait rien pour un commentaire
-    """
-    pass
-
-  def report(self):
-    """ Genere l'objet rapport (classe CR) """
-    self.cr=CR()
-    if not self.isValid(): self.cr.warn(tr("Objet commentaire non valorise"))
-    return self.cr
-
-  def ident(self):
-    """ Retourne le nom interne associe a self
-        Ce nom n'est jamais vu par l'utilisateur dans EFICAS
-    """
-    return self.nom
-
-  def deleteConcept(self,sd):
-    pass
-
-  def replaceConcept (self,old_sd,sd):
-    pass
-
-  def verifConditionBloc(self):
-    """
-        Evalue les conditions de tous les blocs fils possibles
-        (en fonction du catalogue donc de la definition) de self et
-        retourne deux listes :
-          - la premiere contient les noms des blocs a rajouter
-          - la seconde contient les noms des blocs a supprimer
-    """
-    return [],[]
-
-  def verifConditionRegles(self,liste_presents):
+        Cette classe permet de creer des objets de type COMMENTAIRE
     """
-        Retourne la liste des mots-cles a rajouter pour satisfaire les regles
-        en fonction de la liste des mots-cles presents
-    """
-    return []
-
-  def getSdprods(self,nom_sd):
-     """
-         Retourne les concepts produits par la commande
-     """
-     return None
-
-  def verifExistenceSd(self):
-     pass
-
-  def getFr(self):
-    """
-    Retourne le commentaire lui meme tronque a la 1ere ligne
-    """
-    return self.valeur.split('\n',1)[0]
-
-  def controlSdprods(self,d):
-      """sans objet """
-      pass
-
-  def close(self):
-      pass
-
-  def resetContext(self):
-      pass
-
-
+    nature = 'COMMENTAIRE'
+    idracine = '_comm'
+
+    def __init__(self,valeur,parent=None):
+        # parent est un objet de type OBJECT (ETAPE ou MC ou JDC...)
+        self.valeur=valeur
+        if not parent :
+            self.jdc = self.parent = CONTEXT.getCurrentStep()
+        else:
+            self.jdc = self.parent = parent
+        # La classe COMMENTAIRE n'a pas de definition. On utilise self
+        # pour completude
+        self.definition=self
+        self.nom=''
+        self.niveau = self.parent.niveau
+        self.actif=1
+        self.state="unchanged"
+        self.register()
+        self.fenetreIhm=None
+
+    def register(self):
+        """
+            Enregistre le commentaire dans la liste des etapes de son parent
+            lorsque celui-ci est un JDC
+        """
+        if self.parent.nature == 'JDC':
+            # le commentaire est entre deux commandes:
+            # il faut l'enregistrer dans la liste des etapes
+            self.parent.register(self)
+
+    def copy(self):
+        c=COMMENTAIRE(valeur=self.valeur,parent=self.jdc)
+        return c
+
+    def isValid(self):
+        """
+        Retourne 1 si self est valide, 0 sinon
+        Retourne toujours 1 car un commentaire est toujours valide
+        """
+        return 1
+
+    def isOblig(self):
+        """ Indique si self est obligatoire ou non : retourne toujours 0 """
+        return 0
+
+    def isRepetable(self):
+        """ Indique si self est repetable ou non : retourne toujours 1 """
+        return 1
+
+    def active(self):
+        """
+        Rend l'etape courante active
+        """
+        self.actif = 1
+
+    def inactive(self):
+        """
+        Rend l'etape courante inactive
+        NB : un commentaire est toujours actif !
+        """
+        self.actif = 1
+
+    def isActif(self):
+        """
+        Booleenne qui retourne 1 si self est valide, 0 sinon
+        """
+        return self.actif
+
+    def supprime(self):
+        """
+        Methode qui supprime toutes les boucles de references afin que
+        l'objet puisse etre correctement detruit par le garbage collector
+        """
+        self.parent=None
+        self.jdc=None
+        self.definition = None
+        self.niveau = None
+
+    def listeMcPresents(self):
+        return []
+
+    def getValeur(self) :
+        """ Retourne la valeur de self, cad le contenu du commentaire """
+        try :
+            return self.valeur
+        except:
+            return None
+
+    def setValeur(self,new_valeur):
+        """
+            Remplace la valeur de self(si elle existe) par new_valeur
+        """
+        self.valeur = new_valeur
+        self.initModif()
+
+    def initModif(self):
+        self.state = 'modified'
+        if self.parent:
+            self.parent.initModif()
+
+    def supprimeSdProds(self):
+        pass
+
+    def updateContext(self,d):
+        """
+            Update le dictionnaire d avec les concepts ou objets produits par self
+            --> ne fait rien pour un commentaire
+        """
+        pass
+
+    def report(self):
+        """ Genere l'objet rapport (classe CR) """
+        self.cr=CR()
+        if not self.isValid(): self.cr.warn(tr("Objet commentaire non valorise"))
+        return self.cr
+
+    def ident(self):
+        """ Retourne le nom interne associe a self
+            Ce nom n'est jamais vu par l'utilisateur dans EFICAS
+        """
+        return self.nom
+
+    def deleteConcept(self,sd):
+        pass
+
+    def replaceConcept (self,old_sd,sd):
+        pass
+
+    def verifConditionBloc(self):
+        """
+            Evalue les conditions de tous les blocs fils possibles
+            (en fonction du catalogue donc de la definition) de self et
+            retourne deux listes :
+              - la premiere contient les noms des blocs a rajouter
+              - la seconde contient les noms des blocs a supprimer
+        """
+        return [],[]
+
+    def verifConditionRegles(self,liste_presents):
+        """
+            Retourne la liste des mots-cles a rajouter pour satisfaire les regles
+            en fonction de la liste des mots-cles presents
+        """
+        return []
+
+    def getSdprods(self,nom_sd):
+        """
+            Retourne les concepts produits par la commande
+        """
+        return None
+
+    def verifExistenceSd(self):
+        pass
+
+    def getFr(self):
+        """
+        Retourne le commentaire lui meme tronque a la 1ere ligne
+        """
+        return self.valeur.split('\n',1)[0]
+
+    def controlSdprods(self,d):
+        """sans objet """
+        pass
+
+    def close(self):
+        pass
+
+    def resetContext(self):
+        pass
index 6faae636ad59dec0c901a8844e11f4076289e9ea..78b4509c4221e338847d48a05a109caec4521b08 100644 (file)
@@ -16,7 +16,7 @@
 # with this program. If not, see <http://www.gnu.org/licenses/>.
 """
 Creates the ``EficasException`` class for the EDF Eficas application.
-This class supports the internationalization mechanism provided in 
+This class supports the internationalization mechanism provided in
 the ``i18n`` module.
 """
 
@@ -40,7 +40,7 @@ class EficasException(Exception):
         #sys.path.append(os.path.realpath(".."))
         from Extensions.i18n import tr
         self.args = (tr(msg),)
-    
+
 
 if __name__ == "__main__":
     import sys
index 4351c6d83374efe0ace76cdbfb1128d77ac01fc7..6bf7cc6d63005510e7c1fdf90db89041cf7c1b63 100644 (file)
@@ -18,7 +18,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-    Ce module contient la classe ETAPE_NIVEAU qui sert a 
+    Ce module contient la classe ETAPE_NIVEAU qui sert a
     concretiser les niveaux au sein d'un JDC
 """
 from __future__ import absolute_import
@@ -28,114 +28,113 @@ from Noyau import N_OBJECT
 
 class ETAPE_NIVEAU(N_OBJECT.OBJECT):
 
-  def __init__(self,niveau,parent):
-    self.parent = parent
-    self.jdc = self.parent.getJdcRoot()
-    self.niveau = self
-    self.definition = niveau
-    self.etapes=[]
-    self.etapes_niveaux = []
-    self.dict_niveaux={}
-    self.editmode = 0
-    self.state="undetermined"
-    self.buildNiveaux()
-
-  def buildNiveaux(self):
-    for niveau in self.definition.l_niveaux:
-      etape_niveau = ETAPE_NIVEAU(niveau,self)
-      self.etapes_niveaux.append(etape_niveau)
-      self.dict_niveaux[niveau.nom]=etape_niveau
-
-  def register(self,etape):
-    """ 
-          Enregistre la commande etape :
-          - si editmode = 0 : on est en mode relecture d'un fichier de commandes
-          auquel cas on ajoute etape a la fin de la liste self.etapes
-          - si editmode = 1 : on est en mode ajout d'etape depuis eficas auquel cas
-          cette methode ne fait rien, c'est addEntite qui enregistre etape
-          a la bonne place dans self.etapes 
-    """
-    if self.editmode : return
-    self.etapes.append(etape)
-
-  def unregister(self,etape):
-    """
-        Desenregistre l'etape du niveau
-    """
-    self.etapes.remove(etape)
-
-  def ident(self):
-    return self.definition.label
-
-  def isActif(self):
-    #print 'Niveau : ',self.definition.nom
-    #print '\tactif =',self.definition.actif
-    if self.definition.actif == 1 :
-      return 1
-    else :
-      # self.actif est une condition a evaluer dans un certain contexte ...
-      d = self.creeDictValeurs()
-      try:
-        t=eval(self.definition.actif,d)
-        return t
-      except:
-        traceback.print_exc()
-        return 0
-
-  def creeDictValeurs(self):
-    """
-    Retourne le dictionnaire des freres aines de self compose des couples :
-    {nom_frere isValid()}
-    """
-    d={}
-    for niveau in self.parent.etapes_niveaux:
-      if niveau is self : break
-      d[niveau.definition.nom]=niveau.isValid()
-    return d
-
-  def isValid(self):
-    """ Methode booleenne qui retourne 0 si le niveau est invalide, 1 sinon """
-    if self.etapes_niveaux == []:
-      if len(self.etapes) == 0:
-        return self.definition.valide_vide
-      else:
-        for etape in self.etapes :
-          if not etape.isValid() : return 0
-        return 1
-    else:
-      for etape_niveau in self.etapes_niveaux :
-        if not etape_niveau.isValid() : return 0
-      return 1
-
-  def accept(self,visitor):
-    visitor.visitETAPE_NIVEAU(self)
-
-  def addEntite(self,name,pos_rel):
-    self.editmode = 1
-    try :
-      pos_abs=self.jdc.getNbEtapesAvant(self)+pos_rel
-      cmd = self.jdc.addEntite(name,pos_abs)
-      self.etapes.insert(pos_rel,cmd)
-      self.editmode = 0
-      return cmd
-    except:
-      traceback.print_exc()
-      self.editmode = 0
-      return None
-
-  def suppEntite(self,etape) :
-    """ Classe ETAPE_NIVEAU
-        Supprime une etape 
-    """
-    self.jdc.suppEntite(etape)
-
-
-  def getFr(self):
-     """
-        Retourne le texte d'aide dans la langue choisie
-     """
-     try :
-        return getattr(self.definition,self.jdc.lang)
-     except:
-        return ''
-
+    def __init__(self,niveau,parent):
+        self.parent = parent
+        self.jdc = self.parent.getJdcRoot()
+        self.niveau = self
+        self.definition = niveau
+        self.etapes=[]
+        self.etapes_niveaux = []
+        self.dict_niveaux={}
+        self.editmode = 0
+        self.state="undetermined"
+        self.buildNiveaux()
+
+    def buildNiveaux(self):
+        for niveau in self.definition.l_niveaux:
+            etape_niveau = ETAPE_NIVEAU(niveau,self)
+            self.etapes_niveaux.append(etape_niveau)
+            self.dict_niveaux[niveau.nom]=etape_niveau
+
+    def register(self,etape):
+        """
+              Enregistre la commande etape :
+              - si editmode = 0 : on est en mode relecture d'un fichier de commandes
+              auquel cas on ajoute etape a la fin de la liste self.etapes
+              - si editmode = 1 : on est en mode ajout d'etape depuis eficas auquel cas
+              cette methode ne fait rien, c'est addEntite qui enregistre etape
+              a la bonne place dans self.etapes
+        """
+        if self.editmode : return
+        self.etapes.append(etape)
+
+    def unregister(self,etape):
+        """
+            Desenregistre l'etape du niveau
+        """
+        self.etapes.remove(etape)
+
+    def ident(self):
+        return self.definition.label
+
+    def isActif(self):
+        #print 'Niveau : ',self.definition.nom
+        #print '\tactif =',self.definition.actif
+        if self.definition.actif == 1 :
+            return 1
+        else :
+            # self.actif est une condition a evaluer dans un certain contexte ...
+            d = self.creeDictValeurs()
+            try:
+                t=eval(self.definition.actif,d)
+                return t
+            except:
+                traceback.print_exc()
+                return 0
+
+    def creeDictValeurs(self):
+        """
+        Retourne le dictionnaire des freres aines de self compose des couples :
+        {nom_frere isValid()}
+        """
+        d={}
+        for niveau in self.parent.etapes_niveaux:
+            if niveau is self : break
+            d[niveau.definition.nom]=niveau.isValid()
+        return d
+
+    def isValid(self):
+        """ Methode booleenne qui retourne 0 si le niveau est invalide, 1 sinon """
+        if self.etapes_niveaux == []:
+            if len(self.etapes) == 0:
+                return self.definition.valide_vide
+            else:
+                for etape in self.etapes :
+                    if not etape.isValid() : return 0
+                return 1
+        else:
+            for etape_niveau in self.etapes_niveaux :
+                if not etape_niveau.isValid() : return 0
+            return 1
+
+    def accept(self,visitor):
+        visitor.visitETAPE_NIVEAU(self)
+
+    def addEntite(self,name,pos_rel):
+        self.editmode = 1
+        try :
+            pos_abs=self.jdc.getNbEtapesAvant(self)+pos_rel
+            cmd = self.jdc.addEntite(name,pos_abs)
+            self.etapes.insert(pos_rel,cmd)
+            self.editmode = 0
+            return cmd
+        except:
+            traceback.print_exc()
+            self.editmode = 0
+            return None
+
+    def suppEntite(self,etape) :
+        """ Classe ETAPE_NIVEAU
+            Supprime une etape
+        """
+        self.jdc.suppEntite(etape)
+
+
+    def getFr(self):
+        """
+           Retourne le texte d'aide dans la langue choisie
+        """
+        try :
+            return getattr(self.definition,self.jdc.lang)
+        except:
+            return ''
index 9d17d85e5ce3702d9d002f8c54e91f8bcf810d9f..6c5acddfaa0c00a2302e38c10a22daf848e40586 100644 (file)
@@ -19,9 +19,9 @@
 #
 from __future__ import absolute_import
 from __future__ import print_function
-try : 
-   from builtins import str
-   from builtins import object
+try :
+    from builtins import str
+    from builtins import object
 except : pass
 
 import re,sys,types
@@ -59,7 +59,7 @@ def cmp_function(arg1,arg2):
         return 0
     else:
         return 1
-    
+
 class InterpreteurException(Exception):
     """
     Classe servant a definir les exceptions levees par l'interpreteur de formule
@@ -79,7 +79,7 @@ class Interpreteur_Formule(object):
                            'LOG10','SIN','COS','TAN','ASIN','ACOS','ATAN','SINH',
                            'COSH','TANH','HEAVYSID']
     l_constantes = ['PI','RD_RG','DG_RD']
+
     def __init__(self,formule=None,constantes=[],fonctions=[],parent=None):
         """
         Constructeur d'interpreteurs de formule Aster
@@ -120,7 +120,7 @@ class Interpreteur_Formule(object):
             if nom[0] in ('+','-') : nom = nom[1:]
         self.cr.debut = tr("Debut Fonction %s", nom)
         self.cr.fin = tr("Fin Fonction %s", nom)
-        
+
     def str(self):
         """
         Retourne une liste de chaines de caracteres representant la formule
@@ -141,21 +141,21 @@ class Interpreteur_Formule(object):
         """
         txt = self.cr.report()
         return txt
-    
+
     def enregistre(self,fils):
         """
         Enregistre un operateur fils dans la liste des children
         """
         self.l_children.append(fils)
         self.cr.add(fils.cr)
-        
+
     def isValid(self):
         """
         Booleenne qui retourne 1 si la formule est valide, 0 sinon
         Methode externe
         """
         self.l_operateurs = []
-        self.cr.purge() # on vide le cr 
+        self.cr.purge() # on vide le cr
         self.initCr() # on initialise le cr
         self.interpreteFormule()
         return self.cr.estvide()
@@ -205,7 +205,7 @@ class Interpreteur_Formule(object):
             self.d_fonctions_unaires[new_fonc[0]] = self.getNbArgs(new_fonc)
         #self.d_fonctions_unaires.update(self.new_fonctions_unaires)
         self.l_fonctions_unaires = list(self.d_fonctions_unaires.keys())
-        
+
     def ordonneListes(self):
         """
         Ordonne les listes de fonctions unaires et binaires
@@ -213,7 +213,7 @@ class Interpreteur_Formule(object):
         self.l_fonctions_binaires.sort(cmp_function)
         self.l_fonctions_unaires.sort(cmp_function)
         self.l_constantes.sort(cmp_function)
-        
+
 
     def splitOperateurs(self,texte):
         """
@@ -317,7 +317,7 @@ class Interpreteur_Formule(object):
             else:
                 # on n'a pas trouve de nombre
                 return None,texte
-        
+
     def chercheConstanteOld(self,texte):
         """
         Recherche une constante en debut de texte parmi la liste des constantes.
@@ -367,7 +367,7 @@ class Interpreteur_Formule(object):
         else:
             # aucune constante trouvee
             return None,texte
-        
+
     def chercheArgs(self,texte):
         """
         Cherche au debut de texte une liste d'arguments entre parentheses
@@ -391,7 +391,7 @@ class Interpreteur_Formule(object):
             else:
                 # on a fini d'analyser le texte : reste = None
                 return texte,None
-                    
+
     def chercheOperateurUnaireOld(self,texte):
         """
         Cherche dans texte un operateur unaire
@@ -468,26 +468,26 @@ class Interpreteur_Formule(object):
         elif texte[0] == '-':
             # Il faut pouvoir trapper les expressions du type exp(-(x+1)) ...
             try :
-               args,reste = self.chercheArgs(texte[1:])
+                args,reste = self.chercheArgs(texte[1:])
             except InterpreteurException as e:
                 raise InterpreteurException (e.__str__())
             if not args :
-               # Il ne s'agit pas de '-' comme operateur unaire --> on retourne None
-               return None,texte
+                # Il ne s'agit pas de '-' comme operateur unaire --> on retourne None
+                return None,texte
             else:
-               identificateur = '-'
-               args = self.splitArgs(identificateur,args,self.d_fonctions_unaires[identificateur])
-               formule_operateur = (identificateur,'',self.t_formule[2],args)
-               operateur = Interpreteur_Formule(formule = formule_operateur,
-                                                 constantes = self.new_constantes,
-                                                 fonctions = self.new_fonctions_unaires,
-                                                 parent = self)
-               operateur.interpreteFormule()
-               texte = reste
-               return operateur,reste
+                identificateur = '-'
+                args = self.splitArgs(identificateur,args,self.d_fonctions_unaires[identificateur])
+                formule_operateur = (identificateur,'',self.t_formule[2],args)
+                operateur = Interpreteur_Formule(formule = formule_operateur,
+                                                  constantes = self.new_constantes,
+                                                  fonctions = self.new_fonctions_unaires,
+                                                  parent = self)
+                operateur.interpreteFormule()
+                texte = reste
+                return operateur,reste
         else:
             return None,texte
-            
+
     def chercheOperateurBinaire(self,texte):
         """
         Cherche dans texte un operateur unaire
@@ -525,7 +525,7 @@ class Interpreteur_Formule(object):
             operateur.interpreteFormule()
             texte = reste
             return operateur,reste
-            
+
     def splitArgs(self,nom_fonction,args,nb_args):
         """
         Tente de partager args en nb_args elements
index 7dd76ec2a61c84bd85237bb76165b57705c5491e..f4717582931f9a2a0998ccd84ccaf527313ce844 100644 (file)
    pour traiter les niveaux au sein d'un JDC
 """
 from __future__ import absolute_import
-try : 
-   from builtins import object
+try :
+    from builtins import object
 except : pass
 
 from . import etape_niveau
 
 class JDC(object):
-  def __init__(self):
-    self.dict_niveaux={}
-    self.buildNiveaux()
-
-  def buildNiveaux(self):
-    for niveau in self.definition.l_niveaux:
-      etape_niv = etape_niveau.ETAPE_NIVEAU(niveau,self)
-      self.etapes_niveaux.append(etape_niv)
-      self.dict_niveaux[niveau.nom]=etape_niv
-      self.dict_niveaux.update(etape_niv.dict_niveaux)
+    def __init__(self):
+        self.dict_niveaux={}
+        self.buildNiveaux()
 
+    def buildNiveaux(self):
+        for niveau in self.definition.l_niveaux:
+            etape_niv = etape_niveau.ETAPE_NIVEAU(niveau,self)
+            self.etapes_niveaux.append(etape_niv)
+            self.dict_niveaux[niveau.nom]=etape_niv
+            self.dict_niveaux.update(etape_niv.dict_niveaux)
index 009c305c9210600c06d8bf06c212a4af05f7a3c1..22b420c1f9c78aaccc693c473221f0a0cad3e31e 100644 (file)
@@ -32,325 +32,325 @@ from Accas import JDC,ASSD,AsException,JDC_CATA
 from Ihm import CONNECTOR
 
 class JDC_POURSUITE(JDC):
-   def __init__(self,definition=None,procedure=None,cata=None,
-                     cata_ord_dico=None,parent=None,
-                     nom='SansNom',appli=None,context_ini=None,
-                     jdc_pere=None,etape_include=None,prefix_include=None,
-                     recorded_units=None,old_recorded_units=None,**args):
-
-      JDC.__init__(self, definition=definition,
-                         procedure=procedure,
-                         cata=cata,
-                         cata_ord_dico=cata_ord_dico,
-                         parent=parent,
-                         nom=nom,
-                         appli=appli,
-                         context_ini=context_ini,
-                         **args
-                         )
-      self.jdc_pere=jdc_pere
-      self.etape_include=etape_include
-      self.prefix_include=prefix_include
-      if recorded_units is not None:self.recorded_units=recorded_units
-      if old_recorded_units is not None:self.old_recorded_units=old_recorded_units
-
-   def o_register(self,sd):
-      return self.jdc_pere.o_register(sd)
-
-   def nommerSDProd(self,sd,sdnom,restrict='non'):
-      """
-          Nomme la SD apres avoir verifie que le nommage est possible : nom
-          non utilise
-          Ajoute un prefixe s'il est specifie (INCLUDE_MATERIAU)
-          Si le nom est deja utilise, leve une exception
-          Met le concept cree dans le contexe global g_context
-      """
-      #print "nommerSDProd",sd,sdnom,restrict
-      if self.prefix_include:
-          if sdnom != self.prefix_include:sdnom=self.prefix_include+sdnom
-
-      if sdnom != '' and sdnom[0] == '_':
-        # Si le nom du concept commence par le caractere _ on lui attribue
-        # un identificateur automatique comme dans JEVEUX (voir gcncon)
-        # 
-        # nom commencant par __ : il s'agit de concepts qui seront detruits
-        # nom commencant par _ : il s'agit de concepts intermediaires qui seront gardes
-        # ATTENTION : il faut traiter differemment les concepts dont le nom
-        # commence par _ mais qui sont des concepts nommes automatiquement par
-        # une eventuelle sous macro.
-        if sdnom[1] in string.digits:
-          # Ce concept provient probablement d'une sous macro (cas improbable)
-          #pas de renommage
-          pass
-        elif sdnom[1] == '_':
-          #cas d'un concept a ne pas conserver apres execution de la commande
-          sdnom=sd.id[2:]
-          pass
-        else:
-          sdnom=sd.id[2:]
-          pass
-
-      o=self.sdsDict.get(sdnom,None)
-      if isinstance(o,ASSD):
-         raise AsException(tr("Nom de concept deja defini : %s" ,sdnom))
-
-      # On pourrait verifier que le jdc_pere apres l'etape etape_include
-      # ne contient pas deja un concept de ce nom
-      #if self.jdc_pere.getSdApresEtapeAvecDetruire(sdnom,etape=self.etape_include):
-         # Il existe un concept apres self => impossible d'inserer
-      #   raise AsException("Nom de concept deja defini : %s" % sdnom)
-      # On a choisi de ne pas faire ce test ici mais de le faire en bloc
-      # si necessaire apres en appelant la methode verifContexte
-
-      # ATTENTION : Il ne faut pas ajouter sd dans sds car il s y trouve deja.
-      # Ajoute a la creation (appel de regSD).
-      self.sdsDict[sdnom]=sd
-      sd.nom=sdnom
-
-      # En plus si restrict vaut 'non', on insere le concept dans le contexte du JDC
-      if restrict == 'non':
-         self.g_context[sdnom]=sd
-
-   def getVerifContexte(self):
-      #print "getVerifContexte"
-      j_context=self.getContexteAvant(None)
-      self.verifContexte(j_context)
-      return j_context
-
-   def forceContexte(self,contexte):
-      for nom_sd,sd in list(contexte.items()):
-        if not isinstance(sd,ASSD):continue
-        autre_sd= self.jdc_pere.getSdApresEtapeAvecDetruire(nom_sd,sd,
-                                                       etape=self.etape_include)
-        if autre_sd is None:continue
-        if sd is not autre_sd:
-           # Il existe un autre concept de meme nom produit par une etape apres self 
-           # on detruit ce concept pour pouvoir inserer les etapes du jdc_include
-           if sd.etape:
-              sd.etape.supprimeSdprod(sd)
-
-      return contexte
-
-   def verifContexte(self,context):
-      """
-         Cette methode verifie si le contexte passe en argument (context)
-         peut etre insere dans le jdc pere de l'include.
-         Elle verifie que les concepts contenus dans ce contexte n'entrent
-         pas en conflit avec les concepts produits dans le jdc pere
-         apres l'include.
-         Si le contexte ne peut pas etre insere, la methode leve une
-         exception sinon elle retourne le contexte inchange
-      """
-      #print "verifContexte"
-      for nom_sd,sd in list(context.items()):
-        if not isinstance(sd,ASSD):continue
-        autre_sd= self.jdc_pere.getSdApresEtapeAvecDetruire(nom_sd,sd,
-                                                       etape=self.etape_include)
-        if autre_sd is None:continue
-        if sd is not autre_sd:
-           # Il existe un concept produit par une etape apres self 
-           # => impossible d'inserer
-           raise Exception("Impossible d'inclure le fichier. Un concept de nom " +
-                           "%s existe deja dans le jeu de commandes." % nom_sd)
-
-      return context
-
-   def getListeCmd(self):
-      """
-          Retourne la liste des commandes du catalogue
-      """
-      if self.jdc_pere is None:
-         return JDC.getListeCmd(self)
-      return self.jdc_pere.getListeCmd()
-
-   def getGroups(self):
-      """
-          Retourne la liste des commandes du catalogue par groupes
-      """
-      if self.jdc_pere is None:
-         return JDC.getGroups(self)
-      return self.jdc_pere.getGroups()
-
-   def initModif(self):
-      """
-         Met l'etat de l'etape a : modifie
-         Propage la modification au parent
-
-         Attention : initModif doit etre appele avant de realiser une modification
-         La validite devra etre recalculee apres cette modification
-         mais par un appel a finModif pour preserver l'etat modified
-         de tous les objets entre temps
-      """
-      #print "jdc_include.initModif",self,self.etape_include
-      self.state = 'modified'
-      if self.etape_include:
-         self.etape_include.initModif()
-
-   def finModif(self):
-      """
-          Methode appelee une fois qu'une modification a ete faite afin de
-          declencher d'eventuels traitements post-modification
-          ex : INCLUDE et POURSUITE
-      """
-      #print "jdc_include.finModif",self,self.etape_include
-      CONNECTOR.Emit(self,"valid")
-      if self.etape_include:
-         self.etape_include.finModif()
-
-   def supprime(self):
-      """
-          On ne supprime rien directement pour un jdc auxiliaire d'include ou de poursuite
-          Utiliser supprime_aux
-      """
-      pass
-
-   def supprime_aux(self):
-      #print "supprime_aux",self
-      JDC.supprime(self)
-      self.jdc_pere=None
-      self.etape_include=None
-   #   self.cata_ordonne_dico={}
-      self.appli=None
-   #   self.context_ini={}
-   #   self.procedure=None
-
-   def getContexteAvant(self,etape):
-      """
-         Retourne le dictionnaire des concepts connus avant etape
-         On tient compte des concepts produits par le jdc pere
-         en reactualisant le contexte initial context_ini
-         On tient compte des commandes qui modifient le contexte
-         comme DETRUIRE ou les macros
-         Si etape == None, on retourne le contexte en fin de JDC
-      """
-      #print "jdc_include.getContexteAvant",etape,etape and etape.nom
-      if self.etape_include:
-         new_context=self.etape_include.parent.getContexteAvant(self.etape_include).copy()
-         self.context_ini=new_context
-      d= JDC.getContexteAvant(self,etape)
-      return d
-
-   def resetContext(self):
-      #print "jdc_include.resetContext",self,self.nom
-      if self.etape_include:
-         self.etape_include.parent.resetContext()
-         new_context=self.etape_include.parent.getContexteAvant(self.etape_include).copy()
-         self.context_ini=new_context
-      JDC.resetContext(self)
-
-   def getSdApresEtape(self,nom_sd,etape,avec='non'):
-      """
-           Cette methode retourne la SD de nom nom_sd qui est eventuellement
-           definie apres etape
-           Si avec vaut 'non' exclut etape de la recherche
-      """
-      if self.etape_include:
-         sd=self.etape_include.parent.getSdApresEtape(nom_sd,self.etape_include,'non')
-         if sd:return sd
-      return JDC.getSdApresEtape(self,nom_sd,etape,avec)
-
-   def getSdApresEtapeAvecDetruire(self,nom_sd,sd,etape,avec='non'):
-      """
-           On veut savoir ce que devient le concept sd de nom nom_sd apres etape.
-           Il peut etre detruit, remplace ou conserve
-           Cette methode retourne la SD sd de nom nom_sd qui est eventuellement
-           definie apres etape en tenant compte des concepts detruits
-           Si avec vaut 'non' exclut etape de la recherche
-      """
-      #print "jdc_include.getSdApresEtapeAvecDetruire",nom_sd,sd,id(sd)
-      autre_sd=JDC.getSdApresEtapeAvecDetruire(self,nom_sd,sd,etape,avec)
-      # si autre_sd vaut None le concept sd a ete detruit. On peut terminer
-      # la recherche en retournant None
-      # Si autre_sd ne vaut pas sd, le concept a ete redefini. On peut terminer
-      # la recherche en retournant le concept nouvellement defini
-      # Sinon, on poursuit la recherche dans les etapes du niveau superieur.
-      if autre_sd is None or autre_sd is not sd :return autre_sd
-      return self.etape_include.parent.getSdApresEtapeAvecDetruire(nom_sd,sd,self.etape_include,'non')
-
-   def deleteConcept(self,sd):
-      """
-          Fonction : Mettre a jour les etapes du JDC suite a la disparition du
-          concept sd
-          Seuls les mots cles simples MCSIMP font un traitement autre
-          que de transmettre aux fils
-      """
-      # Nettoyage des etapes de l'include
-      JDC.deleteConcept(self,sd)
-      # Nettoyage des etapes du parent
-      if self.etape_include:
-         self.etape_include.parent.deleteConceptAfterEtape(self.etape_include,sd)
-
-   def deleteConceptAfterEtape(self,etape,sd):
-      """
-          Fonction : Mettre a jour les etapes du JDC qui sont apres etape suite a
-          la disparition du concept sd
-      """
-      # Nettoyage des etapes de l'include
-      JDC.deleteConceptAfterEtape(self,etape,sd)
-      # Nettoyage des etapes du parent
-      if self.etape_include:
-         self.etape_include.parent.deleteConceptAfterEtape(self.etape_include,sd)
-
-   def updateConceptAfterEtape(self,etape,sd):
-      """
-          Fonction : mettre a jour les etapes du JDC suite a une modification
-          du concept sd (principalement renommage)
-      """
-      JDC.updateConceptAfterEtape(self,etape,sd)
-      if self.etape_include:
-         self.etape_include.parent.updateConceptAfterEtape(self.etape_include,sd)
-
-   def replaceConceptAfterEtape(self,etape,old_sd,sd):
-      """
-          Fonction : Mettre a jour les etapes du JDC qui sont apres etape suite au
-          remplacement du concept old_sd par sd
-      """
-      # Nettoyage des etapes de l'include
-      JDC.replaceConceptAfterEtape(self,etape,old_sd,sd)
-      # Nettoyage des etapes du parent
-      if self.etape_include:
-         self.etape_include.parent.replaceConceptAfterEtape(self.etape_include,old_sd,sd)
-
-   def changeFichier(self,fichier):
-      if self.etape_include:
-         self.etape_include.fichier_ini=fichier
-      self.finModif()
-
-   def controlContextApres(self,etape):
-      """
-         Cette methode verifie que les etapes apres l'etape etape
-         ont bien des concepts produits acceptables (pas de conflit de
-         nom principalement)
-         Si des concepts produits ne sont pas acceptables ils sont supprimes.
-         Effectue les verifications sur les etapes du jdc mais aussi sur les
-         jdc parents s'ils existent.
-      """
-      #print "jdc_include.controlContextApres",self,etape
-      #Regularise les etapes du jdc apres l'etape etape
-      self.controlJdcContextApres(etape)
-      if self.etape_include:
-         #print "CONTROL_INCLUDE:",self.etape_include,self.etape_include.nom
-         # il existe un jdc pere. On propage la regularisation
-         self.etape_include.parent.controlContextApres(self.etape_include)
+    def __init__(self,definition=None,procedure=None,cata=None,
+                      cata_ord_dico=None,parent=None,
+                      nom='SansNom',appli=None,context_ini=None,
+                      jdc_pere=None,etape_include=None,prefix_include=None,
+                      recorded_units=None,old_recorded_units=None,**args):
+
+        JDC.__init__(self, definition=definition,
+                           procedure=procedure,
+                           cata=cata,
+                           cata_ord_dico=cata_ord_dico,
+                           parent=parent,
+                           nom=nom,
+                           appli=appli,
+                           context_ini=context_ini,
+                           **args
+                           )
+        self.jdc_pere=jdc_pere
+        self.etape_include=etape_include
+        self.prefix_include=prefix_include
+        if recorded_units is not None:self.recorded_units=recorded_units
+        if old_recorded_units is not None:self.old_recorded_units=old_recorded_units
+
+    def o_register(self,sd):
+        return self.jdc_pere.o_register(sd)
+
+    def nommerSDProd(self,sd,sdnom,restrict='non'):
+        """
+            Nomme la SD apres avoir verifie que le nommage est possible : nom
+            non utilise
+            Ajoute un prefixe s'il est specifie (INCLUDE_MATERIAU)
+            Si le nom est deja utilise, leve une exception
+            Met le concept cree dans le contexe global g_context
+        """
+        #print "nommerSDProd",sd,sdnom,restrict
+        if self.prefix_include:
+            if sdnom != self.prefix_include:sdnom=self.prefix_include+sdnom
+
+        if sdnom != '' and sdnom[0] == '_':
+            # Si le nom du concept commence par le caractere _ on lui attribue
+            # un identificateur automatique comme dans JEVEUX (voir gcncon)
+            #
+            # nom commencant par __ : il s'agit de concepts qui seront detruits
+            # nom commencant par _ : il s'agit de concepts intermediaires qui seront gardes
+            # ATTENTION : il faut traiter differemment les concepts dont le nom
+            # commence par _ mais qui sont des concepts nommes automatiquement par
+            # une eventuelle sous macro.
+            if sdnom[1] in string.digits:
+            # Ce concept provient probablement d'une sous macro (cas improbable)
+            #pas de renommage
+                pass
+            elif sdnom[1] == '_':
+                #cas d'un concept a ne pas conserver apres execution de la commande
+                sdnom=sd.id[2:]
+                pass
+            else:
+                sdnom=sd.id[2:]
+                pass
+
+        o=self.sdsDict.get(sdnom,None)
+        if isinstance(o,ASSD):
+            raise AsException(tr("Nom de concept deja defini : %s" ,sdnom))
+
+        # On pourrait verifier que le jdc_pere apres l'etape etape_include
+        # ne contient pas deja un concept de ce nom
+        #if self.jdc_pere.getSdApresEtapeAvecDetruire(sdnom,etape=self.etape_include):
+            # Il existe un concept apres self => impossible d'inserer
+        #   raise AsException("Nom de concept deja defini : %s" % sdnom)
+        # On a choisi de ne pas faire ce test ici mais de le faire en bloc
+        # si necessaire apres en appelant la methode verifContexte
+
+        # ATTENTION : Il ne faut pas ajouter sd dans sds car il s y trouve deja.
+        # Ajoute a la creation (appel de regSD).
+        self.sdsDict[sdnom]=sd
+        sd.nom=sdnom
+
+        # En plus si restrict vaut 'non', on insere le concept dans le contexte du JDC
+        if restrict == 'non':
+            self.g_context[sdnom]=sd
+
+    def getVerifContexte(self):
+        #print "getVerifContexte"
+        j_context=self.getContexteAvant(None)
+        self.verifContexte(j_context)
+        return j_context
+
+    def forceContexte(self,contexte):
+        for nom_sd,sd in list(contexte.items()):
+            if not isinstance(sd,ASSD):continue
+            autre_sd= self.jdc_pere.getSdApresEtapeAvecDetruire(nom_sd,sd,
+                                                           etape=self.etape_include)
+            if autre_sd is None:continue
+            if sd is not autre_sd:
+                # Il existe un autre concept de meme nom produit par une etape apres self
+                # on detruit ce concept pour pouvoir inserer les etapes du jdc_include
+                if sd.etape:
+                    sd.etape.supprimeSdprod(sd)
+
+        return contexte
+
+    def verifContexte(self,context):
+        """
+           Cette methode verifie si le contexte passe en argument (context)
+           peut etre insere dans le jdc pere de l'include.
+           Elle verifie que les concepts contenus dans ce contexte n'entrent
+           pas en conflit avec les concepts produits dans le jdc pere
+           apres l'include.
+           Si le contexte ne peut pas etre insere, la methode leve une
+           exception sinon elle retourne le contexte inchange
+        """
+        #print "verifContexte"
+        for nom_sd,sd in list(context.items()):
+            if not isinstance(sd,ASSD):continue
+            autre_sd= self.jdc_pere.getSdApresEtapeAvecDetruire(nom_sd,sd,
+                                                           etape=self.etape_include)
+            if autre_sd is None:continue
+            if sd is not autre_sd:
+                # Il existe un concept produit par une etape apres self
+                # => impossible d'inserer
+                raise Exception("Impossible d'inclure le fichier. Un concept de nom " +
+                                "%s existe deja dans le jeu de commandes." % nom_sd)
+
+        return context
+
+    def getListeCmd(self):
+        """
+            Retourne la liste des commandes du catalogue
+        """
+        if self.jdc_pere is None:
+            return JDC.getListeCmd(self)
+        return self.jdc_pere.getListeCmd()
+
+    def getGroups(self):
+        """
+            Retourne la liste des commandes du catalogue par groupes
+        """
+        if self.jdc_pere is None:
+            return JDC.getGroups(self)
+        return self.jdc_pere.getGroups()
+
+    def initModif(self):
+        """
+           Met l'etat de l'etape a : modifie
+           Propage la modification au parent
+
+           Attention : initModif doit etre appele avant de realiser une modification
+           La validite devra etre recalculee apres cette modification
+           mais par un appel a finModif pour preserver l'etat modified
+           de tous les objets entre temps
+        """
+        #print "jdc_include.initModif",self,self.etape_include
+        self.state = 'modified'
+        if self.etape_include:
+            self.etape_include.initModif()
+
+    def finModif(self):
+        """
+            Methode appelee une fois qu'une modification a ete faite afin de
+            declencher d'eventuels traitements post-modification
+            ex : INCLUDE et POURSUITE
+        """
+        #print "jdc_include.finModif",self,self.etape_include
+        CONNECTOR.Emit(self,"valid")
+        if self.etape_include:
+            self.etape_include.finModif()
+
+    def supprime(self):
+        """
+            On ne supprime rien directement pour un jdc auxiliaire d'include ou de poursuite
+            Utiliser supprime_aux
+        """
+        pass
+
+    def supprime_aux(self):
+        #print "supprime_aux",self
+        JDC.supprime(self)
+        self.jdc_pere=None
+        self.etape_include=None
+    #   self.cata_ordonne_dico={}
+        self.appli=None
+    #   self.context_ini={}
+    #   self.procedure=None
+
+    def getContexteAvant(self,etape):
+        """
+           Retourne le dictionnaire des concepts connus avant etape
+           On tient compte des concepts produits par le jdc pere
+           en reactualisant le contexte initial context_ini
+           On tient compte des commandes qui modifient le contexte
+           comme DETRUIRE ou les macros
+           Si etape == None, on retourne le contexte en fin de JDC
+        """
+        #print "jdc_include.getContexteAvant",etape,etape and etape.nom
+        if self.etape_include:
+            new_context=self.etape_include.parent.getContexteAvant(self.etape_include).copy()
+            self.context_ini=new_context
+        d= JDC.getContexteAvant(self,etape)
+        return d
+
+    def resetContext(self):
+        #print "jdc_include.resetContext",self,self.nom
+        if self.etape_include:
+            self.etape_include.parent.resetContext()
+            new_context=self.etape_include.parent.getContexteAvant(self.etape_include).copy()
+            self.context_ini=new_context
+        JDC.resetContext(self)
+
+    def getSdApresEtape(self,nom_sd,etape,avec='non'):
+        """
+             Cette methode retourne la SD de nom nom_sd qui est eventuellement
+             definie apres etape
+             Si avec vaut 'non' exclut etape de la recherche
+        """
+        if self.etape_include:
+            sd=self.etape_include.parent.getSdApresEtape(nom_sd,self.etape_include,'non')
+            if sd:return sd
+        return JDC.getSdApresEtape(self,nom_sd,etape,avec)
+
+    def getSdApresEtapeAvecDetruire(self,nom_sd,sd,etape,avec='non'):
+        """
+             On veut savoir ce que devient le concept sd de nom nom_sd apres etape.
+             Il peut etre detruit, remplace ou conserve
+             Cette methode retourne la SD sd de nom nom_sd qui est eventuellement
+             definie apres etape en tenant compte des concepts detruits
+             Si avec vaut 'non' exclut etape de la recherche
+        """
+        #print "jdc_include.getSdApresEtapeAvecDetruire",nom_sd,sd,id(sd)
+        autre_sd=JDC.getSdApresEtapeAvecDetruire(self,nom_sd,sd,etape,avec)
+        # si autre_sd vaut None le concept sd a ete detruit. On peut terminer
+        # la recherche en retournant None
+        # Si autre_sd ne vaut pas sd, le concept a ete redefini. On peut terminer
+        # la recherche en retournant le concept nouvellement defini
+        # Sinon, on poursuit la recherche dans les etapes du niveau superieur.
+        if autre_sd is None or autre_sd is not sd :return autre_sd
+        return self.etape_include.parent.getSdApresEtapeAvecDetruire(nom_sd,sd,self.etape_include,'non')
+
+    def deleteConcept(self,sd):
+        """
+            Fonction : Mettre a jour les etapes du JDC suite a la disparition du
+            concept sd
+            Seuls les mots cles simples MCSIMP font un traitement autre
+            que de transmettre aux fils
+        """
+        # Nettoyage des etapes de l'include
+        JDC.deleteConcept(self,sd)
+        # Nettoyage des etapes du parent
+        if self.etape_include:
+            self.etape_include.parent.deleteConceptAfterEtape(self.etape_include,sd)
+
+    def deleteConceptAfterEtape(self,etape,sd):
+        """
+            Fonction : Mettre a jour les etapes du JDC qui sont apres etape suite a
+            la disparition du concept sd
+        """
+        # Nettoyage des etapes de l'include
+        JDC.deleteConceptAfterEtape(self,etape,sd)
+        # Nettoyage des etapes du parent
+        if self.etape_include:
+            self.etape_include.parent.deleteConceptAfterEtape(self.etape_include,sd)
+
+    def updateConceptAfterEtape(self,etape,sd):
+        """
+            Fonction : mettre a jour les etapes du JDC suite a une modification
+            du concept sd (principalement renommage)
+        """
+        JDC.updateConceptAfterEtape(self,etape,sd)
+        if self.etape_include:
+            self.etape_include.parent.updateConceptAfterEtape(self.etape_include,sd)
+
+    def replaceConceptAfterEtape(self,etape,old_sd,sd):
+        """
+            Fonction : Mettre a jour les etapes du JDC qui sont apres etape suite au
+            remplacement du concept old_sd par sd
+        """
+        # Nettoyage des etapes de l'include
+        JDC.replaceConceptAfterEtape(self,etape,old_sd,sd)
+        # Nettoyage des etapes du parent
+        if self.etape_include:
+            self.etape_include.parent.replaceConceptAfterEtape(self.etape_include,old_sd,sd)
+
+    def changeFichier(self,fichier):
+        if self.etape_include:
+            self.etape_include.fichier_ini=fichier
+        self.finModif()
+
+    def controlContextApres(self,etape):
+        """
+           Cette methode verifie que les etapes apres l'etape etape
+           ont bien des concepts produits acceptables (pas de conflit de
+           nom principalement)
+           Si des concepts produits ne sont pas acceptables ils sont supprimes.
+           Effectue les verifications sur les etapes du jdc mais aussi sur les
+           jdc parents s'ils existent.
+        """
+        #print "jdc_include.controlContextApres",self,etape
+        #Regularise les etapes du jdc apres l'etape etape
+        self.controlJdcContextApres(etape)
+        if self.etape_include:
+            #print "CONTROL_INCLUDE:",self.etape_include,self.etape_include.nom
+            # il existe un jdc pere. On propage la regularisation
+            self.etape_include.parent.controlContextApres(self.etape_include)
 
 class JDC_INCLUDE(JDC_POURSUITE):
-   def getListeCmd(self):
-      """
-          Retourne la liste des commandes du catalogue
-      """
-      if self.jdc_pere is None:
-         return JDC.getListeCmd(self)
-      return [e for e in self.jdc_pere.getListeCmd() if e not in ("DEBUT","POURSUITE","FIN") ]
-
-   def activeEtapes(self):
-      for e in self.etapes:
-         e.active()
+    def getListeCmd(self):
+        """
+            Retourne la liste des commandes du catalogue
+        """
+        if self.jdc_pere is None:
+            return JDC.getListeCmd(self)
+        return [e for e in self.jdc_pere.getListeCmd() if e not in ("DEBUT","POURSUITE","FIN") ]
+
+    def activeEtapes(self):
+        for e in self.etapes:
+            e.active()
 
 class JDC_CATA_INCLUDE(JDC_CATA):
-   class_instance=JDC_INCLUDE
+    class_instance=JDC_INCLUDE
 
 class JDC_CATA_POURSUITE(JDC_CATA):
-   class_instance=JDC_POURSUITE
+    class_instance=JDC_POURSUITE
 
 from Accas import AU_MOINS_UN,A_CLASSER
 
@@ -364,5 +364,3 @@ JdC_poursuite=JDC_CATA_POURSUITE(code='ASTER', execmodul=None,
                                            A_CLASSER(('DEBUT','POURSUITE'),'FIN')
                                           )
                                )
-
-
index 1cee811eb1fa2ebea8167d01fb1cab8515558b43..993864dea7f3d43a13649e45104b52ad521c1326 100644 (file)
@@ -23,22 +23,22 @@ from __future__ import print_function
 import os
 
 try :
-  from PyQt5.QtCore import QTranslator
-  code_translator = QTranslator()
-  eficas_translator = QTranslator()
+    from PyQt5.QtCore import QTranslator
+    code_translator = QTranslator()
+    eficas_translator = QTranslator()
 except :
-  code_translator = None
-  eficas_translator = None
-  print ('pas d import de qt, pas de traduction')
-  
+    code_translator = None
+    eficas_translator = None
+    print ('pas d import de qt, pas de traduction')
+
 
 
 def localise(application, locale=None,file=None,translatorFichier=None, debug=False ):
     """
     """
-    if code_translator == None : 
-       print ('qt not avalaible, no translation')
-       return
+    if code_translator == None :
+        print ('qt not avalaible, no translation')
+        return
     from PyQt5.QtCore import QLibraryInfo
     from PyQt5.QtCore import QLocale
     from PyQt5.QtWidgets import QApplication
@@ -50,24 +50,24 @@ def localise(application, locale=None,file=None,translatorFichier=None, debug=Fa
     if locale=="ang" : locale="en"
 
     if file != None and debug :
-       print ('chargement de ', file,monPath)
-       print (eficas_translator.load(file,monPath))
-       print (QApplication.installTranslator(eficas_translator))
+        print ('chargement de ', file,monPath)
+        print (eficas_translator.load(file,monPath))
+        print (QApplication.installTranslator(eficas_translator))
     elif eficas_translator.load("eficas_" + locale, monPath):
-       QApplication.installTranslator(eficas_translator)
+        QApplication.installTranslator(eficas_translator)
     elif debug:
-       print ("Unable to load Eficas translator!")
+        print ("Unable to load Eficas translator!")
 
     if debug : print  ('translatorFichier :' ,translatorFichier)
     if translatorFichier != None :
-       if (code_translator.load(translatorFichier)) and debug:
-           print (translatorFichier, ' loaded')
-       elif (code_translator.load(translatorFichier+'_'+locale) and debug):
-           print(translatorFichier+'_'+locale+ ' loaded')
-       elif debug :
-           print ("Unable to load Code translator! No file or No translation" + translatorFichier)
-       if debug : print (QApplication.installTranslator(code_translator))
-       else : QApplication.installTranslator(code_translator)
+        if (code_translator.load(translatorFichier)) and debug:
+            print (translatorFichier, ' loaded')
+        elif (code_translator.load(translatorFichier+'_'+locale) and debug):
+            print(translatorFichier+'_'+locale+ ' loaded')
+        elif debug :
+            print ("Unable to load Code translator! No file or No translation" + translatorFichier)
+        if debug : print (QApplication.installTranslator(code_translator))
+        else : QApplication.installTranslator(code_translator)
 
 
 if __name__ == "__main__":
index 76b195c2d56e33550ba542284e06d027996c2119..e190b4a425772eba33ad6d19f127edd494db9689 100644 (file)
@@ -21,8 +21,8 @@
 """
 # Modules Python
 from __future__ import absolute_import
-try : 
-   from builtins import str
+try :
+    from builtins import str
 except : pass
 
 
@@ -32,189 +32,184 @@ from Validation import V_MCCOMPO
 from Extensions.i18n import tr
 
 class MCNUPLET(V_MCCOMPO.MCCOMPO,N_MCCOMPO.MCCOMPO):
-   """
-   """
-   nature = "MCNUPLET"
-   txt_nat="Nuplet : "
-
-   def __init__(self,val,definition,nom,parent):
-      # val contient la valeur initial du nuplet
-      self.val = val
-      if val == None: self.val=()
-      self.definition=definition
-      self.nom=nom
-      self.parent = parent
-      # getValeurEffective affecte la valeur par defaut si necessaire
-      self.valeur=self.getValeurEffective(self.val)
-      if parent :
-         self.jdc = self.parent.jdc
-         self.niveau = self.parent.niveau
-         self.etape = self.parent.etape
-      else:
-         # Le mot cle a ete cree sans parent
-         self.jdc = None
-         self.niveau = None
-         self.etape = None
-      self.state = 'undetermined'
-      self.actif=1
-      self.mcListe=self.buildMc()
-
-   def buildMc(self):
-      """ 
-          Construit la liste des sous-entites de MCNUPLET
-          a partir de la liste des arguments (valeur)
-      """
-      args = self.valeur
-      if args ==None : args =()
-      mcListe=[]
-
-      # on cree les sous entites du NUPLET a partir des valeurs initiales
-      k=0
-      for v in self.definition.entites:
-        if k < len(args):
-          val=args[k]
+    """
+    """
+    nature = "MCNUPLET"
+    txt_nat="Nuplet : "
+
+    def __init__(self,val,definition,nom,parent):
+        # val contient la valeur initial du nuplet
+        self.val = val
+        if val == None: self.val=()
+        self.definition=definition
+        self.nom=nom
+        self.parent = parent
+        # getValeurEffective affecte la valeur par defaut si necessaire
+        self.valeur=self.getValeurEffective(self.val)
+        if parent :
+            self.jdc = self.parent.jdc
+            self.niveau = self.parent.niveau
+            self.etape = self.parent.etape
         else:
-          val=None
-        objet=v(val=val,nom=repr(k),parent=self)
-        if hasattr(objet.definition,'position'):
-          if objet.definition.position == 'global' :
-            self.append_mc_global(objet)
-          #XXX et global_jdc ??
-        mcListe.append(objet)
-        k=k+1
-      # Un nuplet n'a pas de mots inconnus
-      self.reste_val={}
-      return mcListe
-
-   def isValid(self,cr='non'):
-      """
-          Indique si self (MCNUPLET) est un objet valide ou non : retourne 1 si oui, 0 sinon
-      """
-      if self.state == 'unchanged' :
-        return self.valid
-      else:
-        valid = 1
-        if hasattr(self,'valid'):
-          old_valid = self.valid
+            # Le mot cle a ete cree sans parent
+            self.jdc = None
+            self.niveau = None
+            self.etape = None
+        self.state = 'undetermined'
+        self.actif=1
+        self.mcListe=self.buildMc()
+
+    def buildMc(self):
+        """
+            Construit la liste des sous-entites de MCNUPLET
+            a partir de la liste des arguments (valeur)
+        """
+        args = self.valeur
+        if args ==None : args =()
+        mcListe=[]
+
+        # on cree les sous entites du NUPLET a partir des valeurs initiales
+        k=0
+        for v in self.definition.entites:
+            if k < len(args):
+                val=args[k]
+            else:
+                val=None
+            objet=v(val=val,nom=repr(k),parent=self)
+            if hasattr(objet.definition,'position'):
+                if objet.definition.position == 'global' :
+                    self.append_mc_global(objet)
+                #XXX et global_jdc ??
+            mcListe.append(objet)
+            k=k+1
+        # Un nuplet n'a pas de mots inconnus
+        self.reste_val={}
+        return mcListe
+
+    def isValid(self,cr='non'):
+        """
+            Indique si self (MCNUPLET) est un objet valide ou non : retourne 1 si oui, 0 sinon
+        """
+        if self.state == 'unchanged' :
+            return self.valid
         else:
-          old_valid = None
-        for child in self.mcListe :
-          if not child.isValid():
-            valid = 0
-            break
-        if len(self.mcListe) != len(self.definition.entites):
-          valid=0
-          if cr == 'oui' :
-            self.cr.fatal(''.join(("Nuplet : ",self.nom,tr("Longueur incorrecte"))))
-        self.valid = valid
-        self.state = 'unchanged'
-        if old_valid:
-          if old_valid != self.valid : self.initModifUp()
-        return self.valid
-
-   def __getitem__(self,key):
-      """
-          Retourne le key eme element du nuplet
-      """
-      # Un nuplet est toujours une liste de mots cles simples
-      # On retourne donc la valeur
-      return self.mcListe[key].valeur
-
-   def __str__(self):
-      """
-           Retourne une representation du nuplet sous forme de chaine
-           de caracteres
-      """
-      s='('
-      for e in self.mcListe:
-        s=s + str(e.valeur) + ','
-      return s + ')'
-
-   def __repr__(self):
-      """
-           Retourne une representation du nuplet sous forme de chaine
-           de caracteres
-      """
-      s='('
-      for e in self.mcListe:
-        s=s + str(e.valeur) + ','
-      return s + ')'
-
-   def getRegles(self):
-      """
-         Retourne la liste des regles attachees au nuplet
-      """
-      return []
-
-   def verifConditionBloc(self):
-      """
-          Verifie s'il y a des blocs sous le nuplet et retourne 
-          les blocs en question
-      """
-      # Il n y a pas de BLOCs sous un NUPLET
-      return [],[]
-
-   def isRepetable(self):
-      """ 
-          Indique si le NUPLET peut etre repete.
-          Retourne 1 si c'est le cas.
-          Retourne 0 dans le cas contraire.
-          L'information est donnee par le catalogue, cad la definition de self
-      """
-      if self.definition.min != self.definition.max :
-        return 1
-      else :
-        return 0
-
-   def makeobjet(self):
-      return self.definition(val = None, nom = self.nom,parent = self.parent)
-
-   def getValeur(self):
-      """
-          Cette methode doit retourner la valeur de l'objet. Elle est utilisee par 
-          creeDictValeurs pour construire un dictionnaire contenant les mots cles 
-          d'une etape.
-          Dans le cas d'un nuplet, on retournera comme valeur une liste des valeurs
-          des mots cle simples contenus.
-      """
-      l=[]
-      for v in self.mcListe:
-         l.append(v.valeur)
-      return l
-
-   def getVal(self):
-      """
-          Une autre methode qui retourne une "autre" valeur du mot cle facteur.
-          Elle est utilisee par la methode getMocle
-      """
-      l=[]
-      for v in self.mcListe:
-         l.append(v.valeur)
-      return l
-
-   def isOblig(self):
-      return self.definition.statut=='o'
-
-   def getFr(self):
-     """
-        Retourne le texte d'aide dans la langue choisie
-     """
-     try :
-        return getattr(self.definition,self.jdc.lang)
-     except:
-        return ''
-
-   def creeDictValeurs(self,liste=[],condition=0):
-     dico={}
-     return dico
-
-   def updateConditionBloc(self):
-     """
-       Realise l'update des blocs conditionnels fils de self
-       et propage au parent (rien a faire pour nuplet)
-     """
-
-
-
-
-
+            valid = 1
+            if hasattr(self,'valid'):
+                old_valid = self.valid
+            else:
+                old_valid = None
+            for child in self.mcListe :
+                if not child.isValid():
+                    valid = 0
+                    break
+            if len(self.mcListe) != len(self.definition.entites):
+                valid=0
+                if cr == 'oui' :
+                    self.cr.fatal(''.join(("Nuplet : ",self.nom,tr("Longueur incorrecte"))))
+            self.valid = valid
+            self.state = 'unchanged'
+            if old_valid:
+                if old_valid != self.valid : self.initModifUp()
+            return self.valid
+
+    def __getitem__(self,key):
+        """
+            Retourne le key eme element du nuplet
+        """
+        # Un nuplet est toujours une liste de mots cles simples
+        # On retourne donc la valeur
+        return self.mcListe[key].valeur
+
+    def __str__(self):
+        """
+             Retourne une representation du nuplet sous forme de chaine
+             de caracteres
+        """
+        s='('
+        for e in self.mcListe:
+            s=s + str(e.valeur) + ','
+        return s + ')'
+
+    def __repr__(self):
+        """
+             Retourne une representation du nuplet sous forme de chaine
+             de caracteres
+        """
+        s='('
+        for e in self.mcListe:
+            s=s + str(e.valeur) + ','
+        return s + ')'
+
+    def getRegles(self):
+        """
+           Retourne la liste des regles attachees au nuplet
+        """
+        return []
+
+    def verifConditionBloc(self):
+        """
+            Verifie s'il y a des blocs sous le nuplet et retourne
+            les blocs en question
+        """
+        # Il n y a pas de BLOCs sous un NUPLET
+        return [],[]
+
+    def isRepetable(self):
+        """
+            Indique si le NUPLET peut etre repete.
+            Retourne 1 si c'est le cas.
+            Retourne 0 dans le cas contraire.
+            L'information est donnee par le catalogue, cad la definition de self
+        """
+        if self.definition.min != self.definition.max :
+            return 1
+        else :
+            return 0
+
+    def makeobjet(self):
+        return self.definition(val = None, nom = self.nom,parent = self.parent)
+
+    def getValeur(self):
+        """
+            Cette methode doit retourner la valeur de l'objet. Elle est utilisee par
+            creeDictValeurs pour construire un dictionnaire contenant les mots cles
+            d'une etape.
+            Dans le cas d'un nuplet, on retournera comme valeur une liste des valeurs
+            des mots cle simples contenus.
+        """
+        l=[]
+        for v in self.mcListe:
+            l.append(v.valeur)
+        return l
+
+    def getVal(self):
+        """
+            Une autre methode qui retourne une "autre" valeur du mot cle facteur.
+            Elle est utilisee par la methode getMocle
+        """
+        l=[]
+        for v in self.mcListe:
+            l.append(v.valeur)
+        return l
+
+    def isOblig(self):
+        return self.definition.statut=='o'
+
+    def getFr(self):
+        """
+           Retourne le texte d'aide dans la langue choisie
+        """
+        try :
+            return getattr(self.definition,self.jdc.lang)
+        except:
+            return ''
+
+    def creeDictValeurs(self,liste=[],condition=0):
+        dico={}
+        return dico
+
+    def updateConditionBloc(self):
+        """
+          Realise l'update des blocs conditionnels fils de self
+          et propage au parent (rien a faire pour nuplet)
+        """
index 504a8881dce809fb193099f1c169a8ba53cd622e..efc2ba7669e2812bcea8c1dfcb7e7751479b04d1 100644 (file)
     des groupes de commandes dans le catalogue
 """
 
-try : 
-   from builtins import object
+try :
+    from builtins import object
 except : pass
 
 class NIVEAU(object):
-  def __init__(self,nom='',label='',niveaux=(),valide_vide=1,actif=1):
-    self.nom = nom
-    self.label = label
-    self.statut='o'
-    self.min = 1
-    self.max = 1
-    self.entites = []
-    self.l_noms_entites=[]
-    self.valide_vide = valide_vide
-    self.actif = actif
-    self.d_niveaux = {}
-    self.l_niveaux = niveaux
-    for niveau in niveaux:
-      self.d_niveaux[niveau.nom]=niveau
-      self.d_niveaux.update(niveau.d_niveaux)
+    def __init__(self,nom='',label='',niveaux=(),valide_vide=1,actif=1):
+        self.nom = nom
+        self.label = label
+        self.statut='o'
+        self.min = 1
+        self.max = 1
+        self.entites = []
+        self.l_noms_entites=[]
+        self.valide_vide = valide_vide
+        self.actif = actif
+        self.d_niveaux = {}
+        self.l_niveaux = niveaux
+        for niveau in niveaux:
+            self.d_niveaux[niveau.nom]=niveau
+            self.d_niveaux.update(niveau.d_niveaux)
 
-  def enregistre(self,commande):
-    self.entites.append(commande)
-    self.l_noms_entites.append(commande.nom)
-
-  def getListeCmd(self):
-    self.l_noms_entites.sort()
-    return self.l_noms_entites
+    def enregistre(self,commande):
+        self.entites.append(commande)
+        self.l_noms_entites.append(commande.nom)
 
+    def getListeCmd(self):
+        self.l_noms_entites.sort()
+        return self.l_noms_entites
index 0cc524eaf636e4f6c55b6b7e4e9c104b39be00f1..21c9fc619787b2ca1a6232574b191eaa18448492 100644 (file)
@@ -22,8 +22,8 @@
 """
 # Modules Python
 from __future__ import absolute_import
-try : 
-   from builtins import str
+try :
+    from builtins import str
 except : pass
 
 import types
@@ -35,94 +35,93 @@ from Extensions.i18n import tr
 from . import mcnuplet
 
 class NUPL(N_ENTITE.ENTITE,I_ENTITE.ENTITE):
-   """
-   """
-   class_instance = mcnuplet.MCNUPLET
-   list_instance = N_MCLIST.MCList
-   label='NUPLET'
-   CR=N_CR.CR
+    """
+    """
+    class_instance = mcnuplet.MCNUPLET
+    list_instance = N_MCLIST.MCList
+    label='NUPLET'
+    CR=N_CR.CR
 
-   def __init__(self,fr="",ang="",docu="",statut='f',defaut=None,min=0,max=1,
-                    elements=None):
-      N_ENTITE.ENTITE.__init__(self)
-      I_ENTITE.ENTITE.__init__(self)
-      self.fr=fr
-      self.ang=ang
-      self.docu=docu
-      self.statut=statut
-      self.defaut=defaut
-      self.min=min
-      self.max=max
-      if self.max =='**' : self.max=float('inf')
-      if self.min =='**' : self.min=float('-inf')
-      self.entites=elements
-      self.regles=()
-      # on force le statut des sous entites a obligatoire
-      for e in elements:e.statut='o'
-      self.idracine="NUPLET"
-      self.affecter_parente()
+    def __init__(self,fr="",ang="",docu="",statut='f',defaut=None,min=0,max=1,
+                     elements=None):
+        N_ENTITE.ENTITE.__init__(self)
+        I_ENTITE.ENTITE.__init__(self)
+        self.fr=fr
+        self.ang=ang
+        self.docu=docu
+        self.statut=statut
+        self.defaut=defaut
+        self.min=min
+        self.max=max
+        if self.max =='**' : self.max=float('inf')
+        if self.min =='**' : self.min=float('-inf')
+        self.entites=elements
+        self.regles=()
+        # on force le statut des sous entites a obligatoire
+        for e in elements:e.statut='o'
+        self.idracine="NUPLET"
+        self.affecter_parente()
 
-   def verifCata(self):
-      """
-          Cette methode sert a valider les attributs de l'objet de definition
-          de la classe NUPL
-      """
-      if type(self.min) != int :
-        if self.min != '**' and self.min != float('-inf'):
-          self.cr.fatal(tr("L'attribut 'min' doit etre un entier : ")+str(self.min))
-      if type(self.max) != int :
-        if self.max != '**'  and self.max != float('inf'):
-          self.cr.fatal(tr("L'attribut 'max' doit etre un entier : ")+str(self.max))
-      if self.min > self.max :
-         self.cr.fatal(tr("Nombres d'occurrence min et max invalides :") +str(self.min)+","+str(self.max))
-      if type(self.fr) != bytes and type(self.fr) != str  :
-        self.cr.fatal(tr("L'attribut 'fr' doit etre une chaine de caracteres"))
-      if self.statut not in ['o','f','c','d']:
-        self.cr.fatal(tr("L'attribut 'statut' doit valoir 'o','f','c' ou 'd'"))
-      if type(self.docu) != bytes and type(self.docu) != str   :
-        self.cr.fatal(tr("L'attribut 'docu' doit etre une chaine de caracteres"))
-      self.verifCataRegles()
+    def verifCata(self):
+        """
+            Cette methode sert a valider les attributs de l'objet de definition
+            de la classe NUPL
+        """
+        if type(self.min) != int :
+            if self.min != '**' and self.min != float('-inf'):
+                self.cr.fatal(tr("L'attribut 'min' doit etre un entier : ")+str(self.min))
+        if type(self.max) != int :
+            if self.max != '**'  and self.max != float('inf'):
+                self.cr.fatal(tr("L'attribut 'max' doit etre un entier : ")+str(self.max))
+        if self.min > self.max :
+            self.cr.fatal(tr("Nombres d'occurrence min et max invalides :") +str(self.min)+","+str(self.max))
+        if type(self.fr) != bytes and type(self.fr) != str  :
+            self.cr.fatal(tr("L'attribut 'fr' doit etre une chaine de caracteres"))
+        if self.statut not in ['o','f','c','d']:
+            self.cr.fatal(tr("L'attribut 'statut' doit valoir 'o','f','c' ou 'd'"))
+        if type(self.docu) != bytes and type(self.docu) != str   :
+            self.cr.fatal(tr("L'attribut 'docu' doit etre une chaine de caracteres"))
+        self.verifCataRegles()
 
-   def __call__(self,val,nom,parent):
-      """
-         Construit la structure de donnees pour un NUPLET a partir de sa definition (self)
-         de sa valeur (val), de son nom (nom) et de son parent dans l arboresence (parent)
-      """
-      if (type(val) == tuple or type(val) == list) and type(val[0]) == tuple:
-        # On est en presence d une liste de nuplets
-        l=self.list_instance()
-        l.init(nom=nom,parent=parent)
-        for v in val:
-          objet=self.class_instance(nom=nom,definition=self,val=v,parent=parent)
-          l.append(objet)
-        return l
-      else:
-        # on est en presence d un seul nuplet
-        return self.class_instance(nom=nom,definition=self,val=val,parent=parent)
+    def __call__(self,val,nom,parent):
+        """
+           Construit la structure de donnees pour un NUPLET a partir de sa definition (self)
+           de sa valeur (val), de son nom (nom) et de son parent dans l arboresence (parent)
+        """
+        if (type(val) == tuple or type(val) == list) and type(val[0]) == tuple:
+            # On est en presence d une liste de nuplets
+            l=self.list_instance()
+            l.init(nom=nom,parent=parent)
+            for v in val:
+                objet=self.class_instance(nom=nom,definition=self,val=v,parent=parent)
+                l.append(objet)
+            return l
+        else:
+            # on est en presence d un seul nuplet
+            return self.class_instance(nom=nom,definition=self,val=val,parent=parent)
 
-   def report(self):
-      """ 
-           Methode qui cree le rapport de verification du catalogue du nuplet 
-      """
-      self.cr = self.CR()
-      self.verifCata()
-      for v in self.entites :
-        cr = v.report()
-        cr.debut =tr("Debut ")+v.__class__.__name__+ ' : '
-        cr.fin =tr("Fin ")+v.__class__.__name__+ ' : '
-        self.cr.add(cr)
-      return self.cr
-
-   def affecter_parente(self):
-      """
-          Cette methode a pour fonction de donner un nom et un pere aux
-          sous entites qui n'ont aucun moyen pour atteindre leur parent 
-          directement
-          Il s'agit principalement des mots cles
-      """
-      k=0
-      for v in self.entites:
-        v.pere = self
-        v.nom = str(k)
-        k=k+1
+    def report(self):
+        """
+             Methode qui cree le rapport de verification du catalogue du nuplet
+        """
+        self.cr = self.CR()
+        self.verifCata()
+        for v in self.entites :
+            cr = v.report()
+            cr.debut =tr("Debut ")+v.__class__.__name__+ ' : '
+            cr.fin =tr("Fin ")+v.__class__.__name__+ ' : '
+            self.cr.add(cr)
+        return self.cr
 
+    def affecter_parente(self):
+        """
+            Cette methode a pour fonction de donner un nom et un pere aux
+            sous entites qui n'ont aucun moyen pour atteindre leur parent
+            directement
+            Il s'agit principalement des mots cles
+        """
+        k=0
+        for v in self.entites:
+            v.pere = self
+            v.nom = str(k)
+            k=k+1
index 5da28c1bc2339808f0878209b82214472c6ed71f..f99b9fb2c54397a3bf4cc015ade01fd0285d130a 100644 (file)
@@ -20,8 +20,8 @@
 from __future__ import division
 from __future__ import absolute_import
 try :
-  from builtins import str
-  from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 import math
 import types
@@ -29,13 +29,13 @@ import types
 import six
 
 try:
-  import Numeric
+    import Numeric
 except:
-  try:
-    import numpy
-    Numeric = numpy
-  except ImportError:
-    Numeric = None
+    try:
+        import numpy
+        Numeric = numpy
+    except ImportError:
+        Numeric = None
 
 
 def mkf(value):
@@ -55,9 +55,9 @@ class Formula(object):
         val=self.eval()
         if val is None:return 0
         try:
-           return len(val)
+            return len(val)
         except:
-           return 1
+            return 1
     def __complex__(self): return complex(self.eval())
     def __int__(self): return int(self.eval())
     def __long__(self): return int(self.eval())
@@ -79,7 +79,7 @@ class Formula(object):
     def __rfloordiv__(self, other): return Binop('//', other, self)
     def __pow__(self, other): return Binop('**', self, other)
     def __rpow__(self, other): return Binop('**', other, self)
-    def __getitem__(self,i): 
+    def __getitem__(self,i):
         if i > len(self) : raise StopIteration
         return Binop('[]',self,i)
     def __cmp__( self, other ): return self.eval().__cmp__(other)
@@ -92,13 +92,13 @@ class Formula(object):
     def __hash__(self):return id(self)
 
 def _div(a,b):
-  if isinstance(a,six.integer_types) and isinstance(b,six.integer_types):
-    if a%b:
-      return a/b
+    if isinstance(a,six.integer_types) and isinstance(b,six.integer_types):
+        if a%b:
+            return a/b
+        else:
+            return a//b
     else:
-      return a//b
-  else:
-    return a/b
+        return a/b
 
 
 class Binop(Formula):
@@ -116,19 +116,19 @@ class Binop(Formula):
 
     def __str__(self):
         if self.op == '[]':
-           return "%s[%s]" % (self.values[0], self.values[1])
+            return "%s[%s]" % (self.values[0], self.values[1])
         else:
-           return "(%s %s %s)" % (self.values[0], self.op, self.values[1])
+            return "(%s %s %s)" % (self.values[0], self.op, self.values[1])
     def __repr__(self):
         if self.op == '[]':
-           return "%s[%s]" % (self.values[0], self.values[1])
+            return "%s[%s]" % (self.values[0], self.values[1])
         else:
-           return "(%s %s %s)" % (self.values[0], self.op, self.values[1])
+            return "(%s %s %s)" % (self.values[0], self.op, self.values[1])
     def eval(self):
         result= self.opmap[self.op](self.values[0].eval(),
                                    self.values[1].eval())
         while isinstance(result,Formula):
-              result=result.eval()
+            result=result.eval()
         return result
     def __adapt__(self,validator):
         return validator.adapt(self.eval())
@@ -156,23 +156,23 @@ class Unop2(Unop):
         self._op = op
         self._arg=[]
         for a in arg:
-           self._arg.append(mkf(a))
+            self._arg.append(mkf(a))
     def __str__(self):
         s="%s(" % self._nom
         for a in self._arg:
-           s=s+str(a)+','
+            s=s+str(a)+','
         s=s+")"
         return s
     def __repr__(self):
         s="%s(" % self._nom
         for a in self._arg:
-           s=s+str(a)+','
+            s=s+str(a)+','
         s=s+")"
         return s
     def eval(self):
         l=[]
         for a in self._arg:
-          l.append(a.eval())
+            l.append(a.eval())
         return self._op(*l)
 
 class Constant(Formula):
@@ -203,7 +203,7 @@ def Eval(f):
 
 def cos(f): return Unop('ncos', f)
 def sin(f): return Unop('nsin', f)
-def array(f,*tup,**args): 
+def array(f,*tup,**args):
     """array de Numeric met en defaut la mecanique des parametres
        on la supprime dans ce cas. Il faut que la valeur du parametre soit bien definie
     """
@@ -229,8 +229,8 @@ class  OriginalMath(object):
     def __init__(self):
         if hasattr(self,'pi') :return
         import math
-        try : 
-          self.toSurcharge()
+        try :
+            self.toSurcharge()
         except : pass
 
     def toSurcharge(self):
@@ -286,15 +286,15 @@ class  OriginalMath(object):
     def toOriginal(self):
         import math
         try:
-          import Numeric
+            import Numeric
         except:
-          import numpy
-          Numeric = numpy
+            import numpy
+            Numeric = numpy
 
-        try : 
-          Numeric.cos=originalMath.numeric_ncos
-          Numeric.sin=originalMath.numeric_nsin
-          Numeric.array=originalMath.numeric_narray
+        try :
+            Numeric.cos=originalMath.numeric_ncos
+            Numeric.sin=originalMath.numeric_nsin
+            Numeric.array=originalMath.numeric_narray
         except : pass
         math.sin=originalMath.sin
         math.cos=originalMath.cos
index 9cdf5bb5d09251186079acbb3e2c4d43f766f7d2..ad0ab2e9ec62392e7456489d4ad19d099f84d757 100644 (file)
@@ -29,8 +29,8 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 
 import types
@@ -40,6 +40,7 @@ import traceback
 # import de modules Eficas
 from Noyau.N_CR import CR
 from Noyau.N_UserASSD import UserASSD
+from Noyau.N_UserASSDMultiple import UserASSDMultiple
 from Noyau import N_OBJECT
 from Ihm import I_OBJECT
 from .param2 import *
@@ -48,374 +49,377 @@ from Extensions.i18n import tr
 
 
 class PARAMETRE(N_OBJECT.OBJECT,I_OBJECT.OBJECT,Formula) :
-  """
-     Cette classe permet de creer des objets de type PARAMETRE
-     cad des affectations directes dans le jeu de commandes (ex: a=10.)
-     qui sont interpretees par le parseur de fichiers Python.
-     Les objets ainsi crees constituent des parametres pour le jdc
-  """
-
-  nature = 'PARAMETRE'
-  idracine = 'param'
-
-  def __new__(cls,nom,valeur=None):
-    # on est en relecture du .comm: l objet a ete detecte comme parametre par le parsing
-    # mais il  s agit d une reference, une UserASDD
-     if (issubclass(valeur.__class__, UserASSD)):
-        valeur.initialiseNom(nom)
-        return valeur
-     try :
-        return super(PARAMETRE, cls).__new__(cls,*args,**kwargs)
-     except : 
-        return super(PARAMETRE, cls).__new__(cls)
-
-
-  def __init__(self,nom,valeur=None):
-    #print ('__init__ de parametre pour', nom,valeur)
-    self.nom = nom
-    # La classe PARAMETRE n'a pas de definition : on utilise self pour
-    # completude
-    self.definition=self
-    # parent ne peut etre qu'un objet de type JDC
-    self.jdc = self.parent = CONTEXT.getCurrentStep()
-    self.niveau=self.parent.niveau
-    self.actif=1
-    self.state='undetermined'
-    self.register()
-    self.dict_valeur=[]
-    #self.valeur = self.interpreteValeur(valeur)
-    #self.val=valeur
-    self.valeur = valeur
-    self.val=repr(valeur)
-    self.fenetreIhm=None
-
-  def interpreteValeur(self,val):
     """
-    Essaie d'interpreter val (chaine de caracteres)comme :
-    - un entier
-    - un reel
-    - une chaine de caracteres
-    - une liste d'items d'un type qui precede
-    Retourne la valeur interpretee
-    """
-    #if not val : return None
-    valeur = None
-
-    if type(val) == list:
-    # Un premier traitement a ete fait lors de la saisie
-    # permet de tester les parametres qui sont des listes
-       l_new_val = []
-       for v in val :
-           try :
-               valeur=eval(str(v))
-               l_new_val.append(v)
-           except :
-               return None
-       return l_new_val
-
-    if type(val) == bytes or  type(val) == str:
-       # on tente l'evaluation dans un contexte fourni par le parent s'il existe
-       if self.parent:
-          valeur=self.parent.evalInContext(val,self)
-       else:
-          try :
-              valeur = eval(val)
-          except:
-              #traceback.print_exc()
-              pass
-    #PN je n ose pas modifier je rajoute
-    # refus des listes heterogenes : ne dvrait pas etre la
-    if valeur != None :
-        if type(valeur) == tuple:
+       Cette classe permet de creer des objets de type PARAMETRE
+       cad des affectations directes dans le jeu de commandes (ex: a=10.)
+       qui sont interpretees par le parseur de fichiers Python.
+       Les objets ainsi crees constituent des parametres pour le jdc
+    """
+
+    nature = 'PARAMETRE'
+    idracine = 'param'
+
+    def __new__(cls,nom,valeur=None):
+      # on est en relecture du .comm: l objet a ete detecte comme parametre par le parsing
+      # mais il  s agit d une reference, une UserASDD
+        if (issubclass(valeur.__class__, UserASSDMultiple)):
+            valeur.initialiseNom(nom)
+            return valeur
+        if (issubclass(valeur.__class__, UserASSD)):
+            valeur.initialiseNom(nom)
+            return valeur
+        try :
+            return super(PARAMETRE, cls).__new__(cls,*args,**kwargs)
+        except :
+            return super(PARAMETRE, cls).__new__(cls)
+
+
+    def __init__(self,nom,valeur=None):
+      #print ('__init__ de parametre pour', nom,valeur)
+        self.nom = nom
+        # La classe PARAMETRE n'a pas de definition : on utilise self pour
+        # completude
+        self.definition=self
+        # parent ne peut etre qu'un objet de type JDC
+        self.jdc = self.parent = CONTEXT.getCurrentStep()
+        self.niveau=self.parent.niveau
+        self.actif=1
+        self.state='undetermined'
+        self.register()
+        self.dict_valeur=[]
+        #self.valeur = self.interpreteValeur(valeur)
+        #self.val=valeur
+        self.valeur = valeur
+        self.val=repr(valeur)
+        self.fenetreIhm=None
+
+    def interpreteValeur(self,val):
+        """
+        Essaie d'interpreter val (chaine de caracteres)comme :
+        - un entier
+        - un reel
+        - une chaine de caracteres
+        - une liste d'items d'un type qui precede
+        Retourne la valeur interpretee
+        """
+        #if not val : return None
+        valeur = None
+
+        if type(val) == list:
+        # Un premier traitement a ete fait lors de la saisie
+        # permet de tester les parametres qui sont des listes
             l_new_val = []
-            typ = None
-            for v in valeur :
-                if not typ:
-                    typ = type(v)
-                else:
-                    if type(v) != typ :
-                        # la liste est heterogene --> on refuse d'interpreter
-                        #  self comme une liste
-                        # on retourne la string initiale
-                        print(('liste heterogene ',val))
-                        return val
-                l_new_val.append(v)
-            return tuple(l_new_val)
-
-    if valeur != None :
-       if type(valeur).__name__ == 'list':
-          self.dict_valeur=[]
-          for i in range(len(valeur)):
-             self.dict_valeur.append(valeur[i])
-       return valeur
-    # on retourne val comme une string car on n'a pas su l'interpreter
-    return val
-
-  def getValeurs(self):
-    valeurretour=[]
-    if self.dict_valeur != []:
-       for val in self.dict_valeur:
-           valeurretour.append(val)
-    else:
-        valeurretour.append(self.valeur)
-    return valeurretour
-
-  def setValeur(self,new_valeur):
-    """
-    Remplace la valeur de self par new_valeur interpretee
-    """
-    self.valeur = self.interpreteValeur(new_valeur)
-    self.val=repr(self.valeur)
-    self.parent.updateConceptAfterEtape(self,self)
-    self.initModif()
-
-  def setNom(self,new_nom):
-    """
-    Change le nom du parametre
-    """
-    self.initModif()
-    self.nom=new_nom
-    self.finModif()
-
-  def initModif(self):
-    """
-    Methode qui declare l'objet courant comme modifie et propage
-    cet etat modifie a ses ascendants
-    """
-    self.state = 'modified'
-    if self.parent:
-      self.parent.initModif()
-
-  def getJdcRoot(self):
-    if self.parent:
-      return self.parent.getJdcRoot()
-    else:
-      return self
-
-  def register(self):
-    """
-    Enregistre le parametre dans la liste des etapes de son parent (JDC)
-    """
-    self.parent.registerParametre(self)
-    self.parent.register(self)
-
-  def isValid(self,cr='non'):
-    """
-    Retourne 1 si self est valide, 0 sinon
-    Un parametre est considere comme valide si :
-      - il a un nom
-      - il a une valeur
-    """
-    if self.nom == '' :
-        if cr == 'oui':
-           self.cr.fatal(tr("Pas de nom donne au parametre "))
-        return 0
-    else:
-        if self.valeur == None :
-            if cr == 'oui' : 
-               self.cr.fatal(tr("Le parametre %s ne peut valoir None" , self.nom))
+            for v in val :
+                try :
+                    valeur=eval(str(v))
+                    l_new_val.append(v)
+                except :
+                    return None
+            return l_new_val
+
+        if type(val) == bytes or  type(val) == str:
+            # on tente l'evaluation dans un contexte fourni par le parent s'il existe
+            if self.parent:
+                valeur=self.parent.evalInContext(val,self)
+            else:
+                try :
+                    valeur = eval(val)
+                except:
+                    #traceback.print_exc()
+                    pass
+        #PN je n ose pas modifier je rajoute
+        # refus des listes heterogenes : ne dvrait pas etre la
+        if valeur != None :
+            if type(valeur) == tuple:
+                l_new_val = []
+                typ = None
+                for v in valeur :
+                    if not typ:
+                        typ = type(v)
+                    else:
+                        if type(v) != typ :
+                            # la liste est heterogene --> on refuse d'interpreter
+                            #  self comme une liste
+                            # on retourne la string initiale
+                            print(('liste heterogene ',val))
+                            return val
+                    l_new_val.append(v)
+                return tuple(l_new_val)
+
+        if valeur != None :
+            if type(valeur).__name__ == 'list':
+                self.dict_valeur=[]
+                for i in range(len(valeur)):
+                    self.dict_valeur.append(valeur[i])
+            return valeur
+        # on retourne val comme une string car on n'a pas su l'interpreter
+        return val
+
+    def getValeurs(self):
+        valeurretour=[]
+        if self.dict_valeur != []:
+            for val in self.dict_valeur:
+                valeurretour.append(val)
+        else:
+            valeurretour.append(self.valeur)
+        return valeurretour
+
+    def setValeur(self,new_valeur):
+        """
+        Remplace la valeur de self par new_valeur interpretee
+        """
+        self.valeur = self.interpreteValeur(new_valeur)
+        self.val=repr(self.valeur)
+        self.parent.updateConceptAfterEtape(self,self)
+        self.initModif()
+
+    def setNom(self,new_nom):
+        """
+        Change le nom du parametre
+        """
+        self.initModif()
+        self.nom=new_nom
+        self.finModif()
+
+    def initModif(self):
+        """
+        Methode qui declare l'objet courant comme modifie et propage
+        cet etat modifie a ses ascendants
+        """
+        self.state = 'modified'
+        if self.parent:
+            self.parent.initModif()
+
+    def getJdcRoot(self):
+        if self.parent:
+            return self.parent.getJdcRoot()
+        else:
+            return self
+
+    def register(self):
+        """
+        Enregistre le parametre dans la liste des etapes de son parent (JDC)
+        """
+        self.parent.registerParametre(self)
+        self.parent.register(self)
+
+    def isValid(self,cr='non'):
+        """
+        Retourne 1 si self est valide, 0 sinon
+        Un parametre est considere comme valide si :
+          - il a un nom
+          - il a une valeur
+        """
+        if self.nom == '' :
+            if cr == 'oui':
+                self.cr.fatal(tr("Pas de nom donne au parametre "))
             return 0
-    return 1
-
-  def isOblig(self):
-    """
-    Indique si self est obligatoire ou non : retourne toujours 0
-    """
-    return 0
-
-  def isRepetable(self):
-    """
-    Indique si self est repetable ou non : retourne toujours 1
-    """
-    return 1
-
-  def listeMcPresents(self):
-    return []
-
-  def supprime(self):
-    """
-    Methode qui supprime toutes les boucles de references afin que 
-    l'objet puisse etre correctement detruit par le garbage collector
-    """
-    self.parent = None
-    self.jdc = None
-    self.definition=None
-    self.niveau=None
+        else:
+            if self.valeur == None :
+                if cr == 'oui' :
+                    self.cr.fatal(tr("Le parametre %s ne peut valoir None" , self.nom))
+                return 0
+        return 1
+
+    def isOblig(self):
+        """
+        Indique si self est obligatoire ou non : retourne toujours 0
+        """
+        return 0
 
-  def active(self):
-    """
-    Rend l'etape courante active.
-    Il faut ajouter le parametre au contexte global du JDC
-    """
-    self.actif = 1
-    try:
-        self.jdc.appendParam(self)
-    except:
+    def isRepetable(self):
+        """
+        Indique si self est repetable ou non : retourne toujours 1
+        """
+        return 1
+
+    def listeMcPresents(self):
+        return []
+
+    def supprime(self):
+        """
+        Methode qui supprime toutes les boucles de references afin que
+        l'objet puisse etre correctement detruit par le garbage collector
+        """
+        self.parent = None
+        self.jdc = None
+        self.definition=None
+        self.niveau=None
+
+    def active(self):
+        """
+        Rend l'etape courante active.
+        Il faut ajouter le parametre au contexte global du JDC
+        """
+        self.actif = 1
+        try:
+            self.jdc.appendParam(self)
+        except:
+            pass
+        CONNECTOR.Emit(self,"add",None)
+        CONNECTOR.Emit(self,"valid")
+
+    def inactive(self):
+        """
+        Rend l'etape courante inactive
+        Il faut supprimer le parametre du contexte global du JDC
+        """
+        self.actif = 0
+        self.jdc.delParam(self)
+        self.jdc.deleteConceptAfterEtape(self,self)
+        CONNECTOR.Emit(self,"supp",None)
+        CONNECTOR.Emit(self,"valid")
+
+    def isActif(self):
+        """
+        Booleenne qui retourne 1 si self est actif, 0 sinon
+        """
+        return self.actif
+
+    def setAttribut(self,nom_attr,new_valeur):
+        """
+        Remplace la valeur de self.nom_attr par new_valeur)
+        """
+        if hasattr(self,nom_attr):
+            setattr(self,nom_attr,new_valeur)
+            self.initModif()
+
+    def supprimeSdProds(self):
+        """
+        Il faut supprimer le parametre qui a ete entre dans la liste des
+        parametres du JDC
+        """
+        self.jdc.deleteParam(self)
+        self.parent.deleteConcept(self)
+
+    def updateContext(self,d):
+        """
+        Update le dictionnaire d avec le parametre que produit self
+        """
+        d[self.nom]=self
+
+    def __repr__(self):
+        """
+            Donne un echo de self sous la forme nom = valeur
+        """
+        if type(self.valeur) == bytes or  type(self.valeur) == str :
+            if self.valeur.find('\n') == -1:
+                # pas de retour chariot, on utilise repr
+                return self.nom+' = '+ repr(self.valeur)
+            elif self.valeur.find('"""') == -1:
+                # retour chariot mais pas de triple ", on formatte
+                return self.nom+' = """'+self.valeur+'"""'
+            else:
+                return self.nom+' = '+ repr(self.valeur)
+        else:
+            if type(self.valeur) == list :
+                aRetourner=self.nom+' = ['
+                for l in self.valeur :
+                    aRetourner=aRetourner+str(l) +","
+                aRetourner=aRetourner[0:-1]+']'
+                return aRetourner
+            return self.nom+' = '+ str(self.valeur)
+
+    def __str__(self):
+        """
+            Retourne le nom du parametre comme representation de self
+        """
+        return self.nom
+
+    def getSdprods(self,nom_sd):
+        """
+            Retourne les concepts produits par la commande
+        """
+        return None
+
+    def report(self):
+        """ Genere l'objet rapport (classe CR) """
+        self.cr=CR()
+        self.isValid(cr='oui')
+        return self.cr
+
+    def ident(self):
+        """
+        Retourne le nom interne associe a self
+        Ce nom n'est jamais vu par l'utilisateur dans EFICAS
+        """
+        return self.nom
+
+    def deleteConcept(self,sd):
         pass
-    CONNECTOR.Emit(self,"add",None)
-    CONNECTOR.Emit(self,"valid")
 
-  def inactive(self):
-    """
-    Rend l'etape courante inactive
-    Il faut supprimer le parametre du contexte global du JDC
-    """
-    self.actif = 0
-    self.jdc.delParam(self)
-    self.jdc.deleteConceptAfterEtape(self,self)
-    CONNECTOR.Emit(self,"supp",None)
-    CONNECTOR.Emit(self,"valid")
-
-  def isActif(self):
-    """
-    Booleenne qui retourne 1 si self est actif, 0 sinon
-    """
-    return self.actif
-
-  def setAttribut(self,nom_attr,new_valeur):
-    """
-    Remplace la valeur de self.nom_attr par new_valeur)
-    """
-    if hasattr(self,nom_attr):
-      setattr(self,nom_attr,new_valeur)
-      self.initModif()
-
-  def supprimeSdProds(self):
-    """
-    Il faut supprimer le parametre qui a ete entre dans la liste des
-    parametres du JDC
-    """
-    self.jdc.deleteParam(self)
-    self.parent.deleteConcept(self)
-
-  def updateContext(self,d):
-    """
-    Update le dictionnaire d avec le parametre que produit self
-    """
-    d[self.nom]=self
-
-  def __repr__(self):
-    """
-        Donne un echo de self sous la forme nom = valeur
-    """
-    if type(self.valeur) == bytes or  type(self.valeur) == str :
-         if self.valeur.find('\n') == -1:
-            # pas de retour chariot, on utilise repr
-            return self.nom+' = '+ repr(self.valeur)
-         elif self.valeur.find('"""') == -1:
-            # retour chariot mais pas de triple ", on formatte
-            return self.nom+' = """'+self.valeur+'"""'
-         else:
-            return self.nom+' = '+ repr(self.valeur)
-    else:
-       if type(self.valeur) == list :
-          aRetourner=self.nom+' = ['
-          for l in self.valeur :
-            aRetourner=aRetourner+str(l) +","
-          aRetourner=aRetourner[0:-1]+']'
-          return aRetourner
-       return self.nom+' = '+ str(self.valeur)
-
-  def __str__(self):
-    """
-        Retourne le nom du parametre comme representation de self
-    """
-    return self.nom
-
-  def getSdprods(self,nom_sd):
-     """
-         Retourne les concepts produits par la commande
-     """
-     return None
-
-  def report(self):
-    """ Genere l'objet rapport (classe CR) """
-    self.cr=CR()
-    self.isValid(cr='oui')
-    return self.cr
-
-  def ident(self):
-    """
-    Retourne le nom interne associe a self
-    Ce nom n'est jamais vu par l'utilisateur dans EFICAS
-    """
-    return self.nom
-
-  def deleteConcept(self,sd):
-    pass
-
-  def replaceConcept(self,old_sd,sd):
-    pass
-
-  def verifConditionBloc(self):
-    """
-        Evalue les conditions de tous les blocs fils possibles
-        (en fonction du catalogue donc de la definition) de self et
-        retourne deux listes :
-          - la premiere contient les noms des blocs a rajouter
-          - la seconde contient les noms des blocs a supprimer
-    """
-    return [],[]
-
-  def verifConditionRegles(self,liste_presents):
-    """
-        Retourne la liste des mots-cles a rajouter pour satisfaire les regles
-        en fonction de la liste des mots-cles presents
-    """
-    return []
+    def replaceConcept(self,old_sd,sd):
+        pass
 
-  def verifExistenceSd(self):
-     pass
+    def verifConditionBloc(self):
+        """
+            Evalue les conditions de tous les blocs fils possibles
+            (en fonction du catalogue donc de la definition) de self et
+            retourne deux listes :
+              - la premiere contient les noms des blocs a rajouter
+              - la seconde contient les noms des blocs a supprimer
+        """
+        return [],[]
+
+    def verifConditionRegles(self,liste_presents):
+        """
+            Retourne la liste des mots-cles a rajouter pour satisfaire les regles
+            en fonction de la liste des mots-cles presents
+        """
+        return []
+
+    def verifExistenceSd(self):
+        pass
 
-  def controlSdprods(self,d):
-      """sans objet """
-      pass
+    def controlSdprods(self,d):
+        """sans objet """
+        pass
 
-  def close(self):
-      pass
+    def close(self):
+        pass
 
-  def resetContext(self):
-      pass
+    def resetContext(self):
+        pass
 
-  def eval(self):
-      if isinstance(self.valeur,Formula):
-         return self.valeur.eval()
-      else:
-         return self.valeur
+    def eval(self):
+        if isinstance(self.valeur,Formula):
+            return self.valeur.eval()
+        else:
+            return self.valeur
 
-  def __adapt__(self,validator):
-      return validator.adapt(self.eval())
+    def __adapt__(self,validator):
+        return validator.adapt(self.eval())
 
 class COMBI_PARAMETRE(object) :
-  def __init__(self,chainevaleur,valeur):
-      self.chainevaleur=chainevaleur
-      self.valeur=valeur
+    def __init__(self,chainevaleur,valeur):
+        self.chainevaleur=chainevaleur
+        self.valeur=valeur
 
-  def __repr__(self):
-      return self.chainevaleur
+    def __repr__(self):
+        return self.chainevaleur
 
-  def isValid(self):
-      if self.valeur and self.chainevaleur:
-         return 1
+    def isValid(self):
+        if self.valeur and self.chainevaleur:
+            return 1
 
 class ITEM_PARAMETRE(object) :
-  def __init__(self,param_pere,item=None):
-      self.param_pere = param_pere
-      self.item = item
-      
-
-  def __repr__(self):
-    return self.param_pere.nom+'['+str(self.item)+']'
-
-
-  def isValid(self):
-      isValid = 1
-      if self.item < 0:
-         isValid =  0
-      try:
-         longueur= len(self.param_pere.dict_valeur) - 1
-      except:
-         longueur=0
-      if self.item > longueur :
-         isValid= 0
-      return isValid
+    def __init__(self,param_pere,item=None):
+        self.param_pere = param_pere
+        self.item = item
+
+
+    def __repr__(self):
+        return self.param_pere.nom+'['+str(self.item)+']'
+
+
+    def isValid(self):
+        isValid = 1
+        if self.item < 0:
+            isValid =  0
+        try:
+            longueur= len(self.param_pere.dict_valeur) - 1
+        except:
+            longueur=0
+        if self.item > longueur :
+            isValid= 0
+        return isValid
index 7118e1b14774c5f800b68f16a03a885367a22f0b..19566a380433e74332d54acdc09bf25a77d185a5 100644 (file)
@@ -39,198 +39,196 @@ from . import parametre
 pattern_eval       = re.compile(r'^(EVAL)([ \t\r\f\v]*)\(([\w\W]*)')
 
 class PARAMETRE_EVAL(parametre.PARAMETRE) :
-  """
-  Cette classe permet de creer des objets de type PARAMETRE_EVAL
-  cad des affectations directes evaluees dans le jeu de commandes (ex: a=EVAL('''10.*SQRT(25)'''))
-  qui sont interpretees par le parseur de fichiers Python.
-  Les objets ainsi crees constituent des parametres evalues pour le jdc
-  """
-  nature = 'PARAMETRE_EVAL'
-  idracine='param_eval'
-
-  def __init__(self,nom,valeur=None):
-    # parent ne peut etre qu'un objet de type JDC
-    import Accas
-    self.Accas_EVAL=Accas.EVAL
-    self.valeur = self.interpreteValeur(valeur)
-    self.val    = valeur
-    self.nom = nom
-    self.jdc = self.parent = CONTEXT.getCurrentStep()
-    self.definition=self
-    self.niveau = self.parent.niveau
-    self.actif=1
-    self.state='undetermined'
-    # Ceci est-il indispensable ???
-    #self.appel = N_utils.calleeWhere(niveau=2)
-    self.register()
-
-  def __repr__(self):
     """
-        Donne un echo de self sous la forme nom = valeur
-    """
-    return self.nom+' = '+ repr(self.valeur) 
-
-  def __str__(self):
-    """
-        Retourne le nom du parametre evalue comme representation de self
-    """
-    return self.nom
-
-  def interpreteValeur(self,val):
-    """
-    Essaie d'interpreter val (chaine de caracteres ou None) comme :
-    une instance de Accas.EVAL
-    Retourne la valeur interpretee
-    """
-    if not val : return None
-    d={}
-    val = val.strip()
-    if val[-1] == ';' : val = val[0:-1]
-    d['EVAL'] = self.Accas_EVAL
-    try:
-        valeur = eval(val,{},d)
-        return valeur
-    except:
-        traceback.print_exc()
-        print(("Le texte %s n'est pas celui d'un parametre evalue" %val))
-        return None
-
-  def setValeur(self,new_valeur):
-    """
-    Remplace la valeur de self par new_valeur interpretee.
-    """
-    self.valeur = self.interpreteValeur(new_valeur)
-    self.val = new_valeur
-    self.initModif()
-
-  def getNom(self) :
-    """
-    Retourne le nom du parametre
-    """
-    return self.nom
-
-  def getValeur(self):
-    """
-    Retourne la valeur de self, cad le texte de l'objet class_eval.EVAL
-    """
-    if self.valeur :
-        return self.valeur.valeur
-    else:
-        return ''
-
-  def verifEval(self,exp_eval=None,cr='non'):
-    """
-    Cette methode a pour but de verifier si l'expression EVAL
-    est syntaxiquement correcte.
-    Retourne :
-        - un booleen, qui vaut 1 si licite, 0 sinon
-        - un message d'erreurs ('' si illicite)
-    """
-    if not exp_eval:
+    Cette classe permet de creer des objets de type PARAMETRE_EVAL
+    cad des affectations directes evaluees dans le jeu de commandes (ex: a=EVAL('''10.*SQRT(25)'''))
+    qui sont interpretees par le parseur de fichiers Python.
+    Les objets ainsi crees constituent des parametres evalues pour le jdc
+    """
+    nature = 'PARAMETRE_EVAL'
+    idracine='param_eval'
+
+    def __init__(self,nom,valeur=None):
+        # parent ne peut etre qu'un objet de type JDC
+        import Accas
+        self.Accas_EVAL=Accas.EVAL
+        self.valeur = self.interpreteValeur(valeur)
+        self.val    = valeur
+        self.nom = nom
+        self.jdc = self.parent = CONTEXT.getCurrentStep()
+        self.definition=self
+        self.niveau = self.parent.niveau
+        self.actif=1
+        self.state='undetermined'
+        # Ceci est-il indispensable ???
+        #self.appel = N_utils.calleeWhere(niveau=2)
+        self.register()
+
+    def __repr__(self):
+        """
+            Donne un echo de self sous la forme nom = valeur
+        """
+        return self.nom+' = '+ repr(self.valeur)
+
+    def __str__(self):
+        """
+            Retourne le nom du parametre evalue comme representation de self
+        """
+        return self.nom
+
+    def interpreteValeur(self,val):
+        """
+        Essaie d'interpreter val (chaine de caracteres ou None) comme :
+        une instance de Accas.EVAL
+        Retourne la valeur interpretee
+        """
+        if not val : return None
+        d={}
+        val = val.strip()
+        if val[-1] == ';' : val = val[0:-1]
+        d['EVAL'] = self.Accas_EVAL
+        try:
+            valeur = eval(val,{},d)
+            return valeur
+        except:
+            traceback.print_exc()
+            print(("Le texte %s n'est pas celui d'un parametre evalue" %val))
+            return None
+
+    def setValeur(self,new_valeur):
+        """
+        Remplace la valeur de self par new_valeur interpretee.
+        """
+        self.valeur = self.interpreteValeur(new_valeur)
+        self.val = new_valeur
+        self.initModif()
+
+    def getNom(self) :
+        """
+        Retourne le nom du parametre
+        """
+        return self.nom
+
+    def getValeur(self):
+        """
+        Retourne la valeur de self, cad le texte de l'objet class_eval.EVAL
+        """
         if self.valeur :
-            exp_eval = self.valeur.valeur[3:-3] # on enleve les triples guillemets
+            return self.valeur.valeur
         else:
-            exp_eval = None
-    if exp_eval :
-        # on construit un interpreteur de formule
-        formule=(self.nom,'',None,exp_eval)
-        # on recupere la liste des constantes et des autres fonctions predefinies
-        # et qui peuvent etre utilisees dans le corps de la formule courante
-        l_ctes,l_form = self.jdc.getParametresFonctionsAvantEtape(self)
-        # on cree un objet verificateur
-        verificateur = interpreteur_formule.Interpreteur_Formule(formule=formule,
-                                                                 constantes = l_ctes,
-                                                                 fonctions = l_form)
-        if cr == 'oui' :
-          if not verificateur.cr.estvide():
-            self.cr.fatal(verificateur.cr.getMessFatal())
-        return verificateur.isValid(),''.join(verificateur.cr.crfatal)
-    else:
-        # pas d'expression EVAL --> self non valide
-        if cr == 'oui' : 
-           self.cr.fatal(tr("Le parametre EVAL %s ne peut valoir None") , self.nom)
-        return 0,tr("Le parametre EVAL ne peut valoir None")
-
-  def verifNom(self,nom=None,cr='non'):
-    """
-    Verifie si le nom passe en argument (si aucun prend le nom courant)
-    est un nom valide pour un parametre EVAL
-    Retourne :
-        - un booleen, qui vaut 1 si nom licite, 0 sinon
-        - un message d'erreurs ('' si illicite)
-    """
-    if not nom :
-        nom = self.nom
-    if nom == "" :
-        if cr == 'oui' : self.cr.fatal(tr("Pas de nom donne au parametre EVAL"))
-        return 0,"Pas de nom donne au parametre EVAL"
-    if len(nom) > 8 :
-        if cr == 'oui' : self.cr.fatal(tr("Un nom de parametre ne peut depasser 8 caracteres"))
-        return 0,"Un nom de parametre ne peut depasser 8 caracteres"
-    sd = self.parent.getSdAutourEtape(nom,self)
-    if sd :
-        if cr == 'oui' : self.cr.fatal(tr("Un concept de nom %s existe deja !"), nom)
-        return 0,"Un concept de nom %s existe deja !" %nom
-    return 1,''
-
-  def verifParametreEval(self,param=None,cr='non'):
-    """
-    Verifie la validite du parametre EVAL passe en argument.
-    Ce nouveau parametre est passe sous la forme d'un tuple : (nom,valeur)
-    Si aucun tuple passe, prend les valeurs courantes de l'objet
-    Retourne :
-            - un booleen, qui vaut 1 si EVAL licite, 0 sinon
+            return ''
+
+    def verifEval(self,exp_eval=None,cr='non'):
+        """
+        Cette methode a pour but de verifier si l'expression EVAL
+        est syntaxiquement correcte.
+        Retourne :
+            - un booleen, qui vaut 1 si licite, 0 sinon
             - un message d'erreurs ('' si illicite)
-    """
-    if not param :
-        if self.valeur :
-            param = (self.nom,self.valeur.valeur)
+        """
+        if not exp_eval:
+            if self.valeur :
+                exp_eval = self.valeur.valeur[3:-3] # on enleve les triples guillemets
+            else:
+                exp_eval = None
+        if exp_eval :
+            # on construit un interpreteur de formule
+            formule=(self.nom,'',None,exp_eval)
+            # on recupere la liste des constantes et des autres fonctions predefinies
+            # et qui peuvent etre utilisees dans le corps de la formule courante
+            l_ctes,l_form = self.jdc.getParametresFonctionsAvantEtape(self)
+            # on cree un objet verificateur
+            verificateur = interpreteur_formule.Interpreteur_Formule(formule=formule,
+                                                                     constantes = l_ctes,
+                                                                     fonctions = l_form)
+            if cr == 'oui' :
+                if not verificateur.cr.estvide():
+                    self.cr.fatal(verificateur.cr.getMessFatal())
+            return verificateur.isValid(),''.join(verificateur.cr.crfatal)
         else:
-            param = (self.nom,None)
-    test_nom,erreur_nom   = self.verifNom(param[0],cr=cr)
-    test_eval,erreur_eval = self.verifEval(param[1],cr=cr)
-    # test global = produit des tests partiels
-    test = test_nom*test_eval
-    # message d'erreurs global = concatenation des messages partiels
-    erreur = ''
-    if not test :
-        for mess in (erreur_nom,erreur_eval):
-            erreur = erreur+(len(mess) > 0)*'\n'+mess
-    return test,erreur
-
-  def update(self,param):
-    """
-    Methode externe.
-    Met a jour les champs nom, valeur de self
-    par les nouvelles valeurs passees dans le tuple formule.
-    On stocke les valeurs SANS verifications.
-    """
-    self.initModif()
-    self.setNom(param[0])
-    self.setValeur('EVAL("""'+param[1]+'""")')
-
-  def isValid(self,cr='non'):
-    """
-    Retourne 1 si self est valide, 0 sinon
-    Un parametre evalue est considere comme valide si :
-      - il a un nom
-      - il a une valeur qui est interpretable par l'interpreteur de FORMULEs
-    """
-    resu,erreur= self.verifParametreEval(cr=cr)
-    return resu
-
-  def report(self):
-    """
-        Genere l'objet rapport (classe CR)
-    """
-    self.cr = CR()
-    self.isValid(cr='oui')
-    return self.cr
-
-  def setNom(self,new_nom):
-    """
-    Remplace le nom de self par new_nom
-    """
-    self.nom = new_nom
-
-
+            # pas d'expression EVAL --> self non valide
+            if cr == 'oui' :
+                self.cr.fatal(tr("Le parametre EVAL %s ne peut valoir None") , self.nom)
+            return 0,tr("Le parametre EVAL ne peut valoir None")
+
+    def verifNom(self,nom=None,cr='non'):
+        """
+        Verifie si le nom passe en argument (si aucun prend le nom courant)
+        est un nom valide pour un parametre EVAL
+        Retourne :
+            - un booleen, qui vaut 1 si nom licite, 0 sinon
+            - un message d'erreurs ('' si illicite)
+        """
+        if not nom :
+            nom = self.nom
+        if nom == "" :
+            if cr == 'oui' : self.cr.fatal(tr("Pas de nom donne au parametre EVAL"))
+            return 0,"Pas de nom donne au parametre EVAL"
+        if len(nom) > 8 :
+            if cr == 'oui' : self.cr.fatal(tr("Un nom de parametre ne peut depasser 8 caracteres"))
+            return 0,"Un nom de parametre ne peut depasser 8 caracteres"
+        sd = self.parent.getSdAutourEtape(nom,self)
+        if sd :
+            if cr == 'oui' : self.cr.fatal(tr("Un concept de nom %s existe deja !"), nom)
+            return 0,"Un concept de nom %s existe deja !" %nom
+        return 1,''
+
+    def verifParametreEval(self,param=None,cr='non'):
+        """
+        Verifie la validite du parametre EVAL passe en argument.
+        Ce nouveau parametre est passe sous la forme d'un tuple : (nom,valeur)
+        Si aucun tuple passe, prend les valeurs courantes de l'objet
+        Retourne :
+                - un booleen, qui vaut 1 si EVAL licite, 0 sinon
+                - un message d'erreurs ('' si illicite)
+        """
+        if not param :
+            if self.valeur :
+                param = (self.nom,self.valeur.valeur)
+            else:
+                param = (self.nom,None)
+        test_nom,erreur_nom   = self.verifNom(param[0],cr=cr)
+        test_eval,erreur_eval = self.verifEval(param[1],cr=cr)
+        # test global = produit des tests partiels
+        test = test_nom*test_eval
+        # message d'erreurs global = concatenation des messages partiels
+        erreur = ''
+        if not test :
+            for mess in (erreur_nom,erreur_eval):
+                erreur = erreur+(len(mess) > 0)*'\n'+mess
+        return test,erreur
+
+    def update(self,param):
+        """
+        Methode externe.
+        Met a jour les champs nom, valeur de self
+        par les nouvelles valeurs passees dans le tuple formule.
+        On stocke les valeurs SANS verifications.
+        """
+        self.initModif()
+        self.setNom(param[0])
+        self.setValeur('EVAL("""'+param[1]+'""")')
+
+    def isValid(self,cr='non'):
+        """
+        Retourne 1 si self est valide, 0 sinon
+        Un parametre evalue est considere comme valide si :
+          - il a un nom
+          - il a une valeur qui est interpretable par l'interpreteur de FORMULEs
+        """
+        resu,erreur= self.verifParametreEval(cr=cr)
+        return resu
+
+    def report(self):
+        """
+            Genere l'objet rapport (classe CR)
+        """
+        self.cr = CR()
+        self.isValid(cr='oui')
+        return self.cr
+
+    def setNom(self,new_nom):
+        """
+        Remplace le nom de self par new_nom
+        """
+        self.nom = new_nom
index 009af7ef100aff62bcac49dd860f3b47531324be..6dbd8342e2f2d1f0523eb0807c8e9b038c3556de 100644 (file)
 from __future__ import absolute_import
 import glob,os,sys,traceback
 try:
-   from UserDict import UserDict
+    from UserDict import UserDict
 except ImportError:
-   from collections import UserDict
+    from collections import UserDict
 
 
 class PluginLoader(UserDict):
-   def __init__(self,module):
-      UserDict.__init__(self)
-      self.plugin_dir=module.__path__[0]
-      self.plugin_setName=module.__name__
-      _module_list = glob.glob( os.path.join( self.plugin_dir,
-                              '%s*py' % self.plugin_setName,
-                                           )
-                              )
-      _module_list.sort()
+    def __init__(self,module):
+        UserDict.__init__(self)
+        self.plugin_dir=module.__path__[0]
+        self.plugin_setName=module.__name__
+        _module_list = glob.glob( os.path.join( self.plugin_dir,
+                                '%s*py' % self.plugin_setName,
+                                             )
+                                )
+        _module_list.sort()
 
-      for _module_name in _module_list:
+        for _module_name in _module_list:
 
-        _module_name = os.path.basename(_module_name)[:-3]
-        _import_name = '%s.%s' % ( self.plugin_setName,
-                                   _module_name )
+            _module_name = os.path.basename(_module_name)[:-3]
+            _import_name = '%s.%s' % ( self.plugin_setName,
+                                       _module_name )
 
-        try:
-          _module = __import__( _import_name )
-        except:
-          sys.stderr.write('\n--- Plugin Module Error ---\n')
-          traceback.print_exc()
-          sys.stderr.write('---------------------------\n\n')
-          continue
-        try:
-          _module = getattr(_module, _module_name)
-        except AttributeError:
-          sys.stderr.write('ERROR: Could not retrieve %s\n' % _import_name)
+            try:
+                _module = __import__( _import_name )
+            except:
+                sys.stderr.write('\n--- Plugin Module Error ---\n')
+                traceback.print_exc()
+                sys.stderr.write('---------------------------\n\n')
+                continue
+            try:
+                _module = getattr(_module, _module_name)
+            except AttributeError:
+                sys.stderr.write('ERROR: Could not retrieve %s\n' % _import_name)
 
-        try:
-          info = _module.entryPoint()
-        except AttributeError:
-          pass
-        else:
-          self.addEntryPoint(info)
+            try:
+                info = _module.entryPoint()
+            except AttributeError:
+                pass
+            else:
+                self.addEntryPoint(info)
 
 
-   def addEntryPoint(self,infoDict):
-      name=infoDict['name']
-      factory=infoDict['factory']
-      self[name]=factory
-
+    def addEntryPoint(self,infoDict):
+        name=infoDict['name']
+        factory=infoDict['factory']
+        self[name]=factory
index cc763f928c035d0723f7c6a71dbbc8ef1f37a9ad..1745cd1a6cc363872694003d8f08802b2a47f9bd 100644 (file)
@@ -22,12 +22,12 @@ tuples, or atoms.
 
 """
 from __future__ import absolute_import
-try : 
-  from builtins import zip
-  from builtins import map
-  from builtins import range
-except : 
-  pass
+try :
+    from builtins import zip
+    from builtins import map
+    from builtins import range
+except :
+    pass
 from .eficas_exception import EficasException
 
 import re
@@ -137,7 +137,7 @@ def _reformat_qstring_from_atom(qstring, params):
 
     Module-internal method.
     Returns a formatted string from an unformatted string
-    and an integer or a float specifying the parameter of 
+    and an integer or a float specifying the parameter of
     the string.
     """
     from PyQt5.QtCore import QRegExp
@@ -186,7 +186,7 @@ def _reformat_qstring_from_list(qstring, params):
 
     Module-internal method.
     Returns a formatted string from an unformatted string
-    and a list whose concatenation specifies the parameter 
+    and a list whose concatenation specifies the parameter
     of the string.
     """
     # XXX to add further functionality, e.g. list processing
@@ -208,9 +208,9 @@ def _reformat_qstring_from_list(qstring, params):
 def _preprocess_atom(string):
     """
     _preprocess_atom(string-or-number-or-unicode) -> unicode
-    Test if input is a Unicode object or a number; if so, then return it; 
-    otherwise, test if the input is a string; if so, then try to create 
-    a Unicode object out of it. To this end, assume the string is encoded 
+    Test if input is a Unicode object or a number; if so, then return it;
+    otherwise, test if the input is a string; if so, then try to create
+    a Unicode object out of it. To this end, assume the string is encoded
     in utf-8; if this fails, then assume the string is encoded in Latin-9.
     """
     if isinstance(string, (six.text_type, int, float, complex)):
@@ -224,8 +224,8 @@ def _preprocess_atom(string):
 def _str_toUnicode(string):
     """
     _str_toUnicode(string) -> unicode
-    Tries to create a Unicode object out of the input string; assumes 
-    the string is UTF-8 encoded; if not, then assume the string is 
+    Tries to create a Unicode object out of the input string; assumes
+    the string is UTF-8 encoded; if not, then assume the string is
     Latin-9 encoded.
     """
     try:
@@ -241,15 +241,15 @@ def _str_toUnicode(string):
 def tr(string, *args):
     """tr(string-or-unicode, iterable-or-float-or-int) -> unicode
        tr(string-or-unicode) -> unicode
-       
-       Returns a formatted Unicode object from an unformatted 
-       string or Unicode object with formatting specifications, and, 
+
+       Returns a formatted Unicode object from an unformatted
+       string or Unicode object with formatting specifications, and,
        optionally, an iterable or an int or float.
        Lets Python do the string formatting."""
     try :
-      from PyQt5.QtWidgets import QApplication
+        from PyQt5.QtWidgets import QApplication
     except :
-      return string
+        return string
 
     string = _preprocess_atom(string)
     if len(args) == 0:
@@ -293,9 +293,9 @@ def tr(string, *args):
 def tr_qt(string, *args):
     """tr_qt(string, iterable-or-float-or-int) -> unicode
        t_qtr(string) -> unicode
-       
-       Returns a formatted string from an unformatted 
-       Unicode string with formatting specifications, and, 
+
+       Returns a formatted string from an unformatted
+       Unicode string with formatting specifications, and,
        optionally, an iterable or an int or float.
        Lets PyQt4 do the string formatting. To this end,
        a conversion from Python to Qt string formatting
@@ -312,7 +312,7 @@ def tr_qt(string, *args):
                     r = _reformat_qstring_from_dict(r, args[0])
                 elif isinstance(args[0], tuple):
                     r = _reformat_qstring_from_tuple(r, args[0])
-            # XXX Pay attention to this: distinguish between tuple, 
+            # XXX Pay attention to this: distinguish between tuple,
             # dict and dict with key given in string.
             elif r.count("%") in range(2) and r.count("%(") == 0:
                 r = _reformat_qstring_from_atom(r, _preproces_atom(repr(args[0])))
index f0e3f0efe5cd89f5391876188ef70bb1d7ef4825..31efdd4c7b4f94bf9602f7e54e4b65e8654cdccf 100644 (file)
@@ -21,8 +21,8 @@
   La classe CONNECTOR sert a enregistrer les observateurs d'objets et a delivrer
   les messages emis a ces objets.
 
-  Le principe general est le suivant : un objet (subscriber) s'enregistre aupres du 
-  connecteur global (theconnector) pour observer un objet emetteur de messages (publisher) 
+  Le principe general est le suivant : un objet (subscriber) s'enregistre aupres du
+  connecteur global (theconnector) pour observer un objet emetteur de messages (publisher)
   sur un canal donne (channel). Il demande a etre notifie par appel d'une fonction (listener).
   La sequence est donc :
 
@@ -46,147 +46,145 @@ class ConnectorError(Exception):
 
 class CONNECTOR:
 
-  def __init__(self):
-    self.connections={}
-
-  def Connect(self, object, channel, function, args):
-    #print ("Connect",object, channel, function, args)
-    idx = id(object)
-    #if self.connections.has_key(idx):
-    if idx in self.connections :
-       channels = self.connections[idx]
-    else:
-       channels = self.connections[idx] = {}
-
-    #if channels.has_key(channel):
-    if channel in channels :
-       receivers = channels[channel]
-    else:
-       receivers = channels[channel] = []
-
-    for funct,fargs in receivers[:]:
-        if funct() is None:
-           receivers.remove((funct,fargs))
-        elif (function,args) == (funct(),fargs):
-           receivers.remove((funct,fargs))
-
-    receivers.append((ref(function),args))
-    
-
-  def Disconnect(self, object, channel, function, args):
-    try:
-       receivers = self.connections[id(object)][channel]
-    except KeyError:
-       raise ConnectorError (
-            'no receivers for channel %s of %s' % (channel, object))
-
-    for funct,fargs in receivers[:]:
-        if funct() is None:
-           receivers.remove((funct,fargs))
-
-    for funct,fargs in receivers:
-        if (function,args) == (funct(),fargs):
-           receivers.remove((funct,fargs))
-           if not receivers:
-              # the list of receivers is empty now, remove the channel
-              channels = self.connections[id(object)]
-              del channels[channel]
-              if not channels:
-                 # the object has no more channels
-                 del self.connections[id(object)]
-           return
-
-    raise ConnectorError(
-          'receiver %s%s is not connected to channel %s of %s' \
-          % (function, args, channel, object))
-
-
-
-  def Emit(self, object, channel, *args):
-    #print "Emit",object, channel, args
-    try:
-       receivers = self.connections[id(object)][channel]
-    except KeyError:
-       return
-    #print "Emit",object, channel, receivers
-    # Attention : copie pour eviter les pbs lies aux deconnexion reconnexion
-    # pendant l'execution des emit
-    for rfunc, fargs in copy(receivers):
-       try:
-          func=rfunc()
-          if func:
-             #print (func,args,fargs)
-             #rint args + fargs
-             #apply(func, args + fargs)
-             if args + fargs == () : func()
-             else : func ( args + fargs)
-          else:
-             # Le receveur a disparu
-             if (rfunc,fargs) in receivers:receivers.remove((rfunc,fargs))
-       except:
-          traceback.print_exc()
+    def __init__(self):
+        self.connections={}
+
+    def Connect(self, object, channel, function, args):
+        #print ("Connect",object, channel, function, args)
+        idx = id(object)
+        #if self.connections.has_key(idx):
+        if idx in self.connections :
+            channels = self.connections[idx]
+        else:
+            channels = self.connections[idx] = {}
+
+        #if channels.has_key(channel):
+        if channel in channels :
+            receivers = channels[channel]
+        else:
+            receivers = channels[channel] = []
+
+        for funct,fargs in receivers[:]:
+            if funct() is None:
+                receivers.remove((funct,fargs))
+            elif (function,args) == (funct(),fargs):
+                receivers.remove((funct,fargs))
+
+        receivers.append((ref(function),args))
+
+
+    def Disconnect(self, object, channel, function, args):
+        try:
+            receivers = self.connections[id(object)][channel]
+        except KeyError:
+            raise ConnectorError (
+                 'no receivers for channel %s of %s' % (channel, object))
+
+        for funct,fargs in receivers[:]:
+            if funct() is None:
+                receivers.remove((funct,fargs))
+
+        for funct,fargs in receivers:
+            if (function,args) == (funct(),fargs):
+                receivers.remove((funct,fargs))
+                if not receivers:
+                    # the list of receivers is empty now, remove the channel
+                    channels = self.connections[id(object)]
+                    del channels[channel]
+                    if not channels:
+                        # the object has no more channels
+                        del self.connections[id(object)]
+                return
+
+        raise ConnectorError(
+              'receiver %s%s is not connected to channel %s of %s' \
+              % (function, args, channel, object))
+
+
+
+    def Emit(self, object, channel, *args):
+        #print "Emit",object, channel, args
+        try:
+            receivers = self.connections[id(object)][channel]
+        except KeyError:
+            return
+        #print "Emit",object, channel, receivers
+        # Attention : copie pour eviter les pbs lies aux deconnexion reconnexion
+        # pendant l'execution des emit
+        for rfunc, fargs in copy(receivers):
+            try:
+                func=rfunc()
+                if func:
+                    #print (func,args,fargs)
+                    #rint args + fargs
+                    #apply(func, args + fargs)
+                    if args + fargs == () : func()
+                    else : func ( args + fargs)
+                else:
+                    # Le receveur a disparu
+                    if (rfunc,fargs) in receivers:receivers.remove((rfunc,fargs))
+            except:
+                traceback.print_exc()
 
 def ref(target,callback=None):
-   #if hasattr(target,"im_self"):
-   #   return BoundMethodWeakref(target)
-   if hasattr(target,"__self__"):
-      return BoundMethodWeakref(target)
-   else:
-      return weakref.ref(target,callback)
+    #if hasattr(target,"im_self"):
+    #   return BoundMethodWeakref(target)
+    if hasattr(target,"__self__"):
+        return BoundMethodWeakref(target)
+    else:
+        return weakref.ref(target,callback)
 
 class BoundMethodWeakref(object):
-   def __init__(self,callable):
-       #self.Self=weakref.ref(callable.im_self)
-       #self.Func=weakref.ref(callable.im_func)
-       self.Self=weakref.ref(callable.__self__)
-       self.Func=weakref.ref(callable.__func__)
-
-   def __call__(self):
-       target=self.Self()
-       if not target:return None
-       func=self.Func()
-       if func:
-          return func.__get__(self.Self())
+    def __init__(self,callable):
+            #self.Self=weakref.ref(callable.im_self)
+            #self.Func=weakref.ref(callable.im_func)
+        self.Self=weakref.ref(callable.__self__)
+        self.Func=weakref.ref(callable.__func__)
+
+    def __call__(self):
+        target=self.Self()
+        if not target:return None
+        func=self.Func()
+        if func:
+            return func.__get__(self.Self())
 
 _the_connector =CONNECTOR()
 Connect = _the_connector.Connect
-Emit = _the_connector.Emit 
+Emit = _the_connector.Emit
 Disconnect = _the_connector.Disconnect
 
 if __name__ == "__main__":
-   class A:
-     pass
-
-   class B:
-     def add(self,a):
-       print(("--------------------------------add ", self , a))
-
-     def __del__(self):
-       print(("__del__", self))
+    class A:
+        pass
 
-   def f(a):
-     print((f, a))
+    class B:
+        def add(self,a):
+            print(("--------------------------------add ", self , a))
 
-   a=A()
-   b=B()
-   c=B()
+        def __del__(self):
+            print(("__del__", self))
 
-   Connect(a,"add",b.add,())
-   Connect(a,"add",b.add,())
-   Connect(a,"add",c.add,())
-   Connect(a,"add",f,())
+    def f(a):
+        print((f, a))
 
-   Emit(a,"add",1)
+    a=A()
+    b=B()
+    c=B()
 
-   print ("del b")
-   del b
+    Connect(a,"add",b.add,())
+    Connect(a,"add",b.add,())
+    Connect(a,"add",c.add,())
+    Connect(a,"add",f,())
 
-   Emit(a,"add",1)
-   print ("del f")
-   del f
+    Emit(a,"add",1)
 
-   Emit(a,"add",1)
-   Disconnect(a,"add",c.add,())
-   Emit(a,"add",1)
+    print ("del b")
+    del b
 
+    Emit(a,"add",1)
+    print ("del f")
+    del f
 
+    Emit(a,"add",1)
+    Disconnect(a,"add",c.add,())
+    Emit(a,"add",1)
index ff896ce8cff35906d66fedf42d25c6f8f065e13b..ae8caeb19b0f6c9b8c3e4f9144ec43fc77aaf359 100644 (file)
@@ -26,33 +26,32 @@ from Extensions.eficas_exception import EficasException
 from Noyau.N_VALIDATOR import ValError
 
 class ASSD:
-   def __repr__(self):
-      return "concept " + self.getName() + " type " + self.__class__.__name__
+    def __repr__(self):
+        return "concept " + self.getName() + " type " + self.__class__.__name__
 
-   def __str__(self):
-      return self.getName() or "<None>"
+    def __str__(self):
+        return self.getName() or "<None>"
 
 
 class assd(ASSD):
-   def __convert__(cls,valeur):
-      return valeur
-   __convert__=classmethod(__convert__)
+    def __convert__(cls,valeur):
+        return valeur
+    __convert__=classmethod(__convert__)
 
 class GEOM(ASSD):
-   def __convert__(cls,valeur):
-      return valeur
-   __convert__= classmethod(__convert__)
+    def __convert__(cls,valeur):
+        return valeur
+    __convert__= classmethod(__convert__)
 
 class geom(GEOM):
-   pass
+    pass
 
 class CO(ASSD):
-   def __convert__(cls,valeur):
-      if hasattr(valeur,'_etape') :
-         # valeur est un concept CO qui a ete transforme par typeSDProd
-         if valeur.etape == valeur._etape:
-             # le concept est bien produit par l'etape
-             return valeur
-      raise ValError(u"Pas un concept CO")
-   __convert__=classmethod(__convert__)
-
+    def __convert__(cls,valeur):
+        if hasattr(valeur,'_etape') :
+            # valeur est un concept CO qui a ete transforme par typeSDProd
+            if valeur.etape == valeur._etape:
+                # le concept est bien produit par l'etape
+                return valeur
+        raise ValError(u"Pas un concept CO")
+    __convert__=classmethod(__convert__)
index 84fa108d1bc61d4fbc19bdc0ff73eebd93411f2c..068823dae1ff3bd9144afbe5285a8c84a7f70762 100644 (file)
@@ -24,55 +24,54 @@ import types
 
 
 class I_AVANT:
-   """
-      La regle I_AVANT verifie que l'on trouve l ordre  des mots-cles
-      de la regle parmi les arguments d'un JDC.
+    """
+       La regle I_AVANT verifie que l'on trouve l ordre  des mots-cles
+       de la regle parmi les arguments d'un JDC.
 
-      Ces arguments sont transmis a la regle pour validation sous la forme 
-      d'une liste de noms de mots-cles ou d'un dictionnaire dont 
-      les cles sont des noms de mots-cles.
-   """
+       Ces arguments sont transmis a la regle pour validation sous la forme
+       d'une liste de noms de mots-cles ou d'un dictionnaire dont
+       les cles sont des noms de mots-cles.
+    """
 
-   def __init__(self,*args):
-      if len(args) > 2 :
-        print(("Erreur a la creation de la regle A_CLASSER(",args,")"))
-        return
-      if type(args[0]) == tuple:
-        self.listeAvant=args[0]
-      else :
-        self.listeAvant=(args[0],)
-      if type(args[1]) == tuple:
-        self.listeApres=args[1]
-      else :
-        self.listeApres=(args[1],)
+    def __init__(self,*args):
+        if len(args) > 2 :
+            print(("Erreur a la creation de la regle A_CLASSER(",args,")"))
+            return
+        if type(args[0]) == tuple:
+            self.listeAvant=args[0]
+        else :
+            self.listeAvant=(args[0],)
+        if type(args[1]) == tuple:
+            self.listeApres=args[1]
+        else :
+            self.listeApres=(args[1],)
 
-   def verif(self,args):
-      """
-          args peut etre un dictionnaire ou une liste. Les elements de args
-          sont soit les elements de la liste soit les cles du dictionnaire.
-      """
-      #  on compte le nombre de mots cles presents
-      text =''
-      boolListeAvant=0
-      boolListeApres=0
-      boolOK=1
-      for nom in args:
-          if nom in self.listeAvant :
-             boolListeAvant=1
-             if boolListeApres == 1 :
-                boolOK = 0
-          if nom in self.listeApres :
-             boolListeApres=1
-      if boolListeAvant == 0 and boolListeApres == 1 : boolOK = 0
-      return text,boolOK
+    def verif(self,args):
+        """
+            args peut etre un dictionnaire ou une liste. Les elements de args
+            sont soit les elements de la liste soit les cles du dictionnaire.
+        """
+        #  on compte le nombre de mots cles presents
+        text =''
+        boolListeAvant=0
+        boolListeApres=0
+        boolOK=1
+        for nom in args:
+            if nom in self.listeAvant :
+                boolListeAvant=1
+                if boolListeApres == 1 :
+                    boolOK = 0
+            if nom in self.listeApres :
+                boolListeApres=1
+        if boolListeAvant == 0 and boolListeApres == 1 : boolOK = 0
+        return text,boolOK
 
 
-   def getText(self):
-       text = "Regle de classement "' :\n'
-       for mc in self.listeAvant : 
-           text = text + mc + ', '
-       text = text  + " \nAvant : \n" 
-       for mc in self.listeApres : 
-           text = text + mc + ','
-       return text
-
+    def getText(self):
+        text = "Regle de classement "' :\n'
+        for mc in self.listeAvant :
+            text = text + mc + ', '
+        text = text  + " \nAvant : \n"
+        for mc in self.listeApres :
+            text = text + mc + ','
+        return text
index d03f800ea8b34c63b07a054cd55371609be74984..fee92f3aae017b427d01ab762a9dd5b04314269c 100644 (file)
@@ -25,15 +25,14 @@ from __future__ import absolute_import
 from . import I_REGLE
 
 class A_CLASSER(I_REGLE.REGLE):
-  def getText(self):
-    text = 'Regle ' + self.__class__.__name__+ ' :\n'
-    t="  D'abord :\n"+' '*8
-    for arg in self.args0:
-      t=t+arg.strip()+' ou '
-    text = text + t[0:-4] +'\n'
-    t = "  Ensuite :\n"+' '*8
-    for arg in self.args1:
-      t=t+arg.strip()+' ou '
-    text = text + t[0:-4] +'\n'
-    return text
-
+    def getText(self):
+        text = 'Regle ' + self.__class__.__name__+ ' :\n'
+        t="  D'abord :\n"+' '*8
+        for arg in self.args0:
+            t=t+arg.strip()+' ou '
+        text = text + t[0:-4] +'\n'
+        t = "  Ensuite :\n"+' '*8
+        for arg in self.args1:
+            t=t+arg.strip()+' ou '
+        text = text + t[0:-4] +'\n'
+        return text
index 8196d771300fb91a82882fb82e05a2f2df1f65de..97ca3ce1f64ab6bef8d8e6d7a91af5ab762be6bd 100644 (file)
@@ -22,217 +22,57 @@ _no=0
 
 import Accas
 def numberEntite(entite):
-   """
-      Fonction qui attribue un numero unique a tous les objets du catalogue
-      Ce numero permet de conserver l'ordre des objets
-   """
-   global _no
-   _no=_no+1
-   entite._no=_no
+    """
+       Fonction qui attribue un numero unique a tous les objets du catalogue
+       Ce numero permet de conserver l'ordre des objets
+    """
+    global _no
+    _no=_no+1
+    entite._no=_no
 
 class ENTITE:
-  def __init__(self):
-     numberEntite(self)
-    
-  def getDocu(self):
-    if hasattr(self,'docu') :
-      if self.docu != "" : return self.docu
-      else:
-        if hasattr(self,'pere'):
-          return self.pere.getDocu()
+    def __init__(self):
+        numberEntite(self)
+
+    def getDocu(self):
+        if hasattr(self,'docu') :
+            if self.docu != "" : return self.docu
+            else:
+                if hasattr(self,'pere'):
+                    return self.pere.getDocu()
+                else:
+                    return None
         else:
-          return None
-    else:
-      return None
+            return None
 
-  def getSug(self):
-    if hasattr(self,'sug') :
-      if self.sug != "" : return self.sug
-    return None
+    def getSug(self):
+        if hasattr(self,'sug') :
+            if self.sug != "" : return self.sug
+        return None
 
-  def checkDefinition(self, parent):
-      """Verifie la definition d'un objet composite (commande, fact, bloc)."""
-      args = self.entites.copy()
-      mcs = set()
-      for nom, val in args.items():
-         if val.label == 'SIMP':
-            mcs.add(nom)
-            #XXX
-            #if val.max != 1 and val.type == 'TXM':
-                #print "#CMD", parent, nom
-         elif val.label == 'FACT':
-            val.checkDefinition(parent)
-            #PNPNPN surcharge
-            # CALC_SPEC !
-            #assert self.label != 'FACT', \
-            #   'Commande %s : Mot-clef facteur present sous un mot-clef facteur : interdit !' \
-            #   % parent
-         else:
-            continue
-         del args[nom]
-      # seuls les blocs peuvent entrer en conflit avec les mcs du plus haut niveau
-      for nom, val in args.items():
-         if val.label == 'BLOC':
-            mcbloc = val.checkDefinition(parent)
-            #XXX
-            #print "#BLOC", parent, re.sub('\s+', ' ', val.condition)
-            #assert mcs.isdisjoint(mcbloc), "Commande %s : Mot(s)-clef(s) vu(s) plusieurs fois : %s" \
-            #   % (parent, tuple(mcs.intersection(mcbloc)))
-      return mcs
+    def checkDefinition(self, parent):
+        """Verifie la definition d'un objet composite (commande, fact, bloc)."""
+        args = self.entites.copy()
+        mcs = set()
+        for nom, val in args.items():
+            if val.label == 'SIMP':
+                mcs.add(nom)
+                #if val.max != 1 and val.type == 'TXM':
+                    #print "#CMD", parent, nom
+            elif val.label == 'FACT':
+                val.checkDefinition(parent)
+            else:
+                continue
+            del args[nom]
+        # seuls les blocs peuvent entrer en conflit avec les mcs du plus haut niveau
+        for nom, val in args.items():
+            if val.label == 'BLOC':
+                mcbloc = val.checkDefinition(parent)
+                #print "#BLOC", parent, re.sub('\s+', ' ', val.condition)
+                #assert mcs.isdisjoint(mcbloc), "Commande %s : Mot(s)-clef(s) vu(s) plusieurs fois : %s" \
+                #   % (parent, tuple(mcs.intersection(mcbloc)))
+        return mcs
 
-#  def enregistreXML(self,root,catalogueXml):
-#      import xml.etree.ElementTree as ET
-#      import types
-#      moi=ET.SubElement(root,str(self.__class__))
-#      nom=ET.SubElement(moi,'nom')
-#      nom.text=self.nom
-#
-#      if hasattr(self,'validators') and (self.validators != () and self.validators != None):
-#         valid=ET.SubElement(moi,'validators')
-#         valid.text= str(self.validators.__class__)
-#         catalogueXml.validatorsUtilises.append(self.validators)
-#
-#      if hasattr(self,'regles') and (self.regles !=() and self.regles != None):
-#         for regle in self.regles:
-#             regle.enregistreXML(moi,catalogueXml)
-#         catalogueXml.reglesUtilisees.append(self.regles)
-#
-#      if ((self.getDocu() !="" and self.getDocu() !=None) or  \
-#          (self.fr != "" and self.fr != None) or \
-#          (self.ang != "" and self.ang != None) ):
-#                dico={}
-#                if self.getDocu() !=None : dico["docu"]=self.getDocu()
-#                if self.fr != None        : dico["fr"]=six.text_type(self.fr,"iso-8859-1")
-#                if self.ang != None       : dico["ang"]=self.ang
-#                doc=ET.SubElement(moi,'doc')
-#                doc.attrib=dico
-#
-#      if ((self.getSug() !=None) or  \
-#          (hasattr(self,'defaut') and (self.defaut != None) and (self.defaut != 'None'))) :
-#                # il faut ajouter des sug dans le catalogue
-#                # les attributs sont  toujours du texte 
-#                dico={}
-#                if (self.defaut != None) and (self.defaut != 'None') :
-#                    if isinstance(self.defaut,str ) : dico["defaut"]=six.text_type(self.defaut,"iso-8859-1")
-#                    else :dico["defaut"]=str(self.defaut)
-#                if self.getSug() !=None:
-#                    if isinstance(self.getSug(),str ) : dico["sug"]=six.text_type(self.getSug(),"iso-8859-1")
-#                    else :dico["sug"]=str(self.getSug())
-#                
-#                doc=ET.SubElement(moi,'ValeurDef')
-#                doc.attrib=dico
-#
-#      dico={}
-#      if hasattr(self,'into') and self.into!=None: dico['into']=str(self.into)
-#      if hasattr(self,'val_max') and self.val_max != "**" : dico['max']=str(self.val_max)
-#      if hasattr(self,'val_min') and self.val_min != "**" : dico['min']=str(self.val_min)
-#      if dico != {} :
-#           PV=ET.SubElement(moi,'PlageValeur')
-#           PV.attrib=dico
-#
-#      dico={}
-#      if hasattr(self,'max')  and self.max != 1 : dico['max']=str(self.max)
-#      if hasattr(self,'min')  and self.min != 1 : dico['max']=str(self.min)
-#      if dico != {} :
-#           Card=ET.SubElement(moi,'Cardinalite')
-#           Card.attrib=dico
-#
-#      dico={}
-#      if hasattr(self,'reentrant') and self.reentrant not in ('f','n') : dico['reentrant']=str(self.reentrant)
-#      if hasattr(self,'position') and self.position != "local": dico['position']=str(self.position)
-#      if hasattr(self,'homo') and self.homo != 1 : dico['homogene']=str(self.homo)
-#      if hasattr(self,'statut') : dico['statut']=str(self.statut)
-#      if hasattr(self,'repetable') : dico['repetable']=str(self.repetable)
-#      if dico != {} :
-#           pos=ET.SubElement(moi,'situation')
-#           pos.attrib=dico
-#
-#      if hasattr(self,'type') and self.type != ():
-#         typeAttendu=ET.SubElement(moi,'typeAttendu')
-#         l=[]
-#         for t in self.type:
-#             if type(t) == type : l.append(t.__name__)
-#             else : l.append(t)
-#         typeAttendu.text=str(l)
-#
-#      if hasattr(self,'sd_prod') and self.sd_prod != () and self.sd_prod !=None:
-#         typeCree=ET.SubElement(moi,'typeCree')
-#         typeCree.text=str(self.sd_prod.__name__) 
-# 
-#      if hasattr(self,'op') and self.op !=None  : 
-#         subRoutine=ET.SubElement(moi,'subRoutine')
-#         subRoutine.text=str(self.op)
-#
-#      if hasattr(self,'proc') and self.proc != None : 
-#         construction=ET.SubElement(moi,'Construction')
-#         construction.text=self.proc.uri
-#
-#      for nomFils, fils in self.entites.items() :
-#          fils.enregistreXML(moi,catalogueXml)
-#      
-#  def enregistreXMLStructure(self,root,catalogueXml):
-#      import xml.etree.ElementTree as ET
-#      import types
-#      moi=ET.SubElement(root,str(self.__class__))
-#
-#      if hasattr(self,'into') and self.into!=None: 
-#          INTO=ET.SubElement(moi,'into')
-#          INTO.text='into'
-#
-#      dico={}
-#      if hasattr(self,'val_max') and self.val_max != "**" : dico['max']=str(self.val_max)
-#      if hasattr(self,'val_min') and self.val_min != "**" : dico['min']=str(self.val_min)
-#      if dico != {} :
-#           PV=ET.SubElement(moi,'maxOrMin')
-#           PV.text='maxOrMin'
-#
-#      dico={}
-#      if hasattr(self,'max')  and self.max != 1 : dico['max']=str(self.max)
-#      if hasattr(self,'min')  and self.min != 1 : dico['max']=str(self.min)
-#      if dico != {} :
-#           Card=ET.SubElement(moi,'liste')
-#           Card.text="liste"
-#
-#      dico={}
-#      if hasattr(self,'statut') and self.statut=="f" :
-#         statut=ET.SubElement(moi,'facultatif')
-#         statut.text='facultatif'
-#      if hasattr(self,'statut') and self.statut !="f" :
-#         statut=ET.SubElement(moi,'obligatoire')
-#         statut.text='obligatoire'
-#
-#      if hasattr(self,'type') and self.type != ():
-#        try :
-#           if 'Fichier' in self.type : ty=ET.SubElement(moi,'Fichier')
-#           ty.text='type'
-#        except :
-#           try :
-#             if 'Repertoire' in self.type : ty=ET.SubElement(moi,'Repertoire')
-#             ty.text='type'
-#           except :
-#              for t in self.type:
-#                if t == "I" : ty=ET.SubElement(moi,'typeEntier')
-#                elif t == "R" : ty=ET.SubElement(moi,'typeReel')
-#                elif t == "TXM" : ty=ET.SubElement(moi,'typeTXM')
-#                else :
-#                  try :
-#                    ty=ET.SubElement(moi,t.__name__) 
-#                  except :
-#                    ty=ET.SubElement(moi,'autre') 
-#                ty.text='type'
-#
-#      if hasattr(self,'sd_prod') and self.sd_prod != () and self.sd_prod !=None:
-#         typeCree=ET.SubElement(moi,'typeCree')
-#         typeCree.text='sd_prod'
-# 
-#      if hasattr(self,'op') and self.op !=None  : 
-#         subRoutine=ET.SubElement(moi,'subRoutine')
-#         subRoutine.text='op'
-#
-#      if hasattr(self,'proc') and self.proc != None : 
-#         construction=ET.SubElement(moi,'Construction')
-#         construction.text='proc'
 #
-#      for nomFils, fils in self.entites.items() :
-#          fils.enregistreXMLStructure(moi,catalogueXml)
-#      
+    def UQPossible(self):
+        return True
index d97ec4a23b71269e4bd5494f9d2da65dc3c8e5b5..31172dd21759a51f4fe426c9414efe8cf7b861eb 100644 (file)
@@ -47,462 +47,461 @@ from Extensions import commande_comm
 
 class ETAPE(I_MCCOMPO.MCCOMPO):
 
-   def ident(self):
-      return self.nom
-
-   def getSdname(self):
-      #print "SDNAME ",self.reuse,self.sd,self.sd.getName()
-      if CONTEXT.debug : 
-          print(("SDNAME ",  self.reuse,  self.sd,  self.sd.getName()))
-      sdname=''
-      if self.reuse != None:
-        sdname= self.reuse.getName()
-      else:
-        if self.sd:sdname=self.sd.getName()
-      if sdname.find('sansnom') != -1 or sdname.find('SD_') != -1:
-        # dans le cas ou la SD est 'sansnom' ou 'SD_' on retourne la chaine vide
-        return ''
-      return sdname
-
-   def isReentrant(self):
-      """ 
-          Indique si la commande est reentrante
-      """
-      return self.definition.reentrant == 'o' 
-
-   def initModif(self):
-      """
-         Met l'etat de l'etape a : modifie
-         Propage la modification au parent
-      """
-      # initModif doit etre appele avant de realiser une modification
-      # La validite devra etre recalculee apres cette modification
-      # mais dans l'appel a finModif pour preserver l'etat modified
-      # de tous les objets entre temps
-      #print "initModif",self,self.parent
-      self.state = 'modified'
-      if self.parent:
-        self.parent.initModif()
-
-   def finModif(self):
-      """
-          Methode appelee une fois qu'une modification a ete faite afin de 
-          declencher d'eventuels traitements post-modification
-          ex : INCLUDE et POURSUITE
-          Ne pas mettre de traitement qui risque d'induire des recursions (soit a peu pres rien)
-      """
-      CONNECTOR.Emit(self,"valid")
-      if self.parent:
-        self.parent.finModif()
-
-   def nommeSd(self,nom) :
-      """
-          Cette methode a pour fonction de donner un nom (nom) au concept 
-          produit par l'etape (self).
-            - si le concept n'existe pas, on essaye de le creer a condition que l'etape soit valide ET non reentrante)
-            - si il existe dea, on le renomme et on repercute les changements dans les autres etapes    
-          Les valeurs de retour sont :
-            - 0 si le nommage n'a pas pu etre menea son terme,
-            - 1 dans le cas contraire
-      """
-      # Le nom d'un concept doit etre un identificateur Python (toujours vrai ou insuffisant?)
-      if not conceptRE.match(nom):
-         return 0, tr("Un nom de concept doit etre un identificateur Python")
-
-      # pour eviter que le nom du concept soit le nom de la classe --> souci pour utiliser le concept
-      if (nom == self.definition.nom) : return  (0, tr("un concept de type ")+ nom + tr(" ne peut pas se nommer ") +  nom)
-      if ( nom in dir(self.jdc.cata)) : return (0, nom + tr("est un not reserve"))
-      #if (not isinstance(nom,str)) : return (0, tr("Le nom ") + nom + tr(" est un mot reserve"))
-      #if len(nom) > 8 and self.jdc.definition.code == 'ASTER':
-      #  return 0, tr("Nom de concept trop long (maxi 8 caracteres)")
-
-      self.initModif()
-      #
-      # On verifie d'abord si les mots cles sont valides
-      #
-      if not self.isValid(sd='non') : return 0,"Nommage du concept refuse : l'operateur n'est pas valide"
-      #
-      # Cas particulier des operateurs obligatoirement reentrants
-      # plus de concept reentrant (pour Aster)
-      #
-      if self.definition.reentrant == 'o':
-        self.sd = self.reuse = self.jdc.getSdAvantEtape(nom,self)
-        if self.sd != None :
-          self.sdnom=self.sd.nom
-          self.finModif()
-          return 1, tr("Concept existant")
+    def ident(self):
+        return self.nom
+
+    def getSdname(self):
+        #print "SDNAME ",self.reuse,self.sd,self.sd.getName()
+        if CONTEXT.debug :
+            print(("SDNAME ",  self.reuse,  self.sd,  self.sd.getName()))
+        sdname=''
+        if self.reuse != None:
+            sdname= self.reuse.getName()
         else:
-          return 0, tr("Operateur reentrant mais concept non existant")
-      #
-      # Cas particulier des operateurs facultativement reentrants
-      #
-      old_reuse=None
-      if self.definition.reentrant == 'f' :
-        sd = self.jdc.getSdAvantEtape(nom,self)
-        if sd != None :
-          if isinstance(sd,self.getType_produit()) :
-             self.sd = self.reuse = sd
-             self.sdnom = sd.nom
-             self.finModif()
-             return 1, tr("Operateur reentrant et concept existant trouve")
-          else:
-             return 0, tr("Concept deja existant et de mauvais type")
-        else :
-          # il faut enlever le lien vers une SD existante car si on passe ici
-          # cela signifie que l'operateur n'est pas utilise en mode reentrant.
-          # Si on ne fait pas cela, on risque de modifier une SD produite par un autre operateur
-          if self.reuse :
-             old_reuse=self.reuse
-             self.sd = self.reuse = self.sdnom = None
-      #
-      # On est dans le cas ou l'operateur n'est pas reentrant ou est facultativement reentrant
-      # mais est utilise en mode non reentrant
-      #
-      if self.sd == None :
-          #Pas de concept produit preexistant
-          if self.parent.getSdAutourEtape(nom,self):
-            # Un concept de ce nom existe dans le voisinage de l'etape courante
-            # On retablit l'ancien concept reentrant s'il existait
-            if old_reuse:
-               self.sd=self.reuse=old_reuse
-               self.sdnom=old_reuse.nom
-            return 0, tr("Nommage du concept refuse : un concept de meme nom existe deja")
-          else:
-            # Il n'existe pas de concept de ce nom dans le voisinage de l'etape courante
-            # On peut donc creer le concept retourne
-            # Il est cree sans nom mais enregistre dans la liste des concepts existants
-            try:
-               self.getSdProd()
-               # Renommage du concept : Il suffit de changer son attribut nom pour le nommer
-               self.sd.nom = nom
-               self.sdnom=nom
-               self.parent.sdsDict[nom]=self.sd
-               self.parent.updateConceptAfterEtape(self,self.sd)
-               self.finModif()
-               return 1, tr("Nommage du concept effectue")
-            except:
-               return 0, tr("Nommage impossible %s", str(sys.exc_info()[1]))
-      else :
-          #Un concept produit preexiste
-          old_nom=self.sd.nom
-          if old_nom.find('sansnom') :
-            # Dans le cas ou old_nom == sansnom, isValid retourne 0 alors que ...
-            # par contre si le concept existe et qu'il s'appelle sansnom c'est que l'etape est valide
-            # on peut donc le nommer sans test prealable
-            if self.parent.getSdAutourEtape(nom,self):
-              return 0, tr("Nommage du concept refuse : un concept de meme nom existe deja")
+            if self.sd:sdname=self.sd.getName()
+        if sdname.find('sansnom') != -1 or sdname.find('SD_') != -1:
+            # dans le cas ou la SD est 'sansnom' ou 'SD_' on retourne la chaine vide
+            return ''
+        return sdname
+
+    def isReentrant(self):
+        """
+            Indique si la commande est reentrante
+        """
+        return self.definition.reentrant == 'o'
+
+    def initModif(self):
+        """
+           Met l'etat de l'etape a : modifie
+           Propage la modification au parent
+        """
+        # initModif doit etre appele avant de realiser une modification
+        # La validite devra etre recalculee apres cette modification
+        # mais dans l'appel a finModif pour preserver l'etat modified
+        # de tous les objets entre temps
+        #print "initModif",self,self.parent
+        self.state = 'modified'
+        if self.parent:
+            self.parent.initModif()
+
+    def finModif(self):
+        """
+            Methode appelee une fois qu'une modification a ete faite afin de
+            declencher d'eventuels traitements post-modification
+            ex : INCLUDE et POURSUITE
+            Ne pas mettre de traitement qui risque d'induire des recursions (soit a peu pres rien)
+        """
+        CONNECTOR.Emit(self,"valid")
+        if self.parent:
+            self.parent.finModif()
+
+    def nommeSd(self,nom) :
+        """
+            Cette methode a pour fonction de donner un nom (nom) au concept
+            produit par l'etape (self).
+              - si le concept n'existe pas, on essaye de le creer a condition que l'etape soit valide ET non reentrante)
+              - si il existe dea, on le renomme et on repercute les changements dans les autres etapes
+            Les valeurs de retour sont :
+              - 0 si le nommage n'a pas pu etre menea son terme,
+              - 1 dans le cas contraire
+        """
+        # Le nom d'un concept doit etre un identificateur Python (toujours vrai ou insuffisant?)
+        if not conceptRE.match(nom):
+            return 0, tr("Un nom de concept doit etre un identificateur Python")
+
+        # pour eviter que le nom du concept soit le nom de la classe --> souci pour utiliser le concept
+        if (nom == self.definition.nom) : return  (0, tr("un concept de type ")+ nom + tr(" ne peut pas se nommer ") +  nom)
+        if ( nom in dir(self.jdc.cata)) : return (0, nom + tr("est un not reserve"))
+        #if (not isinstance(nom,str)) : return (0, tr("Le nom ") + nom + tr(" est un mot reserve"))
+        #if len(nom) > 8 and self.jdc.definition.code == 'ASTER':
+        #  return 0, tr("Nom de concept trop long (maxi 8 caracteres)")
+
+        self.initModif()
+        #
+        # On verifie d'abord si les mots cles sont valides
+        #
+        if not self.isValid(sd='non') : return 0,"Nommage du concept refuse : l'operateur n'est pas valide"
+        #
+        # Cas particulier des operateurs obligatoirement reentrants
+        # plus de concept reentrant (pour Aster)
+        #
+        if self.definition.reentrant == 'o':
+            self.sd = self.reuse = self.jdc.getSdAvantEtape(nom,self)
+            if self.sd != None :
+                self.sdnom=self.sd.nom
+                self.finModif()
+                return 1, tr("Concept existant")
             else:
-              # Renommage du concept : Il suffit de changer son attribut nom pour le nommer
-              self.sd.nom=nom
-              self.sdnom=nom
-              self.parent.updateConceptAfterEtape(self,self.sd)
-              self.finModif()
-              return 1, tr("Nommage du concept effectue")
-          if self.isValid() :
-            # Normalement l appel de isValid a mis a jour le concept produit (son type)
-            # Il suffit de specifier l attribut nom de sd pour le nommer si le nom n est pas
-            # deja attribue
+                return 0, tr("Operateur reentrant mais concept non existant")
+        #
+        # Cas particulier des operateurs facultativement reentrants
+        #
+        old_reuse=None
+        if self.definition.reentrant == 'f' :
+            sd = self.jdc.getSdAvantEtape(nom,self)
+            if sd != None :
+                if isinstance(sd,self.getType_produit()) :
+                    self.sd = self.reuse = sd
+                    self.sdnom = sd.nom
+                    self.finModif()
+                    return 1, tr("Operateur reentrant et concept existant trouve")
+                else:
+                    return 0, tr("Concept deja existant et de mauvais type")
+            else :
+                # il faut enlever le lien vers une SD existante car si on passe ici
+                # cela signifie que l'operateur n'est pas utilise en mode reentrant.
+                # Si on ne fait pas cela, on risque de modifier une SD produite par un autre operateur
+                if self.reuse :
+                    old_reuse=self.reuse
+                    self.sd = self.reuse = self.sdnom = None
+        #
+        # On est dans le cas ou l'operateur n'est pas reentrant ou est facultativement reentrant
+        # mais est utilise en mode non reentrant
+        #
+        if self.sd == None :
+                #Pas de concept produit preexistant
             if self.parent.getSdAutourEtape(nom,self):
-              return 0, tr("Nommage du concept refuse : un concept de meme nom existe deja")
+                # Un concept de ce nom existe dans le voisinage de l'etape courante
+                # On retablit l'ancien concept reentrant s'il existait
+                if old_reuse:
+                    self.sd=self.reuse=old_reuse
+                    self.sdnom=old_reuse.nom
+                return 0, tr("Nommage du concept refuse : un concept de meme nom existe deja")
             else:
-              # Renommage du concept : Il suffit de changer son attribut nom pour le nommer
-              self.sd.nom=nom
-              self.sdnom=nom
-              self.parent.updateConceptAfterEtape(self,self.sd)
-              self.finModif()
-              return 1, tr("Nommage du concept effectue")
-          else:
-            # Normalement on ne devrait pas passer ici
-            return 0, 'Normalement on ne devrait pas passer ici'
-
-   def getSdprods(self,nom_sd):
-      """ 
-         Fonction : retourne le concept produit par l etape de nom nom_sd
-         s il existe sinon None
-      """
-      if self.sd:
-        if self.sd.nom == nom_sd:return self.sd
-
-   def active(self):
-      """
-          Rend l'etape courante active.
-          Il faut ajouter la sd si elle existe au contexte global du JDC
-          et a la liste des sd
-      """
-      if self.actif:return
-      self.actif = 1
-      self.initModif()
-      if self.sd :
-        try:
-          self.jdc.appendSdProd(self.sd)
-        except:
-          pass
-      CONNECTOR.Emit(self,"add",None)
-      CONNECTOR.Emit(self,"valid")
-
-   def inactive(self):
-      """
-          Rend l'etape courante inactive
-          Il faut supprimer la sd du contexte global du JDC
-          et de la liste des sd
-      """
-      self.actif = 0
-      self.initModif()
-      if self.sd :
-         self.jdc.delSdprod(self.sd)
-         self.jdc.deleteConceptAfterEtape(self,self.sd)
-      CONNECTOR.Emit(self,"supp",None)
-      CONNECTOR.Emit(self,"valid")
-
-   def controlSdprods(self,d):
-      """
-          Cette methode doit verifier que ses concepts produits ne sont pas
-          deja definis dans le contexte
-          Si c'est le cas, les concepts produits doivent etre supprimes
-      """
-      print ("controlSdprods etape",d.keys(),self.sd and self.sd.nom,self.nom)
-      if self.sd:
-        if self.sd.nom in d :
-           # Le concept est deja defini
-           if self.reuse and self.reuse is d[self.sd.nom]:
-              # Le concept est reutilise : situation normale
-              pass
-           else:
-              # Redefinition du concept, on l'annule
-              #XXX on pourrait simplement annuler son nom pour conserver les objets
-              # l'utilisateur n'aurait alors qu'a renommer le concept (faisable??)
-              self.initModif()
-              sd=self.sd
-              self.sd=self.reuse=self.sdnom=None
-              #supprime les references a sd dans les etapes suivantes
-              self.parent.deleteConceptAfterEtape(self,sd)
-              self.finModif()
-
-   def supprimeSdprod(self,sd):
-      """
-         Supprime le concept produit sd s'il est produit par l'etape
-      """
-      if sd is not self.sd:return
-      if self.sd != None :
-         self.initModif()
-         self.parent.delSdprod(sd)
-         self.sd=None
-         self.finModif()
-         self.parent.deleteConcept(sd)
-
-   def supprimeSdProds(self):
-      """ 
-            Fonction:
-            Lors d'une destruction d'etape, detruit tous les concepts produits
-            Un operateur n a qu un concept produit 
-            Une procedure n'en a aucun
-            Une macro en a en general plus d'un
-      """
-      self.deleteRef()
-      #print "supprimeSdProds",self
-      if self.reuse is self.sd :return
-      # l'etape n'est pas reentrante
-      # le concept retourne par l'etape est a supprimer car il etait 
-      # cree par l'etape
-      if self.sd != None :
-         self.parent.delSdprod(self.sd)
-         self.parent.deleteConcept(self.sd)
-
-   def close(self):
-      return
-
-   def updateConcept(self,sd):
-      for child in self.mcListe :
-          child.updateConcept(sd)
-
-   def deleteConcept(self,sd):
-      """ 
-          Inputs :
-             - sd=concept detruit
-          Fonction :
-          Mettre a jour les mots cles de l etape et eventuellement 
-          le concept produit si reuse
-          suite a la disparition du concept sd
-          Seuls les mots cles simples MCSIMP font un traitement autre 
-          que de transmettre aux fils
-      """
-      if self.reuse and self.reuse == sd:
-        self.sd=self.reuse=None
+                # Il n'existe pas de concept de ce nom dans le voisinage de l'etape courante
+                # On peut donc creer le concept retourne
+                # Il est cree sans nom mais enregistre dans la liste des concepts existants
+                try:
+                    self.getSdProd()
+                    # Renommage du concept : Il suffit de changer son attribut nom pour le nommer
+                    self.sd.nom = nom
+                    self.sdnom=nom
+                    self.parent.sdsDict[nom]=self.sd
+                    self.parent.updateConceptAfterEtape(self,self.sd)
+                    self.finModif()
+                    return 1, tr("Nommage du concept effectue")
+                except:
+                    return 0, tr("Nommage impossible %s", str(sys.exc_info()[1]))
+        else :
+            #Un concept produit preexiste
+            old_nom=self.sd.nom
+            if old_nom.find('sansnom') :
+                # Dans le cas ou old_nom == sansnom, isValid retourne 0 alors que ...
+                # par contre si le concept existe et qu'il s'appelle sansnom c'est que l'etape est valide
+                # on peut donc le nommer sans test prealable
+                if self.parent.getSdAutourEtape(nom,self):
+                    return 0, tr("Nommage du concept refuse : un concept de meme nom existe deja")
+                else:
+                    # Renommage du concept : Il suffit de changer son attribut nom pour le nommer
+                    self.sd.nom=nom
+                    self.sdnom=nom
+                    self.parent.updateConceptAfterEtape(self,self.sd)
+                    self.finModif()
+                    return 1, tr("Nommage du concept effectue")
+            if self.isValid() :
+                # Normalement l appel de isValid a mis a jour le concept produit (son type)
+                # Il suffit de specifier l attribut nom de sd pour le nommer si le nom n est pas
+                # deja attribue
+                if self.parent.getSdAutourEtape(nom,self):
+                    return 0, tr("Nommage du concept refuse : un concept de meme nom existe deja")
+                else:
+                    # Renommage du concept : Il suffit de changer son attribut nom pour le nommer
+                    self.sd.nom=nom
+                    self.sdnom=nom
+                    self.parent.updateConceptAfterEtape(self,self.sd)
+                    self.finModif()
+                    return 1, tr("Nommage du concept effectue")
+            else:
+                # Normalement on ne devrait pas passer ici
+                return 0, 'Normalement on ne devrait pas passer ici'
+
+    def getSdprods(self,nom_sd):
+        """
+           Fonction : retourne le concept produit par l etape de nom nom_sd
+           s il existe sinon None
+        """
+        if self.sd:
+            if self.sd.nom == nom_sd:return self.sd
+
+    def active(self):
+        """
+            Rend l'etape courante active.
+            Il faut ajouter la sd si elle existe au contexte global du JDC
+            et a la liste des sd
+        """
+        if self.actif:return
+        self.actif = 1
         self.initModif()
-      for child in self.mcListe :
-        child.deleteConcept(sd)
-
-   def replaceConcept(self,old_sd,sd):
-      """
-          Inputs :
-             - old_sd=concept remplace
-             - sd = nouveau concept 
-          Fonction :
-          Mettre a jour les mots cles de l etape et eventuellement
-          le concept produit si reuse
-          suite au remplacement  du concept old_sd
-      """
-      if self.reuse and self.reuse == old_sd:
-        self.sd=self.reuse=sd
+        if self.sd :
+            try:
+                self.jdc.appendSdProd(self.sd)
+            except:
+                pass
+        CONNECTOR.Emit(self,"add",None)
+        CONNECTOR.Emit(self,"valid")
+
+    def inactive(self):
+        """
+            Rend l'etape courante inactive
+            Il faut supprimer la sd du contexte global du JDC
+            et de la liste des sd
+        """
+        self.actif = 0
         self.initModif()
-      for child in self.mcListe :
-        child.replaceConcept(old_sd,sd)
-
-   def resetContext(self):
-      pass
-
-   def getNomsSdOperReentrant(self):
-      """ 
-          Retourne la liste des noms de concepts utilisesa l'interieur de la commande
-          qui sont du type que peut retourner cette commande 
-      """
-      liste_sd = self.getSd_utilisees()
-      l_noms = []
-      if type(self.definition.sd_prod) == types.FunctionType:
-        d=self.creeDictValeurs(self.mcListe)
-        try:
-          classe_sd_prod = self.definition.sd_prod(*(), **d)
-        except:
-          return []
-      else:
-        classe_sd_prod = self.definition.sd_prod
-      for sd in liste_sd :
-        if sd.__class__ is classe_sd_prod : l_noms.append(sd.nom)
-      l_noms.sort()
-      return l_noms
-
-   def getGenealogiePrecise(self):
-      return [self.nom]
-
-   def getNomDsXML(self):
-     # en xml on a un choice 
-     index=0
-     for e in self.parent.etapes :
-         if e == self : break
-         if e.nom == self.nom : index+=1
-     nomDsXML = self.nom + "[" + str(index) + "]"
-     return nomDsXML
-
-
-   def getGenealogie(self):
-      """ 
-          Retourne la liste des noms des ascendants de l'objet self
-          en s'arretant a la premiere ETAPE rencontree
-      """
-      return [self.nom]
-
-   def verifExistenceSd(self):
-     """
-        Verifie que les structures de donnees utilisees dans self existent bien dans le contexte
-        avant etape, sinon enleve la referea ces concepts
-     """
-     #print "verifExistenceSd",self.sd
-     for motcle in self.mcListe :
-         motcle.verifExistenceSd()
-
-   def updateMcGlobal(self):
-     """
-        Met a jour les mots cles globaux enregistres dans l'etape
-        et dans le jdc parent.
-        Une etape ne peut pas etre globale. Elle se contente de passer
-        la requete a ses fils apres avoir reinitialise le dictionnaire 
-        des mots cles globaux.
-     """
-     self.mc_globaux={}
-     I_MCCOMPO.MCCOMPO.updateMcGlobal(self)
-
-   def updateConditionBloc(self):
-     """
-        Realise l'update des blocs conditionnels fils de self
-     """
-     self._updateConditionBloc()
-
-   def getObjetCommentarise(self,format):
-      """
-          Cette methode retourne un objet commande commentarisee
-          representant la commande self
-      """
-      import generator
-      g=generator.plugins[format]()
-      texte_commande = g.gener(self,format='beautifie')
-      # Il faut enlever la premiere ligne vide de texte_commande que
-      # rajoute le generator
-      # on construit l'objet COMMANDE_COMM repesentatif de self mais non
-      # enregistre dans le jdc (pas ajoute dans jdc.etapes)
-      parent=self.parent
-      pos=self.parent.etapes.index(self)
-      # on ajoute une fin Ã  la commande pour pouvoir en commenter 2
-      texte_commande+='\nFin Commentaire'
-      commande_comment = commande_comm.COMMANDE_COMM(texte=texte_commande,
-                                                     reg='non',
-                                                     parent=parent)
-      self.parent.suppEntite(self)
-      parent.addEntite(commande_comment,pos)
-
-      return commande_comment
-
-   def modified(self):
-      """Le contenu de l'etape (mots cles, ...) a ete modifie"""
-      if self.nom=="DETRUIRE":
-        self.parent.controlContextApres(self)
-
-
-     
+        if self.sd :
+            self.jdc.delSdprod(self.sd)
+            self.jdc.deleteConceptAfterEtape(self,self.sd)
+        CONNECTOR.Emit(self,"supp",None)
+        CONNECTOR.Emit(self,"valid")
+
+    def controlSdprods(self,d):
+        """
+            Cette methode doit verifier que ses concepts produits ne sont pas
+            deja definis dans le contexte
+            Si c'est le cas, les concepts produits doivent etre supprimes
+        """
+        #print ("controlSdprods etape",d.keys(),self.sd and self.sd.nom,self.nom)
+        if self.sd:
+            if self.sd.nom in d :
+                # Le concept est deja defini
+                if self.reuse and self.reuse is d[self.sd.nom]:
+                    # Le concept est reutilise : situation normale
+                    pass
+                else:
+                    # Redefinition du concept, on l'annule
+                    #XXX on pourrait simplement annuler son nom pour conserver les objets
+                    # l'utilisateur n'aurait alors qu'a renommer le concept (faisable??)
+                    self.initModif()
+                    sd=self.sd
+                    self.sd=self.reuse=self.sdnom=None
+                    #supprime les references a sd dans les etapes suivantes
+                    self.parent.deleteConceptAfterEtape(self,sd)
+                    self.finModif()
+
+    def supprimeSdprod(self,sd):
+        """
+           Supprime le concept produit sd s'il est produit par l'etape
+        """
+        if sd is not self.sd:return
+        if self.sd != None :
+            self.initModif()
+            self.parent.delSdprod(sd)
+            self.sd=None
+            self.finModif()
+            self.parent.deleteConcept(sd)
+
+    def supprimeSdProds(self):
+        """
+              Fonction:
+              Lors d'une destruction d'etape, detruit tous les concepts produits
+              Un operateur n a qu un concept produit
+              Une procedure n'en a aucun
+              Une macro en a en general plus d'un
+        """
+        self.deleteRef()
+        #print "supprimeSdProds",self
+        if self.reuse is self.sd :return
+        # l'etape n'est pas reentrante
+        # le concept retourne par l'etape est a supprimer car il etait
+        # cree par l'etape
+        if self.sd != None :
+            self.parent.delSdprod(self.sd)
+            self.parent.deleteConcept(self.sd)
+
+    def close(self):
+        return
+
+    def updateConcept(self,sd):
+        for child in self.mcListe :
+            child.updateConcept(sd)
+
+    def deleteConcept(self,sd):
+        """
+            Inputs :
+               - sd=concept detruit
+            Fonction :
+            Mettre a jour les mots cles de l etape et eventuellement
+            le concept produit si reuse
+            suite a la disparition du concept sd
+            Seuls les mots cles simples MCSIMP font un traitement autre
+            que de transmettre aux fils
+        """
+        if self.reuse and self.reuse == sd:
+            self.sd=self.reuse=None
+            self.initModif()
+        for child in self.mcListe :
+            child.deleteConcept(sd)
+
+    def replaceConcept(self,old_sd,sd):
+        """
+            Inputs :
+               - old_sd=concept remplace
+               - sd = nouveau concept
+            Fonction :
+            Mettre a jour les mots cles de l etape et eventuellement
+            le concept produit si reuse
+            suite au remplacement  du concept old_sd
+        """
+        if self.reuse and self.reuse == old_sd:
+            self.sd=self.reuse=sd
+            self.initModif()
+        for child in self.mcListe :
+            child.replaceConcept(old_sd,sd)
+
+    def resetContext(self):
+        pass
+
+    def getNomsSdOperReentrant(self):
+        """
+            Retourne la liste des noms de concepts utilisesa l'interieur de la commande
+            qui sont du type que peut retourner cette commande
+        """
+        liste_sd = self.getSd_utilisees()
+        l_noms = []
+        if type(self.definition.sd_prod) == types.FunctionType:
+            d=self.creeDictValeurs(self.mcListe)
+            try:
+                classe_sd_prod = self.definition.sd_prod(*(), **d)
+            except:
+                return []
+        else:
+            classe_sd_prod = self.definition.sd_prod
+        for sd in liste_sd :
+            if sd.__class__ is classe_sd_prod : l_noms.append(sd.nom)
+        l_noms.sort()
+        return l_noms
+
+    def getGenealogiePrecise(self):
+        return [self.nom]
+
+    def getNomDsXML(self):
+        # en xml on a un choice
+        index=0
+        for e in self.parent.etapes :
+            if e == self : break
+            if e.nom == self.nom : index+=1
+        nomDsXML = self.nom + "[" + str(index) + "]"
+        return nomDsXML
+
+
+    def getGenealogie(self):
+        """
+            Retourne la liste des noms des ascendants de l'objet self
+            en s'arretant a la premiere ETAPE rencontree
+        """
+        return [self.nom]
+
+    def verifExistenceSd(self):
+        """
+           Verifie que les structures de donnees utilisees dans self existent bien dans le contexte
+           avant etape, sinon enleve la referea ces concepts
+        """
+        #print "verifExistenceSd",self.sd
+        for motcle in self.mcListe :
+            motcle.verifExistenceSd()
+
+    def updateMcGlobal(self):
+        """
+           Met a jour les mots cles globaux enregistres dans l'etape
+           et dans le jdc parent.
+           Une etape ne peut pas etre globale. Elle se contente de passer
+           la requete a ses fils apres avoir reinitialise le dictionnaire
+           des mots cles globaux.
+        """
+        self.mc_globaux={}
+        I_MCCOMPO.MCCOMPO.updateMcGlobal(self)
+
+    def updateConditionBloc(self):
+        """
+           Realise l'update des blocs conditionnels fils de self
+        """
+        self._updateConditionBloc()
+
+    def getObjetCommentarise(self,format):
+        """
+            Cette methode retourne un objet commande commentarisee
+            representant la commande self
+        """
+        import generator
+        g=generator.plugins[format]()
+        texte_commande = g.gener(self,format='beautifie')
+        # Il faut enlever la premiere ligne vide de texte_commande que
+        # rajoute le generator
+        # on construit l'objet COMMANDE_COMM repesentatif de self mais non
+        # enregistre dans le jdc (pas ajoute dans jdc.etapes)
+        parent=self.parent
+        pos=self.parent.etapes.index(self)
+        # on ajoute une fin Ã  la commande pour pouvoir en commenter 2
+        texte_commande+='\nFin Commentaire'
+        commande_comment = commande_comm.COMMANDE_COMM(texte=texte_commande,
+                                                       reg='non',
+                                                       parent=parent)
+        self.parent.suppEntite(self)
+        parent.addEntite(commande_comment,pos)
+
+        return commande_comment
+
+    def modified(self):
+        """Le contenu de l'etape (mots cles, ...) a ete modifie"""
+        if self.nom=="DETRUIRE":
+            self.parent.controlContextApres(self)
+
+
+
 #ATTENTION SURCHARGE: a garder en synchro ou a reintegrer dans le Noyau
-   def buildSd(self,nom):
-      """
-           Methode de Noyau surchargee pour poursuivre malgre tout
-           si une erreur se produit pendant la creation du concept produit
-      """
-      try:
-         sd=Noyau.N_ETAPE.ETAPE.buildSd(self,nom)
-      except AsException as e :
-         # Une erreur s'est produite lors de la construction du concept
-         # Comme on est dans EFICAS, on essaie de poursuivre quand meme
-         # Si on poursuit, on a le choix entre deux possibilites :
-         # 1. on annule la sd associee a self
-         # 2. on la conserve mais il faut la retourner
-         # En plus il faut rendre coherents sdnom et sd.nom
-         self.sd=None
-         self.sdnom=None
-         self.state="unchanged"
-         self.valid=0
-
-      return self.sd
+    def buildSd(self,nom):
+        """
+             Methode de Noyau surchargee pour poursuivre malgre tout
+             si une erreur se produit pendant la creation du concept produit
+        """
+        try:
+            sd=Noyau.N_ETAPE.ETAPE.buildSd(self,nom)
+        except AsException as e :
+            # Une erreur s'est produite lors de la construction du concept
+            # Comme on est dans EFICAS, on essaie de poursuivre quand meme
+            # Si on poursuit, on a le choix entre deux possibilites :
+            # 1. on annule la sd associee a self
+            # 2. on la conserve mais il faut la retourner
+            # En plus il faut rendre coherents sdnom et sd.nom
+            self.sd=None
+            self.sdnom=None
+            self.state="unchanged"
+            self.valid=0
+
+        return self.sd
 
 #ATTENTION SURCHARGE: cette methode doit etre gardee en synchronisation avec Noyau
-   def makeRegister(self):
-      """
-         Initialise les attributs jdc, id, niveau et realise les
-         enregistrements necessaires
-         Pour EFICAS, on tient compte des niveaux
-         Surcharge la methode makeRegister du package Noyau
-      """
-      if self.parent :
-         self.jdc = self.parent.getJdcRoot()
-         self.id=   self.parent.register(self)
-         self.UserError=self.jdc.UserError
-         if self.definition.niveau :
-            # La definition est dans un niveau. En plus on
-            # l'enregistre dans le niveau
-            self.nom_niveau_definition = self.definition.niveau.nom
-            self.niveau = self.parent.dict_niveaux[self.nom_niveau_definition]
-            self.niveau.register(self)
-         else:
-            # La definition est au niveau global
-            self.nom_niveau_definition = 'JDC'
-            self.niveau=self.parent
-      else:
-         self.jdc = self.parent =None
-         self.id=None
-         self.niveau=None
-         self.UserError="UserError"
-
-   def report(self):
-     cr= Validation.V_ETAPE.ETAPE.report(self)
-     #rafraichisst de la validite de l'etape (probleme avec l'ordre dans les macros : etape puis mots cles)
-     self.isValid()
-     if not self.isValid() and self.nom == "INCLUDE" :
-        self.cr.fatal('Etape : {} ligne : {}  {}'.format(self.nom, self.appel[0],  tr("\n   Include Invalide. \n  ne sera pas pris en compte")))
-     return cr
-
+    def makeRegister(self):
+        """
+           Initialise les attributs jdc, id, niveau et realise les
+           enregistrements necessaires
+           Pour EFICAS, on tient compte des niveaux
+           Surcharge la methode makeRegister du package Noyau
+        """
+        if self.parent :
+            self.jdc = self.parent.getJdcRoot()
+            self.id=   self.parent.register(self)
+            self.UserError=self.jdc.UserError
+            if self.definition.niveau :
+                # La definition est dans un niveau. En plus on
+                # l'enregistre dans le niveau
+                self.nom_niveau_definition = self.definition.niveau.nom
+                self.niveau = self.parent.dict_niveaux[self.nom_niveau_definition]
+                self.niveau.register(self)
+            else:
+                # La definition est au niveau global
+                self.nom_niveau_definition = 'JDC'
+                self.niveau=self.parent
+        else:
+            self.jdc = self.parent =None
+            self.id=None
+            self.niveau=None
+            self.UserError="UserError"
+
+    def report(self):
+        cr= Validation.V_ETAPE.ETAPE.report(self)
+        #rafraichisst de la validite de l'etape (probleme avec l'ordre dans les macros : etape puis mots cles)
+        self.isValid()
+        if not self.isValid() and self.nom == "INCLUDE" :
+            self.cr.fatal('Etape : {} ligne : {}  {}'.format(self.nom, self.appel[0],  tr("\n   Include Invalide. \n  ne sera pas pris en compte")))
+        return cr
index d99c9d9f1b24f8eeeda97f341895c1dd9312ae4f..358cf6061be51d93be01be0f252d5b968cc8e1c3 100644 (file)
 """
 
 class EVAL :
-   """
-   """
-   def __init__(self,str):
-      """
-         L'objet EVAL est initialise avec une chaine de caracteres (str)
-      """
-      self.valeur = str
-      self.val=None
+    """
+    """
+    def __init__(self,str):
+        """
+           L'objet EVAL est initialise avec une chaine de caracteres (str)
+        """
+        self.valeur = str
+        self.val=None
 
-   def __repr__(self):
-      return 'EVAL("""'+self.valeur+'""")'
-
-   def accept(self,visitor):
-      """
-         Cette methode permet de parcourir l'arborescence des objets
-         en utilisant le pattern VISITEUR
-      """
-      visitor.visitEVAL(self)
+    def __repr__(self):
+        return 'EVAL("""'+self.valeur+'""")'
 
+    def accept(self,visitor):
+        """
+           Cette methode permet de parcourir l'arborescence des objets
+           en utilisant le pattern VISITEUR
+        """
+        visitor.visitEVAL(self)
index 81d00322fc462a051233c3e1373a6f6e1aa2910e..8a5f443b4539bf9da12ad1872f0399167e342afa 100644 (file)
@@ -24,17 +24,16 @@ from __future__ import absolute_import
 from . import I_REGLE
 
 class EXCLUS(I_REGLE.REGLE):
-  def purgeListe(self,liste_a_purger,listeMcPresents):
-     regle_active=0
-     for mc_present in listeMcPresents:
-        if mc_present in self.mcs:
-           regle_active=1
-           break
-     if not regle_active : return liste_a_purger
-
-     for mc in self.mcs:
-        # Il ne faut pas purger un mot cle present. Sa cardinalite est verifiee par ailleurs
-        if mc in liste_a_purger and mc not in listeMcPresents:
-           liste_a_purger.remove(mc)
-     return liste_a_purger
+    def purgeListe(self,liste_a_purger,listeMcPresents):
+        regle_active=0
+        for mc_present in listeMcPresents:
+            if mc_present in self.mcs:
+                regle_active=1
+                break
+        if not regle_active : return liste_a_purger
 
+        for mc in self.mcs:
+            # Il ne faut pas purger un mot cle present. Sa cardinalite est verifiee par ailleurs
+            if mc in liste_a_purger and mc not in listeMcPresents:
+                liste_a_purger.remove(mc)
+        return liste_a_purger
index 7b64ce38acb09bc34fce9ae127e09c0b29b184b5..44754ae105e5d2eddc0868e39e402b2dd7b1954a 100644 (file)
@@ -22,21 +22,20 @@ import types
 
 class Fichier:
 
-   def __init__(self,filtre='All Files (*)',existence='NonExistant',repertoire=None):
-       self.filtre=filtre
-       self.existence=existence
-       self.repertoire=repertoire
+    def __init__(self,filtre='All Files (*)',existence='NonExistant',repertoire=None):
+        self.filtre=filtre
+        self.existence=existence
+        self.repertoire=repertoire
 
-   def __convert__(self,valeur):
-    # Attention ne verifie pas grand chose
-    if type(valeur) != bytes  and type(valeur) != str:
-      return None
-    return valeur
+    def __convert__(self,valeur):
+        # Attention ne verifie pas grand chose
+        if type(valeur) != bytes  and type(valeur) != str:
+            return None
+        return valeur
 
 
-   def info(self):
-      return "Fichier de Type %s et %s" % (self.filtre,self.existence)
-
-      __repr__=info
-      __str__=info
+    def info(self):
+        return "Fichier de Type %s et %s" % (self.filtre,self.existence)
 
+        __repr__=info
+        __str__=info
index 2cd1596e255afe032977d06ea58cd9b50660514c..be2a3c3f0e850910eb077662c8d5f0d49578c440 100644 (file)
@@ -24,21 +24,21 @@ from Extensions.i18n import tr
 from Extensions.eficas_exception import EficasException
 
 class FONCTION(ASSD):
-  def __init__(self,etape=None,sd=None,reg='oui'):
-    if reg=='oui':
-      self.jdc.registerFonction(self)
+    def __init__(self,etape=None,sd=None,reg='oui'):
+        if reg=='oui':
+            self.jdc.registerFonction(self)
 
-  def getFormule(self):
-    """
-    Retourne une formule decrivant self sous la forme d'un tuple :
-    (nom,type_retourne,arguments,corps)
-    """
-    if hasattr(self.etape,'getFormule'):
-      # on est dans le cas d'une formule Aster
-      return self.etape.getFormule()
-    else:
-      # on est dans le cas d'une fonction
-      return (self.nom,'REEL','(REEL:x)','''bidon''')
+    def getFormule(self):
+        """
+        Retourne une formule decrivant self sous la forme d'un tuple :
+        (nom,type_retourne,arguments,corps)
+        """
+        if hasattr(self.etape,'getFormule'):
+            # on est dans le cas d'une formule Aster
+            return self.etape.getFormule()
+        else:
+            # on est dans le cas d'une fonction
+            return (self.nom,'REEL','(REEL:x)','''bidon''')
 
 # On ajoute la classe formule pour etre coherent avec la
 # modification de C Durand sur la gestion des formules dans le superviseur
@@ -46,27 +46,25 @@ class FONCTION(ASSD):
 class fonction(FONCTION) : pass
 
 from Extensions import param2
-class formule(FONCTION) : 
-   def __call__(self,*val):
-      if len(val) != len(self.nompar):
-         raise TypeError(" %s() takes exactly %d argument (%d given)" % (self.nom,len(self.nompar),len(val)))
-      return param2.Unop2(self.nom,self.realCall,val)
-
-   def realCall(self,*val):
-      if hasattr(self.parent,'contexte_fichier_init'):
-                        context=self.parent.contexte_fichier_init
-      else            : context={}
-      i=0
-      for param in self.nompar :
-         context[param]=val[i]
-         i=i+1
-      try :
-       res=eval(self.expression,self.jdc.const_context, context)
-      except :
-       print (75 * '!')
-       print ('! ' + "Erreur evaluation formule %s" % self.nom + 20*'!')
-       print (75 * '!')
-       raise EficasException
-      return res
-
+class formule(FONCTION) :
+    def __call__(self,*val):
+        if len(val) != len(self.nompar):
+            raise TypeError(" %s() takes exactly %d argument (%d given)" % (self.nom,len(self.nompar),len(val)))
+        return param2.Unop2(self.nom,self.realCall,val)
 
+    def realCall(self,*val):
+        if hasattr(self.parent,'contexte_fichier_init'):
+            context=self.parent.contexte_fichier_init
+        else            : context={}
+        i=0
+        for param in self.nompar :
+            context[param]=val[i]
+            i=i+1
+        try :
+            res=eval(self.expression,self.jdc.const_context, context)
+        except :
+            print (75 * '!')
+            print ('! ' + "Erreur evaluation formule %s" % self.nom + 20*'!')
+            print (75 * '!')
+            raise EficasException
+        return res
index bf52caa32c7522d3e56b989a7a2656e0dbfa251a..41ca29ac7a7e293fdbc71b23322004a726308026 100644 (file)
@@ -59,15 +59,15 @@ class FORM_ETAPE(MACRO_ETAPE):
             return None,None,None
         type_retourne="REEL"
         if len(self.mcListe) > 0:
-           child = self.mcListe[0] # child est un MCSIMP 
-           corps = child.getVal()
+            child = self.mcListe[0] # child est un MCSIMP
+            corps = child.getVal()
         else:
-           corps = None
+            corps = None
         if len(self.mcListe) > 1:
-           child = self.mcListe[1]
-           l_args= child.getVal()
+            child = self.mcListe[1]
+            l_args= child.getVal()
         else :
-           l_args=None
+            l_args=None
         return type_retourne,l_args,corps
 
     def getNom(self):
@@ -258,8 +258,8 @@ class FORM_ETAPE(MACRO_ETAPE):
         if sd:
             sd.nom = formule[0]
 
-    # bidouille PN 
-    # Il faut que formule soit constituee de 
+    # bidouille PN
+    # Il faut que formule soit constituee de
     # nom de la formule
     # type retourne
     # parametres
@@ -269,19 +269,19 @@ class FORM_ETAPE(MACRO_ETAPE):
         self.buildMc()
         self.mcListe=[]
         if len(formule) < 4 :
-           return 0
+            return 0
         arguments=formule[3]
         if arguments[0] == '(' :
-           arguments=arguments[1:]
+            arguments=arguments[1:]
         if arguments[-1] == ')' :
-           arguments=arguments[:-1]
+            arguments=arguments[:-1]
         self.arguments=tuple(arguments.split(','))
 
         mocles={"NOM_PARA":self.arguments}
         if formule[1] == "REEL":
-          mocles["VALE"]=formule[2]
+            mocles["VALE"]=formule[2]
         if formule[1] == "COMPLEXE":
-          mocles["VALE_C"]=formule[2]
+            mocles["VALE_C"]=formule[2]
 
         for k,v in self.definition.entites.items():
             if not k in  mocles : continue
@@ -289,7 +289,7 @@ class FORM_ETAPE(MACRO_ETAPE):
             child.valeur=mocles[k]
             child.state = 'modified'
             self.mcListe.append(child)
-           
+
         self.corps = formule[2]
         self.type_retourne = formule[1]
         sd = self.getSdProd()
@@ -326,18 +326,18 @@ class FORM_ETAPE(MACRO_ETAPE):
         return
 
     def deleteConcept(self,sd):
-        """ 
+        """
          Inputs :
            - sd=concept detruit
          Fonction :
          Mettre a jour les mots cles de l etape et eventuellement le concept produit si reuse
          suite a la disparition du concept sd
          Seuls les mots cles simples MCSIMP font un traitement autre que de transmettre aux fils,
-         sauf les objets FORM_ETAPE qui doivent verifier que le concept detruit n'est pas 
+         sauf les objets FORM_ETAPE qui doivent verifier que le concept detruit n'est pas
          utilise dans le corps de la fonction
         """
         self.initModif()
-         
+
     def replaceConcept(self,old_sd,sd):
         """
          Inputs :
@@ -348,4 +348,3 @@ class FORM_ETAPE(MACRO_ETAPE):
          utilise dans le corps de la fonction
         """
         self.initModif()
-
index 9071b5a2b0fed9506667898ab9221a55d56c447f..e308f4d6a86a516ff923d41e26ed1177a5ac83ad 100644 (file)
@@ -45,959 +45,962 @@ except NameError:
     basestring = str
 
 class LASSD:
-   pass
+    pass
 
 class JDC(I_OBJECT.OBJECT):
-   """
-   """
-   def __init__(self):
-      self.editmode=0
-      self.etapes_niveaux=[]
-      self.niveau=self
-      self.params=[]
-      self.fonctions=[]
-      self._etape_context=None
-      self.recorded_units={}
-      self.old_recorded_units={}
-
-   def getIndex(self,objet):
-      """
-        Retourne la position d'objet dans la liste self
-      """
-      return self.etapes.index(objet)
-
-   def getSdAvantDuBonType(self,etape,types_permis):
-      """
-          Retourne la liste des concepts avant etape d'un type acceptable
-      """
-      d=self.getContexteAvant(etape)
-      
-      l=[]
-      for k,v in d.items():
-        #if type(v) != types.InstanceType and not isinstance(v,object): continue
-        if  not isinstance(v,object): continue
-        # On considere que seul assd indique un type quelconque pas CO
-        elif self.assd in types_permis :
-           if v.etape.sdnom != "sansnom" : l.append(k)
-        elif self.estPermis(v,types_permis):
-           if v.etape.sdnom != "sansnom" : l.append(k)
-      l.sort()
-      return l
-
-   def getSdCreeParObjet(self,classeAChercher):
-       l=[]
-       for v in list(self.sdsDict.keys()):
-          if (isinstance(self.sdsDict[v], classeAChercher)) : 
-             l.append(self.sdsDict[v])
-       return l
-      
-
-   def getVariables(self,etape):
-      etapeStop=etape
-      l=[]
-      for etapeTraitee in self.etapes :
-          if etapeTraitee==etapeStop:
-             break
-          if etapeTraitee.nom == 'VARIABLE' :
-             variable=etapeTraitee.getMocle('ModelVariable')
-             if variable != None :
-                l.append(variable.nom)
-      return l
-
-   def getDistributions(self,etape):
-      etapeStop=etape
-      l=[]
-      for etapeTraitee in self.etapes :
-          if etapeTraitee==etapeStop: break
-          if etapeTraitee.nom == 'DISTRIBUTION' and etapeTraitee.sd !=None : l.append(etapeTraitee.sd.nom)
-      return l
-
-
-   #def set_Copules_recalcule_etat(self):
-   #   for etapeTraitee in self.etapes :
-   #       if etapeTraitee.nom == 'CORRELATION' :
-             #Matrix=etapeTraitee.getChild('Matrix')
-             #if Matrix !=None :
-   #             Correlation=etapeTraitee.getChild('CorrelationMatrix')
-   #             if Correlation !=None : Correlation.state='arecalculer'
-             #   Matrix.state='arecalculer'
-     
-   #def recalculeEtatCorrelation(self):
-   #   for etapeTraitee in self.etapes :
-   #       if etapeTraitee.nom == 'CORRELATION' :
-             #Matrix=etapeTraitee.getChild('Matrix')
-             #if Matrix !=None :
-   #             Matrix.state='arecalculer'
-   #             Correlation=Matrix.getChild('CorrelationMatrix')
-   #             if Correlation !=None : Correlation.state='arecalculer'
-   #                Correlation.isValid()
-   #             Matrix.isValid()
-   #             etapeTraitee.state='arecalculer'
-   #          if etapeTraitee.state=='arecalculer': etapeTraitee.isValid()
-                
-   def recalculeEtatCorrelation(self):
-      for etapeTraitee in self.etapes :
-          if etapeTraitee.nom == 'CORRELATION' :
-             Correlation=etapeTraitee.getChild('CorrelationMatrix')
-             if Correlation !=None : 
-                  Correlation.state='arecalculer'
-                  Correlation.isValid()
-             etapeTraitee.isValid()
-
-   def recalculeValiditeApresChangementGlobalJdc(self, motClef):
-        print ("je passe dans recalculeValiditeApresChangementGlobalJdc")
+    """
+    """
+    def __init__(self):
+        self.editmode=0
+        self.etapes_niveaux=[]
+        self.niveau=self
+        self.params=[]
+        self.fonctions=[]
+        self._etape_context=None
+        self.recorded_units={}
+        self.old_recorded_units={}
+
+
+    def getIndex(self,objet):
+        """
+          Retourne la position d'objet dans la liste self
+        """
+        return self.etapes.index(objet)
+
+    def getSdAvantDuBonType(self,etape,types_permis):
+        """
+            Retourne la liste des concepts avant etape d'un type acceptable
+        """
+        #print ('getSdAvantDuBonType   ', types_permis)
+        d=self.getContexteAvant(etape)
+
+        l=[]
+        for k,v in d.items():
+            #if type(v) != types.InstanceType and not isinstance(v,object): continue
+            if  not isinstance(v,object): continue
+            # On considere que seul assd indique un type quelconque pas CO
+            elif self.assd in types_permis :
+                if v.etape.sdnom != "sansnom" : l.append(k)
+            elif self.estPermis(v,types_permis):
+                if v.etape.sdnom != "sansnom" : l.append(k)
+        l.sort()
+        return l
+
+    def getSdCreeParObjet(self,classeAChercher):
+        l=[]
+        for v in list(self.sdsDict.keys()):
+            if (isinstance(self.sdsDict[v], classeAChercher)) :
+                l.append(self.sdsDict[v])
+        return l
+
+
+    def getVariables(self,etape):
+        etapeStop=etape
+        l=[]
+        for etapeTraitee in self.etapes :
+            if etapeTraitee==etapeStop:
+                break
+            if etapeTraitee.nom == 'VARIABLE' :
+                variable=etapeTraitee.getMocle('ModelVariable')
+                if variable != None :
+                    l.append(variable.nom)
+        return l
+
+    def getDistributions(self,etape):
+        etapeStop=etape
+        l=[]
+        for etapeTraitee in self.etapes :
+            if etapeTraitee==etapeStop: break
+            if etapeTraitee.nom == 'DISTRIBUTION' and etapeTraitee.sd !=None : l.append(etapeTraitee.sd.nom)
+        return l
+
+
+    #def set_Copules_recalcule_etat(self):
+    #   for etapeTraitee in self.etapes :
+    #       if etapeTraitee.nom == 'CORRELATION' :
+                #Matrix=etapeTraitee.getChild('Matrix')
+                #if Matrix !=None :
+    #             Correlation=etapeTraitee.getChild('CorrelationMatrix')
+    #             if Correlation !=None : Correlation.state='arecalculer'
+                #   Matrix.state='arecalculer'
+
+    #def recalculeEtatCorrelation(self):
+    #   for etapeTraitee in self.etapes :
+    #       if etapeTraitee.nom == 'CORRELATION' :
+                #Matrix=etapeTraitee.getChild('Matrix')
+                #if Matrix !=None :
+    #             Matrix.state='arecalculer'
+    #             Correlation=Matrix.getChild('CorrelationMatrix')
+    #             if Correlation !=None : Correlation.state='arecalculer'
+    #                Correlation.isValid()
+    #             Matrix.isValid()
+    #             etapeTraitee.state='arecalculer'
+    #          if etapeTraitee.state=='arecalculer': etapeTraitee.isValid()
+
+    def recalculeEtatCorrelation(self):
+        for etapeTraitee in self.etapes :
+            if etapeTraitee.nom == 'CORRELATION' :
+                Correlation=etapeTraitee.getChild('CorrelationMatrix')
+                if Correlation !=None :
+                    Correlation.state='arecalculer'
+                    Correlation.isValid()
+                etapeTraitee.isValid()
+
+    def recalculeValiditeApresChangementGlobalJdc(self, motClef):
+            #print ("je passe dans recalculeValiditeApresChangementGlobalJdc")
         try :
-          liste=self.getJdcRoot().cata.dict_condition[motClef.nom]
+            liste=self.getJdcRoot().cata.dict_condition[motClef.nom]
         except :
-          liste=()
+            liste=()
         for etapeTraitee in self.etapes :
-           if etapeTraitee.nom not in liste: continue
-           #self.forceRecalculBloc(etapeTraitee)
-           etapeTraitee.state='arecalculer'
-           etapeTraitee.deepUpdateConditionBloc()
-           etapeTraitee.isValid()
-
-   def activeBlocsGlobaux(self):
-       for nomMotClef in self.mc_globaux : 
-           motClef=self.mc_globaux[nomMotClef]
-           if nomMotClef in list(self.cata.dict_condition.keys()):
-              liste=self.cata.dict_condition[nomMotClef]
-           else : liste=()
-           for etapeTraitee in self.etapes :
-               if etapeTraitee.nom not in liste: continue
-               etapeTraitee.state='arecalculer'
-               etapeTraitee.deepUpdateConditionBlocApresCreation()
-               etapeTraitee.isValid()
-        
-      
-        
-   #def forceRecalculBloc(self,objet):
-       # Attention : certains objets deviennent None quand on recalcule 
-       # les conditions d existence des blocs
-   #    if objet != None:  objet.state='arecalculer'
-   #    if hasattr(objet,'listeMcPresents'):
-   #       for childNom in objet.listeMcPresents():
-   #           child=objet.getChild(childNom)
-   #           if hasattr(objet,'_updateConditionBloc'):objet._updateConditionBloc()
-   #           self.forceRecalculBloc(child)
-       
-   
-   def getSdAvantDuBonTypePourTypeDeBase(self,etape,type):
-      """
-          Retourne la liste des concepts avant etape d'1 type de base acceptable
-          Attention different de la routine precedente : 1 seul type passe en parametre
-          Teste sur issubclass et par sur le type permis
-      """
-      d=self.getContexteAvant(etape)
-      l=[]
-      try :
-         typeverif=self.cata.__dict__[type]
-      except :
-         return l
-      for k,v in d.items():
-        if issubclass(v.__class__,typeverif): 
-           l.append(k)
-      l.sort()
-      return l
-
-   def chercheListAvant(self,etape,valeur):
-       d=self.getContexteAvant(etape)
-       for k,v in d.items():
-          if issubclass(v.__class__,LASSD):
-             if k == valeur :
-                return k
-        # Attention pour enlever les . a la fin des pretendus reels
-             if k == valeur[0:-1] :
-                return v
-       return None
-
-   def estPermis(self,v,types_permis):
-      for type_ok in types_permis:
-          if type_ok in ('R','I','C','TXM') and v in self.params : 
-             return 1
-          elif type_ok == 'R' and v.__class__.__name__ == 'reel' : 
-             return 1
-          elif type_ok == 'I' and v.__class__.__name__ == 'entier' : 
-             return 1
-          elif type_ok == 'C' and v.__class__.__name__ == 'complexe' : 
-             return 1
-          elif type_ok == 'TXM' and v.__class__.__name__ == 'chaine' : 
-             return 1
-          elif type(type_ok) != type and not isinstance(type_ok,type): 
-             continue
-          elif v.__class__ == type_ok or issubclass(v.__class__,type_ok):
-             return 1
-      return 0
-
-   def addEntite(self,name,pos):
-      """
-          Ajoute une entite :
-          Si name est le nom d une commande ou un commentaire ajoute 
-          une etape au JDC
-          Sinon remonte une erreur
-      """
-      self.initModif()
-      self.editmode=1
-      if name == "COMMENTAIRE" :
-        from Extensions import commentaire
-        # ajout d'un commentaire
-        self.setCurrentStep()
-        ind = 1
-        for child in self.etapes :
-          if isinstance(child,commentaire.COMMENTAIRE):
-            ind = ind+1
-        objet = commentaire.COMMENTAIRE('',parent=self)
-        objet.nom = "_comm_"+repr(ind)
-        if pos == None : pos = 0
-        self.etapes.insert(pos,objet)
-        self.resetContext()
-        self.editmode=0
-        self.activeEtapes()
-        CONNECTOR.Emit(self,"add",objet)
-        self.finModif()
-        return objet
-      elif name == "PARAMETRE":
-        # ajout d'un parametre
-        self.setCurrentStep()
-        nom_param = '_param_'+str(len(self.params)+1)
-        objet = parametre.PARAMETRE(nom=nom_param)
-        if pos == None : pos = 0
-        self.etapes.insert(pos,objet)
+            if etapeTraitee.nom not in liste: continue
+            #self.forceRecalculBloc(etapeTraitee)
+            etapeTraitee.state='arecalculer'
+            etapeTraitee.deepUpdateConditionBloc()
+            etapeTraitee.isValid()
+            #print (etapeTraitee.nom ,etapeTraitee.isValid())
+
+    def activeBlocsGlobaux(self):
+        for nomMotClef in self.mc_globaux :
+            motClef=self.mc_globaux[nomMotClef]
+            if nomMotClef in list(self.cata.dict_condition.keys()):
+                liste=self.cata.dict_condition[nomMotClef]
+            else : liste=()
+            for etapeTraitee in self.etapes :
+                if etapeTraitee.nom not in liste: continue
+                etapeTraitee.state='arecalculer'
+                etapeTraitee.deepUpdateConditionBlocApresCreation()
+                etapeTraitee.isValid()
+
+
+
+    #def forceRecalculBloc(self,objet):
+        # Attention : certains objets deviennent None quand on recalcule
+        # les conditions d existence des blocs
+    #    if objet != None:  objet.state='arecalculer'
+    #    if hasattr(objet,'listeMcPresents'):
+    #       for childNom in objet.listeMcPresents():
+    #           child=objet.getChild(childNom)
+    #           if hasattr(objet,'_updateConditionBloc'):objet._updateConditionBloc()
+    #           self.forceRecalculBloc(child)
+
+
+    def getSdAvantDuBonTypePourTypeDeBase(self,etape,type):
+        """
+            Retourne la liste des concepts avant etape d'1 type de base acceptable
+            Attention different de la routine precedente : 1 seul type passe en parametre
+            Teste sur issubclass et par sur le type permis
+        """
+        d=self.getContexteAvant(etape)
+        l=[]
+        try :
+            typeverif=self.cata.__dict__[type]
+        except :
+            return l
+        for k,v in d.items():
+            if issubclass(v.__class__,typeverif):
+                l.append(k)
+        l.sort()
+        return l
+
+    def chercheListAvant(self,etape,valeur):
+        d=self.getContexteAvant(etape)
+        for k,v in d.items():
+            if issubclass(v.__class__,LASSD):
+                if k == valeur :
+                    return k
+            # Attention pour enlever les . a la fin des pretendus reels
+                if k == valeur[0:-1] :
+                    return v
+        return None
+
+    def estPermis(self,v,types_permis):
+        for type_ok in types_permis:
+            if type_ok in ('R','I','C','TXM') and v in self.params :
+                return 1
+            elif type_ok == 'R' and v.__class__.__name__ == 'reel' :
+                return 1
+            elif type_ok == 'I' and v.__class__.__name__ == 'entier' :
+                return 1
+            elif type_ok == 'C' and v.__class__.__name__ == 'complexe' :
+                return 1
+            elif type_ok == 'TXM' and v.__class__.__name__ == 'chaine' :
+                return 1
+            elif type(type_ok) != type and not isinstance(type_ok,type):
+                continue
+            elif v.__class__ == type_ok or issubclass(v.__class__,type_ok):
+                return 1
+        return 0
+
+    def addEntite(self,name,pos):
+        """
+            Ajoute une entite :
+            Si name est le nom d une commande ou un commentaire ajoute
+            une etape au JDC
+            Sinon remonte une erreur
+        """
+        self.initModif()
+        self.editmode=1
+        if name == "COMMENTAIRE" :
+            from Extensions import commentaire
+            # ajout d'un commentaire
+            self.setCurrentStep()
+            ind = 1
+            for child in self.etapes :
+                if isinstance(child,commentaire.COMMENTAIRE):
+                    ind = ind+1
+            objet = commentaire.COMMENTAIRE('',parent=self)
+            objet.nom = "_comm_"+repr(ind)
+            if pos == None : pos = 0
+            self.etapes.insert(pos,objet)
+            self.resetContext()
+            self.editmode=0
+            self.activeEtapes()
+            CONNECTOR.Emit(self,"add",objet)
+            self.finModif()
+            return objet
+        elif name == "PARAMETRE":
+            # ajout d'un parametre
+            self.setCurrentStep()
+            nom_param = '_param_'+str(len(self.params)+1)
+            objet = parametre.PARAMETRE(nom=nom_param)
+            if pos == None : pos = 0
+            self.etapes.insert(pos,objet)
+            self.resetContext()
+            self.editmode=0
+            self.activeEtapes()
+            CONNECTOR.Emit(self,"add",objet)
+            self.finModif()
+            return objet
+        elif name == "PARAMETRE_EVAL":
+            # ajout d'un parametre EVAL
+            self.setCurrentStep()
+            nom_param = '_param_'+str(len(self.params)+1)
+            objet = parametre_eval.PARAMETRE_EVAL(nom=nom_param)
+            if pos == None : pos = 0
+            self.etapes.insert(pos,objet)
+            self.resetContext()
+            self.editmode=0
+            self.activeEtapes()
+            CONNECTOR.Emit(self,"add",objet)
+            self.finModif()
+            return objet
+        elif not( isinstance(name, basestring)):
+        #elif type(name)==types.InstanceType:
+        #elif isinstance(name,object):
+            # on est dans le cas ou on veut ajouter une commande deja
+            # existante (par copie donc)
+            # on est donc necessairement en mode editeur ...
+            objet = name
+            # Il ne faut pas oublier de reaffecter le parent d'obj (si copie)
+            from Extensions import commentaire
+            if not( isinstance (objet,commentaire.COMMENTAIRE)):
+                objet.reparent(self)
+            self.setCurrentStep()
+            if isinstance(objet,ETAPE):
+                if objet.nom_niveau_definition == 'JDC':
+                    # l'objet depend directement du JDC
+                    objet.niveau = self
+                else:
+                    # l'etape depend d'un niveau et non directement du JDC :
+                    # il faut l'enregistrer dans le niveau de parent
+                    objet.parent.dict_niveaux[objet.nom_niveau_definition].register(objet)
+                    objet.niveau = objet.parent.dict_niveaux[objet.nom_niveau_definition]
+            self.etapes.insert(pos,objet)
+            self.resetContext()
+            # il faut verifier que les concepts utilises par objet existent bien
+            # a ce niveau d'arborescence
+            objet.verifExistenceSd()
+            objet.updateMcGlobal()
+            self.editmode=0
+            self.activeEtapes()
+            CONNECTOR.Emit(self,"add",objet)
+            self.finModif()
+            return objet
+        else :
+            # On veut ajouter une nouvelle commande
+            try:
+                self.setCurrentStep()
+                cmd=self.getCmd(name)
+                # L'appel a make_objet n'a pas pour effet d'enregistrer l'etape
+                # aupres du step courant car editmode vaut 1
+                # Par contre elle a le bon parent grace a setCurrentStep
+                e=cmd.make_objet()
+                if pos == None : pos = 0
+                self.etapes.insert(pos,e)
+                self.resetCurrentStep()
+                self.resetContext()
+                self.editmode=0
+                self.activeEtapes()
+                self.enregistreEtapePyxb(e,pos)
+                # PN fait ds self.activeEtapes
+                CONNECTOR.Emit(self,"add",e)
+                self.finModif()
+                return e
+            except AsException as e:
+                traceback.print_exc()
+                self.resetCurrentStep()
+                self.editmode=0
+                raise AsException(tr("Impossible d'ajouter la commande")+name + '\n')
+            except:
+            #else :
+                traceback.print_exc()
+                self.resetCurrentStep()
+                self.editmode=0
+                raise AsException(tr("Impossible d ajouter la commande")+name)
+
+    def close(self):
+        #print "JDC.close",self
+        for etape in self.etapes:
+            if hasattr(etape,"close"):etape.close()
+        CONNECTOR.Emit(self,"close")
+
+    def setCurrentStep(self):
+        CONTEXT.unsetCurrentStep()
+        CONTEXT.setCurrentStep(self)
+
+    def resetCurrentStep(self):
+        CONTEXT.unsetCurrentStep()
+
+    def listeMcPresents(self):
+        return []
+
+    def getSdAvantEtape(self,nom_sd,etape):
+        return self.getContexteAvant(etape).get(nom_sd,None)
+
+    def getSdApresEtapeAvecDetruire(self,nom_sd,sd,etape,avec='non'):
+        """
+             Cette methode retourne la SD sd de nom nom_sd qui est eventuellement
+             definie apres etape en tenant compte des concepts detruits
+             Si avec vaut 'non' exclut etape de la recherche
+        """
+        #print "JDC.getSdApresEtapeAvecDetruire",nom_sd,sd
+        ietap=self.etapes.index(etape)
+        if avec == 'non':ietap=ietap+1
+        d={nom_sd:sd}
+        for e in self.etapes[ietap:]:
+            if e.isActif():
+                e.updateContext(d)
+                autre_sd=d.get(nom_sd,None)
+                if autre_sd is None:
+                # Le concept a ete detruit. On interrompt la recherche car il n'y a
+                # pas eu de redefinition du concept (il n'y a pas de conflit potentiel).
+                    return None
+                if autre_sd is not sd :
+                    # L'etape produit un concept different de meme nom. La situation n'est
+                    # pas saine (sauf peut etre si reuse ???)
+                    if hasattr(e,'reuse') and e.reuse == autre_sd:
+                        # Le concept etant reutilise, on interrompt la recherche.
+                        # On considere qu'il n'y a pas de nouveau concept defini
+                        # meme si dans les etapes suivantes le concept est detruit
+                        # et un concept de meme nom cree.
+                        # AVERIFIER : avec reuse le concept devrait etre le meme
+                        # le passage par ici est tres improbable
+                        return None
+                    else:
+                        # Le concept est produit par l'etape (Il y a conflit potentiel).
+                        # Le concept est redefini par une etape posterieure.
+                        return autre_sd
+        # Pas de destruction du concept ni de redefinition. On retourne le
+        # concept initial
+        return sd
+
+    def getSdApresEtape(self,nom_sd,etape,avec='non'):
+        """
+             Cette methode retourne la SD de nom nom_sd qui est eventuellement
+             definie apres etape
+             Si avec vaut 'non' exclut etape de la recherche
+        """
+        ietap=self.etapes.index(etape)
+        if avec == 'non':ietap=ietap+1
+        for e in self.etapes[ietap:]:
+            sd=e.getSdprods(nom_sd)
+            if sd:
+                if hasattr(e,'reuse'):
+                    if e.reuse != sd:
+                        return sd
+        return None
+
+    def getSdAutourEtape(self,nom_sd,etape,avec='non'):
+        """
+             Fonction: retourne la SD de nom nom_sd qui est eventuellement
+             definie avant ou apres etape
+             Permet de verifier si un concept de meme nom existe dans le perimetre
+             d'une etape
+             Si avec vaut 'non' exclut etape de la recherche
+        """
+        sd=self.getSdAvantEtape(nom_sd,etape)
+        if sd:return sd
+        sd=self.getSdApresEtape(nom_sd,etape,avec)
+        if sd:return sd
+        # Pour tenir compte des UserASSD # et des UserASSDMultiple a affiner
+        if nom_sd in self.sdsDict.keys() :
+            sd=self.sdsDict[nom_sd]
+            return sd
+
+    def getContexte_apres(self,etape):
+        """
+           Retourne le dictionnaire des concepts connus apres etape
+           On tient compte des commandes qui modifient le contexte
+           comme DETRUIRE ou les macros
+           Si etape == None, on retourne le contexte en fin de JDC
+        """
+        if not etape: return self.getContexteAvant(etape)
+
+        d=self.getContexteAvant(etape)
+        if etape.isActif():etape.updateContext(d)
+        self.index_etape_courante=self.index_etape_courante+1
+        return d
+
+    def activeEtapes(self):
+        """
+        """
+        for etape in self.etapes:
+            etape.active()
+
+    def deplaceEntite(self,indexNoeudACopier,indexNoeudOuColler,pos):
+        """
+            Pour le cut
+        """
+        if indexNoeudACopier==indexNoeudOuColler:return
+        etapeACopier=self.etapes[indexNoeudACopier]
+        try :
+            sd=self.etapes[indexNoeudACopier].sd
+        except :
+            sd=None
+        if pos=='before' and indexNoeudOuColler==0 :
+            self.etapes2=[etapeACopier,]+self.etapes[0:indexNoeudACopier]+self.etapes[indexNoeudACopier+1:]
+        elif indexNoeudACopier < indexNoeudOuColler :
+            self.etapes2=self.etapes[0:indexNoeudACopier]+self.etapes[indexNoeudACopier+1:indexNoeudOuColler+1]+[etapeACopier,]+self.etapes[indexNoeudOuColler+1:]
+        else:
+            self.etapes2=self.etapes[0:indexNoeudOuColler+1]+[etapeACopier,]+self.etapes[indexNoeudOuColler+1:indexNoeudACopier]+self.etapes[indexNoeudACopier+1:]
+        self.etapes=self.etapes2
+        if indexNoeudACopier < indexNoeudOuColler :
+            self.deleteConceptEntreEtapes(indexNoeudACopier,indexNoeudOuColler,sd)
         self.resetContext()
-        self.editmode=0
+        for e in self.etapes :
+            e.state = 'modified'
+        self.controlContextApres(None)
+        return 1
+
+
+    def suppEntite(self,etape) :
+        """
+            Cette methode a pour fonction de supprimer une etape dans
+            un jeu de commandes
+            Retourne 1 si la suppression a pu etre effectuee,
+            Retourne 0 dans le cas contraire
+        """
+        #PN correction de bugs
+        #print ('suppEntite', etape.nom)
+        if etape not in self.etapes: return 0
+
+        self.initModif()
+        index_etape=self.etapes.index(etape)
+
+        #etape.delObjPyxb()
+        self.etapes.remove(etape)
+
+        if etape.niveau is not self:
+            # Dans ce cas l'etape est enregistree dans un niveau
+            # Il faut la desenregistrer
+            etape.niveau.unregister(etape)
+
+        etape.supprimeSdProds()
+        etape.supprimeUserAssd()
+        etape.close()
+        etape.supprime()
         self.activeEtapes()
-        CONNECTOR.Emit(self,"add",objet)
-        self.finModif()
-        return objet
-      elif name == "PARAMETRE_EVAL":
-        # ajout d'un parametre EVAL
-        self.setCurrentStep()
-        nom_param = '_param_'+str(len(self.params)+1)
-        objet = parametre_eval.PARAMETRE_EVAL(nom=nom_param)
-        if pos == None : pos = 0
-        self.etapes.insert(pos,objet)
+
+        # Apres suppression de l'etape il faut controler que les etapes
+        # suivantes ne produisent pas des concepts DETRUITS dans op_init de etape
+        if index_etape > 0:
+            index_etape=index_etape-1
+            etape=self.etapes[index_etape]
+        else:
+            etape=None
+        self.controlContextApres(etape)
+
         self.resetContext()
-        self.editmode=0
-        self.activeEtapes()
-        CONNECTOR.Emit(self,"add",objet)
+        CONNECTOR.Emit(self,"supp",etape)
         self.finModif()
-        return objet
-      elif not( isinstance(name, basestring)):
-      #elif type(name)==types.InstanceType:
-      #elif isinstance(name,object):
-        # on est dans le cas ou on veut ajouter une commande deja 
-        # existante (par copie donc)
-        # on est donc necessairement en mode editeur ...
-        objet = name
-        # Il ne faut pas oublier de reaffecter le parent d'obj (si copie)
-        from Extensions import commentaire
-        if not( isinstance (objet,commentaire.COMMENTAIRE)):
-           objet.reparent(self)
-        self.setCurrentStep()
-        if isinstance(objet,ETAPE):
-          if objet.nom_niveau_definition == 'JDC':
-            # l'objet depend directement du JDC
-            objet.niveau = self
-          else:
-            # l'etape depend d'un niveau et non directement du JDC :
-            # il faut l'enregistrer dans le niveau de parent
-            objet.parent.dict_niveaux[objet.nom_niveau_definition].register(objet)
-            objet.niveau = objet.parent.dict_niveaux[objet.nom_niveau_definition]
-        self.etapes.insert(pos,objet)
-        self.resetContext()
-        # il faut verifier que les concepts utilises par objet existent bien
-        # a ce niveau d'arborescence
-        objet.verifExistenceSd()
-        objet.updateMcGlobal()
-        self.editmode=0
+        return 1
+
+    def controlContextApres(self,etape):
+        """
+           Cette methode verifie que les etapes apres l'etape etape
+           ont bien des concepts produits acceptables (pas de conflit de
+           nom principalement)
+           Si des concepts produits ne sont pas acceptables ils sont supprimes.
+           Effectue les verifications sur les etapes du jdc mais aussi sur les
+           jdc parents s'ils existent.
+        """
+        #print ("controlContextApres",self,etape)
+        #Regularise les etapes du jdc apres l'etape etape
+        self.controlJdcContextApres(etape)
+
+    def controlJdcContextApres(self,etape):
+        """
+            Methode semblable a controlContextApres mais ne travaille
+            que sur les etapes et sous etapes du jdc
+        """
+        #print ("controlJdcContextApres",self,etape)
+        if etape is None:
+            # on demarre de la premiere etape
+            index_etape=0
+        else:
+            index_etape=self.etapes.index(etape)+1
+
+        try:
+            etape=self.etapes[index_etape]
+        except:
+            #derniere etape du jdc : rien a faire
+            return
+
+        context=self.getContexteAvant(etape)
+        for e in self.etapes[index_etape:]:
+            e.controlSdprods(context)
+            e.updateContext(context)
+
+    def analyse(self):
+        self.compile()
+        self.execCompile()
+        if not self.cr.estvide():return
         self.activeEtapes()
-        CONNECTOR.Emit(self,"add",objet)
+        if self.mc_globaux != {} : self.activeBlocsGlobaux()
+
+    def analyseXML(self):
+        #print ('analyseXML')
+        #print (self.procedure)
+        self.setCurrentContext()
+        self.analyseFromXML()
+
+    def registerParametre(self,param):
+        """
+            Cette methode sert a ajouter un parametre dans la liste des parametres
+        """
+        self.params.append(param)
+
+    def registerFonction(self,fonction):
+        """
+            Cette methode sert a ajouter une fonction dans la liste des fonctions
+        """
+        self.fonctions.append(fonction)
+
+    def deleteParam(self,param):
+        """
+            Supprime le parametre param de la liste des parametres
+            et du contexte gobal
+        """
+        if param in self.params : self.params.remove(param)
+        if param.nom in self.g_context : del self.g_context[param.nom]
+
+    def getParametresFonctionsAvantEtape(self,etape):
+        """
+            Retourne deux elements :
+            - une liste contenant les noms des parametres (constantes ou EVAL)
+              definis avant etape
+            - une liste contenant les formules definies avant etape
+        """
+        l_constantes = []
+        l_fonctions = []
+        # on recupere le contexte avant etape
+        # on ne peut mettre dans les deux listes que des elements de ce contexte
+        d=self.getContexteAvant(etape)
+        # construction de l_constantes
+        for param in self.params:
+            nom = param.nom
+            if not nom : continue
+            if nom in d: l_constantes.append(nom)
+        # construction de l_fonctions
+        for form in self.fonctions:
+            nom = form.nom
+            if not nom : continue
+            if nom in d: l_fonctions.append(form.getFormule())
+
+        # on ajoute les concepts produits par DEFI_VALEUR
+        # XXX On pourrait peut etre faire plutot le test sur le type
+        # de concept : entier, reel, complexe, etc.
+        for k,v in d.items():
+            if hasattr(v,'etape') and v.etape.nom in ('DEFI_VALEUR',):
+                l_constantes.append(k)
+
+        # on retourne les deux listes
+        return l_constantes,l_fonctions
+
+    def getNbEtapesAvant(self,niveau):
+        """
+            Retourne le nombre d etapes avant le debut de niveau
+        """
+        nb=0
+        for niv in self.etapes_niveaux:
+            if niv == niveau:break
+            nb=nb+len(niv.etapes)
+        return nb
+
+    def initModif(self):
+        """
+        Methode appelee au moment ou une modification va etre faite afin de
+        declencher d'eventuels traitements pre-modification
+        """
+        #print "initModif",self
+        self.state = 'modified'
+
+    def finModif(self):
+        #print "finModif",self
+        CONNECTOR.Emit(self,"valid")
+        self.isValid()
+        pass
+
+    def deepUpdateConditionBloc(self,motClef=None):
+        # pour le moment, on ne fait rien
+        self.getJdcRoot().recalculeValiditeApresChangementGlobalJdc(motClef)
+        #raise EficasException(tr("Pas implemente"))
+
+    def updateConditionBloc(self):
+        # pour le moment, on ne fait rien
+        raise EficasException(tr("Pas implemente"))
+
+    def getListeMcInconnus(self):
+        """
+        Retourne une liste contenant les mots-cles inconnus a la relecture du JDC
+        """
+        # cette liste a le format suivant : [etape,(bloc,mcfact,...),nom_mc,valeur_mc]
+        l_mc = []
+        for etape in self.etapes :
+            if etape.isActif() :
+                if not etape.isValid() :
+                    l = etape.getListeMcInconnus()
+                    if l : l_mc.extend(l)
+        return l_mc
+
+    def getGenealogiePrecise(self):
+        return []
+
+    def getGenealogie(self):
+        """
+            Retourne la liste des noms des ascendants de l'objet self
+            jusqu'a la premiere ETAPE parent.
+        """
+        return []
+
+    def getListeCmd(self):
+        """
+            Retourne la liste des commandes du catalogue
+        """
+        return self.niveau.definition.getListeCmd()
+
+    def getGroups(self):
+        """
+            Retourne la liste des groupes
+        """
+        return self.niveau.definition.liste_groupes,self.niveau.definition.dict_groupes
+
+    def setEtapeContext(self,etape):
+        """
+            Positionne l'etape qui sera utilisee dans NommerSdProd pour
+            decider si le concept passe pourra etre  nomme
+        """
+        self._etape_context=etape
+
+    def resetContext(self):
+        """
+            Cette methode reinitialise le contexte glissant pour pouvoir
+            tenir compte des modifications de l'utilisateur : craation
+            de commandes, nommage de concepts, etc.
+        """
+        #print "resetContext",self,self.nom
+        self.currentContext={}
+        self.index_etape_courante=0
+        ind={}
+        for i,etape in enumerate(self.etapes):
+            ind[etape]=i
+        self.index_etapes=ind
+
+    #   for etape in self.etapes:
+    #       etape.resetContext()
+
+    def delSdprod(self,sd):
+        """
+            Supprime la SD sd de la liste des sd et des dictionnaires de contexte
+        """
+        #print "delSdprod",self,sd
+        #print "delSdprod",self.sds
+        #print "delSdprod",self.g_context
+        #print "delSdprod",self.sdsDict
+        #if sd in self.sds : self.sds.remove(sd)
+        if sd.nom in self.g_context : del self.g_context[sd.nom]
+        if sd.nom in self.sdsDict : del self.sdsDict[sd.nom]
+
+    def delParam(self,param):
+        """
+            Supprime le parametre param de la liste des paramatres
+            et du contexte gobal
+        """
+        if param in self.params : self.params.remove(param)
+        if param.nom in self.g_context : del self.g_context[param.nom]
+
+    def delFonction(self,fonction):
+        """
+            Supprime la fonction fonction de la liste des fonctions
+            et du contexte gobal
+        """
+        if fonction in self.fonctions : self.fonctions.remove(fonction)
+        if fonction.nom in self.g_context: del self.g_context[fonction.nom]
+
+    def appendSdProd(self,sd):
+        """
+            Ajoute la SD sd a la liste des sd en verifiant au prealable qu'une SD de
+            meme nom n'existe pas deja
+        """
+        if sd == None or sd.nom == None:return
+        o=self.sdsDict.get(sd.nom,None)
+        if isinstance(o,ASSD):
+            raise AsException(tr("Nom de concept deja defini "+ sd.nom))
+        self.sdsDict[sd.nom]=sd
+        self.g_context[sd.nom] = sd
+        #if sd not in self.sds : self.sds.append(sd)
+
+    def appendParam(self,param):
+        """
+            Ajoute le parametre param a la liste des params
+            et au contexte global
+        """
+        # il faudrait verifier qu'un parametre de meme nom n'existe pas deja !!!
+        if param not in self.params : self.params.append(param)
+        self.g_context[param.nom]=param
+
+    def appendFonction(self,fonction):
+        """
+            Ajoute la fonction fonction a la liste des fonctions
+            et au contexte global
+        """
+        # il faudrait verifier qu'une fonction de meme nom n'existe pas deja !!!
+        if fonction not in self.fonctions : self.fonctions.append(fonction)
+        self.g_context[fonction.nom]=fonction
+
+    def deleteConcept(self,sd):
+        """
+            Inputs :
+               - sd=concept detruit
+            Fonction :
+            Mettre a jour les etapes du JDC suite a la disparition du
+            concept sd
+            Seuls les mots cles simples MCSIMP font un traitement autre
+            que de transmettre aux fils
+        """
+        for etape in self.etapes :
+            etape.deleteConcept(sd)
+            #PN PN PN pour les matrices ????
+            #self.getVariables_avant(etape)
+
+    def replaceConceptAfterEtape(self,etape,old_sd,sd):
+        """
+            Met a jour les etapes du JDC qui sont apres etape en fonction
+            du remplacement du concept sd
+        """
+        index = self.etapes.index(etape)+1
+        if index == len(self.etapes) :
+            return # etape est la derniere etape du jdc ...on ne fait rien !
+        for child in self.etapes[index:]:
+            child.replaceConcept(old_sd,sd)
+
+    def updateConceptAfterEtape(self,etape,sd):
+        """
+            Met a jour les etapes du JDC qui sont apres etape en fonction
+            de la modification (principalement nommage) du concept sd
+        """
+        if etape is None:
+            #On traite toutes les etapes
+            index=0
+        else:
+            index = self.etapes.index(etape)+1
+        if index == len(self.etapes) :
+            return # etape est la derniere etape du jdc ...on ne fait rien !
+        for child in self.etapes[index:]:
+            child.updateConcept(sd)
+
+    def dumpState(self):
+        #print(("JDC.state: ",self.state))
+        for etape in self.etapes :
+            print((etape.nom+".state: ",etape.state))
+
+    def changeUnit(self,unit,etape,old_unit):
+        #print "changeUnit",unit,etape,old_unit
+        #print id(self.recorded_units),self.recorded_units
+        #if self.recorded_units.has_key(old_unit):del self.recorded_units[old_unit]
+        self.recordUnit(unit,etape)
+
+    def recordUnit(self,unit,etape):
+        """Enregistre les unites logiques incluses et les infos relatives a l'etape"""
+        #print "recordUnit",unit,etape
+        if unit is None:
+            # Cas de POURSUITE
+            self.recorded_units[None]=(etape.fichier_ini ,etape.fichier_text,etape.recorded_units)
+        else:
+            self.recorded_units[unit]=(etape.fichier_ini ,etape.fichier_text,etape.recorded_units)
+        #print id(self.recorded_units),self.recorded_units
+        #print self.recorded_units.get(None,(None,"",{}))[2]
+        #print self.recorded_units.get(None,(None,"",{}))[2].get(None,(None,"",{}))
+
+    def changeFichier(self,fichier):
         self.finModif()
-        return objet
-      else :
-        # On veut ajouter une nouvelle commande
-        try:
-          self.setCurrentStep()
-          cmd=self.getCmd(name)
-          # L'appel a make_objet n'a pas pour effet d'enregistrer l'etape
-          # aupres du step courant car editmode vaut 1
-          # Par contre elle a le bon parent grace a setCurrentStep
-          e=cmd.make_objet()
-          if pos == None : pos = 0
-          self.etapes.insert(pos,e)
-          self.resetCurrentStep()
-          self.resetContext()
-          self.editmode=0
-          self.activeEtapes()
-          self.enregistreEtapePyxb(e,pos)
-          # PN fait ds self.activeEtapes
-          CONNECTOR.Emit(self,"add",e)
-          self.finModif()
-          return e
-        except AsException as e:
-          traceback.print_exc()
-          self.resetCurrentStep()
-          self.editmode=0
-          raise AsException(tr("Impossible d'ajouter la commande")+name + '\n')
+
+    def evalInContext(self,valeur,etape):
+        """ Tente d'evaluer valeur dans le contexte courant de etape
+            Retourne le parametre valeur inchange si l'evaluation est impossible
+        """
+        #contexte initial du jdc
+        context=self.condition_context.copy()
+        #contexte courant des concepts. Il contient les parametres
+        context.update(self.getContexteAvant(etape))
+        try :
+            objet = eval(valeur,context)
+            return objet
         except:
-        #else :
-          traceback.print_exc()
-          self.resetCurrentStep()
-          self.editmode=0
-          raise AsException(tr("Impossible d ajouter la commande")+name)
-
-   def close(self):
-      #print "JDC.close",self
-      for etape in self.etapes:
-          if hasattr(etape,"close"):etape.close()
-      CONNECTOR.Emit(self,"close")
-
-   def setCurrentStep(self):
-      CONTEXT.unsetCurrentStep()
-      CONTEXT.setCurrentStep(self)
-
-   def resetCurrentStep(self):
-      CONTEXT.unsetCurrentStep()
-
-   def listeMcPresents(self):
-      return []
-
-   def getSdAvantEtape(self,nom_sd,etape):
-      return self.getContexteAvant(etape).get(nom_sd,None)
-
-   def getSdApresEtapeAvecDetruire(self,nom_sd,sd,etape,avec='non'):
-      """ 
-           Cette methode retourne la SD sd de nom nom_sd qui est eventuellement
-           definie apres etape en tenant compte des concepts detruits
-           Si avec vaut 'non' exclut etape de la recherche
-      """
-      #print "JDC.getSdApresEtapeAvecDetruire",nom_sd,sd
-      ietap=self.etapes.index(etape)
-      if avec == 'non':ietap=ietap+1
-      d={nom_sd:sd}
-      for e in self.etapes[ietap:]:
-         if e.isActif():
-            e.updateContext(d)
-            autre_sd=d.get(nom_sd,None)
-            if autre_sd is None:
-              # Le concept a ete detruit. On interrompt la recherche car il n'y a
-              # pas eu de redefinition du concept (il n'y a pas de conflit potentiel).
-              return None
-            if autre_sd is not sd :
-              # L'etape produit un concept different de meme nom. La situation n'est
-              # pas saine (sauf peut etre si reuse ???)
-              if hasattr(e,'reuse') and e.reuse == autre_sd:
-                 # Le concept etant reutilise, on interrompt la recherche. 
-                 # On considere qu'il n'y a pas de nouveau concept defini
-                 # meme si dans les etapes suivantes le concept est detruit
-                 # et un concept de meme nom cree.
-                 # AVERIFIER : avec reuse le concept devrait etre le meme
-                 # le passage par ici est tres improbable
-                 return None
-              else:
-                 # Le concept est produit par l'etape (Il y a conflit potentiel).
-                 # Le concept est redefini par une etape posterieure.
-                 return autre_sd
-      # Pas de destruction du concept ni de redefinition. On retourne le
-      # concept initial
-      return sd
-
-   def getSdApresEtape(self,nom_sd,etape,avec='non'):
-      """ 
-           Cette methode retourne la SD de nom nom_sd qui est eventuellement
-           definie apres etape 
-           Si avec vaut 'non' exclut etape de la recherche
-      """
-      ietap=self.etapes.index(etape)
-      if avec == 'non':ietap=ietap+1
-      for e in self.etapes[ietap:]:
-        sd=e.getSdprods(nom_sd)
-        if sd:
-          if hasattr(e,'reuse'):
-            if e.reuse != sd:
-              return sd
-      return None
-
-   def getSdAutourEtape(self,nom_sd,etape,avec='non'):
-      """
-           Fonction: retourne la SD de nom nom_sd qui est eventuellement
-           definie avant ou apres etape
-           Permet de verifier si un concept de meme nom existe dans le perimetre 
-           d'une etape
-           Si avec vaut 'non' exclut etape de la recherche
-      """
-      sd=self.getSdAvantEtape(nom_sd,etape)
-      if sd:return sd
-      sd=self.getSdApresEtape(nom_sd,etape,avec)
-      if sd:return sd
-      # Pour tenir compte des UserASSD
-      if nom_sd in self.sdsDict.keys() : 
-         sd=self.sdsDict[nom_sd]
-         return sd
-
-   def getContexte_apres(self,etape):
-      """
-         Retourne le dictionnaire des concepts connus apres etape
-         On tient compte des commandes qui modifient le contexte
-         comme DETRUIRE ou les macros
-         Si etape == None, on retourne le contexte en fin de JDC
-      """
-      if not etape: return self.getContexteAvant(etape)
-
-      d=self.getContexteAvant(etape)
-      if etape.isActif():etape.updateContext(d)
-      self.index_etape_courante=self.index_etape_courante+1
-      return d
-
-   def activeEtapes(self):
-      """
-      """
-      for etape in self.etapes:
-           etape.active()
-
-   def deplaceEntite(self,indexNoeudACopier,indexNoeudOuColler,pos):
-      """
-          Pour le cut
-      """
-      if indexNoeudACopier==indexNoeudOuColler:return
-      etapeACopier=self.etapes[indexNoeudACopier]
-      try :
-        sd=self.etapes[indexNoeudACopier].sd
-      except :
-        sd=None
-      if pos=='before' and indexNoeudOuColler==0 : 
-         self.etapes2=[etapeACopier,]+self.etapes[0:indexNoeudACopier]+self.etapes[indexNoeudACopier+1:]
-      elif indexNoeudACopier < indexNoeudOuColler :
-         self.etapes2=self.etapes[0:indexNoeudACopier]+self.etapes[indexNoeudACopier+1:indexNoeudOuColler+1]+[etapeACopier,]+self.etapes[indexNoeudOuColler+1:]
-      else:
-         self.etapes2=self.etapes[0:indexNoeudOuColler+1]+[etapeACopier,]+self.etapes[indexNoeudOuColler+1:indexNoeudACopier]+self.etapes[indexNoeudACopier+1:]
-      self.etapes=self.etapes2
-      if indexNoeudACopier < indexNoeudOuColler :
-        self.deleteConceptEntreEtapes(indexNoeudACopier,indexNoeudOuColler,sd)
-      self.resetContext()
-      for e in self.etapes :
-         e.state = 'modified'
-      self.controlContextApres(None)
-      return 1
-
-
-   def suppEntite(self,etape) :
-      """  
-          Cette methode a pour fonction de supprimer une etape dans 
-          un jeu de commandes
-          Retourne 1 si la suppression a pu etre effectuee,
-          Retourne 0 dans le cas contraire
-      """
-      #PN correction de bugs 
-      print ('suppEntite', etape.nom)
-      if etape not in self.etapes: return 0
-
-      self.initModif()
-      index_etape=self.etapes.index(etape)
-
-      #etape.delObjPyxb()
-      self.etapes.remove(etape)
-
-      if etape.niveau is not self:
-        # Dans ce cas l'etape est enregistree dans un niveau
-        # Il faut la desenregistrer
-        etape.niveau.unregister(etape)
-
-      etape.supprimeSdProds()
-      etape.close()
-      etape.supprime()
-      self.activeEtapes()
-
-      # Apres suppression de l'etape il faut controler que les etapes
-      # suivantes ne produisent pas des concepts DETRUITS dans op_init de etape
-      if index_etape > 0: 
-         index_etape=index_etape-1
-         etape=self.etapes[index_etape]
-      else:
-         etape=None
-      self.controlContextApres(etape)
-     
-      self.resetContext()
-      CONNECTOR.Emit(self,"supp",etape)
-      self.finModif()
-      return 1
-
-   def controlContextApres(self,etape):
-      """
-         Cette methode verifie que les etapes apres l'etape etape
-         ont bien des concepts produits acceptables (pas de conflit de 
-         nom principalement)
-         Si des concepts produits ne sont pas acceptables ils sont supprimes.
-         Effectue les verifications sur les etapes du jdc mais aussi sur les
-         jdc parents s'ils existent.
-      """
-      print ("controlContextApres",self,etape)
-      #Regularise les etapes du jdc apres l'etape etape
-      self.controlJdcContextApres(etape)
-
-   def controlJdcContextApres(self,etape):
-      """
-          Methode semblable a controlContextApres mais ne travaille
-          que sur les etapes et sous etapes du jdc
-      """
-      print ("controlJdcContextApres",self,etape)
-      if etape is None:
-         # on demarre de la premiere etape
-         index_etape=0
-      else:
-         index_etape=self.etapes.index(etape)+1
-
-      try:
-         etape=self.etapes[index_etape]
-      except:
-         #derniere etape du jdc : rien a faire
-         return
-
-      context=self.getContexteAvant(etape)
-      for e in self.etapes[index_etape:]:
-          e.controlSdprods(context)
-          e.updateContext(context)
-
-   def analyse(self):
-         self.compile()
-         self.execCompile()
-         if not self.cr.estvide():return
-         self.activeEtapes()
-         if self.mc_globaux != {} : self.activeBlocsGlobaux()
-
-   def analyseXML(self):
-         print ('analyseXML')
-         print (self.procedure)
-         self.setCurrentContext()
-         self.analyseFromXML()
-
-   def registerParametre(self,param):
-      """
-          Cette methode sert a ajouter un parametre dans la liste des parametres
-      """
-      self.params.append(param)
-
-   def registerFonction(self,fonction):
-      """
-          Cette methode sert a ajouter une fonction dans la liste des fonctions
-      """
-      self.fonctions.append(fonction)
-
-   def deleteParam(self,param):
-      """
-          Supprime le parametre param de la liste des parametres
-          et du contexte gobal
-      """
-      if param in self.params : self.params.remove(param)
-      if param.nom in self.g_context : del self.g_context[param.nom]
-
-   def getParametresFonctionsAvantEtape(self,etape):
-      """
-          Retourne deux elements :
-          - une liste contenant les noms des parametres (constantes ou EVAL) 
-            definis avant etape
-          - une liste contenant les formules definies avant etape
-      """
-      l_constantes = []
-      l_fonctions = []
-      # on recupere le contexte avant etape
-      # on ne peut mettre dans les deux listes que des elements de ce contexte
-      d=self.getContexteAvant(etape)
-      # construction de l_constantes
-      for param in self.params:
-        nom = param.nom
-        if not nom : continue
-        if nom in d: l_constantes.append(nom)
-      # construction de l_fonctions
-      for form in self.fonctions:
-        nom = form.nom
-        if not nom : continue
-        if nom in d: l_fonctions.append(form.getFormule())
-
-      # on ajoute les concepts produits par DEFI_VALEUR
-      # XXX On pourrait peut etre faire plutot le test sur le type
-      # de concept : entier, reel, complexe, etc.
-      for k,v in d.items():
-         if hasattr(v,'etape') and v.etape.nom in ('DEFI_VALEUR',):
-            l_constantes.append(k)
-
-      # on retourne les deux listes
-      return l_constantes,l_fonctions
-
-   def getNbEtapesAvant(self,niveau):
-      """ 
-          Retourne le nombre d etapes avant le debut de niveau
-      """
-      nb=0
-      for niv in self.etapes_niveaux:
-        if niv == niveau:break
-        nb=nb+len(niv.etapes)
-      return nb
-
-   def initModif(self):
-      """
-      Methode appelee au moment ou une modification va etre faite afin de 
-      declencher d'eventuels traitements pre-modification
-      """
-      #print "initModif",self
-      self.state = 'modified'
-
-   def finModif(self):
-      #print "finModif",self
-      CONNECTOR.Emit(self,"valid")
-      self.isValid()
-      pass
-
-   def deepUpdateConditionBloc(self,motClef=None):
-      # pour le moment, on ne fait rien
-      self.getJdcRoot().recalculeValiditeApresChangementGlobalJdc(motClef)
-      #raise EficasException(tr("Pas implemente"))
-
-   def updateConditionBloc(self):
-      # pour le moment, on ne fait rien
-      raise EficasException(tr("Pas implemente"))
-
-   def getListeMcInconnus(self):
-     """
-     Retourne une liste contenant les mots-cles inconnus a la relecture du JDC
-     """
-     # cette liste a le format suivant : [etape,(bloc,mcfact,...),nom_mc,valeur_mc]
-     l_mc = []
-     for etape in self.etapes :
-         if etape.isActif() :
-            if not etape.isValid() :
-               l = etape.getListeMcInconnus()
-               if l : l_mc.extend(l)
-     return l_mc    
-
-   def getGenealogiePrecise(self):
-      return []
-
-   def getGenealogie(self):
-      """
-          Retourne la liste des noms des ascendants de l'objet self
-          jusqu'a la premiere ETAPE parent.
-      """
-      return []
-
-   def getListeCmd(self):
-      """
-          Retourne la liste des commandes du catalogue
-      """
-      return self.niveau.definition.getListeCmd()
-
-   def getGroups(self):
-      """
-          Retourne la liste des groupes
-      """
-      return self.niveau.definition.liste_groupes,self.niveau.definition.dict_groupes
-
-   def setEtapeContext(self,etape):
-      """
-          Positionne l'etape qui sera utilisee dans NommerSdProd pour
-          decider si le concept passe pourra etre  nomme
-      """
-      self._etape_context=etape
-
-   def resetContext(self):
-      """ 
-          Cette methode reinitialise le contexte glissant pour pouvoir
-          tenir compte des modifications de l'utilisateur : craation
-          de commandes, nommage de concepts, etc.
-      """
-      #print "resetContext",self,self.nom
-      self.currentContext={}
-      self.index_etape_courante=0
-      ind={}
-      for i,etape in enumerate(self.etapes):
-        ind[etape]=i
-      self.index_etapes=ind
-
-   #   for etape in self.etapes:
-   #       etape.resetContext()
-
-   def delSdprod(self,sd):
-      """
-          Supprime la SD sd de la liste des sd et des dictionnaires de contexte
-      """
-      #print "delSdprod",self,sd
-      #print "delSdprod",self.sds
-      #print "delSdprod",self.g_context
-      #print "delSdprod",self.sdsDict
-      #if sd in self.sds : self.sds.remove(sd)
-      if sd.nom in self.g_context : del self.g_context[sd.nom]
-      if sd.nom in self.sdsDict : del self.sdsDict[sd.nom]
-
-   def delParam(self,param):
-      """
-          Supprime le parametre param de la liste des paramatres
-          et du contexte gobal
-      """
-      if param in self.params : self.params.remove(param)
-      if param.nom in self.g_context : del self.g_context[param.nom]
-
-   def delFonction(self,fonction):
-      """
-          Supprime la fonction fonction de la liste des fonctions
-          et du contexte gobal
-      """
-      if fonction in self.fonctions : self.fonctions.remove(fonction)
-      if fonction.nom in self.g_context: del self.g_context[fonction.nom]
-
-   def appendSdProd(self,sd):
-      """
-          Ajoute la SD sd a la liste des sd en verifiant au prealable qu'une SD de
-          meme nom n'existe pas deja
-      """
-      if sd == None or sd.nom == None:return
-      o=self.sdsDict.get(sd.nom,None)
-      if isinstance(o,ASSD):
-         raise AsException(tr("Nom de concept deja defini "+ sd.nom))
-      self.sdsDict[sd.nom]=sd
-      self.g_context[sd.nom] = sd
-      #if sd not in self.sds : self.sds.append(sd)
-
-   def appendParam(self,param):
-      """
-          Ajoute le parametre param a la liste des params
-          et au contexte global
-      """
-      # il faudrait verifier qu'un parametre de meme nom n'existe pas deja !!!
-      if param not in self.params : self.params.append(param)
-      self.g_context[param.nom]=param
-
-   def appendFonction(self,fonction):
-      """
-          Ajoute la fonction fonction a la liste des fonctions
-          et au contexte global
-      """
-      # il faudrait verifier qu'une fonction de meme nom n'existe pas deja !!!
-      if fonction not in self.fonctions : self.fonctions.append(fonction)
-      self.g_context[fonction.nom]=fonction
-
-   def deleteConcept(self,sd):
-      """
-          Inputs :
-             - sd=concept detruit
-          Fonction :
-          Mettre a jour les etapes du JDC suite a la disparition du
-          concept sd
-          Seuls les mots cles simples MCSIMP font un traitement autre
-          que de transmettre aux fils
-      """
-      for etape in self.etapes :
-        etape.deleteConcept(sd)
-        #PN PN PN pour les matrices ????
-        #self.getVariables_avant(etape)
-
-   def replaceConceptAfterEtape(self,etape,old_sd,sd):
-      """
-          Met a jour les etapes du JDC qui sont apres etape en fonction
-          du remplacement du concept sd
-      """
-      index = self.etapes.index(etape)+1
-      if index == len(self.etapes) :
-         return # etape est la derniere etape du jdc ...on ne fait rien !
-      for child in self.etapes[index:]:
-        child.replaceConcept(old_sd,sd)
-
-   def updateConceptAfterEtape(self,etape,sd):
-      """
-          Met a jour les etapes du JDC qui sont apres etape en fonction
-          de la modification (principalement nommage) du concept sd
-      """
-      if etape is None:
-         #On traite toutes les etapes
-         index=0
-      else:
-         index = self.etapes.index(etape)+1
-      if index == len(self.etapes) :
-         return # etape est la derniere etape du jdc ...on ne fait rien !
-      for child in self.etapes[index:]:
-        child.updateConcept(sd)
-
-   def dumpState(self):
-      print(("JDC.state: ",self.state))
-      for etape in self.etapes :
-         print((etape.nom+".state: ",etape.state))
-      
-   def changeUnit(self,unit,etape,old_unit):
-      #print "changeUnit",unit,etape,old_unit
-      #print id(self.recorded_units),self.recorded_units
-      #if self.recorded_units.has_key(old_unit):del self.recorded_units[old_unit]
-      self.recordUnit(unit,etape)
-
-   def recordUnit(self,unit,etape):
-      """Enregistre les unites logiques incluses et les infos relatives a l'etape"""
-      #print "recordUnit",unit,etape
-      if unit is None:
-         # Cas de POURSUITE
-         self.recorded_units[None]=(etape.fichier_ini ,etape.fichier_text,etape.recorded_units)
-      else:
-         self.recorded_units[unit]=(etape.fichier_ini ,etape.fichier_text,etape.recorded_units)
-      #print id(self.recorded_units),self.recorded_units
-      #print self.recorded_units.get(None,(None,"",{}))[2]
-      #print self.recorded_units.get(None,(None,"",{}))[2].get(None,(None,"",{}))
-
-   def changeFichier(self,fichier):
-       self.finModif()
-
-   def evalInContext(self,valeur,etape):
-      """ Tente d'evaluer valeur dans le contexte courant de etape
-          Retourne le parametre valeur inchange si l'evaluation est impossible
-      """
-      #contexte initial du jdc
-      context=self.condition_context.copy()
-      #contexte courant des concepts. Il contient les parametres
-      context.update(self.getContexteAvant(etape))
-      try :
-         objet = eval(valeur,context)
-         return objet
-      except:
-         #traceback.print_exc()
-         pass
-      return valeur
+            #traceback.print_exc()
+            pass
+        return valeur
 
 #ATTENTION SURCHARGE : cette methode doit etre gardee en synchronisation avec celle de Noyau
-   def supprime(self):
-      Noyau.N_JDC.JDC.supprime(self)
-      for etape in self.etapes:
-         etape.supprime()
-      self.appliEficas=None
-      self.g_context={}
-      self.const_context={}
-      self.sdsDict={}
-      self.mc_globaux={}
-      self.currentContext={}
-      self.condition_context={}
-      self.etapes_niveaux=[]
-      self.niveau=None
-      self.params=[]
-      self.fonctions=[]
-      self._etape_context=None
-      self.etapes=[]
-       
+    def supprime(self):
+        Noyau.N_JDC.JDC.supprime(self)
+        for etape in self.etapes:
+            etape.supprime()
+        self.appliEficas=None
+        self.g_context={}
+        self.const_context={}
+        self.sdsDict={}
+        self.mc_globaux={}
+        self.currentContext={}
+        self.condition_context={}
+        self.etapes_niveaux=[]
+        self.niveau=None
+        self.params=[]
+        self.fonctions=[]
+        self._etape_context=None
+        self.etapes=[]
+
 #ATTENTION SURCHARGE : cette methode doit etre gardee en synchronisation avec celle de Noyau
-   def register(self,etape):
-      """
-           Cette methode ajoute  etape dans la liste
-           des etapes self.etapes et retourne l identificateur d'etape
-           fourni par l appel a gRegister
-
-           A quoi sert editmode ?
-              - Si editmode vaut 1, on est en mode edition de JDC. On cherche
-                a enregistrer une etape que l'on a creee avec eficas (en passant
-                par addEntite) auquel cas on ne veut recuperer que son numero
-                d'enregistrement et c'est addEntite qui l'enregistre dans
-                self.etapes a la bonne place...
-              - Si editmode vaut 0, on est en mode relecture d'un fichier de
-                commandes et on doit enregistrer l'etape a la fin de self.etapes
-                (dans ce cas l'ordre des etapes est bien l'ordre chronologique
-                de leur creation   )
-      """
-      #import traceback
-      #traceback.print_stack()
-      if not self.editmode:
-         self.etapes.append(etape)
-         self.index_etapes[etape] = len(self.etapes) - 1
-      else:
-         pass
-      return self.gRegister(etape)
+    def register(self,etape):
+        """
+             Cette methode ajoute  etape dans la liste
+             des etapes self.etapes et retourne l identificateur d'etape
+             fourni par l appel a gRegister
+
+             A quoi sert editmode ?
+                - Si editmode vaut 1, on est en mode edition de JDC. On cherche
+                  a enregistrer une etape que l'on a creee avec eficas (en passant
+                  par addEntite) auquel cas on ne veut recuperer que son numero
+                  d'enregistrement et c'est addEntite qui l'enregistre dans
+                  self.etapes a la bonne place...
+                - Si editmode vaut 0, on est en mode relecture d'un fichier de
+                  commandes et on doit enregistrer l'etape a la fin de self.etapes
+                  (dans ce cas l'ordre des etapes est bien l'ordre chronologique
+                  de leur creation   )
+        """
+        #import traceback
+        #traceback.print_stack()
+        if not self.editmode:
+            self.etapes.append(etape)
+            self.index_etapes[etape] = len(self.etapes) - 1
+        else:
+            pass
+        return self.gRegister(etape)
 
 #ATTENTION SURCHARGE : cette methode doit etre gardee en synchronisation avec celle de Noyau
-   def nommerSDProd(self,sd,sdnom,restrict='non'):
-      """
-          Nomme la SD apres avoir verifie que le nommage est possible :
-          nom non utilise
-          Si le nom est deja utilise, leve une exception
-          Met le concept cree dans le concept global g_context
-      """
-      # XXX En mode editeur dans EFICAS, le nommage doit etre gere differemment
-      # Le dictionnaire g_context ne represente pas le contexte
-      # effectif avant une etape.
-      # Il faut utiliser getContexteAvant avec indication de l'etape
-      # traitee.
-      # Cette etape est indiquee par l'attribut _etape_context qui a ete
-      # positionne prealablement par un appel a setEtapeContext
-
-      if CONTEXT.debug : print(("JDC.nommerSDProd ",sd,sdnom))
-
-      if self._etape_context:
-         o=self.getContexteAvant(self._etape_context).get(sdnom,None)
-      else:
-         o=self.sdsDict.get(sdnom,None)
-
-      if isinstance(o,ASSD):
-         raise AsException(tr(" Nom de concept deja defini : "+ sdnom))
-
-      # ATTENTION : Il ne faut pas ajouter sd dans sds car il s y trouve deja.
-      # Ajoute a la creation (appel de regSD).
-      #print (' je pass ici, pour ', sdnom, self.sdsDict)
-      self.sdsDict[sdnom]=sd
-      sd.nom=sdnom
-
-      # En plus si restrict vaut 'non', on insere le concept dans le contexte du JDC
-      if restrict == 'non':
-         self.g_context[sdnom]=sd
-
-   def deleteConceptEntreEtapes(self,index1,index2,sd):
-      if index2 <= index1 :return
-      for child in self.etapes[index1:index2]:
-        child.deleteConcept(sd)
-
-   def deleteConceptAfterEtape(self,etape,sd):
-      """
-          Met a jour les etapes du JDC qui sont apres etape en fonction
-          de la disparition du concept sd
-      """
-      index = self.etapes.index(etape)+1
-      if index == len(self.etapes) :
-         return # etape est la derniere etape du jdc ...on ne fait rien !
-      for child in self.etapes[index:]:
-        child.deleteConcept(sd)
+    def nommerSDProd(self,sd,sdnom,restrict='non'):
+        """
+            Nomme la SD apres avoir verifie que le nommage est possible :
+            nom non utilise
+            Si le nom est deja utilise, leve une exception
+            Met le concept cree dans le concept global g_context
+        """
+        # XXX En mode editeur dans EFICAS, le nommage doit etre gere differemment
+        # Le dictionnaire g_context ne represente pas le contexte
+        # effectif avant une etape.
+        # Il faut utiliser getContexteAvant avec indication de l'etape
+        # traitee.
+        # Cette etape est indiquee par l'attribut _etape_context qui a ete
+        # positionne prealablement par un appel a setEtapeContext
+
+        if CONTEXT.debug : print(("JDC.nommerSDProd ",sd,sdnom))
+
+        if self._etape_context:
+            o=self.getContexteAvant(self._etape_context).get(sdnom,None)
+        else:
+            o=self.sdsDict.get(sdnom,None)
+
+        if isinstance(o,ASSD):
+            raise AsException(tr(" Nom de concept deja defini : "+ sdnom))
+
+        # ATTENTION : Il ne faut pas ajouter sd dans sds car il s y trouve deja.
+        # Ajoute a la creation (appel de regSD).
+        #print (' je pass ici, pour ', sdnom, self.sdsDict)
+        self.sdsDict[sdnom]=sd
+        sd.nom=sdnom
+
+        # En plus si restrict vaut 'non', on insere le concept dans le contexte du JDC
+        if restrict == 'non':
+            self.g_context[sdnom]=sd
+
+    def deleteConceptEntreEtapes(self,index1,index2,sd):
+        if index2 <= index1 :return
+        for child in self.etapes[index1:index2]:
+            child.deleteConcept(sd)
+
+    def deleteConceptAfterEtape(self,etape,sd):
+        """
+            Met a jour les etapes du JDC qui sont apres etape en fonction
+            de la disparition du concept sd
+        """
+        index = self.etapes.index(etape)+1
+        if index == len(self.etapes) :
+            return # etape est la derniere etape du jdc ...on ne fait rien !
+        for child in self.etapes[index:]:
+            child.deleteConcept(sd)
 
 #ATTENTION SURCHARGE : les methodes ci-dessus surchargent des methodes de Noyau et Validation : a reintegrer
 
-   def getFile(self,unite=None,fic_origine=''):
-      """
-          Retourne le nom du fichier correspondant a un numero d'unite
-          logique (entier) ainsi que le source contenu dans le fichier
-      """
-      if self.appliEficas is not None:
-         # Si le JDC est relie a une appliEficascation maitre, on delegue la recherche
-         file,text= self.appliEficas.getFile(unite,fic_origine)
-      else:
-         file = None
-         if unite != None:
-            if os.path.exists(u"fort."+str(unite)):
-               file= "fort."+str(unite)
-         if file == None :
-            raise AsException(tr("Impossible de trouver le fichier correspondant a l'unite "+str( unite)))
-         if not os.path.exists(file):
-            raise AsException(str(unite)+ tr(" n'est pas un fichier existant"))
-         fproc=open(file,'r')
-         text=fproc.read()
-         fproc.close()
-      #if file == None : return None,None
-      text=text.replace('\r\n','\n')
-      if file:
-         linecache.cache[file]=0,0,text.split('\n'),file
-      return file,text
-
-   def isValid(self,cr='non'):
-     if hasattr(self,'valid'): old_valid=self.valid
-     else:old_valid=0
-     valid=Validation.V_JDC.JDC.isValid(self,cr)
-     if valid != old_valid:
-       CONNECTOR.Emit(self,"valid")
-     return valid
-
-   def getLNomsEtapes(self):
-      """ 
-          Retourne la liste des noms des etapes de self 
-      """
-      l=[]
-      for etape in self.etapes:
-        l.append(etape.nom)
-      return l
+    def getFile(self,unite=None,fic_origine=''):
+        """
+            Retourne le nom du fichier correspondant a un numero d'unite
+            logique (entier) ainsi que le source contenu dans le fichier
+        """
+        if self.appliEficas is not None:
+            # Si le JDC est relie a une appliEficascation maitre, on delegue la recherche
+            file,text= self.appliEficas.getFile(unite,fic_origine)
+        else:
+            file = None
+            if unite != None:
+                if os.path.exists(u"fort."+str(unite)):
+                    file= "fort."+str(unite)
+            if file == None :
+                raise AsException(tr("Impossible de trouver le fichier correspondant a l'unite "+str( unite)))
+            if not os.path.exists(file):
+                raise AsException(str(unite)+ tr(" n'est pas un fichier existant"))
+            fproc=open(file,'r')
+            text=fproc.read()
+            fproc.close()
+        #if file == None : return None,None
+        text=text.replace('\r\n','\n')
+        if file:
+            linecache.cache[file]=0,0,text.split('\n'),file
+        return file,text
+
+    def isValid(self,cr='non'):
+        if hasattr(self,'valid'): old_valid=self.valid
+        else:old_valid=0
+        valid=Validation.V_JDC.JDC.isValid(self,cr)
+        if valid != old_valid:
+            CONNECTOR.Emit(self,"valid")
+        return valid
+
+    def getLNomsEtapes(self):
+        """
+            Retourne la liste des noms des etapes de self
+        """
+        l=[]
+        for etape in self.etapes:
+            l.append(etape.nom)
+        return l
index 014e7a74937737c6046c68393e1f29ceda6f6cb9..46ada13e19c488713dbb43c9d0437cdce3bc97f5 100644 (file)
@@ -21,22 +21,22 @@ from __future__ import absolute_import
 from Noyau import N_JDC_CATA
 
 class JDC_CATA:
-  def __init__(self):
-    self.l_noms_entites=[]
+    def __init__(self):
+        self.l_noms_entites=[]
 
-  def getListeCmd(self):
-    self.l_noms_entites.sort()
-    return self.l_noms_entites
+    def getListeCmd(self):
+        self.l_noms_entites.sort()
+        return self.l_noms_entites
 
-  def getDocu(self):
-    return
+    def getDocu(self):
+        return
 
 
 #ATTENTION SURCHARGE: cette methode doit etre synchronisee avec celle du Noyau
-  def enregistre(self,commande):
-    """ 
-        Cette methode surcharge la methode de la classe du Noyau
-        Marche avec Noyau 
-    """
-    N_JDC_CATA.JDC_CATA.enregistre(self,commande)
-    self.l_noms_entites.append(commande.nom)
+    def enregistre(self,commande):
+        """
+            Cette methode surcharge la methode de la classe du Noyau
+            Marche avec Noyau
+        """
+        N_JDC_CATA.JDC_CATA.enregistre(self,commande)
+        self.l_noms_entites.append(commande.nom)
index b4346754a192565888a035222386edc4e034d352..975e3b6452038570551813a512fbaef4b71f1d45 100644 (file)
@@ -19,5 +19,5 @@
 #
 
 class LASSD:
-   def __repr__(self):
-       return self.getName()
+    def __repr__(self):
+        return self.getName()
index 0e29f26cd4f368563e994b4265b29b35c33cfdfa..5384ede503f7b965c29dc29585869a8a5abf06da 100644 (file)
@@ -46,749 +46,749 @@ import Accas # attention aux imports circulaires
 
 class MACRO_ETAPE(I_ETAPE.ETAPE):
 
-  def __init__(self):
-      self.typret=None
-      #indique si le jeu de commande inclus a pu etre analyse par convert
-      #pour etre editable (0=NON, 1=OUI)
-      self.text_converted=1
-      self.text_error=""
-      self.recorded_units={}
-
-  def getSdprods(self,nom_sd):
-    """ 
-         Fonction : retourne le concept produit par l etape de nom nom_sd
-         s il existe sinon None
-    """
-    if self.sd and self.sd.nom == nom_sd :return self.sd
-    for co in self.sdprods:
-      if co.nom == nom_sd:return co
-    if type(self.definition.op_init) == types.FunctionType:
-      d={}
-      self.definition.op_init(*(self,d))
-      return d.get(nom_sd,None)
-    return None
-
-  def getContexteJdc(self,fichier,text,doitEtreValide=1):
-    """ 
-         Interprete text comme un texte de jdc et retourne le contexte final.
-
-         Le contexte final est le dictionnaire des sd disponibles a la derniere etape.
-         Si text n'est pas un texte de jdc valide, retourne None
-         ou leve une exception
-         --> utilisee par ops.POURSUITE et INCLUDE
-    """
-    #print ("getContexteJdc",self,self.nom, text)
-    # On recupere l'etape courante
-    step=CONTEXT.getCurrentStep()
-    self.text_included_converted=0
-    try:
-    #if 1 :
-       # on essaie de creer un objet JDC auxiliaire avec un contexte initial
-       # Attention getContexteAvant retourne un dictionnaire qui contient
-       # le contexte courant. Ce dictionnaire est reactualise regulierement.
-       # Si on veut garder l'etat du contexte fige, il faut en faire une copie.
-       context_ini = self.parent.getContexteAvant(self).copy()
-
-       # Indispensable avant de creer un nouveau JDC
-       CONTEXT.unsetCurrentStep()
-       args=self.jdc.args
-       prefix_include=None
-       if hasattr(self,'prefix'):
-          prefix_include=self.prefix
-       # ATTENTION : le dictionnaire recorded_units sert a memoriser les unites des 
-       # fichiers inclus. Il est preferable de garder le meme dictionnaire pendant
-       # tout le traitement et de ne pas le reinitialiser brutalement (utiliser 
-       # clear plutot) si on ne veut pas perdre la memoire des unites.
-       # En principe si la memorisation est faite au bon moment il n'est pas necessaire
-       # de prendre cette precaution mais ce n'est pas vrai partout.
-       old_recorded_units=self.recorded_units.copy()
-
-       # on supprime l'ancien jdc_aux s'il existe
-       if hasattr(self,'jdc_aux') and self.jdc_aux:
-          self.jdc_aux.supprime_aux()
-
-       if fichier is None:fichier="SansNom"
-
-       # Il faut convertir le texte inclus en fonction du format
-       # sauf les INCLUDE_MATERIAU
-       self.text_converted=0
-       self.text_error=""
-       if self.nom != "INCLUDE_MATERIAU":
-          format=self.jdc.appliEficas.format_fichier
-          #on force a python pour Carmel
-          if format=="CARMEL3D" : format="python"
-          import convert
-          if format in convert.plugins :
-              # Le convertisseur existe on l'utilise
-              p=convert.plugins[format]()
-              p.text=text
-              text=p.convert('exec',self.jdc.appliEficas)
-              #Si le fichier ne peut pas etre converti, le cr n'est pas vide
-              #et le texte est retourne tel que
-              if not p.cr.estvide(): 
-                  self.text_converted=0
-                  self.text_error=str(p.cr)
-              else:
-                  self.text_converted=1
-
-
-       if hasattr(self,'sd') and self.sd != None : context_ini[self.sd.nom]=self.sd
-       j=self.JdC_aux( procedure=text, nom=fichier,
-                                appliEficas=self.jdc.appliEficas,
-                                cata=self.jdc.cata,
-                                cata_ord_dico=self.jdc.cata_ordonne_dico,
-                                context_ini = context_ini,
-                                jdc_pere=self.jdc,etape_include=self,
-                                prefix_include=prefix_include,
-                                recorded_units=self.recorded_units,
-                                old_recorded_units=old_recorded_units,**args)
-
-       j.analyse()
-       if not j.cr.estvide(): self.text_included_converted=0
-       else : self.text_included_converted=1
-       self.text_included_error=str(j.cr)
-       # On recupere les etapes internes (pour validation)
-       self.etapes=j.etapes
-       self.jdc_aux=j
-       self.jdc.jdcDict=self.jdc_aux
-
-    except:
-    #else :
-       traceback.print_exc()
-       # On retablit l'etape courante step
-       CONTEXT.unsetCurrentStep()
-       CONTEXT.setCurrentStep(step)
-       return None
-
-     
-    if not j.cr.estvide() and doitEtreValide:
-       # Erreurs dans l'INCLUDE. On garde la memoire du fichier 
-       # mais on n'insere pas les concepts
-       # On retablit l'etape courante step
-       #print (j.cr)
-       #print ("valid ",j.isValid())
-       CONTEXT.unsetCurrentStep()
-       CONTEXT.setCurrentStep(step)
-       raise EficasException(tr("Impossible de relire le fichier %s \n ")+ str(j.cr))
-
-
-    if not j.isValid() and doitEtreValide:
-       # L'INCLUDE n'est pas valide.
-       # on produit un rapport d'erreurs
-       cr=j.report()
-       #print ('cr', cr)
-       # On retablit l'etape courante step
-       CONTEXT.unsetCurrentStep()
-       CONTEXT.setCurrentStep(step)
-       self.jdc.cr.fatal("Le fichier include contient des erreurs ")
-       raise EficasException(tr("Le fichier include contient des erreurs "))
-
-
-    # Si aucune erreur rencontree
-    # ou qu on accepte un jdc incomplet
-    # On recupere le contexte de l'include verifie
-    try:
-       j_context=j.getVerifContexte()
-       #print j_context.keys()
-       #print j.g_context.keys()
-    except:
-       # On retablit l'etape courante step
-       CONTEXT.unsetCurrentStep()
-       CONTEXT.setCurrentStep(step)
-       raise EficasException(" ")
-
-    # Si on est arrive ici, le texte du fichier inclus (INCLUDE, POURSUITE, ...)
-    # est valide et inserable dans le JDC
-
-    # On remplit le dictionnaire des concepts produits inclus
-    # en retirant les concepts presents dans le  contexte initial
-    # On ajoute egalement le concept produit dans le sdsDict du parent
-    # sans verification car on est sur (verification integree) que 
-    # le nommage est possible
-    self.g_context.clear()
-    for k,v in j_context.items():
-       if (not k in context_ini) or (context_ini[k] != v):
-           self.g_context[k]=v
-           self.parent.sdsDict[k]=v
-
-    #Ce traitement n'est realise que dans les cas suivants:
-    #     - si convert n'a pas pu convertir le jeu de commandes
-    #     - et ce n'est pas un INCLUDE_MATERIAU
-    #On collecte les variables Python qui ne sont pas dans le contexte initial
-    #et dans le contexte valide et on en fait un pseudo-parametre (Variable)
-    if self.text_converted == 0 and self.nom != "INCLUDE_MATERIAU":
-        for k,v in j.g_context.items():
-            if k in context_ini:continue
-            if k in j_context:continue
-            if isinstance(v,ASSD):continue
-            if isinstance(v,I_ENTITE.ENTITE):continue
-            if isinstance(v,I_OBJECT.OBJECT):continue
-            if callable(v):continue
-            self.g_context[k]=param2.Variable(k,v)
-
-    # On recupere le contexte courant
-    self.currentContext=j.currentContext
-    self.index_etape_courante=j.index_etape_courante
-    self.jdc_aux=j
-
-    # On retablit l'etape courante step
-    CONTEXT.unsetCurrentStep()
-    CONTEXT.setCurrentStep(step)
-
-    return j_context
-
-  def reevalueSdJdc(self):
-     """
-         Avec la liste des SD qui ont ete supprimees, propage la 
-         disparition de ces SD dans toutes les etapes et descendants
-     """
-     #print "reevalueSdJdc"
-     l_sd_supp,l_sd_repl = self.diffContextes()
-     for sd in l_sd_supp:
-        self.parent.deleteConceptAfterEtape(self,sd)
-     for old_sd,sd in l_sd_repl:
-        self.parent.replaceConceptAfterEtape(self,old_sd,sd)
-
-  def diffContextes(self):
-     """ 
-         Realise la difference entre les 2 contextes 
-         old_contexte_fichier_init et contexte_fichier_init
-         cad retourne la liste des sd qui ont disparu ou ne derivent pas 
-         de la meme classe et des sd qui ont ete remplacees
-     """
-     if not hasattr(self,'old_contexte_fichier_init'):return [],[]
-     l_sd_suppressed = []
-     l_sd_replaced = []
-     for old_key in self.old_contexte_fichier_init:
-       if not old_key in self.contexte_fichier_init:
-         if isinstance(self.old_contexte_fichier_init[old_key],ASSD):
-           l_sd_suppressed.append(self.old_contexte_fichier_init[old_key])
-       else:
-         if isinstance(self.old_contexte_fichier_init[old_key],ASSD):
-            # Un concept de meme nom existe
-            old_class=self.old_contexte_fichier_init[old_key].__class__
-            if not isinstance(self.contexte_fichier_init[old_key],old_class):
-               # S'il n'est pas d'une classe derivee, on le supprime
-               l_sd_suppressed.append(self.old_contexte_fichier_init[old_key])
+    def __init__(self):
+        self.typret=None
+        #indique si le jeu de commande inclus a pu etre analyse par convert
+        #pour etre editable (0=NON, 1=OUI)
+        self.text_converted=1
+        self.text_error=""
+        self.recorded_units={}
+
+    def getSdprods(self,nom_sd):
+        """
+             Fonction : retourne le concept produit par l etape de nom nom_sd
+             s il existe sinon None
+        """
+        if self.sd and self.sd.nom == nom_sd :return self.sd
+        for co in self.sdprods:
+            if co.nom == nom_sd:return co
+        if type(self.definition.op_init) == types.FunctionType:
+            d={}
+            self.definition.op_init(*(self,d))
+            return d.get(nom_sd,None)
+        return None
+
+    def getContexteJdc(self,fichier,text,doitEtreValide=1):
+        """
+             Interprete text comme un texte de jdc et retourne le contexte final.
+
+             Le contexte final est le dictionnaire des sd disponibles a la derniere etape.
+             Si text n'est pas un texte de jdc valide, retourne None
+             ou leve une exception
+             --> utilisee par ops.POURSUITE et INCLUDE
+        """
+        #print ("getContexteJdc",self,self.nom, text)
+        # On recupere l'etape courante
+        step=CONTEXT.getCurrentStep()
+        self.text_included_converted=0
+        try:
+        #if 1 :
+            # on essaie de creer un objet JDC auxiliaire avec un contexte initial
+            # Attention getContexteAvant retourne un dictionnaire qui contient
+            # le contexte courant. Ce dictionnaire est reactualise regulierement.
+            # Si on veut garder l'etat du contexte fige, il faut en faire une copie.
+            context_ini = self.parent.getContexteAvant(self).copy()
+
+            # Indispensable avant de creer un nouveau JDC
+            CONTEXT.unsetCurrentStep()
+            args=self.jdc.args
+            prefix_include=None
+            if hasattr(self,'prefix'):
+                prefix_include=self.prefix
+            # ATTENTION : le dictionnaire recorded_units sert a memoriser les unites des
+            # fichiers inclus. Il est preferable de garder le meme dictionnaire pendant
+            # tout le traitement et de ne pas le reinitialiser brutalement (utiliser
+            # clear plutot) si on ne veut pas perdre la memoire des unites.
+            # En principe si la memorisation est faite au bon moment il n'est pas necessaire
+            # de prendre cette precaution mais ce n'est pas vrai partout.
+            old_recorded_units=self.recorded_units.copy()
+
+            # on supprime l'ancien jdc_aux s'il existe
+            if hasattr(self,'jdc_aux') and self.jdc_aux:
+                self.jdc_aux.supprime_aux()
+
+            if fichier is None:fichier="SansNom"
+
+            # Il faut convertir le texte inclus en fonction du format
+            # sauf les INCLUDE_MATERIAU
+            self.text_converted=0
+            self.text_error=""
+            if self.nom != "INCLUDE_MATERIAU":
+                format=self.jdc.appliEficas.format_fichier
+                #on force a python pour Carmel
+                if format=="CARMEL3D" : format="python"
+                import convert
+                if format in convert.plugins :
+                    # Le convertisseur existe on l'utilise
+                    p=convert.plugins[format]()
+                    p.text=text
+                    text=p.convert('exec',self.jdc.appliEficas)
+                    #Si le fichier ne peut pas etre converti, le cr n'est pas vide
+                    #et le texte est retourne tel que
+                    if not p.cr.estvide():
+                        self.text_converted=0
+                        self.text_error=str(p.cr)
+                    else:
+                        self.text_converted=1
+
+
+            if hasattr(self,'sd') and self.sd != None : context_ini[self.sd.nom]=self.sd
+            j=self.JdC_aux( procedure=text, nom=fichier,
+                                     appliEficas=self.jdc.appliEficas,
+                                     cata=self.jdc.cata,
+                                     cata_ord_dico=self.jdc.cata_ordonne_dico,
+                                     context_ini = context_ini,
+                                     jdc_pere=self.jdc,etape_include=self,
+                                     prefix_include=prefix_include,
+                                     recorded_units=self.recorded_units,
+                                     old_recorded_units=old_recorded_units,**args)
+
+            j.analyse()
+            if not j.cr.estvide(): self.text_included_converted=0
+            else : self.text_included_converted=1
+            self.text_included_error=str(j.cr)
+            # On recupere les etapes internes (pour validation)
+            self.etapes=j.etapes
+            self.jdc_aux=j
+            self.jdc.jdcDict=self.jdc_aux
+
+        except:
+        #else :
+            traceback.print_exc()
+            # On retablit l'etape courante step
+            CONTEXT.unsetCurrentStep()
+            CONTEXT.setCurrentStep(step)
+            return None
+
+
+        if not j.cr.estvide() and doitEtreValide:
+            # Erreurs dans l'INCLUDE. On garde la memoire du fichier
+            # mais on n'insere pas les concepts
+            # On retablit l'etape courante step
+            #print (j.cr)
+            #print ("valid ",j.isValid())
+            CONTEXT.unsetCurrentStep()
+            CONTEXT.setCurrentStep(step)
+            raise EficasException(tr("Impossible de relire le fichier %s \n ")+ str(j.cr))
+
+
+        if not j.isValid() and doitEtreValide:
+            # L'INCLUDE n'est pas valide.
+            # on produit un rapport d'erreurs
+            cr=j.report()
+            #print ('cr', cr)
+            # On retablit l'etape courante step
+            CONTEXT.unsetCurrentStep()
+            CONTEXT.setCurrentStep(step)
+            self.jdc.cr.fatal("Le fichier include contient des erreurs ")
+            raise EficasException(tr("Le fichier include contient des erreurs "))
+
+
+        # Si aucune erreur rencontree
+        # ou qu on accepte un jdc incomplet
+        # On recupere le contexte de l'include verifie
+        try:
+            j_context=j.getVerifContexte()
+            #print j_context.keys()
+            #print j.g_context.keys()
+        except:
+            # On retablit l'etape courante step
+            CONTEXT.unsetCurrentStep()
+            CONTEXT.setCurrentStep(step)
+            raise EficasException(" ")
+
+        # Si on est arrive ici, le texte du fichier inclus (INCLUDE, POURSUITE, ...)
+        # est valide et inserable dans le JDC
+
+        # On remplit le dictionnaire des concepts produits inclus
+        # en retirant les concepts presents dans le  contexte initial
+        # On ajoute egalement le concept produit dans le sdsDict du parent
+        # sans verification car on est sur (verification integree) que
+        # le nommage est possible
+        self.g_context.clear()
+        for k,v in j_context.items():
+            if (not k in context_ini) or (context_ini[k] != v):
+                self.g_context[k]=v
+                self.parent.sdsDict[k]=v
+
+        #Ce traitement n'est realise que dans les cas suivants:
+        #     - si convert n'a pas pu convertir le jeu de commandes
+        #     - et ce n'est pas un INCLUDE_MATERIAU
+        #On collecte les variables Python qui ne sont pas dans le contexte initial
+        #et dans le contexte valide et on en fait un pseudo-parametre (Variable)
+        if self.text_converted == 0 and self.nom != "INCLUDE_MATERIAU":
+            for k,v in j.g_context.items():
+                if k in context_ini:continue
+                if k in j_context:continue
+                if isinstance(v,ASSD):continue
+                if isinstance(v,I_ENTITE.ENTITE):continue
+                if isinstance(v,I_OBJECT.OBJECT):continue
+                if callable(v):continue
+                self.g_context[k]=param2.Variable(k,v)
+
+        # On recupere le contexte courant
+        self.currentContext=j.currentContext
+        self.index_etape_courante=j.index_etape_courante
+        self.jdc_aux=j
+
+        # On retablit l'etape courante step
+        CONTEXT.unsetCurrentStep()
+        CONTEXT.setCurrentStep(step)
+
+        return j_context
+
+    def reevalueSdJdc(self):
+        """
+            Avec la liste des SD qui ont ete supprimees, propage la
+            disparition de ces SD dans toutes les etapes et descendants
+        """
+        #print "reevalueSdJdc"
+        l_sd_supp,l_sd_repl = self.diffContextes()
+        for sd in l_sd_supp:
+            self.parent.deleteConceptAfterEtape(self,sd)
+        for old_sd,sd in l_sd_repl:
+            self.parent.replaceConceptAfterEtape(self,old_sd,sd)
+
+    def diffContextes(self):
+        """
+            Realise la difference entre les 2 contextes
+            old_contexte_fichier_init et contexte_fichier_init
+            cad retourne la liste des sd qui ont disparu ou ne derivent pas
+            de la meme classe et des sd qui ont ete remplacees
+        """
+        if not hasattr(self,'old_contexte_fichier_init'):return [],[]
+        l_sd_suppressed = []
+        l_sd_replaced = []
+        for old_key in self.old_contexte_fichier_init:
+            if not old_key in self.contexte_fichier_init:
+                if isinstance(self.old_contexte_fichier_init[old_key],ASSD):
+                    l_sd_suppressed.append(self.old_contexte_fichier_init[old_key])
             else:
-               l_sd_replaced.append((self.old_contexte_fichier_init[old_key],self.contexte_fichier_init[old_key]))
-     return l_sd_suppressed,l_sd_replaced
-      
-  def controlSdprods(self,d):
-      """
-          Cette methode doit verifier que les concepts produits par la 
-          commande ne sont pas incompatibles avec le contexte fourni (d).
-          Si c'est le cas, le concept produit doit etre supprime
-          Si la macro a elle meme des etapes, elle doit propager
-          le traitement (voir methode controlJdcContextApres de I_JDC)
-      """
-      #print ("I_MACRO_ETAPE.controlSdprods",d.keys(),self,self.nom,self.sd and self.sd.nom)
-      if self.sd:
-        if self.sd.nom in d:
-           # Le concept est deja defini
-           if self.reuse and self.reuse is d[self.sd.nom]:
-              # Le concept est reutilise : situation normale
-              pass
-           else:
-              # Redefinition du concept, on l'annule
-              #XXX on pourrait simplement annuler son nom pour conserver les objets
-              # l'utilisateur n'aurait alors qu'a renommer le concept (faisable??)
-              self.initModif()
-              sd=self.sd
-              self.sd=self.reuse=self.sdnom=None
-              self.parent.deleteConceptAfterEtape(self,sd)
-              self.finModif()
-
-      # On verifie les concepts a droite du signe =
-      self.initModif()
-      sdprods=self.sdprods[:]
-      self.sdprods=[]
-      for co in sdprods:
-        if co.nom in d and co is not d[co.nom] :
-           #nettoie les mots cles de l'etape qui ont comme valeur co
-           self.deleteConcept(co)
-           #supprime les references a co dans les etapes suivantes
-           self.parent.deleteConceptAfterEtape(self,co)
-        else:
-           self.sdprods.append(co)
-      self.finModif()
-       
-      for e in self.etapes:
-          e.controlSdprods(d)
-          e.updateContext(d)
-
-  def supprimeSdprod(self,sd):
-      """
-         Supprime le concept produit sd s'il est produit par l'etape
-      """
-      #print ('supprimeSdprod de MACRO_ETAPE')
-      if sd in self.sdprods:
-         self.initModif()
-         self.parent.delSdprod(sd)
-         self.sdprods.remove(sd)
-         self.finModif()
-         self.parent.deleteConcept(sd)
-         return
-
-      if sd is not self.sd :return
-      if self.sd is not None :
-         self.initModif()
-         self.parent.delSdprod(sd)
-         self.sd=None
-         self.finModif()
-         self.parent.deleteConcept(sd)
-
-  def supprimeSdProds(self):
-      """
-          Fonction: Lors de la destruction de la macro-etape, detruit tous les concepts produits
-          Un operateur n a qu un concept produit
-          Une procedure n'en a aucun
-          Une macro en a en general plus d'un
-      """
-      #print "supprimeSdProds"
-      if self.reuse is not self.sd :
-         # l'etape n'est pas reentrante
-         # le concept retourne par l'etape est a supprimer car il etait
-         # cree par l'etape
-         if self.sd != None :
-            self.parent.delSdprod(self.sd)
-            self.parent.deleteConcept(self.sd)
-      # On detruit les concepts a droite du signe =
-      for co in self.sdprods:
-         self.parent.delSdprod(co)
-         self.parent.deleteConcept(co)
-      # Si la macro a des etapes et des concepts inclus, on les detruit
-      for nom_sd,co in self.g_context.items():
-         if not isinstance(co,ASSD):continue
-         self.parent.delSdprod(co)
-         self.parent.deleteConcept(co)
-      # On met g_context a blanc
-      self.g_context={}
-
-  def close(self):
-      #print "close",self
-      if hasattr(self,"jdc_aux") and self.jdc_aux:
-         # La macro a un jdc auxiliaire inclus. On demande sa fermeture
-         self.jdc_aux.close()
-
-  def resetContext(self):
-      if hasattr(self,"jdc_aux") and self.jdc_aux:
-         # La macro a un jdc auxiliaire inclus. On demande la reinitialisation du contexte
-         self.jdc_aux.resetContext()
-
-  def updateConcept(self,sd):
-      I_ETAPE.ETAPE.updateConcept(self,sd)
-      for etape in self.etapes:
-          etape.updateConcept(sd)
-
-  def deleteConcept(self,sd):
-      """
-          Fonction : Mettre a jour les mots cles de l etape et eventuellement
-          le concept produit si reuse suite a la disparition du concept sd
-          Seuls les mots cles simples MCSIMP font un traitement autre
-          que de transmettre aux fils
-      """
-      #print "deleteConcept",sd
-      I_ETAPE.ETAPE.deleteConcept(self,sd)
-      for etape in self.etapes:
-         etape.deleteConcept(sd)
-
-  def replaceConcept(self,old_sd,sd):
-      """
-          Fonction : Mettre a jour les mots cles de l etape et le concept produit si reuse 
-          suite au remplacement  du concept old_sd par sd
-      """
-      #print "replaceConcept",old_sd,sd
-      I_ETAPE.ETAPE.replaceConcept(self,old_sd,sd)
-      for etape in self.etapes:
-         etape.replaceConcept(old_sd,sd)
-         
-  def changeFichierInit(self,new_fic,text):
-    """
-       Tente de changer le fichier include. Le precedent include est conserve
-       dans old_xxx
-    """
-    if not hasattr(self,'fichier_ini'):
-       self.fichier_ini=None
-       self.fichier_text=None
-       self.fichier_err="Le fichier n'est pas defini"
-       self.contexte_fichier_init={}
-       self.recorded_units={}
-       self.jdc_aux=None
-       self.fichier_unite="PasDefini"
-       import Extensions.jdc_include
-       self.JdC_aux=Extensions.jdc_include.JdC_include
-
-    self.old_fic = self.fichier_ini
-    self.old_text = self.fichier_text
-    self.old_err = self.fichier_err
-    self.old_context=self.contexte_fichier_init
-    self.old_units=self.recorded_units
-    self.old_etapes=self.etapes
-    self.old_jdc_aux=self.jdc_aux
-
-    self.fichier_ini = new_fic
-    self.fichier_text=text
-
-    try:
-       self.makeContexteInclude(new_fic,text)
-    except:
-       l=traceback.format_exception_only(tr("Fichier invalide %s", sys.exc_info()[1]))
-       self.fichier_err=''.join(l)
-       raise EficasException(self.fichier_err)
-
-    # L'evaluation de text dans un JDC auxiliaire s'est bien passe
-    # on peut poursuivre le traitement
-    self.initModif()
-    self.state="undetermined"
-    self.fichier_err=None
-    # On enregistre la modification de fichier
-    self.recordUnite()
-    # Le contexte du parent doit etre reinitialise car les concepts produits ont change
-    self.parent.resetContext()
-
-    # Si des concepts ont disparu lors du changement de fichier, on demande leur suppression
-    self.old_contexte_fichier_init=self.old_context
-    self.reevalueSdJdc()
-
-    self.finModif()
-    if self.old_jdc_aux:
-       self.old_jdc_aux.close()
-
-  def restoreFichierInit(self):
-    """
-       Restaure le fichier init enregistre dans old_xxx
-    """
-    self.fichier_ini=self.old_fic
-    self.fichier_text=self.old_text
-    self.fichier_err=self.old_err
-    self.contexte_fichier_init=self.old_context
-    self.recorded_units=self.old_units
-    self.etapes=self.old_etapes
-    self.jdc_aux=self.old_jdc_aux
-
-  def forceFichierInit(self):
-    """
-       Force le remplacement du fichier init meme si le remplacant est en erreur
-    """
-    # Reinitialisation complete du compte-rendu d'erreurs
-    self.jdc_aux.cr=self.jdc_aux.CR()
-    # On remplit le dictionnaire des concepts produits inclus
-    # en retirant les concepts presents dans le  contexte initial
-    # On ajoute egalement le concept produit dans le sdsDict du parent
-    # sans verification car on est sur (verification integree) que
-    # le nommage est possible
-    j_context=self.jdc_aux.getContexteAvant(None)
-    self.g_context.clear()
-    context_ini=self.jdc_aux.context_ini
-    for k,v in j_context.items():
-       if not k in context_ini or context_ini[k] != v:
-           self.g_context[k]=v
-           self.parent.sdsDict[k]=v
-    # On recupere le contexte courant
-    self.currentContext=self.jdc_aux.currentContext
-    self.index_etape_courante=self.jdc_aux.index_etape_courante
-    self.contexte_fichier_init = j_context
-    self.fichier_err = None
-
-    # On enregistre la modification de fichier
-    self.initModif()
-    self.state="undetermined"
-    self.recordUnite()
-    # Le contexte du parent doit etre reinitialise car les concepts produits ont change
-    self.parent.resetContext()
-
-    # On remplace les anciens concepts par les nouveaux (y compris ajouts 
-    # et suppression) et on propage les modifications aux etapes precedentes et suivantes
-    # reevalueSdJdc construit la liste des differences entre les contextes contexte_fichier_init
-    # et old_contexte_fichier_init et effectue les destructions et remplacements de concept
-    # necessaires
-    self.old_contexte_fichier_init=self.old_context
-    self.reevalueSdJdc()
-    self.finModif()
-    if self.old_jdc_aux:
-       self.old_jdc_aux.close()
-
-    self.jdc_aux.forceContexte(self.g_context)
-
-  def buildInclude(self,fichier,text):
-    import Extensions.jdc_include
-    self.JdC_aux=Extensions.jdc_include.JdC_include
-    # un include partage la table des unites avec son parent (jdc)
-    self.recorded_units=self.parent.recorded_units
-    self.buildJdcaux(fichier,text)
-
-  def buildPoursuite(self,fichier,text):
-    import Extensions.jdc_include
-    self.JdC_aux=Extensions.jdc_include.JdC_poursuite
-    # une poursuite a sa propre table d'unites
-    self.recorded_units={}
-    self.buildJdcaux(fichier,text)
-       
-
-  def buildIncludeInclude(self,text):
-    import Extensions.jdc_include
-    self.JdC_aux=Extensions.jdc_include.JdC_include
-    # un include partage la table des unites avec son parent (jdc)
-
-
-  def buildIncludeEtape(self,text,doitEtreValide = 0):
-    import Extensions.jdc_include
-    self.JdC_aux=Extensions.jdc_include.JdC_include
-    # un include partage la table des unites avec son parent (jdc)
-    #self.buildJdcauxInclude(text)
-    # Attention fonctionne pour import_Zone de MT
-    # a adapter eventuellement
-    try :
-    #if 1 :
-       contexte = self.getContexteJdc(None,text,doitEtreValide)
-    except EficasException: 
-       return 0
-     
-    for e in self.etapes: 
-        e.niveau=self.niveau
-        e.parent=self.parent
-        e.state='change'
-
-    index=self.jdc.etapes.index(self)
-    self.jdc.etapes=self.jdc.etapes[:index+1]+self.etapes+self.jdc.etapes[index+1:]
-
-    self.g_context={}
-    self.etapes=[]
-    self.jdc.resetContext()
-    self.jdc_aux=None
-    CONTEXT.unsetCurrentStep()
-    return 1
-
-
-  def buildJdcauxInclude(self,text):
-       
-       try :
-         contexte = self.getContexteJdc(None,text)
-       except EficasException:
-         pass
-       index=self.jdc.etapes.index(self)
-       for e in self.etapes:
-           e.niveau=self.niveau
-       self.jdc.etapes=self.jdc.etapes[:index+1]+self.etapes+self.jdc.etapes[index+1:]
-       self.g_context={}
-       self.etapes=[]
-       self.jdc_aux=None
-       CONTEXT.unsetCurrentStep()
-
-  def buildJdcaux(self,fichier,text):
-    """
-         Cree un jdc auxiliaire initialise avec text. 
-         Initialise le nom du fichier associe avec fichier
-         N'enregistre pas d'association unite <-> fichier
-    """
-    self.fichier_ini = fichier
-    self.fichier_text= text
-    self.fichier_unite=None
-    self.fichier_err = None
-    try:
-       contexte = self.getContexteJdc(fichier,text)
-       if contexte is None :
-          # Impossible de construire le jdc auxiliaire (sortie par None)
-          # On simule une sortie par exception
-          raise EficasException(tr("Impossible de construire le jeu de commandes correspondant au fichier"))
-       else:
-          # La construction du jdc auxiliaire est allee au bout
-          self.contexte_fichier_init = contexte
-       self.initModif()
-       self.finModif()
-    except:
-       # Impossible de construire le jdc auxiliaire (sortie par exception)
-       l=traceback.format_exception_only("Fichier invalide",sys.exc_info()[1])
-       if self.jdc.editor is not None:
-          self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier inclus"),
-                                       message= tr("Ce fichier ne sera pas pris en compte\n %s",''.join(l)))
-
-       self.g_context={}
-       self.etapes=[]
-       self.jdc_aux=None
-       self.fichier_err = ''.join(l)
-       self.contexte_fichier_init={}
-       self.initModif()
-       self.finModif()
-       raise EficasException(" ")
-
-  def makeContexteInclude(self,fichier,text):
-    """
-        Cette methode sert a craer un contexte en interpratant un texte source Python.
-    """
-    #print ("makeContexteInclude",fichier)
-    # on recupere le contexte d'un nouveau jdc dans lequel on interprete text
-    contexte = self.getContexteJdc(fichier,text)
-    #print (contexte)
-    if contexte == None :
-      raise EficasException("Impossible de construire le jeu de commandes correspondant au fichier")
-    else:
-      # Pour les macros de type include : INCLUDE, INCLUDE_MATERIAU et POURSUITE
-      # l'attribut g_context est un dictionnaire qui contient les concepts produits par inclusion
-      # l'attribut contexte_fichier_init est un dictionnaire qui contient les concepts produits
-      # en sortie de macro. g_context est obtenu en retirant de contexte_fichier_init les concepts
-      # existants en debut de macro contenus dans context_ini (dans getContexteJdc)
-      # g_context est utilise pour avoir les concepts produits par la macro
-      # contexte_fichier_init est utilise pour avoir les concepts supprimes par la macro
-      self.contexte_fichier_init = contexte
-    #print ("fin makeContexteInclude",fichier)
-
-  def reevalueFichierInitObsolete(self):
-      """Recalcule les concepts produits par le fichier enregistre"""
-      #print "reevalue_fichier_init"
-      old_context=self.contexte_fichier_init
-      try:
-         self.makeContexteInclude(self.fichier_ini ,self.fichier_text)
-      except:
-         l=traceback.format_exception_only("Fichier invalide",sys.exc_info()[1])
-         self.fichier_err = ''.join(l)
-         self.g_context={}
-         self.etapes=[]
-         self.jdc_aux=None
-         self.old_contexte_fichier_init=old_context
-         self.contexte_fichier_init={}
-         self.reevalueSdJdc()
-         return
-
-      # L'evaluation s'est bien passee
-      self.fichier_err = None
-      self.old_contexte_fichier_init=old_context
-      self.reevalueSdJdc()
-
-  def updateFichierInit(self,unite):
-      """Reevalue le fichier init sans demander (dans la mesure du possible) a l'utilisateur 
-         les noms des fichiers
-         Ceci suppose que les relations entre unites et noms ont ete memorisees prealablement
-         L'include a ete initialise precedemment. Le jdc auxiliaire existe.
-      """
-      #print "updateFichierInit",unite,self.fichier_unite 
-      self.old_contexte_fichier_init=self.contexte_fichier_init
-      old_fichier_ini=self.fichier_ini
-      if not hasattr(self,"jdc_aux"):self.jdc_aux=None
-      old_jdc_aux=self.jdc_aux
-
-      #print "updateFichierInit",self,self.parent,self.parent.recorded_units
-
-      if self.fichier_unite is None:
-         # L'unite n'etait pas definie precedemment. On ne change que l'unite
-         #print "updateFichierInit","pas de changement dans include"
-         self.fichier_unite=unite
-         return
-      elif unite == self.fichier_unite :
-         # L'unite n'a pas change
-         #print "updateFichierInit","pas de changement dans include 3"
-         return
-      elif unite != self.fichier_unite :
-         # L'unite etait definie precedemment. On remplace l'include 
-         #
-         f,text=self.getFileMemo(unite=unite,fic_origine=self.parent.nom)
-         if f is None:
-            # Le fichier associe n'a pas pu etre defini
-            # on change l'unite associee mais pas l'include
-            #print "updateFichierInit","pas de changement dans include 2"
-            self.fichier_unite=unite
+                if isinstance(self.old_contexte_fichier_init[old_key],ASSD):
+                # Un concept de meme nom existe
+                    old_class=self.old_contexte_fichier_init[old_key].__class__
+                    if not isinstance(self.contexte_fichier_init[old_key],old_class):
+                        # S'il n'est pas d'une classe derivee, on le supprime
+                        l_sd_suppressed.append(self.old_contexte_fichier_init[old_key])
+                    else:
+                        l_sd_replaced.append((self.old_contexte_fichier_init[old_key],self.contexte_fichier_init[old_key]))
+        return l_sd_suppressed,l_sd_replaced
+
+    def controlSdprods(self,d):
+        """
+            Cette methode doit verifier que les concepts produits par la
+            commande ne sont pas incompatibles avec le contexte fourni (d).
+            Si c'est le cas, le concept produit doit etre supprime
+            Si la macro a elle meme des etapes, elle doit propager
+            le traitement (voir methode controlJdcContextApres de I_JDC)
+        """
+        #print ("I_MACRO_ETAPE.controlSdprods",d.keys(),self,self.nom,self.sd and self.sd.nom)
+        if self.sd:
+            if self.sd.nom in d:
+                    # Le concept est deja defini
+                if self.reuse and self.reuse is d[self.sd.nom]:
+                    # Le concept est reutilise : situation normale
+                    pass
+                else:
+                    # Redefinition du concept, on l'annule
+                    #XXX on pourrait simplement annuler son nom pour conserver les objets
+                    # l'utilisateur n'aurait alors qu'a renommer le concept (faisable??)
+                    self.initModif()
+                    sd=self.sd
+                    self.sd=self.reuse=self.sdnom=None
+                    self.parent.deleteConceptAfterEtape(self,sd)
+                    self.finModif()
+
+        # On verifie les concepts a droite du signe =
+        self.initModif()
+        sdprods=self.sdprods[:]
+        self.sdprods=[]
+        for co in sdprods:
+            if co.nom in d and co is not d[co.nom] :
+                #nettoie les mots cles de l'etape qui ont comme valeur co
+                self.deleteConcept(co)
+                #supprime les references a co dans les etapes suivantes
+                self.parent.deleteConceptAfterEtape(self,co)
+            else:
+                self.sdprods.append(co)
+        self.finModif()
+
+        for e in self.etapes:
+            e.controlSdprods(d)
+            e.updateContext(d)
+
+    def supprimeSdprod(self,sd):
+        """
+           Supprime le concept produit sd s'il est produit par l'etape
+        """
+        #print ('supprimeSdprod de MACRO_ETAPE')
+        if sd in self.sdprods:
+            self.initModif()
+            self.parent.delSdprod(sd)
+            self.sdprods.remove(sd)
+            self.finModif()
+            self.parent.deleteConcept(sd)
             return
-         else:
-            self.fichier_ini = f
-            self.fichier_text=text
-            self.fichier_unite=unite
-         #print "updateFichierInit",self.recorded_units
-
-      #print "updateFichierInit",self.fichier_ini,self.fichier_text,self.fichier_unite
 
-      if old_fichier_ini == self.fichier_ini:
-         # Le fichier inclus n'a pas change. On ne recree pas le contexte
-         # mais on enregistre le changement d'association unite <-> fichier
-         #print "updateFichierInit.fichier inchange",self.jdc_aux.context_ini
-         self.parent.recordUnit(unite,self)
-         return
+        if sd is not self.sd :return
+        if self.sd is not None :
+            self.initModif()
+            self.parent.delSdprod(sd)
+            self.sd=None
+            self.finModif()
+            self.parent.deleteConcept(sd)
+
+    def supprimeSdProds(self):
+        """
+            Fonction: Lors de la destruction de la macro-etape, detruit tous les concepts produits
+            Un operateur n a qu un concept produit
+            Une procedure n'en a aucun
+            Une macro en a en general plus d'un
+        """
+        #print "supprimeSdProds"
+        if self.reuse is not self.sd :
+            # l'etape n'est pas reentrante
+            # le concept retourne par l'etape est a supprimer car il etait
+            # cree par l'etape
+            if self.sd != None :
+                self.parent.delSdprod(self.sd)
+                self.parent.deleteConcept(self.sd)
+        # On detruit les concepts a droite du signe =
+        for co in self.sdprods:
+            self.parent.delSdprod(co)
+            self.parent.deleteConcept(co)
+        # Si la macro a des etapes et des concepts inclus, on les detruit
+        for nom_sd,co in self.g_context.items():
+            if not isinstance(co,ASSD):continue
+            self.parent.delSdprod(co)
+            self.parent.deleteConcept(co)
+        # On met g_context a blanc
+        self.g_context={}
 
-      try:
+    def close(self):
+        #print "close",self
+        if hasattr(self,"jdc_aux") and self.jdc_aux:
+            # La macro a un jdc auxiliaire inclus. On demande sa fermeture
+            self.jdc_aux.close()
+
+    def resetContext(self):
+        if hasattr(self,"jdc_aux") and self.jdc_aux:
+            # La macro a un jdc auxiliaire inclus. On demande la reinitialisation du contexte
+            self.jdc_aux.resetContext()
+
+    def updateConcept(self,sd):
+        I_ETAPE.ETAPE.updateConcept(self,sd)
+        for etape in self.etapes:
+            etape.updateConcept(sd)
+
+    def deleteConcept(self,sd):
+        """
+            Fonction : Mettre a jour les mots cles de l etape et eventuellement
+            le concept produit si reuse suite a la disparition du concept sd
+            Seuls les mots cles simples MCSIMP font un traitement autre
+            que de transmettre aux fils
+        """
+        #print "deleteConcept",sd
+        I_ETAPE.ETAPE.deleteConcept(self,sd)
+        for etape in self.etapes:
+            etape.deleteConcept(sd)
+
+    def replaceConcept(self,old_sd,sd):
+        """
+            Fonction : Mettre a jour les mots cles de l etape et le concept produit si reuse
+            suite au remplacement  du concept old_sd par sd
+        """
+        #print "replaceConcept",old_sd,sd
+        I_ETAPE.ETAPE.replaceConcept(self,old_sd,sd)
+        for etape in self.etapes:
+            etape.replaceConcept(old_sd,sd)
+
+    def changeFichierInit(self,new_fic,text):
+        """
+           Tente de changer le fichier include. Le precedent include est conserve
+           dans old_xxx
+        """
+        if not hasattr(self,'fichier_ini'):
+            self.fichier_ini=None
+            self.fichier_text=None
+            self.fichier_err="Le fichier n'est pas defini"
+            self.contexte_fichier_init={}
+            self.recorded_units={}
+            self.jdc_aux=None
+            self.fichier_unite="PasDefini"
+            import Extensions.jdc_include
+            self.JdC_aux=Extensions.jdc_include.JdC_include
+
+        self.old_fic = self.fichier_ini
+        self.old_text = self.fichier_text
+        self.old_err = self.fichier_err
+        self.old_context=self.contexte_fichier_init
+        self.old_units=self.recorded_units
+        self.old_etapes=self.etapes
+        self.old_jdc_aux=self.jdc_aux
+
+        self.fichier_ini = new_fic
+        self.fichier_text=text
+
+        try:
+            self.makeContexteInclude(new_fic,text)
+        except:
+            l=traceback.format_exception_only(tr("Fichier invalide %s", sys.exc_info()[1]))
+            self.fichier_err=''.join(l)
+            raise EficasException(self.fichier_err)
+
+        # L'evaluation de text dans un JDC auxiliaire s'est bien passe
+        # on peut poursuivre le traitement
+        self.initModif()
+        self.state="undetermined"
         self.fichier_err=None
-        self.makeContexteInclude(self.fichier_ini,self.fichier_text)
-        # Les 3 attributs fichier_ini fichier_text recorded_units doivent etre corrects
-        # avant d'appeler changeUnit
-      except:
-        # Erreurs lors de l'evaluation de text dans un JDC auxiliaire
-        l=traceback.format_exception_only("Fichier invalide",sys.exc_info()[1])
-        # On conserve la memoire du nouveau fichier
-        # mais on n'utilise pas les concepts crees par ce fichier
-        # on met l'etape en erreur : fichier_err=''.join(l)
-        self.fichier_err=''.join(l)
+        # On enregistre la modification de fichier
+        self.recordUnite()
+        # Le contexte du parent doit etre reinitialise car les concepts produits ont change
+        self.parent.resetContext()
+
+        # Si des concepts ont disparu lors du changement de fichier, on demande leur suppression
+        self.old_contexte_fichier_init=self.old_context
+        self.reevalueSdJdc()
+
+        self.finModif()
+        if self.old_jdc_aux:
+            self.old_jdc_aux.close()
+
+    def restoreFichierInit(self):
+        """
+           Restaure le fichier init enregistre dans old_xxx
+        """
+        self.fichier_ini=self.old_fic
+        self.fichier_text=self.old_text
+        self.fichier_err=self.old_err
+        self.contexte_fichier_init=self.old_context
+        self.recorded_units=self.old_units
+        self.etapes=self.old_etapes
+        self.jdc_aux=self.old_jdc_aux
+
+    def forceFichierInit(self):
+        """
+           Force le remplacement du fichier init meme si le remplacant est en erreur
+        """
+        # Reinitialisation complete du compte-rendu d'erreurs
+        self.jdc_aux.cr=self.jdc_aux.CR()
+        # On remplit le dictionnaire des concepts produits inclus
+        # en retirant les concepts presents dans le  contexte initial
+        # On ajoute egalement le concept produit dans le sdsDict du parent
+        # sans verification car on est sur (verification integree) que
+        # le nommage est possible
+        j_context=self.jdc_aux.getContexteAvant(None)
+        self.g_context.clear()
+        context_ini=self.jdc_aux.context_ini
+        for k,v in j_context.items():
+            if not k in context_ini or context_ini[k] != v:
+                self.g_context[k]=v
+                self.parent.sdsDict[k]=v
+        # On recupere le contexte courant
+        self.currentContext=self.jdc_aux.currentContext
+        self.index_etape_courante=self.jdc_aux.index_etape_courante
+        self.contexte_fichier_init = j_context
+        self.fichier_err = None
+
+        # On enregistre la modification de fichier
+        self.initModif()
+        self.state="undetermined"
+        self.recordUnite()
+        # Le contexte du parent doit etre reinitialise car les concepts produits ont change
+        self.parent.resetContext()
+
+        # On remplace les anciens concepts par les nouveaux (y compris ajouts
+        # et suppression) et on propage les modifications aux etapes precedentes et suivantes
+        # reevalueSdJdc construit la liste des differences entre les contextes contexte_fichier_init
+        # et old_contexte_fichier_init et effectue les destructions et remplacements de concept
+        # necessaires
+        self.old_contexte_fichier_init=self.old_context
+        self.reevalueSdJdc()
+        self.finModif()
+        if self.old_jdc_aux:
+            self.old_jdc_aux.close()
+
+        self.jdc_aux.forceContexte(self.g_context)
+
+    def buildInclude(self,fichier,text):
+        import Extensions.jdc_include
+        self.JdC_aux=Extensions.jdc_include.JdC_include
+        # un include partage la table des unites avec son parent (jdc)
+        self.recorded_units=self.parent.recorded_units
+        self.buildJdcaux(fichier,text)
+
+    def buildPoursuite(self,fichier,text):
+        import Extensions.jdc_include
+        self.JdC_aux=Extensions.jdc_include.JdC_poursuite
+        # une poursuite a sa propre table d'unites
+        self.recorded_units={}
+        self.buildJdcaux(fichier,text)
+
+
+    def buildIncludeInclude(self,text):
+        import Extensions.jdc_include
+        self.JdC_aux=Extensions.jdc_include.JdC_include
+        # un include partage la table des unites avec son parent (jdc)
+
+
+    def buildIncludeEtape(self,text,doitEtreValide = 0):
+        import Extensions.jdc_include
+        self.JdC_aux=Extensions.jdc_include.JdC_include
+        # un include partage la table des unites avec son parent (jdc)
+        #self.buildJdcauxInclude(text)
+        # Attention fonctionne pour import_Zone de MT
+        # a adapter eventuellement
+        try :
+        #if 1 :
+            contexte = self.getContexteJdc(None,text,doitEtreValide)
+        except EficasException:
+            return 0
+
+        for e in self.etapes:
+            e.niveau=self.niveau
+            e.parent=self.parent
+            e.state='change'
+
+        index=self.jdc.etapes.index(self)
+        self.jdc.etapes=self.jdc.etapes[:index+1]+self.etapes+self.jdc.etapes[index+1:]
+
         self.g_context={}
         self.etapes=[]
+        self.jdc.resetContext()
         self.jdc_aux=None
-        self.contexte_fichier_init={}
+        CONTEXT.unsetCurrentStep()
+        return 1
+
+
+    def buildJdcauxInclude(self,text):
+
+        try :
+            contexte = self.getContexteJdc(None,text)
+        except EficasException:
+            pass
+        index=self.jdc.etapes.index(self)
+        for e in self.etapes:
+            e.niveau=self.niveau
+        self.jdc.etapes=self.jdc.etapes[:index+1]+self.etapes+self.jdc.etapes[index+1:]
+        self.g_context={}
+        self.etapes=[]
+        self.jdc_aux=None
+        CONTEXT.unsetCurrentStep()
+
+    def buildJdcaux(self,fichier,text):
+        """
+             Cree un jdc auxiliaire initialise avec text.
+             Initialise le nom du fichier associe avec fichier
+             N'enregistre pas d'association unite <-> fichier
+        """
+        self.fichier_ini = fichier
+        self.fichier_text= text
+        self.fichier_unite=None
+        self.fichier_err = None
+        try:
+            contexte = self.getContexteJdc(fichier,text)
+            if contexte is None :
+            # Impossible de construire le jdc auxiliaire (sortie par None)
+            # On simule une sortie par exception
+                raise EficasException(tr("Impossible de construire le jeu de commandes correspondant au fichier"))
+            else:
+                # La construction du jdc auxiliaire est allee au bout
+                self.contexte_fichier_init = contexte
+            self.initModif()
+            self.finModif()
+        except:
+            # Impossible de construire le jdc auxiliaire (sortie par exception)
+            l=traceback.format_exception_only("Fichier invalide",sys.exc_info()[1])
+            if self.jdc.editor is not None:
+                self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier inclus"),
+                                             message= tr("Ce fichier ne sera pas pris en compte\n %s",''.join(l)))
+
+            self.g_context={}
+            self.etapes=[]
+            self.jdc_aux=None
+            self.fichier_err = ''.join(l)
+            self.contexte_fichier_init={}
+            self.initModif()
+            self.finModif()
+            raise EficasException(" ")
+
+    def makeContexteInclude(self,fichier,text):
+        """
+            Cette methode sert a craer un contexte en interpratant un texte source Python.
+        """
+        #print ("makeContexteInclude",fichier)
+        # on recupere le contexte d'un nouveau jdc dans lequel on interprete text
+        contexte = self.getContexteJdc(fichier,text)
+        #print (contexte)
+        if contexte == None :
+            raise EficasException("Impossible de construire le jeu de commandes correspondant au fichier")
+        else:
+            # Pour les macros de type include : INCLUDE, INCLUDE_MATERIAU et POURSUITE
+            # l'attribut g_context est un dictionnaire qui contient les concepts produits par inclusion
+            # l'attribut contexte_fichier_init est un dictionnaire qui contient les concepts produits
+            # en sortie de macro. g_context est obtenu en retirant de contexte_fichier_init les concepts
+            # existants en debut de macro contenus dans context_ini (dans getContexteJdc)
+            # g_context est utilise pour avoir les concepts produits par la macro
+            # contexte_fichier_init est utilise pour avoir les concepts supprimes par la macro
+            self.contexte_fichier_init = contexte
+        #print ("fin makeContexteInclude",fichier)
+
+    def reevalueFichierInitObsolete(self):
+        """Recalcule les concepts produits par le fichier enregistre"""
+        #print "reevalue_fichier_init"
+        old_context=self.contexte_fichier_init
+        try:
+            self.makeContexteInclude(self.fichier_ini ,self.fichier_text)
+        except:
+            l=traceback.format_exception_only("Fichier invalide",sys.exc_info()[1])
+            self.fichier_err = ''.join(l)
+            self.g_context={}
+            self.etapes=[]
+            self.jdc_aux=None
+            self.old_contexte_fichier_init=old_context
+            self.contexte_fichier_init={}
+            self.reevalueSdJdc()
+            return
+
+        # L'evaluation s'est bien passee
+        self.fichier_err = None
+        self.old_contexte_fichier_init=old_context
+        self.reevalueSdJdc()
+
+    def updateFichierInit(self,unite):
+        """Reevalue le fichier init sans demander (dans la mesure du possible) a l'utilisateur
+           les noms des fichiers
+           Ceci suppose que les relations entre unites et noms ont ete memorisees prealablement
+           L'include a ete initialise precedemment. Le jdc auxiliaire existe.
+        """
+        #print "updateFichierInit",unite,self.fichier_unite
+        self.old_contexte_fichier_init=self.contexte_fichier_init
+        old_fichier_ini=self.fichier_ini
+        if not hasattr(self,"jdc_aux"):self.jdc_aux=None
+        old_jdc_aux=self.jdc_aux
+
+        #print "updateFichierInit",self,self.parent,self.parent.recorded_units
+
+        if self.fichier_unite is None:
+            # L'unite n'etait pas definie precedemment. On ne change que l'unite
+            #print "updateFichierInit","pas de changement dans include"
+            self.fichier_unite=unite
+            return
+        elif unite == self.fichier_unite :
+            # L'unite n'a pas change
+            #print "updateFichierInit","pas de changement dans include 3"
+            return
+        elif unite != self.fichier_unite :
+            # L'unite etait definie precedemment. On remplace l'include
+            #
+            f,text=self.getFileMemo(unite=unite,fic_origine=self.parent.nom)
+            if f is None:
+                # Le fichier associe n'a pas pu etre defini
+                # on change l'unite associee mais pas l'include
+                #print "updateFichierInit","pas de changement dans include 2"
+                self.fichier_unite=unite
+                return
+            else:
+                self.fichier_ini = f
+                self.fichier_text=text
+                self.fichier_unite=unite
+            #print "updateFichierInit",self.recorded_units
+
+        #print "updateFichierInit",self.fichier_ini,self.fichier_text,self.fichier_unite
+
+        if old_fichier_ini == self.fichier_ini:
+            # Le fichier inclus n'a pas change. On ne recree pas le contexte
+            # mais on enregistre le changement d'association unite <-> fichier
+            #print "updateFichierInit.fichier inchange",self.jdc_aux.context_ini
+            self.parent.recordUnit(unite,self)
+            return
 
-      if old_jdc_aux:
-         old_jdc_aux.close()
-      self.parent.recordUnit(unite,self)
-      # Le contexte du parent doit etre reinitialise car les concepts 
-      # produits ont change
-      self.parent.resetContext()
-      # Si des concepts ont disparu lors du changement de fichier, on 
-      # demande leur suppression
-      self.reevalueSdJdc()
-      #print "updateFichierInit",self.jdc_aux.context_ini.keys()
-
-  def recordUnite(self):
-      #print "recordUnite",self.nom
-      if self.nom == "POURSUITE":
-         self.parent.recordUnit(None,self)
-      else:
-         if hasattr(self,'fichier_unite') : 
-            self.parent.recordUnit(self.fichier_unite,self)
-
-  def getFileMemo(self, unite=None, fname=None, fic_origine=''):
-      """Retourne le nom du fichier et le source correspondant a l'unite unite
-         Initialise en plus recorded_units
-      """
-      #print "getFileMemo",unite,fic_origine,self,self.parent
-      #print self.parent.recorded_units
-      if unite is None:
-         # On est dans le cas d'une poursuite. On ne reutilise aucune unite de parent
-         units={}
-      else:
-         # On est dans le cas d'un include. On reutilise toutes les unites de parent
-         units=self.parent.recorded_units
-
-      if unite in self.parent.recorded_units:
-         f,text,units=self.parent.recorded_units[unite]
-      elif self.jdc :
-         if fname:
-             if not osp.exists(fname):
-                raise AsException(fname + tr(" n'est pas un fichier existant"))
-             f = fname
-             text = open(fname, 'r').read()
-         else:
-             f,text=self.jdc.getFile(unite=unite, fic_origine=fic_origine)
-      else:
-         f,text=None,None
-
-      self.recorded_units=units
-      if f is None and self.jdc.editor:
-         self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier inclus"),
-               message= tr("Ce fichier ne sera pas pris en compte\nLe fichier associe n'est pas defini"))
-      return f,text
-
-  def updateContext(self,d):
-      """
-         Met a jour le contexte contenu dans le dictionnaire d
-         Une MACRO_ETAPE peut ajouter plusieurs concepts dans le contexte
-         Une fonction enregistree dans op_init peut egalement modifier le contexte
-      """
-      #print ("updateContext",self,self.nom,d.keys())
-      if hasattr(self,"jdc_aux") and self.jdc_aux:
-            #ATTENTION: updateContext NE DOIT PAS appeler resetContext
-            # car il appelle directement ou indirectement updateContext
-            # equivalent a resetContext. Evite les recursions
+        try:
+            self.fichier_err=None
+            self.makeContexteInclude(self.fichier_ini,self.fichier_text)
+            # Les 3 attributs fichier_ini fichier_text recorded_units doivent etre corrects
+            # avant d'appeler changeUnit
+        except:
+            # Erreurs lors de l'evaluation de text dans un JDC auxiliaire
+            l=traceback.format_exception_only("Fichier invalide",sys.exc_info()[1])
+            # On conserve la memoire du nouveau fichier
+            # mais on n'utilise pas les concepts crees par ce fichier
+            # on met l'etape en erreur : fichier_err=''.join(l)
+            self.fichier_err=''.join(l)
+            self.g_context={}
+            self.etapes=[]
+            self.jdc_aux=None
+            self.contexte_fichier_init={}
+
+        if old_jdc_aux:
+            old_jdc_aux.close()
+        self.parent.recordUnit(unite,self)
+        # Le contexte du parent doit etre reinitialise car les concepts
+        # produits ont change
+        self.parent.resetContext()
+        # Si des concepts ont disparu lors du changement de fichier, on
+        # demande leur suppression
+        self.reevalueSdJdc()
+        #print "updateFichierInit",self.jdc_aux.context_ini.keys()
+
+    def recordUnite(self):
+        #print "recordUnite",self.nom
+        if self.nom == "POURSUITE":
+            self.parent.recordUnit(None,self)
+        else:
+            if hasattr(self,'fichier_unite') :
+                self.parent.recordUnit(self.fichier_unite,self)
+
+    def getFileMemo(self, unite=None, fname=None, fic_origine=''):
+        """Retourne le nom du fichier et le source correspondant a l'unite unite
+           Initialise en plus recorded_units
+        """
+        #print "getFileMemo",unite,fic_origine,self,self.parent
+        #print self.parent.recorded_units
+        if unite is None:
+            # On est dans le cas d'une poursuite. On ne reutilise aucune unite de parent
+            units={}
+        else:
+            # On est dans le cas d'un include. On reutilise toutes les unites de parent
+            units=self.parent.recorded_units
+
+        if unite in self.parent.recorded_units:
+            f,text,units=self.parent.recorded_units[unite]
+        elif self.jdc :
+            if fname:
+                if not osp.exists(fname):
+                    raise AsException(fname + tr(" n'est pas un fichier existant"))
+                f = fname
+                text = open(fname, 'r').read()
+            else:
+                f,text=self.jdc.getFile(unite=unite, fic_origine=fic_origine)
+        else:
+            f,text=None,None
+
+        self.recorded_units=units
+        if f is None and self.jdc.editor:
+            self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier inclus"),
+                  message= tr("Ce fichier ne sera pas pris en compte\nLe fichier associe n'est pas defini"))
+        return f,text
+
+    def updateContext(self,d):
+        """
+           Met a jour le contexte contenu dans le dictionnaire d
+           Une MACRO_ETAPE peut ajouter plusieurs concepts dans le contexte
+           Une fonction enregistree dans op_init peut egalement modifier le contexte
+        """
+        #print ("updateContext",self,self.nom,d.keys())
+        if hasattr(self,"jdc_aux") and self.jdc_aux:
+                #ATTENTION: updateContext NE DOIT PAS appeler resetContext
+                # car il appelle directement ou indirectement updateContext
+                # equivalent a resetContext. Evite les recursions
             self.jdc_aux.context_ini=d.copy()
             self.jdc_aux.currentContext={}
             self.jdc_aux.index_etape_courante=0
             #ATTENTION: il ne faut pas utiliser self.jdc_aux.getContexteAvant
             #car cet appel conduit a des remontees multiples incoherentes dans le
-            # ou les parents. 
+            # ou les parents.
             #get_context_avant appelle updateContext qui NE DOIT PAS appeler getContexteAvant
             #On n'a besoin que d'un update local connaissant
             # le contexte amont : d qui sert a reinitialiser self.context_ini
@@ -796,452 +796,452 @@ class MACRO_ETAPE(I_ETAPE.ETAPE):
                 e.updateContext(d)
             return
 
-      if type(self.definition.op_init) == types.FunctionType:
-        self.definition.op_init(*(self,d))
-      if self.sd != None :d[self.sd.nom]=self.sd
-      for co in self.sdprods:
-        d[co.nom]=co
-      #print "updateContext.fin",d.keys()
+        if type(self.definition.op_init) == types.FunctionType:
+            self.definition.op_init(*(self,d))
+        if self.sd != None :d[self.sd.nom]=self.sd
+        for co in self.sdprods:
+            d[co.nom]=co
+        #print "updateContext.fin",d.keys()
 
 #ATTENTION SURCHARGE : cette methode surcharge celle de Noyau (a garder en synchro)
-  def copy(self):
-      etape=Noyau.N_MACRO_ETAPE.MACRO_ETAPE.copy(self)
-      if hasattr(etape,"etapes") :etape.etapes=[]
-      if hasattr(etape,"jdc_aux") : 
-         etape.jdc_aux=None
-         del etape.fichier_ini
-      return etape
-
-  def supprime(self):
-      #print "supprime",self
-      if hasattr(self,"jdc_aux") and self.jdc_aux:
-         self.jdc_aux.supprime_aux()
-         self.jdc_aux=None
-      Noyau.N_MACRO_ETAPE.MACRO_ETAPE.supprime(self)
+    def copy(self):
+        etape=Noyau.N_MACRO_ETAPE.MACRO_ETAPE.copy(self)
+        if hasattr(etape,"etapes") :etape.etapes=[]
+        if hasattr(etape,"jdc_aux") :
+            etape.jdc_aux=None
+            del etape.fichier_ini
+        return etape
+
+    def supprime(self):
+        #print "supprime",self
+        if hasattr(self,"jdc_aux") and self.jdc_aux:
+            self.jdc_aux.supprime_aux()
+            self.jdc_aux=None
+        Noyau.N_MACRO_ETAPE.MACRO_ETAPE.supprime(self)
 
 #ATTENTION SURCHARGE : cette methode surcharge celle de Noyau (a garder en synchro)
-  def getFile(self,unite=None,fic_origine=''):
-      """Retourne le nom du fichier et le source correspondant a l'unite unite
-      """
-      if self.jdc :
-         f,text=self.jdc.getFile(unite=unite,fic_origine=fic_origine)
-      else:
-         f,text=None,None
-      return f,text
-
-
-  def makeInclude3(self,fichier=None):
-      self.makeIncludeCarmel(fichier)
-
-
-  def makeIncludeCND(self,fichier=None):
-      unite=999
-      if fichier==None : return
-      if hasattr(self,'fichier_ini') : print((self.fichier_ini))
-      if hasattr(self,'fichier_ini') : return
-      self.fichier_ini=fichier
-      from acquiertGroupes import getGroupes
-      erreur,listeGroupes=getGroupes(fichier)
-      if erreur != "" : print ("a traiter")
-      texteSources=""
-      texteCond=""
-      texteNoCond=""
-      texteVcut=""
-      for groupe in listeGroupes :
-          if groupe[0:8]=='CURRENT_': texteSources +=groupe[8:]+"=SOURCE();\n"
-          if groupe[0:5]=='COND_':    texteCond    +=groupe[5:]+"=CONDUCTEUR();\n"
-          if groupe[0:7]=='NOCOND_':  texteNoCond  +=groupe[7:]+"=NOCOND();\n"
-          #if groupe[0:5]=='VCUT_':    texteVcut    +=groupe[5:]+"=VCUT();\n"
-          if groupe[0:5]=='VCUT_':    texteVcut    +='V_'+groupe[5:]+"=VCUT();\n"
-      texte=texteSources+texteCond+texteNoCond+texteVcut
-      #print (texte)
-      self.buildIncludeInclude(texte)
-      if CONTEXT.getCurrentStep()==None : CONTEXT.setCurrentStep(self)
-      reevalue=0
-
-  def makeIncludeCarmel(self,fichier=None):
-  # Pour Carmel
-      #print "je suis dans makeIncludeCarmel"
-      unite=999
-      if hasattr(self,'fichier_ini') : return
-      reevalue=0
-      if hasattr(self,'old_context_fichier_init' ):
-         reevalue=1
-         for concept in self.old_context_fichier_init.values():
-             self.jdc.deleteConcept(concept)
-      if fichier == None :
-         fichier=str(self.jdc.appliEficas.getFile_dictDonnees())
-         if fichier  == str("") : 
-           self.fichier_ini="badfile"
-           self.fichier_text=""
-           self.fichier_err=tr("Le fichier n est pas defini")
-           self.parent.recordUnit(999,self)
-           try :
-              MCFils=self.getChild('FileName')
-              MCFils.setValeur(None)
-           except :
-              pass
-           raise EficasException(self.fichier_err)
-      self.fichier_ini  = fichier
-      f=open(self.fichier_ini,'r')
-      self.fichier_text=f.read()
-      f.close()
-
-      self.contexte_fichier_init={}
-      self.fichier_unite=999
-      self.fichier_err=None
-
-      try:
-      #if 1 :
-         import Extensions.jdc_include
-         self.JdC_aux=Extensions.jdc_include.JdC_include
-      except:
-      #else:
-         traceback.print_exc()
-         self.makeIncl2Except()
-         raise EficasException(" ")
-
-      try:
-      #if 1 :
-         self.makeContexteInclude(self.fichier_ini ,self.fichier_text)
-         self.old_context_fichier_init=self.contexte_fichier_init
-         self.parent.recordUnit(unite,self)
-         try :
-            MCFils=self.getChild('FileName')
-            #MCFils.setValeur(fichier)
-            #on appelle pas setValeur qui modifie le contexte ce qui fout le bazar
-            #pas de modification de bloc
-            MCFils.valeur=fichier
-            MCFils.val=fichier
-         except :
-            pass
-      except:
-      #else:
-         self.makeIncl2Except()
-      # Cette P*** de ligne suivante ne fonctionne que pour Aster
-      # si quelqu un a une idee merci de m en parler
-      #CONTEXT.setCurrentStep(self)
-
-  def makeInclude2(self,fichier=None):
-  # Pour OT
-      # gestion de l unicite SVP
-      unite=999
-
-      if hasattr(self,'fichier_ini') : return
-      reevalue=0
-      if hasattr(self,'old_context_fichier_init' ):
-         reevalue=1
-         for concept in self.old_context_fichier_init.values():
-             self.jdc.deleteConcept(concept)
-
-      if fichier == None :
-         fichier=str(self.jdc.appliEficas.getFileVariable())
-         if fichier  == str("") : 
-           self.fichier_ini="badfile"
-           self.fichier_text=""
-           self.fichier_err=tr("Le fichier n est pas defini")
-           self.parent.recordUnit(999,self)
-           try :
-              MCFils=self.getChild('FileName')
-              MCFils.setValeur(None)
-           except :
-              pass
-           raise EficasException(self.fichier_err)
-
-      self.fichier_ini  = fichier
-      self.fichier_text = ""
-      self.contexte_fichier_init={}
-      self.fichier_unite=999
-      self.fichier_err=None
-      nbVariableOut=0
-      try :
-         from openturns import WrapperFile
-         monWrapper=WrapperFile(fichier)
-         data=monWrapper.getWrapperData()
-         maVariableListe=data.getVariableList()
-         nbVariables=maVariableListe.getSize()
-         for i in range(nbVariables) :
-             nom=maVariableListe[i].id_
-             type=maVariableListe[i].type_
-             if type :
-               #ligneTexte="%s=DETERMINISTICVARIABLE(N='%s',T='out',R=%d);\n" % (nom, nom, i)
-               ligneTexte=""
-               nbVariableOut=nbVariableOut+1
-             else :
-               ligneTexte="%s=DETERMINISTICVARIABLE(N='%s',T='in',R=%d);\n" % (nom, nom, i)
-             self.fichier_text = self.fichier_text + ligneTexte
-      except:
-         self.makeIncl2Except()
-         raise EficasException(" ")
-
-      if nbVariableOut != 1 :
-         self.makeIncl2Except(mess=tr("le fichier doit contenir une unique variable de sortie"))
-         raise EficasException(" ")
-
-      try:
-         import Extensions.jdc_include
-         self.JdC_aux=Extensions.jdc_include.JdC_include
-      except:
-         traceback.print_exc()
-         self.makeIncl2Except()
-         raise EficasException(" ")
-      
-      try:
-         self.makeContexteInclude(self.fichier_ini ,self.fichier_text)
-         self.old_context_fichier_init=self.contexte_fichier_init
-         self.parent.recordUnit(unite,self)
-         try :
-            MCFils=self.getChild('FileName')
-            MCFils.setValeur(fichier)
-         except :
-            pass
-      except:
-         self.makeIncl2Except()
-
-      # recalcul validite pour la matrice eventuelle
-      if reevalue :
-         for e in self.jdc.etapes:
-           if e.nom == "VARIABLE" :
-              e.state="modified"
-              try :
-                 mc=e.getChild('ModelVariable') 
-                 mc.state="modified"
-              except :
-                 pass
-           if e.nom == "CORRELATION" :
-              e.state="modified"
-              try :
-                 mc=e.getChild('Matrix') 
-                 mc.state="modified"
-                 mcFeuille=mc.getChild('CorrelationMatrix')
-                 mcFeuille.state="modified"
-              except :
-                 pass
-              e.isValid()
-
-  def makeIncl2Except(self,mess=None):
-         l=traceback.format_exception_only(tr("Fichier invalide"),sys.exc_info()[1])
-         if self.jdc.editor is not None:
-             if mess == None :
-                     self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier inclus"),
-                     message= tr("Le contenu de ce fichier ne sera pas pris en compte\n %s",\
-                                                                   ''.join(l)))
-
-             else :
-                     self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier inclus"),
-                                            message=tr(mess))
-         #self.parent.recordUnit(unite,self)
-         self.g_context={}
-         self.etapes=[]
-         self.jdc_aux=None
-         self.fichier_err = ''.join(l)
-         self.contexte_fichier_init={}
-         try :
+    def getFile(self,unite=None,fic_origine=''):
+        """Retourne le nom du fichier et le source correspondant a l'unite unite
+        """
+        if self.jdc :
+            f,text=self.jdc.getFile(unite=unite,fic_origine=fic_origine)
+        else:
+            f,text=None,None
+        return f,text
+
+
+    def makeInclude3(self,fichier=None):
+        self.makeIncludeCarmel(fichier)
+
+
+    def makeIncludeCND(self,fichier=None):
+        unite=999
+        if fichier==None : return
+        if hasattr(self,'fichier_ini') : print((self.fichier_ini))
+        if hasattr(self,'fichier_ini') : return
+        self.fichier_ini=fichier
+        from acquiertGroupes import getGroupes
+        erreur,listeGroupes=getGroupes(fichier)
+        if erreur != "" : print ("a traiter")
+        texteSources=""
+        texteCond=""
+        texteNoCond=""
+        texteVcut=""
+        for groupe in listeGroupes :
+            if groupe[0:8]=='CURRENT_': texteSources +=groupe[8:]+"=SOURCE();\n"
+            if groupe[0:5]=='COND_':    texteCond    +=groupe[5:]+"=CONDUCTEUR();\n"
+            if groupe[0:7]=='NOCOND_':  texteNoCond  +=groupe[7:]+"=NOCOND();\n"
+            #if groupe[0:5]=='VCUT_':    texteVcut    +=groupe[5:]+"=VCUT();\n"
+            if groupe[0:5]=='VCUT_':    texteVcut    +='V_'+groupe[5:]+"=VCUT();\n"
+        texte=texteSources+texteCond+texteNoCond+texteVcut
+        #print (texte)
+        self.buildIncludeInclude(texte)
+        if CONTEXT.getCurrentStep()==None : CONTEXT.setCurrentStep(self)
+        reevalue=0
+
+    def makeIncludeCarmel(self,fichier=None):
+    # Pour Carmel
+        #print "je suis dans makeIncludeCarmel"
+        unite=999
+        if hasattr(self,'fichier_ini') : return
+        reevalue=0
+        if hasattr(self,'old_context_fichier_init' ):
+            reevalue=1
+            for concept in self.old_context_fichier_init.values():
+                self.jdc.deleteConcept(concept)
+        if fichier == None :
+            fichier=str(self.jdc.appliEficas.getFile_dictDonnees())
+            if fichier  == str("") :
+                self.fichier_ini="badfile"
+                self.fichier_text=""
+                self.fichier_err=tr("Le fichier n est pas defini")
+                self.parent.recordUnit(999,self)
+                try :
+                    MCFils=self.getChild('FileName')
+                    MCFils.setValeur(None)
+                except :
+                    pass
+                raise EficasException(self.fichier_err)
+        self.fichier_ini  = fichier
+        f=open(self.fichier_ini,'r')
+        self.fichier_text=f.read()
+        f.close()
+
+        self.contexte_fichier_init={}
+        self.fichier_unite=999
+        self.fichier_err=None
+
+        try:
+        #if 1 :
+            import Extensions.jdc_include
+            self.JdC_aux=Extensions.jdc_include.JdC_include
+        except:
+        #else:
+            traceback.print_exc()
+            self.makeIncl2Except()
+            raise EficasException(" ")
+
+        try:
+        #if 1 :
+            self.makeContexteInclude(self.fichier_ini ,self.fichier_text)
+            self.old_context_fichier_init=self.contexte_fichier_init
+            self.parent.recordUnit(unite,self)
+            try :
+                MCFils=self.getChild('FileName')
+                #MCFils.setValeur(fichier)
+                #on appelle pas setValeur qui modifie le contexte ce qui fout le bazar
+                #pas de modification de bloc
+                MCFils.valeur=fichier
+                MCFils.val=fichier
+            except :
+                pass
+        except:
+        #else:
+            self.makeIncl2Except()
+        # Cette P*** de ligne suivante ne fonctionne que pour Aster
+        # si quelqu un a une idee merci de m en parler
+        #CONTEXT.setCurrentStep(self)
+
+    def makeInclude2(self,fichier=None):
+    # Pour OT
+        # gestion de l unicite SVP
+        unite=999
+
+        if hasattr(self,'fichier_ini') : return
+        reevalue=0
+        if hasattr(self,'old_context_fichier_init' ):
+            reevalue=1
+            for concept in self.old_context_fichier_init.values():
+                self.jdc.deleteConcept(concept)
+
+        if fichier == None :
+            fichier=str(self.jdc.appliEficas.getFileVariable())
+            if fichier  == str("") :
+                self.fichier_ini="badfile"
+                self.fichier_text=""
+                self.fichier_err=tr("Le fichier n est pas defini")
+                self.parent.recordUnit(999,self)
+                try :
+                    MCFils=self.getChild('FileName')
+                    MCFils.setValeur(None)
+                except :
+                    pass
+                raise EficasException(self.fichier_err)
+
+        self.fichier_ini  = fichier
+        self.fichier_text = ""
+        self.contexte_fichier_init={}
+        self.fichier_unite=999
+        self.fichier_err=None
+        nbVariableOut=0
+        try :
+            from openturns import WrapperFile
+            monWrapper=WrapperFile(fichier)
+            data=monWrapper.getWrapperData()
+            maVariableListe=data.getVariableList()
+            nbVariables=maVariableListe.getSize()
+            for i in range(nbVariables) :
+                nom=maVariableListe[i].id_
+                type=maVariableListe[i].type_
+                if type :
+                        #ligneTexte="%s=DETERMINISTICVARIABLE(N='%s',T='out',R=%d);\n" % (nom, nom, i)
+                    ligneTexte=""
+                    nbVariableOut=nbVariableOut+1
+                else :
+                    ligneTexte="%s=DETERMINISTICVARIABLE(N='%s',T='in',R=%d);\n" % (nom, nom, i)
+                self.fichier_text = self.fichier_text + ligneTexte
+        except:
+            self.makeIncl2Except()
+            raise EficasException(" ")
+
+        if nbVariableOut != 1 :
+            self.makeIncl2Except(mess=tr("le fichier doit contenir une unique variable de sortie"))
+            raise EficasException(" ")
+
+        try:
+            import Extensions.jdc_include
+            self.JdC_aux=Extensions.jdc_include.JdC_include
+        except:
+            traceback.print_exc()
+            self.makeIncl2Except()
+            raise EficasException(" ")
+
+        try:
+            self.makeContexteInclude(self.fichier_ini ,self.fichier_text)
+            self.old_context_fichier_init=self.contexte_fichier_init
+            self.parent.recordUnit(unite,self)
+            try :
+                MCFils=self.getChild('FileName')
+                MCFils.setValeur(fichier)
+            except :
+                pass
+        except:
+            self.makeIncl2Except()
+
+        # recalcul validite pour la matrice eventuelle
+        if reevalue :
+            for e in self.jdc.etapes:
+                if e.nom == "VARIABLE" :
+                    e.state="modified"
+                    try :
+                        mc=e.getChild('ModelVariable')
+                        mc.state="modified"
+                    except :
+                        pass
+                if e.nom == "CORRELATION" :
+                    e.state="modified"
+                    try :
+                        mc=e.getChild('Matrix')
+                        mc.state="modified"
+                        mcFeuille=mc.getChild('CorrelationMatrix')
+                        mcFeuille.state="modified"
+                    except :
+                        pass
+                    e.isValid()
+
+    def makeIncl2Except(self,mess=None):
+        l=traceback.format_exception_only(tr("Fichier invalide"),sys.exc_info()[1])
+        if self.jdc.editor is not None:
+            if mess == None :
+                self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier inclus"),
+                message= tr("Le contenu de ce fichier ne sera pas pris en compte\n %s",\
+                                                              ''.join(l)))
+
+            else :
+                self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier inclus"),
+                                       message=tr(mess))
+        #self.parent.recordUnit(unite,self)
+        self.g_context={}
+        self.etapes=[]
+        self.jdc_aux=None
+        self.fichier_err = ''.join(l)
+        self.contexte_fichier_init={}
+        try :
             MCFils=self.getChild('FileName')
             MCFils.setValeur(None)
-         except :
+        except :
             pass
 
 
 #ATTENTION SURCHARGE : cette methode surcharge celle de Noyau (a garder en synchro)
-  #def makeInclude(self, unite=None, fname=None):
-  def makeInclude(self, unite=None, fname=None):
-      """
-          Inclut un fichier dont l'unite logique est unite
-          Cette methode est appelee par la fonction sd_prod de la macro INCLUDE
-          Si l'INCLUDE est invalide, la methode doit produire une exception 
-          Sinon on retourne None. Les concepts produits par l'INCLUDE sont
-          pris en compte par le JDC parent lors du calcul du contexte (appel de ???)
-      """
-      # On supprime l'attribut unite qui bloque l'evaluation du source de l'INCLUDE
-      # car on ne s'appuie pas sur lui dans EFICAS mais sur l'attribut fichier_ini
-      # Si unite n'a pas de valeur, l'etape est forcement invalide. On peut retourner None
-      #if not unite and not fname:
-      #    return
-      # 2020 on supprime unite
-      #      attention cependant c est utilise pour poursuite
-      #      PNPN a revoir
-      if not fname : return 
-
-      if not hasattr(self,'fichier_ini') : 
-         # Si le fichier n'est pas defini on le demande
-         f,text=self.getFileMemo(unite=unite, fname=fname, fic_origine=self.parent.nom)
-         # On memorise le fichier retourne
-         self.fichier_ini  = f
-         self.fichier_text = text
-         self.contexte_fichier_init={}
-         self.fichier_unite=unite
-         self.fichier_err=None
-         try:
-           import Extensions.jdc_include
-         except:
-           traceback.print_exc()
-           raise EficasException("pb import Extensions")
-         self.JdC_aux=Extensions.jdc_include.JdC_include
-
-         #print "makeInclude",self.fichier_ini,self.fichier_text 
-         if f is None and not text:
-             self.fichier_err=tr("Le fichier INCLUDE n est pas defini")
-             self.parent.recordUnit(unite,self)
-             raise EficasException(self.fichier_err)
-
-         try:
-           self.makeContexteInclude(self.fichier_ini ,self.fichier_text)
-           self.parent.recordUnit(unite,self)
-         except:
-           l=traceback.format_exception_only(tr("Fichier invalide %s",sys.exc_info()[1]))
-           if self.jdc.editor:
-              self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier inclus"),
-                                            message=tr("Le contenu de ce fichier ne sera pas pris en compte\n"+''.join(l)))
-           self.parent.recordUnit(unite,self)
-           self.g_context={}
-           self.etapes=[]
-           self.jdc_aux=None
-           self.fichier_err = ''.join(l)
-           self.contexte_fichier_init={}
-           raise EficasException(" ")
-
-      else:
-         # Si le fichier est deja defini on ne reevalue pas le fichier
-         # et on leve une exception si une erreur a ete enregistree
-         self.updateFichierInit(unite)
-         self.fichier_unite=unite
-         if self.fichier_err is not None: raise EficasException(self.fichier_err)
-      #print ('self.g_context', self.g_context)
-        
+    #def makeInclude(self, unite=None, fname=None):
+    def makeInclude(self, unite=None, fname=None):
+        """
+            Inclut un fichier dont l'unite logique est unite
+            Cette methode est appelee par la fonction sd_prod de la macro INCLUDE
+            Si l'INCLUDE est invalide, la methode doit produire une exception
+            Sinon on retourne None. Les concepts produits par l'INCLUDE sont
+            pris en compte par le JDC parent lors du calcul du contexte (appel de ???)
+        """
+        # On supprime l'attribut unite qui bloque l'evaluation du source de l'INCLUDE
+        # car on ne s'appuie pas sur lui dans EFICAS mais sur l'attribut fichier_ini
+        # Si unite n'a pas de valeur, l'etape est forcement invalide. On peut retourner None
+        #if not unite and not fname:
+        #    return
+        # 2020 on supprime unite
+        #      attention cependant c est utilise pour poursuite
+        #      PNPN a revoir
+        if not fname : return
+
+        if not hasattr(self,'fichier_ini') :
+        # Si le fichier n'est pas defini on le demande
+            f,text=self.getFileMemo(unite=unite, fname=fname, fic_origine=self.parent.nom)
+            # On memorise le fichier retourne
+            self.fichier_ini  = f
+            self.fichier_text = text
+            self.contexte_fichier_init={}
+            self.fichier_unite=unite
+            self.fichier_err=None
+            try:
+                import Extensions.jdc_include
+            except:
+                traceback.print_exc()
+                raise EficasException("pb import Extensions")
+            self.JdC_aux=Extensions.jdc_include.JdC_include
+
+            #print "makeInclude",self.fichier_ini,self.fichier_text
+            if f is None and not text:
+                self.fichier_err=tr("Le fichier INCLUDE n est pas defini")
+                self.parent.recordUnit(unite,self)
+                raise EficasException(self.fichier_err)
+
+            try:
+                self.makeContexteInclude(self.fichier_ini ,self.fichier_text)
+                self.parent.recordUnit(unite,self)
+            except:
+                l=traceback.format_exception_only(tr("Fichier invalide %s",sys.exc_info()[1]))
+                if self.jdc.editor:
+                    self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier inclus"),
+                                                  message=tr("Le contenu de ce fichier ne sera pas pris en compte\n"+''.join(l)))
+                self.parent.recordUnit(unite,self)
+                self.g_context={}
+                self.etapes=[]
+                self.jdc_aux=None
+                self.fichier_err = ''.join(l)
+                self.contexte_fichier_init={}
+                raise EficasException(" ")
+
+        else:
+            # Si le fichier est deja defini on ne reevalue pas le fichier
+            # et on leve une exception si une erreur a ete enregistree
+            self.updateFichierInit(unite)
+            self.fichier_unite=unite
+            if self.fichier_err is not None: raise EficasException(self.fichier_err)
+        #print ('self.g_context', self.g_context)
+
 
 #ATTENTION SURCHARGE : cette methode surcharge celle de Noyau (a garder en synchro)
-  def makeContexte(self,fichier,text):
-    """
-        Cette methode sert a creer un contexte pour INCLUDE_MATERIAU
-        en interpretant un texte source Python
-        Elle est appelee par la fonction sd_prod d'INCLUDE_MATERIAU
-    """
-    #print "makeContexte",fichier
-    # On supprime l'attribut mat qui bloque l'evaluation du source de l'INCLUDE_MATERIAU
-    # car on ne s'appuie pas sur lui dans EFICAS mais sur l'attribut fichier_ini
-    if hasattr(self,'mat'):del self.mat
-    if not hasattr(self,'fichier_ini') or self.fichier_ini != fichier or self.fichier_mater != self.nom_mater: 
-       # le fichier est nouveau ou change
-       self.fichier_ini =fichier
-       self.fichier_unite =fichier
-       self.fichier_mater=self.nom_mater
-       self.fichier_text=text
-       self.fichier_err=None 
-       self.contexte_fichier_init={}
-       # On specifie la classe a utiliser pour le JDC auxiliaire
-       try:
-         import Extensions.jdc_include
-         self.JdC_aux=Extensions.jdc_include.JdC_include
-       except:
-         raise EficasException(" ")
-       try:
-          self.makeContexteInclude(self.fichier_ini ,self.fichier_text)
-          if not self.nom_mater in self.g_context :
-             #Pour permettre de lire un jeu de commandes avec des INCLUDE_MATERIAU errones
-             self.g_context[self.nom_mater]=None
-             if self.parent: self.parent.g_context[self.nom_mater]=None
-       except:
-          l=traceback.format_exception_only(tr("Fichier invalide %s",sys.exc_info()[1]))
-          self.fichier_err = ''.join(l)
-          self.g_context={}
-          #Pour permettre de lire un jeu de commandes avec des INCLUDE_MATERIAU errones
-          if self.parent:
-              self.parent.g_context[self.nom_mater]=None
-          self.g_context[self.nom_mater]=None
-          #-------------
-          self.etapes=[]
-          self.jdc_aux=None
-          self.contexte_fichier_init={}
-          raise EficasException(" ")
-    else:
-       # le fichier est le meme on ne le reevalue pas
-       # et on leve une exception si une erreur a ete enregistree
-       if self.fichier_err is not None: raise EficasException(self.fichier_err)
+    def makeContexte(self,fichier,text):
+        """
+            Cette methode sert a creer un contexte pour INCLUDE_MATERIAU
+            en interpretant un texte source Python
+            Elle est appelee par la fonction sd_prod d'INCLUDE_MATERIAU
+        """
+        #print "makeContexte",fichier
+        # On supprime l'attribut mat qui bloque l'evaluation du source de l'INCLUDE_MATERIAU
+        # car on ne s'appuie pas sur lui dans EFICAS mais sur l'attribut fichier_ini
+        if hasattr(self,'mat'):del self.mat
+        if not hasattr(self,'fichier_ini') or self.fichier_ini != fichier or self.fichier_mater != self.nom_mater:
+            # le fichier est nouveau ou change
+            self.fichier_ini =fichier
+            self.fichier_unite =fichier
+            self.fichier_mater=self.nom_mater
+            self.fichier_text=text
+            self.fichier_err=None
+            self.contexte_fichier_init={}
+            # On specifie la classe a utiliser pour le JDC auxiliaire
+            try:
+                import Extensions.jdc_include
+                self.JdC_aux=Extensions.jdc_include.JdC_include
+            except:
+                raise EficasException(" ")
+            try:
+                self.makeContexteInclude(self.fichier_ini ,self.fichier_text)
+                if not self.nom_mater in self.g_context :
+                #Pour permettre de lire un jeu de commandes avec des INCLUDE_MATERIAU errones
+                    self.g_context[self.nom_mater]=None
+                    if self.parent: self.parent.g_context[self.nom_mater]=None
+            except:
+                l=traceback.format_exception_only(tr("Fichier invalide %s",sys.exc_info()[1]))
+                self.fichier_err = ''.join(l)
+                self.g_context={}
+                #Pour permettre de lire un jeu de commandes avec des INCLUDE_MATERIAU errones
+                if self.parent:
+                    self.parent.g_context[self.nom_mater]=None
+                self.g_context[self.nom_mater]=None
+                #-------------
+                self.etapes=[]
+                self.jdc_aux=None
+                self.contexte_fichier_init={}
+                raise EficasException(" ")
+        else:
+            # le fichier est le meme on ne le reevalue pas
+            # et on leve une exception si une erreur a ete enregistree
+            if self.fichier_err is not None: raise EficasException(self.fichier_err)
 
 #ATTENTION SURCHARGE : cette methode surcharge celle de Noyau (a garder en synchro)
-  def updateSdprod(self,cr='non'):
-     # Cette methode peut etre appelee dans EFICAS avec des mots cles de 
-     # la commande modifies. Ceci peut conduire a la construction ou
-     # a la reconstruction d'etapes dans le cas d'INCLUDE ou d'INCLUDE_MATERIAU
-     # Il faut donc positionner le current_step avant l'appel
-     CONTEXT.unsetCurrentStep()
-     CONTEXT.setCurrentStep(self)
-     valid=Validation.V_MACRO_ETAPE.MACRO_ETAPE.updateSdprod(self,cr=cr)
-     CONTEXT.unsetCurrentStep()
-     return valid
-
-#ATTENTION SURCHARGE: cette methode surcharge celle de Noyau a garder en synchro 
-  def buildSd(self,nom):
-      """
-           Methode de Noyau surchargee pour poursuivre malgre tout
-           si une erreur se produit pendant la creation du concept produit
-      """
-      try:
-         sd=Noyau.N_MACRO_ETAPE.MACRO_ETAPE.buildSd(self,nom)
-      except :
-      #   return None
-      #except AsException,e:
-         # Une erreur s'est produite lors de la construction du concept
-         # Comme on est dans EFICAS, on essaie de poursuivre quand meme
-         # Si on poursuit, on a le choix entre deux possibilites :
-         # 1. on annule la sd associee a self
-         # 2. on la conserve mais il faut la retourner
-         # On choisit de l'annuler
-         # En plus il faut rendre coherents sdnom et sd.nom
-         self.sd=None
-         self.sdnom=None
-         self.state="unchanged"
-         self.valid=0
-
-      return self.sd
-
-#ATTENTION SURCHARGE: cette methode surcharge celle de Noyau a garder en synchro 
-  def makePoursuite(self):
-      """ Cette methode est appelee par la fonction sd_prod de la macro POURSUITE
-      """
-      #print "makePoursuite"
-      if not hasattr(self,'fichier_ini') :
-         # Si le fichier n'est pas defini on le demande
-         f,text=self.getFileMemo(fic_origine=self.parent.nom)
-         # On memorise le fichier retourne
-         self.fichier_ini = f
-         self.fichier_unite = None
-         self.fichier_text = text
-         self.fichier_err=None
-         try:
-           import Extensions.jdc_include
-         except:
-           traceback.print_exc()
-           raise EficasException(" ")
-         self.JdC_aux=Extensions.jdc_include.JdC_poursuite
-         self.contexte_fichier_init={}
-         #print "makePoursuite",self.fichier_ini,self.fichier_text
-
-         if f is None:
-             self.fichier_err="Le fichier POURSUITE n'est pas defini"
-             self.jdc_aux=None
-             self.parent.recordUnit(None,self)
-             raise EficasException(self.fichier_err)
-
-         try:
-           self.makeContexteInclude(self.fichier_ini,self.fichier_text)
-           self.parent.recordUnit(None,self)
-         except:
-           l=traceback.format_exception_only("Fichier invalide",sys.exc_info()[1])
-           if self.jdc.editor:
-              self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier poursuite"),
-                                            message=tr("Ce fichier ne sera pas pris en compte\n %s",''.join(l)))
-           self.parent.recordUnit(None,self)
-           self.g_context={}
-           self.etapes=[]
-           self.jdc_aux=None
-           self.fichier_err = ''.join(l)
-           self.contexte_fichier_init={}
-           raise EficasException(" ")
-
-      else:
-         # Si le fichier est deja defini on ne reevalue pas le fichier
-         # et on leve une exception si une erreur a ete enregistree
-         self.updateFichierInit(None)
-         if self.fichier_err is not None: raise EficasException(self.fichier_err)
+    def updateSdprod(self,cr='non'):
+        # Cette methode peut etre appelee dans EFICAS avec des mots cles de
+        # la commande modifies. Ceci peut conduire a la construction ou
+        # a la reconstruction d'etapes dans le cas d'INCLUDE ou d'INCLUDE_MATERIAU
+        # Il faut donc positionner le current_step avant l'appel
+        CONTEXT.unsetCurrentStep()
+        CONTEXT.setCurrentStep(self)
+        valid=Validation.V_MACRO_ETAPE.MACRO_ETAPE.updateSdprod(self,cr=cr)
+        CONTEXT.unsetCurrentStep()
+        return valid
+
+#ATTENTION SURCHARGE: cette methode surcharge celle de Noyau a garder en synchro
+    def buildSd(self,nom):
+        """
+             Methode de Noyau surchargee pour poursuivre malgre tout
+             si une erreur se produit pendant la creation du concept produit
+        """
+        try:
+            sd=Noyau.N_MACRO_ETAPE.MACRO_ETAPE.buildSd(self,nom)
+        except :
+        #   return None
+        #except AsException,e:
+            # Une erreur s'est produite lors de la construction du concept
+            # Comme on est dans EFICAS, on essaie de poursuivre quand meme
+            # Si on poursuit, on a le choix entre deux possibilites :
+            # 1. on annule la sd associee a self
+            # 2. on la conserve mais il faut la retourner
+            # On choisit de l'annuler
+            # En plus il faut rendre coherents sdnom et sd.nom
+            self.sd=None
+            self.sdnom=None
+            self.state="unchanged"
+            self.valid=0
+
+        return self.sd
+
+#ATTENTION SURCHARGE: cette methode surcharge celle de Noyau a garder en synchro
+    def makePoursuite(self):
+        """ Cette methode est appelee par la fonction sd_prod de la macro POURSUITE
+        """
+        #print "makePoursuite"
+        if not hasattr(self,'fichier_ini') :
+            # Si le fichier n'est pas defini on le demande
+            f,text=self.getFileMemo(fic_origine=self.parent.nom)
+            # On memorise le fichier retourne
+            self.fichier_ini = f
+            self.fichier_unite = None
+            self.fichier_text = text
+            self.fichier_err=None
+            try:
+                import Extensions.jdc_include
+            except:
+                traceback.print_exc()
+                raise EficasException(" ")
+            self.JdC_aux=Extensions.jdc_include.JdC_poursuite
+            self.contexte_fichier_init={}
+            #print "makePoursuite",self.fichier_ini,self.fichier_text
+
+            if f is None:
+                self.fichier_err="Le fichier POURSUITE n'est pas defini"
+                self.jdc_aux=None
+                self.parent.recordUnit(None,self)
+                raise EficasException(self.fichier_err)
+
+            try:
+                self.makeContexteInclude(self.fichier_ini,self.fichier_text)
+                self.parent.recordUnit(None,self)
+            except:
+                l=traceback.format_exception_only("Fichier invalide",sys.exc_info()[1])
+                if self.jdc.editor:
+                    self.jdc.editor.afficheAlerte(tr("Erreur lors de l'evaluation du fichier poursuite"),
+                                                  message=tr("Ce fichier ne sera pas pris en compte\n %s",''.join(l)))
+                self.parent.recordUnit(None,self)
+                self.g_context={}
+                self.etapes=[]
+                self.jdc_aux=None
+                self.fichier_err = ''.join(l)
+                self.contexte_fichier_init={}
+                raise EficasException(" ")
+
+        else:
+            # Si le fichier est deja defini on ne reevalue pas le fichier
+            # et on leve une exception si une erreur a ete enregistree
+            self.updateFichierInit(None)
+            if self.fichier_err is not None: raise EficasException(self.fichier_err)
index 923bb6499442b0bc7df0b4630eaf53a74e78a5da..c96a9f80f6e43934cc80d70863dca98fd28b3187 100644 (file)
@@ -21,7 +21,5 @@ from __future__ import absolute_import
 from . import I_MCCOMPO
 class MCBLOC(I_MCCOMPO.MCCOMPO):
 
-   def getNomDsXML(self):
-     return self.parent.getNomDsXML()
-
-
+    def getNomDsXML(self):
+        return self.parent.getNomDsXML()
index 7d764b8786e3dbfc6db0b2736e2edf0b0ac634aa..c7cf0d25a102d7cc03e387e8d13b4a28303492c4 100644 (file)
@@ -36,449 +36,482 @@ from . import I_OBJECT
 from . import CONNECTOR
 
 class MCCOMPO(I_OBJECT.OBJECT):
-  def getLabelText(self):
-    """ 
-       Retourne le label de self 
-       utilise pour l'affichage dans l'arbre
-    """
-    return tr(self.nom)
-
-  def getListeMcOrdonnee(self,liste,dico):
-    """
-       Retourne la liste ordonnee (suivant le catalogue) des mots-cles
-       d'une entite composee dont le chemin complet est donne sous forme
-       d'une liste du type :ETAPE + MCFACT ou MCBLOC + ...
-       il faut encore rearranger cette liste (certains mots-cles deja
-       presents ne doivent plus etre proposes, regles ...)
-    """
-    return self.filtreListeMc(self.getListeMcOrdonneeBrute(liste,dico))
-
-  def getListeMcOrdonneeBrute(self,liste,dico):
-    """
-       Retourne la liste ordonnee (suivant le catalogue) BRUTE des mots-cles
-       d'une entite composee dont le chemin complet est donne sous forme
-       d'une liste du type :ETAPE + MCFACT ou MCBLOC + ...
-    """
-    for arg in liste:
-        objet_cata = dico[arg]
-        dico=objet_cata.entites
-        l=[]
-        specifique=0
-        for obj in list(dico.keys()) :
-            if not(hasattr(dico[obj],'cache')) or dico[obj].cache==0 :
-               l.append(obj)
+    def getLabelText(self):
+        """
+           Retourne le label de self
+           utilise pour l'affichage dans l'arbre
+        """
+        return tr(self.nom)
+
+    def getListeMcOrdonnee(self,liste,dico):
+        """
+           Retourne la liste ordonnee (suivant le catalogue) des mots-cles
+           d'une entite composee dont le chemin complet est donne sous forme
+           d'une liste du type :ETAPE + MCFACT ou MCBLOC + ...
+           il faut encore rearranger cette liste (certains mots-cles deja
+           presents ne doivent plus etre proposes, regles ...)
+        """
+        return self.filtreListeMc(self.getListeMcOrdonneeBrute(liste,dico))
+
+    def getListeMcOrdonneeBrute(self,liste,dico):
+        """
+           Retourne la liste ordonnee (suivant le catalogue) BRUTE des mots-cles
+           d'une entite composee dont le chemin complet est donne sous forme
+           d'une liste du type :ETAPE + MCFACT ou MCBLOC + ...
+        """
+        for arg in liste:
+            objet_cata = dico[arg]
+            dico=objet_cata.entites
+            l=[]
+            specifique=0
+            for obj in list(dico.keys()) :
+                if not(hasattr(dico[obj],'cache')) or dico[obj].cache==0 :
+                    l.append(obj)
+                else :
+                    specifique=1
+            if specifique == 1 : return l
+        return objet_cata.ordre_mc
+
+    def filtreListeMc(self,liste_brute):
+        """
+           Cette methode est appelee par EFICAS afin de presenter a
+           l'utilisateur la liste des enfants possibles de self actualisee
+           en fonction du contexte de self. En clair, sont supprimes de la
+           liste des possibles (fournie par la definition), les mots-cles
+           exclus par les regles de self et les mots-cles ne pouvant plus
+           etre repetes
+        """
+        liste = copy(liste_brute)
+        listeMcPresents = self.listeMcPresents()
+        # on enleve les mots-cles non permis par les regles
+        for regle in self.definition.regles:
+            # la methode purgeListe est a developper pour chaque regle qui
+            # influe sur la liste de choix a proposer a l'utilisateur
+            # --> EXCLUS,UN_PARMI,PRESENT_ABSENT
+            liste = regle.purgeListe(liste,listeMcPresents)
+        # on enleve les mots-cles dont l'occurrence est deja atteinte
+        liste_copy = copy(liste)
+        for k in liste_copy:
+            objet = self.getChild(k,restreint = 'oui')
+            if objet != None :
+            # l'objet est deja present : il faut distinguer plusieurs cas
+                if isinstance(objet,MCSIMP):
+                    # un mot-cle simple ne peut pas etre repete
+                    liste.remove(k)
+                elif isinstance(objet,MCBLOC):
+                    # un bloc conditionnel ne doit pas apparaitre dans la liste de choix
+                    liste.remove(k)
+                elif isinstance(objet,MCFACT):
+                    # un mot-cle facteur ne peut pas etre repete plus de self.max fois
+                    if objet.definition.max == 1:
+                        liste.remove(k)
+                elif isinstance(objet,MCList):
+                    try :
+                        nb_occur_maxi = objet[0].definition.max
+                        if len(objet) >= nb_occur_maxi:
+                            liste.remove(k)
+                    except:
+                        pass
+                else :
+                    #XXX CCAR : les MCNUPLET ne sont pas traites
+                    if CONTEXT.debug : print('   ',k,' est un objet de type inconnu :',type(objet))
             else :
-               specifique=1
-        if specifique == 1 : return l    
-    return objet_cata.ordre_mc
-
-  def filtreListeMc(self,liste_brute):
-    """ 
-       Cette methode est appelee par EFICAS afin de presenter a 
-       l'utilisateur la liste des enfants possibles de self actualisee 
-       en fonction du contexte de self. En clair, sont supprimes de la
-       liste des possibles (fournie par la definition), les mots-cles
-       exclus par les regles de self et les mots-cles ne pouvant plus 
-       etre repetes
-    """
-    liste = copy(liste_brute)
-    listeMcPresents = self.listeMcPresents()
-    # on enleve les mots-cles non permis par les regles
-    for regle in self.definition.regles:
-       # la methode purgeListe est a developper pour chaque regle qui
-       # influe sur la liste de choix a proposer a l'utilisateur
-       # --> EXCLUS,UN_PARMI,PRESENT_ABSENT
-       liste = regle.purgeListe(liste,listeMcPresents)
-    # on enleve les mots-cles dont l'occurrence est deja atteinte
-    liste_copy = copy(liste)
-    for k in liste_copy:
-      objet = self.getChild(k,restreint = 'oui')
-      if objet != None :
-        # l'objet est deja present : il faut distinguer plusieurs cas
-        if isinstance(objet,MCSIMP):
-          # un mot-cle simple ne peut pas etre repete
-          liste.remove(k)
-        elif isinstance(objet,MCBLOC):
-          # un bloc conditionnel ne doit pas apparaitre dans la liste de choix
-          liste.remove(k)
-        elif isinstance(objet,MCFACT):
-          # un mot-cle facteur ne peut pas etre repete plus de self.max fois
-          if objet.definition.max == 1:
-            liste.remove(k)
-        elif isinstance(objet,MCList):
-          try :
-            nb_occur_maxi = objet[0].definition.max
-            if len(objet) >= nb_occur_maxi:
-              liste.remove(k)
-          except:
-            pass
-        else :
-          #XXX CCAR : les MCNUPLET ne sont pas traites
-          if CONTEXT.debug : print('   ',k,' est un objet de type inconnu :',type(objet))
-      else :
-        # l'objet est absent : on enleve de la liste les blocs
-        if self.definition.entites[k].statut=='c' :
-          liste.remove(k)
-        if self.definition.entites[k].label=='BLOC':
-          liste.remove(k)
-    # Pour corriger les exces qui pourraient etre commis dans la methode purgeListe
-    # des regles, on essaie de compenser comme suit :
-    # on ajoute les mots cles facteurs presents dont l'occurence n'est pas atteinte
-    for k in listeMcPresents:
-      if k in liste:continue
-      objet = self.getChild(k,restreint = 'oui')
-      if isinstance(objet,MCFACT):
-          # un mot-cle facteur ne peut pas etre repete plus de self.max fois
-          if objet.definition.max > 1:
-             liste.append(k)
-      elif isinstance(objet,MCList):
-          nb_occur_maxi = objet[0].definition.max
-          if len(objet) < nb_occur_maxi:
-              liste.append(k)
-    return liste
-
-  def listeMcPresents(self):
-    """ 
-       Retourne la liste des noms des mots-cles fils de self presents construite
-       a partir de self.mcListe 
-    """
-    l=[]
-    for v in self.mcListe:
-      k=v.nom
-      l.append(k)
-    return l
-
-  def getIndexChild(self,nom_fils):
-      """
-        Retourne l'index dans la liste des fils de self du nouveau fils de nom nom_fils
-        Permet de savoir a quelle position il faut ajouter un nouveau mot-cle
-      """
-      cata_ordonne = self.jdc.cata_ordonne_dico
-      liste_noms_mc_ordonnee = self.getListeMcOrdonneeBrute(self.getGenealogie(),cata_ordonne)
-      liste_noms_mc_presents = self.listeMcPresents()
-      index=0
-      for nom in liste_noms_mc_ordonnee:
-          if nom == nom_fils:break
-          if nom not in liste_noms_mc_presents :continue
-          index=index+1
-      return index
-          
-  def chercheIndiceDsLeContenu(self,objet) :
-  # uniquement pour Pyxb
-  # ajoute la taille des les Blocs
-  # faut -il chercher plus loin ds les petits-enfants ?
-      if objet.nature == 'MCList' : objet=objet[0]
-      leRang=0
-      positionDsLaListe=0
-      try :
-        positionDsLaListe=self.mcListe.index(objet)
-        positionDsLaListeDeFactSiFact =0
-      except :
-        for mc in self.mcListe:
-           if mc.nature == 'MCList':
-              try :
-                positionDsLaListeDeFactSiFact=mc.index(objet)
-                break
-              except :
-                positionDsLaListe=positionDsLaListe+1
-           else : positionDsLaListe=positionDsLaListe+1
-      i=0
-      while i < positionDsLaListe :
-        leRang= leRang + self.mcListe[i].longueurDsArbre()
-        i=i+1
-      leRang=leRang+positionDsLaListeDeFactSiFact
-      return leRang
-
-  def ordonneListeMc(self,listeMc_a_ordonner,liste_noms_mc_ordonnee):
-    """
-        Retourne listeMc_a_ordonner ordonnee suivant l'ordre 
-        donne par liste_noms_mc_ordonnee
-    """
-    liste = []
-    # on transforme liste_a_ordonner en un dictionnaire (plus facile a consulter)
-    d_mc = {}
-    for mc in listeMc_a_ordonner:
-      d_mc[mc.nom]=mc
-    # on construit la liste des objets ordonnes
-    for nom_mc in liste_noms_mc_ordonnee:
-      if nom_mc in d_mc:
-        liste.append(d_mc.get(nom_mc))
-    # on la retourne
-    return liste
-
-  def suppEntite(self,objet) :
-    """ 
-        Supprime le fils 'objet' de self : 
-        Retourne 1 si la suppression a pu etre effectuee,
-        Retourne 0 dans le cas contraire
-    """
-    if not objet in self.mcListe:
-       # Impossible de supprimer objet. Il n'est pas dans mcListe
-       return 0
-
-    self.initModif()
-    objet.delObjPyxb()
-# PNPNPN a corriger
-    try :
-      objet.deleteRef()
-    except : pass
-    self.mcListe.remove(objet)
-    CONNECTOR.Emit(self,"supp",objet)
-    objet.deleteMcGlobal()
-    objet.updateConditionBloc()
-    objet.supprime()
-    self.etape.modified()
-    self.finModif()
-    return 1
-
-  def isOblig(self):
-      return 0
-
-  def addEntite(self,name,pos=None):
-      """ 
-          Ajoute le mot-cle name a la liste des mots-cles de
-          l'objet MCCOMPOSE
-      """
-      #print ('addEntite', name, pos)
-      self.initModif()
-      if type(name)==bytes or type(name) == str :
-        # on est en mode creation d'un motcle 
-        if self.ispermis(name) == 0 : return 0
-        objet=self.definition.entites[name](val=None,nom=name,parent=self)
-      else :
-        # dans ce cas on est en mode copie d'un motcle
-        objet = name
-        # Appel de la methode qui fait le menage dans les references
-        # sur les concepts produits (verification que les concepts existent
-        # dans le contexte de la commande courante).
-        objet.verifExistenceSd()
-
-      # On verifie que l'ajout d'objet est autorise
-      if self.ispermis(objet) == 0:
-        self.jdc.editor.afficheAlerte(tr("Erreur"),
-                                      tr("L'objet %(v_1)s ne peut  etre un fils de %(v_2)s",\
-                                      {'v_1': objet.nom, 'v_2': self.nom}))
+                # l'objet est absent : on enleve de la liste les blocs
+                if self.definition.entites[k].statut=='c' :
+                    liste.remove(k)
+                if self.definition.entites[k].label=='BLOC':
+                    liste.remove(k)
+        # Pour corriger les exces qui pourraient etre commis dans la methode purgeListe
+        # des regles, on essaie de compenser comme suit :
+        # on ajoute les mots cles facteurs presents dont l'occurence n'est pas atteinte
+        for k in listeMcPresents:
+            if k in liste:continue
+            objet = self.getChild(k,restreint = 'oui')
+            if isinstance(objet,MCFACT):
+                    # un mot-cle facteur ne peut pas etre repete plus de self.max fois
+                if objet.definition.max > 1:
+                    liste.append(k)
+            elif isinstance(objet,MCList):
+                nb_occur_maxi = objet[0].definition.max
+                if len(objet) < nb_occur_maxi:
+                    liste.append(k)
+        return liste
+
+    def listeMcPresents(self):
+        """
+           Retourne la liste des noms des mots-cles fils de self presents construite
+           a partir de self.mcListe
+        """
+        l=[]
+        for v in self.mcListe:
+            k=v.nom
+            l.append(k)
+        return l
+
+    def getIndexChild(self,nom_fils):
+        """
+          Retourne l'index dans la liste des fils de self du nouveau fils de nom nom_fils
+          Permet de savoir a quelle position il faut ajouter un nouveau mot-cle
+        """
+        cata_ordonne = self.jdc.cata_ordonne_dico
+        liste_noms_mc_ordonnee = self.getListeMcOrdonneeBrute(self.getGenealogie(),cata_ordonne)
+        liste_noms_mc_presents = self.listeMcPresents()
+        index=0
+        for nom in liste_noms_mc_ordonnee:
+            if nom == nom_fils:break
+            if nom not in liste_noms_mc_presents :continue
+            index=index+1
+        return index
+
+    def chercheIndiceDsLeContenu(self,objet) :
+    # uniquement pour Pyxb
+    # ajoute la taille des les Blocs
+    # faut -il chercher plus loin ds les petits-enfants ?
+        if objet.nature == 'MCList' : objet=objet[0]
+        leRang=0
+        positionDsLaListe=0
+        try :
+            positionDsLaListe=self.mcListe.index(objet)
+            positionDsLaListeDeFactSiFact =0
+        except :
+            for mc in self.mcListe:
+                if mc.nature == 'MCList':
+                    try :
+                        positionDsLaListeDeFactSiFact=mc.index(objet)
+                        break
+                    except :
+                        positionDsLaListe=positionDsLaListe+1
+                else : positionDsLaListe=positionDsLaListe+1
+        i=0
+        while i < positionDsLaListe :
+            leRang= leRang + self.mcListe[i].longueurDsArbre()
+            i=i+1
+        leRang=leRang+positionDsLaListeDeFactSiFact
+        return leRang
+
+
+    def ordonneListeMc(self,listeMc_a_ordonner,liste_noms_mc_ordonnee):
+        """
+            Retourne listeMc_a_ordonner ordonnee suivant l'ordre
+            donne par liste_noms_mc_ordonnee
+        """
+        liste = []
+        # on transforme liste_a_ordonner en un dictionnaire (plus facile a consulter)
+        d_mc = {}
+        for mc in listeMc_a_ordonner:
+            d_mc[mc.nom]=mc
+        # on construit la liste des objets ordonnes
+        for nom_mc in liste_noms_mc_ordonnee:
+            if nom_mc in d_mc:
+                liste.append(d_mc.get(nom_mc))
+        # on la retourne
+        return liste
+
+    def suppEntite(self,objet) :
+        """
+            Supprime le fils 'objet' de self :
+            Retourne 1 si la suppression a pu etre effectuee,
+            Retourne 0 dans le cas contraire
+        """
+        #print ('suppEntite', self.nom,objet.nom)
+        if not objet in self.mcListe:
+            # Impossible de supprimer objet. Il n'est pas dans mcListe
+            return 0
+
+        self.initModif()
+        objet.delObjPyxb()
+        objet.deleteRef()
+        self.mcListe.remove(objet)
+        CONNECTOR.Emit(self,"supp",objet)
+        objet.deleteMcGlobal()
+        objet.updateConditionBloc()
+        objet.supprime()
+        while self.etape.doitEtreRecalculee == True :
+            #print (' je suis dans le while')
+            self.etape.doitEtreRecalculee = False
+            self.etape.deepUpdateConditionBlocApresSuppression()
+        self.etape.modified()
         self.finModif()
+        return 1
+
+    def isOblig(self):
         return 0
 
-      # On cherche s'il existe deja un mot cle de meme nom
-      old_obj = self.getChild(objet.nom,restreint = 'oui')
-      if not old_obj :
-         # on normalize l'objet
-         objet=objet.normalize()
-         # Le mot cle n'existe pas encore. On l'ajoute a la position
-         # demandee (pos)
-         if pos == None :
-           self.mcListe.append(objet)
-         else :
-           self.mcListe.insert(pos,objet)
-         # Il ne faut pas oublier de reaffecter le parent d'obj (si copie)
-         objet.reparent(self)
-         if  self.cata.modeleMetier :
-             if isinstance(objet,MCList): objet[0].addObjPyxb(self.chercheIndiceDsLeContenu(objet))
-             else : objet.addObjPyxb(self.chercheIndiceDsLeContenu(objet))
-         CONNECTOR.Emit(self,"add",objet)
-         objet.updateMcGlobal()
-         objet.updateConditionBloc()
-         self.finModif()
-         return objet
-      else:
-         # Le mot cle existe deja. Si le mot cle est repetable,
-         # on cree une liste d'objets. Dans le cas contraire,
-         # on emet un message d'erreur.
-         if not old_obj.isRepetable():
-            self.jdc.editor.afficheAlerte(tr("Erreur"),tr("L'objet %s ne peut pas etre repete", objet.nom))
+    def addEntite(self,name,pos=None):
+        """
+            Ajoute le mot-cle name a la liste des mots-cles de
+            l'objet MCCOMPOSE
+        """
+        #print ('addEntite', name, pos)
+        self.initModif()
+        if type(name)==bytes or type(name) == str :
+                # on est en mode creation d'un motcle
+            if self.ispermis(name) == 0 : return 0
+            objet=self.definition.entites[name](val=None,nom=name,parent=self)
+        else :
+            # dans ce cas on est en mode copie d'un motcle
+            objet = name
+            # Appel de la methode qui fait le menage dans les references
+            # sur les concepts produits (verification que les concepts existent
+            # dans le contexte de la commande courante).
+            objet.verifExistenceSd()
+
+        # On verifie que l'ajout d'objet est autorise
+        if self.ispermis(objet) == 0:
+            self.jdc.editor.afficheAlerte(tr("Erreur"),
+                                          tr("L'objet %(v_1)s ne peut  etre un fils de %(v_2)s",\
+                                          {'v_1': objet.nom, 'v_2': self.nom}))
             self.finModif()
             return 0
-         else:
-            # une liste d'objets de meme type existe deja
-            old_obj.addEntite(objet)
+
+        # On cherche s'il existe deja un mot cle de meme nom
+        old_obj = self.getChild(objet.nom,restreint = 'oui')
+        if not old_obj :
+            # on normalize l'objet
+            objet=objet.normalize()
+            # Le mot cle n'existe pas encore. On l'ajoute a la position
+            # demandee (pos)
+            if pos == None :
+                self.mcListe.append(objet)
+            else :
+                self.mcListe.insert(pos,objet)
+            # Il ne faut pas oublier de reaffecter le parent d'obj (si copie)
+            objet.reparent(self)
             if  self.cata.modeleMetier :
-             if isinstance(objet,MCList): objet[0].addObjPyxb(self.chercheIndiceDsLeContenu(objet))
-             else : objet.addObjPyxb(self.chercheIndiceDsLeContenu(objet))
+                if isinstance(objet,MCList): objet[0].addObjPyxb(self.chercheIndiceDsLeContenu(objet))
+                else : objet.addObjPyxb(self.chercheIndiceDsLeContenu(objet))
+            CONNECTOR.Emit(self,"add",objet)
+            objet.updateMcGlobal()
+            objet.updateConditionBloc()
             self.finModif()
-            return old_obj
-
-  def ispermis(self,fils):
-    """ 
-        Retourne 1 si l'objet de nom nom_fils 
-        est bien permis, cad peut bien etre un fils de self, 
-        Retourne 0 sinon 
-    """
-    if type(fils) == bytes or type(fils) == str  :
-      # on veut juste savoir si self peut avoir un fils de nom 'fils'
-      if fils in self.definition.entites:
-        return 1
-      else :
-        return 0
-    #elif type(fils) == types.InstanceType:
-    elif isinstance(fils,object):
-      # fils est un objet (commande,mcf,mclist)
-      # on est dans le cas d'une tentative de copie de l'objet
-      # on veut savoir si l'objet peut bien etre un fils de self :
-      # la verification du nom de suffit pas (plusieurs commandes
-      # ont le meme mot-cle facteur AFFE ... et c'est l'utilisateur
-      # qui choisit le pere d'ou un risque d'erreur)
-      if not fils.nom in self.definition.entites:
-        return 0
-      else:
-        if fils.parent.nom != self.nom : return 0
-      return 1
-
-  def updateConcept(self,sd):
-    for child in self.mcListe :
-        child.updateConcept(sd)
-
-  def deleteConcept(self,sd):
-    """ 
-        Inputs :
-           - sd=concept detruit
-        Fonction :
-        Mettre a jour les fils de l objet suite a la disparition du
-        concept sd
-        Seuls les mots cles simples MCSIMP font un traitement autre que 
-        de transmettre aux fils
-    """
-    for child in self.mcListe :
-      child.deleteConcept(sd)
-
-  def replaceConcept(self,old_sd,sd):
-    """
-        Inputs :
-           - old_sd=concept remplace
-           - sd = nouveau concept
-        Fonction :
-        Mettre a jour les fils de l objet suite au remplacement  du
-        concept old_sd
-    """
-    for child in self.mcListe :
-      child.replaceConcept(old_sd,sd)
-
-  def getListeMcInconnus(self):
-     """
-     Retourne la liste des mots-cles inconnus dans self
-     """
-     l_mc = []
-     if self.reste_val != {}:
-        for k,v in self.reste_val.items() :
-            l_mc.append([self,k,v])
-     for child in self.mcListe :
-        if child.isValid() : continue
-        l_child = child.getListeMcInconnus()
-        for mc in l_child:
-           l = [self]
-           l.extend(mc)
-           l_mc.append(l)
-     return l_mc
-
-  def deepUpdateConditionBlocApresCreation(self):
-     # idem deepUpdateConditionBloc sauf qu on cherche les MC qui
-     # avait ete laisse de cote par la construction
-     #print ('Ihm deepUpdateConditionBloc', self.nom, self.reste_val)
-     if self.reste_val != {} : self.buildMcApresGlobal()
-     for mcobj in self.mcListe:
-        if mcobj.nature=="MCList" :
-           for obj in mcobj : obj.deepUpdateConditionBlocApresCreation() 
-        elif hasattr(mcobj,"deepUpdateConditionBlocApresCreation"):
-           mcobj.deepUpdateConditionBlocApresCreation()
-     
-
-  def deepUpdateConditionBloc(self):
-     """
-        Parcourt l'arborescence des mcobject et realise l'update 
-        des blocs conditionnels par appel de la methode updateConditionBloc
-     """
-     self._updateConditionBloc()
-     for mcobj in self.mcListe:
-        if hasattr(mcobj,"deepUpdateConditionBloc"):
-           mcobj.deepUpdateConditionBloc()
-
-  def updateConditionBloc(self):
-     """
-        Realise l'update des blocs conditionnels fils de self
-        et propage au parent
-     """
-     self._updateConditionBloc()
-     if self.parent:self.parent.updateConditionBloc()
-
-  def _updateConditionBloc(self):
-     """
-        Realise l'update des blocs conditionnels fils de self
-     """
-     dict = self.creeDictCondition(self.mcListe,condition=1)
-     #print ('_updateConditionBloc', dict)
-     for k,v in self.definition.entites.items():
-        if v.label != 'BLOC' :continue
-        globs= self.jdc and self.jdc.condition_context or {}
-        bloc=self.getChild(k,restreint = 'oui')
-        presence=v.verifPresence(dict,globs)
-        if presence and not bloc:
-           # le bloc doit etre present
-           # mais le bloc n'est pas present et il doit etre cree
-           #print "AJOUT BLOC",k
-           pos=self.getIndexChild(k)
-           self.addEntite(k,pos)
-        if not presence and bloc:
-           # le bloc devrait etre absent
-           # le bloc est present : il faut l'enlever
-           #print "SUPPRESSION BLOC",k,bloc
-           self.suppEntite(bloc)
-
-  def verifConditionBloc(self):
-    """ 
-        Evalue les conditions de tous les blocs fils possibles 
-        (en fonction du catalogue donc de la definition) de self
-        et retourne deux listes :
-          - la premiere contient les noms des blocs a rajouter
-          - la seconde contient les noms des blocs a supprimer
-    """
-    liste_ajouts = []
-    liste_retraits = []
-    dict = self.creeDictCondition(self.mcListe,condition=1)
-    for k,v in self.definition.entites.items():
-      if v.label=='BLOC' :
-        globs= self.jdc and self.jdc.condition_context or {}
-        if v.verifPresence(dict,globs):
-          # le bloc doit etre present
-          if not self.getChild(k,restreint = 'oui'):
-            # le bloc n'est pas present et il doit etre cree
-            liste_ajouts.append(k)
-        else :
-          # le bloc doit etre absent
-          if self.getChild(k,restreint = 'oui'):
-            # le bloc est present : il faut l'enlever
-            liste_retraits.append(k)
-    return liste_ajouts,liste_retraits
-
-  def verifExistenceSd(self):
-     """
-        Verifie que les structures de donnees utilisees dans self existent bien dans le contexte
-        avant etape, sinon enleve la reference a ces concepts
-     """
-     for motcle in self.mcListe :
-         motcle.verifExistenceSd()
-
-  def updateMcGlobal(self):
-     """
-        Met a jour les mots cles globaux enregistres dans l'etape parente 
-        et dans le jdc parent.
-        Un mot cle compose ne peut pas etre global. Il se contente de passer
-        la requete a ses fils.
-     """
-     for motcle in self.mcListe :
-         motcle.updateMcGlobal()
-
-  def deleteMcGlobal(self):
-     for motcle in self.mcListe :
-         motcle.deleteMcGlobal()
-     try :
-         motcle.updateMcGlobal()
-     except :
-         pass
-
-  def initModifUp(self):
-    Validation.V_MCCOMPO.MCCOMPO.initModifUp(self)
-    CONNECTOR.Emit(self,"valid")
+            return objet
+        else:
+            # Le mot cle existe deja. Si le mot cle est repetable,
+            # on cree une liste d'objets. Dans le cas contraire,
+            # on emet un message d'erreur.
+            if not old_obj.isRepetable():
+                self.jdc.editor.afficheAlerte(tr("Erreur"),tr("L'objet %s ne peut pas etre repete", objet.nom))
+                self.finModif()
+                return 0
+            else:
+                # une liste d'objets de meme type existe deja
+                old_obj.addEntite(objet)
+                if  self.cata.modeleMetier :
+                    if isinstance(objet,MCList): objet[0].addObjPyxb(self.chercheIndiceDsLeContenu(objet))
+                    else : objet.addObjPyxb(self.chercheIndiceDsLeContenu(objet))
+                self.finModif()
+                return old_obj
+
+    def ispermis(self,fils):
+        """
+            Retourne 1 si l'objet de nom nom_fils
+            est bien permis, cad peut bien etre un fils de self,
+            Retourne 0 sinon
+        """
+        if type(fils) == bytes or type(fils) == str  :
+        # on veut juste savoir si self peut avoir un fils de nom 'fils'
+            if fils in self.definition.entites:
+                return 1
+            else :
+                return 0
+        #elif type(fils) == types.InstanceType:
+        elif isinstance(fils,object):
+            # fils est un objet (commande,mcf,mclist)
+            # on est dans le cas d'une tentative de copie de l'objet
+            # on veut savoir si l'objet peut bien etre un fils de self :
+            # la verification du nom de suffit pas (plusieurs commandes
+            # ont le meme mot-cle facteur AFFE ... et c'est l'utilisateur
+            # qui choisit le pere d'ou un risque d'erreur)
+            if not fils.nom in self.definition.entites:
+                return 0
+            else:
+                if fils.parent.nom != self.nom : return 0
+            return 1
+
+    def updateConcept(self,sd):
+        for child in self.mcListe :
+            child.updateConcept(sd)
+
+    def deleteConcept(self,sd):
+        """
+            Inputs :
+               - sd=concept detruit
+            Fonction :
+            Mettre a jour les fils de l objet suite a la disparition du
+            concept sd
+            Seuls les mots cles simples MCSIMP font un traitement autre que
+            de transmettre aux fils
+        """
+        for child in self.mcListe :
+            child.deleteConcept(sd)
+
+    def replaceConcept(self,old_sd,sd):
+        """
+            Inputs :
+               - old_sd=concept remplace
+               - sd = nouveau concept
+            Fonction :
+            Mettre a jour les fils de l objet suite au remplacement  du
+            concept old_sd
+        """
+        for child in self.mcListe :
+            child.replaceConcept(old_sd,sd)
+
+    def getListeMcInconnus(self):
+        """
+        Retourne la liste des mots-cles inconnus dans self
+        """
+        l_mc = []
+        if self.reste_val != {}:
+            for k,v in self.reste_val.items() :
+                l_mc.append([self,k,v])
+        for child in self.mcListe :
+            if child.isValid() : continue
+            l_child = child.getListeMcInconnus()
+            for mc in l_child:
+                l = [self]
+                l.extend(mc)
+                l_mc.append(l)
+        return l_mc
+
+    def deepUpdateConditionBlocApresSuppression(self):
+        self._updateConditionBloc()
+        for mcobj in self.mcListe:
+            if mcobj.nature=="MCList" :
+                for obj in mcobj :
+                    obj.deepUpdateConditionBlocApresSuppression()
+                    obj.state='modified'
+            elif hasattr(mcobj,"deepUpdateConditionBlocApresSuppression"):
+                mcobj.deepUpdateConditionBlocApresSuppression()
+
+
+    def deepUpdateConditionBlocApresCreation(self):
+        # idem deepUpdateConditionBloc sauf qu on cherche les MC qui
+        # avait ete laisse de cote par la construction
+        # Comme on est en construction, on ne devrait pas avoir a detruire de bloc
+        # si on vient d un xml invalide, il faudra probablement traiter les blocs deja crees
+        # reste_val est au niveau du MCCompo, il faut donc tout parcourir
+        #print ('dans deepUpdateConditionBlocApresCreation pour', self.nom)
+        if self.reste_val != {} : self.buildMcApresGlobalEnCreation()
+        for mcobj in self.mcListe:
+            if mcobj.nature=="MCList" :
+                for obj in mcobj :
+                    obj.deepUpdateConditionBlocApresCreation()
+                    obj.state='modified'
+            elif hasattr(mcobj,"deepUpdateConditionBlocApresCreation"):
+                mcobj.deepUpdateConditionBlocApresCreation()
+            mcobj.state='modified'
+        self.state='modified'
+
+    def deepUpdateConditionBloc(self):
+        """
+           Parcourt l'arborescence des mcobject et realise l'update
+           des blocs conditionnels par appel de la methode updateConditionBloc
+        """
+        self._updateConditionBloc()
+        for mcobj in self.mcListe:
+            if hasattr(mcobj,"deepUpdateConditionBloc"):
+                mcobj.deepUpdateConditionBloc()
+            mcobj.state='modified'
+        if self.nature == 'PROCEDURE' :
+            if self.doitEtreRecalculee :
+                self.doitEtreRecalculee = False
+                self.deepUpdateConditionBloc()
+
+    def updateConditionBloc(self):
+        """
+           Realise l'update des blocs conditionnels fils de self
+           et propage au parent
+        """
+        self._updateConditionBloc()
+        if self.parent:self.parent.updateConditionBloc()
+
+    def _updateConditionBloc(self):
+        """
+           Realise l'update des blocs conditionnels fils de self
+        """
+        dict = self.creeDictCondition(self.mcListe,condition=1)
+        doitEtreReecrit=False
+        for k,v in self.definition.entites.items():
+            if v.label != 'BLOC' :continue
+            globs= self.jdc and self.jdc.condition_context or {}
+            bloc=self.getChild(k,restreint = 'oui')
+            presence=v.verifPresence(dict,globs)
+            if presence and not bloc:
+                # le bloc doit etre present
+                # mais le bloc n'est pas present et il doit etre cree
+                pos=self.getIndexChild(k)
+                self.addEntite(k,pos)
+                #print ("AJOUT",k,pos)
+            if not presence and bloc:
+                # le bloc devrait etre absent
+                # le bloc est present : il faut l'enlever
+                #print ("SUPPRESSION BLOC",k,bloc)
+                self.suppEntite(bloc)
+                doitEtreReecrit=True
+
+    def verifConditionBloc(self):
+        """
+        2021 : obsolete ?
+            Evalue les conditions de tous les blocs fils possibles
+            (en fonction du catalogue donc de la definition) de self
+            et retourne deux listes :
+              - la premiere contient les noms des blocs a rajouter
+              - la seconde contient les noms des blocs a supprimer
+        """
+        liste_ajouts = []
+        liste_retraits = []
+        dict = self.creeDictCondition(self.mcListe,condition=1)
+        for k,v in self.definition.entites.items():
+            if v.label=='BLOC' :
+                globs= self.jdc and self.jdc.condition_context or {}
+                if v.verifPresence(dict,globs):
+            # le bloc doit etre present
+                    if not self.getChild(k,restreint = 'oui'):
+                # le bloc n'est pas present et il doit etre cree
+                        liste_ajouts.append(k)
+                else :
+                    # le bloc doit etre absent
+                    if self.getChild(k,restreint = 'oui'):
+                        # le bloc est present : il faut l'enlever
+                        liste_retraits.append(k)
+        return liste_ajouts,liste_retraits
+
+    def verifExistenceSd(self):
+        """
+           Verifie que les structures de donnees utilisees dans self existent bien dans le contexte
+           avant etape, sinon enleve la reference a ces concepts
+        """
+        for motcle in self.mcListe :
+            motcle.verifExistenceSd()
+
+    def updateMcGlobal(self):
+        """
+           Met a jour les mots cles globaux enregistres dans l'etape parente
+           et dans le jdc parent.
+           Un mot cle compose ne peut pas etre global. Il se contente de passer
+           la requete a ses fils.
+        """
+        for motcle in self.mcListe :
+            motcle.updateMcGlobal()
+
+    def deleteMcGlobal(self):
+        for motcle in self.mcListe :
+            motcle.deleteMcGlobal()
+        # PN : je ne comprends pas les 4 lignes suivantes
+        # du coup je les vire
+        # surtout en dehors dans le for ?
+        # 20201217
+        #try :
+        #    print (motcle)
+        #    motcle.updateMcGlobal()
+        #except :
+        #    pass
 
+    def supprimeUserAssd(self):
+        for objUserAssd in self.userASSDCrees:
+            objUserAssd.supprime(self)
 
+    def initModifUp(self):
+        Validation.V_MCCOMPO.MCCOMPO.initModifUp(self)
+        CONNECTOR.Emit(self,"valid")
index 13d272e1420360df5eb2c90626962a0ba1d1223b..b42c028c8a0156139e278dfacc5bb8436df7d71d 100644 (file)
@@ -24,107 +24,107 @@ from . import I_MCCOMPO
 import Noyau
 
 class MCFACT(I_MCCOMPO.MCCOMPO):
-  def isRepetable(self):
-     """ 
-         Indique si l'objet est repetable.
-         Retourne 1 si le mot-cle facteur self peut etre repete
-         Retourne 0 dans le cas contraire
-     """
-     if self.definition.max > 1:
-       # marche avec '**'
-       return 1
-     else :
-       return 0
+    def isRepetable(self):
+        """
+            Indique si l'objet est repetable.
+            Retourne 1 si le mot-cle facteur self peut etre repete
+            Retourne 0 dans le cas contraire
+        """
+        if self.definition.max > 1:
+            # marche avec '**'
+            return 1
+        else :
+            return 0
 
-  def isOblig(self):
-    if self.definition.statut != 'o' : return 0
-    objet = self.parent.getChild(self.nom)
-    if len(objet) > 1 : return 0
-    else : return 1
+    def isOblig(self):
+        if self.definition.statut != 'o' : return 0
+        objet = self.parent.getChild(self.nom)
+        if len(objet) > 1 : return 0
+        else : return 1
 
-  def getMinMax(self):
-     """
-     Retourne les valeurs min et max admissibles pour la valeur de self
-     """
-     return self.definition.min,self.definition.max
+    def getMinMax(self):
+        """
+        Retourne les valeurs min et max admissibles pour la valeur de self
+        """
+        return self.definition.min,self.definition.max
 
-  def getNomDsXML(self):
-     # en xml on a une sequence si max est superieur a 1
-     # sinon non
-     objet = self.parent.getChild(self.nom, restreint='oui')
-     if len(objet) > 1 :
-        index = objet.getIndex(self) 
-        nom = self.nom + "[" + str(index) + "]"
-     else :
-        if self.definition.max == 1 : nom = self.nom
-        else :  nom = self.nom+"[0]"
-     nomDsXML=self.parent.getNomDsXML()+"."+nom
-     return nomDsXML
+    def getNomDsXML(self):
+        # en xml on a une sequence si max est superieur a 1
+        # sinon non
+        objet = self.parent.getChild(self.nom, restreint='oui')
+        if len(objet) > 1 :
+            index = objet.getIndex(self)
+            nom = self.nom + "[" + str(index) + "]"
+        else :
+            if self.definition.max == 1 : nom = self.nom
+            else :  nom = self.nom+"[0]"
+        nomDsXML=self.parent.getNomDsXML()+"."+nom
+        return nomDsXML
 
 
-  def getLabelText(self):
-    """
-       Retourne le label de self suivant qu'il s'agit d'un MCFACT
-       isole ou d'un MCFACT appartenant a une MCList :
-       utilisee pour l'affichage dans l'arbre
-    """
-    objet = self.parent.getChild(self.nom, restreint='oui')
-    # objet peut-etre self ou une MCList qui contient self ...
-    if objet is None or objet is self:
-     return tr("Erreur - mclist inexistante : %s", self.nom)
+    def getLabelText(self):
+        """
+           Retourne le label de self suivant qu'il s'agit d'un MCFACT
+           isole ou d'un MCFACT appartenant a une MCList :
+           utilisee pour l'affichage dans l'arbre
+        """
+        objet = self.parent.getChild(self.nom, restreint='oui')
+        # objet peut-etre self ou une MCList qui contient self ...
+        if objet is None or objet is self:
+            return tr("Erreur - mclist inexistante : %s", self.nom)
 
-    try:
-      if len(objet) > 1 :
-        index = objet.getIndex(self)+1 # + 1 a cause de la numerotation qui commence a 0
-        return tr(self.nom) +'_'+repr(index)+':'
-      else:
-        return tr(self.nom)
-    except:
-      return tr("Erreur - mot cle facteur de nom : %s", self.nom)
+        try:
+            if len(objet) > 1 :
+                index = objet.getIndex(self)+1 # + 1 a cause de la numerotation qui commence a 0
+                return tr(self.nom) +'_'+repr(index)+':'
+            else:
+                return tr(self.nom)
+        except:
+            return tr("Erreur - mot cle facteur de nom : %s", self.nom)
 
-  def getGenealogiePrecise(self):
-    nom=self.getLabelText() 
-    if nom[-1]==':' : nom=nom[0:-1]
-    if self.parent:
-       l=self.parent.getGenealogiePrecise()
-       l.append(nom.strip())
-       return l
-    else:
-       return [nom.strip()]
+    def getGenealogiePrecise(self):
+        nom=self.getLabelText()
+        if nom[-1]==':' : nom=nom[0:-1]
+        if self.parent:
+            l=self.parent.getGenealogiePrecise()
+            l.append(nom.strip())
+            return l
+        else:
+            return [nom.strip()]
 
 
-  def initModif(self):
-    """
-       Met l'etat de l'objet a modified et propage au parent
-       qui vaut None s'il n'existe pas
-    """
-    self.state = 'modified'
-    parent= hasattr(self,"alt_parent") and self.alt_parent or self.parent
-    if parent:
-       parent.initModif()
+    def initModif(self):
+        """
+           Met l'etat de l'objet a modified et propage au parent
+           qui vaut None s'il n'existe pas
+        """
+        self.state = 'modified'
+        parent= hasattr(self,"alt_parent") and self.alt_parent or self.parent
+        if parent:
+            parent.initModif()
 
-  def finModif(self):
-    """
-      Methode appelee apres qu'une modification a ete faite afin de declencher
-      d'eventuels traitements post-modification
-    """
-    #print "finModif",self
-    # pour les objets autres que les commandes, aucun traitement specifique
-    # on remonte l'info de fin de modif au parent
-    CONNECTOR.Emit(self,"valid")
-    parent= hasattr(self,"alt_parent") and self.alt_parent or self.parent
-    if parent:
-       parent.finModif()
+    def finModif(self):
+        """
+          Methode appelee apres qu'une modification a ete faite afin de declencher
+          d'eventuels traitements post-modification
+        """
+        #print "finModif",self
+        # pour les objets autres que les commandes, aucun traitement specifique
+        # on remonte l'info de fin de modif au parent
+        CONNECTOR.Emit(self,"valid")
+        parent= hasattr(self,"alt_parent") and self.alt_parent or self.parent
+        if parent:
+            parent.finModif()
 
-  def normalize(self):
-    """ Retourne le MCFACT normalise. Pour un MCFACT isole, l'objet normalise
-        est une MCLIST de longueur 1 qui contient ce MCFACT
-    """
-    new_obj = self.definition.list_instance()
-    new_obj.init(nom=self.nom,parent=None)
-    new_obj.append(self)
-    return new_obj
+    def normalize(self):
+        """ Retourne le MCFACT normalise. Pour un MCFACT isole, l'objet normalise
+            est une MCLIST de longueur 1 qui contient ce MCFACT
+        """
+        new_obj = self.definition.list_instance()
+        new_obj.init(nom=self.nom,parent=None)
+        new_obj.append(self)
+        return new_obj
 
-  def supprime(self):
-    self.alt_parent=None
-    Noyau.N_MCFACT.MCFACT.supprime(self)
+    def supprime(self):
+        self.alt_parent=None
+        Noyau.N_MCFACT.MCFACT.supprime(self)
index 5db4b341774ad7fcc3fa94adec5f81f6f91a05b2..e52a5b5cf27b81794f18f4fa9671c097c95649b6 100644 (file)
@@ -25,268 +25,272 @@ from copy import copy
 from . import CONNECTOR
 
 class MCList:
-  def isMCList(self):
-    """ 
-       Retourne 1 si self est une MCList (liste de mots-cles), 0 sinon (defaut) 
-    """
-    return 1
-
-  def getIndex(self,objet):
-    """
-        Retourne la position d'objet dans la liste self
-    """
-    return self.data.index(objet)
-
-  def ajoutPossible(self):
-    """ 
-        Methode booleenne qui retourne 1 si on peut encore ajouter une occurrence
-        de l'element que contient self, 0 sinon 
-    """
-    max = self.data[0].definition.max
-    if max == '**' or max == float('inf'):
-      return 1
-    else:
-      if len(self) < max :
+    def isMCList(self):
+        """
+           Retourne 1 si self est une MCList (liste de mots-cles), 0 sinon (defaut)
+        """
         return 1
-      else:
-        return 0
-
-  def isRepetable(self):
-    """
-       Indique si l'objet est repetable.
-       Retourne 1 si le mot-cle facteur self peut etre repete
-       Retourne 0 dans le cas contraire
-    """
-    if self.data[0].definition.max > 1:
-       # marche avec '**'
-       return 1
-    else :
-       return 0
-
-  def isOblig(self):
-     """
-     Une MCList n'est jamais obligatoire (meme si le MCFACT qu'elle represente l'est
-     """
-     return self.data[0].definition.statut=='o'
-  
-  def suppEntite(self,obj):
-      """
-        Supprime le mot cle facteur obj de la MCLIST
-      """
-      if obj not in self:
-         return 0
-
-      self.initModif()
-      self.remove(obj)
-      CONNECTOR.Emit(self,"supp",obj)
-      self.updateConditionBloc()
-      obj.delObjPyxb()
-      obj.supprime()
-      self.etape.modified()
-      self.finModif()
-      return 1
-
-  def addEntite(self,obj,pos=None):
-      """
-        Ajoute le mot cle facteur obj a la MCLIST a la position pos
-        Retourne None si l'ajout est impossible
-      """
-      if type(obj)==bytes or type(obj) == str  :
-         # on est en mode creation d'un motcle
-                  raise EficasException(tr("traitement non-prevu"))
-
-      if not self.ajoutPossible():
-         self.jdc.editor.afficheAlerte(tr("Erreur"),
-                                       tr("L'objet %s ne peut pas etre ajoute", obj.nom))
-         return None
-
-      if self.nom != obj.nom:
-         return None
-
-      if obj.isMCList():
-         obj=obj.data[0]
-
-      # traitement du copier coller seulement 
-      # Les autres cas d'ajout sont traites dans MCFACT
-      self.initModif()
-      obj.verifExistenceSd()
-      obj.reparent(self.parent)
-      if pos is None:
-         self.append(obj)
-      else:
-         self.insert(pos,obj)
-      CONNECTOR.Emit(self,"add",obj)
-      self.finModif()
-      self.updateConditionBloc()
-      return obj
-
-  def listeMcPresents(self):
-    return []
-
-  def updateConcept(self,sd):
-    for child in self.data :
-        child.updateConcept(sd)
-
-  def deleteConcept(self,sd):
-    """ 
-        Inputs :
-           - sd=concept detruit
-        Fonction : Mettre a jour les fils de l objet suite a la disparition 
-        du concept sd
-        Seuls les mots cles simples MCSIMP font un traitement autre 
-        que de transmettre aux fils
-    """
-    for child in self.data :
-      child.deleteConcept(sd)
-
-  def replaceConcept(self,old_sd,sd):
-    """
-        Inputs :
-           - old_sd=concept remplace
-           - sd=nouveau concept
-        Fonction : Mettre a jour les fils de l objet suite au remplacement 
-        du concept old_sd
-    """
-    for child in self.data :
-      child.replaceConcept(old_sd,sd)
-
-  def getDocu(self):
-    return self.data[0].definition.getDocu()
-
-  def getListeMcInconnus(self):
-     """
-     Retourne la liste des mots-cles inconnus dans self
-     """
-     l_mc = []
-     for mcfact in self.data :
-        if mcfact.isValid() : continue
-        l_child = mcfact.getListeMcInconnus()
-        for mc in l_child:
-           l = [self]
-           l.extend(mc)
-           l_mc.append(l)
-     return l_mc
-
-  def verifConditionRegles(self,liste_presents):
-    """
-        Retourne la liste des mots-cles a rajouter pour satisfaire les regles
-        en fonction de la liste des mots-cles presents
-    """
-    # Sans objet pour une liste de mots cles facteurs
-    return []
-
-  def deepUpdateConditionBloc(self):
-     """
-        Parcourt l'arborescence des mcobject et realise l'update
-        des blocs conditionnels par appel de la methode updateConditionBloc
-     """
-     #print "deepUpdateConditionBloc",self
-     for mcfact in self.data :
-         mcfact.deepUpdateConditionBloc()
-
-  def updateConditionBloc(self):
-     """
-        Propage la mise a jour des conditions au parent.
-        Une liste ne fait pas de traitement sur les conditions
-     """
-     if self.parent: self.parent.updateConditionBloc()
-
-  def verifConditionBloc(self):
-    """ 
-        Evalue les conditions de tous les blocs fils possibles 
-        (en fonction du catalogue donc de la definition) de self et 
-        retourne deux listes :
-           - la premiere contient les noms des blocs a rajouter
-           - la seconde contient les noms des blocs a supprimer
-    """
-    # Sans objet pour une liste de mots cles facteurs (a voir !!!)
-    return [],[]
-
-  def initModif(self):
-    """
-       Met l'etat de l'objet a modified et propage au parent
-       qui vaut None s'il n'existe pas
-    """
-    self.state = 'modified'
-    if self.parent:
-      self.parent.initModif()
-
-  def finModif(self):
-    """
-      Methode appelee apres qu'une modification a ete faite afin de declencher
-      d'eventuels traitements post-modification
-    """
-    #print "finModif",self
-    CONNECTOR.Emit(self,"valid")
-    if self.parent:
-      self.parent.finModif()
-
-  def getGenealogiePrecise(self):
-     if self.parent: 
-        return self.parent.getGenealogiePrecise()
-     else:
+
+    def getIndex(self,objet):
+        """
+            Retourne la position d'objet dans la liste self
+        """
+        return self.data.index(objet)
+
+    def ajoutPossible(self):
+        """
+            Methode booleenne qui retourne 1 si on peut encore ajouter une occurrence
+            de l'element que contient self, 0 sinon
+        """
+        max = self.data[0].definition.max
+        if max == '**' or max == float('inf'):
+            return 1
+        else:
+            if len(self) < max :
+                return 1
+            else:
+                return 0
+
+    def isRepetable(self):
+        """
+           Indique si l'objet est repetable.
+           Retourne 1 si le mot-cle facteur self peut etre repete
+           Retourne 0 dans le cas contraire
+        """
+        if self.data[0].definition.max > 1:
+            # marche avec '**'
+            return 1
+        else :
+            return 0
+
+    def isOblig(self):
+        """
+        Une MCList n'est jamais obligatoire (meme si le MCFACT qu'elle represente l'est
+        """
+        return self.data[0].definition.statut=='o'
+
+    def suppEntite(self,obj):
+        """
+          Supprime le mot cle facteur obj de la MCLIST
+        """
+        if obj not in self:
+            return 0
+
+        self.initModif()
+        self.remove(obj)
+        CONNECTOR.Emit(self,"supp",obj)
+        self.updateConditionBloc()
+        obj.delObjPyxb()
+        obj.supprime()
+        self.etape.modified()
+        self.finModif()
+        return 1
+
+    def addEntite(self,obj,pos=None):
+        """
+          Ajoute le mot cle facteur obj a la MCLIST a la position pos
+          Retourne None si l'ajout est impossible
+        """
+        if type(obj)==bytes or type(obj) == str  :
+            # on est en mode creation d'un motcle
+            raise EficasException(tr("traitement non-prevu"))
+
+        if not self.ajoutPossible():
+            self.jdc.editor.afficheAlerte(tr("Erreur"),
+                                          tr("L'objet %s ne peut pas etre ajoute", obj.nom))
+            return None
+
+        if self.nom != obj.nom:
+            return None
+
+        if obj.isMCList():
+            obj=obj.data[0]
+
+        # traitement du copier coller seulement
+        # Les autres cas d'ajout sont traites dans MCFACT
+        self.initModif()
+        obj.verifExistenceSd()
+        obj.reparent(self.parent)
+        if pos is None:
+            self.append(obj)
+        else:
+            self.insert(pos,obj)
+        CONNECTOR.Emit(self,"add",obj)
+        self.finModif()
+        self.updateConditionBloc()
+        return obj
+
+    def listeMcPresents(self):
         return []
 
-  def getGenealogie(self):
-     """
-         Retourne la liste des noms des ascendants.
-         Un objet MCList n'est pas enregistre dans la genealogie.
-         XXX Meme si le MCFACT fils ne l'est pas lui non plus ????
-     """
-     if self.parent: 
-        return self.parent.getGenealogie()
-     else:
+    def updateConcept(self,sd):
+        for child in self.data :
+            child.updateConcept(sd)
+
+    def deleteRef(self):
+        for child in self.data :
+            child.deleteRef()
+
+    def deleteConcept(self,sd):
+        """
+            Inputs :
+               - sd=concept detruit
+            Fonction : Mettre a jour les fils de l objet suite a la disparition
+            du concept sd
+            Seuls les mots cles simples MCSIMP font un traitement autre
+            que de transmettre aux fils
+        """
+        for child in self.data :
+            child.deleteConcept(sd)
+
+    def replaceConcept(self,old_sd,sd):
+        """
+            Inputs :
+               - old_sd=concept remplace
+               - sd=nouveau concept
+            Fonction : Mettre a jour les fils de l objet suite au remplacement
+            du concept old_sd
+        """
+        for child in self.data :
+            child.replaceConcept(old_sd,sd)
+
+    def getDocu(self):
+        return self.data[0].definition.getDocu()
+
+    def getListeMcInconnus(self):
+        """
+        Retourne la liste des mots-cles inconnus dans self
+        """
+        l_mc = []
+        for mcfact in self.data :
+            if mcfact.isValid() : continue
+            l_child = mcfact.getListeMcInconnus()
+            for mc in l_child:
+                l = [self]
+                l.extend(mc)
+                l_mc.append(l)
+        return l_mc
+
+    def verifConditionRegles(self,liste_presents):
+        """
+            Retourne la liste des mots-cles a rajouter pour satisfaire les regles
+            en fonction de la liste des mots-cles presents
+        """
+        # Sans objet pour une liste de mots cles facteurs
         return []
 
-  def getListeMcOrdonneeBrute(self,liste,dico):
-     """
-         Retourne la liste ordonnee (suivant le catalogue) BRUTE des mots-cles
-         d'une entite composee dont le chemin complet est donne sous forme
-         d'une liste du type :ETAPE + MCFACT ou MCBLOC + ...
-     """
-     for arg in liste:
-        objet_cata = dico[arg]
-        dico=objet_cata.entites
-     return objet_cata.ordre_mc
-
-  def verifExistenceSd(self):
-     """
-        Verifie que les structures de donnees utilisees dans self existent bien dans le contexte
-        avant etape, sinon enleve la reference a ces concepts
-     """
-     for motcle in self.data :
-         motcle.verifExistenceSd()
-
-  def getFr(self):
-     """
-         Retourne la chaine d'aide contenue dans le catalogue
-         en tenant compte de la langue
-     """
-     try :
-        return self.data[0].getFr()
-     except:
-        return ''
-
-  def normalize(self):
-     """
-        Retourne l'objet normalise. Une liste est deja normalisee
-     """
-     return self
-
-  def updateMcGlobal(self):
-     """
-        Met a jour les mots cles globaux enregistres dans l'etape parente
-        et dans le jdc parent.
-        Une liste ne peut pas etre globale. Elle se contente de passer
-        la requete a ses fils.
-     """
-     for motcle in self.data :
-         motcle.updateMcGlobal()
-
-  def deleteMcGlobal(self):
-     for motcle in self.data :
-         motcle.deleteMcGlobal()
-
-
-  #def __del__(self):
-  #   print "__del__",self
+    def deepUpdateConditionBloc(self):
+        """
+           Parcourt l'arborescence des mcobject et realise l'update
+           des blocs conditionnels par appel de la methode updateConditionBloc
+        """
+        #print "deepUpdateConditionBloc",self
+        for mcfact in self.data :
+            mcfact.deepUpdateConditionBloc()
+
+    def updateConditionBloc(self):
+        """
+           Propage la mise a jour des conditions au parent.
+           Une liste ne fait pas de traitement sur les conditions
+        """
+        if self.parent: self.parent.updateConditionBloc()
+
+    def verifConditionBloc(self):
+        """
+            Evalue les conditions de tous les blocs fils possibles
+            (en fonction du catalogue donc de la definition) de self et
+            retourne deux listes :
+               - la premiere contient les noms des blocs a rajouter
+               - la seconde contient les noms des blocs a supprimer
+        """
+        # Sans objet pour une liste de mots cles facteurs (a voir !!!)
+        return [],[]
+
+    def initModif(self):
+        """
+           Met l'etat de l'objet a modified et propage au parent
+           qui vaut None s'il n'existe pas
+        """
+        self.state = 'modified'
+        if self.parent:
+            self.parent.initModif()
+
+    def finModif(self):
+        """
+          Methode appelee apres qu'une modification a ete faite afin de declencher
+          d'eventuels traitements post-modification
+        """
+        #print "finModif",self
+        CONNECTOR.Emit(self,"valid")
+        if self.parent:
+            self.parent.finModif()
+
+    def getGenealogiePrecise(self):
+        if self.parent:
+            return self.parent.getGenealogiePrecise()
+        else:
+            return []
+
+    def getGenealogie(self):
+        """
+            Retourne la liste des noms des ascendants.
+            Un objet MCList n'est pas enregistre dans la genealogie.
+            XXX Meme si le MCFACT fils ne l'est pas lui non plus ????
+        """
+        if self.parent:
+            return self.parent.getGenealogie()
+        else:
+            return []
+
+    def getListeMcOrdonneeBrute(self,liste,dico):
+        """
+            Retourne la liste ordonnee (suivant le catalogue) BRUTE des mots-cles
+            d'une entite composee dont le chemin complet est donne sous forme
+            d'une liste du type :ETAPE + MCFACT ou MCBLOC + ...
+        """
+        for arg in liste:
+            objet_cata = dico[arg]
+            dico=objet_cata.entites
+        return objet_cata.ordre_mc
+
+    def verifExistenceSd(self):
+        """
+           Verifie que les structures de donnees utilisees dans self existent bien dans le contexte
+           avant etape, sinon enleve la reference a ces concepts
+        """
+        for motcle in self.data :
+            motcle.verifExistenceSd()
+
+    def getFr(self):
+        """
+            Retourne la chaine d'aide contenue dans le catalogue
+            en tenant compte de la langue
+        """
+        try :
+            return self.data[0].getFr()
+        except:
+            return ''
+
+    def normalize(self):
+        """
+           Retourne l'objet normalise. Une liste est deja normalisee
+        """
+        return self
+
+    def updateMcGlobal(self):
+        """
+           Met a jour les mots cles globaux enregistres dans l'etape parente
+           et dans le jdc parent.
+           Une liste ne peut pas etre globale. Elle se contente de passer
+           la requete a ses fils.
+        """
+        for motcle in self.data :
+            motcle.updateMcGlobal()
+
+    def deleteMcGlobal(self):
+        for motcle in self.data :
+            motcle.deleteMcGlobal()
+
+
+    #def __del__(self):
+    #   print "__del__",self
index 6eca2a1383bceb8f5f18b5422edc3097371fb17a..159c8f67f3042421fc28d3dd4886b4d9890d9ab1 100644 (file)
@@ -41,6 +41,7 @@ from Noyau.N_ASSD import ASSD,assd
 from Noyau.N_GEOM import GEOM,geom
 from Noyau.N_CO import CO
 from Accas.A_ASSD import UserASSD
+from Accas.A_ASSD import UserASSDMultiple
 import Accas
 # fin attention
 
@@ -53,720 +54,832 @@ from .I_VALIDATOR import ValError,listProto
 class MCSIMP(I_OBJECT.OBJECT):
 
 
-  def isValid(self,cr='non'):
-      if self.state == 'unchanged':
-        return self.valid
-      for type_permis in self.definition.type:
-          if hasattr(type_permis, "__class__") and type_permis.__class__.__name__ == 'Matrice':
-             self.monType=type_permis
-             return self.valideMatrice(cr=cr)
-      validite=Validation.V_MCSIMP.MCSIMP.isValid(self,cr=cr)
+    def isValid(self,cr='non'):
+        if self.state == 'unchanged':
+            return self.valid
+        for type_permis in self.definition.type:
+            #if hasattr(type_permis, "__class__") and type_permis.__class__.__name__ == 'Matrice':
+            if hasattr(type_permis, "typElt") :
+                self.monType=type_permis
+                return self.valideMatrice(cr=cr)
+        validite=Validation.V_MCSIMP.MCSIMP.isValid(self,cr=cr)
 
-      if self.definition.siValide != None and validite:
+        if self.definition.siValide != None and validite:
             self.definition.siValide(self)
-      return validite 
+        return validite
 
 
-  def getNomConcept(self):
-      p=self
-      while p.parent :
-         try :
-            nomconcept=p.getSdname()
-            return nomconcept
-         except:
+    def getNomConcept(self):
+        p=self
+        while p.parent :
             try :
-               nomconcept= p.object.getSdname()
-               return nomconcept
-            except :
-               pass
-         p=p.parent
-      return ""
-
-  def getText(self):
-    """
-        Retourne le texte a afficher dans l'arbre representant la valeur de l'objet
-        pointe par self
-    """
-
-    if self.valeur == None : 
-      return None
-    elif type(self.valeur) == float : 
-      # traitement d'un flottant isole
-      txt = str(self.valeur)
-      clefobj=self.getNomConcept()
-      if clefobj in self.jdc.appliEficas.dict_reels :
-        if self.valeur in self.jdc.appliEficas.dict_reels[clefobj]:
-           txt=self.jdc.appliEficas.dict_reels[clefobj][self.valeur]
-    elif type(self.valeur) in (list,tuple) :
-      if self.valeur==[] or self.valeur == (): return str(self.valeur)
-      # traitement des listes
-      txt='('
-      sep=''
-      for val in self.valeur:
-        if type(val) == float : 
-           clefobj=self.getNomConcept()
-           if clefobj in self.jdc.appliEficas.dict_reels:
-              if val in self.jdc.appliEficas.dict_reels[clefobj]:
-                 txt=txt + sep +self.jdc.appliEficas.dict_reels[clefobj][val]
-              else :
-                 txt=txt + sep + str(val)
-           else :
-              txt=txt + sep + str(val)
-        else: 
-           if isinstance(val,tuple):
-              texteVal='('
-              for i in val :
-                  if isinstance(i, bytes) or isinstance(i,str) : texteVal = texteVal +"'"+str(i)+"'," 
-                  else : texteVal = texteVal + str(i)+','
-              texteVal=texteVal[:-1]+')'
-           else : 
-              if isinstance(val,bytes) or isinstance(val, str): texteVal="'"+str(val)+"'"
-              else :texteVal=str(val)
-           txt = txt + sep+ texteVal 
+                nomconcept=p.getSdname()
+                return nomconcept
+            except:
+                try :
+                    nomconcept= p.object.getSdname()
+                    return nomconcept
+                except :
+                    pass
+            p=p.parent
+        return ""
+
+    def getText(self):
+        """
+            Retourne le texte a afficher dans l'arbre representant la valeur de l'objet
+            pointe par self
+        """
+
+        if self.valeur == None :
+            return None
+        elif type(self.valeur) == float :
+            # traitement d'un flottant isole
+            txt = str(self.valeur)
+            clefobj=self.getNomConcept()
+            if clefobj in self.jdc.appliEficas.dict_reels :
+                if self.valeur in self.jdc.appliEficas.dict_reels[clefobj]:
+                    txt=self.jdc.appliEficas.dict_reels[clefobj][self.valeur]
+        elif type(self.valeur) in (list,tuple) :
+            if self.valeur==[] or self.valeur == (): return str(self.valeur)
+            # traitement des listes
+            txt='('
+            sep=''
+            for val in self.valeur:
+                if type(val) == float :
+                    clefobj=self.getNomConcept()
+                    if clefobj in self.jdc.appliEficas.dict_reels:
+                        if val in self.jdc.appliEficas.dict_reels[clefobj]:
+                            txt=txt + sep +self.jdc.appliEficas.dict_reels[clefobj][val]
+                        else :
+                            txt=txt + sep + str(val)
+                    else :
+                        txt=txt + sep + str(val)
+                else:
+                    if isinstance(val,tuple):
+                        texteVal='('
+                        for i in val :
+                            if isinstance(i, bytes) or isinstance(i,str) : texteVal = texteVal +"'"+str(i)+"',"
+                            else : texteVal = texteVal + str(i)+','
+                        texteVal=texteVal[:-1]+')'
+                    else :
+                        if isinstance(val,bytes) or isinstance(val,str): texteVal="'"+str(val)+"'"
+                        else :texteVal=str(val)
+                    txt = txt + sep+ texteVal
 
 ##        if len(txt) > 200:
 ##            #ligne trop longue, on tronque
 ##            txt=txt+" ..."
 ##            break
-        sep=','
-      # cas des listes de tuples de longueur 1
-      if isinstance(val,tuple) and len(self.valeur) == 1 : txt=txt+','
-      txt=txt+')'
-    else:
-      # traitement des autres cas
-      txt = str(self.valeur)
-
-    # txt peut etre une longue chaine sur plusieurs lignes.
-    # Il est possible de tronquer cette chaine au premier \n et 
-    # de limiter la longueur de la chaine a 30 caracteres. Cependant
-    # ceci provoque une perte d'information pour l'utilisateur
-    # Pour le moment on retourne la chaine telle que
-    return txt
-
-  def getVal(self):
-    """ 
-       Retourne une chaine de caractere representant la valeur de self 
-    """
-    val=self.valeur
-    if type(val) == float : 
-      clefobj=self.getNomConcept()
-      if clefobj in self.jdc.appliEficas.dict_reels :
-        if val in self.jdc.appliEficas.appliEficas.dict_reels[clefobj] :
-           return self.jdc.appliEficas.dict_reels[clefobj][val]
-    if type(val) != tuple :
-      try:
-        return val.getName()
-      except:
-        return val
-    else :
-      if val ==() or val == [] : return val
-      s='( '
-      for item in val :
-        try :
-          s=s+item.getName()+','
-        except:
-          s=s+repr(item)+','
-      s=s+' )'
-      return s
-
-  def waitBool(self):
-      for typ in self.definition.type:
+                sep=','
+            # cas des listes de tuples de longueur 1
+            if isinstance(val,tuple) and len(self.valeur) == 1 : txt=txt+','
+            txt=txt+')'
+        else:
+            # traitement des autres cas
+            txt = str(self.valeur)
+
+        # txt peut etre une longue chaine sur plusieurs lignes.
+        # Il est possible de tronquer cette chaine au premier \n et
+        # de limiter la longueur de la chaine a 30 caracteres. Cependant
+        # ceci provoque une perte d'information pour l'utilisateur
+        # Pour le moment on retourne la chaine telle que
+        return txt
+
+    def getVal(self):
+        """
+           Retourne une chaine de caractere representant la valeur de self
+        """
+        val=self.valeur
+        if type(val) == float :
+            clefobj=self.getNomConcept()
+            if clefobj in self.jdc.appliEficas.dict_reels :
+                if val in self.jdc.appliEficas.appliEficas.dict_reels[clefobj] :
+                    return self.jdc.appliEficas.dict_reels[clefobj][val]
+        if type(val) != tuple :
+            try:
+                return val.getName()
+            except:
+                return val
+        else :
+            if val ==() or val == [] : return val
+            s='( '
+            for item in val :
+                try :
+                    s=s+item.getName()+','
+                except:
+                    s=s+repr(item)+','
+            s=s+' )'
+            return s
+
+    def waitBool(self):
+        for typ in self.definition.type:
+            try :
+                if typ == bool: return True
+            except :
+                pass
+        return False
+
+    def waitCo(self):
+        """
+            Methode booleenne qui retourne 1 si l'objet attend un objet ASSD
+            qui n'existe pas encore (type CO()), 0 sinon
+        """
+        for typ in self.definition.type:
+            if type(typ) == type or isinstance(typ,type):
+                if issubclass(typ,CO) :
+                    return 1
+        return 0
+
+    def waitAssd(self):
+        """
+            Methode booleenne qui retourne 1 si le MCS attend un objet de type ASSD ou UserASSD
+            ou derive, 0 sinon
+        """
+        for typ in self.definition.type:
+            if type(typ) == type or isinstance(typ,type):
+                if issubclass(typ,ASSD) and not issubclass(typ,GEOM) :
+                    return 1
+        return 0
+
+    def waitUserAssd(self):
+        """
+            Methode booleenne qui retourne 1 si le MCS attend un objet de type ASSD
+            ou derive, 0 sinon
+        """
+        for typ in self.definition.type:
+            if type(typ) == type or isinstance(typ,type):
+                if issubclass(typ,UserASSD) :
+                    return 1
+        return 0
+
+    def waitUserAssdMultiple(self):
+        for typ in self.definition.type:
+            if type(typ) == type or isinstance(typ,type):
+                if issubclass(typ,UserASSDMultiple) :
+                    return 1
+        return 0
+
+    def waitUserAssdOrAssdMultipleEnCreation(self):
+        for typ in self.definition.type:
+            if typ == 'createObject' :
+                return 1
+        return 0
+
+
+    def waitAssdOrGeom(self):
+        """
+             Retourne 1 si le mot-cle simple attend un objet de type
+             assd, ASSD, geom ou GEOM
+             Retourne 0 dans le cas contraire
+        """
+        for typ in self.definition.type:
+            if type(typ) == type or isinstance(typ,type):
+                if typ.__name__ in ("GEOM","ASSD","geom","assd") or issubclass(typ,GEOM) :
+                    return 1
+        return 0
+
+    def waitGeom(self):
+        """
+             Retourne 1 si le mot-cle simple attend un objet de type GEOM
+             Retourne 0 dans le cas contraire
+        """
+        for typ in self.definition.type:
+            if type(typ) == type or isinstance(typ,type):
+                if issubclass(typ,GEOM) : return 1
+        return 0
+
+
+    def waitTxm(self):
+        """
+             Retourne 1 si le mot-cle simple attend un objet de type TXM
+             Retourne 0 dans le cas contraire
+        """
+        for typ in self.definition.type:
+            if typ == 'TXM' :return 1
+        return 0
+
+    def waitTuple(self):
+        for ss_type in self.definition.type:
+            if repr(ss_type).find('Tuple') != -1 :
+                return 1
+        return 0
+
+    def waitChaineAvecBlancs(self):
+        if self.definition.avecBlancs : return 1
+        return 0
+
+    def combienEltDsTuple(self):
+        for ss_type in self.definition.type:
+            if hasattr(ss_type,'ntuple'):
+               return ss_type.ntuple
+        return O 
+
+    def waitMatrice(self):
+        if hasattr(self, 'isAMatrice') : return self.isAMatrice
+        for typ in self.definition.type:
           try :
-            if typ == bool: return True
-          except :
-            pass
-      return False
-
-  def waitCo(self):
-    """
-        Methode booleenne qui retourne 1 si l'objet attend un objet ASSD 
-        qui n'existe pas encore (type CO()), 0 sinon
-    """
-    for typ in self.definition.type:
-      if type(typ) == type or isinstance(typ,type):
-        if issubclass(typ,CO) :
-           return 1
-    return 0
-
-  def waitAssd(self):
-    """ 
-        Methode booleenne qui retourne 1 si le MCS attend un objet de type ASSD ou UserASSD
-        ou derive, 0 sinon
-    """
-    for typ in self.definition.type:
-      if type(typ) == type or isinstance(typ,type):
-        if issubclass(typ,ASSD) and not issubclass(typ,GEOM) :
-          return 1
-    return 0
-
-  def waitUserAssd(self):
-    """ 
-        Methode booleenne qui retourne 1 si le MCS attend un objet de type ASSD 
-        ou derive, 0 sinon
-    """
-    for typ in self.definition.type:
-      if type(typ) == type or isinstance(typ,type):
-        if issubclass(typ,UserASSD) :
-          return 1
-    return 0
-
-  def waitUserAssdEnCreation(self):
-    for typ in self.definition.type:
-      if typ == 'createObject' :
-          return 1
-    return 0
-
-
-  def waitAssdOrGeom(self):
-    """ 
-         Retourne 1 si le mot-cle simple attend un objet de type
-         assd, ASSD, geom ou GEOM
-         Retourne 0 dans le cas contraire
-    """
-    for typ in self.definition.type:
-      if type(typ) == type or isinstance(typ,type):
-        if typ.__name__ in ("GEOM","ASSD","geom","assd") or issubclass(typ,GEOM) :
-          return 1
-    return 0
-
-  def waitGeom(self):
-    """ 
-         Retourne 1 si le mot-cle simple attend un objet de type GEOM
-         Retourne 0 dans le cas contraire
-    """
-    for typ in self.definition.type:
-      if type(typ) == type or isinstance(typ,type):
-        if issubclass(typ,GEOM) : return 1
-    return 0
-
-
-  def waitTxm(self):
-    """ 
-         Retourne 1 si le mot-cle simple attend un objet de type TXM
-         Retourne 0 dans le cas contraire
-    """
-    for typ in self.definition.type:
-      if typ == 'TXM' :return 1
-    return 0
-
-  def waitTuple(self):
-    for ss_type in self.definition.type:
-        if repr(ss_type).find('Tuple') != -1 :
-          return 1
-    return 0
-
-
-  def getListeValeurs(self):
-    """
-    """
-    if self.valeur == None:
-      return []
-    elif type(self.valeur) == tuple:
-      return list(self.valeur)
-    elif type(self.valeur) == list:
-      return self.valeur
-    else:
-      return [self.valeur]
-
-  def isOblig(self):
-    return self.definition.statut=='o'
-
-  def isImmuable(self):
-    return self.definition.homo=='constant'
-
-  def isInformation(self):
-    return self.definition.homo=='information'
-
-
-
-  def validVal(self,valeur):
-      """
-        Verifie que la valeur passee en argument (valeur) est valide
-        sans modifier la valeur courante 
-      """
-      lval=listProto.adapt(valeur)
-      if lval is None:
-         valid=0
-         mess=tr("None n'est pas une valeur autorisee")
-      else:
-         try:
-            for val in lval:
+            if hasattr(typ, 'typElt') : self.isAMatrice=1; return 1
+          except : pass
+        self.isAMatrice=0
+        return 0
+
+    def getListeValeurs(self):
+        """
+        """
+        if self.valeur == None:
+            return []
+        elif type(self.valeur) == tuple:
+            return list(self.valeur)
+        elif type(self.valeur) == list:
+            return self.valeur
+        else:
+            return [self.valeur]
+
+    def isOblig(self):
+        return self.definition.statut=='o'
+
+    def isImmuable(self):
+        return self.definition.homo=='constant'
+
+    def isInformation(self):
+        return self.definition.homo=='information'
+
+
+    def validVal(self,valeur):
+        """
+          Verifie que la valeur passee en argument (valeur) est valide
+          sans modifier la valeur courante
+        """
+        lval=listProto.adapt(valeur)
+        if lval is None:
+            valid=0
+            mess=tr("None n'est pas une valeur autorisee")
+        else:
+            try:
+                for val in lval:
+                    self.typeProto.adapt(val)
+                    self.intoProto.adapt(val)
+                self.cardProto.adapt(lval)
+                if self.definition.validators:
+                    self.definition.validators.convert(lval)
+                valid,mess=1,""
+            except ValError as e:
+                mess=str(e)
+                valid=0
+        return valid,mess
+
+    def validValeur(self,new_valeur):
+        """
+          Verifie que la valeur passee en argument (new_valeur) est valide
+          sans modifier la valeur courante (evite d'utiliser setValeur et est plus performant)
+        """
+        validite,mess=self.validVal(new_valeur)
+        return validite
+
+    def validValeurPartielle(self,new_valeur):
+        """
+          Verifie que la valeur passee en argument (new_valeur) est une liste partiellement valide
+          sans modifier la valeur courante du mot cle
+        """
+        validite=1
+        try:
+            for val in new_valeur:
                 self.typeProto.adapt(val)
                 self.intoProto.adapt(val)
-            self.cardProto.adapt(lval)
-            if self.definition.validators:
-                self.definition.validators.convert(lval)
-            valid,mess=1,""
-         except ValError as e:
-            mess=str(e)
-            valid=0
-      return valid,mess
-
-  def validValeur(self,new_valeur):
-      """
-        Verifie que la valeur passee en argument (new_valeur) est valide
-        sans modifier la valeur courante (evite d'utiliser setValeur et est plus performant)
-      """
-      validite,mess=self.validVal(new_valeur)
-      return validite
-
-  def validValeurPartielle(self,new_valeur):
-      """
-        Verifie que la valeur passee en argument (new_valeur) est une liste partiellement valide
-        sans modifier la valeur courante du mot cle
-      """
-      validite=1
-      try:
-          for val in new_valeur:
-              self.typeProto.adapt(val)
-              self.intoProto.adapt(val)
-              #on ne verifie pas la cardinalite
-              if self.definition.validators:
-                  validite=self.definition.validators.valideListePartielle(new_valeur)
-      except ValError as e:
-          validite=0
-
-      return validite
-
-  def updateConditionBloc(self):
-      """ Met a jour les blocs conditionnels dependant du mot cle simple self
-      """
-      if self.definition.position == 'global' : 
-         self.etape.deepUpdateConditionBloc()
-      elif self.definition.position == 'global_jdc' :
-         self.jdc.deepUpdateConditionBloc(self)
-      else:
-         self.parent.updateConditionBloc()
-
-  def setValeur(self,new_valeur,evaluation='oui'):
+                #on ne verifie pas la cardinalite
+                if self.definition.validators:
+                    validite=self.definition.validators.valideListePartielle(new_valeur)
+        except ValError as e:
+            validite=0
+
+        return validite
+
+    def updateConditionBloc(self):
+        """ Met a jour les blocs conditionnels dependant du mot cle simple self
+        """
+        if self.definition.position == 'global' :
+            self.etape.deepUpdateConditionBloc()
+        elif self.definition.position == 'reCalculeEtape' :
+            print ('je passe par la pour ', self.nom)
+            self.etape.deepUpdateConditionBloc()
+            self.etape.demandeRedessine()
+        elif self.definition.position == 'global_jdc' :
+            self.jdc.deepUpdateConditionBloc(self)
+            self.etape.demandeRedessine()
+        elif self.definition.position == 'inGetAttribut' :
+            self.jdc.deepUpdateConditionBloc(self)
+        else:
+            self.parent.updateConditionBloc()
+
+    def setValeur(self,new_valeur,evaluation='oui'):
         self.initModif()
         self.valeur = new_valeur
         self.val = new_valeur
-        if self.valeur and self.waitUserAssd() and not(self.waitUserAssdEnCreation()) : 
-           if type(self.valeur)  in (list,tuple):
-              for v in self.valeur : v.ajoutUtilisePar(self)
-           else : self.valeur.ajoutUtilisePar(self)
-        if self.isValid():self.setValeurObjPyxb(new_valeur)
+        if self.valeur and self.waitUserAssd() and not(self.waitUserAssdOrAssdMultipleEnCreation()) :
+            if type(self.valeur)  in (list,tuple):
+                for v in self.valeur : v.ajoutUtilisePar(self)
+            else : self.valeur.ajoutUtilisePar(self)
+        if  self.isValid() and hasattr(self, 'objPyxb') and self.objPyxb : self.setValeurObjPyxb(new_valeur)
         self.updateConditionBloc()
+        if self.definition.metAJour != None : self.updateAutresMotsClefs()
         self.etape.modified()
         self.finModif()
         return 1
 
-  def evalValeur(self,new_valeur):
-    """
-        Essaie d'evaluer new_valeur comme une SD, une declaration Python 
-        ou un EVAL: Retourne la valeur evaluee (ou None) et le test de reussite (1 ou 0)
-    """
-    sd = self.jdc.getSdAvantEtape(new_valeur,self.etape)
-    #sd = self.jdc.getContexteAvant(self.etape).get(new_valeur,None)
-    if sd is not None:
-      return sd,1
-    lsd = self.jdc.chercheListAvant(self.etape,new_valeur) 
-    if lsd :
-      return lsd,1
-    else:
-      d={}
-      # On veut EVAL avec tous ses comportements. On utilise Accas. Perfs ??
-      d['EVAL']=Accas.EVAL
-      try :
-        objet = eval(new_valeur,d)
-        return objet,1
-      except Exception:
-        itparam=self.chercheItemParametre(new_valeur)
-        if itparam:
-             return itparam,1
-        try :
-             object=eval(new_valeur.valeur,d)
-        except :
-             pass
-        if CONTEXT.debug : traceback.print_exc()
-        return None,0
-
-  def evalVal(self,new_valeur):
-    """
-       Tente d'evaluer new_valeur comme un objet du jdc (par appel a evalValItem)
-       ou comme une liste de ces memes objets
-       Si new_valeur contient au moins un separateur (,), tente l'evaluation sur
-       la chaine splittee
-    """
-    if new_valeur in ('True','False') and 'TXM' in self.definition.type  :
-       valeur=self.evalValItem(str(new_valeur))
-       return new_valeur
-    if type(new_valeur) in (list,tuple):
-       valeurretour=[]
-       for item in new_valeur :
-          valeurretour.append(self.evalValItem(item))
-       return valeurretour
-    else:
-       valeur=self.evalValItem(new_valeur)
-       return valeur
-
-  def evalValItem(self,new_valeur):
-    """
-       Tente d'evaluer new_valeur comme un concept, un parametre, un objet Python ou un UserASSD
-       Si c'est impossible retourne new_valeur inchange
-       argument new_valeur : string (nom de concept, de parametre, expression ou simple chaine)
-    """
-    if new_valeur in list(self.jdc.sdsDict.keys()) and self.waitUserAssd():
-       valeur=self.jdc.sdsDict[new_valeur]
-       return valeur
-    elif self.etape and self.etape.parent:
-       valeur=self.etape.parent.evalInContext(new_valeur,self.etape)
-       return valeur
-    else:
-       try :
-           valeur = eval(val)
-           return valeur
-       except:
-           #traceback.print_exc()
-           return new_valeur
-           pass
-
-  def chercheItemParametre (self,new_valeur):
+    def evalValeur(self,new_valeur):
+        """
+            Essaie d'evaluer new_valeur comme une SD, une declaration Python
+            ou un EVAL: Retourne la valeur evaluee (ou None) et le test de reussite (1 ou 0)
+        """
+        sd = self.jdc.getSdAvantEtape(new_valeur,self.etape)
+        #sd = self.jdc.getContexteAvant(self.etape).get(new_valeur,None)
+        if sd is not None:
+            return sd,1
+        lsd = self.jdc.chercheListAvant(self.etape,new_valeur)
+        if lsd :
+            return lsd,1
+        else:
+            d={}
+            # On veut EVAL avec tous ses comportements. On utilise Accas. Perfs ??
+            d['EVAL']=Accas.EVAL
+            try :
+                objet = eval(new_valeur,d)
+                return objet,1
+            except Exception:
+                itparam=self.chercheItemParametre(new_valeur)
+                if itparam:
+                    return itparam,1
+                try :
+                    object=eval(new_valeur.valeur,d)
+                except :
+                    pass
+                if CONTEXT.debug : traceback.print_exc()
+                return None,0
+
+    def evalVal(self,new_valeur):
+        """
+           Tente d'evaluer new_valeur comme un objet du jdc (par appel a evalValItem)
+           ou comme une liste de ces memes objets
+           Si new_valeur contient au moins un separateur (,), tente l'evaluation sur
+           la chaine splittee
+        """
+        if new_valeur in ('True','False') and 'TXM' in self.definition.type  :
+            valeur=self.evalValItem(str(new_valeur))
+            return new_valeur
+        if type(new_valeur) in (list,tuple):
+            valeurretour=[]
+            for item in new_valeur :
+                valeurretour.append(self.evalValItem(item))
+            return valeurretour
+        else:
+            valeur=self.evalValItem(new_valeur)
+            return valeur
+
+    def evalValItem(self,new_valeur):
+        """
+           Tente d'evaluer new_valeur comme un concept, un parametre, un objet Python ou un UserASSD
+           Si c'est impossible retourne new_valeur inchange
+           argument new_valeur : string (nom de concept, de parametre, expression ou simple chaine)
+        """
+        if new_valeur in list(self.jdc.sdsDict.keys()) and self.waitUserAssd():
+            valeur=self.jdc.sdsDict[new_valeur]
+            return valeur
+        elif self.etape and self.etape.parent:
+            valeur=self.etape.parent.evalInContext(new_valeur,self.etape)
+            return valeur
+        else:
+            try :
+                valeur = eval(val)
+                return valeur
+            except:
+                #traceback.print_exc()
+                return new_valeur
+                pass
+
+    def chercheItemParametre (self,new_valeur):
         try:
-          nomparam=new_valeur[0:new_valeur.find("[")]
-          indice=new_valeur[new_valeur.find(u"[")+1:new_valeur.find(u"]")]
-          for p in self.jdc.params:
-             if p.nom == nomparam :
-                if int(indice) < len(p.getValeurs()):
-                   itparam=parametre.ITEM_PARAMETRE(p,int(indice))
-                   return itparam
-          return None
+            nomparam=new_valeur[0:new_valeur.find("[")]
+            indice=new_valeur[new_valeur.find(u"[")+1:new_valeur.find(u"]")]
+            for p in self.jdc.params:
+                if p.nom == nomparam :
+                    if int(indice) < len(p.getValeurs()):
+                        itparam=parametre.ITEM_PARAMETRE(p,int(indice))
+                        return itparam
+            return None
         except:
-          return None
-
-  def updateConcept(self,sd):
-    if type(self.valeur) in (list,tuple) :
-       if sd in self.valeur:
-         if self.objPyxb : 
-            newVal=[]
-            for v in self.valeur : newVal.append(v.nom)
-            self.setValeurObjPyxb(newVal)
-         self.initModif()
-         self.finModif()
-    else:
-       if sd == self.valeur:
-         if self.objPyxb :  self.setValeurObjPyxb(sd.nom)
-         self.initModif()
-         self.finModif()
-
-  def deleteConcept(self,sd):
-    """ 
-        Inputs :
-           - sd=concept detruit
-        Fonction :
-        Met a jour la valeur du mot cle simple suite a la disparition 
-        du concept sd
-        Attention aux matrices
-    """
+            return None
+
+    def updateConcept(self,sd):
+        if not self.waitAssd() : return
+        if type(self.valeur) in (list,tuple) :
+            if sd in self.valeur:
+                newVal=[]
+                for v in self.valeur : newVal.append(v.nom)
+                self.initModif()
+                if hasattr(self, 'objPyxb') and self.objPyxb : self.setValeurObjPyxb(newVal)
+                self.finModif()
+        else:
+            if sd == self.valeur:
+                self.initModif()
+                if hasattr(self, 'objPyxb') and self.objPyxb : self.setValeurObjPyxb(sd.nom)
+                self.finModif()
+
+    def deleteConcept(self,sd):
+        """
+            Inputs :
+               - sd=concept detruit
+            Fonction :
+            Met a jour la valeur du mot cle simple suite a la disparition
+            du concept sd
+            Attention aux matrices
+        """
 ##PNPNPN a tester
-    if type(self.valeur) == tuple :
-      if sd in self.valeur:
-        self.initModif()
-        self.valeur=list(self.valeur)
-        while sd in self.valeur : self.valeur.remove(sd)
-        if self.objPyxb : 
-           newVal=[]
-           for v in self.valeur : newVal.append(v.nom)
-           if newVal == [] : self.delObjPyxb()
-           else : self.setValeurObjPyxb(sd.nom) 
-        self.finModif()
-    elif type(self.valeur) == list:
-      if sd in self.valeur:
+        if type(self.valeur) == tuple :
+            if sd in self.valeur:
+                self.initModif()
+                self.valeur=list(self.valeur)
+                while sd in self.valeur : self.valeur.remove(sd)
+                if hasattr(self, 'objPyxb') and self.objPyxb :
+                    newVal=[]
+                    for v in self.valeur : newVal.append(v.nom)
+                    if newVal == [] : self.delObjPyxb()
+                    else : self.setValeurObjPyxb(sd.nom)
+                self.finModif()
+        elif type(self.valeur) == list:
+            if sd in self.valeur:
+                self.initModif()
+                while sd in self.valeur : self.valeur.remove(sd)
+                self.finModif()
+        else:
+            if self.valeur == sd:
+                self.initModif()
+                self.valeur=None
+                self.val=None
+                if hasattr(self, 'objPyxb') and self.objPyxb : self.setValeurObjPyxb()
+                self.finModif()
+        # Glut Horrible pour les matrices OT ???
+        #if sd.__class__.__name__== "variable":
+        #   for type_permis in self.definition.type:
+                #if type(type_permis) == types.InstanceType:
+                # a voir en python 3
+        #           if type_permis.__class__.__name__ == 'Matrice' :
+        #               self.state="changed"
+        #               self.isValid()
+
+
+    def replaceConcept(self,old_sd,sd):
+        """
+            Inputs :
+               - old_sd=concept remplace
+               - sd=nouveau concept
+            Fonction :
+            Met a jour la valeur du mot cle simple suite au remplacement
+            du concept old_sd
+        """
+        #print ("replaceConcept",old_sd,sd)
+        if type(self.valeur) == tuple :
+            if old_sd in self.valeur:
+                self.initModif()
+                self.valeur=list(self.valeur)
+                i=self.valeur.index(old_sd)
+                self.valeur[i]=sd
+                self.finModif()
+        elif type(self.valeur) == list:
+            if old_sd in self.valeur:
+                self.initModif()
+                i=self.valeur.index(old_sd)
+                self.valeur[i]=sd
+                self.finModif()
+        else:
+            if self.valeur == old_sd:
+                self.initModif()
+                self.valeur=sd
+                self.val=sd
+                self.finModif()
+
+    def setValeurCo(self,nomCO):
+        """
+            Affecte a self l'objet de type CO et de nom nomCO
+        """
+        step=self.etape.parent
+        if nomCO == None or nomCO == '':
+            new_objet=None
+        else:
+            # Avant de creer un concept il faut s'assurer du contexte : step
+            # courant
+            sd= step.getSdAutourEtape(nomCO,self.etape,avec='oui')
+            if sd:
+                # Si un concept du meme nom existe deja dans la portee de l'etape
+                # on ne cree pas le concept
+                return 0,tr("un concept de meme nom existe deja")
+            # Il n'existe pas de concept de meme nom. On peut donc le creer
+            # Il faut neanmoins que la methode NommerSdProd de step gere les
+            # contextes en mode editeur
+            # Normalement la methode  du Noyau doit etre surchargee
+            # On declare l'etape du mot cle comme etape courante pour nommerSDProd
+            cs= CONTEXT.getCurrentStep()
+            CONTEXT.unsetCurrentStep()
+            CONTEXT.setCurrentStep(step)
+            step.setEtapeContext(self.etape)
+            new_objet = Accas.CO(nomCO)
+            CONTEXT.unsetCurrentStep()
+            CONTEXT.setCurrentStep(cs)
         self.initModif()
-        while sd in self.valeur : self.valeur.remove(sd)
-        self.finModif()
-    else:
-      if self.valeur == sd:
-        self.initModif()
-        self.valeur=None
-        self.val=None
-        if self.objPyxb : self.setValeurObjPyxb()
-        self.finModif()
-    # Glut Horrible pour les matrices ???
-    if sd.__class__.__name__== "variable":
-       for type_permis in self.definition.type:
-            #if type(type_permis) == types.InstanceType:
-            # a voir en python 3
-               if type_permis.__class__.__name__ == 'Matrice' :
-                   self.state="changed"
-                   self.isValid()
-                  
-
-  def replaceConcept(self,old_sd,sd):
-    """
-        Inputs :
-           - old_sd=concept remplace
-           - sd=nouveau concept
-        Fonction :
-        Met a jour la valeur du mot cle simple suite au remplacement 
-        du concept old_sd
-    """
-    print ("replaceConcept",old_sd,sd)
-    if type(self.valeur) == tuple :
-      if old_sd in self.valeur:
-        self.initModif()
-        self.valeur=list(self.valeur)
-        i=self.valeur.index(old_sd)
-        self.valeur[i]=sd
-        self.finModif()
-    elif type(self.valeur) == list:
-      if old_sd in self.valeur:
-        self.initModif()
-        i=self.valeur.index(old_sd)
-        self.valeur[i]=sd
-        self.finModif()
-    else:
-      if self.valeur == old_sd:
-        self.initModif()
-        self.valeur=sd
-        self.val=sd
+        self.valeur = new_objet
+        self.val = new_objet
+        # On force l'enregistrement de new_objet en tant que concept produit
+        # de la macro en appelant getType_produit avec force=1
+        self.etape.getType_produit(force=1)
         self.finModif()
+        step.resetContext()
+        #print "setValeurCo",new_objet
+        return 1,tr("Concept cree")
+
+    def verifExistenceSd(self):
+        """
+           Verifie que les structures de donnees utilisees dans self existent bien dans le contexte
+           avant etape, sinon enleve la referea ces concepts
+        """
+        #print "verifExistenceSd"
+        # Attention : possible probleme avec include
+        # A priori il n'y a pas de raison de retirer les concepts non existants
+        # avant etape. En fait il s'agit uniquement eventuellement de ceux crees par une macro
+        l_sd_avant_etape = list(self.jdc.getContexteAvant(self.etape).values())
+        if type(self.valeur) in (tuple,list) :
+            l=[]
+            for sd in self.valeur:
+                if isinstance(sd,ASSD) :
+                    if sd in l_sd_avant_etape or self.etape.getSdprods(sd.nom) is sd:
+                        l.append(sd)
+                else:
+                    l.append(sd)
+            if len(l) < len(self.valeur):
+                self.initModif()
+                self.valeur=tuple(l)
+                self.finModif()
+        else:
+            if isinstance(self.valeur,ASSD) :
+                if self.valeur not in l_sd_avant_etape and self.etape.getSdprods(self.valeur.nom) is None:
+                    self.initModif()
+                    self.valeur = None
+                    self.finModif()
+
+    def renommeSdCree(self,nouveauNom):
+        #print ( 'dans renommeSdCree', self.jdc.sdsDict, self.valeur)
+        if nouveauNom in self.jdc.sdsDict : return (0, 'concept deja existant')
+        if self.valeur == None : return (0, 'pb sur la valeur')
+        else :   self.valeur.renomme(nouveauNom)
+        return (1, 'concept renomme')
+
+    def renommeSdCreeDsListe(self,objASSD, nouveauNom):
+        #print ( 'dans renommeSdCree', self.jdc.sdsDict, self.valeur, nouveauNom)
+        if nouveauNom in self.jdc.sdsDict : return (0, 'concept deja existant')
+        objASSD.renomme(nouveauNom)
+        return (1, 'concept renomme')
+
+
+
+    def getMinMax(self):
+        """
+        Retourne les valeurs min et max admissibles pour la valeur de self
+        """
+        return self.definition.min,self.definition.max
+
+
+    def getType(self):
+        """
+        Retourne le type attendu par le mot-cle simple
+        """
+        return self.definition.type
+
+    def deleteMcGlobal(self):
+        """ Retire self des declarations globales
+        """
+   # on est oblige de verifier si le nom est dans etape
+   # car parfois l ordre des creations/destruction n est pas clair
+   # quand on a des blocs freres qui contiennent le meme mc global
+   # cas de NumericalMethod dans VIMMP
+        if self.definition.position == 'global' :
+            etape = self.getEtape()
+            if etape and self.nom in etape.mc_globaux:
+                if etape.mc_globaux[self.nom] == self :
+                    del etape.mc_globaux[self.nom]
+        elif self.definition.position == 'reCalculeEtape' :
+            etape = self.getEtape()
+            if etape  :
+                if self.nom in etape.mc_globaux:
+                    if etape.mc_globaux[self.nom] == self :
+                        del etape.mc_globaux[self.nom]
+                        self.etape.doitEtreRecalculee = True
+                    #print ('deleteMcGlobal je mets doitEtreRecalculee = True avec', self.nom ,' pour ', etape.nom)
+        elif self.definition.position == 'global_jdc' :
+            if self.nom in self.jdc.mc_globaux:
+                try : del self.jdc.mc_globaux[self.nom]
+                except : print ('!!!!!!!! Souci delete mc_globaux')
+
+    def updateMcGlobal(self):
+        """
+           Met a jour les mots cles globaux enregistres dans l'etape parente
+           et dans le jdc parent.
+           Un mot cle simple peut etre global.
+        """
+        if self.definition.position == 'global' :
+            etape = self.getEtape()
+            if etape :
+                etape.mc_globaux[self.nom]=self
+        elif self.definition.position == 'reCalculeEtape' :
+            etape = self.getEtape()
+            if etape :
+                etape.mc_globaux[self.nom]=self
+                etape.doitEtreRecalculee=True
+                print ('je mets doitEtreRecalculee = True avec', self.nom ,' pour ', etape.nom)
+                print ('j ajoute au mc_globaux')
+        elif self.definition.position == 'global_jdc' :
+            if self.jdc:
+                self.jdc.mc_globaux[self.nom]=self
+
+    def nbrColonnes(self):
+        genea = self.getGenealogie()
+        if "VALE_C" in genea and "DEFI_FONCTION" in genea : return 3
+        if "VALE" in genea and "DEFI_FONCTION" in genea : return 2
+        return 0
+
+    def valideItem(self,item):
+        """Valide un item isole. Cet item est candidata l'ajout a la liste existante"""
+        valid=1
+        try:
+                #on verifie le type
+            self.typeProto.adapt(item)
+            #on verifie les choix possibles
+            self.intoProto.adapt(item)
+            #on ne verifie pas la cardinalite
+            if self.definition.validators:
+                valid=self.definition.validators.verifItem(item)
+        except ValError as e:
+            #traceback.print_exc()
+            valid=0
+        return valid
+
+    def verifType(self,item):
+        """Verifie le type d'un item de liste"""
+        try:
+            #on verifie le type
+            self.typeProto.adapt(item)
+            #on verifie les choix possibles
+            self.intoProto.adapt(item)
+            #on ne verifie pas la cardinalite mais on verifie les validateurs
+            if self.definition.validators:
+                valid=self.definition.validators.verifItem(item)
+            comment=""
+            valid=1
+        except ValError as e:
+            #traceback.print_exc()
+            comment=tr(e.__str__())
+            valid=0
+        return valid,comment
+
+    def valideMatrice(self,cr):
+        ok=1
+        commentaire =''
+        if self.valeur == None :
+            self.setValid(0)
+            return 0
+
+        if self.monType.methodeCalculTaille != None :
+            MCSIMP.__dict__[self.monType.methodeCalculTaille](*(self,))
+
+        if len(self.valeur) == self.monType.nbLigs :
+            for i in range(len(self.valeur)):
+                if len(self.valeur[i]) != self.monType.nbCols: ok=0
+        else : ok=0
+
+        if not ok :
+            self.setValid(0)
+            if cr == 'oui' :
+                self.cr.fatal(tr("La matrice n'est pas une matrice %(n_lign)d sur %(n_col)d", \
+                {'n_lign': self.monType.nbLigs, 'n_col': self.monType.nbCols}))
+            return 0
+
+        for i in range(self.monType.nbLigs):
+            for j in range(self.monType.nbCols):
+                val=self.valeur[i][j]
+                ok, commentaire = self.monType.verifItem(str(val),self.parent)
+                if self.monType.typElt not in ('TXM','I','R') and type(val) != self.monType.typElt : 
+                   ok=0; commentaire = 'mauvais type'; self.valeur=None
+                if not ok :
+                    self.setValid(0)
+                    if cr == 'oui' :
+                       self.cr.fatal(tr(commentaire))
+                    return 0
+        self.setValid(1)
+        return 1
 
-  def setValeurCo(self,nomCO):
-      """
-          Affecte a self l'objet de type CO et de nom nomCO
-      """
-      step=self.etape.parent
-      if nomCO == None or nomCO == '':
-         new_objet=None
-      else:
-         # Avant de creer un concept il faut s'assurer du contexte : step 
-         # courant
-         sd= step.getSdAutourEtape(nomCO,self.etape,avec='oui')
-         if sd:
-            # Si un concept du meme nom existe deja dans la portee de l'etape
-            # on ne cree pas le concept
-            return 0,tr("un concept de meme nom existe deja")
-         # Il n'existe pas de concept de meme nom. On peut donc le creer 
-         # Il faut neanmoins que la methode NommerSdProd de step gere les 
-         # contextes en mode editeur
-         # Normalement la methode  du Noyau doit etre surchargee
-         # On declare l'etape du mot cle comme etape courante pour nommerSDProd
-         cs= CONTEXT.getCurrentStep()
-         CONTEXT.unsetCurrentStep()
-         CONTEXT.setCurrentStep(step)
-         step.setEtapeContext(self.etape)
-         new_objet = Accas.CO(nomCO)
-         CONTEXT.unsetCurrentStep()
-         CONTEXT.setCurrentStep(cs)
-      self.initModif()
-      self.valeur = new_objet
-      self.val = new_objet
-      # On force l'enregistrement de new_objet en tant que concept produit 
-      # de la macro en appelant getType_produit avec force=1
-      self.etape.getType_produit(force=1)
-      self.finModif()
-      step.resetContext()
-      #print "setValeurCo",new_objet
-      return 1,tr("Concept cree")
-        
-  def verifExistenceSd(self):
-     """
-        Verifie que les structures de donnees utilisees dans self existent bien dans le contexte
-        avant etape, sinon enleve la referea ces concepts
-     """
-     #print "verifExistenceSd"
-     # Attention : possible probleme avec include
-     # A priori il n'y a pas de raison de retirer les concepts non existants
-     # avant etape. En fait il s'agit uniquement eventuellement de ceux crees par une macro
-     l_sd_avant_etape = list(self.jdc.getContexteAvant(self.etape).values())  
-     if type(self.valeur) in (tuple,list) :
-       l=[]
-       for sd in self.valeur:
-         if isinstance(sd,ASSD) :
-            if sd in l_sd_avant_etape or self.etape.getSdprods(sd.nom) is sd:
-               l.append(sd)
-         else:
-            l.append(sd)
-       if len(l) < len(self.valeur):
-          self.initModif()
-          self.valeur=tuple(l)
-          self.finModif()
-     else:
-       if isinstance(self.valeur,ASSD) :
-          if self.valeur not in l_sd_avant_etape and self.etape.getSdprods(self.valeur.nom) is None:
-             self.initModif()
-             self.valeur = None
-             self.finModif()
-  def renommeSdCree(self,nouveauNom):
-      print ( 'dans renommeSdCree', self.jdc.sdsDict, self.valeur)
-      if nouveauNom in self.jdc.sdsDict : return (0, 'concept deja existant')
-      if self.valeur == None : return (0, 'pb sur la valeur')
-      else :   self.valeur.renomme(nouveauNom)
-      return (1, 'concept renomme')
-      
-  def renommeSdCreeDsListe(self,objASSD, nouveauNom):
-      if nouveauNom in self.jdc.sdsDict : return (0, 'concept deja existant')
-      objASSD.renomme(nouveauNom)
-      return (1, 'concept renomme')
-      
-
-
-  def getMinMax(self):
-     """
-     Retourne les valeurs min et max admissibles pour la valeur de self
-     """
-     return self.definition.min,self.definition.max
-
-
-  def getType(self):
-     """
-     Retourne le type attendu par le mot-cle simple
-     """
-     return self.definition.type
-
-  def deleteMcGlobal(self):
-      """ Retire self des declarations globales
-      """
-      if self.definition.position == 'global' : 
-         etape = self.getEtape()
-         if etape :
-            del etape.mc_globaux[self.nom]
-      elif self.definition.position == 'global_jdc' :
-# PNPNPN a debuger
-         print (self.nom)
-         try :
-           del self.jdc.mc_globaux[self.nom]
-         except : pass
-
-  def updateMcGlobal(self):
-     """
-        Met a jour les mots cles globaux enregistres dans l'etape parente
-        et dans le jdc parent.
-        Un mot cle simple peut etre global. 
-     """
-     if self.definition.position == 'global' :
-        etape = self.getEtape()
-        if etape :
-           etape.mc_globaux[self.nom]=self
-     elif self.definition.position == 'global_jdc' :
-        if self.jdc:
-           self.jdc.mc_globaux[self.nom]=self
-
-  def nbrColonnes(self):
-     genea = self.getGenealogie()
-     if "VALE_C" in genea and "DEFI_FONCTION" in genea : return 3
-     if "VALE" in genea and "DEFI_FONCTION" in genea : return 2
-     return 0
-
-  def valideItem(self,item):
-      """Valide un item isole. Cet item est candidata l'ajout a la liste existante"""
-      valid=1
-      try:
-          #on verifie le type
-          self.typeProto.adapt(item)
-          #on verifie les choix possibles
-          self.intoProto.adapt(item)
-          #on ne verifie pas la cardinalite
-          if self.definition.validators:
-              valid=self.definition.validators.verifItem(item)
-      except ValError as e:
-          #traceback.print_exc()
-          valid=0
-      return valid
-
-  def verifType(self,item):
-      """Verifie le type d'un item de liste"""
-      try:
-          #on verifie le type
-          self.typeProto.adapt(item)
-          #on verifie les choix possibles
-          self.intoProto.adapt(item)
-          #on ne verifie pas la cardinalite mais on verifie les validateurs
-          if self.definition.validators:
-              valid=self.definition.validators.verifItem(item)
-          comment=""
-          valid=1
-      except ValError as e:
-          #traceback.print_exc()
-          comment=tr(e.__str__())
-          valid=0
-      return valid,comment
-
-  def valideMatrice(self,cr):
-       #Attention, la matrice contient comme dernier tuple l ordre des variables
-       if self.valideEnteteMatrice()==False :
-           self.setValid(0)
-           if cr == "oui" : self.cr.fatal(tr("La matrice n'a pas le bon entete"))
-           return 0
-       if self.monType.methodeCalculTaille != None :
-           MCSIMP.__dict__[self.monType.methodeCalculTaille](*(self,))
-       try :
-       #if 1 :
-           ok=0
-           if len(self.valeur) == self.monType.nbLigs +1:
-              ok=1
-              for i in range(len(self.valeur) -1):
-                  if len(self.valeur[i])!= self.monType.nbCols:
-                     ok=0
-           if ok: 
-              self.setValid(1)
-              return 1 
-       except :
-       #else :
+
+
+    def valideMatriceOT(self,cr):
+            #Attention, la matrice contient comme dernier tuple l ordre des variables
+        if self.valideEnteteMatrice()==False :
+            self.setValid(0)
+            if cr == "oui" : self.cr.fatal(tr("La matrice n'a pas le bon entete"))
+            return 0
+        if self.monType.methodeCalculTaille != None :
+            MCSIMP.__dict__[self.monType.methodeCalculTaille](*(self,))
+        try :
+        #if 1 :
+            ok=0
+            if len(self.valeur) == self.monType.nbLigs +1:
+                ok=1
+                for i in range(len(self.valeur) -1):
+                    if len(self.valeur[i])!= self.monType.nbCols:
+                        ok=0
+            if ok:
+                self.setValid(1)
+                return 1
+        except :
+        #else :
             pass
-       if cr == 'oui' :
-             self.cr.fatal(tr("La matrice n'est pas une matrice %(n_lign)d sur %(n_col)d", \
-             {'n_lign': self.monType.nbLigs, 'n_col': self.monType.nbCols}))
-       self.setValid(0)
-       return 0
-
-
-  def nbDeVariables(self):
-       listeVariables=self.jdc.getVariables(self.etape)
-       self.monType.nbLigs=len(listeVariables)
-       self.monType.nbCols=len(listeVariables)
-      
-  def valideEnteteMatrice(self):
-      if self.jdc.getDistributions(self.etape) == () or self.valeur == None : return 0
-      if self.jdc.getDistributions(self.etape) != self.valeur[0] : return 0
-      return 1
-     
-  def changeEnteteMatrice(self):
-      a=[self.jdc.getDistributions(self.etape),]
-      for t in self.valeur[1:]:
-         a.append(t)
-      self.valeur=a
-
-
-  def nbDeDistributions(self):
-       listeVariables=self.jdc.getDistributions(self.etape)
-       self.monType.nbLigs=len(listeVariables)
-       self.monType.nbCols=len(listeVariables)
-      
-  def getNomDsXML(self):
-      nomDsXML=self.parent.getNomDsXML()+"."+self.nom
-      return nomDsXML
-
-
-  def verifTypeIhm(self,val,cr='non'):
-      try :
-         val.eval()
-         return 1
-      except :
-         traceback.print_exc()
-         pass
-      return self.verifType(val,cr)
-
-  def verifTypeliste(self,val,cr='non') :
-      verif=0
-      for v in val :
-        verif=verif+self.verifTypeIhm(v,cr)
-      return verif
-
-  def initModifUp(self):
-    Validation.V_MCSIMP.MCSIMP.initModifUp(self)
-    CONNECTOR.Emit(self,"valid")
-
-  def deleteRef(self):
-    print ('je suis dans deleteRef', self.nom)
-    if self.definition.creeDesObjets :
-       if self.valeur : 
-          self.valeur.deleteReference() 
-       
-       for MC in self.valeur.utilisePar:
-           MC.state='changed' 
-           CONNECTOR.Emit(MC,"valid")
+        if cr == 'oui' :
+            self.cr.fatal(tr("La matrice n'est pas une matrice %(n_lign)d sur %(n_col)d", \
+            {'n_lign': self.monType.nbLigs, 'n_col': self.monType.nbCols}))
+        self.setValid(0)
+        return 0
+
+
+    def nbDeVariables(self):
+        listeVariables=self.jdc.getVariables(self.etape)
+        self.monType.nbLigs=len(listeVariables)
+        self.monType.nbCols=len(listeVariables)
 
+    def valideEnteteMatrice(self):
+        if self.jdc.getDistributions(self.etape) == () or self.valeur == None : return 0
+        if self.jdc.getDistributions(self.etape) != self.valeur[0] : return 0
+        return 1
+
+    def changeEnteteMatrice(self):
+        a=[self.jdc.getDistributions(self.etape),]
+        for t in self.valeur[1:]:
+            a.append(t)
+        self.valeur=a
+
+
+    def nbDeDistributions(self):
+        listeVariables=self.jdc.getDistributions(self.etape)
+        self.monType.nbLigs=len(listeVariables)
+        self.monType.nbCols=len(listeVariables)
+
+    def getNomDsXML(self):
+        nomDsXML=self.parent.getNomDsXML()+"."+self.nom
+        return nomDsXML
+
+
+    def verifTypeIhm(self,val,cr='non'):
+        try :
+            val.eval()
+            return 1
+        except :
+            traceback.print_exc()
+            pass
+        return self.verifType(val,cr)
+
+    def verifTypeliste(self,val,cr='non') :
+        verif=0
+        for v in val :
+            verif=verif+self.verifTypeIhm(v,cr)
+        return verif
+
+    def initModifUp(self):
+        Validation.V_MCSIMP.MCSIMP.initModifUp(self)
+        CONNECTOR.Emit(self,"valid")
+
+    def deleteRef(self):
+        if self.valeur == None or self.valeur == [] : return
+        if not type(self.valeur) in (list, tuple): lesValeurs=(self.valeur,)
+        else : lesValeurs=self.valeur
+        for val in lesValeurs:
+            if self.definition.creeDesObjets :
+                val.deleteReference(self)
+            else :
+                if (hasattr (val, 'enleveUtilisePar')) : val.enleveUtilisePar(self)
+
+    def updateAutresMotsClefs(self):
+        print ('updateAutresMotsClefs')
+        for (nomMC, Xpath) in self.definition.metAJour :
+            exp=Xpath+'.getChild("'+nomMC+'")'
+            try :
+                lesMotsClefs = eval(exp)
+            except :
+                lesMotsClefs = []
+            if not type(lesMotsClefs) in (list, tuple): lesMotsClefs=(lesMotsClefs,)
+            if isinstance (lesMotsClefs, MCSIMP): lesMotsClefs=(lesMotsClefs,)
+            listeEtapesDejaRedessinees=[]
+            listeMotsClefsAppel=[]
+            for leMotCle in lesMotsClefs:
+                leMotCle.state='changed'
+                if not leMotCle.isValid() : leMotCle.val=None
+                if leMotCle.etape not in listeEtapesDejaRedessinees :
+                    listeEtapesDejaRedessinees.append(leMotCle.etape)
+                    listeMotsClefsAppel.append(leMotCle)
+            for leMotCle in listeMotsClefsAppel:
+                leMotCle.demandeRedessine()
+
+        print ('fin updateAutresMotsClefs')
index 0c204847947422ddab64d33483d22590234a0c82..5a2c27018a9ca0f868250f466ee80bec7aea1e3e 100644 (file)
@@ -27,166 +27,174 @@ import re
 conceptRE=re.compile(r'[a-zA-Z_]\w*$')
 
 class OBJECT:
-  from Noyau.N_CO import CO
-  from Noyau.N_ASSD import assd
-
-  def isMCList(self):
-    """ 
-        Retourne 1 si self est une MCList (liste de mots-cles), 0 sinon (defaut) 
-    """
-    return 0
-
-  def getRegles(self):
-    """ 
-       Retourne les regles de self 
-    """
-    if hasattr(self,'definition'):
-      return self.definition.regles
-    elif hasattr(self,'regles'):
-      return self.regles
-    else :
-      return []
-
-  def initModif(self):
-    """
-       Met l'etat de l'objet a modified et propage au parent
-       qui vaut None s'il n'existe pas
-    """
-    self.state = 'modified'
-    if self.parent:
-      self.parent.initModif()
-
-  def finModif(self):
-      """
-      Methode appelee apres qu'une modification a ete faite afin de declencher
-      d'eventuels traitements post-modification
-      """
-      #print "finModif",self
-      # pour les objets autres que les commandes, aucun traitement specifique 
-      # on remonte l'info de fin de modif au parent
-      CONNECTOR.Emit(self,"valid")
-      if self.parent:
-        self.parent.finModif()
-
-  def isRepetable(self):
-    """
-         Indique si l'objet est repetable
-    """
-    return 0
-
-  def listeMcPresents(self):
-    """
-         Retourne la liste des noms des mots cles presents
-    """
-    return []
-
-  def getDocu(self):
-    return self.definition.getDocu()
-
-  def getListeMcInconnus(self):
-     """
-     Retourne la liste des mots-cles inconnus dans self
-     """
-     return []
-
-  def verifConditionRegles(self,liste_presents):
-    """ 
-        Retourne la liste des mots-cles a rajouter pour satisfaire les regles
-        en fonction de la liste des mots-cles presents 
-    """
-    liste=[]
-    for regle in self.definition.regles:
-        liste=regle.verifConditionRegle(liste,liste_presents)
-    return liste
-
-  def verifConditionBloc(self):
-    """ 
-        Evalue les conditions de tous les blocs fils possibles 
-        (en fonction du catalogue donc de la definition) de self et
-        retourne deux listes :
-          - la premiere contient les noms des blocs a rajouter
-          - la seconde contient les noms des blocs a supprimer
-    """
-    return [],[]
-
-  def getGenealogiePrecise(self):
-    if self.parent:
-       l=self.parent.getGenealogiePrecise()
-       l.append(self.nom.strip())
-       return l
-    else:
-       return [self.nom.strip()]
-
-
-  def getGenealogie(self):
-    """ 
-        Retourne la liste des noms des ascendants (noms de MCSIMP,MCFACT,MCBLOC
-        ou ETAPE) de self jusqu'au premier objet etape rencontre
-    """
-    if self.parent:
-       l=self.parent.getGenealogie()
-       l.append(self.nom.strip())
-       return l
-    else:
-       return [self.nom.strip()]
-
-  def getFr(self):
-     """
-         Retourne la chaine d'aide contenue dans le catalogue
-         en tenant compte de la langue
-     """
-     try:
-     #if 1 :
-        c=getattr(self.definition,self.jdc.lang)
-        return c
-     except:
-     #else:
-        try :
-            c=getattr(self.definition,"fr")
+    from Noyau.N_CO import CO
+    from Noyau.N_ASSD import assd
+
+    def isMCList(self):
+        """
+            Retourne 1 si self est une MCList (liste de mots-cles), 0 sinon (defaut)
+        """
+        return 0
+
+    def getRegles(self):
+        """
+           Retourne les regles de self
+        """
+        if hasattr(self,'definition'):
+            return self.definition.regles
+        elif hasattr(self,'regles'):
+            return self.regles
+        else :
+            return []
+
+    def initModif(self):
+        """
+           Met l'etat de l'objet a modified et propage au parent
+           qui vaut None s'il n'existe pas
+        """
+        self.state = 'modified'
+        if self.parent:
+            self.parent.initModif()
+
+    def finModif(self):
+        """
+        Methode appelee apres qu'une modification a ete faite afin de declencher
+        d'eventuels traitements post-modification
+        """
+        #print "finModif",self
+        # pour les objets autres que les commandes, aucun traitement specifique
+        # on remonte l'info de fin de modif au parent
+        CONNECTOR.Emit(self,"valid")
+        if self.parent:
+            self.parent.finModif()
+
+    def isRepetable(self):
+        """
+             Indique si l'objet est repetable
+        """
+        return 0
+
+    def listeMcPresents(self):
+        """
+             Retourne la liste des noms des mots cles presents
+        """
+        return []
+
+    def getDocu(self):
+        return self.definition.getDocu()
+
+    def getListeMcInconnus(self):
+        """
+        Retourne la liste des mots-cles inconnus dans self
+        """
+        return []
+
+    def verifConditionRegles(self,liste_presents):
+        """
+            Retourne la liste des mots-cles a rajouter pour satisfaire les regles
+            en fonction de la liste des mots-cles presents
+        """
+        liste=[]
+        for regle in self.definition.regles:
+            liste=regle.verifConditionRegle(liste,liste_presents)
+        return liste
+
+    def verifConditionBloc(self):
+        """
+            Evalue les conditions de tous les blocs fils possibles
+            (en fonction du catalogue donc de la definition) de self et
+            retourne deux listes :
+              - la premiere contient les noms des blocs a rajouter
+              - la seconde contient les noms des blocs a supprimer
+        """
+        return [],[]
+
+    def getGenealogiePrecise(self):
+        if self.parent:
+            l=self.parent.getGenealogiePrecise()
+            l.append(self.nom.strip())
+            return l
+        else:
+            return [self.nom.strip()]
+
+
+    def getGenealogie(self):
+        """
+            Retourne la liste des noms des ascendants (noms de MCSIMP,MCFACT,MCBLOC
+            ou ETAPE) de self jusqu'au premier objet etape rencontre
+        """
+        if self.parent:
+            l=self.parent.getGenealogie()
+            l.append(self.nom.strip())
+            return l
+        else:
+            return [self.nom.strip()]
+
+    def getFr(self):
+        """
+            Retourne la chaine d'aide contenue dans le catalogue
+            en tenant compte de la langue
+        """
+        try:
+        #if 1 :
+            c=getattr(self.definition,self.jdc.lang)
             return c
-        except :
-            return ''
-
-  def updateConcept(self,sd):
-     pass
-
-  def normalize(self):
-     """ Retourne l'objet normalise. En general self sauf si
-         pour etre insere dans l'objet pere il doit etre 
-         wrappe dans un autre objet (voir mot cle facteur).
-     """
-     return self
-
-  def deleteMcGlobal(self):
-     return
-
-  def updateMcGlobal(self):
-     return
-
-  #def __del__(self):
-  #   print "__del__",self
-
-  def nommeSd(self):
-  # surcharge dans I_ETAPE.py
-      if ( nom in dir(self.jdc.cata)) : return (0, nom + tr("mot reserve"))
-      if not conceptRE.match(nom):
-         return 0, tr("Un nom de concept doit etre un identificateur Python")
-      self.initModif()
-      #self.getSdProd()
-      #self.sd.nom = nom
-      #self.sdnom=nom
-      #self.parent.updateConceptAfterEtape(self,self.sd)
-      #self.finModif()
-      #return 1, tr("Nommage du concept effectue")
-
-  def deleteRef(self):
-  # doit etre surcharge dans MC_COMPO et MC_SIMP 
-      pass
-
-  def demandeRedessine(self):
-      CONNECTOR.Emit(self,"redessine")
-
+        except:
+        #else:
+            try :
+                c=getattr(self.definition,"fr")
+                return c
+            except :
+                return ''
+
+    def updateConcept(self,sd):
+        pass
+
+    def normalize(self):
+        """ Retourne l'objet normalise. En general self sauf si
+            pour etre insere dans l'objet pere il doit etre
+            wrappe dans un autre objet (voir mot cle facteur).
+        """
+        return self
+
+    def deleteMcGlobal(self):
+        return
+
+    def updateMcGlobal(self):
+        return
+
+    #def __del__(self):
+    #   print "__del__",self
+
+    def nommeSd(self):
+    # surcharge dans I_ETAPE.py
+        if ( nom in dir(self.jdc.cata)) : return (0, nom + tr("mot reserve"))
+        if not conceptRE.match(nom):
+            return 0, tr("Un nom de concept doit etre un identificateur Python")
+        self.initModif()
+        #self.getSdProd()
+        #self.sd.nom = nom
+        #self.sdnom=nom
+        #self.parent.updateConceptAfterEtape(self,self.sd)
+        #self.finModif()
+        #return 1, tr("Nommage du concept effectue")
+
+    def deleteRef(self):
+    # est surcharge dans  MC_SIMP et dans MC_List
+        #print ('je suis dans deleteRef pour', self.nom)
+        for obj in (self.mcListe):
+            obj.deleteRef()
+
+    def supprimeUserAssd(self):
+        pass
+
+    def demandeRedessine(self):
+        #print ('demandeRedessine pour', self.nom, self, tout)
+        CONNECTOR.Emit(self,"redessine")
+
+    def isUQActivate(self):
+        # valide uniquement pour les MCSIMP
+        return True
 
 
 class ErrorObj(OBJECT):pass
-
index d2bb5b38398fcbc68e9639b02e729cd5ca9347dd..e4daed959ff987660364129e915400802bd3ae4f 100644 (file)
@@ -24,14 +24,13 @@ from __future__ import absolute_import
 from . import I_REGLE
 
 class PRESENT_ABSENT(I_REGLE.REGLE):
-  def purgeListe(self,liste_a_purger,listeMcPresents):
-     regle_active=0
-     if self.mcs[0] in listeMcPresents:regle_active=1
-     if not regle_active : return liste_a_purger
-
-     # Il ne faut pas purger le mot cle present
-     for mc in self.mcs[1:]:
-        if mc in liste_a_purger :
-           liste_a_purger.remove(mc)
-     return liste_a_purger
+    def purgeListe(self,liste_a_purger,listeMcPresents):
+        regle_active=0
+        if self.mcs[0] in listeMcPresents:regle_active=1
+        if not regle_active : return liste_a_purger
 
+        # Il ne faut pas purger le mot cle present
+        for mc in self.mcs[1:]:
+            if mc in liste_a_purger :
+                liste_a_purger.remove(mc)
+        return liste_a_purger
index f86d86b47013f00f617ec320bdbca59df84f5c3d..e99cf8b604b288e4b68cd37ed18ee4d3464b52b4 100644 (file)
@@ -24,14 +24,12 @@ from __future__ import absolute_import
 from . import I_REGLE
 
 class PRESENT_PRESENT(I_REGLE.REGLE):
-  def verifConditionRegle(self,liste,l_mc_presents):
-    mc0=self.mcs[0]
-    for mc_present in l_mc_presents:
-      if mc_present == mc0 :
-        for mc in self.mcs[1:]:
-          nb = l_mc_presents.count(mc)
-          if nb == 0 : liste.append(mc)
+    def verifConditionRegle(self,liste,l_mc_presents):
+        mc0=self.mcs[0]
+        for mc_present in l_mc_presents:
+            if mc_present == mc0 :
+                for mc in self.mcs[1:]:
+                    nb = l_mc_presents.count(mc)
+                    if nb == 0 : liste.append(mc)
+                return liste
         return liste
-    return liste
-
-
index 823e6c6c9fbdc309681898bd40c6dcee42de4b2e..e4c19768f19ba2ae71f9287ddb50fce323095595 100644 (file)
@@ -30,66 +30,65 @@ from Noyau.N_Exception import AsException
 from Extensions.eficas_exception import EficasException
 
 class PROC_ETAPE(I_ETAPE.ETAPE):
-   def getSdname(self):
-      return ""
+    def getSdname(self):
+        return ""
 
-   def getSdprods(self,nom_sd):
-      """ 
-         Fonction : retourne le concept produit par l etape de nom nom_sd
-         s il existe sinon None
-         Une PROC ne produit aucun concept
-      """
-      return None
+    def getSdprods(self,nom_sd):
+        """
+           Fonction : retourne le concept produit par l etape de nom nom_sd
+           s il existe sinon None
+           Une PROC ne produit aucun concept
+        """
+        return None
 
-   def supprimeSdProds(self):
-      """
-         Fonction: Lors d'une destruction d'etape, detruit tous les concepts produits
-         Une procedure n'en a aucun
-      """
-      return
+    def supprimeSdProds(self):
+        """
+           Fonction: Lors d'une destruction d'etape, detruit tous les concepts produits
+           Une procedure n'en a aucun
+        """
+        return
 
-   def deleteConcept(self,sd):
-      """
-          Fonction : Mettre a jour les mots cles de l etape 
-          suite a la disparition du concept sd
-          Seuls les mots cles simples MCSIMP font un traitement autre
-          que de transmettre aux fils
+    def deleteConcept(self,sd):
+        """
+            Fonction : Mettre a jour les mots cles de l etape
+            suite a la disparition du concept sd
+            Seuls les mots cles simples MCSIMP font un traitement autre
+            que de transmettre aux fils
 
-          Inputs :
-             - sd=concept detruit
-      """
-      for child in self.mcListe :
-        child.deleteConcept(sd)
+            Inputs :
+               - sd=concept detruit
+        """
+        for child in self.mcListe :
+            child.deleteConcept(sd)
 
-   def replaceConcept(self,old_sd,sd):
-      """
-          Fonction : Mettre a jour les mots cles de l etape
-          suite au remplacement du concept old_sd
+    def replaceConcept(self,old_sd,sd):
+        """
+            Fonction : Mettre a jour les mots cles de l etape
+            suite au remplacement du concept old_sd
 
-          Inputs :
-             - old_sd=concept remplace
-             - sd=nouveau concept
-      """
-      for child in self.mcListe :
-        child.replaceConcept(old_sd,sd)
+            Inputs :
+               - old_sd=concept remplace
+               - sd=nouveau concept
+        """
+        for child in self.mcListe :
+            child.replaceConcept(old_sd,sd)
 
 #ATTENTION SURCHARGE: a garder en synchro ou a reintegrer dans le Noyau
-   def buildSd(self):
-      """
-           Methode de Noyau surchargee pour poursuivre malgre tout
-           si une erreur se produit pendant la creation du concept produit
-      """
-      try:
-         sd=Noyau.N_PROC_ETAPE.PROC_ETAPE.buildSd(self)
-      except AsException  :
-         # Une erreur s'est produite lors de la construction du concept
-         # Comme on est dans EFICAS, on essaie de poursuivre quand meme
-         # Si on poursuit, on a le choix entre deux possibilites :
-         # 1. on annule la sd associee a self
-         # 2. on la conserve mais il faut la retourner
-         # En plus il faut rendre coherents sdnom et sd.nom
-         self.sd=None
-         self.sdnom=None
-         self.state="unchanged"
-         self.valid=0
-
+    def buildSd(self):
+        """
+             Methode de Noyau surchargee pour poursuivre malgre tout
+             si une erreur se produit pendant la creation du concept produit
+        """
+        try:
+            sd=Noyau.N_PROC_ETAPE.PROC_ETAPE.buildSd(self)
+        except AsException  :
+            # Une erreur s'est produite lors de la construction du concept
+            # Comme on est dans EFICAS, on essaie de poursuivre quand meme
+            # Si on poursuit, on a le choix entre deux possibilites :
+            # 1. on annule la sd associee a self
+            # 2. on la conserve mais il faut la retourner
+            # En plus il faut rendre coherents sdnom et sd.nom
+            self.sd=None
+            self.sdnom=None
+            self.state="unchanged"
+            self.valid=0
index d2c30f352ae8c267bd03da5891593804e7a424c4..ed43ffb9fe017100b0209fdf3cc4d45c5e130ab5 100644 (file)
@@ -23,28 +23,28 @@ from __future__ import absolute_import
 
 class REGLE:
 
-  def getText(self):
-    text = self.__class__.__name__+ ' :\n'
-    for mc in self.mcs :
-      text = text + '\t' + mc.strip() + '\n'
-    return text
-
-  def purgeListe(self,liste_a_purger,listeMcPresents):
-    """
-         Cette methode doit retirer de la liste liste_a_purger
-         les elements qui ne doivent plus apparaitre en fonction du contexte
-    """
-    # Dans le cas general on ne touche pas a la liste
-    return liste_a_purger
-
-  def hasOperande(self,nom):
-    # On peut faire aussi try:self.mcs.index(nom);return 1;except:return 0
-    for mc in self.mcs:
-      if mc==nom : return 1
-    return 0
-
-  def verifConditionRegle(self,liste,l_mc_presents):
-    return []
+    def getText(self):
+        text = self.__class__.__name__+ ' :\n'
+        for mc in self.mcs :
+            text = text + '\t' + mc.strip() + '\n'
+        return text
+
+    def purgeListe(self,liste_a_purger,listeMcPresents):
+        """
+             Cette methode doit retirer de la liste liste_a_purger
+             les elements qui ne doivent plus apparaitre en fonction du contexte
+        """
+        # Dans le cas general on ne touche pas a la liste
+        return liste_a_purger
+
+    def hasOperande(self,nom):
+        # On peut faire aussi try:self.mcs.index(nom);return 1;except:return 0
+        for mc in self.mcs:
+            if mc==nom : return 1
+        return 0
+
+    def verifConditionRegle(self,liste,l_mc_presents):
+        return []
 
 
 #  def enregistreXML(self,root,catalogueXml):
@@ -52,7 +52,6 @@ class REGLE:
 #      regleXml=ET.SubElement(root,'regles')
 #      txt=""
 #      for mot in self.getText().split('\n'):
-#          mot.replace(' ','') 
+#          mot.replace(' ','')
 #          txt=txt + mot + " "
 #      regleXml.text= txt
-
diff --git a/Ihm/I_TUPLE.py b/Ihm/I_TUPLE.py
new file mode 100644 (file)
index 0000000..519ba37
--- /dev/null
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2007-2021   EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+class I_Matrice:
+    def activeCouleur(self):
+        self.dictCouleurs={}
+        self.indiceCouleur=1
+        self.listeCouleurs=((10, 186, 181),(204, 204, 255),(121, 248, 248),(254, 231, 240),(250, 234, 115), (254, 191, 210),(248, 142, 85),(133, 193, 126),(210, 202, 236),(225, 206, 154), (187, 174, 152),(240, 195, 0),(242, 255, 255),(239, 239, 239),(149, 165, 149), (150, 131, 236),(201, 160, 220),(103, 159, 90),(176, 242, 182),(233, 201, 177))
+
index c5bbf8a18c0105bd82cbefd97885c3948d86cc6d..c44c8529f67dd364dde6b562a8f0af406ee83b4e 100644 (file)
@@ -25,18 +25,17 @@ from . import I_REGLE
 
 class UN_PARMI(I_REGLE.REGLE):
 
-  def purgeListe(self,liste_a_purger,listeMcPresents):
-     regle_active=0
-     for mc_present in listeMcPresents:
-        if mc_present in self.mcs:
-           regle_active=1
-           break
-     if not regle_active : return liste_a_purger
-
-     # Si un des mots cles est present, on les enleve tous
-     # sauf celui ci
-     for mc in self.mcs:
-        if mc in liste_a_purger and mc not in listeMcPresents:
-           liste_a_purger.remove(mc)
-     return liste_a_purger
+    def purgeListe(self,liste_a_purger,listeMcPresents):
+        regle_active=0
+        for mc_present in listeMcPresents:
+            if mc_present in self.mcs:
+                regle_active=1
+                break
+        if not regle_active : return liste_a_purger
 
+        # Si un des mots cles est present, on les enleve tous
+        # sauf celui ci
+        for mc in self.mcs:
+            if mc in liste_a_purger and mc not in listeMcPresents:
+                liste_a_purger.remove(mc)
+        return liste_a_purger
index 3bcd79ac8b60bb5f466c40f3c3701606b038f160..a1e3006c760fee188d9dd1bc5cbb583094dc135d 100644 (file)
@@ -22,20 +22,19 @@ from __future__ import absolute_import
 from Noyau.N_VALIDATOR import *
 
 class Compulsory(Compulsory):
-      def hasInto(self):
-          return 0
-      def valideListePartielle(self,liste_courante=None):
-          return 1
+    def hasInto(self):
+        return 0
+    def valideListePartielle(self,liste_courante=None):
+        return 1
 
 class OrdList(OrdList):
-      def valideListePartielle(self,liste_courante=None):
-          """
-           Methode de validation de liste partielle pour le validateur OrdList
-          """
-          try:
-             self.convert(liste_courante)
-             valid=1
-          except :
-             valid=0
-          return valid
-
+    def valideListePartielle(self,liste_courante=None):
+        """
+         Methode de validation de liste partielle pour le validateur OrdList
+        """
+        try:
+            self.convert(liste_courante)
+            valid=1
+        except :
+            valid=0
+        return valid
diff --git a/InterfaceQT4/aiemonWidgetPlusieursBase.py b/InterfaceQT4/aiemonWidgetPlusieursBase.py
deleted file mode 100644 (file)
index c11d1dc..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2021   EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# Modules Python
-from __future__ import absolute_import
-try :
-   from builtins import str
-   from builtins import range
-   from builtins import object
-except : pass
-
-import types,os,sys
-
-from six.moves import range
-from PyQt5.QtGui     import QIcon 
-from PyQt5.QtWidgets import QApplication, QMessageBox
-from PyQt5.QtCore    import QTimer, QSize, Qt
-
-# Modules Eficas
-from Extensions.i18n import tr
-
-from InterfaceQT4.feuille                import Feuille
-from UiQT5.desWidgetPlusieursBase        import Ui_WidgetPlusieursBase 
-from InterfaceQT4.politiquesValidation   import PolitiquePlusieurs
-from InterfaceQT4.qtSaisie               import SaisieValeur
-from InterfaceQT4.gereListe              import GereListe
-from InterfaceQT4.gereListe              import GerePlie
-from InterfaceQT4.gereListe              import LECustom
-
-dicoLongueur={2:95,3:125,4:154,5:183,6:210,float('inf'):210}
-hauteurMax=253
-
-class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie):
-
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-        #print "MonWidgetPlusieursBase", nom
-        self.inFocusOutEvent=False
-        self.nomLine="lineEditVal"
-        self.inInit=True
-        self.indexDernierLabel=0
-        self.numLineEditEnCours=0
-        self.listeAffichageWidget=[]
-        Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-        GereListe.__init__(self)
-        self.gereIconePlier()
-        self.BSelectFichier.clicked.connect(self.selectInFile)
-
-        if sys.platform[0:5]!="linux":
-          repIcon=self.node.editor.appliEficas.repIcon
-          fichier=os.path.join(repIcon, 'arrow_up.png')
-          icon = QIcon(fichier)
-          self.RBHaut.setIcon(icon)
-          self.RBHaut.setIconSize(QSize(32, 32))
-          fichier2=os.path.join(repIcon, 'arrow_down.png')
-          icon2 = QIcon(fichier2)
-          self.RBBas.setIcon(icon2)
-          fichier3=os.path.join(repIcon, 'file-explorer.png')
-          icon3 = QIcon(fichier2)
-          self.BSelectFichier.setIcon(icon3)
-          self.BSelectFichier.setIconSize(QSize(32, 32))
-        icon=QIcon(self.repIcon+"/MoinsBleu.png")
-        self.RBMoins.setIcon(icon)
-        icon=QIcon(self.repIcon+"/PlusBleu.png")
-        self.RBPlus.setIcon(icon)
-        icon=QIcon(self.repIcon+"/verre-loupe-icone-6087-64.png")
-        self.RBVoisListe.setIcon(icon)
-
-
-        self.listeValeursCourantes=self.node.item.getListeValeurs()
-        if self.monSimpDef.max != "**"  and self.monSimpDef.max < 7: 
-           hauteurMax=dicoLongueur[self.monSimpDef.max]
-        else :
-           hauteurMax=220
-        #   if self.monSimpDef.max == self.monSimpDef.min : self.setMaximumHeight(hauteur)
-        self.resize(self.width(),hauteurMax)
-        self.setMinimumHeight(hauteurMax)
-        self.finCommentaireListe()
-        self.parentQt.commandesLayout.insertWidget(-1,self)
-        self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
-        self.AAfficher=self.lineEditVal1
-        self.inInit=False
-        # PNPN a completer __ si tuple le type des tuples sinon le tuple
-        self.monCommentaireLabel.setText(self.finCommentaireListe())
-
-
-  def setValeurs(self):
-       self.vScrollBar = self.scrollArea.verticalScrollBar()
-       self.politique=PolitiquePlusieurs(self.node,self.editor)
-       # construction du min de valeur a entrer
-       if self.monSimpDef.max == "**"  : aConstruire=7
-       elif self.monSimpDef.max == float('inf'): aConstruire=7
-       else                            : aConstruire=self.monSimpDef.max
-
-       for i in range(1,aConstruire):
-           self.ajoutLineEdit()
-       QApplication.processEvents()
-       self.scrollArea.ensureWidgetVisible(self.lineEditVal1)
-       self.listeValeursCourantes=self.node.item.getListeValeurs()
-       index=1
-       for valeur in self.listeValeursCourantes :
-           val=self.politique.getValeurTexte(valeur)
-           nomLineEdit="lineEditVal"+str(index)
-           if hasattr(self,nomLineEdit) : 
-              courant=getattr(self,nomLineEdit)
-              if 'R' in self.objSimp.definition.type and str(val) != repr(val) :  courant.setText(repr(val))
-              else                     :  courant.setText(str(val))
-           else :
-              self.ajoutLineEdit(val)
-           index=index+1
-       # ajout d'une ligne vide ou affichage commentaire
-       if self.indexDernierLabel < self.monSimpDef.max  : self.ajoutLineEdit()
-       else : self.scrollArea.setToolTip('nb max de valeurs atteint')
-       #self.adjustSize()
-       #self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum)
-       
-
-  def ajoutLineEdit(self,valeur=None,):
-      self.indexDernierLabel=self.indexDernierLabel+1
-      nomLineEdit="lineEditVal"+str(self.indexDernierLabel)
-      if hasattr(self,nomLineEdit) : 
-         self.indexDernierLabel=self.indexDernierLabel-1
-         return
-      nouveauLE = LECustom(self.scrollArea,self,self.indexDernierLabel)
-      self.verticalLayoutLE.insertWidget(self.indexDernierLabel-1,nouveauLE)
-      nouveauLE.setText("")
-      if self.indexDernierLabel % 2 == 1 : nouveauLE.setStyleSheet("background:rgb(210,210,210)")
-      else :                              nouveauLE.setStyleSheet("background:rgb(235,235,235)")
-      nouveauLE.setFrame(False)
-      nouveauLE.returnPressed.connect(self.changeValeur)
-
-      setattr(self,nomLineEdit,nouveauLE)
-      self.listeAffichageWidget.append(nouveauLE)
-      self.etablitOrdre()
-      if valeur != None : nouveauLE.setText(str(valeur))
-      # deux lignes pour que le ensureVisible fonctionne
-      self.estVisible=nouveauLE
-      if self.inInit==False :QTimer.singleShot(1, self.rendVisibleLigne)
-
-  def etablitOrdre(self):
-      i=0
-      while(i +1 < len(self.listeAffichageWidget)):
-         self.listeAffichageWidget[i].setFocusPolicy(Qt.StrongFocus)
-         self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1])
-         i=i+1
-      # si on boucle on perd l'ordre
-
-
-  def rendVisibleLigne(self):
-      QApplication.processEvents()
-      self.estVisible.setFocus()
-      self.scrollArea.ensureWidgetVisible(self.estVisible,0,0)
-      
-
-  def finCommentaire(self):
-      return self.finCommentaireListe()
-
-  def ajout1Valeur(self,valeur=None):
-        if valeur == None : return
-        liste,validite=SaisieValeur.TraiteLEValeur(self,str(valeur))
-        if validite == 0 : return
-        if liste ==[]    : return
-        listeVal=[]
-        for valeur in self.listeValeursCourantes : listeVal.append(valeur)
-        validite,comm,comm2,listeRetour=self.politique.ajoutValeurs(liste,-1,listeVal)
-        if (comm2 != "" and comm != None) : return comm2
-        if validite : 
-           self.listeValeursCourantes=self.listeValeursCourantes+listeRetour
-           if len(self.listeValeursCourantes) > self.monSimpDef.min :
-              self.node.item.setValeur(self.listeValeursCourantes)
-              self.reaffiche()
-           return None
-        else :
-           return(comm2+" "+comm)
-        
-  def reaffiche(self):
-      # A priori, on ne fait rien
-      pass
-
-                
-  def ajoutNValeur(self,liste):
-  #----------------------------
-  # attention quand on charge par un fichier, on ne peut pas se contenter d ajouter N fois 1 valeur
-  # car alors le temps de verification devient prohibitif  reconstructu=ion et verification a 
-  # chaque valeur. d ou l ajout de ajoutNTuple a politique plusieurs
-
-           
-        listeFormatee=list(liste)
-
-        min,max=self.node.item.getMinMax()
-        if self.objSimp.valeur == None : listeComplete=listeFormatee
-        else : listeComplete =self.objSimp.valeur + listeFormatee
-
-        if len(listeComplete) > max : 
-           texte=tr("Nombre maximum de valeurs ")+str(max)+tr(" atteint")
-           self.editor.afficheInfos(texte,Qt.red)
-           return
-
-        validite,comm,comm2,listeRetour= self.politique.ajoutNTuple(listeComplete)
-        if not validite : 
-           self.editor.affiche_infos(texte,Qt.red)
-           return
-
-        # on calcule le dernier lineedit rempli avant de changer la valeur
-        if self.objSimp.valeur != None : indexDernierRempli=len(self.objSimp.valeur)
-        else : indexDernierRempli=0
-
-        self.politique.recordValeur(listeComplete)
-
-        indexDernierRempli=0
-        while ( indexDernierRempli < len(liste) ) :
-         texte=liste[indexDernierRempli]
-         if indexDernierRempli < self.indexDernierLabel:
-            nomLineEdit="lineEditVal"+str(indexDernierRempli+1)
-            courant=getattr(self,nomLineEdit)
-            courant.setText(str(texte))
-         else : 
-            self.ajoutLineEdit(texte)
-         indexDernierRempli = indexDernierRempli + 1
-        
-
-  def changeValeur(self,changeDePlace=True,oblige=False):
-      donneFocus=None
-      derniereValeur=None
-      self.listeValeursCourantes = []
-      fin=self.indexDernierLabel
-      for i in range (1, fin):
-          nomLineEdit="lineEditVal"+str(i)
-          courant=getattr(self,nomLineEdit)
-          valeur=courant.text()
-          lval=valeur.split(',')
-          if len (lval) > 1 : 
-             msgBox=QMessageBox()
-             msgBox.setText("separator ',' ")
-             msgBox.setInformativeText("Do you want to enter " + str (lval) + "?")
-             msgBox.setStandardButtons( QMessageBox.Ok | QMessageBox.Cancel)
-             msgBox.setDefaultButton(QMessageBox.Ok)
-             ret = msgBox.exec_()
-             if ret != 1024 : 
-                courant.setText("") 
-                return
-             courant.setText(lval[0])
-             self.ajoutNValeur(lval[1:])
-             self.listeValeursCourantes = []
-
-      for i in range (1, self.indexDernierLabel+1):
-          nomLineEdit="lineEditVal"+str(i)
-          courant=getattr(self,nomLineEdit)
-          valeur=courant.text()
-          if valeur != None and valeur != "" : 
-             commentaire=self.ajout1Valeur(valeur)
-             if (commentaire != None ):
-                 self.editor.afficheInfos(commentaire,Qt.red)
-                 courant.setText("")
-                 donneFocus=courant
-                 self.reaffiche()
-                 return
-             else :
-                 self.editor.afficheInfos("")
-          elif donneFocus==None : donneFocus=courant
-
-      nomDernierLineEdit="lineEditVal"+str(self.indexDernierLabel)
-      dernier=getattr(self,nomDernierLineEdit)
-      derniereValeur=dernier.text()
-      if changeDePlace:
-         if donneFocus != None : 
-           donneFocus.setFocus()
-           self.scrollArea.ensureWidgetVisible(donneFocus)
-         elif self.indexDernierLabel < self.monSimpDef.max  : 
-           self.ajoutLineEdit()
-      if self.listeValeursCourantes == [] : return
-      min,max = self.node.item.getMinMax()
-      if len(self.listeValeursCourantes) < self.monSimpDef.min  :
-        self.editor.afficheInfos(tr('nb min de valeurs : ')+str( self.monSimpDef.min))
-      if len(self.listeValeursCourantes) < min and oblige==True: return
-      if len(self.listeValeursCourantes) > max : return
-      self.node.item.setValeur(self.listeValeursCourantes)
-      if len(self.listeValeursCourantes) == self.monSimpDef.max  :
-        self.editor.afficheInfos(tr('nb max de valeurs atteint'))
-      self.setValide()
-      self.reaffiche()
-
-          
-
-# Avertissement quand on quitte le widget
diff --git a/InterfaceQT4/bizarreEditorDu5aout.py b/InterfaceQT4/bizarreEditorDu5aout.py
deleted file mode 100644 (file)
index 9ec84ab..0000000
+++ /dev/null
@@ -1,982 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2021   EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-from __future__ import absolute_import
-from __future__ import print_function
-try :
-   from builtins import str
-   from builtins import range
-except : pass
-
-import re
-import types,sys,os
-import traceback
-from . import typeNode
-
-import six
-from six.moves import range
-
-from PyQt5.QtWidgets import QTreeWidget , QTreeWidgetItem, QApplication, QMessageBox
-from PyQt5.QtGui import QIcon
-from PyQt5.QtCore  import Qt
-from Extensions.i18n import tr
-from .gereRegles import GereRegles
-from .monChoixCommande import MonChoixCommande
-
-#------------------------------------------
-class JDCTree( QTreeWidget,GereRegles ):
-#------------------------------------------
-
-    def __init__( self, jdc_item, QWParent):        
-        #if hasattr(QWParent,'widgetTree') : 
-        self.editor       = QWParent
-        self.plie=False
-        if self.editor.widgetTree !=None  :
-           QTreeWidget.__init__(self, self.editor.widgetTree ) 
-           self.editor.verticalLayout_2.addWidget(self)
-           if self.editor.enteteQTree=='complet':
-                 self.headerItem().setText(0,  "Commande   ")
-                 self.headerItem().setText(1, "Concept/Valeur")
-           else :
-                 self.headerItem().setText(0,  "Commande   ")
-           self.setColumnWidth(0,200)
-           self.setExpandsOnDoubleClick(False)
-           self.setSelectionMode(3)
-        else :
-           QTreeWidget.__init__(self, None ) 
-        self.item          = jdc_item
-        self.tree          = self        
-        self.appliEficas   = self.editor.appliEficas
-        self.childrenComplete=[]
-        self.racine=self.item.itemNode(self,self.item)
-        self.itemCourant=None
-
-        self.itemClicked.connect(self.handleOnItem)
-        self.itemCollapsed.connect(self.handleCollapsedItem)
-        self.itemExpanded.connect(self.handleExpandedItem)
-
-        #PNPNPN verifier dans quel cas on se trouve : affiche l arbre ou la commande
-        self.node_selected=self.racine
-        self.inhibeExpand=True
-        self.expandItem(self.racine)
-        self.inhibeExpand=False
-        #print ("self.editor.maConfiguration.afficheCommandesPliees", self.editor.maConfiguration.afficheCommandesPliees)
-        if self.racine.children !=[] :  
-           #self.editor.initSplitterSizes(3)
-           if self.editor.maConfiguration.afficheCommandesPliees : self.racine.children[0].plieToutEtReaffiche()
-           else : self.racine.children[0].deplieToutEtReaffiche()
-           self.racine.children[0].fenetre.donnePremier()
-        else : 
-          #self.editor.initSplitterSizes(2)
-          self.racine.affichePanneau()
-          #print self.editor.splitter.sizes()
-        #PNPNPN
-        #pdb.set_trace()
-
-    def contextMenuEvent(self,event) :
-        #print "contextMenuEvent"
-        coord=event.globalPos()
-        item= self.currentItem()
-        self.handleContextMenu(item,coord)
-
-    def handleContextMenu(self,item,coord):
-        """
-        Private slot to show the context menu of the listview.
-        
-        @param itm the selected listview item (QListWidgetItem)
-        @param coord the position of the mouse pointer (QPoint)
-        Attention : existeMenu permet de savoir si un menu est associe a cet item
-        """
-        #print "handleContextMenu"
-        if item == None : return
-        self.itemCourant=item
-        if item.existeMenu == 0 : return
-        if item.menu == None:
-           item.createPopUpMenu()
-        if item.menu != None:
-           if item.item.getNom() == "DISTRIBUTION" and item.item.isValid() :
-              item.Graphe.setEnabled(1)
-           item.menu.exec_(coord)            
-            
-
-    def handleCollapsedItem(self,item):
-        #print "dans CollapsedItem", self.inhibeExpand  
-        if self.inhibeExpand == True : return
-        self.itemCourant=item
-        # On traite le cas de l item non selectionne
-        itemParent=item
-        while not (hasattr (itemParent,'getPanel')) : 
-           itemParent=itemParent.treeParent 
-        if self.tree.node_selected != itemParent : 
-             item.setExpanded(False)
-             return
-
-        itemParent=item
-        item.setPlie()
-        item.plieToutEtReaffiche()
-        item.select()
-
-    def handleExpandedItem(self,item):
-        #print ("handleExpandedItem pour ", item.item.nom, self.inhibeExpand)
-        #import traceback
-        #traceback.print_stack()
-        if self.inhibeExpand == True : return
-        self.itemCourant=item
-        self.inhibeExpand = True 
-        itemParent=item
-        while not (hasattr (itemParent,'getPanel')) : 
-           if itemParent.plie==True : itemParent.setDeplie()
-           itemParent=itemParent.treeParent 
-        if self.tree.node_selected != itemParent : 
-             item.setExpanded(True)
-             self.inhibeExpand = False 
-             return
-        item.deplieToutEtReaffiche()
-        self.inhibeExpand = False 
-
-
-    def handleOnItem(self,item,int):
-        #print ("je passe dans handleOnItem pour ",self, item.item.nom, item, item.item, item.item.getLabelText())
-        
-        from InterfaceQT4 import composimp
-        self.inhibeExpand = True 
-        self.itemCourant=item
-        itemParent=item
-
-        while not (hasattr (itemParent,'getPanel')) : 
-           if itemParent.plie==True : itemParent.setDeplie()
-           itemParent=itemParent.treeParent 
-
-        if itemParent.fenetre != self.editor.fenetreCentraleAffichee : 
-            estUneFeuille=(isinstance(item,composimp.Node))
-             # il faut afficher le parent
-            if estUneFeuille                        : itemParent.affichePanneau()
-            elif self.editor.maConfiguration.afficheCommandesPliees : itemParent.plieToutEtReafficheSaufItem(item)
-            else                                    : itemParent.affichePanneau()
-
-
-        elif (isinstance(item,composimp.Node)) and item.fenetre : item.fenetre.rendVisible()
-        elif itemParent!=item:
-             self.tree.handleExpandedItem(item)
-             #item.fenetre.donnePremier()
-             #item.fenetre.rendActif()
-             #print 'il faut afficher le 1er'
-
-        try :
-           fr = item.item.getFr()
-           chaineDecoupee= fr.split('\n')
-           if len(chaineDecoupee) > 3 :
-              txt='\n'.join(chaineDecoupee[0:2])+'...\nfull help : double clicked on validity chip of '+ str(item.item.nom)+ ' in central widget'
-           else : txt=fr
-
-           if self.editor: 
-              self.editor.afficheCommentaire(six.text_type(txt))
-        except:
-            pass
-        item.select()
-        self.inhibeExpand = False 
-        #print "je mets inhibeExpand a false handleOnItem"
-
-
-    def choisitPremier(self,name):
-        self.editor.layoutJDCCHOIX.removeWidget(self.racine.fenetre)
-        self.racine.fenetre.close()
-        new_node=self.racine.appendBrother(name,'after')
-# type de noeud
-COMMENT     = "COMMENTAIRE"
-PARAMETERS  = "PARAMETRE"
-#------------------------------------------
-class JDCNode(QTreeWidgetItem,GereRegles):
-#------------------------------------------
-    def __init__( self, treeParent, item, itemExpand=False, ancien=False ):
-        #print ("creation d'un noeud : ", item, " ",item.nom,"", treeParent, self)
-        #self.a=0
-
-
-        self.item        = item
-        self.vraiParent  = treeParent
-        self.treeParent  = treeParent
-        self.tree        = self.treeParent.tree
-        self.editor     = self.treeParent.editor
-        self.appliEficas = treeParent.appliEficas
-        self.JESUISOFF=0
-        self.childrenComplete=[]
-
-                        
-        from InterfaceQT4 import compocomm
-        from InterfaceQT4 import compoparam
-        from InterfaceQT4 import composimp
-        if   (isinstance(self.item,compocomm.COMMTreeItem)) : name=tr("Commentaire")
-        elif (isinstance(self.item,compoparam.PARAMTreeItem)) : name=tr(str(item.getLabelText()[0]))
-        #else:   name  = tr(str(tr(item.getLabelText()[0]))+" :")
-        else:   name  = tr(item.getLabelText()[0])
-        if item.nom != tr(item.nom) : name = str(tr(item.nom)+" :")
-        value = tr(str( item.getText() ) )
-       
-        # si specialisation de la fenetre
-        if self.item.object.definition == None : self.fenetreIhm = None
-           # Cas des listes de mots_clefs 
-        else : self.fenetreIhm = self.item.object.definition.fenetreIhm
-        if self.editor.enteteQTree=='complet':mesColonnes=(name,value)
-        else : mesColonnes=(name,)
-
-        if self.treeParent.plie==True :
-            self.plie        = True
-            self.appartientAUnNoeudPlie=True
-            if self.treeParent.item.isMCList() : self.appartientAUnNoeudPlie =  self.treeParent.appartientAUnNoeudPlie
-        else :
-            self.plie        = False
-            self.appartientAUnNoeudPlie = False
-
-        #if item.nom == "POUTRE" :print "creation d'un noeud : ", item, " ",item.nom,"", self.treeParent, self.appartientAUnNoeudPlie , self.plie
-
-        if ancien and itemExpand     : self.plie = False
-        if ancien and not itemExpand : self.plie = True 
-        if (isinstance(self.item,composimp.SIMPTreeItem)) : self.plie=False
-
-        from InterfaceQT4 import compobloc
-        from InterfaceQT4 import compomclist
-
-        ajoutAuParentduNoeud=0
-        self.treeParent=treeParent
-        while (isinstance(self.treeParent,compobloc.Node) or ( isinstance(self.treeParent,compomclist.Node) and self.treeParent.item.isMCList())) : 
-              self.treeParent.childrenComplete.append(self)
-              self.treeParent=self.treeParent.vraiParent
-        self.treeParent.childrenComplete.append(self)
-
-
-        if (isinstance(self,compobloc.Node) or (isinstance(self,compomclist.Node) and self.item.isMCList()) or ( hasattr(self.item.parent,'inhibeValidator') and isinstance(self,compomclist.Node) and self.item.parent.inhibeValidator)) : 
-        # Le dernier or ne sert que lorsqu'on est en train de creer une liste par les validator
-           QTreeWidgetItem.__init__(self,None,mesColonnes)
-        else :
-           QTreeWidgetItem.__init__(self,self.treeParent,mesColonnes)
-
-        self.setToolTip(0,self.item.getFr())
-        self.setToolTip(1,self.item.getFr())
-        repIcon=self.appliEficas.repIcon
-
-        couleur=self.item.getIconName()
-        monIcone = QIcon(repIcon+"/" + couleur + ".png")
-
-        self.setIcon(0,monIcone)
-
-        self.children = []
-        self.buildChildren()
-        self.menu=None
-        self.existeMenu=1
-
-        self.item.connect("valid",self.onValid,())
-        self.item.connect("supp" ,self.onSupp,())
-        self.item.connect("add"  ,self.onAdd,())
-
-        self.state=""
-        self.fenetre=None
-        try :
-          if self.item.getObject().isBLOC() : 
-                self.setExpanded(True) 
-                self.plie=False
-        except :
-          pass
-
-
-    def buildChildren(self,posInsertion=10000):
-        """ Construit la liste des enfants de self """
-        """ Se charge de remettre les noeuds Expanded dans le meme etat """
-        #print ("*********** buildChildren ",self,self.item, self.item.nom)
-        #print (poum)
-        
-        self.listeItemExpanded=[]
-        self.listeItemPlie=[]
-
-        for enfant in self.childrenComplete :
-            if enfant.plie : self.listeItemPlie.append(enfant.item)
-            else : self.listeItemExpanded.append(enfant.item)
-
-        for enfant in self.childrenComplete :
-            parent=enfant.treeParent
-            parent.removeChild(enfant)
-            enfant.JESUISOFF=1
-         
-        
-        self.children = []
-        self.childrenComplete = []
-        sublist = self.item._getSubList()
-        ind=0
-        
-        for item in sublist :
-            itemExpand=False
-            ancien=False
-            if item in self.listeItemExpanded : itemExpand=True;  ancien=True
-            if item in self.listeItemPlie     : itemExpand=False; ancien=True
-            nouvelItem=item.itemNode(self,item,itemExpand,ancien)
-            self.children.append(nouvelItem)
-
-        #print ("fin *********** buildChildren ",self,self.item, self.item.nom, self.children)
-
-        
-    def chercheNoeudCorrespondant(self,objSimp):
-        sublist = self.item._getSubList()
-        for node in self.childrenComplete:
-            if node.item.object==objSimp : return node
-        return None
-
-
-    def afficheCeNiveau(self):
-        #print ('afficheCeNiveau pour ', self.item.nom, self.item.getLabelText())
-        for indiceWidget in range(self.editor.widgetCentraleLayout.count()):
-            widget=self.editor.widgetCentraleLayout.itemAt(indiceWidget)
-            self.editor.widgetCentraleLayout.removeItem(widget)
-        if self.editor.fenetreCentraleAffichee != None :
-            self.editor.widgetCentraleLayout.removeWidget(self.editor.fenetreCentraleAffichee)
-            self.editor.fenetreCentraleAffichee.setParent(None)
-            self.editor.fenetreCentraleAffichee.close()
-            self.editor.fenetreCentraleAffichee.deleteLater()
-
-        from monWidgetNiveauFact import MonWidgetNiveauFact, MonWidgetNiveauFactTableau
-        maDefinition=self.item.get_definition()
-        monObjet=self.item.object
-        if maDefinition.fenetreIhm=='Tableau' : self.maFenetreCadre=MonWidgetNiveauFactTableau(self,self.editor,maDefinition,monObjet)
-        else : self.maFenetreCadre=MonWidgetNiveauFact(self,self.editor,maDefinition,monObjet)
-        self.fenetre=self.maFenetreCadre
-        self.editor.widgetCentraleLayout.addWidget(self.maFenetreCadre)
-        self.editor.fenetreCentraleAffichee=self.maFenetreCadre
-        self.select()
-        #print ('fin afficheCeNiveau pour ', self.item.nom)
-        
-   
-    def getPanelModifie(self):
-       
-        if self.fenetreIhm == None : return None
-        if self.fenetreIhm=='deplie1Niveau':
-           from InterfaceQT4.monWidgetCommandeDeplie1Niveau import MonWidgetCommandeDeplie1Niveau
-           return MonWidgetCommandeDeplie1Niveau (self,self.editor ,self.item.object)
-        return None
-        
-
-    def affichePanneau(self) :
-        #if self.editor.code == 'ASTER' and not(self.item.isActif()) : 
-        # posera des pb si un code decide d appeler FIN un mot clef
-        # on resoudera a ce moment la
-        # pour l pas de poussiere sous le tapis
-        #print ('_________________ds affichePanneau pour', self.item.nom)
-        if  not(self.item.isActif()) : 
-            from .monWidgetInactif import MonWidgetInactif
-            self.fenetre = MonWidgetInactif(self,self.editor)
-        else:
-           itemParent=self
-           while not (hasattr (itemParent,'getPanel')) : itemParent=itemParent.treeParent 
-           if itemParent!=self : 
-              #print ('j appelle affichePanneau pour ', itemParent.item.nom , 'par', self.item.nom)
-              itemParent.affichePanneau()
-              #print ('fin _________________ds affichePanneau pour', self.item.nom)
-              return
-           self.fenetre=self.getPanelModifie()
-           if self.fenetre == None : self.fenetre=self.getPanel()
-           self.editor.restoreSplitterSizes()
-         
-        for indiceWidget in range(self.editor.widgetCentraleLayout.count()):
-            widget=self.editor.widgetCentraleLayout.itemAt(indiceWidget)
-            self.editor.widgetCentraleLayout.removeItem(widget)
-        # ceinture et bretelle
-        #print 'old fenetre = ',self.editor.fenetreCentraleAffichee
-        if self.editor.fenetreCentraleAffichee != None : 
-            self.editor.widgetCentraleLayout.removeWidget(self.editor.fenetreCentraleAffichee)
-            self.editor.fenetreCentraleAffichee.setParent(None)
-            self.editor.fenetreCentraleAffichee.close()
-            self.editor.fenetreCentraleAffichee.deleteLater()
-
-        self.editor.widgetCentraleLayout.addWidget(self.fenetre)
-        #print ("j ajoute ", self.fenetre, self.fenetre.node.item.nom)
-        self.editor.fenetreCentraleAffichee=self.fenetre
-        self.tree.node_selected= self
-
-        if self.editor.first :
-           if not(isinstance(self.fenetre,MonChoixCommande)): self.editor.first=False
-        self.tree.inhibeExpand=True
-        self.tree.expandItem(self)
-        self.tree.inhibeExpand=False
-        #print( '_________________fin affichePanneau pour', self.item.nom)
-          
-
-    def createPopUpMenu(self):
-        #implemente dans les noeuds derives si necessaire
-        self.existeMenu = 0
-
-    def commentIt(self):
-        """
-        Cette methode a pour but de commentariser la commande pointee par self
-        """
-        # On traite par une exception le cas ou l'utilisateur final cherche a desactiver
-        # (commentariser) un commentaire.
-        try :
-            pos=self.treeParent.children.index(self)
-            commande_comment = self.item.getObjetCommentarise()
-            # On signale a l editeur du panel (le JDCDisplay) une modification
-            self.editor.initModif()
-            self.treeParent.buildChildren()
-            self.treeParent.children[pos].select()
-            self.treeParent.children[pos].affichePanneau()
-        except Exception as e:
-            traceback.print_exc()
-            QMessageBox.critical( self.editor, "TOO BAD",str(e))
-        
-    def unCommentIt(self):
-        """
-        Realise la decommentarisation de self
-        """
-        try :
-            pos=self.treeParent.children.index(self)
-            commande,nom = self.item.unComment()
-            self.editor.initModif()
-            self.treeParent.buildChildren()
-            self.treeParent.children[pos].select()
-            self.treeParent.children[pos].affichePanneau()
-        except Exception as e:
-            QMessageBox.critical( self.editor, "Erreur !",str(e))
-        
-    def addComment( self, after=True ):
-        """
-        Ajoute un commentaire a l'interieur du JDC :
-        """
-        self.editor.initModif()
-        if after:
-            pos = 'after'
-        else:
-            pos = 'before'
-        return self.appendBrother( COMMENT, pos )
-                
-    def addParameters( self, after=True ):
-        """
-        Ajoute un parametre a l'interieur du JDC :
-        """
-        self.editor.initModif()
-        if after: pos = 'after'
-        else: pos = 'before'
-        child=self.appendBrother( PARAMETERS, pos )
-        return  child
-    
-    
-    def select( self ):
-        """
-        Rend le noeud courant (self) selectionne et deselectionne
-        tous les autres
-        """        
-        #print "select pour", self.item.nom
-        for item in self.tree.selectedItems() :
-            item.setSelected(0)
-        self.tree.setCurrentItem( self )    
-                               
-    #------------------------------------------------------------------
-    # Methodes de creation et destruction de noeuds
-    # Certaines de ces methodes peuvent etre appelees depuis l'externe
-    #------------------------------------------------------------------
-    def appendBrother(self,name,pos='after',plier=False):
-        """
-        Permet d'ajouter un objet frere a l'objet associe au noeud self
-        par defaut on l'ajoute immediatement apres 
-        Methode externe
-        """
-        self.editor.initModif()
-
-        from InterfaceQT4 import compojdc
-        if (isinstance(self.treeParent, compojdc.Node)) and not self.verifiePosition(name,pos)  : return 0
-        
-        if self.treeParent != self.vraiParent :
-          index = self.vraiParent.children.index(self)
-          if   pos == 'before': index = index
-          elif pos == 'after': index = index +1
-          return self.vraiParent.appendChild(name,pos=index,plier=plier)
-        else :
-          index = self.treeParent.children.index(self)
-          if   pos == 'before': index = index
-          elif pos == 'after': index = index +1
-          else:
-              print(six.text_type(pos), tr("  n'est pas un index valide pour appendBrother"))
-              return 0
-          return self.treeParent.appendChild(name,pos=index,plier=plier)
-
-    def verifiePosition(self,name,pos,aLaRacine=False):
-        if name not in self.editor.readercata.Classement_Commandes_Ds_Arbre : return True
-        indexName=self.editor.readercata.Classement_Commandes_Ds_Arbre.index(name)
-
-        etapes=self.item.getJdc().etapes
-        if etapes == [] : return True
-
-        if aLaRacine == False :indexOu=etapes.index(self.item.object)
-        else : indexOu=0
-
-        if pos=="after" : indexOu = indexOu+1
-        for e in etapes[:indexOu] :
-            nom=e.nom
-            if nom not in self.editor.readercata.Classement_Commandes_Ds_Arbre : continue
-            indexEtape=self.editor.readercata.Classement_Commandes_Ds_Arbre.index(nom)
-            if indexEtape > indexName :
-               comment=tr('le mot clef ')+name+tr(' doit etre insere avant ')+nom
-               QMessageBox.information( None,tr('insertion impossible'),comment, )
-               return False
-        for e in etapes[indexOu:] :
-            nom=e.nom
-            if nom not in self.editor.readercata.Classement_Commandes_Ds_Arbre : continue
-            indexEtape=self.editor.readercata.Classement_Commandes_Ds_Arbre.index(nom)
-            if indexEtape < indexName :
-               comment=tr('le mot clef ')+name+tr(' doit etre insere apres ')+nom
-               QMessageBox.information( None,tr('insertion impossible'),comment, )
-               return False
-        return True
-
-    def appendChild(self,name,pos=None,plier=False):
-        """
-           Methode pour ajouter un objet fils a l'objet associe au noeud self.
-           On peut l'ajouter en debut de liste (pos='first'), en fin (pos='last')
-           ou en position intermediaire.
-           Si pos vaut None, on le place a la position du catalogue.
-        """
-        #print ("************** appendChild ",self.item.getLabelText(), pos, plier)
-        #import traceback
-        #traceback.print_stack()
-
-         
-        self.editor.initModif()
-        if pos == 'first':
-            index = 0
-        elif pos == 'last':
-            index = len(self.children)
-        elif type(pos) == int :
-            # position fixee
-            index = pos
-        elif type(pos) == types.InstanceType:
-            # pos est un item. Il faut inserer name apres pos
-            index = self.item.getIndex(pos) +1
-        elif type(name) == types.InstanceType:
-            index = self.item.getIndexChild(name.nom)
-        else:
-            index = self.item.getIndexChild(name)
-
-        # si on essaye d inserer a la racine
-        if (isinstance(self.treeParent,JDCTree) and index==0) :
-           verifiePosition=self.verifiePosition(name,'first',aLaRacine=True)
-           if not verifiePosition : return 0
-
-        self.tree.inhibeExpand=True
-        obj=self.item.addItem(name,index) # emet le signal 'add'
-        if obj is None:obj=0
-        if obj == 0:return 0
-        try :
-        #if 1 :
-           child=self.children[index]
-           if plier == True : child.setPlie()
-           else             : child.setDeplie() 
-        except :
-           child=self.children[index]
-        try : 
-           if len(obj) > 1 : self.buildChildren()
-        except : pass
-        self.tree.inhibeExpand=False
-        #print (" fin append child")
-        return child
-
-    def deplace(self):
-        self.editor.initModif()
-        index = self.treeParent.children.index(self) - 1 
-        if index < 0 : index =0
-        ret=self.treeParent.item.deplaceEntite(self.item.getObject())
-
-    def delete(self):
-        """ 
-            Methode externe pour la destruction de l'objet associe au noeud
-        """
-        self.editor.initModif()
-        index = self.vraiParent.children.index(self) - 1 
-        if index < 0 : index =0
-        recalcule=0
-        if self.item.nom == "VARIABLE" :
-           recalcule=1
-           jdc=self.item.jdc
-        ret,commentaire=self.vraiParent.item.suppItem(self.item)
-        if ret==0 :
-          self.editor.afficheInfos(commentaire,Qt.red)
-        else :
-          self.editor.afficheInfos(commentaire)
-        self.treeParent.buildChildren()
-        if self.treeParent.childrenComplete : toselect=self.treeParent.childrenComplete[index]
-        else: toselect=self.treeParent
-        if recalcule : jdc.recalculeEtatCorrelation()
-        if ret==0 :
-            if self.treeParent.childrenComplete :
-                notdeleted=self.treeParent.childrenComplete[index+1]
-                notdeleted.select()
-        else :
-            toselect.select()
-        from InterfaceQT4 import compojdc
-        # cas ou on detruit dans l arbre sans affichage
-        if isinstance(self.treeParent,compojdc.Node) : 
-           toselect.affichePanneau()
-        else :
-           if self.treeParent.fenetre== None : return
-           #print "J appelle reaffiche de browser apres delete"
-           self.treeParent.fenetre.reaffiche(toselect)
-
-    def deleteMultiple(self,liste=()):
-        """ 
-            Methode externe pour la destruction d une liste de noeud
-        """
-        from InterfaceQT4 import compojdc 
-        self.editor.initModif()
-        index=9999
-        recalcule=0
-        jdc=self.treeParent
-        parentPosition=jdc
-        while not(isinstance(jdc,compojdc.Node)):
-              jdc=jdc.treeParent
-        for noeud in liste :
-            if not( isinstance(noeud.treeParent, compojdc.Node)): continue
-            if noeud.item.nom == "VARIABLE" : recalcule=1
-            if noeud.treeParent.children.index(noeud) < index : index=noeud.treeParent.children.index(noeud)
-        if index < 0 : index =0
-
-        # Cas ou on detruit dans une ETape
-        if index == 9999 : 
-              parentPosition=self.treeParent
-              while not(isinstance(parentPosition, compojdc.Node)):
-                 index=parentPosition.treeParent.children.index(parentPosition)
-                 parentPosition=parentPosition.treeParent
-
-        for noeud in liste:
-            noeud.treeParent.item.suppItem(noeud.item)
-
-        jdc.buildChildren()
-        if recalcule : jdc.recalculeEtatCorrelation()
-        try    : toselect=parentPosition.children[index]
-        except : toselect=jdc
-        toselect.select()
-        toselect.affichePanneau()
-#        
-#    #------------------------------------------------------------------
-    def onValid(self):        
-
-        #print ("onValid pour ", self.item.nom)
-        if self.JESUISOFF==1 : return
-        if hasattr(self,'fenetre') and self.fenetre: 
-           try :
-             self.fenetre.setValide()
-           except :
-            # print "onValid pour ", self.item.nom, self,'pb'
-            pass
-
-        if (self.item.nom == "VARIABLE" or self.item.nom == "DISTRIBUTION") and self.item.isValid():
-           self.item.jdc.recalculeEtatCorrelation()
-        if hasattr(self.item,'forceRecalcul'):
-           self.forceRecalculChildren(self.item.forceRecalcul)
-        self.editor.initModif()
-        
-        self.updateNodeValid()
-        self.updateNodeLabel()
-        self.updateNodeTexte()
-
-    def onAdd(self,object):
-        if self.JESUISOFF==1 : return
-        #print "onAdd pour ", self.item.nom, object.nom
-        self.editor.initModif()
-        self.updateNodes()
-        # PN -- non necessaire si item=jdc
-        if hasattr(self.item,'jdc'): self.item.jdc.aReafficher=True
-    def onSupp(self,object):
-        if self.JESUISOFF==1 : return
-        #print "onSup pour ", self.item.nom, object.nom
-        self.editor.initModif()
-        self.updateNodes()
-        # PN -- non necessaire si item=jdc
-        if hasattr(self.item,'jdc'): self.item.jdc.aReafficher=True
-         
-
-
-    def updateNodeValid(self):
-        """Cette methode remet a jour la validite du noeud (icone)
-           Elle appelle isValid
-        """
-        repIcon=self.appliEficas.repIcon
-        couleur=self.item.getIconName()
-        monIcone = QIcon(repIcon+"/" + couleur + ".png")
-        self.setIcon(0,monIcone)
-
-
-
-    def updateNodeLabel(self):
-        """ Met a jour le label du noeud """
-        #print "NODE updateNodeLabel", self.item.getLabelText()
-        labeltext,fonte,couleur = self.item.getLabelText()
-        # PNPN a reflechir
-        self.setText(0, labeltext)        
-    
-    def updateNodeLabelInBlack(self):
-        if hasattr(self.appliEficas,'noeudColore'): 
-            self.appliEficas.noeudColore.setForeground(0,Qt.black)
-            self.appliEficas.noeudColore.updateNodeLabel
-    
-    def updateNodeLabelInBlue(self):
-        if hasattr(self.appliEficas,'noeudColore'): self.appliEficas.noeudColore.setForeground(0,Qt.black)
-        self.setForeground(0,Qt.blue)
-        labeltext,fonte,couleur = self.item.getLabelText()
-        self.setText(0, labeltext)        
-        self.appliEficas.noeudColore=self
-
-    def updatePlusieursNodeLabelInBlue(self,liste):
-        if hasattr(self.appliEficas,'listeNoeudsColores'):
-           for noeud in self.appliEficas.listeNoeudsColores:
-               noeud.setTextColor( 0,Qt.black)
-               noeud.updateNodeLabel()
-        self.appliEficas.listeNoeudsColores=[]
-        for noeud in liste :
-            noeud.setTextColor( 0,Qt.blue )
-            labeltext,fonte,couleur = noeud.item.getLabelText()
-            noeud.setText(0, labeltext)        
-            self.appliEficas.listeNoeudsColores.append(noeud)
-
-    def updateNodeTexteInBlack(self):
-        """ Met a jour les noms des SD et valeurs des mots-cles """
-        self.setTextColor( 1,Qt.black )
-        value = self.item.getText()
-        self.setText(1, value)
-
-    def updateNodeTexte(self):
-        """ Met a jour les noms des SD et valeurs des mots-cles """
-        value = self.item.getText()
-        self.setText(1, value)
-        
-
-    def updateNodeTexteInBlue(self):
-        self.setTextColor( 1,Qt.blue )
-        value = self.item.getText()
-        self.setText(1, value)
-
-    def updateNodes(self):
-        #print 'NODE updateNodes', self.item.getLabelText()
-        self.buildChildren()
-
-    def updateValid(self) :
-        """Cette methode a pour but de mettre a jour la validite du noeud
-           et de propager la demande de mise a jour a son parent
-        """
-        #print "NODE updateValid", self.item.getLabelText()
-        self.updateNodeValid()
-        try :
-          self.treeParent.updateValid()
-        except:
-          pass
-            
-    def updateTexte(self):
-        """ Met a jour les noms des SD et valeurs des mots-cles """
-        #print "NODE updateTexte", self.item.getLabelText()
-        self.updateNodeVexte()
-        if self.isExpanded() :
-            for child in self.children:
-                if child.isHidden() == false : child.updateTexte()
-
-
-    def forceRecalculChildren(self,niveau):
-        if self.state=='recalcule' : 
-           self.state=""
-           return
-        self.state='recalcule'
-        if hasattr(self.item,'object'):
-           self.item.object.state="modified"
-        for child in self.children:
-           if niveau > 0 : child.forceRecalculChildren(niveau - 1)
-              
-        
-
-    def doPaste(self,node_selected,pos='after'):
-        """
-            Declenche la copie de l'objet item avec pour cible
-            l'objet passe en argument : node_selected
-        """
-        objet_a_copier = self.item.getCopieObjet()
-        child=node_selected.doPasteCommande(objet_a_copier,pos)
-        if self.editor.fenetreCentraleAffichee : self.editor.fenetreCentraleAffichee.node.affichePanneau()
-        self.updateNodeLabelInBlack()
-        return child
-
-    def doPasteCommande(self,objet_a_copier,pos='after'):
-        """
-          Realise la copie de l'objet passe en argument qui est necessairement
-          un onjet
-        """
-        child=None
-        try :
-        #if 1 :
-          child = self.appendBrother(objet_a_copier,pos)
-        except :
-           pass
-        return child
-
-    def doPastePremier(self,objet_a_copier):
-        """
-           Realise la copie de l'objet passe en argument (objet_a_copier)
-        """
-        objet = objet_a_copier.item.getCopieObjet()
-        child = self.appendChild(objet,pos='first')
-        return child
-
-    def plieToutEtReafficheSaufItem(self, itemADeplier):
-        self.inhibeExpand=True
-        from InterfaceQT4 import compojdc
-        if (isinstance(self, compojdc.Node)) :
-            self.affichePanneau()
-            self.inhibeExpand=False
-            return 
-        self.editor.deplier = False
-        for item in self.children :
-            # il ne faut pas plier les blocs 
-            from InterfaceQT4 import compobloc
-            if (isinstance(item,compobloc.Node)) : continue
-            item.setPlie()
-            if item==itemADeplier : 
-                  itemADeplier.setDeplie()
-        self.affichePanneau()
-        self.inhibeExpand=False
-
-    def plieToutEtReaffiche(self):
-        #print ('plieToutEtReaffiche', self.item.getNom())
-        from InterfaceQT4 import compojdc
-        if (isinstance(self, compojdc.Node)) : self.affichePanneau(); return 
-        self.inhibeExpand=True
-        self.editor.deplier = False
-        for item in self.children :
-            # il ne faut pas plier les blocs 
-            from InterfaceQT4 import compobloc
-            if (isinstance(item,compobloc.Node)) : continue
-            item.setPlie()
-        self.affichePanneau()
-        #print ("fin plieToutEtReaffiche", self.item.getNom())
-
-    def deplieToutEtReaffiche(self):
-        self.editor.deplier = True
-        for item in self.children :
-            item.setDeplie()
-        self.affichePanneau()
-
-    def setPlie(self):
-        #print "je mets inhibeExpand a true dans setPlie"
-        #print ("je suis dans plieTout", self.item.getNom())
-        from . import compojdc
-        if self.fenetre == self.editor.fenetreCentraleAffichee  and isinstance(self.treeParent,compojdc.Node): 
-           return
-        self.tree.inhibeExpand=True
-        self.tree.collapseItem(self)
-        self.setPlieChildren()
-        self.tree.inhibeExpand=False
-        #print "je mets inhibeExpand a false dans setPlie"
-
-
-        # on ne plie pas au niveau 1
-        #   self.plie=False
-        #   for item in self.children :
-        #       item.appartientAUnNoeudPlie=False
-
-    def setPlieChildren(self):
-        self.plie=True
-        from InterfaceQT4 import composimp
-        if isinstance(self,composimp.Node) : return
-        for c in self.children :
-            c.setPlieChildren()
-            #print "dans setPlieChildren appartientAUnNoeudPlie=True ", c, c.item.getLabelText()[0]
-            c.appartientAUnNoeudPlie=True
-            c.plie=True
-            #print "dans setPlieChildren plie", c.item.nom
-            #  01/2018 PNPN : boucle sur MT __ La ligne suivante ne me semble pas necessaire
-            #if not (isinstance(c,composimp.Node)) :c.setExpanded(False)
-
-        # Pour les blocs et les motcles list
-        # on affiche un niveau de plus
-        from InterfaceQT4 import compobloc
-        from InterfaceQT4 import compomclist
-        if (isinstance(self,compobloc.Node) or ( isinstance(self,compomclist.Node) and self.item.isMCList())) : 
-            niveauPere=self.treeParent
-            while (isinstance(niveauPere,compobloc.Node) or (isinstance(niveauPere,compomclist.Node) and niveauPere.item.isMCList())) : 
-               niveauPere=niveauPere.treeParent
-            for c in self.children :
-                c.appartientAUnNoeudPlie=niveauPere.appartientAUnNoeudPlie
-                #print ("dans setPlieChildren appartientAUnNoeudPlie=True ", c, c.item.getLabelText()[0], "mis a la valeur ", niveauPere.appartientAUnNoeudPlie)
-                c.setExpanded(False)
-
-
-    def setDeplie(self):
-        #print "dans setPlieChildren pour", self.item.nom
-        #print "je mets inhibeExpand a true dans setDeplie"
-        self.tree.inhibeExpand=True
-        self.plie=False
-        self.tree.expandItem(self)
-        self.setDeplieChildren()
-        self.tree.inhibeExpand=False
-        #print "je mets inhibeExpand a false dans setDePlie"
-
-    def setDeplieChildren(self):
-        #print "dans setDeplieChildren appartientAUnNoeudPlie=False ", self.item.getLabelText()
-        for c in self.children :
-            c.setDeplieChildren()
-            #print "dans setDeplieChildren ", c.item.nom
-            c.appartientAUnNoeudPlie=False
-            c.setExpanded(True)
-            c.plie=False
-       
-    def selectAvant(self):
-        i=self.item.jdc.etapes.index(self.item.object)
-        try :
-           cherche=self.item.jdc.etapes[i-1]
-        except :
-           cherche=self.item.jdc.etapes[-1]
-        node=None
-        for i in self.tree.racine.children :
-            if i.item.object== cherche  : 
-               node=i
-               break
-        if node : 
-          node.affichePanneau()
-          node.select()
-
-    def selectApres(self):
-        i=self.item.jdc.etapes.index(self.item.object)
-        try :
-           cherche=self.item.jdc.etapes[i+1]
-        except :
-           cherche=self.item.jdc.etapes[0]
-        node=None
-        for i in self.tree.racine.children :
-            if i.item.object== cherche  : 
-               node=i
-               break
-        if node : 
-           node.affichePanneau()
-           node.select()
-
-    def ouvreLesNoeudsDsLArbre(self):
-        return
-        self.inhibeExpand = True 
-        for i in range(self.childCount()):
-            self.child(i).inhibeExpand=True
-            self.child(i).setExpanded(True)
-            self.child(i).ouvreLesNoeudsDsLArbre()
-            self.child(i).inhibeExpand=False
-        self.inhibeExpand = False 
index faa4fc964a7b61daeb97eae0cf562be806c775ea..512c55b28f1471f81b9fa242f97ec6c6679e96e4 100644 (file)
@@ -21,8 +21,8 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 
 import re
@@ -43,29 +43,29 @@ from .monChoixCommande import MonChoixCommande
 class JDCTree( QTreeWidget,GereRegles ):
 #------------------------------------------
 
-    def __init__( self, jdc_item, QWParent):        
+    def __init__( self, jdc_item, QWParent):
     #----------------------------------------
         self.editor      = QWParent
         self.plie=False
         if self.editor.widgetTree !=None  :
-           QTreeWidget.__init__(self, self.editor.widgetTree ) 
-           self.editor.verticalLayout_2.addWidget(self)
-           if self.editor.enteteQTree=='complet':
-                 self.headerItem().setText(0, "Commande   ")
-                 self.headerItem().setText(1, "Concept/Valeur")
-           else :
-                 self.headerItem().setText(0, "Commande   ")
-           self.setColumnWidth(0,200)
-           self.setExpandsOnDoubleClick(False)
-           self.setSelectionMode(3)
+            QTreeWidget.__init__(self, self.editor.widgetTree )
+            self.editor.verticalLayout_2.addWidget(self)
+            if self.editor.enteteQTree=='complet':
+                self.headerItem().setText(0, "Commande   ")
+                self.headerItem().setText(1, "Concept/Valeur")
+            else :
+                self.headerItem().setText(0, "Commande   ")
+            self.setColumnWidth(0,200)
+            self.setExpandsOnDoubleClick(False)
+            self.setSelectionMode(3)
         else :
-           QTreeWidget.__init__(self, None ) 
+            QTreeWidget.__init__(self, None )
         self.item          = jdc_item
-        self.tree          = self        
+        self.tree          = self
         self.appliEficas   = self.editor.appliEficas
         self.childrenComplete=[]
         self.racine=self.item.itemNode(self,self.item)
+
         self.itemCourant=None
 
         self.itemClicked.connect(self.handleOnItem)
@@ -76,12 +76,12 @@ class JDCTree( QTreeWidget,GereRegles ):
         self.inhibeExpand  =  True
         self.expandItem(self.racine)
         self.inhibeExpand = False
-        if self.racine.children !=[] :  
-           if self.editor.maConfiguration.afficheCommandesPliees : self.racine.children[0].plieToutEtReaffiche()
-           else                                                  : self.racine.children[0].deplieToutEtReaffiche()
-           self.racine.children[0].fenetre.donnePremier()
-        else : 
-          self.racine.affichePanneau()
+        if self.racine.children !=[] :
+            if self.editor.maConfiguration.afficheCommandesPliees : self.racine.children[0].plieToutEtReaffiche()
+            else                                                  : self.racine.children[0].deplieToutEtReaffiche()
+            self.racine.children[0].fenetre.donnePremier()
+        else :
+            self.racine.affichePanneau()
 
     def contextMenuEvent(self,event) :
     #---------------------------------
@@ -93,7 +93,7 @@ class JDCTree( QTreeWidget,GereRegles ):
     #-------------------------------------
         """
         Private slot to show the context menu of the listview.
-        
+
         @param itm the selected listview item (QListWidgetItem)
         @param coord the position of the mouse pointer (QPoint)
         Attention : existeMenu permet de savoir si un menu est associe a cet item
@@ -104,13 +104,13 @@ class JDCTree( QTreeWidget,GereRegles ):
         if item.existeMenu == 0 : return
 
         if item.menu == None:
-           item.createPopUpMenu()
+            item.createPopUpMenu()
         # PNPN reflechir a qqchose de generique pour remplacer cette fonctionnalite
-        if item.menu != None:
-           if item.item.getNom() == "DISTRIBUTION" and item.item.isValid() :
-              item.Graphe.setEnabled(1)
-           item.menu.exec_(coord)            
-            
+        #if item.menu != None:
+        #   if item.item.getNom() == "DISTRIBUTION" and item.item.isValid() :
+        #      item.Graphe.setEnabled(1)
+        #   item.menu.exec_(coord)
+
 
     def handleCollapsedItem(self,item):
     #----------------------------------
@@ -120,10 +120,10 @@ class JDCTree( QTreeWidget,GereRegles ):
         # On traite le cas de l item non selectionne
         self.itemCourant = item
         itemParent = item
-        while not (hasattr (itemParent,'getPanel')) : itemParent=itemParent.treeParent 
-        if self.tree.node_selected != itemParent : 
-             item.setExpanded(False)
-             return
+        while not (hasattr (itemParent,'getPanel')) : itemParent=itemParent.treeParent
+        if self.tree.node_selected != itemParent :
+            item.setExpanded(False)
+            return
 
         item.setPlie()
         item.plieToutEtReaffiche()
@@ -137,49 +137,45 @@ class JDCTree( QTreeWidget,GereRegles ):
         if self.inhibeExpand == True : return
 
         self.itemCourant  = item
-        self.inhibeExpand = True 
+        self.inhibeExpand = True
         itemParent = item
-        while not (hasattr (itemParent,'getPanel')) : 
-           if itemParent.plie==True : itemParent.setDeplie()
-           itemParent=itemParent.treeParent 
-        if self.tree.node_selected != itemParent : 
-             item.setExpanded(True)
-             self.inhibeExpand = False 
-             return
+        while not (hasattr (itemParent,'getPanel')) :
+            if itemParent.plie==True : itemParent.setDeplie()
+            itemParent=itemParent.treeParent
+        if self.tree.node_selected != itemParent :
+            item.setExpanded(True)
+            self.inhibeExpand = False
+            return
         item.deplieToutEtReaffiche()
-        self.inhibeExpand = False 
+        self.inhibeExpand = False
 
 
     def handleOnItem(self,item,int):
     #----------------------------------
         #print ("je passe dans handleOnItem pour ",self, item.item.nom, item, item.item, item.item.getLabelText())
-        
+
         from InterfaceQT4 import composimp
-        self.inhibeExpand = True 
+        self.inhibeExpand = True
         self.itemCourant  = item
         itemParent        = item
         itemAvant         = item
+        # PN : 22 juil 2021 --> bizarre ce itemAvant Verifier le while
+        while not (hasattr (itemParent,'getPanel')) :
+            if itemParent.plie==True : itemParent.setDeplie()
+            itemAvant=itemParent
+            itemParent=itemParent.treeParent
 
-        while not (hasattr (itemParent,'getPanel')) : 
-           if itemParent.plie==True : itemParent.setDeplie()
-           itemAvant=itemParent
-           itemParent=itemParent.treeParent 
-
-        if itemParent.fenetre != self.editor.fenetreCentraleAffichee : 
+        if itemParent.fenetre != self.editor.fenetreCentraleAffichee :
             estUneFeuille=(isinstance(item,composimp.Node))
             # il faut afficher le parent
             # Attention - Specification particuliere pour MT qui permet de nn afficher qu 1 niveau
             # le catalogue contient cette indication dans fenetreIhm
-            #if estUneFeuille and itemParent.fenetreIhm=='deplie1Niveau' : 
-            #   itemAvant.afficheCeNiveau()
-            #   return
-            #if estUneFeuille                        : itemParent.affichePanneau()
-            if itemParent.fenetreIhm == 'deplie1Niveau' :
-               if item == itemParent : itemParent.affichePanneau()
-               else                  : itemAvant.afficheCeNiveau()
-            elif estUneFeuille       : itemParent.affichePanneau()
+            if estUneFeuille and itemParent.fenetreIhm=='deplie1Niveau' :
+                itemAvant.afficheCeNiveau()
+                return
+            if estUneFeuille                        : itemParent.affichePanneau()
             elif self.editor.maConfiguration.afficheCommandesPliees : itemParent.plieToutEtReafficheSaufItem(item)
-            else                     : itemParent.affichePanneau()
+            else                                    : itemParent.affichePanneau()
 
 
         elif (isinstance(item,composimp.Node)) and item.fenetre : item.fenetre.rendVisible()
@@ -187,17 +183,17 @@ class JDCTree( QTreeWidget,GereRegles ):
 
         # aide
         try :
-           fr = item.item.getFr()
-           chaineDecoupee= fr.split('\n')
-           if len(chaineDecoupee) > 3 :
-              txt='\n'.join(chaineDecoupee[0:2])+'...\nfull help : double clicked on validity chip of '+ str(item.item.nom)+ ' in central widget'
-           else : txt=fr
-           if self.editor: self.editor.afficheCommentaire(str(txt))
+            fr = item.item.getFr()
+            chaineDecoupee= fr.split('\n')
+            if len(chaineDecoupee) > 3 :
+                txt='\n'.join(chaineDecoupee[0:2])+'...\nfull help : double clicked on validity chip of '+ str(item.item.nom)+ ' in central widget'
+            else : txt=fr
+            if self.editor: self.editor.afficheCommentaire(str(txt))
         except:
             pass
 
         item.select()
-        self.inhibeExpand = False 
+        self.inhibeExpand = False
 
 
     def choisitPremier(self,name):
@@ -205,11 +201,11 @@ class JDCTree( QTreeWidget,GereRegles ):
         self.editor.layoutJDCCHOIX.removeWidget(self.racine.fenetre)
         self.racine.fenetre.close()
         new_node=self.racine.appendBrother(name,'after')
+
 # type de noeud
 COMMENT     = "COMMENTAIRE"
 PARAMETERS  = "PARAMETRE"
+
 #------------------------------------------
 class JDCNode(QTreeWidgetItem,GereRegles):
 #------------------------------------------
@@ -229,7 +225,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         self.firstAffiche = True
         self.childrenComplete=[]
 
-                        
+
         from InterfaceQT4 import compocomm
         from InterfaceQT4 import compoparam
         from InterfaceQT4 import composimp
@@ -238,12 +234,12 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         else                                                  : name = tr(item.getLabelText()[0])
         if item.nom != tr(item.nom)                           : name = str(tr(item.nom)+" :")
         value = tr(str(item.getText() ) )
-       
+
         # si specialisation de la fenetre
         if self.item.object.definition == None : self.fenetreIhm = None
-           # Cas des listes de mots_clefs 
+            # Cas des listes de mots_clefs
         else : self.fenetreIhm = self.item.object.definition.fenetreIhm
+
         if self.editor.enteteQTree=='complet':mesColonnes=(name,value)
         else : mesColonnes=(name,)
 
@@ -258,7 +254,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         #if item.nom == "POUTRE" :print "creation d'un noeud : ", item, " ",item.nom,"", self.treeParent, self.appartientAUnNoeudPlie , self.plie
 
         if ancien and itemExpand     : self.plie = False
-        if ancien and not itemExpand : self.plie = True 
+        if ancien and not itemExpand : self.plie = True
         if (isinstance(self.item,composimp.SIMPTreeItem)) : self.plie=False
 
         from InterfaceQT4 import compobloc
@@ -266,17 +262,17 @@ class JDCNode(QTreeWidgetItem,GereRegles):
 
         ajoutAuParentduNoeud=0
         self.treeParent=treeParent
-        while (isinstance(self.treeParent,compobloc.Node) or ( isinstance(self.treeParent,compomclist.Node) and self.treeParent.item.isMCList())) : 
-              self.treeParent.childrenComplete.append(self)
-              self.treeParent=self.treeParent.vraiParent
+        while (isinstance(self.treeParent,compobloc.Node) or ( isinstance(self.treeParent,compomclist.Node) and self.treeParent.item.isMCList())) :
+            self.treeParent.childrenComplete.append(self)
+            self.treeParent=self.treeParent.vraiParent
         self.treeParent.childrenComplete.append(self)
 
 
-        if (isinstance(self,compobloc.Node) or (isinstance(self,compomclist.Node) and self.item.isMCList()) or ( hasattr(self.item.parent,'inhibeValidator') and isinstance(self,compomclist.Node) and self.item.parent.inhibeValidator)) : 
+        if (isinstance(self,compobloc.Node) or (isinstance(self,compomclist.Node) and self.item.isMCList()) or ( hasattr(self.item.parent,'inhibeValidator') and isinstance(self,compomclist.Node) and self.item.parent.inhibeValidator)) :
         # Le dernier or ne sert que lorsqu'on est en train de creer une liste par les validator
-           QTreeWidgetItem.__init__(self,None,mesColonnes)
+            QTreeWidgetItem.__init__(self,None,mesColonnes)
         else :
-           QTreeWidgetItem.__init__(self,self.treeParent,mesColonnes)
+            QTreeWidgetItem.__init__(self,self.treeParent,mesColonnes)
 
         self.setToolTip(0,self.item.getFr())
         self.setToolTip(1,self.item.getFr())
@@ -300,11 +296,11 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         self.state=""
         self.fenetre=None
         try :
-          if self.item.getObject().isBLOC() : 
-                self.setExpanded(True) 
+            if self.item.getObject().isBLOC() :
+                self.setExpanded(True)
                 self.plie=False
         except :
-          pass
+            pass
 
 
     def buildChildren(self,posInsertion=10000):
@@ -313,7 +309,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         """ Se charge de remettre les noeuds Expanded dans le meme etat """
         #print ("*********** buildChildren ",self,self.item, self.item.nom)
         #print (poum)
-        
+
         self.listeItemExpanded=[]
         self.listeItemPlie=[]
 
@@ -325,13 +321,13 @@ class JDCNode(QTreeWidgetItem,GereRegles):
             parent = enfant.treeParent
             parent.removeChild(enfant)
             enfant.JESUISOFF=1
-         
-        
+
+
         self.children = []
         self.childrenComplete = []
         sublist = self.item._getSubList()
         ind=0
-        
+
         for item in sublist :
             itemExpand=False
             ancien=False
@@ -342,7 +338,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
 
         #print ("fin *********** buildChildren ",self,self.item, self.item.nom, self.children)
 
-        
+
     def chercheNoeudCorrespondant(self,objSimp):
     #-------------------------------------------
         sublist = self.item._getSubList()
@@ -368,58 +364,58 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         monObjet     = self.item.object
         if maDefinition.fenetreIhm=='Tableau' : self.maFenetreCadre=MonWidgetNiveauFactTableau(self,self.editor,maDefinition,monObjet)
         else : self.maFenetreCadre=MonWidgetNiveauFact(self,self.editor,maDefinition,monObjet)
-        
+
         self.fenetre = self.maFenetreCadre
         self.editor.widgetCentraleLayout.addWidget(self.maFenetreCadre)
         self.editor.fenetreCentraleAffichee=self.maFenetreCadre
         self.select()
         #print ('fin afficheCeNiveau pour ', self.item.nom)
-        
-   
+
+
     def getPanelModifie(self):
     #-------------------------
-       
+
         if self.fenetreIhm == None : return None
         if self.fenetreIhm =='deplie1Niveau':
-           from InterfaceQT4.monWidgetCommandeDeplie1Niveau import MonWidgetCommandeDeplie1Niveau
-           return MonWidgetCommandeDeplie1Niveau (self,self.editor ,self.item.object)
+            from InterfaceQT4.monWidgetCommandeDeplie1Niveau import MonWidgetCommandeDeplie1Niveau
+            return MonWidgetCommandeDeplie1Niveau (self,self.editor ,self.item.object)
         return None
-        
+
 
     def affichePanneau(self) :
     #-------------------------
         #print ('_________________ds affichePanneau pour', self.item.nom)
         # pour l instant pas d inactif
-        if  not(self.item.isActif()) : 
+        if  not(self.item.isActif()) :
             from .monWidgetInactif import MonWidgetInactif
             self.fenetre = MonWidgetInactif(self,self.editor)
         else:
-           itemParent=self
-           while not (hasattr (itemParent,'getPanel')) : itemParent=itemParent.treeParent 
-           if itemParent != self : 
-              #print ('j appelle affichePanneau pour ', itemParent.item.nom , 'par', self.item.nom)
-              itemParent.affichePanneau()
-              #print ('fin _________________ds affichePanneau pour', self.item.nom)
-              return
-
-           self.fenetre = self.getPanelModifie()
-           if self.fenetre == None : self.fenetre=self.getPanel()
-           self.editor.restoreSplitterSizes()
-         
+            itemParent=self
+            while not (hasattr (itemParent,'getPanel')) : itemParent=itemParent.treeParent
+            if itemParent != self :
+            #print ('j appelle affichePanneau pour ', itemParent.item.nom , 'par', self.item.nom)
+                itemParent.affichePanneau()
+                #print ('fin _________________ds affichePanneau pour', self.item.nom)
+                return
+
+            self.fenetre = self.getPanelModifie()
+            if self.fenetre == None : self.fenetre=self.getPanel()
+            self.editor.restoreSplitterSizes()
+
         for indiceWidget in range(self.editor.widgetCentraleLayout.count()):
             widget = self.editor.widgetCentraleLayout.itemAt(indiceWidget)
             self.editor.widgetCentraleLayout.removeItem(widget)
 
         # ceinture et bretelle
         #print 'old fenetre = ',self.editor.fenetreCentraleAffichee
-        if self.editor.fenetreCentraleAffichee != None : 
+        if self.editor.fenetreCentraleAffichee != None :
             try :
-              self.editor.widgetCentraleLayout.removeWidget(self.editor.fenetreCentraleAffichee)
-              self.editor.fenetreCentraleAffichee.setParent(None)
-              self.editor.fenetreCentraleAffichee.close()
-              self.editor.fenetreCentraleAffichee.deleteLater()
+                self.editor.widgetCentraleLayout.removeWidget(self.editor.fenetreCentraleAffichee)
+                self.editor.fenetreCentraleAffichee.setParent(None)
+                self.editor.fenetreCentraleAffichee.close()
+                self.editor.fenetreCentraleAffichee.deleteLater()
             except :
-              pass
+                pass
 
         self.editor.widgetCentraleLayout.addWidget(self.fenetre)
         #print ("j ajoute ", self.fenetre, self.fenetre.node.item.nom)
@@ -427,12 +423,12 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         self.tree.node_selected= self
 
         if self.editor.first :
-           if not(isinstance(self.fenetre,MonChoixCommande)): self.editor.first=False
+            if not(isinstance(self.fenetre,MonChoixCommande)): self.editor.first=False
         self.tree.inhibeExpand=True
         self.tree.expandItem(self)
         self.tree.inhibeExpand=False
         #print( '_________________fin affichePanneau pour', self.item.nom)
-          
+
 
     def createPopUpMenu(self):
     #-------------------------
@@ -457,7 +453,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         except Exception as e:
             traceback.print_exc()
             QMessageBox.critical( self.editor, "TOO BAD",str(e))
-        
+
     def unCommentIt(self):
     #-------------------------
         """
@@ -472,7 +468,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
             self.treeParent.children[pos].affichePanneau()
         except Exception as e:
             QMessageBox.critical( self.editor, "Erreur !",str(e))
-        
+
     def addComment( self, after=True ):
     #-----------------------------------
         """
@@ -484,7 +480,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         else:
             pos = 'before'
         return self.appendBrother( COMMENT, pos )
-                
+
     def addParameters( self, after=True ):
     #-------------------------------------
         """
@@ -495,19 +491,19 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         else: pos = 'before'
         child=self.appendBrother( PARAMETERS, pos )
         return  child
-    
-    
+
+
     def select( self ):
     #------------------
         """
         Rend le noeud courant (self) selectionne et deselectionne
         tous les autres
-        """        
+        """
         #print "select pour", self.item.nom
         for item in self.tree.selectedItems() :
             item.setSelected(0)
-        self.tree.setCurrentItem( self )    
-                               
+        self.tree.setCurrentItem( self )
+
     #------------------------------------------------------------------
     # Methodes de creation et destruction de noeuds
     #------------------------------------------------------------------
@@ -516,27 +512,27 @@ class JDCNode(QTreeWidgetItem,GereRegles):
     #----------------------------------------------------
         """
         Permet d'ajouter un objet frere a l'objet associe au noeud self
-        par defaut on l'ajoute immediatement apres 
+        par defaut on l'ajoute immediatement apres
         Methode externe
         """
         self.editor.initModif()
 
         from InterfaceQT4 import compojdc
         if (isinstance(self.treeParent, compojdc.Node)) and not self.verifiePosition(name,pos)  : return 0
-        
+
         if self.treeParent != self.vraiParent :
-          index = self.vraiParent.children.index(self)
-          if   pos == 'before' : index = index
-          elif pos == 'after'  : index = index +1
-          return self.vraiParent.appendChild(name,pos=index,plier=plier)
+            index = self.vraiParent.children.index(self)
+            if   pos == 'before' : index = index
+            elif pos == 'after'  : index = index +1
+            return self.vraiParent.appendChild(name,pos=index,plier=plier)
         else :
-          index = self.treeParent.children.index(self)
-          if   pos == 'before': index = index
-          elif pos == 'after' : index = index +1
-          else:
-              print(pos, tr("  n'est pas un index valide pour appendBrother"))
-              return 0
-          return self.treeParent.appendChild(name,pos=index,plier=plier)
+            index = self.treeParent.children.index(self)
+            if   pos == 'before': index = index
+            elif pos == 'after' : index = index +1
+            else:
+                print(pos, tr("  n'est pas un index valide pour appendBrother"))
+                return 0
+            return self.treeParent.appendChild(name,pos=index,plier=plier)
 
     def verifiePosition(self,name,pos,aLaRacine=False):
     #----------------------------------------------------
@@ -555,17 +551,17 @@ class JDCNode(QTreeWidgetItem,GereRegles):
             if nom not in self.editor.readercata.Classement_Commandes_Ds_Arbre : continue
             indexEtape=self.editor.readercata.Classement_Commandes_Ds_Arbre.index(nom)
             if indexEtape > indexName :
-               comment=tr('le mot clef ')+name+tr(' doit etre insere avant ')+nom
-               QMessageBox.information( None,tr('insertion impossible'),comment, )
-               return False
+                comment=tr('le mot clef ')+name+tr(' doit etre insere avant ')+nom
+                QMessageBox.information( None,tr('insertion impossible'),comment, )
+                return False
         for e in etapes[indexOu:] :
             nom=e.nom
             if nom not in self.editor.readercata.Classement_Commandes_Ds_Arbre : continue
             indexEtape=self.editor.readercata.Classement_Commandes_Ds_Arbre.index(nom)
             if indexEtape < indexName :
-               comment=tr('le mot clef ')+name+tr(' doit etre insere apres ')+nom
-               QMessageBox.information( None,tr('insertion impossible'),comment, )
-               return False
+                comment=tr('le mot clef ')+name+tr(' doit etre insere apres ')+nom
+                QMessageBox.information( None,tr('insertion impossible'),comment, )
+                return False
         return True
 
     def appendChild(self,name,pos=None,plier=False):
@@ -580,7 +576,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         #import traceback
         #traceback.print_stack()
 
-         
+
         self.editor.initModif()
         if   pos == 'first'       : index = 0
         elif pos == 'last'        : index = len(self.children)
@@ -591,8 +587,8 @@ class JDCNode(QTreeWidgetItem,GereRegles):
 
         # si on essaye d inserer a la racine
         if (isinstance(self.treeParent,JDCTree) and index==0) :
-           verifiePosition=self.verifiePosition(name,'first',aLaRacine=True)
-           if not verifiePosition : return 0
+            verifiePosition=self.verifiePosition(name,'first',aLaRacine=True)
+            if not verifiePosition : return 0
 
         self.tree.inhibeExpand = True
         obj = self.item.addItem(name,index) # emet le signal 'add'
@@ -601,14 +597,14 @@ class JDCNode(QTreeWidgetItem,GereRegles):
 
         try :
         #if 1 :
-           child = self.children[index]
-           if plier == True : child.setPlie()
-           else             : child.setDeplie() 
+            child = self.children[index]
+            if plier == True : child.setPlie()
+            else             : child.setDeplie()
         except :
-           child=self.children[index]
+            child=self.children[index]
 
-        try : 
-           if len(obj) > 1 : self.buildChildren()
+        try :
+            if len(obj) > 1 : self.buildChildren()
         except : pass
 
         self.tree.inhibeExpand=False
@@ -618,23 +614,23 @@ class JDCNode(QTreeWidgetItem,GereRegles):
     def deplace(self):
     #-----------------
         self.editor.initModif()
-        index = self.treeParent.children.index(self) - 1 
+        index = self.treeParent.children.index(self) - 1
         if index < 0 : index =0
         ret=self.treeParent.item.deplaceEntite(self.item.getObject())
 
     def delete(self):
     #----------------
-        """ 
+        """
             Methode externe pour la destruction de l'objet associe au noeud
         """
         self.editor.initModif()
-        index = self.vraiParent.children.index(self) - 1 
+        index = self.vraiParent.children.index(self) - 1
         if index < 0 : index =0
 
         recalcule=0
         if self.item.nom == "VARIABLE" :
-           recalcule=1
-           jdc=self.item.jdc
+            recalcule=1
+            jdc=self.item.jdc
 
         ret,commentaire=self.vraiParent.item.suppItem(self.item)
         if ret==0 : self.editor.afficheInfos(commentaire,Qt.red)
@@ -653,26 +649,26 @@ class JDCNode(QTreeWidgetItem,GereRegles):
 
         from InterfaceQT4 import compojdc
         # cas ou on detruit dans l arbre sans affichage
-        if isinstance(self.treeParent,compojdc.Node) : 
-           toselect.affichePanneau()
+        if isinstance(self.treeParent,compojdc.Node) :
+            toselect.affichePanneau()
         else :
-           if self.treeParent.fenetre== None : return
-           #print "J appelle reaffiche de browser apres delete"
-           self.treeParent.fenetre.reaffiche(toselect)
+            if self.treeParent.fenetre== None : return
+            #print "J appelle reaffiche de browser apres delete"
+            self.treeParent.fenetre.reaffiche(toselect)
 
     def deleteMultiple(self,liste=()):
     #--------------------------------
-        """ 
+        """
             Methode externe pour la destruction d une liste de noeud
         """
-        from InterfaceQT4 import compojdc 
+        from InterfaceQT4 import compojdc
         self.editor.initModif()
         index=9999
         recalcule=0
         jdc=self.treeParent
         parentPosition=jdc
         while not(isinstance(jdc,compojdc.Node)):
-              jdc=jdc.treeParent
+            jdc=jdc.treeParent
         for noeud in liste :
             if not( isinstance(noeud.treeParent, compojdc.Node)): continue
             if noeud.item.nom == "VARIABLE" : recalcule=1
@@ -680,11 +676,11 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         if index < 0 : index =0
 
         # Cas ou on detruit dans une ETape
-        if index == 9999 : 
-              parentPosition=self.treeParent
-              while not(isinstance(parentPosition, compojdc.Node)):
-                 index=parentPosition.treeParent.children.index(parentPosition)
-                 parentPosition=parentPosition.treeParent
+        if index == 9999 :
+            parentPosition=self.treeParent
+            while not(isinstance(parentPosition, compojdc.Node)):
+                index=parentPosition.treeParent.children.index(parentPosition)
+                parentPosition=parentPosition.treeParent
 
         for noeud in liste:
             noeud.treeParent.item.suppItem(noeud.item)
@@ -695,24 +691,24 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         except : toselect=jdc
         toselect.select()
         toselect.affichePanneau()
-#        
+#
 #    ------------------------------------------------------------------
 
-    def onValid(self):        
+    def onValid(self):
     #-----------------
         #print ("onValid pour ", self.item.nom)
         if self.JESUISOFF==1 : return
 
-        if hasattr(self,'fenetre') and self.fenetre: 
-           try : self.fenetre.setValide()
-           except : pass
+        if hasattr(self,'fenetre') and self.fenetre:
+            try : self.fenetre.setValide()
+            except : pass
 
         # PNPN  lignes suivantes a repenser
         if (self.item.nom == "VARIABLE" or self.item.nom == "DISTRIBUTION") and self.item.isValid():
             self.item.jdc.recalculeEtatCorrelation()
         if hasattr(self.item,'forceRecalcul') : self.forceRecalculChildren(self.item.forceRecalcul)
         self.editor.initModif()
-        
+
         self.updateNodeValid()
         self.updateNodeLabel()
         self.updateNodeTexte()
@@ -725,7 +721,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         self.editor.initModif()
         self.updateNodes()
         if hasattr(self.item,'jdc'): self.item.jdc.aReafficher=True
+
     def onSupp(self,object):
     #-----------------------
         #print ("onSup pour ", self.item.nom, object)
@@ -735,13 +731,11 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         self.editor.initModif()
         self.updateNodes()
         if hasattr(self.item,'jdc'): self.item.jdc.aReafficher=True
-         
+
     def onRedessine(self):
     #---------------------
-        print ('dans redessine pour', self)
-        self.updateNodeTexte()
-        #if not(self.fenetre): return
-        # a priori l objet C++ n est plus la si la fenetre n est pas visible
+        #print ('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!je passe dans onRedessine pour', self.item.nom)
+        self.affichePanneau()
 
     def updateNodeValid(self):
     #-----------------------
@@ -763,34 +757,34 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         # PNPN a reflechir
         if self.item.nom != tr(self.item.nom) : labeltext = str(tr(self.item.nom)+" :")
         self.setText(0, tr(labeltext))
-    
+
     def updateNodeLabelInBlack(self):
     #-------------------------------
-        if hasattr(self.appliEficas,'noeudColore'): 
+        if hasattr(self.appliEficas,'noeudColore'):
             self.appliEficas.noeudColore.setForeground(0,Qt.black)
             self.appliEficas.noeudColore.updateNodeLabel
-    
+
     def updateNodeLabelInBlue(self):
     #-------------------------------
         if hasattr(self.appliEficas,'noeudColore'): self.appliEficas.noeudColore.setForeground(0,Qt.black)
         self.setForeground(0,Qt.blue)
         labeltext,fonte,couleur = self.item.getLabelText()
         if self.item.nom != tr(self.item.nom) : labeltext = str(tr(self.item.nom)+" :")
-        self.setText(0, labeltext)        
+        self.setText(0, labeltext)
         self.appliEficas.noeudColore=self
 
     def updatePlusieursNodeLabelInBlue(self,liste):
     #----------------------------------------------
         if hasattr(self.appliEficas,'listeNoeudsColores'):
-           for noeud in self.appliEficas.listeNoeudsColores:
-               noeud.setTextColor( 0,Qt.black)
-               noeud.updateNodeLabel()
+            for noeud in self.appliEficas.listeNoeudsColores:
+                noeud.setTextColor( 0,Qt.black)
+                noeud.updateNodeLabel()
         self.appliEficas.listeNoeudsColores=[]
         for noeud in liste :
             noeud.setTextColor( 0,Qt.blue )
             if item.nom != tr(item.nom) : labeltext = str(tr(item.nom)+" :")
             labeltext,fonte,couleur = noeud.item.getLabelText()
-            noeud.setText(0, labeltext)        
+            noeud.setText(0, labeltext)
             self.appliEficas.listeNoeudsColores.append(noeud)
 
     def updateNodeTexteInBlack(self):
@@ -805,7 +799,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         """ Met a jour les noms des SD et valeurs des mots-cles """
         value = self.item.getText()
         self.setText(1, value)
-        
+
 
     def updateNodeTexteInBlue(self):
     #--------------------------------
@@ -827,7 +821,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         self.updateNodeValid()
         try   : self.treeParent.updateValid()
         except: pass
-            
+
     def updateTexte(self):
     #----------------------
         """ Met a jour les noms des SD et valeurs des mots-cles """
@@ -840,16 +834,16 @@ class JDCNode(QTreeWidgetItem,GereRegles):
 
     def forceRecalculChildren(self,niveau):
     #--------------------------------------
-        if self.state == 'recalcule' : 
-           self.state = ""
-           return
+        if self.state == 'recalcule' :
+            self.state = ""
+            return
         self.state='recalcule'
         if hasattr(self.item,'object'):
-           self.item.object.state="modified"
+            self.item.object.state="modified"
         for child in self.children:
-           if niveau > 0 : child.forceRecalculChildren(niveau - 1)
-              
-        
+            if niveau > 0 : child.forceRecalculChildren(niveau - 1)
+
+
 
     def doPaste(self,node_selected,pos='after'):
     #--------------------------------------------
@@ -872,9 +866,9 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         child=None
         try :
         #if 1 :
-          child = self.appendBrother(objet_a_copier,pos)
+            child = self.appendBrother(objet_a_copier,pos)
         except :
-           pass
+            pass
         return child
 
     def doPastePremier(self,objet_a_copier):
@@ -893,15 +887,15 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         if (isinstance(self, compojdc.Node)) :
             self.affichePanneau()
             self.inhibeExpand=False
-            return 
+            return
         self.editor.deplier = False
         for item in self.children :
-            # il ne faut pas plier les blocs 
+            # il ne faut pas plier les blocs
             from InterfaceQT4 import compobloc
             if (isinstance(item,compobloc.Node)) : continue
             item.setPlie()
-            if item==itemADeplier : 
-                  itemADeplier.setDeplie()
+            if item==itemADeplier :
+                itemADeplier.setDeplie()
         self.affichePanneau()
         self.inhibeExpand=False
 
@@ -909,11 +903,11 @@ class JDCNode(QTreeWidgetItem,GereRegles):
     #-----------------------------
         #print ('plieToutEtReaffiche', self.item.getNom())
         from InterfaceQT4 import compojdc
-        if (isinstance(self, compojdc.Node)) : self.affichePanneau(); return 
+        if (isinstance(self, compojdc.Node)) : self.affichePanneau(); return
         self.inhibeExpand=True
         self.editor.deplier = False
         for item in self.children :
-            # il ne faut pas plier les blocs 
+            # il ne faut pas plier les blocs
             from InterfaceQT4 import compobloc
             if (isinstance(item,compobloc.Node)) : continue
             item.setPlie()
@@ -932,8 +926,8 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         #print "je mets inhibeExpand a true dans setPlie"
         #print ("je suis dans plieTout", self.item.getNom())
         from . import compojdc
-        if self.fenetre == self.editor.fenetreCentraleAffichee  and isinstance(self.treeParent,compojdc.Node): 
-           return
+        if self.fenetre == self.editor.fenetreCentraleAffichee  and isinstance(self.treeParent,compojdc.Node):
+            return
         self.tree.inhibeExpand=True
         self.tree.collapseItem(self)
         self.setPlieChildren()
@@ -964,10 +958,10 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         # on affiche un niveau de plus
         from InterfaceQT4 import compobloc
         from InterfaceQT4 import compomclist
-        if (isinstance(self,compobloc.Node) or ( isinstance(self,compomclist.Node) and self.item.isMCList())) : 
+        if (isinstance(self,compobloc.Node) or ( isinstance(self,compomclist.Node) and self.item.isMCList())) :
             niveauPere=self.treeParent
-            while (isinstance(niveauPere,compobloc.Node) or (isinstance(niveauPere,compomclist.Node) and niveauPere.item.isMCList())) : 
-               niveauPere=niveauPere.treeParent
+            while (isinstance(niveauPere,compobloc.Node) or (isinstance(niveauPere,compomclist.Node) and niveauPere.item.isMCList())) :
+                niveauPere=niveauPere.treeParent
             for c in self.children :
                 c.appartientAUnNoeudPlie=niveauPere.appartientAUnNoeudPlie
                 #print ("dans setPlieChildren appartientAUnNoeudPlie=True ", c, c.item.getLabelText()[0], "mis a la valeur ", niveauPere.appartientAUnNoeudPlie)
@@ -994,7 +988,7 @@ class JDCNode(QTreeWidgetItem,GereRegles):
             c.appartientAUnNoeudPlie=False
             c.setExpanded(True)
             c.plie=False
-       
+
     def selectAvant(self):
     #-----------------------------
         i=self.item.jdc.etapes.index(self.item.object)
@@ -1002,12 +996,12 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         except : cherche=self.item.jdc.etapes[-1]
         node=None
         for i in self.tree.racine.children :
-            if i.item.object== cherche  : 
-               node=i
-               break
-        if node : 
-          node.affichePanneau()
-          node.select()
+            if i.item.object== cherche  :
+                node=i
+                break
+        if node :
+            node.affichePanneau()
+            node.select()
 
     def selectApres(self):
     #---------------------
@@ -1016,10 +1010,9 @@ class JDCNode(QTreeWidgetItem,GereRegles):
         except : cherche=self.item.jdc.etapes[0]
         node=None
         for i in self.tree.racine.children :
-            if i.item.object== cherche  : 
-               node=i
-               break
-        if node : 
-           node.affichePanneau()
-           node.select()
-
+            if i.item.object== cherche  :
+                node=i
+                break
+        if node :
+            node.affichePanneau()
+            node.select()
index 96feead9c5f74b0c5d19a1ba17a4c7f68495002c..d0235243110ac4e20495521f08d304df70e09545 100644 (file)
@@ -28,7 +28,7 @@ from . import typeNode
 
 
 class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal):
-        
+
 
     def createPopUpMenu(self):
         typeNode.PopUpMenuNodeMinimal.createPopUpMenu(self)
@@ -46,12 +46,12 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal):
 
 
 class BLOCTreeItem(compofact.FACTTreeItem):
-  itemNode=Node
+    itemNode=Node
 
-  def isCopiable(self):
-    return 0
+    def isCopiable(self):
+        return 0
 
 
 import Accas
 treeitem = BLOCTreeItem
-objet = Accas.MCBLOC   
+objet = Accas.MCBLOC
index fbfc5afc66c665544eb697550647e90d15e1b4ae..f5a0c6552cc37acd71cbb1f9681f1f774c5cf657 100644 (file)
@@ -43,7 +43,7 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel):
         self.Decommente.setStatusTip(tr("Decommente la commande "))
 
         if hasattr(self.item,'unComment'):
-           self.menu.addAction(self.Decommente)
+            self.menu.addAction(self.Decommente)
 
     def decommenter(self) :
         item= self.tree.currentItem()
@@ -55,20 +55,20 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel):
         debComm=self.item.getText()
         self.setText(1,tr(debComm))
 
-    
+
 class COMMTreeItem(Objecttreeitem.ObjectTreeItem):
-    itemNode=Node    
+    itemNode=Node
 
     def init(self):
-      self.setFunction = self.setValeur
+        self.setFunction = self.setValeur
 
     def getIconName(self):
-      """
-      Retourne le nom de l'icone associee au noeud qui porte self,
-      dependant de la validite de l'objet
-      NB : un commentaire est toujours valide ...
-      """
-      return "ast-white-percent"
+        """
+        Retourne le nom de l'icone associee au noeud qui porte self,
+        dependant de la validite de l'objet
+        NB : un commentaire est toujours valide ...
+        """
+        return "ast-white-percent"
 
     def getLabelText(self):
         """ Retourne 3 valeurs :
@@ -79,11 +79,11 @@ class COMMTreeItem(Objecttreeitem.ObjectTreeItem):
         return tr('Commentaire'),None,None
 
     def getValeur(self):
-      """
-      Retourne la valeur de l'objet Commentaire cad son texte
-      """
-      return self.object.getValeur() or ''
-    
+        """
+        Retourne la valeur de l'objet Commentaire cad son texte
+        """
+        return self.object.getValeur() or ''
+
     def getText(self):
         texte = self.object.valeur
         texte = texte.split('\n')[0]
@@ -93,26 +93,26 @@ class COMMTreeItem(Objecttreeitem.ObjectTreeItem):
             return texte[0:24]
 
     def setValeur(self,valeur):
-      """
-      Affecte valeur a l'objet COMMENTAIRE
-      """
-      self.object.setValeur(valeur)
-      
+        """
+        Affecte valeur a l'objet COMMENTAIRE
+        """
+        self.object.setValeur(valeur)
+
     def getSubList(self):
-      """
-      Retourne la liste des fils de self
-      """
-      return []
+        """
+        Retourne la liste des fils de self
+        """
+        return []
 
 
     def getObjetCommentarise(self):
-       """
-           La methode getObjetCommentarise() de la classe compocomm.COMMTreeItem
-           surcharge la methode getObjetCommentarise de la classe Objecttreeitem.ObjectTreeItem
-           elle a pour but d'empecher l'utilisateur final de commentariser un commentaire.
-       """
-       raise EficasException( 'Impossible de commentariser un commentaire' )
-  
+        """
+            La methode getObjetCommentarise() de la classe compocomm.COMMTreeItem
+            surcharge la methode getObjetCommentarise de la classe Objecttreeitem.ObjectTreeItem
+            elle a pour but d'empecher l'utilisateur final de commentariser un commentaire.
+        """
+        raise EficasException( 'Impossible de commentariser un commentaire' )
+
 import Extensions
 treeitem =COMMTreeItem
-objet = Extensions.commentaire.COMMENTAIRE    
+objet = Extensions.commentaire.COMMENTAIRE
index 068f6a818d9a631476de2b0feef3c311e476aaa1..a6ac1686e83e0312d5330ab02fd79476c18aec17 100644 (file)
@@ -28,18 +28,18 @@ class COMMANDE_COMMTreeItem(Objecttreeitem.ObjectTreeItem):
     itemNode=compocomm.Node
 
     def init(self):
-      self.setFunction = self.setValeur
+        self.setFunction = self.setValeur
 
     def getIconName(self):
-      """
-      Retourne le nom de l'icone associee au noeud qui porte self,
-      dependant de la validite de l'objet
-      NB : une commande commentarisee est toujours valide ...
-      """
-      if self.isValid():
-          return "ast-green-percent"
-      else:
-          return "ast-red-percent"
+        """
+        Retourne le nom de l'icone associee au noeud qui porte self,
+        dependant de la validite de l'objet
+        NB : une commande commentarisee est toujours valide ...
+        """
+        if self.isValid():
+            return "ast-green-percent"
+        else:
+            return "ast-red-percent"
 
     def getLabelText(self):
         """ Retourne 3 valeurs :
@@ -50,11 +50,11 @@ class COMMANDE_COMMTreeItem(Objecttreeitem.ObjectTreeItem):
         return 'commentaire'
 
     def getValeur(self):
-      """
-      Retourne la valeur de la commande commentarisee cad son texte
-      """
-      return self.object.getValeur() or ''
-    
+        """
+        Retourne la valeur de la commande commentarisee cad son texte
+        """
+        return self.object.getValeur() or ''
+
     def getText(self):
         texte = self.object.valeur
         texte = texte.split('\n')[0]
@@ -64,31 +64,31 @@ class COMMANDE_COMMTreeItem(Objecttreeitem.ObjectTreeItem):
             return texte[0:24]
 
     def setValeur(self,valeur):
-      """
-      Afefcte valeur a l'objet commande commentarisee
-      """
-      self.object.setValeur(valeur)
-      
+        """
+        Afefcte valeur a l'objet commande commentarisee
+        """
+        self.object.setValeur(valeur)
+
     def getSubList(self):
-      """
-      Retourne la liste des fils de self
-      """
-      return []
+        """
+        Retourne la liste des fils de self
+        """
+        return []
 
     def unComment(self):
-      """
-      Demande a l'objet commande commentarisee de se decommentariser.
-      Si l'operation s'effectue correctement, retourne l'objet commande
-      et eventuellement le nom de la sd produite, sinon leve une exception
-      """
-      try:
-        commande,nom = self.object.unComment()
-        #self.parent.children[pos].select()
-      except Exception as e:
-        traceback.print_exc()
-        raise EficasException(e)
-      return commande,nom
-  
+        """
+        Demande a l'objet commande commentarisee de se decommentariser.
+        Si l'operation s'effectue correctement, retourne l'objet commande
+        et eventuellement le nom de la sd produite, sinon leve une exception
+        """
+        try:
+            commande,nom = self.object.unComment()
+            #self.parent.children[pos].select()
+        except Exception as e:
+            traceback.print_exc()
+            raise EficasException(e)
+        return commande,nom
+
 import Accas
 treeitem =COMMANDE_COMMTreeItem
-objet = Accas.COMMANDE_COMM    
+objet = Accas.COMMANDE_COMM
index 4c9c032f037d5f79b5ab8013f19c77a62ca9f517..0f5c93ed28913ac7cb0679439fde8bcc35154f99 100644 (file)
@@ -38,17 +38,17 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel):
         maCommande=commande
         if hasattr(parentQt,'niveau'): self.niveau=parentQt.niveau+1
         else : self.niveau=1
-        if  hasattr(self,'plie') and self.plie==True : 
-           from InterfaceQT4.monWidgetFactPlie import MonWidgetFactPlie
-           widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
-        elif self.editor.maConfiguration.afficheFirstPlies and self.firstAffiche: 
-           self.firstAffiche = False
-           self.setPlie()
-           from InterfaceQT4.monWidgetFactPlie import MonWidgetFactPlie
-           widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
+        if  hasattr(self,'plie') and self.plie==True :
+            from InterfaceQT4.monWidgetFactPlie import MonWidgetFactPlie
+            widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
+        elif self.editor.maConfiguration.afficheFirstPlies and self.firstAffiche:
+            self.firstAffiche = False
+            self.setPlie()
+            from InterfaceQT4.monWidgetFactPlie import MonWidgetFactPlie
+            widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
         else:
-           from InterfaceQT4.monWidgetFact import MonWidgetFact
-           widget=MonWidgetFact(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
+            from InterfaceQT4.monWidgetFact import MonWidgetFact
+            widget=MonWidgetFact(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
         return widget
 
 
@@ -58,95 +58,95 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel):
 
 
 class FACTTreeItem(Objecttreeitem.ObjectTreeItem):
-  itemNode=Node
-  
-  def isExpandable(self):
-  # ----------------------
-    return 1
-
-  def getText(self):
-  # ----------------
-      return  ''
-
-  def getLabelText(self):
-  # ----------------------
-      """ Retourne 3 valeurs :
-        - le texte Ã  afficher dans le noeud representant l'item
-        - la fonte dans laquelle afficher ce texte
-        - la couleur du texte
-      """
-      # None --> fonte et couleur par defaut
-      if not(hasattr(self.object,'getLabelText')): return self.object.nom,None,None
-      return self.object.getLabelText(),None,None
-
-  def isValid(self):
-  # ----------------
-    return self.object.isValid()
-
-  def isCopiable(self):
-  # ----------------
-    return 1
-
-  def getIconName(self):
-  # ----------------
-    if self.object.isValid()  : return "ast-green-los"
-    elif self.object.isOblig(): return "ast-red-los"
-    else                      : return "ast-yel-los"
-
-  #PNPN ????
-  #def keys(self):
-  #  keys=self.object.mc_dict
-  #  return keys
-
-  def getSubList(self):
-  # ----------------
-      """
-         Reactualise la liste des items fils stockes dans self.sublist
-      """
-      liste=self.object.mcListe
-      sublist=[None]*len(liste)
-      # suppression des items lies aux objets disparus
-      for item in self.sublist:
-         old_obj=item.getObject()
-         if old_obj in liste:
-            pos=liste.index(old_obj)
-            sublist[pos]=item
-         else:
-            pass # objets supprimes ignores
-      # ajout des items lies aux nouveaux objets
-      pos=0
-      for obj in liste:
-         if sublist[pos] is None:
-            # nouvel objet : on cree un nouvel item
-            def setFunction(value, object=obj):
-                object.setval(value)
-            item = self.makeObjecttreeitem(self.appliEficas, obj.nom + " : ", obj, setFunction)
-            sublist[pos]=item
-         pos=pos+1
-
-      self.sublist=sublist
-      return self.sublist
-
-  def addItem(self,name,pos):
-    objet = self.object.addEntite(name,pos)
-    return objet
-
-  def suppItem(self,item) :
-      """ 
-         Cette methode a pour fonction de supprimer l'item passee en argument
-         des fils de l'item FACT qui est son pere
-           - item = item du MOCLE a supprimer du MOCLE pere
-           - item.getObject() = MCSIMP ou MCBLOC 
-      """
-      itemobject=item.getObject()
-      if itemobject.isOblig() :
-         return (0, tr('Impossible de supprimer un mot-cle obligatoire '))
-
-      if self.object.suppEntite(itemobject):
-         message = tr("Mot-cle %s supprime")+ itemobject.nom
-         return (1, message)
-      else:
-         return (0,tr('Pb interne : impossible de supprimer ce mot-cle'))
+    itemNode=Node
+
+    def isExpandable(self):
+    # ----------------------
+        return 1
+
+    def getText(self):
+    # ----------------
+        return  ''
+
+    def getLabelText(self):
+    # ----------------------
+        """ Retourne 3 valeurs :
+          - le texte Ã  afficher dans le noeud representant l'item
+          - la fonte dans laquelle afficher ce texte
+          - la couleur du texte
+        """
+        # None --> fonte et couleur par defaut
+        if not(hasattr(self.object,'getLabelText')): return self.object.nom,None,None
+        return self.object.getLabelText(),None,None
+
+    def isValid(self):
+    # ----------------
+        return self.object.isValid()
+
+    def isCopiable(self):
+    # ----------------
+        return 1
+
+    def getIconName(self):
+    # ----------------
+        if self.object.isValid()  : return "ast-green-los"
+        elif self.object.isOblig(): return "ast-red-los"
+        else                      : return "ast-yel-los"
+
+    #PNPN ????
+    #def keys(self):
+    #  keys=self.object.mc_dict
+    #  return keys
+
+    def getSubList(self):
+    # ----------------
+        """
+           Reactualise la liste des items fils stockes dans self.sublist
+        """
+        liste=self.object.mcListe
+        sublist=[None]*len(liste)
+        # suppression des items lies aux objets disparus
+        for item in self.sublist:
+            old_obj=item.getObject()
+            if old_obj in liste:
+                pos=liste.index(old_obj)
+                sublist[pos]=item
+            else:
+                pass # objets supprimes ignores
+        # ajout des items lies aux nouveaux objets
+        pos=0
+        for obj in liste:
+            if sublist[pos] is None:
+                # nouvel objet : on cree un nouvel item
+                def setFunction(value, object=obj):
+                    object.setval(value)
+                item = self.makeObjecttreeitem(self.appliEficas, obj.nom + " : ", obj, setFunction)
+                sublist[pos]=item
+            pos=pos+1
+
+        self.sublist=sublist
+        return self.sublist
+
+    def addItem(self,name,pos):
+        objet = self.object.addEntite(name,pos)
+        return objet
+
+    def suppItem(self,item) :
+        """
+           Cette methode a pour fonction de supprimer l'item passee en argument
+           des fils de l'item FACT qui est son pere
+             - item = item du MOCLE a supprimer du MOCLE pere
+             - item.getObject() = MCSIMP ou MCBLOC
+        """
+        itemobject=item.getObject()
+        if itemobject.isOblig() :
+            return (0, tr('Impossible de supprimer un mot-cle obligatoire '))
+
+        if self.object.suppEntite(itemobject):
+            message = tr("Mot-cle %s supprime")+ itemobject.nom
+            return (1, message)
+        else:
+            return (0,tr('Pb interne : impossible de supprimer ce mot-cle'))
 
 import Accas
 objet = Accas.MCFACT
index c0b72040dcbdc6c4a3c95ea26814e9bbaada75c9..ebd4871419acca06852c02bd049ec203a885ea08 100644 (file)
@@ -31,14 +31,14 @@ from . import typeNode
 
 
 class FormuleNode(browser.JDCNode,typeNode.PopUpMenuNode):
-        
+
     def getPanel(self):
-      from .monWidgetFormule import MonWidgetFormule
-      return MonWidgetFormule(self,self.editor,self.item.object)
+        from .monWidgetFormule import MonWidgetFormule
+        return MonWidgetFormule(self,self.editor,self.item.object)
+
 
-   
     def createPopUpMenu(self):
-      typeNode.PopUpMenuNode.createPopUpMenu(self)
+        typeNode.PopUpMenuNode.createPopUpMenu(self)
 
 
 class FORMULETreeItem(compooper.EtapeTreeItem):
@@ -49,118 +49,118 @@ class FORMULETreeItem(compooper.EtapeTreeItem):
     itemNode=FormuleNode
 
     def init(self):
-      self.setFunction = self.setValeur
+        self.setFunction = self.setValeur
 
 # ---------------------------------------------------------------------------
-#                   API de FORMULE pour l'arbre 
+#                   API de FORMULE pour l'arbre
 # ---------------------------------------------------------------------------
     def getSubList(self):
-      """
-      Retourne la liste des fils de self
-      On considere que FORMULE n'a pas de fils
-      --> modification par rapport a MACRO classique
-      """
-      # dans EFICAS on ne souhaite pas afficher les mots-cles fils de FORMULE
-      # de facon traditionnelle
-      return []
+        """
+        Retourne la liste des fils de self
+        On considere que FORMULE n'a pas de fils
+        --> modification par rapport a MACRO classique
+        """
+        # dans EFICAS on ne souhaite pas afficher les mots-cles fils de FORMULE
+        # de facon traditionnelle
+        return []
 
     def getIconName(self):
-      """
-      Retourne le nom de l'icone a afficher dans l'arbre
-      Ce nom depend de la validite de l'objet
-      """
-      if self.object.isActif():
-        if self.object.isValid():
-          return "ast-green-square"
+        """
+        Retourne le nom de l'icone a afficher dans l'arbre
+        Ce nom depend de la validite de l'objet
+        """
+        if self.object.isActif():
+            if self.object.isValid():
+                return "ast-green-square"
+            else:
+                return "ast-red-square"
         else:
-          return "ast-red-square"
-      else:
-        return "ast-white-text"
+            return "ast-white-text"
 
     def getLabelText(self):
-      """ Retourne 3 valeurs :
-      - le texte a afficher dans le noeud representant l'item
-      - la fonte dans laquelle afficher ce texte
-      - la couleur du texte
-      """
-      return self.labeltext,None,None
-      #if self.object.isActif():
-        # None --> fonte et couleur par defaut
-      #  return tr(self.labeltext),None,None
-      #else:
-      #   return tr(self.labeltext),None,None
-      #return self.labeltext,fontes.standard_italique,None
-    
+        """ Retourne 3 valeurs :
+        - le texte a afficher dans le noeud representant l'item
+        - la fonte dans laquelle afficher ce texte
+        - la couleur du texte
+        """
+        return self.labeltext,None,None
+        #if self.object.isActif():
+            # None --> fonte et couleur par defaut
+        #  return tr(self.labeltext),None,None
+        #else:
+        #   return tr(self.labeltext),None,None
+        #return self.labeltext,fontes.standard_italique,None
+
 # ---------------------------------------------------------------------------
 #       Methodes permettant la modification et la lecture des attributs
 #       du parametre = API graphique de la FORMULE pour Panel et EFICAS
 # ---------------------------------------------------------------------------
 
     def getNom(self):
-      """
-      Retourne le nom de la FORMULE
-      """
-      return self.object.getNom()
+        """
+        Retourne le nom de la FORMULE
+        """
+        return self.object.getNom()
 
     def getType(self):
-      """
-      Retourne le type de la valeur retournee par la FORMULE
-      """
-      return self.object.type_retourne
+        """
+        Retourne le type de la valeur retournee par la FORMULE
+        """
+        return self.object.type_retourne
 
     def getArgs(self):
-      """
-      Retourne les arguments de la FORMULE
-      """
-      args=""
-      for mot in self.object.mcListe:
-          if mot.nom == 'NOM_PARA':
-             args=mot.valeur
-             break
-      if args :
-          if args[0] == "(" and args[-1] ==")":
-             args=args[1:-1]
-          # transforme en tuple si ce n est pas deja le casa
-          try :
-             args=args.split(',')
-          except :
-             pass
-      return args
+        """
+        Retourne les arguments de la FORMULE
+        """
+        args=""
+        for mot in self.object.mcListe:
+            if mot.nom == 'NOM_PARA':
+                args=mot.valeur
+                break
+        if args :
+            if args[0] == "(" and args[-1] ==")":
+                args=args[1:-1]
+            # transforme en tuple si ce n est pas deja le casa
+            try :
+                args=args.split(',')
+            except :
+                pass
+        return args
 
     def getCorps(self):
-      """
-      Retourne le corps de la FORMULE
-      """
-      corps=""
-      for mot in self.object.mcListe:
-          if mot.nom == 'VALE':
-             corps=mot.valeur
-             break
-      return corps
+        """
+        Retourne le corps de la FORMULE
+        """
+        corps=""
+        for mot in self.object.mcListe:
+            if mot.nom == 'VALE':
+                corps=mot.valeur
+                break
+        return corps
 
 
     def getListeTypesAutorises(self):
-      """
-         Retourne la liste des types autorises pour les valeurs de sortie 
-         d'une FORMULE
-      """
-      return self.object.l_types_autorises
+        """
+           Retourne la liste des types autorises pour les valeurs de sortie
+           d'une FORMULE
+        """
+        return self.object.l_types_autorises
 
     def saveFormule(self,new_nom,new_typ,new_arg,new_exp):
-      """
-      Verifie si (new_nom,new_typ,new_arg,new_exp) definit bien une FORMULE 
-      licite :
-          - si oui, stocke ces parametres comme nouveaux parametres de la 
-            FORMULE courante et retourne 1
-          - si non, laisse les parametres anciens de la FORMULE inchanges et 
-            retourne 0
-      """
-      test,erreur = self.object.verifFormule_python(formule=(new_nom,new_typ,new_arg,
-                                                       new_exp))
-      if test :
-          # la formule est bien correcte : on sauve les nouveaux parametres
-          test=self.object.updateFormulePython(formule=(new_nom,new_typ,new_exp,new_arg))
-      return test,erreur
+        """
+        Verifie si (new_nom,new_typ,new_arg,new_exp) definit bien une FORMULE
+        licite :
+            - si oui, stocke ces parametres comme nouveaux parametres de la
+              FORMULE courante et retourne 1
+            - si non, laisse les parametres anciens de la FORMULE inchanges et
+              retourne 0
+        """
+        test,erreur = self.object.verifFormule_python(formule=(new_nom,new_typ,new_arg,
+                                                         new_exp))
+        if test :
+            # la formule est bien correcte : on sauve les nouveaux parametres
+            test=self.object.updateFormulePython(formule=(new_nom,new_typ,new_exp,new_arg))
+        return test,erreur
 
 # ---------------------------------------------------------------------------
 #          Acces aux methodes de verification de l'objet FORM_ETAPE
index 5f5f7ad584d5df42088a7b4213ef1085ed508c7e..3c9e5a390451963e6ebffd8904acc5053f24793a 100644 (file)
@@ -30,7 +30,7 @@ class Node(browser.JDCNode,typeNode.PopUpMenuRacine):
     def getPanel(self):
         from .monChoixCommande import MonChoixCommande
         return MonChoixCommande(self,self.item, self.editor)
-        
+
 
     def createPopUpMenu(self):
         typeNode.PopUpMenuRacine.createPopUpMenu(self)
@@ -38,98 +38,98 @@ class Node(browser.JDCNode,typeNode.PopUpMenuRacine):
     def addParameters(self,apres):
         param=self.appendChild("PARAMETRE",pos=0)
         return param
-       
+
 
 
 class JDCTreeItem(Objecttreeitem.ObjectTreeItem):
-  itemNode=Node
-  
-  def isExpandable(self):
-    return 1
-
-  def getText(self):
-      return  "    "
-
-  def getLabelText(self):
-      # None --> fonte et couleur par defaut
-      return tr(self.object.nom),None,None
-
-  def getJdc(self):
-    """
-    Retourne l'objet pointe par self
-    """
-    return self.object
-  
-  def getIconName(self):
-    if self.object.isValid():
-      return "ast-green-square"
-    else:
-      return "ast-red-square"
-
-  #def keys(self):
-  #    if self.object.etapes_niveaux != []:
-  #        return range(len(self.object.etapes_niveaux))
-  #    else:
-  #        return range(len(self.object.etapes))
-
-  def addItem(self,name,pos):
-      cmd = self._object.addEntite(name,pos)
-      return cmd
-
-  def suppItem(self,item) :
-    # item             = item de l'ETAPE a supprimer du JDC
-    # item.getObject() = ETAPE ou COMMENTAIRE
-    # self.object      = JDC
-
-    itemobject=item.getObject()
-    if self.object.suppEntite(itemobject):
-       if itemobject.nature == "COMMENTAIRE" :
-          message = tr("Commentaire supprime")
-       else :
-          message = tr("Commande %s supprimee",itemobject.nom)
-       return 1,message
-    else:
-       message=tr("Pb interne : impossible de supprimer cet objet")
-       return 0,message
-
-  def getSubList(self):
-    """
-       Retourne la liste des items fils de l'item jdc.
-       Cette liste est conservee et mise a jour a chaque appel
-    """
-    if self.object.etapes_niveaux != []:
-        liste = self.object.etapes_niveaux
-    else:
-        liste = self.object.etapes
-    sublist=[None]*len(liste)
-    # suppression des items lies aux objets disparus
-    for item in self.sublist:
-       old_obj=item.getObject()
-       if old_obj in liste:
-          pos=liste.index(old_obj)
-          sublist[pos]=item
-       else:
-          pass # objets supprimes ignores
-    # ajout des items lies aux nouveaux objets
-    pos=0
-    for obj in liste:
-       if sublist[pos] is None:
-          # nouvel objet : on cree un nouvel item
-          item = self.makeObjecttreeitem(self.appliEficas, obj.nom + " : ", obj)
-          sublist[pos]=item
-       pos=pos+1
-
-    self.sublist=sublist
-    return self.sublist
-
-  def getLNomsEtapes(self):
-      """ Retourne la liste des noms des etapes de self.object"""
-      return self.object.getLNomsEtapes()
-
-  def getListeCmd(self):
-      listeCmd = self.object.niveau.definition.getListeCmd()
-      return listeCmd
+    itemNode=Node
+
+    def isExpandable(self):
+        return 1
+
+    def getText(self):
+        return  "    "
+
+    def getLabelText(self):
+        # None --> fonte et couleur par defaut
+        return tr(self.object.nom),None,None
+
+    def getJdc(self):
+        """
+        Retourne l'objet pointe par self
+        """
+        return self.object
+
+    def getIconName(self):
+        if self.object.isValid():
+            return "ast-green-square"
+        else:
+            return "ast-red-square"
+
+    #def keys(self):
+    #    if self.object.etapes_niveaux != []:
+    #        return range(len(self.object.etapes_niveaux))
+    #    else:
+    #        return range(len(self.object.etapes))
+
+    def addItem(self,name,pos):
+        cmd = self._object.addEntite(name,pos)
+        return cmd
+
+    def suppItem(self,item) :
+        # item             = item de l'ETAPE a supprimer du JDC
+        # item.getObject() = ETAPE ou COMMENTAIRE
+        # self.object      = JDC
+
+        itemobject=item.getObject()
+        if self.object.suppEntite(itemobject):
+            if itemobject.nature == "COMMENTAIRE" :
+                message = tr("Commentaire supprime")
+            else :
+                message = tr("Commande %s supprimee",itemobject.nom)
+            return 1,message
+        else:
+            message=tr("Pb interne : impossible de supprimer cet objet")
+            return 0,message
+
+    def getSubList(self):
+        """
+           Retourne la liste des items fils de l'item jdc.
+           Cette liste est conservee et mise a jour a chaque appel
+        """
+        if self.object.etapes_niveaux != []:
+            liste = self.object.etapes_niveaux
+        else:
+            liste = self.object.etapes
+        sublist=[None]*len(liste)
+        # suppression des items lies aux objets disparus
+        for item in self.sublist:
+            old_obj=item.getObject()
+            if old_obj in liste:
+                pos=liste.index(old_obj)
+                sublist[pos]=item
+            else:
+                pass # objets supprimes ignores
+        # ajout des items lies aux nouveaux objets
+        pos=0
+        for obj in liste:
+            if sublist[pos] is None:
+                # nouvel objet : on cree un nouvel item
+                item = self.makeObjecttreeitem(self.appliEficas, obj.nom + " : ", obj)
+                sublist[pos]=item
+            pos=pos+1
+
+        self.sublist=sublist
+        return self.sublist
+
+    def getLNomsEtapes(self):
+        """ Retourne la liste des noms des etapes de self.object"""
+        return self.object.getLNomsEtapes()
+
+    def getListeCmd(self):
+        listeCmd = self.object.niveau.definition.getListeCmd()
+        return listeCmd
 
 import Accas
 treeitem =JDCTreeItem
-objet = Accas.JDC    
+objet = Accas.JDC
index afb748d472ac377b9decb52c42d93dee4034cfa7..330f828335b21e475806a2c9b3b89f0689b81fec 100644 (file)
@@ -32,23 +32,23 @@ from InterfaceQT4 import browser
 from InterfaceQT4 import typeNode
 
 
-class MACRONode(browser.JDCNode,typeNode.PopUpMenuNode):         
-    
+class MACRONode(browser.JDCNode,typeNode.PopUpMenuNode):
+
     def getPanel(self):
-      from   .monWidgetCommande import MonWidgetCommande
-      return MonWidgetCommande (self,self.editor ,self.item.object)
+        from   .monWidgetCommande import MonWidgetCommande
+        return MonWidgetCommande (self,self.editor ,self.item.object)
 
 
     def createPopUpMenu(self):
-      typeNode.PopUpMenuNode.createPopUpMenu(self)
+        typeNode.PopUpMenuNode.createPopUpMenu(self)
 
 #    def view3D(self) :
 #        from Editeur import TroisDPal
 #        troisD=TroisDPal.TroisDPilote(self.item,self.editor.appliEficas)
 #        troisD.envoievisu()
 
-        
-    
+
+
 class MACROTreeItem(compooper.EtapeTreeItem):
 #  """ Cette classe herite d'une grande partie des comportements
 #      de la classe compooper.EtapeTreeItem
@@ -61,97 +61,97 @@ class MACROTreeItem(compooper.EtapeTreeItem):
 
 class INCLUDETreeItemBase(MACROTreeItem):
 
-    def __init__(self,appliEficas, labeltext, object, setFunction):    
-       MACROTreeItem.__init__(self,appliEficas, labeltext, object, setFunction)
+    def __init__(self,appliEficas, labeltext, object, setFunction):
+        MACROTreeItem.__init__(self,appliEficas, labeltext, object, setFunction)
 
     def isCopiable(self):
-       return 0
+        return 0
 
 
-class INCLUDENode(browser.JDCNode,typeNode.PopUpMenuNode):    
+class INCLUDENode(browser.JDCNode,typeNode.PopUpMenuNode):
 
     def getPanel(self):
-      from   .monWidgetCommande import MonWidgetCommande
-      return MonWidgetCommande (self,self.editor ,self.item.object)
+        from   .monWidgetCommande import MonWidgetCommande
+        return MonWidgetCommande (self,self.editor ,self.item.object)
 
     def createPopUpMenu(self):
-      typeNode.PopUpMenuNode.createPopUpMenu(self)
-      
+        typeNode.PopUpMenuNode.createPopUpMenu(self)
+
     def makeEdit(self):    #,appliEficas,node
         if self.item.object.text_converted == 0:
-                # Le texte du fichier inclus n'a pas pu etre converti par le module convert
-                msg=tr("Le fichier de commande n'a pas pu etre converti pour etre editable par Eficas\n\n")
-                msg=msg+self.item.object.text_error
-                return
-    
+            # Le texte du fichier inclus n'a pas pu etre converti par le module convert
+            msg=tr("Le fichier de commande n'a pas pu etre converti pour etre editable par Eficas\n\n")
+            msg=msg+self.item.object.text_error
+            return
+
         if not hasattr(self.item.object,"jdc_aux") or self.item.object.jdc_aux is None:
-               #L'include n'est pas initialise
-               self.item.object.buildInclude(None,"")
-    
+            #L'include n'est pas initialise
+            self.item.object.buildInclude(None,"")
+
         # On cree un nouvel onglet dans le bureau
         self.editor.vm.displayJDC( self.item.object.jdc_aux , self.item.object.jdc_aux.nom )
-     
+
 
 class INCLUDETreeItem(INCLUDETreeItemBase):
     itemNode=INCLUDENode
-    
+
 
 # ------------------------------------
 #  Classes necessaires a POURSUITE
 # ------------------------------------
-    
-class POURSUITENode(browser.JDCNode, typeNode.PopUpMenuNode):    
+
+class POURSUITENode(browser.JDCNode, typeNode.PopUpMenuNode):
 
     def getPanel(self):
-      from   .monWidgetCommande import MonWidgetCommande
-      return MonWidgetCommande (self,self.editor ,self.item.object)
+        from   .monWidgetCommande import MonWidgetCommande
+        return MonWidgetCommande (self,self.editor ,self.item.object)
 
     def createPopUpMenu(self):
-      typeNode.PopUpMenuNode.createPopUpMenu(self)
+        typeNode.PopUpMenuNode.createPopUpMenu(self)
 
     def makeEdit(self):    #,appliEficas,node
         if self.item.object.text_converted == 0:
-                msg=tr("Le fichier de commande n'a pas pu etre converti pour etre editable par Eficas\n\n")
-                msg=msg+self.item.object.text_error
-                return
-    
+            msg=tr("Le fichier de commande n'a pas pu etre converti pour etre editable par Eficas\n\n")
+            msg=msg+self.item.object.text_error
+            return
+
         if not hasattr(self.item.object,"jdc_aux") or self.item.object.jdc_aux is None:
             text="""DEBUT()
                     FIN()"""
             self.object.buildPoursuite(None,text)
-    
+
         # On cree un nouvel onglet dans le bureau
         self.editor.vm.displayJDC( self.item.object.jdc_aux , self.item.object.jdc_aux.nom)
-    
+
 class POURSUITETreeItem(INCLUDETreeItemBase):
-  itemNode=POURSUITENode
+    itemNode=POURSUITENode
 
 
 # ----------------------------------------
 #  Classes necessaires a INCLUDE MATERIAU
 # ----------------------------------------
-    
+
 
 class MATERIAUNode(MACRONode):
 
     def getPanel(self):
-      from   .monWidgetCommande import MonWidgetCommande
-      return MonWidgetCommande (self,self.editor ,self.item.object)
+        from   .monWidgetCommande import MonWidgetCommande
+        return MonWidgetCommande (self,self.editor ,self.item.object)
 
     def createPopUpMenu(self):
-      typeNode.PopUpMenuNode.createPopUpMenu(self)
+        typeNode.PopUpMenuNode.createPopUpMenu(self)
 
     def makeView(self) :
-      if hasattr(self.item.object,'fichier_ini') and self.item.object.fichier_ini==None:
-         QMessageBox.information( self,tr("Include vide"),tr("L'include doit etre correctement initialise pour etre visualise"))
-         return
-      f = open(self.item.object.fichier_ini, "rb")
-      texte = f.read()
-      f.close()
-      from desVisu import DVisu
-      monVisuDialg=DVisu(parent=self.editor.appliEficas,fl=0)
-      monVisuDialg.TB.setText(texte)
-      monVisuDialg.show()
+        if hasattr(self.item.object,'fichier_ini') and self.item.object.fichier_ini==None:
+            QMessageBox.information( self,tr("Include vide"),tr("L'include doit etre correctement initialise pour etre visualise"))
+            return
+        f = open(self.item.object.fichier_ini, "rb")
+        texte = f.read()
+        f.close()
+        from desVisu import DVisu
+        monVisuDialg=DVisu(parent=self.editor.appliEficas,fl=0)
+        monVisuDialg.TB.setText(texte)
+        monVisuDialg.show()
 
 
 class INCLUDE_MATERIAUTreeItem(INCLUDETreeItemBase):
@@ -160,22 +160,20 @@ class INCLUDE_MATERIAUTreeItem(INCLUDETreeItemBase):
 # ------------------------------------
 # TreeItem
 # ------------------------------------
-    
+
 
 def treeitem(appliEficas, labeltext, object, setFunction=None):
-   """ Factory qui retourne l'item adapte au type de macro : 
-       INCLUDE, POURSUITE, MACRO
-   """
-   if object.nom == "INCLUDE_MATERIAU":
-      return INCLUDE_MATERIAUTreeItem(appliEficas, labeltext, object, setFunction)
-   elif object.nom == "INCLUDE" or object.nom== "DICTDATA":
-      return INCLUDETreeItem(appliEficas, labeltext, object, setFunction)
-   elif object.nom == "POURSUITE":
-      return POURSUITETreeItem(appliEficas, labeltext, object, setFunction)
-   else:
-      return MACROTreeItem(appliEficas, labeltext, object, setFunction)
+    """ Factory qui retourne l'item adapte au type de macro :
+        INCLUDE, POURSUITE, MACRO
+    """
+    if object.nom == "INCLUDE_MATERIAU":
+        return INCLUDE_MATERIAUTreeItem(appliEficas, labeltext, object, setFunction)
+    elif object.nom == "INCLUDE" or object.nom== "DICTDATA":
+        return INCLUDETreeItem(appliEficas, labeltext, object, setFunction)
+    elif object.nom == "POURSUITE":
+        return POURSUITETreeItem(appliEficas, labeltext, object, setFunction)
+    else:
+        return MACROTreeItem(appliEficas, labeltext, object, setFunction)
 
 import Accas
 objet=Accas.MACRO_ETAPE
-    
-
index e8735ea863de2ff23302b92495410b10aded8293..15e2a11f161d18a306976c1568a8469cfa928c7e 100644 (file)
@@ -45,20 +45,20 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal):
         else : self.niveau=1
         # attention si l objet est une mclist on utilise bloc
         if not (monObjet.isMCList()) :
-           if  hasattr(self,'plie') and self.plie==True : 
-               from InterfaceQT4.monWidgetFactPlie import MonWidgetFactPlie
-               widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
-           elif self.editor.maConfiguration.afficheFirstPlies and self.firstAffiche:
-               self.firstAffiche = False
-               self.setPlie()
-               from InterfaceQT4.monWidgetFactPlie import MonWidgetFactPlie
-               widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
-           else:
-               from InterfaceQT4.monWidgetFact import MonWidgetFact
-               widget=MonWidgetFact(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
+            if  hasattr(self,'plie') and self.plie==True :
+                from InterfaceQT4.monWidgetFactPlie import MonWidgetFactPlie
+                widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
+            elif self.editor.maConfiguration.afficheFirstPlies and self.firstAffiche:
+                self.firstAffiche = False
+                self.setPlie()
+                from InterfaceQT4.monWidgetFactPlie import MonWidgetFactPlie
+                widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
+            else:
+                from InterfaceQT4.monWidgetFact import MonWidgetFact
+                widget=MonWidgetFact(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
         else :
-           from InterfaceQT4.monWidgetBloc import MonWidgetBloc
-           widget=MonWidgetBloc(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
+            from InterfaceQT4.monWidgetBloc import MonWidgetBloc
+            widget=MonWidgetBloc(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
         return widget
 
 
@@ -80,7 +80,7 @@ class MCListTreeItem(Objecttreeitem.SequenceTreeItem,compofact.FACTTreeItem):
         Elle adapte ces objets pour leur permettre d'etre integres en tant que
         noeuds dans un arbre graphique (voir treewidget.py et ObjectTreeItem.py).
         Cette classe delegue les appels de methode et les acces
-        aux attributs a l'objet du noyau soit manuellement soit 
+        aux attributs a l'objet du noyau soit manuellement soit
         automatiquement (voir classe Delegate et attribut object).
     """
     itemNode=Node
@@ -92,9 +92,9 @@ class MCListTreeItem(Objecttreeitem.SequenceTreeItem,compofact.FACTTreeItem):
 
     def updateDelegate(self):
         if len(self._object) > 1:
-           self.setDelegate(self._object)
+            self.setDelegate(self._object)
         else:
-           self.setDelegate(self._object.data[0])
+            self.setDelegate(self._object.data[0])
 
     def panel(self,jdcdisplay,pane,node):
         """ Retourne une instance de l'objet panneau associe a l'item (self)
@@ -103,49 +103,49 @@ class MCListTreeItem(Objecttreeitem.SequenceTreeItem,compofact.FACTTreeItem):
             Si la liste est plus longue on utilise le panneau MCLISTPanel.
         """
         if len(self._object) > 1:
-           return MCLISTPanel(jdcdisplay,pane,node)
+            return MCLISTPanel(jdcdisplay,pane,node)
         elif isinstance(self._object.data[0],ErrorObj):
-           return compoerror.ERRORPanel(jdcdisplay,pane,node)
+            return compoerror.ERRORPanel(jdcdisplay,pane,node)
         else:
-           return compofact.FACTPanel(jdcdisplay,pane,node)
+            return compofact.FACTPanel(jdcdisplay,pane,node)
 
     def isExpandable(self):
         if len(self._object) > 1:
-           return Objecttreeitem.SequenceTreeItem.isExpandable(self)
+            return Objecttreeitem.SequenceTreeItem.isExpandable(self)
         else:
-           return compofact.FACTTreeItem.isExpandable(self)
+            return compofact.FACTTreeItem.isExpandable(self)
 
     def getSubList(self):
         self.updateDelegate()
         if len(self._object) <= 1:
-           self._object.data[0].alt_parent=self._object
-           return compofact.FACTTreeItem.getSubList(self)
+            self._object.data[0].alt_parent=self._object
+            return compofact.FACTTreeItem.getSubList(self)
 
         liste=self._object.data
         sublist=[None]*len(liste)
         # suppression des items lies aux objets disparus
         for item in self.sublist:
-           old_obj=item.getObject()
-           if old_obj in liste:
-              pos=liste.index(old_obj)
-              sublist[pos]=item
-           else:
-              pass # objets supprimes ignores
+            old_obj=item.getObject()
+            if old_obj in liste:
+                pos=liste.index(old_obj)
+                sublist[pos]=item
+            else:
+                pass # objets supprimes ignores
         # ajout des items lies aux nouveaux objets
         pos=0
         for obj in liste:
-           if sublist[pos] is None:
-              # nouvel objet : on cree un nouvel item
-              def setFunction(value, object=obj):
-                  object=value
-              item = self.makeObjecttreeitem(self.appliEficas, obj.nom + " : ", obj, setFunction)
-              sublist[pos]=item
-              #Attention : on ajoute une information supplementaire pour l'actualisation de 
-              # la validite. L'attribut parent d'un MCFACT pointe sur le parent de la MCLISTE
-              # et pas sur la MCLISTE elle meme ce qui rompt la chaine de remontee des
-              # informations de validite. alt_parent permet de remedier a ce defaut.
-              obj.alt_parent=self._object
-           pos=pos+1
+            if sublist[pos] is None:
+                # nouvel objet : on cree un nouvel item
+                def setFunction(value, object=obj):
+                    object=value
+                item = self.makeObjecttreeitem(self.appliEficas, obj.nom + " : ", obj, setFunction)
+                sublist[pos]=item
+                #Attention : on ajoute une information supplementaire pour l'actualisation de
+                # la validite. L'attribut parent d'un MCFACT pointe sur le parent de la MCLISTE
+                # et pas sur la MCLISTE elle meme ce qui rompt la chaine de remontee des
+                # informations de validite. alt_parent permet de remedier a ce defaut.
+                obj.alt_parent=self._object
+            pos=pos+1
 
         self.sublist=sublist
         return self.sublist
@@ -160,13 +160,13 @@ class MCListTreeItem(Objecttreeitem.SequenceTreeItem,compofact.FACTTreeItem):
 
     def getDocu(self):
         """ Retourne la clef de doc de l'objet pointe par self """
-        return self.object.getDocu()    
+        return self.object.getDocu()
 
     def isCopiable(self):
         if len(self._object) > 1:
-           return Objecttreeitem.SequenceTreeItem.isCopiable(self)
+            return Objecttreeitem.SequenceTreeItem.isCopiable(self)
         else:
-           return compofact.FACTTreeItem.isCopiable(self)
+            return compofact.FACTTreeItem.isCopiable(self)
 
     def isMCFact(self):
         """
@@ -179,40 +179,40 @@ class MCListTreeItem(Objecttreeitem.SequenceTreeItem,compofact.FACTTreeItem):
         Retourne 1 si l'objet pointe par self est une MCList, 0 sinon
         """
         return len(self._object) > 1
-        
+
     def getCopieObjet(self):
         return self._object.data[0].copy()
 
     def addItem(self,obj,pos):
         #print "compomclist.addItem",obj,pos
         if len(self._object) <= 1:
-           return compofact.FACTTreeItem.addItem(self,obj,pos)
+            return compofact.FACTTreeItem.addItem(self,obj,pos)
 
         o= self.object.addEntite(obj,pos)
         return o
 
     def suppItem(self,item):
         """
-        Retire un objet MCFACT de la MCList (self.object) 
+        Retire un objet MCFACT de la MCList (self.object)
         """
         #print "compomclist.suppItem",item
         obj=item.getObject()
         if len(self._object) <= 1:
-           return compofact.FACTTreeItem.suppItem(self,item)
+            return compofact.FACTTreeItem.suppItem(self,item)
 
         if self.object.suppEntite(obj):
-           if len(self._object) == 1: self.updateDelegate()     
-           message = "Mot-clef " + obj.nom + " supprime"
-           return (1,message)
+            if len(self._object) == 1: self.updateDelegate()
+            message = "Mot-clef " + obj.nom + " supprime"
+            return (1,message)
         else:
-           return (0,tr('Impossible de supprimer ce mot-clef'))
+            return (0,tr('Impossible de supprimer ce mot-clef'))
+
 
-            
 import Accas
-objet = Accas.MCList    
+objet = Accas.MCList
 
 def treeitem(appliEficas,labeltext,object,setFunction):
-  """ Factory qui produit un objet treeitem adapte a un objet 
-      Accas.MCList (attribut objet de ce module)
-  """
-  return MCListTreeItem(appliEficas,labeltext,object,setFunction)
+    """ Factory qui produit un objet treeitem adapte a un objet
+        Accas.MCList (attribut objet de ce module)
+    """
+    return MCListTreeItem(appliEficas,labeltext,object,setFunction)
index b8aff454d522abd975e7360b48738166e6a1c246..fd59ff45b988769e7a8e5efd790d0b3ea239e2de 100644 (file)
@@ -19,7 +19,7 @@
 #
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import os
@@ -48,16 +48,16 @@ class Node(browser.JDCNode, typeNode.PopUpMenuNode):
         self.editor.initModif()
         test,mess = self.item.nommeSd(nom)
         if (test== 0):
-           self.editor.afficheInfos(mess,'red')
-           old=self.item.getText()
-           self.monWidgetNom.setText(old)
+            self.editor.afficheInfos(mess,'red')
+            old=self.item.getText()
+            self.monWidgetNom.setText(old)
         else :
-           self.editor.afficheCommentaire(tr("Nommage du concept effectue"))
-           self.onValid()
-           try :
-             self.fenetre.LENom.setText(nom)
-           except :
-             pass
+            self.editor.afficheCommentaire(tr("Nommage du concept effectue"))
+            self.onValid()
+            try :
+                self.fenetre.LENom.setText(nom)
+            except :
+                pass
 
 
     def getPanel(self):
@@ -74,209 +74,207 @@ class Node(browser.JDCNode, typeNode.PopUpMenuNode):
 
 
 class EtapeTreeItem(Objecttreeitem.ObjectTreeItem):
-  """ La classe EtapeTreeItem est un adaptateur des objets ETAPE du noyau
-      Accas. Elle leur permet d'etre affichés comme des noeuds
-      d'un arbre graphique.
-      Cette classe a entre autres deux attributs importants :
-        - _object qui est un pointeur vers l'objet du noyau
-        - object qui pointe vers l'objet auquel sont délégués les
-          appels de méthode et les acces aux attributs
-      Dans le cas d'une ETAPE, _object et object pointent vers le 
-      meme objet.
-  """
-  itemNode=Node
-  
-  def isExpandable(self):
-      return 1
-
-  def getIconName(self):
-      """
-      Retourne le nom de l'icone a afficher dans l'arbre
-      Ce nom depend de la validite de l'objet
-      """
-      if not self.object.isActif():
-         return "ast-white-square"
-      elif self.object.isValid():
-         return "ast-green-square"
-      else:
-         valid=self.validChild()
-         valid=valid * self.validRegles("non")
-         if self.reste_val != {}:
-            valid=0
-         if valid==0  :
-            return "ast-red-square"
-         else :
-            try :
-            # on traite ici le cas d include materiau
-            #  print self.object.definition.nom 
-              if  self.object.fichier_ini != self.object.nom_mater :
-                  return "ast-red-square"
-            except :
-              pass
-            return "ast-yellow-square"
-
-  def getLabelText(self):
-      """ Retourne 3 valeurs :
-      - le texte a afficher dans le noeud représentant l'item
-      - la fonte dans laquelle afficher ce texte
-      - la couleur du texte
-      """
-      return self.labeltext,None,None
-      #if self.object.isActif():
+    """ La classe EtapeTreeItem est un adaptateur des objets ETAPE du noyau
+        Accas. Elle leur permet d'etre affichés comme des noeuds
+        d'un arbre graphique.
+        Cette classe a entre autres deux attributs importants :
+          - _object qui est un pointeur vers l'objet du noyau
+          - object qui pointe vers l'objet auquel sont délégués les
+            appels de méthode et les acces aux attributs
+        Dans le cas d'une ETAPE, _object et object pointent vers le
+        meme objet.
+    """
+    itemNode=Node
+
+    def isExpandable(self):
+        return 1
+
+    def getIconName(self):
+        """
+        Retourne le nom de l'icone a afficher dans l'arbre
+        Ce nom depend de la validite de l'objet
+        """
+        if not self.object.isActif():
+            return "ast-white-square"
+        elif self.object.isValid():
+            return "ast-green-square"
+        else:
+            valid=self.validChild()
+            valid= valid * self.validRegles("non")
+            if self.reste_val != {} : valid=0
+            if valid==0  :
+                return "ast-red-square"
+            else :
+                try :
+                # on traite ici le cas d include materiau
+                #  print self.object.definition.nom
+                    if  self.object.fichier_ini != self.object.nom_mater :
+                        return "ast-red-square"
+                except :
+                    pass
+                return "ast-yellow-square"
+
+    def getLabelText(self):
+        """ Retourne 3 valeurs :
+        - le texte a afficher dans le noeud représentant l'item
+        - la fonte dans laquelle afficher ce texte
+        - la couleur du texte
+        """
+        return self.labeltext,None,None
+        #if self.object.isActif():
         # None --> fonte et couleur par défaut
-      #  return self.labeltext,None,None
-      #else:
-      #  return self.labeltext, None, None #CS_pbruno todo
-      
-  #def get_objet(self,name) :
-  #    for v in self.object.mcListe:
-  #        if v.nom == name : return v
-  #    return None
-      
- # def getType_sd_prod(self):
- #     """
- #        Retourne le nom du type du concept résultat de l'étape
- #     """
- #     sd_prod=self.object.getType_produit()
- #     if sd_prod:
- #        return sd_prod.__name__
- #     else:
- #        return ""
-
-  def addItem(self,name,pos):      
-      mcent = self._object.addEntite(name,pos)
-      return mcent
-      
-
-  def suppItem(self,item) :
-      # item : item du MOCLE de l'ETAPE a supprimer
-      # item.getObject() = MCSIMP, MCFACT, MCBLOC ou MCList 
-      itemobject=item.getObject()
-      if itemobject.isOblig() :
-          return (0,tr('Impossible de supprimer un mot-clef obligatoire '))
-      if self.object.suppEntite(itemobject):
-          message = tr("Mot-clef %s supprime " , itemobject.nom)
-          return (1,message)
-      else :
-          return (0,tr('Pb interne : impossible de supprimer ce mot-clef'))
-
-  def getText(self):
-      try:
-          return self.object.getSdname()
-      except:
-          return ''
-
-  # PNPN ????
-  #def keys(self):
-  #    keys=self.object.mc_dict
-  #    return keys
-
-  def getSubList(self):
-      """
-         Reactualise la liste des items fils stockes dans self.sublist
-      """
-      if self.isActif():
-         liste=self.object.mcListe
-      else:
-         liste=[]
-
-      sublist=[None]*len(liste)
-      # suppression des items lies aux objets disparus
-      for item in self.sublist:
-         old_obj=item.getObject()
-         if old_obj in liste:
-            pos=liste.index(old_obj)
-            sublist[pos]=item
-         else:
-            pass # objets supprimes ignores
-
-      # ajout des items lies aux nouveaux objets
-      pos=0
-      for obj in liste:
-         if sublist[pos] is None:
-            # nouvel objet : on cree un nouvel item
-            def setFunction(value, object=obj):
-                object.setval(value)
-            item = self.makeObjecttreeitem(self.appliEficas, obj.nom + " : ", obj, setFunction)
-            sublist[pos]=item
-         pos=pos+1
-
-      self.sublist=sublist
-      return self.sublist
-
-  def isValid(self):
-      return self.object.isValid()
-
-  def isCopiable(self):
-      """
-      Retourne 1 si l'objet est copiable, 0 sinon
-      """
-      return 1
-
-  def updateDeplace(self,item):
-      if item.sd and item.sd.nom:
-         self.object.sd=item.sd
-         self.object.sd.nom=item.sd.nom
-
-  def update(self,item):
-      if item.sd and item.sd.nom:
-         self.nommeSd(item.sd.nom)
-
-  def nommeSd(self,nom):
-      """ Lance la méthode de nommage de la SD """
-      oldnom=""
-      if self.object.sd != None :
-         oldnom=self.object.sd.nom
-      test,mess= self.object.nommeSd(nom)
-      if test:self.object.parent.resetContext()
-      if (test and oldnom in self.appliEficas.dict_reels ):
-              self.appliEficas.dict_reels[nom]=self.appliEficas.dict_reels[oldnom]
-      return test,mess
-
-  def isReentrant(self):
-      return self.object.isReentrant()
-    
-  def getNomsSdOperReentrant(self):
-      return self.object.getNomsSdOperReentrant()
-
-  def getObjetCommentarise(self):
-      """
-          Cette méthode retourne un objet commentarisé
-          représentatif de self.object
-      """
-      # Format de fichier utilisé
-      format=self.appliEficas.formatFichierIn
-      return self.object.getObjetCommentarise(format)
-
-  def getObjetCommentarise_BAK(self):
-      """
-          Cette méthode retourne un objet commentarisé
-          représentatif de self.object
-      """
-      import generator,Accas
-      # Format de fichier utilisé
-      format=self.appliEficas.format_fichier
-      g=generator.plugins[format]()
-      texte_commande = g.gener(self.object,format='beautifie')
-      # Il faut enlever la premiere ligne vide de texte_commande que 
-      # rajoute le generator
-      rebut,texte_commande = texte_commande.split('\n',1)
-      # on construit l'objet COMMANDE_COMM repésentatif de self mais non 
-      # enregistré dans le jdc
-      commande_comment = Accas.COMMANDE_COMM(texte=texte_commande,reg='non',
-                                             parent=self.object.parent)
-      commande_comment.niveau = self.object.niveau
-      commande_comment.jdc = commande_comment.parent = self.object.jdc
-
-      pos=self.object.parent.etapes.index(self.object)
-      parent=self.object.parent
-      self.object.parent.suppEntite(self.object)
-      parent.addEntite(commande_comment,pos)
-
-      return commande_comment
+        #  return self.labeltext,None,None
+        #else:
+        #  return self.labeltext, None, None #CS_pbruno todo
+
+    #def get_objet(self,name) :
+    #    for v in self.object.mcListe:
+    #        if v.nom == name : return v
+    #    return None
+
  # def getType_sd_prod(self):
  #     """
  #        Retourne le nom du type du concept résultat de l'étape
  #     """
  #     sd_prod=self.object.getType_produit()
  #     if sd_prod:
  #        return sd_prod.__name__
  #     else:
  #        return ""
+
+    def addItem(self,name,pos):
+        mcent = self._object.addEntite(name,pos)
+        return mcent
+
+
+    def suppItem(self,item) :
+        # item : item du MOCLE de l'ETAPE a supprimer
+        # item.getObject() = MCSIMP, MCFACT, MCBLOC ou MCList
+        itemobject=item.getObject()
+        if itemobject.isOblig() :
+            return (0,tr('Impossible de supprimer un mot-clef obligatoire '))
+        if self.object.suppEntite(itemobject):
+            message = tr("Mot-clef %s supprime " , itemobject.nom)
+            return (1,message)
+        else :
+            return (0,tr('Pb interne : impossible de supprimer ce mot-clef'))
+
+    def getText(self):
+        try:
+            return self.object.getSdname()
+        except:
+            return ''
+
+    # PNPN ????
+    #def keys(self):
+    #    keys=self.object.mc_dict
+    #    return keys
+
+    def getSubList(self):
+        """
+           Reactualise la liste des items fils stockes dans self.sublist
+        """
+        if self.isActif():
+            liste=self.object.mcListe
+        else:
+            liste=[]
+
+        sublist=[None]*len(liste)
+        # suppression des items lies aux objets disparus
+        for item in self.sublist:
+            old_obj=item.getObject()
+            if old_obj in liste:
+                pos=liste.index(old_obj)
+                sublist[pos]=item
+            else:
+                pass # objets supprimes ignores
+
+        # ajout des items lies aux nouveaux objets
+        pos=0
+        for obj in liste:
+            if sublist[pos] is None:
+                # nouvel objet : on cree un nouvel item
+                def setFunction(value, object=obj):
+                    object.setval(value)
+                item = self.makeObjecttreeitem(self.appliEficas, obj.nom + " : ", obj, setFunction)
+                sublist[pos]=item
+            pos=pos+1
+
+        self.sublist=sublist
+        return self.sublist
+
+    def isValid(self):
+        return self.object.isValid()
+
+    def isCopiable(self):
+        """
+        Retourne 1 si l'objet est copiable, 0 sinon
+        """
+        return 1
+
+    def updateDeplace(self,item):
+        if item.sd and item.sd.nom:
+            self.object.sd=item.sd
+            self.object.sd.nom=item.sd.nom
+
+    def update(self,item):
+        if item.sd and item.sd.nom:
+            self.nommeSd(item.sd.nom)
+
+    def nommeSd(self,nom):
+        """ Lance la méthode de nommage de la SD """
+        oldnom=""
+        if self.object.sd != None :
+            oldnom=self.object.sd.nom
+        test,mess= self.object.nommeSd(nom)
+        if test:self.object.parent.resetContext()
+        if (test and oldnom in self.appliEficas.dict_reels ):
+            self.appliEficas.dict_reels[nom]=self.appliEficas.dict_reels[oldnom]
+        return test,mess
+
+    def isReentrant(self):
+        return self.object.isReentrant()
+
+    def getNomsSdOperReentrant(self):
+        return self.object.getNomsSdOperReentrant()
+
+    def getObjetCommentarise(self):
+        """
+            Cette méthode retourne un objet commentarisé
+            représentatif de self.object
+        """
+        # Format de fichier utilisé
+        format=self.appliEficas.formatFichierIn
+        return self.object.getObjetCommentarise(format)
+
+    def getObjetCommentarise_BAK(self):
+        """
+            Cette méthode retourne un objet commentarisé
+            représentatif de self.object
+        """
+        import generator,Accas
+        # Format de fichier utilisé
+        format=self.appliEficas.format_fichier
+        g=generator.plugins[format]()
+        texte_commande = g.gener(self.object,format='beautifie')
+        # Il faut enlever la premiere ligne vide de texte_commande que
+        # rajoute le generator
+        rebut,texte_commande = texte_commande.split('\n',1)
+        # on construit l'objet COMMANDE_COMM repésentatif de self mais non
+        # enregistré dans le jdc
+        commande_comment = Accas.COMMANDE_COMM(texte=texte_commande,reg='non',
+                                               parent=self.object.parent)
+        commande_comment.niveau = self.object.niveau
+        commande_comment.jdc = commande_comment.parent = self.object.jdc
+
+        pos=self.object.parent.etapes.index(self.object)
+        parent=self.object.parent
+        self.object.parent.suppEntite(self.object)
+        parent.addEntite(commande_comment,pos)
+
+        return commande_comment
 
 
 import Accas
 treeitem = EtapeTreeItem
-objet = Accas.ETAPE    
-
+objet = Accas.ETAPE
index b9eddf9996376ec922e1b4d0699b88104b91a47c..ca9b1c02cf744245fcfd7d20031ecc643df5d081 100644 (file)
@@ -24,7 +24,7 @@
 """
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 
@@ -38,10 +38,10 @@ from . import browser
 from . import typeNode
 
 
-class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel): 
+class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel):
     def getPanel(self):
-        """        
-        """    
+        """
+        """
         from .monWidgetParam  import MonWidgetParam
         return MonWidgetParam(self, self.editor,self.item.object)
 
@@ -61,26 +61,26 @@ class PARAMTreeItem(Objecttreeitem.ObjectTreeItem):
     """
     itemNode=Node
 
-    def init(self):      
-      self.setFunction = self.setValeur
+    def init(self):
+        self.setFunction = self.setValeur
 
 # ---------------------------------------------------------------------------
-#                   API du PARAMETRE pour l'arbre 
+#                   API du PARAMETRE pour l'arbre
 # ---------------------------------------------------------------------------
 
     def getIconName(self):
-      """
-      Retourne le nom de l'icone associee au noeud qui porte self,
-      dependant de la validite de l'objet
-      NB : un PARAMETRE est toujours valide ...
-      """
-      if self.isActif():
-          if self.isValid():
-              return "ast-green-square"
-          else:
-              return "ast-red-square"
-      else:
-          return "ast-white-square"
+        """
+        Retourne le nom de l'icone associee au noeud qui porte self,
+        dependant de la validite de l'objet
+        NB : un PARAMETRE est toujours valide ...
+        """
+        if self.isActif():
+            if self.isValid():
+                return "ast-green-square"
+            else:
+                return "ast-red-square"
+        else:
+            return "ast-white-square"
 
     def getLabelText(self):
         """ Retourne 3 valeurs :
@@ -88,68 +88,68 @@ class PARAMTreeItem(Objecttreeitem.ObjectTreeItem):
         - la fonte dans laquelle afficher ce texte
         - la couleur du texte
         """
-        return tr('PARAMETRE'),None,None 
+        return tr('PARAMETRE'),None,None
 
     def getText(self):
-      """
-      Retourne le texte a afficher apres le nom de la commande (ici apres 'parametre')
-      Ce texte est tronque a 25 caracteres
-      """
-      texte=self.object.nom+"="+str(self.object.valeur)
-      if type(self.object.valeur) == list :
-          texte=self.nom+' = ['
-          for l in self.object.valeur :
-            texte=texte+str(l) +","
-          texte=texte[0:-1]+']'
-      texte = texte.split('\n')[0]
-      if len(texte) < 25 :
-          return texte
-      else :
-          return texte[0:24]+'...'
+        """
+        Retourne le texte a afficher apres le nom de la commande (ici apres 'parametre')
+        Ce texte est tronque a 25 caracteres
+        """
+        texte=self.object.nom+"="+str(self.object.valeur)
+        if type(self.object.valeur) == list :
+            texte=self.nom+' = ['
+            for l in self.object.valeur :
+                texte=texte+str(l) +","
+            texte=texte[0:-1]+']'
+        texte = texte.split('\n')[0]
+        if len(texte) < 25 :
+            return texte
+        else :
+            return texte[0:24]+'...'
 
     def getSubList(self):
-      """
-      Retourne la liste des fils de self
-      """
-      return []
-    
+        """
+        Retourne la liste des fils de self
+        """
+        return []
+
 # ---------------------------------------------------------------------------
 #       Methodes permettant la modification et la lecture des attributs
 #       du parametre = API graphique du PARAMETRE pour Panel et EFICAS
 # ---------------------------------------------------------------------------
 
     def getValeur(self):
-      """
-      Retourne la valeur de l'objet PARAMETRE cad son texte
-      """
-      if self.object.valeur is None: return ''
-      else: return self.object.valeur 
+        """
+        Retourne la valeur de l'objet PARAMETRE cad son texte
+        """
+        if self.object.valeur is None: return ''
+        else: return self.object.valeur
 
     def getNom(self):
-      """
-      Retourne le nom du parametre
-      """
-      return self.object.nom
+        """
+        Retourne le nom du parametre
+        """
+        return self.object.nom
 
     def setValeur(self,new_valeur):
-      """
-      Affecte valeur a l'objet PARAMETRE
-      """
-      self.object.setValeur(new_valeur)
+        """
+        Affecte valeur a l'objet PARAMETRE
+        """
+        self.object.setValeur(new_valeur)
 
     def setNom(self,new_nom):
-      """
-      Renomme le parametre
-      """
-      self.object.setNom(new_nom)
-      #self.object.setAttribut('nom',new_nom)
+        """
+        Renomme le parametre
+        """
+        self.object.setNom(new_nom)
+        #self.object.setAttribut('nom',new_nom)
 
     def getFr(self):
-      """
-      Retourne le fr associe au parametre, cad la bulle d'aide pour EFICAS
-      """
-      return tr("Definition d'un parametre")
-    
+        """
+        Retourne le fr associe au parametre, cad la bulle d'aide pour EFICAS
+        """
+        return tr("Definition d'un parametre")
+
 import Extensions.parametre
 treeitem =PARAMTreeItem
 objet = Extensions.parametre.PARAMETRE
index 35a75c8d7de6277aa1930e625e202028294967f3..f4088abc22364098a29803c7b083e1e894f5e60a 100644 (file)
@@ -37,8 +37,7 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNode):
 
 class ProcEtapeTreeItem(compooper.EtapeTreeItem):
     itemNode=Node
-  
+
 import Accas
 treeitem = ProcEtapeTreeItem
-objet = Accas.PROC_ETAPE    
-
+objet = Accas.PROC_ETAPE
index 7f2318ee356fd528ce1dcb03637e24292b9981ec..e58363c3a85d7a214b491e2540e5debfcc39e1bb 100644 (file)
@@ -21,7 +21,7 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os
@@ -35,9 +35,11 @@ from Editeur      import Objecttreeitem
 from InterfaceQT4 import browser
 from Noyau.N_CR   import justifyText
 from Accas        import SalomeEntry
+from Accas        import ASSD
 from Accas        import UserASSD
-    
-class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal):    
+from Accas        import UserASSDMultiple
+
+class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal):
 
     def createPopUpMenu(self):
         typeNode.PopUpMenuNodeMinimal.createPopUpMenu(self)
@@ -49,774 +51,780 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal):
         monObjet=self.item.object
         monNom=self.item.nom
 
-        # label informatif 
+        # label informatif
         if monObjet.isInformation():
-          from InterfaceQT4.monWidgetInfo import MonWidgetInfo
-          widget=MonWidgetInfo(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          self.widget=widget
-          return widget
+            from InterfaceQT4.monWidgetInfo import MonWidgetInfo
+            widget=MonWidgetInfo(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            self.widget=widget
+            return widget
 
 
-      # Attention l ordre des if est important
-      # Attention il faut gerer les blocs et les facteurs 
-      # a gerer comme dans composimp
-      # Gestion des matrices
+        # Attention l ordre des if est important
+        # Attention il faut gerer les blocs et les facteurs
+        # a gerer comme dans composimp
+        # Gestion des matrices
         if self.item.waitMatrice ():
-          from InterfaceQT4.monWidgetMatrice import MonWidgetMatrice
-          widget=MonWidgetMatrice(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          self.widget=widget
-          return widget
+            from InterfaceQT4.monWidgetMatrice import MonWidgetMatrice
+            widget=MonWidgetMatrice(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            self.widget=widget
+            return widget
 
-        #print "____________________________", monNom, self.item.waitCo() 
-        #print "____________________________", monNom, self.item.waitAssd() 
+        #print "____________________________", monNom, self.item.waitCo()
+        #print "____________________________", monNom, self.item.waitAssd()
         # Gestion d'une seule valeur (eventuellement un tuple ou un complexe)
         if maDefinition.into != [] and maDefinition.into != None:
-            if type(maDefinition.into) ==types.FunctionType : monInto=maDefinition.into() 
+            if type(maDefinition.into) ==types.FunctionType : monInto=maDefinition.into()
             else : monInto = maDefinition.into
 
 
         if maDefinition.max == 1 :
 
         # A verifier
-          if maDefinition.intoSug != [] and maDefinition.intoSug != None:
-            from InterfaceQT4.monWidgetCBIntoSug import MonWidgetCBIntoSug
-            widget=MonWidgetCBIntoSug(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          elif  maDefinition.into != [] and maDefinition.into != None:
-            if maDefinition.fenetreIhm=='menuDeroulant' :
-              from InterfaceQT4.monWidgetCB import MonWidgetCB
-              widget=MonWidgetCB(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-            elif len(monInto) < 4 :
-              from InterfaceQT4.monWidgetRadioButton import MonWidgetRadioButton
-              widget=MonWidgetRadioButton(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-            elif len(monInto) < 7 :
-              from InterfaceQT4.monWidget4a6RadioButton import MonWidget4a6RadioButton
-              widget=MonWidget4a6RadioButton(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-            else :
-              from InterfaceQT4.monWidgetCB import MonWidgetCB
-              widget=MonWidgetCB(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-
-          elif self.item.waitBool() :
-            from InterfaceQT4.monWidgetSimpBool import MonWidgetSimpBool
-            widget=MonWidgetSimpBool(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          elif self.item.waitFichier():
-            from InterfaceQT4.monWidgetSimpFichier import MonWidgetSimpFichier
-            widget=MonWidgetSimpFichier(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-
-          # PNPNPN - a faire
-          elif self.item.waitDate():
-            from InterfaceQT4.monWidgetDate import MonWidgetDate
-            widget=MonWidgetDate(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          elif self.item.waitHeure():
-            from InterfaceQT4.monWidgetHeure import MonWidgetHeure
-            widget=MonWidgetHeure(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-
-          elif self.item.waitTuple() :
-            num=self.item.object.definition.type[0].ntuple
-            nomDeLaClasse = 'MonWidgetSimpTuple'+str(num)
-            nomDuFichier  = 'InterfaceQT4.monWidgetSimpTupleN'
-            try :
-            #if 1 :
-               _temp = __import__(nomDuFichier, globals(), locals(), [nomDeLaClasse], 0)
-               #print (_temp)
-               MonWidgetSimpTuple =  getattr(_temp,nomDeLaClasse)
-            except :
-               print ("Pas de Tuple de longueur : ", num)
-            #   print ("Prevenir la maintenance ")
-            widget=MonWidgetSimpTuple(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-
-          elif self.item.waitComplex():
-            from InterfaceQT4.monWidgetSimpComplexe import MonWidgetSimpComplexe
-            widget=MonWidgetSimpComplexe(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-
-          elif self.item.waitCo():
-            if len(self.item.getSdAvantDuBonType()) == 0 :
-               from InterfaceQT4.monWidgetUniqueSDCO import MonWidgetUniqueSDCO
-               widget=MonWidgetUniqueSDCO(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-            else :      
-               from InterfaceQT4.monWidgetSDCOInto import MonWidgetSDCOInto
-               widget=MonWidgetSDCOInto(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          elif self.item.waitAssd():
-            
-            # PN - pour ne pas appeller trop souvent self.item.getSdAvantDuBonType()
-            if not (self.item.waitUserAssdEnCreation()) : maListe=self.item.getSdAvantDuBonType()
-            if self.item.waitUserAssdEnCreation() : 
-               from InterfaceQT4.monWidgetCreeUserAssd import MonWidgetCreeUserAssd
-               widget=MonWidgetCreeUserAssd(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-            #elif len(self.item.getSdAvantDuBonType()) == 0 :
-            elif len(maListe) == 0 :
-               from InterfaceQT4.monWidgetVide import MonWidgetVide
-               widget=MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-            #elif len(self.item.getSdAvantDuBonType()) < 4 :
-            elif len(maListe) < 4 :
-              from InterfaceQT4.monWidgetRadioButton import MonWidgetRadioButtonSD
-              widget=MonWidgetRadioButtonSD(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-            #elif len(self.item.getSdAvantDuBonType()) < 7 :
-            elif len(maListe) < 7 :
-              from InterfaceQT4.monWidget4a6RadioButton import MonWidget4a6RadioButtonSD
-              widget=MonWidget4a6RadioButtonSD(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            if maDefinition.intoSug != [] and maDefinition.intoSug != None:
+                from InterfaceQT4.monWidgetCBIntoSug import MonWidgetCBIntoSug
+                widget=MonWidgetCBIntoSug(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            elif  maDefinition.into != [] and maDefinition.into != None:
+                if maDefinition.fenetreIhm=='menuDeroulant' :
+                    from InterfaceQT4.monWidgetCB import MonWidgetCB
+                    widget=MonWidgetCB(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                elif len(monInto) < 4 :
+                    from InterfaceQT4.monWidgetRadioButton import MonWidgetRadioButton
+                    widget=MonWidgetRadioButton(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                elif len(monInto) < 7 :
+                    from InterfaceQT4.monWidget4a6RadioButton import MonWidget4a6RadioButton
+                    widget=MonWidget4a6RadioButton(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                else :
+                    from InterfaceQT4.monWidgetCB import MonWidgetCB
+                    widget=MonWidgetCB(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+
+            elif self.item.waitBool() :
+                from InterfaceQT4.monWidgetSimpBool import MonWidgetSimpBool
+                widget=MonWidgetSimpBool(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            elif self.item.waitFichier():
+                from InterfaceQT4.monWidgetSimpFichier import MonWidgetSimpFichier
+                widget=MonWidgetSimpFichier(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+
+            # PNPNPN - a faire
+            elif self.item.waitDate():
+                from InterfaceQT4.monWidgetDate import MonWidgetDate
+                widget=MonWidgetDate(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            elif self.item.waitHeure():
+                from InterfaceQT4.monWidgetHeure import MonWidgetHeure
+                widget=MonWidgetHeure(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+
+            elif self.item.waitTuple() :
+                num=self.item.object.definition.type[0].ntuple
+                nomDeLaClasse = 'MonWidgetSimpTuple'+str(num)
+                nomDuFichier  = 'InterfaceQT4.monWidgetSimpTupleN'
+                try :
+                #if 1 :
+                    _temp = __import__(nomDuFichier, globals(), locals(), [nomDeLaClasse], 0)
+                    #print (_temp)
+                    MonWidgetSimpTuple =  getattr(_temp,nomDeLaClasse)
+                    #print (MonWidgetSimpTuple)
+                except :
+                    print ("Pas de Tuple de longueur : ", num)
+                #   print ("Prevenir la maintenance ")
+                widget=MonWidgetSimpTuple(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+
+            elif self.item.waitComplex():
+                from InterfaceQT4.monWidgetSimpComplexe import MonWidgetSimpComplexe
+                widget=MonWidgetSimpComplexe(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+
+            elif self.item.waitCo():
+                if len(self.item.getSdAvantDuBonType()) == 0 :
+                    from InterfaceQT4.monWidgetUniqueSDCO import MonWidgetUniqueSDCO
+                    widget=MonWidgetUniqueSDCO(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                else :
+                    from InterfaceQT4.monWidgetSDCOInto import MonWidgetSDCOInto
+                    widget=MonWidgetSDCOInto(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            elif self.item.waitAssd():
+
+                # PN - pour ne pas appeller trop souvent self.item.getSdAvantDuBonType()
+                if not (self.item.waitUserAssdOrAssdMultipleEnCreation()) : maListe=self.item.getSdAvantDuBonType()
+                if self.item.waitUserAssdOrAssdMultipleEnCreation() :
+                    from InterfaceQT4.monWidgetCreeUserAssd import MonWidgetCreeUserAssd
+                    widget=MonWidgetCreeUserAssd(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                #elif len(self.item.getSdAvantDuBonType()) == 0 :
+                elif len(maListe) == 0 :
+                    from InterfaceQT4.monWidgetVide import MonWidgetVide
+                    widget=MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                #elif len(self.item.getSdAvantDuBonType()) < 4 :
+                elif len(maListe) < 4 :
+                    from InterfaceQT4.monWidgetRadioButton import MonWidgetRadioButtonSD
+                    widget=MonWidgetRadioButtonSD(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                #elif len(self.item.getSdAvantDuBonType()) < 7 :
+                elif len(maListe) < 7 :
+                    from InterfaceQT4.monWidget4a6RadioButton import MonWidget4a6RadioButtonSD
+                    widget=MonWidget4a6RadioButtonSD(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                else :
+                    from InterfaceQT4.monWidgetCB import MonWidgetCBSD
+                    widget=MonWidgetCBSD(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+
+            elif  self.item.waitSalome() and self.editor.salome:
+                from InterfaceQT4.monWidgetSimpSalome import MonWidgetSimpSalome
+                widget=MonWidgetSimpSalome(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+
+            elif self.item.waitTxm():
+                from InterfaceQT4.monWidgetSimpTxt import MonWidgetSimpTxt
+                widget=MonWidgetSimpTxt(self,maDefinition,monNom,monObjet,parentQt,maCommande)
             else :
-              from InterfaceQT4.monWidgetCB import MonWidgetCBSD
-              widget=MonWidgetCBSD(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          
-          elif  self.item.waitSalome() and self.editor.salome:
-            from InterfaceQT4.monWidgetSimpSalome import MonWidgetSimpSalome
-            widget=MonWidgetSimpSalome(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-
-          elif self.item.waitTxm():
-            from InterfaceQT4.monWidgetSimpTxt import MonWidgetSimpTxt
-            widget=MonWidgetSimpTxt(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          else :
-            from InterfaceQT4.monWidgetSimpBase import MonWidgetSimpBase
-            widget=MonWidgetSimpBase(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                from InterfaceQT4.monWidgetSimpBase import MonWidgetSimpBase
+                widget=MonWidgetSimpBase(self,maDefinition,monNom,monObjet,parentQt,maCommande)
 
         # Gestion des listes
         else :
-          if maDefinition.intoSug != [] and maDefinition.intoSug != None:
-               if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : 
-                 from InterfaceQT4.monWidgetIntoSug import MonWidgetIntoSug
-                 widget=MonWidgetIntoSug(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-               else :
-                  from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie
-                  widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          #if maDefinition.into != [] and maDefinition.into != None:
-          # Attention pas fini --> on attend une liste de ASSD avec ordre
-          elif self.item.waitAssd() and self.item.isListSansOrdreNiDoublon():
-               listeAAfficher = self.item.getSdAvantDuBonType()
-               if len(listeAAfficher) == 0:
-                 from InterfaceQT4.monWidgetVide import MonWidgetVide
-                 widget = MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-               else :
-                 from InterfaceQT4.monWidgetPlusieursInto import MonWidgetPlusieursInto
-                 widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          elif self.item.waitAssd()  and not self.item.waitUserAssdEnCreation() :
-               listeAAfficher = self.item.getSdAvantDuBonType()
-               #if not (self.item.waitUserAssdEnCreation()) : maListe=self.item.getSdAvantDuBonType()
-               mctype=maDefinition.type[0]
-               enable_salome_selection = self.editor.salome and \
-                      (('grma' in repr(mctype)) or ('grno' in repr(mctype)) or ('SalomeEntry' in repr(mctype)) or \
-                      (hasattr(mctype, "enable_salome_selection") and mctype.enable_salome_selection))
-               if enable_salome_selection:
-                  from InterfaceQT4.monWidgetPlusieursBase import MonWidgetPlusieursBase
-                  widget=MonWidgetPlusieursBase(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-               elif len(listeAAfficher) == 0:
-                 from InterfaceQT4.monWidgetVide import MonWidgetVide
-                 widget = MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-               elif self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : 
-                 from InterfaceQT4.monWidgetPlusieursASSDIntoOrdonne import MonWidgetPlusieursASSDIntoOrdonne
-                 widget=MonWidgetPlusieursASSDIntoOrdonne(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-               else :
-                  from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlieASSD
-                  widget=MonWidgetPlusieursPlieASSD(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          elif self.item.waitTuple() :
-            if self.item.object.definition.fenetreIhm == 'Tableau' :
-               from InterfaceQT4.monWidgetTableau import MonWidgetTableau
-               widget=MonWidgetTableau(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-            else  :
-               num=self.item.object.definition.type[0].ntuple
-               nomDeLaClasse = 'MonWidgetPlusieursTuple'+str(num)
-               nomDuFichier  = 'InterfaceQT4.monWidgetPlusieursTupleN'
-               #try:
-               if 1 :
-                  _temp = __import__(nomDuFichier, globals(), locals(), [nomDeLaClasse], 0)
-                  MonWidgetPlusieursTuple =  getattr(_temp,nomDeLaClasse)
-               #except :
-               #   print ("Pas de Tuple de longueur : ", num)
-               #   print ("Prevenir la maintenance ")
-               widget=MonWidgetPlusieursTuple(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-
-          elif self.item.hasInto():
-            if self.item.isListSansOrdreNiDoublon():
-               
-               if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : 
-                  from InterfaceQT4.monWidgetPlusieursInto import MonWidgetPlusieursInto
-                  widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-               else :
-                  from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie
-                  widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-            else :
-               if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : 
-                  from InterfaceQT4.monWidgetPlusieursIntoOrdonne import MonWidgetPlusieursIntoOrdonne
-                  widget=MonWidgetPlusieursIntoOrdonne(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-               else :
-                  from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie
-                  widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-          else :
-            if self.item.waitUserAssdEnCreation() : 
-               from InterfaceQT4.monWidgetCreeUserAssd import MonWidgetCreeListeUserAssd
-               widget=MonWidgetCreeListeUserAssd(self,maDefinition,monNom,monObjet,parentQt,maCommande)
-            elif self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees)  : 
-               from InterfaceQT4.monWidgetPlusieursBase import MonWidgetPlusieursBase
-               widget=MonWidgetPlusieursBase(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            if maDefinition.intoSug != [] and maDefinition.intoSug != None:
+                if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) :
+                    from InterfaceQT4.monWidgetIntoSug import MonWidgetIntoSug
+                    widget=MonWidgetIntoSug(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                else :
+                    from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie
+                    widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            #if maDefinition.into != [] and maDefinition.into != None:
+            # Attention pas fini --> on attend une liste de ASSD avec ordre
+            elif self.item.waitAssd() and self.item.isListSansOrdreNiDoublon():
+                listeAAfficher = self.item.getSdAvantDuBonType()
+                if len(listeAAfficher) == 0:
+                    from InterfaceQT4.monWidgetVide import MonWidgetVide
+                    widget = MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                else :
+                    from InterfaceQT4.monWidgetPlusieursInto import MonWidgetPlusieursInto
+                    widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            elif self.item.waitAssd()  and not self.item.waitUserAssdOrAssdMultipleEnCreation() :
+                listeAAfficher = self.item.getSdAvantDuBonType()
+                # a changer selon UserASSD ou UserASSDMultiple
+                mctype=maDefinition.type[0]
+                enable_salome_selection = self.editor.salome and \
+                       (('grma' in repr(mctype)) or ('grno' in repr(mctype)) or ('SalomeEntry' in repr(mctype)) or \
+                       (hasattr(mctype, "enable_salome_selection") and mctype.enable_salome_selection))
+                if enable_salome_selection:
+                    from InterfaceQT4.monWidgetPlusieursBase import MonWidgetPlusieursBase
+                    widget=MonWidgetPlusieursBase(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                elif len(listeAAfficher) == 0:
+                    from InterfaceQT4.monWidgetVide import MonWidgetVide
+                    widget = MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                elif self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) :
+                    from InterfaceQT4.monWidgetPlusieursASSDIntoOrdonne import MonWidgetPlusieursASSDIntoOrdonne
+                    widget=MonWidgetPlusieursASSDIntoOrdonne(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                else :
+                    from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlieASSD
+                    widget=MonWidgetPlusieursPlieASSD(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+            elif self.item.waitTuple() :
+                if self.item.object.definition.fenetreIhm == 'Tableau' :
+                    from InterfaceQT4.monWidgetTableau import MonWidgetTableau
+                    widget=MonWidgetTableau(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                else  :
+                    num=self.item.object.definition.type[0].ntuple
+                    nomDeLaClasse = 'MonWidgetPlusieursTuple'+str(num)
+                    nomDuFichier  = 'InterfaceQT4.monWidgetPlusieursTupleN'
+                    try:
+                        _temp = __import__(nomDuFichier, globals(), locals(), [nomDeLaClasse], 0)
+                        MonWidgetPlusieursTuple =  getattr(_temp,nomDeLaClasse)
+                    except :
+                        print ("Pas de Tuple de longueur : ", num)
+                        print ("Prevenir la maintenance ")
+                    widget=MonWidgetPlusieursTuple(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+
+            elif self.item.hasInto():
+                if self.item.isListSansOrdreNiDoublon():
+
+                    if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) :
+                        from InterfaceQT4.monWidgetPlusieursInto import MonWidgetPlusieursInto
+                        widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                    else :
+                        from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie
+                        widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                else :
+                    if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) :
+                        from InterfaceQT4.monWidgetPlusieursIntoOrdonne import MonWidgetPlusieursIntoOrdonne
+                        widget=MonWidgetPlusieursIntoOrdonne(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                    else :
+                        from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie
+                        widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande)
             else :
-               from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie
-               widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                if self.item.waitUserAssdOrAssdMultipleEnCreation() :
+                    from InterfaceQT4.monWidgetPlusieursCreeUserAssd import MonWidgetPlusieursCreeUserAssd
+                    widget=MonWidgetPlusieursCreeUserAssd(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                elif self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees)  :
+                    from InterfaceQT4.monWidgetPlusieursBase import MonWidgetPlusieursBase
+                    widget=MonWidgetPlusieursBase(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+                else :
+                    from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie
+                    widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande)
 
         self.widget=widget
         return widget
-         
-    
+
+
 class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem):
-  itemNode=Node
-
-  def init(self) :
-      self.expandable = 0
-  
-
-  #-----------------------------------------------
-  #
-  # Methodes liees aux informations sur le Panel
-  # ou au mot-clef simple
-  #
-  #-----------------------------------------------
-  # isList
-  # hasInto
-  # getMinMax
-  # getMultiplicite
-  # getIntervalle
-  # getListeValeurs
-  # getListePossible
-
-  def isList(self):
-      """
-          Cette methode indique si le mot cle simple attend une liste (valeur de retour 1)
-          ou s'il n'en attend pas (valeur de retour 0)
-
-          Deux cas principaux peuvent se presenter : avec validateurs ou bien sans.
-          Dans le cas sans validateur, l'information est donnee par l'attribut max
-          de la definition du mot cle.
-          Dans le cas avec validateur, il faut combiner l'information precedente avec
-          celle issue de l'appel de la methode isList sur le validateur.On utilisera
-          l'operateur ET pour effectuer cette combinaison (AndVal).
-      """
-      is_a_list=0
-      min,max = self.getMinMax()
-      assert (min <= max)
-      if max > 1 :
-                is_a_list=1
-      # Dans le cas avec validateurs, pour que le mot cle soit considere
-      # comme acceptant une liste, il faut que max soit superieur a 1
-      # ET que la methode isList du validateur retourne 1. Dans les autres cas
-      # on retournera 0 (n'attend pas de liste)
-      if self.definition.validators :
-         is_a_list= self.definition.validators.isList() * is_a_list
-      return is_a_list 
-
-  def isListSansOrdreNiDoublon(self):
-      if self.definition.homo=="SansOrdreNiDoublon" : return 1
-      return 0 
-
-
-  def hasInto(self):
-      """
-          Cette methode indique si le mot cle simple propose un choix (valeur de retour 1)
-          ou s'il n'en propose pas (valeur de retour 0)
-
-          Deux cas principaux peuvent se presenter : avec validateurs ou bien sans.
-          Dans le cas sans validateur, l'information est donnee par l'attribut into
-          de la definition du mot cle.
-          Dans le cas avec validateurs, pour que le mot cle soit considere
-          comme proposant un choix, il faut que into soit present OU
-          que la methode hasInto du validateur retourne 1. Dans les autres cas
-          on retournera 0 (ne propose pas de choix)
-      """
-      has_an_into=0
-      if self.definition.into:
-               has_an_into=1
-      elif self.definition.validators :
-         has_an_into= self.definition.validators.hasInto()
-      return has_an_into
-
-  def hasIntoSug(self):
-      if self.definition.intoSug: return 1
-      return 0
-
-
-  def getMinMax(self):
-      """ Retourne les valeurs min et max de la definition de object """
-      return self.object.getMinMax()
-
-  def getMultiplicite(self):
-      """ A preciser.
-          Retourne la multiplicite des valeurs affectees a l'objet
-          represente par l'item. Pour le moment retourne invariablement 1.
-      """
-      return 1
-
-  def getIntervalle(self):
-      """ 
-           Retourne le domaine de valeur attendu par l'objet represente 
-           par l'item.
-      """
-      return self.object.getintervalle()
-
-  def getListeValeurs(self) :
-      """ Retourne la liste des valeurs de object """
-      valeurs=self.object.getListeValeurs()
-      try :
-        if "R" in self.object.definition.type:
-           clef=self.object.getNomConcept()
-           if clef in self.appliEficas.dict_reels:
-              if type(valeurs) == tuple:
-                 valeurs_reelles=[]
-                 for val in valeurs :
-                    if val in self.appliEficas.dict_reels[clef]:
-                       valeurs_reelles.append(self.appliEficas.dict_reels[clef][val])
+    itemNode=Node
+
+    def init(self) :
+        self.expandable = 0
+
+
+    #-----------------------------------------------
+    #
+    # Methodes liees aux informations sur le Panel
+    # ou au mot-clef simple
+    #
+    #-----------------------------------------------
+    # isList
+    # hasInto
+    # getMinMax
+    # getMultiplicite
+    # getIntervalle
+    # getListeValeurs
+    # getListePossible
+
+    def isList(self):
+        """
+            Cette methode indique si le mot cle simple attend une liste (valeur de retour 1)
+            ou s'il n'en attend pas (valeur de retour 0)
+
+            Deux cas principaux peuvent se presenter : avec validateurs ou bien sans.
+            Dans le cas sans validateur, l'information est donnee par l'attribut max
+            de la definition du mot cle.
+            Dans le cas avec validateur, il faut combiner l'information precedente avec
+            celle issue de l'appel de la methode isList sur le validateur.On utilisera
+            l'operateur ET pour effectuer cette combinaison (AndVal).
+        """
+        is_a_list=0
+        min,max = self.getMinMax()
+        assert (min <= max)
+        if max > 1 :
+            is_a_list=1
+        # Dans le cas avec validateurs, pour que le mot cle soit considere
+        # comme acceptant une liste, il faut que max soit superieur a 1
+        # ET que la methode isList du validateur retourne 1. Dans les autres cas
+        # on retournera 0 (n'attend pas de liste)
+        if self.definition.validators :
+            is_a_list= self.definition.validators.isList() * is_a_list
+        return is_a_list
+
+    def isListSansOrdreNiDoublon(self):
+        if self.definition.homo=="SansOrdreNiDoublon" : return 1
+        return 0
+
+
+    def hasInto(self):
+        """
+            Cette methode indique si le mot cle simple propose un choix (valeur de retour 1)
+            ou s'il n'en propose pas (valeur de retour 0)
+
+            Deux cas principaux peuvent se presenter : avec validateurs ou bien sans.
+            Dans le cas sans validateur, l'information est donnee par l'attribut into
+            de la definition du mot cle.
+            Dans le cas avec validateurs, pour que le mot cle soit considere
+            comme proposant un choix, il faut que into soit present OU
+            que la methode hasInto du validateur retourne 1. Dans les autres cas
+            on retournera 0 (ne propose pas de choix)
+        """
+        has_an_into=0
+        if self.definition.into:
+            has_an_into=1
+        elif self.definition.validators :
+            has_an_into= self.definition.validators.hasInto()
+        return has_an_into
+
+    def hasIntoSug(self):
+        if self.definition.intoSug: return 1
+        return 0
+
+
+    def getMinMax(self):
+        """ Retourne les valeurs min et max de la definition de object """
+        return self.object.getMinMax()
+
+    def getMultiplicite(self):
+        """ A preciser.
+            Retourne la multiplicite des valeurs affectees a l'objet
+            represente par l'item. Pour le moment retourne invariablement 1.
+        """
+        return 1
+
+    def getIntervalle(self):
+        """
+             Retourne le domaine de valeur attendu par l'objet represente
+             par l'item.
+        """
+        return self.object.getintervalle()
+
+    def getListeValeurs(self) :
+        """ Retourne la liste des valeurs de object """
+        valeurs=self.object.getListeValeurs()
+        try :
+            if "R" in self.object.definition.type:
+                clef=self.object.getNomConcept()
+                if clef in self.appliEficas.dict_reels:
+                    if type(valeurs) == tuple:
+                        valeurs_reelles=[]
+                        for val in valeurs :
+                            if val in self.appliEficas.dict_reels[clef]:
+                                valeurs_reelles.append(self.appliEficas.dict_reels[clef][val])
+                            else :
+                                valeurs_reelles.append(val)
                     else :
-                       valeurs_reelles.append(val)
-              else :
-                 if valeurs in self.appliEficas.dict_reels[clef]:
-                    valeurs_reelles=self.appliEficas.dict_reels[clef][valeurs]
-              valeurs=valeurs_reelles
-      except :
-        pass
-      return valeurs
-    
-  def getListePossible(self,listeActuelle=[]):
-      if hasattr(self.definition.validators,'into'):
-         valeurspossibles = self.definition.validators.into 
-      else:
-         valeurspossibles = self.get_definition().into
-
-      if listeActuelle==[] : return valeurspossibles
-
-      #On ne garde que les items valides
-      listevalideitem=[]
-      if type(valeurspossibles) in (list,tuple) :
-         pass
-      else :
-         valeurspossibles=(valeurspossibles,)
-      for item in valeurspossibles:
-          encorevalide=self.valideItem(item)
-          if encorevalide :
-             listevalideitem.append(item)
-
-      #on ne garde que les choix possibles qui passent le test de valideListePartielle
-      listevalideliste=[]
-      for item in listevalideitem:
-          encorevalide=self.valideListePartielle(item,listeActuelle)
-          if encorevalide :
-              listevalideliste.append(item)
-      #print listevalideliste
-      return listevalideliste
-
-  def getListePossibleAvecSug(self,listeActuelle=[]):
-      if hasattr(self.definition,'intoSug'):
-         valeurspossibles = self.definition.intoSug 
-      else:
-         return listeActuelle
-
-      if listeActuelle==[] :  return valeurspossibles
-      valeurspossibles = valeurspossibles+listeActuelle
-
-      #On ne garde que les items valides
-      listevalideitem=[]
-      if type(valeurspossibles) in (list,tuple) :
-         pass
-      else :
-         valeurspossibles=(valeurspossibles,)
-      for item in valeurspossibles:
-          encorevalide=self.valideItem(item)
-          if encorevalide :
-             listevalideitem.append(item)
-
-      #on ne garde que les choix possibles qui passent le test de valideListePartielle
-      listevalideliste=[]
-      for item in listevalideitem:
-          encorevalide=self.valideListePartielle(item,listeActuelle)
-          if encorevalide :
-              listevalideliste.append(item)
-      return listevalideliste
-
-  def getListeParamPossible(self):
-      liste_param=[]
-      l1,l2=self.jdc.getParametresFonctionsAvantEtape(self.getEtape())
-      for param in self.object.jdc.params:
-          if param.nom not in l1 : continue
-          encorevalide=self.valideItem(param.valeur)
-          if encorevalide:
-             type_param=param.valeur.__class__.__name__
-             for typ in self.definition.type:
-                 if typ=='R':
-                     liste_param.append(param)
-                 if typ=='I' and type_param=='int':
-                     liste_param.append(param)
-                 if typ=='TXM' and type_param=='str':
-                     liste_param.append(repr(param))
-                 if ('grma' in repr(typ)) and type_param=='str':
-                     liste_param.append(param.nom)
-      return liste_param
-
-  #--------------------------------------------------
-  #
-  # Methodes liees a la validite des valeurs saisies
-  #
-  #---------------------------------------------------
-  # valideItem
-  # valideListePartielle
-  # valideListeComplete
-  # infoErreurItem
-  # infoErreurListe
-  # isInIntervalle
-  # isValid
-
-  def valideItem(self,item):
-      """
-        La validation est realisee directement par l'objet
-      """
-      return self.object.valideItem(item)
-     
-  def valideListePartielle(self,item,listecourante):
-      #On protege la liste en entree en la copiant
-      valeur=list(listecourante)
-      if item : valeur.append(item)
-      return self.object.validValeurPartielle(valeur)
-
-  def valideListeComplete (self,valeur):
-      return self.object.validValeur(valeur)
-
-  def infoErreurItem(self) :
-      commentaire=""
-      if self.definition.validators :
-         commentaire=self.definition.validators.infoErreurItem()
-      return commentaire
-      
-  def aide(self) :
-      commentaire=""
-      if self.definition.validators :
-         commentaire=self.definition.validators.aide()
-      return commentaire
-
-  def infoErreurListe(self) :
-      commentaire=""
-      if self.definition.validators :
-         commentaire=self.definition.validators.infoErreurListe()
-      return commentaire
-
-  def isInIntervalle(self,valeur):
-      """ 
-          Retourne 1 si la valeur est dans l'intervalle permis par
-          l'objet represente par l'item.
-      """
-      return self.valideItem(valeur)
-
-  def isValid(self):
-    valide=self.object.isValid()
-    return valide
-
-  #--------------------------------------------------
-  #
-  # Autres ...
-  #
-  #---------------------------------------------------
-  # getIconName
-  # getText
-  # setValeurCo
-  # getSdAvantDuBonType
-
-
-  def getIconName(self):
-    if self.appliEficas.maConfiguration.differencieSiDefaut and self.isValid():
-      if self.object.definition.defaut != None :
-         if self.object.valeur == self.object.definition.defaut : return "ast-green-dark-ball"
-         if self.object.definition.max > 1 and list(self.object.valeur) == list(self.object.definition.defaut) : return "ast-green-dark-ball"
-      return "ast-green-ball"
-    elif self.isValid():
-      return "ast-green-ball"
-    elif self.object.isOblig():
-      return "ast-red-ball"
-    else:
-      return "ast-yel-ball"
-
-  def getText(self):
-    """
-    Classe SIMPTreeItem
-    Retourne le texte a afficher dans l'arbre representant la valeur de l'objet
-    pointe par self 
-    """
-    text= self.object.getText()
-    if text == None : text=""
-    return text
-    
-
-  def setValeurCo(self,nomCo):
-      """
-      Affecte au MCS pointe par self l'objet de type CO et de nom nom_co
-      """
-      ret = self.object.setValeurCo(nomCo)
-      #print "setValeurCo",ret
-      return ret
-      
-  def getSdAvantDuBonType(self):
-      """
-      Retourne la liste des noms des SD presentes avant l'etape qui contient
-      le MCS pointe par self et du type requis par ce MCS
-      """
-      a=self.object.etape.parent.getSdAvantDuBonType(self.object.etape,self.object.definition.type)
-      if self.waitUserAssd() : l=self.jdc.getSdCreeParObjet(self.object.definition.type)
-      else :l=[]
-      return a+l
-
-  def getSdAvantDuBonTypePourTypeDeBase(self):
-      a=self.object.jdc.getSdAvantDuBonTypePourTypeDe_Base(self.object.etape,"LASSD")
-      return a
-
-
-
-  def deleteValeurCo(self,valeur=None):
-      """
-           Supprime la valeur du mot cle (de type CO)
-           il faut propager la destruction aux autres etapes
-      """
-      if not valeur : valeur=self.object.valeur
-      # XXX faut il vraiment appeler delSdprod ???
-      #self.object.etape.parent.delSdprod(valeur)
-      self.object.etape.parent.deleteConcept(valeur)
-
-  #-----------------------------------------------
-  #
-  # Methodes liees au type de l objet attendu
-  #
-  #-----------------------------------------------
-  # waitCo 
-  # waitGeom
-  # waitComplex
-  # waitReel
-  # waitAssd
-  # getType
-
-  def waitCo(self):
-      """
-      Methode booleenne qui retourne 1 si l'objet pointe par self
-      attend un objet de type ASSD qui n'existe pas encore (type CO()),
-      0 sinon
-      """
-      return self.object.waitCo()
-
-  def waitFichier(self):
-      maDefinition=self.object.definition
-      try : 
-        if ('Repertoire' in maDefinition.type[0]) or ('Fichier' in maDefinition.type[0]) :
-           return 1
-      except :
-           return 0
-
-  def waitGeom(self):
-      """
-      Methode booleenne qui retourne 1 si l'objet pointe par self
-      attend un objet GEOM, 0 sinon
-      """
-      return self.object.waitGeom()
-
-  def waitTxm(self):
-     return self.object.waitTxm()
-
-    
-  def waitComplex(self):
-      """ Methode booleenne qui retourne 1 si l'objet pointe par self
-      attend un complexe, 0 sinon """
-      if 'C' in self.object.definition.type:
-          return 1
-      else:
-          return 0
-
-  def waitReel(self):
-      """ Methode booleenne qui retourne 1 si l'objet pointe par self
-      attend un reel, 0 sinon """
-      if 'R' in self.object.definition.type:
-          return 1
-      else:
-          return 0
-
-  def waitTuple(self) :
-      return  self.object.waitTuple()
-
-  def waitDate(self):
-      """ Methode booleenne qui retourne 1 si l'objet pointe par self
-      attend un reel, 0 sinon """
-      if 'DateHHMMAAAA' in self.object.definition.type:
-          return 1
-      else:
-          return 0
-        
-  def waitHeure(self):
-      """ Methode booleenne qui retourne 1 si l'objet pointe par self
-      attend un reel, 0 sinon """
-      if 'HeureHHMMSS' in self.object.definition.type:
-          return 1
-      else:
-          return 0
-        
-        
-        
-  def waitTuple(self):
-      """ Methode booleenne qui retourne 1 si l'objet pointe par self
-      attend un Tuple, 0 sinon """
-      for ss_type in self.object.definition.type:
-          if repr(ss_type).find('Tuple') != -1 :
-             return 1
-      return 0
-
-  def waitMatrice(self):
-      """ Methode booleenne qui retourne 1 si l'objet pointe par self
-      attend un Tuple, 0 sinon """
-      for ss_type in self.object.definition.type:
-          if repr(ss_type).find('Matrice') != -1 :
-             return 1
-      return 0
-
-  def waitAssd(self):
-      """Methode booleenne qui retourne 1 si l'objet pointe par self
-      attend un objet de type ASSD ou derive, 0 sinon """
-      return self.object.waitAssd()
-    
-  def waitAssdOrTypeBase(self) :
-      boo=0
-      if len(self.object.definition.type) > 1 :
-         if self.waitReel() :
-            boo = 1
-         if 'I' in self.object.definition.type :
-            boo = 1
-      return boo
-
-  def waitSalome(self):
-      monType = self.object.definition.type[0]
-      if 'grma' in repr(monType) : return True
-      if 'grno' in repr(monType) : return True
-      try :
-         if issubclass(monType, SalomeEntry) : return True
-      except :
-         pass
-      return False
-   
-  def getType(self):
-      """ 
-          Retourne le type de valeur attendu par l'objet represente par l'item.
-      """
-      return self.object.getType()
-
-  #-----------------------------------------------------
-  #
-  # Methodes liees  a l evaluation de la valeur saisie
-  #
-  #-----------------------------------------------------
-  # evalValeur
-  # evalValeurItem
-  # isCO
-  # traiteReel
-
-  def evalValeur(self,valeur):
-      """ Lance l'interpretation de 'valeur' (chaine de caracteres) comme valeur de self :
-             - retourne l'objet associe si on a pu interpreter (entier, reel, ASSD,...)
-             - retourne 'valeur' (chaine de caracteres) sinon
-      """
-      newvaleur=self.evalVal(valeur)
-      return newvaleur,1
-
-
-  def evalValeurItem(self,valeur):
-      """ Lance l'interpretation de 'valeur' qui doit ne pas etre un tuple 
-          - va retourner la valeur de retour et la validite
-            selon le type de l objet attendu
-          - traite les reels et les parametres 
-      """ 
-      #print "evalValeurItem",valeur
-      if valeur==None or valeur == "" :
-         return None,0
-      validite=1
-      if self.waitReel():
-             valeurinter = self.traiteReel(valeur)
-             if valeurinter != None :
+                        if valeurs in self.appliEficas.dict_reels[clef]:
+                            valeurs_reelles=self.appliEficas.dict_reels[clef][valeurs]
+                    valeurs=valeurs_reelles
+        except :
+            pass
+        return valeurs
+
+    def getListePossible(self,listeActuelle=[]):
+        if hasattr(self.definition.validators,'into'):
+            valeurspossibles = self.definition.validators.into
+        else:
+            valeurspossibles = self.get_definition().into
+
+        if listeActuelle==[] : return valeurspossibles
+
+        #On ne garde que les items valides
+        listevalideitem=[]
+        if type(valeurspossibles) in (list,tuple) :
+            pass
+        else :
+            valeurspossibles=(valeurspossibles,)
+        for item in valeurspossibles:
+            encorevalide=self.valideItem(item)
+            if encorevalide :
+                listevalideitem.append(item)
+
+        #on ne garde que les choix possibles qui passent le test de valideListePartielle
+        listevalideliste=[]
+        for item in listevalideitem:
+            encorevalide=self.valideListePartielle(item,listeActuelle)
+            if encorevalide :
+                listevalideliste.append(item)
+        #print listevalideliste
+        return listevalideliste
+
+    def getListePossibleAvecSug(self,listeActuelle=[]):
+        if hasattr(self.definition,'intoSug'):
+            valeurspossibles = self.definition.intoSug
+        else:
+            return listeActuelle
+
+        if listeActuelle==[] :  return valeurspossibles
+        valeurspossibles = valeurspossibles+listeActuelle
+
+        #On ne garde que les items valides
+        listevalideitem=[]
+        if type(valeurspossibles) in (list,tuple) :
+            pass
+        else :
+            valeurspossibles=(valeurspossibles,)
+        for item in valeurspossibles:
+            encorevalide=self.valideItem(item)
+            if encorevalide :
+                listevalideitem.append(item)
+
+        #on ne garde que les choix possibles qui passent le test de valideListePartielle
+        listevalideliste=[]
+        for item in listevalideitem:
+            encorevalide=self.valideListePartielle(item,listeActuelle)
+            if encorevalide :
+                listevalideliste.append(item)
+        return listevalideliste
+
+    def getListeParamPossible(self):
+        liste_param=[]
+        l1,l2=self.jdc.getParametresFonctionsAvantEtape(self.getEtape())
+        for param in self.object.jdc.params:
+            if param.nom not in l1 : continue
+            encorevalide=self.valideItem(param.valeur)
+            if encorevalide:
+                type_param=param.valeur.__class__.__name__
+                for typ in self.definition.type:
+                    if typ=='R':
+                        liste_param.append(param)
+                    if typ=='I' and type_param=='int':
+                        liste_param.append(param)
+                    if typ=='TXM' and type_param=='str':
+                        liste_param.append(repr(param))
+                    if ('grma' in repr(typ)) and type_param=='str':
+                        liste_param.append(param.nom)
+        return liste_param
+
+    #--------------------------------------------------
+    #
+    # Methodes liees a la validite des valeurs saisies
+    #
+    #---------------------------------------------------
+    # valideItem
+    # valideListePartielle
+    # valideListeComplete
+    # infoErreurItem
+    # infoErreurListe
+    # isInIntervalle
+    # isValid
+
+    def valideItem(self,item):
+        """
+          La validation est realisee directement par l'objet
+        """
+        return self.object.valideItem(item)
+
+    def valideListePartielle(self,item,listecourante):
+        #On protege la liste en entree en la copiant
+        valeur=list(listecourante)
+        if item : valeur.append(item)
+        return self.object.validValeurPartielle(valeur)
+
+    def valideListeComplete (self,valeur):
+        return self.object.validValeur(valeur)
+
+    def infoErreurItem(self) :
+        commentaire=""
+        if self.definition.validators :
+            commentaire=self.definition.validators.infoErreurItem()
+        return commentaire
+
+    def aide(self) :
+        commentaire=""
+        if self.definition.validators :
+            commentaire=self.definition.validators.aide()
+        return commentaire
+
+    def infoErreurListe(self) :
+        commentaire=""
+        if self.definition.validators :
+            commentaire=self.definition.validators.infoErreurListe()
+        return commentaire
+
+    def isInIntervalle(self,valeur):
+        """
+            Retourne 1 si la valeur est dans l'intervalle permis par
+            l'objet represente par l'item.
+        """
+        return self.valideItem(valeur)
+
+    def isValid(self):
+        valide=self.object.isValid()
+        return valide
+
+    #--------------------------------------------------
+    #
+    # Autres ...
+    #
+    #---------------------------------------------------
+    # getIconName
+    # getText
+    # setValeurCo
+    # getSdAvantDuBonType
+
+
+    def getIconName(self):
+        if self.appliEficas.maConfiguration.differencieSiDefaut and self.isValid():
+            if self.object.definition.defaut != None :
+                if self.object.valeur == self.object.definition.defaut : return "ast-green-dark-ball"
+                if self.object.definition.max > 1 and list(self.object.valeur) == list(self.object.definition.defaut) : return "ast-green-dark-ball"
+            return "ast-green-ball"
+        elif self.isValid():
+            return "ast-green-ball"
+        elif self.object.isOblig():
+            return "ast-red-ball"
+        else:
+            return "ast-yel-ball"
+
+    def getText(self):
+        """
+        Classe SIMPTreeItem
+        Retourne le texte a afficher dans l'arbre representant la valeur de l'objet
+        pointe par self
+        """
+        if  self.waitUserAssdMultiple() or self.object.waitUserAssd() or self.object.waitAssd(): return self.object.nom
+        text = self.object.getText()
+        if text == None : text=""
+        return text
+
+
+    def setValeurCo(self,nomCo):
+        """
+        Affecte au MCS pointe par self l'objet de type CO et de nom nom_co
+        """
+        ret = self.object.setValeurCo(nomCo)
+        #print "setValeurCo",ret
+        return ret
+
+    def getSdAvantDuBonType(self):
+        """
+        Retourne la liste des noms des SD presentes avant l'etape qui contient
+        le MCS pointe par self et du type requis par ce MCS
+        """
+        # A changer pour tenir compte des UserASSDMultiple
+        # ici on passe par parent pour avoir le bon type
+        #if  self.waitUserAssdMultiple() :
+        #    l=self.object.parent.getSdCreeParObjetAvecFiltre(self.object)
+        #    return l
+        if  self.waitUserAssdMultiple() :
+            l=self.object.getUserAssdPossible()
+            return l
+        a=self.object.etape.parent.getSdAvantDuBonType(self.object.etape,self.object.definition.type)
+        if self.waitUserAssd() : l=self.jdc.getSdCreeParObjet(self.object.definition.type)
+        else :l=[]
+        return a+l
+
+    def getSdAvantDuBonTypePourTypeDeBase(self):
+        a=self.object.jdc.getSdAvantDuBonTypePourTypeDe_Base(self.object.etape,"LASSD")
+        return a
+
+    def deleteValeurCo(self,valeur=None):
+        """
+             Supprime la valeur du mot cle (de type CO)
+             il faut propager la destruction aux autres etapes
+        """
+        if not valeur : valeur=self.object.valeur
+        # XXX faut il vraiment appeler delSdprod ???
+        #self.object.etape.parent.delSdprod(valeur)
+        self.object.etape.parent.deleteConcept(valeur)
+
+    #-----------------------------------------------
+    #
+    # Methodes liees au type de l objet attendu
+    #
+    #-----------------------------------------------
+    # waitCo
+    # waitGeom
+    # waitComplex
+    # waitReel
+    # waitAssd
+    # getType
+
+    def waitCo(self):
+        """
+        Methode booleenne qui retourne 1 si l'objet pointe par self
+        attend un objet de type ASSD qui n'existe pas encore (type CO()),
+        0 sinon
+        """
+        return self.object.waitCo()
+
+    def waitFichier(self):
+        maDefinition=self.object.definition
+        try :
+            if ('Repertoire' in maDefinition.type[0]) or ('Fichier' in maDefinition.type[0]) :
+                return 1
+        except :
+            return 0
+
+    def waitGeom(self):
+        """
+        Methode booleenne qui retourne 1 si l'objet pointe par self
+        attend un objet GEOM, 0 sinon
+        """
+        return self.object.waitGeom()
+
+    def waitTxm(self):
+        return self.object.waitTxm()
+
+
+    def waitComplex(self):
+        """ Methode booleenne qui retourne 1 si l'objet pointe par self
+        attend un complexe, 0 sinon """
+        if 'C' in self.object.definition.type:
+            return 1
+        else:
+            return 0
+
+    def waitReel(self):
+        """ Methode booleenne qui retourne 1 si l'objet pointe par self
+        attend un reel, 0 sinon """
+        if 'R' in self.object.definition.type:
+            return 1
+        else:
+            return 0
+
+    def waitTuple(self) :
+        return  self.object.waitTuple()
+
+    def waitDate(self):
+        """ Methode booleenne qui retourne 1 si l'objet pointe par self
+        attend un reel, 0 sinon """
+        if 'DateHHMMAAAA' in self.object.definition.type:
+            return 1
+        else:
+            return 0
+
+    def waitHeure(self):
+        """ Methode booleenne qui retourne 1 si l'objet pointe par self
+        attend un reel, 0 sinon """
+        if 'HeureHHMMSS' in self.object.definition.type:
+            return 1
+        else:
+            return 0
+
+
+
+    def waitTuple(self):
+        """ Methode booleenne qui retourne 1 si l'objet pointe par self
+        attend un Tuple, 0 sinon """
+        for ss_type in self.object.definition.type:
+            if repr(ss_type).find('Tuple') != -1 :
+                return 1
+        return 0
+
+    def waitMatrice(self):
+        """ Methode booleenne qui retourne 1 si l'objet pointe par self
+        attend un Tuple, 0 sinon """
+        for ss_type in self.object.definition.type:
+            if repr(ss_type).find('Matrice') != -1 :
+                return 1
+        return 0
+
+    def waitAssd(self):
+        """Methode booleenne qui retourne 1 si l'objet pointe par self
+        attend un objet de type ASSD ou derive, 0 sinon """
+        return self.object.waitAssd()
+
+    def waitAssdOrTypeBase(self) :
+        boo=0
+        if len(self.object.definition.type) > 1 :
+            if self.waitReel() :
+                boo = 1
+            if 'I' in self.object.definition.type :
+                boo = 1
+        return boo
+
+    def waitSalome(self):
+        monType = self.object.definition.type[0]
+        if 'grma' in repr(monType) : return True
+        if 'grno' in repr(monType) : return True
+        try :
+            if issubclass(monType, SalomeEntry) : return True
+        except :
+            pass
+        return False
+
+    def getType(self):
+        """
+            Retourne le type de valeur attendu par l'objet represente par l'item.
+        """
+        return self.object.getType()
+
+    #-----------------------------------------------------
+    #
+    # Methodes liees  a l evaluation de la valeur saisie
+    #
+    #-----------------------------------------------------
+    # evalValeur
+    # evalValeurItem
+    # isCO
+    # traiteReel
+
+    def evalValeur(self,valeur):
+        """ Lance l'interpretation de 'valeur' (chaine de caracteres) comme valeur de self :
+               - retourne l'objet associe si on a pu interpreter (entier, reel, ASSD,...)
+               - retourne 'valeur' (chaine de caracteres) sinon
+        """
+        newvaleur=self.evalVal(valeur)
+        return newvaleur,1
+
+
+    def evalValeurItem(self,valeur):
+        """ Lance l'interpretation de 'valeur' qui doit ne pas etre un tuple
+            - va retourner la valeur de retour et la validite
+              selon le type de l objet attendu
+            - traite les reels et les parametres
+        """
+        #print "evalValeurItem",valeur
+        if valeur==None or valeur == "" :
+            return None,0
+        validite=1
+        if self.waitReel():
+            valeurinter = self.traiteReel(valeur)
+            if valeurinter != None :
                 valeurretour,validite= self.object.evalValeur(valeurinter)
-             else:
+            else:
                 valeurretour,validite= self.object.evalValeur(valeur)
-      elif self.waitGeom():
-             valeurretour,validite = valeur,1
-      else :
-             valeurretour,validite= self.object.evalValeur(valeur)
-
-      if validite == 0:
-         if (type(valeur) == bytes  or type(valeur) == str )and self.object.waitTxm():
-            essai_valeur="'" + valeur + "'"
-            valeurretour,validite= self.object.evalValeur(essai_valeur)
-
-      if hasattr(valeurretour,'__class__'):
-         #if valeurretour.__class__.__name__ in ('PARAMETRE','PARAMETRE_EVAL'):
-         if valeurretour.__class__.__name__ in ('PARAMETRE',):
-            validite=1
-
-      #if self.waitCo():
-         # CCAR : il ne faut pas essayer de creer un concept
-         # il faut simplement en chercher un existant ce qui a du etre fait par self.object.evalValeur(valeur)
-         #try:
-            #valeurretour=Accas.CO(valeur)
-         #except:
-            #valeurretour=None
-            #validite=0
-      # on est dans le cas ou on a evalue et ou on n'aurait pas du
-      if self.object.waitTxm() :
-          if type(valeurretour) != bytes:
-             valeurretour=str(valeur)
-             validite=1
-      return valeurretour,validite
-      
-  def isCO(self,valeur=None):
-      """
-         Indique si valeur est un concept produit de la macro
-         Cette methode n'a de sens que pour un MCSIMP d'une MACRO
-         Si valeur vaut None on teste la valeur du mot cle
-      """
-      # Pour savoir si un concept est un nouveau concept de macro
-      # on regarde s'il est present dans l'attribut sdprods de l'etape
-      # ou si son nom de classe est CO.
-      # Il faut faire les 2 tests car une macro non valide peut etre
-      # dans un etat pas tres catholique avec des CO pas encore types
-      # et donc pas dans sdprods (resultat d'une exception dans typeSDProd)
-      if not valeur:valeur=self.object.valeur
-      if valeur in self.object.etape.sdprods:return 1
-      #if type(valeur) is not types.InstanceType:return 0
-      if type(valeur) is not object:return 0
-      if valeur.__class__.__name__ == 'CO':return 1
-      return 0
-
-  def isParam(self,valeur) :
-      for param in self.jdc.params:
-          if (repr(param) == valeur):
-             return 1
-      return 0
-
-  def traiteReel(self,valeur):
-      """
-      Cette fonction a pour but de rajouter le '.' en fin de chaine pour un reel
-      ou de detecter si on fait reference a un concept produit par DEFI_VALEUR
-      ou un EVAL ...
-      """
-      valeur = valeur.strip()
-      liste_reels = self.getSdAvantDuBonType()
-      if valeur in liste_reels:
-          return valeur
-      if len(valeur) >= 3 :
-          if valeur[0:4] == 'EVAL' :
-              # on a trouve un EVAL --> on retourne directement la valeur
-              return valeur
-      if valeur.find('.') == -1 :
-          # aucun '.' n'a ete trouve dans valeur --> on en rajoute un a la fin
-          if (self.isParam(valeur)):
-              return valeur
-          else:
-              if valeur.find('e') != -1:
-                 # Notation scientifique ?
-                 try :
-                    r=eval(valeur)
-                    return valeur
-                 except :
-                    return None
-              else :
-                 return valeur+'.'
-      else:
-          return valeur
-        
+        elif self.waitGeom():
+            valeurretour,validite = valeur,1
+        else :
+            valeurretour,validite= self.object.evalValeur(valeur)
+
+        if validite == 0:
+            if (type(valeur) == bytes  or type(valeur) == str )and self.object.waitTxm():
+                essai_valeur="'" + valeur + "'"
+                valeurretour,validite= self.object.evalValeur(essai_valeur)
+
+        if hasattr(valeurretour,'__class__'):
+            #if valeurretour.__class__.__name__ in ('PARAMETRE','PARAMETRE_EVAL'):
+            if valeurretour.__class__.__name__ in ('PARAMETRE',):
+                validite=1
+
+        #if self.waitCo():
+            # CCAR : il ne faut pas essayer de creer un concept
+            # il faut simplement en chercher un existant ce qui a du etre fait par self.object.evalValeur(valeur)
+            #try:
+                #valeurretour=Accas.CO(valeur)
+            #except:
+                #valeurretour=None
+                #validite=0
+        # on est dans le cas ou on a evalue et ou on n'aurait pas du
+        if self.object.waitTxm() :
+            if type(valeurretour) != bytes:
+                valeurretour=str(valeur)
+                validite=1
+        return valeurretour,validite
+
+    def isCO(self,valeur=None):
+        """
+           Indique si valeur est un concept produit de la macro
+           Cette methode n'a de sens que pour un MCSIMP d'une MACRO
+           Si valeur vaut None on teste la valeur du mot cle
+        """
+        # Pour savoir si un concept est un nouveau concept de macro
+        # on regarde s'il est present dans l'attribut sdprods de l'etape
+        # ou si son nom de classe est CO.
+        # Il faut faire les 2 tests car une macro non valide peut etre
+        # dans un etat pas tres catholique avec des CO pas encore types
+        # et donc pas dans sdprods (resultat d'une exception dans typeSDProd)
+        if not valeur:valeur=self.object.valeur
+        if valeur in self.object.etape.sdprods:return 1
+        #if type(valeur) is not types.InstanceType:return 0
+        if type(valeur) is not object:return 0
+        if valeur.__class__.__name__ == 'CO':return 1
+        return 0
+
+    def isParam(self,valeur) :
+        for param in self.jdc.params:
+            if (repr(param) == valeur):
+                return 1
+        return 0
+
+    def traiteReel(self,valeur):
+        """
+        Cette fonction a pour but de rajouter le '.' en fin de chaine pour un reel
+        ou de detecter si on fait reference a un concept produit par DEFI_VALEUR
+        ou un EVAL ...
+        """
+        valeur = valeur.strip()
+        liste_reels = self.getSdAvantDuBonType()
+        if valeur in liste_reels:
+            return valeur
+        if len(valeur) >= 3 :
+            if valeur[0:4] == 'EVAL' :
+                # on a trouve un EVAL --> on retourne directement la valeur
+                return valeur
+        if valeur.find('.') == -1 :
+            # aucun '.' n'a ete trouve dans valeur --> on en rajoute un a la fin
+            if (self.isParam(valeur)):
+                return valeur
+            else:
+                if valeur.find('e') != -1:
+                    # Notation scientifique ?
+                    try :
+                        r=eval(valeur)
+                        return valeur
+                    except :
+                        return None
+                else :
+                    return valeur+'.'
+        else:
+            return valeur
+
 
 import Accas
 treeitem = SIMPTreeItem
 objet = Accas.MCSIMP
-
index 08b0b2c4a394a266cad79c94f4205a406886907a..0ff50144919cbbf3db7028a108746ee554508e0e 100644 (file)
@@ -23,9 +23,9 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import range
-   from builtins import object
+    from builtins import str
+    from builtins import range
+    from builtins import object
 except : pass
 
 import os, sys,  types, re
@@ -36,224 +36,224 @@ from Extensions.i18n import tr
 
 class configBase(object):
 
-  #-------------------------------
-  def __init__(self,appliEficas,repIni):
-  #-------------------------------
-
-  # Classe de base permettant de lire, afficher
-  # et sauvegarder les fichiers utilisateurs 
-  # On a deux directories : la directory generale (Repertoire d install + Nom du code
-  #                       Par exemple : ~/Install_Eficas/EficasV1_14/Openturns_Wrapper
-  # et la directorie de l utilisateur 
-  #                      HOME/.Eficas_Openturns
-  # Le fichier prefs.py va etre lu dans la directory generale 
-  #         puis surcharge eventuellement par celui contenu dans ${PREFS_CATA_$CODE} 
-  #         par celui de l utilisateur
-  # le fichier de catalogue va etre lu dans la directory de l utilisateur s il exite
-  # dans le fichier general sinon
-
-      self.appliEficas   = appliEficas  
-      self.code    = appliEficas.code
-      self.salome  = appliEficas.salome
-      if self.salome : self.name="editeur_salome.ini"
-      else           : self.name="editeur.ini"
-      self.rep_mat = None
-      self.repIni  = repIni
-     
-      if self.code == None : self.code=''
-      #if sys.platform[0:5]=="linux" :
-              #self.rep_user   = os.path.join(os.environ['HOME'],'.config/Eficas',self.code)
-      self.rep_user   = os.path.join(os.path.expanduser("~"),'.config/Eficas',self.code)
-      #else :
-      #        self.rep_user   = os.path.join('C:/','.config/Eficas',self.code)
-
-
-      self.setValeursParDefaut()
-      
-      if self.code != '' :
-         self.lectureFichierIniStandard()
-         self.lectureFichierIniIntegrateur()
-         self.lectureFichierIniUtilisateur()
-
-      if self.boutonDsMenuBar:
-         self.closeAutreCommande = True
-         self.closeFrameRechercheCommande = True
-
-      #Particularite des schemas MAP
-      if hasattr(self,'make_ssCode'): self.make_ssCode(self.ssCode)
-
-      #if self.appliEficas: self.parent=appliEficas.top
-      #else:        self.parent=None
-
-      if not os.path.isdir(self.savedir) :
-        if sys.platform[0:5]=="linux" :
-          #self.savedir=os.environ['HOME']
-          self.savedir=os.path.expanduser("~")
-        else:
-          self.savedir='C:/'
-      
-
-
-  def setValeursParDefaut(self):
-  #-----------------------------
-  
-      # Valeurs par defaut
-      if not os.path.isdir(self.rep_user) : os.makedirs(self.rep_user)
-      self.path_doc     = os.path.abspath(os.path.join(self.repIni,'..','Doc'))
-      self.exec_acrobat = 'acroread'
-      nomDir="Eficas_"+self.code
-      #if sys.platform[0:5]=="linux" :
-        #self.savedir   = os.path.abspath(os.path.join(os.environ['HOME'],nomDir))
-      self.savedir=os.path.join(os.path.expanduser("~"),'.config/Eficas',self.code)
-      #else:
-      #  self.savedir = os.path.abspath('C:/')
-      self.modeNouvCommande='initial'
-      self.affiche="alpha"
-      self.closeAutreCommande = False
-      self.closeFrameRechercheCommande = False
-      self.closeFrameRechercheCommandeSurPageDesCommandes = False
-      self.closeEntete = False
-      self.closeArbre = False
-      self.demandeLangue=False
-      self.suiteTelemac=False
-      self.nombreDeBoutonParLigne=0
-      self.translatorFichier=None
-      self.dicoImages= {}
-      self.dicoIcones= {}
-      self.afficheCommandesPliees = True
-      self.afficheFirstPlies =  False
-      self.simpleClic = False
-      self.afficheOptionnelVide=False
-      self.afficheListesPliees=True
-      self.boutonDsMenuBar=False
-      self.ficIcones=None
-      self.repIcones=None
-      self.differencieSiDefaut=False
-      self.typeDeCata='Python'
-      self.closeParenthese=False
-      self.closeOptionnel=False
-      self.afficheFactOptionnel=False
-      self.enleverActionStructures=False
-      self.enleverPoubellePourCommande=False
-      self.enleverParametres=False
-      self.enleverSupprimer=False
-      self.ajoutExecution=False
-      self.utilParExtensions=[]
-      self.rendVisiblesLesCaches=False
-      self.pasDeMCOptionnels=False
-
-      self.dumpXSD=False
-      self.withXSD=False
-      self.afficheIhm=True
-
-
-
-  #--------------------------------------
-  def lectureFichierIniStandard(self):
-  #--------------------------------------
-
-      name='prefs_'+self.appliEficas.code
-      try :
-        prefsCode=__import__(name)
-      except :
-        self.catalogues=[]
-        print ('pas de fichier de prefs')
-        return
-      for k in dir(prefsCode):
-          if (k[0:1] != "__" and k[-1:-2] !='__'):
-             valeur=getattr(prefsCode,k)
-             setattr(self,k,valeur)
-       
-
-
-  #--------------------------------------
-  def lectureFichierIniIntegrateur(self):
-  #--------------------------------------
-  # Verifie l'existence du fichier "standard"
-  # appelle la lecture de ce fichier
-      clef="PREFS_CATA_"+self.code
-      try :
-        repIntegrateur=os.path.abspath(os.environ[clef])
-      except :
-        return
-      
-      fic_ini_integrateur=os.path.join(repIntegrateur,self.name)
-      if not os.path.isfile(fic_ini_integrateur): return
-      txt = read_file(fic_ini_integrateur)
-      d=locals()
-      try:
-         exec(txt, d)
-      except :
-         try :
-           from PyQt5.QtWidgets import QMessageBox
-           QMessageBox.critical( None, tr("Import du fichier de Configuration"), 
-                       tr("Erreur a la lecture du fichier de configuration %s " , str(fic_ini_integrateur)))
-         except : 
-           print("Erreur a la lecture du fichier de configuration %s " , str(fic_ini_integrateur))
-         return
-      self.labels_eficas.append('rep_aide')
-      for k in self.labels_eficas :
-         try :
-            setattr(self,k,d[k])
-         except :
-            pass
-      #Glut pour les repertoires materiaux
-      #et pour la doc
-      for k in d :
-          if (k[0:8]=="rep_mat_") or (k[0:8]=="rep_doc_"):
-             setattr(self,k,d[k])
-
-
-  #--------------------------------------
-  def lectureFichierIniUtilisateur(self):
-  #--------------------------------------
-  # Surcharge les parametres standards par les parametres utilisateur s'ils existent
-      self.fic_ini_utilisateur = os.path.join(self.rep_user,self.name)
-      if not os.path.isfile(self.fic_ini_utilisateur): return
-
-      txt = read_file(self.fic_ini_utilisateur)
-      d=locals()
-      try:
-         exec(txt, d)
-      except :
-         l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2])
-         try :
-           from PyQt5.QtWidgets import QMessageBox
-           QMessageBox.critical( None, tr("Import du fichier de Configuration"), 
-                       tr("Erreur a la lecture du fichier de configuration %s " , str(fic_ini_integrateur)))
-         except :
-            print ("Erreur a la lecture du fichier de configuration %s " , str(fic_ini_integrateur))
-      for k in self.labels_user :
-         try :
-            setattr(self,k,d[k])
-         except :
-            pass
-      for k in d :
-          if (k[0:8]=="rep_mat_") or (k[0:8]=="rep_doc_"):
-             setattr(self,k,d[k])
-
-  #--------------------------------------
-  def saveParams(self):
-  #--------------------------------------
-  # sauvegarde
-  # les nouveaux parametres dans le fichier de configuration utilisateur
-  #
-      texte=""
-      for clef in self.labels_user :
-          if hasattr(self,clef):
-             valeur=getattr(self,clef)
-             texte= texte + clef+"     = " + repr(valeur) +"\n"
-      #Glut pour les repertoires materiaux
-      #et pour la doc
-      for k in dir(self):
-          if (k[0:8]=="rep_mat_") or (k[0:8]=="rep_doc_"):
-             valeur=getattr(self,k)
-             texte= texte + k+"        = " + repr(valeur) +"\n"
-
-      f=open(self.fic_ini_utilisateur,'w+')
-      f.write(texte) 
-      f.close()
+    #-------------------------------
+    def __init__(self,appliEficas,repIni):
+    #-------------------------------
+
+    # Classe de base permettant de lire, afficher
+    # et sauvegarder les fichiers utilisateurs
+    # On a deux directories : la directory generale (Repertoire d install + Nom du code
+    #                       Par exemple : ~/Install_Eficas/EficasV1_14/Openturns_Wrapper
+    # et la directorie de l utilisateur
+    #                       HOME/.Eficas_Openturns
+    # Le fichier prefs.py va etre lu dans la directory generale
+    #         puis surcharge eventuellement par celui contenu dans ${PREFS_CATA_$CODE}
+    #         par celui de l utilisateur
+    # le fichier de catalogue va etre lu dans la directory de l utilisateur s il exite
+    # dans le fichier general sinon
+
+        self.appliEficas   = appliEficas
+        self.code    = appliEficas.code
+        self.salome  = appliEficas.salome
+        if self.salome : self.name="editeur_salome.ini"
+        else           : self.name="editeur.ini"
+        self.rep_mat = None
+        self.repIni  = repIni
+
+        if self.code == None : self.code=''
+        #if sys.platform[0:5]=="linux" :
+                #self.rep_user   = os.path.join(os.environ['HOME'],'.config/Eficas',self.code)
+        self.rep_user   = os.path.join(os.path.expanduser("~"),'.config/Eficas',self.code)
+        #else :
+        #        self.rep_user   = os.path.join('C:/','.config/Eficas',self.code)
+
+
+        self.setValeursParDefaut()
+
+        if self.code != '' :
+            self.lectureFichierIniStandard()
+            self.lectureFichierIniIntegrateur()
+            self.lectureFichierIniUtilisateur()
+
+        if self.boutonDsMenuBar:
+            self.closeAutreCommande = True
+            self.closeFrameRechercheCommande = True
+
+        #Particularite des schemas MAP
+        if hasattr(self,'make_ssCode'): self.make_ssCode(self.ssCode)
+
+        #if self.appliEficas: self.parent=appliEficas.top
+        #else:         self.parent=None
+
+        if not os.path.isdir(self.savedir) :
+            if sys.platform[0:5]=="linux" :
+                #self.savedir=os.environ['HOME']
+                self.savedir=os.path.expanduser("~")
+            else:
+                self.savedir='C:/'
+
+
+
+    def setValeursParDefaut(self):
+    #-----------------------------
+
+        # Valeurs par defaut
+        if not os.path.isdir(self.rep_user) : os.makedirs(self.rep_user)
+        self.path_doc     = os.path.abspath(os.path.join(self.repIni,'..','Doc'))
+        self.exec_acrobat = 'acroread'
+        nomDir="Eficas_"+self.code
+        #if sys.platform[0:5]=="linux" :
+            #self.savedir   = os.path.abspath(os.path.join(os.environ['HOME'],nomDir))
+        self.savedir=os.path.join(os.path.expanduser("~"),'.config/Eficas',self.code)
+        #else:
+        #  self.savedir = os.path.abspath('C:/')
+        self.modeNouvCommande='initial'
+        self.affiche="alpha"
+        self.closeAutreCommande = False
+        self.closeFrameRechercheCommande = False
+        self.closeFrameRechercheCommandeSurPageDesCommandes = False
+        self.closeEntete = False
+        self.closeArbre = False
+        self.demandeLangue=False
+        self.suiteTelemac=False
+        self.nombreDeBoutonParLigne=0
+        self.translatorFichier=None
+        self.dicoImages= {}
+        self.dicoIcones= {}
+        self.afficheCommandesPliees = True
+        self.afficheFirstPlies =  False
+        self.simpleClic = False
+        self.afficheOptionnelVide=False
+        self.afficheListesPliees=True
+        self.boutonDsMenuBar=False
+        self.ficIcones=None
+        self.repIcones=None
+        self.differencieSiDefaut=False
+        self.typeDeCata='Python'
+        self.closeParenthese=False
+        self.closeOptionnel=False
+        self.afficheFactOptionnel=False
+        self.enleverActionStructures=False
+        self.enleverPoubellePourCommande=False
+        self.enleverParametres=False
+        self.enleverSupprimer=False
+        self.ajoutExecution=False
+        self.utilParExtensions=[]
+        self.rendVisiblesLesCaches=False
+        self.pasDeMCOptionnels=False
+
+        self.dumpXSD=False
+        self.withXSD=False
+        self.afficheIhm=True
+
+
+
+
+    #--------------------------------------
+    def lectureFichierIniStandard(self):
+    #--------------------------------------
+
+        name='prefs_'+self.appliEficas.code
+        try :
+            prefsCode=__import__(name)
+        except :
+            self.catalogues=[]
+            print ('pas de fichier de prefs')
+            return
+        for k in dir(prefsCode):
+            if (k[0:1] != "__" and k[-1:-2] !='__'):
+                valeur=getattr(prefsCode,k)
+                setattr(self,k,valeur)
+
+
+
+    #--------------------------------------
+    def lectureFichierIniIntegrateur(self):
+    #--------------------------------------
+    # Verifie l'existence du fichier "standard"
+    # appelle la lecture de ce fichier
+        clef="PREFS_CATA_"+self.code
+        try :
+            repIntegrateur=os.path.abspath(os.environ[clef])
+        except :
+            return
+
+        fic_ini_integrateur=os.path.join(repIntegrateur,self.name)
+        if not os.path.isfile(fic_ini_integrateur): return
+        txt = read_file(fic_ini_integrateur)
+        d=locals()
+        try:
+            exec(txt, d)
+        except :
+            try :
+                from PyQt5.QtWidgets import QMessageBox
+                QMessageBox.critical( None, tr("Import du fichier de Configuration"),
+                             tr("Erreur a la lecture du fichier de configuration %s " , str(fic_ini_integrateur)))
+            except :
+                print("Erreur a la lecture du fichier de configuration %s " , str(fic_ini_integrateur))
+            return
+        self.labels_eficas.append('rep_aide')
+        for k in self.labels_eficas :
+            try :
+                setattr(self,k,d[k])
+            except :
+                pass
+        #Glut pour les repertoires materiaux
+        #et pour la doc
+        for k in d :
+            if (k[0:8]=="rep_mat_") or (k[0:8]=="rep_doc_"):
+                setattr(self,k,d[k])
+
+
+    #--------------------------------------
+    def lectureFichierIniUtilisateur(self):
+    #--------------------------------------
+    # Surcharge les parametres standards par les parametres utilisateur s'ils existent
+        self.fic_ini_utilisateur = os.path.join(self.rep_user,self.name)
+        if not os.path.isfile(self.fic_ini_utilisateur): return
+
+        txt = read_file(self.fic_ini_utilisateur)
+        d=locals()
+        try:
+            exec(txt, d)
+        except :
+            l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2])
+            try :
+                from PyQt5.QtWidgets import QMessageBox
+                QMessageBox.critical( None, tr("Import du fichier de Configuration"),
+                             tr("Erreur a la lecture du fichier de configuration %s " , str(fic_ini_integrateur)))
+            except :
+                print ("Erreur a la lecture du fichier de configuration %s " , str(fic_ini_integrateur))
+        for k in self.labels_user :
+            try :
+                setattr(self,k,d[k])
+            except :
+                pass
+        for k in d :
+            if (k[0:8]=="rep_mat_") or (k[0:8]=="rep_doc_"):
+                setattr(self,k,d[k])
+
+    #--------------------------------------
+    def saveParams(self):
+    #--------------------------------------
+    # sauvegarde
+    # les nouveaux parametres dans le fichier de configuration utilisateur
+    #
+        texte=""
+        for clef in self.labels_user :
+            if hasattr(self,clef):
+                valeur=getattr(self,clef)
+                texte= texte + clef+"      = " + repr(valeur) +"\n"
+        #Glut pour les repertoires materiaux
+        #et pour la doc
+        for k in dir(self):
+            if (k[0:8]=="rep_mat_") or (k[0:8]=="rep_doc_"):
+                valeur=getattr(self,k)
+                texte= texte + k+" = " + repr(valeur) +"\n"
+
+        f=open(self.fic_ini_utilisateur,'w+')
+        f.write(texte)
+        f.close()
 #
 
 
index e3259a91ceaba03fff7c99679cf5ddaf81736d3f..4769c91583b7b33b5fbabd8675650f0988ad353f 100755 (executable)
@@ -20,8 +20,8 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 
 import types,sys,os, re
@@ -45,12 +45,12 @@ from InterfaceQT4   import browser
 
 from desBaseWidget    import Ui_baseWidget
 from InterfaceQT4.monViewTexte   import ViewText
-from monWidgetCreeParam import MonWidgetCreeParam 
+from monWidgetCreeParam import MonWidgetCreeParam
 
 DictExtensions= {"MAP" : ".map", "TELEMAC" : '.cas'}
 debug = False
 
-    
+
 from InterfaceQT4.editorSsIhm    import JDCEditorSsIhm
 
 
@@ -82,8 +82,8 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
 
         JDCEditorSsIhm. __init__ (self,appliEficas,fichier, jdc,units,include)
         if self.jdc:
-             comploader.chargerComposants()
-             self.jdc_item=Objecttreeitem.makeObjecttreeitem( self, "nom", self.jdc )
+            comploader.chargerComposants()
+            self.jdc_item=Objecttreeitem.makeObjecttreeitem( self, "nom", self.jdc )
 
 
         # Particularites IHM : met la fenetre a jour
@@ -102,7 +102,7 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
         if self.maConfiguration.closeOptionnel  : self.fermeOptionnel()
         if self.maConfiguration.boutonDsMenuBar : self.appliEficas.remplitIconesCommandes()
 
-     
+
         self.formatFichierOut =  self.appliEficas.formatFichierOut
         self.formatFichierIn  =  self.appliEficas.formatFichierIn
 
@@ -120,11 +120,11 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
         self.Commandes_Ordre_Catalogue =self.readercata.Commandes_Ordre_Catalogue
 
         if self.appliEficas.readercata.demandeCatalogue==True  :
-           nomFichierTranslation='translatorFichier'+'_'+str(self.appliEficas.readercata.labelCode)
-           if hasattr(self.appliEficas.maConfiguration,nomFichierTranslation) :
-              translatorFichier=getattr(self.appliEficas.maConfiguration,nomFichierTranslation)
-              from Extensions import localisation
-              localisation.localise(None,self.appliEficas.langue,translatorFichier=translatorFichier)
+            nomFichierTranslation='translatorFichier'+'_'+str(self.appliEficas.readercata.labelCode)
+            if hasattr(self.appliEficas.maConfiguration,nomFichierTranslation) :
+                translatorFichier=getattr(self.appliEficas.maConfiguration,nomFichierTranslation)
+                from Extensions import localisation
+                localisation.localise(None,self.appliEficas.langue,translatorFichier=translatorFichier)
 
 
         if self.jdc_item and self.appliEficas.ssIhm==False :
@@ -175,7 +175,7 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
 #   saveFileLegerAs
 
 # ---------------------------------------------
-# Methodes Surchargees 
+# Methodes Surchargees
 # ---------------------------------------------
 
     #-----------------------------------------------------------------------#
@@ -187,20 +187,20 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
     #--------------------------------#
     def informe(self,titre,txt,critique=True):
     #--------------------------------#
-       if  critique :
-           self.afficheInfos(tr(txt),Qt.red)
-           QMessageBox.critical( self, tr(titre), tr(txt))
-       else :
-           QMessageBox.warning( self, tr(titre),tr(txt))
+        if  critique :
+            self.afficheInfos(tr(txt),Qt.red)
+            QMessageBox.critical( self, tr(titre), tr(txt))
+        else :
+            QMessageBox.warning( self, tr(titre),tr(txt))
 
     #--------------------------------#
     def ajoutCommentaire(self):
     #--------------------------------#
         if self.tree.selectedItems()==[] :
-          QMessageBox.warning( self, tr("Pas de noeud selectionne"),tr("Selectionnez un Noeud \nLe commentaire sera place apres le noeud selectionne"))
-          return 
+            QMessageBox.warning( self, tr("Pas de noeud selectionne"),tr("Selectionnez un Noeud \nLe commentaire sera place apres le noeud selectionne"))
+            return
         noeudAvantCommentaire=self.tree.selectedItems()[0]
-        if noeudAvantCommentaire ==self.tree.racine : 
+        if noeudAvantCommentaire ==self.tree.racine :
             self.tree.racine.appendChild("COMMENTAIRE",pos=0)
             return
         noeudAvantCommentaire.addComment(True)
@@ -224,10 +224,10 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
         self.monExe.closeWriteChannel()
         self.w.exec_()
         try:
-          commande="rm  "+ nomFichier
-          os.system(commande)
+            commande="rm  "+ nomFichier
+            os.system(commande)
         except :
-          pass
+            pass
 
     def readFromStdErr(self):
         a=self.monExe.readAllStandardError()
@@ -237,7 +237,7 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
         a=self.monExe.readAllStandardOutput()
         self.w.view.append(str(a.data()))
 
-        
+
     #-----------------------#
     def gestionParam(self):
     #-----------------------#
@@ -259,11 +259,11 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
     #----------------------------------------------#
         if couleur=='red' : couleur = Qt.red
         if self.sb:
-           mapalette=self.sb.palette()
-           mapalette.setColor( QPalette.WindowText, couleur )
-           self.sb.setPalette( mapalette );
-           self.sb.showMessage(message,4000)
-           self.couleur=couleur
+            mapalette=self.sb.palette()
+            mapalette.setColor( QPalette.WindowText, couleur )
+            self.sb.setPalette( mapalette );
+            self.sb.showMessage(message,4000)
+            self.couleur=couleur
 
     #------------------------------#
     def afficheAlerte(self,titre,message):
@@ -285,166 +285,166 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
     #---------------------------------------#
     def chercheNoeudSelectionne(self,copie=1):
     #---------------------------------------#
-      """
-        appele par Cut et Copy pour positionner self.node_selected
-      """
-      self.node_selected=[]
-      if len(self.tree.selectedItems()) == 0 : return
-      self.node_selected=self.tree.selectedItems()
+        """
+          appele par Cut et Copy pour positionner self.node_selected
+        """
+        self.node_selected=[]
+        if len(self.tree.selectedItems()) == 0 : return
+        self.node_selected=self.tree.selectedItems()
 
 
     #---------------------#
     def handleSupprimer(self):
     #---------------------#
-      self.chercheNoeudSelectionne()
-      if len(self.node_selected) == 0 : return
-      self.QWParent.noeud_a_editer = []
-      if self.node_selected[0]==self.tree.racine: return
-      if len(self.node_selected) == 1 : self.node_selected[0].delete()
-      else : self.node_selected[0].deleteMultiple(self.node_selected)
+        self.chercheNoeudSelectionne()
+        if len(self.node_selected) == 0 : return
+        self.QWParent.noeud_a_editer = []
+        if self.node_selected[0]==self.tree.racine: return
+        if len(self.node_selected) == 1 : self.node_selected[0].delete()
+        else : self.node_selected[0].deleteMultiple(self.node_selected)
 
     #---------------------#
     def handleRechercher(self):
     #---------------------#
-      from .monRecherche import DRecherche
-      monRechercheDialg=DRecherche(parent=self,fl=0)
-      monRechercheDialg.show()
+        from .monRecherche import DRecherche
+        monRechercheDialg=DRecherche(parent=self,fl=0)
+        monRechercheDialg.show()
 
 
     #--------------------------------#
     def handleRechercherDsCatalogue(self):
     #-----------------------------#
-      from .monRechercheCatalogue import DRechercheCatalogue
-      monRechercheDialg=DRechercheCatalogue(self.QWParent,self)
-      monRechercheDialg.show()
+        from .monRechercheCatalogue import DRechercheCatalogue
+        monRechercheDialg=DRechercheCatalogue(self.QWParent,self)
+        monRechercheDialg.show()
 
     #---------------------#
     def handleDeplier(self):
     #---------------------#
-       if self.tree == None : return
-       #self.tree.collapseAll()
-       if self.deplier :
-          #print "je plie"
-          self.tree.expandItem(self.tree.topLevelItem(0))
-          self.deplier = False
-          if self.fenetreCentraleAffichee != None  :
-             if hasattr(self.fenetreCentraleAffichee.node,'plieToutEtReaffiche'):
-                 self.fenetreCentraleAffichee.node.plieToutEtReaffiche()
-       else:
-          #print "je deplie"
-          self.tree.expandItem(self.tree.topLevelItem(0))
-          self.deplier = True
-          if self.fenetreCentraleAffichee != None  :
-             if hasattr(self.fenetreCentraleAffichee.node,'deplieToutEtReaffiche'):
-                 self.fenetreCentraleAffichee.node.deplieToutEtReaffiche()
+        if self.tree == None : return
+        #self.tree.collapseAll()
+        if self.deplier :
+            #print "je plie"
+            self.tree.expandItem(self.tree.topLevelItem(0))
+            self.deplier = False
+            if self.fenetreCentraleAffichee != None  :
+                if hasattr(self.fenetreCentraleAffichee.node,'plieToutEtReaffiche'):
+                    self.fenetreCentraleAffichee.node.plieToutEtReaffiche()
+        else:
+            #print "je deplie"
+            self.tree.expandItem(self.tree.topLevelItem(0))
+            self.deplier = True
+            if self.fenetreCentraleAffichee != None  :
+                if hasattr(self.fenetreCentraleAffichee.node,'deplieToutEtReaffiche'):
+                    self.fenetreCentraleAffichee.node.deplieToutEtReaffiche()
 
     #---------------------#
     def handleEditCut(self):
     #---------------------#
-      """
-      Stocke dans Eficas.noeud_a_editer le noeud a couper
-      """
-      #print "handleEditCut"
-      self.chercheNoeudSelectionne()
-      self.QWParent.edit="couper"
-      self.QWParent.noeud_a_editer = self.node_selected
+        """
+        Stocke dans Eficas.noeud_a_editer le noeud a couper
+        """
+        #print "handleEditCut"
+        self.chercheNoeudSelectionne()
+        self.QWParent.edit="couper"
+        self.QWParent.noeud_a_editer = self.node_selected
 
     #-----------------------#
     def handleEditCopy(self):
     #-----------------------#
-      """
-      Stocke dans Eficas.noeud_a_editer le noeud a copier
-      """
-      self.chercheNoeudSelectionne()
-      if len(self.node_selected) == 0 : return
-      if len(self.node_selected) == 1 : self.node_selected[0].updateNodeLabelInBlue()
-      else :  self.node_selected[0].updatePlusieursNodeLabelInBlue(self.node_selected)
-      self.QWParent.edit="copier"
-      self.QWParent.noeud_a_editer = self.node_selected
+        """
+        Stocke dans Eficas.noeud_a_editer le noeud a copier
+        """
+        self.chercheNoeudSelectionne()
+        if len(self.node_selected) == 0 : return
+        if len(self.node_selected) == 1 : self.node_selected[0].updateNodeLabelInBlue()
+        else :  self.node_selected[0].updatePlusieursNodeLabelInBlue(self.node_selected)
+        self.QWParent.edit="copier"
+        self.QWParent.noeud_a_editer = self.node_selected
 
     #------------------------#
     def handleEditPaste(self):
     #------------------------#
-      """
-      Lance la copie de l'objet place dans self.QWParent.noeud_a_editer
-      Ne permet que la copie d'objets de type Commande ou MCF
-      """
-      self.chercheNoeudSelectionne()
-      if (not(hasattr(self.QWParent,'noeud_a_editer'))) or len(self.QWParent.noeud_a_editer)==0:
-          QMessageBox.information( self,
-                      tr("Copie impossible"),
-                      tr("Veuillez selectionner un objet a copier"))
-          return
-      if len(self.node_selected) != 1 :
-          QMessageBox.information( self,
-                      tr("Copie impossible"),
-                      tr("Veuillez selectionner un seul objet : la copie se fera apres le noeud selectionne"))
-          return
-      noeudOuColler=self.node_selected[0]
-
-      if len(self.QWParent.noeud_a_editer)!=1:
-         #self.handleEditPasteMultiple()
-         QMessageBox.information( self, tr("Copie impossible"), tr("Aucun Objet n a ete copie ou coupe"))
-         return
-
-      noeudACopier=self.QWParent.noeud_a_editer[0]
-
-      if (self.QWParent.edit != "couper"):
-        #print   (noeudOuColler.item.parent.getChild(noeudOuColler.item.nom)) 
-        try:
-           if noeudOuColler == self.tree.racine :
-               child=noeudOuColler.doPastePremier(noeudACopier)
-           else :
-               child=noeudACopier.doPaste(noeudOuColler,'after')
-
-           if child==None or child==0:
-               QMessageBox.critical( self,tr( "Copie refusee"),tr('Eficas n a pas reussi a copier l objet'))
-               self.message = ''
-               self.afficheInfos("Copie refusee",Qt.red)
-           if noeudACopier.treeParent.editor != noeudOuColler.treeParent.editor:
-               try :
-                 nom=noeudACopier.item.sd.nom
-                 child.item.nommeSd(nom)
-               except :
-                 pass
-           return
-           self.initModif()
-           child.select()
-        except  :
-           traceback.print_exc()
-           QMessageBox.critical( self,tr( "Copie refusee"),tr('Copie refusee pour ce type d objet'))
-           self.message = ''
-           self.afficheInfos("Copie refusee",Qt.red)
-           return
-
-      # il faut declarer le JDCDisplay_courant modifie
-      # suppression eventuelle du noeud selectionne
-      # si possible on renomme l objet comme le noeud couper
-
-      if (self.QWParent.edit == "couper"):
-         if noeudACopier.treeParent.editor != noeudOuColler.treeParent.editor:
-           QMessageBox.critical( self, tr("Deplacement refuse"),tr('Deplacement refuse entre 2 fichiers. Seule la copie est autorisee '))
-
-         #if 1:
-         try :
-           # indexNoeudACopier=noeudACopier.treeParent.children.index(noeudACopier)
-            indexNoeudACopier=self.getTreeIndex(noeudACopier)
-            noeudACopier.treeParent.item.deplaceEntite(indexNoeudACopier,indexNoeudOuColler,pos)
-            noeudACopier.treeParent.buildChildren()
-
-         #else:
-         except:
-            pass
-         self.QWParent.noeud_a_editer=[]
+        """
+        Lance la copie de l'objet place dans self.QWParent.noeud_a_editer
+        Ne permet que la copie d'objets de type Commande ou MCF
+        """
+        self.chercheNoeudSelectionne()
+        if (not(hasattr(self.QWParent,'noeud_a_editer'))) or len(self.QWParent.noeud_a_editer)==0:
+            QMessageBox.information( self,
+                        tr("Copie impossible"),
+                        tr("Veuillez selectionner un objet a copier"))
+            return
+        if len(self.node_selected) != 1 :
+            QMessageBox.information( self,
+                        tr("Copie impossible"),
+                        tr("Veuillez selectionner un seul objet : la copie se fera apres le noeud selectionne"))
+            return
+        noeudOuColler=self.node_selected[0]
 
-      # on rend la copie a nouveau possible en liberant le flag edit
-      self.QWParent.edit="copier"
-      noeudACopier.select()
+        if len(self.QWParent.noeud_a_editer)!=1:
+            #self.handleEditPasteMultiple()
+            QMessageBox.information( self, tr("Copie impossible"), tr("Aucun Objet n a ete copie ou coupe"))
+            return
+
+        noeudACopier=self.QWParent.noeud_a_editer[0]
+
+        if (self.QWParent.edit != "couper"):
+        #print   (noeudOuColler.item.parent.getChild(noeudOuColler.item.nom))
+            try:
+                if noeudOuColler == self.tree.racine :
+                    child=noeudOuColler.doPastePremier(noeudACopier)
+                else :
+                    child=noeudACopier.doPaste(noeudOuColler,'after')
+
+                if child==None or child==0:
+                    QMessageBox.critical( self,tr( "Copie refusee"),tr('Eficas n a pas reussi a copier l objet'))
+                    self.message = ''
+                    self.afficheInfos("Copie refusee",Qt.red)
+                if noeudACopier.treeParent.editor != noeudOuColler.treeParent.editor:
+                    try :
+                        nom=noeudACopier.item.sd.nom
+                        child.item.nommeSd(nom)
+                    except :
+                        pass
+                return
+                self.initModif()
+                child.select()
+            except  :
+                traceback.print_exc()
+                QMessageBox.critical( self,tr( "Copie refusee"),tr('Copie refusee pour ce type d objet'))
+                self.message = ''
+                self.afficheInfos("Copie refusee",Qt.red)
+                return
+
+        # il faut declarer le JDCDisplay_courant modifie
+        # suppression eventuelle du noeud selectionne
+        # si possible on renomme l objet comme le noeud couper
+
+        if (self.QWParent.edit == "couper"):
+            if noeudACopier.treeParent.editor != noeudOuColler.treeParent.editor:
+                QMessageBox.critical( self, tr("Deplacement refuse"),tr('Deplacement refuse entre 2 fichiers. Seule la copie est autorisee '))
+
+            #if 1:
+            try :
+                # indexNoeudACopier=noeudACopier.treeParent.children.index(noeudACopier)
+                indexNoeudACopier=self.getTreeIndex(noeudACopier)
+                noeudACopier.treeParent.item.deplaceEntite(indexNoeudACopier,indexNoeudOuColler,pos)
+                noeudACopier.treeParent.buildChildren()
+
+            #else:
+            except:
+                pass
+            self.QWParent.noeud_a_editer=[]
+
+        # on rend la copie a nouveau possible en liberant le flag edit
+        self.QWParent.edit="copier"
+        noeudACopier.select()
 
     #----------------------------------#
     def handleDeplaceMultiple(self):
     #----------------------------------#
-       pass
+        pass
 
     #----------------------------------#
     def handleEditPasteMultiple(self):
@@ -452,270 +452,270 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
 
     # On ne garde que les niveaux "Etape"
     # On insere dans l'ordre du JDC
-     listeNoeudsACouper=[]
-     listeIndex=[]
-     listeChild=[]
-     listeItem=[]
-     from InterfaceQT4 import compojdc
-     noeudOuColler=self.node_selected[0]
-     if not (isinstance(noeudOuColler.treeParent, compojdc.Node)):
-        QMessageBox.information( self,
-                  tr("Copie impossible a cet endroit",),
-                  tr("Veuillez selectionner une commande, un parametre, un commentaire ou une macro"))
-        return
-     indexNoeudOuColler=noeudOuColler.treeParent.children.index(noeudOuColler)
-
-     for noeud in self.QWParent.noeud_a_editer :
-        if not (isinstance(noeud.treeParent, compojdc.Node)): continue
-        indexInTree=noeud.treeParent.children.index(noeud)
-        indice = 0
+        listeNoeudsACouper=[]
+        listeIndex=[]
+        listeChild=[]
+        listeItem=[]
+        from InterfaceQT4 import compojdc
+        noeudOuColler=self.node_selected[0]
+        if not (isinstance(noeudOuColler.treeParent, compojdc.Node)):
+            QMessageBox.information( self,
+                      tr("Copie impossible a cet endroit",),
+                      tr("Veuillez selectionner une commande, un parametre, un commentaire ou une macro"))
+            return
+        indexNoeudOuColler=noeudOuColler.treeParent.children.index(noeudOuColler)
+
+        for noeud in self.QWParent.noeud_a_editer :
+            if not (isinstance(noeud.treeParent, compojdc.Node)): continue
+            indexInTree=noeud.treeParent.children.index(noeud)
+            indice = 0
+            for index in listeIndex:
+                if index < indexInTree : indice = indice +1
+            listeIndex.insert(indice, indexInTree)
+            listeNoeudsACouper.insert(indice, noeud)
+
+        noeudJdc=noeudOuColler.treeParent
+        dejaCrees=0
+        # on les cree a l'envers parcequ'on ajoute a NoeudOuColler
+        listeIndex.reverse()
+        for index in listeIndex:
+            indexTravail=index
+            if indexNoeudOuColler < index:
+                indexTravail=indexTravail+dejaCrees
+            noeudOuColler=noeudJdc.children[indexNoeudOuColler]
+            noeud=noeudJdc.children[indexTravail]
+            child=noeud.doPaste(noeudOuColler)
+            listeChild.append(child)
+            dejaCrees=dejaCrees+1
+
+        self.QWParent.noeud_a_editer = []
+        for i in range(len(listeIndex)):
+            noeud=noeudJdc.children[indexNoeudOuColler+1+i]
+            self.QWParent.noeud_a_editer.append(noeud)
+
+        listeASupprimer=[]
+        if self.QWParent.edit !="couper" : return
+
         for index in listeIndex:
-            if index < indexInTree : indice = indice +1
-        listeIndex.insert(indice, indexInTree)
-        listeNoeudsACouper.insert(indice, noeud)
-
-     noeudJdc=noeudOuColler.treeParent
-     dejaCrees=0
-     # on les cree a l'envers parcequ'on ajoute a NoeudOuColler
-     listeIndex.reverse()
-     for index in listeIndex:
-         indexTravail=index
-         if indexNoeudOuColler < index:
-            indexTravail=indexTravail+dejaCrees
-         noeudOuColler=noeudJdc.children[indexNoeudOuColler]
-         noeud=noeudJdc.children[indexTravail]
-         child=noeud.doPaste(noeudOuColler)
-         listeChild.append(child)
-         dejaCrees=dejaCrees+1
-
-     self.QWParent.noeud_a_editer = []
-     for i in range(len(listeIndex)):
-        noeud=noeudJdc.children[indexNoeudOuColler+1+i]
-        self.QWParent.noeud_a_editer.append(noeud)
-
-     listeASupprimer=[]
-     if self.QWParent.edit !="couper" : return
-
-     for index in listeIndex:
-         indexTravail=index
-         if indexNoeudOuColler < index:
-            indexTravail=indexTravail+(len(listeIndex))
-         noeud=noeudJdc.children[indexTravail]
-
-         listeItem.append(noeud.item)
-         listeASupprimer.append(noeud)
-
-     for i in range(len(listeChild)):
-         self.tree.item.suppItem(listeItem[i])
-         listeChild[i].item.update(listeItem[i])
-
-     self.QWParent.noeud_a_editer = []
+            indexTravail=index
+            if indexNoeudOuColler < index:
+                indexTravail=indexTravail+(len(listeIndex))
+            noeud=noeudJdc.children[indexTravail]
+
+            listeItem.append(noeud.item)
+            listeASupprimer.append(noeud)
+
+        for i in range(len(listeChild)):
+            self.tree.item.suppItem(listeItem[i])
+            listeChild[i].item.update(listeItem[i])
+
+        self.QWParent.noeud_a_editer = []
 
     #----------------------------------#
     def handleAjoutEtape(self,nomEtape):
     #----------------------------------#
-      self.chercheNoeudSelectionne()
-      if len(self.node_selected) == 0 or self.node_selected[0] == self.tree.racine : 
-         nodeOuAjouter=self.tree.racine
-         nouveau=nodeOuAjouter.appendChild(nomEtape,pos='first')
-      else :               
-         nodeOuAjouter=self.node_selected[0]
-         if nodeOuAjouter != self.tree.racine :
-            while  nodeOuAjouter.treeParent != self.tree.racine:
-                   nodeOuAjouter=nodeOuAjouter.treeParent
-         nouveau=nodeOuAjouter.appendBrother(nomEtape)
-      try : 
-        self.node_selected[0].setSelected(False)
-      except : pass
-      nouveau.setSelected(True)
-      nouveau.affichePanneau()
+        self.chercheNoeudSelectionne()
+        if len(self.node_selected) == 0 or self.node_selected[0] == self.tree.racine :
+            nodeOuAjouter=self.tree.racine
+            nouveau=nodeOuAjouter.appendChild(nomEtape,pos='first')
+        else :
+            nodeOuAjouter=self.node_selected[0]
+            if nodeOuAjouter != self.tree.racine :
+                while  nodeOuAjouter.treeParent != self.tree.racine:
+                    nodeOuAjouter=nodeOuAjouter.treeParent
+            nouveau=nodeOuAjouter.appendBrother(nomEtape)
+        try :
+            self.node_selected[0].setSelected(False)
+        except : pass
+        nouveau.setSelected(True)
+        nouveau.affichePanneau()
 
 
     #---------------------------#
     def getFileVariable(self) :
     #---------------------------#
-     titre = tr("Choix d'un fichier XML")
-     texte = tr("Le fichier contient une commande MODEL\n")
-     texte = texte+tr('Donnez le nom du fichier XML qui contient la description des variables')
-     QMessageBox.information( self, titre,tr(texte))
+        titre = tr("Choix d'un fichier XML")
+        texte = tr("Le fichier contient une commande MODEL\n")
+        texte = texte+tr('Donnez le nom du fichier XML qui contient la description des variables')
+        QMessageBox.information( self, titre,tr(texte))
 
-     fichier = QFileDialog.getOpenFileName(self.appliEficas,
-                   tr('Ouvrir Fichier'),
-                   self.appliEficas.maConfiguration.savedir,
-                   tr('Wrapper Files (*.xml);;''All Files (*)'))
-     return  fichier
+        fichier = QFileDialog.getOpenFileName(self.appliEficas,
+                      tr('Ouvrir Fichier'),
+                      self.appliEficas.maConfiguration.savedir,
+                      tr('Wrapper Files (*.xml);;''All Files (*)'))
+        return  fichier
 
     #------------#
     def run(self):
     #------------#
-      fonction="run"+self.code
-      if fonction in JDCEditor.__dict__: JDCEditor.__dict__[fonction](self,)
+        fonction="run"+self.code
+        if fonction in JDCEditor.__dict__: JDCEditor.__dict__[fonction](self,)
 
     #------------#
     def saveRun(self):
     #------------#
-      fonction="saveRun"+self.code
-      if fonction in JDCEditor.__dict__: JDCEditor.__dict__[fonction](self,)
+        fonction="saveRun"+self.code
+        if fonction in JDCEditor.__dict__: JDCEditor.__dict__[fonction](self,)
 
 
 # ---------------------------------------------
-# Methodes Non Crees dans ssIHM 
+# Methodes Non Crees dans ssIHM
 # ---------------------------------------------
     #---------------#
     def runVP(self):
     #---------------#
-      texte=self.getTextJDC("MAPVp",pourRun=1)
-      print (texte)
+        texte=self.getTextJDC("MAPVp",pourRun=1)
+        print (texte)
 
     #---------------#
     def runMAP(self):
     #---------------#
 
-      if not(self.jdc.isValid()):
-         QMessageBox.critical( self, tr( "Execution impossible "),tr("le JDC doit etre valide pour une execution MAP"))
-         return
-      if len(self.jdc.etapes) != 1 :
-         QMessageBox.critical( self, tr("Execution impossible "),tr("le JDC doit contenir un et un seul composant"))
-         return
-      if self.modified or self.fichier==None  :
-         self.fichierMapInput = self.__generateTempFilename(prefix = "map_run", suffix = ".map")
-         texte=self.getTextJDC("MAP")
-         self.writeFile( self.fichierMapInput, txt = texte)
-      else :
-         self.fichierMapInput=self.fichier
-      composant=self.jdc.etapes[0].nom.lower()[0:-5]
-
-
-      # :TRICKY: to determine if a component requires SALOME, loads the component from Eficas catalog
-      # then instantiate corresponding class and call getUseSalome() method
-      try:
-          from mapengine.spec import factory
-          mapComponent = factory.new(composant)[0]
-
-          command = "map"
-          if mapComponent.getUseSalome():
-              command += " -r sappli"
-          textePython=(command + " run -n "+composant +" -i "+self.fichierMapInput)
-
-          #textePython="ls -l"
-          self._viewTextExecute( textePython,"map_run",".sh")
-          #try:
-          #  commande="rm  "+self.fichierMapInput
-          #   os.system(commande)
-          #except :
-          #   pass
-      except Exception as e:
-          print((traceback.print_exc()))
+        if not(self.jdc.isValid()):
+            QMessageBox.critical( self, tr( "Execution impossible "),tr("le JDC doit etre valide pour une execution MAP"))
+            return
+        if len(self.jdc.etapes) != 1 :
+            QMessageBox.critical( self, tr("Execution impossible "),tr("le JDC doit contenir un et un seul composant"))
+            return
+        if self.modified or self.fichier==None  :
+            self.fichierMapInput = self.__generateTempFilename(prefix = "map_run", suffix = ".map")
+            texte=self.getTextJDC("MAP")
+            self.writeFile( self.fichierMapInput, txt = texte)
+        else :
+            self.fichierMapInput=self.fichier
+        composant=self.jdc.etapes[0].nom.lower()[0:-5]
+
+
+        # :TRICKY: to determine if a component requires SALOME, loads the component from Eficas catalog
+        # then instantiate corresponding class and call getUseSalome() method
+        try:
+            from mapengine.spec import factory
+            mapComponent = factory.new(composant)[0]
+
+            command = "map"
+            if mapComponent.getUseSalome():
+                command += " -r sappli"
+            textePython=(command + " run -n "+composant +" -i "+self.fichierMapInput)
+
+            #textePython="ls -l"
+            self._viewTextExecute( textePython,"map_run",".sh")
+            #try:
+            #  commande="rm  "+self.fichierMapInput
+            #   os.system(commande)
+            #except :
+            #   pass
+        except Exception as e:
+            print((traceback.print_exc()))
 
     #-------------------#
     def runZCRACKS(self):
     #-------------------#
-      if not(self.jdc.isValid()):
-         QMessageBox.critical( self, tr( "Execution impossible "),tr("le JDC doit etre valide pour une execution "))
-         return
-      if self.modified or self.fichier==None  :
-      #if 1:
-         self.fichierZcracksInput = self.__generateTempFilename(prefix = "zcracks_run", suffix = ".z7p")
-         texte=self.getTextJDC("ZCRACKS",pourRun=1)
-         self.writeFile( self.fichierZcracksInput, txt = texte)
-      else :
-         self.fichierZcracksInput=self.fichier
-      try :
-          #commande ="Zrun -zp "
-          commande="more "
-          textePython=(commande + self.fichierZcracksInput)
-          self._viewTextExecute( textePython,"run_zcracks",".sh")
-      except Exception as e:
-          print((traceback.print_exc()))
+        if not(self.jdc.isValid()):
+            QMessageBox.critical( self, tr( "Execution impossible "),tr("le JDC doit etre valide pour une execution "))
+            return
+        if self.modified or self.fichier==None  :
+        #if 1:
+            self.fichierZcracksInput = self.__generateTempFilename(prefix = "zcracks_run", suffix = ".z7p")
+            texte=self.getTextJDC("ZCRACKS",pourRun=1)
+            self.writeFile( self.fichierZcracksInput, txt = texte)
+        else :
+            self.fichierZcracksInput=self.fichier
+        try :
+            #commande ="Zrun -zp "
+            commande="more "
+            textePython=(commande + self.fichierZcracksInput)
+            self._viewTextExecute( textePython,"run_zcracks",".sh")
+        except Exception as e:
+            print((traceback.print_exc()))
 
     #-------------------#
     def runCARMELCND(self):
     #-------------------#
-      #if not(self.jdc.isValid()):
-      #   QMessageBox.critical( self, tr( "Execution impossible "),tr("le JDC doit etre valide pour une execution "))
-      #   return
-      if self.modified or self.fichier==None  :
-         QMessageBox.critical( self, tr( "Execution impossible "),tr("Sauvegarder SVP avant l'execution "))
-         return
-      if not hasattr(self,'generator'): texte=self.getTextJDC(self.formatFichierOut)
-      from PrepareRunCarmel import prepareRunCarmel
-      fichierGenerique=os.path.basename(self.fichier).split(".")[0]
-      repMed=os.path.dirname(self.fichier)
-      repExeCarmel=self.generator.get_repExeCarmel()
-      textePython=prepareRunCarmel(repExeCarmel,repMed,fichierGenerique)
-      nomFichier = self.__generateTempFilename("carmel_run", suffix = ".sh")
-      f=open(nomFichier,'w')
-      f.write(textePython)
-      f.close()
-      commande="xterm -e sh "+nomFichier +"\n"
-      os.system(commande)
+        #if not(self.jdc.isValid()):
+        #   QMessageBox.critical( self, tr( "Execution impossible "),tr("le JDC doit etre valide pour une execution "))
+        #   return
+        if self.modified or self.fichier==None  :
+            QMessageBox.critical( self, tr( "Execution impossible "),tr("Sauvegarder SVP avant l'execution "))
+            return
+        if not hasattr(self,'generator'): texte=self.getTextJDC(self.formatFichierOut)
+        from PrepareRunCarmel import prepareRunCarmel
+        fichierGenerique=os.path.basename(self.fichier).split(".")[0]
+        repMed=os.path.dirname(self.fichier)
+        repExeCarmel=self.generator.get_repExeCarmel()
+        textePython=prepareRunCarmel(repExeCarmel,repMed,fichierGenerique)
+        nomFichier = self.__generateTempFilename("carmel_run", suffix = ".sh")
+        f=open(nomFichier,'w')
+        f.write(textePython)
+        f.close()
+        commande="xterm -e sh "+nomFichier +"\n"
+        os.system(commande)
 
     #-------------------#
     def runCarmelCS(self):
     #-------------------#
-      try :
-          commande="runSession pilotyacsCS.py"
-          os.system(commande)
-      except Exception as e:
-          print((traceback.print_exc()))
+        try :
+            commande="runSession pilotyacsCS.py"
+            os.system(commande)
+        except Exception as e:
+            print((traceback.print_exc()))
 
     #-----------------------------------------------------#
     def determineNomFichier(self,path,extension):
     #-----------------------------------------------------#
-      if self.appliEficas.code in DictExtensions:
-         chaine1=DictExtensions[self.appliEficas.code]+" (*."+DictExtensions[self.appliEficas.code]+");;"
-         extensions= tr(chaine1+ "All Files (*)")
-      else :
-         extensions= tr("JDC (*.comm);;" "All Files (*)")
-
-      if self.appliEficas.code == "MAP" :
-         extensions = extensions + ";; Run (*.input);;"
-
-      fn = QFileDialog.getSaveFileName( self,
-             tr("sauvegarde"), path,
-             extensions,None,
-             QFileDialog.DontConfirmOverwrite)
-      if fn == None : return (0, None)
-      fn=fn[0]
-      if fn=='': return (0, None)
-
-      ext = QFileInfo(fn).suffix()
-      if ext == '': fn+=extension
-
-      if QFileInfo(fn).exists():
-           msgBox = QMessageBox(self)
-           msgBox.setWindowTitle(tr("Sauvegarde du Fichier"))
-           msgBox.setText(tr("Le fichier")+ "  "+str(fn)+ "  " +tr("existe deja"))
-           msgBox.addButton(tr("&Ecraser"),0)
-           msgBox.addButton(tr("&Abandonner"),1)
-           abort=msgBox.exec_()
-           if abort == 1 :  return (0, "")
-      return (1,fn)
+        if self.appliEficas.code in DictExtensions:
+            chaine1=DictExtensions[self.appliEficas.code]+" (*."+DictExtensions[self.appliEficas.code]+");;"
+            extensions= tr(chaine1+ "All Files (*)")
+        else :
+            extensions= tr("JDC (*.comm);;" "All Files (*)")
+
+        if self.appliEficas.code == "MAP" :
+            extensions = extensions + ";; Run (*.input);;"
+
+        fn = QFileDialog.getSaveFileName( self,
+               tr("sauvegarde"), path,
+               extensions,None,
+               QFileDialog.DontConfirmOverwrite)
+        if fn == None : return (0, None)
+        fn=fn[0]
+        if fn=='': return (0, None)
+
+        ext = QFileInfo(fn).suffix()
+        if ext == '': fn+=extension
+
+        if QFileInfo(fn).exists():
+            msgBox = QMessageBox(self)
+            msgBox.setWindowTitle(tr("Sauvegarde du Fichier"))
+            msgBox.setText(tr("Le fichier")+ "  "+str(fn)+ "  " +tr("existe deja"))
+            msgBox.addButton(tr("&Ecraser"),0)
+            msgBox.addButton(tr("&Abandonner"),1)
+            abort=msgBox.exec_()
+            if abort == 1 :  return (0, "")
+        return (1,fn)
 
     #-----------------#
     def saveRunMAP(self):
     #-----------------#
         extension=".input"
         if not(self.jdc.isValid()):
-           QMessageBox.critical( self, tr( "Sauvegarde de l'input impossible "),
-                                tr("Un JdC valide est necessaire pour creer un .input")
-                                 )
-           return
+            QMessageBox.critical( self, tr( "Sauvegarde de l'input impossible "),
+                                 tr("Un JdC valide est necessaire pour creer un .input")
+                                  )
+            return
         try :
-          composant=self.jdc.etapes[0].nom.lower()[0:-5]
+            composant=self.jdc.etapes[0].nom.lower()[0:-5]
         except :
-           QMessageBox.critical( self, tr( "Sauvegarde de l'input impossible "),
-                                tr("Choix du composant obligatoire")
-                                 )
-           return
+            QMessageBox.critical( self, tr( "Sauvegarde de l'input impossible "),
+                                 tr("Choix du composant obligatoire")
+                                  )
+            return
         if hasattr(self.maConfiguration, "savedir"): path=self.maConfiguration.savedir
         else : path='C:/'
 
         monNomFichier=""
         if self.fichier is not None and self.fichier != "" :
-             maBase=str(QFileInfo(self.fichier).baseName())+".input"
-             monPath=str(QFileInfo(self.fichier).absolutePath())
-             monNomFichier=os.path.join(monPath,maBase)
+            maBase=str(QFileInfo(self.fichier).baseName())+".input"
+            monPath=str(QFileInfo(self.fichier).absolutePath())
+            monNomFichier=os.path.join(monPath,maBase)
         elif hasattr(self,'monNomFichierInput'):
             monNomFichier=self.monNomFichierInput
 
@@ -726,10 +726,10 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
 
         for c in monDialog.children():
             if isinstance(c,QDialogButtonBox):
-               for b in c.children():
-                  if isinstance(b,QPushButton):
-                     avant=b.text()
-                     if avant=="&Open": b.setText("Save")
+                for b in c.children():
+                    if isinstance(b,QPushButton):
+                        avant=b.text()
+                        if avant=="&Open": b.setText("Save")
         mesFiltres= "input Map (*.input);;All Files (*)"
         monDialog.setNameFilters(mesFiltres)
         if monNomFichier!="" : monDialog.selectFile(monNomFichier)
@@ -764,13 +764,13 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
     #-----------------------------------------#
         try :
         #if 1:
-           from ajoutGroupe import handleAjoutGroupFiltre
-           #print listeGroup
-           handleAjoutGroupFiltre(self,listeGroup)
-           #print "apres handleAjoutGroupFiltre"
+            from ajoutGroupe import handleAjoutGroupFiltre
+            #print listeGroup
+            handleAjoutGroupFiltre(self,listeGroup)
+            #print "apres handleAjoutGroupFiltre"
         except :
         #else :
-           pass
+            pass
 
 
     #-----------------------------------------------------------------#
@@ -781,15 +781,15 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
         #saveas=True # Pour forcer le nom
         self.generator=self.maConfiguration.mesGenerators.plugins[self.formatFichierOut]()
         if self.fichierComplet is None or saveas:
-          if path is None: path=self.maConfiguration.savedir
-          bOK, fn=self.determineNomFichier(path,extension)
-          if bOK == 0 : return (0, None)
-          if fn == None : return (0, None)
-          if fn== '' : return (0, None)
+            if path is None: path=self.maConfiguration.savedir
+            bOK, fn=self.determineNomFichier(path,extension)
+            if bOK == 0 : return (0, None)
+            if fn == None : return (0, None)
+            if fn== '' : return (0, None)
 
-          ulfile = os.path.abspath(fn)
-          self.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
-          fn = QDir.toNativeSeparators(fn)
+            ulfile = os.path.abspath(fn)
+            self.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
+            fn = QDir.toNativeSeparators(fn)
 
         self.fichierComplet = os.path.splitext(fn)[0]+extension
 
@@ -819,43 +819,43 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
             return (0, None)      # do nothing if text wasn't changed
 
         if self.appliEficas.code in DictExtensions :
-           extension=DictExtensions[self.appliEficas.code]
+            extension=DictExtensions[self.appliEficas.code]
         else :
-           extension='.comm'
+            extension='.comm'
 
         newName = None
         fn = self.fichier
         if self.fichier is None or saveas:
-          if path is None: path=self.maConfiguration.savedir
-          bOK, fn=self.determineNomFichier(path,extension)
-          if bOK == 0 : return (0, None)
-          if fn == None : return (0, None)
-          if fn== '' : return (0, None)
+            if path is None: path=self.maConfiguration.savedir
+            bOK, fn=self.determineNomFichier(path,extension)
+            if bOK == 0 : return (0, None)
+            if fn == None : return (0, None)
+            if fn== '' : return (0, None)
 
-          ulfile = os.path.abspath(fn)
-          self.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
-          fn = QDir.toNativeSeparators(fn)
-          newName = fn
+            ulfile = os.path.abspath(fn)
+            self.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
+            fn = QDir.toNativeSeparators(fn)
+            newName = fn
 
 
         if not (self.writeFile(fn,formatLigne=formatLigne)): return (0, None)
         self.fichier = fn
         self.modified  = False
         if self.fileInfo is None or saveas:
-           self.fileInfo = QFileInfo(self.fichier)
-           self.fileInfo.setCaching(0)
+            self.fileInfo = QFileInfo(self.fichier)
+            self.fileInfo.setCaching(0)
         self.lastModified = self.fileInfo.lastModified()
         if newName is not None:
-           self.appliEficas.addToRecentList(newName)
-           self.tree.racine.item.getObject().nom=os.path.basename(newName)
-           self.tree.racine.updateNodeLabel()
+            self.appliEficas.addToRecentList(newName)
+            self.tree.racine.item.getObject().nom=os.path.basename(newName)
+            self.tree.racine.updateNodeLabel()
+
 
         if  self.jdc.cata.modeleMetier:self.jdc.toXml(self.fichier)
         if  self.jdc.cata.modeleMetier and self.jdc.isValid():
             if self.generator != self.XMLgenerator :
-               self.XMLgenerator.gener(self.jdc)
-               self.XMLgenerator.writeDefault(fn)
+                self.XMLgenerator.gener(self.jdc)
+                self.XMLgenerator.writeDefault(fn)
 
         if self.jdc.isValid() != 0 and hasattr(self.generator, "writeDefault"):
         #if hasattr(self.generator, "writeDefault"):
@@ -869,14 +869,14 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
             msgBox.addButton(tr("&Annuler"),2)
             res=msgBox.exec_()
             if res == 0 :
-               self.generator.writeDefault(fn)
-               return (1, self.fichier)
+                self.generator.writeDefault(fn)
+                return (1, self.fichier)
             if res == 2 : return (0, None)
             if self.appliEficas.salome : self.appliEficas.close()
             else : sys.exit(1)
 
         if self.salome :
-               self.appliEficas.addJdcInSalome( self.fichier)
+            self.appliEficas.addJdcInSalome( self.fichier)
         self.modified = 0
         nouveauTitre=self.titre+"              "+str(os.path.basename(self.fichier))
         self.appliEficas.setWindowTitle(nouveauTitre)
@@ -902,8 +902,8 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
             the name of the saved file
         """
         if fileName != None :
-           self.fichier = fileName
-           return self.saveFile()
+            self.fichier = fileName
+            return self.saveFile()
         return self.saveFile(path,1,"beautifie")
 
 
@@ -957,10 +957,10 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
         CONTEXT.setCurrentStep(etape)
         etape.buildIncludeEtape(texte)
         if not (etape.text_included_converted) :
-           QMessageBox.information( self,
-                      tr("Impossible d importer le texte"),
-                      etape.text_included_error)
-               
+            QMessageBox.information( self,
+                       tr("Impossible d importer le texte"),
+                       etape.text_included_error)
+
         self.tree.racine.buildChildren()
 
     #-----------------------------------#
@@ -969,16 +969,16 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
     # ajoute une etape  de JdC a partir d un texte
         monItem=itemApres
         etape=monItem.item.object
-         
+
         CONTEXT.setCurrentStep(etape)
         try :
-          ok=etape.buildIncludeEtape(texte)
+            ok=etape.buildIncludeEtape(texte)
         except :
-          ok=0
+            ok=0
         if not ok :
-           QMessageBox.information( self,
-                      tr("Import texte"),
-                      tr("Impossible d importer le texte"))
+            QMessageBox.information( self,
+                       tr("Import texte"),
+                       tr("Impossible d importer le texte"))
         self.tree.racine.buildChildren()
         return ok
 
@@ -988,13 +988,13 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
     # ajoute une etape  de JdC a partir d un texte
         CONTEXT.setCurrentStep(etape)
         try :
-          ok=etape.buildIncludeEtape(texte,doitEtreValide=0)
+            ok=etape.buildIncludeEtape(texte,doitEtreValide=0)
         except :
-          ok=0
+            ok=0
         if not ok :
-           QMessageBox.information( self,
-                      tr("Import texte"),
-                      tr("Impossible d importer le texte"))
+            QMessageBox.information( self,
+                       tr("Import texte"),
+                       tr("Impossible d importer le texte"))
         self.tree.racine.buildChildren()
         return ok
 
@@ -1009,197 +1009,197 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget):
     #-----------------------------------------
     def initSplitterSizes(self, nbWidget=3):
     #-----------------------------------------
-       #print ("je passe ds initSplitterSizes", nbWidget)
+        #print ("je passe ds initSplitterSizes", nbWidget)
 
-       if   self.code in [ 'Adao', 'ADAO','MAP' ] : self.splitterSizes3=[1,1550,300]
-       #elif self.code in [ 'MAP']            : self.splitterSizes3=[700,300]
-       else                                  : self.splitterSizes3=[150,1000,300]
+        if   self.code in [ 'Adao', 'ADAO','MAP' ] : self.splitterSizes3=[1,1550,300]
+        #elif self.code in [ 'MAP']            : self.splitterSizes3=[700,300]
+        else                                  : self.splitterSizes3=[150,1000,300]
 
-       if   self.code in [ 'Adao', 'ADAO','MAP' ] : self.splitterSizes2=[5,1500]
-       else                                  : self.splitterSizes2=[300,1000]
+        if   self.code in [ 'Adao', 'ADAO','MAP' ] : self.splitterSizes2=[5,1500]
+        else                                  : self.splitterSizes2=[300,1000]
 
 
     #-----------------------------------------
     def restoreSplitterSizes(self,nbWidget=3):
     #----------------------------------------
-      
-      #traceback.print_stack()
-      #print ("je passe ds restoreSplitterSizes")
-      if not(hasattr(self,'splitter')) : return
-      if nbWidget==2  : newSizes=self.splitterSizes2
-      if nbWidget==3  : newSizes=self.splitterSizes3
-      #self.inhibeSplitter = 1
-      #print (newSizes)
-      self.splitter.setSizes(newSizes)
-      #self.inhibeSplitter = 0
-      QApplication.processEvents()
-      # seule la fentetre du milieu est necessaire
-      self.splitter.widget(1).resizeEvent=self.saveSplitterSizes
-   
+
+        #traceback.print_stack()
+        #print ("je passe ds restoreSplitterSizes")
+        if not(hasattr(self,'splitter')) : return
+        if nbWidget==2  : newSizes=self.splitterSizes2
+        if nbWidget==3  : newSizes=self.splitterSizes3
+        #self.inhibeSplitter = 1
+        #print (newSizes)
+        self.splitter.setSizes(newSizes)
+        #self.inhibeSplitter = 0
+        QApplication.processEvents()
+        # seule la fentetre du milieu est necessaire
+        self.splitter.widget(1).resizeEvent=self.saveSplitterSizes
+
     #-----------------------------------------
     def saveSplitterSizes(self,event):
     #-----------------------------------------
-      #print ("je passe ds saveSplitterSizes")
-      if self.inhibeSplitter : return
-      if self.widgetOptionnel == None  : self.splitterSizes2 = self.splitter.sizes()[0:2]
-      else                             : self.splitterSizes3 = self.splitter.sizes()[0:3]
+        #print ("je passe ds saveSplitterSizes")
+        if self.inhibeSplitter : return
+        if self.widgetOptionnel == None  : self.splitterSizes2 = self.splitter.sizes()[0:2]
+        else                             : self.splitterSizes3 = self.splitter.sizes()[0:3]
 
     #------------------------
     def fermeOptionnel(self):
     #------------------------
-      if self.widgetOptionnel == None : return
+        if self.widgetOptionnel == None : return
 
-      self.inhibeSplitter=1
-      self.widgetOptionnel.setParent(None)
-      self.widgetOptionnel.close()
-      self.widgetOptionnel.deleteLater()
-      self.widgetOptionnel=None
-      self.inhibeSplitter=0
-      self.restoreSplitterSizes(2)
+        self.inhibeSplitter=1
+        self.widgetOptionnel.setParent(None)
+        self.widgetOptionnel.close()
+        self.widgetOptionnel.deleteLater()
+        self.widgetOptionnel=None
+        self.inhibeSplitter=0
+        self.restoreSplitterSizes(2)
 
     #------------------------
     def ajoutOptionnel(self):
     #------------------------
-      #if len(self.splitterSizes) == 2 : self.splitterSizes.append(self.oldSizeWidgetOptionnel)
-      #else : self.splitterSizes[2] = self.oldSizeWidgetOptionnel # ceinture pour les close bizarres
-      #self.splitterSizes[1] = self.splitterSizes[1] - self.splitterSizes[2]
-      
-      self.restoreSplitterSizes(3)
+        #if len(self.splitterSizes) == 2 : self.splitterSizes.append(self.oldSizeWidgetOptionnel)
+        #else : self.splitterSizes[2] = self.oldSizeWidgetOptionnel # ceinture pour les close bizarres
+        #self.splitterSizes[1] = self.splitterSizes[1] - self.splitterSizes[2]
+
+        self.restoreSplitterSizes(3)
 
 
     #------------------------
     def fermeArbre(self):
     #------------------------
-       #print (self.widgetTree)
-       self.oldWidgetTree=self.widgetTree
-       self.widgetTree.hide()
-       #self.widgetTree=None
+        #print (self.widgetTree)
+        self.oldWidgetTree=self.widgetTree
+        self.widgetTree.hide()
+        #self.widgetTree=None
 
     #------------------------
     def ouvreArbre(self):
     #------------------------
-       #print ('je passe la')
-       #print (self.widgetTree)
-       #self.widgetTree=self.oldWidgetTree
-       self.widgetTree.show()
-       #self.restoreSplitterSizes(3)
+        #print ('je passe la')
+        #print (self.widgetTree)
+        #self.widgetTree=self.oldWidgetTree
+        self.widgetTree.show()
+        #self.restoreSplitterSizes(3)
 
     #-----------------------
     def getEtapeCourante(self) :
     #-----------------------
-      if len(self.tree.selectedItems()) != 1 : return None
-      etape=self.tree.selectedItems()[0].item.object.getEtape()
-      return etape
+        if len(self.tree.selectedItems()) != 1 : return None
+        etape=self.tree.selectedItems()[0].item.object.getEtape()
+        return etape
     #-----------------------------
     def getTreeIndex(self,noeud):
     #----------------------------
-      indexNoeud=-1
-      if noeud in noeud.treeParent.children :
-          indexNoeud=noeud.treeParent.children.index(noeud)
-      else :
-          if hasattr(noeud,'vraiParent') :
-              noeudVrai = noeud
-              noeudVraiParent = noeud.vraiParent
-              while noeudVraiParent != noeud.treeParent and hasattr(noeudVraiParent,'vraiParent') :
-                  noeudVrai = noeudVraiParent
-                  noeudVraiParent = noeudVraiParent.vraiParent
-                  pass
-              if noeudVraiParent == noeud.treeParent :
-                  indexNoeud=noeud.treeParent.children.index(noeudVrai)
-                  pass
-              pass
-          pass
-      return indexNoeud
+        indexNoeud=-1
+        if noeud in noeud.treeParent.children :
+            indexNoeud=noeud.treeParent.children.index(noeud)
+        else :
+            if hasattr(noeud,'vraiParent') :
+                noeudVrai = noeud
+                noeudVraiParent = noeud.vraiParent
+                while noeudVraiParent != noeud.treeParent and hasattr(noeudVraiParent,'vraiParent') :
+                    noeudVrai = noeudVraiParent
+                    noeudVraiParent = noeudVraiParent.vraiParent
+                    pass
+                if noeudVraiParent == noeud.treeParent :
+                    indexNoeud=noeud.treeParent.children.index(noeudVrai)
+                    pass
+                pass
+            pass
+        return indexNoeud
 
     #-------------------#  Pour execution avec output et error dans le bash
     def runPSEN(self):
     #-------------------#
-    
-      #if self.modified or self.fichier==None  : self.saveFile()
-      self.saveFile()
-        
-      #lancement avec le .bat
-      path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','PSEN_Eficas','PSEN'))
-      WrapperFilePath = os.path.join(path1, 'PSSEWrapper.py') 
-      import subprocess
-      p = subprocess.Popen(['python',WrapperFilePath])
-      (out,err)=p.communicate()        
-      print (out)
-      print (err)
+
+        #if self.modified or self.fichier==None  : self.saveFile()
+        self.saveFile()
+
+        #lancement avec le .bat
+        path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','PSEN_Eficas','PSEN'))
+        WrapperFilePath = os.path.join(path1, 'PSSEWrapper.py')
+        import subprocess
+        p = subprocess.Popen(['python',WrapperFilePath])
+        (out,err)=p.communicate()
+        print (out)
+        print (err)
 
     #-------------------#  Pour execution avec output et error dans le bash
     def runPSEN_N1(self):
     #-------------------#
-      
-
-      self.saveFile()
-      path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','ProcessOutputs_Eficas','TreatOutputs'))
-      sys.path.append(path1)
-
-      if not(self.jdc.isValid()):
-         QMessageBox.information( self, tr( "Unvalid JDC"),tr("incorrect keywords will be ignored"))
-      if 'dicoImbrique' in generator.plugins:
-         self.generator=generator.plugins['dicoImbrique']()
-         jdc_formate=self.generator.gener(self.jdc)
-         dico=self.generator.Dico 
-         
-         ###to delete
-         #fileDico =  r'C:\Logiciels DER\PSEN_V16\Code\ProcessOutputs_Eficas\TreatOutputs\dicoN1.py'
-         fileDico =  os.path.join(path1, 'dicoN1.py') #r'C:\Logiciels DER\PSEN_V16\Code\ProcessOutputs_Eficas\TreatOutputs\dicoN1.py'
-         f = open( str(fileDico), 'w')
-         f.write("Dico =" + str(dico) )
-         f.close()
-         ###
-         
-      
-      print ('in runPSEN_N1', dico)
-      print (dico)
-      from Run import run 
-      run(dico)
-      #res,txt_exception=run(dico)
-      #if res : QMessageBox.information( self, tr("fin de script run"), txt_exception)
-      #else  : QMessageBox.critical( self, tr("Erreur fatale script run"), txt_exception)
-       
+
+
+        self.saveFile()
+        path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','ProcessOutputs_Eficas','TreatOutputs'))
+        sys.path.append(path1)
+
+        if not(self.jdc.isValid()):
+            QMessageBox.information( self, tr( "Unvalid JDC"),tr("incorrect keywords will be ignored"))
+        if 'dicoImbrique' in generator.plugins:
+            self.generator=generator.plugins['dicoImbrique']()
+            jdc_formate=self.generator.gener(self.jdc)
+            dico=self.generator.Dico
+
+            ###to delete
+            #fileDico =  r'C:\Logiciels DER\PSEN_V16\Code\ProcessOutputs_Eficas\TreatOutputs\dicoN1.py'
+            fileDico =  os.path.join(path1, 'dicoN1.py') #r'C:\Logiciels DER\PSEN_V16\Code\ProcessOutputs_Eficas\TreatOutputs\dicoN1.py'
+            f = open( str(fileDico), 'w')
+            f.write("Dico =" + str(dico) )
+            f.close()
+            ###
+
+
+        print ('in runPSEN_N1', dico)
+        print (dico)
+        from Run import run
+        run(dico)
+        #res,txt_exception=run(dico)
+        #if res : QMessageBox.information( self, tr("fin de script run"), txt_exception)
+        #else  : QMessageBox.critical( self, tr("Erreur fatale script run"), txt_exception)
+
     #-------------------#  Pour execution avec output et error dans le bash
     def process_N1(self):
     #-------------------#
 
-      path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','ProcessOutputs_Eficas','TreatOutputs'))
-      sys.path.append(path1)
+        path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','ProcessOutputs_Eficas','TreatOutputs'))
+        sys.path.append(path1)
 
 
-      if 'dicoImbrique' in generator.plugins:
-         self.generator=generator.plugins['dicoImbrique']()
-         jdc_formate=self.generator.gener(self.jdc)
-         dico=self.getDico() #generator.Dico
+        if 'dicoImbrique' in generator.plugins:
+            self.generator=generator.plugins['dicoImbrique']()
+            jdc_formate=self.generator.gener(self.jdc)
+            dico=self.getDico() #generator.Dico
 
 
-         for k in dico['CONTINGENCY_PROCESSING']:
-             #print (k)
-             if k[0:19] == 'Component_List_For_' or k[0:21] =='Contingency_List_For_' :
-                newK=k.replace('__',' ')
-                l="'"+str(newK)+"'"
-                dico['CONTINGENCY_PROCESSING'][l]=dico['CONTINGENCY_PROCESSING'][k]
-                del dico['CONTINGENCY_PROCESSING'][k]
+            for k in dico['CONTINGENCY_PROCESSING']:
+            #print (k)
+                if k[0:19] == 'Component_List_For_' or k[0:21] =='Contingency_List_For_' :
+                    newK=k.replace('__',' ')
+                    l="'"+str(newK)+"'"
+                    dico['CONTINGENCY_PROCESSING'][l]=dico['CONTINGENCY_PROCESSING'][k]
+                    del dico['CONTINGENCY_PROCESSING'][k]
 
-         ###to delete
-         fileDico =  os.path.join(path1, 'dicoN1_process.py')
-         f = open( str(fileDico), 'w')
-         f.write("Dico =" + str(dico) )
-         f.close()
-         ###
-         return dico
+            ###to delete
+            fileDico =  os.path.join(path1, 'dicoN1_process.py')
+            f = open( str(fileDico), 'w')
+            f.write("Dico =" + str(dico) )
+            f.close()
+            ###
+            return dico
 
         #return self.getDico()
 
     #-------------------#  Pour execution avec output et error dans le bash
     def process_VP(self):
     #-------------------#
-      if 'dicoImbrique' in generator.plugins:
-         self.generator=generator.plugins['dicoImbrique']()
-         jdc_formate=self.generator.gener(self.jdc)
-         dico=self.getDico() #generator.Dico
-         return dico
+        if 'dicoImbrique' in generator.plugins:
+            self.generator=generator.plugins['dicoImbrique']()
+            jdc_formate=self.generator.gener(self.jdc)
+            dico=self.getDico() #generator.Dico
+            return dico
 
 if __name__ == "__main__":
     print ('in main')
index af334d7f86672b0a8292bc7654fa1891c63d8078..7627206de75684ffee0eb25298da949ffffdaae5 100755 (executable)
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 
 import types,sys,os, re
 import  subprocess
 import traceback
 
-
-import traceback
-
 # Modules Eficas
 
 import convert, generator
@@ -64,7 +61,7 @@ class JDCEditorSsIhm :
         if fichier != None : self.extensionFichier = os.path.splitext(fichier)[1]
         else : self.extensionFichier = None
         self.jdc         = jdc
-        self.first      = True
+        self.first       = True
         self.jdc_item    = None
         self.dicoNouveauxMC   = {}
         self.dicoNouveauxFact = {}
@@ -80,22 +77,22 @@ class JDCEditorSsIhm :
 
 
         if not hasattr ( self.appliEficas, 'readercata') or self.appliEficas.readercata.demandeCatalogue==True or self.appliEficas.multi==True:
-           if self.maConfiguration.typeDeCata == 'XML' :
-              from InterfaceQT4   import readercataXML as readercata
-           else :
-              from InterfaceQT4   import readercata
-           self.readercata  = readercata.ReaderCata( self, self.appliEficas )
-           self.appliEficas.readercata=self.readercata
-           self.appliEficas.code=self.code
+            if self.maConfiguration.typeDeCata == 'XML' :
+                from InterfaceQT4   import readercataXML as readercata
+            else :
+                from InterfaceQT4   import readercata
+            self.readercata  = readercata.ReaderCata( self, self.appliEficas )
+            self.appliEficas.readercata=self.readercata
+            self.appliEficas.code=self.code
         else :
-           self.readercata=self.appliEficas.readercata
+            self.readercata=self.appliEficas.readercata
         if self.readercata.fichierCata == None : return    #Sortie Salome
         self.titre=self.readercata.titre
 
         self.formatFichierOut =  self.appliEficas.formatFichierOut
         self.formatFichierIn  =  self.appliEficas.formatFichierIn
 
-        if self.appliEficas.maConfiguration.dumpXSD==True : self.appliEficas.dumpXsd()
+        #if self.appliEficas.maConfiguration.dumpXSD==True : self.appliEficas.dumpXsd()
         self.dict_reels={}
         self.liste_simp_reel=[]
         self.dicoNouveauxMC={}
@@ -103,30 +100,30 @@ class JDCEditorSsIhm :
 
 
         try:
-          self.maConfiguration.generator_module
-          _module = __import__(self.maConfiguration.generator_module)
-          info    = _module.entryPoint()
-          generator.plugins.addEntryPoint(info)
+            self.maConfiguration.generator_module
+            _module = __import__(self.maConfiguration.generator_module)
+            info    = _module.entryPoint()
+            generator.plugins.addEntryPoint(info)
         except:
-          pass
+            pass
 
         try:
-          self.maConfiguration.convert_module
-          #print self.maConfiguration.convert_module
-          _module = __import__(self.maConfiguration.convert_module)
-          info = _module.entryPoint()
-          convert.plugins.addEntryPoint(info)
+            self.maConfiguration.convert_module
+            #print self.maConfiguration.convert_module
+            _module = __import__(self.maConfiguration.convert_module)
+            info = _module.entryPoint()
+            convert.plugins.addEntryPoint(info)
         except :
-          pass
+            pass
 
         self.maConfiguration.mesGenerators     = generator
         self.maConfiguration.mesconvertisseurs = convert
         try    : self.XMLgenerator=generator.plugins['xml']()
         except : self.XMLgenerator=None
-        
+
 
         if self.formatFichierOut in generator.plugins.keys():
-           self.generator = generator.plugins[self.formatFichierOut]()
+            self.generator = generator.plugins[self.formatFichierOut]()
 
 
         self.fileInfo       = None
@@ -141,21 +138,21 @@ class JDCEditorSsIhm :
         self.nouveau=0
         if self.fichier is not None:        #  fichier jdc fourni
             if jdc==None :
-               #print ('PNPN : chgt try en if')
-               try :
-               #if 1 :
-                   self.jdc = self.readFile(self.fichier)
-               except :
-                   print ("mauvaise lecture du fichier")
-               if self.salome :
-                  try    : self.appliEficas.addJdcInSalome( self.fichier)
-                  except : print ("mauvais enregistrement dans Salome")
+                #print ('PNPN : chgt try en if')
+                try :
+                #if 1 :
+                    self.jdc = self.readFile(self.fichier)
+                except :
+                    print ("mauvaise lecture du fichier")
+                if self.salome :
+                    try    : self.appliEficas.addJdcInSalome( self.fichier)
+                    except : print ("mauvais enregistrement dans Salome")
             else :
-               self.jdc=jdc
+                self.jdc=jdc
 
             if self.jdc is not None and units is not None:
-               self.jdc.recorded_units=units
-               self.jdc.old_recorded_units=units
+                self.jdc.recorded_units=units
+                self.jdc.old_recorded_units=units
 
         else:
             if not self.jdc:                   #  nouveau jdc
@@ -168,10 +165,10 @@ class JDCEditorSsIhm :
             self.jdc.lang    = self.appliEficas.langue
             self.jdc.aReafficher=False
             txt_exception  = None
-            if not jdc:            
+            if not jdc:
                 if self.extensionFichier == '.xml' :
-                   if self.appliEficas.maConfiguration.withXSD: self.jdc.analyseXML()
-                   else : print ('run MDM with -x option  (MDM for XML)'); exit()
+                    if self.appliEficas.maConfiguration.withXSD: self.jdc.analyseXML()
+                    else : print ('run MDM with -x option  (MDM for XML)'); exit()
                 else : self.jdc.analyse()
                 txt_exception = self.jdc.cr.getMessException()
             if txt_exception :
@@ -199,14 +196,14 @@ class JDCEditorSsIhm :
         formatIn=self.appliEficas.formatFichierIn
         if self.extensionFichier == '.xml' and self.appliEficas.maConfiguration.withXSD: formatIn='xml'
         if formatIn in convert.plugins:
-             # Le convertisseur existe on l'utilise
-             p=convert.plugins[formatIn]()
-             p.readfile(fn)
+            # Le convertisseur existe on l'utilise
+            p=convert.plugins[formatIn]()
+            p.readfile(fn)
 
-             if p.text=="" : self.nouveau=1
-             #print ('PNPN --> CIST a faire')
+            if p.text=="" : self.nouveau=1
+            #print ('PNPN --> CIST a faire')
 
-             if formatIn != 'xml':
+            if formatIn != 'xml':
                 pareil,texteNew=self.verifieChecksum(p.text)
                 if  not pareil : self.informe(("fichier modifie"),("Attention! fichier change hors EFICAS"),False)
                 p.text=texteNew
@@ -215,7 +212,7 @@ class JDCEditorSsIhm :
                 p.text=texteNew
                 text=p.convert('exec',self.appliEficas)
                 if not p.cr.estvide(): self.afficheInfos("Erreur a la conversion",'red')
-             else:
+            else:
                 text=p.text
         else :
             self.afficheInfos("Type de fichier non reconnu",'red')
@@ -264,15 +261,15 @@ class JDCEditorSsIhm :
 
         jdc.lang    = self.appliEficas.langue
         if units is not None:
-           jdc.recorded_units=units
-           jdc.old_recorded_units=units
-        # chgt le 15/10/19 
+            jdc.recorded_units=units
+            jdc.old_recorded_units=units
+        # chgt le 15/10/19
         # Attention positionne  contexte ?
         # est ce qu on ne doit pas changer le format en Accas si on vient d accas ?
         jdc.editor=self
         return jdc
 
-   #--------------------------------#
+    #--------------------------------#
     def _newJDCInclude( self ,units = None):
     #--------------------------------#
         """
@@ -302,8 +299,8 @@ class JDCEditorSsIhm :
         J.editor=self
         J.analyse()
         if units is not None:
-           J.recorded_units=units
-           J.old_recorded_units=units
+            J.recorded_units=units
+            J.old_recorded_units=units
         return J
 
 
@@ -339,26 +336,26 @@ class JDCEditorSsIhm :
     #-----------------------#
     def generDico(self):
     #-----------------------#
-       if 'dico' in generator.plugins:
-         self.generator=generator.plugins['dico']()
-         #print (self.generator)
-         jdc_formate=self.generator.gener(self.jdc)
-         #print (jdc_formate)
-         dico=self.generator.Dico
-         #print (dico)
-         return dico
+        if 'dico' in generator.plugins:
+            self.generator=generator.plugins['dico']()
+            #print (self.generator)
+            jdc_formate=self.generator.gener(self.jdc)
+            #print (jdc_formate)
+            dico=self.generator.Dico
+            #print (dico)
+            return dico
 
     #-----------------------#
     def viewJdcSource(self):
     #-----------------------#
         if self.fichier == None : return
         if os.path.isfile(self.fichier):
-           f=open(self.fichier,'r')
-           texteSource=f.read()
-           f.close()
-           self._viewText(texteSource, "JDC_SOURCE")
+            f=open(self.fichier,'r')
+            texteSource=f.read()
+            f.close()
+            self._viewText(texteSource, "JDC_SOURCE")
         else :
-           self._viewText("file doesn't exist", "JDC_SOURCE")
+            self._viewText("file doesn't exist", "JDC_SOURCE")
 
 
     #-----------------------#
@@ -378,7 +375,7 @@ class JDCEditorSsIhm :
     def viewJdcRegles(self):
     #-----------------------#
         # on ajoute les regles
-        texte_global, test_global =  self.jdc.verifRegles() 
+        texte_global, test_global =  self.jdc.verifRegles()
         self._viewText(texte_global, "JDC_REGLES")
 
     #-----------------------#
@@ -391,16 +388,16 @@ class JDCEditorSsIhm :
     #---------------------#
     def getFileName(self):
     #---------------------#
-      return self.fichier
+        return self.fichier
 
     #-------------------#
     def initModif(self):
     #-------------------#
-      """
-          Met l'attribut modified a 'o' : utilise par Eficas pour savoir
-          si un JDC doit etre sauvegarde avant destruction ou non
-      """
-      self.modified = True
+        """
+            Met l'attribut modified a 'o' : utilise par Eficas pour savoir
+            si un JDC doit etre sauvegarde avant destruction ou non
+        """
+        self.modified = True
 
 
     #--------------------------------------------------#
@@ -419,8 +416,8 @@ class JDCEditorSsIhm :
             txt = self.getTextJDC(self.formatFichierOut,formatLigne=formatLigne)
             eol = '\n'
             if len(txt) >= len(eol):
-               if txt[-len(eol):] != eol:
-                  txt += eol
+                if txt[-len(eol):] != eol:
+                    txt += eol
             else:
                 txt += eol
             txt=self.ajoutVersionCataDsJDC(txt)
@@ -437,34 +434,34 @@ class JDCEditorSsIhm :
             print('Sauvegarde du Fichier', 'Le fichier'+str(fn) + 'n a pas pu etre sauvegarde :'  , str(why))
             self.afficheInfos('Le fichier'+str(fn) + 'n a pas pu etre sauvegarde '  , 'red')
             return 0
-           
+
 
     #-----------------------------------------------------------#
     def getTextJDC(self,format = None,pourRun=0,formatLigne="beautifie"):
     #-----------------------------------------------------------#
-      if self.code == "MAP" and not(format in generator.plugins): format = "MAP"
-      if format == None : format = self.formatFichierOut
-      if format in generator.plugins:
-
-         # Le generateur existe on l'utilise
-         self.generator=generator.plugins[format]()
-         try :
-            jdc_formate=self.generator.gener(self.jdc,format=formatLigne,config=self.appliEficas.maConfiguration,appliEficas=self.appliEficas)
-            if pourRun : jdc_formate=self.generator.textePourRun
-            if self.code == 'TELEMAC' : jdc_formate=self.generator.texteDico
-         except ValueError as e:
-            self.informe( "Erreur a la generation",str(e),'red')
-            return
-
-         if not self.generator.cr.estvide():
-            self.informe("Erreur a la generation","EFICAS ne sait pas convertir ce JDC",'red')
+        if self.code == "MAP" and not(format in generator.plugins): format = "MAP"
+        if format == None : format = self.formatFichierOut
+        if format in generator.plugins:
+
+            # Le generateur existe on l'utilise
+            self.generator=generator.plugins[format]()
+            try :
+                jdc_formate=self.generator.gener(self.jdc,format=formatLigne,config=self.appliEficas.maConfiguration,appliEficas=self.appliEficas)
+                if pourRun : jdc_formate=self.generator.textePourRun
+                if self.code == 'TELEMAC' : jdc_formate=self.generator.texteDico
+            except ValueError as e:
+                self.informe( "Erreur a la generation",str(e),'red')
+                return
+
+            if not self.generator.cr.estvide():
+                self.informe("Erreur a la generation","EFICAS ne sait pas convertir ce JDC",'red')
+                return ""
+            else:
+                return jdc_formate
+        else:
+            # Il n'existe pas c'est une erreur
+            self.informe("Format inconnu", self.format +  " non reconnu" )
             return ""
-         else:
-            return jdc_formate
-      else:
-         # Il n'existe pas c'est une erreur
-         self.informe("Format inconnu", self.format +  " non reconnu" )
-         return ""
 
     #------------------------------#
     def verifieChecksum(self,text):
@@ -477,48 +474,48 @@ class JDCEditorSsIhm :
         checkAvant=text[indexDeb:indexFin+13]
         textJDC=text[0:indexDeb]+text[indexFin+13:-1]
         if self.code != 'PSEN'  and self.code != 'PSEN_N1':
-           checksum=self.getChecksum(textJDC)
-           pareil=(checkAvant==checksum)
+            checksum=self.getChecksum(textJDC)
+            pareil=(checkAvant==checksum)
         else :
-           pareil=1
+            pareil=1
         return pareil, textJDC
 
     #---------------------------#
     def getChecksum(self,texte):
     #---------------------------#
         try :
-           import haslib
-           newtexte=texte.replace('"','\\"')
-           hash_checksum = hashlib.md5()
-           hash_checksum.update(newtexte.encode('utf-8'))
-           checksum = hash_checksum.hexdigest()
-           ligne = ligne="#CHECKSUM:"+checksum+":FIN CHECKSUM"
-        except : 
-           try :
-              newtexte=texte.replace('"','\\"')
-              commande='echo "'+newtexte+'"|md5sum'
-              a=os.popen(commande)
-              checksum=a.read()
-              a.close()
-           except :
-              checksum='Fichier trop long \n'
-           ligne="#CHECKSUM:"+checksum[0:-1]+":FIN CHECKSUM"
-           return ligne
+            import haslib
+            newtexte=texte.replace('"','\\"')
+            hash_checksum = hashlib.md5()
+            hash_checksum.update(newtexte.encode('utf-8'))
+            checksum = hash_checksum.hexdigest()
+            ligne = ligne="#CHECKSUM:"+checksum+":FIN CHECKSUM"
+        except :
+            try :
+                newtexte=texte.replace('"','\\"')
+                commande='echo "'+newtexte+'"|md5sum'
+                a=os.popen(commande)
+                checksum=a.read()
+                a.close()
+            except :
+                checksum='Fichier trop long \n'
+            ligne="#CHECKSUM:"+checksum[0:-1]+":FIN CHECKSUM"
+            return ligne
 
     #----------------------#
     def getDico(self):
     #---------------------#
-      if 'dicoImbrique' in generator.plugins:
-         self.generator=generator.plugins['dicoImbrique']()
-         #print (self.generator)
-         jdc_formate=self.generator.gener(self.jdc)
-         dico=self.generator.Dico
-         return dico
-      else :
-         self.afficheInfos(tr("Format %s non reconnu" , 'Dictionnaire Imbrique' ),'red')
-         return ""
-
-   #-----------------------------------------#
+        if 'dicoImbrique' in generator.plugins:
+            self.generator=generator.plugins['dicoImbrique']()
+            #print (self.generator)
+            jdc_formate=self.generator.gener(self.jdc)
+            dico=self.generator.Dico
+            return dico
+        else :
+            self.afficheInfos(tr("Format %s non reconnu" , 'Dictionnaire Imbrique' ),'red')
+            return ""
+
+    #-----------------------------------------#
     def chercheGroupes(self):
     #-----------------------------------------#
         listeMA,listeNO=self.getTextJDC("GroupMA")
@@ -530,18 +527,18 @@ class JDCEditorSsIhm :
         dicoCourant={}
         format =  self.appliEficas.formatFichierOut
         if format in generator.plugins:
-           # Le generateur existe on l'utilise
-           self.generator=generator.plugins[format]()
-           jdc_formate=self.generator.gener(self.jdc,format='beautifie',config=self.appliEficas.maConfiguration)
-           dicoCourant=self.generator.dico
+            # Le generateur existe on l'utilise
+            self.generator=generator.plugins[format]()
+            jdc_formate=self.generator.gener(self.jdc,format='beautifie',config=self.appliEficas.maConfiguration)
+            dicoCourant=self.generator.dico
         return dicoCourant
 
     #-----------------------------------------------------------------#
     def saveFileLegerAs(self, fileName = None) :
     #-----------------------------------------------------------------#
         if fileName != None :
-           self.fichier = fileName
-           return self.saveFileLeger(fileName)
+            self.fichier = fileName
+            return self.saveFileLeger(fileName)
         return self.saveFileLeger()
 
     #-----------------------------------------------------------------#
@@ -561,24 +558,24 @@ class JDCEditorSsIhm :
     #--------------------------------#
     def ajoutCommentaire(self):
     #--------------------------------#
-      print ('pas programme sans Ihm')
-      print ('prevenir la maintenance du besoin')
+        print ('pas programme sans Ihm')
+        print ('prevenir la maintenance du besoin')
 
 
     #--------------------------------------#
     def informe(self,titre,txt,critique=True):
     #--------------------------------------#
     # methode differenre avec et sans ihm
-      if critique : print ('!!!!!!!!!!!!!!!!!!!!!!!!!!!')
-      print (titre)
-      print (txt)
-      if critique : print ('!!!!!!!!!!!!!!!!!!!!!!!!!!!')
+        if critique : print ('!!!!!!!!!!!!!!!!!!!!!!!!!!!')
+        print (titre)
+        print (txt)
+        if critique : print ('!!!!!!!!!!!!!!!!!!!!!!!!!!!')
 
     #--------------------------------------#
     def afficheInfos(self,txt,couleur=None):
     #--------------------------------------#
     # methode differenre avec et sans ihm
-      print (txt)
+        print (txt)
 
     #-----------------------------------------------------------------------#
     def _viewText(self, txt, caption = "FILE_VIEWER",largeur=1200,hauteur=600):
@@ -604,9 +601,9 @@ class JDCEditorSsIhm :
         if not (self.writeFile(fichier,formatLigne=formatLigne)): return (0, None)
         if  self.jdc.cata.modeleMetier and self.jdc.isValid():
             if self.generator != self.XMLgenerator :
-               self.XMLgenerator.gener(self.jdc)
-               self.XMLgenerator.writeDefault(fichier)
-               return(1,self.fichier)
+                self.XMLgenerator.gener(self.jdc)
+                self.XMLgenerator.writeDefault(fichier)
+                return(1,self.fichier)
         if self.jdc.isValid() and hasattr(self.generator, "writeDefault"):
             self.generator.writeDefault(fichier)
         elif self.code=="TELEMAC" and hasattr(self.generator, "writeDefault"):
@@ -640,13 +637,13 @@ class JDCEditorSsIhm :
         etape=monItem.item.object
         CONTEXT.set_current_step(etape)
         try :
-          ok=etape.build_includeEtape(texte)
+            ok=etape.build_includeEtape(texte)
         except :
-          ok=0
+            ok=0
         if not ok :
-           QMessageBox.information( self,
-                      tr("Import texte"),
-                      tr("Impossible d importer le texte"))
+            QMessageBox.information( self,
+                       tr("Import texte"),
+                       tr("Impossible d importer le texte"))
         self.tree.racine.build_children()
         return ok
 
@@ -664,7 +661,7 @@ class JDCEditorSsIhm :
     # dans le JDC
         ouChercher=etape
         for mot in listeAvant :
-              ouChercher=ouChercher.getChild(mot,restreint="oui")
+            ouChercher=ouChercher.getChild(mot,restreint="oui")
         monMC=ouChercher.getChild(MCFils,restreint="oui")
         if monMC != None :  ouChercher.suppentite(monMC)
         ouChercher.state='changed'
@@ -679,7 +676,7 @@ class JDCEditorSsIhm :
         ouChercher=etape
         if debug : print (ouChercher)
         for mot in listeAvant :
-           ouChercher=ouChercher.getChild(mot,restreint="oui")
+            ouChercher=ouChercher.getChild(mot,restreint="oui")
         monMC=ouChercher.getChild(MCFils,restreint="oui")
         if monMC == None : monMC = ouChercher.addEntite(MCFils)
         monMC.valeur=valeurs
@@ -698,7 +695,7 @@ class JDCEditorSsIhm :
         ouChercher=etape
         if debug : print (ouChercher)
         for mot in listeAvant :
-           ouChercher=ouChercher.getChild(mot,restreint="oui")
+            ouChercher=ouChercher.getChild(mot,restreint="oui")
         # Attention si +sieursMCFACT
         ouChercher=ouChercher[0]
         if debug : print (ouChercher)
@@ -716,7 +713,7 @@ class JDCEditorSsIhm :
     # dans le JDC
         ouChercher=etape
         for mot in listeAvant :
-              ouChercher=ouChercher.getChild(mot,restreint="oui")
+            ouChercher=ouChercher.getChild(mot,restreint="oui")
         monMC=etape.getChild(ouChercher,restreint="oui")
         if monMC== None : monMC= ouChercher.addEntite(MCFils)
         monMC.isvalid()
@@ -727,14 +724,14 @@ class JDCEditorSsIhm :
     # pour VP
         monObj=etape
         for mot in listeAvant :
-              monObj=monObj.getChild(mot,restreint="oui")
-              if monObj==None : return False
+            monObj=monObj.getChild(mot,restreint="oui")
+            if monObj==None : return False
         if monObj == None : return False
         if monObj.valeur != valeur :
-           # PNPN le setValeur fait des bugs --> pourquoi
-           #monObj.setValeur(valeur)
-           monObj.valeur=valeur
-           monObj.isValid()
+            # PNPN le setValeur fait des bugs --> pourquoi
+            #monObj.setValeur(valeur)
+            monObj.valeur=valeur
+            monObj.isValid()
         return True
 
     #-------------------------------------------------#
@@ -749,9 +746,9 @@ class JDCEditorSsIhm :
         if debug : print ('etape trouvee', ouChercher)
         if ouChercher==None : return None
         for mot in listeAvant :
-              ouChercher=ouChercher.getChild(mot,restreint="oui")
-              if debug : print (mot, ouChercher)
-              if ouChercher==None : return None
+            ouChercher=ouChercher.getChild(mot,restreint="oui")
+            if debug : print (mot, ouChercher)
+            if ouChercher==None : return None
         monMC=ouChercher.getChild(MCFils,restreint="oui")
         if debug : print ('monMC', monMC)
         if monMC== None : return None
@@ -766,9 +763,9 @@ class JDCEditorSsIhm :
         ouChercher=etape
         debug=0
         for mot in listeAvant :
-              ouChercher=ouChercher.getChild(mot,restreint="oui")
-              if debug : print (mot, ouChercher)
-              if ouChercher==None : return None
+            ouChercher=ouChercher.getChild(mot,restreint="oui")
+            if debug : print (mot, ouChercher)
+            if ouChercher==None : return None
         monMC=ouChercher.getChild(MCFils,restreint="oui")
         if debug : print ('monMC', monMC)
         return monMC
@@ -783,9 +780,9 @@ class JDCEditorSsIhm :
             if e.nom == nomEtape : ouChercher=e; break
         if ouChercher==None : return None
         for mot in listeAvant :
-              ouChercher=ouChercher.getChild(mot,restreint="oui")
-              #print (mot, ouChercher)
-              if ouChercher==None : return None
+            ouChercher=ouChercher.getChild(mot,restreint="oui")
+            #print (mot, ouChercher)
+            if ouChercher==None : return None
         monMC=ouChercher.getChild(MCFils,restreint="oui")
         monMC.set_valeur(valeur)
         monMC.isvalid()
@@ -796,14 +793,14 @@ class JDCEditorSsIhm :
     # dans le JDC
         ouChercher=etape
         if isinstance (etape, str):
-           ouChercher=None
-           for e in self.jdc.etapes:
-              if e.nom == etape : ouChercher=e; break
+            ouChercher=None
+            for e in self.jdc.etapes:
+                if e.nom == etape : ouChercher=e; break
         if ouChercher==None : return
 
         for mot in listeAvant :
-              ouChercher=ouChercher.getChild(mot,restreint="oui")
-              if ouChercher==None : return
+            ouChercher=ouChercher.getChild(mot,restreint="oui")
+            if ouChercher==None : return
         monMC=ouChercher.getChild(MCFils,restreint="oui")
         if monMC== None : monMC= ouChercher.addEntite(MCFils)
 
@@ -822,20 +819,20 @@ class JDCEditorSsIhm :
 
         for mot in listeAvant :
             try :
-              ouChercher=ouChercher.getChild(mot,restreint="oui")
+                ouChercher=ouChercher.getChild(mot,restreint="oui")
             # Le mot clef n est pas la
             except : return 0
         try :
-           monMC=ouChercher.getChild(MCFils,restreint="oui")
+            monMC=ouChercher.getChild(MCFils,restreint="oui")
         # Le mot clef n est pas la
         except : return 0
         if monMC == None : return 0
 
         if hasattr(monMC.definition,'into') :
-           if type(monMC.definition.into) ==types.FunctionType : maListeDeValeur=monMC.definition.into()
-           else : maListeDeValeur=monMC.definition.into
+            if type(monMC.definition.into) ==types.FunctionType : maListeDeValeur=monMC.definition.into()
+            else : maListeDeValeur=monMC.definition.into
         else :
-           return 0
+            return 0
 
         monMC.state='changed'
         return 1
@@ -854,9 +851,9 @@ class JDCEditorSsIhm :
         ouChercher=definitionEtape
         if len(listeMC) > 1 :
 
-           for mc in listeMC[0:-1]:
-             mcfact=ouChercher.entites[mc]
-             ouChercher=mcfact
+            for mc in listeMC[0:-1]:
+                mcfact=ouChercher.entites[mc]
+                ouChercher=mcfact
 
         mcAccas=ouChercher.entites[listeMC[-1]]
         mcAccas.defaut=valeurs
@@ -897,8 +894,8 @@ class JDCEditorSsIhm :
     # dans le MDD
         #print 'in deleteDefinitionMC', etape,listeAvant,nomDuMC
         if isinstance (etape, str):
-          for e in self.jdc.etapes:
-            if e.nom == etape : etape=e; break
+            for e in self.jdc.etapes:
+                if e.nom == etape : etape=e; break
         if etape == None : return
         #definitionEtape=getattr(self.jdc.cata[0],etape)
         definitionEtape=getattr(self.jdc.cata,etape)
@@ -974,8 +971,8 @@ class JDCEditorSsIhm :
         self.changeIntoDefMC(etape,listeMC,into)
 
         if isinstance (etape, str):
-          for e in self.jdc.etapes:
-            if e.nom == etape : etape=e; break
+            for e in self.jdc.etapes:
+                if e.nom == etape : etape=e; break
         if etape == None : return
 
         ouChercher = etape
@@ -1008,11 +1005,11 @@ class JDCEditorSsIhm :
         indexDeb=text.find("#VERSION_CATALOGUE:")
         indexFin=text.find(":FIN VERSION_CATALOGUE")
         if indexDeb < 0 :
-           self.versionCataDuJDC="sans"
-           textJDC=text
+            self.versionCataDuJDC="sans"
+            textJDC=text
         else :
-           self.versionCataDuJDC=text[indexDeb+19:indexFin]
-           textJDC=text[0:indexDeb]+text[indexFin+23:-1]
+            self.versionCataDuJDC=text[indexDeb+19:indexFin]
+            textJDC=text[0:indexDeb]+text[indexFin+23:-1]
 
         self.versionCata="sans"
         if hasattr(self.readercata.cata,'VERSION_CATALOGUE'): self.versionCata=self.readercata.cata.VERSION_CATALOGUE
@@ -1069,39 +1066,39 @@ class JDCEditorSsIhm :
     #---------------------------#
     def _newJDCCND(self):
     #---------------------------#
-      extensions=tr('Fichiers Med (*.med);;''Tous les Fichiers (*)')
-
-      #if self.salome == 0 :
-      QMessageBox.information( self,
-                      tr("Fichier Med"),
-                      tr("Veuillez selectionner un fichier Med"))
-      QSfichier = QFileDialog.getOpenFileName(self.appliEficas,
-                        caption='Fichier Med',
-                        filter=extensions)
-      QSfichier=QSfichier[0]
-      self.fichierMED=QSfichier
-      from acquiertGroupes import getGroupes
-      erreur,self.listeGroupes,self.nomMaillage,self.dicoCoord=getGroupes(self.fichierMED)
-      if erreur != "" : print ("a traiter")
-      texteComm="COMMENTAIRE(u'Cree - fichier : "+self.fichierMED +" - Nom Maillage : "+self.nomMaillage+"');\nPARAMETRES()\n"
-      texteSources=""
-      texteCond=""
-      texteNoCond=""
-      texteVcut=""
-      texteZs=""
-      for groupe in self.listeGroupes :
-          if groupe[0:8]=='CURRENT_':
-             texteSources +=groupe[8:]+"=SOURCE("
-             texteSources +="VecteurDirecteur=(1.0,2.0,3.0,),);\n"
-          if groupe[0:5]=='COND_':    texteCond    +=groupe[5:]+"=CONDUCTEUR();\n"
-          if groupe[0:7]=='NOCOND_':  texteNoCond  +=groupe[7:]+"=NOCOND();\n"
-          if groupe[0:5]=='VCUT_':    texteVcut    +='V_'+groupe[5:]+"=VCUT();\n"
-          if groupe[0:3]=='ZS_':      texteZs      +=groupe[3:]+"=ZS();\n"
-      texte=texteComm+texteSources+texteCond+texteNoCond+texteVcut+texteZs
-      self.newTexteCND=texte
-      self.modified=1
-      return texte
+        extensions=tr('Fichiers Med (*.med);;''Tous les Fichiers (*)')
+
+        #if self.salome == 0 :
+        QMessageBox.information( self,
+                        tr("Fichier Med"),
+                        tr("Veuillez selectionner un fichier Med"))
+        QSfichier = QFileDialog.getOpenFileName(self.appliEficas,
+                          caption='Fichier Med',
+                          filter=extensions)
+        QSfichier=QSfichier[0]
+        self.fichierMED=QSfichier
+        from acquiertGroupes import getGroupes
+        erreur,self.listeGroupes,self.nomMaillage,self.dicoCoord=getGroupes(self.fichierMED)
+        if erreur != "" : print ("a traiter")
+        texteComm="COMMENTAIRE(u'Cree - fichier : "+self.fichierMED +" - Nom Maillage : "+self.nomMaillage+"');\nPARAMETRES()\n"
+        texteSources=""
+        texteCond=""
+        texteNoCond=""
+        texteVcut=""
+        texteZs=""
+        for groupe in self.listeGroupes :
+            if groupe[0:8]=='CURRENT_':
+                texteSources +=groupe[8:]+"=SOURCE("
+                texteSources +="VecteurDirecteur=(1.0,2.0,3.0,),);\n"
+            if groupe[0:5]=='COND_':    texteCond    +=groupe[5:]+"=CONDUCTEUR();\n"
+            if groupe[0:7]=='NOCOND_':  texteNoCond  +=groupe[7:]+"=NOCOND();\n"
+            if groupe[0:5]=='VCUT_':    texteVcut    +='V_'+groupe[5:]+"=VCUT();\n"
+            if groupe[0:3]=='ZS_':      texteZs      +=groupe[3:]+"=ZS();\n"
+        texte=texteComm+texteSources+texteCond+texteNoCond+texteVcut+texteZs
+        self.newTexteCND=texte
+        self.modified=1
+        return texte
 
 
 if __name__ == "__main__":
-   print ('a faire')
+    print ('a faire')
index 1f7828cedd5571f7087157ca907131995421a8fd..7ae725e967dbb0b2d0061c4c9ca80006da270d17 100755 (executable)
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
-
 import sys,os
 repIni     = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),".."))
 ihmQTDir   = os.path.join(repIni,"UiQT5")
@@ -37,6 +36,9 @@ if ihmDir     not in sys.path : sys.path.append(ihmDir)
 if ihmQTDir   not in sys.path : sys.path.append(ihmQTDir)
 if editeurDir not in sys.path : sys.path.append(editeurDir)
 
+if sys.version_info[0] < 3:
+    print("Must be using Python 3")
+    sys.exit()
 
 def lanceEficas(code=None, multi=False, langue='en', labelCode=None):
 #-------------------------------------------------------------------
@@ -44,10 +46,10 @@ def lanceEficas(code=None, multi=False, langue='en', labelCode=None):
         Lance l'appli EFICAS avec Ihm
     """
     try :
-      from PyQt5.QtWidgets import QApplication
+        from PyQt5.QtWidgets import QApplication
     except :
-      print('Please, set qt environment')
-      return
+        print('Please, set qt environment')
+        return
 
     from Editeur  import session
     options = session.parse(sys.argv)
@@ -62,8 +64,8 @@ def lanceEficas(code=None, multi=False, langue='en', labelCode=None):
     res=app.exec_()
     sys.exit(res)
 
-def getEficasSsIhm(code=None, multi=False, langue='en', labelCode=None,forceXML=False, genereXSD=False):
-#------------------------------------------------------------------------------------------------------
+def getEficasSsIhm(code=None, multi=False, langue='en', ssCode=None, labelCode=None,forceXML=False, genereXSD=False, fichierCata=None):
+#-------------------------------------------------------------------------------------------------------------------------
     """
         Lance l'appli EFICAS sans Ihm
     """
@@ -73,7 +75,7 @@ def getEficasSsIhm(code=None, multi=False, langue='en', labelCode=None,forceXML=
     if forceXML : options.withXSD=True
 
     from InterfaceQT4.qtEficasSsIhm import AppliSsIhm
-    Eficas=AppliSsIhm(code=code, salome=0, multi=multi, langue=langue, labelCode=labelCode, genereXSD=genereXSD)
+    Eficas=AppliSsIhm(code=code, salome=0, multi=multi, langue=langue, ssCode=ssCode, labelCode=labelCode, genereXSD=genereXSD, fichierCata=fichierCata)
     return Eficas
 
 
@@ -83,13 +85,14 @@ def genereXSD(code=None):
     from Editeur  import session
     options = session.parse(sys.argv)
     if code != None : options.code = code
-    if options.fichierCata == None : 
-       print ('Use -c cata_name.py')
-       return
+    if options.fichierCata == None :
+        print ('Use -c cata_name.py')
+        return
 
     monEficasSsIhm = getEficasSsIhm(code=options.code,genereXSD=True)
     monEditor=monEficasSsIhm.getEditor()
-    texteXSD=monEficasSsIhm.dumpXsd(avecEltAbstrait=options.avecEltAbstrait)
+    #texteXSD=monEficasSsIhm.dumpXsd(avecEltAbstrait=options.avecEltAbstrait)
+    texteXSD=monEditor.dumpXsd(avecEltAbstrait=options.avecEltAbstrait)
 
     fichierCataTrunc=os.path.splitext(os.path.basename(options.fichierCata))[0]
     #if fichierCataTrunc[0:4] in ('cata','Cata'): fichierCataTrunc=fichierCataTrunc[4:]
@@ -104,34 +107,62 @@ def genereXML(code=None):
     from Editeur  import session
     options=session.parse(sys.argv)
     if code != None : options.code = code
-    if options.fichierCata == None : 
-       print ('Use -c cata_name.py')
-       return
-    fichier=options.comm[0]
-    if fichier==None : 
-       print ('comm file is needed')
-       return
-    
+    if options.fichierCata == None :
+        print ('Use -c cata_name.py')
+        return
+    try    : fichier=options.comm[0]
+    except : fichier=None
+    if fichier==None :
+        print ('comm file is needed')
+        return
+
     monEficasSsIhm = getEficasSsIhm(code=options.code, forceXML=True)
 
     from .editorSsIhm import JDCEditorSsIhm
     monEditeur=JDCEditorSsIhm(monEficasSsIhm,fichier)
-    fichierXML=fichier[:fichier.rfind(".")]+'.xml'
+    if options.fichierXMLOut == None :
+        fichierXMLOut=fichier[:fichier.rfind(".")]+'.xml'
+    else :
+        fichierXMLOut=options.fichierXMLOut
+    if not(monEditeur.jdc.isValid()):
+        print ('Fichier comm is not valid')
+        return
+    #print ('Fichier comm is not valid')
     monEditeur.XMLgenerator.gener(monEditeur.jdc)
-    monEditeur.XMLgenerator.writeDefault(fichierXML)
+    monEditeur.XMLgenerator.writeDefault(fichierXMLOut)
+
+def genereStructure(code=None):
+#------------------------------
+    from Editeur  import session
+    options=session.parse(sys.argv)
+    if code != None : options.code = code
+    if options.fichierCata == None :
+        print ('Use -c cata_name.py')
+        return
+
+    monEficasSsIhm = getEficasSsIhm(code=options.code,genereXSD=True)
+    monEditor=monEficasSsIhm.getEditor()
+    texteStructure=monEditor.dumpStructure()
+
+    fichierCataTrunc=os.path.splitext(os.path.basename(options.fichierCata))[0]
+    fileStructure = fichierCataTrunc + '.txt'
+    f = open( str(fileStructure), 'w')
+    f.write(str(texteStructure))
+    f.close()
+
 
 def validateDataSet(code=None):
 #------------------------------
     from Editeur  import session
     options=session.parse(sys.argv)
     if code != None : options.code = code
-    if options.fichierCata == None : 
-       print ('Use -c cata_name.py')
-       return
+    if options.fichierCata == None :
+        print ('Use -c cata_name.py')
+        return
     fichier=options.comm[0]
-    if fichier==None : 
-       print ('comm file is needed')
-       return
+    if fichier==None :
+        print ('comm file is needed')
+        return
     from .editorSsIhm import JDCEditorSsIhm
     monEficasSsIhm = getEficasSsIhm(code=options.code)
     monEditeur=JDCEditorSsIhm(monEficasSsIhm,fichier)
@@ -139,7 +170,7 @@ def validateDataSet(code=None):
     else : print ('Jdc is valid')
     return monEditeur.jdc.isValid()
 
-def validateFonction(laFonction, debug=True):
+def validateFonction(laFonction, debug=False):
 #-------------------------------
     # ici un singleton pour avoir l editor, le catalogue et...
     monEficasSsIhm = getEficasSsIhm(code='Essai')
@@ -152,47 +183,48 @@ def validateFonction(laFonction, debug=True):
     def fonctionValidee(*args, **kwargs):
         laFonctionName = laFonction.__name__
         if debug : print('Appel {} avec args={} et kwargs={}'.format( laFonction.__name__, args, kwargs))
-        listArgsNames   = list(OrderedDict.fromkeys(getargspec(laFonction)[0]))
-        listKwargsNames = list(kwargs.keys())
-        if debug : print (listArgsNames)
-        if debug : print (listKwargsNames)
-        #listTousNames = listArgsNames+listKwargsNames
-        #if debug : print (listTousNames)
-        #args_dict = OrderedDict(list(zip(args_name, args)) + list(kwargs.iteritems()))
-        #print (args_dict)
-
-        #laDefDeLaFonctionDansAccas = getattr(monEditor.readercata.cata,laFonctionName)
-        #print (laDefDeLaFonctionDansAccas)
-        #print (laDefDeLaFonctionDansAccas.entites)
-        #print (dir(laDefDeLaFonctionDansAccas))
-        #print (args)
-        #dict1={'monArgument1' : 'a', 'monArgument2' : 'uuu'}
-        
-        #objConstruit = laDefDeLaFonctionDansAccas.makeObjetPourVerifSignature(**dict1)
-        #print (objConstruit)
-        #print (objConstruit.isValid())
-        ret = laFonction(*args, **kwargs)
-        return ret
+        laDefDeLaFonctionDansAccas = getattr(monEditor.readercata.cata,laFonctionName)
+        objConstruit = laDefDeLaFonctionDansAccas.makeObjetPourVerifSignature(*args,**kwargs)
+        if (objConstruit.isValid()) :
+            ret = laFonction(*args, **kwargs)
+            return ret
+        else :
+            print ('mauvais arguments')
+            print (objConstruit.CR())
+            return None
     return fonctionValidee
 
         #maClasseAccas=getattr(self.cata,objEtape.monNomClasseAccas)
     return fonctionValidee
 
-    
+
     return laFonction
-   
+
+def createFromDocumentAccas(fichierCata=None,fichier=None,code=None):
+#------------------------------------------------------------
+    if fichier == None : print ('file is needed'); return None
+    if fichierCata == None    : print ('cata file is needed'); return None
+
+    from Noyau.N_OBJECT import activeSurcharge
+    activeSurcharge()
+
+    from .editorSsIhm import JDCEditorSsIhm
+    monEficasSsIhm = getEficasSsIhm(code='Essai', fichierCata=fichierCata)
+    monEditeur=JDCEditorSsIhm(monEficasSsIhm,fichier)
+    return monEditeur.jdc
+    #from Noyau
 
 
 # --------------------------- toutes les fonctions après sont obseletes
 def lanceEficas_ssIhm(code=None,fichier=None,ssCode=None,version=None,debug=False,langue='en'):
     """
-        Lance l'appli EFICAS SsIhm 
+        Lance l'appli EFICAS SsIhm
     """
     # Analyse des arguments de la ligne de commande
     print ('deprecated')
     from Editeur  import session
     options=session.parse(sys.argv)
-    if version!=None and options.version == None : options.version=version 
+    if version!=None and options.version == None : options.version=version
     if fichier == None : fichier=options.comm[0]
     if code    == None : code=options.code
 
@@ -204,8 +236,8 @@ def lanceEficas_ssIhm(code=None,fichier=None,ssCode=None,version=None,debug=Fals
 
     from . import readercata
     if not hasattr ( Eficas, 'readercata'):
-           monreadercata  = readercata.ReaderCata( parent, Eficas )
-           Eficas.readercata=monreadercata
+        monreadercata  = readercata.ReaderCata( parent, Eficas )
+        Eficas.readercata=monreadercata
 
     from .editor import JDCEditor
     monEditeur=JDCEditor(Eficas,fichier)
@@ -225,35 +257,35 @@ def lanceEficas_ssIhm_reecrit(code=None,fichier=None,ssCode=None,version=None,ou
     print ('deprecated')
     #print 'lanceEficas_ssIhm_reecrit', fichier
     monEditeur=lanceEficas_ssIhm(code,fichier,ssCode,version,langue=langue)
-    if ou == None : 
-       fileName=fichier.split(".")[0]+"_reecrit.comm"
-       fn=fichier.split(".")[0]+"_cr.txt"
+    if ou == None :
+        fileName=fichier.split(".")[0]+"_reecrit.comm"
+        fn=fichier.split(".")[0]+"_cr.txt"
     else :
-       f=fichier.split(".")[0]+"_reecrit.comm"
-       f1=os.path.basename(f)
-       fn=fichier.split(".")[0]+"_cr.txt"
-       f2=os.path.basename(fn)
-       fileName=os.path.join(ou,f1)
-       fileCr=os.path.join(ou,f2)
+        f=fichier.split(".")[0]+"_reecrit.comm"
+        f1=os.path.basename(f)
+        fn=fichier.split(".")[0]+"_cr.txt"
+        f2=os.path.basename(fn)
+        fileName=os.path.join(ou,f1)
+        fileCr=os.path.join(ou,f2)
     debut=False
     if debug :
-         import cProfile, pstats, StringIO
-         pr = cProfile.Profile()
-         pr.enable()
-         monEditeur.saveFileAs(fileName=fileName)
-         pr.disable()
-         s = StringIO.StringIO()
-         sortby = 'cumulative'
-         ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
-         ps.print_stats()
-         print (s.getValue())
+        import cProfile, pstats, StringIO
+        pr = cProfile.Profile()
+        pr.enable()
+        monEditeur.saveFileAs(fileName=fileName)
+        pr.disable()
+        s = StringIO.StringIO()
+        sortby = 'cumulative'
+        ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
+        ps.print_stats()
+        print (s.getValue())
 
     elif not leger : monEditeur.saveFileAs(fileName=fileName)
     else : monEditeur.saveFileLegerAs(fileName=fileName)
     if cr:
-       f = open(fileCr, 'w')
-       f.write(str(monEditeur.jdc.report()))
-       f.close()
+        f = open(fileCr, 'w')
+        f.write(str(monEditeur.jdc.report()))
+        f.close()
 
 def lanceEficas_param(code='Adao',fichier=None,version='V0',macro='ASSIMILATION_STUDY'):
     """
@@ -271,8 +303,8 @@ def lanceEficas_param(code='Adao',fichier=None,version='V0',macro='ASSIMILATION_
 
     from . import readercata
     if not hasattr ( Eficas, 'readercata'):
-           monreadercata  = readercata.ReaderCata( parent, Eficas )
-           Eficas.readercata=monreadercata
+        monreadercata  = readercata.ReaderCata( parent, Eficas )
+        Eficas.readercata=monreadercata
 
     from .editor import JDCEditor
     monEditeur=JDCEditor(Eficas,fichier)
@@ -308,7 +340,7 @@ def loadJDC(filename):
     jdc = ""
     for line in fcomm.readlines():
         if not (line[0]=='#'):
-           jdc+="%s"%line
+            jdc+="%s"%line
 
     # Warning, we have to make sure that the jdc comes as a simple
     # string without any extra spaces/newlines
@@ -318,5 +350,3 @@ if __name__ == "__main__":
     import sys
     sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..')))
     lanceEficas(code=None,multi=True)
-    
-
index aa6f6e0945e4d5a52121b7a7ffb21fa717dea35a..e8f1dc3cd9b341ba9f7bc81436078a28200fcb63 100644 (file)
@@ -20,9 +20,9 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-  from builtins import str
+    from builtins import str
 except :
-  pass
+    pass
 import types,os
 import traceback
 
@@ -37,93 +37,112 @@ from .gereIcones import FacultatifOuOptionnel
 from .qtSaisie    import SaisieValeur
 
 nomMax=230
-# empirique les metrics ne fonctionnent pas 
+# empirique les metrics ne fonctionnent pas
 # ---------------------------------------------------------------------- #
 class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel):
 # --------------------------------------------------------------------- #
 
 
-   def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-       #print ("Feuille", monSimpDef,nom,objSimp)
-       QWidget.__init__(self,None)
-       self.node=node
-       self.node.fenetre=self
-
-       # on se positionne pour les icones
-       #os.chdir(os.path.abspath(os.path.join(os.path.dirname(__file__))))
-       self.setupUi(self)
-       self.prendLeFocus=0
-
-       maPolice= QFont("Times", 10)
-       self.setFont(maPolice)
-       self.setFocusPolicy(Qt.StrongFocus)
-
-       self.parentQt=parentQt
-       self.editor=self.node.editor
-       self.appliEficas=self.editor.appliEficas
-       self.repIcon=self.appliEficas.repIcon
-       self.monSimpDef=monSimpDef
-       self.nom=nom
-       self.objSimp=objSimp
-       self.node.fenetre=self
-       self.maCommande=commande
-
-       self.aRedimensionner=0
-       self.setSuggestion()
-       self.setValeurs()
-       self.setNom()
-       self.setValide()
-       self.setIconePoubelle()
-       self.setIconesFichier()
-       self.setIconesSalome()
-       self.setIconesGenerales()
-       self.setCommentaire()
-       self.setZoneInfo()
-     
-
-   def setNom(self):
-       self.debutToolTip=""
-       nomTraduit=tr(self.objSimp.nom)
-       #metrix= QFontMetrics(self.label.font())
-       #maxLongueur = self.label.width() - 2
-       #print ('______________________')
-       #print (nomTraduit)
-       #print (self.label.font().pixelSize())
-       #longueur2 = metrix.boundingRect(nomTraduit).width()
-       longueur=QFontMetrics(self.label.font()).width(nomTraduit)
-       if longueur >= nomMax :
-         nouveauNom=self.formate(nomTraduit)
-         self.label.setText(nouveauNom)
-       else :   
-         self.label.setText(nomTraduit)
-       #clidedText = metrics.elidedText(text, Qt.ElideRight, label.width());
-       #if (clippedText != nomTraduit): self.label.setToolTip(nomTraduit)
-       #self.label.setText(clippedText)
-
-   #def agrandit(self):
-       # inutile pour certains widgets
-   #    if self.height() < 40 :
-   #       self.setMinimumHeight(50)
-   #       self.resize(self.width(),200)
-
-   #def mousePressEvent(self, event):
-     #print 'mousePressEvent'
-     #import inspect
-     #print (inspect.getmro(self.__class__))
-     #self.__class__.mousePressEvent(self, event)
-
-
-                                 
-   def setValeurs(self):
-      # print "passe dans setValeurs pour ", self.objSimp.nom
-      # print "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+        #print ("Feuille", monSimpDef,nom,objSimp)
+        QWidget.__init__(self,None)
+        self.node=node
+        self.node.fenetre=self
+
+        # on se positionne pour les icones
+        #os.chdir(os.path.abspath(os.path.join(os.path.dirname(__file__))))
+        self.setupUi(self)
+        self.prendLeFocus=0
+
+        maPolice= QFont("Times", 10)
+        self.setFont(maPolice)
+        self.setFocusPolicy(Qt.StrongFocus)
+
+        self.parentQt=parentQt
+        self.editor=self.node.editor
+        self.appliEficas=self.editor.appliEficas
+        self.repIcon=self.appliEficas.repIcon
+        self.monSimpDef=monSimpDef
+        self.nom=nom
+        self.objSimp=objSimp
+        self.node.fenetre=self
+        self.maCommande=commande
+
+        self.aRedimensionner=0
+        self.setSuggestion()
+        self.setValeurs()
+        self.setNom()
+        self.setValide()
+        self.setIconePoubelle()
+        self.setIconesFichier()
+        self.setIconesSalome()
+        self.setIconesGenerales()
+        self.setCommentaire()
+        self.setZoneInfo()
+        self.setUnite()
+        self.setUQ()
+
+
+    def setUnite(self):
+        if self.monSimpDef.unite == None  :
+            if hasattr( self,'lineEditUnite') : self.lineEditUnite.setText(' ')
+        else :
+            if hasattr( self,'lineEditUnite') : self.lineEditUnite.setText(self.monSimpDef.unite)
+            else : self.editor.informe('Erreur de Catalogue','Champ Unite non prevu pour '+ self.nom + ' correction du catalogue souhaitable, prevenez la maintenance', False)
+
+    def setUQ(self):
+        if not (self.editor.appliEficas.maConfiguration.afficheUQ) and hasattr(self,'checkBoxUQ') :
+             self.checkBoxUQ.close()
+             return
+        if not self.monSimpDef.UQPossible(): 
+             self.checkBoxUQ.close()
+             return
+        if self.objSimp.isUQActivate() and hasattr(self,'checkBoxUQ') :
+             self.checkBoxUQ.setChecked(True)
+
+    def setNom(self):
+        self.debutToolTip=""
+        nomTraduit=tr(self.objSimp.nom)
+        #metrix= QFontMetrics(self.label.font())
+        #maxLongueur = self.label.width() - 2
+        #print ('______________________')
+        #print (nomTraduit)
+        #print (self.label.font().pixelSize())
+        #longueur2 = metrix.boundingRect(nomTraduit).width()
+        longueur=QFontMetrics(self.label.font()).width(nomTraduit)
+        if longueur >= nomMax :
+            nouveauNom=self.formate(nomTraduit)
+            self.label.setText(nouveauNom)
+        else :
+            self.label.setText(nomTraduit)
+        #clidedText = metrics.elidedText(text, Qt.ElideRight, label.width());
+        #if (clippedText != nomTraduit): self.label.setToolTip(nomTraduit)
+        #self.label.setText(clippedText)
+
+    #def agrandit(self):
+        # inutile pour certains widgets
+    #    if self.height() < 40 :
+    #       self.setMinimumHeight(50)
+    #       self.resize(self.width(),200)
+
+    #def mousePressEvent(self, event):
+        #print 'mousePressEvent'
+        #import inspect
+        #print (inspect.getmro(self.__class__))
+        #self.__class__.mousePressEvent(self, event)
+
+
+
+    def setValeurs(self):
+       # print "passe dans setValeurs pour ", self.objSimp.nom
+       # print "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
         pass
 
-   def finCommentaire(self):
-       return ""
+    def finCommentaire(self):
+        return ""
+
 
-   
-   def finCommentaireListe(self):
+    def finCommentaireListe(self):
         commentaire=""
         mc = self.node.item.get_definition()
         d_aides = { 'TXM' : 'chaines de caracteres',
@@ -132,152 +151,153 @@ class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel):
                   'C'   : 'complexes'}
         type = mc.type[0]
         if not type in d_aides :
-           if mc.min == mc.max:
-               commentaire=tr("Entrez ")+str(mc.min)+tr(" valeurs ")+'\n'
-           else :
-               if mc.max != "**" :
-                  commentaire=tr("entre ")+str(mc.min)+tr(" et ")+str(mc.max)+tr(" valeurs ")+'\n'
-               else :
-                  commentaire=""
+            if mc.min == mc.max:
+                commentaire=tr("Entrez ")+str(mc.min)+tr(" valeurs ")+'\n'
+            else :
+                if mc.max != "**" :
+                    commentaire=tr("entre ")+str(mc.min)+tr(" et ")+str(mc.max)+tr(" valeurs ")+'\n'
+                else :
+                    commentaire=""
         else :
-           if mc.min == mc.max:
-               commentaire=tr("Entrez ")+str(mc.min)+" "+tr(d_aides[type])+'\n'
-           elif mc.max == float('inf') :
-               commentaire=tr("Entrez une liste de ") + tr(d_aides[type])+'\n'
-           else :
-               commentaire=tr("Entrez entre ")+"\n"+str(mc.min)+(" et  ")+str(mc.max) +" " +tr(d_aides[type])+'\n'
+            if mc.min == mc.max:
+                commentaire=tr("Entrez ")+str(mc.min)+" "+tr(d_aides[type])+'\n'
+            elif mc.max == float('inf') :
+                commentaire=tr("Entrez une liste de ") +" "+tr(d_aides[type])+'\n'
+            else :
+                commentaire=tr("Entrez entre ")+"\n"+str(mc.min)+(" et  ")+str(mc.max) +" " +tr(d_aides[type])+'\n'
         aideval=self.node.item.aide()
-        commentaire=commentaire +  tr(aideval)
+        commentaire=commentaire + tr(aideval)
         return str(commentaire)
 
 
-   def setSuggestion(self):
-      if self.monSimpDef.getSug() != None and self.monSimpDef.getSug() != "":
-         suggere=str('<html><head/><body><p><span style=" font-size:8pt;">suggestion : ')+str(self.monSimpDef.getSug())+"</span></p></body></html>"
-         if hasattr(self,'lineEditVal'): self.lineEditVal.setToolTip(suggere)
-
-   def setCommentaire(self):
-      c  = self.debutToolTip
-      #if self.node.item.definition.validators : c+=self.node.item.definition.validators.aide()
-      self.aide=c
-      if self.objSimp.getFr() != None and self.objSimp.getFr() != "":
-          #c2 = '<html><head/><body><p>'+c+self.objSimp.getFr().decode('latin-1','replace')+"</p></body></html>"
-          c2 = '<html><head/><body><p>'+c+self.objSimp.getFr()
-          #c2 = '<html><head/><body><p>'+c+self.objSimp.getFr()+"</p></body></html>"
-          self.label.setToolTip(c2)
-          #self.aide=self.objSimp.getFr().decode('latin-1','ignore')+" "+c
-          self.aide=self.objSimp.getFr()+" "+c
-      else :
-         c+=self.finCommentaire()
-         if c != "" and c != None :
-            self.aide=c
-            #c=str('<html><head/><body><p><span style=" font-size:8pt; ">')+c+"</span></p></body></html>"
-            c=str('<html><head/><body><p>')+c+"</p></body></html>"
-            self.label.setToolTip(c)
-
-      if self.editor.maConfiguration.differencieSiDefaut :
+    def setSuggestion(self):
+        if self.monSimpDef.getSug() != None and self.monSimpDef.getSug() != "":
+            suggere=str('<html><head/><body><p><span style=" font-size:8pt;">suggestion : ')+str(self.monSimpDef.getSug())+"</span></p></body></html>"
+            if hasattr(self,'lineEditVal'): self.lineEditVal.setToolTip(suggere)
+
+    def setCommentaire(self):
+        c  = self.debutToolTip
+        #if self.node.item.definition.validators : c+=self.node.item.definition.validators.aide()
+        self.aide=c
+        if self.objSimp.getFr() != None and self.objSimp.getFr() != "":
+            #c2 = '<html><head/><body><p>'+c+self.objSimp.getFr().decode('latin-1','replace')+"</p></body></html>"
+            c2 = '<html><head/><body><p>'+c+self.objSimp.getFr()
+            #c2 = '<html><head/><body><p>'+c+self.objSimp.getFr()+"</p></body></html>"
+            self.label.setToolTip(c2)
+            #self.aide=self.objSimp.getFr().decode('latin-1','ignore')+" "+c
+            self.aide=self.objSimp.getFr()+" "+c
+        else :
+            c+=self.finCommentaire()
+            if c != "" and c != None :
+                self.aide=c
+                #c=str('<html><head/><body><p><span style=" font-size:8pt; ">')+c+"</span></p></body></html>"
+                c=str('<html><head/><body><p>')+c+"</p></body></html>"
+                self.label.setToolTip(c)
+
+        if self.editor.maConfiguration.differencieSiDefaut :
             self.label.setToolTip('defaut : ' + tr(str(self.node.item.object.definition.defaut)))
 
 
 
-   def showEvent(self, event):
-      if self.prendLeFocus==1 :
-         self.activateWindow()
-         "il faut deriver le showEvent pour" , self.nom
-         self.prendLeFocus=0
-      QWidget.showEvent(self,event)
-
-   def aideALaSaisie(self):
-      mc = self.node.item.get_definition()
-      mctype = mc.type[0]
-      d_aides = { 'TXM' : tr(u"chaine de caracteres"),
-                  'R'   : tr("reel"),
-                  'I'   : tr("entier"),
-                  'C'   : tr("complexe"),
-                  'Matrice' : tr(u'Matrice'),
-                  'Fichier' : tr(u'fichier'),
-                  'FichierNoAbs' : tr(u'fichier existant'),
-                  'Repertoire' : tr(u'repertoire')}
-
-      if mc.min == mc.max: commentaire=tr("Entrez ")+" "+str(mc.min)+" "
-      else :               commentaire=tr("Entrez entre ")+str(mc.min)+tr(" et ")+str(mc.max)
-
-      try :
-         if issubclass(mctype,object) : ctype = getattr(mctype, 'help_message', tr("Type de base inconnu"))
-         else : ctype = d_aides.get(mctype, tr("Type de base inconnu"))
-      except:                        
-         ctype = d_aides.get(mctype, tr("Type de base inconnu"))
-      if ctype == tr("Type de base inconnu") and "Tuple" in str(mctype): ctype=str(mctype)
-
-      commentaire+=ctype
-      if mc.max!=1 : commentaire+="s" 
-      return commentaire
-
-   def setZoneInfo(self):
-      # info=str(self.nom)+'  '
-      # if self.monSimpDef.getFr() != None and self.monSimpDef.getFr() != "": info+=self.monSimpDef.getSug() +" "
-      # if self.monSimpDef.getSug() != None and self.monSimpDef.getSug() != "": info+="Valeur suggeree : "self.monSimpDef.getSug()
-      pass
-
-   def reaffiche(self):
-
-      if self.editor.jdc.aReafficher==True :
-         self.parentQt.reaffiche()
-
-         #PN PN PN pas satisfaisant
-         #nodeAVoir=self.parentQt.node.chercheNoeudCorrespondant(self.objSimp)
-         #print nodeAVoir.fenetre
-         #print "nodeAVoir.fenetre.isVisible()", nodeAVoir.fenetre.isVisible()
-         #if nodeAVoir.fenetre.isVisible() : return
-         #self.editor.fenetreCentraleAffichee.rendVisibleNoeud(nodeAVoir)
-         #nodeAVoir.fenetre.setFocus()
-         # return  # on est bien postionne
-
-         if self.objSimp.isValid() and hasattr(self, 'AAfficher'):
-            nodeAVoir=self.parentQt.node.chercheNoeudCorrespondant(self.objSimp)
-            try :
-               index=self.editor.fenetreCentraleAffichee.listeAffichageWidget.index(nodeAVoir.fenetre.AAfficher)
-               if (index==len(self.editor.fenetreCentraleAffichee.listeAffichageWidget)-1) :
-                  try :
-                     nodeAVoir.fenetre.setValeursApresBouton()
-                  except :
-                     pass
-               else :
-                  self.editor.fenetreCentraleAffichee.afficheSuivant(nodeAVoir.fenetre.AAfficher)
-            except :
-               pass
-      else :
-         if self.objSimp.isValid() and hasattr(self, 'AAfficher'):
-            try :
-               self.setValeursApresBouton()
-            except :
-               pass
-            self.editor.fenetreCentraleAffichee.afficheSuivant(self.AAfficher)
-         else :
-            if hasattr(self, 'AAfficher'): self.AAfficher.setFocus(7)
-
-   def reaffichePourDeplier(self):
-      self.parentQt.reaffiche()
-
-   def rendVisible(self):
-       pass
-
-   #def enterEvent(self,event):
-   #   print "je passe dans enterEvent", self.nom
-   #   QWidget.enterEvent(self,event)
-
-   def traiteClicSurLabel(self,texte):
-       #aide=self.aide.encode('latin-1', 'ignore').decode('latin-1')+"\n"+self.aideALaSaisie().encode('latin-1', 'ignore').decode('latin-1')
-       try :
-          aide=self.aide+"\n"+self.aideALaSaisie()
-       except :
-          aide=self.aideALaSaisie()
-       self.editor.afficheCommentaire(aide)
-
-   def formate(self,t):
-       l=len(t)//2
-       newText=t[0:l]+'-\n'+t[l:]
-       return newText
-      
-
+    def showEvent(self, event):
+        if self.prendLeFocus==1 :
+            self.activateWindow()
+            "il faut deriver le showEvent pour" , self.nom
+            self.prendLeFocus=0
+        QWidget.showEvent(self,event)
+
+    def aideALaSaisie(self):
+        mc = self.node.item.get_definition()
+        mctype = mc.type[0]
+        d_aides = { 'TXM' : tr(u"chaine de caracteres"),
+                    'R'   : tr("reel"),
+                    'I'   : tr("entier"),
+                    'C'   : tr("complexe"),
+                    'Matrice' : tr(u'Matrice'),
+                    'Fichier' : tr(u'fichier'),
+                    'FichierNoAbs' : tr(u'fichier existant'),
+                    'Repertoire' : tr(u'repertoire')}
+
+        if mc.min == mc.max: commentaire=tr("Entrez ")+" "+str(mc.min)+" "
+        else :               commentaire=tr("Entrez entre ")+str(mc.min)+tr(" et ")+str(mc.max) + " "
+
+        try :
+            if issubclass(mctype,object) : ctype = getattr(mctype, 'help_message', tr("Type de base inconnu"))
+            else : ctype = d_aides.get(mctype, tr("Type de base inconnu"))
+        except:
+            ctype = d_aides.get(mctype, tr("Type de base inconnu"))
+        if ctype == tr("Type de base inconnu") and "Tuple" in str(mctype): ctype=str(mctype)
+        if ctype == tr("Type de base inconnu") and "bool" in str(mctype): ctype='bool'
+
+        if mc.max!=1 : 
+           if ctype == 'chaine de caractere' and mc.max>1 : ctype = 'chaines de caractere' 
+           else : ctype = ctype + 's'
+        commentaire+=ctype
+        if mc.max!=1 : commentaire+="s"
+        return commentaire
+
+    def setZoneInfo(self):
+        # info=str(self.nom)+'  '
+        # if self.monSimpDef.getFr() != None and self.monSimpDef.getFr() != "": info+=self.monSimpDef.getSug() +" "
+        # if self.monSimpDef.getSug() != None and self.monSimpDef.getSug() != "": info+="Valeur suggeree : "self.monSimpDef.getSug()
+        pass
+
+    def reaffiche(self):
+
+        if self.editor.jdc.aReafficher==True :
+            self.parentQt.reaffiche()
+
+            #PN PN PN pas satisfaisant
+            #nodeAVoir=self.parentQt.node.chercheNoeudCorrespondant(self.objSimp)
+            #print nodeAVoir.fenetre
+            #print "nodeAVoir.fenetre.isVisible()", nodeAVoir.fenetre.isVisible()
+            #if nodeAVoir.fenetre.isVisible() : return
+            #self.editor.fenetreCentraleAffichee.rendVisibleNoeud(nodeAVoir)
+            #nodeAVoir.fenetre.setFocus()
+            # return  # on est bien postionne
+
+            if self.objSimp.isValid() and hasattr(self, 'AAfficher'):
+                nodeAVoir=self.parentQt.node.chercheNoeudCorrespondant(self.objSimp)
+                try :
+                    index=self.editor.fenetreCentraleAffichee.listeAffichageWidget.index(nodeAVoir.fenetre.AAfficher)
+                    if (index==len(self.editor.fenetreCentraleAffichee.listeAffichageWidget)-1) :
+                        try :
+                            nodeAVoir.fenetre.setValeursApresBouton()
+                        except :
+                            pass
+                    else :
+                        self.editor.fenetreCentraleAffichee.afficheSuivant(nodeAVoir.fenetre.AAfficher)
+                except :
+                    pass
+        else :
+            if self.objSimp.isValid() and hasattr(self, 'AAfficher'):
+                try :
+                    self.setValeursApresBouton()
+                except :
+                    pass
+                self.editor.fenetreCentraleAffichee.afficheSuivant(self.AAfficher)
+            else :
+                if hasattr(self, 'AAfficher'): self.AAfficher.setFocus(7)
+
+    def reaffichePourDeplier(self):
+        self.parentQt.reaffiche()
+
+    def rendVisible(self):
+        pass
+
+    #def enterEvent(self,event):
+    #   print "je passe dans enterEvent", self.nom
+    #   QWidget.enterEvent(self,event)
+
+    def traiteClicSurLabel(self,texte):
+        #aide=self.aide.encode('latin-1', 'ignore').decode('latin-1')+"\n"+self.aideALaSaisie().encode('latin-1', 'ignore').decode('latin-1')
+        try :
+            aide=self.aide+"\n"+self.aideALaSaisie()
+        except :
+            aide=self.aideALaSaisie()
+        self.editor.afficheCommentaire(aide)
+
+    def formate(self,t):
+        l=len(t)//2
+        newText=t[0:l]+'-\n'+t[l:]
+        return newText
index d8a18c5b30eca14069cff0d264cad2ffdba5eda5..0a17b7423e83b8a9820c5a0650c72a1a81a7378e 100644 (file)
@@ -21,8 +21,8 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 
 import types,os,re,sys
@@ -40,327 +40,327 @@ listeSuffixe=('bmp','png','jpg' ,'txt','med')
 
 class FacultatifOuOptionnel(object):
 
-  def setReglesEtAide(self):
-      listeRegles=()
-      try :
-         listeRegles     = self.node.item.getRegles()
-      except :
-         pass
-      if hasattr(self,"RBRegle"):
-        if listeRegles==() : self.RBRegle.close() 
+    def setReglesEtAide(self):
+        listeRegles=()
+        try :
+            listeRegles     = self.node.item.getRegles()
+        except :
+            pass
+        if hasattr(self,"RBRegle"):
+            if listeRegles==() : self.RBRegle.close()
+            else :
+                icon3=QIcon(self.repIcon+"/lettreRblanc30.png")
+                self.RBRegle.setIcon(icon3)
+                self.RBRegle.clicked.connect(self.viewRegles)
+
+        cle_doc=None
+        if not hasattr(self,"RBInfo"):return
+        icon=QIcon(self.repIcon+"/point-interrogation30.png")
+        self.RBInfo.setIcon(icon)
+
+        from .monWidgetCommande import MonWidgetCommande
+        if isinstance(self,MonWidgetCommande) and self.editor.code =="MAP":
+            self.cle_doc = self.chercheDocMAP()
         else :
-           icon3=QIcon(self.repIcon+"/lettreRblanc30.png")
-           self.RBRegle.setIcon(icon3)
-           self.RBRegle.clicked.connect(self.viewRegles)
-
-      cle_doc=None
-      if not hasattr(self,"RBInfo"):return
-      icon=QIcon(self.repIcon+"/point-interrogation30.png")
-      self.RBInfo.setIcon(icon)
-
-      from .monWidgetCommande import MonWidgetCommande
-      if isinstance(self,MonWidgetCommande) and self.editor.code =="MAP":
-         self.cle_doc = self.chercheDocMAP()
-      else :
-         self.cle_doc = self.node.item.getDocu()
-      if self.cle_doc == None  : self.RBInfo.close()
-      else : self.RBInfo.clicked.connect (self.viewDoc)
-
-
-  def chercheDocMAP(self):
-      try :
-        clef=self.editor.maConfiguration.adresse+"/"
-      except :
-        return None
-      for k in self.editor.readercata.cata.JdC.dict_groupes:
-          if self.obj.nom in self.editor.readercata.cata.JdC.dict_groupes[k]:
-             clef+=k
-             break
-      clef+="/"+ self.obj.nom[0:-5].lower()+"/spec_"+self.obj.nom[0:-5].lower()+".html"
-
-      return clef
-  def viewDoc(self):
-      try :
-          if sys.platform[0:5]=="linux" : cmd="xdg-open "+self.cle_doc
-          else                                 : cmd="start "+self.cle_doc
-          os.system(cmd)
-      except:
-          QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
-
-  def viewRegles(self):
-      self.node.appellebuildLBRegles()
-
-
-  def setIconePoubelle(self):
-      if not(hasattr(self,"RBPoubelle")):return
-
-      if self.node.item.object.isOblig()  and not( hasattr(self.node.item.object,'isDeletable') ): 
-         icon=QIcon(self.repIcon+"/deleteRondVide.png")
-         self.RBPoubelle.setIcon(icon)
-         return
-      icon=QIcon(self.repIcon+"/deleteRond.png")
-      self.RBPoubelle.setIcon(icon)
-      self.RBPoubelle.clicked.connect(self.aDetruire)
-
-  def setIconesSalome(self):
-       if not (hasattr(self,"RBSalome")): return
-       from Accas import SalomeEntry
-       mc = self.node.item.get_definition()
-       mctype = mc.type[0]
-       enable_salome_selection = self.editor.salome and \
-         (('grma' in repr(mctype)) or ('grno' in repr(mctype)) or ('SalomeEntry' in repr(mctype)) or \
-         (hasattr(mctype, "enable_salome_selection") and mctype.enable_salome_selection))
-
-       if enable_salome_selection:
-          icon=QIcon(self.repIcon+"/flecheSalome.png")
-          self.RBSalome.setIcon(icon)
-          self.RBSalome.pressed.connect(self.BSalomePressed)
+            self.cle_doc = self.node.item.getDocu()
+        if self.cle_doc == None  : self.RBInfo.close()
+        else : self.RBInfo.clicked.connect (self.viewDoc)
+
+
+    def chercheDocMAP(self):
+        try :
+            clef=self.editor.maConfiguration.adresse+"/"
+        except :
+            return None
+        for k in self.editor.readercata.cata.JdC.dict_groupes:
+            if self.obj.nom in self.editor.readercata.cata.JdC.dict_groupes[k]:
+                clef+=k
+                break
+        clef+="/"+ self.obj.nom[0:-5].lower()+"/spec_"+self.obj.nom[0:-5].lower()+".html"
+
+        return clef
+
+    def viewDoc(self):
+        try :
+            if sys.platform[0:5]=="linux" : cmd="xdg-open "+self.cle_doc
+            else                          : cmd="start "+self.cle_doc
+            os.system(cmd)
+        except:
+            QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
+
+    def viewRegles(self):
+        self.node.appellebuildLBRegles()
+
+
+    def setIconePoubelle(self):
+        if not(hasattr(self,"RBPoubelle")):return
+
+        if self.node.item.object.isOblig()  and not( hasattr(self.node.item.object,'isDeletable') ):
+            icon=QIcon(self.repIcon+"/deleteRondVide.png")
+            self.RBPoubelle.setIcon(icon)
+            return
+        icon=QIcon(self.repIcon+"/deleteRond.png")
+        self.RBPoubelle.setIcon(icon)
+        self.RBPoubelle.clicked.connect(self.aDetruire)
+
+    def setIconesSalome(self):
+        if not (hasattr(self,"RBSalome")): return
+        from Accas import SalomeEntry
+        mc = self.node.item.get_definition()
+        mctype = mc.type[0]
+        enable_salome_selection = self.editor.salome and \
+          (('grma' in repr(mctype)) or ('grno' in repr(mctype)) or ('SalomeEntry' in repr(mctype)) or \
+          (hasattr(mctype, "enable_salome_selection") and mctype.enable_salome_selection))
+
+        if enable_salome_selection:
+            icon=QIcon(self.repIcon+"/flecheSalome.png")
+            self.RBSalome.setIcon(icon)
+            self.RBSalome.pressed.connect(self.BSalomePressed)
 
 #PNPN --> Telemac A revoir surement
 # cela ou le catalogue grpma ou salomeEntry
-          if not(('grma' in repr(mctype)) or ('grno' in repr(mctype))) or not(self.editor.salome): 
-             if hasattr(self,"RBSalomeVue") : self.RBSalomeVue.close()
-          else : 
-             icon1=QIcon(self.repIcon+"/eye.png")
-             self.RBSalomeVue.setIcon(icon1)
-             self.RBSalomeVue.clicked.connect(self.BView2DPressed)
-       else:
-          self.RBSalome.close()
-          self.RBSalomeVue.close()
-
-     
-  def setIconesFichier(self):
-       if not ( hasattr(self,"BFichier")): return
-       mc = self.node.item.get_definition()
-       mctype = mc.type[0]
-       if mctype == "FichierOuRepertoire":
-          self.BFichierOuRepertoire=self.BFichier
-          self.BFichierOuRepertoire.clicked.connect(self.BFichierOuRepertoirePressed)
-          self.BVisuFichier.close()
-       elif mctype == "Repertoire":
-          self.BRepertoire=self.BFichier
-          self.BRepertoire.clicked.connect(self.BRepertoirePressed)
-          self.BVisuFichier.close()
-       else :
-          self.BFichier.clicked.connect(self.BFichierPressed)
-          self.BVisuFichier.clicked.connect(self.BFichierVisu)
-
-
-
-  def setIconesGenerales(self):
-      repIcon=self.node.editor.appliEficas.repIcon
-      if hasattr(self,"BVisuListe") :
-         fichier=os.path.join(repIcon, 'plusnode.png')
-         icon = QIcon(fichier)
-         self.BVisuListe.setIcon(icon)
-      if hasattr(self,"RBDeplie") :
-         fichier=os.path.join(repIcon, 'plusnode.png')
-         icon = QIcon(fichier)
-         self.RBDeplie.setIcon(icon)
-      if hasattr(self,"RBPlie") :
-         fichier=os.path.join(repIcon, 'minusnode.png')
-         icon = QIcon(fichier)
-         self.RBPlie.setIcon(icon)
-      if hasattr(self,"BVisuFichier") :
-         fichier=os.path.join(repIcon, 'visuFichier.png')
-         icon = QIcon(fichier)
-         self.BVisuFichier.setIcon(icon)
-
-      
-
-  def setRun(self):
-      if hasattr(self.editor.appliEficas, 'mesScripts') :
-         if self.editor.code in  self.editor.appliEficas.mesScripts :
-            self.dict_commandes_mesScripts=self.appliEficas.mesScripts[self.editor.code].dict_commandes
-            if self.obj.nom in self.dict_commandes_mesScripts :
-               self.ajoutScript()
-               icon=QIcon(self.repIcon+"/roue.png")
-               if hasattr(self,"RBRun"):self.RBRun.setIcon(icon)
-               return
-      if hasattr(self,"RBRun"): self.RBRun.close()
-      if hasattr(self,"CBScripts"): self.CBScripts.close()
-
-
-  def aDetruire(self):
-      self.node.delete()
-
-  def setValide(self):
-      if not(hasattr (self,'RBValide')) : return
-      couleur=self.node.item.getIconName()
-      monIcone = QIcon(self.repIcon+"/" + couleur + ".png")
-      self.RBValide.setIcon(monIcone)
-
-  # il faut chercher la bonne fenetre
-  def rendVisible(self):
-      #print "je passe par rendVisible de FacultatifOuOptionnel"
-      #print self
-      #print self.node.fenetre
-      #print "return pour etre sure"
-      return
-      #PNPN
-      newNode=self.node.treeParent.chercheNoeudCorrespondant(self.node.item.object)
-      #print newNode
-      self.editor.fenetreCentraleAffichee.scrollAreaCommandes.ensureWidgetVisible(newNode.fenetre)
-      #newNode.fenetre.setFocus()
-
-
-  def ajoutScript(self):
+            if not(('grma' in repr(mctype)) or ('grno' in repr(mctype))) or not(self.editor.salome):
+                if hasattr(self,"RBSalomeVue") : self.RBSalomeVue.close()
+            else :
+                icon1=QIcon(self.repIcon+"/eye.png")
+                self.RBSalomeVue.setIcon(icon1)
+                self.RBSalomeVue.clicked.connect(self.BView2DPressed)
+        else:
+            self.RBSalome.close()
+            self.RBSalomeVue.close()
+
+
+    def setIconesFichier(self):
+        if not ( hasattr(self,"BFichier")): return
+        mc = self.node.item.get_definition()
+        mctype = mc.type[0]
+        if mctype == "FichierOuRepertoire":
+            self.BFichierOuRepertoire=self.BFichier
+            self.BFichierOuRepertoire.clicked.connect(self.BFichierOuRepertoirePressed)
+            self.BVisuFichier.close()
+        elif mctype == "Repertoire":
+            self.BRepertoire=self.BFichier
+            self.BRepertoire.clicked.connect(self.BRepertoirePressed)
+            self.BVisuFichier.close()
+        else :
+            self.BFichier.clicked.connect(self.BFichierPressed)
+            self.BVisuFichier.clicked.connect(self.BFichierVisu)
+
+
+
+    def setIconesGenerales(self):
+        repIcon=self.node.editor.appliEficas.repIcon
+        if hasattr(self,"BVisuListe") :
+            fichier=os.path.join(repIcon, 'plusnode.png')
+            icon = QIcon(fichier)
+            self.BVisuListe.setIcon(icon)
+        if hasattr(self,"RBDeplie") :
+            fichier=os.path.join(repIcon, 'plusnode.png')
+            icon = QIcon(fichier)
+            self.RBDeplie.setIcon(icon)
+        if hasattr(self,"RBPlie") :
+            fichier=os.path.join(repIcon, 'minusnode.png')
+            icon = QIcon(fichier)
+            self.RBPlie.setIcon(icon)
+        if hasattr(self,"BVisuFichier") :
+            fichier=os.path.join(repIcon, 'visuFichier.png')
+            icon = QIcon(fichier)
+            self.BVisuFichier.setIcon(icon)
+
+
+
+    def setRun(self):
+        if hasattr(self.editor.appliEficas, 'mesScripts') :
+            if self.editor.code in  self.editor.appliEficas.mesScripts :
+                self.dict_commandes_mesScripts=self.appliEficas.mesScripts[self.editor.code].dict_commandes
+                if self.obj.nom in self.dict_commandes_mesScripts :
+                    self.ajoutScript()
+                    icon=QIcon(self.repIcon+"/roue.png")
+                    if hasattr(self,"RBRun"):self.RBRun.setIcon(icon)
+                    return
+        if hasattr(self,"RBRun"): self.RBRun.close()
+        if hasattr(self,"CBScripts"): self.CBScripts.close()
+
+
+    def aDetruire(self):
+        self.node.delete()
+
+    def setValide(self):
+        if not(hasattr (self,'RBValide')) : return
+        couleur=self.node.item.getIconName()
+        monIcone = QIcon(self.repIcon+"/" + couleur + ".png")
+        self.RBValide.setIcon(monIcone)
+
+    # il faut chercher la bonne fenetre
+    def rendVisible(self):
+        #print "je passe par rendVisible de FacultatifOuOptionnel"
+        #print self
+        #print self.node.fenetre
+        #print "return pour etre sure"
+        return
+        #PNPN
+        newNode=self.node.treeParent.chercheNoeudCorrespondant(self.node.item.object)
+        #print newNode
+        self.editor.fenetreCentraleAffichee.scrollAreaCommandes.ensureWidgetVisible(newNode.fenetre)
+        #newNode.fenetre.setFocus()
+
+
+    def ajoutScript(self):
         if not hasattr(self,'CBScripts') : return # Cas des Widgets Plies
         self.dictCommandes={}
         listeCommandes=self.dict_commandes_mesScripts[self.obj.nom]
         if type(listeCommandes) != tuple: listeCommandes=(listeCommandes,)
         i=0
         for commande in listeCommandes :
-          conditionSalome=commande[3]
-          if (self.appliEficas.salome == 0 and conditionSalome == True): continue
-          self.CBScripts.addItem(commande[1])
-          self.dictCommandes[commande[1]]=i
-          i=i+1
+            conditionSalome=commande[3]
+            if (self.appliEficas.salome == 0 and conditionSalome == True): continue
+            self.CBScripts.addItem(commande[1])
+            self.dictCommandes[commande[1]]=i
+            i=i+1
         self.CBScripts.activated.connect(self.choixSaisi)
 
-  def choixSaisi(self):
-      fction=str(self.CBScripts.currentText())
-      numero= self.dictCommandes[fction]
-      self.node.appelleFonction(numero,nodeTraite=self.node)
-      #self.reaffiche()
+    def choixSaisi(self):
+        fction=str(self.CBScripts.currentText())
+        numero= self.dictCommandes[fction]
+        self.node.appelleFonction(numero,nodeTraite=self.node)
+        #self.reaffiche()
 
 class ContientIcones(object):
 
-  def BFichierVisu(self):
-       fichier=self.lineEditVal.text()
-       if fichier == None or str(fichier)=="" : return
-       from .monViewTexte import ViewText
-       try :
-         if sys.platform[0:5]=="linux" :
-           #cmd="xdg-open "+ str(fichier)
-           #changer pour marcher dans l'EDC
-           #cmd="gedit "+ str(fichier)
-           from os.path import splitext
-           fileName,extension = splitext(fichier)
-           if extension in  self.parentQt.editor.appliEficas.maConfiguration.utilParExtensions:
-              cmd=self.parentQt.editor.appliEficas.maConfiguration.utilParExtensions[extension] + " " + str(fichier)
-           else:  cmd="xdg-open "+ str(fichier)
-           os.system(cmd)
-         else                         :
-           os.startfile(str(fichier)) 
-       except:
-         try :
-            fp=open(fichier)
-            txt=fp.read()
-            nomFichier=QFileInfo(fichier).baseName()
-            maVue=ViewText(self,entete=nomFichier)
-            maVue.setText(txt)
-            maVue.show()
-            fp.close()
-         except:
-            QMessageBox.warning( None,
-                       tr("Visualisation Fichier "),
-                       tr("Impossibilite d'afficher le Fichier"),)
-
-  def BFichierPressed(self):
-      mctype = self.node.item.get_definition().type
-      if len(mctype) > 1:
-          filters = mctype[1]
-      elif hasattr(mctype[0], "filters"):
-          filters = mctype[0].filters
-      else:
-          filters = ""
-      if len(mctype) > 2 and mctype[2] == "Sauvegarde":
-          fichier = QFileDialog.getSaveFileName(self.appliEficas,
-                              tr('Sauvegarder Fichier'),
-                              self.appliEficas.maConfiguration.savedir,
-                              filters)
-      else:
-          #print(filters)
-          fichier = QFileDialog.getOpenFileName(self.appliEficas,
-                              tr('Ouvrir Fichier'),
-                              self.appliEficas.maConfiguration.savedir,
-                              filters)
-
-      fichier=fichier[0]
-      if not(fichier == ""):
-         ulfile = os.path.abspath(fichier)
-         self.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
-         self.lineEditVal.setText(fichier)
-         self.editor.afficheCommentaire(tr("Fichier selectionne"))
-         self.LEvaleurPressed()
-         if (QFileInfo(fichier).suffix() in listeSuffixe ):
-             self.image=fichier
-             if (not hasattr(self,"BSelectInFile")):
-               try :
-                 self.BSelectInFile = QPushButton(self)
-                 self.BSelectInFile.setMinimumSize(QSize(140,40))
-                 self.BSelectInFile.setObjectName("BSelectInFile")
-                 self.gridLayout.addWidget(self.BSelectInFile,1,1,1,1)
-                 self.BSelectInFile.setText(tr("Selection"))
-                 self.BSelectInFile.clicked.connect(self.BSelectInFilePressed)
-               except :
-                pass
-             else :
-               self.BSelectInFile.setVisible(1)
-               
-         elif hasattr(self, "BSelectInFile"):
-             self.BSelectInFile.setVisible(0)
-
-  def BFichierOuRepertoirePressed(self):
-      self.fileName=""
-      self.file_dialog=QFileDialog()
-      self.file_dialog.setFileMode(QFileDialog.Directory);
-      self.file_dialog.setFileMode(QFileDialog.Directory|QFileDialog.ExistingFiles)
-      self.file_dialog.setOption(QFileDialog.DontUseNativeDialog,True);
-      self.file_dialog.setWindowTitle('Choose File or Directory')
-      self.explore(self.file_dialog)
-      self.file_dialog.exec_()
-      if self.fileName == "" : return
-      self.lineEditVal.setText(self.fileName)
-      self.LEvaleurPressed()
-     
-
-  def explore(self,widget):
-      for c in widget.children() :
-          if isinstance(c, QTreeView) :
-             c.clicked.connect (self.changeBoutonOpen)
-             self.monTreeView=c
-          try :
-             if c.text() == "&Open" : self.monBoutonOpen=c
-          except : pass
-          self.explore(c) 
-
-
-  def changeBoutonOpen(self):
-      self.monBoutonOpen.setEnabled(True)
-      self.monBoutonOpen.setText("Choose")
-      self.monBoutonOpen.clicked.connect(self.monBoutonOpenClicked)
-      index = self.monTreeView.currentIndex();
-      self.fileName2 = self.monTreeView.model().data(index)
-
-  def monBoutonOpenClicked(self):
-      try :
-        self.fileName=self.file_dialog.selectedFiles()[0]
-      except :
-         self.fileName=self.file_dialog.directory().absolutePath()
-      self.file_dialog.close()
-      self.file_dialog=None
-
-  def BRepertoirePressed(self):
-      directory = QFileDialog.getExistingDirectory(self.appliEficas,
-            directory = self.appliEficas.maConfiguration.savedir,
-            options = QFileDialog.ShowDirsOnly)
-
-      if not (directory == "") :
-         absdir = os.path.abspath(directory)
-         self.appliEficas.maConfiguration.savedir = os.path.dirname(absdir)
-         self.lineEditVal.setText(directory)
-         self.LEvaleurPressed()
-
-  def BSelectInFilePressed(self):
-      from monSelectImage import MonSelectImage
-      MonSelectImage(file=self.image,parent=self).show()
-
-          
-
-  def BSalomePressed(self):
+    def BFichierVisu(self):
+        fichier=self.lineEditVal.text()
+        if fichier == None or str(fichier)=="" : return
+        from .monViewTexte import ViewText
+        try :
+            if sys.platform[0:5]=="linux" :
+                #cmd="xdg-open "+ str(fichier)
+                #changer pour marcher dans l'EDC
+                #cmd="gedit "+ str(fichier)
+                from os.path import splitext
+                fileName,extension = splitext(fichier)
+                if extension in  self.parentQt.editor.appliEficas.maConfiguration.utilParExtensions:
+                    cmd=self.parentQt.editor.appliEficas.maConfiguration.utilParExtensions[extension] + " " + str(fichier)
+                else:  cmd="xdg-open "+ str(fichier)
+                os.system(cmd)
+            else                          :
+                os.startfile(str(fichier))
+        except:
+            try :
+                fp=open(fichier)
+                txt=fp.read()
+                nomFichier=QFileInfo(fichier).baseName()
+                maVue=ViewText(self,entete=nomFichier)
+                maVue.setText(txt)
+                maVue.show()
+                fp.close()
+            except:
+                QMessageBox.warning( None,
+                           tr("Visualisation Fichier "),
+                           tr("Impossibilite d'afficher le Fichier"),)
+
+    def BFichierPressed(self):
+        mctype = self.node.item.get_definition().type
+        if len(mctype) > 1:
+            filters = mctype[1]
+        elif hasattr(mctype[0], "filters"):
+            filters = mctype[0].filters
+        else:
+            filters = ""
+        if len(mctype) > 2 and mctype[2] == "Sauvegarde":
+            fichier = QFileDialog.getSaveFileName(self.appliEficas,
+                                tr('Use File'),
+                                self.appliEficas.maConfiguration.savedir,
+                                filters)
+        else:
+            #print(filters)
+            fichier = QFileDialog.getOpenFileName(self.appliEficas,
+                                tr('Ouvrir Fichier'),
+                                self.appliEficas.maConfiguration.savedir,
+                                filters)
+
+        fichier=fichier[0]
+        if not(fichier == ""):
+            ulfile = os.path.abspath(fichier)
+            self.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
+            self.lineEditVal.setText(fichier)
+            self.editor.afficheCommentaire(tr("Fichier selectionne"))
+            self.LEvaleurPressed()
+            if (QFileInfo(fichier).suffix() in listeSuffixe ):
+                self.image=fichier
+                if (not hasattr(self,"BSelectInFile")):
+                    try :
+                        self.BSelectInFile = QPushButton(self)
+                        self.BSelectInFile.setMinimumSize(QSize(140,40))
+                        self.BSelectInFile.setObjectName("BSelectInFile")
+                        self.gridLayout.addWidget(self.BSelectInFile,1,1,1,1)
+                        self.BSelectInFile.setText(tr("Selection"))
+                        self.BSelectInFile.clicked.connect(self.BSelectInFilePressed)
+                    except :
+                        pass
+                else :
+                    self.BSelectInFile.setVisible(1)
+
+            elif hasattr(self, "BSelectInFile"):
+                self.BSelectInFile.setVisible(0)
+
+    def BFichierOuRepertoirePressed(self):
+        self.fileName=""
+        self.file_dialog=QFileDialog()
+        self.file_dialog.setFileMode(QFileDialog.Directory);
+        self.file_dialog.setFileMode(QFileDialog.Directory|QFileDialog.ExistingFiles)
+        self.file_dialog.setOption(QFileDialog.DontUseNativeDialog,True);
+        self.file_dialog.setWindowTitle('Choose File or Directory')
+        self.explore(self.file_dialog)
+        self.file_dialog.exec_()
+        if self.fileName == "" : return
+        self.lineEditVal.setText(self.fileName)
+        self.LEvaleurPressed()
+
+
+    def explore(self,widget):
+        for c in widget.children() :
+            if isinstance(c, QTreeView) :
+                c.clicked.connect (self.changeBoutonOpen)
+                self.monTreeView=c
+            try :
+                if c.text() == "&Open" : self.monBoutonOpen=c
+            except : pass
+            self.explore(c)
+
+
+    def changeBoutonOpen(self):
+        self.monBoutonOpen.setEnabled(True)
+        self.monBoutonOpen.setText("Choose")
+        self.monBoutonOpen.clicked.connect(self.monBoutonOpenClicked)
+        index = self.monTreeView.currentIndex();
+        self.fileName2 = self.monTreeView.model().data(index)
+
+    def monBoutonOpenClicked(self):
+        try :
+            self.fileName=self.file_dialog.selectedFiles()[0]
+        except :
+            self.fileName=self.file_dialog.directory().absolutePath()
+        self.file_dialog.close()
+        self.file_dialog=None
+
+    def BRepertoirePressed(self):
+        directory = QFileDialog.getExistingDirectory(self.appliEficas,
+              directory = self.appliEficas.maConfiguration.savedir,
+              options = QFileDialog.ShowDirsOnly)
+
+        if not (directory == "") :
+            absdir = os.path.abspath(directory)
+            self.appliEficas.maConfiguration.savedir = os.path.dirname(absdir)
+            self.lineEditVal.setText(directory)
+            self.LEvaleurPressed()
+
+    def BSelectInFilePressed(self):
+        from monSelectImage import MonSelectImage
+        MonSelectImage(file=self.image,parent=self).show()
+
+
+
+    def BSalomePressed(self):
         self.editor.afficheCommentaire("")
         selection=[]
         commentaire=""
@@ -374,34 +374,34 @@ class ContientIcones(object):
         if 'grma' in repr(kwType): kwType = "GROUP_MA"
 
         if kwType in ("GROUP_NO","GROUP_MA"):
-           selection, commentaire = self.appliEficas.selectGroupFromSalome(kwType,editor=self.editor)
+            selection, commentaire = self.appliEficas.selectGroupFromSalome(kwType,editor=self.editor)
 
         mc = self.node.item.get_definition()
 
         if  (isinstance(mc.type,tuple) and len(mc.type) > 1 and "(*.med)" in mc.type[1] ):
-           selection, commentaire = self.appliEficas.selectMeshFile(editor=self.editor)
-           #print selection, commentaire
-           if commentaire != "" : 
-                  QMessageBox.warning( None,
-                  tr("Export Med vers Fichier "),
-                  tr("Impossibilite d exporter le Fichier"),)
-                  return
-           else :
-                  self.lineEditVal.setText(str(selection))
-                  return
+            selection, commentaire = self.appliEficas.selectMeshFile(editor=self.editor)
+            #print selection, commentaire
+            if commentaire != "" :
+                QMessageBox.warning( None,
+                tr("Export Med vers Fichier "),
+                tr("Impossibilite d exporter le Fichier"),)
+                return
+            else :
+                self.lineEditVal.setText(str(selection))
+                return
 
         from Accas import SalomeEntry
         if inspect.isclass(kwType) and issubclass(kwType, SalomeEntry):
-           selection, commentaire = self.appliEficas.selectEntryFromSalome(kwType,editor=self.editor)
+            selection, commentaire = self.appliEficas.selectEntryFromSalome(kwType,editor=self.editor)
 
         if commentaire !="" :
             self.editor.afficheInfos(tr(str(commentaire)))
         if selection == [] : return
 
         min,max=self.node.item.getMinMax()
-        if max > 1 : 
-           self.ajoutNValeur(selection)
-           return
+        if max > 1 :
+            self.ajoutNValeur(selection)
+            return
 
         monTexte=""
         for geomElt in selection: monTexte=geomElt+","
@@ -409,21 +409,20 @@ class ContientIcones(object):
         self.lineEditVal.setText(str(monTexte))
         self.LEvaleurPressed()
 
-  def BView2DPressed(self):
+    def BView2DPressed(self):
         try :
-          # cas d un Simp de base
-          valeur=self.lineEditVal.text()
+            # cas d un Simp de base
+            valeur=self.lineEditVal.text()
         except :
-          valeur=self.textSelected
+            valeur=self.textSelected
         valeur = str(valeur)
         if valeur == str("") : return
         if valeur :
-           ok, msgError = self.appliEficas.displayShape(valeur)
-           if not ok:
-              self.editor.afficheInfos(msgError,Qt.red)
+            ok, msgError = self.appliEficas.displayShape(valeur)
+            if not ok:
+                self.editor.afficheInfos(msgError,Qt.red)
 
-  def BParametresPressed(self):
+    def BParametresPressed(self):
         liste=self.node.item.getListeParamPossible()
         from monListeParamPanel import MonListeParamPanel
         MonListeParamPanel(liste=liste,parent=self).show()
-
index 3e96a736f73371ccc8350ef39d4c60f10b657c90..5cd8e4b4ddc1832f181ce4144c37e06e7190e1c1 100644 (file)
@@ -21,8 +21,8 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 
 import types,os
@@ -40,7 +40,7 @@ from InterfaceQT4.monViewTexte   import ViewText
 # ---------------------- #
 class LECustom(QLineEdit):
 # ---------------------- #
- def __init__(self,parent,parentQt,i):
   def __init__(self,parent,parentQt,i):
         """
         Constructor
         """
@@ -52,286 +52,290 @@ class LECustom(QLineEdit):
         self.numDsLaListe=-1
         self.parentTuple=None
         self.valeur=None
-
- def focusInEvent(self,event):
-     #print ("dans focusInEvent de LECustom")
-     self.parentQt.aEuLeFocus=True
-     self.aEuLeFocus=True
-     self.parentQt.LineEditEnCours=self
-     self.parentQt.numLineEditEnCours=self.num
-     self.parentQt.textSelected=self.text()
-     self.setStyleSheet("border: 2px solid gray")
-     QLineEdit.focusInEvent(self,event)
-
- def focusOutEvent(self,event):
-     #print (self.aEuLeFocus)
-     self.setStyleSheet("border: 0px")
-     if self.dansUnTuple    : self.setStyleSheet("background:rgb(235,235,235); border: 0px;")
-     elif self.num % 2 == 1 : self.setStyleSheet("background:rgb(210,210,210)")
-     else                   : self.setStyleSheet("background:rgb(235,235,235)")
-     if self.aEuLeFocus:
-       self.aEuLeFocus=False
-       self.litValeur()
-       if self.dansUnTuple : self.parentTuple.getValeur()
-     QLineEdit.focusOutEvent(self,event)
-
-
- def litValeur(self):
-     #print ("dans litValeur de LECustom")
-     self.aEuLeFocus=False
-     val=str(self.text())
-     if str(val)=="" or val==None :
-        self.valeur=None
-        return
-     try :
-       valeur=eval(val,{})
-     except :
-       try :
-          d=self.parentQt.parentQt.objSimp.jdc.getContexteAvant(self.parentQt.objSimp. etape)
-          valeur=eval(val,d)
-       except :
-          valeur=val
-     self.valeur=valeur
-     #print ('self.valeur', self.valeur)
-
-
- def clean(self):
-     self.setText("")
-
- def getValeur(self):
-     #return self.text()
-     self.litValeur()
-     return self.valeur
-
- def setValeur(self,valeur):
-     self.setText(valeur)
+        self.aEuLeFocus=True
+
+    def focusInEvent(self,event):
+        #print ("dans focusInEvent de LECustom")
+        self.parentQt.aEuLeFocus=True
+        self.aEuLeFocus=True
+        self.parentQt.lineEditEnCours=self
+        self.parentQt.numLineEditEnCours=self.num
+        self.parentQt.textSelected=self.text()
+        self.setStyleSheet("border: 2px solid gray")
+        QLineEdit.focusInEvent(self,event)
+
+    def focusOutEvent(self,event):
+        #print ('focusOutEvent', self.aEuLeFocus)
+        self.setStyleSheet("border: 0px")
+        if self.dansUnTuple    : self.setStyleSheet("background:rgb(235,235,235); border: 0px;")
+        elif self.num % 2 == 1 : self.setStyleSheet("background:rgb(210,210,210)")
+        else                   : self.setStyleSheet("background:rgb(235,235,235)")
+        if self.aEuLeFocus:
+            self.aEuLeFocus=False
+            self.litValeur()
+            if self.dansUnTuple : self.parentTuple.getValeur()
+        QLineEdit.focusOutEvent(self,event)
+
+
+    def litValeur(self):
+        #print ("dans litValeur de LECustom")
+        self.aEuLeFocus=False
+        val=str(self.text())
+        if str(val)=="" or val==None :
+            self.valeur=None
+            return
+        try :
+            valeur=eval(val,{})
+        except :
+            try :
+                d=self.parentQt.parentQt.objSimp.jdc.getContexteAvant(self.parentQt.objSimp. etape)
+                valeur=eval(val,d)
+            except :
+                valeur=val
+        self.valeur=valeur
+        #print ('self.valeur', self.valeur)
+
+
+    def clean(self):
+        self.setText("")
+
+    def getValeur(self):
+        #return self.text()
+        self.litValeur()
+        return self.valeur
+
+    def setValeur(self,valeur):
+        self.setText(valeur)
 
 
 
 # --------------------------- #
 class LECustomTuple(LECustom):
 # --------------------------- #
- def __init__(self,parent):
-   #  index sera mis a jour par TupleCustom
-   parentQt=parent.parent().parent().parent()
-   LECustom. __init__(self,parent,parentQt,0)
-   #print (dir(self))
   def __init__(self,parent):
+    #  index sera mis a jour par TupleCustom
+        parentQt=parent.parent().parent().parent()
+        LECustom. __init__(self,parent,parentQt,0)
+        #print (dir(self))
 
 # ---------------------------- #
 class MonLabelListeClic(QLabel):
 # ---------------------------- #
-     def __init__(self,parent):
+    def __init__(self,parent):
         QLabel.__init__(self,parent)
         self.parent=parent
 
-     def event(self,event) :
-         if event.type() == QEvent.MouseButtonRelease:
+    def event(self,event) :
+        if event.type() == QEvent.MouseButtonRelease:
             self.texte=self.text()
             self.parent.traiteClicSurLabelListe(self.texte)
-         return QLabel.event(self,event)
-
-
-
+        return QLabel.event(self,event)
 
 # ------------- #
 class GereListe(object):
 # ------------- #
-
-   def __init__(self):
-       self.connecterSignaux()
-
-
-   def connecterSignaux(self):
-       if hasattr(self,'RBHaut'):
-          self.RBHaut.clicked.connect(self.hautPushed)
-          self.RBBas.clicked.connect(self.basPushed)
-          self.RBMoins.clicked.connect(self.moinsPushed)
-          self.RBPlus.clicked.connect(self.plusPushed)
-          self.RBVoisListe.clicked.connect(self.voisListePushed)
-       if hasattr(self,'PBAlpha'):
-          self.PBCata.clicked.connect(self.cataPushed)
-          self.PBAlpha.clicked.connect(self.alphaPushed)
-          self.PBFind.clicked.connect(self.findPushed)
-          self.LEFiltre.returnPressed.connect(self.LEFiltreReturnPressed)
-       if hasattr(self, 'PBValideFeuille'):
-          self.PBValideFeuille.clicked.connect(self.changeValeur)
-
-   def filtreListe(self):
-       l=[]
-       if self.filtre != "" :
-          for i in self.listeAAfficher :
-              if i.find(self.filtre) == 0 :l.append(i)
-          self.listeAAfficher=l
-       if self.alpha : self.listeAAfficher.sort()
-
-   def LEFiltreReturnPressed(self):
-       self.filtre= self.LEFiltre.text()
-       self.prepareListeResultatFiltre()
-
-   def findPushed(self):
-       self.filtre= self.LEFiltre.text()
-       self.prepareListeResultatFiltre()
-
-   def alphaPushed(self):
-       #print "alphaPushed" ,self.alpha
-       if self.alpha == 1 : return
-       self.alpha=1
-       self.prepareListeResultat()
-
-   def cataPushed(self):
-       if self.alpha == 0 : return
-       self.alpha=0
-       self.prepareListeResultat()
-
-   def hautPushed(self):
-       if self.numLineEditEnCours == 0 : return
-       if self.numLineEditEnCours == 1 : return
-       else : numEchange=self.numLineEditEnCours-1
-       self.echange(self.numLineEditEnCours,numEchange)
-       self.LineEditEnCours.setFocus(True)
-       self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
-
-
-   def basPushed(self):
-       if self.numLineEditEnCours == 0 : return
-       if self.numLineEditEnCours == self.indexDernierLabel : return
-       else : numEchange=self.numLineEditEnCours+1
-       self.echange(self.numLineEditEnCours,numEchange)
-       self.LineEditEnCours.setFocus(True)
-       self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
-
-   def echange(self,num1,num2):
-       # on donne le focus au a celui ou on a bouge
-       # par convention le 2
-       nomLineEdit=self.nomLine+str(num1)
-       #print (nomLineEdit)
-       courant=getattr(self,nomLineEdit)
-       valeurAGarder=courant.text()
-       nomLineEdit2=self.nomLine+str(num2)
-       #print (nomLineEdit2)
-       courant2=getattr(self,nomLineEdit2)
-       courant.setText(courant2.text())
-       courant2.setText(valeurAGarder)
-       self.changeValeur(changeDePlace=False)
-       self.numLineEditEnCours=num2
-       self.LineEditEnCours=courant2
-       self.LineEditEnCours.setFocus(True)
-
-   def moinsPushed(self):
-       # on supprime le dernier
-       if self.numLineEditEnCours == 0 : return
-       if self.indexDernierLabel == 0 : return
-       if self.numLineEditEnCours==self.indexDernierLabel :
-          nomLineEdit=self.nomLine+str(self.indexDernierLabel)
-          courant=getattr(self,nomLineEdit)
-          courant.clean()
-       else :
-         for i in range (self.numLineEditEnCours, self.indexDernierLabel):
-             aRemonter=i+1
-             nomLineEdit=self.nomLine+str(aRemonter)
-             courant=getattr(self,nomLineEdit)
-             valeurARemonter=courant.getValeur()
-             nomLineEdit=self.nomLine+str(i)
-             courant=getattr(self,nomLineEdit)
-             if valeurARemonter != None : courant.setValeur(valeurARemonter)
-             else : courant.clean()
-         nomLineEdit=self.nomLine+str(self.indexDernierLabel)
-         courant=getattr(self,nomLineEdit)
-         courant.clean()
-       self.changeValeur(changeDePlace=False,oblige=True)
-       self.setValide()
-
-   def plusPushed(self):
-       if self.indexDernierLabel == self.monSimpDef.max:
-          if len(self.listeValeursCourantes) < self.monSimpDef.max : self.chercheLigneVide()
-          else : self.editor.afficheInfos('nb max de valeurs : '+str(self.monSimpDef.max)+' atteint',Qt.red)
-          return
-       self.ajoutLineEdit()
-       self.descendLesLignes()
-       self.chercheLigneVide()
-       QTimer.singleShot(1, self.rendVisibleLigne)
-
-   def chercheLigneVide(self):
-       for i in range(self.indexDernierLabel) :
-          nomLineEdit=self.nomLine+str(i+1)
-          courant=getattr(self,nomLineEdit)
-          valeur=courant.getValeur()
-          if valeur=="" or valeur == None :
-             courant.setFocus(True)
-             self.estVisible=courant
-             return
-
-
-   def descendLesLignes(self):
-       if self.numLineEditEnCours==self.indexDernierLabel : return
-       nomLineEdit=self.nomLine+str(self.numLineEditEnCours+1)
-       courant=getattr(self,nomLineEdit)
-       valeurADescendre=courant.getValeur()
-       courant.clean()
-       for i in range (self.numLineEditEnCours+1, self.indexDernierLabel):
-             aDescendre=i+1
-             nomLineEdit=self.nomLine+str(aDescendre)
-             courant=getattr(self,nomLineEdit)
-             valeurAGarder=courant.getValeur()
-             courant.setValeur(valeurADescendre)
-             valeurADescendre=valeurAGarder
-       self.changeValeur(changeDePlace=False)
-       if hasattr (self, 'LineEditEnCours') :self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
-
-   def voisListePushed(self):
-       texteValeurs=""
-       for v in self.node.item.getListeValeurs():
-          texteValeurs+=str(v)+", "
-       entete="Valeurs pour "+self.nom
-       f=ViewText(self,self.editor,entete,texteValeurs[0:-2])
-       f.show()
-
-
-   def selectInFile(self):
-       init=str( self.editor.maConfiguration.savedir)
-       fn = QFileDialog.getOpenFileName(self.node.appliEficas,
-                                         tr("Fichier de donnees"),
-                                         init,
-                                         tr('Tous les  Fichiers (*)',))
-       fn=fn[0]
-       if fn == None : return
-       if fn == "" : return
-       ulfile = os.path.abspath(fn)
-       self.editor.maConfiguration.savedir=os.path.split(ulfile)[0]
-
-       from .monSelectVal import MonSelectVal
-       MonSelectVal(file=fn,parent=self).show()
-
-   def noircirResultatFiltre(self):
-      filtre=str(self.LEFiltre.text())
-      for cb in self.listeCbRouge:
-          palette = QPalette(Qt.red)
-          palette.setColor(QPalette.WindowText,Qt.black)
-          cb.setPalette(palette)
-          t=cb.text()
-          cb.setText(t)
-      self.LEFiltre.setText("")
-      self.listeCbRouge = []
+    def __init__(self):
+        self.connecterSignaux()
+
+    def connecterSignaux(self):
+        if hasattr(self,'RBHaut'):
+            self.RBHaut.clicked.connect(self.hautPushed)
+            self.RBBas.clicked.connect(self.basPushed)
+            self.RBMoins.clicked.connect(self.moinsPushed)
+            self.RBPlus.clicked.connect(self.plusPushed)
+            self.RBVoisListe.clicked.connect(self.voisListePushed)
+        if hasattr(self,'PBAlpha'):
+            self.PBCata.clicked.connect(self.cataPushed)
+            self.PBAlpha.clicked.connect(self.alphaPushed)
+            self.PBFind.clicked.connect(self.findPushed)
+            self.LEFiltre.returnPressed.connect(self.LEFiltreReturnPressed)
+        if hasattr(self, 'PBValideFeuille'):
+            self.PBValideFeuille.clicked.connect(self.changeValeur)
+
+    def filtreListe(self):
+        l=[]
+        if self.filtre != "" :
+            for i in self.listeAAfficher :
+                if i.find(self.filtre) == 0 :l.append(i)
+            self.listeAAfficher=l
+        if self.alpha : self.listeAAfficher.sort()
+
+    def LEFiltreReturnPressed(self):
+        self.filtre= self.LEFiltre.text()
+        self.prepareListeResultatFiltre()
+
+    def findPushed(self):
+        self.filtre= self.LEFiltre.text()
+        self.prepareListeResultatFiltre()
+
+    def alphaPushed(self):
+        #print "alphaPushed" ,self.alpha
+        if self.alpha == 1 : return
+        self.alpha=1
+        self.prepareListeResultat()
+
+    def cataPushed(self):
+        if self.alpha == 0 : return
+        self.alpha=0
+        self.prepareListeResultat()
+
+    def hautPushed(self):
+        #print ('hautPushed')
+        if self.numLineEditEnCours == 0 : return
+        if self.numLineEditEnCours == 1 : return
+        else : numEchange=self.numLineEditEnCours-1
+        self.echange(self.numLineEditEnCours,numEchange)
+        self.lineEditEnCours.setFocus(True)
+        self.scrollArea.ensureWidgetVisible(self.lineEditEnCours)
+
+
+    def basPushed(self):
+        #print ('hautPushed')
+        if self.numLineEditEnCours == 0 : return
+        if self.numLineEditEnCours == self.indexDernierLabel : return
+        else : numEchange=self.numLineEditEnCours+1
+        self.echange(self.numLineEditEnCours,numEchange)
+        self.lineEditEnCours.setFocus(True)
+        self.scrollArea.ensureWidgetVisible(self.lineEditEnCours)
+
+    def echange(self,num1,num2):
+        # on donne le focus au a celui ou on a bouge
+        # par convention le 2
+        #print ('echange')
+        nomLineEdit=self.nomLine+str(num1)
+        #print (nomLineEdit)
+        courant=getattr(self,nomLineEdit)
+        valeurAGarder=courant.text()
+        nomLineEdit2=self.nomLine+str(num2)
+        #print (nomLineEdit2)
+        courant2=getattr(self,nomLineEdit2)
+        courant.setText(courant2.text())
+        courant2.setText(valeurAGarder)
+        # pour monWidgetCreeUserAssd
+        self.num1=num1
+        self.num2=num2
+        self.changeValeur(changeDePlace=False)
+        self.numLineEditEnCours=num2
+        self.lineEditEnCours=courant2
+        self.lineEditEnCours.setFocus(True)
+
+    def moinsPushed(self):
+        # on supprime le dernier
+        #print ('moinsPushed')
+        if self.numLineEditEnCours == 0 : return
+        if self.indexDernierLabel == 0 : return
+        if self.numLineEditEnCours==self.indexDernierLabel :
+            nomLineEdit=self.nomLine+str(self.indexDernierLabel)
+            courant=getattr(self,nomLineEdit)
+            courant.clean()
+        else :
+            for i in range (self.numLineEditEnCours, self.indexDernierLabel):
+                aRemonter=i+1
+                nomLineEdit=self.nomLine+str(aRemonter)
+                courant=getattr(self,nomLineEdit)
+                valeurARemonter=courant.getValeur()
+                nomLineEdit=self.nomLine+str(i)
+                courant=getattr(self,nomLineEdit)
+                if valeurARemonter != None : courant.setValeur(valeurARemonter)
+                else : courant.clean()
+            nomLineEdit=self.nomLine+str(self.indexDernierLabel)
+            courant=getattr(self,nomLineEdit)
+            courant.clean()
+        self.changeValeur(changeDePlace=False,oblige=True)
+        self.setValide()
+
+    def plusPushed(self):
+        #print ('plusPushed gereliste')
+        if self.indexDernierLabel == self.monSimpDef.max:
+            if len(self.listeValeursCourantes) < self.monSimpDef.max : self.chercheLigneVide()
+            else : self.editor.afficheInfos('nb max de valeurs : '+str(self.monSimpDef.max)+' atteint',Qt.red)
+            return
+        self.ajoutLineEdit()
+        self.descendLesLignes()
+        self.chercheLigneVide()
+        QTimer.singleShot(1, self.rendVisibleLigne)
+
+    def chercheLigneVide(self):
+        #print ('chercheLigneVide')
+        for i in range(self.indexDernierLabel) :
+            nomLineEdit=self.nomLine+str(i+1)
+            courant=getattr(self,nomLineEdit)
+            valeur=courant.getValeur()
+            if valeur=="" or valeur == None :
+                courant.setFocus(True)
+                self.estVisible=courant
+
+    def descendLesLignes(self):
+        #print ('descendLesLignes')
+        if self.numLineEditEnCours==self.indexDernierLabel : return
+        nomLineEdit=self.nomLine+str(self.numLineEditEnCours+1)
+        courant=getattr(self,nomLineEdit)
+        valeurADescendre=courant.getValeur()
+        courant.clean()
+        for i in range (self.numLineEditEnCours+1, self.indexDernierLabel):
+            aDescendre=i+1
+            nomLineEdit=self.nomLine+str(aDescendre)
+            courant=getattr(self,nomLineEdit)
+            valeurAGarder=courant.getValeur()
+            courant.setValeur(valeurADescendre)
+            valeurADescendre=valeurAGarder
+        self.changeValeur(changeDePlace=False)
+        if hasattr (self, 'lineEditEnCours') :self.scrollArea.ensureWidgetVisible(self.lineEditEnCours)
+
+    def voisListePushed(self):
+        texteValeurs=""
+        for v in self.node.item.getListeValeurs():
+            texteValeurs+=str(v)+", "
+        entete="Valeurs pour "+self.nom
+        f=ViewText(self,self.editor,entete,texteValeurs[0:-2])
+        f.show()
+
+
+    def selectInFile(self):
+        init=str( self.editor.maConfiguration.savedir)
+        fn = QFileDialog.getOpenFileName(self.node.appliEficas,
+                                          tr("Fichier de donnees"),
+                                          init,
+                                          tr('Tous les  Fichiers (*)',))
+        fn=fn[0]
+        if fn == None : return
+        if fn == "" : return
+        ulfile = os.path.abspath(fn)
+        self.editor.maConfiguration.savedir=os.path.split(ulfile)[0]
+
+        from .monSelectVal import MonSelectVal
+        MonSelectVal(file=fn,parent=self).show()
+
+    def noircirResultatFiltre(self):
+        filtre=str(self.LEFiltre.text())
+        for cb in self.listeCbRouge:
+            palette = QPalette(Qt.red)
+            palette.setColor(QPalette.WindowText,Qt.black)
+            cb.setPalette(palette)
+            t=cb.text()
+            cb.setText(t)
+        self.LEFiltre.setText("")
+        self.listeCbRouge = []
 
 
 # ----------- #
 class GerePlie(object):
 # ----------- #
 
-   def gereIconePlier(self):
-      if not(hasattr(self,'BFermeListe')) : return
-      self.editor.listeDesListesOuvertes.add(self.node.item)
-      repIcon=self.node.editor.appliEficas.repIcon
-      if not (self.editor.afficheListesPliees):
-         fichier=os.path.join(repIcon, 'empty.png')
-         icon = QIcon(fichier)
-         self.BFermeListe.setIcon(icon)
-         return
-      fichier=os.path.join(repIcon, 'minusnode.png')
-      icon = QIcon(fichier)
-      self.BFermeListe.setIcon(icon)
-      self.BFermeListe.clicked.connect( self.selectWidgetPlie)
-
-   def selectWidgetPlie(self):
-      self.editor.listeDesListesOuvertes.remove(self.node.item)
-      self.reaffichePourDeplier()
+    def gereIconePlier(self):
+        if not(hasattr(self,'BFermeListe')) : return
+        self.editor.listeDesListesOuvertes.add(self.node.item)
+        repIcon=self.node.editor.appliEficas.repIcon
+        if not (self.editor.afficheListesPliees):
+            fichier=os.path.join(repIcon, 'empty.png')
+            icon = QIcon(fichier)
+            self.BFermeListe.setIcon(icon)
+            return
+        fichier=os.path.join(repIcon, 'minusnode.png')
+        icon = QIcon(fichier)
+        self.BFermeListe.setIcon(icon)
+        self.BFermeListe.clicked.connect( self.selectWidgetPlie)
+
+    def selectWidgetPlie(self):
+        self.editor.listeDesListesOuvertes.remove(self.node.item)
+        self.reaffichePourDeplier()
index e86b2dde192f3ddaa9f6ba4992bcc9707897da0f..11b3431baf3a354f273e93e7ed9c9f115c0be88e 100644 (file)
@@ -21,9 +21,9 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import range
-   from builtins import object
+    from builtins import str
+    from builtins import range
+    from builtins import object
 except : pass
 
 import types,os
@@ -43,12 +43,12 @@ from InterfaceQT4.monViewTexte   import ViewText
 # ---------------------- #
 class LECustom(QLineEdit):
 # ---------------------- #
- def __init__(self,parent,parentQt,i):
   def __init__(self,parent,parentQt,i):
         """
         Constructor
         """
         QLineEdit.__init__(self,parent)
-        
+
         self.valeur=None
         self.aEuLeFocus=False
         self.parentQt=parentQt
@@ -58,82 +58,82 @@ class LECustom(QLineEdit):
         self.numDsLaListe=-1
         self.returnPressed.connect(self.litValeur)
 
- def focusInEvent(self,event):
-     #print ("dans focusInEvent de LECustom",self.parentQt)
-     print ("dans focusInEvent de LECustom",self.num,self.numDsLaListe)
-     self.parentQt.aEuLeFocus=True
-     self.aEuLeFocus=True
-     self.parentQt.LineEditEnCours=self
-     self.parentQt.numLineEditEnCours=self.num
-     self.parentQt.textSelected=self.text()
-     self.setStyleSheet("border: 2px solid gray")
-     QLineEdit.focusInEvent(self,event)
-
- def focusOutEvent(self,event):
-     #print ("dans focusOutEvent de LECustom",self.num,self.numDsLaListe, self.aEuLeFocus)
-     self.setStyleSheet("border: 0px")
-     if self.dansUnTuple    : self.setStyleSheet("background:rgb(235,235,235); border: 0px;")
-     elif self.num % 2 == 1 : self.setStyleSheet("background:rgb(210,210,210)")
-     else                   : self.setStyleSheet("background:rgb(235,235,235)")
-     
-     if self.aEuLeFocus:
-       self.aEuLeFocus=False
-       self.litValeur()
-     QLineEdit.focusOutEvent(self,event)
-
- def litValeur(self):
-     self.aEuLeFocus=False
-     val=str(self.text())
-     if str(val)=="" or val==None : 
-        self.valeur=None 
-        return
-     try :
-       valeur=eval(val,{})
-     except :
-       try :
-          d=self.parentQt.parentQt.objSimp.jdc.getContexteAvant(self.parentQt.objSimp. etape)
-          valeur=eval(val,d)
-       except :
-          valeur=val
-
-     self.valeur=valeur
-
- def clean(self):
-     self.setText("")
-
- def getValeur(self):
-     return self.text()
-
- def setValeur(self,valeur):
-     self.setText(valeur)
-     self.valeur=valeur
-
- #def leaveEvent(self,event):
- #   ne sert a rien. quand on modifie la valeur on prend le focus
-
-    
   def focusInEvent(self,event):
+        #print ("dans focusInEvent de LECustom",self.parentQt)
+        print ("dans focusInEvent de LECustom",self.num,self.numDsLaListe)
+        self.parentQt.aEuLeFocus=True
+        self.aEuLeFocus=True
+        self.parentQt.LineEditEnCours=self
+        self.parentQt.numLineEditEnCours=self.num
+        self.parentQt.textSelected=self.text()
+        self.setStyleSheet("border: 2px solid gray")
+        QLineEdit.focusInEvent(self,event)
+
   def focusOutEvent(self,event):
+        #print ("dans focusOutEvent de LECustom",self.num,self.numDsLaListe, self.aEuLeFocus)
+        self.setStyleSheet("border: 0px")
+        if self.dansUnTuple    : self.setStyleSheet("background:rgb(235,235,235); border: 0px;")
+        elif self.num % 2 == 1 : self.setStyleSheet("background:rgb(210,210,210)")
+        else                   : self.setStyleSheet("background:rgb(235,235,235)")
+
+        if self.aEuLeFocus:
+            self.aEuLeFocus=False
+            self.litValeur()
+        QLineEdit.focusOutEvent(self,event)
+
   def litValeur(self):
+        self.aEuLeFocus=False
+        val=str(self.text())
+        if str(val)=="" or val==None :
+            self.valeur=None
+            return
+        try :
+            valeur=eval(val,{})
+        except :
+            try :
+                d=self.parentQt.parentQt.objSimp.jdc.getContexteAvant(self.parentQt.objSimp. etape)
+                valeur=eval(val,d)
+            except :
+                valeur=val
+
+        self.valeur=valeur
+
   def clean(self):
+        self.setText("")
+
   def getValeur(self):
+        return self.text()
+
   def setValeur(self,valeur):
+        self.setText(valeur)
+        self.valeur=valeur
+
   #def leaveEvent(self,event):
   #   ne sert a rien. quand on modifie la valeur on prend le focus
+
+
 
 # --------------------------- #
 class LECustomTuple(LECustom):
 # --------------------------- #
- def __init__(self,parent):
-   #  index sera mis a jour par TupleCustom
-   parentQt=parent.parent().parent().parent()
-   LECustom. __init__(self,parent,parentQt,0)
-   #print (dir(self))
   def __init__(self,parent):
+    #  index sera mis a jour par TupleCustom
+        parentQt=parent.parent().parent().parent()
+        LECustom. __init__(self,parent,parentQt,0)
+        #print (dir(self))
 
 # ---------------------------- #
 class MonLabelListeClic(QLabel):
 # ---------------------------- #
-     def __init__(self,parent):
+    def __init__(self,parent):
         QLabel.__init__(self,parent)
         self.parent=parent
 
-     def event(self,event) :
-         if event.type() == QEvent.MouseButtonRelease:
+    def event(self,event) :
+        if event.type() == QEvent.MouseButtonRelease:
             self.texte=self.text()
             self.parent.traiteClicSurLabelListe(self.texte)
-         return QLabel.event(self,event)
+        return QLabel.event(self,event)
 
 
 
@@ -142,208 +142,205 @@ class MonLabelListeClic(QLabel):
 class GereListe(object):
 # ------------- #
 
-   def __init__(self):
-       self.aEuLeFocus=False
-       self.connecterSignaux()
-
-
-   def leaveEvent(self,event):
-       if self.aEuLeFocus : 
-          print ('appel de changeValeur')
-          self.changeValeur()
-          self.aEuLeFocus=False
-       QWidget.leaveEvent(self,event)
-
-   def connecterSignaux(self):
-       if hasattr(self,'RBHaut'):
-          self.RBHaut.clicked.connect(self.hautPushed)
-          self.RBBas.clicked.connect(self.basPushed)
-          self.RBMoins.clicked.connect(self.moinsPushed)
-          self.RBPlus.clicked.connect(self.plusPushed)
-          self.RBVoisListe.clicked.connect(self.voisListePushed)
-       if hasattr(self,'PBAlpha'):
-          self.PBCata.clicked.connect(self.cataPushed)
-          self.PBAlpha.clicked.connect(self.alphaPushed)
-          self.PBFind.clicked.connect(self.findPushed)
-          self.LEFiltre.returnPressed.connect(self.LEFiltreReturnPressed)
-
-   def filtreListe(self):
-       l=[]
-       if self.filtre != "" :
-          for i in self.listeAAfficher :
-              if i.find(self.filtre) == 0 :l.append(i)
-          self.listeAAfficher=l
-       if self.alpha : self.listeAAfficher.sort()
-      
-   def LEFiltreReturnPressed(self):
-       self.filtre= self.LEFiltre.text()
-       self.prepareListeResultatFiltre()
-
-   def findPushed(self):
-       self.filtre= self.LEFiltre.text()
-       self.prepareListeResultatFiltre()
-
-   def alphaPushed(self):
-       #print "alphaPushed" ,self.alpha
-       if self.alpha == 1 : return
-       self.alpha=1
-       self.prepareListeResultat()
-
-   def cataPushed(self):
-       if self.alpha == 0 : return
-       self.alpha=0
-       self.prepareListeResultat()
-
-   def hautPushed(self):
-       if self.numLineEditEnCours == 1 : return
-       else : numEchange=self.numLineEditEnCours-1
-       self.echange(self.numLineEditEnCours,numEchange)
-       self.LineEditEnCours.setFocus(True)
-       self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
-
-
-   def basPushed(self):
-       if self.numLineEditEnCours == self.indexDernierLabel : return
-       else : numEchange=self.numLineEditEnCours+1
-       self.echange(self.numLineEditEnCours,numEchange)
-       self.LineEditEnCours.setFocus(True)
-       self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
-
-   def echange(self,num1,num2):
-       # on donne le focus au a celui ou on a bouge
-       # par convention le 2
-       nomLineEdit=self.nomLine+str(num1)
-       #print nomLineEdit
-       courant=getattr(self,nomLineEdit)
-       valeurAGarder=courant.text()
-       nomLineEdit2=self.nomLine+str(num2)
-       #print nomLineEdit2
-       courant2=getattr(self,nomLineEdit2)
-       courant.setText(courant2.text())
-       courant2.setText(valeurAGarder)
-       self.changeValeur(changeDePlace=False)
-       self.numLineEditEnCours=num2
-       self.LineEditEnCours=courant2
-       self.LineEditEnCours.setFocus(True)
-
-   def moinsPushed(self):
-       # on supprime le dernier
-       if self.numLineEditEnCours == 0 : return
-       if self.indexDernierLabel == 0 : return
-       if self.numLineEditEnCours==self.indexDernierLabel : 
-          nomLineEdit=self.nomLine+str(self.indexDernierLabel)
-          courant=getattr(self,nomLineEdit)
-          courant.clean()
-       else :
-         for i in range (self.numLineEditEnCours, self.indexDernierLabel):
-             aRemonter=i+1
-             nomLineEdit=self.nomLine+str(aRemonter)
-             courant=getattr(self,nomLineEdit)
-             valeurARemonter=courant.getValeur()
-             nomLineEdit=self.nomLine+str(i)
-             courant=getattr(self,nomLineEdit)
-             if valeurARemonter != None : courant.setValeur(valeurARemonter)
-             else : courant.clean()
-         nomLineEdit=self.nomLine+str(self.indexDernierLabel)
-         courant=getattr(self,nomLineEdit)
-         courant.clean()
-       self.changeValeur(changeDePlace=False,oblige=True)
-       self.setValide()
-
-   def plusPushed(self):
-       if self.indexDernierLabel == self.monSimpDef.max:
-          if len(self.listeValeursCourantes) < self.monSimpDef.max : self.chercheLigneVide()
-          else : self.editor.afficheInfos('nb max de valeurs : '+str(self.monSimpDef.max)+' atteint',Qt.red)
-          return
-       self.ajoutLineEdit()
-       self.descendLesLignes()
-       self.chercheLigneVide()
-       QTimer.singleShot(1, self.rendVisibleLigne)
-
-   def chercheLigneVide(self):
-       for i in range(self.indexDernierLabel) :
-          nomLineEdit=self.nomLine+str(i+1)
-          courant=getattr(self,nomLineEdit)
-          valeur=courant.getValeur()
-          if valeur=="" : 
-             courant.setFocus(True)
-             self.estVisible=courant
-             return
-
-
-   def descendLesLignes(self):
-       if self.numLineEditEnCours==self.indexDernierLabel : return
-       nomLineEdit=self.nomLine+str(self.numLineEditEnCours+1)
-       courant=getattr(self,nomLineEdit)
-       valeurADescendre=courant.getValeur()
-       courant.clean()
-       for i in range (self.numLineEditEnCours+1, self.indexDernierLabel):
-             aDescendre=i+1
-             nomLineEdit=self.nomLine+str(aDescendre)
-             courant=getattr(self,nomLineEdit)
-             valeurAGarder=courant.getValeur()
-             courant.setValeur(valeurADescendre)
-             valeurADescendre=valeurAGarder
-       self.changeValeur(changeDePlace=False)
-       if hasattr (self, 'LineEditEnCours') :self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
-
-   def voisListePushed(self):
-       texteValeurs=""
-       for v in self.node.item.getListeValeurs():
-          texteValeurs+=str(v)+", "
-       entete="Valeurs pour "+self.nom
-       f=ViewText(self,self.editor,entete,texteValeurs[0:-2])
-       f.show()
-
-
-   def selectInFile(self):
-       init=str( self.editor.maConfiguration.savedir)
-       fn = QFileDialog.getOpenFileName(self.node.appliEficas,
-                                         tr("Fichier de donnees"),
-                                         init,
-                                         tr('Tous les  Fichiers (*)',))
-       fn=fn[0]
-       if fn == None : return
-       if fn == "" : return
-       ulfile = os.path.abspath(six.text_type(fn))
-       self.editor.maConfiguration.savedir=os.path.split(ulfile)[0]
-
-       from .monSelectVal import MonSelectVal
-       MonSelectVal(file=fn,parent=self).show()
-
-   def noircirResultatFiltre(self):
-      filtre=str(self.LEFiltre.text())
-      for cb in self.listeCbRouge:
-          palette = QPalette(Qt.red)
-         palette.setColor(QPalette.WindowText,Qt.black)
-         cb.setPalette(palette)
-          t=cb.text()
-          cb.setText(t)
-      self.LEFiltre.setText("")
-      self.listeCbRouge = []
-
-  
+    def __init__(self):
+        self.aEuLeFocus=False
+        self.connecterSignaux()
+
+
+    def leaveEvent(self,event):
+        if self.aEuLeFocus :
+            print ('appel de changeValeur')
+            self.changeValeur()
+            self.aEuLeFocus=False
+        QWidget.leaveEvent(self,event)
+
+    def connecterSignaux(self):
+        if hasattr(self,'RBHaut'):
+            self.RBHaut.clicked.connect(self.hautPushed)
+            self.RBBas.clicked.connect(self.basPushed)
+            self.RBMoins.clicked.connect(self.moinsPushed)
+            self.RBPlus.clicked.connect(self.plusPushed)
+            self.RBVoisListe.clicked.connect(self.voisListePushed)
+        if hasattr(self,'PBAlpha'):
+            self.PBCata.clicked.connect(self.cataPushed)
+            self.PBAlpha.clicked.connect(self.alphaPushed)
+            self.PBFind.clicked.connect(self.findPushed)
+            self.LEFiltre.returnPressed.connect(self.LEFiltreReturnPressed)
+
+    def filtreListe(self):
+        l=[]
+        if self.filtre != "" :
+            for i in self.listeAAfficher :
+                if i.find(self.filtre) == 0 :l.append(i)
+            self.listeAAfficher=l
+        if self.alpha : self.listeAAfficher.sort()
+
+    def LEFiltreReturnPressed(self):
+        self.filtre= self.LEFiltre.text()
+        self.prepareListeResultatFiltre()
+
+    def findPushed(self):
+        self.filtre= self.LEFiltre.text()
+        self.prepareListeResultatFiltre()
+
+    def alphaPushed(self):
+        #print "alphaPushed" ,self.alpha
+        if self.alpha == 1 : return
+        self.alpha=1
+        self.prepareListeResultat()
+
+    def cataPushed(self):
+        if self.alpha == 0 : return
+        self.alpha=0
+        self.prepareListeResultat()
+
+    def hautPushed(self):
+        if self.numLineEditEnCours == 1 : return
+        else : numEchange=self.numLineEditEnCours-1
+        self.echange(self.numLineEditEnCours,numEchange)
+        self.LineEditEnCours.setFocus(True)
+        self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
+
+
+    def basPushed(self):
+        if self.numLineEditEnCours == self.indexDernierLabel : return
+        else : numEchange=self.numLineEditEnCours+1
+        self.echange(self.numLineEditEnCours,numEchange)
+        self.LineEditEnCours.setFocus(True)
+        self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
+
+    def echange(self,num1,num2):
+        # on donne le focus au a celui ou on a bouge
+        # par convention le 2
+        nomLineEdit=self.nomLine+str(num1)
+        #print nomLineEdit
+        courant=getattr(self,nomLineEdit)
+        valeurAGarder=courant.text()
+        nomLineEdit2=self.nomLine+str(num2)
+        #print nomLineEdit2
+        courant2=getattr(self,nomLineEdit2)
+        courant.setText(courant2.text())
+        courant2.setText(valeurAGarder)
+        self.changeValeur(changeDePlace=False)
+        self.numLineEditEnCours=num2
+        self.LineEditEnCours=courant2
+        self.LineEditEnCours.setFocus(True)
+
+    def moinsPushed(self):
+        # on supprime le dernier
+        if self.numLineEditEnCours == 0 : return
+        if self.indexDernierLabel == 0 : return
+        if self.numLineEditEnCours==self.indexDernierLabel :
+            nomLineEdit=self.nomLine+str(self.indexDernierLabel)
+            courant=getattr(self,nomLineEdit)
+            courant.clean()
+        else :
+            for i in range (self.numLineEditEnCours, self.indexDernierLabel):
+                aRemonter=i+1
+                nomLineEdit=self.nomLine+str(aRemonter)
+                courant=getattr(self,nomLineEdit)
+                valeurARemonter=courant.getValeur()
+                nomLineEdit=self.nomLine+str(i)
+                courant=getattr(self,nomLineEdit)
+                if valeurARemonter != None : courant.setValeur(valeurARemonter)
+                else : courant.clean()
+            nomLineEdit=self.nomLine+str(self.indexDernierLabel)
+            courant=getattr(self,nomLineEdit)
+            courant.clean()
+        self.changeValeur(changeDePlace=False,oblige=True)
+        self.setValide()
+
+    def plusPushed(self):
+        if self.indexDernierLabel == self.monSimpDef.max:
+            if len(self.listeValeursCourantes) < self.monSimpDef.max : self.chercheLigneVide()
+            else : self.editor.afficheInfos('nb max de valeurs : '+str(self.monSimpDef.max)+' atteint',Qt.red)
+            return
+        self.ajoutLineEdit()
+        self.descendLesLignes()
+        self.chercheLigneVide()
+        QTimer.singleShot(1, self.rendVisibleLigne)
+
+    def chercheLigneVide(self):
+        for i in range(self.indexDernierLabel) :
+            nomLineEdit=self.nomLine+str(i+1)
+            courant=getattr(self,nomLineEdit)
+            valeur=courant.getValeur()
+            if valeur=="" :
+                courant.setFocus(True)
+                self.estVisible=courant
+                return
+
+
+    def descendLesLignes(self):
+        if self.numLineEditEnCours==self.indexDernierLabel : return
+        nomLineEdit=self.nomLine+str(self.numLineEditEnCours+1)
+        courant=getattr(self,nomLineEdit)
+        valeurADescendre=courant.getValeur()
+        courant.clean()
+        for i in range (self.numLineEditEnCours+1, self.indexDernierLabel):
+            aDescendre=i+1
+            nomLineEdit=self.nomLine+str(aDescendre)
+            courant=getattr(self,nomLineEdit)
+            valeurAGarder=courant.getValeur()
+            courant.setValeur(valeurADescendre)
+            valeurADescendre=valeurAGarder
+        self.changeValeur(changeDePlace=False)
+        if hasattr (self, 'LineEditEnCours') :self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
+
+    def voisListePushed(self):
+        texteValeurs=""
+        for v in self.node.item.getListeValeurs():
+            texteValeurs+=str(v)+", "
+        entete="Valeurs pour "+self.nom
+        f=ViewText(self,self.editor,entete,texteValeurs[0:-2])
+        f.show()
+
+
+    def selectInFile(self):
+        init=str( self.editor.maConfiguration.savedir)
+        fn = QFileDialog.getOpenFileName(self.node.appliEficas,
+                                          tr("Fichier de donnees"),
+                                          init,
+                                          tr('Tous les  Fichiers (*)',))
+        fn=fn[0]
+        if fn == None : return
+        if fn == "" : return
+        ulfile = os.path.abspath(six.text_type(fn))
+        self.editor.maConfiguration.savedir=os.path.split(ulfile)[0]
+
+        from .monSelectVal import MonSelectVal
+        MonSelectVal(file=fn,parent=self).show()
+
+    def noircirResultatFiltre(self):
+        filtre=str(self.LEFiltre.text())
+        for cb in self.listeCbRouge:
+            palette = QPalette(Qt.red)
+            palette.setColor(QPalette.WindowText,Qt.black)
+            cb.setPalette(palette)
+            t=cb.text()
+            cb.setText(t)
+        self.LEFiltre.setText("")
+        self.listeCbRouge = []
+
+
 # ----------- #
 class GerePlie(object):
 # ----------- #
 
-   def gereIconePlier(self):
-      if not(hasattr(self,'BFermeListe')) : return
-      self.editor.listeDesListesOuvertes.add(self.node.item)
-      repIcon=self.node.editor.appliEficas.repIcon
-      if not (self.editor.afficheListesPliees):
-         fichier=os.path.join(repIcon, 'empty.png')
-         icon = QIcon(fichier)
-         self.BFermeListe.setIcon(icon)
-         return
-      fichier=os.path.join(repIcon, 'minusnode.png')
-      icon = QIcon(fichier)
-      self.BFermeListe.setIcon(icon)
-      self.BFermeListe.clicked.connect( self.selectWidgetPlie)
-
-   def selectWidgetPlie(self):
-      self.editor.listeDesListesOuvertes.remove(self.node.item)
-      self.reaffichePourDeplier()
-
-        
-     
+    def gereIconePlier(self):
+        if not(hasattr(self,'BFermeListe')) : return
+        self.editor.listeDesListesOuvertes.add(self.node.item)
+        repIcon=self.node.editor.appliEficas.repIcon
+        if not (self.editor.afficheListesPliees):
+            fichier=os.path.join(repIcon, 'empty.png')
+            icon = QIcon(fichier)
+            self.BFermeListe.setIcon(icon)
+            return
+        fichier=os.path.join(repIcon, 'minusnode.png')
+        icon = QIcon(fichier)
+        self.BFermeListe.setIcon(icon)
+        self.BFermeListe.clicked.connect( self.selectWidgetPlie)
+
+    def selectWidgetPlie(self):
+        self.editor.listeDesListesOuvertes.remove(self.node.item)
+        self.reaffichePourDeplier()
index fb5f802b7a7b806999c9d36dcc5e60df5a70eb3f..49aef48cb56098def4402fb60d66a13c50efcc33 100644 (file)
@@ -20,7 +20,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import object
+    from builtins import object
 except : pass
 
 from PyQt5.QtCore import Qt
@@ -29,45 +29,42 @@ from Extensions.i18n import tr
 
 class GereRegles(object) :
 
-   def appellebuildLBRegles(self):
-       from .browser import JDCTree
-       if isinstance(self,JDCTree):
-          self.appellebuildLBReglesForJdC()
-       else :
-          self.appellebuildLBReglesForCommand()
-       self.buildLBRegles(self.listeRegles,self.listeNomsEtapes)
-       self.afficheRegles()
-       
-   def appellebuildLBReglesForCommand(self):
-       self.listeRegles     = self.item.getRegles()
-       self.listeNomsEtapes = self.item.getMcPresents()
+    def appellebuildLBRegles(self):
+        from .browser import JDCTree
+        if isinstance(self,JDCTree):
+            self.appellebuildLBReglesForJdC()
+        else :
+            self.appellebuildLBReglesForCommand()
+        self.buildLBRegles(self.listeRegles,self.listeNomsEtapes)
+        self.afficheRegles()
 
-   def appellebuildLBReglesForJdC(self):
-       self.listeRegles=self.item.getRegles()
-       self.listeNomsEtapes = self.item.getLNomsEtapes()
+    def appellebuildLBReglesForCommand(self):
+        self.listeRegles     = self.item.getRegles()
+        self.listeNomsEtapes = self.item.getMcPresents()
 
+    def appellebuildLBReglesForJdC(self):
+        self.listeRegles=self.item.getRegles()
+        self.listeNomsEtapes = self.item.getLNomsEtapes()
 
-   def buildLBRegles(self,listeRegles,listeNomsEtapes):
-       self.liste=[]
-       if len(listeRegles) > 0:
-          for regle in listeRegles :
-             texteRegle=regle.getText()
-             texteMauvais,test = regle.verif(listeNomsEtapes)
-             for ligne in texteRegle.split("\n") :
-                if ligne == "" : continue
-                if ligne[0]=="\t" :  ligne="     "+ligne[1:]
-                if test :
-                   self.liste.append((ligne,Qt.black))
-                else :
-                   self.liste.append((ligne,Qt.red))
-             self.liste.append(("",Qt.red))
-       if self.liste==[] : self.liste.append(("pas de regle de construction pour ce jeu de commandes",Qt.black))
-               
 
-   def afficheRegles(self):
-      titre="Regles pour "+self.item.nom
-      w = ViewRegles( self.editor,self.liste,titre  )
-      w.exec_()
-       
+    def buildLBRegles(self,listeRegles,listeNomsEtapes):
+        self.liste=[]
+        if len(listeRegles) > 0:
+            for regle in listeRegles :
+                texteRegle=regle.getText()
+                texteMauvais,test = regle.verif(listeNomsEtapes)
+                for ligne in texteRegle.split("\n") :
+                    if ligne == "" : continue
+                    if ligne[0]=="\t" :  ligne="     "+ligne[1:]
+                    if test :
+                        self.liste.append((ligne,Qt.black))
+                    else :
+                        self.liste.append((ligne,Qt.red))
+                self.liste.append(("",Qt.red))
+        if self.liste==[] : self.liste.append(("pas de regle de construction pour ce jeu de commandes",Qt.black))
 
 
+    def afficheRegles(self):
+        titre="Regles pour "+self.item.nom
+        w = ViewRegles( self.editor,self.liste,titre  )
+        w.exec_()
index 0e9673d4dc57f7597a0ea9d72d0c628bec36377d..29aa8b4e84055950a306d4226c351a4c646b8193 100644 (file)
@@ -18,7 +18,7 @@
 #
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 from PyQt5.QtWidgets import  QFileDialog, QApplication
@@ -28,20 +28,20 @@ from Extensions.i18n import tr
 
 
 def traduction(directPath,editor,version):
-    if version == "V9V10" : 
-       from Traducteur import traduitV9V10 
-       suffixe="v10.comm"
+    if version == "V9V10" :
+        from Traducteur import traduitV9V10
+        suffixe="v10.comm"
     if version == "V10V11" :
-       from Traducteur import traduitV10V11
-       suffixe="v11.comm"
+        from Traducteur import traduitV10V11
+        suffixe="v11.comm"
     if version == "V11V12" :
-       from Traducteur import traduitV11V12
-       suffixe="v12.comm"
+        from Traducteur import traduitV11V12
+        suffixe="v12.comm"
 
-    fn = QFileDialog.getOpenFileName( 
-                       editor.appliEficas,
+    fn = QFileDialog.getOpenFileName(
+                        editor.appliEficas,
                         tr('Traduire Fichier'),
-                       directPath ,
+                        directPath ,
                         tr('Fichiers JDC  (*.comm);;''Tous les Fichiers (*)'))
 
 
@@ -70,13 +70,13 @@ def traduction(directPath,editor,version):
         texte= f.read()
         f.close()
     else :
-       texte = Entete  
-       commande="diff "+FichieraTraduire+" "+FichierTraduit+" >/dev/null"
-       try :
-         if os.system(commande) == 0 :
-            texte = texte + tr("Pas de difference entre le fichier origine et le fichier traduit")
-       except :
-         pass
+        texte = Entete
+        commande="diff "+FichieraTraduire+" "+FichierTraduit+" >/dev/null"
+        try :
+            if os.system(commande) == 0 :
+                texte = texte + tr("Pas de difference entre le fichier origine et le fichier traduit")
+        except :
+            pass
 
     from .monVisu import DVisu
     titre = "conversion de "+ FichieraTraduire
@@ -84,4 +84,3 @@ def traduction(directPath,editor,version):
     monVisuDialg.setWindowTitle(titre)
     monVisuDialg.TB.setText(texte)
     monVisuDialg.show()
-
index 0fe113f90e76d5467d8dc9ed0a6e4cde08c95deb..93b2225c9afeca01e2772b8b73f46f13b841fc27 100644 (file)
@@ -27,69 +27,69 @@ from PyQt5.QtCore import Qt
 from Extensions.i18n import tr
 
 from .gereIcones import FacultatifOuOptionnel
-import Accas 
+import Accas
 import traceback
 
-    
+
 # Import des panels
 
 class Groupe(QWidget,FacultatifOuOptionnel):
-  """
-  """
-  def __init__(self,node,editor,parentQt,definition,obj,niveau,commande=None):
-      #print ("groupe : ",self.node.item.nom," ",self.node.fenetre)
-      QWidget.__init__(self,None)
-      self.node=node
-      self.node.fenetre=self
-      self.setupUi(self)
-      self.editor=editor
-      self.obj=obj
-      self.niveau=niveau
-      self.definition=definition
-      self.parentQt=parentQt
-      self.maCommande=commande
-      self.listeFocus=[]
-      self.appliEficas=self.editor.appliEficas
-      self.repIcon=self.appliEficas.repIcon
-      self.jdc=self.node.item.getJdc()
-      self.setIconePoubelle()
-      self.setIconesGenerales()
-      self.setRun()
-      self.setValide()
-      self.setReglesEtAide()
-      self.afficheMots()
-      self.listeMCAAjouter=[]
-      self.dictMCVenantDesBlocs={}
-      if hasattr(self,'RBDeplie')  : self.RBDeplie.clicked.connect(self.setDeplie)
-      if hasattr(self,'RBPlie')    : self.RBPlie.clicked.connect( self.setPlie)
-
-      self.setAcceptDrops(True)
-      #if hasattr (self, 'commandesLayout'): 
-      #   print (' j ajoute un spacer dans ', self.node.item.nom)
-      #   spacerItem = QSpacerItem(20, 5, QSizePolicy.Minimum, QSizePolicy.Expanding)
-      #   self.commandesLayout.addItem(spacerItem)
-     
-  def donneFocus(self):
-      for fenetre in self.listeFocus:
-          if fenetre==None : return
-          if fenetre.node.item.isValid() == 0 :
-             fenetre.prendLeFocus=1
-             fenetre.hide()
-             fenetre.show()
-      
-
-  def afficheMots(self):
-      #print ("ds afficheMots ",self.node.item.nom,self.node.plie)
-      for node in self.node.children:
-           # non return mais  continue car il faut tenir compte des blocs
-           if node.appartientAUnNoeudPlie==True : continue
-           widget=node.getPanelGroupe(self,self.maCommande)
-           #print ("widget pour ", node.item.nom, widget)
-           self.listeFocus.append(node.fenetre)
-      #print "fin pour " , self.node.item.nom
-
-       
-  def calculOptionnel(self):
+    """
+    """
+    def __init__(self,node,editor,parentQt,definition,obj,niveau,commande=None):
+        #print ("groupe : ",self.node.item.nom," ",self.node.fenetre)
+        QWidget.__init__(self,None)
+        self.node=node
+        self.node.fenetre=self
+        self.setupUi(self)
+        self.editor=editor
+        self.obj=obj
+        self.niveau=niveau
+        self.definition=definition
+        self.parentQt=parentQt
+        self.maCommande=commande
+        self.listeFocus=[]
+        self.appliEficas=self.editor.appliEficas
+        self.repIcon=self.appliEficas.repIcon
+        self.jdc=self.node.item.getJdc()
+        self.setIconePoubelle()
+        self.setIconesGenerales()
+        self.setRun()
+        self.setValide()
+        self.setReglesEtAide()
+        self.afficheMots()
+        self.listeMCAAjouter=[]
+        self.dictMCVenantDesBlocs={}
+        if hasattr(self,'RBDeplie')  : self.RBDeplie.clicked.connect(self.setDeplie)
+        if hasattr(self,'RBPlie')    : self.RBPlie.clicked.connect( self.setPlie)
+
+        self.setAcceptDrops(True)
+        #if hasattr (self, 'commandesLayout'):
+        #   print (' j ajoute un spacer dans ', self.node.item.nom)
+        #   spacerItem = QSpacerItem(20, 5, QSizePolicy.Minimum, QSizePolicy.Expanding)
+        #   self.commandesLayout.addItem(spacerItem)
+
+    def donneFocus(self):
+        for fenetre in self.listeFocus:
+            if fenetre==None : return
+            if fenetre.node.item.isValid() == 0 :
+                fenetre.prendLeFocus=1
+                fenetre.hide()
+                fenetre.show()
+
+
+    def afficheMots(self):
+        #print ("ds afficheMots ",self.node.item.nom,self.node.plie)
+        for node in self.node.children:
+            # non return mais  continue car il faut tenir compte des blocs
+            if node.appartientAUnNoeudPlie==True : continue
+            widget=node.getPanelGroupe(self,self.maCommande)
+            #print ("widget pour ", node.item.nom, widget)
+            self.listeFocus.append(node.fenetre)
+        #print "fin pour " , self.node.item.nom
+
+
+    def calculOptionnel(self):
         self.listeMc=[]
         self.listeMcRegle=[]
         self.dictToolTipMc={}
@@ -98,114 +98,119 @@ class Groupe(QWidget,FacultatifOuOptionnel):
         # n ont pas toutes ces methodes
         try :
         #if 1 :
-           self.listeMc     = self.obj.getListeMcOrdonnee(genea,self.jdc.cata_ordonne_dico)
-           listeNomsPresents=self.obj.dictMcPresents()
-           for regle in self.obj.getRegles():
-               (monToolTip,regleOk)=regle.verif(listeNomsPresents)
-               if regleOk : continue
-               for mc in regle.mcs :
-                   self.listeMcRegle.append(mc)
-                   self.dictToolTipMc[mc]=monToolTip
+            self.listeMc     = self.obj.getListeMcOrdonnee(genea,self.jdc.cata_ordonne_dico)
+            listeNomsPresents=self.obj.dictMcPresents()
+            for regle in self.obj.getRegles():
+                (monToolTip,regleOk)=regle.verif(listeNomsPresents)
+                if regleOk : continue
+                for mc in regle.mcs :
+                    self.listeMcRegle.append(mc)
+                    self.dictToolTipMc[mc]=monToolTip
         except :
-           #print ('in except')
-           #print (self)
-           return
-        
-  def afficheOptionnel(self):
+            #print ('in except')
+            #print (self)
+            return
+
+    def afficheOptionnel(self):
         if self.editor.maConfiguration.closeOptionnel : return
         liste,liste_rouge=self.ajouteMCOptionnelDesBlocs()
         self.monOptionnel=self.editor.widgetOptionnel
         self.monOptionnel.afficheOptionnel(liste,liste_rouge,self)
-           
-
-  def ajouteMCOptionnelDesBlocs(self):
-      self.dictMCVenantDesBlocs={}
-      i=0
-      self.calculOptionnel()
-      liste=self.listeMc
-      liste_rouge=self.listeMcRegle
-      for MC in self.listeMc : self.dictMCVenantDesBlocs[MC]=self
-      # ce cas est le cas machine tournant sr le plie
-      try :
-        while i < self.commandesLayout.count():
-          from .monWidgetBloc import MonWidgetBloc
-          widget=self.commandesLayout.itemAt(i).widget()
-          i=i+1
-          if not(isinstance(widget,MonWidgetBloc)) : continue
-          widget.calculOptionnel()
-          listeW,listeW_rouge=widget.ajouteMCOptionnelDesBlocs() 
-          for MC in widget.dictMCVenantDesBlocs:
-              if MC in self.dictMCVenantDesBlocs: print ("Pb Sur les MC" )
-              else : self.dictMCVenantDesBlocs[MC]=widget.dictMCVenantDesBlocs[MC]
-          liste=liste+listeW
-          liste_rouge=liste_rouge+listeW_rouge
-      except : 
-        pass
-      return (liste,liste_rouge)
-
-
-  def reaffiche(self,nodeAVoir=None):
-      #print "dans reaffiche de groupe.py", nodeAVoir
-      self.parentQt.reaffiche(nodeAVoir)
-
-  def recalculeListeMC(self,listeMC):
-      #print "pas si peu utile"
-      #on ajoute et on enleve
-      listeNode=[]
-      for name in listeMC :
-          nodeAEnlever=self.node.appendChild(name)
-          if nodeAEnlever.item.isMCList(): 
-             nodeAEnlever=nodeAEnlever.children[-1]
-          listeNode.append(nodeAEnlever)
-      self.afficheOptionnel()
-      self.monOptionnel.affiche(self.listeMc)
-      if len(listeNode) == 0 : return
-      if len(listeNode) == 1 : 
-         listeNode[0].delete()
-         self.editor.afficheInfos("")
-         return
-      for noeud in listeNode:
-          noeud.treeParent.item.suppItem(noeud.item)
-      noeud.treeParent.buildChildren()
-      self.editor.afficheInfos("")
-
-  def ajoutMC(self,texteListeNom):
-      listeNom=texteListeNom.split("+")[1:]
-      firstNode=None
-      for nom in listeNom:
-        if nom not in self.dictMCVenantDesBlocs:
-           #print "bizarre, bizarre"
-           self.editor.initModif()
-           nouveau=self.node.appendChild(nom)
-        else :
-           self.editor.initModif()
-           widget=self.dictMCVenantDesBlocs[nom]
-           nouveau=widget.node.appendChild(nom)
-        if firstNode==None : firstNode=nouveau 
-        if nouveau == None or nouveau == 0  : 
-           self.editor.afficheInfos(tr('insertion impossible a cet endroit pour '+nom),Qt.red)
-      try :
-       self.reaffiche(firstNode)
-       if firstNode!=None and firstNode !=0 and firstNode.item!=None : firstNode.select()
-      except :
-       pass
-
-
-  def setPlie(self):
-      self.node.setPlie()
-      self.reaffiche(self.node) 
-
-  def setDeplie(self):
-      #print ('je passe ds setDeplie de groupe', self.obj.nom)
-      self.node.firstDeplie = False
-      self.node.setDeplie()
-      self.reaffiche(self.node) 
-    
-
-  def traiteClicSurLabel(self,texte):
-      if self.editor.code != "CARMELCND" : self.afficheOptionnel()
-
-
-  def propageChange(self,leType):
-      self.parentQt.propageChange(leType)
 
+
+    def ajouteMCOptionnelDesBlocs(self):
+        self.dictMCVenantDesBlocs={}
+        i=0
+        self.calculOptionnel()
+        liste=self.listeMc
+        liste_rouge=self.listeMcRegle
+        for MC in self.listeMc : self.dictMCVenantDesBlocs[MC]=self
+        # ce cas est le cas machine tournant sr le plie
+        try :
+            while i < self.commandesLayout.count():
+                from .monWidgetBloc import MonWidgetBloc
+                widget=self.commandesLayout.itemAt(i).widget()
+                i=i+1
+                if not(isinstance(widget,MonWidgetBloc)) : continue
+                widget.calculOptionnel()
+                listeW,listeW_rouge=widget.ajouteMCOptionnelDesBlocs()
+                for MC in widget.dictMCVenantDesBlocs:
+                    if MC in self.dictMCVenantDesBlocs: print ("Pb Sur les MC" )
+                    else : self.dictMCVenantDesBlocs[MC]=widget.dictMCVenantDesBlocs[MC]
+                liste=liste+listeW
+                liste_rouge=liste_rouge+listeW_rouge
+        except :
+            pass
+        return (liste,liste_rouge)
+
+
+    def reaffiche(self,nodeAVoir=None):
+        #print "dans reaffiche de groupe.py", nodeAVoir
+        self.parentQt.reaffiche(nodeAVoir)
+
+    def recalculeListeMC(self,listeMC):
+        #print "pas si peu utile"
+        #on ajoute et on enleve
+        listeNode=[]
+        for name in listeMC :
+            nodeAEnlever=self.node.appendChild(name)
+            if nodeAEnlever.item.isMCList():
+                nodeAEnlever=nodeAEnlever.children[-1]
+            listeNode.append(nodeAEnlever)
+        self.afficheOptionnel()
+        self.monOptionnel.affiche(self.listeMc)
+        if len(listeNode) == 0 : return
+        if len(listeNode) == 1 :
+            listeNode[0].delete()
+            self.editor.afficheInfos("")
+            return
+        for noeud in listeNode:
+            noeud.treeParent.item.suppItem(noeud.item)
+        noeud.treeParent.buildChildren()
+        self.editor.afficheInfos("")
+
+    def ajoutMC(self,texteListeNom):
+        listeNom=texteListeNom.split("+")[1:]
+        firstNode=None
+        for nom in listeNom:
+            if nom not in self.dictMCVenantDesBlocs:
+            #print "bizarre, bizarre"
+                self.editor.initModif()
+                nouveau=self.node.appendChild(nom)
+            else :
+                self.editor.initModif()
+                widget=self.dictMCVenantDesBlocs[nom]
+                nouveau=widget.node.appendChild(nom)
+            if firstNode==None : firstNode=nouveau
+            if nouveau == None or nouveau == 0  :
+                self.editor.afficheInfos(tr('insertion impossible a cet endroit pour '+nom),Qt.red)
+        try :
+            self.reaffiche(firstNode)
+            if firstNode!=None and firstNode !=0 and firstNode.item!=None : firstNode.select()
+        except :
+            pass
+
+
+    def setPlie(self):
+        self.node.setPlie()
+        self.reaffiche(self.node)
+
+    def setDeplie(self):
+        #print ('je passe ds setDeplie de groupe', self.obj.nom)
+        self.node.firstDeplie = False
+        self.node.setDeplie()
+        self.reaffiche(self.node)
+
+
+    def traiteClicSurLabel(self,texte):
+        if self.editor.code != "CARMELCND" : self.afficheOptionnel()
+        try :
+            fr = self.node.item.getFr()
+            self.editor.afficheCommentaire(str(fr))
+        except :
+            pass
+
+
+
+    def propageChange(self,leType,donneLefocus):
+        self.parentQt.propageChange(leType,donneLefocus)
index 724df9b46129f29353af9bb8e0a78c608eebdf31..12767af9107288088254c64fa8018eac628d44c5 100644 (file)
@@ -29,46 +29,44 @@ from Extensions.i18n import tr
 
 class MonBoutonValide(QToolButton) :
 
-     def __init__(self,parent):
+    def __init__(self,parent):
         QToolButton.__init__(self,parent)
-        while( not(hasattr(parent,'node'))): 
-          parent= parent.parent()
+        while( not(hasattr(parent,'node'))):
+            parent= parent.parent()
         self.parent=parent
 
-     def mouseDoubleClickEvent(self, event):
+    def mouseDoubleClickEvent(self, event):
         #print "dans mouseDoubleClickEvent"
         strAide=self.parent.node.item.object.getFr()
         if hasattr(self.parent.node.item.object.definition, 'defaut') :
-                strAide+='\ndefaut : \n'+str(self.parent.node.item.object.definition.defaut)
+            strAide+='\ndefaut : \n'+str(self.parent.node.item.object.definition.defaut)
         strRapport=str(self.parent.node.item.object.report())
         self.parent.editor._viewText(strAide+"\n"+strRapport, "JDC_RAPPORT")
 
-     def mousePressEvent(self, event):
-       #print "dans mousePressEvent"
-       if self.parent.node.item.object.isValid() :
-          myToolTip=tr("objet valide")
-          if self.parent.editor.maConfiguration.differencieSiDefaut :
-            if hasattr(self.parent.node.item.object.definition, 'defaut') :
-              if self.parent.node.item.object.valeur != self.parent.node.item.object.definition.defaut :
-                myToolTip+='\ndefaut : \n'+str(self.parent.node.item.object.definition.defaut)
-
-          QToolTip.showText(event.globalPos(),myToolTip )
-       else :
-          t=""
-          texte=self.parent.node.item.object.report().report()
-          deb=1
-          for l in texte.split('\n')[2:-2]:
-              if re.match('^[\t !]*$',l) : continue
-              if re.match('^ *Fin Mot-cl',l) : continue
-              if re.match('^ *D?but Mot-cl',l) : continue
-              if re.match('^ *Mot-cl',l) : continue
-              l=l.replace('!','')
-              if deb :
-                 deb=0
-                 t=l
-              else :
-                 t=t+'\n'+l
-          myToolTip=tr(t)
-       QToolTip.showText(event.globalPos(),myToolTip )
-
+    def mousePressEvent(self, event):
+        #print "dans mousePressEvent"
+        if self.parent.node.item.object.isValid() :
+            myToolTip=tr("objet valide")
+            if self.parent.editor.maConfiguration.differencieSiDefaut :
+                if hasattr(self.parent.node.item.object.definition, 'defaut') :
+                    if self.parent.node.item.object.valeur != self.parent.node.item.object.definition.defaut :
+                        myToolTip+='\ndefaut : \n'+str(self.parent.node.item.object.definition.defaut)
 
+            QToolTip.showText(event.globalPos(),myToolTip )
+        else :
+            t=""
+            texte=self.parent.node.item.object.report().report()
+            deb=1
+            for l in texte.split('\n')[2:-2]:
+                if re.match('^[\t !]*$',l) : continue
+                if re.match('^ *Fin Mot-cl',l) : continue
+                if re.match('^ *D?but Mot-cl',l) : continue
+                if re.match('^ *Mot-cl',l) : continue
+                l=l.replace('!','')
+                if deb :
+                    deb=0
+                    t=l
+                else :
+                    t=t+'\n'+l
+            myToolTip=tr(t)
+        QToolTip.showText(event.globalPos(),myToolTip )
index a66db09045137079ccc655343a3aae9de7e96e73..646aab02cb1ee2d83c511d72c4b4b7de720e6203 100644 (file)
@@ -28,23 +28,22 @@ from Extensions.i18n import tr
 # Import des panels
 
 class MonChoixCata(Ui_DChoixCata,QDialog):
-  """
-  """
-  def __init__(self, QWparent, listeCata, title = None):
-      QDialog.__init__(self, QWparent)
-      self.setModal(True)
-      self.setupUi(self)
-      self.CBChoixCata.addItems(listeCata)
-      self.TLNb.setText(tr("%d versions du catalogue sont disponibles", len(listeCata)))
-      if title is not None:
-          self.setWindowTitle(tr(title))
-      self.buttonOk.clicked.connect(self.cataChoisi)
-      self.buttonCancel.clicked.connect(self.sortSansChoix)
+    """
+    """
+    def __init__(self, QWparent, listeCata, title = None):
+        QDialog.__init__(self, QWparent)
+        self.setModal(True)
+        self.setupUi(self)
+        self.CBChoixCata.addItems(listeCata)
+        self.TLNb.setText(tr("%d versions du catalogue sont disponibles", len(listeCata)))
+        if title is not None:
+            self.setWindowTitle(tr(title))
+        self.buttonOk.clicked.connect(self.cataChoisi)
+        self.buttonCancel.clicked.connect(self.sortSansChoix)
 
 
-  def sortSansChoix(self):
-      QDialog.reject(self)
-
-  def cataChoisi(self):
-      QDialog.accept(self)
+    def sortSansChoix(self):
+        QDialog.reject(self)
 
+    def cataChoisi(self):
+        QDialog.accept(self)
index 89b58ed5adae78db7f3cf1715515bd2bca2c6c38..bae07cf31f863ba7374023503e2e3551434cef75 100644 (file)
@@ -22,7 +22,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import os,sys,re
@@ -31,83 +31,83 @@ from PyQt5.QtWidgets import QDialog, QRadioButton, QGroupBox, QButtonGroup
 from PyQt5.QtGui import QPalette
 from PyQt5.QtCore import QProcess, QFileInfo, Qt, QSize
 
-    
+
 # Import des panels
 
 class MonChoixCode(Ui_ChoixCode,QDialog):
-  """
-  Classe definissant le panel associe aux mots-cles qui demandent
-  a l'utilisateur de choisir une seule valeur parmi une liste de valeurs
-  discretes
-  """
-  def __init__(self,  appliEficas=None):
-      QDialog.__init__(self,parent=appliEficas,flags=Qt.Window)
-      self.setModal(True)
-      self.setupUi(self)
-      self.appliEficas=appliEficas
-      self.verifieInstall()
-      self.code=None
-      self.buttonBox.accepted.disconnect(self.accept)
-      self.buttonBox.accepted.connect(self.choisitCode)
-     # self.pB_OK.clicked.connect(self.choisitCode)
-      #self.pB_cancel.clicked.connect(self.sortie)
+    """
+    Classe definissant le panel associe aux mots-cles qui demandent
+    a l'utilisateur de choisir une seule valeur parmi une liste de valeurs
+    discretes
+    """
+    def __init__(self,  appliEficas=None):
+        QDialog.__init__(self,parent=appliEficas,flags=Qt.Window)
+        self.setModal(True)
+        self.setupUi(self)
+        self.appliEficas=appliEficas
+        self.verifieInstall()
+        self.code=None
+        self.buttonBox.accepted.disconnect(self.accept)
+        self.buttonBox.accepted.connect(self.choisitCode)
+       # self.pB_OK.clicked.connect(self.choisitCode)
+        #self.pB_cancel.clicked.connect(self.sortie)
 
-  def sortie(self):
-      QDialog.reject(self)
+    def sortie(self):
+        QDialog.reject(self)
 
-  def verifieInstall(self):
-      self.groupCodes=QButtonGroup(self.groupBox)
-      vars=list(os.environ.items())
-      listeCode=('Adao','Carmel3D','CarmelCND','CF','MAP','MT','PSEN','PSEN_N1','Telemac','ZCracks',)
-      for code in listeCode:
-          dirCode=os.path.abspath(os.path.join(os.path.abspath(__file__),'../..',code))
-          try :
-             l=os.listdir(dirCode)
-             bouton=QRadioButton(self.groupBox)
-             bouton.setText(code)
-             self.groupCodes.addButton(bouton)
-             self.vlBouton.addWidget(bouton)
-          except :
-             clef="PREFS_CATA_"+code
-             try :
+    def verifieInstall(self):
+        self.groupCodes=QButtonGroup(self.groupBox)
+        vars=list(os.environ.items())
+        listeCode=('Adao','Carmel3D','CarmelCND','CF','MAP','MT','PSEN','PSEN_N1','Telemac','ZCracks',)
+        for code in listeCode:
+            dirCode=os.path.abspath(os.path.join(os.path.abspath(__file__),'../..',code))
+            try :
+                l=os.listdir(dirCode)
+                bouton=QRadioButton(self.groupBox)
+                bouton.setText(code)
+                self.groupCodes.addButton(bouton)
+                self.vlBouton.addWidget(bouton)
+            except :
+                clef="PREFS_CATA_"+code
+                try :
+                    repIntegrateur=os.path.abspath(os.environ[clef])
+                    l=os.listdir(repIntegrateur)
+                    bouton=QRadioButton(self.groupBox)
+                    bouton.setText(code)
+                    bouton.show()
+                    self.groupCodes.addButton(bouton)
+                except :
+                    pass
+        listeCodesIntegrateur=[]
+        for k,v in vars:
+            if re.search('^PREFS_CATA_',k) != None and k[11:] not in listeCode:
+                listeCodesIntegrateur.append(k[11:])
+        for code in listeCodesIntegrateur:
+            try :
+                clef="PREFS_CATA_"+code
                 repIntegrateur=os.path.abspath(os.environ[clef])
                 l=os.listdir(repIntegrateur)
-                bouton=QRadioButton(self.groupBox)
+                bouton=QRadioButton(self)
                 bouton.setText(code)
                 bouton.show()
                 self.groupCodes.addButton(bouton)
-             except :
+            except :
                 pass
-      listeCodesIntegrateur=[]
-      for k,v in vars:
-          if re.search('^PREFS_CATA_',k) != None and k[11:] not in listeCode:
-             listeCodesIntegrateur.append(k[11:])
-      for code in listeCodesIntegrateur:
-          try :
-              clef="PREFS_CATA_"+code
-              repIntegrateur=os.path.abspath(os.environ[clef])
-              l=os.listdir(repIntegrateur)
-              bouton=QRadioButton(self)
-              bouton.setText(code)
-              bouton.show()
-              self.groupCodes.addButton(bouton)
-          except :
-              pass
-      self.appliEficas.listeCode=self.appliEficas.listeCode+listeCodesIntegrateur
+        self.appliEficas.listeCode=self.appliEficas.listeCode+listeCodesIntegrateur
 
-  def choisitCode(self):
-      bouton=self.groupCodes.checkedButton()
-      if bouton==None : return
-      code=str(bouton.text())
-      codeUpper=code.upper()
-      self.appliEficas.code=codeUpper
-      try :
-          dirCode=os.path.abspath(os.path.join(os.path.abspath(__file__),'../..',code))
-          l=os.listdir(dirCode)
-          sys.path.insert(0,dirCode)
-      except :
-          clef="PREFS_CATA_"+code
-          repIntegrateur=os.path.abspath(os.environ[clef])
-          l=os.listdir(repIntegrateur)
-          sys.path.insert(0,repIntegrateur)
-      self.close()
+    def choisitCode(self):
+        bouton=self.groupCodes.checkedButton()
+        if bouton==None : return
+        code=str(bouton.text())
+        codeUpper=code.upper()
+        self.appliEficas.code=codeUpper
+        try :
+            dirCode=os.path.abspath(os.path.join(os.path.abspath(__file__),'../..',code))
+            l=os.listdir(dirCode)
+            sys.path.insert(0,dirCode)
+        except :
+            clef="PREFS_CATA_"+code
+            repIntegrateur=os.path.abspath(os.environ[clef])
+            l=os.listdir(repIntegrateur)
+            sys.path.insert(0,repIntegrateur)
+        self.close()
index bd0d8dbbb9b8aee13d229c97e16db3fbdec2fb19..bc0cebdaf5b107539c10c8d2646807ccf59d39f2 100644 (file)
@@ -21,7 +21,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 from desChoixCommandes import Ui_ChoixCommandes
@@ -32,322 +32,327 @@ from PyQt5.QtCore import QSize, QRect
 from Extensions.i18n import tr
 import os
 
-    
+
 # Import des panels
 
 class MonChoixCommande(Ui_ChoixCommandes,QWidget):
-  """
-  """
-  def __init__(self,node, jdc_item, editor):
-      QWidget.__init__(self,parent=None)
-      self.setupUi(self)
-
-      self.repIcon=os.path.join( os.path.dirname(os.path.abspath(__file__)),'..','Editeur','icons')
-      iconeFile=os.path.join(self.repIcon,'lettreRblanc30.png')
-      icon = QIcon(iconeFile)
-      self.RBRegle.setIcon(icon)
-      self.RBRegle.setIconSize(QSize(21, 31))
-
-      self.item = jdc_item
-      self.node = node
-      self.editor = editor
-      self.simpleClic=self.editor.maConfiguration.simpleClic
-      self.jdc  = self.item.object.getJdcRoot()
-      debutTitre=self.editor.titre
-      self.listeWidget=[]
-      self.dicoCmd={}
-      if self.editor.fichier != None : 
-          nouveauTitre=debutTitre+" "+os.path.basename(self.editor.fichier)
-      else :
-          nouveauTitre=debutTitre
-      self.editor.appliEficas.setWindowTitle(nouveauTitre)
-
-
-      self.RBalpha.clicked.connect(self.afficheAlpha)
-      self.RBGroupe.clicked.connect(self.afficheGroupe)
-      self.RBOrdre.clicked.connect(self.afficheOrdre)
-      self.RBClear.clicked.connect(self.clearFiltre)
-      self.RBCasse.toggled.connect(self.ajouteRadioButtons)
-      self.LEFiltre.returnPressed.connect(self.ajouteRadioButtons)
-      self.LEFiltre.textChanged.connect(self.ajouteRadioButtons)
-
-      if self.node.tree.item.getRegles() == () :
-         self.RBRegle.close()
-         self.labelRegle.close()
-      else : 
-        self.RBRegle.clicked.connect(self.afficheRegle)
-
-      if self.editor.readercata.Ordre_Des_Commandes == None : self.RBOrdre.close()
-
-       
-      #self.editor.labelCommentaire.setText("")
-      if self.editor.widgetOptionnel!= None : 
-         self.editor.fermeOptionnel()
-         self.editor.widgetOptionnel=None
-      self.name=None
-
-      self.boolAlpha=0
-      self.boolGroupe=0
-      self.boolOrdre=0
-      if self.editor.maConfiguration.affiche=="alpha"  : 
-         self.boolAlpha==1;  
-         self.RBalpha.setChecked(True);
-         self.afficheAlpha()
-      elif self.editor.maConfiguration.affiche=="groupe" : 
-         self.boolGroupe==1; 
-         self.RBGroupe.setChecked(True); 
-         self.afficheGroupe()
-      elif self.editor.maConfiguration.affiche=="ordre"  : 
-         self.boolOrdre==1;  
-         self.RBOrdre.setChecked(True);  
-         self.afficheOrdre()
-      if self.editor.maConfiguration.closeFrameRechercheCommandeSurPageDesCommandes == True : self.frameAffichage.close()
-
-      if self.editor.widgetTree != None : self.editor.restoreSplitterSizes(2) 
-      else: self.editor.restoreSplitterSizes(3)
-
-  def afficheRegle(self):
-      self.node.tree.appellebuildLBRegles()
-
-  def afficheAlpha(self):
-      self.boolAlpha=1
-      self.boolGroupe=0
-      self.boolOrdre=0
-      self.ajouteRadioButtons()
-
-  def afficheGroupe(self):
-      self.boolAlpha=0
-      self.boolGroupe=1
-      self.boolOrdre=0
-      self.ajouteRadioButtons()
-
-  def afficheOrdre(self):
-      self.boolAlpha=0
-      self.boolGroupe=0
-      self.boolOrdre=1
-      self.ajouteRadioButtons()
-
-  def insereNoeudApresClick(self,event):
-      #print self.editor.Classement_Commandes_Ds_Arbre
-      #if self.editor.Classement_Commandes_Ds_Arbre!= () : self.chercheOu()
-      #print ('dans insereNoeudApresClick')
-      nodeCourrant=self.node.tree.currentItem()
-      if nodeCourrant==None: nodeCourrant=self.node.tree.racine
-      if self.name != None :
-         plier=self.editor.maConfiguration.afficheCommandesPliees
-         if nodeCourrant==self.node : nouveau=self.node.appendChild(self.name,'first',plier)
-         else : nouveau=nodeCourrant.appendBrother(self.name,plier=plier)
-      else :
-         nouveau = 0
-      if nouveau == 0 : return # on n a pas insere le noeud
-      nouveau.setDeplie()
-      #if self.editor.afficheApresInsert==True : nouveau.plieToutEtReaffiche()
-      if self.editor.afficheApresInsert == True :
-           #if self.editor.affichePlie==True:  nouveau.plieToutEtReaffiche()
-           if self.editor.maConfiguration.afficheCommandesPliees ==True:  nouveau.plieToutEtReaffiche()
-           else : nouveau.deplieToutEtReaffiche()
-           nouveau.fenetre.donnePremier()
-           #nouveau.deplieToutEtReaffiche()
-      else :
-           self.node.setSelected(False)
-           nouveau.setSelected(True)
-           self.node.tree.setCurrentItem(nouveau)
-      if event != None : event.accept()
-      
-         
-
-  def creeListeCommande(self,filtre):
-      listeGroupes,dictGroupes=self.jdc.getGroups()
-      sensibleALaCasse=self.RBCasse.isChecked()
-      if "CACHE" in dictGroupes: aExclure=list(dictGroupes["CACHE"])
-      else: aExclure=()
-      listeACreer=[]
-      listeEtapesDejaPresentes=[]
-      if self.editor.maConfiguration.rendVisiblesLesCaches :
-         for e in self.jdc.etapes:
-            listeEtapesDejaPresentes.append(e.nom)
-         for c in aExclure :
-             if c not in listeEtapesDejaPresentes : aExclure.remove(c)
-      for l in self.jdc.getListeCmd():
-         if l not in aExclure : 
-            if sensibleALaCasse and (filtre != None and not filtre in l) : continue
-            if (not sensibleALaCasse) and filtre != None and (not filtre in l) and (not filtre.upper() in l) : continue
-            listeACreer.append(l)
-      return listeACreer
-
-  def ajouteRadioButtons(self):
-      if self.editor.maConfiguration.nombreDeBoutonParLigne != 0 :
-         self.ajoutePushButtons()
-         return
-      #print 'ds ajouteRadioButtons'
-      filtre=str(self.LEFiltre.text())
-      if filtre==str("") : filtre=None
-      if hasattr(self,'buttonGroup') :
-         for b in self.buttonGroup.buttons():
-             self.buttonGroup.removeButton(b)
-             b.setParent(None)
-             b.close()
-      else :
-         self.buttonGroup = QButtonGroup()
-      for w in self.listeWidget :
-         w.setParent(None)
-         w.close()
-      self.listeWidget=[]
-      if self.boolAlpha==1 :
-         liste=self.creeListeCommande(filtre)
-         for cmd in liste :
-           self.dicoCmd[tr(cmd)]=cmd
-           rbcmd=(QRadioButton(tr(cmd)))
-           self.buttonGroup.addButton(rbcmd)
-           self.commandesLayout.addWidget(rbcmd)
-           #if self.simpleClic :  rbcmd.mouseReleaseEvent=self.insereNoeudApresClick
-           #else : rbcmd.mouseDoubleClickEvent=self.insereNoeudApresClick
-           #self.buttonGroup.buttonClicked.connect(self.rbClique) 
-           if not(self.simpleClic ):  rbcmd.mouseDoubleClickEvent=self.insereNoeudApresClick
-         if self.simpleClic :  
-            self.buttonGroup.buttonClicked.connect(self.rbCliqueEtInsere) 
-         else :
-            self.buttonGroup.buttonClicked.connect(self.rbClique) 
-      elif  self.boolGroupe==1 :
-         listeGroupes,dictGroupes=self.jdc.getGroups()
-         for grp in listeGroupes:
-           if grp == "CACHE" : continue
-           label=QLabel(self)
-           text=tr('<html><head/><body><p><span style=\" font-weight:600;\">Groupe : '+tr(grp)+'</span></p></body></html>')
-           label.setText(text)
-           self.listeWidget.append(label)
-           aAjouter=1
-           sensibleALaCasse=self.RBCasse.isChecked()
-           for cmd in  dictGroupes[grp]:
-              if sensibleALaCasse and (filtre != None and not filtre in cmd) : continue
-              if (not sensibleALaCasse) and filtre != None and (not filtre in cmd) and (not filtre.upper() in cmd) : continue
-              if aAjouter == 1 :
-                 self.commandesLayout.addWidget(label)
-                 aAjouter=0
-              self.dicoCmd[tr(cmd)]=cmd
-              rbcmd=(QRadioButton(tr(cmd)))
-              self.buttonGroup.addButton(rbcmd)
-              self.commandesLayout.addWidget(rbcmd)
-              if not(self.simpleClic ):  rbcmd.mouseDoubleClickEvent=self.insereNoeudApresClick
-           if self.simpleClic :  
-             self.buttonGroup.buttonClicked.connect(self.rbCliqueEtInsere) 
-           else :
-             self.buttonGroup.buttonClicked.connect(self.rbClique) 
-           label2=QLabel(self)
-           label2.setText(" ")
-           self.listeWidget.append(label2)
-           self.commandesLayout.addWidget(label2)
-      elif  self.boolOrdre==1 :
-         listeFiltre=self.creeListeCommande(filtre)
-         liste=[]
-         if self.editor.readercata.Ordre_Des_Commandes == None : Ordre_Des_Commandes=listeFiltre
-         else : Ordre_Des_Commandes=self.editor.readercata.Ordre_Des_Commandes
-         for cmd in Ordre_Des_Commandes :
-            if cmd in listeFiltre :
-                 liste.append(cmd)
-         for cmd in liste :
-           self.dicoCmd[tr(cmd)]=cmd
-           rbcmd=(QRadioButton(tr(cmd)))
-           self.buttonGroup.addButton(rbcmd)
-           self.commandesLayout.addWidget(rbcmd)
-           if not(self.simpleClic ):  rbcmd.mouseDoubleClickEvent=self.insereNoeudApresClick
-         if self.simpleClic :  
-            self.buttonGroup.buttonClicked.connect(self.rbCliqueEtInsere) 
-         else :
-            self.buttonGroup.buttonClicked.connect(self.rbClique) 
-
-     
-
-  def ajoutePushButtons(self):
-      if hasattr(self,'buttonGroup') :
-         for b in self.buttonGroup.buttons():
-             self.buttonGroup.removeButton(b)
-             b.setParent(None)
-             b.close()
-      else :
-         self.buttonGroup = QButtonGroup()
-         self.buttonGroup.buttonClicked.connect(self.rbCliqueEtInsere) 
-      for w in self.listeWidget :
-         w.setParent(None)
-         w.close()
-      self.listeWidget=[]
-
-      if not hasattr(self,'maGrilleBouton') :
-         #self.commandesLayout.close()
-         self.maGrilleBouton=QGridLayout()
-         self.maGrilleBouton.setSpacing(20)
-         self.verticalLayout.addLayout(self.maGrilleBouton)
-      col=-1
-      ligne = 0
-
-      if self.boolAlpha==1 :
-         liste=self.creeListeCommande(None)
-      elif  self.boolOrdre:
-         liste=self.creeListeCommande(None)
-         listeFiltre=self.creeListeCommande(None)
-         liste=[]
-         if self.editor.readercata.Ordre_Des_Commandes == None : Ordre_Des_Commandes=listeFiltre
-         else : Ordre_Des_Commandes=self.editor.readercata.Ordre_Des_Commandes
-         for cmd in Ordre_Des_Commandes :
-            if cmd in listeFiltre :
-                 liste.append(cmd)
-      for cmd in liste :
-           col=col+1
-           if col == self.editor.maConfiguration.nombreDeBoutonParLigne :
-              col=0
-              ligne=ligne+1
-           self.dicoCmd[tr(cmd)]=cmd
-           rbcmd=QPushButton(tr(cmd))
-           rbcmd.setGeometry(QRect(40, 20, 211, 71))
-           rbcmd.setMaximumSize(QSize(250, 81))
-           rbcmd.setStyleSheet("background-color : rgb(66, 165, 238);\n"
+    """
+    """
+    def __init__(self,node, jdc_item, editor):
+        QWidget.__init__(self,parent=None)
+        self.setupUi(self)
+
+        self.repIcon=os.path.join( os.path.dirname(os.path.abspath(__file__)),'..','Editeur','icons')
+        iconeFile=os.path.join(self.repIcon,'lettreRblanc30.png')
+        icon = QIcon(iconeFile)
+        self.RBRegle.setIcon(icon)
+        self.RBRegle.setIconSize(QSize(21, 31))
+
+        self.item = jdc_item
+        self.node = node
+        self.editor = editor
+        self.simpleClic=self.editor.maConfiguration.simpleClic
+        self.jdc  = self.item.object.getJdcRoot()
+        debutTitre=self.editor.titre
+        self.listeWidget=[]
+        self.dicoCmd={}
+        if self.editor.fichier != None :
+            nouveauTitre=debutTitre+" "+os.path.basename(self.editor.fichier)
+        else :
+            nouveauTitre=debutTitre
+        self.editor.appliEficas.setWindowTitle(nouveauTitre)
+
+
+        self.RBalpha.clicked.connect(self.afficheAlpha)
+        self.RBGroupe.clicked.connect(self.afficheGroupe)
+        self.RBOrdre.clicked.connect(self.afficheOrdre)
+        self.RBClear.clicked.connect(self.clearFiltre)
+        self.RBCasse.toggled.connect(self.ajouteRadioButtons)
+        self.LEFiltre.returnPressed.connect(self.ajouteRadioButtons)
+        self.LEFiltre.textChanged.connect(self.ajouteRadioButtons)
+
+        if self.node.tree.item.getRegles() == () :
+            self.RBRegle.close()
+            self.labelRegle.close()
+        else :
+            self.RBRegle.clicked.connect(self.afficheRegle)
+
+        if self.editor.readercata.Ordre_Des_Commandes == None : self.RBOrdre.close()
+
+
+        #self.editor.labelCommentaire.setText("")
+        if self.editor.widgetOptionnel!= None :
+            self.editor.fermeOptionnel()
+            self.editor.widgetOptionnel=None
+        self.name=None
+
+        self.boolAlpha=0
+        self.boolGroupe=0
+        self.boolOrdre=0
+        if self.editor.maConfiguration.affiche=="alpha"  :
+            self.boolAlpha==1;
+            self.RBalpha.setChecked(True);
+            self.afficheAlpha()
+        elif self.editor.maConfiguration.affiche=="groupe" :
+            self.boolGroupe==1;
+            self.RBGroupe.setChecked(True);
+            self.afficheGroupe()
+        elif self.editor.maConfiguration.affiche=="ordre"  :
+            self.boolOrdre==1;
+            self.RBOrdre.setChecked(True);
+            self.afficheOrdre()
+        if self.editor.maConfiguration.closeFrameRechercheCommandeSurPageDesCommandes == True : self.frameAffichage.close()
+
+        if self.editor.widgetTree != None : self.editor.restoreSplitterSizes(2)
+        else: self.editor.restoreSplitterSizes(3)
+
+    def afficheRegle(self):
+        self.node.tree.appellebuildLBRegles()
+
+    def afficheAlpha(self):
+        self.boolAlpha=1
+        self.boolGroupe=0
+        self.boolOrdre=0
+        self.ajouteRadioButtons()
+
+    def afficheGroupe(self):
+        self.boolAlpha=0
+        self.boolGroupe=1
+        self.boolOrdre=0
+        self.ajouteRadioButtons()
+
+    def afficheOrdre(self):
+        self.boolAlpha=0
+        self.boolGroupe=0
+        self.boolOrdre=1
+        self.ajouteRadioButtons()
+
+    def insereNoeudApresClick(self,event):
+        #print self.editor.Classement_Commandes_Ds_Arbre
+        #if self.editor.Classement_Commandes_Ds_Arbre!= () : self.chercheOu()
+        #print ('dans insereNoeudApresClick')
+        nodeCourrant=self.node.tree.currentItem()
+        if nodeCourrant==None: nodeCourrant=self.node.tree.racine
+        if self.name != None :
+            plier=self.editor.maConfiguration.afficheCommandesPliees
+            if nodeCourrant==self.node : nouveau=self.node.appendChild(self.name,'first',plier)
+            else : nouveau=nodeCourrant.appendBrother(self.name,plier=plier)
+        else :
+            nouveau = 0
+        if nouveau == 0 : return # on n a pas insere le noeud
+        nouveau.setDeplie()
+        #if self.editor.afficheApresInsert==True : nouveau.plieToutEtReaffiche()
+        if self.editor.afficheApresInsert == True :
+            #if self.editor.affichePlie==True:  nouveau.plieToutEtReaffiche()
+            if self.editor.maConfiguration.afficheCommandesPliees ==True:  nouveau.plieToutEtReaffiche()
+            else : nouveau.deplieToutEtReaffiche()
+            nouveau.fenetre.donnePremier()
+            #nouveau.deplieToutEtReaffiche()
+        else :
+            self.node.setSelected(False)
+            nouveau.setSelected(True)
+            self.node.tree.setCurrentItem(nouveau)
+        if event != None : event.accept()
+
+
+
+    def creeListeCommande(self,filtre):
+        listeGroupes,dictGroupes=self.jdc.getGroups()
+        sensibleALaCasse=self.RBCasse.isChecked()
+        if "CACHE" in dictGroupes: aExclure=list(dictGroupes["CACHE"])
+        else: aExclure=[]
+        listeACreer=[]
+        listeEtapesDejaPresentes=[]
+        if self.editor.maConfiguration.rendVisiblesLesCaches :
+            for e in self.jdc.etapes:
+                listeEtapesDejaPresentes.append(e.nom)
+            for c in aExclure :
+                if c not in listeEtapesDejaPresentes : aExclure.remove(c)
+        #for e in self.jdc.etapes:
+        #    print (e.nom)
+        #    print (e.definition.repetable)
+        #    if e.definition.repetable == 'n' : aExclure.append(e.nom)
+        #print (aExclure)
+        for l in self.jdc.getListeCmd():
+            if l not in aExclure :
+                if sensibleALaCasse and (filtre != None and not filtre in l) : continue
+                if (not sensibleALaCasse) and filtre != None and (not filtre in l) and (not filtre.upper() in l) : continue
+                listeACreer.append(l)
+        return listeACreer
+
+    def ajouteRadioButtons(self):
+        if self.editor.maConfiguration.nombreDeBoutonParLigne != 0 :
+            self.ajoutePushButtons()
+            return
+        #print 'ds ajouteRadioButtons'
+        filtre=str(self.LEFiltre.text())
+        if filtre==str("") : filtre=None
+        if hasattr(self,'buttonGroup') :
+            for b in self.buttonGroup.buttons():
+                self.buttonGroup.removeButton(b)
+                b.setParent(None)
+                b.close()
+        else :
+            self.buttonGroup = QButtonGroup()
+        for w in self.listeWidget :
+            w.setParent(None)
+            w.close()
+        self.listeWidget=[]
+        if self.boolAlpha==1 :
+            liste=self.creeListeCommande(filtre)
+            for cmd in liste :
+                self.dicoCmd[tr(cmd)]=cmd
+                rbcmd=(QRadioButton(tr(cmd)))
+                self.buttonGroup.addButton(rbcmd)
+                self.commandesLayout.addWidget(rbcmd)
+                #if self.simpleClic :  rbcmd.mouseReleaseEvent=self.insereNoeudApresClick
+                #else : rbcmd.mouseDoubleClickEvent=self.insereNoeudApresClick
+                #self.buttonGroup.buttonClicked.connect(self.rbClique)
+                if not(self.simpleClic ):  rbcmd.mouseDoubleClickEvent=self.insereNoeudApresClick
+            if self.simpleClic :
+                self.buttonGroup.buttonClicked.connect(self.rbCliqueEtInsere)
+            else :
+                self.buttonGroup.buttonClicked.connect(self.rbClique)
+        elif  self.boolGroupe==1 :
+            listeGroupes,dictGroupes=self.jdc.getGroups()
+            for grp in listeGroupes:
+                if grp == "CACHE" : continue
+                label=QLabel(self)
+                text=tr('<html><head/><body><p><span style=\" font-weight:600;\">Groupe : '+tr(grp)+'</span></p></body></html>')
+                label.setText(text)
+                self.listeWidget.append(label)
+                aAjouter=1
+                sensibleALaCasse=self.RBCasse.isChecked()
+                for cmd in  dictGroupes[grp]:
+                    if sensibleALaCasse and (filtre != None and not filtre in cmd) : continue
+                    if (not sensibleALaCasse) and filtre != None and (not filtre in cmd) and (not filtre.upper() in cmd) : continue
+                    if aAjouter == 1 :
+                        self.commandesLayout.addWidget(label)
+                        aAjouter=0
+                    self.dicoCmd[tr(cmd)]=cmd
+                    rbcmd=(QRadioButton(tr(cmd)))
+                    self.buttonGroup.addButton(rbcmd)
+                    self.commandesLayout.addWidget(rbcmd)
+                    if not(self.simpleClic ):  rbcmd.mouseDoubleClickEvent=self.insereNoeudApresClick
+                if self.simpleClic :
+                    self.buttonGroup.buttonClicked.connect(self.rbCliqueEtInsere)
+                else :
+                    self.buttonGroup.buttonClicked.connect(self.rbClique)
+                label2=QLabel(self)
+                label2.setText(" ")
+                self.listeWidget.append(label2)
+                self.commandesLayout.addWidget(label2)
+        elif  self.boolOrdre==1 :
+            listeFiltre=self.creeListeCommande(filtre)
+            liste=[]
+            if self.editor.readercata.Ordre_Des_Commandes == None : Ordre_Des_Commandes=listeFiltre
+            else : Ordre_Des_Commandes=self.editor.readercata.Ordre_Des_Commandes
+            for cmd in Ordre_Des_Commandes :
+                if cmd in listeFiltre :
+                    liste.append(cmd)
+            for cmd in liste :
+                self.dicoCmd[tr(cmd)]=cmd
+                rbcmd=(QRadioButton(tr(cmd)))
+                self.buttonGroup.addButton(rbcmd)
+                self.commandesLayout.addWidget(rbcmd)
+                if not(self.simpleClic ):  rbcmd.mouseDoubleClickEvent=self.insereNoeudApresClick
+            if self.simpleClic :
+                self.buttonGroup.buttonClicked.connect(self.rbCliqueEtInsere)
+            else :
+                self.buttonGroup.buttonClicked.connect(self.rbClique)
+
+
+
+    def ajoutePushButtons(self):
+        if hasattr(self,'buttonGroup') :
+            for b in self.buttonGroup.buttons():
+                self.buttonGroup.removeButton(b)
+                b.setParent(None)
+                b.close()
+        else :
+            self.buttonGroup = QButtonGroup()
+            self.buttonGroup.buttonClicked.connect(self.rbCliqueEtInsere)
+        for w in self.listeWidget :
+            w.setParent(None)
+            w.close()
+        self.listeWidget=[]
+
+        if not hasattr(self,'maGrilleBouton') :
+            #self.commandesLayout.close()
+            self.maGrilleBouton=QGridLayout()
+            self.maGrilleBouton.setSpacing(20)
+            self.verticalLayout.addLayout(self.maGrilleBouton)
+        col=-1
+        ligne = 0
+
+        if self.boolAlpha==1 :
+            liste=self.creeListeCommande(None)
+        elif  self.boolOrdre:
+            liste=self.creeListeCommande(None)
+            listeFiltre=self.creeListeCommande(None)
+            liste=[]
+            if self.editor.readercata.Ordre_Des_Commandes == None : Ordre_Des_Commandes=listeFiltre
+            else : Ordre_Des_Commandes=self.editor.readercata.Ordre_Des_Commandes
+            for cmd in Ordre_Des_Commandes :
+                if cmd in listeFiltre :
+                    liste.append(cmd)
+        for cmd in liste :
+            col=col+1
+            if col == self.editor.maConfiguration.nombreDeBoutonParLigne :
+                col=0
+                ligne=ligne+1
+            self.dicoCmd[tr(cmd)]=cmd
+            rbcmd=QPushButton(tr(cmd))
+            rbcmd.setGeometry(QRect(40, 20, 211, 71))
+            rbcmd.setMaximumSize(QSize(250, 81))
+            rbcmd.setStyleSheet("background-color : rgb(66, 165, 238);\n"
 "/*border-style : outset;*/\n"
 "border-radius : 20px;\n"
 "border-width : 30 px;\n"
 "border-color : beige;\n"
 "text-align : center")
-           #print ('self.editor.maConfiguration.dicoImages', self.editor.maConfiguration.dicoImages)
-           if cmd in self.editor.maConfiguration.dicoImages :
-              fichier=self.editor.maConfiguration.dicoImages[cmd]
-              icon = QIcon()
-              icon.addPixmap(QPixmap(fichier), QIcon.Normal, QIcon.Off)
-              rbcmd.setIcon(icon)
-              rbcmd.setIconSize(QSize(48, 48))
-
-           self.buttonGroup.addButton(rbcmd)
-           self.maGrilleBouton.addWidget(rbcmd,ligne,col)
-
-  def clearFiltre(self):
-      self.LEFiltre.setText("")
-      self.ajouteRadioButtons()
-
-  def rbCliqueEtInsere(self,id):
-      self.rbClique(id)
-      self.insereNoeudApresClick(None)
-
-  def rbClique(self,id):
-      try : 
-        self.name=self.dicoCmd[id.text()]
-      except : 
+            #print ('self.editor.maConfiguration.dicoImages', self.editor.maConfiguration.dicoImages)
+            if cmd in self.editor.maConfiguration.dicoImages :
+                fichier=self.editor.maConfiguration.dicoImages[cmd]
+                icon = QIcon()
+                icon.addPixmap(QPixmap(fichier), QIcon.Normal, QIcon.Off)
+                rbcmd.setIcon(icon)
+                rbcmd.setIconSize(QSize(48, 48))
+
+            self.buttonGroup.addButton(rbcmd)
+            self.maGrilleBouton.addWidget(rbcmd,ligne,col)
+
+    def clearFiltre(self):
+        self.LEFiltre.setText("")
+        self.ajouteRadioButtons()
+
+    def rbCliqueEtInsere(self,id):
+        self.rbClique(id)
+        self.insereNoeudApresClick(None)
+
+    def rbClique(self,id):
+
         try :
-          self.name=self.dicoCmd[str(id.text())]
+            self.name=self.dicoCmd[id.text()]
         except :
-          print ('pb d accent : contacter la maintenance')
+            try :
+                self.name=self.dicoCmd[str(id.text())]
+            except :
+                print ('pb d accent : contacter la maintenance')
 
-      definitionEtape=getattr(self.jdc.cata,self.name)
-      #commentaire=getattr(definitionEtape,self.jdc.lang)
-      try :
-        commentaire=getattr(definitionEtape,self.jdc.lang)
-      except :
+        definitionEtape=getattr(self.jdc.cata,self.name)
+        #commentaire=getattr(definitionEtape,self.jdc.lang)
         try :
-           commentaire=getattr(definitionEtape,"ang")
+            commentaire=getattr(definitionEtape,self.jdc.lang)
         except :
-           commentaire=""
-      self.editor.afficheCommentaire(commentaire)
+            try :
+                commentaire=getattr(definitionEtape,"ang")
+            except :
+                commentaire=""
+        self.editor.afficheCommentaire(commentaire)
 
 
 
-  def setValide(self):
-      #PNPN a priori pas d icone mais peut-etre a faire
-      pass
+    def setValide(self):
+        #PNPN a priori pas d icone mais peut-etre a faire
+        pass
index 59c497e735c2373a045b7d24523cf9b5de28a2e4..ae217256b534666fe231172e48144f8ddfdf6a2c 100644 (file)
@@ -28,31 +28,30 @@ from PyQt5.QtWidgets import QDialog, QRadioButton, QGroupBox, QButtonGroup
 from PyQt5.QtGui import QPalette
 from PyQt5.QtCore import QProcess, QFileInfo, Qt, QSize
 
-    
+
 # Import des panels
 
 class MonChoixLangue(Ui_ChoixLangue,QDialog):
-  """
-  Classe definissant le panel associe aux mots-cles qui demandent
-  a l'utilisateur de choisir une seule valeur parmi une liste de valeurs
-  discretes
-  """
-  def __init__(self,  appliEficas=None):
-      QDialog.__init__(self,appliEficas)
-      self.setModal(True)
-      self.setupUi(self)
-      self.appliEficas=appliEficas
-      self.installLangue()
-      self.code=None
-      self.pB_OK.clicked.connect(self.choisitLangue)
-
-
-  def installLangue(self):
-      if self.appliEficas.langue == 'fr' : self.rbFrancais.setChecked(True)
-      else : self.rbEnglish.setChecked(True)
-
-  def choisitLangue(self):
-      if self.rbFrancais.isChecked() : self.appliEficas.langue='fr'
-      else                           : self.appliEficas.langue ='ang'
-      self.close()
-
+    """
+    Classe definissant le panel associe aux mots-cles qui demandent
+    a l'utilisateur de choisir une seule valeur parmi une liste de valeurs
+    discretes
+    """
+    def __init__(self,  appliEficas=None):
+        QDialog.__init__(self,appliEficas)
+        self.setModal(True)
+        self.setupUi(self)
+        self.appliEficas=appliEficas
+        self.installLangue()
+        self.code=None
+        self.pB_OK.clicked.connect(self.choisitLangue)
+
+
+    def installLangue(self):
+        if self.appliEficas.langue == 'fr' : self.rbFrancais.setChecked(True)
+        else : self.rbEnglish.setChecked(True)
+
+    def choisitLangue(self):
+        if self.rbFrancais.isChecked() : self.appliEficas.langue='fr'
+        else                           : self.appliEficas.langue ='ang'
+        self.close()
index 3bf95fe4682d60d5bc13c3dd5443b5ab8270131d..a5e0b371dd4f2f2cb3723d18f141ded77869c446 100644 (file)
@@ -20,8 +20,8 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 
 import types,os
@@ -40,28 +40,28 @@ class MonFonctionPanel(MonPlusieursBasePanel):
 #  Classe definissant le panel associee aux mots-cles qui demandent
 #  a l'utilisateur de choisir une seule valeur parmi une liste de valeurs
 #  discretes
-  def __init__(self,node, parent = None,name = None,fl = 0):
+    def __init__(self,node, parent = None,name = None,fl = 0):
         #print "MonFonctionPanel"
         self.node=node
         self.setNbValeurs()
         MonPlusieursBasePanel.__init__(self,node,parent,name,fl)
 
-  def setNbValeurs(self):
+    def setNbValeurs(self):
         self.nbValeurs = 1
         if self.node.item.waitTuple()== 1 :
-           for a in self.node.item.definition.type :
-               try :
-                   self.nbValeurs = a.ntuple
-                   break
-               except :
-                   pass
+            for a in self.node.item.definition.type :
+                try :
+                    self.nbValeurs = a.ntuple
+                    break
+                except :
+                    pass
         genea=self.node.item.getGenealogie()
         self.nbValeursASaisir=self.nbValeurs
         if "VALE" in genea: self.nbValeurs=2
         if "VALE_C" in genea: self.nbValeurs=3
 
 
-  def decoupeListeValeurs(self,liste):
+    def decoupeListeValeurs(self,liste):
         #decoupe la liste des valeurs en n ( les x puis les y)
         l_valeurs=[]
         if ((len(liste)% self.nbValeursASaisir != 0 and (len(liste)% self.nbValeurs))):
@@ -70,114 +70,114 @@ class MonFonctionPanel(MonPlusieursBasePanel):
         i=0
         while ( i < len(liste) ) :
             try :
-              t=tuple(liste[i:i+self.nbValeurs])
-              i=i+self.nbValeurs
+                t=tuple(liste[i:i+self.nbValeurs])
+                i=i+self.nbValeurs
             except:
-              t=tuple(liste[i:len(liste)])
+                t=tuple(liste[i:len(liste)])
             l_valeurs.append(t)
         return l_valeurs
 
-  def buildLBValeurs(self,listeValeurs=None):
+    def buildLBValeurs(self,listeValeurs=None):
         self.LBValeurs.clear()
         if listeValeurs== None :
-           listeValeurs=self.node.item.getListeValeurs()
+            listeValeurs=self.node.item.getListeValeurs()
         if self.node.item.waitTuple()== 1 :
-             listeATraiter=listeValeurs
-              for valeur in listeATraiter:
-                  str_valeur=str(valeur)
-                  self.LBValeurs.addItem(str_valeur)
-        else : 
-             for valeur in self.decoupeListeValeurs(listeValeurs):
-                   if type(valeur) == tuple:
-                       TupleEnTexte="("
-                       for val in valeur :
-                           TupleEnTexte = TupleEnTexte + str(self.politique.getValeurTexte(val)) +", "
-                       TupleEnTexte = TupleEnTexte[0:-2] +")"
-                       self.LBValeurs.addItem(TupleEnTexte)
-                   else :
-                       self.LBValeurs.addItem(str(valeur))
-
-
-  def  ajout1Valeur(self,liste=[]):
+            listeATraiter=listeValeurs
+            for valeur in listeATraiter:
+                str_valeur=str(valeur)
+                self.LBValeurs.addItem(str_valeur)
+        else :
+            for valeur in self.decoupeListeValeurs(listeValeurs):
+                if type(valeur) == tuple:
+                    TupleEnTexte="("
+                    for val in valeur :
+                        TupleEnTexte = TupleEnTexte + str(self.politique.getValeurTexte(val)) +", "
+                    TupleEnTexte = TupleEnTexte[0:-2] +")"
+                    self.LBValeurs.addItem(TupleEnTexte)
+                else :
+                    self.LBValeurs.addItem(str(valeur))
+
+
+    def  ajout1Valeur(self,liste=[]):
         # Pour etre appele a partir du Panel Importer (donc plusieurs fois par AjouterNValeur)
         validite=1
         if liste == [] :
-           if self.node.item.waitTuple()== 1 :
-              liste=SaisieValeur.TraiteLEValeurTuple(self)
-              if liste == [''] : return
-           else :
-              liste,validite=SaisieValeur.TraiteLEValeur(self)
-              if validite == 0 : return
+            if self.node.item.waitTuple()== 1 :
+                liste=SaisieValeur.TraiteLEValeurTuple(self)
+                if liste == [''] : return
+            else :
+                liste,validite=SaisieValeur.TraiteLEValeur(self)
+                if validite == 0 : return
         if liste ==[]    : return
 
         if (self.node.item.waitTuple()== 1 and len(liste) != self.nbValeurs):
-            commentaire  = str(liste) 
-            commentaire += tr(" n est pas un tuple de ") 
-            commentaire += str(self.nbValeursASaisir) 
+            commentaire  = str(liste)
+            commentaire += tr(" n est pas un tuple de ")
+            commentaire += str(self.nbValeursASaisir)
             commentaire += tr(" valeurs")
-           self.LEValeur.setText(str(liste))
+            self.LEValeur.setText(str(liste))
             self.editor.afficheInfos(commentaire,Qt.red)
             return
 
         if self.node.item.waitTuple()== 1 :
-              liste2=tuple(liste)
-              liste=liste2
+            liste2=tuple(liste)
+            liste=liste2
 
         index=self.LBValeurs.currentRow()
         if ((self.LBValeurs.isItemSelected(self.LBValeurs.item(index )) == 0) and (index > 0 )):
-           index=0
+            index=0
         else :
-           index=self.LBValeurs.currentRow() + 1
+            index=self.LBValeurs.currentRow() + 1
         indexListe=index*self.nbValeurs
         if index == 0 : indexListe=len(self.listeValeursCourantes)
 
         listeVal=[]
         for valeur in self.listeValeursCourantes :
-                listeVal.append(valeur)
+            listeVal.append(valeur)
         if self.node.item.waitTuple()== 1 :
-             indexListe = index
-             validite,comm,comm2,listeRetour=self.politique.ajoutTuple(liste,index,listeVal)
+            indexListe = index
+            validite,comm,comm2,listeRetour=self.politique.ajoutTuple(liste,index,listeVal)
         else :
-             validite,comm,comm2,listeRetour=self.politique.ajoutValeurs(liste,index,listeVal)
+            validite,comm,comm2,listeRetour=self.politique.ajoutValeurs(liste,index,listeVal)
         self.Commentaire.setText(tr(comm2))
         if not validite :
-                self.editor.afficheInfos(comm,Qt.red)
+            self.editor.afficheInfos(comm,Qt.red)
         else:
-           self.LEValeur.setText("")
-           l1=self.listeValeursCourantes[:indexListe]
-           l3=self.listeValeursCourantes[indexListe:]
-           if self.node.item.waitTuple()== 1 :
-             listeATraiter=listeRetour
-           else : 
-              listeATraiter=self.decoupeListeValeurs(listeRetour)
-           for valeur in  listeATraiter :
-               if type(valeur) == tuple:
-                  TupleEnTexte="("
-                  for val in valeur :
-                      TupleEnTexte = TupleEnTexte + str(self.politique.getValeurTexte(val)) +", "
-                  str_valeur = TupleEnTexte[0:-2] +")"
-               else :
-                  str_valeur=str(valeur)
-               self.LBValeurs.insertItem(index,str_valeur)
-               item=self.LBValeurs.item(index)
-               item.setSelected(1)
-               self.LBValeurs.setCurrentItem(item)
-               index=index+1
-           self.listeValeursCourantes=l1+listeRetour+l3
-           self.buildLBValeurs(self.listeValeursCourantes)
-
-
-  def ajoutNValeur(self,liste) :
+            self.LEValeur.setText("")
+            l1=self.listeValeursCourantes[:indexListe]
+            l3=self.listeValeursCourantes[indexListe:]
+            if self.node.item.waitTuple()== 1 :
+                listeATraiter=listeRetour
+            else :
+                listeATraiter=self.decoupeListeValeurs(listeRetour)
+            for valeur in  listeATraiter :
+                if type(valeur) == tuple:
+                    TupleEnTexte="("
+                    for val in valeur :
+                        TupleEnTexte = TupleEnTexte + str(self.politique.getValeurTexte(val)) +", "
+                    str_valeur = TupleEnTexte[0:-2] +")"
+                else :
+                    str_valeur=str(valeur)
+                self.LBValeurs.insertItem(index,str_valeur)
+                item=self.LBValeurs.item(index)
+                item.setSelected(1)
+                self.LBValeurs.setCurrentItem(item)
+                index=index+1
+            self.listeValeursCourantes=l1+listeRetour+l3
+            self.buildLBValeurs(self.listeValeursCourantes)
+
+
+    def ajoutNValeur(self,liste) :
         if len(liste)%self.nbValeurs != 0 :
-           texte="Nombre de valeur incorrecte"
-           #self.Commentaire.setText(texte)
-           self.editor.afficheInfos(texte,Qt.red)
-           return
+            texte="Nombre de valeur incorrecte"
+            #self.Commentaire.setText(texte)
+            self.editor.afficheInfos(texte,Qt.red)
+            return
         listeDecoupee=self.decoupeListeValeurs(liste)
         for vals in listeDecoupee :
             self.ajout1Valeur(vals)
-           
-  def sup1Valeur(self):
+
+    def sup1Valeur(self):
         index=self.LBValeurs.currentRow()
         if index == None : return
         removed_item = self.LBValeurs.takeItem(index)
@@ -189,14 +189,12 @@ class MonFonctionPanel(MonPlusieursBasePanel):
             indexAOter=index*self.nbValeurs + i
             indexInterdit.append(indexAOter)
         if self.node.item.waitTuple()== 1 :
-           indexInterdit=[index]
+            indexInterdit=[index]
 
         i=0
         for valeur in self.listeValeursCourantes :
-            if not (i in indexInterdit) : 
+            if not (i in indexInterdit) :
                 listeVal.append(valeur)
             i = i+1
         self.listeValeursCourantes=listeVal
         listeValeurs=self.listeValeursCourantes
-
-      
index cd64f1e59610ff26d38d96a40bb080793243f713..bb4b34e0acd0ccf8e485cbfa24738de4893080eb 100644 (file)
@@ -28,161 +28,160 @@ from Extensions.i18n    import tr
 from desGroupeOptionnel import Ui_groupeOptionnel
 from desPBOptionnelMT   import Ui_customPB
 
-    
+
 # Import des panels
 
 class MonRBButtonCustom(QCheckBox):
 
-   def __init__(self,texte,monOptionnel,parent=None,couleur=None):
-      QCheckBox.__init__(self,tr(texte),parent)
-      self.mousePressed=True
-      self.monOptionnel=monOptionnel
-      self.setToolTip(tr("clicker: affichage aide, double-click: ajout"))
-      if couleur != None :
-         mapalette=self.palette()
-         mapalette.setColor( QPalette.WindowText, couleur )
-         mapalette.setColor( QPalette.Base, Qt.green )
-         self.setPalette( mapalette );
-         self.setText(tr(texte))
-         try :
-           monToolTip=monOptionnel.parentMC.dictToolTipMc[texte]
-           self.setToolTip(monToolTip)
-         except :
-           pass
-
-
-   def mouseDoubleClickEvent(self, event):
-      #print "dans mouseDoubleClickEvent", self
-      if self not in self.monOptionnel.dicoCb: 
-         event.accept()
-         return
-      listeCheckedMC="+"+self.monOptionnel.dicoCb[self]
-      self.monOptionnel.parentMC.ajoutMC(listeCheckedMC)
-      event.accept()
-      
-
-   def mousePressEvent(self, event):
-      if not( event.button() != Qt.RightButton)  : 
-         event.accept()
-         return
-      if self.monOptionnel.cbPressed != None :
-         self.monOptionnel.cbPressed.setChecked(False)
-      self.monOptionnel.cbPressed=self
-      if self.mousePressed == False :
-         self.mousePressed=True
-      else :
-         self.mousePressed=False
-         self.ajoutAideMC()
-      QCheckBox.mousePressEvent(self, event)
-      event.accept()
-
-   def ajoutAideMC(self):
-      try :
-        maDefinition = self.monOptionnel.parentMC.definition.entites[self.texte]
-        maLangue =  self.monOptionnel.parentMC.jdc.lang
-        if hasattr(maDefinition,maLangue): 
-          self.monAide = getattr(maDefinition,self.monOptionnel.parentMC.jdc.lang)
-        else : 
-          self.monAide = ""
-      except :
-          self.monAide = ""
-      self.monOptionnel.parentMC.editor.afficheCommentaire(self.monAide)
-  
+    def __init__(self,texte,monOptionnel,parent=None,couleur=None):
+        QCheckBox.__init__(self,tr(texte),parent)
+        self.mousePressed=True
+        self.monOptionnel=monOptionnel
+        self.setToolTip(tr("clicker: affichage aide, double-click: ajout"))
+        if couleur != None :
+            mapalette=self.palette()
+            mapalette.setColor( QPalette.WindowText, couleur )
+            mapalette.setColor( QPalette.Base, Qt.green )
+            self.setPalette( mapalette );
+            self.setText(tr(texte))
+            try :
+                monToolTip=monOptionnel.parentMC.dictToolTipMc[texte]
+                self.setToolTip(monToolTip)
+            except :
+                pass
+
+
+    def mouseDoubleClickEvent(self, event):
+        #print "dans mouseDoubleClickEvent", self
+        if self not in self.monOptionnel.dicoCb:
+            event.accept()
+            return
+        listeCheckedMC="+"+self.monOptionnel.dicoCb[self]
+        self.monOptionnel.parentMC.ajoutMC(listeCheckedMC)
+        event.accept()
+
+
+    def mousePressEvent(self, event):
+        if not( event.button() != Qt.RightButton)  :
+            event.accept()
+            return
+        if self.monOptionnel.cbPressed != None :
+            self.monOptionnel.cbPressed.setChecked(False)
+        self.monOptionnel.cbPressed=self
+        if self.mousePressed == False :
+            self.mousePressed=True
+        else :
+            self.mousePressed=False
+            self.ajoutAideMC()
+        QCheckBox.mousePressEvent(self, event)
+        event.accept()
+
+    def ajoutAideMC(self):
+        try :
+            maDefinition = self.monOptionnel.parentMC.definition.entites[self.texte]
+            maLangue =  self.monOptionnel.parentMC.jdc.lang
+            if hasattr(maDefinition,maLangue):
+                self.monAide = getattr(maDefinition,self.monOptionnel.parentMC.jdc.lang)
+            else :
+                self.monAide = ""
+        except :
+            self.monAide = ""
+        self.monOptionnel.parentMC.editor.afficheCommentaire(self.monAide)
+
 class MonPBButtonCustom(QWidget,Ui_customPB):
 
-   def __init__(self,texte,monOptionnel,parent=None,couleur=None):
-      QWidget.__init__(self)
-      self.setupUi(self)
-      if couleur != None :
-         self.monPb.setText(texte)
-         self.monPb.setStyleSheet('QPushButton {background-color: #A3C1DA; color: red;}')
-         #mapalette=self.monPb.palette()
-         #mapalette.setColor( QPalette.ButtonText, Qt.red )
-         #self.monPb.setPalette( mapalette )
-         self.monPb.update()
-         #self.update()
-         try :
-           monToolTip=monOptionnel.parentMC.dictToolTipMc[texte]
-           self.monPb.setToolTip(monToolTip)
-         except :
-           pass
-      self.monPb.setText(texte)
-      self.monPb.clicked.connect(self.ajoutMC)
-
-      self.texte=texte
-      self.monOptionnel=monOptionnel
-      self.definitAideMC()
-      self.setToolTip(self.monAide)
-
-   def ajoutMC (self) :
-      listeCheckedMC="+"+self.monOptionnel.dicoCb[self]
-      self.monOptionnel.parentMC.ajoutMC(listeCheckedMC)
-
-   def definitAideMC(self):
-      try :
-        maDefinition = self.monOptionnel.parentMC.definition.entites[self.texte]
-        maLangue =  self.monOptionnel.parentMC.jdc.lang
-        if hasattr(maDefinition,maLangue): 
-          self.monAide = getattr(maDefinition,self.monOptionnel.parentMC.jdc.lang)
-      except :
-          self.monAide = ""
-        
-class MonGroupeOptionnel (QWidget,Ui_groupeOptionnel):
-  """
-  """
-  def __init__(self,liste,liste_rouge,parentQt,parentMC):
-     #print ("dans init de monWidgetOptionnel ", parentQt, liste,parentMC)
-     QWidget.__init__(self,None)
-     self.setupUi(self)
-     self.listeChecked=[]
-     self.dicoCb={}
-     self.mousePressed=False
-     self.cbPressed=None
-     self.cb=None
-     self.parentQt=parentQt
-     self.parentMC=parentMC
-     
-
-     if liste != [] : 
-        self.affiche(liste,liste_rouge)
-        self.afficheTitre()
-     elif self.parentQt.parentQt.maConfiguration.afficheOptionnelVide != False : 
-        self.afficheTitre()
-        self.MCOptionnelLayout.insertWidget(0,QLabel(tr('Pas de MC Optionnel')))
-     else :
-        self.frameLabelMC.close()
-     #print "dans fin de monWidgetOptionnel ", parentQt
-
-
-  def afficheTitre(self):
-     labeltext,fonte,couleur = self.parentMC.node.item.getLabelText()
-     #print (labeltext)
-     l=tr(labeltext)
-     li=[]
-     while len(l) > 25:
-         li.append(l[0:24])
-         l=l[24:]
-     li.append(l)
-     texte=""
-     for l in li : texte+=l+"\n"
-     texte=texte[0:-1]
-     self.MCLabel.setText(texte)
-
-  def affiche(self,liste,liste_rouge):
-     #print ("dans Optionnel ____ affiche", liste,liste_rouge)
-     self.dicoCb={}
-     liste.reverse()
-     for mot in liste :
-         #if mot in liste_rouge : print ('je dois afficher en rouge' , mot)
-         couleur=None
-         if mot in liste_rouge : couleur=Qt.red 
-         if self.parentQt.parentQt.maConfiguration.simpleClic == False :
-            cb = MonRBButtonCustom(mot,self,couleur=couleur)
-            cb.clicked.connect(cb.ajoutAideMC)
-         else :
-            cb = MonPBButtonCustom(mot,self,couleur=couleur)
-
-         self.MCOptionnelLayout.insertWidget(0,cb)
-         self.dicoCb[cb]=mot
-     self.scrollAreaCommandesOptionnelles.horizontalScrollBar().setSliderPosition(0)
+    def __init__(self,texte,monOptionnel,parent=None,couleur=None):
+        QWidget.__init__(self)
+        self.setupUi(self)
+        if couleur != None :
+            self.monPb.setText(texte)
+            self.monPb.setStyleSheet('QPushButton {background-color: #A3C1DA; color: red;}')
+            #mapalette=self.monPb.palette()
+            #mapalette.setColor( QPalette.ButtonText, Qt.red )
+            #self.monPb.setPalette( mapalette )
+            self.monPb.update()
+            #self.update()
+            try :
+                monToolTip=monOptionnel.parentMC.dictToolTipMc[texte]
+                self.monPb.setToolTip(monToolTip)
+            except :
+                pass
+        self.monPb.setText(texte)
+        self.monPb.clicked.connect(self.ajoutMC)
+
+        self.texte=texte
+        self.monOptionnel=monOptionnel
+        self.definitAideMC()
+        self.setToolTip(self.monAide)
+
+    def ajoutMC (self) :
+        listeCheckedMC="+"+self.monOptionnel.dicoCb[self]
+        self.monOptionnel.parentMC.ajoutMC(listeCheckedMC)
+
+    def definitAideMC(self):
+        try :
+            maDefinition = self.monOptionnel.parentMC.definition.entites[self.texte]
+            maLangue =  self.monOptionnel.parentMC.jdc.lang
+            if hasattr(maDefinition,maLangue):
+                self.monAide = getattr(maDefinition,self.monOptionnel.parentMC.jdc.lang)
+        except :
+            self.monAide = ""
 
+class MonGroupeOptionnel (QWidget,Ui_groupeOptionnel):
+    """
+    """
+    def __init__(self,liste,liste_rouge,parentQt,parentMC):
+        #print ("dans init de monWidgetOptionnel ", parentQt, liste,parentMC)
+        QWidget.__init__(self,None)
+        self.setupUi(self)
+        self.listeChecked=[]
+        self.dicoCb={}
+        self.mousePressed=False
+        self.cbPressed=None
+        self.cb=None
+        self.parentQt=parentQt
+        self.parentMC=parentMC
+
+
+        if liste != [] :
+            self.affiche(liste,liste_rouge)
+            self.afficheTitre()
+        elif self.parentQt.parentQt.maConfiguration.afficheOptionnelVide != False :
+            self.afficheTitre()
+            self.MCOptionnelLayout.insertWidget(0,QLabel(tr('Pas de MC Optionnel')))
+        else :
+            self.frameLabelMC.close()
+        #print "dans fin de monWidgetOptionnel ", parentQt
+
+
+    def afficheTitre(self):
+        labeltext,fonte,couleur = self.parentMC.node.item.getLabelText()
+        #print (labeltext)
+        l=tr(labeltext)
+        li=[]
+        while len(l) > 25:
+            li.append(l[0:24])
+            l=l[24:]
+        li.append(l)
+        texte=""
+        for l in li : texte+=l+"\n"
+        texte=texte[0:-1]
+        self.MCLabel.setText(texte)
+
+    def affiche(self,liste,liste_rouge):
+        #print ("dans Optionnel ____ affiche", liste,liste_rouge)
+        self.dicoCb={}
+        liste.reverse()
+        for mot in liste :
+            #if mot in liste_rouge : print ('je dois afficher en rouge' , mot)
+            couleur=None
+            if mot in liste_rouge : couleur=Qt.red
+            if self.parentQt.parentQt.maConfiguration.simpleClic == False :
+                cb = MonRBButtonCustom(mot,self,couleur=couleur)
+                cb.clicked.connect(cb.ajoutAideMC)
+            else :
+                cb = MonPBButtonCustom(mot,self,couleur=couleur)
+
+            self.MCOptionnelLayout.insertWidget(0,cb)
+            self.dicoCb[cb]=mot
+        self.scrollAreaCommandesOptionnelles.horizontalScrollBar().setSliderPosition(0)
index 90f30c9eed2c57a46374fea3e3180e21903648da..9e998cb8e36f1a7657760ca9ab5399b45e34ed4a 100644 (file)
@@ -33,20 +33,19 @@ from Extensions.i18n import tr
 
 class MonLabelClic(QLabel) :
 
-     def __init__(self,parent):
+    def __init__(self,parent):
         QLabel.__init__(self,parent)
-        # Pas propre mais impossible de faire fonctionner isinstance sur Groupe, MonWidgetCommande 
+        # Pas propre mais impossible de faire fonctionner isinstance sur Groupe, MonWidgetCommande
         # PNPNPN ? a ameliorer
         if isinstance (parent,QFrame): parent=parent.parent()
         while not( hasattr(parent,'traiteClicSurLabel')) :
-             try : parent=parent.parent()
-             except : print ("pb avec MonLabelClic"); break
+            try : parent=parent.parent()
+            except : print ("pb avec MonLabelClic"); break
         self.parent=parent
 
 
-     def event(self,event) :
-         if event.type() == QEvent.MouseButtonRelease:
+    def event(self,event) :
+        if event.type() == QEvent.MouseButtonRelease:
             self.texte=self.text()
             self.parent.traiteClicSurLabel(self.texte)
-         return QLabel.event(self,event)
-
+        return QLabel.event(self,event)
index 1a9471bdca7c6af35564de6e4fafd3ceda9115ab..441710dbd165e6269d6888c1ccb1f57fc75a63da 100644 (file)
@@ -21,7 +21,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 from PyQt5.QtWidgets import  QButtonGroup, QToolButton
@@ -34,34 +34,32 @@ class MonLayoutBouton :
 #----------------------
 
 #  -------------------------------
-   def __init__(self,appliEficas):
+    def __init__(self,appliEficas):
 #  -------------------------------
 
-      self.appliEficas = appliEficas
-      self.buttonGroup = QButtonGroup()
-    
-      for etape in self.appliEficas.readercata.cata.JdC.commandes :
-        nomEtape = etape.nom
-        toolButton = QToolButton(self.appliEficas.toolBarCommande)
-        icon = QIcon()
-        if nomEtape in self.appliEficas.maConfiguration.dicoIcones:
-             fichier = self.appliEficas.maConfiguration.dicoIcones[nomEtape]
-             icon.addPixmap(QPixmap(fichier), QIcon.Normal, QIcon.Off)
-             toolButton.setIcon(icon)
-        else :
-             try :    label = nomEtape[0:3]
-             except : label = nomEtape
-             toolButton.setText(label)
+        self.appliEficas = appliEficas
+        self.buttonGroup = QButtonGroup()
 
-        action = self.appliEficas.toolBarCommande.addWidget(toolButton)
-        action.setVisible(True)
-        toolButton.setObjectName(nomEtape)
-        toolButton.setToolTip(tr(nomEtape))
-        self.buttonGroup.addButton(toolButton)
+        for etape in self.appliEficas.readercata.cata.JdC.commandes :
+            nomEtape = etape.nom
+            toolButton = QToolButton(self.appliEficas.toolBarCommande)
+            icon = QIcon()
+            if nomEtape in self.appliEficas.maConfiguration.dicoIcones:
+                fichier = self.appliEficas.maConfiguration.dicoIcones[nomEtape]
+                icon.addPixmap(QPixmap(fichier), QIcon.Normal, QIcon.Off)
+                toolButton.setIcon(icon)
+            else :
+                try :    label = nomEtape[0:3]
+                except : label = nomEtape
+                toolButton.setText(label)
 
-      self.buttonGroup.buttonClicked.connect(self.rbCliqueEtInsere)
-
-   def rbCliqueEtInsere(self,id):
-        self.appliEficas.handleAjoutEtape(id.objectName()) 
+            action = self.appliEficas.toolBarCommande.addWidget(toolButton)
+            action.setVisible(True)
+            toolButton.setObjectName(nomEtape)
+            toolButton.setToolTip(tr(nomEtape))
+            self.buttonGroup.addButton(toolButton)
 
+        self.buttonGroup.buttonClicked.connect(self.rbCliqueEtInsere)
 
+    def rbCliqueEtInsere(self,id):
+        self.appliEficas.handleAjoutEtape(id.objectName())
index dd73054d1228742f2faf1354c2066d2e1646f22c..4e597c91c307ab4a727fdcda5b3ac22e10a5662e 100644 (file)
@@ -29,36 +29,35 @@ from PyQt5.QtCore import Qt
 # Import des panels
 
 class DRecherche(Ui_desRecherche ,QDialog):
-  """
-  """
-  def __init__(self,parent = None , name = None,fl = 0):
-      QDialog.__init__(self,parent)
-      self.parentQT=parent
-      self.tree=self.parentQT.tree
-      self.setupUi(self)
-      self.PBSuivant.setDefault(True)
-      self.PBSuivant.setAutoDefault(False)
-      self.PBSuivant.clicked.connect( self.suivantClicked)
-      self.LERecherche.returnPressed.connect(self.recherche)
-      self.surLigne=0
-      self.listeTrouvee=()
-      self.nodeSurligne=None
+    """
+    """
+    def __init__(self,parent = None , name = None,fl = 0):
+        QDialog.__init__(self,parent)
+        self.parentQT=parent
+        self.tree=self.parentQT.tree
+        self.setupUi(self)
+        self.PBSuivant.setDefault(True)
+        self.PBSuivant.setAutoDefault(False)
+        self.PBSuivant.clicked.connect( self.suivantClicked)
+        self.LERecherche.returnPressed.connect(self.recherche)
+        self.surLigne=0
+        self.listeTrouvee=()
+        self.nodeSurligne=None
 
-  def suivantClicked(self):
-      #if self.motAChercher!=self.LERecherche.text(): self.recherche()
-      if self.listeTrouvee=={} : return
-      if self.surLigne > len(self.listeTrouvee) -1 : return
-      if self.nodeSurligne!=None : self.nodeSurligne.updateNodeTexteInBlack()
-      #self.listeTrouvee[self.surLigne].updateNodeTexteInBlue()
-      #self.nodeSurligne=self.listeTrouvee[self.surLigne]
-      self.listeTrouvee[self.surLigne].select()
-      self.listeTrouvee[self.surLigne].affichePanneau()
-      self.surLigne=self.surLigne+1
-      self.PBSuivant.setFocus()
-      if self.surLigne == len(self.listeTrouvee): self.surLigne=0
-
-  def recherche(self):
-      self.motAChercher=self.LERecherche.text()
-      self.listeTrouvee=self.tree.findItems(self.motAChercher,Qt.MatchContains|Qt.MatchRecursive,0)
-      self.surLigne=0
+    def suivantClicked(self):
+        #if self.motAChercher!=self.LERecherche.text(): self.recherche()
+        if self.listeTrouvee=={} : return
+        if self.surLigne > len(self.listeTrouvee) -1 : return
+        if self.nodeSurligne!=None : self.nodeSurligne.updateNodeTexteInBlack()
+        #self.listeTrouvee[self.surLigne].updateNodeTexteInBlue()
+        #self.nodeSurligne=self.listeTrouvee[self.surLigne]
+        self.listeTrouvee[self.surLigne].select()
+        self.listeTrouvee[self.surLigne].affichePanneau()
+        self.surLigne=self.surLigne+1
+        self.PBSuivant.setFocus()
+        if self.surLigne == len(self.listeTrouvee): self.surLigne=0
 
+    def recherche(self):
+        self.motAChercher=self.LERecherche.text()
+        self.listeTrouvee=self.tree.findItems(self.motAChercher,Qt.MatchContains|Qt.MatchRecursive,1)
+        self.surLigne=0
index b8b57cdd5a35c848c569b0976cc62e56abd62709..825db5515599f3f59f124f3ee9b770966946c4f2 100644 (file)
@@ -22,7 +22,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 from desRechercheCatalogue import Ui_desRechercheCatalogue
@@ -34,54 +34,53 @@ from Extensions.i18n import tr
 # Import des panels
 
 class DRechercheCatalogue (Ui_desRechercheCatalogue ,QDialog):
-  """
-  """
-  def __init__(self,parent,editor ):
-      QDialog.__init__(self,parent)
-      #self.setModal(True)
-      self.setupUi(self)
-      self.editor=editor
-      self.CBRecherche.setEditable(True)
-      self.CBRecherche.lineEdit().returnPressed.connect(self.rechercheCB)
-      self.CBRecherche.currentIndexChanged.connect(self.rechercheCB)
-      self.CBRecherche.currentTextChanged.connect(self.rechercheCB)
+    """
+    """
+    def __init__(self,parent,editor ):
+        QDialog.__init__(self,parent)
+        #self.setModal(True)
+        self.setupUi(self)
+        self.editor=editor
+        self.CBRecherche.setEditable(True)
+        self.CBRecherche.lineEdit().returnPressed.connect(self.rechercheCB)
+        self.CBRecherche.currentIndexChanged.connect(self.rechercheCB)
+        self.CBRecherche.currentTextChanged.connect(self.rechercheCB)
 
-      self.initRecherche()
+        self.initRecherche()
 
-  def initRecherche(self):
-      listeChoix=list(self.editor.readercata.dicoInverse.keys())
-      self.CBRecherche.addItem("")
-      for choix in listeChoix:
-          self.CBRecherche.addItem(choix)
-      monCompleteur=QCompleter(listeChoix,self)
-      monCompleteur.setCompletionMode(QCompleter.PopupCompletion)
-      self.CBRecherche.setCompleter(monCompleteur)
+    def initRecherche(self):
+        listeChoix=list(self.editor.readercata.dicoInverse.keys())
+        self.CBRecherche.addItem("")
+        for choix in listeChoix:
+            self.CBRecherche.addItem(choix)
+        monCompleteur=QCompleter(listeChoix,self)
+        monCompleteur.setCompletionMode(QCompleter.PopupCompletion)
+        self.CBRecherche.setCompleter(monCompleteur)
 
 
-  def rechercheCB(self):
-      motAChercher=self.CBRecherche.lineEdit().text()
-      self.recherche(motAChercher)
+    def rechercheCB(self):
+        motAChercher=self.CBRecherche.lineEdit().text()
+        self.recherche(motAChercher)
 
 
-  def recherche(self,motAChercher):
-      if str(motAChercher)=="" or str(motAChercher) == None : return
-      if str(motAChercher) not in self.editor.readercata.dicoInverse:return
-      try :
-      #if 1  :
-        genea= self.editor.readercata.dicoInverse[str(motAChercher)]
-        listeGenea=[]
-        for t in genea : listeGenea.append(t[0])
-        listeGenea.reverse()
-        texte=''
-        i=0
-        for mc in listeGenea :
-         ligne = i*'   '+str(mc) + ' / '+tr(str(mc))+'\n' 
-         i=i+1
-         texte += ligne
-        self.teGenea.setText(texte)
-        self.teDoc.setText(getattr(genea[0][1],self.editor.appliEficas.langue))
-        
-        
-      except :
-        pass
+    def recherche(self,motAChercher):
+        if str(motAChercher)=="" or str(motAChercher) == None : return
+        if str(motAChercher) not in self.editor.readercata.dicoInverse:return
+        try :
+        #if 1  :
+            genea= self.editor.readercata.dicoInverse[str(motAChercher)]
+            listeGenea=[]
+            for t in genea : listeGenea.append(t[0])
+            listeGenea.reverse()
+            texte=''
+            i=0
+            for mc in listeGenea :
+                ligne = i*'   '+str(mc) + ' / '+tr(str(mc))+'\n'
+                i=i+1
+                texte += ligne
+            self.teGenea.setText(texte)
+            self.teDoc.setText(getattr(genea[0][1],self.editor.appliEficas.langue))
 
+
+        except :
+            pass
index 0683c6794a2be04b45398f7a929c1f898b3e8413..e3cb4a87f14f24dda224c93b138c255d9717337d 100644 (file)
@@ -22,7 +22,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 from desSelectVal import Ui_DSelVal
@@ -33,17 +33,17 @@ from PyQt5.QtCore import QTimer, Qt
 from PyQt5.QtGui import QPalette
 
 class DSelVal(Ui_DSelVal,QDialog):
-   def __init__(self,parent ,modal ) :
-       QDialog.__init__(self,parent)
-       self.setupUi(self)
+    def __init__(self,parent ,modal ) :
+        QDialog.__init__(self,parent)
+        self.setupUi(self)
 
 class MonSelectVal(DSelVal):
-  """
-  Classe definissant le panel associe aux mots-cles qui demandent
-  a l'utilisateur de choisir une seule valeur parmi une liste de valeurs
-  discretes
-  """
-  def __init__(self,file,parent,name = None,fl = 0):
+    """
+    Classe definissant le panel associe aux mots-cles qui demandent
+    a l'utilisateur de choisir une seule valeur parmi une liste de valeurs
+    discretes
+    """
+    def __init__(self,file,parent,name = None,fl = 0):
         #print "MonSelectVal"
         self.parent=parent
         DSelVal.__init__(self,parent,0)
@@ -55,7 +55,7 @@ class MonSelectVal(DSelVal):
         self.initVal()
         self.connecterSignaux()
 
-  def connecterSignaux(self) :
+    def connecterSignaux(self) :
         self.Bespace.clicked.connect(self.selectEsp)
         self.BpointVirgule.clicked.connect(self.selectPoint)
         self.Bvirgule.clicked.connect(self.selectVir)
@@ -63,7 +63,7 @@ class MonSelectVal(DSelVal):
         self.BImportTout.clicked.connect(self.BImportToutPressed)
         self.parent.editor.sb.messageChanged.connect(self.messageAChanger)
 
-  def connecterSignauxQT4(self) :
+    def connecterSignauxQT4(self) :
         self.connect(self.Bespace,SIGNAL("clicked()"),self.selectEsp)
         self.connect(self.BpointVirgule,SIGNAL("clicked()"),self.selectPoint)
         self.connect(self.Bvirgule,SIGNAL("clicked()"),self.selectVir)
@@ -71,66 +71,65 @@ class MonSelectVal(DSelVal):
         self.connect(self.BImportTout,SIGNAL("clicked()"),self.BImportToutPressed)
         self.connect(self.parent.editor.sb,SIGNAL("messageChanged(QString)"),self.messageAChanger)
 
-  def messageAChanger(self):
-      message=self.parent.editor.sb.currentMessage()
-      mapalette=self.sb.palette()
-      mapalette.setColor( QPalette.Text,Qt.red )
-      self.sb.setPalette( mapalette )
-      self.sb.setText(message)
-      QTimer.singleShot(3000, self.efface)
-      
-  def efface(self):
-      self.sb.setText("")
-
-  def readVal(self):
+    def messageAChanger(self):
+        message=self.parent.editor.sb.currentMessage()
+        mapalette=self.sb.palette()
+        mapalette.setColor( QPalette.Text,Qt.red )
+        self.sb.setPalette( mapalette )
+        self.sb.setText(message)
+        QTimer.singleShot(3000, self.efface)
+
+    def efface(self):
+        self.sb.setText("")
+
+    def readVal(self):
         if self.file == "" : return
         try :
-          f = open(self.file, "r")
-          self.texte = f.read()
-          f.close()
+            f = open(self.file, "r")
+            self.texte = f.read()
+            f.close()
         except :
-          QMessageBox.warning( self,tr( "Fichier Indisponible"),tr( "Lecture impossible"))
-          self.texte=""
-          return
+            QMessageBox.warning( self,tr( "Fichier Indisponible"),tr( "Lecture impossible"))
+            self.texte=""
+            return
 
-  def initVal(self):
+    def initVal(self):
         self.TBtext.clear()
         self.TBtext.setText(self.texte)
 
-  def selectEsp(self):
+    def selectEsp(self):
         self.separateur=" "
-        
-  def selectVir(self):
+
+    def selectVir(self):
         self.separateur=","
-        
-  def selectPoint(self):
+
+    def selectPoint(self):
         self.separateur=";"
-        
-  def BImportSelPressed(self):
+
+    def BImportSelPressed(self):
 
         texte = self.TBtext.textCursor().selectedText()
         textTraite=texte.replace(u'\u2029',"\n")
         self.textTraite=str(textTraite)
         self.traitement()
-        
-  def BImportToutPressed(self):
+
+    def BImportToutPressed(self):
         self.textTraite=self.texte
         self.traitement()
 
-  def traitement(self):
+    def traitement(self):
         if self.textTraite == "" : return
         if self.textTraite[-1]=="\n" : self.textTraite=self.textTraite[0:-1]
         self.textTraite=self.textTraite.replace("\n",self.separateur)
         liste1=self.textTraite.split(self.separateur)
         liste=[]
         for val in liste1 :
-          if val != '' and val != ' ' and val != self.separateur :
-            val=str(val)
-            try :
-            #if 1 :
-               val2=eval(val,{})
-               liste.append(val2)
-            except :
-              pass
-        self.parent.ajoutNValeur(liste) 
-        
+            if val != '' and val != ' ' and val != self.separateur :
+                val=str(val)
+                try :
+                #if 1 :
+                    val2=eval(val,{})
+                    liste.append(val2)
+                except :
+                    pass
+        self.parent.ajoutNValeur(liste)
index a144a682f83dbbfbbcdcc640141559a9e558a5c0..b84d66401541ac2fec8be9795d5198417f5deb2e 100644 (file)
@@ -41,14 +41,11 @@ class ViewRegles(Ui_viewRegles,QDialog):
 
         if entete != None : self.setWindowTitle (entete)
         for ligne in liste :
-          texte=ligne[0]
-          couleur=ligne[1]
-          if couleur==Qt.black :
-             self.LBRegles.addItem(texte)
-          else :
-             monItem=QListWidgetItem(texte)
-             monItem.setForeground(Qt.red)
-             self.LBRegles.addItem(monItem)
-
-
-        
+            texte=ligne[0]
+            couleur=ligne[1]
+            if couleur==Qt.black :
+                self.LBRegles.addItem(texte)
+            else :
+                monItem=QListWidgetItem(texte)
+                monItem.setForeground(Qt.red)
+                self.LBRegles.addItem(monItem)
index 3a82aff10edf1e0e38b7ff9454fefda9274f443a..d16903b85374a1d1d7f8aa87a005405c8dcf76ad 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os
@@ -50,16 +50,16 @@ class ViewText(Ui_dView,QDialog):
         if entete != None : self.setWindowTitle (entete)
         if entete != None : self.setText (texte)
 
-        
-    def setText(self, txt ):    
+
+    def setText(self, txt ):
         self.view.setText(txt)
-        
+
     def saveFile(self):
         #recuperation du nom du fichier
         if self.editor != None :
-           dir=self.editor.appliEficas.maConfiguration.savedir
+            dir=self.editor.appliEficas.maConfiguration.savedir
         else:
-           dir='/tmp'
+            dir='/tmp'
         fn = QFileDialog.getSaveFileName(None,
                 tr("Sauvegarder le fichier"),
                 dir)
@@ -69,15 +69,13 @@ class ViewText(Ui_dView,QDialog):
 
         ulfile = os.path.abspath(fn)
         if self.editor != None :
-           self.editor.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
+            self.editor.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
         try:
-           f = open(fn, 'w')
-           f.write(str(self.view.toPlainText()))
-           f.close()
-           return 1
+            f = open(fn, 'w')
+            f.write(str(self.view.toPlainText()))
+            f.close()
+            return 1
         except IOError as why:
-           QMessageBox.critical(self, tr("Sauvegarder le fichier"),
-                 tr('Le fichier')+str(fn) + tr('n a pas pu etre sauvegarde : ') + str(why))
-           return
-
-
+            QMessageBox.critical(self, tr("Sauvegarder le fichier"),
+                  tr('Le fichier')+str(fn) + tr('n a pas pu etre sauvegarde : ') + str(why))
+            return
index 12c906908608b7d337240ce982d110c63a8737fb..209ebc792b36a00d9a1bdee58696e00788702ebc 100644 (file)
@@ -28,15 +28,15 @@ from PyQt5.QtWidgets import QDialog
 # Import des panels
 
 class DVisu(Ui_DVisu, QDialog):
-  """
-  """
-  def __init__(self,parent = None , name = None,fl = 0):
-      QDialog.__init__(self,parent)
-      self.setModal(True)
-      self.setupUi(self)
+    """
+    """
+    def __init__(self,parent = None , name = None,fl = 0):
+        QDialog.__init__(self,parent)
+        self.setModal(True)
+        self.setupUi(self)
 
-  def on_buttonCancel_clicked(self):
-      QDialog.reject(self)
+    def on_buttonCancel_clicked(self):
+        QDialog.reject(self)
 
-  def on_buttonOk_clicked(self):
-      QDialog.accept(self)
+    def on_buttonOk_clicked(self):
+        QDialog.accept(self)
index 175dc9a0298feaf3035453bb1ee472f2a5f8b467..f189312f0f5388cada8b861591f5104cb1b7dcc1 100644 (file)
@@ -24,29 +24,28 @@ import types,os
 # Modules Eficas
 from Extensions.i18n import tr
 
-from .monWidgetRadioButton  import MonWidgetRadioButtonCommun 
-from desWidget4a6RadioButton  import Ui_Widget4a6RadioButton 
+from .monWidgetRadioButton  import MonWidgetRadioButtonCommun
+from desWidget4a6RadioButton  import Ui_Widget4a6RadioButton
 
 
 class MonWidget4a6RadioButton (Ui_Widget4a6RadioButton,MonWidgetRadioButtonCommun):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         #print "dans le init de MonWidget4a6RadioButton",self
         if type(monSimpDef.into) ==types.FunctionType : self.maListeDeValeur=monSimpDef.into()
         else : self.maListeDeValeur=monSimpDef.into
         MonWidgetRadioButtonCommun.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
 
-  def setMaxI(self):
+    def setMaxI(self):
         self.maxI=6
 
 
 class MonWidget4a6RadioButtonSD (Ui_Widget4a6RadioButton,MonWidgetRadioButtonCommun):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         #print "dans le init de MonWidget4a6RadioButton",self
         self.maListeDeValeur=node.item.getSdAvantDuBonType()
         MonWidgetRadioButtonCommun.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
 
-  def setMaxI(self):
+    def setMaxI(self):
         self.maxI=6
-
index 8f75e5d976a439416bb0bbd147c59d444ef38cff..e98f4d0b03a636db8ea60c035f3125b0048fd8cf 100644 (file)
@@ -24,17 +24,16 @@ import types,os
 # Modules Eficas
 from Extensions.i18n import tr
 
-from .monWidgetRadioButton  import MonWidgetRadioButtonCommun 
-from desWidget4a6RadioButton  import Ui_Widget4a6RadioButton 
+from .monWidgetRadioButton  import MonWidgetRadioButtonCommun
+from desWidget4a6RadioButton  import Ui_Widget4a6RadioButton
 
 
 class MonWidget4a6RadioButtonSD (Ui_Widget4a6RadioButton,MonWidgetRadioButtonCommun):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         #print "dans le init de MonWidget4a6RadioButton",self
         self.maListeDeValeur=node.item.getSdAvantDuBonType()
         MonWidgetRadioButtonCommun.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
 
-  def setMaxI(self):
+    def setMaxI(self):
         self.maxI=6
-
index eeef908b16acd0b35bcc02d4039c3df001b4f851..fe19d6fd4b1d6f804f5d040c852927836791597d 100644 (file)
@@ -26,14 +26,14 @@ from Extensions.i18n import tr
 # Import des panels
 
 class MonWidgetBloc(Ui_WidgetBloc,Groupe):
-  """
-  """
-  def __init__(self,node,editor,parentQt,definition, obj, niveau,commande):
-      #print ("bloc : ",node.item.nom)
-      Groupe.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
-      #if self.editor.maConfiguration.afficheCommandesPliees ==True:  self.node.plieToutEtReaffiche()
-      self.parentQt.commandesLayout.insertWidget(-1,self,1)
+    """
+    """
+    def __init__(self,node,editor,parentQt,definition, obj, niveau,commande):
+        #print ("bloc : ",node.item.nom)
+        Groupe.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
+        #if self.editor.maConfiguration.afficheCommandesPliees ==True:  self.node.plieToutEtReaffiche()
+        self.parentQt.commandesLayout.insertWidget(-1,self,1)
 
 
-  def afficheOptionnel(self):
-      return
+    def afficheOptionnel(self):
+        return
index 5c7bc817557fdc4a95a2d67e43f32d101c6af0b0..410df3a16441784efbdede100ebae10a3665753f 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os
@@ -29,7 +29,7 @@ import types,os
 from Extensions.i18n import tr
 
 from InterfaceQT4.feuille               import Feuille
-from desWidgetCB                        import Ui_WidgetCB 
+from desWidgetCB                        import Ui_WidgetCB
 from InterfaceQT4.politiquesValidation  import PolitiqueUnique
 from InterfaceQT4.qtSaisie              import SaisieValeur
 
@@ -39,7 +39,7 @@ from PyQt5.QtCore import Qt, QEvent
 
 class MonWidgetCBCommun (Feuille):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.politique=PolitiqueUnique(self.node,self.editor)
         self.determineChoix()
@@ -51,51 +51,51 @@ class MonWidgetCBCommun (Feuille):
         self.AAfficher=self.CBChoix
 
 
-  def setValeursApresBouton(self):
-      if self.objSimp.getValeur()==None : 
-         self.CBChoix.setCurrentIndex(-1)
-         self.CBChoix.lineEdit().setText(tr("Select"))
-         return
-      valeur=self.objSimp.getValeur()
-      if not(type(valeur) == str) : valeur=str(valeur)
-      self.CBChoix.setCurrentIndex(self.CBChoix.findText(valeur))
-      
-  def determineChoix(self):
-      listeChoix=[]
-      if self.maListeDeValeur == None : self.maListeDeValeur=[]
-      for choix in self.maListeDeValeur:
-          if not(type(choix) == str) : choix=str(choix)
-          listeChoix.append(choix)
-          self.CBChoix.addItem(choix)
-      self.CBChoix.setEditable(True)
-      monCompleteur=QCompleter(listeChoix,self) 
-      monCompleteur.setCompletionMode(QCompleter.PopupCompletion) 
-      self.CBChoix.setCompleter(monCompleteur)
-
-  def choixSaisi(self):
-      self.CBChoix.lineEdit().setStyleSheet(("\n"
+    def setValeursApresBouton(self):
+        if self.objSimp.getValeur()==None :
+            self.CBChoix.setCurrentIndex(-1)
+            self.CBChoix.lineEdit().setText(tr("Select"))
+            return
+        valeur=self.objSimp.getValeur()
+        if not(type(valeur) == str) : valeur=str(valeur)
+        self.CBChoix.setCurrentIndex(self.CBChoix.findText(valeur))
+
+    def determineChoix(self):
+        listeChoix=[]
+        if self.maListeDeValeur == None : self.maListeDeValeur=[]
+        for choix in self.maListeDeValeur:
+            if not(type(choix) == str) : choix=str(choix)
+            listeChoix.append(choix)
+            self.CBChoix.addItem(choix)
+        self.CBChoix.setEditable(True)
+        monCompleteur=QCompleter(listeChoix,self)
+        monCompleteur.setCompletionMode(QCompleter.PopupCompletion)
+        self.CBChoix.setCompleter(monCompleteur)
+
+    def choixSaisi(self):
+        self.CBChoix.lineEdit().setStyleSheet(("\n"
 "QLineEdit {\n"
 "     font : italic ;\n"
 "     background: rgb(235,235,235);\n"
 " }"))
-      valeur=str(self.CBChoix.currentText())
-      SaisieValeur.LEvaleurPressed(self,valeur)
-      self.reaffiche()
+        valeur=str(self.CBChoix.currentText())
+        SaisieValeur.LEvaleurPressed(self,valeur)
+        self.reaffiche()
 
-  def wheelEvent(self,  event):
-  # Sinon poum sur les fenetres trop longues
-  # lorsque la widget attrape le wheelevent
-    event.ignore()
+    def wheelEvent(self,  event):
+    # Sinon poum sur les fenetres trop longues
+    # lorsque la widget attrape le wheelevent
+        event.ignore()
 
 
 class MonWidgetCB (Ui_WidgetCB, MonWidgetCBCommun):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-      self.maListeDeValeur = monSimpDef.into
-      MonWidgetCBCommun. __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+        self.maListeDeValeur = monSimpDef.into
+        MonWidgetCBCommun. __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
 
 class MonWidgetCBSD (Ui_WidgetCB,MonWidgetCBCommun):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-      self.maListeDeValeur = node.item.getSdAvantDuBonType()
-      MonWidgetCBCommun.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+        self.maListeDeValeur = node.item.getSdAvantDuBonType()
+        MonWidgetCBCommun.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
index f924e962a524b37273c3255f7f817c1b314adb32..6efa0fcf70a8f829dab05e4d572ff72ec4ad21f7 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os
@@ -39,21 +39,19 @@ from PyQt5.QtCore import Qt
 from monWidgetCB            import MonWidgetCBCommun
 from monWidgetIntoSug       import GereAjoutDsPossible
 
-      
-class MonWidgetCBIntoSug (MonWidgetCBCommun, Ui_WidgetCBIntoSug,GereAjoutDsPossible):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-      self.maListeDeValeur=monSimpDef.into
-      if node.item.hasIntoSug()          : self.maListeDeValeur  = node.item.getListePossibleAvecSug([])
-      if hasattr(node.item,'suggestion') : self.maListeDeValeur +=  node.item.suggestion
-      MonWidgetCBCommun. __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      self.lineEditVal.returnPressed.connect(self.LEValeurAjouteDsPossible)
-
-  def ajouteValeurPossible(self,valeur):
-      self.CBChoix.addItem(valeur)
-      # on ne sait pas si on a deja ajouté une valeur
-      try    : self.node.item.suggestion.append(valeur)
-      except : self.node.item.suggestion = (valeur,)
-      self.lineEditVal.setText('')
-      self.CBChoix.setCurrentIndex(self.CBChoix.findText(valeur));
-      
 
+class MonWidgetCBIntoSug (MonWidgetCBCommun, Ui_WidgetCBIntoSug,GereAjoutDsPossible):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+        self.maListeDeValeur=monSimpDef.into
+        if node.item.hasIntoSug()          : self.maListeDeValeur  = node.item.getListePossibleAvecSug([])
+        if hasattr(node.item,'suggestion') : self.maListeDeValeur +=  node.item.suggestion
+        MonWidgetCBCommun. __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
+        self.lineEditVal.returnPressed.connect(self.LEValeurAjouteDsPossible)
+
+    def ajouteValeurPossible(self,valeur):
+        self.CBChoix.addItem(valeur)
+        # on ne sait pas si on a deja ajouté une valeur
+        try    : self.node.item.suggestion.append(valeur)
+        except : self.node.item.suggestion = (valeur,)
+        self.lineEditVal.setText('')
+        self.CBChoix.setCurrentIndex(self.CBChoix.findText(valeur));
index d914d1bf3aff58a281acb1967b064c545dd39f43..98553fdaf680c3ebb54059c5ed99d050e68a11c5 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os
@@ -29,7 +29,7 @@ import types,os
 from Extensions.i18n import tr
 
 from .feuille               import Feuille
-from desWidgetCB           import Ui_WidgetCB 
+from desWidgetCB           import Ui_WidgetCB
 from .politiquesValidation  import PolitiqueUnique
 from .qtSaisie              import SaisieValeur
 
@@ -39,7 +39,7 @@ from PyQt5.QtWidgets import QComboBox, QCompleter
 
 class MonWidgetCB (Ui_WidgetCB,Feuille):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.politique=PolitiqueUnique(self.node,self.editor)
         self.determineChoix()
@@ -51,27 +51,27 @@ class MonWidgetCB (Ui_WidgetCB,Feuille):
         #print self.objSimp.isOblig()
 
 
-  def setValeursApresBouton(self):
-      if self.objSimp.getValeur()==None : 
-         self.CBChoix.setCurrentIndex(-1)
-         return
-      valeur=self.objSimp.getValeur()
-      if not(type(valeur) == str) : valeur=str(valeur)
-      self.CBChoix.setCurrentIndex(self.CBChoix.findText(valeur))
-      
-  def determineChoix(self):
-      self.CBChoix.currentIndexChanged.connect(self.choixSaisi)
+    def setValeursApresBouton(self):
+        if self.objSimp.getValeur()==None :
+            self.CBChoix.setCurrentIndex(-1)
+            return
+        valeur=self.objSimp.getValeur()
+        if not(type(valeur) == str) : valeur=str(valeur)
+        self.CBChoix.setCurrentIndex(self.CBChoix.findText(valeur))
 
-      for choix in self.monSimpDef.into:
-          if not(type(choix) == str) : choix=str(choix)
-          self.CBChoix.currentIndexChanged.connect(self.choixSaisi)
-          self.CBChoix.addItem(choix)
-      self.CBChoix.setEditable(True)
-      monCompleteur=QCompleter(listeChoix,self) 
-      monCompleteur.setCompletionMode(QCompleter.PopupCompletion) 
-      self.CBChoix.setCompleter(monCompleteur)
+    def determineChoix(self):
+        self.CBChoix.currentIndexChanged.connect(self.choixSaisi)
+
+        for choix in self.monSimpDef.into:
+            if not(type(choix) == str) : choix=str(choix)
+            self.CBChoix.currentIndexChanged.connect(self.choixSaisi)
+            self.CBChoix.addItem(choix)
+        self.CBChoix.setEditable(True)
+        monCompleteur=QCompleter(listeChoix,self)
+        monCompleteur.setCompletionMode(QCompleter.PopupCompletion)
+        self.CBChoix.setCompleter(monCompleteur)
 
-  def choixSaisi(self):
-      valeur=str(self.CBChoix.currentText())
-      SaisieValeur.LEvaleurPressed(self,valeur)
-      self.reaffiche()
+    def choixSaisi(self):
+        valeur=str(self.CBChoix.currentText())
+        SaisieValeur.LEvaleurPressed(self,valeur)
+        self.reaffiche()
index 08381df4cb88fa1ca40d53723f387166a58c3a36..3ad181e4e2930e68666dba34ab4bb3952533c590 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Eficas
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types
@@ -37,270 +37,272 @@ from PyQt5.QtCore import Qt
 
 
 from Extensions.i18n import tr
-import Accas 
+import Accas
 import os
 
-    
+
 # Import des panels
 
 class MonWidgetCommande(Ui_WidgetCommande,Groupe):
-  """
-  """
-  def __init__(self,node,editor,etape):
-
-      self.listeAffichageWidget=[]
-      self.inhibe=0
-      self.ensure=0
-      editor.inhibeSplitter=1
-      Groupe.__init__(self,node,editor,None,etape.definition,etape,1,self)
-      spacerItem = QSpacerItem(21, 500, QSizePolicy.Expanding, QSizePolicy.Expanding)
-      self.verticalLayoutCommande.addItem(spacerItem)
-      editor.inhibeSplitter=0
-
-      # Gestion du nom de L OPER si il est nomme 
-      if   not(hasattr(etape.definition,'sd_prod')) or (etape.definition.sd_prod==None): self.LENom.close()
-      elif (hasattr(etape.definition,'sd_prod') and type(etape.definition.sd_prod)== types.FunctionType):self.LENom.close()
-      elif (hasattr(etape, 'sdnom')) and etape.sdnom != "sansnom" and etape.sdnom != None: 
-         self.LENom.setText(etape.sdnom)
-      else : 
-         self.LENom.setText("")
-      if hasattr(self,'LENom'): self.LENom.returnPressed.connect(self.nomChange)
-      self.racine=self.node.tree.racine
-      if self.node.item.getIconName() == "ast-red-square" : self.LENom.setDisabled(True)
-
-      # Gestion de la doc de l objet
-      if node.item.getFr() != "" : 
-         self.labelDoc.setText(node.item.getFr())
-         nouvelleSize=self.frameAffichage.height()+60
-         self.frameAffichage.setMinimumHeight(nouvelleSize)
-         self.frameAffichage.resize(self.frameAffichage.width(),nouvelleSize)
-      else : self.labelDoc.close()
-      
-   
-      # Gestion du nom de l etape
-      maPolice= QFont("Times", 10,)
-      self.setFont(maPolice)
-      self.labelNomCommande.setText(tr(self.obj.nom))
-
-
-      # Gestion du Frame d affichage des autres commandes
-      if self.editor.maConfiguration.closeAutreCommande == True  : self.closeAutreCommande()
-      else :
-         self.bCatalogue.clicked.connect(self.afficheCatalogue)
-         self.bAvant.clicked.connect(self.afficheAvant)
-         self.bApres.clicked.connect(self.afficheApres)
-       
-      if self.editor.maConfiguration.closeFrameRechercheCommande==True  : 
-         self.frameAffichage.close()
-         self.closeAutreCommande()
-
-
-      self.setAcceptDrops(True)
-      self.etablitOrdre()
-
-      if self.editor.maConfiguration.enleverPoubellePourCommande  : 
-         self.RBPoubelle.close() # JDC Fige
-
-      if self.editor.maConfiguration.pasDeMCOptionnels  : 
-         return                  # Pas de MC Optionnels pour Carmel
-
-      from .monWidgetOptionnel import MonWidgetOptionnel
-      if self.editor.widgetOptionnel!= None : 
-         self.monOptionnel=self.editor.widgetOptionnel
-      else :
-         self.editor.inhibeSplitter=1
-         self.monOptionnel=MonWidgetOptionnel(self.editor)
-         self.editor.widgetOptionnel=self.monOptionnel
-         self.editor.splitter.addWidget(self.monOptionnel)
-         self.editor.ajoutOptionnel()
-         self.editor.inhibeSplitter=0
-         self.monOptionnel=self.editor.widgetOptionnel
-      self.afficheOptionnel()
-
-      #print "fin init de widget Commande"
-      
-
-  def closeAutreCommande(self):
-      self.bCatalogue.close()
-      self.bAvant.close()
-      self.bApres.close()
-
-  def donnePremier(self):
-      #print "dans donnePremier"
-      QApplication.processEvents()
-      if self.listeAffichageWidget != [] :
-         self.listeAffichageWidget[0].setFocus(7)
-      QApplication.processEvents()
-      #print self.focusWidget()
-
-
-  def focusNextPrevChild(self, next):
-      # on s assure que ce n est pas un chgt de fenetre
-      #print "je passe dans focusNextPrevChild"
-      if self.editor.fenetreCentraleAffichee != self : return True
-      f = self.focusWidget()
-      if f not in self.listeAffichageWidget :
-         i=0
-         while not hasattr (f,'AAfficher') :
-           if f==None :i=-1; break
-           f = f.parentWidget()
-         if hasattr(f,'AAfficher') : f=f.AAfficher
-         if i != -1 : i=self.listeAffichageWidget.index(f)
-      else :i=self.listeAffichageWidget.index(f) 
-      if (i==len(self.listeAffichageWidget) -1) and next and not self.inhibe: 
-         try :
-           self.listeAffichageWidget[1].setFocus(7)
-           w=self.focusWidget()
-           self.inhibe=1
-           w.focusPreviousChild()
-           self.inhibe=0
-           return True
-         except :
-           pass
-           #print self.listeAffichageWidget
-           #print "souci ds focusNextPrevChild"
-      if i==0 and next==False and not self.inhibe: 
-         if hasattr(self.editor.fenetreCentraleAffichee,'scrollArea'):
-            self.editor.fenetreCentraleAffichee.scrollArea.ensureWidgetVisible(self.listeAffichageWidget[-1])
-         self.listeAffichageWidget[-2].setFocus(7)
-         self.inhibe=1
-         w=self.focusWidget()
-         w.focusNextChild()
-         self.inhibe=0
-         return True
-      if i==0 and next==True and not self.inhibe:
-         self.listeAffichageWidget[0].setFocus(7)
-         self.inhibe=1
-         w=self.focusWidget()
-         w.focusNextChild()
-         self.inhibe=0
-         return True
-      if i>0 and next==False and not self.inhibe:
-         if isinstance(self.listeAffichageWidget[i-1],QRadioButton):
-           self.listeAffichageWidget[i-1].setFocus(7)
-           return True
-      return QWidget.focusNextPrevChild(self, next)
-
-  def etablitOrdre(self):
-      i=0
-      while(i +1 < len(self.listeAffichageWidget)):
-         self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1])
-         i=i+1
-      # si on boucle on perd l'ordre
-  def  afficheSuivant(self,f):
-      #print ('ds afficheSuivant')
-      try :
-        i=self.listeAffichageWidget.index(f) 
-        next=i+1
-      except :
-        next=1
-      if (next==len(self.listeAffichageWidget) ): next =0
-      #self.f=next
-      #QTimer.singleShot(1, self.rendVisible)
-      try :
-        self.listeAffichageWidget[next].setFocus(7)
-      except :
-        pass
-
-  def nomChange(self):
-      nom = str(self.LENom.text())
-      nom = nom.strip()
-      if nom == '' : return                  # si pas de nom, on ressort sans rien faire
-      test,mess = self.node.item.nommeSd(nom)
-      self.editor.afficheCommentaire(mess)
-
-      #Notation scientifique
-      if test :
-        from .politiquesValidation import Validation
-        validation=Validation(self.node,self.editor)
-        validation.ajoutDsDictReelEtape()
-
-  def afficheOptionnel(self):
-      # N a pas de parentQt. doit donc etre redefini
-      if self.editor.maConfiguration.closeOptionnel : self.editor.fermeOptionnel()
-      liste,liste_rouge=self.ajouteMCOptionnelDesBlocs()
-      #print "dans afficheOptionnel", self.monOptionnel
-      # dans le cas ou l insertion n a pas eu leiu (souci d ordre par exemple)
-      #if self.monOptionnel == None : return
-      self.monOptionnel.parentCommande=self
-      self.monOptionnel.titre(self.obj.nom)
-      self.monGroupe=self.monOptionnel.afficheOptionnel(liste,liste_rouge,self)
-      
-
-  def focusInEvent(self,event):
-      #print "je mets a jour dans focusInEvent de monWidget Commande "
-      self.afficheOptionnel()
-
-
-  def reaffiche(self,nodeAVoir=None):
-      # Attention delicat. les appels de fonctions ne semblent pas pouvoir etre supprimes!
-      self.avantH=self.editor.fenetreCentraleAffichee.scrollAreaCommandes.horizontalScrollBar().sliderPosition()
-      self.avantV=self.editor.fenetreCentraleAffichee.scrollAreaCommandes.verticalScrollBar().sliderPosition()
-      self.inhibeExpand=True
-      self.node.affichePanneau()
-      #QTimer.singleShot(1, self.recentre)
-      if nodeAVoir != None and nodeAVoir!=0:
-        self.f=nodeAVoir.fenetre
-        if self.f==None : 
-             newNode=nodeAVoir.treeParent.chercheNoeudCorrespondant(nodeAVoir.item.object)
-             self.f = newNode.fenetre 
-        if self.f != None and self.f.isVisible() : self.inhibeExpand=False; return
-        if self.f != None : self.rendVisible()
+    """
+    """
+    def __init__(self,node,editor,etape):
+
+        self.listeAffichageWidget=[]
+        self.inhibe=0
+        self.ensure=0
+        editor.inhibeSplitter=1
+        Groupe.__init__(self,node,editor,None,etape.definition,etape,1,self)
+        spacerItem = QSpacerItem(21, 500, QSizePolicy.Expanding, QSizePolicy.Expanding)
+        self.verticalLayoutCommande.addItem(spacerItem)
+        editor.inhibeSplitter=0
+
+        # Gestion du nom de L OPER si il est nomme
+        if   not(hasattr(etape.definition,'sd_prod')) or (etape.definition.sd_prod==None): self.LENom.close()
+        elif (hasattr(etape.definition,'sd_prod') and type(etape.definition.sd_prod)== types.FunctionType):self.LENom.close()
+        elif (hasattr(etape, 'sdnom')) and etape.sdnom != "sansnom" and etape.sdnom != None:
+            self.LENom.setText(etape.sdnom)
+        else :
+            self.LENom.setText("")
+        if hasattr(self,'LENom'): self.LENom.returnPressed.connect(self.nomChange)
+        self.racine=self.node.tree.racine
+        if self.node.item.getIconName() == "ast-red-square" : self.LENom.setDisabled(True)
+
+        # Gestion de la doc de l objet
+        if node.item.getFr() != "" :
+            self.labelDoc.setText(node.item.getFr())
+            nouvelleSize=self.frameAffichage.height()+60
+            self.frameAffichage.setMinimumHeight(nouvelleSize)
+            self.frameAffichage.resize(self.frameAffichage.width(),nouvelleSize)
+        else : self.labelDoc.close()
+
+
+        # Gestion du nom de l etape
+        maPolice= QFont("Times", 10,)
+        self.setFont(maPolice)
+        self.labelNomCommande.setText(tr(self.obj.nom))
+
+
+        # Gestion du Frame d affichage des autres commandes
+        if self.editor.maConfiguration.closeAutreCommande == True  : self.closeAutreCommande()
+        else :
+            self.bCatalogue.clicked.connect(self.afficheCatalogue)
+            self.bAvant.clicked.connect(self.afficheAvant)
+            self.bApres.clicked.connect(self.afficheApres)
+
+        if self.editor.maConfiguration.closeFrameRechercheCommande==True  :
+            self.frameAffichage.close()
+            self.closeAutreCommande()
+
+
+        self.setAcceptDrops(True)
+        self.etablitOrdre()
+
+        if self.editor.maConfiguration.enleverPoubellePourCommande  :
+            self.RBPoubelle.close() # JDC Fige
+
+        if self.editor.maConfiguration.pasDeMCOptionnels  :
+            return                  # Pas de MC Optionnels pour Carmel
+
+        from .monWidgetOptionnel import MonWidgetOptionnel
+        if self.editor.widgetOptionnel!= None :
+            self.monOptionnel=self.editor.widgetOptionnel
+        else :
+            self.editor.inhibeSplitter=1
+            self.monOptionnel=MonWidgetOptionnel(self.editor)
+            self.editor.widgetOptionnel=self.monOptionnel
+            self.editor.splitter.addWidget(self.monOptionnel)
+            self.editor.ajoutOptionnel()
+            self.editor.inhibeSplitter=0
+            self.monOptionnel=self.editor.widgetOptionnel
+        self.afficheOptionnel()
+
+        #print "fin init de widget Commande"
+
+
+    def closeAutreCommande(self):
+        self.bCatalogue.close()
+        self.bAvant.close()
+        self.bApres.close()
+
+    def donnePremier(self):
+        #print "dans donnePremier"
+        QApplication.processEvents()
+        if self.listeAffichageWidget != [] :
+            self.listeAffichageWidget[0].setFocus(7)
+        QApplication.processEvents()
+        #print self.focusWidget()
+
+
+    def focusNextPrevChild(self, next):
+        # on s assure que ce n est pas un chgt de fenetre
+        #print "je passe dans focusNextPrevChild"
+        if self.editor.fenetreCentraleAffichee != self : return True
+        f = self.focusWidget()
+        if f not in self.listeAffichageWidget :
+            i=0
+            while not hasattr (f,'AAfficher') :
+                if f==None :i=-1; break
+                f = f.parentWidget()
+            if hasattr(f,'AAfficher') : f=f.AAfficher
+            if i != -1 : i=self.listeAffichageWidget.index(f)
+        else :i=self.listeAffichageWidget.index(f)
+        if (i==len(self.listeAffichageWidget) -1) and next and not self.inhibe:
+            try :
+                self.listeAffichageWidget[1].setFocus(7)
+                w=self.focusWidget()
+                self.inhibe=1
+                w.focusPreviousChild()
+                self.inhibe=0
+                return True
+            except :
+                pass
+                #print self.listeAffichageWidget
+                #print "souci ds focusNextPrevChild"
+        if i==0 and next==False and not self.inhibe:
+            if hasattr(self.editor.fenetreCentraleAffichee,'scrollArea'):
+                self.editor.fenetreCentraleAffichee.scrollArea.ensureWidgetVisible(self.listeAffichageWidget[-1])
+            self.listeAffichageWidget[-2].setFocus(7)
+            self.inhibe=1
+            w=self.focusWidget()
+            w.focusNextChild()
+            self.inhibe=0
+            return True
+        if i==0 and next==True and not self.inhibe:
+            self.listeAffichageWidget[0].setFocus(7)
+            self.inhibe=1
+            w=self.focusWidget()
+            w.focusNextChild()
+            self.inhibe=0
+            return True
+        if i>0 and next==False and not self.inhibe:
+            if isinstance(self.listeAffichageWidget[i-1],QRadioButton):
+                self.listeAffichageWidget[i-1].setFocus(7)
+                return True
+        return QWidget.focusNextPrevChild(self, next)
+
+    def etablitOrdre(self):
+        i=0
+        while(i +1 < len(self.listeAffichageWidget)):
+            self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1])
+            i=i+1
+        # si on boucle on perd l'ordre
+
+    def  afficheSuivant(self,f):
+        #print ('ds afficheSuivant')
+        try :
+            i=self.listeAffichageWidget.index(f)
+            next=i+1
+        except :
+            next=1
+        if (next==len(self.listeAffichageWidget) ): next =0
+        #self.f=next
+        #QTimer.singleShot(1, self.rendVisible)
+        try :
+            self.listeAffichageWidget[next].setFocus(7)
+        except :
+            pass
+
+    def nomChange(self):
+        nom = str(self.LENom.text())
+        nom = nom.strip()
+        if nom == '' : return                  # si pas de nom, on ressort sans rien faire
+        test,mess = self.node.item.nommeSd(nom)
+        self.editor.afficheCommentaire(mess)
+
+        #Notation scientifique
+        if test :
+            from .politiquesValidation import Validation
+            validation=Validation(self.node,self.editor)
+            validation.ajoutDsDictReelEtape()
+
+    def afficheOptionnel(self):
+        # N a pas de parentQt. doit donc etre redefini
+        if self.editor.maConfiguration.closeOptionnel : self.editor.fermeOptionnel()
+        liste,liste_rouge=self.ajouteMCOptionnelDesBlocs()
+        #print "dans afficheOptionnel", self.monOptionnel
+        # dans le cas ou l insertion n a pas eu leiu (souci d ordre par exemple)
+        #if self.monOptionnel == None : return
+        self.monOptionnel.parentCommande=self
+        self.monOptionnel.titre(self.obj.nom)
+        self.monGroupe=self.monOptionnel.afficheOptionnel(liste,liste_rouge,self)
+
+
+    def focusInEvent(self,event):
+        #print "je mets a jour dans focusInEvent de monWidget Commande "
+        self.afficheOptionnel()
+
+
+    def reaffiche(self,nodeAVoir=None):
+        # Attention delicat. les appels de fonctions ne semblent pas pouvoir etre supprimes!
+        self.avantH=self.editor.fenetreCentraleAffichee.scrollAreaCommandes.horizontalScrollBar().sliderPosition()
+        self.avantV=self.editor.fenetreCentraleAffichee.scrollAreaCommandes.verticalScrollBar().sliderPosition()
+        self.inhibeExpand=True
+        self.node.affichePanneau()
+        #QTimer.singleShot(1, self.recentre)
+        if nodeAVoir != None and nodeAVoir!=0:
+            self.f=nodeAVoir.fenetre
+            if self.f==None :
+                newNode=nodeAVoir.treeParent.chercheNoeudCorrespondant(nodeAVoir.item.object)
+                self.f = newNode.fenetre
+            if self.f != None and self.f.isVisible() : self.inhibeExpand=False; return
+            if self.f != None : self.rendVisible()
+            else : self.recentre()
         else : self.recentre()
-      else : self.recentre()
-      self.inhibeExpand=False
-
-
-
-  def recentre(self):
-      QApplication.processEvents()
-      s=self.editor.fenetreCentraleAffichee.scrollAreaCommandes
-      s.horizontalScrollBar().setSliderPosition(self.avantH)
-      s.verticalScrollBar().setSliderPosition(self.avantV)
-
-  def rendVisible(self):
-      QApplication.processEvents()
-      self.f.setFocus(7)
-      self.editor.fenetreCentraleAffichee.scrollAreaCommandes.ensureWidgetVisible(self.f)
-
-  def afficheCatalogue(self):
-      if self.editor.widgetOptionnel != None : self.monOptionnel.hide()
-      self.racine.affichePanneau()
-      if self.node : self.node.select()
-      else : self.racine.select()
-
-  def afficheApres(self):
-       self.node.selectApres()
-
-  def afficheAvant(self):
-       self.node.selectAvant()
-
-  def setValide(self):
-      if not(hasattr (self,'RBValide')) : return
-      icon = QIcon()
-      if self.node.item.object.isValid() : icon=QIcon(self.repIcon+"/ast-green-ball.png")
-      else :                               icon=QIcon(self.repIcon+"/ast-red-ball.png")
-      nomIcone = self.node.item.getIconName()
-      if nomIcone == "ast-yellow-square" : icon=QIcon(self.repIcon+"/ast-yel-ball.png")
-      if nomIcone == "ast-red-square"    : self.LENom.setDisabled(True)
-
-      self.LENom.setDisabled(False)
-      self.RBValide.setIcon(icon)
-
-
-  def propageChange(self,typeChange):
-      aReecrire=self.propageChangeEnfant(self.node.item.object,typeChange)
-      if aReecrire : self.node.affichePanneau()
-
-  def propageChangeEnfant(self,mc, typeChange):
-      for enfant in mc.mcListe:
-          if enfant.nature == 'MCSIMP' :
-             if enfant.waitUserAssd():
-                if enfant.definition.type[0] == typeChange: return True
-          else :
-            if enfant.nature == 'MCList' : enfant=enfant[0]
-            if self.propageChangeEnfant(enfant, typeChange) : return True
-      return False
-             
-             
+        self.inhibeExpand=False
+
+
+
+    def recentre(self):
+        QApplication.processEvents()
+        s=self.editor.fenetreCentraleAffichee.scrollAreaCommandes
+        s.horizontalScrollBar().setSliderPosition(self.avantH)
+        s.verticalScrollBar().setSliderPosition(self.avantV)
+
+    def rendVisible(self):
+        QApplication.processEvents()
+        self.f.setFocus(7)
+        self.editor.fenetreCentraleAffichee.scrollAreaCommandes.ensureWidgetVisible(self.f)
+
+    def afficheCatalogue(self):
+        if self.editor.widgetOptionnel != None : self.monOptionnel.hide()
+        self.racine.affichePanneau()
+        if self.node : self.node.select()
+        else : self.racine.select()
+
+    def afficheApres(self):
+        self.node.selectApres()
+
+    def afficheAvant(self):
+        self.node.selectAvant()
+
+    def setValide(self):
+        if not(hasattr (self,'RBValide')) : return
+        icon = QIcon()
+        if self.node.item.object.isValid() : icon=QIcon(self.repIcon+"/ast-green-ball.png")
+        else :                               icon=QIcon(self.repIcon+"/ast-red-ball.png")
+        nomIcone = self.node.item.getIconName()
+        if nomIcone == "ast-yellow-square" : icon=QIcon(self.repIcon+"/ast-yel-ball.png")
+        if nomIcone == "ast-red-square"    : self.LENom.setDisabled(True)
+
+        self.LENom.setDisabled(False)
+        self.RBValide.setIcon(icon)
+
+
+    def propageChange(self,typeChange,donneLeFocus):
+        aReecrire=self.propageChangeEnfant(self.node.item.object,typeChange)
+        if aReecrire : self.node.affichePanneau()
+        if hasattr(donneLeFocus.node.fenetre, 'selectionneDernier') :
+            QApplication.processEvents()
+            self.editor.fenetreCentraleAffichee.scrollAreaCommandes.ensureWidgetVisible(donneLeFocus.node.fenetre)
+            donneLeFocus.node.fenetre.selectionneDernier()
+
+    def propageChangeEnfant(self,mc, typeChange):
+        for enfant in mc.mcListe:
+            if enfant.nature == 'MCSIMP' :
+                if enfant.waitUserAssd():
+                    if enfant.definition.type[0] == typeChange: return True
+            else :
+                if enfant.nature == 'MCList' : enfant=enfant[0]
+                if self.propageChangeEnfant(enfant, typeChange) : return True
+        return False
index ee7b1b2b66fc006ef862717dbd411f0b28834e8c..006d3b0006f2eea53908a06298253824e32b876a 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Eficas
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 import types, os
 import traceback
@@ -34,117 +34,117 @@ class MonWidgetCommandeDeplie1Niveau(MonWidgetCommande):
 # il faut donc surcharger un certain nb de fonction ici pour eux
 
 
-  def __init__(self,node,editor,etape):
-      #print ("debut de ---------------------- init de MonWidgetCommandeDeplie1Niveau ",node.item.nom)
-      MonWidgetCommande.__init__(self,node,editor,etape)
-      self.node.plieToutEtReaffiche=self.plieToutEtReaffiche
-      spacerItem = QSpacerItem(21, 600, QSizePolicy.Expanding, QSizePolicy.Expanding)
-      self.verticalLayoutCommande.addItem(spacerItem)
-
-  def afficheMots(self):
-      # Attention
-      # Attention --> cette methode surcharge les methodes des Nodes Fils
-      # Attention
-      #print ("debut de ---------------------- ds afficheMots de MonWidgetCommandeDeplie1Niveau ",self.node.item.nom)
-      #traceback.print_stack()
-      repIcon=self.editor.appliEficas.repIcon
-      fichier=os.path.join(repIcon, 'deleteRondVide.png')
-      icon = QIcon(fichier)
-      for node in self.node.children:
-
-           node.plie=True
-           node.setPlieChildren()
-           if node.appartientAUnNoeudPlie==True : continue
-
-           node.plieToutEtReaffiche   = self.plieToutEtReaffiche
-           node.deplieToutEtReaffiche = self.deplieToutEtReaffiche
-           node.affichePanneau        = self.affichePanneau
-           node.getPanel              = self.getPanel
-
-           widget=node.getPanelGroupe(self,self.maCommande)
-           self.listeFocus.append(node.fenetre)
-
-           try :
-            node.fenetre.RBDeplie.setCheckable(False)
-            node.fenetre.RBDeplie.setEnabled(False)
-            node.fenetre.RBDeplie.setIcon(icon)
-           except : pass
-
-           if node.item.object.isMCList() :
-              node.setDeplie              = self.setDepliePourMCList
-
-              for c in node.children :
-                  c.setDeplie           = self.setDepliePourNode
-                  c.plieToutEtReaffiche = self.plieToutEtReaffiche
-                  c.deplieToutEtReaffiche = self.deplieToutEtReaffiche
-                  c.getPanel              = self.getPanel
-                  c.affichePanneau      = self.affichePanneau
-                  try :        
-                    c.fenetre.RBDeplie.setCheckable(False)
-                    c.fenetre.RBDeplie.setEnabled(False)
-                    c.fenetre.RBDeplie.setIcon(icon)
-                  except :
-                    pass
-           else :
-              node.setDeplie=self.setDepliePourNode
-
-      #print ("fin ------------------------ afficheMots de MonWidgetCommandeDeplie1Niveau ",self.node.item.nom)
-
-  def afficheSuivant(self,aAfficher):
-      fenetre=self.node.tree.itemCourant.fenetre
-      fenetre.afficheSuivant(aAfficher)
-
-  def setDepliePourNode(self):
-      noeudCourant=self.node.tree.itemCourant
-      noeudCourant.setDeplieChildren()
-      if self.editor.fenetreCentraleAffichee == noeudCourant.fenetre : return
-      noeudCourant.afficheCeNiveau()
-      pass
+    def __init__(self,node,editor,etape):
+        #print ("debut de ---------------------- init de MonWidgetCommandeDeplie1Niveau ",node.item.nom)
+        MonWidgetCommande.__init__(self,node,editor,etape)
+        self.node.plieToutEtReaffiche=self.plieToutEtReaffiche
+        spacerItem = QSpacerItem(21, 600, QSizePolicy.Expanding, QSizePolicy.Expanding)
+        self.verticalLayoutCommande.addItem(spacerItem)
+
+    def afficheMots(self):
+        # Attention
+        # Attention --> cette methode surcharge les methodes des Nodes Fils
+        # Attention
+        #print ("debut de ---------------------- ds afficheMots de MonWidgetCommandeDeplie1Niveau ",self.node.item.nom)
+        #traceback.print_stack()
+        repIcon=self.editor.appliEficas.repIcon
+        fichier=os.path.join(repIcon, 'deleteRondVide.png')
+        icon = QIcon(fichier)
+        for node in self.node.children:
+
+            node.plie=True
+            node.setPlieChildren()
+            if node.appartientAUnNoeudPlie==True : continue
+
+            node.plieToutEtReaffiche   = self.plieToutEtReaffiche
+            node.deplieToutEtReaffiche = self.deplieToutEtReaffiche
+            node.affichePanneau        = self.affichePanneau
+            node.getPanel              = self.getPanel
+
+            widget=node.getPanelGroupe(self,self.maCommande)
+            self.listeFocus.append(node.fenetre)
+
+            try :
+                node.fenetre.RBDeplie.setCheckable(False)
+                node.fenetre.RBDeplie.setEnabled(False)
+                node.fenetre.RBDeplie.setIcon(icon)
+            except : pass
+
+            if node.item.object.isMCList() :
+                node.setDeplie              = self.setDepliePourMCList
+
+                for c in node.children :
+                    c.setDeplie           = self.setDepliePourNode
+                    c.plieToutEtReaffiche = self.plieToutEtReaffiche
+                    c.deplieToutEtReaffiche = self.deplieToutEtReaffiche
+                    c.getPanel              = self.getPanel
+                    c.affichePanneau      = self.affichePanneau
+                    try :
+                        c.fenetre.RBDeplie.setCheckable(False)
+                        c.fenetre.RBDeplie.setEnabled(False)
+                        c.fenetre.RBDeplie.setIcon(icon)
+                    except :
+                        pass
+            else :
+                node.setDeplie=self.setDepliePourNode
+
+        #print ("fin ------------------------ afficheMots de MonWidgetCommandeDeplie1Niveau ",self.node.item.nom)
+
+    def afficheSuivant(self,aAfficher):
+        fenetre=self.node.tree.itemCourant.fenetre
+        fenetre.afficheSuivant(aAfficher)
+
+    def setDepliePourNode(self):
+        noeudCourant=self.node.tree.itemCourant
+        noeudCourant.setDeplieChildren()
+        if self.editor.fenetreCentraleAffichee == noeudCourant.fenetre : return
+        noeudCourant.afficheCeNiveau()
+        pass
 
 
 # -------------------------------------------- Methodes qui surchargent les noeuds fils
 
-  def setDepliePourMCList(self):
-      #print ('je surcharge setDeplie pour MCList')
-      pass
+    def setDepliePourMCList(self):
+        #print ('je surcharge setDeplie pour MCList')
+        pass
 
-  def setPlieChildren(self):
-      #print ('je surcharge setPlieChildren')
-      pass
+    def setPlieChildren(self):
+        #print ('je surcharge setPlieChildren')
+        pass
 
-  def setDeplieChildren(self):
-      #print ('je surcharge setDeplieChildren')
-      pass
+    def setDeplieChildren(self):
+        #print ('je surcharge setDeplieChildren')
+        pass
 
-  def plieToutEtReaffiche(self):
-      #print ('je surcharge plieToutEtReaffiche', self.node.item.nom)
-      pass
+    def plieToutEtReaffiche(self):
+        #print ('je surcharge plieToutEtReaffiche', self.node.item.nom)
+        pass
 
-  def deplieToutEtReaffiche(self):
-      #print ('je surcharge deplieToutEtReaffiche', self.node.tree.itemCourant.item.getLabelText())
-      pass
+    def deplieToutEtReaffiche(self):
+        #print ('je surcharge deplieToutEtReaffiche', self.node.tree.itemCourant.item.getLabelText())
+        pass
 
-  def plieToutEtReafficheSaufItem(self):
-      #print ('je surcharge plieToutEtReaffiche', self.node.tree.itemCourant.item.getLabelText())
-      pass
+    def plieToutEtReafficheSaufItem(self):
+        #print ('je surcharge plieToutEtReaffiche', self.node.tree.itemCourant.item.getLabelText())
+        pass
 
-  def affichePanneau(self):
-      #print ('je surcharge affichePanneau', self.node.tree.itemCourant.item.getLabelText())
-      node=self.node.tree.itemCourant
-      while ( not (hasattr(node,'fenetreIhm')) or node.treeParent.fenetreIhm != 'deplie1Niveau') : 
+    def affichePanneau(self):
+        #print ('je surcharge affichePanneau', self.node.tree.itemCourant.item.getLabelText())
+        node=self.node.tree.itemCourant
+        while ( not (hasattr(node,'fenetreIhm')) or node.treeParent.fenetreIhm != 'deplie1Niveau') :
             node=node.treeParent
-      self.node.tree.setCurrentItem(node)
-          
-      item=node.item
-      if item.getLabelText()[0] == self.editor.fenetreCentraleAffichee.labelNomCommande.text():
-         return
-      node.setDeplieChildren()
-      node.afficheCeNiveau()
-      self.editor.fenetreCentraleAffichee.labelNomCommande.setText(item.getLabelText()[0])
-      self.editor.fenetreCentraleAffichee.labelDoc.setText(item.getFr())
+        self.node.tree.setCurrentItem(node)
 
+        item=node.item
+        if item.getLabelText()[0] == self.editor.fenetreCentraleAffichee.labelNomCommande.text():
+            return
+        node.setDeplieChildren()
+        node.afficheCeNiveau()
+        self.editor.fenetreCentraleAffichee.labelNomCommande.setText(item.getLabelText()[0])
+        self.editor.fenetreCentraleAffichee.labelDoc.setText(item.getFr())
 
 
-  def getPanel (self):
-      #print ('surcharge ds getPanel')
-      pass
+
+    def getPanel (self):
+        #print ('surcharge ds getPanel')
+        pass
index dd71cc7bb2acdcf0978a88162cdb9437a310b225..31f016b954bd3ab31921e8e687a3db686f57c454 100644 (file)
@@ -21,7 +21,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 from PyQt5.QtWidgets import QWidget
@@ -30,68 +30,67 @@ from PyQt5.QtCore    import Qt
 from desWidgetCommentaire import Ui_WidgetCommentaire
 from .gereIcones import FacultatifOuOptionnel
 from Extensions.i18n import tr
-import Accas 
+import Accas
 import os
 
-    
+
 # Import des panels
 
 class MonWidgetCommentaire(QWidget,Ui_WidgetCommentaire,FacultatifOuOptionnel):
-  """
-  """
-  def __init__(self,node,editor,commentaire):
-      QWidget.__init__(self,None)
-      self.node=node
-      self.node.fenetre=self
-      self.setupUi(self)
-      self.editor=editor
-      self.appliEficas=self.editor.appliEficas
-      self.repIcon=self.appliEficas.repIcon
-      self.setIconePoubelle()
-      self.remplitTexte()
-      self.monOptionnel=None
-
-      self.commentaireTE.textChanged.connect(self.TexteCommentaireEntre)
-      if self.editor.code in ['MAP','CARMELCND'] : self.bCatalogue.close()
-      else : self.bCatalogue.clicked.connect(self.afficheCatalogue)
-      if self.editor.code in ['Adao','MAP','ADAO'] :
-           self.bAvant.close()
-           self.bApres.close()
-      else :
-           self.bAvant.clicked.connect(self.afficheAvant)
-           self.bApres.clicked.connect(self.afficheApres)
-      self.editor.fermeOptionnel()
-
-
-  def afficheApres(self):
-       self.node.selectApres()
-
-  def afficheAvant(self):
-       self.node.selectAvant()
-
-       
-  def afficheCatalogue(self):
-      self.node.tree.racine.affichePanneau()
-      if self.node : self.node.select()
-      else : self.node.tree.racine.select()
-
-  def remplitTexte(self):
-      texte=self.node.item.getValeur()
-      self.commentaireTE.setText(texte)
-      if self.editor.code == "CARMELCND" and texte[0:16]=="Cree - fichier :" :
-         self.commentaireTE.setReadOnly(True)
-         self.commentaireTE.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
-         self.commentaireTE.setToolTip(tr("Valeur non modifiable"))
-      else :
-         self.commentaireTE.setReadOnly(False)
-
-  def donnePremier(self):
-      self.commentaireTE.setFocus(7)
-
-
-  def TexteCommentaireEntre(self):
-      texte=str(self.commentaireTE.toPlainText())
-      self.editor.initModif()
-      self.node.item.setValeur(texte)
-      self.node.updateNodeTexte()
+    """
+    """
+    def __init__(self,node,editor,commentaire):
+        QWidget.__init__(self,None)
+        self.node=node
+        self.node.fenetre=self
+        self.setupUi(self)
+        self.editor=editor
+        self.appliEficas=self.editor.appliEficas
+        self.repIcon=self.appliEficas.repIcon
+        self.setIconePoubelle()
+        self.remplitTexte()
+        self.monOptionnel=None
+
+        self.commentaireTE.textChanged.connect(self.TexteCommentaireEntre)
+        if self.editor.code in ['MAP','CARMELCND'] : self.bCatalogue.close()
+        else : self.bCatalogue.clicked.connect(self.afficheCatalogue)
+        if self.editor.code in ['Adao','MAP','ADAO'] :
+            self.bAvant.close()
+            self.bApres.close()
+        else :
+            self.bAvant.clicked.connect(self.afficheAvant)
+            self.bApres.clicked.connect(self.afficheApres)
+        self.editor.fermeOptionnel()
+
+
+    def afficheApres(self):
+        self.node.selectApres()
+
+    def afficheAvant(self):
+        self.node.selectAvant()
+
+
+    def afficheCatalogue(self):
+        self.node.tree.racine.affichePanneau()
+        if self.node : self.node.select()
+        else : self.node.tree.racine.select()
+
+    def remplitTexte(self):
+        texte=self.node.item.getValeur()
+        self.commentaireTE.setText(texte)
+        if self.editor.code == "CARMELCND" and texte[0:16]=="Cree - fichier :" :
+            self.commentaireTE.setReadOnly(True)
+            self.commentaireTE.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
+            self.commentaireTE.setToolTip(tr("Valeur non modifiable"))
+        else :
+            self.commentaireTE.setReadOnly(False)
+
+    def donnePremier(self):
+        self.commentaireTE.setFocus(7)
+
 
+    def TexteCommentaireEntre(self):
+        texte=str(self.commentaireTE.toPlainText())
+        self.editor.initModif()
+        self.node.item.setValeur(texte)
+        self.node.updateNodeTexte()
index 28834ebc0b8a1ea96d28a52c5779192d06e8ab4b..a1df6da62f4c98c38455529bbedf2fbba2e08625 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import object
+    from builtins import object
 except : pass
 
 import types,os,re
@@ -35,46 +35,46 @@ from desWidgetCreeParam import Ui_desWidgetCreeParam
 
 
 class MonWidgetCreeParam(Ui_desWidgetCreeParam,QDialog):
-  """
-  """
-  def __init__(self,editor, name = None,fl = 0):
-       self.editor=editor
-       self.editor.afficheInfos("")
-       QDialog.__init__(self,editor)
-       self.setupUi(self)
-       self.connecterSignaux()
-       self.dejaExistant=0
-       self.listeTousParam=self.editor.jdc.params
-       self.dictListe={}
-       self.initToutesVal()
-
-  def connecterSignauxQT4(self) :
+    """
+    """
+    def __init__(self,editor, name = None,fl = 0):
+        self.editor=editor
+        self.editor.afficheInfos("")
+        QDialog.__init__(self,editor)
+        self.setupUi(self)
+        self.connecterSignaux()
+        self.dejaExistant=0
+        self.listeTousParam=self.editor.jdc.params
+        self.dictListe={}
+        self.initToutesVal()
+
+    def connecterSignauxQT4(self) :
         self.connect(self.lineEditVal,SIGNAL("returnPressed()"),self.lineEditValReturnPressed)
         self.connect(self.lineEditNom,SIGNAL("returnPressed()"),self.lineEditNomReturnPressed)
 
-  def connecterSignaux(self) :
+    def connecterSignaux(self) :
         self.lineEditVal.returnPressed.connect(self.lineEditValReturnPressed)
         self.lineEditNom.returnPressed.connect(self.lineEditNomReturnPressed)
         self.LBParam.itemDoubleClicked.connect(self.paramClicked)
 
-  def paramClicked(self,item):
-        if self.editor.nodeEnCours == None : 
+    def paramClicked(self,item):
+        if self.editor.nodeEnCours == None :
             QMessageBox.warning( self, tr("Pas de Mot-Clef"),tr("Attention! selectionnez un mot-clef"))
             return
         param= self.dictListe[item.text()]
         self.editor.nodeEnCours.lineEditVal.setText(param)
         self.editor.nodeEnCours.LEvaleurPressed()
-       
 
-  def creeParametre(self):
+
+    def creeParametre(self):
         nom=str(self.lineEditNom.text())
         val=str(self.lineEditVal.text())
         if val == "" or None : return
         if nom == "" or None : return
-        if len(self.editor.tree.selectedItems()) == 0 : 
-           itemAvant=self.editor.tree.racine 
-        else :                                     
-           itemAvant=self.editor.tree.selectedItems()[0]
+        if len(self.editor.tree.selectedItems()) == 0 :
+            itemAvant=self.editor.tree.racine
+        else :
+            itemAvant=self.editor.tree.selectedItems()[0]
         param=itemAvant.addParameters(True)
         param.item.setNom(nom)
         #PN self.val permet d entrer du texte
@@ -89,62 +89,62 @@ class MonWidgetCreeParam(Ui_desWidgetCreeParam,QDialog):
 
 
 
-  def lineEditValReturnPressed(self):
+    def lineEditValReturnPressed(self):
         qtVal=self.lineEditVal.text()
         valString=str(self.lineEditVal.text())
         self.val=""
         contexte={}
         exec("from math import *", contexte)
         jdc=self.editor.jdc
-        if jdc == None : 
-          self.editor.afficheInfos(tr(u"La Creation de parametre n est possible que dans un jeu de donnees"),Qt.red)
-          return
+        if jdc == None :
+            self.editor.afficheInfos(tr(u"La Creation de parametre n est possible que dans un jeu de donnees"),Qt.red)
+            return
 
         for p in jdc.params :
-           try:
-              tp=p.nom+'='+str(repr(p.valeur))
-              exec(tp, contexte)
-           except :
-              pass
+            try:
+                tp=p.nom+'='+str(repr(p.valeur))
+                exec(tp, contexte)
+            except :
+                pass
         monTexte="monParam="+valString
         try :
-          exec(monTexte, contexte)
-          self.val=valString
+            exec(monTexte, contexte)
+            self.val=valString
         except :
-          try :
-            monTexte="monParam='"+valString+"'"
-            self.val="'"+valString+"'"
-          except :
-            self.editor.afficheInfos(tr("Valeur incorrecte"),Qt.red)
+            try :
+                monTexte="monParam='"+valString+"'"
+                self.val="'"+valString+"'"
+            except :
+                self.editor.afficheInfos(tr("Valeur incorrecte"),Qt.red)
         if self.lineEditNom.text()!="" and self.dejaExistant==False : self.creeParametre()
 
 
-  def lineEditNomReturnPressed(self):
+    def lineEditNomReturnPressed(self):
         qtNom=self.lineEditNom.text()
         nom=str(qtNom)
         if not pattern_name.match(nom) :
-           self.lineEditNom.setText("")
-           commentaire=nom + tr(" n est pas un identifiant correct\n ")
-           self.editor.afficheInfos(commentaire,Qt.red)
+            self.lineEditNom.setText("")
+            commentaire=nom + tr(" n est pas un identifiant correct\n ")
+            self.editor.afficheInfos(commentaire,Qt.red)
         for p in self.editor.jdc.params :
-           if p.nom==nom :
-             commentaire=nom + tr(" existe deja\n ")
-             self.editor.afficheInfos(commentaire,Qt.red)
-             return
+            if p.nom==nom :
+                commentaire=nom + tr(" existe deja\n ")
+                self.editor.afficheInfos(commentaire,Qt.red)
+                return
 
         if self.lineEditVal.text()!="" : self.creeParametre()
         self.lineEditVal.setFocus(Qt.OtherFocusReason)
 
 
-  def initToutesVal(self):
+    def initToutesVal(self):
         self.LBParam.clear()
         for param in self.listeTousParam :
             self.LBParam.addItem((repr(param)))
             self.dictListe[repr(param)] = param.nom
-         
-         
-  
-  def valideParam(self):
+
+
+
+    def valideParam(self):
         if self.LBParam.selectedItems()== None : return
         lParam=[]
         for indice in range(len(self.LBParam.selectedItems())):
@@ -153,9 +153,8 @@ class MonWidgetCreeParam(Ui_desWidgetCreeParam,QDialog):
             lParam.append(param)
 
         try :
-          self.panel.ajoutNValeur(lParam)
+            self.panel.ajoutNValeur(lParam)
         except :
-          for p in lParam :
-             self.panel.ajout1Valeur(p)
+            for p in lParam :
+                self.panel.ajout1Valeur(p)
         self.close()
-
index 7ce1b64ff294228493eae7d06e423173fd20d469..0291ef14d2cd26d7f6de8ba2e94dd09594723020 100644 (file)
@@ -30,155 +30,30 @@ from copy import copy,deepcopy
 from PyQt5.QtCore import Qt
 
 
-      
-class MonWidgetCreeUserAssd ( MonWidgetSimpTxt):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-      MonWidgetSimpTxt. __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      #self.lineEditVal.returnPressed.connect(self.LEValeurAjouteDsPossible)
-
-  def LEvaleurPressed(self):
-      try :
-        if str(self.lineEditVal.text())=="" or str(self.lineEditVal.text())==None : return
-      except : pass
-      valeurEntree = str(self.lineEditVal.text())
-      if valeurEntree == self.oldValeurTexte : return
-      if self.oldValeurTexte == ""  : enCreation = True
-      else                          : enCreation = False
-      if enCreation : validite,commentaire=self.objSimp.creeUserASSDetSetValeur(valeurEntree)
-      else          : validite,commentaire=self.objSimp.renommeSdCree(valeurEntree)
-      if not enCreation : self.node.updateNodeTexte()
-      #PNPNPN -- signal update sur les fils ou ?
-      if commentaire != "" :
-         if validite : 
-            self.editor.afficheCommentaire(commentaire)
-            self.oldValeurTexte = self.lineEditVal.text()
-         else  : 
-            self.editor.afficheInfos(commentaire,Qt.red)
-            self.lineEditVal.setText("")
-            self.oldValeurTexte=""
-      self.parentQt.propageChange(self.objSimp.definition.type[0])
-      
-       
-class MonWidgetCreeListeUserAssd ( MonWidgetPlusieursBase):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-      MonWidgetPlusieursBase. __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
-  def ajout1Valeur(self,valeur=None):
-      if not valeur in list(self.dictValeurs.keys()):
-         validite,commentaire=self.objSimp.creeUserASSDetSetValeur(valeur)
-         MonWidgetPlusieursBase.ajout1Valeur(self,valeur)
-
-  def changeValeur(self,changeDePlace=False,oblige=False,numero=None):
-      #print ('dans changeValeur du CreeUserAssd', changeDePlace,numero)
-      self.changeUnLineEdit=False
-      if numero==None : 
-           self.echangeDeuxValeurs()
-           return
-      valeur = self.lineEditEnEdition.text()
-      #print (valeur)
-      if numero in list(self.dictLE.keys()) :
-         oldValeurUserAssd = self.dictLE[numero] 
-         if oldValeurUserAssd == None or oldValeurUserAssd == "" : enCreation = True
-         else : enCreation = False
-      else                         : 
-         enCreation     = True
-         oldValeurUserAssd =  ""
-      #print ('je traite')
-      if enCreation : validite, objASSD, commentaire=self.objSimp.creeUserASSD(valeur)
-      elif oldValeurUserAssd.nom == valeur : return
-      else :  
-         validite, commentaire=self.node.item.renommeSdCreeDsListe(oldValeurUserAssd,valeur)
-         nomDernierLineEdit="lineEditVal"+str(numero+1)
-         dernier=getattr(self,nomDernierLineEdit)
-         dernier.setFocus()
-         return
-  
-      if commentaire != "" and not validite:
-            self.editor.afficheInfos(commentaire,Qt.red)
-            self.lineEditEnEdition.setText("")
-            return
-      # on relit tout pour tenir compte des lignes blanches 
-      liste=[]
-      for i in range (1, self.indexDernierLabel+1):
-          if i == numero : liste.append(objASSD)
-          if i in list(self.dictLE.keys()) :
-             if self.dictLE[i] != None and self.dictLE[i] != "" : liste.append(self.dictLE[i])
-      self.node.item.object.state='changed'
-      validite=self.node.item.setValeur(liste)
-      self.setValide()
-      validite=self.node.item.isValid()
-      if validite : 
-         self.dictLE[numero] = objASSD
-         self.node.item.rattacheUserASSD(objASSD)
-         if self.indexDernierLabel < len(liste)  : self.ajoutLineEdit()
-         nomDernierLineEdit="lineEditVal"+str(numero+1)
-         self.listeValeursCourantes=liste
-         dernier=getattr(self,nomDernierLineEdit)
-         dernier.setFocus()
-      else : 
-         self.editor.afficheInfos('ajout impossible' ,Qt.red)
-         if objASSD : objASSD.supprime()
-         self.lineEditEnEdition.setText("")
-      self.parentQt.propageChange(self.objSimp.definition.type[0])
-
-
-  def leaveEventScrollArea(self,event):
-      pass
-
-  def echangeDeuxValeurs(self):
-      self.changeUnLineEdit=False
-      obj1=self.dictLE[self.num1] 
-      obj2=self.dictLE[self.num2] 
-      self.dictLE[self.num1]=obj2
-      self.dictLE[self.num2]=obj1
-      nomLineEdit=self.nomLine+str(self.num1)
-      courant=getattr(self,nomLineEdit)
-      if self.dictLE[self.num1] != None : courant.setText(self.dictLE[self.num1].nom)
-      else : courant.setText("")
-      nomLineEdit=self.nomLine+str(self.num2)
-      courant=getattr(self,nomLineEdit)
-      if self.dictLE[self.num2] != None : courant.setText(self.dictLE[self.num2].nom)
-      else : courant.setText("")
-      liste=[]
-      for i in list(self.dictLE.keys()): 
-             if self.dictLE[i] != None and self.dictLE[i] != "" : liste.append(self.dictLE[i])
-      validite=self.node.item.setValeur(liste)
-      courant.setFocus(True)
-
-  def descendLesLignes(self):
-      self.changeUnLineEdit=False
-      if self.numlineEditEnCours==self.indexDernierLabel : return
-      nouvelleValeur=None
-      for i in range (self.numlineEditEnCours+1, self.indexDernierLabel):
-             valeurAGarder=self.dictLE[i]
-             self.dictLE[i]=nouvelleValeur
-             nomLineEdit=self.nomLine+str(i)
-             courant=getattr(self,nomLineEdit)
-             if nouvelleValeur != None : courant.setText(nouvelleValeur.nom)
-             else : courant.setText("")
-             nouvelleValeur=valeurAGarder
-      
-
-  def moinsPushed(self):
-     if self.numlineEditEnCours == 0 : return
-     if self.indexDernierLabel == 0 : return
-     objASSD=self.dictLE[self.numlineEditEnCours]
-     if objASSD : objASSD.supprime()
-     self.lineEditEnEdition.setText("")
-
-     #self.dictLE.pop(self.numlineEditEnCours)
-     for i in range (self.numlineEditEnCours, self.indexDernierLabel-1):
-             self.dictLE[i]= self.dictLE[i+1]
-             nomLineEdit=self.nomLine+str(i)
-             courant=getattr(self,nomLineEdit)
-             if self.dictLE[i] != None : courant.setText(self.dictLE[i].nom)
-             else : courant.setText("")
-     nomLineEdit=self.nomLine+str(self.indexDernierLabel)
-     courant=getattr(self,nomLineEdit)
-     courant.setText("")
-     self.dictLE[self.indexDernierLabel]=None
-     liste=[]
-     for i in list(self.dictLE.keys()): 
-          if self.dictLE[i] != None and self.dictLE[i] != "" : liste.append(self.dictLE[i])
-     validite=self.node.item.setValeur(liste)
 
+class MonWidgetCreeUserAssd ( MonWidgetSimpTxt):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+        MonWidgetSimpTxt. __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
+        #self.lineEditVal.returnPressed.connect(self.LEValeurAjouteDsPossible)
+
+    def LEvaleurPressed(self):
+        try :
+            if str(self.lineEditVal.text())=="" or str(self.lineEditVal.text())==None : return
+        except : pass
+        valeurEntree = str(self.lineEditVal.text())
+        if valeurEntree == self.oldValeurTexte : return
+        if self.oldValeurTexte == ""  : enCreation = True
+        else                          : enCreation = False
+        if enCreation : validite,commentaire=self.objSimp.creeUserASSDetSetValeur(valeurEntree)
+        else          : validite,commentaire=self.objSimp.renommeSdCree(valeurEntree)
+        if not enCreation : self.node.updateNodeTexte()
+        #PNPNPN -- signal update sur les fils ou ?
+        if commentaire != "" :
+            if validite :
+                self.editor.afficheCommentaire(commentaire)
+                self.oldValeurTexte = self.lineEditVal.text()
+            else  :
+                self.editor.afficheInfos(commentaire,Qt.red)
+                self.lineEditVal.setText("")
+                self.oldValeurTexte=""
+        self.parentQt.propageChange(self.objSimp.definition.type[0],self)
index f6d723f49465ca7c10113bcbbbefbb38544f217a..f2dcdc3b7721f3c5c9d67c4ca22240701b43d867 100644 (file)
@@ -25,27 +25,26 @@ import types,os
 from Extensions.i18n import tr
 
 from .feuille               import Feuille
-from .monWidgetSimpTuple    import MonWidgetSimpTuple 
-from desWidgetDate       import Ui_WidgetDate 
+from .monWidgetSimpTuple    import MonWidgetSimpTuple
+from desWidgetDate       import Ui_WidgetDate
 
 
 class MonWidgetDate (Ui_WidgetDate,MonWidgetSimpTuple):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=3
         MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         if self.objSimp.isImmuable() :
-           self.lineEditVal1.setDisabled(True)
-           self.lineEditVal2.setDisabled(True)
-           self.lineEditVal3.setDisabled(True)
-           self.lineEditVal1.setStyleSheet(QString.fromUtf8("background:rgb(244,244,244);\n" "border:0px;\n"))
-           self.lineEditVal2.setStyleSheet(QString.fromUtf8("background:rgb(244,244,244);\n" "border:0px;\n"))
-           self.lineEditVal3.setStyleSheet(QString.fromUtf8("background:rgb(244,244,244);\n" "border:0px;\n"))
-           self.lineEditVal1.setToolTip(tr("Valeur non modifiable"))
-           self.lineEditVal2.setToolTip(tr("Valeur non modifiable"))
-           self.lineEditVal3.setToolTip(tr("Valeur non modifiable"))
+            self.lineEditVal1.setDisabled(True)
+            self.lineEditVal2.setDisabled(True)
+            self.lineEditVal3.setDisabled(True)
+            self.lineEditVal1.setStyleSheet(QString.fromUtf8("background:rgb(244,244,244);\n" "border:0px;\n"))
+            self.lineEditVal2.setStyleSheet(QString.fromUtf8("background:rgb(244,244,244);\n" "border:0px;\n"))
+            self.lineEditVal3.setStyleSheet(QString.fromUtf8("background:rgb(244,244,244);\n" "border:0px;\n"))
+            self.lineEditVal1.setToolTip(tr("Valeur non modifiable"))
+            self.lineEditVal2.setToolTip(tr("Valeur non modifiable"))
+            self.lineEditVal3.setToolTip(tr("Valeur non modifiable"))
         else :
-           self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
+            self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
         #self.maCommande.listeAffichageWidget.append(self.lineEditVal2)
         #self.maCommande.listeAffichageWidget.append(self.lineEditVal3)
-
index 37add2fefaf3c42bdf143b5f19e268c75cfb73eb..8bf1c5dc283ff64be47ecc37106ca3eb72f66197 100644 (file)
@@ -32,46 +32,46 @@ from Extensions.i18n import tr
 
 # PN 18 mai 2020 : affiche systematique des optionnels
 class MonWidgetFactCommun(Groupe):
-  """
-  """
-  def __init__(self,node,editor,parentQt,definition, obj, niveau,commande):
-      #print "fact : ",node.item.nom
-      Groupe.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
-      labeltext,fonte,couleur = self.node.item.getLabelText()
-      self.GroupBox.setText(tr(labeltext))
-      self.GroupBox.setTextInteractionFlags(Qt.TextSelectableByMouse)
-      self.parentQt.commandesLayout.insertWidget(-1,self)
-      self.doitAfficherOptionnel=True
-      min,max=obj.getMinMax()
-      if max < 2 and  hasattr(self, 'RBPlus') : self.RBPlus.close() 
-      if max > 1 and  hasattr(self, 'RBPlus') : self.RBPlus.clicked.connect(self.ajouteMCParPB)
+    """
+    """
+    def __init__(self,node,editor,parentQt,definition, obj, niveau,commande):
+        #print ("fact : ",node.item.nom)
+        Groupe.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
+        labeltext,fonte,couleur = self.node.item.getLabelText()
+        self.GroupBox.setText(tr(labeltext))
+        #self.GroupBox.setTextInteractionFlags(Qt.TextSelectableByMouse)
+        self.parentQt.commandesLayout.insertWidget(-1,self)
+        self.doitAfficherOptionnel=True
+        min,max=obj.getMinMax()
+        if max < 2 and  hasattr(self, 'RBPlus') : self.RBPlus.close()
+        if max > 1 and  hasattr(self, 'RBPlus') : self.RBPlus.clicked.connect(self.ajouteMCParPB)
 
-  def enterEvent(self,event):
-      #print "enterEvent ", self.node.item.getLabelText()[0]
-      self.doitAfficherOptionnel=True
-      QWidget.enterEvent(self,event)
-      QTimer.singleShot(500, self.delayAffiche)
+    def enterEvent(self,event):
+        #print "enterEvent ", self.node.item.getLabelText()[0]
+        self.doitAfficherOptionnel=True
+        QWidget.enterEvent(self,event)
+        QTimer.singleShot(500, self.delayAffiche)
 
-  def leaveEvent(self,event):
-      #print "leaveEvent", self.node.item.getLabelText()[0]
-      #self.doitAfficherOptionnel=False
-      QWidget.leaveEvent(self,event)
+    def leaveEvent(self,event):
+        #print "leaveEvent", self.node.item.getLabelText()[0]
+        #self.doitAfficherOptionnel=False
+        QWidget.leaveEvent(self,event)
 
-  def delayAffiche(self):
-      #print "delayAffiche, self.doitAfficherOptionnel = ", self.doitAfficherOptionnel
-      if self.doitAfficherOptionnel and self.editor.code != "CARMELCND" :self.afficheOptionnel()
+    def delayAffiche(self):
+        #print "delayAffiche, self.doitAfficherOptionnel = ", self.doitAfficherOptionnel
+        if self.doitAfficherOptionnel and self.editor.code != "CARMELCND" :self.afficheOptionnel()
 
-  def ajouteMCParPB(self):
-      texteListeNom="+"+self.obj.nom
-      parentOuAjouter=self.parentQt
-      from .monWidgetBloc import MonWidgetBloc
-      while (parentOuAjouter and isinstance(parentOuAjouter, MonWidgetBloc)) :
-         parentOuAjouter=parentOuAjouter.parentQt
-      parentOuAjouter.ajoutMC(texteListeNom)
+    def ajouteMCParPB(self):
+        texteListeNom="+"+self.obj.nom
+        parentOuAjouter=self.parentQt
+        from .monWidgetBloc import MonWidgetBloc
+        while (parentOuAjouter and isinstance(parentOuAjouter, MonWidgetBloc)) :
+            parentOuAjouter=parentOuAjouter.parentQt
+        parentOuAjouter.ajoutMC(texteListeNom)
 
 
 #  def reaffiche(self, nodeAVoir=None):
-#      print ('ds reaffiche : ', self.obj.nom, self.node.firstDeplie) 
+#      print ('ds reaffiche : ', self.obj.nom, self.node.firstDeplie)
 #      if self.node.editor.maConfiguration.afficheFirstPlies and self.node.firstDeplie:
 #         self.node.firstDeplie =False
 #         self.node.setPlie()
@@ -80,14 +80,14 @@ class MonWidgetFactCommun(Groupe):
 
 
 class MonWidgetFact(Ui_WidgetFact,MonWidgetFactCommun):
-  #def __init__(self,node,editor,parentQt,definition, obj, niveau,commande,insertIn=1):
-  #    MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande,insertIn)
-  def __init__(self,node,editor,parentQt,definition, obj, niveau,commande):
-      MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
+    #def __init__(self,node,editor,parentQt,definition, obj, niveau,commande,insertIn=1):
+    #    MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande,insertIn)
+    def __init__(self,node,editor,parentQt,definition, obj, niveau,commande):
+        MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
 
 class MonWidgetFactTableau(Ui_WidgetFact,MonWidgetFactCommun):
-  #def __init__(self,node,editor,parentQt,definition, obj, niveau,commande,insertIn=1):
-  #    MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande,insertIn)
-  def __init__(self,node,editor,parentQt,definition, obj, niveau,commande):
-      MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
-      MonWidgetFactTableau.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
+    #def __init__(self,node,editor,parentQt,definition, obj, niveau,commande,insertIn=1):
+    #    MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande,insertIn)
+    def __init__(self,node,editor,parentQt,definition, obj, niveau,commande):
+        MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
+        MonWidgetFactTableau.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
index 2e39daf89b5349c1b2def99e0452df0cdac33fc8..51066dca3a76734243d22e2b5ff73a69bb168637 100644 (file)
@@ -26,16 +26,15 @@ from Extensions.i18n import tr
 # Import des panels
 
 class MonWidgetFactPlie(Ui_WidgetFactPlie,Groupe):
-  """
-  """
-  #def __init__(self,node,editor,parentQt,definition, obj, niveau,commande,insertIn=-1):
-  def __init__(self,node,editor,parentQt,definition, obj, niveau,commande):
-      #print "fact plie : ",node.item.nom
-      node.fenetreAAfficher=self
-      Groupe.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
-      self.groupBox.setText(self.node.item.getLabelText()[0])
-      self.parentQt.commandesLayout.insertWidget(-1,self)
-
-  def traiteClicSurLabel(self,texte):
-      return
+    """
+    """
+    #def __init__(self,node,editor,parentQt,definition, obj, niveau,commande,insertIn=-1):
+    def __init__(self,node,editor,parentQt,definition, obj, niveau,commande):
+        #print "fact plie : ",node.item.nom
+        node.fenetreAAfficher=self
+        Groupe.__init__(self,node,editor,parentQt, definition,obj,niveau,commande)
+        self.groupBox.setText(self.node.item.getLabelText()[0])
+        self.parentQt.commandesLayout.insertWidget(-1,self)
 
+    def traiteClicSurLabel(self,texte):
+        return
index b7aba8bd1952cdc6a23162b0983b91f6ec6c800d..cff3948854dff826ff93d5697fcb1fe83a49f197 100644 (file)
@@ -21,7 +21,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 from desWidgetFormule import Ui_WidgetFormule
@@ -33,58 +33,58 @@ from PyQt5.QtCore import Qt
 
 
 from Extensions.i18n import tr
-import Accas 
+import Accas
 import os
 
-    
+
 # Import des panels
 
 class MonWidgetFormule(QWidget,Ui_WidgetFormule,FacultatifOuOptionnel):
-  """
-  """
-  def __init__(self,node,editor,etape):
-      #print "MonWidgetFormule ", self
-      QWidget.__init__(self,None)
-      self.node=node
-      self.node.fenetre=self
-      self.editor=editor
-      self.appliEficas=self.editor.appliEficas
-      self.repIcon=self.appliEficas.repIcon
-      self.setupUi(self)
-      
-      self.setIconePoubelle()
-      self.setIconesGenerales()
-      self.setValeurs()
-      self.setValide()
-
-     
-      if self.editor.code in ['MAP','CARMELCND'] : self.bCatalogue.close()
-      else : self.bCatalogue.clicked.connect(self.afficheCatalogue)
-      if self.editor.code in ['Adao','MAP','ADAO'] : 
-          self.bAvant.close()
-          self.bApres.close()
-      else : 
-          self.bAvant.clicked.connect(self.afficheAvant)
-          self.bApres.clicked.connect(self.afficheApres)
-      self.LENom.returnPressed.connect(self.nomChange)
-      self.LENomFormule.returnPressed.connect(self.nomFormuleSaisi)
-      self.LENomsArgs.returnPressed.connect(self.argsSaisis)
-      self.LECorpsFormule.returnPressed.connect(self.FormuleSaisie)
-
-
-   
-      self.racine=self.node.tree.racine
-      self.monOptionnel=None
-      self.editor.fermeOptionnel()
-      #print "fin init de widget Commande"
-      
-
-  def donnePremier(self):
-      self.listeAffichageWidget[0].setFocus(7)
-
-
-  def setValeurs(self):
+    """
+    """
+    def __init__(self,node,editor,etape):
+        #print "MonWidgetFormule ", self
+        QWidget.__init__(self,None)
+        self.node=node
+        self.node.fenetre=self
+        self.editor=editor
+        self.appliEficas=self.editor.appliEficas
+        self.repIcon=self.appliEficas.repIcon
+        self.setupUi(self)
+
+
+        self.setIconePoubelle()
+        self.setIconesGenerales()
+        self.setValeurs()
+        self.setValide()
+
+
+        if self.editor.code in ['MAP','CARMELCND'] : self.bCatalogue.close()
+        else : self.bCatalogue.clicked.connect(self.afficheCatalogue)
+        if self.editor.code in ['Adao','MAP','ADAO'] :
+            self.bAvant.close()
+            self.bApres.close()
+        else :
+            self.bAvant.clicked.connect(self.afficheAvant)
+            self.bApres.clicked.connect(self.afficheApres)
+        self.LENom.returnPressed.connect(self.nomChange)
+        self.LENomFormule.returnPressed.connect(self.nomFormuleSaisi)
+        self.LENomsArgs.returnPressed.connect(self.argsSaisis)
+        self.LECorpsFormule.returnPressed.connect(self.FormuleSaisie)
+
+
+
+        self.racine=self.node.tree.racine
+        self.monOptionnel=None
+        self.editor.fermeOptionnel()
+        #print "fin init de widget Commande"
+
+
+    def donnePremier(self):
+        self.listeAffichageWidget[0].setFocus(7)
+
+
+    def setValeurs(self):
         self.LENomFormule.setText(self.node.item.getNom())
         self.LECorpsFormule.setText(self.node.item.getCorps())
         texte_args=""
@@ -95,110 +95,109 @@ class MonWidgetFormule(QWidget,Ui_WidgetFormule,FacultatifOuOptionnel):
         self.LENomsArgs.setText(texte_args)
 
 
-  def nomChange(self):
-      nom = str(self.LENom.text())
-      self.LENomFormule.setText(nom)
-      self.nomFormuleSaisi()
-
-
-  def afficheCatalogue(self):
-      if self.editor.widgetOptionnel != None : self.monOptionnel.hide()
-      self.racine.affichePanneau()
-      if self.node : self.node.select()
-      else : self.racine.select()
-
-  def afficheApres(self):
-       self.node.selectApres()
-
-  def afficheAvant(self):
-       self.node.selectAvant()
-
-  def setValide(self):
-      if not(hasattr (self,'RBValide')) : return
-      icon = QIcon()
-      if self.node.item.object.isValid() :
-         icon=QIcon(self.repIcon+"/ast-green-ball.png")
-      else :
-         icon=QIcon(self.repIcon+"/ast-red-ball.png")
-      if self.node.item.getIconName() == "ast-yellow-square" :
-         icon=QIcon(self.repIcon+"/ast-yel-ball.png")
-      self.RBValide.setIcon(icon)
-
-
-  def nomFormuleSaisi(self):
-      nomFormule = str(self.LENomFormule.text())
-      if nomFormule == '' : return
-      self.LENom.setText(nomFormule)
-      test,erreur = self.node.item.verifNom(nomFormule)
-      if test :
-         commentaire=nomFormule+tr(" est un nom valide pour une FORMULE")
-         self.editor.afficheInfos(commentaire)
-      else :
-         commentaire=nomFormule+tr(" n'est pas un nom valide pour une FORMULE")
-         self.editor.afficheInfos(commentaire,Qt.red)
-         return
-      if str(self.LENomsArgs.text()) != "" and  str(self.LECorpsFormule.text())!= "" : self.BOkPressedFormule()
-      self.LENomsArgs.setFocus(7)
-
-  def argsSaisis(self):
-      arguments = str(self.LENomsArgs.text())
-      if arguments == '' : return
-      test,erreur = self.node.item.verifArguments(arguments)
-      if test:
-         commentaire=tr("Argument(s) valide(s) pour une FORMULE")
-         self.editor.afficheInfos(commentaire)
-      else:
-         commentaire=tr("Argument(s) invalide(s) pour une FORMULE")
-         self.editor.afficheInfos(commentaire,Qt.red)
-      if str(self.LECorpsFormule.text()) != "" and  str(self.LENomFormule.text())!= "" : self.BOkPressedFormule()
-      self.LECorpsFormule.setFocus(7)
-
-  def FormuleSaisie(self):
-      nomFormule = str(self.LENomFormule.text())
-      arguments  = str(self.LENomsArgs.text())
-      expression = str(self.LECorpsFormule.text())
-      if expression == '' : return
-      test,erreur = self.node.item.verifFormule_python((nomFormule,"REEL",arguments,expression))
-
-      if test:
-         commentaire=tr("Corps de FORMULE valide")
-         self.editor.afficheInfos(commentaire)
-      else:
-         commentaire=tr("Corps de FORMULE invalide")
-         self.editor.afficheInfos(commentaire,Qt.red)
-      if str(self.LENomsArgs.text()) != "" and  str(self.LENomFormule.text())!= "" : self.BOkPressedFormule()
-
-  def BOkPressedFormule(self):
-      #print dir(self)
-      #if self.parent.modified == 'n' : self.parent.initModif()
-
-      nomFormule = str(self.LENomFormule.text())
-      test,erreur = self.node.item.verifNom(nomFormule)
-      if not test :
-         self.editor.afficheInfos(erreur,Qt.red)
-         return
-
-      arguments  = str(self.LENomsArgs.text())
-      test,erreur = self.node.item.verifArguments(arguments)
-      if not test :
-         self.editor.afficheInfos(erreur,Qt.red)
-         return
-
-      expression = str(self.LECorpsFormule.text())
-      test,erreur = self.node.item.verifFormule_python((nomFormule,"REEL",arguments,expression))
-      if not test :
-         self.editor.afficheInfos(erreur,Qt.red)
-         return
-
-      test=self.node.item.object.updateFormulePython(formule=(nomFormule,"REEL",arguments,expression))
-      test,erreur = self.node.item.saveFormule(nomFormule,"REEL",arguments,expression)
-      if test :
-         self.node.onValid()
-         self.node.update_valid()
-         commentaire = "Formule saisie"
-         self.editor.afficheInfos(commentaire)
-      else:
-         commentaire ="Formule incorrecte : " + erreur
-         self.editor.afficheInfos(commentaire,Qt.red)
-      self.editor.initModif()
-
+    def nomChange(self):
+        nom = str(self.LENom.text())
+        self.LENomFormule.setText(nom)
+        self.nomFormuleSaisi()
+
+
+    def afficheCatalogue(self):
+        if self.editor.widgetOptionnel != None : self.monOptionnel.hide()
+        self.racine.affichePanneau()
+        if self.node : self.node.select()
+        else : self.racine.select()
+
+    def afficheApres(self):
+        self.node.selectApres()
+
+    def afficheAvant(self):
+        self.node.selectAvant()
+
+    def setValide(self):
+        if not(hasattr (self,'RBValide')) : return
+        icon = QIcon()
+        if self.node.item.object.isValid() :
+            icon=QIcon(self.repIcon+"/ast-green-ball.png")
+        else :
+            icon=QIcon(self.repIcon+"/ast-red-ball.png")
+        if self.node.item.getIconName() == "ast-yellow-square" :
+            icon=QIcon(self.repIcon+"/ast-yel-ball.png")
+        self.RBValide.setIcon(icon)
+
+
+    def nomFormuleSaisi(self):
+        nomFormule = str(self.LENomFormule.text())
+        if nomFormule == '' : return
+        self.LENom.setText(nomFormule)
+        test,erreur = self.node.item.verifNom(nomFormule)
+        if test :
+            commentaire=nomFormule+tr(" est un nom valide pour une FORMULE")
+            self.editor.afficheInfos(commentaire)
+        else :
+            commentaire=nomFormule+tr(" n'est pas un nom valide pour une FORMULE")
+            self.editor.afficheInfos(commentaire,Qt.red)
+            return
+        if str(self.LENomsArgs.text()) != "" and  str(self.LECorpsFormule.text())!= "" : self.BOkPressedFormule()
+        self.LENomsArgs.setFocus(7)
+
+    def argsSaisis(self):
+        arguments = str(self.LENomsArgs.text())
+        if arguments == '' : return
+        test,erreur = self.node.item.verifArguments(arguments)
+        if test:
+            commentaire=tr("Argument(s) valide(s) pour une FORMULE")
+            self.editor.afficheInfos(commentaire)
+        else:
+            commentaire=tr("Argument(s) invalide(s) pour une FORMULE")
+            self.editor.afficheInfos(commentaire,Qt.red)
+        if str(self.LECorpsFormule.text()) != "" and  str(self.LENomFormule.text())!= "" : self.BOkPressedFormule()
+        self.LECorpsFormule.setFocus(7)
+
+    def FormuleSaisie(self):
+        nomFormule = str(self.LENomFormule.text())
+        arguments  = str(self.LENomsArgs.text())
+        expression = str(self.LECorpsFormule.text())
+        if expression == '' : return
+        test,erreur = self.node.item.verifFormule_python((nomFormule,"REEL",arguments,expression))
+
+        if test:
+            commentaire=tr("Corps de FORMULE valide")
+            self.editor.afficheInfos(commentaire)
+        else:
+            commentaire=tr("Corps de FORMULE invalide")
+            self.editor.afficheInfos(commentaire,Qt.red)
+        if str(self.LENomsArgs.text()) != "" and  str(self.LENomFormule.text())!= "" : self.BOkPressedFormule()
+
+    def BOkPressedFormule(self):
+        #print dir(self)
+        #if self.parent.modified == 'n' : self.parent.initModif()
+
+        nomFormule = str(self.LENomFormule.text())
+        test,erreur = self.node.item.verifNom(nomFormule)
+        if not test :
+            self.editor.afficheInfos(erreur,Qt.red)
+            return
+
+        arguments  = str(self.LENomsArgs.text())
+        test,erreur = self.node.item.verifArguments(arguments)
+        if not test :
+            self.editor.afficheInfos(erreur,Qt.red)
+            return
+
+        expression = str(self.LECorpsFormule.text())
+        test,erreur = self.node.item.verifFormule_python((nomFormule,"REEL",arguments,expression))
+        if not test :
+            self.editor.afficheInfos(erreur,Qt.red)
+            return
+
+        test=self.node.item.object.updateFormulePython(formule=(nomFormule,"REEL",arguments,expression))
+        test,erreur = self.node.item.saveFormule(nomFormule,"REEL",arguments,expression)
+        if test :
+            self.node.onValid()
+            self.node.update_valid()
+            commentaire = "Formule saisie"
+            self.editor.afficheInfos(commentaire)
+        else:
+            commentaire ="Formule incorrecte : " + erreur
+            self.editor.afficheInfos(commentaire,Qt.red)
+        self.editor.initModif()
index d3e1444ccbb9bff084363e338a357d3a5d50e878..b95cf974deb8f20a1d361924f74fbe692ec30329 100644 (file)
@@ -26,10 +26,10 @@ from Extensions.i18n import tr
 
 from .feuille               import Feuille
 from .monWidgetSimpBase     import MonWidgetSimpBase
-from desWidgetHeure       import Ui_WidgetHeure 
+from desWidgetHeure       import Ui_WidgetHeure
 
 
 class MonWidgetHeure (Ui_WidgetHeure,MonWidgetSimpBase):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         MonWidgetSimpBase.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
index f3608e9626a8ad6a00bba058056df283892f50b9..3a920c1a8b4b1257ffde44c4bc837558e2457c23 100644 (file)
@@ -24,64 +24,62 @@ from PyQt5.QtWidgets import QWidget
 
 from Extensions.i18n import tr
 from desWidgetInactif import Ui_WidgetInactif
-import Accas 
+import Accas
 import os
 
-    
+
 # Import des panels
 
 class MonWidgetInactif(QWidget,Ui_WidgetInactif):
-  """
-  """
-  def __init__(self,node,editor):
-       QWidget.__init__(self,None)
-       self.node=node
-       self.editor=editor
-       self.setupUi(self)
-       from .monWidgetOptionnel import MonWidgetOptionnel
-       if self.editor.widgetOptionnel!= None :
-          self.monOptionnel=self.editor.widgetOptionnel
-       else :
-          self.monOptionnel=MonWidgetOptionnel(self)
-          self.editor.widgetOptionnel=self.monOptionnel
-          self.editor.splitter.addWidget(self.monOptionnel)
-          self.editor.restoreSplitterSizes()
-       self.afficheOptionnel()
-       self.bAvant.clicked.connect(self.afficheAvant)
-       self.bApres.clicked.connect(self.afficheApres)
-       self.bCatalogue.clicked.connect(self.afficheCatalogue)
-       self.labelNomCommande.setText(tr(self.node.item.nom))
-       self.labelNomCommande.setEnabled(False)
-
-  def traiteClicSurLabel(self):
-      pass
-  
-  def donnePremier(self):
-      pass
+    """
+    """
+    def __init__(self,node,editor):
+        QWidget.__init__(self,None)
+        self.node=node
+        self.editor=editor
+        self.setupUi(self)
+        from .monWidgetOptionnel import MonWidgetOptionnel
+        if self.editor.widgetOptionnel!= None :
+            self.monOptionnel=self.editor.widgetOptionnel
+        else :
+            self.monOptionnel=MonWidgetOptionnel(self)
+            self.editor.widgetOptionnel=self.monOptionnel
+            self.editor.splitter.addWidget(self.monOptionnel)
+            self.editor.restoreSplitterSizes()
+        self.afficheOptionnel()
+        self.bAvant.clicked.connect(self.afficheAvant)
+        self.bApres.clicked.connect(self.afficheApres)
+        self.bCatalogue.clicked.connect(self.afficheCatalogue)
+        self.labelNomCommande.setText(tr(self.node.item.nom))
+        self.labelNomCommande.setEnabled(False)
 
-  def setValide(self):
-      pass 
+    def traiteClicSurLabel(self):
+        pass
 
-  def afficheOptionnel(self):
-      # N a pas de parentQt. doit donc etre redefini
-      if self.editor.maConfiguration.closeOptionnel : return
-      liste=[]
-      #print "dans afficheOptionnel", self.monOptionnel
-      # dans le cas ou l insertion n a pas eu leiu (souci d ordre par exemple)
-      #if self.monOptionnel == None : return
-      self.monOptionnel.parentMC=self
-      self.monOptionnel.afficheOptionnelVide()
+    def donnePremier(self):
+        pass
 
+    def setValide(self):
+        pass
 
-  def afficheCatalogue(self):
-      if self.editor.widgetOptionnel != None : self.monOptionnel.hide()
-      self.node.tree.racine.affichePanneau()
-      self.node.tree.racine.select()
+    def afficheOptionnel(self):
+        # N a pas de parentQt. doit donc etre redefini
+        if self.editor.maConfiguration.closeOptionnel : return
+        liste=[]
+        #print "dans afficheOptionnel", self.monOptionnel
+        # dans le cas ou l insertion n a pas eu leiu (souci d ordre par exemple)
+        #if self.monOptionnel == None : return
+        self.monOptionnel.parentMC=self
+        self.monOptionnel.afficheOptionnelVide()
 
-  def afficheApres(self):
-       self.node.selectApres()
 
-  def afficheAvant(self):
-       self.node.selectAvant()
+    def afficheCatalogue(self):
+        if self.editor.widgetOptionnel != None : self.monOptionnel.hide()
+        self.node.tree.racine.affichePanneau()
+        self.node.tree.racine.select()
 
+    def afficheApres(self):
+        self.node.selectApres()
 
+    def afficheAvant(self):
+        self.node.selectAvant()
index e05d2d03061ec668f51570622e28a5f6ca985bb9..a8f6a028452c959700b8142ab7b66577fedb574b 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os
@@ -29,13 +29,13 @@ import types,os
 from PyQt5.QtWidgets import QWidget
 from Extensions.i18n import tr
 
-from desWidgetInformation  import Ui_WidgetInformative 
+from desWidgetInformation  import Ui_WidgetInformative
 
 
 class MonWidgetInfo (Ui_WidgetInformative,QWidget):
 # c est juste la taille des differents widgets de base qui change
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         QWidget.__init__(self,None)
         self.setupUi(self)
         valeur=node.item.getValeur()
index bf451cd5616ac4f82a16fac451cf459c4ea5ff95..e4db00ad85b0f9d129867223fe61812054761b26 100644 (file)
@@ -20,8 +20,8 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 
 import types,os
@@ -34,39 +34,38 @@ from PyQt5.QtCore import Qt
 
 from Extensions.i18n import tr
 
-from desWidgetIntoSug        import Ui_WidgetIntoSug 
-from monWidgetPlusieursInto  import MonWidgetPlusieursInto 
+from desWidgetIntoSug        import Ui_WidgetIntoSug
+from monWidgetPlusieursInto  import MonWidgetPlusieursInto
 
 class GereAjoutDsPossible:
-  def LEValeurAjouteDsPossible(self):
-       text=str(self.lineEditVal.text())
-       if text == "" : return
-       # il faudrait essauer d en obtenir un reel, un tuple ou ...
-       # si cela est utilise pour autre chose que Telemac
-       # tout devrait etre fait ici
-       if not isinstance(text,str) : 
-          self.lineEditVal.setText("")
-          return
-       if self.node.item.hasIntoSug() : 
-          self.maListeDeValeur=list(self.node.item.getListePossibleAvecSug([]))
-          self.maListeDeValeur.insert(0,text)
-       else :
-         try :
-           self.monSimpDef.intoSug.insert(0,text)
-         except : 
-           self.monSimpDef.intoSug=list(self.monSimpDef.intoSug)
-           self.monSimpDef.intoSug.insert(0,text)
-       # selon si on est une liste ou un combo
-       try : self.ajouteValeurPossible(text)
-       except : self.setValeurs()
+    def LEValeurAjouteDsPossible(self):
+        text=str(self.lineEditVal.text())
+        if text == "" : return
+        # il faudrait essauer d en obtenir un reel, un tuple ou ...
+        # si cela est utilise pour autre chose que Telemac
+        # tout devrait etre fait ici
+        if not isinstance(text,str) :
+            self.lineEditVal.setText("")
+            return
+        if self.node.item.hasIntoSug() :
+            self.maListeDeValeur=list(self.node.item.getListePossibleAvecSug([]))
+            self.maListeDeValeur.insert(0,text)
+        else :
+            try :
+                self.monSimpDef.intoSug.insert(0,text)
+            except :
+                self.monSimpDef.intoSug=list(self.monSimpDef.intoSug)
+                self.monSimpDef.intoSug.insert(0,text)
+        # selon si on est une liste ou un combo
+        try : self.ajouteValeurPossible(text)
+        except : self.setValeurs()
 
 class MonWidgetIntoSug (Ui_WidgetIntoSug, MonWidgetPlusieursInto,GereAjoutDsPossible):
 # Attention Attention
 # cette wdget ne fonctionne actuellement que pour Telemac
-# on attend du texte . on n essaye pas de transformer 
+# on attend du texte . on n essaye pas de transformer
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
 
         MonWidgetPlusieursInto.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.lineEditVal.returnPressed.connect(self.LEValeurAjouteDsPossible)
-
index 248c6e1415c86ba277c68fc2c6385ef4236aef41..02fb9311bda7fc5277ad3b57457a31af294b9208 100644 (file)
@@ -21,8 +21,8 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 
 import types,os,sys
@@ -30,197 +30,235 @@ import types,os,sys
 # Modules Eficas
 from Extensions.i18n import tr
 from .feuille         import Feuille
+from Extensions.eficas_exception import EficasException
 
 
-from desWidgetMatrice  import Ui_desWidgetMatrice 
+from desWidgetMatrice  import Ui_desWidgetMatrice
 
 from PyQt5.QtCore import QSize, Qt
-from PyQt5.QtWidgets import QTableWidgetItem
-from PyQt5.QtGui import QIcon
+from PyQt5.QtWidgets import QTableWidgetItem, QTableWidget
+from PyQt5.QtGui import QIcon, QColor
+from PyQt5.QtWidgets import  QMessageBox
 
 
 class MonWidgetMatrice (Ui_desWidgetMatrice,Feuille):
 # c est juste la taille des differents widgets de base qui change
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-        self.monType= self.node.item.object.definition.type[0]
+        self.monType = self.node.item.object.definition.type[0]
         parentQt.commandesLayout.insertWidget(-1,self)
         self.nbLigs=0
         self.nbCols=0
-        self.nomVariables={}
         self.creeColonnes()
         self.connecterSignaux()
+        self.initialValeur()
+
+
+    def connecterSignaux(self) :
+        self.TBMatrice.itemChanged.connect(self.itemChanged)
+        self.PBrefresh.clicked.connect( self.acceptVal)
+        self.TBMatrice.focusOutEvent=self.monFocusOutEvent
+
+
+    def monFocusOutEvent(self,event):
+        self.acceptVal()
+        QTableWidget.focusOutEvent(self.TBMatrice,event)
+
+
+    def itemChanged(self):
+        monItem=self.TBMatrice.currentItem()
+        if monItem==None : return
+        texte=monItem.text()
+        if texte=="" : return
+        boolOk, commentaire = self.monType.verifItem(texte,self.node.item.object)
+        if not boolOk :
+            self.editor.afficheInfos(tr(commentaire),Qt.red)
+            monItem.setText("")
+            return
+        if self.monType.coloree : self.coloreItem(monItem,texte)
+
+
+    def coloreItem(self,monItem,texte):
+        if texte in self.monType.dictCouleurs.keys() :
+            monItem.setBackground(self.monType.dictCouleurs[texte])
+        else :
+            i=self.monType.indiceCouleur%20
+            newCouleur=QColor(*self.monType.listeCouleurs[i])
+            #monItem.setBackground(Qt.red)
+            monItem.setBackground(newCouleur)
+            self.monType.dictCouleurs[texte]=newCouleur
+            self.monType.indiceCouleur+=1
+            
+
+
+    def creeColonnes(self):
+        if self.monType.methodeCalculTaille != None :
+            try:
+                MonWidgetMatrice.__dict__[self.monType.methodeCalculTaille](*(self,))
+            except :
+                QMessageBox.critical( self, tr("Mauvaise execution "),tr( "impossible d executer la methode ") + monType.methodeCalculTaille )
+                return
+        else :
+            self.nbLigs=self.monType.nbLigs
+            self.nbCols=self.monType.nbCols
+        self.TBMatrice.setColumnCount(self.nbCols)
+        self.TBMatrice.setRowCount(self.nbLigs)
+        if self.nbLigs <15 : taille = 50
+        else : taille = 30
+        for i in range(self.nbLigs) :
+            self.TBMatrice.setRowHeight(i,taille)
+        for i in range(self.nbCols) :
+            self.TBMatrice.setColumnWidth(i,taille)
+        if self.monType.listeHeaders != None :
+            self.TBMatrice.setHorizontalHeaderLabels(self.monType.listeHeaders[0])
+            self.TBMatrice.setVerticalHeaderLabels(self.monType.listeHeaders[1])
+        else :
+            self.TBMatrice.verticalHeader().hide()
+            self.TBMatrice.horizontalHeader().hide()
+        #   self.TBMatrice.setFixedSize(self.nbCols*20+10,self.nbLigs*20+10)
+
+
+    def  initialValeur(self):
+        liste=self.node.item.getValeur()
+        if liste == None : return
+        dejaAffiche=0
+        if (len(liste)) != self.nbLigs  :
+            QMessageBox.critical( self,tr( "Mauvaise dimension de matrice"),tr( "le nombre de ligne n est pas egal a ") + str(self.nbLigs))
+        for i in range(self.nbLigs):
+            inter=liste[i]
+            if (len(inter)) != self.nbCols :
+                QMessageBox.critical( self, tr("Mauvaise dimension de matrice"), tr("le nombre de colonne n est pas egal a ") + str(self.nbCols))
+                raise  EficasException('dimension')
+            for j in range(self.nbCols):
+                self.TBMatrice.setItem(i,j,QTableWidgetItem(str(liste[i][j])))
+                if self.monType.coloree : self.coloreItem(self.TBMatrice.item(i,j),str(liste[i][j]))
+
+    def acceptVal(self):
+        liste=[]
+        for i in range(self.nbLigs):
+            listeCol=[]
+            for j in range(self.nbCols):
+                monItem=self.TBMatrice.item(i,j)
+                if monItem : texte=monItem.text()
+                else       : texte = ''
+                if texte != '' : val=self.monType.convertItem(texte)
+                else : val = None
+                listeCol.append(val)
+            liste.append(listeCol)
+        self.node.item.setValeur(liste)
+
+
+class MonWidgetMatriceOT (MonWidgetMatrice):
+
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+        monWidgetMatrice.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
+
+    def connecterSignaux(self) :
+        self.TBMatrice.itemChanged.connect(self.itemChanged)
+        self.PBrefresh.clicked.connect( self.afficheEntete)
+
+
+    def afficheEntete(self):
+        self.objSimp.changeEnteteMatrice()
+        self.TBMatrice.clear()
         if self.node.item.getValeur()== None:  self.initialSsValeur()
         else :
-           try    : self.initialValeur()
-           except : self.initialSsValeur()
-        if sys.platform[0:5]!="linux" : 
-          repIcon=self.node.editor.appliEficas.repIcon
-          fichier=os.path.join(repIcon, 'update.png')
-          icon = QIcon(fichier)
-          self.PBrefresh.setIcon(icon)
-          self.PBrefresh.setIconSize(QSize(32, 32))
-
-
-
-  def connecterSignauxQT4(self) :
-      self.connect(self.TBMatrice,SIGNAL("itemChanged(QTableWidgetItem *)"),self.itemChanged)
-      self.connect(self.PBrefresh,SIGNAL("clicked()"), self.afficheEntete)
-
-  def connecterSignaux(self) :
-      self.TBMatrice.itemChanged.connect(self.itemChanged)
-      self.PBrefresh.clicked.connect( self.afficheEntete)
-
-  def afficheEntete(self):
-      self.objSimp.changeEnteteMatrice()
-      self.TBMatrice.clear()
-      if self.node.item.getValeur()== None:  self.initialSsValeur()
-      else :
-         try    : self.initialValeur()
-         except : self.initialSsValeur()
-      self.node.item.object.state='changed'
-      self.node.item.object.parent.state='changed'
-      self.setValide()
-      self.parentQt.setValide()
-      self.node.item.jdc.isValid()
-
-
-  def itemChanged(self):
-      monItem=self.TBMatrice.currentItem()
-      if monItem==None : return
-      texte=monItem.text()
-      if texte=="" : return
-      #try :
-      if 1 :
-        val=float(str(texte))
-        ok=True
-      #except :
-      else :
-        ok=False
-      if ok == False :
-       self.editor.afficheInfos(tr("Entrer un float SVP"),Qt.red)
-        monItem.setText("")
-        return
-      if self.monType.valSup != None :
-         if val > self.monType.valSup :
-           self.editor.afficheInfos(tr("Entrer un float inferieur a ") + repr(self.monType.valSup),Qt.red)
+            try    : self.initialValeur()
+            except : self.initialSsValeur()
+        self.node.item.object.state='changed'
+        self.node.item.object.parent.state='changed'
+        self.setValide()
+        self.parentQt.setValide()
+        self.node.item.jdc.isValid()
+
+
+    def itemChanged(self):
+        monItem=self.TBMatrice.currentItem()
+        if monItem==None : return
+        texte=monItem.text()
+        if texte=="" : return
+        try :
+            val=float(str(texte))
+            ok=True
+        except :
+            ok=False
+        if ok == False :
+            self.editor.afficheInfos(tr("Entrer un float SVP"),Qt.red)
             monItem.setText("")
             return
-      if self.monType.valMin != None :
-         if val < self.monType.valMin :
-           self.editor.afficheInfos(tr("Entrer un float superieur a ") + repr(self.monType.valMin),Qt.red)
-            monItem.setText("")
+        if self.monType.valSup != None :
+            if val > self.monType.valSup :
+                self.editor.afficheInfos(tr("Entrer un float inferieur a ") + repr(self.monType.valSup),Qt.red)
+                monItem.setText("")
+                return
+        if self.monType.valMin != None :
+            if val < self.monType.valMin :
+                self.editor.afficheInfos(tr("Entrer un float superieur a ") + repr(self.monType.valMin),Qt.red)
+                monItem.setText("")
+                return
+        self.editor.afficheInfos("")
+        if self.monType.structure != None: MonWidgetMatrice.__dict__[self.monType.structure](*(self,))
+        self.acceptVal()
+
+
+
+    def creeColonnes(self):
+        if self.monType.methodeCalculTaille != None :
+            try:
+                MonWidgetMatrice.__dict__[self.monType.methodeCalculTaille](*(self,))
+            except :
+                QMessageBox.critical( self, tr("Mauvaise execution "),tr( "impossible d executer la methode ") + monType.methodeCalculTaille )
+                return
+        else :
+            self.nbLigs=self.monType.nbLigs
+            self.nbCols=self.monType.nbCols
+
+
+    def  nbDeVariables(self):
+    # uniquement pour OT
+        jdc=self.node.item.object.jdc
+        etape=self.node.item.object.etape
+        self.listeVariables=jdc.getVariables(etape)
+        if self.listeVariables == [] :
+            QMessageBox.critical( self, tr("Mauvaise Commande "),tr( "Aucune variable connue"))
             return
-      self.editor.afficheInfos("")
-      if self.monType.structure != None: MonWidgetMatrice.__dict__[self.monType.structure](*(self,))
-      self.acceptVal()
-
-
-  def symetrique(self):
-      monItem=self.TBMatrice.currentItem()
-      texte=monItem.text()
-      if monItem.row() != monItem.column():
-         print(monItem.row(), monItem.column())
-         monItemSym=self.TBMatrice.item(monItem.column(), monItem.row())
-         monItemSym.setText(texte)
-
-  def creeColonnes(self):
-      if self.monType.methodeCalculTaille != None :
-        #try:
-         if 1 :
-           MonWidgetMatrice.__dict__[self.monType.methodeCalculTaille](*(self,))
-         else :
-         #except :
-           QMessageBox.critical( self, tr("Mauvaise execution "),tr( "impossible d executer la methode ") + monType.methodeCalculTaille )
-           return
-      else :
-         self.nbLigs=self.monType.nbLigs
-         self.nbCols=self.monType.nbCols
-
-
-  def  nbDeVariables(self):
-       jdc=self.node.item.object.jdc
-       etape=self.node.item.object.etape
-       self.listeVariables=jdc.getVariables(etape)
-       if self.listeVariables == [] :
-           QMessageBox.critical( self, tr("Mauvaise Commande "),tr( "Aucune variable connue"))
-           return
-       self.TBMatrice.setColumnCount(len(self.listeVariables))
-       self.TBMatrice.setRowCount(len(self.listeVariables))
-       self.nbLigs=len(self.listeVariables)
-       self.nbCols=len(self.listeVariables)
-
-  def  nbDeDistributions(self):
-       jdc=self.node.item.object.jdc
-       etape=self.node.item.object.etape
-       self.listeVariables=jdc.getDistributions(etape)
-       if self.listeVariables == [] :
-           QMessageBox.critical( self, tr("Mauvaise Commande "),tr( "Aucune variable connue"))
-           return
-       self.TBMatrice.setColumnCount(len(self.listeVariables))
-       self.TBMatrice.setRowCount(len(self.listeVariables))
-       self.nbLigs=len(self.listeVariables)
-       self.nbCols=len(self.listeVariables)
-
-  def  initialSsValeur(self):
-       for row in range(self.nbLigs):
-          for column in range(self.nbCols):
-              if row == column :
-                 initialFloat=1
-               else :
-                 initialFloat=0
-               self.TBMatrice.setItem(row,column,QTableWidgetItem(str(initialFloat)))
-       #header=QStringList()
-       header=[]
-       for var in self.listeVariables :
-#         header << var
-           header.append(var)
-       self.TBMatrice.setVerticalHeaderLabels(header)
-       self.TBMatrice.setHorizontalHeaderLabels(header)
-
-  def  initialValeur(self):
-      liste=self.node.item.getValeur()
-      dejaAffiche=0
-      if (len(liste)) != self.nbLigs +1  :
-         QMessageBox.critical( self,tr( "Mauvaise dimension de matrice"),tr( "le nombre de ligne n est pas egal a ") + str(self.nbLigs))
-         dejaAffiche=1
-         raise  EficasException('dimension')
-      for i in range(self.nbLigs):
-          inter=liste[i+1]
-          if (len(inter)) != self.nbCols and (dejaAffiche == 0 ) :
-             QMessageBox.critical( self, tr("Mauvaise dimension de matrice"), tr("le nombre de colonne n est pas egal a ") + str(self.nbCols))
-             dejaAffiche=1
-             raise  EficasException('dimension')
-          for j in range(self.nbCols):
-              self.TBMatrice.setItem(i,j,QTableWidgetItem(str(liste[i+1][j])))
-      header=QStringList()
-      for var in liste[0]:
-          header << var
-      self.TBMatrice.setVerticalHeaderLabels(header)
-      self.TBMatrice.setHorizontalHeaderLabels(header)
-              
-  def acceptVal(self):
-      liste=[]
-      liste.append(self.listeVariables)
-      if self.TBMatrice.rowCount() != self.nbLigs :
-         QMessageBox.critical( self, tr("Mauvaise dimension de matrice"),tr( "le nombre de ligne n est pas egal a ") + str(self.nbLigs))
-      if self.TBMatrice.columnCount() != self.nbCols :
-         QMessageBox.critical( self, tr("Mauvaise dimension de matrice"), tr("le nombre de colonne n est pas egal a ") + str(self.nbCols))
-      for i in range(self.nbLigs):
-          listeCol=[]
-          for j in range(self.nbCols):
-              monItem=self.TBMatrice.item(i,j)       
-              texte=monItem.text()
-              try :
-                 val=float(str(texte))
-                 ok=True
-              except :
-                 ok=False
-              #val,ok=texte.toDouble() 
-              if ok == False :
-                 QMessageBox.critical( self, tr("Mauvaise Valeur"),tr( "l element ") + str(i) + "," +str(j) +tr("n est pas correct"))
-              listeCol.append(val)
-          liste.append(listeCol)
-      # on ajoute l ordre des variables aux valeurs
-      self.node.item.setValeur(liste)
+        self.TBMatrice.setColumnCount(len(self.listeVariables))
+        self.TBMatrice.setRowCount(len(self.listeVariables))
+        self.nbLigs=len(self.listeVariables)
+        self.nbCols=len(self.listeVariables)
+
+
+    def  initialSsValeur(self):
+    # uniquement pour OT
+        self.listeVariables=[]
+        for row in range(self.nbLigs):
+            for column in range(self.nbCols):
+                if row == column :
+                    initialFloat=1
+                else :
+                    initialFloat=0
+                self.TBMatrice.setItem(row,column,QTableWidgetItem(str(initialFloat)))
+        header =[]
+        for var in liste[0]: header .append(str(var))
+        self.TBMatrice.setVerticalHeaderLabels(header)
+        self.TBMatrice.setHorizontalHeaderLabels(header)
+
+    def  initialValeur(self):
+    # uniquement pour OT
+        liste=self.node.item.getValeur()
+        dejaAffiche=0
+        if (len(liste)) != self.nbLigs +1   :
+            QMessageBox.critical( self,tr( "Mauvaise dimension de matrice"),tr( "le nombre de ligne n est pas egal a ") + str(self.nbLigs))
+            raise  EficasException('dimension')
+        for i in range(self.nbLigs):
+            inter=liste[i+1]
+            if (len(inter)) != self.nbCols :
+                QMessageBox.critical( self, tr("Mauvaise dimension de matrice"), tr("le nombre de colonne n est pas egal a ") + str(self.nbCols))
+                raise  EficasException('dimension')
+            for j in range(self.nbCols):
+                self.TBMatrice.setItem(i,j,QTableWidgetItem(str(liste[i][j])))
+        header =[]
+        for var in liste[0]: header .append(str(var))
+        self.TBMatrice.setVerticalHeaderLabels(header)
+        self.TBMatrice.setHorizontalHeaderLabels(header)
index 2cfb072bce6a6be845eaa22059f82714a68c4123..c12e5bacaf31cc43136a482492a83aae8be62879 100644 (file)
@@ -21,7 +21,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types
@@ -35,147 +35,145 @@ from PyQt5.QtGui  import  QIcon
 
 
 from Extensions.i18n import tr
-import Accas 
+import Accas
 import os
 
-    
+
 # Import des panels
 
 class MonWidgetNiveauFact(Ui_WidgetNiveauFact,Groupe):
-  """
-  """
-  def __init__(self,node,editor,definition,obj):
-      self.listeAffichageWidget=[]
-      self.listeBoutonAChanger=[]
-      Groupe.__init__(self,node,editor,None,definition,obj,1,self)
-      from InterfaceQT4 import composimp
-      if isinstance(self.node ,composimp.Node):
-         widget=self.node.getPanelGroupe(self,self.maCommande)
-         self.listeBoutonAChanger.append(widget.RBValide)
-      self.afficheOptionnel()
-      self.inhibe=False
-      self.labelDoc.setText(self.node.item.getFr())
-      self.labelNomCommande.setText(self.node.item.getLabelText()[0])
-
-  def reaffiche(self,nodeAVoir=None):
-      self.node.setDeplieChildren()
-      self.node.afficheCeNiveau()
-      self.editor.fenetreCentraleAffichee.labelDoc.setText(self.node.item.getFr())
-      self.editor.fenetreCentraleAffichee.labelNomCommande.setText(self.node.item.getLabelText()[0])
-
-  def getPanel(self):
-  # necessaire pour handleOnItem de browser.py
-  # non appele
-      pass 
-
-  def donnePremier(self):
-      #print "dans donnePremier"
-      QApplication.processEvents()
-      if self.listeAffichageWidget != [] :
-         self.listeAffichageWidget[0].setFocus(7)
-      QApplication.processEvents()
-      #print self.focusWidget()
-
-
-  def focusNextPrevChild(self, next):
-      # on s assure que ce n est pas un chgt de fenetre
-      #print "je passe dans focusNextPrevChild"
-      if self.editor.fenetreCentraleAffichee != self : return True
-      f=self.focusWidget()
-
-      if f not in self.listeAffichageWidget :
-         i=0
-         while not hasattr (f,'AAfficher') :
-           if f==None :i=-1; break
-           f=f.parentWidget()
-         if hasattr(f,'AAfficher') : f=f.AAfficher
-         if i != -1 : i=self.listeAffichageWidget.index(f)
-      else :i=self.listeAffichageWidget.index(f) 
-      if (i==len(self.listeAffichageWidget) -1) and next and not self.inhibe: 
-         try :
-           self.listeAffichageWidget[1].setFocus(7)
-           w=self.focusWidget()
-           self.inhibe=1
-           w.focusPreviousChild()
-           self.inhibe=0
-           return True
-         except : pass
-
-      if i==0 and next==False and not self.inhibe: 
-         if hasattr(self.editor.fenetreCentraleAffichee,'scrollArea'):
-            self.editor.fenetreCentraleAffichee.scrollArea.ensureWidgetVisible(self.listeAffichageWidget[-1])
-         self.listeAffichageWidget[-2].setFocus(7)
-         self.inhibe=1
-         w=self.focusWidget()
-         w.focusNextChild()
-         self.inhibe=0
-         return True
-
-      if i==0 and next==True and not self.inhibe:
-         self.listeAffichageWidget[0].setFocus(7)
-         self.inhibe=1
-         w=self.focusWidget()
-         w.focusNextChild()
-         self.inhibe=0
-         return True
-
-      if i>0 and next==False and not self.inhibe:
-         if isinstance(self.listeAffichageWidget[i-1],QRadioButton):
-           self.listeAffichageWidget[i-1].setFocus(7)
-           return True
-      return QWidget.focusNextPrevChild(self, next)
-
-  def etablitOrdre(self):
-      # si on boucle on perd l'ordre
-      i=0
-      while(i +1 < len(self.listeAffichageWidget)):
-         self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1])
-         i=i+1
-
-  def  afficheSuivant(self,f):
-      #print ('ds afficheSuivant')
-      try :
-        i=self.listeAffichageWidget.index(f) 
-        next=i+1
-      except :
-        next=1
-      if (next==len(self.listeAffichageWidget) ): next =0
-      try :
-        self.listeAffichageWidget[next].setFocus(7)
-      except :
+    """
+    """
+    def __init__(self,node,editor,definition,obj):
+        self.listeAffichageWidget=[]
+        self.listeBoutonAChanger=[]
+        Groupe.__init__(self,node,editor,None,definition,obj,1,self)
+        from InterfaceQT4 import composimp
+        if isinstance(self.node ,composimp.Node):
+            widget=self.node.getPanelGroupe(self,self.maCommande)
+            self.listeBoutonAChanger.append(widget.RBValide)
+        self.afficheOptionnel()
+        self.inhibe=False
+        self.labelDoc.setText(self.node.item.getFr())
+        self.labelNomCommande.setText(self.node.item.getLabelText()[0])
+
+    def reaffiche(self,nodeAVoir=None):
+        self.node.setDeplieChildren()
+        self.node.afficheCeNiveau()
+        self.editor.fenetreCentraleAffichee.labelDoc.setText(self.node.item.getFr())
+        self.editor.fenetreCentraleAffichee.labelNomCommande.setText(self.node.item.getLabelText()[0])
+
+    def getPanel(self):
+    # necessaire pour handleOnItem de browser.py
+    # non appele
         pass
 
-
-  def afficheOptionnel(self):
-      # N a pas de parentQt. doit donc etre redefini
-      #print ('ds afficheOptionnel')
-      if self.editor.maConfiguration.closeOptionnel : return
-      if self.editor.widgetOptionnel!= None :
-        self.monOptionnel=self.editor.widgetOptionnel
-      else :
-        self.editor.inhibeSplitter=1
-        self.monOptionnel=MonWidgetOptionnel(self.editor)
-        self.editor.widgetOptionnel=self.monOptionnel
-        self.editor.splitter.addWidget(self.monOptionnel)
-        self.editor.ajoutOptionnel()
-        self.editor.inhibeSplitter=0
-      self.monOptionnel.vireTous()
-
-      
-      liste,liste_rouge=self.ajouteMCOptionnelDesBlocs()
-      self.monOptionnel.parentCommande=self
-      self.monOptionnel.titre(self.obj.nom)
-      self.monGroupe=self.monOptionnel.afficheOptionnel(liste,liste_rouge,self)
-      
-  def setValide(self):
-     Groupe.setValide(self)
-     for bouton in self.listeBoutonAChanger:
-         couleur=self.node.item.getIconName()
-         monIcone = QIcon(self.repIcon+"/" + couleur + ".png")
-         bouton.setIcon(monIcone)
+    def donnePremier(self):
+        #print "dans donnePremier"
+        QApplication.processEvents()
+        if self.listeAffichageWidget != [] :
+            self.listeAffichageWidget[0].setFocus(7)
+        QApplication.processEvents()
+        #print self.focusWidget()
+
+
+    def focusNextPrevChild(self, next):
+        # on s assure que ce n est pas un chgt de fenetre
+        #print "je passe dans focusNextPrevChild"
+        if self.editor.fenetreCentraleAffichee != self : return True
+        f=self.focusWidget()
+
+        if f not in self.listeAffichageWidget :
+            i=0
+            while not hasattr (f,'AAfficher') :
+                if f==None :i=-1; break
+                f=f.parentWidget()
+            if hasattr(f,'AAfficher') : f=f.AAfficher
+            if i != -1 : i=self.listeAffichageWidget.index(f)
+        else :i=self.listeAffichageWidget.index(f)
+        if (i==len(self.listeAffichageWidget) -1) and next and not self.inhibe:
+            try :
+                self.listeAffichageWidget[1].setFocus(7)
+                w=self.focusWidget()
+                self.inhibe=1
+                w.focusPreviousChild()
+                self.inhibe=0
+                return True
+            except : pass
+
+        if i==0 and next==False and not self.inhibe:
+            if hasattr(self.editor.fenetreCentraleAffichee,'scrollArea'):
+                self.editor.fenetreCentraleAffichee.scrollArea.ensureWidgetVisible(self.listeAffichageWidget[-1])
+            self.listeAffichageWidget[-2].setFocus(7)
+            self.inhibe=1
+            w=self.focusWidget()
+            w.focusNextChild()
+            self.inhibe=0
+            return True
+
+        if i==0 and next==True and not self.inhibe:
+            self.listeAffichageWidget[0].setFocus(7)
+            self.inhibe=1
+            w=self.focusWidget()
+            w.focusNextChild()
+            self.inhibe=0
+            return True
+
+        if i>0 and next==False and not self.inhibe:
+            if isinstance(self.listeAffichageWidget[i-1],QRadioButton):
+                self.listeAffichageWidget[i-1].setFocus(7)
+                return True
+        return QWidget.focusNextPrevChild(self, next)
+
+    def etablitOrdre(self):
+        # si on boucle on perd l'ordre
+        i=0
+        while(i +1 < len(self.listeAffichageWidget)):
+            self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1])
+            i=i+1
+
+    def  afficheSuivant(self,f):
+        #print ('ds afficheSuivant')
+        try :
+            i=self.listeAffichageWidget.index(f)
+            next=i+1
+        except :
+            next=1
+        if (next==len(self.listeAffichageWidget) ): next =0
+        try :
+            self.listeAffichageWidget[next].setFocus(7)
+        except :
+            pass
+
+
+    def afficheOptionnel(self):
+        # N a pas de parentQt. doit donc etre redefini
+        #print ('ds afficheOptionnel')
+        if self.editor.maConfiguration.closeOptionnel : return
+        if self.editor.widgetOptionnel!= None :
+            self.monOptionnel=self.editor.widgetOptionnel
+        else :
+            self.editor.inhibeSplitter=1
+            self.monOptionnel=MonWidgetOptionnel(self.editor)
+            self.editor.widgetOptionnel=self.monOptionnel
+            self.editor.splitter.addWidget(self.monOptionnel)
+            self.editor.ajoutOptionnel()
+            self.editor.inhibeSplitter=0
+        self.monOptionnel.vireTous()
+
+
+        liste,liste_rouge=self.ajouteMCOptionnelDesBlocs()
+        self.monOptionnel.parentCommande=self
+        self.monOptionnel.titre(self.obj.nom)
+        self.monGroupe=self.monOptionnel.afficheOptionnel(liste,liste_rouge,self)
+
+    def setValide(self):
+        Groupe.setValide(self)
+        for bouton in self.listeBoutonAChanger:
+            couleur=self.node.item.getIconName()
+            monIcone = QIcon(self.repIcon+"/" + couleur + ".png")
+            bouton.setIcon(monIcone)
 
 class MonWidgetNiveauFactTableau(MonWidgetNiveauFact):
-  def __init__(self,node,editor,definition,obj):
-      MonWidgetNiveauFact.__init__(self,node,editor,definition,obj)
-
-
+    def __init__(self,node,editor,definition,obj):
+        MonWidgetNiveauFact.__init__(self,node,editor,definition,obj)
index 7282da41c68195312743a86337a1b639c55909fe..cc2360bb2a551ee64c103d95df7367344427d376 100644 (file)
@@ -27,67 +27,67 @@ from Extensions.i18n import tr
 from desWidgetOptionnel import Ui_WidgetOptionnel
 from .monGroupeOptionnel import MonGroupeOptionnel
 
-    
+
 # Import des panels
 class  MonWidgetOptionnel (QWidget,Ui_WidgetOptionnel):
-  def __init__(self,parentQt):
-     #print ("dans init de monWidgetOptionnel ", parentQt )
-     QWidget.__init__(self,None)
-     self.setupUi(self)
-     self.dicoMCWidgetOptionnel={}
-     self.parentQt=parentQt
+    def __init__(self,parentQt):
+        #print ("dans init de monWidgetOptionnel ", parentQt )
+        QWidget.__init__(self,None)
+        self.setupUi(self)
+        self.dicoMCWidgetOptionnel={}
+        self.parentQt=parentQt
+
+    def afficheOptionnel(self,liste,liste_rouge,MC):
+        #print ('afficheOptionnel MonWidgetOptionnel',self, liste,MC.node.item.nom)
+        self.vireLesAutres(MC)
+
+        if MC.node.item.nom in self.dicoMCWidgetOptionnel :
+            #print (MC.node.item.nom)
+            self.dicoMCWidgetOptionnel[MC.node.item.nom].close()
+            self.dicoMCWidgetOptionnel[MC.node.item.nom].setParent(None)
+            self.dicoMCWidgetOptionnel[MC.node.item.nom].deleteLater()
+            del self.dicoMCWidgetOptionnel[MC.node.item.nom]
+        if liste==[] : return
+        groupe = MonGroupeOptionnel(liste,liste_rouge,self,MC)
+        self.groupesOptionnelsLayout.insertWidget(0,groupe)
+        self.dicoMCWidgetOptionnel[MC.node.item.nom]=groupe
+        return groupe
 
-  def afficheOptionnel(self,liste,liste_rouge,MC):
-     #print ('afficheOptionnel MonWidgetOptionnel',self, liste,MC.node.item.nom)
-     self.vireLesAutres(MC)
-   
-     if MC.node.item.nom in self.dicoMCWidgetOptionnel :
-        #print (MC.node.item.nom)
-        self.dicoMCWidgetOptionnel[MC.node.item.nom].close()
-        self.dicoMCWidgetOptionnel[MC.node.item.nom].setParent(None)
-        self.dicoMCWidgetOptionnel[MC.node.item.nom].deleteLater()
-        del self.dicoMCWidgetOptionnel[MC.node.item.nom]
-     if liste==[] : return
-     groupe = MonGroupeOptionnel(liste,liste_rouge,self,MC)
-     self.groupesOptionnelsLayout.insertWidget(0,groupe)
-     self.dicoMCWidgetOptionnel[MC.node.item.nom]=groupe
-     return groupe
+    def vireLesAutres(self,MC):
+        #print( "je passe dans vireLesAutres")
+        genea =MC.obj.getGenealogie()
+        #print (genea)
+        for k in list(self.dicoMCWidgetOptionnel.keys()):
+            #print (k)
+            #if k not in genea :  print ( k)
+            if k not in genea :
+                self.dicoMCWidgetOptionnel[k].close()
+                del self.dicoMCWidgetOptionnel[k]
+        #print( "fin vireLesAutres")
 
-  def vireLesAutres(self,MC):
-      #print( "je passe dans vireLesAutres")
-      genea =MC.obj.getGenealogie()
-      #print (genea)
-      for k in list(self.dicoMCWidgetOptionnel.keys()):
-          #print (k)
-          #if k not in genea :  print ( k)
-          if k not in genea :  
-             self.dicoMCWidgetOptionnel[k].close()
-             del self.dicoMCWidgetOptionnel[k]
-      #print( "fin vireLesAutres")
-      
-  def vireTous(self):
-      for k in list(self.dicoMCWidgetOptionnel.keys()):
-          self.dicoMCWidgetOptionnel[k].close()
-          del self.dicoMCWidgetOptionnel[k]
+    def vireTous(self):
+        for k in list(self.dicoMCWidgetOptionnel.keys()):
+            self.dicoMCWidgetOptionnel[k].close()
+            del self.dicoMCWidgetOptionnel[k]
 
-  def afficheOptionnelVide(self):
-      self.GeneaLabel.setText("")
-      for k in list(self.dicoMCWidgetOptionnel.keys()):
+    def afficheOptionnelVide(self):
+        self.GeneaLabel.setText("")
+        for k in list(self.dicoMCWidgetOptionnel.keys()):
             self.dicoMCWidgetOptionnel[k].close()
             del self.dicoMCWidgetOptionnel[k]
 
-  def titre(self,MC):
-     if self.parentCommande.node.editor.maConfiguration.closeFrameRechercheCommande==True :
-        self.frameLabelCommande.close()
-        return
-     labeltext,fonte,couleur = self.parentCommande.node.item.getLabelText()
-     l=tr(labeltext)
-     li=[]
-     while len(l) > 25:
-         li.append(l[0:24])
-         l=l[24:]
-     li.append(l)
-     texte=""
-     for l in li : texte+=l+"\n"
-     texte=texte[0:-2]
-     self.GeneaLabel.setText(tr("Options pour \n") +texte)
+    def titre(self,MC):
+        if self.parentCommande.node.editor.maConfiguration.closeFrameRechercheCommande==True :
+            self.frameLabelCommande.close()
+            return
+        labeltext,fonte,couleur = self.parentCommande.node.item.getLabelText()
+        l=tr(labeltext)
+        li=[]
+        while len(l) > 25:
+            li.append(l[0:24])
+            l=l[24:]
+        li.append(l)
+        texte=""
+        for l in li : texte+=l+"\n"
+        texte=texte[0:-2]
+        self.GeneaLabel.setText(tr("Options pour \n") +texte)
index 71c3bed92a748d376f34679fa24c311d00958a7f..905bbe34768d4c72c5f9515fd8ea405f01aa7284 100644 (file)
@@ -21,7 +21,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 from desWidgetParam import Ui_WidgetParam
@@ -31,88 +31,88 @@ from PyQt5.QtGui import QIcon
 
 from Extensions.i18n import tr
 from Extensions.eficas_exception import EficasException
-import Accas 
+import Accas
 import os, re
 import types
 
 pattern_name       = re.compile(r'^[^\d\W]\w*\Z')
 
-    
+
 # Import des panels
 
 class MonWidgetParam(QWidget,Ui_WidgetParam,FacultatifOuOptionnel):
-  """
-  """
-  def __init__(self,node,editor,commentaire):
-      QWidget.__init__(self,None)
-      self.node=node
-      self.node.fenetre=self
-      self.setupUi(self)
-      self.editor=editor
-      self.appliEficas=self.editor.appliEficas
-      self.repIcon=self.appliEficas.repIcon
-
-      self.setIconePoubelle()
-      if not(self.node.item.object.isValid()) :
-         icon=QIcon(self.repIcon+"/ast-red-ball.png")
-         self.RBValide.setIcon(icon)
-
-      self.remplit()
-      #if self.editor.code in ['MAP','CARMELCND','CF'] : self.bCatalogue.close()
-      if self.editor.code in ['MAP','CARMELCND'] : self.bCatalogue.close()
-      else : self.bCatalogue.clicked.connect(self.afficheCatalogue)
-
-      self.lineEditVal.returnPressed.connect(self.LEvaleurPressed)
-      self.lineEditNom.returnPressed.connect(self.LENomPressed)
-      self.bAvant.clicked.connect(self.afficheAvant)
-      self.bApres.clicked.connect(self.afficheApres)
-      self.bVerifie.clicked.connect(self.verifiePressed)
-
-      self.editor.fermeOptionnel()
-
-       
-  def afficheCatalogue(self):
-      self.node.tree.racine.affichePanneau()
-      if self.node : self.node.select()
-      else : self.node.tree.racine.select()
-
-  def remplit(self):
-      nom=self.node.item.getNom()
-      self.lineEditNom.setText(nom)
-
-      valeur=self.node.item.getValeur()
-      if valeur == None : 
-         self.lineEditVal.clear()
-      elif type(valeur) == list :
-         texte="["
-         for l in valeur :
-           texte=texte+str(l) +","
-         texte=texte[0:-1]+"]"
-         self.lineEditVal.setText(texte)
-      else :
-         self.lineEditVal.setText(str(valeur))
-
-
-  def donnePremier(self):
-      self.lineEditVal.setFocus(7)
-
-  def LEvaleurPressed(self):
-      if self.verifiePressed() == False :
-         QMessageBox.warning( self,tr( "Modification Impossible"),tr( "le parametre n'est pas valide"))
-      nom=str(self.lineEditNom.text())
-      val=str(self.lineEditVal.text())
-      self.node.item.setNom(nom)
-      self.node.item.setValeur(val)
-      self.node.updateTexte()
-
-  def LENomPressed(self):
-      self.LEvaleurPressed()
-
-  def verifiePressed(self):
+    """
+    """
+    def __init__(self,node,editor,commentaire):
+        QWidget.__init__(self,None)
+        self.node=node
+        self.node.fenetre=self
+        self.setupUi(self)
+        self.editor=editor
+        self.appliEficas=self.editor.appliEficas
+        self.repIcon=self.appliEficas.repIcon
+
+        self.setIconePoubelle()
+        if not(self.node.item.object.isValid()) :
+            icon=QIcon(self.repIcon+"/ast-red-ball.png")
+            self.RBValide.setIcon(icon)
+
+        self.remplit()
+        #if self.editor.code in ['MAP','CARMELCND','CF'] : self.bCatalogue.close()
+        if self.editor.code in ['MAP','CARMELCND'] : self.bCatalogue.close()
+        else : self.bCatalogue.clicked.connect(self.afficheCatalogue)
+
+        self.lineEditVal.returnPressed.connect(self.LEvaleurPressed)
+        self.lineEditNom.returnPressed.connect(self.LENomPressed)
+        self.bAvant.clicked.connect(self.afficheAvant)
+        self.bApres.clicked.connect(self.afficheApres)
+        self.bVerifie.clicked.connect(self.verifiePressed)
+
+        self.editor.fermeOptionnel()
+
+
+    def afficheCatalogue(self):
+        self.node.tree.racine.affichePanneau()
+        if self.node : self.node.select()
+        else : self.node.tree.racine.select()
+
+    def remplit(self):
+        nom=self.node.item.getNom()
+        self.lineEditNom.setText(nom)
+
+        valeur=self.node.item.getValeur()
+        if valeur == None :
+            self.lineEditVal.clear()
+        elif type(valeur) == list :
+            texte="["
+            for l in valeur :
+                texte=texte+str(l) +","
+            texte=texte[0:-1]+"]"
+            self.lineEditVal.setText(texte)
+        else :
+            self.lineEditVal.setText(str(valeur))
+
+
+    def donnePremier(self):
+        self.lineEditVal.setFocus(7)
+
+    def LEvaleurPressed(self):
+        if self.verifiePressed() == False :
+            QMessageBox.warning( self,tr( "Modification Impossible"),tr( "le parametre n'est pas valide"))
+        nom=str(self.lineEditNom.text())
+        val=str(self.lineEditVal.text())
+        self.node.item.setNom(nom)
+        self.node.item.setValeur(val)
+        self.node.updateTexte()
+
+    def LENomPressed(self):
+        self.LEvaleurPressed()
+
+    def verifiePressed(self):
         nomString=str(self.lineEditNom.text())
-        if not pattern_name.match(nomString) : 
-           self.LECommentaire.setText(nomString + tr(" n est pas un identifiant correct"))
-           return False
+        if not pattern_name.match(nomString) :
+            self.LECommentaire.setText(nomString + tr(" n est pas un identifiant correct"))
+            return False
 
         valString=str(self.lineEditVal.text())
 
@@ -120,29 +120,27 @@ class MonWidgetParam(QWidget,Ui_WidgetParam,FacultatifOuOptionnel):
         exec("from math import *", contexte)
         jdc=self.node.item.getJdc()
         for p in jdc.params :
-           try:
-              tp=p.nom+'='+str(repr(p.valeur))
-              exec(tp, contexte)
-           except exc :
-              pass
+            try:
+                tp=p.nom+'='+str(repr(p.valeur))
+                exec(tp, contexte)
+            except exc :
+                pass
 
         monTexte=nomString+"="+valString
         try :
-          exec(monTexte, contexte)
+            exec(monTexte, contexte)
         except (ValueError,TypeError, NameError,RuntimeError,ZeroDivisionError) as  exc:
-          self.LECommentaire.setText(tr("Valeur incorrecte: ")+str(exc))
-          return False
+            self.LECommentaire.setText(tr("Valeur incorrecte: ")+str(exc))
+            return False
         except :
-          self.LECommentaire.setText(tr("Valeur incorrecte "))
-          return False
+            self.LECommentaire.setText(tr("Valeur incorrecte "))
+            return False
 
         self.LECommentaire.setText(tr("Valeur correcte "))
         return True
 
-  def afficheApres(self):
-       self.node.selectApres()
-
-  def afficheAvant(self):
-       self.node.selectAvant()
-
+    def afficheApres(self):
+        self.node.selectApres()
 
+    def afficheAvant(self):
+        self.node.selectAvant()
index 8b2c462f849eff45094dad544d0d4712e4f5dda6..5bb4ab303f9b7394f411ce7d7ac1f465e7df9ae0 100644 (file)
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os,sys
 
 # Modules Eficas
 from Extensions.i18n import tr
-from .monWidgetPlusieursIntoOrdonne import MonWidgetPlusieursIntoOrdonne 
+from .monWidgetPlusieursIntoOrdonne import MonWidgetPlusieursIntoOrdonne
 from .politiquesValidation          import PolitiquePlusieurs
 
 from six.moves import range
@@ -37,31 +37,29 @@ from PyQt5.QtWidgets  import  QScrollBar
 
 class MonWidgetPlusieursASSDIntoOrdonne (MonWidgetPlusieursIntoOrdonne):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.numLineEditEnCours=0
         MonWidgetPlusieursIntoOrdonne.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-       
 
-       
-  def prepareListeResultat(self):
-       for i in self.listeLE: i.close()
-       self.listeLE=[]
-       self.vScrollBar = self.scrollArea.verticalScrollBar()
-       self.listeAAfficher = self.node.item.getSdAvantDuBonType()
 
-       if len(self.listeAAfficher) == 0 :
-          self.ajoutLE(0)
-          return
-           
-         
-       if len(self.listeAAfficher)*20 > 400 : self.setMinimumHeight(400)
-       else : self.setMinimumHeight(len(self.listeAAfficher)*30)
-       self.politique=PolitiquePlusieurs(self.node,self.editor)
-       for i in range(1,len(self.listeAAfficher)+1): self.ajoutLE(i)
-       for i in range(len(self.listeAAfficher)):
-           nomLE="lineEditVal"+str(i+1)
-           courant=getattr(self,nomLE)
-           courant.setText(str(self.listeAAfficher[i]))
-       self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum)
-       
-      
+
+    def prepareListeResultat(self):
+        for i in self.listeLE: i.close()
+        self.listeLE=[]
+        self.vScrollBar = self.scrollArea.verticalScrollBar()
+        self.listeAAfficher = self.node.item.getSdAvantDuBonType()
+
+        if len(self.listeAAfficher) == 0 :
+            self.ajoutLE(0)
+            return
+
+
+        if len(self.listeAAfficher)*30 > 400 : self.resize(self.width(),200)
+        else : self.resize(self.width(),len(self.listeAAfficher)*30)
+        self.politique=PolitiquePlusieurs(self.node,self.editor)
+        for i in range(1,len(self.listeAAfficher)+1): self.ajoutLE(i)
+        for i in range(len(self.listeAAfficher)):
+            nomLE="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLE)
+            courant.setText(str(self.listeAAfficher[i]))
+        self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum)
index 35c0bf481476fb517483a7bbac0e09f16ee6f21c..ce462480004649115fc43b4261cd1d5a00bacaa5 100644 (file)
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 
 import types,os,sys
 
 from six.moves import range
-from PyQt5.QtGui     import QIcon 
+from PyQt5.QtGui     import QIcon
 from PyQt5.QtWidgets import QApplication, QMessageBox, QScrollArea
 from PyQt5.QtCore    import QTimer, QSize, Qt
 
@@ -35,7 +35,7 @@ from PyQt5.QtCore    import QTimer, QSize, Qt
 from Extensions.i18n import tr
 
 from InterfaceQT4.feuille                import Feuille
-from desWidgetPlusieursBase              import Ui_WidgetPlusieursBase 
+from desWidgetPlusieursBase              import Ui_WidgetPlusieursBase
 from InterfaceQT4.politiquesValidation   import PolitiquePlusieurs
 from InterfaceQT4.qtSaisie               import SaisieValeur
 from InterfaceQT4.gereListe              import GereListe
@@ -47,7 +47,7 @@ hauteurMax=253
 
 class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         #print "MonWidgetPlusieursBase", nom
         self.inFocusOutEvent=False
         self.nomLine="lineEditVal"
@@ -55,24 +55,24 @@ class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie)
         self.indexDernierLabel=0
         self.numLineEditEnCours=0
         self.listeAffichageWidget=[]
+        self.dictLE={}
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         GereListe.__init__(self)
         self.gereIconePlier()
         self.BSelectFichier.clicked.connect(self.selectInFile)
 
-        if sys.platform[0:5]!="linux":
-          repIcon=self.node.editor.appliEficas.repIcon
-          fichier=os.path.join(repIcon, 'arrow_up.png')
-          icon = QIcon(fichier)
-          self.RBHaut.setIcon(icon)
-          self.RBHaut.setIconSize(QSize(32, 32))
-          fichier2=os.path.join(repIcon, 'arrow_down.png')
-          icon2 = QIcon(fichier2)
-          self.RBBas.setIcon(icon2)
-          fichier3=os.path.join(repIcon, 'file-explorer.png')
-          icon3 = QIcon(fichier2)
-          self.BSelectFichier.setIcon(icon3)
-          self.BSelectFichier.setIconSize(QSize(32, 32))
+        repIcon=self.node.editor.appliEficas.repIcon
+        fichier=os.path.join(repIcon, 'arrow_up.png')
+        icon = QIcon(fichier)
+        self.RBHaut.setIcon(icon)
+        self.RBHaut.setIconSize(QSize(32, 32))
+        fichier2=os.path.join(repIcon, 'arrow_down.png')
+        icon2 = QIcon(fichier2)
+        self.RBBas.setIcon(icon2)
+        fichier3=os.path.join(repIcon, 'file-explorer.png')
+        icon3 = QIcon(fichier2)
+        self.BSelectFichier.setIcon(icon3)
+        self.BSelectFichier.setIconSize(QSize(32, 32))
         icon=QIcon(self.repIcon+"/MoinsBleu.png")
         self.RBMoins.setIcon(icon)
         icon=QIcon(self.repIcon+"/PlusBleu.png")
@@ -82,10 +82,10 @@ class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie)
 
 
         self.listeValeursCourantes=self.node.item.getListeValeurs()
-        if self.monSimpDef.max != "**"  and self.monSimpDef.max < 7: 
-           hauteurMax=dicoLongueur[self.monSimpDef.max]
+        if self.monSimpDef.max != "**"  and self.monSimpDef.max < 7:
+            hauteurMax=dicoLongueur[self.monSimpDef.max]
         else :
-           hauteurMax=220
+            hauteurMax=220
         #   if self.monSimpDef.max == self.monSimpDef.min : self.setMaximumHeight(hauteur)
         self.resize(self.width(),hauteurMax)
         self.setMinimumHeight(hauteurMax)
@@ -95,82 +95,94 @@ class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie)
         self.AAfficher=self.lineEditVal1
         self.inInit=False
         # PNPN a completer __ si tuple le type des tuples sinon le tuple
-        self.monCommentaireLabel.setText(self.finCommentaireListe())
+        # trop moche
+        #self.monCommentaireLabel.setText(self.finCommentaireListe())
+        self.monCommentaireLabel.setText("")
         self.scrollArea.leaveEvent = self.leaveEventScrollArea
+        self.inhibeChangeValeur = False 
+        self.dejaAverti = False
+
+
+    def setValeurs(self):
+        self.vScrollBar = self.scrollArea.verticalScrollBar()
+        self.politique=PolitiquePlusieurs(self.node,self.editor)
+        # construction du min de valeur a entrer
+        if self.monSimpDef.max == "**"  : aConstruire=7
+        elif self.monSimpDef.max == float('inf'): aConstruire=7
+        else                            : aConstruire=self.monSimpDef.max
+
+        for i in range(1,aConstruire):
+            self.ajoutLineEdit()
+        QApplication.processEvents()
+        self.scrollArea.ensureWidgetVisible(self.lineEditVal1)
+        self.listeValeursCourantes=self.node.item.getListeValeurs()
+        index=1
+        for valeur in self.listeValeursCourantes :
+            val=self.politique.getValeurTexte(valeur)
+            nomLineEdit="lineEditVal"+str(index)
+            if hasattr(self,nomLineEdit) :
+                courant=getattr(self,nomLineEdit)
+                if 'R' in self.objSimp.definition.type and str(val) != repr(val) :  courant.setText(repr(val))
+                else                     :  courant.setText(str(val))
+                self.dictLE[index]=val
+            else :
+                self.ajoutLineEdit(val)
+            index=index+1
+        # ajout d'une ligne vide ou affichage commentaire
+        if self.indexDernierLabel < self.monSimpDef.max  : self.ajoutLineEdit()
+        else : self.scrollArea.setToolTip('nb max de valeurs atteint')
+        #self.adjustSize()
+        #self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum)
+
+
+    def ajoutLineEdit(self,valeur=None,):
+        #print ('ajoutLineEdit plusieursBase')
+        #print ('self.indexDernierLabel', self.indexDernierLabel)
+        self.indexDernierLabel=self.indexDernierLabel+1
+        nomLineEdit="lineEditVal"+str(self.indexDernierLabel)
+        if hasattr(self,nomLineEdit) :
+            self.indexDernierLabel=self.indexDernierLabel-1
+            return
+        nouveauLE = LECustom(self.scrollArea,self,self.indexDernierLabel)
+        self.verticalLayoutLE.insertWidget(self.indexDernierLabel-1,nouveauLE)
+        nouveauLE.setText("")
+        if self.indexDernierLabel % 2 == 1 : nouveauLE.setStyleSheet("background:rgb(210,210,210)")
+        else :                               nouveauLE.setStyleSheet("background:rgb(235,235,235)")
+        nouveauLE.setFrame(False)
+        nouveauLE.returnPressed.connect(self.changeValeur)
+
+        setattr(self,nomLineEdit,nouveauLE)
+        self.listeAffichageWidget.append(nouveauLE)
+        self.etablitOrdre()
+        if valeur != None :
+            nouveauLE.setText(str(valeur))
+            self.dictLE[self.indexDernierLabel] = valeur
+        else :
+            self.dictLE[self.indexDernierLabel] = None
+        # deux lignes pour que le ensureVisible fonctionne
+        self.estVisible=nouveauLE
+        if self.inInit==False :QTimer.singleShot(1, self.rendVisibleLigne)
+
+    def etablitOrdre(self):
+        i=0
+        while(i +1 < len(self.listeAffichageWidget)):
+            self.listeAffichageWidget[i].setFocusPolicy(Qt.StrongFocus)
+            self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1])
+            i=i+1
+        # si on boucle on perd l'ordre
+
+
+    def rendVisibleLigne(self):
+        QApplication.processEvents()
+        self.estVisible.setFocus()
+        self.scrollArea.ensureWidgetVisible(self.estVisible,0,0)
+
 
+    def finCommentaire(self):
+        return self.finCommentaireListe()
 
-  def setValeurs(self):
-       self.vScrollBar = self.scrollArea.verticalScrollBar()
-       self.politique=PolitiquePlusieurs(self.node,self.editor)
-       # construction du min de valeur a entrer
-       if self.monSimpDef.max == "**"  : aConstruire=7
-       elif self.monSimpDef.max == float('inf'): aConstruire=7
-       else                            : aConstruire=self.monSimpDef.max
-
-       for i in range(1,aConstruire):
-           self.ajoutLineEdit()
-       QApplication.processEvents()
-       self.scrollArea.ensureWidgetVisible(self.lineEditVal1)
-       self.listeValeursCourantes=self.node.item.getListeValeurs()
-       index=1
-       for valeur in self.listeValeursCourantes :
-           val=self.politique.getValeurTexte(valeur)
-           nomLineEdit="lineEditVal"+str(index)
-           if hasattr(self,nomLineEdit) : 
-              courant=getattr(self,nomLineEdit)
-              if 'R' in self.objSimp.definition.type and str(val) != repr(val) :  courant.setText(repr(val))
-              else                     :  courant.setText(str(val))
-           else :
-              self.ajoutLineEdit(val)
-           index=index+1
-       # ajout d'une ligne vide ou affichage commentaire
-       if self.indexDernierLabel < self.monSimpDef.max  : self.ajoutLineEdit()
-       else : self.scrollArea.setToolTip('nb max de valeurs atteint')
-       #self.adjustSize()
-       #self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum)
-       
-
-  def ajoutLineEdit(self,valeur=None,):
-      self.indexDernierLabel=self.indexDernierLabel+1
-      nomLineEdit="lineEditVal"+str(self.indexDernierLabel)
-      if hasattr(self,nomLineEdit) : 
-         self.indexDernierLabel=self.indexDernierLabel-1
-         return
-      nouveauLE = LECustom(self.scrollArea,self,self.indexDernierLabel)
-      self.verticalLayoutLE.insertWidget(self.indexDernierLabel-1,nouveauLE)
-      nouveauLE.setText("")
-      if self.indexDernierLabel % 2 == 1 : nouveauLE.setStyleSheet("background:rgb(210,210,210)")
-      else :                              nouveauLE.setStyleSheet("background:rgb(235,235,235)")
-      nouveauLE.setFrame(False)
-      nouveauLE.returnPressed.connect(self.changeValeur)
-
-      setattr(self,nomLineEdit,nouveauLE)
-      self.listeAffichageWidget.append(nouveauLE)
-      self.etablitOrdre()
-      if valeur != None : nouveauLE.setText(str(valeur))
-      # deux lignes pour que le ensureVisible fonctionne
-      self.estVisible=nouveauLE
-      if self.inInit==False :QTimer.singleShot(1, self.rendVisibleLigne)
-
-  def etablitOrdre(self):
-      i=0
-      while(i +1 < len(self.listeAffichageWidget)):
-         self.listeAffichageWidget[i].setFocusPolicy(Qt.StrongFocus)
-         self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1])
-         i=i+1
-      # si on boucle on perd l'ordre
-
-
-  def rendVisibleLigne(self):
-      QApplication.processEvents()
-      self.estVisible.setFocus()
-      self.scrollArea.ensureWidgetVisible(self.estVisible,0,0)
-      
-
-  def finCommentaire(self):
-      return self.finCommentaireListe()
-
-  def ajout1Valeur(self,valeur=None):
+    def ajout1Valeur(self,valeur=None):
+        print ('ajout1Valeur plusieursBase')
         if valeur == None : return
         liste,validite=SaisieValeur.TraiteLEValeur(self,str(valeur))
         if validite == 0 : return
@@ -179,42 +191,43 @@ class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie)
         for valeur in self.listeValeursCourantes : listeVal.append(valeur)
         validite,comm,comm2,listeRetour=self.politique.ajoutValeurs(liste,-1,listeVal)
         if (comm2 != "" and comm != None) : return comm2
-        if validite : 
-           self.listeValeursCourantes=self.listeValeursCourantes+listeRetour
-           if len(self.listeValeursCourantes) > self.monSimpDef.min :
-              self.node.item.setValeur(self.listeValeursCourantes)
-              self.reaffiche()
-           return None
+        if validite :
+            self.listeValeursCourantes=self.listeValeursCourantes+listeRetour
+            if len(self.listeValeursCourantes) > self.monSimpDef.min :
+                self.node.item.setValeur(self.listeValeursCourantes)
+                self.reaffiche()
+            return None
         else :
-           return(comm2+" "+comm)
-        
-  def reaffiche(self):
-      # A priori, on ne fait rien
-      pass
-
-                
-  def ajoutNValeur(self,liste):
-  #----------------------------
-  # attention quand on charge par un fichier, on ne peut pas se contenter d ajouter N fois 1 valeur
-  # car alors le temps de verification devient prohibitif  reconstructu=ion et verification a 
-  # chaque valeur. d ou l ajout de ajoutNTuple a politique plusieurs
-
-           
+            return(comm2+" "+comm)
+
+    def reaffiche(self):
+        # A priori, on ne fait rien
+        pass
+
+
+    def ajoutNValeur(self,liste):
+        #print ('ajoutNValeur plusieursBase')
+    #----------------------------
+    # attention quand on charge par un fichier, on ne peut pas se contenter d ajouter N fois 1 valeur
+    # car alors le temps de verification devient prohibitif  reconstructu=ion et verification a
+    # chaque valeur. d ou l ajout de ajoutNTuple a politique plusieurs
+
+
         listeFormatee=list(liste)
 
         min,max=self.node.item.getMinMax()
         if self.objSimp.valeur == None : listeComplete=listeFormatee
         else : listeComplete =self.objSimp.valeur + listeFormatee
 
-        if len(listeComplete) > max : 
-           texte=tr("Nombre maximum de valeurs ")+str(max)+tr(" atteint")
-           self.editor.afficheInfos(texte,Qt.red)
-           return
+        if len(listeComplete) > max :
+            texte=tr("Nombre maximum de valeurs ")+str(max)+tr(" atteint")
+            self.editor.afficheInfos(texte,Qt.red)
+            return
 
         validite,comm,comm2,listeRetour= self.politique.ajoutNTuple(listeComplete)
-        if not validite : 
-           self.editor.affiche_infos(texte,Qt.red)
-           return
+        if not validite :
+            self.editor.affiche_infos(texte,Qt.red)
+            return
 
         # on calcule le dernier lineedit rempli avant de changer la valeur
         if self.objSimp.valeur != None : indexDernierRempli=len(self.objSimp.valeur)
@@ -224,79 +237,92 @@ class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie)
 
         indexDernierRempli=0
         while ( indexDernierRempli < len(liste) ) :
-         texte=liste[indexDernierRempli]
-         if indexDernierRempli < self.indexDernierLabel:
-            nomLineEdit="lineEditVal"+str(indexDernierRempli+1)
+            texte=liste[indexDernierRempli]
+            if indexDernierRempli < self.indexDernierLabel:
+                nomLineEdit="lineEditVal"+str(indexDernierRempli+1)
+                courant=getattr(self,nomLineEdit)
+                courant.setText(str(texte))
+            else :
+                self.ajoutLineEdit(texte)
+            indexDernierRempli = indexDernierRempli + 1
+
+
+    def changeValeur(self,changeDePlace=True,oblige=False):
+        #print ('achangeValeur plusieursBase', self)
+        #import traceback
+        #traceback.print_stack()
+        if self.inhibeChangeValeur : return
+        self.inhibeChangeValeur = True 
+        donneFocus=None
+        derniereValeur=None
+        self.listeValeursCourantes = []
+        fin=self.indexDernierLabel
+        if (not('TXM' in self.objSimp.definition.type)) and not (self.dejaAverti):
+            for i in range (1, fin):
+                nomLineEdit="lineEditVal"+str(i)
+                courant=getattr(self,nomLineEdit)
+                valeur=courant.text()
+                lval=valeur.split(',')
+                if len (lval) > 1 :
+                    self.dejaAverti = True
+                    QMessageBox.warning(self,tr('"," used'), 'Perhaps, character "," is used in ' +str( valeur)  + 'intead of "."') 
+                    break
+                    # msgBox = QMessageBox()
+                    # msgBox.setText("separator ',' ")
+                    # msgBox.setInformativeText("Do you want to enter " + str (lval) + "?")
+                    # msgBox.setInformativeText ("  you want to enter " + str (lval) + "?")
+                    # msgBox.setStandardButtons( QMessageBox.Ok | QMessageBox.Cancel)
+                    # msgBox.setDefaultButton(QMessageBox.Ok)
+                    #ret = msgBox.exec()
+                    # tres dicutable 20210401 j enleve la boucle
+                    # if faut remtrre self.inhibeChangeValeur si on la reactive
+                    # if ret == 1024:
+                    #   courant.setText(lval[0])
+                    #   self.ajoutNValeur(lval[1:])
+                    #   self.listeValeursCourantes = []
+
+
+        for i in range (1, self.indexDernierLabel+1):
+            nomLineEdit="lineEditVal"+str(i)
             courant=getattr(self,nomLineEdit)
-            courant.setText(str(texte))
-         else : 
-            self.ajoutLineEdit(texte)
-         indexDernierRempli = indexDernierRempli + 1
-        
-
-  def changeValeur(self,changeDePlace=True,oblige=False):
-      donneFocus=None
-      derniereValeur=None
-      self.listeValeursCourantes = []
-      fin=self.indexDernierLabel
-      for i in range (1, fin):
-          nomLineEdit="lineEditVal"+str(i)
-          courant=getattr(self,nomLineEdit)
-          valeur=courant.text()
-          lval=valeur.split(',')
-          if len (lval) > 1 : 
-             msgBox=QMessageBox()
-             msgBox.setText("separator ',' ")
-             msgBox.setInformativeText("Do you want to enter " + str (lval) + "?")
-             msgBox.setStandardButtons( QMessageBox.Ok | QMessageBox.Cancel)
-             msgBox.setDefaultButton(QMessageBox.Ok)
-             ret = msgBox.exec_()
-             if ret != 1024 : 
-                courant.setText("") 
-                return
-             courant.setText(lval[0])
-             self.ajoutNValeur(lval[1:])
-             self.listeValeursCourantes = []
-
-      for i in range (1, self.indexDernierLabel+1):
-          nomLineEdit="lineEditVal"+str(i)
-          courant=getattr(self,nomLineEdit)
-          valeur=courant.text()
-          if valeur != None and valeur != "" : 
-             commentaire=self.ajout1Valeur(valeur)
-             if (commentaire != None ):
-                 self.editor.afficheInfos(commentaire,Qt.red)
-                 courant.setText("")
-                 donneFocus=courant
-                 self.reaffiche()
-                 return
-             else :
-                 self.editor.afficheInfos("")
-          elif donneFocus==None : donneFocus=courant
-
-      nomDernierLineEdit="lineEditVal"+str(self.indexDernierLabel)
-      dernier=getattr(self,nomDernierLineEdit)
-      derniereValeur=dernier.text()
-      if changeDePlace:
-         if donneFocus != None : 
-           donneFocus.setFocus()
-           self.scrollArea.ensureWidgetVisible(donneFocus)
-         elif self.indexDernierLabel < self.monSimpDef.max  : 
-           self.ajoutLineEdit()
-      if self.listeValeursCourantes == [] : return
-      min,max = self.node.item.getMinMax()
-      if len(self.listeValeursCourantes) < self.monSimpDef.min  :
-        self.editor.afficheInfos(tr('nb min de valeurs : ')+str( self.monSimpDef.min))
-      if len(self.listeValeursCourantes) < min and oblige==True: return
-      if len(self.listeValeursCourantes) > max : return
-      retour=self.node.item.setValeur(self.listeValeursCourantes)
-      if len(self.listeValeursCourantes) == self.monSimpDef.max  :
-        self.editor.afficheInfos(tr('nb max de valeurs atteint'))
-      self.setValide()
-      self.reaffiche()
-
-  def leaveEventScrollArea(self,event):
-       self.changeValeur(changeDePlace=False)
-       QScrollArea.leaveEvent(self.scrollArea,event)
+            valeur=courant.text()
+            if valeur != None and valeur != "" :
+                commentaire=self.ajout1Valeur(valeur)
+                if (commentaire != None ):
+                    self.editor.afficheInfos(commentaire,Qt.red)
+                    courant.setText("")
+                    donneFocus=courant
+                    self.reaffiche()
+                    return
+                else :
+                    self.editor.afficheInfos("")
+            elif donneFocus==None : donneFocus=courant
+
+        nomDernierLineEdit="lineEditVal"+str(self.indexDernierLabel)
+        dernier=getattr(self,nomDernierLineEdit)
+        derniereValeur=dernier.text()
+        if changeDePlace:
+            if donneFocus != None :
+                donneFocus.setFocus()
+                self.scrollArea.ensureWidgetVisible(donneFocus)
+            elif self.indexDernierLabel < self.monSimpDef.max  :
+                self.ajoutLineEdit()
+        if self.listeValeursCourantes == [] : return
+        min,max = self.node.item.getMinMax()
+        if len(self.listeValeursCourantes) < self.monSimpDef.min  :
+            self.editor.afficheInfos(tr('nb min de valeurs : ')+str( self.monSimpDef.min))
+        if len(self.listeValeursCourantes) < min and oblige==True: return
+        if len(self.listeValeursCourantes) > max : return
+        retour=self.node.item.setValeur(self.listeValeursCourantes)
+        if len(self.listeValeursCourantes) == self.monSimpDef.max  :
+            self.editor.afficheInfos(tr('nb max de valeurs atteint'))
+        self.setValide()
+        self.reaffiche()
+        self.inhibeChangeValeur = False 
+
+    def leaveEventScrollArea(self,event):
+        #print ('achangeValeur plusieursBase')
+        self.changeValeur(changeDePlace=False)
+        QScrollArea.leaveEvent(self.scrollArea,event)
 
 # Avertissement quand on quitte le widget
diff --git a/InterfaceQT4/monWidgetPlusieursCreeUserAssd.py b/InterfaceQT4/monWidgetPlusieursCreeUserAssd.py
new file mode 100644 (file)
index 0000000..056cf3e
--- /dev/null
@@ -0,0 +1,184 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2007-2020   EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Modules Python
+from __future__ import absolute_import
+import types,os
+
+
+# Modules Eficas
+from Extensions.i18n import tr
+from .monWidgetSimpTxt  import MonWidgetSimpTxt
+from .monWidgetPlusieursBase import MonWidgetPlusieursBase
+from copy import copy,deepcopy
+from PyQt5.QtCore import Qt
+
+
+
+class MonWidgetPlusieursCreeUserAssd ( MonWidgetPlusieursBase):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+        MonWidgetPlusieursBase. __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
+        self.etablitOrdre()
+        self.scrollArea.leaveEvent = self.leaveEventScrollArea
+        self.RBHaut.close()
+        self.RBBas.close()
+
+    def ajout1Valeur(self,valeur=None):
+        if not valeur in list(self.dictValeurs.keys()):
+            validite,commentaire=self.objSimp.creeUserASSDetSetValeur(valeur)
+            MonWidgetPlusieursBase.ajout1Valeur(self,valeur)
+
+    def changeValeur(self,changeDePlace=False,oblige=False ):
+        #print ('dans changeValeur du CreeUserAssd', changeDePlace, self.numLineEditEnCours)
+        #import traceback
+        #traceback.print_stack()
+        self.changeUnLineEdit=False
+        valeur = self.lineEditEnCours.text()
+        if self.numLineEditEnCours in list(self.dictLE.keys()) :
+            oldValeurUserAssd = self.dictLE[self.numLineEditEnCours]
+            if oldValeurUserAssd == None or oldValeurUserAssd == "" :
+                enCreation = True
+                oldValeurUserAssd == True
+            else : enCreation = False
+        else                         :
+            enCreation     = True
+            oldValeurUserAssd =  None
+
+        if oldValeurUserAssd  and oldValeurUserAssd.nom == valeur :
+            self.selectionneNext()
+            return
+
+        if valeur != "" :
+            if not enCreation :
+                validite, commentaire=self.node.item.renommeSdCreeDsListe(oldValeurUserAssd,valeur)
+                if commentaire != "" and not validite:
+                    self.editor.afficheInfos(commentaire,Qt.red)
+                    self.lineEditEnCours.setText(oldValeurUserAssd.nom)
+                nomDernierLineEdit="lineEditVal"+str(self.numLineEditEnCours+1)
+                dernier=getattr(self,nomDernierLineEdit)
+                dernier.setFocus()
+                return
+
+            validite, objASSD, commentaire=self.objSimp.creeUserASSD(valeur)
+            if commentaire != "" and not validite:
+                self.editor.afficheInfos(commentaire,Qt.red)
+                self.lineEditEnCours.setText("")
+                if objASSD : objASSD.supprime(self.objSimp)
+                return
+        else:
+            validite = 1
+            objASSD=None
+            commentaire = ""
+
+        # on relit tout pour tenir compte des lignes blanches
+        oldValeur=self.objSimp.valeur
+        liste=[]
+        for i in range (1, self.indexDernierLabel+1):
+            if i == self.numLineEditEnCours  and objASSD : liste.append(objASSD)
+            elif self.dictLE[i] != None and self.dictLE[i] != "" : liste.append(self.dictLE[i])
+        validite=self.node.item.setValeur(liste)
+        if not validite :
+            self.objSimp.valeur=oldValeur
+            self.objSimp.state='changed'
+            self.setValide()
+            if objASSD : objASSD.supprime(self.objSimp)
+            self.lineEditEnCours.setText(oldValeurUserASSD.nom)
+            return
+
+        validite=self.node.item.isValid()
+        if validite :
+            self.dictLE[self.numLineEditEnCours] = objASSD
+            self.node.item.rattacheUserASSD(objASSD)
+            if self.indexDernierLabel < len(liste)  : self.ajoutLineEdit()
+            nomDernierLineEdit="lineEditVal"+str(self.numLineEditEnCours+1)
+            self.listeValeursCourantes=liste
+            dernier=getattr(self,nomDernierLineEdit)
+            dernier.setFocus()
+        else :
+            self.editor.afficheInfos('ajout impossible' ,Qt.red)
+            if objASSD : objASSD.supprime(self.objSimp)
+            self.lineEditEnCours.setText("")
+        self.parentQt.propageChange(self.objSimp.definition.type[0],self)
+
+    def selectionneDernier(self):
+        index=len(self.listeValeursCourantes)
+        self.listeAffichageWidget[index].setFocus()
+
+    def leaveEventScrollArea(self,event):
+        pass
+
+#  def echangeDeuxValeurs(self):
+#    self.changeUnLineEdit=False
+#    obj1=self.dictLE[self.num1]
+#    obj2=self.dictLE[self.num2]
+#    self.dictLE[self.num1]=obj2
+#    self.dictLE[self.num2]=obj1
+#    nomLineEdit=self.nomLine+str(self.num1)
+#    courant=getattr(self,nomLineEdit)
+#    if self.dictLE[self.num1] != None : courant.setText(self.dictLE[self.num1].nom)
+#    else : courant.setText("")
+#    nomLineEdit=self.nomLine+str(self.num2)
+#    courant=getattr(self,nomLineEdit)
+#    if self.dictLE[self.num2] != None : courant.setText(self.dictLE[self.num2].nom)
+#    else : courant.setText("")
+#    liste=[]
+#    for i in list(self.dictLE.keys()):
+#       if self.dictLE[i] != None and self.dictLE[i] != "" : liste.append(self.dictLE[i])
+#    validite=self.node.item.setValeur(liste)
+#    self.listeValeursCourantes=liste
+#    courant.setFocus(True)
+
+    def descendLesLignes(self):
+        self.changeUnLineEdit=False
+        if self.numLineEditEnCours==self.indexDernierLabel : return
+        nouvelleValeur=None
+        for i in range (self.numLineEditEnCours+1, self.indexDernierLabel):
+            valeurAGarder=self.dictLE[i]
+            self.dictLE[i]=nouvelleValeur
+            nomLineEdit=self.nomLine+str(i)
+            courant=getattr(self,nomLineEdit)
+            if nouvelleValeur != None : courant.setText(nouvelleValeur.nom)
+            else : courant.setText("")
+            nouvelleValeur=valeurAGarder
+
+
+    def moinsPushed(self):
+        if self.numLineEditEnCours == 0 : return
+        if self.indexDernierLabel == 0 : return
+        objASSD=self.dictLE[self.numLineEditEnCours]
+        if objASSD : objASSD.supprime(self.objSimp)
+        self.lineEditEnCours.setText("")
+        self.dictLE[self.numLineEditEnCours]=None
+
+        for i in range (self.numLineEditEnCours, self.indexDernierLabel-1):
+            self.dictLE[i]= self.dictLE[i+1]
+            nomLineEdit=self.nomLine+str(i)
+            courant=getattr(self,nomLineEdit)
+            if self.dictLE[i] != None : courant.setText(self.dictLE[i].nom)
+            else : courant.setText("")
+        nomLineEdit=self.nomLine+str(self.indexDernierLabel)
+        courant=getattr(self,nomLineEdit)
+        courant.setText("")
+        self.dictLE[self.indexDernierLabel]=None
+        liste=[]
+        for i in list(self.dictLE.keys()):
+            if self.dictLE[i] != None and self.dictLE[i] != "" : liste.append(self.dictLE[i])
+        print (liste)
+        validite=self.node.item.setValeur(liste)
+        self.listeValeursCourantes=liste
index 8040c914eaa7b6cf832ed515a2d7da0f5b67e0f8..cb2be8efab4c6eccb850d709a4408ca466b0a3ef 100644 (file)
@@ -20,8 +20,8 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 
 import types,os
@@ -43,7 +43,7 @@ from InterfaceQT4.gereListe              import GereListe
 
 class MonWidgetPlusieursInto (Ui_WidgetPlusieursInto,Feuille,GerePlie,GereListe):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
 
         self.index=1
         self.alpha=0
@@ -76,113 +76,120 @@ class MonWidgetPlusieursInto (Ui_WidgetPlusieursInto,Feuille,GerePlie,GereListe)
 
         if len(self.listeAAfficher) < 30 and hasattr(self,'frameRecherche') : self.frameRecherche.close()
         if len(self.listeAAfficher)  == len(self.listeValeursCourantes) : self.CBCheck.setChecked(True)
+        if len(self.listeAAfficher) < 10 :
+            self.setMinimumHeight(len(self.listeAAfficher)*22+55)
+        else :
+            self.setMinimumHeight(300)
+
         # try except si la liste des possibles est vide
         # prevoir qqchose
         try :
-          self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
+            self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
         except :
-          pass
-
-
-  def changeTout(self,int):
-       #print ('changeTout')
-       if self.inhibe : return
-       self.inhibe=True
-       if not(self.CBCheck.isChecked()) :
-          min,max = self.node.item.getMinMax()
-          if max < len(self.listeAAfficher) :
-             commentaire=tr('impossible de tout selectionner : max =')+str(max)
-             self.editor.afficheInfos(commentaire,Qt.red)
-             self.inhibe=False
-             return
-          for i in range(len(self.listeAAfficher)):
-              nomCB="lineEditVal"+str(i+1)
-              courant=getattr(self,nomCB)
-              courant.setChecked(True)
-          self.CBCheck.setChecked(False)
-       else :
-          for i in range(len(self.listeAAfficher)):
-              nomCB="lineEditVal"+str(i+1)
-              courant=getattr(self,nomCB)
-              courant.setChecked(False)
-          self.CBCheck.setChecked(True)
-       self.inhibe=False
-       self.changeValeur()
-
-  def setValeurs(self):
-       #print ('setValeurs')
-       self.listeValeursCourantes =self.node.item.getValeur()
-       if self.listeValeursCourantes ==  None : self.listeValeursCourantes=[]
-       #print "ds set Valeur", self.listeValeursCourantes, self.node.item.getValeur()
-       self.politique=PolitiquePlusieurs(self.node,self.editor)
-       self.vScrollBar = self.scrollArea.verticalScrollBar()
-
-       if hasattr(self.node.item.definition.validators,'set_MCSimp'):
+            pass
+
+
+    def changeTout(self,int):
+        #print ('changeTout')
+        if self.inhibe : return
+        self.inhibe=True
+        if not(self.CBCheck.isChecked()) :
+            min,max = self.node.item.getMinMax()
+            if max < len(self.listeAAfficher) :
+                commentaire=tr('impossible de tout selectionner : max =')+str(max)
+                self.editor.afficheInfos(commentaire,Qt.red)
+                self.inhibe=False
+                return
+            for i in range(len(self.listeAAfficher)):
+                nomCB="lineEditVal"+str(i+1)
+                courant=getattr(self,nomCB)
+                courant.setChecked(True)
+            self.CBCheck.setChecked(False)
+        else :
+            for i in range(len(self.listeAAfficher)):
+                nomCB="lineEditVal"+str(i+1)
+                courant=getattr(self,nomCB)
+                courant.setChecked(False)
+            self.CBCheck.setChecked(True)
+        self.inhibe=False
+        self.changeValeur()
+
+    def setValeurs(self):
+        #print ('setValeurs')
+        self.listeValeursCourantes =self.node.item.getValeur()
+        if self.listeValeursCourantes ==  None : self.listeValeursCourantes=[]
+        #print ("ds set Valeur", self.listeValeursCourantes, self.node.item.getValeur())
+        self.politique=PolitiquePlusieurs(self.node,self.editor)
+        self.vScrollBar = self.scrollArea.verticalScrollBar()
+
+        if hasattr(self.node.item.definition.validators,'set_MCSimp'):
             obj=self.node.item.getObject()
             self.node.item.definition.validators.set_MCSimp(obj)
             if self.node.item.isValid() == 0 :
-               liste=[]
-               for item in self.listeValeursCourantes:
-                   if self.node.item.definition.validators.verifItem(item)==1:
-                      liste.append(item)
-               self.listeAAfficher=self.node.item.getListePossible(liste)
+                liste=[]
+                for item in self.listeValeursCourantes:
+                    if self.node.item.definition.validators.verifItem(item)==1:
+                        liste.append(item)
+                self.listeAAfficher=self.node.item.getListePossible(liste)
             else:
-               self.listeAAfficher=self.node.item.getListePossible([])
-       else :
-               self.listeAAfficher=self.node.item.getListePossible([])
-
-       if self.node.item.hasIntoSug() : self.listeAAfficher=self.node.item.getListePossibleAvecSug([])
-
-
-       if self.objSimp.waitAssd() :
-          self.listeAAfficher=self.node.item.getSdAvantDuBonType()
-       if self.listeAAfficher== None or self.listeAAfficher==[] : self.listeAAfficher=[]
+                self.listeAAfficher=self.node.item.getListePossible([])
+        else :
+            self.listeAAfficher=self.node.item.getListePossible([])
 
-       #if len(self.listeAAfficher)*20 > 400 : self.setMinimumHeight(400)
-       #else : self.setMinimumHeight(len(self.listeAAfficher)*30)
+        if self.node.item.hasIntoSug() : self.listeAAfficher=self.node.item.getListePossibleAvecSug([])
 
-       self.PourEtreCoche=[]
-       if self.objSimp.waitAssd() :
-          for concept in self.listeValeursCourantes: self.PourEtreCoche.append(concept.nom)
-       else :
-          for val in self.listeValeursCourantes: self.PourEtreCoche.append(val)
 
-       maListe=[]
-       for  i in self.listeAAfficher: maListe.append(i)
-       if self.alpha==1 : maListe.sort()
-       for i in range(1,len(maListe)+1): self.ajoutCB(i)
+        if self.objSimp.waitAssd() :
+            self.listeAAfficher=self.node.item.getSdAvantDuBonType()
+        if self.listeAAfficher== None or self.listeAAfficher==[] : self.listeAAfficher=[]
 
-       self.inhibe=True
-       for i in range(len(maListe)):
-           nomCB="lineEditVal"+str(i+1)
-           courant=getattr(self,nomCB)
-           courant.setText(str(maListe[i]))
-           if maListe[i] in self.PourEtreCoche : courant.setChecked(True)
-           else                                : courant.setChecked(False)
+        #if len(self.listeAAfficher)*20 > 400 : self.setMinimumHeight(400)
+        #else : self.setMinimumHeight(len(self.listeAAfficher)*30)
 
-           courant.toggled.connect(self.changeValeur)
-       self.inhibe=False
+        self.PourEtreCoche=[]
+        if self.objSimp.waitUserAssd() :
+            for concept in self.listeValeursCourantes: self.PourEtreCoche.append(concept)
+        elif self.objSimp.waitAssd() :
+            for concept in self.listeValeursCourantes: self.PourEtreCoche.append(concept.nom)
+        else :
+            for val in self.listeValeursCourantes: self.PourEtreCoche.append(val)
+
+        maListe=[]
+        for  i in self.listeAAfficher: maListe.append(i)
+        if self.alpha==1 : maListe.sort()
+        for i in range(1,len(maListe)+1): self.ajoutCB(i)
+
+        self.inhibe=True
+        for i in range(len(maListe)):
+            nomCB="lineEditVal"+str(i+1)
+            courant=getattr(self,nomCB)
+            courant.setText(str(maListe[i]))
+            if maListe[i] in self.PourEtreCoche : courant.setChecked(True)
+            else                                : courant.setChecked(False)
+
+            courant.toggled.connect(self.changeValeur)
+        self.inhibe=False
 
-       self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum)
+        self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum)
 
 
-  def ajoutCB(self,index,valeur=None):
-      #print ('ajoutCB')
-      nomCB="lineEditVal"+str(index)
-      if hasattr(self,nomCB) : return
-      nouveauCB = QCheckBox(self.scrollArea)
-      self.CBLayout.insertWidget(index-1,nouveauCB)
-      self.listeCB.append(nouveauCB)
-      nouveauCB.setText("")
-      if index % 2 == 1 : nouveauCB.setStyleSheet("background:rgb(210,210,210)")
-      else :                       nouveauCB.setStyleSheet("background:rgb(240,240,240)")
-      self.vScrollBar.triggerAction(QScrollBar.SliderToMaximum)
-      nouveauCB.setFocus()
-      setattr(self,nomCB,nouveauCB)
+    def ajoutCB(self,index,valeur=None):
+        #print ('ajoutCB')
+        nomCB="lineEditVal"+str(index)
+        if hasattr(self,nomCB) : return
+        nouveauCB = QCheckBox(self.scrollArea)
+        self.CBLayout.insertWidget(index-1,nouveauCB)
+        self.listeCB.append(nouveauCB)
+        nouveauCB.setText("")
+        if index % 2 == 1 : nouveauCB.setStyleSheet("background:rgb(210,210,210)")
+        else :                        nouveauCB.setStyleSheet("background:rgb(240,240,240)")
+        self.vScrollBar.triggerAction(QScrollBar.SliderToMaximum)
+        nouveauCB.setFocus()
+        setattr(self,nomCB,nouveauCB)
 
 
 
-  def ajout1Valeur(self,valeur=None):
+    def ajout1Valeur(self,valeur=None):
         #print ('ajout1Valeur')
         if valeur == None : return
         liste,validite=SaisieValeur.TraiteLEValeur(self,str(valeur))
@@ -193,68 +200,66 @@ class MonWidgetPlusieursInto (Ui_WidgetPlusieursInto,Feuille,GerePlie,GereListe)
         validite,comm,comm2,listeRetour=self.politique.ajoutValeurs(liste,-1,listeVal)
         if (comm2 != "" and comm != None) : return comm2
         if validite :
-           self.listeValeursCourantes=self.listeValeursCourantes+listeRetour
-           return None
+            self.listeValeursCourantes=self.listeValeursCourantes+listeRetour
+            return None
         else :
-           return(comm2+" "+comm)
-
-
-
-  def changeValeur(self):
- #def changeValeur(self,changeDePlace=False,oblige=True, numero=None):
-      #print ('changeValeur')
-      if self.inhibe == True: return
-      if hasattr(self,'LEFiltre') :self.noircirResultatFiltre()
-      self.listeValeursCourantesAvant=self.listeValeursCourantes
-      self.listeValeursCourantes = []
-
-      for i in range (1,len(self.listeAAfficher)+1):
-          nomLineEdit="lineEditVal"+str(i)
-          courant=getattr(self,nomLineEdit)
-          if not (courant.isChecked()):continue
-          valeur=courant.text()
-          if valeur != None and valeur != "" :
-             commentaire=self.ajout1Valeur(valeur)
-             if (commentaire != None ):
-                 self.editor.afficheInfos(commentaire,Qt.red)
-                 self.listeValeursCourantesAvant=self.listeValeursCourantes
-                 self.setValeurs()
-
-      min,max = self.node.item.getMinMax()
-      if len(self.listeValeursCourantes) < min :
-         self.editor.afficheInfos(tr("Nombre minimal de valeurs : ") + str(min),Qt.red)
-      elif len(self.listeValeursCourantes) > max :
-         self.editor.afficheInfos(tr("Nombre maximal de valeurs : ") + str(max),Qt.red)
-
-      if self.listeValeursCourantes== [] :  self.node.item.setValeur([])
-      else : self.node.item.setValeur(self.listeValeursCourantes)
-
-      # Exception pour PSEN
-      if min==0 and self.listeValeursCourantes== []: self.node.item.setValeur([])
-      self.setValide()
-
-
-  def prepareListeResultatFiltre(self):
-      #print ('prepareListeResultatFiltre')
-      filtre=str(self.LEFiltre.text())
-      for cb in self.listeCB:
-          texte=cb.text()
-          if texte.find(filtre) == 0 :
-            palette = QPalette(Qt.red)
-            palette.setColor(QPalette.WindowText,Qt.red)
-            cb.setPalette(palette)
-            t=cb.text()
-            cb.setText(t)
-            self.listeCbRouge.append(cb)
-
-  def prepareListeResultat(self):
-      #print ('prepareListeResultat')
-      self.clearAll()
-      self.setValeurs()
-
-  def clearAll(self):
-      #print ('clearAll')
-      for cb in self.listeCB :
-         cb.setText("")
-
-
+            return(comm2+" "+comm)
+
+
+
+    def changeValeur(self):
+   #def changeValeur(self,changeDePlace=False,oblige=True, numero=None):
+        #print ('changeValeur')
+        if self.inhibe == True: return
+        if hasattr(self,'LEFiltre') :self.noircirResultatFiltre()
+        self.listeValeursCourantesAvant=self.listeValeursCourantes
+        self.listeValeursCourantes = []
+
+        for i in range (1,len(self.listeAAfficher)+1):
+            nomLineEdit="lineEditVal"+str(i)
+            courant=getattr(self,nomLineEdit)
+            if not (courant.isChecked()):continue
+            valeur=courant.text()
+            if valeur != None and valeur != "" :
+                commentaire=self.ajout1Valeur(valeur)
+                if (commentaire != None ):
+                    self.editor.afficheInfos(commentaire,Qt.red)
+                    self.listeValeursCourantesAvant=self.listeValeursCourantes
+                    self.setValeurs()
+
+        min,max = self.node.item.getMinMax()
+        if len(self.listeValeursCourantes) < min :
+            self.editor.afficheInfos(tr("Nombre minimal de valeurs : ") + str(min),Qt.red)
+        elif len(self.listeValeursCourantes) > max :
+            self.editor.afficheInfos(tr("Nombre maximal de valeurs : ") + str(max),Qt.red)
+
+        if self.listeValeursCourantes== [] :  self.node.item.setValeur([])
+        else : self.node.item.setValeur(self.listeValeursCourantes)
+
+        # Exception pour PSEN
+        if min==0 and self.listeValeursCourantes== []: self.node.item.setValeur([])
+        self.setValide()
+
+
+    def prepareListeResultatFiltre(self):
+        #print ('prepareListeResultatFiltre')
+        filtre=str(self.LEFiltre.text())
+        for cb in self.listeCB:
+            texte=cb.text()
+            if texte.find(filtre) == 0 :
+                palette = QPalette(Qt.red)
+                palette.setColor(QPalette.WindowText,Qt.red)
+                cb.setPalette(palette)
+                t=cb.text()
+                cb.setText(t)
+                self.listeCbRouge.append(cb)
+
+    def prepareListeResultat(self):
+        #print ('prepareListeResultat')
+        self.clearAll()
+        self.setValeurs()
+
+    def clearAll(self):
+        #print ('clearAll')
+        for cb in self.listeCB :
+            cb.setText("")
index 0d3186a6b79a3121a85ca4ae088d34a619971e29..3fbe5838ac890184d8b7cb26dbfae483cdd50b51 100644 (file)
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 
 import types,os,sys
 
 # Modules Eficas
 from .feuille                import Feuille
-from desWidgetPlusieursIntoOrdonne import Ui_WidgetPlusieursIntoOrdonne 
+from desWidgetPlusieursIntoOrdonne import Ui_WidgetPlusieursIntoOrdonne
 from .politiquesValidation   import PolitiquePlusieurs
 from .qtSaisie               import SaisieValeur
 from .gereListe              import GereListe
@@ -44,7 +44,7 @@ from PyQt5.QtGui  import QIcon, QPalette
 
 class MonWidgetPlusieursIntoOrdonne (Ui_WidgetPlusieursIntoOrdonne, Feuille,GereListe,GerePlie):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parent,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parent,commande):
         self.nomLine="LEResultat"
         self.listeLE=[]
         self.ouAjouter=0
@@ -57,23 +57,23 @@ class MonWidgetPlusieursIntoOrdonne (Ui_WidgetPlusieursIntoOrdonne, Feuille,Gere
         self.gereIconePlier()
         self.listeValeursCourantes=self.node.item.getListeValeurs()
         try :
-          self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
+            self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
         except :
-          # cas ou on ne peut rien ajouter
-          pass 
+            # cas ou on ne peut rien ajouter
+            pass
         self.prepareListeResultat()
         if len(self.listeAAfficher) < 20 : self.frameRecherche2.close()
         if len(self.listeAAfficher) < 20 : self.frameRecherche.close()
         self.adjustSize()
-        if sys.platform[0:5]!="linux":
-          repIcon=self.node.editor.appliEficas.repIcon
-          fichier=os.path.join(repIcon, 'arrow_up.png')
-          icon = QIcon(fichier)
-          self.RBHaut.setIcon(icon)
-          self.RBHaut.setIconSize(QSize(32, 32))
-          fichier2=os.path.join(repIcon, 'arrow_down.png')
-          icon2 = QIcon(fichier2)
-          self.RBBas.setIcon(icon2)
+        #if sys.platform[0:5]!="linux":
+        repIcon=self.node.editor.appliEficas.repIcon
+        fichier=os.path.join(repIcon, 'arrow_up.png')
+        icon = QIcon(fichier)
+        self.RBHaut.setIcon(icon)
+        self.RBHaut.setIconSize(QSize(32, 32))
+        fichier2=os.path.join(repIcon, 'arrow_down.png')
+        icon2 = QIcon(fichier2)
+        self.RBBas.setIcon(icon2)
         icon=QIcon(self.repIcon+"/MoinsBleu.png")
         self.RBMoins.setIcon(icon)
         icon=QIcon(self.repIcon+"/PlusBleu.png")
@@ -85,143 +85,148 @@ class MonWidgetPlusieursIntoOrdonne (Ui_WidgetPlusieursIntoOrdonne, Feuille,Gere
         self.parentQt.commandesLayout.insertWidget(-1,self)
         self.listeRouge=[]
 
-       
-  def prepareListeResultat(self):
-       for i in self.listeLE: i.close()
-       self.listeLE=[]
-       self.vScrollBar = self.scrollArea.verticalScrollBar()
-       self.listeValeursCourantes=self.node.item.getListeValeurs()
-       if hasattr(self.node.item.definition.validators,'set_MCSimp'):
+
+    def prepareListeResultat(self):
+        for i in self.listeLE: i.close()
+        self.listeLE=[]
+        self.vScrollBar = self.scrollArea.verticalScrollBar()
+        self.listeValeursCourantes=self.node.item.getListeValeurs()
+        if hasattr(self.node.item.definition.validators,'set_MCSimp'):
             obj=self.node.item.getObject()
             self.node.item.definition.validators.set_MCSimp(obj)
             if self.node.item.isValid() == 0 :
-               liste=[]
-               for item in self.listeValeursCourantes:
-                   if self.node.item.definition.validators.verifItem(item)==1: liste.append(item)
-               self.listeAAfficher=self.node.item.getListePossible(liste)
-            else: 
-               self.listeAAfficher=self.node.item.getListePossible([])
-       else :
+                liste=[]
+                for item in self.listeValeursCourantes:
+                    if self.node.item.definition.validators.verifItem(item)==1: liste.append(item)
+                self.listeAAfficher=self.node.item.getListePossible(liste)
+            else:
+                self.listeAAfficher=self.node.item.getListePossible([])
+        else :
             self.listeAAfficher=self.node.item.getListePossible(self.listeValeursCourantes)
 
-       if self.listeAAfficher==[] : 
-          self.ajoutLE(0)
-          return
-       self.filtreListe()
-       if len(self.listeAAfficher)*20 > 400 : self.setMinimumHeight(400)
-       else : self.setMinimumHeight(len(self.listeAAfficher)*30)
+        if self.listeAAfficher==[] :
+            self.ajoutLE(0)
+            return
+        self.filtreListe()
+        if len(self.listeAAfficher)*20 > 400 : self.setMinimumHeight(400)
+        else :
+            if self.monSimpDef.min > len(self.listeAAfficher)    : self.setMinimumHeight(self.monSimpDef.min*30+300)
+            elif  self.monSimpDef.max > len(self.listeAAfficher) : self.setMinimumHeight(400)
+            else  : self.setMinimumHeight(len(self.listeAAfficher)*30+30)
+        self.setMinimumHeight(300)
+        self.adjustSize()
+
+        self.politique=PolitiquePlusieurs(self.node,self.editor)
+        for i in range(1,len(self.listeAAfficher)+1): self.ajoutLE(i)
+        for i in range(len(self.listeAAfficher)):
+            nomLE="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLE)
+            courant.setText(str(self.listeAAfficher[i]))
+        self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum)
+        if len(self.listeAAfficher) < 15 and hasattr(self,'frameRecherche') : self.frameRecherche.close()
+        if len(self.listeAAfficher) < 15 and hasattr(self,'frameRecherche2') : self.frameRecherche2.close()
 
-       self.politique=PolitiquePlusieurs(self.node,self.editor)
-       for i in range(1,len(self.listeAAfficher)+1): self.ajoutLE(i)
-       for i in range(len(self.listeAAfficher)):
-           nomLE="lineEditVal"+str(i+1)
-           courant=getattr(self,nomLE)
-           courant.setText(str(self.listeAAfficher[i]))
-       self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum)
-       if len(self.listeAAfficher) < 15 and hasattr(self,'frameRecherche') : self.frameRecherche.close() 
-       if len(self.listeAAfficher) < 15 and hasattr(self,'frameRecherche2') : self.frameRecherche2.close() 
-       
-      
-  def setValeurs(self,first=True):
-       self.listeValeursCourantes=self.node.item.getListeValeurs()
-       if first : 
-          if self.monSimpDef.max == "**" or self.monSimpDef.max == float('inf') : aConstruire=7
-          else : aConstruire=self.monSimpDef.max
-          if len(self.listeValeursCourantes) > aConstruire : aConstruire=len(self.listeValeursCourantes)
-          self.indexDernierLabel = aConstruire
-          for i in range(1,aConstruire+1): self.ajoutLEResultat(i)
-       index=1
-       for val in self.listeValeursCourantes :
-          nomLE="LEResultat"+str(index)
-          courant=getattr(self,nomLE)
-          courant.setText(str(val))
-          courant.setReadOnly(True)
-          index=index+1
-       while (index < self.indexDernierLabel) :
-          nomLE="LEResultat"+str(index)
-          courant=getattr(self,nomLE)
-          courant.setText("")
-          courant.setReadOnly(True)
-          index=index+1
-       #self.prepareListeResultat()
 
-  def moinsPushed(self):
-      self.ouAjouter=self.ouAjouter-1
-      GereListe.moinsPushed(self)
-      self.setValeurs(first=False)
+    def setValeurs(self,first=True):
+        self.listeValeursCourantes=self.node.item.getListeValeurs()
+        if first :
+            if self.monSimpDef.max == "**" or self.monSimpDef.max == float('inf') : aConstruire=7
+            else : aConstruire=self.monSimpDef.max
+            if len(self.listeValeursCourantes) > aConstruire : aConstruire=len(self.listeValeursCourantes)
+            self.indexDernierLabel = aConstruire
+            for i in range(1,aConstruire+1): self.ajoutLEResultat(i)
+        index=1
+        for val in self.listeValeursCourantes :
+            nomLE="LEResultat"+str(index)
+            courant=getattr(self,nomLE)
+            courant.setText(str(val))
+            courant.setReadOnly(True)
+            index=index+1
+        while (index < self.indexDernierLabel) :
+            nomLE="LEResultat"+str(index)
+            courant=getattr(self,nomLE)
+            courant.setText("")
+            courant.setReadOnly(True)
+            index=index+1
+        #self.prepareListeResultat()
+
+    def moinsPushed(self):
+        self.ouAjouter=self.ouAjouter-1
+        GereListe.moinsPushed(self)
+        self.setValeurs(first=False)
 
-  def prepareListeResultatFiltre(self):
-      for i in self.listeRouge :
-          nomLE="lineEditVal"+str(i+1)
-          courant=getattr(self,nomLE)
-          texte=courant.text()
-          palette = QPalette(Qt.black)
-          palette.setColor(QPalette.WindowText,Qt.black)
-          courant.setPalette(palette)
-          courant.setText(texte)
-      
-      self.listeRouge = []
-      filtre=str(self.LEFiltre.text())
-      if filtre == '' : return
-      for i in range(len(self.listeAAfficher)):
-           nomLE="lineEditVal"+str(i+1)
-           courant=getattr(self,nomLE)
-           texte=courant.text()
-           if texte.find(filtre) == 0 :
-              palette = QPalette(Qt.red)
-              palette.setColor(QPalette.WindowText,Qt.red)
-              courant.setPalette(palette)
-              courant.setText(texte)
-           self.listeRouge.append(i)
+    def prepareListeResultatFiltre(self):
+        for i in self.listeRouge :
+            nomLE="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLE)
+            texte=courant.text()
+            palette = QPalette(Qt.black)
+            palette.setColor(QPalette.WindowText,Qt.black)
+            courant.setPalette(palette)
+            courant.setText(texte)
 
-  def cleanListeResultatFiltre(self):
-      self.LEFiltre.setText('')
-      self.prepareListeResultatFiltre()
+        self.listeRouge = []
+        filtre=str(self.LEFiltre.text())
+        if filtre == '' : return
+        for i in range(len(self.listeAAfficher)):
+            nomLE="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLE)
+            texte=courant.text()
+            if texte.find(filtre) == 0 :
+                palette = QPalette(Qt.red)
+                palette.setColor(QPalette.WindowText,Qt.red)
+                courant.setPalette(palette)
+                courant.setText(texte)
+            self.listeRouge.append(i)
 
-  def ajoutLEResultat (self,index,valeur=None):
-      #print ('ajoutLEResultat', index, valeur)
-      nomLE="LEResultat"+str(index)
-      if not (hasattr(self,nomLE)) : 
-        nouveauLE = LECustom(self.scrollAreaRE,self,index)
-        nouveauLE.setFrame(False)
-        self.CBChoisis.insertWidget(self.ouAjouter,nouveauLE)
-        self.ouAjouter=self.ouAjouter+1
-        nouveauLE.setReadOnly(True)
+    def cleanListeResultatFiltre(self):
+        self.LEFiltre.setText('')
+        self.prepareListeResultatFiltre()
+
+    def ajoutLEResultat (self,index,valeur=None):
+        #print ('ajoutLEResultat', index, valeur)
+        nomLE="LEResultat"+str(index)
+        if not (hasattr(self,nomLE)) :
+            nouveauLE = LECustom(self.scrollAreaRE,self,index)
+            nouveauLE.setFrame(False)
+            self.CBChoisis.insertWidget(self.ouAjouter,nouveauLE)
+            self.ouAjouter=self.ouAjouter+1
+            nouveauLE.setReadOnly(True)
+            if index % 2 == 1 : nouveauLE.setStyleSheet("background:rgb(210,210,210)")
+            else :            nouveauLE.setStyleSheet("background:rgb(240,240,240)")
+            self.vScrollBarRE = self.scrollAreaRE.verticalScrollBar()
+            self.vScrollBarRE.triggerAction(QScrollBar.SliderToMaximum)
+            setattr(self,nomLE,nouveauLE)
+            self.estVisibleRE=nouveauLE
+        else :
+            nouveauLE=getattr(self,nomLE)
+
+        if valeur == None : nouveauLE.setText("")
+        else : nouveauLE.setText(str(valeur))
+
+    def ajoutLE(self,index,valeur=None):
+        #print ('ajoutLE')
+        nomLE="lineEditVal"+str(index)
+        nouveauLE = MonLabelListeClic(self)
+        #self.CBLayout.addWidget(nouveauLE)
+        self.CBLayout.insertWidget(index -1,nouveauLE)
+        self.listeLE.append(nouveauLE)
+        nouveauLE.setFrameShape(QFrame.NoFrame)
+        QApplication.processEvents()
+        nouveauLE.setText("")
         if index % 2 == 1 : nouveauLE.setStyleSheet("background:rgb(210,210,210)")
-        else :           nouveauLE.setStyleSheet("background:rgb(240,240,240)")
-        self.vScrollBarRE = self.scrollAreaRE.verticalScrollBar()
-        self.vScrollBarRE.triggerAction(QScrollBar.SliderToMaximum)
+        else :              nouveauLE.setStyleSheet("background:rgb(240,240,240)")
+        self.vScrollBar.triggerAction(QScrollBar.SliderToMaximum)
+        nouveauLE.setFocus()
         setattr(self,nomLE,nouveauLE)
-        self.estVisibleRE=nouveauLE
-      else :
-         nouveauLE=getattr(self,nomLE)
 
-      if valeur == None : nouveauLE.setText("")
-      else : nouveauLE.setText(str(valeur))
-      
-  def ajoutLE(self,index,valeur=None):
-      #print ('ajoutLE')
-      nomLE="lineEditVal"+str(index)
-      nouveauLE = MonLabelListeClic(self)
-      #self.CBLayout.addWidget(nouveauLE)
-      self.CBLayout.insertWidget(index -1,nouveauLE)
-      self.listeLE.append(nouveauLE)
-      nouveauLE.setFrameShape(QFrame.NoFrame)
-      QApplication.processEvents()
-      nouveauLE.setText("")
-      if index % 2 == 1 : nouveauLE.setStyleSheet("background:rgb(210,210,210)")
-      else :             nouveauLE.setStyleSheet("background:rgb(240,240,240)")
-      self.vScrollBar.triggerAction(QScrollBar.SliderToMaximum)
-      nouveauLE.setFocus()
-      setattr(self,nomLE,nouveauLE)
-      
-  def ajoutLineEdit(self):
-      #print ('ajoutLineEdit')
-      self.indexDernierLabel=self.indexDernierLabel+1
-      self.ajoutLEResultat (self.indexDernierLabel)
+    def ajoutLineEdit(self):
+        #print ('ajoutLineEdit')
+        self.indexDernierLabel=self.indexDernierLabel+1
+        self.ajoutLEResultat (self.indexDernierLabel)
 
 
-  def traiteClicSurLabelListe(self,valeur):
+    def traiteClicSurLabelListe(self,valeur):
         if valeur == None : return
         liste,validite=SaisieValeur.TraiteLEValeur(self,str(valeur))
         if validite == 0 : return
@@ -230,70 +235,70 @@ class MonWidgetPlusieursIntoOrdonne (Ui_WidgetPlusieursIntoOrdonne, Feuille,Gere
 
         self.listeValeursCourantes=self.node.item.getListeValeurs()
         min,max = self.node.item.getMinMax()
-        if len(self.listeValeursCourantes) +1 > max : 
-           self.editor.afficheInfos(tr("Nombre maximal de valeurs : ") + str(max),Qt.red)
-           return
+        if len(self.listeValeursCourantes) +1 > max :
+            self.editor.afficheInfos(tr("Nombre maximal de valeurs : ") + str(max),Qt.red)
+            return
         else :
-           self.editor.afficheInfos("")
+            self.editor.afficheInfos("")
 
         affiche=False
         for i in range(1,self.indexDernierLabel+1):
-           nomLE="LEResultat"+str(i)
-           courant=getattr(self,nomLE)
-           if str(courant.text())==str("") : 
-              courant.setText(valeur)
-              courant.setReadOnly(True)
-              affiche=True
-              self.estVisibleRE=courant
-              QTimer.singleShot(1, self.rendVisibleLigneRE)
-              break
-          
+            nomLE="LEResultat"+str(i)
+            courant=getattr(self,nomLE)
+            if str(courant.text())==str("") :
+                courant.setText(valeur)
+                courant.setReadOnly(True)
+                affiche=True
+                self.estVisibleRE=courant
+                QTimer.singleShot(1, self.rendVisibleLigneRE)
+                break
+
         if affiche == False:
-           self.indexDernierLabel = self.indexDernierLabel+1
-           self.ajoutLEResultat (self.indexDernierLabel,str(valeur))
-           self.vScrollBarRE.triggerAction(QScrollBar.SliderToMaximum)
-           QTimer.singleShot(1, self.rendVisibleLigneRE)
+            self.indexDernierLabel = self.indexDernierLabel+1
+            self.ajoutLEResultat (self.indexDernierLabel,str(valeur))
+            self.vScrollBarRE.triggerAction(QScrollBar.SliderToMaximum)
+            QTimer.singleShot(1, self.rendVisibleLigneRE)
         self.changeValeur()
         self.setValeurs(first=False)
 
-  def changeValeur(self,changeDePlace=False,oblige=False):
+    def changeValeur(self,changeDePlace=False,oblige=False):
 #def changeValeur(self,changeDePlace=False,oblige=False, numero=None):
 #PN les 2 arg sont pour que la signature de ma fonction soit identique a monWidgetPlusieursBase
         listeVal=[]
         for i in range(1,self.indexDernierLabel+1):
-           nomLE="LEResultat"+str(i)
-           courant=getattr(self,nomLE)
-           valeur=courant.text()
-           if str(valeur)=="" : continue
-           liste,validite=SaisieValeur.TraiteLEValeur(self,str(valeur))
-           listeVal.append(str(valeur))
+            nomLE="LEResultat"+str(i)
+            courant=getattr(self,nomLE)
+            valeur=courant.text()
+            if str(valeur)=="" : continue
+            liste,validite=SaisieValeur.TraiteLEValeur(self,str(valeur))
+            listeVal.append(str(valeur))
 
         validite,comm,comm2,listeRetour=self.politique.ajoutValeurs(listeVal,-1,[])
-        
+
 
         self.listeValeursCourantes=self.node.item.getListeValeurs()
         min,max = self.node.item.getMinMax()
-        if len(self.listeValeursCourantes) < min : 
-           self.editor.afficheInfos(tr("Nombre minimal de valeurs : ") + str(min),Qt.red)
+        if len(self.listeValeursCourantes) < min :
+            self.editor.afficheInfos(tr("Nombre minimal de valeurs : ") + str(min),Qt.red)
         else :
-           self.editor.afficheInfos("")
-    
+            self.editor.afficheInfos("")
+
         if len(listeRetour) == 0 :
-           self.node.item.setValeur(None)
+            self.node.item.setValeur(None)
         elif validite :
-           self.node.item.setValeur(listeRetour)
+            self.node.item.setValeur(listeRetour)
         else :
-           commentaire=comm+" "+comm2
-           self.editor.afficheInfos(commentaire,Qt.red)
+            commentaire=comm+" "+comm2
+            self.editor.afficheInfos(commentaire,Qt.red)
         self.setValide()
+        self.reaffiche()
+      
 #
-  def rendVisibleLigneRE(self):
-      QApplication.processEvents()
-      self.estVisibleRE.setFocus()
-      self.scrollArea.ensureWidgetVisible(self.estVisibleRE,0,0)
+    def rendVisibleLigneRE(self):
+        QApplication.processEvents()
+        self.estVisibleRE.setFocus()
+        self.scrollArea.ensureWidgetVisible(self.estVisibleRE,0,0)
 #
-  def rendVisibleLigne(self):
-      self.estVisibleRE=self.estVisible
-      #rendVisibleLigneRE()
-
-
+    def rendVisibleLigne(self):
+        self.estVisibleRE=self.estVisible
+        #rendVisibleLigneRE()
index 382d812c3fa428dc48778303233dc73e480e341d..424f5055c020adf43e4da8f26dbc1db6126a5902 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os,sys,re
@@ -32,7 +32,7 @@ from PyQt5.QtGui  import QIcon, QBrush, QColor
 from Extensions.i18n import tr
 
 from .feuille                import Feuille
-from desWidgetPlusieursPlie import Ui_WidgetPlusieursPlie 
+from desWidgetPlusieursPlie import Ui_WidgetPlusieursPlie
 
 from .politiquesValidation   import PolitiquePlusieurs
 from .qtSaisie               import SaisieValeur
@@ -42,81 +42,81 @@ pattern_blanc = re.compile(r"^\s*$")
 
 class MonWidgetPlusieursPlie (Ui_WidgetPlusieursPlie,Feuille):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         #print ("MonWidgetPlusieursBase", nom)
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.parentQt.commandesLayout.insertWidget(-1,self)
         self.AAfficher=self.lineEditVal
         self.maCommande.listeAffichageWidget.append(self.lineEditVal)
-        if self.node.item.hasInto() : 
-           self.lineEditVal.setReadOnly(True)
-           self.lineEditVal.setStyleSheet("background:rgb(235,235,235);\n")
-           self.lineEditVal.setToolTip("Ensemble discret de valeurs possibles, pas de Saisie Manuelle")
-           #self.lineEditVal.setPen(QtGui.QColor(0,0,200))
-          #b=QBrush(Qt.DiagCrossPattern)
-           #b.setColor(QColor(255,100,0))
-           #self.lineEditVal.setBrush(b)
+        if self.node.item.hasInto() :
+            self.lineEditVal.setReadOnly(True)
+            self.lineEditVal.setStyleSheet("background:rgb(235,235,235);\n")
+            self.lineEditVal.setToolTip("Ensemble discret de valeurs possibles, pas de Saisie Manuelle")
+            #self.lineEditVal.setPen(QtGui.QColor(0,0,200))
+            #b=QBrush(Qt.DiagCrossPattern)
+            #b.setColor(QColor(255,100,0))
+            #self.lineEditVal.setBrush(b)
         else :
-           self.lineEditVal.returnPressed.connect(self.valeurEntree)
+            self.lineEditVal.returnPressed.connect(self.valeurEntree)
         self.BVisuListe.clicked.connect(self.selectWidgetDeplie)
 
 
-  def setValeurs(self):
-       self.listeValeursCourantes=self.node.item.getListeValeurs()
-       if self.listeValeursCourantes != []  :  self.lineEditVal.setText(str(self.listeValeursCourantes))
-       else : self.lineEditVal.setText("")
-       self.politique=PolitiquePlusieurs(self.node,self.editor)
-       return
-
-  def selectWidgetDeplie(self):
-      self.editor.listeDesListesOuvertes.add(self.node.item)
-      self.reaffichePourDeplier()
-
-  def valeurEntree(self):
-      valeurTexte=self.lineEditVal.text()
-      #print (valeurTexte[0])
-      #print (valeurTexte[-1])
-      if valeurTexte[0] == '[' or valeurTexte[0] == '('   : valeurTexte = valeurTexte[1:]
-      if valeurTexte[-1] == ']' or valeurTexte[-1] == ')' : valeurTexte = valeurTexte[:-1]
-      #print (valeurTexte)
-      listeValeursBrutes=valeurTexte.split(',')
-      if listeValeursBrutes == [] or listeValeursBrutes == None : 
-         self.lineEditVal.setText(str(self.listeValeursCourantes))
-         return
-      listeValeur=[]
-      for v in listeValeursBrutes: 
-          if v == None or pattern_blanc.match(v) : 
-             self.editor.afficheInfos(str(listeValeur)+'   Valeurs saisies incorrectes',Qt.red)
-             return
-          liste,validite=SaisieValeur.TraiteLEValeur(self,str(v))
-          if not validite : 
-             self.editor.afficheInfos(str(listeValeur) +'   Valeurs saisies incorrectes',Qt.red)
-             return
-          listeValeur.append(liste[0])
-      validite,comm,comm2,listeRetour=self.politique.ajoutValeurs(listeValeur,-1,[])
-      if validite : 
-         self.node.item.setValeur(listeValeur)
-         self.node.item.isValid()
-         self.setValeurs()
-      else :
-         self.editor.afficheInfos(str(listeValeur) + '   ' +comm,Qt.red)
-         self.lineEditVal.setText('')
-       
+    def setValeurs(self):
+        self.listeValeursCourantes=self.node.item.getListeValeurs()
+        if self.listeValeursCourantes != []  :  self.lineEditVal.setText(str(self.listeValeursCourantes))
+        else : self.lineEditVal.setText("")
+        self.politique=PolitiquePlusieurs(self.node,self.editor)
+        return
+
+    def selectWidgetDeplie(self):
+        self.editor.listeDesListesOuvertes.add(self.node.item)
+        self.reaffichePourDeplier()
+
+    def valeurEntree(self):
+        valeurTexte=self.lineEditVal.text()
+        #print (valeurTexte[0])
+        #print (valeurTexte[-1])
+        if valeurTexte[0] == '[' or valeurTexte[0] == '('   : valeurTexte = valeurTexte[1:]
+        if valeurTexte[-1] == ']' or valeurTexte[-1] == ')' : valeurTexte = valeurTexte[:-1]
+        #print (valeurTexte)
+        listeValeursBrutes=valeurTexte.split(',')
+        if listeValeursBrutes == [] or listeValeursBrutes == None :
+            self.lineEditVal.setText(str(self.listeValeursCourantes))
+            return
+        listeValeur=[]
+        for v in listeValeursBrutes:
+            if v == None or pattern_blanc.match(v) :
+                self.editor.afficheInfos(str(listeValeur)+'   Valeurs saisies incorrectes',Qt.red)
+                return
+            liste,validite=SaisieValeur.TraiteLEValeur(self,str(v))
+            if not validite :
+                self.editor.afficheInfos(str(listeValeur) +'   Valeurs saisies incorrectes',Qt.red)
+                return
+            listeValeur.append(liste[0])
+        validite,comm,comm2,listeRetour=self.politique.ajoutValeurs(listeValeur,-1,[])
+        if validite :
+            self.node.item.setValeur(listeValeur)
+            self.node.item.isValid()
+            self.setValeurs()
+        else :
+            self.editor.afficheInfos(str(listeValeur) + '   ' +comm,Qt.red)
+            self.lineEditVal.setText('')
+
 class MonWidgetPlusieursPlieASSD (MonWidgetPlusieursPlie):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         MonWidgetPlusieursPlie.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.lineEditVal.setReadOnly(True)
 
-  def setValeurs(self):
-       self.listeValeursCourantes=self.node.item.getListeValeurs()
-       self.politique=PolitiquePlusieurs(self.node,self.editor)
-       if self.listeValeursCourantes == []  :  self.lineEditVal.setText(""); return
-       txt="["
-       for elt in self.listeValeursCourantes :
+    def setValeurs(self):
+        self.listeValeursCourantes=self.node.item.getListeValeurs()
+        self.politique=PolitiquePlusieurs(self.node,self.editor)
+        if self.listeValeursCourantes == []  :  self.lineEditVal.setText(""); return
+        txt="["
+        for elt in self.listeValeursCourantes :
             txt= txt+ (str(elt)) + ","
-       txt= txt + "]"
-       self.lineEditVal.setText(txt)
+        txt= txt + "]"
+        self.lineEditVal.setText(txt)
 
-  def valeurEntree(self):
-      pass
+    def valeurEntree(self):
+        pass
index 7a84e5011a585ebaa4c04c02753683748cac9552..9899faab121f014969de0dbbb1fdd6ef1f4d3cca 100644 (file)
@@ -20,9 +20,9 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import range
-   from builtins import object
+    from builtins import str
+    from builtins import range
+    from builtins import object
 except : pass
 
 import types,os,sys
@@ -55,193 +55,193 @@ from Tuple10                            import Ui_Tuple10
 class TupleCustom(object) :
 #--------------------------
 
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------------------------------------
-      QWidget.__init__(self,parent)
-      self.setupUi(self)
-      self.tailleTuple=tailleTuple
-      self.parent=parent
-      self.parentQt=parentQt
-      self.valeur=[]
-      self.index=index
-      self.inFocusOutEvent=False
-
-
-      for i in range(self.tailleTuple):
-         nomLE="lineEditVal_"+str(i+1)
-         courant=getattr(self,nomLE)
-         courant.num=index
-         courant.dansUnTuple=True
-         courant.returnPressed.connect(self.valueChange)
-         courant.numDsLaListe = i+1
-         courant.tupleCustomParent=self
-         courant.parentTuple = self
-
-
-  def valueChange(self):
-  #----------------------
-
-      listeVal=[]
-      for i in range(self.tailleTuple):
-         nomLE="lineEditVal_"+str(i+1)
-         courant=getattr(self,nomLE)
-         val=str(courant.text())
-        
-         if str(val)=="" or val==None : 
-            if not self.inFocusOutEvent : courant.setFocus()
-            return
+    def __init__(self,tailleTuple,parent,parentQt,index):
+    #-------------------------------------------------
+        QWidget.__init__(self,parent)
+        self.setupUi(self)
+        self.tailleTuple=tailleTuple
+        self.parent=parent
+        self.parentQt=parentQt
+        self.valeur=[]
+        self.index=index
+        self.inFocusOutEvent=False
+
+
+        for i in range(self.tailleTuple):
+            nomLE="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLE)
+            courant.num=index
+            courant.dansUnTuple=True
+            courant.returnPressed.connect(self.valueChange)
+            courant.numDsLaListe = i+1
+            courant.tupleCustomParent=self
+            courant.parentTuple = self
+
+
+    def valueChange(self):
+    #----------------------
+
+        listeVal=[]
+        for i in range(self.tailleTuple):
+            nomLE="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLE)
+            val=str(courant.text())
+
+            if str(val)=="" or val==None :
+                if not self.inFocusOutEvent : courant.setFocus()
+                return
+
+            try :
+                valeur=eval(val,{})
+            except :
+                try :
+                    d=self.parentQt.objSimp.jdc.getContexteAvant(self.parentQt.objSimp. etape)
+                    valeur=eval(val,d)
+                except :
+                    valeur=val
+            listeVal.append(valeur)
+        self.valeur=listeVal
+        self.parentQt.changeValeur()
+
+
+    def setValeur(self,value):
+    #----------------------
+
+        listeVal=[]
+        valeurNulle=True
+        for i in range(self.tailleTuple):
+            nomLE="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLE)
+            try :
+                if str(value[i]) != "" : valeurNulle=False
+            except :
+                pass
 
-         try :
-             valeur=eval(val,{})
-         except :
-           try :
-             d=self.parentQt.objSimp.jdc.getContexteAvant(self.parentQt.objSimp. etape)
-             valeur=eval(val,d)
-           except :
-             valeur=val
-         listeVal.append(valeur)
-      self.valeur=listeVal
-      self.parentQt.changeValeur()
-
-
-  def setValeur(self,value):
-  #----------------------
-
-      listeVal=[]
-      valeurNulle=True
-      for i in range(self.tailleTuple):
-         nomLE="lineEditVal_"+str(i+1)
-         courant=getattr(self,nomLE)
-         try :
-           if str(value[i]) != "" : valeurNulle=False
-         except :
-           pass
-
-         try :
-           courant.setText(str(value[i]))
-         except :
-           courant.setText("")
-         val=str(courant.text())
-         try :
-           valeur=eval(val,{})
-         except :
-           try :
-             d=self.parentQt.objSimp.jdc.getContexteAvant(self.parentQt.objSimp. etape)
-             valeur=eval(val,d)
-           except :
-             valeur=val
-         listeVal.append(valeur)
-      if  valeurNulle == True : self.valeur=None
-      else                    : self.valeur=listeVal
-
-  def getValeurbad(self):
-  #----------------------
-      self.valeur=[]
-      vide=True
-      print (self.tailleTuple)
-      for i in range(self.tailleTuple):
-         nomLE="lineEditVal_"+str(i+1)
-         courant=getattr(self,nomLE)
-         self.valeur.append(courant.valeur)
-         if courant.valeur!= None : vide = False 
-      if vide : self.valeur=[]
-      return self.valeur
-
-  def getValeur(self):
-  #----------------------
-      return self.valeur
-     
-
-  def text(self):
-  #--------------
-      return self.valeur
-
-  def setText(self,value):
-  #-----------------------
-      self.setValeur(value)
-
-  def clean(self):
-  #-------------------
-      self.valeur=None
-      for i in range(self.tailleTuple):
-         nomLE="lineEditVal_"+str(i+1)
-         courant=getattr(self,nomLE)
-         courant.setText("")
-
-  def finCommentaire(self):
-  #-------------------
+            try :
+                courant.setText(str(value[i]))
+            except :
+                courant.setText("")
+            val=str(courant.text())
+            try :
+                valeur=eval(val,{})
+            except :
+                try :
+                    d=self.parentQt.objSimp.jdc.getContexteAvant(self.parentQt.objSimp. etape)
+                    valeur=eval(val,d)
+                except :
+                    valeur=val
+            listeVal.append(valeur)
+        if  valeurNulle == True : self.valeur=None
+        else                    : self.valeur=listeVal
+
+    def getValeurbad(self):
+    #----------------------
+        self.valeur=[]
+        vide=True
+        print (self.tailleTuple)
+        for i in range(self.tailleTuple):
+            nomLE="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLE)
+            self.valeur.append(courant.valeur)
+            if courant.valeur!= None : vide = False
+        if vide : self.valeur=[]
+        return self.valeur
+
+    def getValeur(self):
+    #----------------------
+        return self.valeur
+
+
+    def text(self):
+    #--------------
+        return self.valeur
+
+    def setText(self,value):
+    #-----------------------
+        self.setValeur(value)
+
+    def clean(self):
+    #-------------------
+        self.valeur=None
+        for i in range(self.tailleTuple):
+            nomLE="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLE)
+            courant.setText("")
+
+    def finCommentaire(self):
+    #-------------------
         return self.finCommentaireListe()
 
 
 #-------------------------------------------------
 class TupleCustom2(QWidget,Ui_Tuple2,TupleCustom):
 #-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-      if self.parentQt.editor.maConfiguration.closeParenthese :
-           self.label_5.close()
-           self.label_7.close()
+    def __init__(self,tailleTuple,parent,parentQt,index):
+    #-------------------
+        TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
+        if self.parentQt.editor.maConfiguration.closeParenthese :
+            self.label_5.close()
+            self.label_7.close()
 
 
 #-------------------------------------------------
 class TupleCustom3(QWidget,Ui_Tuple3,TupleCustom):
 #-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
+    def __init__(self,tailleTuple,parent,parentQt,index):
+    #-------------------
+        TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
 
 #-------------------------------------------------
 class TupleCustom4(QWidget,Ui_Tuple4,TupleCustom):
 #-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
+    def __init__(self,tailleTuple,parent,parentQt,index):
+    #-------------------
+        TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
 
 #-------------------------------------------------
 class TupleCustom5(QWidget,Ui_Tuple5,TupleCustom):
 #-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
+    def __init__(self,tailleTuple,parent,parentQt,index):
+    #-------------------
+        TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
 
 #-------------------------------------------------
 class TupleCustom6(QWidget,Ui_Tuple6,TupleCustom):
 #-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
+    def __init__(self,tailleTuple,parent,parentQt,index):
+    #-------------------
+        TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
 
 #-------------------------------------------------
 class TupleCustom7(QWidget,Ui_Tuple7,TupleCustom):
 #-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
+    def __init__(self,tailleTuple,parent,parentQt,index):
+    #-------------------
+        TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
 
 #-------------------------------------------------
 class TupleCustom8(QWidget,Ui_Tuple8,TupleCustom):
 #-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
+    def __init__(self,tailleTuple,parent,parentQt,index):
+    #-------------------
+        TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
 
 #-------------------------------------------------
 class TupleCustom9(QWidget,Ui_Tuple9,TupleCustom):
 #-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
+    def __init__(self,tailleTuple,parent,parentQt,index):
+    #-------------------
+        TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
 
 #-------------------------------------------------
 class TupleCustom10(QWidget,Ui_Tuple10,TupleCustom):
 #-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-      if self.parentQt.editor.maConfiguration.closeParenthese :
-           self.label_5.close()
-           self.label_7.close()
+    def __init__(self,tailleTuple,parent,parentQt,index):
+    #-------------------
+        TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
+        if self.parentQt.editor.maConfiguration.closeParenthese :
+            self.label_5.close()
+            self.label_7.close()
 
 
 
@@ -251,8 +251,8 @@ class TupleCustom10(QWidget,Ui_Tuple10,TupleCustom):
 class MonWidgetPlusieursTuple(Feuille,GereListe):
 # -------------------------------------------- #
 
-  def __init__(self, node, monSimpDef, nom, objSimp, parentQt, commande):
-  #-----------------------------------------------------
+    def __init__(self, node, monSimpDef, nom, objSimp, parentQt, commande):
+    #-----------------------------------------------------
 
         self.indexDernierLabel=0
         self.numLineEditEnCours=0
@@ -265,158 +265,158 @@ class MonWidgetPlusieursTuple(Feuille,GereListe):
         self.parentQt.commandesLayout.insertWidget(-1,self)
 
         #if sys.platform[0:5]!="linux":
-        if 1 : 
+        if 1 :
         #Pour MT
-          repIcon=self.node.editor.appliEficas.repIcon
-          fichier=os.path.join(repIcon, 'arrow_up.png')
-          icon = QIcon(fichier)
-          self.RBHaut.setIcon(icon)
-          self.RBHaut.setIconSize(QSize(32, 32))
-          fichier2=os.path.join(repIcon, 'arrow_down.png')
-          icon2 = QIcon(fichier2)
-          self.RBBas.setIcon(icon2)
-          fichier3=os.path.join(repIcon, 'file-explorer.png')
-          icon3 = QIcon(fichier3)
-          self.BSelectFichier.setIcon(icon3)
-          self.BSelectFichier.setIconSize(QSize(32, 32))
+            repIcon=self.node.editor.appliEficas.repIcon
+            fichier=os.path.join(repIcon, 'arrow_up.png')
+            icon = QIcon(fichier)
+            self.RBHaut.setIcon(icon)
+            self.RBHaut.setIconSize(QSize(32, 32))
+            fichier2=os.path.join(repIcon, 'arrow_down.png')
+            icon2 = QIcon(fichier2)
+            self.RBBas.setIcon(icon2)
+            fichier3=os.path.join(repIcon, 'file-explorer.png')
+            icon3 = QIcon(fichier3)
+            self.BSelectFichier.setIcon(icon3)
+            self.BSelectFichier.setIconSize(QSize(32, 32))
         self.BSelectFichier.clicked.connect(self.selectInFile)
-
-
-
-  def ajoutLineEdit(self,valeur=None,inInit=False):
-  #------------------------------------------------
-      self.indexDernierLabel=self.indexDernierLabel+1
-      nomLineEdit=self.nomLine+str(self.indexDernierLabel)
-      if hasattr(self,nomLineEdit) :
-         self.indexDernierLabel=self.indexDernierLabel-1
-         return
-
-      nomCustomTuple='TupleCustom'+str(self.nbValeurs)
-      laClasseDuTuple=globals()[nomCustomTuple]
-      nouveauLE=laClasseDuTuple(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
-
-      #if self.nbValeurs == 2 : nouveauLE = TupleCustom2(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
-      #else                   : nouveauLE = TupleCustom3(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
-                 
-      self.verticalLayoutLE.insertWidget(self.indexDernierLabel-1,nouveauLE)
-      setattr(self,nomLineEdit,nouveauLE)
-      if valeur != None : nouveauLE.setValeur(valeur)
-
-      for i in range(self.nbValeurs) :
-          num=i+1
-          nomLineEdit='lineEditVal_'+str(num)
-          lineEditVal=getattr(nouveauLE,nomLineEdit)
-          self.listeAffichageWidget.append(lineEditVal)
-      #self.listeAffichageWidget.append(nouveauLE.lineEditVal_1)
-      #self.listeAffichageWidget.append(nouveauLE.lineEditVal_2)
-      #if self.nbValeurs == 3 : self.listeAffichageWidget.append(nouveauLE.lineEditVal_3)
-
-      self.etablitOrdre()
-
-      # deux lignes pour que le ensureVisible fonctionne
-      self.estVisible=nouveauLE.lineEditVal_1
-      if inInit==False :QTimer.singleShot(1, self.rendVisibleLigne)
-
-  def etablitOrdre(self):
-  # ---------------------
-      i=0
-      while(i +1 < len(self.listeAffichageWidget)):
-         self.listeAffichageWidget[i].setFocusPolicy(Qt.StrongFocus)
-         self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1])
-         i=i+1
-
-
-  def setValeurs(self):
-  # ---------------------
-       if self.editor.code == 'PSEN' : self.RBListePush()
-       valeurs=self.node.item.getValeur()
-       min,max=self.node.item.getMinMax()
-       if max == "**" or max > 8 : aCreer= 8
-       else : aCreer=max 
-
-       if valeurs == () or valeurs == None :
-          for i in range(aCreer): self.ajoutLineEdit(inInit=True)
-          return
-
-       for v in valeurs:
-           self.ajoutLineEdit(v,inInit=True)
-
-       for i in range(len(valeurs),aCreer) : self.ajoutLineEdit(inInit=True)
-
-  def rendVisibleLigne(self):
-  # -------------------------
-      QApplication.processEvents()
-      self.estVisible.setFocus(True)
-      self.scrollArea.ensureWidgetVisible(self.estVisible,0,0)
-
-   
-  def changeValeur(self,changeDePlace=False,oblige=True):
-  # -----------------------------------------------------
-      #Pour compatibilite signature
-      #print ('dschangeValeur', self.indexDernierLabel)
-
-      aLeFocus=self.focusWidget()
-      listeComplete=[]
-      libre=False
-      #print (self.indexDernierLabel)
-      for i in range(self.indexDernierLabel) :
-          nom=self.nomLine+str(i+1)
-          courant=getattr(self,nom)
-          valeurTuple=courant.valeur
-          if valeurTuple == None or valeurTuple== "" or valeurTuple==[]: 
-             libre=True
-             continue
-          validite,comm,comm2,listeRetour= self.politique.ajoutTuple(valeurTuple,listeComplete)
-          if not validite:
-             if comm2 != '' : comm += " " + comm2
-             self.editor.afficheInfos(comm+" "+str(self.objSimp.definition.validators.typeDesTuples),Qt.red)
-             return
-          listeComplete.append(tuple(courant.valeur))
-      #print ('listeComplete', listeComplete)
-      if listeComplete == [] : listeComplete=None
-      self.node.item.setValeur(listeComplete)
-
-      if changeDePlace : return
-      min,max=self.node.item.getMinMax()
-      if self.indexDernierLabel == max  : self.editor.afficheInfos(tr('Nb maximum de valeurs atteint'))
-      if self.indexDernierLabel < max and libre==False :
-          self.ajoutLineEdit()
-          self.listeAffichageWidget[-2].setFocus(True)
-      else :
-         try :
-           QApplication.processEvents()
-           w=self.listeAffichageWidget[self.listeAffichageWidget.index(aLeFocus)+1]
-           w.setFocus(True)
-           self.scrollArea.ensureWidgetVisible(w,0,0)
-         except :
-           pass
-          
-  def echange(self,num1,num2):
-       # on donne le focus au a celui ou on a bouge
-       # par convention le 2
-       nomLineEdit=self.nomLine+str(num1)
-       courant=getattr(self,nomLineEdit)
-       valeurAGarder=courant.getValeur()
-       nomLineEdit2=self.nomLine+str(num2)
-       courant2=getattr(self,nomLineEdit2)
-       courant.setText(courant2.text())
-       courant2.setText(valeurAGarder)
-       self.changeValeur(changeDePlace=True)
-       self.numLineEditEnCours=num2
-       self.LineEditEnCours=courant2
-       courant2.lineEditVal_1.setFocus(True)
-
-  def ajoutNValeur(self,liste):
-  #----------------------------
-  # attention quand on charge par un fichier, on ne peut pas se contenter d ajouter N fois 1 valeur
-  # car alors le temps de verification devient prohibitif  reconstructu=ion et verification a 
-  # chaque valeur. d ou l ajout de ajoutNTuple a politique plusieurs
+
+
+
+
+    def ajoutLineEdit(self,valeur=None,inInit=False):
+    #------------------------------------------------
+        self.indexDernierLabel=self.indexDernierLabel+1
+        nomLineEdit=self.nomLine+str(self.indexDernierLabel)
+        if hasattr(self,nomLineEdit) :
+            self.indexDernierLabel=self.indexDernierLabel-1
+            return
+
+        nomCustomTuple='TupleCustom'+str(self.nbValeurs)
+        laClasseDuTuple=globals()[nomCustomTuple]
+        nouveauLE=laClasseDuTuple(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
+
+        #if self.nbValeurs == 2 : nouveauLE = TupleCustom2(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
+        #else                   : nouveauLE = TupleCustom3(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
+
+        self.verticalLayoutLE.insertWidget(self.indexDernierLabel-1,nouveauLE)
+        setattr(self,nomLineEdit,nouveauLE)
+        if valeur != None : nouveauLE.setValeur(valeur)
+
+        for i in range(self.nbValeurs) :
+            num=i+1
+            nomLineEdit='lineEditVal'+str(num)
+            lineEditVal=getattr(nouveauLE,nomLineEdit)
+            self.listeAffichageWidget.append(lineEditVal)
+        #self.listeAffichageWidget.append(nouveauLE.lineEditVal1)
+        #self.listeAffichageWidget.append(nouveauLE.lineEditVal2)
+        #if self.nbValeurs == 3 : self.listeAffichageWidget.append(nouveauLE.lineEditVal3)
+
+        self.etablitOrdre()
+
+        # deux lignes pour que le ensureVisible fonctionne
+        self.estVisible=nouveauLE.lineEditVal1
+        if inInit==False :QTimer.singleShot(1, self.rendVisibleLigne)
+
+    def etablitOrdre(self):
+    # ---------------------
+        i=0
+        while(i +1 < len(self.listeAffichageWidget)):
+            self.listeAffichageWidget[i].setFocusPolicy(Qt.StrongFocus)
+            self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1])
+            i=i+1
+
+
+    def setValeurs(self):
+    # ---------------------
+        if self.editor.code == 'PSEN' : self.RBListePush()
+        valeurs=self.node.item.getValeur()
+        min,max=self.node.item.getMinMax()
+        if max == "**" or max > 8 : aCreer= 8
+        else : aCreer=max
+
+        if valeurs == () or valeurs == None :
+            for i in range(aCreer): self.ajoutLineEdit(inInit=True)
+            return
+
+        for v in valeurs:
+            self.ajoutLineEdit(v,inInit=True)
+
+        for i in range(len(valeurs),aCreer) : self.ajoutLineEdit(inInit=True)
+
+    def rendVisibleLigne(self):
+    # -------------------------
+        QApplication.processEvents()
+        self.estVisible.setFocus(True)
+        self.scrollArea.ensureWidgetVisible(self.estVisible,0,0)
+
+
+    def changeValeur(self,changeDePlace=False,oblige=True):
+    # -----------------------------------------------------
+        #Pour compatibilite signature
+        #print ('dschangeValeur', self.indexDernierLabel)
+
+        aLeFocus=self.focusWidget()
+        listeComplete=[]
+        libre=False
+        #print (self.indexDernierLabel)
+        for i in range(self.indexDernierLabel) :
+            nom=self.nomLine+str(i+1)
+            courant=getattr(self,nom)
+            valeurTuple=courant.valeur
+            if valeurTuple == None or valeurTuple== "" or valeurTuple==[]:
+                libre=True
+                continue
+            validite,comm,comm2,listeRetour= self.politique.ajoutTuple(valeurTuple,listeComplete)
+            if not validite:
+                if comm2 != '' : comm += " " + comm2
+                self.editor.afficheInfos(comm+" "+str(self.objSimp.definition.validators.typeDesTuples),Qt.red)
+                return
+            listeComplete.append(tuple(courant.valeur))
+        #print ('listeComplete', listeComplete)
+        if listeComplete == [] : listeComplete=None
+        self.node.item.setValeur(listeComplete)
+
+        if changeDePlace : return
+        min,max=self.node.item.getMinMax()
+        if self.indexDernierLabel == max  : self.editor.afficheInfos(tr('Nb maximum de valeurs atteint'))
+        if self.indexDernierLabel < max and libre==False :
+            self.ajoutLineEdit()
+            self.listeAffichageWidget[-2].setFocus(True)
+        else :
+            try :
+                QApplication.processEvents()
+                w=self.listeAffichageWidget[self.listeAffichageWidget.index(aLeFocus)+1]
+                w.setFocus(True)
+                self.scrollArea.ensureWidgetVisible(w,0,0)
+            except :
+                pass
+
+    def echange(self,num1,num2):
+        # on donne le focus au a celui ou on a bouge
+        # par convention le 2
+        nomLineEdit=self.nomLine+str(num1)
+        courant=getattr(self,nomLineEdit)
+        valeurAGarder=courant.getValeur()
+        nomLineEdit2=self.nomLine+str(num2)
+        courant2=getattr(self,nomLineEdit2)
+        courant.setText(courant2.text())
+        courant2.setText(valeurAGarder)
+        self.changeValeur(changeDePlace=True)
+        self.numLineEditEnCours=num2
+        self.lineEditEnCours=courant2
+        courant2.lineEditVal1.setFocus(True)
+
+    def ajoutNValeur(self,liste):
+    #----------------------------
+    # attention quand on charge par un fichier, on ne peut pas se contenter d ajouter N fois 1 valeur
+    # car alors le temps de verification devient prohibitif  reconstructu=ion et verification a
+    # chaque valeur. d ou l ajout de ajoutNTuple a politique plusieurs
 
         if len(liste)%self.nbValeurs != 0 :
-           texte="Nombre incorrect de valeurs"
-           self.editor.afficheInfos(tr(texte),Qt.red)
-           return
+            texte="Nombre incorrect de valeurs"
+            self.editor.afficheInfos(tr(texte),Qt.red)
+            return
 
         i=0
         longueur=len(liste)//self.nbValeurs
@@ -428,15 +428,15 @@ class MonWidgetPlusieursTuple(Feuille,GereListe):
         if self.objSimp.valeur == None : listeComplete=listeFormatee
         else : listeComplete =self.objSimp.valeur + listeFormatee
 
-        if len(listeComplete) > max : 
-           texte=tr("Nombre maximum de valeurs ")+str(max)+tr(" atteint")
-           self.editor.afficheInfos(texte,Qt.red)
-           return
+        if len(listeComplete) > max :
+            texte=tr("Nombre maximum de valeurs ")+str(max)+tr(" atteint")
+            self.editor.afficheInfos(texte,Qt.red)
+            return
 
         validite,comm,comm2,listeRetour= self.politique.ajoutNTuple(listeComplete)
-        if not validite : 
-           self.editor.afficheInfos(comm+comm2,Qt.red)
-           return
+        if not validite :
+            self.editor.afficheInfos(comm+comm2,Qt.red)
+            return
 
         # on calcule le dernier lineedit rempli avant de changer la valeur
         if self.objSimp.valeur != None : indexDernierRempli=len(self.objSimp.valeur)
@@ -446,101 +446,100 @@ class MonWidgetPlusieursTuple(Feuille,GereListe):
 
         while ( i < len(liste) ) :
             try :
-              t=tuple(liste[i:i+self.nbValeurs])
+                t=tuple(liste[i:i+self.nbValeurs])
             except:
-              t=tuple(liste[i:len(liste)])
+                t=tuple(liste[i:len(liste)])
             i=i+self.nbValeurs
             if indexDernierRempli < self.indexDernierLabel:
 
-               nomLEARemplir=self.nomLine+str(indexDernierRempli+1)
-               LEARemplir=getattr(self,nomLEARemplir) 
-               for n in range(self.nbValeurs) :
-                  nomLineEdit='lineEditVal_'+str(n+1)
-                  lineEditVal=getattr(LEARemplir,nomLineEdit)
-                  lineEditVal.setText(str(t[n]))
-            else : 
-               # ne pas appeler ajoutLineEdit(t,False ) pb de boucle pb du a etablitOrdre et a listeWidgetAffichage qui bouge
-               self.indexDernierLabel=self.indexDernierLabel+1
-               nomLineEdit=self.nomLine+str(self.indexDernierLabel)
-
-               nomCustomTuple='TupleCustom'+str(self.nbValeurs)
-               laClasseDuTuple=globals()[nomCustomTuple]
-               nouveauLE=laClasseDuTuple(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
-                 
-               self.verticalLayoutLE.insertWidget(self.indexDernierLabel-1,nouveauLE)
-               setattr(self,nomLineEdit,nouveauLE)
-               nouveauLE.setValeur(t)
-
-               for n in range(self.nbValeurs) :
-                  nomLineEdit='lineEditVal_'+str(n+1)
-                  lineEditVal=getattr(nouveauLE,nomLineEdit)
-                  self.listeAffichageWidget.append(lineEditVal)
+                nomLEARemplir=self.nomLine+str(indexDernierRempli+1)
+                LEARemplir=getattr(self,nomLEARemplir)
+                for n in range(self.nbValeurs) :
+                    nomLineEdit='lineEditVal'+str(n+1)
+                    lineEditVal=getattr(LEARemplir,nomLineEdit)
+                    lineEditVal.setText(str(t[n]))
+            else :
+                # ne pas appeler ajoutLineEdit(t,False ) pb de boucle pb du a etablitOrdre et a listeWidgetAffichage qui bouge
+                self.indexDernierLabel=self.indexDernierLabel+1
+                nomLineEdit=self.nomLine+str(self.indexDernierLabel)
+
+                nomCustomTuple='TupleCustom'+str(self.nbValeurs)
+                laClasseDuTuple=globals()[nomCustomTuple]
+                nouveauLE=laClasseDuTuple(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
+
+                self.verticalLayoutLE.insertWidget(self.indexDernierLabel-1,nouveauLE)
+                setattr(self,nomLineEdit,nouveauLE)
+                nouveauLE.setValeur(t)
+
+                for n in range(self.nbValeurs) :
+                    nomLineEdit='lineEditVal'+str(n+1)
+                    lineEditVal=getattr(nouveauLE,nomLineEdit)
+                    self.listeAffichageWidget.append(lineEditVal)
             indexDernierRempli = indexDernierRempli+1
 
         self.etablitOrdre()
 
-        
-
-  def RBListePush(self):
-  #----------------------
-  # PN a rendre generique avec un truc tel prerempli
-  # pour l instant specifique PSEN
-
-      if self.editor.code == 'VP' : return
-      if self.objSimp.valeur != None and self.objSimp.valeur != [] : return
-      if not hasattr(self.editor.readercata.cata,'sd_ligne') : self.editor.readercata.cata.sd_ligne=None
-      if not hasattr(self.editor.readercata.cata,'sd_generateur') : self.editor.readercata.cata.sd_generateur=None
-      if not hasattr(self.editor.readercata.cata,'sd_transfo') : self.editor.readercata.cata.sd_transfo=None
-      if not hasattr(self.editor.readercata.cata,'sd_charge') : self.editor.readercata.cata.sd_charge=None
-      if not hasattr(self.editor.readercata.cata,'sd_moteur') : self.editor.readercata.cata.sd_moteur=None
-      if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_ligne :
-         val=[]
-         if  hasattr(self.objSimp.jdc,'LineDico'):
-          for k in self.objSimp.jdc.LineDico :
-              try :
-               valeur=self.objSimp.jdc.getConcept(k)
-               val.append((valeur,0))
-              except :
-               pass
-         self.node.item.setValeur(val)
-      if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_generateur :
-         val=[]
-         if  hasattr(self.objSimp.jdc,'MachineDico'):
-          for k in self.objSimp.jdc.MachineDico :
-              try :
-               valeur=self.objSimp.jdc.getConcept(k)
-               val.append((valeur,0))
-              except :
-               pass
-         self.node.item.setValeur(val)
-      if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_transfo :
-         val=[]
-         if  hasattr(self.objSimp.jdc,'TransfoDico'):
-          for k in self.objSimp.jdc.TransfoDico :
-              try :
-               valeur=self.objSimp.jdc.getConcept(k)
-               val.append((valeur,0))
-              except :
-               pass
-         self.node.item.setValeur(val)
-      if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_charge :
-         val=[]
-         if  hasattr(self.objSimp.jdc,'LoadDico'):
-          for k in self.objSimp.jdc.LoadDico :
-              try :
-               valeur=self.objSimp.jdc.getConcept(k)
-               val.append((valeur,0))
-              except :
-               pass
-         self.node.item.setValeur(val)
-      if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_moteur :
-         val=[]
-         if  hasattr(self.objSimp.jdc,'MotorDico'):
-          for k in self.objSimp.jdc.MotorDico :
-              try :
-               valeur=self.objSimp.jdc.getConcept(k)
-               val.append((valeur,0))
-              except :
-               pass
-         self.node.item.setValeur(val)
 
+
+    def RBListePush(self):
+    #----------------------
+    # PN a rendre generique avec un truc tel prerempli
+    # pour l instant specifique PSEN
+
+        if self.editor.code == 'VP' : return
+        if self.objSimp.valeur != None and self.objSimp.valeur != [] : return
+        if not hasattr(self.editor.readercata.cata,'sd_ligne') : self.editor.readercata.cata.sd_ligne=None
+        if not hasattr(self.editor.readercata.cata,'sd_generateur') : self.editor.readercata.cata.sd_generateur=None
+        if not hasattr(self.editor.readercata.cata,'sd_transfo') : self.editor.readercata.cata.sd_transfo=None
+        if not hasattr(self.editor.readercata.cata,'sd_charge') : self.editor.readercata.cata.sd_charge=None
+        if not hasattr(self.editor.readercata.cata,'sd_moteur') : self.editor.readercata.cata.sd_moteur=None
+        if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_ligne :
+            val=[]
+            if  hasattr(self.objSimp.jdc,'LineDico'):
+                for k in self.objSimp.jdc.LineDico :
+                    try :
+                        valeur=self.objSimp.jdc.getConcept(k)
+                        val.append((valeur,0))
+                    except :
+                        pass
+            self.node.item.setValeur(val)
+        if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_generateur :
+            val=[]
+            if  hasattr(self.objSimp.jdc,'MachineDico'):
+                for k in self.objSimp.jdc.MachineDico :
+                    try :
+                        valeur=self.objSimp.jdc.getConcept(k)
+                        val.append((valeur,0))
+                    except :
+                        pass
+            self.node.item.setValeur(val)
+        if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_transfo :
+            val=[]
+            if  hasattr(self.objSimp.jdc,'TransfoDico'):
+                for k in self.objSimp.jdc.TransfoDico :
+                    try :
+                        valeur=self.objSimp.jdc.getConcept(k)
+                        val.append((valeur,0))
+                    except :
+                        pass
+            self.node.item.setValeur(val)
+        if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_charge :
+            val=[]
+            if  hasattr(self.objSimp.jdc,'LoadDico'):
+                for k in self.objSimp.jdc.LoadDico :
+                    try :
+                        valeur=self.objSimp.jdc.getConcept(k)
+                        val.append((valeur,0))
+                    except :
+                        pass
+            self.node.item.setValeur(val)
+        if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_moteur :
+            val=[]
+            if  hasattr(self.objSimp.jdc,'MotorDico'):
+                for k in self.objSimp.jdc.MotorDico :
+                    try :
+                        valeur=self.objSimp.jdc.getConcept(k)
+                        val.append((valeur,0))
+                    except :
+                        pass
+            self.node.item.setValeur(val)
diff --git a/InterfaceQT4/monWidgetPlusieursTuple2.py b/InterfaceQT4/monWidgetPlusieursTuple2.py
deleted file mode 100644 (file)
index 3c48b18..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2021   EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# Modules Python
-from __future__ import absolute_import
-import types,os
-
-# Modules Eficas
-
-from .feuille                  import Feuille
-from .monWidgetPlusieursTuple  import MonWidgetPlusieursTuple 
-from desWidgetPlusieursTuple  import Ui_WidgetPlusieursTuple
-
-
-class MonWidgetPlusieursTuple2 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-        self.nbValeurs=2
-        MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
diff --git a/InterfaceQT4/monWidgetPlusieursTuple3.py b/InterfaceQT4/monWidgetPlusieursTuple3.py
deleted file mode 100644 (file)
index 5c39773..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2021   EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# Modules Python
-from __future__ import absolute_import
-import types,os
-
-# Modules Eficas
-
-from .feuille                  import Feuille
-from .monWidgetPlusieursTuple  import MonWidgetPlusieursTuple 
-from desWidgetPlusieursTuple  import Ui_WidgetPlusieursTuple 
-
-
-class MonWidgetPlusieursTuple3 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-        self.nbValeurs=3
-        MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
diff --git a/InterfaceQT4/monWidgetPlusieursTupleAvril11.py b/InterfaceQT4/monWidgetPlusieursTupleAvril11.py
deleted file mode 100644 (file)
index 8398051..0000000
+++ /dev/null
@@ -1,495 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2021   EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# Modules Python
-from __future__ import absolute_import
-try :
-   from builtins import str
-   from builtins import range
-   from builtins import object
-except : pass
-
-import types,os,sys
-
-from six.moves import range
-from PyQt5.QtWidgets  import QFrame,QApplication, QFrame, QWidget
-from PyQt5.QtGui      import QIcon
-from PyQt5.QtCore     import QSize, Qt, QTimer
-
-from Extensions.i18n import tr
-
-
-from InterfaceQT4.feuille               import Feuille
-from InterfaceQT4.politiquesValidation  import PolitiquePlusieurs
-from InterfaceQT4.qtSaisie              import SaisieValeur
-from InterfaceQT4.gereListe             import GereListe
-from InterfaceQT4.gereListe             import LECustom
-from Tuple2                             import Ui_Tuple2
-from Tuple3                             import Ui_Tuple3
-from Tuple4                             import Ui_Tuple4
-from Tuple5                             import Ui_Tuple5
-from Tuple6                             import Ui_Tuple6
-from Tuple7                             import Ui_Tuple7
-from Tuple8                             import Ui_Tuple8
-from Tuple9                             import Ui_Tuple9
-from Tuple10                            import Ui_Tuple10
-
-
-#--------------------------
-class TupleCustom(object) :
-#--------------------------
-
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------------------------------------
-      QWidget.__init__(self,parent)
-      self.setupUi(self)
-      self.tailleTuple=tailleTuple
-      self.parent=parent
-      self.parentQt=parentQt
-      self.valeur=None
-      self.index=index
-      self.inFocusOutEvent=False
-
-
-      for i in range(self.tailleTuple):
-         nomLE="lineEditVal_"+str(i+1)
-         courant=getattr(self,nomLE)
-         courant.num=index
-         courant.dansUnTuple=True
-         courant.numDsLaListe = i+1
-         courant.tupleCustomParent=self
-
-
-
-  def setValeur(self,value):
-  #----------------------
-
-      listeVal=[]
-      valeurNulle=True
-      for i in range(self.tailleTuple):
-         nomLE="lineEditVal_"+str(i+1)
-         courant=getattr(self,nomLE)
-         try :
-           if str(value[i]) != "" : valeurNulle=False
-         except :
-           pass
-
-         try :
-           courant.setText(str(value[i]))
-         except :
-           courant.setText("")
-         val=str(courant.text())
-         try :
-           valeur=eval(val,{})
-         except :
-           try :
-             d=self.parentQt.objSimp.jdc.getContexteAvant(self.parentQt.objSimp. etape)
-             valeur=eval(val,d)
-           except :
-             valeur=val
-         listeVal.append(valeur)
-      if  valeurNulle == True : self.valeur=None
-      else                    : self.valeur=listeVal
-
-  def getValeur(self):
-  #----------------------
-      return self.valeur
-
-  def text(self):
-  #--------------
-      return self.valeur
-
-  def setText(self,value):
-  #-----------------------
-      self.setValeur(value)
-
-  def clean(self):
-  #-------------------
-      self.valeur=None
-      for i in range(self.tailleTuple):
-         nomLE="lineEditVal_"+str(i+1)
-         courant=getattr(self,nomLE)
-         courant.setText("")
-
-  def finCommentaire(self):
-  #-------------------
-        return self.finCommentaireListe()
-
-
-#-------------------------------------------------
-class TupleCustom2(QWidget,Ui_Tuple2,TupleCustom):
-#-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-
-#-------------------------------------------------
-class TupleCustom3(QWidget,Ui_Tuple3,TupleCustom):
-#-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-----------------------------------------------------
-      TupleCustom. __init__(self,tailleTuple,parent,parentQt,index)
-      
-#-------------------------------------------------
-class TupleCustom3(QWidget,Ui_Tuple3,TupleCustom):
-#-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-
-#-------------------------------------------------
-class TupleCustom4(QWidget,Ui_Tuple4,TupleCustom):
-#-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-
-#-------------------------------------------------
-class TupleCustom5(QWidget,Ui_Tuple5,TupleCustom):
-#-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-
-#-------------------------------------------------
-class TupleCustom6(QWidget,Ui_Tuple6,TupleCustom):
-#-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-
-#-------------------------------------------------
-class TupleCustom7(QWidget,Ui_Tuple7,TupleCustom):
-#-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-
-#-------------------------------------------------
-class TupleCustom8(QWidget,Ui_Tuple8,TupleCustom):
-#-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-
-#-------------------------------------------------
-class TupleCustom9(QWidget,Ui_Tuple9,TupleCustom):
-#-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-
-#-------------------------------------------------
-class TupleCustom10(QWidget,Ui_Tuple10,TupleCustom):
-#-------------------------------------------------
-  def __init__(self,tailleTuple,parent,parentQt,index):
-  #-------------------
-      TupleCustom.__init__(self,tailleTuple,parent,parentQt,index)
-
-
-
-
-
-# -------------------------------------------- #
-class MonWidgetPlusieursTuple(Feuille,GereListe):
-# -------------------------------------------- #
-
-  def __init__(self, node, monSimpDef, nom, objSimp, parentQt, commande):
-  #-----------------------------------------------------
-
-        self.indexDernierLabel=0
-        self.numLineEditEnCours=0
-        self.nomLine="TupleVal"
-        self.listeAffichageWidget=[]
-        Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-        GereListe.__init__(self)
-        self.finCommentaireListe()
-        self.politique=PolitiquePlusieurs(self.node,self.editor)
-        self.parentQt.commandesLayout.insertWidget(-1,self)
-
-        if sys.platform[0:5]!="linux":
-          repIcon=self.node.editor.appliEficas.repIcon
-          fichier=os.path.join(repIcon, 'arrow_up.png')
-          icon = QIcon(fichier)
-          self.RBHaut.setIcon(icon)
-          self.RBHaut.setIconSize(QSize(32, 32))
-          fichier2=os.path.join(repIcon, 'arrow_down.png')
-          icon2 = QIcon(fichier2)
-          self.RBBas.setIcon(icon2)
-          fichier3=os.path.join(repIcon, 'file-explorer.png')
-          icon3 = QIcon(fichier3)
-          self.BSelectFichier.setIcon(icon3)
-          self.BSelectFichier.setIconSize(QSize(32, 32))
-        self.BSelectFichier.clicked.connect(self.selectInFile)
-
-
-
-  def ajoutLineEdit(self,valeur=None,inInit=False):
-  #------------------------------------------------
-      self.indexDernierLabel=self.indexDernierLabel+1
-      nomLineEdit=self.nomLine+str(self.indexDernierLabel)
-      if hasattr(self,nomLineEdit) :
-         self.indexDernierLabel=self.indexDernierLabel-1
-         return
-
-      nomCustomTuple='TupleCustom'+str(self.nbValeurs)
-      laClasseDuTuple=globals()[nomCustomTuple]
-      nouveauLE=laClasseDuTuple(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
-
-      #if self.nbValeurs == 2 : nouveauLE = TupleCustom2(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
-      #else                   : nouveauLE = TupleCustom3(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
-                 
-      self.verticalLayoutLE.insertWidget(self.indexDernierLabel-1,nouveauLE)
-      setattr(self,nomLineEdit,nouveauLE)
-      if valeur != None : nouveauLE.setValeur(valeur)
-
-      for i in range(self.nbValeurs) :
-          num=i+1
-          nomLineEdit='lineEditVal_'+str(num)
-          lineEditVal=getattr(nouveauLE,nomLineEdit)
-          self.listeAffichageWidget.append(lineEditVal)
-      #self.listeAffichageWidget.append(nouveauLE.lineEditVal_1)
-      #self.listeAffichageWidget.append(nouveauLE.lineEditVal_2)
-      #if self.nbValeurs == 3 : self.listeAffichageWidget.append(nouveauLE.lineEditVal_3)
-
-      self.etablitOrdre()
-
-      # deux lignes pour que le ensureVisible fonctionne
-      self.estVisible=nouveauLE.lineEditVal_1
-      if inInit==False :QTimer.singleShot(1, self.rendVisibleLigne)
-
-  def etablitOrdre(self):
-  # ---------------------
-      i=0
-      while(i +1 < len(self.listeAffichageWidget)):
-         self.listeAffichageWidget[i].setFocusPolicy(Qt.StrongFocus)
-         self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1])
-         i=i+1
-
-
-  def setValeurs(self):
-  # ---------------------
-       if self.editor.code == 'PSEN' : self.RBListePush()
-       valeurs=self.node.item.getValeur()
-       min,max=self.node.item.getMinMax()
-       if max == "**" or max > 8 : aCreer= 8
-       else : aCreer=max 
-
-       if valeurs == () or valeurs == None :
-          for i in range(aCreer): self.ajoutLineEdit(inInit=True)
-          return
-
-       for v in valeurs:
-           self.ajoutLineEdit(v,inInit=True)
-
-       for i in range(len(valeurs),aCreer) : self.ajoutLineEdit(inInit=True)
-
-  def rendVisibleLigne(self):
-  # -------------------------
-      QApplication.processEvents()
-      self.estVisible.setFocus(True)
-      self.scrollArea.ensureWidgetVisible(self.estVisible,0,0)
-
-   
-  def changeValeur(self,changeDePlace=False,oblige=True):
-  # -----------------------------------------------------
-      #Pour compatibilite signature
-
-      self.aEuLeFocus=False # set pour le leaveEvent voir gereListe
-      aLeFocus=self.focusWidget()
-      listeComplete=[]
-      libre=False
-      #print ('ds changeValeur', self.indexDernierLabel)
-      for i in range(self.indexDernierLabel) :
-          #print (i)
-          nom=self.nomLine+str(i+1)
-          #print (nom)
-          courant=getattr(self,nom)
-          #print (courant)
-          valeurTuple=courant.valeur
-          #print (valeurTuple)
-          if valeurTuple == None or valeurTuple== "": 
-             libre=True
-             continue
-          print (i, valeurTuple)
-          validite,comm,comm2,listeRetour= self.politique.ajoutTuple(valeurTuple,listeComplete)
-          if not validite:
-             print (validite,comm,comm2)
-             if comm2 != '' : comm += " " + comm2
-             print (validite,comm,comm2)
-             self.editor.afficheInfos(comm+" "+str(self.objSimp.definition.validators.typeDesTuples),Qt.red)
-             print (comm+" "+str(self.objSimp.definition.validators.typeDesTuples),Qt.red)
-             return
-          listeComplete.append(tuple(courant.valeur))
-      if listeComplete == [] : listeComplete=None
-      self.node.item.setValeur(listeComplete)
-
-      if changeDePlace : return
-      min,max=self.node.item.getMinMax()
-      if self.indexDernierLabel == max  : self.editor.afficheInfos(tr('Nb maximum de valeurs atteint'))
-      if self.indexDernierLabel < max and libre==False :
-          self.ajoutLineEdit()
-          self.listeAffichageWidget[-2].setFocus(True)
-      else :
-         try :
-           QApplication.processEvents()
-           w=self.listeAffichageWidget[self.listeAffichageWidget.index(aLeFocus)+1]
-           w.setFocus(True)
-           self.scrollArea.ensureWidgetVisible(w,0,0)
-         except :
-           pass
-          
-  def ajoutNValeur(self,liste):
-  #----------------------------
-  # attention quand on charge par un fichier, on ne peut pas se contenter d ajouter N fois 1 valeur
-  # car alors le temps de verification devient prohibitif  reconstructu=ion et verification a 
-  # chaque valeur. d ou l ajout de ajoutNTuple a politique plusieurs
-
-        if len(liste)%self.nbValeurs != 0 :
-           texte="Nombre incorrect de valeurs"
-           self.editor.afficheInfos(tr(texte),Qt.red)
-           return
-
-        i=0
-        longueur=len(liste)//self.nbValeurs
-        increment=self.nbValeurs
-        listeFormatee=[liste[k*increment:(k+1)*increment] for k in range(longueur)]
-        listeFormatee=tuple(listeFormatee)
-
-        min,max=self.node.item.getMinMax()
-        if self.objSimp.valeur == None : listeComplete=listeFormatee
-        else : listeComplete =self.objSimp.valeur + listeFormatee
-
-        if len(listeComplete) > max : 
-           texte=tr("Nombre maximum de valeurs ")+str(max)+tr(" atteint")
-           self.editor.afficheInfos(texte,Qt.red)
-           return
-
-        validite,comm,comm2,listeRetour= self.politique.ajoutNTuple(listeComplete)
-        if not validite : 
-           self.editor.afficheInfos(texte,Qt.red)
-           return
-
-        # on calcule le dernier lineedit rempli avant de changer la valeur
-        if self.objSimp.valeur != None : indexDernierRempli=len(self.objSimp.valeur)
-        else : indexDernierRempli=0
-
-        self.politique.recordValeur(listeComplete)
-
-        while ( i < len(liste) ) :
-            try :
-              t=tuple(liste[i:i+self.nbValeurs])
-            except:
-              t=tuple(liste[i:len(liste)])
-            i=i+self.nbValeurs
-            if indexDernierRempli < self.indexDernierLabel:
-
-               nomLEARemplir=self.nomLine+str(indexDernierRempli+1)
-               LEARemplir=getattr(self,nomLEARemplir) 
-               for n in range(self.nbValeurs) :
-                  nomLineEdit='lineEditVal_'+str(n+1)
-                  lineEditVal=getattr(LEARemplir,nomLineEdit)
-                  lineEditVal.setText(str(t[n]))
-            else : 
-               # ne pas appeler ajoutLineEdit(t,False ) pb de boucle pb du a etablitOrdre et a listeWidgetAffichage qui bouge
-               self.indexDernierLabel=self.indexDernierLabel+1
-               nomLineEdit=self.nomLine+str(self.indexDernierLabel)
-
-               nomCustomTuple='TupleCustom'+str(self.nbValeurs)
-               laClasseDuTuple=globals()[nomCustomTuple]
-               nouveauLE=laClasseDuTuple(self.nbValeurs,self.scrollArea,self,self.indexDernierLabel)
-                 
-               self.verticalLayoutLE.insertWidget(self.indexDernierLabel-1,nouveauLE)
-               setattr(self,nomLineEdit,nouveauLE)
-               nouveauLE.setValeur(t)
-
-               for n in range(self.nbValeurs) :
-                  nomLineEdit='lineEditVal_'+str(n+1)
-                  lineEditVal=getattr(nouveauLE,nomLineEdit)
-                  self.listeAffichageWidget.append(lineEditVal)
-            indexDernierRempli = indexDernierRempli+1
-
-        self.etablitOrdre()
-
-        
-
-  def RBListePush(self):
-  #----------------------
-  # PN a rendre generique avec un truc tel prerempli
-  # pour l instant specifique PSEN
-
-      if self.editor.code == 'VP' : return
-      if self.objSimp.valeur != None and self.objSimp.valeur != [] : return
-      if not hasattr(self.editor.readercata.cata,'sd_ligne') : self.editor.readercata.cata.sd_ligne=None
-      if not hasattr(self.editor.readercata.cata,'sd_generateur') : self.editor.readercata.cata.sd_generateur=None
-      if not hasattr(self.editor.readercata.cata,'sd_transfo') : self.editor.readercata.cata.sd_transfo=None
-      if not hasattr(self.editor.readercata.cata,'sd_charge') : self.editor.readercata.cata.sd_charge=None
-      if not hasattr(self.editor.readercata.cata,'sd_moteur') : self.editor.readercata.cata.sd_moteur=None
-      if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_ligne :
-         val=[]
-         if  hasattr(self.objSimp.jdc,'LineDico'):
-          for k in self.objSimp.jdc.LineDico :
-              try :
-               valeur=self.objSimp.jdc.getConcept(k)
-               val.append((valeur,0))
-              except :
-               pass
-         self.node.item.setValeur(val)
-      if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_generateur :
-         val=[]
-         if  hasattr(self.objSimp.jdc,'MachineDico'):
-          for k in self.objSimp.jdc.MachineDico :
-              try :
-               valeur=self.objSimp.jdc.getConcept(k)
-               val.append((valeur,0))
-              except :
-               pass
-         self.node.item.setValeur(val)
-      if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_transfo :
-         val=[]
-         if  hasattr(self.objSimp.jdc,'TransfoDico'):
-          for k in self.objSimp.jdc.TransfoDico :
-              try :
-               valeur=self.objSimp.jdc.getConcept(k)
-               val.append((valeur,0))
-              except :
-               pass
-         self.node.item.setValeur(val)
-      if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_charge :
-         val=[]
-         if  hasattr(self.objSimp.jdc,'LoadDico'):
-          for k in self.objSimp.jdc.LoadDico :
-              try :
-               valeur=self.objSimp.jdc.getConcept(k)
-               val.append((valeur,0))
-              except :
-               pass
-         self.node.item.setValeur(val)
-      if self.objSimp.definition.validators.typeDesTuples[0]==self.editor.readercata.cata.sd_moteur :
-         val=[]
-         if  hasattr(self.objSimp.jdc,'MotorDico'):
-          for k in self.objSimp.jdc.MotorDico :
-              try :
-               valeur=self.objSimp.jdc.getConcept(k)
-               val.append((valeur,0))
-              except :
-               pass
-         self.node.item.setValeur(val)
-
index 42551488e8e35ea1f6db6e4e5deeb17a297ff7a3..c68c7c7213b7eb2dd9ac97eb9ef37614fe16b681 100644 (file)
@@ -24,50 +24,51 @@ import types,os
 # Modules Eficas
 
 from .feuille                  import Feuille
-from .monWidgetPlusieursTuple  import MonWidgetPlusieursTuple 
-from desWidgetPlusieursTuple  import Ui_WidgetPlusieursTuple 
+from .monWidgetPlusieursTuple  import MonWidgetPlusieursTuple
+from desWidgetPlusieursTuple  import Ui_WidgetPlusieursTuple
 
 
 class MonWidgetPlusieursTuple2 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=2
         MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetPlusieursTuple3 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=3
+        MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
 
 class MonWidgetPlusieursTuple4 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=4
+        MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
 
 class MonWidgetPlusieursTuple5 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=5
         MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetPlusieursTuple6 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=6
         MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetPlusieursTuple7 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=7
         MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetPlusieursTuple8 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=8
         MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetPlusieursTuple9 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=9
         MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetPlusieursTuple10 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=10
         MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
index c2cef59e56e4f777dc63d88ad4abd6573ef6309d..67fcdf16948732bd8a7c60638964090e367d8f22 100644 (file)
@@ -21,7 +21,7 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os
@@ -34,13 +34,13 @@ from PyQt5.QtWidgets  import  QWidget
 from Extensions.i18n import tr
 
 from .feuille               import Feuille
-from desWidgetRadioButton  import Ui_WidgetRadioButton 
+from desWidgetRadioButton  import Ui_WidgetRadioButton
 from .politiquesValidation  import PolitiqueUnique
 from .qtSaisie              import SaisieValeur
 
 
 class MonWidgetRadioButtonCommun (Feuille):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.setMaxI()
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.politique=PolitiqueUnique(self.node,self.editor)
@@ -52,101 +52,101 @@ class MonWidgetRadioButtonCommun (Feuille):
         self.maCommande.listeAffichageWidget.append(self.radioButton_1)
 
 
-  def setValeursApresBouton(self):
-      if self.objSimp.getValeur()==None : return
-      valeur=self.objSimp.getValeur()
-      if not(isinstance(valeur, str)) : valeur = str(valeur)
-      try :
-        self.dict_bouton[valeur].setChecked(True)
-        self.dict_bouton[valeur].setFocus(True)
-      except :
-        pass
-
-  def determineChoix(self):
-      self.horizontalLayout.setAlignment(Qt.AlignLeft)
-      i=1
-      j=len(self.maListeDeValeur)
-      if j > self.maxI : 
-         print ("poumbadaboum")
-         return
-      while i < j+1 :
-         nomBouton="radioButton_"+str(i)
-         bouton=getattr(self,nomBouton)
-         valeur=self.maListeDeValeur[i-1]
-         if not(isinstance(valeur, str)) : valeur = str(valeur)
-         bouton.setText(tr(valeur))
-         self.dict_bouton[valeur]=bouton
-         bouton.clicked.connect(self.boutonclic)
-         bouton.keyPressEvent=self.keyPressEvent
-         setattr(self,nomBouton,bouton)
-         i=i+1
-      while i < self.maxI +1 :
-         nomBouton="radioButton_"+str(i)
-         bouton=getattr(self,nomBouton)
-         bouton.close()
-         i=i+1
-
-  def boutonclic(self):
-      for valeur in self.dict_bouton:
-          if self.dict_bouton[valeur].isChecked():
-             SaisieValeur.LEvaleurPressed(self,valeur)
-      self.reaffiche()
-
-
-  def keyPressEvent(self, event):
-    if event.key() == Qt.Key_Right : self.selectSuivant(); return
-    if event.key() == Qt.Key_Left  : self.selectPrecedent(); return
-    if event.key() == Qt.Key_Return or event.key() == Qt.Key_Space : self.checkFocused(); return
-    QWidget.keyPressEvent(self,event)
-
-  def selectSuivant(self):
-      aLeFocus=self.focusWidget()
-      nom=aLeFocus.objectName()[12:]
-      i=int(nom)+1
-      if i ==  len(self.maListeDeValeur) +1 : i=1
-      nomBouton="radioButton_"+str(i)
-      courant=getattr(self,nomBouton)
-      courant.setFocus(True)
-
-  def selectPrecedent(self):
-      aLeFocus=self.focusWidget()
-      nom=aLeFocus.objectName()[12:]
-      i=int(nom)-1
-      if i == 0 : i= len(self.maListeDeValeur)  
-      nomBouton="radioButton_"+str(i)
-      courant=getattr(self,nomBouton)
-      courant.setFocus(True)
-
-  def checkFocused(self):
-      aLeFocus=self.focusWidget()
-      nom=aLeFocus.objectName()[12:]
-      i=int(nom)
-      if i > 0 and i <= len(self.maListeDeValeur):
+    def setValeursApresBouton(self):
+        if self.objSimp.getValeur()==None : return
+        valeur=self.objSimp.getValeur()
+        if not(isinstance(valeur, str)) : valeur = str(valeur)
+        try :
+            self.dict_bouton[valeur].setChecked(True)
+            self.dict_bouton[valeur].setFocus(True)
+        except :
+            pass
+
+    def determineChoix(self):
+        self.horizontalLayout.setAlignment(Qt.AlignLeft)
+        i=1
+        j=len(self.maListeDeValeur)
+        if j > self.maxI :
+            print ("poumbadaboum")
+            return
+        while i < j+1 :
+            nomBouton="radioButton_"+str(i)
+            bouton=getattr(self,nomBouton)
+            valeur=self.maListeDeValeur[i-1]
+            if not(isinstance(valeur, str)) : valeur = str(valeur)
+            bouton.setText(tr(valeur))
+            self.dict_bouton[valeur]=bouton
+            bouton.clicked.connect(self.boutonclic)
+            bouton.keyPressEvent=self.keyPressEvent
+            setattr(self,nomBouton,bouton)
+            i=i+1
+        while i < self.maxI +1 :
+            nomBouton="radioButton_"+str(i)
+            bouton=getattr(self,nomBouton)
+            bouton.close()
+            i=i+1
+
+    def boutonclic(self):
+        for valeur in self.dict_bouton:
+            if self.dict_bouton[valeur].isChecked():
+                SaisieValeur.LEvaleurPressed(self,valeur)
+        self.reaffiche()
+
+
+    def keyPressEvent(self, event):
+        if event.key() == Qt.Key_Right : self.selectSuivant(); return
+        if event.key() == Qt.Key_Left  : self.selectPrecedent(); return
+        if event.key() == Qt.Key_Return or event.key() == Qt.Key_Space : self.checkFocused(); return
+        QWidget.keyPressEvent(self,event)
+
+    def selectSuivant(self):
+        aLeFocus=self.focusWidget()
+        nom=aLeFocus.objectName()[12:]
+        i=int(nom)+1
+        if i ==  len(self.maListeDeValeur) +1 : i=1
         nomBouton="radioButton_"+str(i)
         courant=getattr(self,nomBouton)
-        if not courant.isChecked():
-          courant.setChecked(True)
-          self.boutonclic()
+        courant.setFocus(True)
+
+    def selectPrecedent(self):
+        aLeFocus=self.focusWidget()
+        nom=aLeFocus.objectName()[12:]
+        i=int(nom)-1
+        if i == 0 : i= len(self.maListeDeValeur)
+        nomBouton="radioButton_"+str(i)
+        courant=getattr(self,nomBouton)
+        courant.setFocus(True)
+
+    def checkFocused(self):
+        aLeFocus=self.focusWidget()
+        nom=aLeFocus.objectName()[12:]
+        i=int(nom)
+        if i > 0 and i <= len(self.maListeDeValeur):
+            nomBouton="radioButton_"+str(i)
+            courant=getattr(self,nomBouton)
+            if not courant.isChecked():
+                courant.setChecked(True)
+                self.boutonclic()
 
 
 class MonWidgetRadioButton (Ui_WidgetRadioButton,MonWidgetRadioButtonCommun):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-        #print "MonWidgetRadioButton ", self
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+            #print "MonWidgetRadioButton ", self
         if type(monSimpDef.into) ==types.FunctionType : self.maListeDeValeur=monSimpDef.into()
         else : self.maListeDeValeur=monSimpDef.into
 
         MonWidgetRadioButtonCommun.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-        
-  def setMaxI(self):
+
+    def setMaxI(self):
         self.maxI=3
 
 
 class MonWidgetRadioButtonSD (Ui_WidgetRadioButton,MonWidgetRadioButtonCommun):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         #print "dans le init de MonWidgetRadioButtonSD",self
         self.maListeDeValeur=node.item.getSdAvantDuBonType()
         MonWidgetRadioButtonCommun.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
 
-  def setMaxI(self):
+    def setMaxI(self):
         self.maxI=3
index 691d2713ccd07b643daef7d3903f5fd0bc10daf7..d07252b1d66f42ae9db90032fda587a59bc77247 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os
@@ -31,7 +31,7 @@ from PyQt5.QtCore import Qt
 from Extensions.i18n import tr
 
 from .feuille               import Feuille
-from desWidgetSDCOInto     import Ui_WidgetSDCOInto 
+from desWidgetSDCOInto     import Ui_WidgetSDCOInto
 from .qtSaisie              import SaisieSDCO
 from .politiquesValidation  import PolitiqueUnique
 
@@ -39,7 +39,7 @@ from .politiquesValidation  import PolitiqueUnique
 
 class MonWidgetSDCOInto (Ui_WidgetSDCOInto,Feuille,SaisieSDCO):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         #print "MonWidgetSDCOInto init"
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.politique=PolitiqueUnique(self.node,self.editor)
@@ -47,25 +47,25 @@ class MonWidgetSDCOInto (Ui_WidgetSDCOInto,Feuille,SaisieSDCO):
         self.maCommande.listeAffichageWidget.append(self.LESDCO)
         self.AAficher=self.LESDCO
         self.initLBSDCO()
-       
+
         self.LESDCO.returnPressed.connect(self.LESDCOReturnPressed)
         self.LBSDCO.itemDoubleClicked.connect(self.LBSDCODoubleClicked )
 
-  def LESDCOReturnPressed(self) :
+    def LESDCOReturnPressed(self) :
         self.LBSDCO.clearSelection()
         SaisieSDCO.LESDCOReturnPressed(self)
 
 
-  def initLBSDCO(self):
+    def initLBSDCO(self):
         listeNomsSDCO = self.node.item.getSdAvantDuBonType()
         for aSDCO in listeNomsSDCO:
             self.LBSDCO.insertItem( 1,aSDCO)
         valeur = self.node.item.getValeur()
         if valeur  != "" and valeur != None :
-           self.LESDCO.setText(str(valeur.nom))
+            self.LESDCO.setText(str(valeur.nom))
 
 
-  def LBSDCODoubleClicked(self):
+    def LBSDCODoubleClicked(self):
         """
          Teste si la valeur fournie par l'utilisateur est une valeur permise :
           - si oui, l'enregistre
@@ -80,19 +80,17 @@ class MonWidgetSDCOInto (Ui_WidgetSDCOInto,Feuille,SaisieSDCO):
         valeur,validite=self.node.item.evalValeur(nomConcept)
         test = self.node.item.setValeur(valeur)
         if not test :
-          commentaire = tr("impossible d'evaluer : ") +  valeur
+            commentaire = tr("impossible d'evaluer : ") +  valeur
         elif validite:
-          commentaire = tr("Valeur du mot-clef enregistree")
-          if test_CO:
-             # il faut egalement propager la destruction de l'ancien concept
-             self.node.item.deleteValeurCo(valeur=anc_val)
-             self.node.item.object.etape.getType_produit(force=1)
-             self.node.item.object.etape.parent.resetContext()
-             self.LESDCO.setText(nomConcept)
+            commentaire = tr("Valeur du mot-clef enregistree")
+            if test_CO:
+                # il faut egalement propager la destruction de l'ancien concept
+                self.node.item.deleteValeurCo(valeur=anc_val)
+                self.node.item.object.etape.getType_produit(force=1)
+                self.node.item.object.etape.parent.resetContext()
+                self.LESDCO.setText(nomConcept)
         else :
-          commentaire = self.node.item.getCr()
-          self.reset_old_valeur(anc_val,mess=mess)
-          self.editor.afficheInfos(commentaire,Qt.red)
+            commentaire = self.node.item.getCr()
+            self.reset_old_valeur(anc_val,mess=mess)
+            self.editor.afficheInfos(commentaire,Qt.red)
         self.Commentaire.setText(tr(commentaire))
-
-
index d916017ef996f8689409434e6d2e80854859bea6..fae5cb3f383c63f132898567574bd56e95e2d7fb 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os
@@ -31,15 +31,16 @@ from PyQt5.QtCore import  Qt
 from Extensions.i18n import tr
 
 from .feuille               import Feuille
-from desWidgetSimpBase     import Ui_WidgetSimpBase 
+from desWidgetSimpBase     import Ui_WidgetSimpBase
 from .politiquesValidation  import PolitiqueUnique
 from .qtSaisie              import SaisieValeur
 
 
 class MonWidgetSimpBase (Ui_WidgetSimpBase,Feuille):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
+        if 'R' or 'I' in self.monSimpDef.type  : self.lineEditVal.setMinimumWidth(525)
         self.parentQt.commandesLayout.insertWidget(-1,self,1)
         self.setFocusPolicy(Qt.StrongFocus)
         if monSimpDef.homo == 'constant' : self.lineEditVal.setReadOnly(True)
@@ -51,66 +52,64 @@ class MonWidgetSimpBase (Ui_WidgetSimpBase,Feuille):
         self.lineEditVal.focusOutEvent=self.monFocusOutEvent
 
 
-  def monFocusInEvent(self,event):
-      self.editor.nodeEnCours = self
-      QLineEdit.focusInEvent(self.lineEditVal,event)
-
-  def monFocusOutEvent(self,event):
-      if self.oldValeurTexte != self.lineEditVal.text():
-         self.oldValeurTexte= self.lineEditVal.text()
-         self.LEvaleurPressed()
-      QLineEdit.focusOutEvent(self.lineEditVal,event)
-
-
-  def setValeurs(self):
-       #print ("dans setValeurs")
-       self.politique=PolitiqueUnique(self.node,self.editor)
-       valeur=self.node.item.getValeur()
-       valeurTexte=self.politique.getValeurTexte(valeur)
-       chaine=""
-
-       if valeurTexte != None :
-          from decimal import Decimal
-          if isinstance(valeurTexte,Decimal):
-             chaine=str(valeurTexte)
-          elif repr(valeurTexte.__class__).find("PARAMETRE") > 0:
-             chaine = repr(valeur)
-          else :
-             #PN ????
-             #try :
-             #  chaine=QString("").setNum(valeurTexte)
-             #except :
-             chaine=str(valeurTexte)
-       self.oldValeurTexte=chaine
-       self.lineEditVal.setText(chaine)
-
-
-  def finCommentaire(self):
-      mc = self.objSimp.definition
-      d_aides = { 'TXM' : tr(u"Une chaine de caracteres est attendue.  "),
-                  'R'   : tr(u"Un reel est attendu. "),
-                  'I'   : tr(u"Un entier est attendu.  "),
-                  'Matrice' : tr(u'Une Matrice est attendue.  '),
-                  'Fichier' : tr(u'Un fichier est attendu.  '),
-                  'FichierNoAbs' : tr(u'Un fichier est attendu.  '),
-                  'Repertoire' : tr(u'Un repertoire est attendu.  '),
-                  'FichierOuRepertoire' : tr(u'Un repertoire ou un fichier est attendu.  '),
-                  'Heure' : tr(u'Heure sous la forme HH:MM'),
-                  'Date' :  tr(u'Date sous la forme JJ/MM/AA')}
-      if mc.type[0] != type:
-         commentaire = d_aides.get(mc.type[0], tr("Type de base inconnu"))
-      else : commentaire=""
-      return commentaire
-
-
-  def LEvaleurPressed(self):
-      # pour les soucis d encoding
-      try :
-        if str(self.lineEditVal.text())=="" or str(self.lineEditVal.text())==None : return
-      except : pass
-      SaisieValeur.LEvaleurPressed(self)
-      self.parentQt.donneFocus()
-      self.setValeurs()
-      self.reaffiche()
-      
-
+    def monFocusInEvent(self,event):
+        self.editor.nodeEnCours = self
+        QLineEdit.focusInEvent(self.lineEditVal,event)
+
+    def monFocusOutEvent(self,event):
+        if self.oldValeurTexte != self.lineEditVal.text():
+            self.oldValeurTexte= self.lineEditVal.text()
+            self.LEvaleurPressed()
+        QLineEdit.focusOutEvent(self.lineEditVal,event)
+
+
+    def setValeurs(self):
+        #print ("dans setValeurs")
+        self.politique=PolitiqueUnique(self.node,self.editor)
+        valeur=self.node.item.getValeur()
+        valeurTexte=self.politique.getValeurTexte(valeur)
+        chaine=""
+
+        if valeurTexte != None :
+            from decimal import Decimal
+            if isinstance(valeurTexte,Decimal):
+                chaine=str(valeurTexte)
+            elif repr(valeurTexte.__class__).find("PARAMETRE") > 0:
+                chaine = repr(valeur)
+            else :
+                #PN ????
+                #try :
+                #  chaine=QString("").setNum(valeurTexte)
+                #except :
+                chaine=str(valeurTexte)
+        self.oldValeurTexte=chaine
+        self.lineEditVal.setText(chaine)
+
+
+    def finCommentaire(self):
+        mc = self.objSimp.definition
+        d_aides = { 'TXM' : tr(u"Une chaine de caracteres est attendue.  "),
+                    'R'   : tr(u"Un reel est attendu. "),
+                    'I'   : tr(u"Un entier est attendu.  "),
+                    'Matrice' : tr(u'Une Matrice est attendue.  '),
+                    'Fichier' : tr(u'Un fichier est attendu.  '),
+                    'FichierNoAbs' : tr(u'Un fichier est attendu.  '),
+                    'Repertoire' : tr(u'Un repertoire est attendu.  '),
+                    'FichierOuRepertoire' : tr(u'Un repertoire ou un fichier est attendu.  '),
+                    'Heure' : tr(u'Heure sous la forme HH:MM'),
+                    'Date' :  tr(u'Date sous la forme JJ/MM/AA')}
+        if mc.type[0] != type:
+            commentaire = d_aides.get(mc.type[0], tr("Type de base inconnu"))
+        else : commentaire=""
+        return commentaire
+
+
+    def LEvaleurPressed(self):
+        # pour les soucis d encoding
+        try :
+            if str(self.lineEditVal.text())=="" or str(self.lineEditVal.text())==None : return
+        except : pass
+        SaisieValeur.LEvaleurPressed(self)
+        self.parentQt.donneFocus()
+        self.setValeurs()
+        self.reaffiche()
index 8bf811ad3111100cb8dae36047a7e9c3faa43323..7545a315fe839ffcb4d2d56c850d009e4d19e314 100644 (file)
@@ -26,14 +26,14 @@ from PyQt5.QtWidgets import QRadioButton
 from Extensions.i18n import tr
 
 from .feuille               import Feuille
-from desWidgetSimpBool     import Ui_WidgetSimpBool 
+from desWidgetSimpBool     import Ui_WidgetSimpBool
 from .politiquesValidation  import PolitiqueUnique
 from .qtSaisie              import SaisieValeur
 
 
 class MonWidgetSimpBool (Ui_WidgetSimpBool,Feuille):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.politique=PolitiqueUnique(self.node,self.editor)
         self.RBTrue.clicked.connect(self.boutonTrueClic)
@@ -42,20 +42,19 @@ class MonWidgetSimpBool (Ui_WidgetSimpBool,Feuille):
         self.maCommande.listeAffichageWidget.append(self.RBTrue)
         self.AAfficher=self.RBTrue
 
-  def setValeurs(self):
-       valeur=self.node.item.getValeur()
-       if valeur == None  : return
-       if valeur == True  : self.RBTrue.setChecked(True)
-       if valeur == False : self.RBFalse.setChecked(True)
-       if self.monSimpDef.homo == 'constant' :
-          if valeur == True  : self.RBFalse.setDisabled(True)
-          else :               self.RBTrue.setDisabled(True)
-
-  def boutonTrueClic(self):
-      SaisieValeur.LEvaleurPressed(self,True)
-      self.reaffiche()
-
-  def boutonFalseClic(self):
-      SaisieValeur.LEvaleurPressed(self,False)
-      self.reaffiche()
-
+    def setValeurs(self):
+        valeur=self.node.item.getValeur()
+        if valeur == None  : return
+        if valeur == True  : self.RBTrue.setChecked(True)
+        if valeur == False : self.RBFalse.setChecked(True)
+        if self.monSimpDef.homo == 'constant' :
+            if valeur == True  : self.RBFalse.setDisabled(True)
+            else :               self.RBTrue.setDisabled(True)
+
+    def boutonTrueClic(self):
+        SaisieValeur.LEvaleurPressed(self,True)
+        self.reaffiche()
+
+    def boutonFalseClic(self):
+        SaisieValeur.LEvaleurPressed(self,False)
+        self.reaffiche()
index 157cf161041a158571f2396a99f0d47343a87ab8..8ab5d5d34de0b6ca0bb9363e2403c424c00034a9 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os, locale
@@ -33,14 +33,14 @@ from PyQt5.QtCore import Qt
 from Extensions.i18n import tr
 
 from .feuille                import Feuille
-from desWidgetSimpComplexe  import Ui_WidgetSimpComplexe 
+from desWidgetSimpComplexe  import Ui_WidgetSimpComplexe
 from .politiquesValidation   import PolitiqueUnique
 from .qtSaisie               import SaisieValeur
 
 
 class MonWidgetSimpComplexe (Ui_WidgetSimpComplexe,Feuille):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.parentQt.commandesLayout.insertWidget(-1,self)
         self.setFocusPolicy(Qt.StrongFocus)
@@ -48,128 +48,121 @@ class MonWidgetSimpComplexe (Ui_WidgetSimpComplexe,Feuille):
         self.LEReel.returnPressed.connect(self.LEReelRPressed)
         self.RBRI.clicked.connect(self.valeurPressed )
         self.RBMP.clicked.connect(self.valeurPressed )
-        self.LEComp.returnPressed.connect(self.LECompRPressed)
-        self.maCommande.listeAffichageWidget.append(self.LEComp)
-        #self.maCommande.listeAffichageWidget.append(self.RBRI)
-        #self.maCommande.listeAffichageWidget.append(self.RBMP)
-        #self.maCommande.listeAffichageWidget.append(self.LEReel)
-        #self.maCommande.listeAffichageWidget.append(self.LEImag)
-
-
-  def setValeurs(self):
-       self.politique=PolitiqueUnique(self.node,self.editor)
-       valeur=self.node.item.getValeur()
-       if valeur == None or valeur == '' : return
-       if type(valeur) not in (list,tuple) :
-           self.LEComp.setText(str(valeur))
-       else :
-           typ_cplx,x1,x2=valeur
-           self.LEReel.setText(str(x1))
-           self.LEImag.setText(str(x2))
-           if typ_cplx == "RI" :
-              self.RBRI.setChecked(1)
-           else :
-              self.RBMP.setChecked(1)
-
-  def LECompRPressed(self) :
-        self.LEReel.clear()
-        self.LEImag.clear()
-        commentaire=tr("expression valide")
-        valeur = str(self.LEComp.text())
-        d={}
-        try :
-          v=eval(valeur,d)
-        except :
-          commentaire=tr("expression invalide")
-          self.editor.afficheInfos(commentaire,Qt.red)
-          return
-        try :
-          i=v.imag
-          self.editor.afficheInfos(commentaire)
-          self.valeurPressed()
-        except :
-          commentaire=tr("l expression n est pas de la forme a+bj")
-          self.editor.afficheInfos(commentaire,Qt.red)
-
-  def LEReelRPressed(self):
-        self.LEComp.clear()
+        self.maCommande.listeAffichageWidget.append(self.RBRI)
+        self.maCommande.listeAffichageWidget.append(self.RBMP)
+        self.maCommande.listeAffichageWidget.append(self.LEReel)
+        self.maCommande.listeAffichageWidget.append(self.LEImag)
+
+
+    def setValeurs(self):
+        self.politique=PolitiqueUnique(self.node,self.editor)
+        valeur=self.node.item.getValeur()
+        if valeur == None or valeur == '' : return
+        if type(valeur) not in (list,tuple) :
+            self.LEComp.setText(str(valeur))
+            commentaire=tr('complexe form deprecated, od value : ', valeur)
+            self.editor.afficheInfos(commentaire,Qt.red)
+        else :
+            typ_cplx,x1,x2=valeur
+            self.LEReel.setText(str(x1))
+            self.LEImag.setText(str(x2))
+            if typ_cplx == "RI" :
+                self.RBRI.setChecked(1)
+            else :
+                self.RBMP.setChecked(1)
+
+    #def LECompRPressed(self) :
+    #    self.LEReel.clear()
+    #    self.LEImag.clear()
+    #    commentaire=tr("expression valide")
+    #    valeur = str(self.LEComp.text())
+    #    d={}
+    #    if 1 :
+    #    try :
+    #        v=eval(valeur,d)
+    #    except :
+    #        commentaire=tr("expression invalide")
+    #        self.editor.afficheInfos(commentaire,Qt.red)
+    #        return
+    #    try :
+    #        i=v.imag
+    #        self.editor.afficheInfos(commentaire)
+    #        self.valeurPressed()
+    #    except :
+    #        commentaire=tr("l expression n est pas de la forme a+bj")
+    #        self.editor.afficheInfos(commentaire,Qt.red)
+
+    def LEReelRPressed(self):
+        #self.LEComp.clear()
         commentaire=tr("expression valide")
         valeur = str(self.LEReel.text())
         try :
-          a=locale.atof(valeur)
-          self.editor.afficheInfos(commentaire)
+            a=locale.atof(valeur)
+            self.editor.afficheInfos(commentaire)
         except :
-          commentaire=tr("expression invalide")
-          self.editor.afficheInfos(commentaire,Qt.red)
+            commentaire=tr("expression invalide")
+            self.editor.afficheInfos(commentaire,Qt.red)
         if self.LEImag.text()!="" : self.valeurPressed()
+        else : self.LEImag.setFocus(True)
 
-  def LEImagRPressed(self):
-        self.LEComp.clear()
+    def LEImagRPressed(self):
         commentaire=tr("expression valide")
         valeur = str(self.LEImag.text())
         try :
-          a=locale.atof(valeur)
-          self.editor.afficheInfos(commentaire)
+            a=locale.atof(valeur)
+            self.editor.afficheInfos(commentaire)
         except :
-          commentaire=tr("expression invalide")
-          self.editor.afficheInfos(commentaire,Qt.red)
+            commentaire=tr("expression invalide")
+            self.editor.afficheInfos(commentaire,Qt.red)
         if self.LEReel.text()!="" : self.valeurPressed()
-
-  def finCommentaire(self):
-      commentaire="valeur de type complexe"
-      return commentaire
-
-  def getValeurComp(self):
-        commentaire=tr("expression valide")
-        valeur = str(self.LEComp.text())
-        d={}
-        try :
-          v=eval(valeur,d)
-        except :
-          commentaire=tr("expression invalide")
-          self.editor.afficheInfos(commentaire,Qt.red)
-          return None
+        else : self.LEReel.setFocus(True)
+
+    def finCommentaire(self):
+        commentaire="valeur de type complexe"
+        return commentaire
+
+    #def getValeurComp(self):
+    #    commentaire=tr("expression valide")
+    #    valeur = str(self.LEComp.text())
+    #    d={}
+    #    try :
+    #        v=eval(valeur,d)
+    #    except :
+    #        commentaire=tr("expression invalide")
+    #        self.editor.afficheInfos(commentaire,Qt.red)
+    #        return None
+    #     try :
+    #        i=v.imag
+    #    except :
+    #        commentaire=tr("expression n est pas de la forme a+bj")
+    #        self.editor.afficheInfos(commentaire,Qt.red)
+    #        return None
+    #    return v
+
+
+    def valeurPressed(self):
+        if (self.LEReel.text()=="" and self.LEImag.text()=="") : self.LEReel.setFocus(True)
+        if (self.LEReel.text()=="" and self.LEImag.text()!="") : self.LEReel.setFocus(True)
+        if (self.LEReel.text()!="" and self.LEImag.text()=="") : self.LEImag.setFocus(True)
+        valeur = self.getValeurRI()
+        self.politique.recordValeur(valeur)
+        self.reaffiche()
+        self.parentQt.donneFocus()
+
+    def getValeurRI(self):
+        """
+        Retourne le complexe saisi par l'utilisateur
+        """
+        l=[]
+        if (self.RBMP.isChecked() == 1 ) : l.append("MP")
+        elif (self.RBRI.isChecked() == 1) : l.append("RI")
+        else :
+            self.editor.afficheInfos(commentaire,Qt.red)
+            self.RBMP.setFocus(True)
+            return None
         try :
-          i=v.imag
+            l.append(locale.atof(str(self.LEReel.text())))
+            l.append(locale.atof(str(self.LEImag.text())))
         except :
-          commentaire=tr("expression n est pas de la forme a+bj")
-          self.editor.afficheInfos(commentaire,Qt.red)
-          return None
-        return v
-
-
-  def valeurPressed(self):
-      if self.LEComp.text()== ""  and (self.LEReel.text()=="" or self.LEImag.text()=="") :
-         return
-      if self.LEComp.text()== "" : valeur = self.getValeurRI()
-      else :
-          if self.LEReel.text() != "" or self.LEImag.text() != "" :
-              commentaire=tr("entrer une seule valeur SVP")
-              self.editor.afficheInfos(commentaire,Qt.red)
-              return
-          valeur=  self.getValeurComp()
-      self.politique.recordValeur(valeur)
-      self.reaffiche()
-      self.parentQt.donneFocus()
-
-  def getValeurRI(self):
-      """
-      Retourne le complexe saisi par l'utilisateur
-      """
-      l=[]
-      if  (self.RBMP.isChecked() == 1 ) :
-         l.append("MP")
-      elif (self.RBRI.isChecked() == 1) :
-         l.append("RI")
-      else :
-         commentaire=tr("saisir le type de complexe")
-         self.editor.afficheInfos(commentaire,Qt.red)
-         return None
-      try :
-         l.append(locale.atof(str(self.LEReel.text())))
-         l.append(locale.atof(str(self.LEImag.text())))
-      except :
-         return None
-      return repr(tuple(l))
-
-      
+            return None
+        return repr(tuple(l))
index 943e1221aada1f801fa0cf6ff7965ecaa14c341e..0b81e44bbac3c0acb361324b307ef7236dbb3607 100644 (file)
@@ -26,19 +26,18 @@ from PyQt5.QtGui  import QIcon
 from PyQt5.QtCore import QSize
 from Extensions.i18n import tr
 
-from desWidgetSimpFichier  import Ui_WidgetSimpFichier 
+from desWidgetSimpFichier  import Ui_WidgetSimpFichier
 from .monWidgetSimpBase     import MonWidgetSimpBase
 
 
 class MonWidgetSimpFichier (Ui_WidgetSimpFichier,MonWidgetSimpBase):
 # c est juste la taille des differents widgets de base qui change
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         MonWidgetSimpBase.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         if sys.platform[0:5]!="linux" :
-          repIcon=self.node.editor.appliEficas.repIcon
-          fichier=os.path.join(repIcon, 'file-explorer.png')
-          icon = QIcon(fichier)
-          self.BFichier.setIcon(icon)
-          self.BFichier.setIconSize(QSize(32, 32))
-
+            repIcon=self.node.editor.appliEficas.repIcon
+            fichier=os.path.join(repIcon, 'file-explorer.png')
+            icon = QIcon(fichier)
+            self.BFichier.setIcon(icon)
+            self.BFichier.setIconSize(QSize(32, 32))
index cca59c0ecd696ce8908f3ee29cff6b3714462908..41e0632f8531fe3a69954709fa36244f2acb27a0 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import types,os
@@ -33,14 +33,14 @@ from PyQt5.QtCore import Qt
 from Extensions.i18n import tr
 
 from .feuille               import Feuille
-from desWidgetSimpSalome   import Ui_WidgetSimpSalome 
+from desWidgetSimpSalome   import Ui_WidgetSimpSalome
 from .politiquesValidation  import PolitiqueUnique
 from .qtSaisie              import SaisieValeur
 
 
 class MonWidgetSimpSalome (Ui_WidgetSimpSalome,Feuille):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.parentQt.commandesLayout.insertWidget(-1,self,1)
         self.setFocusPolicy(Qt.StrongFocus)
@@ -50,14 +50,14 @@ class MonWidgetSimpSalome (Ui_WidgetSimpSalome,Feuille):
         self.maCommande.listeAffichageWidget.append(self.lineEditVal)
 
 
-  def LEvaleurPressed(self):
-      if str(self.lineEditVal.text())=="" or str(self.lineEditVal.text())==None : return
-      SaisieValeur.LEvaleurPressed(self)
-      self.parentQt.donneFocus()
-      self.setValeurs()
-      self.reaffiche()
+    def LEvaleurPressed(self):
+        if str(self.lineEditVal.text())=="" or str(self.lineEditVal.text())==None : return
+        SaisieValeur.LEvaleurPressed(self)
+        self.parentQt.donneFocus()
+        self.setValeurs()
+        self.reaffiche()
 
 
-  def setValeurs(self):
-      valeur=self.node.item.getValeur()
-      if valeur != None : self.lineEditVal.setText(str(valeur))
+    def setValeurs(self):
+        valeur=self.node.item.getValeur()
+        if valeur != None : self.lineEditVal.setText(str(valeur))
index 7f43db8c9b63e17bd52e7db3aaa8ddfd3a00e8ea..c5e99ec0f266a25919d1f0006155e8ba5d5d9d58 100644 (file)
@@ -20,8 +20,8 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 
 import types,os
@@ -38,63 +38,61 @@ from InterfaceQT4.qtSaisie              import SaisieValeur
 
 class MonWidgetSimpTuple(Feuille):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.politique=PolitiqueUnique(self.node,self.editor)
         self.parentQt.commandesLayout.insertWidget(-1,self)
         self.setFocusPolicy(Qt.StrongFocus)
 
-  def setValeurs(self):
-       valeur=self.node.item.getValeur()
-       for i in range(self.nbValeurs) :
-           nomLineEdit="lineEditVal"+str(i+1)
-           courant=getattr(self,nomLineEdit)
-           if valeur !=None: courant.setText(str(valeur[i]))
-           setattr(self,nomLineEdit,courant)
-           courant.returnPressed.connect(self.valeursPressed)
+    def setValeurs(self):
+        valeur=self.node.item.getValeur()
+        for i in range(self.nbValeurs) :
+            nomLineEdit="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLineEdit)
+            if valeur !=None: courant.setText(str(valeur[i]))
+            setattr(self,nomLineEdit,courant)
+            courant.returnPressed.connect(self.valeursPressed)
 
-  def valeursPressed(self):
-      aLeFocus=self.focusWidget()
-      self.editor.afficheInfos("")
-      texteValeur=""
-      for i in range(self.nbValeurs) :
-          nomLineEdit="lineEditVal"+str(i+1)
-          courant=getattr(self,nomLineEdit)
-          if courant.text()=="" or courant.text()==None :
-             courant.setFocus(True)
-             return 
-          s=str(courant.text())
-          if hasattr(self.objSimp.definition.validators, 'typeDesTuples'):
-           if self.objSimp.definition.validators.typeDesTuples[i] == "R" :
-             if (s.find('.')== -1 and s.find('e')== -1 and s.find('E')==-1) : 
-                 s=s+'.0'
-                 courant.setText(s)
-           if self.objSimp.definition.validators.typeDesTuples[i] == "TXM" :
-             if s[0]!='"' and s[0] != "'": 
-                if s[-1]=="'": s="'"+s
-                else :         s='"'+s
-             if s[-1]!='"' and s[-1] != "'": 
-                if s[0]=="'": s=s+"'"
-                else :        s=s+'"'
-             courant.setText(s)
-          texteValeur+=str(courant.text())
-          #print (texteValeur)
-          if i+1 != self.nbValeurs : texteValeur+=','
-      validite,commentaire=self.politique.recordValeur(texteValeur)
-      if not validite:self.editor.afficheInfos(commentaire+" "+str(self.objSimp.definition.validators.typeDesTuples),Qt.red)
+    def valeursPressed(self):
+        aLeFocus=self.focusWidget()
+        self.editor.afficheInfos("")
+        texteValeur=""
+        for i in range(self.nbValeurs) :
+            nomLineEdit="lineEditVal"+str(i+1)
+            courant=getattr(self,nomLineEdit)
+            if courant.text()=="" or courant.text()==None :
+                courant.setFocus(True)
+                return
+            s=str(courant.text())
+            if hasattr(self.objSimp.definition.validators, 'typeDesTuples'):
+                if self.objSimp.definition.validators.typeDesTuples[i] == "R" :
+                    if (s.find('.')== -1 and s.find('e')== -1 and s.find('E')==-1) :
+                        s=s+'.0'
+                        courant.setText(s)
+                if self.objSimp.definition.validators.typeDesTuples[i] == "TXM" :
+                    if s[0]!='"' and s[0] != "'":
+                        if s[-1]=="'": s="'"+s
+                        else :         s='"'+s
+                    if s[-1]!='"' and s[-1] != "'":
+                        if s[0]=="'": s=s+"'"
+                        else :        s=s+'"'
+                    courant.setText(s)
+            texteValeur+=str(courant.text())
+            #print (texteValeur)
+            if i+1 != self.nbValeurs : texteValeur+=','
+        validite,commentaire=self.politique.recordValeur(texteValeur)
+        if not validite:self.editor.afficheInfos(commentaire+" "+str(self.objSimp.definition.validators.typeDesTuples),Qt.red)
 
-      # Passage au champ suivant
-      nom=aLeFocus.objectName()[11:]
-      try :
-        i=int(nom)+1
-      except :
+        # Passage au champ suivant
+        nom=aLeFocus.objectName()[11:]
         try :
-          i=i+1
+            i=int(nom)+1
         except :
-          return
-      if i == self.nbValeurs +1 : i=1
-      nomLineEdit="lineEditVal"+str(i)
-      courant=getattr(self,nomLineEdit)
-      courant.setFocus(True)
-          
-         
+            try :
+                i=i+1
+            except :
+                return
+        if i == self.nbValeurs +1 : i=1
+        nomLineEdit="lineEditVal"+str(i)
+        courant=getattr(self,nomLineEdit)
+        courant.setFocus(True)
diff --git a/InterfaceQT4/monWidgetSimpTuple2.py b/InterfaceQT4/monWidgetSimpTuple2.py
deleted file mode 100644 (file)
index e9cae25..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2021   EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# Modules Python
-from __future__ import absolute_import
-import types,os
-
-# Modules Eficas
-#from PyQt4.QtGui import *
-#from PyQt4.QtCore import *
-from Extensions.i18n import tr
-
-from .feuille               import Feuille
-from .monWidgetSimpTuple    import MonWidgetSimpTuple 
-from desWidgetTuple2       import Ui_WidgetTuple2 
-
-
-class MonWidgetSimpTuple2 (Ui_WidgetTuple2,MonWidgetSimpTuple):
-
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-        self.nbValeurs=2
-        MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-        #self.maCommande.listeAffichageWidget.append(self.lineEditVal2)
-        if self.objSimp.isImmuable() :
-          self.lineEditVal1.setDisabled(True)
-          self.lineEditVal2.setDisabled(True)
-          self.lineEditVal1.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
-          self.lineEditVal2.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
-          self.lineEditVal1.setToolTip(tr("Valeur non modifiable"))
-          self.lineEditVal2.setToolTip(tr("Valeur non modifiable"))
-        else :
-          self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
-      
diff --git a/InterfaceQT4/monWidgetSimpTuple3.py b/InterfaceQT4/monWidgetSimpTuple3.py
deleted file mode 100644 (file)
index e7fcf97..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2021   EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# Modules Python
-from __future__ import absolute_import
-import types,os
-
-# Modules Eficas
-#from PyQt4.QtGui import *
-#from PyQt4.QtCore import *
-from Extensions.i18n import tr
-
-from .feuille               import Feuille
-from .monWidgetSimpTuple    import MonWidgetSimpTuple 
-from desWidgetTuple3       import Ui_WidgetTuple3 
-
-
-class MonWidgetSimpTuple3 (Ui_WidgetTuple3,MonWidgetSimpTuple):
-
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-        self.nbValeurs=3
-        MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-        if self.objSimp.isImmuable() :
-           self.lineEditVal1.setDisabled(True)
-           self.lineEditVal2.setDisabled(True)
-           self.lineEditVal3.setDisabled(True)
-           self.lineEditVal1.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
-           self.lineEditVal2.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
-           self.lineEditVal3.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
-           self.lineEditVal1.setToolTip(tr("Valeur non modifiable"))
-           self.lineEditVal2.setToolTip(tr("Valeur non modifiable"))
-           self.lineEditVal3.setToolTip(tr("Valeur non modifiable"))
-        else :
-           self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
-        #self.maCommande.listeAffichageWidget.append(self.lineEditVal2)
-        #self.maCommande.listeAffichageWidget.append(self.lineEditVal3)
-
index 5734105788ad8617a1c9b16c95ab5570e03df3c1..cda89eff460a21036b4aae42804a22e94641139a 100644 (file)
@@ -27,77 +27,81 @@ import types,os
 from Extensions.i18n import tr
 
 from InterfaceQT4.feuille               import Feuille
-from InterfaceQT4.monWidgetSimpTuple    import MonWidgetSimpTuple 
-from desWidgetTuple2  import Ui_WidgetTuple2 
-from desWidgetTuple3  import Ui_WidgetTuple3 
-from desWidgetTuple4  import Ui_WidgetTuple4 
-from desWidgetTuple5  import Ui_WidgetTuple5 
-from desWidgetTuple6  import Ui_WidgetTuple6 
-from desWidgetTuple7  import Ui_WidgetTuple7 
-from desWidgetTuple8  import Ui_WidgetTuple8 
-from desWidgetTuple9  import Ui_WidgetTuple9 
+from InterfaceQT4.monWidgetSimpTuple    import MonWidgetSimpTuple
+from desWidgetTuple2  import Ui_WidgetTuple2
+from desWidgetTuple3  import Ui_WidgetTuple3
+from desWidgetTuple4  import Ui_WidgetTuple4
+from desWidgetTuple5  import Ui_WidgetTuple5
+from desWidgetTuple6  import Ui_WidgetTuple6
+from desWidgetTuple7  import Ui_WidgetTuple7
+from desWidgetTuple8  import Ui_WidgetTuple8
+from desWidgetTuple9  import Ui_WidgetTuple9
 from desWidgetTuple10 import Ui_WidgetTuple10
 
 
 class MonWidgetSimpTuple2 (Ui_WidgetTuple2,MonWidgetSimpTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=2
         MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         if self.objSimp.isImmuable() :
-          self.lineEditVal1.setDisabled(True)
-          self.lineEditVal2.setDisabled(True)
-          self.lineEditVal1.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
-          self.lineEditVal2.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
-          self.lineEditVal1.setToolTip(tr("Valeur non modifiable"))
-          self.lineEditVal2.setToolTip(tr("Valeur non modifiable"))
+            self.lineEditVal1.setDisabled(True)
+            self.lineEditVal2.setDisabled(True)
+            self.lineEditVal1.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
+            self.lineEditVal2.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
+            self.lineEditVal1.setToolTip(tr("Valeur non modifiable"))
+            self.lineEditVal2.setToolTip(tr("Valeur non modifiable"))
         else :
-          self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
-      
+            self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
+
 class MonWidgetSimpTuple3 (Ui_WidgetTuple3,MonWidgetSimpTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=3
         MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         if self.objSimp.isImmuable() :
-          self.lineEditVal1.setDisabled(True)
-          self.lineEditVal2.setDisabled(True)
-          self.lineEditVal1.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
-          self.lineEditVal2.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
-          self.lineEditVal1.setToolTip(tr("Valeur non modifiable"))
-          self.lineEditVal2.setToolTip(tr("Valeur non modifiable"))
+            self.lineEditVal1.setDisabled(True)
+            self.lineEditVal2.setDisabled(True)
+            self.lineEditVal3.setDisabled(True)
+            self.lineEditVal1.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
+            self.lineEditVal2.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
+            self.lineEditVal3.setStyleSheet("background:rgb(244,244,244);\n" "border:0px;\n")
+            self.lineEditVal1.setToolTip(tr("Valeur non modifiable"))
+            self.lineEditVal2.setToolTip(tr("Valeur non modifiable"))
+            self.lineEditVal3.setToolTip(tr("Valeur non modifiable"))
         else :
-          self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
-      
+            self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
+
 class MonWidgetSimpTuple4 (Ui_WidgetTuple4,MonWidgetSimpTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+        #print (self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.nbValeurs=4
         MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetSimpTuple5 (Ui_WidgetTuple5,MonWidgetSimpTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=5
         MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetSimpTuple6 (Ui_WidgetTuple6,MonWidgetSimpTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=6
         MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetSimpTuple7 (Ui_WidgetTuple7,MonWidgetSimpTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=7
         MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetSimpTuple8 (Ui_WidgetTuple8,MonWidgetSimpTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=8
         MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetSimpTuple9 (Ui_WidgetTuple9,MonWidgetSimpTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=9
         MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-      
+
 class MonWidgetSimpTuple10 (Ui_WidgetTuple10,MonWidgetSimpTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=10
         MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
index d377322fae95f18992d9b9fdb4d1ac242b926796..b3f45bec29876efc3dbca486d5c426f4b6fce51b 100644 (file)
@@ -24,14 +24,12 @@ import types,os
 # Modules Eficas
 from Extensions.i18n import tr
 
-from desWidgetSimpTxt  import Ui_WidgetSimpTxt 
+from desWidgetSimpTxt  import Ui_WidgetSimpTxt
 from .monWidgetSimpBase     import MonWidgetSimpBase
 
 
 class MonWidgetSimpTxt (Ui_WidgetSimpTxt,MonWidgetSimpBase):
 # c est juste la taille des differents widgets de base qui change
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         MonWidgetSimpBase.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
-
-
index 317bf64f4ac3d83e7eca666e7b00b64b4c8582e4..aaeca35be4b56bfc1684539031cfa2718a653050 100644 (file)
@@ -27,7 +27,7 @@ from PyQt5.QtWidgets import QLabel, QSizePolicy, QSpacerItem
 from PyQt5.QtCore    import QSize
 
 from InterfaceQT4.feuille                  import Feuille
-from InterfaceQT4.monWidgetPlusieursTuple  import MonWidgetPlusieursTuple 
+from InterfaceQT4.monWidgetPlusieursTuple  import MonWidgetPlusieursTuple
 from desWidgetPlusieursTuple               import Ui_WidgetPlusieursTuple
 from desWidgetTableau                      import Ui_WidgetTableau
 
@@ -35,7 +35,7 @@ maxLen=3
 
 
 class MonWidgetTableau (Ui_WidgetTableau,MonWidgetPlusieursTuple):
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         self.nbValeurs=len(monSimpDef.homo)
         MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
 
@@ -43,7 +43,7 @@ class MonWidgetTableau (Ui_WidgetTableau,MonWidgetPlusieursTuple):
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
 
+
         for i in range(len(monSimpDef.homo)):
             nomCol='LECol'+str(i+1)
             objCol=QLabel(self)
@@ -58,16 +58,15 @@ class MonWidgetTableau (Ui_WidgetTableau,MonWidgetPlusieursTuple):
 
 #            monObjTitreCol=getattr(self,nomCol)
 #            monObjTitreCol.setText(monSimpDef.homo[i])
-            
+
 #        for i in range(maxLen-len(monSimpDef.homo)):
 #            index=i+len(monSimpDef.homo)+1
 #            nomCol='LECol'+str(index)
 #            monObjTitreCol=getattr(self,nomCol)
 #            monObjTitreCol.close()
-            
-        self.resize(self.width(),1800)
 
-  def ajoutLineEdit(self,valeur=None,inInit=False):
-      hauteurAvant=(self.frame.height())
-      MonWidgetPlusieursTuple.ajoutLineEdit(self,valeur,inInit)
+        self.resize(self.width(),1800)
 
+    def ajoutLineEdit(self,valeur=None,inInit=False):
+        hauteurAvant=(self.frame.height())
+        MonWidgetPlusieursTuple.ajoutLineEdit(self,valeur,inInit)
index 95d6f75ed5c0c25330c2c967e427c894f3f9b04d..4cc423dcf1093e29edb9a5cf3da4d9f24cfc200c 100644 (file)
@@ -27,7 +27,7 @@ from PyQt4.QtCore import *
 from Extensions.i18n import tr
 
 from .feuille               import Feuille
-from desWidgetUniqueSDCO   import Ui_WidgetUniqueSDCO 
+from desWidgetUniqueSDCO   import Ui_WidgetUniqueSDCO
 from .politiquesValidation  import PolitiqueUnique
 from .qtSaisie              import SaisieSDCO
 
@@ -36,7 +36,7 @@ from .qtSaisie              import SaisieSDCO
 
 class MonWidgetUniqueSDCO (Ui_WidgetUniqueSDCO,Feuille,SaisieSDCO):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
         #print "dans MonWidgetSDCO"
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.politique=PolitiqueUnique(self.node,self.editor)
@@ -47,4 +47,3 @@ class MonWidgetUniqueSDCO (Ui_WidgetUniqueSDCO,Feuille,SaisieSDCO):
         valeur = self.node.item.getValeur()
         if valeur  != "" and valeur != None : self.LESDCO.setText(valeur.nom)
         self.connect(self.LESDCO,SIGNAL("returnPressed()"),self.LESDCOReturnPressed)
-
index 0225473d7dbaf47cdbdcc5b898d028b5fa581b89..a924bd19384a98a633fb75e2ba6057577f3ea2df 100644 (file)
@@ -25,13 +25,13 @@ import types,os
 from Extensions.i18n import tr
 
 from .feuille                           import Feuille
-from desWidgetVide                      import Ui_WidgetVide 
+from desWidgetVide                      import Ui_WidgetVide
 from InterfaceQT4.politiquesValidation  import PolitiqueUnique
 
 class MonWidgetVide (Ui_WidgetVide,Feuille):
 
-  def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
-        
+    def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+
         Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
         self.politique=PolitiqueUnique(self.node,self.editor)
         t=self.node.item.object.definition.type[0].__name__
index 786285319b7682ae145a805b65a4ab1f9acd4fbe..bf20a1dde55a875270b7ce2d201a25d07c9340bd 100644 (file)
@@ -20,7 +20,7 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import range
+    from builtins import range
 except : pass
 
 import types
@@ -31,266 +31,264 @@ from Extensions.i18n import tr
 #------------------
 class Validation(object)  :
 #------------------
-  def __init__(self,node,parent) :
-         self.node=node
-         self.parent=parent
-   
+    def __init__(self,node,parent) :
+        self.node=node
+        self.parent=parent
 
-  def testeUneValeur(self,valeurentree):
-         commentaire = None
-         #import traceback
-         #traceback.print_stack()
-         valeur,validite=self.node.item.evalValeur(valeurentree)
-         if not validite :
-                  commentaire = "impossible d'evaluer : %s " %repr(valeurentree)
-                  return valeur,validite,commentaire
-         if self.node.item.waitTxm() and not( type(valeur) == str) : valeur=str(valeur) 
 
-         testtype,commentaire = self.node.item.object.verifType(valeur)
-         if not testtype :
-                  return valeur,0,commentaire
+    def testeUneValeur(self,valeurentree):
+        commentaire = None
+        #import traceback
+        #traceback.print_stack()
+        valeur,validite=self.node.item.evalValeur(valeurentree)
+        if not validite :
+            commentaire = "impossible d'evaluer : %s " %repr(valeurentree)
+            return valeur,validite,commentaire
+        if self.node.item.waitTxm() and not( type(valeur) == str) : valeur=str(valeur)
 
-         valide=self.node.item.valideItem(valeur)
-         if type(valide) == tuple:
-                 validite,commentaire=valide
-         else :
-                 validite=valide
-                 commentaire=" "
+        testtype,commentaire = self.node.item.object.verifType(valeur)
+        if not testtype :
+            return valeur,0,commentaire
 
-         if not validite and commentaire is None:
-                  commentaire = "impossible d'evaluer : %s " %repr(valeurentree)
-         #print ('ds testeUneValeur', valeur, validite, commentaire)
-         return valeur, validite, commentaire
+        valide=self.node.item.valideItem(valeur)
+        if type(valide) == tuple:
+            validite,commentaire=valide
+        else :
+            validite=valide
+            commentaire=" "
+
+        if not validite and commentaire is None:
+            commentaire = "impossible d'evaluer : %s " %repr(valeurentree)
+        #print ('ds testeUneValeur', valeur, validite, commentaire)
+        return valeur, validite, commentaire
 
 # ----------------------------------------------------------------------------------------
 #   Methodes utilisees pour la manipulation des items en notation scientifique
 #   a mettre au point
 # ----------------------------------------------------------------------------------------
-  def setValeurTexte(self,texteValeur) :
-         try :
-                  if "R" in self.node.item.object.definition.type:
-                     if texteValeur[0] != "'":
-                        clef=eval(texteValeur)
-                        if str(clef) != str(texteValeur) :
-                           self.node.item.object.initModif()
-                           clefobj=self.node.item.object.getNomConcept()
-                           if not clefobj in self.parent.appliEficas.dict_reels:
-                              self.parent.appliEficas.dict_reels[clefobj] = {}
-                           self.parent.appliEficas.dict_reels[clefobj][clef]=texteValeur
-                           self.parent.appliEficas.dict_reels[clefobj]
-                           if clefobj=="" : 
-                              if not self.node.item.object.etape in self.parent.appliEficas.dict_reels :
-                                 self.parent.appliEficas.dict_reels[self.node.item.object.etape] = {}
-                              self.parent.appliEficas.dict_reels[self.node.item.object.etape][clef]=texteValeur
-                           self.node.item.object.finModif()
-         except:
+    def setValeurTexte(self,texteValeur) :
+        try :
+            if "R" in self.node.item.object.definition.type:
+                if texteValeur[0] != "'":
+                    clef=eval(texteValeur)
+                    if str(clef) != str(texteValeur) :
+                        self.node.item.object.initModif()
+                        clefobj=self.node.item.object.getNomConcept()
+                        if not clefobj in self.parent.appliEficas.dict_reels:
+                            self.parent.appliEficas.dict_reels[clefobj] = {}
+                        self.parent.appliEficas.dict_reels[clefobj][clef]=texteValeur
+                        self.parent.appliEficas.dict_reels[clefobj]
+                        if clefobj=="" :
+                            if not self.node.item.object.etape in self.parent.appliEficas.dict_reels :
+                                self.parent.appliEficas.dict_reels[self.node.item.object.etape] = {}
+                            self.parent.appliEficas.dict_reels[self.node.item.object.etape][clef]=texteValeur
+                        self.node.item.object.finModif()
+        except:
             pass
 
-  def getValeurTexte(self,valeur) :
-         valeurTexte=valeur
-         if valeur == None : return valeur
-         from decimal import Decimal
-         if  isinstance(valeur,Decimal) :
-             if self.node.waitTxm() and not self.isParam(valeur) : return "'"+str(valeur)+"'"
-             else : return(valeur)
-         if "R" in self.node.item.object.definition.type:
-                  clefobj=self.node.item.object.getNomConcept()
-                  if clefobj in self.parent.appliEficas.dict_reels:
-                     if valeur in self.parent.appliEficas.dict_reels[clefobj] :
-                        valeurTexte=self.parent.appliEficas.dict_reels[clefobj][valeur]
-                  else :
-                     if str(valeur).find('.') == -1 and str(valeur).find('e') == -1 and str(valeur).find('E'):
-                     # aucun '.' n'a ete trouve dans valeur --> on en rajoute un a la fin
-                        if (self.isParam(valeur)):
-                           return valeur
-                        else:
-                          try :
+    def getValeurTexte(self,valeur) :
+        valeurTexte=valeur
+        if valeur == None : return valeur
+        from decimal import Decimal
+        if  isinstance(valeur,Decimal) :
+            if self.node.waitTxm() and not self.isParam(valeur) : return "'"+str(valeur)+"'"
+            else : return(valeur)
+        if "R" in self.node.item.object.definition.type:
+            clefobj=self.node.item.object.getNomConcept()
+            if clefobj in self.parent.appliEficas.dict_reels:
+                if valeur in self.parent.appliEficas.dict_reels[clefobj] :
+                    valeurTexte=self.parent.appliEficas.dict_reels[clefobj][valeur]
+            else :
+                if str(valeur).find('.') == -1 and str(valeur).find('e') == -1 and str(valeur).find('E'):
+                # aucun '.' n'a ete trouve dans valeur --> on en rajoute un a la fin
+                    if (self.isParam(valeur)):
+                        return valeur
+                    else:
+                        try :
                             val2=eval(str(valeur)+'.')
-                          except :
+                        except :
                             pass
-         return valeurTexte
+        return valeurTexte
 
-  def isParam(self,valeur) :
-      for param in self.node.item.jdc.params:
-          if ((repr(param) == repr(valeur)) or (str(param)==str(valeur))):
-             return 1
-      return 0
+    def isParam(self,valeur) :
+        for param in self.node.item.jdc.params:
+            if ((repr(param) == repr(valeur)) or (str(param)==str(valeur))):
+                return 1
+        return 0
 
-  def ajoutDsDictReel(self,texteValeur):
-         # le try except est necessaire pour saisir les parametres
-         # on enleve l erreur de saisie 00 pour 0
-         if str(texteValeur)== '00' : return
-         try :
+    def ajoutDsDictReel(self,texteValeur):
+        # le try except est necessaire pour saisir les parametres
+        # on enleve l erreur de saisie 00 pour 0
+        if str(texteValeur)== '00' : return
+        try :
             if "R" in self.node.item.object.definition.type:
                 if str(texteValeur)[0] != "'":
-                   clef=eval(texteValeur)
-                   if str(clef) != str(texteValeur) :
-                      clefobj=self.node.item.object.getNomConcept()
-                      if not clefobj in self.parent.appliEficas :
-                          self.parent.appliEficas.dict_reels[clefobj] = {}
-                      self.parent.appliEficas.dict_reels[clefobj][clef]=texteValeur
-                      if clefobj=="" : 
-                         if not self.node.item.object.etape in self.parent.appliEficas.dict_reels :
-                            self.parent.appliEficas.dict_reels[self.node.item.object.etape] = {}
-                         self.parent.appliEficas.dict_reels[self.node.item.object.etape][clef]=texteValeur
-                          
-         except:
-          pass
+                    clef=eval(texteValeur)
+                    if str(clef) != str(texteValeur) :
+                        clefobj=self.node.item.object.getNomConcept()
+                        if not clefobj in self.parent.appliEficas :
+                            self.parent.appliEficas.dict_reels[clefobj] = {}
+                        self.parent.appliEficas.dict_reels[clefobj][clef]=texteValeur
+                        if clefobj=="" :
+                            if not self.node.item.object.etape in self.parent.appliEficas.dict_reels :
+                                self.parent.appliEficas.dict_reels[self.node.item.object.etape] = {}
+                            self.parent.appliEficas.dict_reels[self.node.item.object.etape][clef]=texteValeur
 
-  def ajoutDsDictReelEtape(self):
-      try:
-         if self.node.item.object in self.parent.appliEficas.dict_reels:
-            self.parent.appliEficas.dict_reels[self.node.item.sdnom]=self.parent.appliEficas.dict_reels[self.node.item.object]
-            del self.parent.appliEficas.dict_reels[self.node.item.object]
-      except :
-         pass
+        except:
+            pass
+
+    def ajoutDsDictReelEtape(self):
+        try:
+            if self.node.item.object in self.parent.appliEficas.dict_reels:
+                self.parent.appliEficas.dict_reels[self.node.item.sdnom]=self.parent.appliEficas.dict_reels[self.node.item.object]
+                del self.parent.appliEficas.dict_reels[self.node.item.object]
+        except :
+            pass
 
 
 #------------------------------------
 class PolitiqueUnique(Validation) :
 #------------------------------------
-  """
-  classe servant pour les entrees ne demandant qu un mot clef
-  """
-  def __init__(self,node,parent):
+    """
+    classe servant pour les entrees ne demandant qu un mot clef
+    """
+    def __init__(self,node,parent):
         Validation.__init__(self,node,parent)
 
-  def recordValeur(self,valeurentree):
-         if self.parent.modified == 'n' : self.parent.initModif()
-         ancienneVal = self.node.item.getValeur()
-         valeur,validite,commentaire =self.testeUneValeur(valeurentree)
-         if validite and ('R' in self.node.item.object.definition.type) and not(isinstance(valeur,PARAMETRE)) :
+    def recordValeur(self,valeurentree):
+        if self.parent.modified == 'n' : self.parent.initModif()
+        ancienneVal = self.node.item.getValeur()
+        valeur,validite,commentaire =self.testeUneValeur(valeurentree)
+        if validite and ('R' in self.node.item.object.definition.type) and not(isinstance(valeur,PARAMETRE)) :
             s=valeurentree
             if (s.find('.')== -1 and s.find('e')== -1 and s.find('E')==-1) : s=s+'.'
             valeur,validite,commentaire =self.testeUneValeur(s)
-         if validite :
+        if validite :
             validite=self.node.item.setValeur(valeur)
             if self.node.item.isValid():
-                  commentaire = tr("Valeur du mot-cle enregistree")
-                  #commentaire = "Valeur du mot-cle enregistree"
-                  self.setValeurTexte(str(valeurentree))
+                commentaire = tr("Valeur du mot-cle enregistree")
+                #commentaire = "Valeur du mot-cle enregistree"
+                self.setValeurTexte(str(valeurentree))
             else:
-                  cr = self.node.item.getCr()
-                  commentaire =  tr("Valeur du mot-cle non autorisee ")+cr.getMessFatal()
-                  self.node.item.setValeur(ancienneVal)
-         return validite, commentaire 
+                cr = self.node.item.getCr()
+                commentaire =  tr("Valeur du mot-cle non autorisee ")+cr.getMessFatal()
+                self.node.item.setValeur(ancienneVal)
+        return validite, commentaire
+
 
 #--------------------------------------
 class PolitiquePlusieurs(Validation):
 #--------------------------------------
-  """
-  classe servant pour les entrees ne demandant qu un mot clef
-  """
-  def __init__(self,node,parent) :
-         #print "ds PolitiquePlusieurs"
-         self.node=node
-         self.parent=parent
-         #print self.node
-         #print self.parent
+    """
+    classe servant pour les entrees ne demandant qu un mot clef
+    """
+    def __init__(self,node,parent) :
+        #print "ds PolitiquePlusieurs"
+        self.node=node
+        self.parent=parent
+        #print self.node
+        #print self.parent
 
 
-  def ajoutValeurs(self,listevaleur,index,listecourante):
-         listeRetour=[]
-         commentaire="Nouvelle valeur acceptee"
-         commentaire2=""
-         valide=1
-         if listevaleur==None: return
-         if listevaleur=="": return
-         if not( type(listevaleur)  in (list,tuple)) :
+    def ajoutValeurs(self,listevaleur,index,listecourante):
+        listeRetour=[]
+        commentaire="Nouvelle valeur acceptee"
+        commentaire2=""
+        valide=1
+        if listevaleur==None: return
+        if listevaleur=="": return
+        if not( type(listevaleur)  in (list,tuple)) :
             listevaleur=tuple(listevaleur)
-         # on verifie que la cardinalite max n a pas ete atteinte
-         min,max = self.node.item.getMinMax()
-         if len(listecourante) + len(listevaleur) > max :
+        # on verifie que la cardinalite max n a pas ete atteinte
+        min,max = self.node.item.getMinMax()
+        if len(listecourante) + len(listevaleur) > max :
             commentaire="La liste atteint le nombre maximum d'elements : "+ str(max) +" ,ajout refuse"
             return False,commentaire,commentaire2,listeRetour
 
-         for valeur in listevaleur :
-             # On teste le type de la valeur
-             valeurScientifique=valeur
-             valide=self.node.item.valideItem(valeur)
-             if not valide :
+        for valeur in listevaleur :
+                # On teste le type de la valeur
+            valeurScientifique=valeur
+            valide=self.node.item.valideItem(valeur)
+            if not valide :
                 try :
-                   valeur,valide=self.node.item.evalValeur(valeur)
-                   valide,commentaire2 = self.node.item.object.verifType(valeur)
+                    valeur,valide=self.node.item.evalValeur(valeur)
+                    valide,commentaire2 = self.node.item.object.verifType(valeur)
                 except :
-                   #return testtype,commentaire,"",listeRetour
-                   pass
-             if not valide:
+                    #return testtype,commentaire,"",listeRetour
+                    pass
+            if not valide:
                 if commentaire.find("On attend un chaine") > 1 :
-                   commentaire="Valeur "+str(valeur)+ " incorrecte : ajout a la liste refuse: On attend une chaine de caracteres < 8"
+                    commentaire="Valeur "+str(valeur)+ " incorrecte : ajout a la liste refuse: On attend une chaine de caracteres < 8"
                 else :
-                   commentaire="Valeur "+str(valeur)+ " incorrecte : ajout a la liste refuse"
+                    commentaire="Valeur "+str(valeur)+ " incorrecte : ajout a la liste refuse"
                 if commentaire2== "" :commentaire2=self.node.item.infoErreurItem()
                 return valide,commentaire,commentaire2,listeRetour
 
-             # On valide la liste obtenue
-             encorevalide=self.node.item.valideListePartielle(valeur,listecourante)
-             if not encorevalide :
+            # On valide la liste obtenue
+            encorevalide=self.node.item.valideListePartielle(valeur,listecourante)
+            if not encorevalide :
                 commentaire2=self.node.item.infoErreurListe()
                 # On traite le cas ou la liste n est pas valide pour un pb de cardinalite
                 min,max = self.node.item.getMinMax()
                 if len(listecourante) + 1 >= max :
-                   commentaire="La liste atteint le nombre maximum d'elements : "+ str(max) +" ,ajout refuse"
-                   return valide,commentaire,commentaire2,listeRetour
+                    commentaire="La liste atteint le nombre maximum d'elements : "+ str(max) +" ,ajout refuse"
+                    return valide,commentaire,commentaire2,listeRetour
                 if len(listecourante) + 1 > min :
-                   commentaire=""
-                   return valide,commentaire,commentaire2,listeRetour
-             # On ajoute la valeur testee a la liste courante et a la liste acceptee
-             self.ajoutDsDictReel(valeurScientifique)
-             listecourante.insert(index,valeur)
-             index=index+1
-             listeRetour.append(valeur)
+                    commentaire=""
+                    return valide,commentaire,commentaire2,listeRetour
+            # On ajoute la valeur testee a la liste courante et a la liste acceptee
+            self.ajoutDsDictReel(valeurScientifique)
+            listecourante.insert(index,valeur)
+            index=index+1
+            listeRetour.append(valeur)
 
-         return valide,commentaire,commentaire2,listeRetour
+        return valide,commentaire,commentaire2,listeRetour
 
-  def ajoutTuple(self,valeurTuple,listecourante):
-         listeRetour=[]
-         commentaire="Nouvelle valeur acceptee"
-         commentaire2=""
-         valide=1
-         if valeurTuple==None: return
-         if valeurTuple==['']: return
-         # On teste le type de la valeur
-         valide=self.node.item.valideItem(valeurTuple)
-         if not valide :
+    def ajoutTuple(self,valeurTuple,listecourante):
+        listeRetour=[]
+        commentaire="Nouvelle valeur acceptee"
+        commentaire2=""
+        valide=1
+        if valeurTuple==None: return
+        if valeurTuple==['']: return
+        # On teste le type de la valeur
+        valide=self.node.item.valideItem(valeurTuple)
+        if not valide :
             try :
                 valeur,valide=self.node.item.evalValeur(valeurTuple)
                 valide = self.node.item.valideItem(valeur)
             except :
                 pass
-         if not valide:
+        if not valide:
             commentaire="Valeur "+str(valeurTuple)+ " incorrecte : ajout a la liste refuse"
             commentaire2=self.node.item.infoErreurItem()
             return valide,commentaire,commentaire2,listeRetour
 
-         # On valide la liste obtenue
-         encorevalide=self.node.item.valideListePartielle(valeurTuple,listecourante)
-         if not encorevalide :
+        # On valide la liste obtenue
+        encorevalide=self.node.item.valideListePartielle(valeurTuple,listecourante)
+        if not encorevalide :
             commentaire2=self.node.item.infoErreurListe()
             return valide,commentaire,commentaire2,listeRetour
-         listeRetour.append(valeurTuple)
-         return valide,commentaire,commentaire2,listeRetour
+        listeRetour.append(valeurTuple)
+        return valide,commentaire,commentaire2,listeRetour
 
-  def ajoutNTuple(self,liste):
-         commentaire="Nouvelles valeurs acceptee"
-         commentaire2=""
-         valide=self.node.item.valideListePartielle(None,liste)
-         print ('uuuuuuuuuuu',valide)
-         if not valide :
+    def ajoutNTuple(self,liste):
+        commentaire="Nouvelles valeurs acceptee"
+        commentaire2=""
+        valide=self.node.item.valideListePartielle(None,liste)
+        print ('uuuuuuuuuuu',valide)
+        if not valide :
             commentaire2=self.node.item.infoErreurListe()
-         return valide,commentaire,commentaire2
+        return valide,commentaire,commentaire2
 
-  def recordValeur(self,liste,dejaValide=True):
-         ancienneVal = self.node.item.getValeur()
-         validite=self.node.item.setValeur(liste)
-         if validite : self.node.item.initModif()
-         if self.node.item.isValid():
+    def recordValeur(self,liste,dejaValide=True):
+        ancienneVal = self.node.item.getValeur()
+        validite=self.node.item.setValeur(liste)
+        if validite : self.node.item.initModif()
+        if self.node.item.isValid():
             commentaire = tr("Valeur du mot-cle enregistree")
-         else:
+        else:
             cr = self.node.item.getCr()
             commentaire =  tr("Valeur du mot-cle non autorisee ")+cr.getMessFatal()
             self.node.item.setValeur(ancienneVal)
-         return validite, commentaire 
-
-      
+        return validite, commentaire
index 477b11b4d5f9823d4c06571f3dff5b757a25c61f..4bfc694db0b3fb6e63d38ccef918acd2b238dfa5 100755 (executable)
@@ -22,7 +22,7 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import os, sys
@@ -47,13 +47,13 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
     """
     Class implementing the main user interface.
     """
-    def __init__(self,code=None,salome=1,parent=None, multi=False,langue='fr',ssIhm=False, labelCode=None):
+    def __init__(self,code=None,salome=1,parent=None, multi=False,langue='en',ssIhm=False, labelCode=None):
         """
         Constructor
         """
-        if ssIhm == True : 
-           print ('mauvaise utilisation de la classe Appli. Utiliser AppliSsIm SVP')
-           exit()
+        if ssIhm == True :
+            print ('mauvaise utilisation de la classe Appli. Utiliser AppliSsIm SVP')
+            exit()
 
         AppliSsIhm.__init__(self,code,salome,parent,multi=multi,langue=langue,ssIhm=True, labelCode=labelCode)
         QMainWindow.__init__(self,parent)
@@ -65,21 +65,21 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
 
 
         if self.multi == False :
-             self.definitCode(code,None)
-             if code==None: return
+            self.definitCode(code,None)
+            if code==None: return
         else :
-             self.definitCode(code,None)
-             if code==None: return
-             print ('il faut trouver le chemin du code')
-             return 
+            self.definitCode(code,None)
+            if code==None: return
+            print ('il faut trouver le chemin du code')
+            return
 
         self.suiteTelemac=False
         if hasattr (self, 'maConfiguration') :
-           if self.maConfiguration.demandeLangue :
-              from InterfaceQT4.monChoixLangue import MonChoixLangue
-              widgetLangue = MonChoixLangue(self)
-              ret=widgetLangue.exec_()
-           self.suiteTelemac=self.maConfiguration.suiteTelemac
+            if self.maConfiguration.demandeLangue :
+                from InterfaceQT4.monChoixLangue import MonChoixLangue
+                widgetLangue = MonChoixLangue(self)
+                ret=widgetLangue.exec_()
+            self.suiteTelemac=self.maConfiguration.suiteTelemac
 
 
         if not self.salome and hasattr (self, 'maConfiguration') and hasattr(self.maConfiguration,'lang') : self.langue=self.maConfiguration.lang
@@ -92,22 +92,22 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         #else              : self.parentCentralWidget = None
 
         if not self.salome :
-           if  hasattr (self, 'maConfiguration') and hasattr(self.maConfiguration,'taille') : self.taille=self.maConfiguration.taille
-           else : self.taille=1700
+            if  hasattr (self, 'maConfiguration') and hasattr(self.maConfiguration,'taille') : self.taille=self.maConfiguration.taille
+            else : self.taille=1700
 
-           self.resize(self.taille,self.height())
+            self.resize(self.taille,self.height())
 
 
         icon = QIcon(self.repIcon+"/parametres.png")
         self.actionParametres.setIcon(icon)
-        if  hasattr (self, 'maConfiguration') and self.maConfiguration.boutonDsMenuBar  : 
-           self.frameEntete.setMaximumSize(QSize(16777215,100))
-           self.frameEntete.setMinimumSize(QSize(0,100))
-        if  hasattr (self, 'maConfiguration') and self.maConfiguration.enleverActionStructures  : 
+        if  hasattr (self, 'maConfiguration') and self.maConfiguration.boutonDsMenuBar  :
+            self.frameEntete.setMaximumSize(QSize(16777215,100))
+            self.frameEntete.setMinimumSize(QSize(0,100))
+        if  hasattr (self, 'maConfiguration') and self.maConfiguration.enleverActionStructures  :
             self.enleverActionsStructures()
-        if  hasattr (self, 'maConfiguration') and self.maConfiguration.enleverParametres  : 
+        if  hasattr (self, 'maConfiguration') and self.maConfiguration.enleverParametres  :
             self.enleverParametres()
-        if  hasattr (self, 'maConfiguration') and self.maConfiguration.enleverSupprimer : 
+        if  hasattr (self, 'maConfiguration') and self.maConfiguration.enleverSupprimer :
             self.enleverSupprimer()
 
 
@@ -122,15 +122,15 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         self.blEnteteGlob.insertLayout(0,self.blEntete)
 
 
-        
-        if  hasattr (self, 'maConfiguration') and self.maConfiguration.boutonDsMenuBar  : 
+
+        if  hasattr (self, 'maConfiguration') and self.maConfiguration.boutonDsMenuBar  :
             self.blEnteteCommmande = QBoxLayout(0)
             self.blEnteteCommmande.insertWidget(0,self.toolBarCommande)
             self.toolBarCommande.setIconSize(QSize(96,96))
             self.blEnteteGlob.insertLayout(-1,self.blEnteteCommmande)
         else :
             self.toolBarCommande.close()
-         
+
 
         if hasattr (self, 'maConfiguration') and self.maConfiguration.closeEntete==True and self.salome: self.closeEntete()
 
@@ -153,11 +153,11 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         try :
         #if 1 :
          #print ('attention try devient if 1')
-          self.ouvreFichiers()
+            self.ouvreFichiers()
         except EficasException as exc:
         #except:
-          print ("je suis dans le except")
-          if self.salome == 0 : exit()
+            print ("je suis dans le except")
+            if self.salome == 0 : exit()
 
         #self.adjustSize()
 
@@ -170,11 +170,11 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         self.code=code
         self.ssCode=ssCode
         if self.code==None :
-           self.cleanPath()
-           from InterfaceQT4.monChoixCode import MonChoixCode
-           widgetChoix = MonChoixCode(self)
-           ret=widgetChoix.exec_()
-           #widgetChoix.show()
+            self.cleanPath()
+            from InterfaceQT4.monChoixCode import MonChoixCode
+            widgetChoix = MonChoixCode(self)
+            ret=widgetChoix.exec_()
+            #widgetChoix.show()
         if self.code == None:return # pour le cancel de la fenetre choix code
         AppliSsIhm.definitCode(self,self.code,ssCode)
 
@@ -191,20 +191,20 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         self.initRecents()
         self.initAides()
         for intituleMenu in ("menuTraduction","menuOptions","menuMesh","menuExecution","menuN1"):
-              if hasattr(self,intituleMenu):
-                 menu=getattr(self,intituleMenu)
-                 menu.setAttribute(Qt.WA_DeleteOnClose)
-                 menu.close()
-                 delattr(self,intituleMenu)
+            if hasattr(self,intituleMenu):
+                menu=getattr(self,intituleMenu)
+                menu.setAttribute(Qt.WA_DeleteOnClose)
+                menu.close()
+                delattr(self,intituleMenu)
         for intituleAction in ("actionExecution","actionSaveRun"):
             if hasattr(self,intituleAction):
-              action=getattr(self,intituleAction)
-              self.toolBar.removeAction(action)
+                action=getattr(self,intituleAction)
+                self.toolBar.removeAction(action)
         if self.code.upper() in Appli.__dict__:
-          Appli.__dict__[self.code.upper()](self,)
+            Appli.__dict__[self.code.upper()](self,)
         if self.suiteTelemac : self.lookSuiteTelemac()
         self.metMenuAJourUtilisateurs()
-        if  hasattr (self, 'maConfiguration') and self.maConfiguration.ajoutExecution : 
+        if  hasattr (self, 'maConfiguration') and self.maConfiguration.ajoutExecution :
             self.ajoutExecution()
 
     def initAides(self):
@@ -217,10 +217,10 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         self.fileDoc=os.path.join(self.docPath,fileName)
         self.actionCode.setText(tr("Aide specifique ")+str(self.code))
         if not os.path.isfile(self.fileDoc) :
-               self.fileDoc=""
-               self.docPath=""
-               self.actionCode.setEnabled(False)
-               return
+            self.fileDoc=""
+            self.docPath=""
+            self.actionCode.setEnabled(False)
+            return
 
         self.actionCode.setEnabled(True)
         self.menuAide.addAction(self.actionCode)
@@ -270,14 +270,14 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         self.menuExecution = self.menubar.addMenu(tr("&Run"))
         self.actionExecution = QAction(self)
         if sys.platform[0:5]=="linux":
-          icon6 = QIcon(self.repIcon+"/roue.png")
-          self.actionExecution.setIcon(icon6)
+            icon6 = QIcon(self.repIcon+"/roue.png")
+            self.actionExecution.setIcon(icon6)
         else :
-          self.actionExecution.setText(tr("Run"))
+            self.actionExecution.setText(tr("Run"))
         self.actionExecution.setObjectName("actionExecution")
         self.menuExecution.addAction(self.actionExecution)
         if not(self.actionExecution in self.toolBar.actions()):
-           self.toolBar.addAction(self.actionExecution)
+            self.toolBar.addAction(self.actionExecution)
         self.actionExecution.setText(tr("Run"))
         self.actionExecution.triggered.connect(self.run)
 
@@ -288,7 +288,7 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         self.actionSaveRun.setObjectName("actionSaveRun")
         self.menuExecution.addAction(self.actionSaveRun)
         if not(self.actionSaveRun in self.toolBar.actions()):
-           self.toolBar.addAction(self.actionSaveRun)
+            self.toolBar.addAction(self.actionSaveRun)
         self.actionSaveRun.setText(tr("Save Run"))
         self.actionSaveRun.triggered.connect(self.saveRun)
 
@@ -443,9 +443,9 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
     def ChercheGrpMesh(self):
         Msg,listeGroup=self.ChercheGrpMeshInSalome()
         if Msg == None :
-           self.viewmanager.handleAjoutGroup(listeGroup)
+            self.viewmanager.handleAjoutGroup(listeGroup)
         else :
-           print ("il faut gerer les erreurs")
+            print ("il faut gerer les erreurs")
 
     def ChercheGrpMaille(self):
         # Normalement la variable self.salome permet de savoir si on est ou non dans Salome
@@ -455,9 +455,9 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         except:
             raise ValueError('Salome non ouvert')
         if Msg == None :
-           self.viewmanager.handleAjoutGroup(listeGroup)
+            self.viewmanager.handleAjoutGroup(listeGroup)
         else :
-           print ("il faut gerer les erreurs")
+            print ("il faut gerer les erreurs")
 
 
     def ChercheGrp(self):
@@ -647,57 +647,57 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
     # Mise a jour du menu des fichiers recemment ouverts
         from Editeur import listePatrons
         if not(self.code in listePatrons.sous_menus) :
-           if hasattr(self,"menuPatrons"):
-              self.menuPatrons.setAttribute(Qt.WA_DeleteOnClose)
-              self.menuPatrons.close()
-              delattr(self,"menuPatrons")
-           return
+            if hasattr(self,"menuPatrons"):
+                self.menuPatrons.setAttribute(Qt.WA_DeleteOnClose)
+                self.menuPatrons.close()
+                delattr(self,"menuPatrons")
+            return
         if (not hasattr(self,"menuPatrons")):
-           self.menuPatrons = QMenu(self.menubar)
-           self.menuPatrons.setObjectName("menuPatrons")
-           self.menubar.addAction(self.menuPatrons.menuAction())
-           self.menuPatrons.setTitle(tr("Patrons"))
+            self.menuPatrons = QMenu(self.menubar)
+            self.menuPatrons.setObjectName("menuPatrons")
+            self.menubar.addAction(self.menuPatrons.menuAction())
+            self.menuPatrons.setTitle(tr("Patrons"))
         else :
-           self.menuPatrons.clear()
+            self.menuPatrons.clear()
         self.listePatrons = listePatrons.listePatrons(self.code)
         idx = 0
         for nomSsMenu in self.listePatrons.liste:
             ssmenu=self.menuPatrons.addMenu(nomSsMenu)
             for fichier in self.listePatrons.liste[nomSsMenu]:
-               id = ssmenu.addAction(fichier)
-               self.ficPatrons[id]=fichier
-               self.id.triggered.connect(self.handleOpenPatrons)
+                id = ssmenu.addAction(fichier)
+                self.ficPatrons[id]=fichier
+                self.id.triggered.connect(self.handleOpenPatrons)
             #   self.Patrons.setItemParameter(id,idx)
-               idx=idx+1
+                idx=idx+1
 
     def initRecents(self):
-       self.recent =  []
-       try :
-           #if sys.platform[0:5]=="linux" :
-              #rep=os.path.join(os.environ['HOME'],'.config/Eficas',self.code)
-           rep=os.path.join(os.path.expanduser("~"),'.config/Eficas',self.code)
-           #else :
-           #   rep=os.path.join('C:/','.config/Eficas',self.code)
-           monFichier=rep+"/listefichiers_"+self.code
-           index=0
-           f=open(monFichier)
-           while ( index < 9) :
-              ligne=f.readline()
-              if ligne != "" :
-                 l=(ligne.split("\n"))[0]
-                 self.recent.append(l)
-              index=index+1
-       except :
-           pass
-
-       try    : f.close()
-       except : pass
+        self.recent =  []
+        try :
+            #if sys.platform[0:5]=="linux" :
+                #rep=os.path.join(os.environ['HOME'],'.config/Eficas',self.code)
+            rep=os.path.join(os.path.expanduser("~"),'.config/Eficas',self.code)
+            #else :
+            #   rep=os.path.join('C:/','.config/Eficas',self.code)
+            monFichier=rep+"/listefichiers_"+self.code
+            index=0
+            f=open(monFichier)
+            while ( index < 9) :
+                ligne=f.readline()
+                if ligne != "" :
+                    l=(ligne.split("\n"))[0]
+                    self.recent.append(l)
+                index=index+1
+        except :
+            pass
+
+        try    : f.close()
+        except : pass
 
     def addToRecentList(self, fn):
-      while fn in self.recent: self.recent.remove(fn)
-      self.recent.insert(0,fn)
-      if len(self.recent) > 9:
-         self.recent = self.recent[:9]
+        while fn in self.recent: self.recent.remove(fn)
+        self.recent.insert(0,fn)
+        if len(self.recent) > 9:
+            self.recent = self.recent[:9]
 
 
     def addToRecentListQT4(self, fn):
@@ -714,24 +714,24 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         self.sauveRecents()
 
     def sauveRecents(self) :
-       try :
-         rep=self.maConfiguration.rep_user
-         monFichier=rep+"/listefichiers_"+self.code
-       except :
-         return
-       try :
+        try :
+            rep=self.maConfiguration.rep_user
+            monFichier=rep+"/listefichiers_"+self.code
+        except :
+            return
+        try :
             f=open(monFichier,'w')
             if len(self.recent) == 0 : return
             index=0
             while ( index <  len(self.recent)):
-              ligne=str(self.recent[index])+"\n"
-              f.write(ligne)
-              index=index+1
-       except :
+                ligne=str(self.recent[index])+"\n"
+                f.write(ligne)
+                index=index+1
+        except :
             pass
-       try :
+        try :
             f.close()
-       except :
+        except :
             pass
 
 
@@ -762,49 +762,49 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
         repAide=os.path.dirname(os.path.abspath(__file__))
         maD=os.path.join( repAide,'..','Doc')
         try :
-          indexAide=os.path.join(maD,'index.html')
-          if sys.platform[0:5]=="linux" : cmd="xdg-open "+indexAide
-          else                          : cmd="start "+indexAide
-          os.system(cmd)
+            indexAide=os.path.join(maD,'index.html')
+            if sys.platform[0:5]=="linux" : cmd="xdg-open "+indexAide
+            else                          : cmd="start "+indexAide
+            os.system(cmd)
         except:
-          QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
+            QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
 
     def aidePSEN(self) :
         repAide=os.path.dirname(os.path.abspath(__file__))
         maD=os.path.join( repAide,'..','Doc')
         try :
-          indexAide=os.path.join(maD,'index.html')
-          if sys.platform[0:5]=="linux" : cmd="xdg-open "+indexAide
-          else                          : cmd="start "+indexAide
-          os.system(cmd)
+            indexAide=os.path.join(maD,'index.html')
+            if sys.platform[0:5]=="linux" : cmd="xdg-open "+indexAide
+            else                          : cmd="start "+indexAide
+            os.system(cmd)
         except:
-          QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
+            QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
 
     def aideCode(self) :
         if self.code==None : return
         try :
         #if 1 :
-          if sys.platform[0:5]=="linux" : cmd="xdg-open "+self.fileDoc
-          else                          : cmd="start "+self.fileDoc
-          os.system(cmd)
+            if sys.platform[0:5]=="linux" : cmd="xdg-open "+self.fileDoc
+            else                          : cmd="start "+self.fileDoc
+            os.system(cmd)
         except:
         #else:
-          QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
+            QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
 
 
     def optionEditeur(self) :
         try :
-           name='monOptions_'+self.code
+            name='monOptions_'+self.code
         except :
-           QMessageBox.critical( self,tr( "Parametrage"),tr( "Veuillez d abord choisir un code"))
-           return
+            QMessageBox.critical( self,tr( "Parametrage"),tr( "Veuillez d abord choisir un code"))
+            return
         try :
         #if 1:
-           optionCode=__import__(name)
+            optionCode=__import__(name)
         except :
         #else :
-           QMessageBox.critical( self, tr("Parametrage"), tr("Pas de possibilite de personnalisation de la configuration "))
-           return
+            QMessageBox.critical( self, tr("Parametrage"), tr("Pas de possibilite de personnalisation de la configuration "))
+            return
         monOption=optionCode.Options(parent=self,modal = 0 ,configuration=self.maConfiguration)
         monOption.show()
 
@@ -947,32 +947,32 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
     def cleanPath(self):
         for pathCode in self.ListePathCode:
             try:
-              aEnlever=os.path.abspath(os.path.join(os.path.dirname(__file__),'..',pathCode))
-              sys.path.remove(aEnlever)
+                aEnlever=os.path.abspath(os.path.join(os.path.dirname(__file__),'..',pathCode))
+                sys.path.remove(aEnlever)
             except :
-              pass
+                pass
         for pathCode in self.listeAEnlever:
             try:
-              sys.path.remove(aEnlever)
+                sys.path.remove(aEnlever)
             except :
-              pass
+                pass
 
 
     def closeEvent(self,event):
-      res=self.fileExit()
-      if res==2 : event.ignore()
+        res=self.fileExit()
+        if res==2 : event.ignore()
+
 
     def remplitIconesCommandes(self):
         if self.maConfiguration.boutonDsMenuBar == False : return
         if not hasattr(self, 'readercata') : return
         from monLayoutBouton import MonLayoutBouton
         if hasattr(self,'monLayoutBoutonRempli') : return
         self.monLayoutBoutonRempli=MonLayoutBouton(self)
-        
+
     def handleAjoutEtape(self,nomEtape):
         self.viewmanager.handleAjoutEtape(nomEtape)
-     
+
     def metMenuAJourUtilisateurs(self):
         self.lesFonctionsUtilisateurs={}
         if self.code not in self.mesScripts : return
@@ -982,12 +982,12 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow):
             self.menuOptions = self.menubar.addMenu("menuOptions")
             self.menuOptions.setTitle(tr(titre))
             for elt in lesFonctions :
-               laFonctionUtilisateur, label, lesArguments = elt
-               action = QAction(self)
-               action.setText(label)
+                laFonctionUtilisateur, label, lesArguments = elt
+                action = QAction(self)
+                action.setText(label)
             #action.triggered.connect(self.appelleFonctionUtilisateur)
-               self.menuOptions.addAction(action)
-               self.lesFonctionsUtilisateurs[action]=(laFonctionUtilisateur, lesArguments)
+                self.menuOptions.addAction(action)
+                self.lesFonctionsUtilisateurs[action]=(laFonctionUtilisateur, lesArguments)
             self.menuOptions.triggered.connect(self.handleFonctionUtilisateur)
 
 
index f2fb2245c6e9a442bd412462c18b39b0b811f743..4374a8fb206ec8731a74480660ae95616fa25173 100755 (executable)
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import os, sys
 
 from Extensions.eficas_exception import EficasException
 from Extensions import param2
-
 from InterfaceQT4.getVersion import getEficasVersion
 from InterfaceQT4.viewManagerSsIhm import MyViewManagerSsIhm
-
 from Editeur        import session
 
 
@@ -52,6 +50,8 @@ class AppliSsIhm:
         self.ssIhm=True
         self.code=code
         self.genereXSD=genereXSD
+        self.versionCode=versionCode
+        self.ssCode=ssCode
 
         self.dict_reels={}
         self.fichierIn=None
@@ -65,29 +65,30 @@ class AppliSsIhm:
         self.listeCode=['Adao','ADAO','Carmel3D','Telemac','CF','MAP','ZCracks', 'SEP','SPECA','PSEN_Eficas','PSEN_N1']
         self.repIcon=os.path.join( os.path.dirname(os.path.abspath(__file__)),'..','Editeur','icons')
 
-        self.fichierCata=session.d_env.fichierCata
+        if fichierCata== None: self.fichierCata=session.d_env.fichierCata
+        else : self.fichierCata=fichierCata
         if session.d_env.labelCode : self.labelCode=session.d_env.labelCode
         self.withXSD=session.d_env.withXSD
 
         if self.salome:
-          import Accas
-          try :
-            import eficasSalome
-            Accas.SalomeEntry = eficasSalome.SalomeEntry
-          except : 
-            print ('eficas hors salome')
+            import Accas
+            try :
+                import eficasSalome
+                Accas.SalomeEntry = eficasSalome.SalomeEntry
+            except :
+                print ('eficas hors salome')
 
         self.multi=multi
-        if self.multi : 
-              print ('pas de multi sans ihm')
+        if self.multi :
+            print ('pas de multi sans ihm')
 
 
         if langue=='fr': self.langue=langue
         else           : self.langue="ang"
 
         if self.multi == False :
-             self.definitCode(code,None)
-             if code==None: return
+            self.definitCode(code,ssCode)
+            if code==None: return
 
         self.suiteTelemac=False
         self.viewmanager=MyViewManagerSsIhm(self)
@@ -98,33 +99,33 @@ class AppliSsIhm:
         self.ssCode=ssCode
         if self.code == None:return # pour le cancel de la fenetre choix code
 
-        try : 
-          name='prefs_'+self.code
-          prefsCode=__import__(name)
-          self.repIni=prefsCode.repIni
-        except : 
-          self.repIni=os.path.dirname(os.path.abspath(__file__))
-          
+        try :
+            name='prefs_'+self.code
+            prefsCode=__import__(name)
+            self.repIni=prefsCode.repIni
+        except :
+            self.repIni=os.path.dirname(os.path.abspath(__file__))
+
 
         if ssCode != None :
-           self.formatFichierOut = ssCode  #par defaut
-           prefsCode.NAME_SCHEME = ssCode
+            self.formatFichierOut = ssCode  #par defaut
+            prefsCode.NAME_SCHEME = ssCode
         else :
-           self.formatFichierIn  = "python" #par defaut
-           self.formatFichierOut = "python" #par defaut
+            self.formatFichierIn  = "python" #par defaut
+            self.formatFichierOut = "python" #par defaut
 
         nameConf='configuration_'+self.code
         try :
-          configuration=__import__(nameConf)
-          self.maConfiguration = configuration.make_config(self,self.repIni)
+            configuration=__import__(nameConf)
+            self.maConfiguration = configuration.make_config(self,self.repIni)
         except :
-          from InterfaceQT4.configuration import makeConfig
-          #self.maConfiguration = configuration.makeConfig(self,prefsCode.repIni)
-          self.maConfiguration = makeConfig(self,self.repIni)
+            from InterfaceQT4.configuration import makeConfig
+            #self.maConfiguration = configuration.makeConfig(self,prefsCode.repIni)
+            self.maConfiguration = makeConfig(self,self.repIni)
 
         if hasattr (self,'maConfiguration') and self.maConfiguration.translatorFichier :
-           from Extensions import localisation
-           localisation.localise(None,self.langue,translatorFichier=self.maConfiguration.translatorFichier)
+            from Extensions import localisation
+            localisation.localise(None,self.langue,translatorFichier=self.maConfiguration.translatorFichier)
         if self.withXSD : self.maConfiguration.withXSD=True
 
 
@@ -138,18 +139,18 @@ class AppliSsIhm:
 
 
     def initEditor(self,fichier = None,jdc = None, units = None,include=0):
-        if (hasattr(self, 'editor')) and self.editor != None : 
-           print ('un seul editeur par application')
-           sys.exit()
+        if (hasattr(self, 'editor')) and self.editor != None :
+            print ('un seul editeur par application')
+            sys.exit()
         self.editor = self.viewmanager.getNewEditorNormal()
-        
+
     def initEditorNormal(self,fichier = None,jdc = None, units = None,include=0):
-        if (hasattr(self, 'editor')) and self.editor != None : 
-           print ('un seul editeur par application')
-           sys.Exit()
+        if (hasattr(self, 'editor')) and self.editor != None :
+            print ('un seul editeur par application')
+            sys.Exit()
         #self.editor = JDCEditorSsIhm(self,fichier, jdc, self.myQtab,units=units,include=include)
         self.editor = self.viewmanager.getNewEditorNormal()
-        
+
 
     def fileNew(self):
         self.editor=self.initEditor()
@@ -179,12 +180,13 @@ class AppliSsIhm:
         print ('ok ',ok)
 
     def dumpXsd(self, avecEltAbstrait = False):
-        current_cata    = CONTEXT.getCurrentCata()
-        texteXSD = current_cata.dumpXsd( avecEltAbstrait)
+        currentCata    = CONTEXT.getCurrentCata()
+        texteXSD = currentCata.dumpXsd( avecEltAbstrait)
         return texteXSD
         #if self.maConfiguration.afficheIhm==False : exit()
         #else : return texteXSD
 
+
 #,self.fileSaveAs
 #,self.fileClose
 #,self.fileExit
@@ -192,7 +194,7 @@ class AppliSsIhm:
 #,self.jdcRegles
 #,self.jdcFichierSource
 #,self.visuJdcPy
-       
+
 
 
 if __name__=='__main__':
index f52e7e359312b0c469bfdd1ec94849eef3f600a2..ad1b229b03459ae5e08e296571618f46567dd28b 100644 (file)
@@ -31,7 +31,7 @@ from Extensions.i18n import tr
 from Extensions.eficas_exception import EficasException
 
 from Editeur import session
-import Accas 
+import Accas
 
 
 class Appli(Ui_Eficas,QMainWindow):
@@ -68,8 +68,8 @@ class Appli(Ui_Eficas,QMainWindow):
         if langue=='fr': self.langue=langue
         else           : self.langue="ang"
         if self.multi == False :
-             self.definitCode(code,ssCode)
-             if code==None: return
+            self.definitCode(code,ssCode)
+            if code==None: return
 
         eficas_root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
         self.ajoutIcones()
@@ -92,10 +92,10 @@ class Appli(Ui_Eficas,QMainWindow):
         self.code=code
         self.ssCode=ssCode
         if self.code==None :
-           self.cleanPath()
-           from monChoixCode import MonChoixCode
-           widgetChoix = MonChoixCode(self)
-           ret=widgetChoix.exec_()
+            self.cleanPath()
+            from monChoixCode import MonChoixCode
+            widgetChoix = MonChoixCode(self)
+            ret=widgetChoix.exec_()
         import sys
         if self.code == None:return # pour le cancel de la fenetre choix code
         name='prefs_'+self.code
@@ -103,38 +103,38 @@ class Appli(Ui_Eficas,QMainWindow):
 
         self.repIni=prefsCode.repIni
         if ssCode != None :
-           self.format_fichier= ssCode  #par defaut
-           prefsCode.NAME_SCHEME=ssCode
+            self.format_fichier= ssCode  #par defaut
+            prefsCode.NAME_SCHEME=ssCode
         else :
-           self.format_fichier="python" #par defaut
+            self.format_fichier="python" #par defaut
 
         nameConf='configuration_'+self.code
         configuration=__import__(nameConf)
         self.CONFIGURATION = configuration.make_config(self,prefsCode.repIni)
         self.CONFIGStyle = None
         if hasattr(configuration,'make_config_style'):
-           self.CONFIGStyle = configuration.make_config_style(self,prefsCode.repIni)
+            self.CONFIGStyle = configuration.make_config_style(self,prefsCode.repIni)
         if hasattr(prefsCode,'encoding'):
-           import sys
-           reload(sys)
-           sys.setdefaultencoding(prefsCode.encoding)
+            import sys
+            reload(sys)
+            sys.setdefaultencoding(prefsCode.encoding)
 
     def construitMenu(self):
         self.initPatrons()
         self.initRecents()
         self.initAides()
         for intituleMenu in ("menuTraduction","menuOptions","menuMesh","menuExecution"):
-              if hasattr(self,intituleMenu):
-                 menu=getattr(self,intituleMenu)
-                 menu.setAttribute(Qt.WA_DeleteOnClose)
-                 menu.close()
-                 delattr(self,intituleMenu)
+            if hasattr(self,intituleMenu):
+                menu=getattr(self,intituleMenu)
+                menu.setAttribute(Qt.WA_DeleteOnClose)
+                menu.close()
+                delattr(self,intituleMenu)
         for intituleAction in ("actionExecution","actionSaveRun",):
             if hasattr(self,intituleAction):
-              action=getattr(self,intituleAction)
-              self.toolBar.removeAction(action)
+                action=getattr(self,intituleAction)
+                self.toolBar.removeAction(action)
         if self.code in Appli.__dict__.keys():
-          listeTexte=apply(Appli.__dict__[self.code],(self,))
+            listeTexte=apply(Appli.__dict__[self.code],(self,))
 
     def initAides(self):
         #print "je passe la"
@@ -146,10 +146,10 @@ class Appli(Ui_Eficas,QMainWindow):
         self.fileDoc=os.path.join(self.docPath,fileName)
         self.actionCode.setText(tr("Aide specifique ")+str(self.code))
         if not os.path.isfile(self.fileDoc) :
-               self.fileDoc=""
-               self.docPath=""
-               self.actionCode.setEnabled(False)
-               return
+            self.fileDoc=""
+            self.docPath=""
+            self.actionCode.setEnabled(False)
+            return
 
         self.actionCode.setEnabled(True)
         self.menuAide.addAction(self.actionCode)
@@ -162,7 +162,7 @@ class Appli(Ui_Eficas,QMainWindow):
         self.actionExecution.setObjectName("actionExecution")
         self.menuExecution.addAction(self.actionExecution)
         if not(self.actionExecution in self.toolBar.actions()):
-           self.toolBar.addAction(self.actionExecution)
+            self.toolBar.addAction(self.actionExecution)
         self.actionExecution.setText(QApplication.translate("Eficas", "Execution ", None, QApplication.UnicodeUTF8))
         self.connect(self.actionExecution,SIGNAL("activated()"),self.run)
 
@@ -172,7 +172,7 @@ class Appli(Ui_Eficas,QMainWindow):
         self.actionSaveRun.setObjectName("actionSaveRun")
         self.menuExecution.addAction(self.actionSaveRun)
         if not(self.actionSaveRun in self.toolBar.actions()):
-           self.toolBar.addAction(self.actionSaveRun)
+            self.toolBar.addAction(self.actionSaveRun)
         self.actionSaveRun.setText(QApplication.translate("Eficas", "Save Run", None, QApplication.UnicodeUTF8))
         self.connect(self.actionSaveRun,SIGNAL("activated()"),self.saveRun)
 
@@ -202,16 +202,16 @@ class Appli(Ui_Eficas,QMainWindow):
     def ChercheGrpMesh(self):
         Msg,listeGroup=self.ChercheGrpMeshInSalome()
         if Msg == None :
-           self.viewmanager.handleAjoutGroup(listeGroup)
+            self.viewmanager.handleAjoutGroup(listeGroup)
         else :
-           print "il faut gerer les erreurs"
+            print "il faut gerer les erreurs"
 
     def ChercheGrpMaille(self):
         Msg,listeGroup=self.ChercheGrpMailleInSalome()
         if Msg == None :
-           self.viewmanager.handleAjoutGroup(listeGroup)
+            self.viewmanager.handleAjoutGroup(listeGroup)
         else :
-           print "il faut gerer les erreurs"
+            print "il faut gerer les erreurs"
 
 
     def ajoutIcones(self) :
@@ -314,49 +314,49 @@ class Appli(Ui_Eficas,QMainWindow):
     # Mise a jour du menu des fichiers recemment ouverts
         from Editeur import listePatrons
         if not(self.code in listePatrons.sous_menus.keys()) :
-           if hasattr(self,"menuPatrons"):
-              self.menuPatrons.setAttribute(Qt.WA_DeleteOnClose)
-              self.menuPatrons.close()
-              delattr(self,"menuPatrons")
-           return
+            if hasattr(self,"menuPatrons"):
+                self.menuPatrons.setAttribute(Qt.WA_DeleteOnClose)
+                self.menuPatrons.close()
+                delattr(self,"menuPatrons")
+            return
         if (not hasattr(self,"menuPatrons")):
-           self.menuPatrons = QMenu(self.menubar)
-           self.menuPatrons.setObjectName("menuPatrons")
-           self.menubar.addAction(self.menuPatrons.menuAction())
-           self.menuPatrons.setTitle(QApplication.translate("Eficas", "Patrons", None, QApplication.UnicodeUTF8))
+            self.menuPatrons = QMenu(self.menubar)
+            self.menuPatrons.setObjectName("menuPatrons")
+            self.menubar.addAction(self.menuPatrons.menuAction())
+            self.menuPatrons.setTitle(QApplication.translate("Eficas", "Patrons", None, QApplication.UnicodeUTF8))
         else :
-           self.menuPatrons.clear()
+            self.menuPatrons.clear()
         self.listePatrons = listePatrons.listePatrons(self.code)
         idx = 0
         for nomSsMenu in self.listePatrons.liste.keys():
             ssmenu=self.menuPatrons.addMenu(nomSsMenu)
             for fichier in self.listePatrons.liste[nomSsMenu]:
-               id = ssmenu.addAction(fichier)
-               self.ficPatrons[id]=fichier
-               self.connect(id, SIGNAL('triggered()'),self.handleOpenPatrons)
+                id = ssmenu.addAction(fichier)
+                self.ficPatrons[id]=fichier
+                self.connect(id, SIGNAL('triggered()'),self.handleOpenPatrons)
             #   self.Patrons.setItemParameter(id,idx)
-               idx=idx+1
+                idx=idx+1
 
     def initRecents(self):
-       self.recent =  QStringList()
-       try :
-       #if 1 :
-           rep=os.path.join(os.environ['HOME'],'.config/Eficas',self.code)
-           monFichier=rep+"/listefichiers_"+self.code
-           index=0
-           f=open(monFichier)
-           while ( index < 9) :
-              ligne=f.readline()
-              if ligne != "" :
-                 l=(ligne.split("\n"))[0]
-                 self.recent.append(l)
-              index=index+1
-       except :
-       #else :
-           pass
-
-       try    : f.close()
-       except : pass
+        self.recent =  QStringList()
+        try :
+        #if 1 :
+            rep=os.path.join(os.environ['HOME'],'.config/Eficas',self.code)
+            monFichier=rep+"/listefichiers_"+self.code
+            index=0
+            f=open(monFichier)
+            while ( index < 9) :
+                ligne=f.readline()
+                if ligne != "" :
+                    l=(ligne.split("\n"))[0]
+                    self.recent.append(l)
+                index=index+1
+        except :
+        #else :
+            pass
+
+        try    : f.close()
+        except : pass
 
     def addToRecentList(self, fn):
         """
@@ -370,24 +370,24 @@ class Appli(Ui_Eficas,QMainWindow):
             self.recent = self.recent[:9]
 
     def sauveRecents(self) :
-       try :
-         rep=self.CONFIGURATION.rep_user
-         monFichier=rep+"/listefichiers_"+self.code
-       except :
-         return
-       try :
+        try :
+            rep=self.CONFIGURATION.rep_user
+            monFichier=rep+"/listefichiers_"+self.code
+        except :
+            return
+        try :
             f=open(monFichier,'w')
             if len(self.recent) == 0 : return
             index=0
             while ( index <  len(self.recent)):
-              ligne=str(self.recent[index])+"\n"
-              f.write(ligne)
-              index=index+1
-       except :
+                ligne=str(self.recent[index])+"\n"
+                f.write(ligne)
+                index=index+1
+        except :
             pass
-       try :
+        try :
             f.close()
-       except :
+        except :
             pass
 
 
@@ -418,37 +418,37 @@ class Appli(Ui_Eficas,QMainWindow):
         repAide=os.path.dirname(os.path.abspath(__file__))
         maD=repAide+"/../Aide"
         try :
-          indexAide=maD+"/fichiers_EFICAS/index.html"
-          cmd="xdg-open "+indexAide
-          os.system(cmd)
+            indexAide=maD+"/fichiers_EFICAS/index.html"
+            cmd="xdg-open "+indexAide
+            os.system(cmd)
         except:
-          QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
+            QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
 
 
     def aideCode(self) :
         if self.code==None : return
         try :
         #if 1 :
-          cmd="xdg-open "+self.fileDoc
-          os.system(cmd)
+            cmd="xdg-open "+self.fileDoc
+            os.system(cmd)
         except:
         #else:
-          QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
+            QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
 
 
     def optionEditeur(self) :
         try :
-           name='monOptions_'+self.code
+            name='monOptions_'+self.code
         except :
-           QMessageBox.critical( self,tr( "Parametrage"),tr( "Veuillez d abord choisir un code"))
-           return
+            QMessageBox.critical( self,tr( "Parametrage"),tr( "Veuillez d abord choisir un code"))
+            return
         try :
         #if 1:
-           optionCode=__import__(name)
+            optionCode=__import__(name)
         except :
         #else :
-           QMessageBox.critical( self, tr("Parametrage"), tr("Pas de possibilite de personnalisation de la configuration "))
-           return
+            QMessageBox.critical( self, tr("Parametrage"), tr("Pas de possibilite de personnalisation de la configuration "))
+            return
         monOption=optionCode.Options(parent=self,modal = 0 ,configuration=self.CONFIGURATION)
         monOption.show()
 
@@ -562,20 +562,20 @@ class Appli(Ui_Eficas,QMainWindow):
     def cleanPath(self):
         for pathCode in self.ListeCode:
             try:
-              aEnlever=os.path.abspath(os.path.join(os.path.dirname(__file__),'..',pathCode))
-              sys.path.remove(aEnlever)
+                aEnlever=os.path.abspath(os.path.join(os.path.dirname(__file__),'..',pathCode))
+                sys.path.remove(aEnlever)
             except :
-              pass
+                pass
         for pathCode in self.listeAEnlever:
             try:
-              sys.path.remove(aEnlever)
+                sys.path.remove(aEnlever)
             except :
-              pass
+                pass
 
 
     def closeEvent(self,event):
-      res=self.fileExit()
-      if res==2 : event.ignore()
+        res=self.fileExit()
+        if res==2 : event.ignore()
 
 if __name__=='__main__':
 
@@ -584,12 +584,12 @@ if __name__=='__main__':
     sys.path.append(rep)
     from Aster import prefsCode
     if hasattr(prefsCode,'encoding'):
-       # Hack pour changer le codage par defaut des strings
-       import sys
-       reload(sys)
-       sys.setdefaultencoding(prefsCode.encoding)
-       del sys.setdefaultencoding
-       # Fin hack
+        # Hack pour changer le codage par defaut des strings
+        import sys
+        reload(sys)
+        sys.setdefaultencoding(prefsCode.encoding)
+        del sys.setdefaultencoding
+        # Fin hack
 
     from Editeur import import_code
     from Editeur import session
index 16cfd6e7a394c090cfcab2897f0a75f86fb280f0..0ff274d9bdde717ede9ce8820bb365a8aed0b41f 100644 (file)
@@ -20,8 +20,8 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 
 import types,os
@@ -33,115 +33,115 @@ from PyQt5.QtCore import Qt
 # Import des panels
 
 class SaisieValeur(object):
-  """
-  Classe contenant les methodes communes aux  panels
-  permettant de choisir des valeurs 
-  """
-  def __init__(self):
-       pass
+    """
+    Classe contenant les methodes communes aux  panels
+    permettant de choisir des valeurs
+    """
+    def __init__(self):
+        pass
 
 
-  def LEvaleurPressed(self,valeur=None):
-         #print('LEvaleurPressed', valeur, type(valeur))
-         if not hasattr(self, 'inSaisieValeur' ) : self.inSaisieValeur=False
-         if self.inSaisieValeur : return
-         self.inSaisieValeur=True
+    def LEvaleurPressed(self,valeur=None):
+        #print('LEvaleurPressed', valeur, type(valeur))
+        if not hasattr(self, 'inSaisieValeur' ) : self.inSaisieValeur=False
+        if self.inSaisieValeur : return
+        self.inSaisieValeur=True
 
-         if valeur == None :
+        if valeur == None :
             try :
-              nouvelleValeur=str(self.lineEditVal.text())
+                nouvelleValeur=str(self.lineEditVal.text())
             except UnicodeEncodeError as e :
-               self.editor.afficheInfos("pb d encoding", Qt.red)
-               validite,commentaire=self.politique.recordValeur(None)
-               self.lineEditVal.setText('')
-               self.setValide()
-               self.inSaisieValeur=False
-               return
-         else :
-            try : 
-              # la 1 ligne est tres bizarre. remplacee par le 3nd le 01 10 19
-              #if hasattr(self,"lineEditVal"):self.lineEditVal.setText(tr(valeur.nom))
-              if hasattr(self,"lineEditVal") : self.lineEditVal.setText(tr(valeur))
-            except : 
-              if hasattr(self,"lineEditVal"):self.lineEditVal.setText(valeur)
+                self.editor.afficheInfos("pb d encoding", Qt.red)
+                validite,commentaire=self.politique.recordValeur(None)
+                self.lineEditVal.setText('')
+                self.setValide()
+                self.inSaisieValeur=False
+                return
+        else :
+            try :
+                # la 1 ligne est tres bizarre. remplacee par le 3nd le 01 10 19
+                #if hasattr(self,"lineEditVal"):self.lineEditVal.setText(tr(valeur.nom))
+                if hasattr(self,"lineEditVal") : self.lineEditVal.setText(tr(valeur))
+            except :
+                if hasattr(self,"lineEditVal"):self.lineEditVal.setText(valeur)
             nouvelleValeur=valeur
 
-         if self.node.item.definition.validators != None :
+        if self.node.item.definition.validators != None :
             if self.node.item.definition.validators.verifItem(nouvelleValeur) !=1 :
                 commentaire=self.node.item.definition.validators.infoErreurItem()
                 self.editor.afficheInfos(commentaire,Qt.red)
                 self.inSaisieValeur=False
                 return
 
-         nouvelleValeurFormat=self.politique.getValeurTexte(nouvelleValeur)
-         validite,commentaire=self.politique.recordValeur(nouvelleValeurFormat)
-         if commentaire != "" :
+        nouvelleValeurFormat=self.politique.getValeurTexte(nouvelleValeur)
+        validite,commentaire=self.politique.recordValeur(nouvelleValeurFormat)
+        if commentaire != "" :
             if validite :
                 self.editor.afficheCommentaire(commentaire)
             else :
                 self.editor.afficheInfos(commentaire,Qt.red)
-         self.inSaisieValeur=False
-         self.setValide()
+        self.inSaisieValeur=False
+        self.setValide()
 
 
 
-  def TraiteLEValeur(self,valeurTraitee=None) :
+    def TraiteLEValeur(self,valeurTraitee=None) :
         # lit la chaine entree dans le line edit
         # et la tranforme en chaine de valeurs
         # a traiter. renvoie eventuellement des complexes
         listeValeurs=[]
         if valeurTraitee == None :
-           valeurBrute=str(self.LEValeur.text())
+            valeurBrute=str(self.LEValeur.text())
         else :
-           valeurBrute=valeurTraitee
+            valeurBrute=valeurTraitee
         if valeurBrute == str("") : return listeValeurs,1
 
         try :
-            valeur=eval(valeurBrute,{})        
+            valeur=eval(valeurBrute,{})
         except :
             valeur=valeurBrute
 
         # pour traiter 11.0 - 30.0 pour le CIST
         #if (valeurTraitee and (type(valeurTraitee) in types.StringTypes) and (self.node.item.waitTxm())) :
         if (valeurTraitee and  isinstance(valeurTraitee, str)  and (self.node.item.waitTxm())) :
-           valeur=str(valeurTraitee)
+            valeur=str(valeurTraitee)
 
 
         if type(valeur)  in (list,tuple) :
-           if self.node.item.waitComplex() :
-              indice = 0
-              while (indice < len(valeur)):
-                 v=valeur[indice]
-
-                 if (v== 'RI' or v == 'MP'):
-                    try :
-                       t=tuple([v,valeur[indice+1],valeur[indice+2]])
-                       listeValeurs.append(t)
-                       indice=indice+3
-                    except :
-                       commentaire = tr("Veuillez entrer le complexe sous forme aster ou sous forme python")
-                       self.editor.afficheInfos(commentaire)
-                       return listeValeurs,0
-                       
-
-                 else :     # ce n'est pas un tuple a la mode aster
-                    listeValeurs.append(v)
-                    indice = indice + 1
-
-           else:  # on n'attend pas un complexe
-             listeValeurs=valeurBrute.split(',')
+            if self.node.item.waitComplex() :
+                indice = 0
+                while (indice < len(valeur)):
+                    v=valeur[indice]
+
+                    if (v== 'RI' or v == 'MP'):
+                        try :
+                            t=tuple([v,valeur[indice+1],valeur[indice+2]])
+                            listeValeurs.append(t)
+                            indice=indice+3
+                        except :
+                            commentaire = tr("Veuillez entrer le complexe sous forme aster ou sous forme python")
+                            self.editor.afficheInfos(commentaire)
+                            return listeValeurs,0
+
+
+                    else :     # ce n'est pas un tuple a la mode aster
+                        listeValeurs.append(v)
+                        indice = indice + 1
+
+            else:  # on n'attend pas un complexe
+                listeValeurs=valeurBrute.split(',')
 
         elif type(valeur) == bytes:
-             listeValeurs=valeur.split(',')
+            listeValeurs=valeur.split(',')
         else:
-          #listeValeurs.append(valeurBrute)
-          listeValeurs.append(valeur)
+            #listeValeurs.append(valeurBrute)
+            listeValeurs.append(valeur)
 
         return listeValeurs,1
 
 class SaisieSDCO(object) :
 
-  def LESDCOReturnPressed(self):
+    def LESDCOReturnPressed(self):
         """
            Lit le nom donne par l'utilisateur au concept de type CO qui doit Ãªtre
            la valeur du MCS courant et stocke cette valeur
@@ -149,20 +149,19 @@ class SaisieSDCO(object) :
         self.editor.initModif()
         anc_val = self.node.item.getValeur()
         if anc_val != None:
-          # il faut egalement propager la destruction de l'ancien concept
-          self.node.item.deleteValeurCo(valeur=anc_val)
-          # et on force le recalcul des concepts de sortie de l'etape
-          self.node.item.object.etape.getType_produit(force=1)
-          # et le recalcul du contexte
-          self.node.item.object.etape.parent.resetContext()
+            # il faut egalement propager la destruction de l'ancien concept
+            self.node.item.deleteValeurCo(valeur=anc_val)
+            # et on force le recalcul des concepts de sortie de l'etape
+            self.node.item.object.etape.getType_produit(force=1)
+            # et le recalcul du contexte
+            self.node.item.object.etape.parent.resetContext()
         nomConcept = str(self.LESDCO.text())
         if nomConcept == "" : return
 
         test,commentaire=self.node.item.setValeurCo(nomConcept)
         if test:
-           commentaire=tr("Valeur du mot-clef enregistree")
-           self.node.updateNodeValid()
+            commentaire=tr("Valeur du mot-clef enregistree")
+            self.node.updateNodeValid()
         else :
-           cr = self.node.item.getCr()
-           commentaire = tr("Valeur du mot-clef non autorisee :")+cr.getMessFatal()
-                                                                                         
+            cr = self.node.item.getCr()
+            commentaire = tr("Valeur du mot-clef non autorisee :")+cr.getMessFatal()
index c4faa8fb060f6b3576887805e8170265edec8976..05d942d9c14b1e75779f87801c56b3a00fff0966 100644 (file)
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
-
 import os, sys
 
 # Modules Eficas
@@ -48,330 +47,373 @@ from Extensions.eficas_exception import EficasException
 class ReaderCataCommun(object):
 #-------------------------------
 
-   def askChoixCatalogue(self, cataListeChoix):
-   # ____________________________________________
-      """
-      Ouvre une fenetre de selection du catalogue dans le cas où plusieurs
-      ont ete definis dans Accas/editeur.ini
-      """
-      try : 
-         from PyQt5.QtWidgets import QDialog
-      except : 
-         print ('Pas de choix interactif sans qt')
-         return
-
-      code = getattr(self.appliEficas.maConfiguration, "code", None)
-      if code != None :
-          title=tr("Choix d une version du code ")+str(code)
-      else :
-          title=tr("Choix d une version ")
-
-      from InterfaceQT4.monChoixCata import MonChoixCata
-      widgetChoix = MonChoixCata(self.appliEficas, [cata.labelCode for cata in cataListeChoix], title)
-      ret=widgetChoix.exec_()
-
-
-      lab=str(self.VERSION_EFICAS)+" "
-      lab+=tr(" pour ")
-      lab+=str(self.code)
-      lab+=tr(" avec le catalogue ")
-      if ret == QDialog.Accepted:
-          cata = cataListeChoix[widgetChoix.CBChoixCata.currentIndex()]
-          self.fichierCata = cata.fichierCata
-          self.labelCode   = cata.labelCode
-          self.appliEficas.formatFichierOut = cata.formatFichierOut
-          self.appliEficas.formatFichierIn  = cata.formatFichierIn
-          lab+=self.labelCode
-          self.appliEficas.setWindowTitle(lab)
-          widgetChoix.close()
-      else:
-          widgetChoix.close()
-          raise EficasException()
-
-   def choisitCata(self):
-   # ____________________
-
-      listeCataPossibles=[]
-      self.Commandes_Ordre_Catalogue=[]
-
-
-      listeTousLesCatas = []
-      for catalogue in self.appliEficas.maConfiguration.catalogues:
-          if isinstance(catalogue, CatalogDescription): listeTousLesCatas.append(catalogue)
-          elif isinstance(catalogue, tuple)           : listeTousLesCatas.append(CatalogDescription.createFromTuple(catalogue))
-          else: print(("Catalog description cannot be interpreted: ", catalogue))
-
-      # This filter is only useful for codes that have subcodes (like MAP).
-      # Otherwise, the "code" attribute of the catalog description can (should) be None.
-      if self.ssCode is None: listeCataPossibles = listeTousLesCatas
-      else:
-          for catalogue in listeTousLesCatas:
-             if catalogue.code == self.code and catalogue.ssCode == self.ssCode: listeCataPossibles.append(catalogue)
-
-      # le catalogue est fixe dans la ligne de commande
-      if self.appliEficas.fichierCata != None : 
-         trouve=False
-         for catalogue in listeTousLesCatas: 
-             if os.path.abspath(catalogue.fichierCata) ==  (os.path.abspath(self.appliEficas.fichierCata)) :
-                listeCataPossibles=(catalogue,)
-                trouve=True
-                break
-         if not trouve:
+    def askChoixCatalogue(self, cataListeChoix):
+    # ____________________________________________
+        """
+        Ouvre une fenetre de selection du catalogue dans le cas où plusieurs
+        ont ete definis dans Accas/editeur.ini
+        """
+        try :
+            from PyQt5.QtWidgets import QDialog
+        except :
+            print ('Pas de choix interactif sans qt')
+            return
+
+        code = getattr(self.appliEficas.maConfiguration, "code", None)
+        if code != None :
+            title=tr("Choix d une version du code ")+str(code)
+        else :
+            title=tr("Choix d une version ")
+
+        from InterfaceQT4.monChoixCata import MonChoixCata
+        widgetChoix = MonChoixCata(self.appliEficas, [cata.labelCode for cata in cataListeChoix], title)
+        ret=widgetChoix.exec_()
+
+
+        lab=str(self.VERSION_EFICAS)+" "
+        lab+=tr(" pour ")
+        lab+=str(self.code)
+        lab+=tr(" avec le catalogue ")
+        if ret == QDialog.Accepted:
+            cata = cataListeChoix[widgetChoix.CBChoixCata.currentIndex()]
+            self.fichierCata = cata.fichierCata
+            self.labelCode   = cata.labelCode
+            self.appliEficas.formatFichierOut = cata.formatFichierOut
+            self.appliEficas.formatFichierIn  = cata.formatFichierIn
+            lab+=self.labelCode
+            self.appliEficas.setWindowTitle(lab)
+            widgetChoix.close()
+        else:
+            widgetChoix.close()
+            raise EficasException()
+
+    def choisitCata(self):
+    # ____________________
+
+
+        listeCataPossibles=[]
+        self.Commandes_Ordre_Catalogue=[]
+
+
+        listeTousLesCatas = []
+        for catalogue in self.appliEficas.maConfiguration.catalogues:
+            if isinstance(catalogue, CatalogDescription): listeTousLesCatas.append(catalogue)
+            elif isinstance(catalogue, tuple)           : listeTousLesCatas.append(CatalogDescription.createFromTuple(catalogue))
+            else: print(("Catalog description cannot be interpreted: ", catalogue))
+
+        if self.labelCode is  None: listeCataPossibles = listeTousLesCatas
+        else :
+            for catalogue in listeTousLesCatas:
+                if catalogue.code == self.code and catalogue.ssCode == self.ssCode:
+                    listeCataPossibles.append(catalogue)
+
+        if len(listeCataPossibles)==0:
+            try :
+                QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
+                                tr("Pas de catalogue defini pour le code ") + self.code)
+            except :
+                print("Pas de catalogue defini pour le code " + self.code)
+            if self.appliEficas.salome == 0 : sys.exit(1)
+            self.appliEficas.close()
+            return
+
+        if self.labelCode is not None:
+            # La version a ete fixee
+            for cata in listeCataPossibles:
+                if self.labelCode == cata.labelCode:
+                    self.fichierCata = cata.fichierCata
+                    self.labelCode   = cata.labelCode
+                    self.appliEficas.formatFichierOut = cata.formatFichierOut
+                    self.appliEficas.formatFichierIn  = cata.formatFichierIn
+        else:
+            cataChoiceList = []
+            for cata in listeCataPossibles:
+                if cata.selectable:
+                    if cata.default : cataChoiceList.insert(0, cata)
+                    else            : cataChoiceList.append(cata)
+
+        # le catalogue est fixe dans la ligne de commande
+        if self.appliEficas.fichierCata != None :
+            trouve=False
+            for catalogue in listeTousLesCatas:
+                if os.path.abspath(catalogue.fichierCata) ==  (os.path.abspath(self.appliEficas.fichierCata)) :
+                    listeCataPossibles=(catalogue,)
+                    trouve=True
+                    break
+            if not trouve:
                 catalogue=CatalogDescription.createFromTuple((self.code ,self.code,self.appliEficas.fichierCata,'python','python'))
                 listeCataPossibles=(catalogue,)
-             
-
-      if len(listeCataPossibles)==0:
-          try : 
-             from PyQt5.QtWidgets import QMessageBox, QDialog
-             QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
-                               tr("Pas de catalogue defini pour le code ") + self.code)
-          except : 
-             print ("Pas de catalogue defini pour le code " + self.code)
-          self.appliEficas.close()
-          if self.appliEficas.salome == 0 : sys.exit(1)
-          return
-
-
-      # le label est fixe dans la ligne de commande
-      if self.labelCode is not None:
-          # La version a ete fixee
-          for cata in listeCataPossibles:
-             if self.labelCode == cata.labelCode:
-                self.fichierCata = cata.fichierCata
-                self.appliEficas.formatFichierIn  = cata.formatFichierIn
-                self.appliEficas.formatFichierOut = cata.formatFichierOut
-      else:
-          cataListeChoix = []
-          for cata in listeCataPossibles:
-              if cata.default : cataListeChoix.insert(0, cata)
-              else            : cataListeChoix.append(cata)
-
-          if len(cataListeChoix) == 0:
-              try : 
-                from PyQt5.QtWidgets import QMessageBox
+
+
+        if len(listeCataPossibles)==0:
+            try :
+                from PyQt5.QtWidgets import QMessageBox, QDialog
                 QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
-                                   tr("Aucun catalogue trouve"))
-              except :
+                                  tr("Pas de catalogue defini pour le code ") + self.code)
+            except :
                 print ("Pas de catalogue defini pour le code " + self.code)
-              self.appliEficas.close()
-              if self.appliEficas.salome == 0 : sys.exit(1)
-
-          elif len(cataListeChoix) == 1:
-              self.fichierCata = cataListeChoix[0].fichierCata
-              self.labelCode   = cataListeChoix[0].labelCode
-              self.appliEficas.formatFichierOut = cataListeChoix[0].formatFichierOut
-              self.appliEficas.formatFichierIn  = cataListeChoix[0].formatFichierIn
-
-          else:
-              # plusieurs catalogues sont disponibles : il faut demander a l'utilisateur
-              # lequel il veut utiliser ...
-              if self.appliEficas.ssIhm : 
-                 print ('Unable to know which catafile is choosen')
-                 exit()
-              self.askChoixCatalogue(cataListeChoix)
-              self.demandeCatalogue=True
-
-      if self.fichierCata == None :
-          if self.appliEficas.salome == 0 :
-             print(("Pas de catalogue pour code %s, version %s" %(self.code,self.labelCode)))
-             sys.exit(1)
-          else :
-             self.appliEficas.close()
-             return
+            self.appliEficas.close()
+            if self.appliEficas.salome == 0 : sys.exit(1)
+            return
+
+
+        # le label est fixe dans la ligne de commande
+        if self.labelCode is not None:
+            # La version a ete fixee
+            for cata in listeCataPossibles:
+                if self.labelCode == cata.labelCode:
+                    self.fichierCata = cata.fichierCata
+                    self.appliEficas.formatFichierIn  = cata.formatFichierIn
+                    self.appliEficas.formatFichierOut = cata.formatFichierOut
+        else:
+            cataListeChoix = []
+            for cata in listeCataPossibles:
+                if cata.default : cataListeChoix.insert(0, cata)
+                else            : cataListeChoix.append(cata)
+
+            if len(cataListeChoix) == 0:
+                try :
+                    from PyQt5.QtWidgets import QMessageBox
+                    QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
+                                       tr("Aucun catalogue trouve"))
+                except :
+                    print ("Pas de catalogue defini pour le code " + self.code)
+                self.appliEficas.close()
+                if self.appliEficas.salome == 0 : sys.exit(1)
+
+            elif len(cataListeChoix) == 1:
+                self.fichierCata = cataListeChoix[0].fichierCata
+                self.labelCode   = cataListeChoix[0].labelCode
+                self.appliEficas.formatFichierOut = cataListeChoix[0].formatFichierOut
+                self.appliEficas.formatFichierIn  = cataListeChoix[0].formatFichierIn
+
+            else:
+                # plusieurs catalogues sont disponibles : il faut demander a l'utilisateur
+                # lequel il veut utiliser ...
+                if self.appliEficas.ssIhm :
+                    print ('Unable to know which catafile is choosen')
+                    exit()
+                self.askChoixCatalogue(cataListeChoix)
+                self.demandeCatalogue=True
+
+        if self.fichierCata == None :
+            if self.appliEficas.salome == 0 :
+                print(("Pas de catalogue pour code %s, version %s" %(self.code,self.labelCode)))
+                sys.exit(1)
+            else :
+                self.appliEficas.close()
+                return
 
 
 #------------------------------------
 class ReaderCata (ReaderCataCommun):
 #------------------------------------
 
-   def __init__(self,QWParent, appliEficas):
-   # _______________________________________
-
-     
-      self.QWParent=QWParent
-      self.appliEficas=self.QWParent.appliEficas
-      self.VERSION_EFICAS=self.appliEficas.VERSION_EFICAS
-      self.demandeCatalogue=False
-      self.code=self.appliEficas.code
-      self.ssCode=self.appliEficas.ssCode
-      # on positionne par defaut mais est-ce vraiment necessaire
-      self.appliEficas.formatFichierIn='python'
-      self.appliEficas.formatFichierOut='python'
-      self.labelCode=self.appliEficas.labelCode
-      self.fichierCata=self.appliEficas.fichierCata
-      self.openCata()
-      self.traiteIcones()
-      self.cataitem=None
-      self.creeDicoInverse()
-      if self.code=="TELEMAC": self.creeDicoCasToCata()
-
-
-   def openCata(self):
-      """
-          Ouvre le catalogue standard du code courant, cad le catalogue present
-          dans le repertoire Cata
-      """
-      # import du catalogue
-      self.choisitCata()
-
-      modeleMetier = None
-      if not (self.appliEficas.genereXSD) :
-         if (self.appliEficas.maConfiguration.withXSD or self.appliEficas.withXSD)  :
-           try :
-             import pyxb
-           except :
-             self.QWParent.informe('environnement', 'please source pyxb environment')
-             exit()
-           try : 
-             nomCataXsd = os.path.splitext(os.path.basename(self.fichierCata))[0]
-             fichierCataTrunc=os.path.splitext(os.path.basename(self.fichierCata))[0]  
-             nomCataXsd = fichierCataTrunc+'_driver' 
-             pathCata = os.path.dirname(self.fichierCata)+'/raw/'+nomCataXsd+'.py'
-             import imp
-             modeleMetier= imp.load_source(nomCataXsd,pathCata)
-           except :
-             if self.appliEficas.ssIhm == False :print ('______________ poum import cata_genere ')
-             self.QWParent.informe('XSD driver', 'unable to load xsd driver',critique=False)
-             modeleMetier = None
-
-      self.cata = self.importCata(self.fichierCata)
-      if hasattr(self.cata, 'implement'): self.cata.JdC.implement = self.cata.implement
-      else : self.cata.JdC.implement = ""
-      if hasattr(self.cata, 'importedBy'): self.cata.JdC.importedBy = self.cata.importedBy
-      else : self.cata.JdC.importedBy = [] 
-      self.cata.JdC.labelCode = self.labelCode 
-      if not(hasattr(self.cata, 'dict_condition')): self.cata.dict_condition = {}
-      
-      # pointeur pour le dumpXSD
-      self.cata.JdC.cata=self.cata
-      
-      self.cata.modeleMetier = modeleMetier
-      if not self.cata :
-          #try:
-            #from PyQt5.QtWidgets import QMessageBox, QDialog
-            #QMessageBox.critical( self.QWParent, tr("Import du catalogue"),tr("Impossible d'importer le catalogue ")+ self.fichierCata)
-          #except : 
-          #  print ("Impossible d'importer le catalogue "+ self.fichierCata)
-          self.QWParent.informe("Catalogue","Impossible d'importer le catalogue "+ self.fichierCata)
-          self.appliEficas.close()
-          if self.appliEficas.salome == 0 :
-             sys.exit(1)
-      #
-      # analyse du catalogue (ordre des mots-cles)
-      #
-      # retrouveOrdreCataStandard fait une analyse textuelle du catalogue
-      # remplace par retrouveOrdreCataStandardAutre qui utilise une numerotation
-      # des mots cles a la creation
-      #print (dir(self.cata))
-      self.retrouveOrdreCataStandardAutre()
-      if self.appliEficas.maConfiguration.modeNouvCommande == "initial" : self.retrouveOrdreCataStandard()
-      if hasattr(self.cata, 'Ordre_Des_Commandes') : self.Ordre_Des_Commandes=self.cata.Ordre_Des_Commandes
-      else : self.Ordre_Des_Commandes=None
-
-      if hasattr(self.cata, 'Classement_Commandes_Ds_Arbre') :
-             self.Classement_Commandes_Ds_Arbre=self.cata.Classement_Commandes_Ds_Arbre
-      else : self.Classement_Commandes_Ds_Arbre=()
-      if hasattr(self.cata,'enum'):
-         try :
-           _temp= __import__(self.cata.enum,globals(), locals(), ['DicoEnumCasFrToEnumCasEn', 'TelemacdicoEn'], 0)
-           self.DicoEnumCasFrToEnumCasEn = _temp.DicoEnumCasFrToEnumCasEn
-           self.TelemacdicoEn = _temp.TelemacdicoEn
-         except : pass
-
-      #print self.cata.Ordre_Des_Commandes
-
-      #
-      # analyse des donnees liees l'IHM : UIinfo
-      #
-      uiinfo.traite_UIinfo(self.cata)
-
-      #
-      # traitement des clefs documentaires
-      #
-
-      self.titre=self.VERSION_EFICAS+" "+tr( " avec le catalogue ") + os.path.basename(self.fichierCata)
-      if self.appliEficas.ssIhm == False : self.appliEficas.setWindowTitle(self.titre)
-      self.appliEficas.titre=self.titre
-      self.QWParent.titre=self.titre
-
-
-   def importCata(self,cata):
-      """
-          Realise l'import du catalogue dont le chemin d'acces est donne par cata
-      """
-      nom_cata = os.path.splitext(os.path.basename(cata))[0]
-      rep_cata = os.path.dirname(cata)
-      sys.path[:0] = [rep_cata]
-      self.appliEficas.listeAEnlever.append(rep_cata)
-
-      # PNPNPN pas propre __ A reflechir
-      if 'cata_Vimmp' in list(sys.modules.keys()) :
-          del sys.modules['cata_Vimmp']
-
-      if nom_cata in list(sys.modules.keys()) :
-        del sys.modules[nom_cata]
-
-      for k in sys.modules:
-        if k[0:len(nom_cata)+1] == nom_cata+'.':
-          del sys.modules[k]
-
-      mesScriptsNomFichier='mesScripts_'+self.code.upper()
-      try :
-          self.appliEficas.mesScripts[self.code]=__import__(mesScriptsNomFichier)
-      except:
-          pass
-
-      #if 1 :
-      try :
-          o=__import__(nom_cata)
-          return o
-      except Exception as e:
-          self.QWParent.informe('catalog', 'unable to load catalog file')
-          import traceback
-          traceback.print_exc()
-          return 0
-
-
-
-   def retrouveOrdreCataStandardAutre(self):
-      """
-          Construit une structure de donnees dans le catalogue qui permet
-          a EFICAS de retrouver l'ordre des mots-cles dans le texte du catalogue.
-          Pour chaque entite du catlogue on cree une liste de nom ordre_mc qui
-          contient le nom des mots cles dans le bon ordre
-      """
-      self.cata_ordonne_dico, self.appliEficas.liste_simp_reel=autre_analyse_cata.analyseCatalogue(self.cata)
-      #print ('_________________________________________', self)
-      #print (self.cata_ordonne_dico)
-      #self.appliEficas.liste_simp_reel = ()
-      #self.cata_ordonne_dico = {}
-
-   def retrouveOrdreCataStandard(self):
-      """
-          Retrouve l'ordre des mots-cles dans le catalogue, cad :
-          Attention s appuie sur les commentaires
-      """
-      nom_cata = os.path.splitext(os.path.basename(self.fichierCata))[0]
-      rep_cata = os.path.dirname(self.fichierCata)
-      self.Commandes_Ordre_Catalogue = analyse_catalogue_initial.analyseCatalogue(self.fichierCata)
-      #print self.Commandes_Ordre_Catalogue
-
-   def traiteIcones(self):
-      if self.appliEficas.maConfiguration.ficIcones==None : return
-      try:
-        ficIcones=self.appliEficas.maConfiguration.ficIcones
-        fichierIcones = __import__(ficIcones, globals(), locals(), [], 0)
-        self.appliEficas.maConfiguration.dicoIcones=fichierIcones.dicoDesIcones.dicoIcones
-        self.appliEficas.maConfiguration.dicoImages=fichierIcones.dicoDesIcones.dicoImages
-      except:
-        print ("Pas de fichier associe contenant des liens sur les icones ")
-        self.appliEficas.maConfiguration.dicoIcones={}
-
-
-
-   def creeDicoInverse(self):
+    def __init__(self,QWParent, appliEficas):
+    # _______________________________________
+
+
+        self.QWParent=QWParent
+        self.appliEficas=self.QWParent.appliEficas
+        self.VERSION_EFICAS=self.appliEficas.VERSION_EFICAS
+        self.demandeCatalogue=False
+        self.code=self.appliEficas.code
+        self.ssCode=self.appliEficas.ssCode
+        # on positionne par defaut mais est-ce vraiment necessaire
+        self.appliEficas.formatFichierIn='python'
+        self.appliEficas.formatFichierOut='python'
+        self.labelCode=self.appliEficas.labelCode
+        self.fichierCata=self.appliEficas.fichierCata
+        self.openCata()
+        self.traiteIcones()
+        self.cataitem=None
+        self.creeDicoInverse()
+        if self.code=="TELEMAC": self.creeDicoCasToCata()
+
+
+    def openCata(self):
+        """
+            Ouvre le catalogue standard du code courant, cad le catalogue present
+            dans le repertoire Cata
+        """
+        # import du catalogue
+        if self.fichierCata == None : self.choisitCata()
+
+        self.cata = self.importCata(self.fichierCata)
+        if self.code == 'NonConnu' : self.code = self.cata.JdC.code
+        modeleMetier = None
+        dicoEltDif = {}
+        if not (self.appliEficas.genereXSD) :
+            if (self.appliEficas.maConfiguration.withXSD or self.appliEficas.withXSD)  :
+                try :
+                    import pyxb
+                except :
+                    self.QWParent.informe('environnement', 'please source pyxb environment')
+                    exit()
+                try :
+                    nomCataXsd = os.path.splitext(os.path.basename(self.fichierCata))[0]
+                    fichierCataTrunc=os.path.splitext(os.path.basename(self.fichierCata))[0]
+                    nomCataXsd = fichierCataTrunc+'_driver'
+                    pathCata = os.path.dirname(self.fichierCata)+'/raw/'+nomCataXsd+'.py'
+                    import imp
+                    modeleMetier= imp.load_source(nomCataXsd,pathCata)
+                    #print ('nomCataXsd , pathCata ',nomCataXsd,pathCata)
+                    try :
+                    #if 1 :
+                        #monObjetAnnotation = getattr(modeleMetier,'PNEFdico_'+self.code)
+                        monObjetAnnotation = getattr(modeleMetier,'PNEFdico')
+                        texte=monObjetAnnotation.__doc__
+                    except :
+                        texte=None
+                    if texte != None and texte != "":
+                        l={}
+                        texte='dicoEltDif = '+ texte
+                        exec (texte, globals(),l)
+                        dicoEltDif=l['dicoEltDif']
+                    #print ('dans readerCata _________', dicoEltDif)
+
+                except :
+                    if self.appliEficas.ssIhm == False :print ('______________ poum import cata_genere ')
+                    self.QWParent.informe('XSD driver', 'unable to load xsd driver',critique=False)
+                    modeleMetier = None
+
+        self.cata.DicoNomTypeDifferentNomElt=dicoEltDif
+
+        if hasattr(self.cata, 'implement'): self.cata.JdC.implement = self.cata.implement
+        else : self.cata.JdC.implement = ""
+        if hasattr(self.cata, 'importedBy'): self.cata.JdC.importedBy = self.cata.importedBy
+        else : self.cata.JdC.importedBy = []
+        self.cata.JdC.labelCode = self.labelCode
+        if not(hasattr(self.cata, 'dict_condition')): self.cata.dict_condition = {}
+
+        # pointeur pour le dumpXSD
+        self.cata.JdC.cata=self.cata
+
+        self.cata.modeleMetier = modeleMetier
+        if not self.cata :
+            #try:
+              #from PyQt5.QtWidgets import QMessageBox, QDialog
+              #QMessageBox.critical( self.QWParent, tr("Import du catalogue"),tr("Impossible d'importer le catalogue ")+ self.fichierCata)
+            #except :
+            #  print ("Impossible d'importer le catalogue "+ self.fichierCata)
+            self.QWParent.informe("Catalogue","Impossible d'importer le catalogue "+ self.fichierCata)
+            self.appliEficas.close()
+            if self.appliEficas.salome == 0 :
+                sys.exit(1)
+        #
+        # analyse du catalogue (ordre des mots-cles)
+        #
+        # retrouveOrdreCataStandard fait une analyse textuelle du catalogue
+        # remplace par retrouveOrdreCataStandardAutre qui utilise une numerotation
+        # des mots cles a la creation
+        #print (dir(self.cata))
+        self.retrouveOrdreCataStandardAutre()
+        if self.appliEficas.maConfiguration.modeNouvCommande == "initial" : self.retrouveOrdreCataStandard()
+        if hasattr(self.cata, 'Ordre_Des_Commandes') : self.Ordre_Des_Commandes=self.cata.Ordre_Des_Commandes
+        else : self.Ordre_Des_Commandes=None
+
+        if hasattr(self.cata, 'Classement_Commandes_Ds_Arbre') :
+            self.Classement_Commandes_Ds_Arbre=self.cata.Classement_Commandes_Ds_Arbre
+        else : self.Classement_Commandes_Ds_Arbre=()
+        if hasattr(self.cata,'enum'):
+            try :
+                _temp= __import__(self.cata.enum,globals(), locals(), ['DicoEnumCasFrToEnumCasEn', 'TelemacdicoEn'], 0)
+                self.DicoEnumCasFrToEnumCasEn = _temp.DicoEnumCasFrToEnumCasEn
+                self.TelemacdicoEn = _temp.TelemacdicoEn
+            except : pass
+
+        #print self.cata.Ordre_Des_Commandes
+
+        #
+        # analyse des donnees liees l'IHM : UIinfo
+        #
+        uiinfo.traite_UIinfo(self.cata)
+
+        #
+        # traitement des clefs documentaires
+        #
+
+        self.titre=self.VERSION_EFICAS+" "+tr( " avec le catalogue ") + os.path.basename(self.fichierCata)
+        if self.appliEficas.ssIhm == False : self.appliEficas.setWindowTitle(self.titre)
+        self.appliEficas.titre=self.titre
+        self.QWParent.titre=self.titre
+
+
+    def importCata(self,cata):
+        """
+            Realise l'import du catalogue dont le chemin d'acces est donne par cata
+        """
+        nom_cata = os.path.splitext(os.path.basename(cata))[0]
+        rep_cata = os.path.dirname(cata)
+        sys.path[:0] = [rep_cata]
+        self.appliEficas.listeAEnlever.append(rep_cata)
+
+        # PNPNPN pas propre __ A reflechir
+        if 'cata_Vimmp' in list(sys.modules.keys()) :
+            del sys.modules['cata_Vimmp']
+
+        if nom_cata in list(sys.modules.keys()) :
+            del sys.modules[nom_cata]
+
+        for k in sys.modules:
+            if k[0:len(nom_cata)+1] == nom_cata+'.':
+                del sys.modules[k]
+
+        mesScriptsNomFichier='mesScripts_'+self.code.upper()
+        try :
+            self.appliEficas.mesScripts[self.code]=__import__(mesScriptsNomFichier)
+        except:
+            pass
+
+        #if 1 :
+        try :
+            o=__import__(nom_cata)
+            return o
+        except Exception as e:
+            self.QWParent.informe('catalog', 'unable to load catalog file')
+            import traceback
+            traceback.print_exc()
+            return 0
+
+
+
+    def retrouveOrdreCataStandardAutre(self):
+        """
+            Construit une structure de donnees dans le catalogue qui permet
+            a EFICAS de retrouver l'ordre des mots-cles dans le texte du catalogue.
+            Pour chaque entite du catlogue on cree une liste de nom ordre_mc qui
+            contient le nom des mots cles dans le bon ordre
+        """
+        self.cata_ordonne_dico, self.appliEficas.liste_simp_reel=autre_analyse_cata.analyseCatalogue(self.cata)
+        #print ('_________________________________________', self)
+        #print (self.cata_ordonne_dico)
+        #self.appliEficas.liste_simp_reel = ()
+        #self.cata_ordonne_dico = {}
+
+    def retrouveOrdreCataStandard(self):
+        """
+            Retrouve l'ordre des mots-cles dans le catalogue, cad :
+            Attention s appuie sur les commentaires
+        """
+        nom_cata = os.path.splitext(os.path.basename(self.fichierCata))[0]
+        rep_cata = os.path.dirname(self.fichierCata)
+        self.Commandes_Ordre_Catalogue = analyse_catalogue_initial.analyseCatalogue(self.fichierCata)
+        #print self.Commandes_Ordre_Catalogue
+
+    def traiteIcones(self):
+        if self.appliEficas.maConfiguration.ficIcones==None : return
+        try:
+            ficIcones=self.appliEficas.maConfiguration.ficIcones
+            fichierIcones = __import__(ficIcones, globals(), locals(), [], 0)
+            self.appliEficas.maConfiguration.dicoIcones=fichierIcones.dicoDesIcones.dicoIcones
+            self.appliEficas.maConfiguration.dicoImages=fichierIcones.dicoDesIcones.dicoImages
+        except:
+            print ("Pas de fichier associe contenant des liens sur les icones ")
+            self.appliEficas.maConfiguration.dicoIcones={}
+
+
+
+    def creeDicoInverse(self):
         self.dicoInverse={}
         self.dicoMC={}
         listeEtapes=self.cata.JdC.commandes
@@ -379,48 +421,47 @@ class ReaderCata (ReaderCataCommun):
             self.traiteEntite(e)
 
 
-   def creeDicoCasToCata(self):
-      if hasattr(self.cata,'dicoCasEn'):
-        _temp= __import__(self.cata.dicoCasEn,globals(), locals(), ['DicoCasEnToCata'], 0)
-        if self.appliEficas.langue=="ang" :
-           self.dicoCasToCata=_temp.dicoCasEnToCata
-        else :
-           self.dicoCasToCata=_temp.dicoCasFrToCata
+    def creeDicoCasToCata(self):
+        if hasattr(self.cata,'dicoCasEn'):
+            _temp= __import__(self.cata.dicoCasEn,globals(), locals(), ['DicoCasEnToCata'], 0)
+            if self.appliEficas.langue=="ang" :
+                self.dicoCasToCata=_temp.dicoCasEnToCata
+            else :
+                self.dicoCasToCata=_temp.dicoCasFrToCata
 
 
 
-   def traiteEntite(self,e):
-       boolIn=0
-       for (nomFils, fils) in list(e.entites.items()) :
-          self.dicoMC[nomFils]=fils
-          self.traiteEntite(fils)
-          boolIn=1
-       if boolIn==0 :
-          liste=[]
-          moi=e
-          while hasattr(moi,'pere') :
+    def traiteEntite(self,e):
+        boolIn=0
+        for (nomFils, fils) in list(e.entites.items()) :
+            self.dicoMC[nomFils]=fils
+            self.traiteEntite(fils)
+            boolIn=1
+        if boolIn==0 :
+            liste=[]
+            moi=e
+            while hasattr(moi,'pere') :
                 liste.append((moi.nom,moi))
                 moi=moi.pere
-          liste.append((moi.nom,moi))
-          self.dicoInverse[e.nom]=liste
-          self.dicoInverse[tr(e.nom)]=liste
-
-   def creeRubrique(self,e,dico, niveau):
-       from Accas import A_BLOC
-       decale=niveau*"   "
-       #if niveau != 0 :
-       #    if isinstance(e,A_BLOC.BLOC): print decale, e.condition
-       #    else :                           print decale, e. nom
-       for (nom, fils) in list(e.entites.items()) :
-           if  list(fils.entites.items()) != [] : self.creeRubrique(fils,dico,niveau+1)
-           #else : print (niveau+1)*"   ", nom
-
-
-   def dumpToXsdEficas(self):
-       # Pas sur qu on ait jamais besoin de cela
-       pass
-       #from Efi2Xsd import readerEfficas
-       #newSchema=   xml = open('Cata_MED_FAM.xml').read()
-       #SchemaMed = efficas.CreateFromDocument(xml)
-       #SchemaMed.alimenteCata(self.cata)
-
+            liste.append((moi.nom,moi))
+            self.dicoInverse[e.nom]=liste
+            self.dicoInverse[tr(e.nom)]=liste
+
+    def creeRubrique(self,e,dico, niveau):
+        from Accas import A_BLOC
+        decale=niveau*"   "
+        #if niveau != 0 :
+        #    if isinstance(e,A_BLOC.BLOC): print decale, e.condition
+        #    else :                           print decale, e. nom
+        for (nom, fils) in list(e.entites.items()) :
+            if  list(fils.entites.items()) != [] : self.creeRubrique(fils,dico,niveau+1)
+            #else : print (niveau+1)*"   ", nom
+
+
+    #def dumpToXsdEficas(self):
+        # Pas sur qu on ait jamais besoin de cela
+    #    pass
+        #from Efi2Xsd import readerEfficas
+        #newSchema=   xml = open('Cata_MED_FAM.xml').read()
+        #SchemaMed = efficas.CreateFromDocument(xml)
+        #SchemaMed.alimenteCata(self.cata)
index a3ab5c34f5da08e74757a1231899f69d1f79c17a..c8baede10b052c7755d1bcdb009f39ebe2d58d7e 100644 (file)
@@ -40,45 +40,45 @@ from readercata import ReaderCataCommun
 
 class ReaderCata (ReaderCataCommun):
 
-   def __init__(self,QWParent, appliEficas):
-      self.QWParent=QWParent
-      self.appliEficas=appliEficas
-      self.VERSION_EFICAS=self.appliEficas.VERSION_EFICAS
-      self.code=self.appliEficas.code
-      self.ssCode=self.appliEficas.ssCode
-      # PN ?? bizarre le 22/04/20
-      self.appliEficas.formatfichierOut='python'
-      self.appliEficas.formatfichierIn ='xml'
-      self.modeNouvCommande=self.appliEficas.maConfiguration.modeNouvCommande
-      self.labelCode=self.appliEficas.labelCode
-      self.version_cata=None
-      self.ficCata=None
-      self.OpenCata()
-      self.cataitem=None
-      self.titre='Eficas XML'
-      self.Ordre_Des_Commandes=None
-      self.Classement_Commandes_Ds_Arbre=()
-      self.demandeCatalogue=False
+    def __init__(self,QWParent, appliEficas):
+        self.QWParent=QWParent
+        self.appliEficas=appliEficas
+        self.VERSION_EFICAS=self.appliEficas.VERSION_EFICAS
+        self.code=self.appliEficas.code
+        self.ssCode=self.appliEficas.ssCode
+        # PN ?? bizarre le 22/04/20
+        self.appliEficas.formatfichierOut='python'
+        self.appliEficas.formatfichierIn ='xml'
+        self.modeNouvCommande=self.appliEficas.maConfiguration.modeNouvCommande
+        self.labelCode=self.appliEficas.labelCode
+        self.version_cata=None
+        self.ficCata=None
+        self.OpenCata()
+        self.cataitem=None
+        self.titre='Eficas XML'
+        self.Ordre_Des_Commandes=None
+        self.Classement_Commandes_Ds_Arbre=()
+        self.demandeCatalogue=False
 
-      #self.traiteIcones()
-      #self.creeDicoInverse()
+        #self.traiteIcones()
+        #self.creeDicoInverse()
 
 
-   def OpenCata(self):
+    def OpenCata(self):
 
-      #self.ficCata = 'Cata_MED_FAM.xml'
-      #xml = open('/home/A96028/QT5GitEficasTravail/eficas/Med/Cata_MED_FAM.xml').read()
-      #xml = open('/home/A96028/QT5GitEficasTravail/eficas/CataTestXSD/cata_test1.xml').read()
-      self.choisitCata()
-      xml=open(self.ficCata).read()
-      SchemaMed = readerEfiXsd.efficas.CreateFromDocument(xml)
-      SchemaMed.exploreCata() 
-      self.cata=SchemaMed
-      uiinfo.traite_UIinfo(self.cata)
-      self.Commandes_Ordre_Catalogue=[]
-      self.cata_ordonne_dico,self.appliEficas.liste_simp_reel=autre_analyse_cata.analyseCatalogue(self.cata)
-      self.liste_groupes=None
+        #self.ficCata = 'Cata_MED_FAM.xml'
+        #xml = open('/home/A96028/QT5GitEficasTravail/eficas/Med/Cata_MED_FAM.xml').read()
+        #xml = open('/home/A96028/QT5GitEficasTravail/eficas/CataTestXSD/cata_test1.xml').read()
+        self.choisitCata()
+        xml=open(self.ficCata).read()
+        SchemaMed = readerEfiXsd.efficas.CreateFromDocument(xml)
+        SchemaMed.exploreCata()
+        self.cata=SchemaMed
+        uiinfo.traite_UIinfo(self.cata)
+        self.Commandes_Ordre_Catalogue=[]
+        self.cata_ordonne_dico,self.appliEficas.liste_simp_reel=autre_analyse_cata.analyseCatalogue(self.cata)
+        self.liste_groupes=None
 
-   def dumpToXml(self):
-      # pour compatibilite
-       pass
+    def dumpToXml(self):
+        # pour compatibilite
+        pass
index 1d0cbafc6acdb3c0271d8aa134b8db8dd415ed8c..c16c8a296d3015b4928b2f23623f5cda11898b05 100644 (file)
 #
 #    permet de lancer  EFICAS en n affichant rien
 try :
-   from builtins import object
+    from builtins import object
 except : pass
 
 class appliEficasSSIhm(object):
-   def __init__ (self,code):
-       self.VERSION_EFICAS="Sans Ihm"
-       self.code=code
-       self.ssCode=None
-       self.salome=None
-       self.top=None
-       self.indice=0
-       self.dict_reels={}
-       self.listeAEnlever=[]
+    def __init__ (self,code):
+        self.VERSION_EFICAS="Sans Ihm"
+        self.code=code
+        self.ssCode=None
+        self.salome=None
+        self.top=None
+        self.indice=0
+        self.dict_reels={}
+        self.listeAEnlever=[]
+
 
+        name='prefs_'+self.code
+        try :
+            prefsCode=__import__(name)
+        except :
+            name='prefs_'+self.code.upper()
+            self.code=self.code.upper()
+            prefsCode=__import__(name)
 
-       name='prefs_'+self.code
-       try :
-         prefsCode=__import__(name)
-       except :
-         name='prefs_'+self.code.upper()
-         self.code=self.code.upper()
-         prefsCode=__import__(name)
-       
 
-       self.repIni=prefsCode.repIni
-       self.format_fichier="python" #par defaut
+        self.repIni=prefsCode.repIni
+        self.format_fichier="python" #par defaut
+
+        nameConf='configuration_'+self.code
+        configuration=__import__(nameConf)
+        self.CONFIGURATION = configuration.make_config(self,prefsCode.repIni)
 
-       nameConf='configuration_'+self.code
-       configuration=__import__(nameConf)
-       self.CONFIGURATION = configuration.make_config(self,prefsCode.repIni)
-        
 class QWParentSSIhm(object):
-   def __init__(self,code,version_code):
+    def __init__(self,code,version_code):
         self.ihm="QT"
         self.code=code
         self.version_code=version_code
         self.format_fichier="python" #par defaut
-
index 9068a0aa1a7d1bf8ddb0b423034723cf2a3a0c48..2e3e2de37d11ce06f9d8796a24fcd945e0044080 100644 (file)
@@ -19,7 +19,7 @@
 #
 from __future__ import absolute_import
 try :
-   from builtins import object
+    from builtins import object
 except : pass
 
 from PyQt5.QtWidgets import QAction, QMenu, QMessageBox
@@ -61,16 +61,16 @@ class PopUpMenuNodeMinimal(object) :
         self.menu.addAction(self.Supprime)
         if hasattr(self.appliEficas, 'mesScripts'):
             if self.editor.code in  self.editor.appliEficas.mesScripts :
-               self.dict_commandes_mesScripts=self.appliEficas.mesScripts[self.editor.code].dict_commandes
-               if self.tree.currentItem().item.getNom() in self.dict_commandes_mesScripts : 
-                   self.ajoutScript()
-    
+                self.dict_commandes_mesScripts=self.appliEficas.mesScripts[self.editor.code].dict_commandes
+                if self.tree.currentItem().item.getNom() in self.dict_commandes_mesScripts :
+                    self.ajoutScript()
+
     def ajoutScript(self):
     # cochon mais je n arrive pas a faire mieux avec le mecanisme de plugin
     # a revoir avec un menu et un connect sur le triggered sur le menu ?
         if hasattr(self.appliEficas, 'mesScripts'):
             if self.editor.code in  self.editor.appliEficas.mesScripts :
-               self.dict_commandes_mesScripts=self.appliEficas.mesScripts[self.editor.code].dict_commandes
+                self.dict_commandes_mesScripts=self.appliEficas.mesScripts[self.editor.code].dict_commandes
             else : return
 
         from Extensions import jdc_include
@@ -80,18 +80,18 @@ class PopUpMenuNodeMinimal(object) :
         if type(listeCommandes) != tuple: listeCommandes=(listeCommandes,)
         numero=0
         for commande in listeCommandes :
-           conditionSalome=commande[3]
-           if (self.appliEficas.salome == 0 and conditionSalome == True): return
-           label=commande[1]
-           tip=commande[5]
-           self.action=QAction(label,self.tree)
-           self.action.setStatusTip(tip)
-           if numero==4: self.action.triggered.connect(self.appelleFonction4)
-           if numero==3: self.action.triggered.connect(self.appelleFonction3); numero=4
-           if numero==2: self.action.triggered.connect(self.appelleFonction2); numero=3
-           if numero==1: self.action.triggered.connect(self.appelleFonction1); numero=2
-           if numero==0: self.action.triggered.connect(self.appelleFonction0); numero=1
-           self.menu.addAction(self.action)
+            conditionSalome=commande[3]
+            if (self.appliEficas.salome == 0 and conditionSalome == True): return
+            label=commande[1]
+            tip=commande[5]
+            self.action=QAction(label,self.tree)
+            self.action.setStatusTip(tip)
+            if numero==4: self.action.triggered.connect(self.appelleFonction4)
+            if numero==3: self.action.triggered.connect(self.appelleFonction3); numero=4
+            if numero==2: self.action.triggered.connect(self.appelleFonction2); numero=3
+            if numero==1: self.action.triggered.connect(self.appelleFonction1); numero=2
+            if numero==0: self.action.triggered.connect(self.appelleFonction0); numero=1
+            self.menu.addAction(self.action)
 
 
     def appelleFonction0(self):
@@ -114,7 +114,7 @@ class PopUpMenuNodeMinimal(object) :
         nomCmd=nodeTraite.item.getNom()
         if hasattr(self.appliEficas, 'mesScripts'):
             if self.editor.code in  self.editor.appliEficas.mesScripts :
-               self.dict_commandes_mesScripts=self.appliEficas.mesScripts[self.editor.code].dict_commandes
+                self.dict_commandes_mesScripts=self.appliEficas.mesScripts[self.editor.code].dict_commandes
             else : return
         listeCommandes=self.dict_commandes_mesScripts[nomCmd]
         commande=listeCommandes[numero]
@@ -122,28 +122,28 @@ class PopUpMenuNodeMinimal(object) :
 
 
         if (nodeTraite.item.isValid() == 0 and conditionValid == True):
-                 QMessageBox.warning( None, 
-                             tr("item invalide"),
-                             tr("l item doit etre valide"),)
-                 return
+            QMessageBox.warning( None,
+                        tr("item invalide"),
+                        tr("l item doit etre valide"),)
+            return
         fonction=commande[0]
         listenomparam=commande[2]
         listeparam=[]
         for p in listenomparam:
             if hasattr(nodeTraite,p):
-               listeparam.append(getattr(nodeTraite,p))
+                listeparam.append(getattr(nodeTraite,p))
             if p=="self" : listeparam.append(self)
-           
+
         try :
-           res, commentaire= fonction(listeparam)
-           if not res :
-                 QMessageBox.warning( None, 
-                             tr("echec de la fonction"),
-                             tr(commentaire),)
-                 return
+            res, commentaire= fonction(listeparam)
+            if not res :
+                QMessageBox.warning( None,
+                            tr("echec de la fonction"),
+                            tr(commentaire),)
+                return
         except :
-           pass
-        
+            pass
+
 
 
 
@@ -184,25 +184,25 @@ class PopUpMenuNodeMinimal(object) :
         try :
             f=open(commande,"rb")
         except :
-             texte=tr("impossible de trouver la commande  ") + commande
-             QMessageBox.information( self.editor, tr("Lecteur PDF"), texte)
-             return
+            texte=tr("impossible de trouver la commande  ") + commande
+            QMessageBox.information( self.editor, tr("Lecteur PDF"), texte)
+            return
         import os
         if cle_doc.startswith('http:'):
-           fichier = cle_doc
+            fichier = cle_doc
         else :
             fichier = os.path.abspath(os.path.join(self.editor.maConfiguration.path_doc,
                                        cle_doc))
             try :
-               f=open(fichier,"rb")
+                f=open(fichier,"rb")
             except :
-               texte=tr("impossible d'ouvrir ") + fichier
-               QMessageBox.information( self.editor, tr("Documentation Vide"), texte)
-               return
+                texte=tr("impossible d'ouvrir ") + fichier
+                QMessageBox.information( self.editor, tr("Documentation Vide"), texte)
+                return
+
 
-       
         if os.name == 'nt':
-           os.spawnv(os.P_NOWAIT,commande,(commande,fichier,))
+            os.spawnv(os.P_NOWAIT,commande,(commande,fichier,))
         elif os.name == 'posix':
             script ="#!/usr/bin/sh \n%s %s&" %(commande,fichier)
             pid = os.system(script)
@@ -237,7 +237,7 @@ class PopUpMenuNodePartiel (PopUpMenuNodeMinimal):
         self.commentMenu.addAction(self.CommApres)
         self.commentMenu.addAction(self.CommAvant)
         #ss-menu Parameters:
-        self.paramMenu =self.menu.addMenu(tr('Parametre')) 
+        self.paramMenu =self.menu.addMenu(tr('Parametre'))
         self.paramMenu.addAction(self.ParamApres)
         self.paramMenu.addAction(self.ParamAvant)
         self.menu.addAction(self.Documentation)
index f415a757734097194001d306af9c47faffd52472..fffd16d868e12f397e5268056f465a38598a1cb5 100644 (file)
@@ -20,8 +20,8 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 
 import os
@@ -32,263 +32,265 @@ from  PyQt5.QtCore     import QFileInfo
 DictExtensions= {"MAP" : ".map"}
 class MyViewManager(object):
 
-   def __init__(self,appliEficas):
-       self.appliEficas=appliEficas
-       self.tabWidgets = []
-       self.mesIndexes = {}
-       self.appliEficas=appliEficas
-       self.editors = []
-       self.dict_editors={}
-       self.untitledCount = 0
-       self.doubles = {}
-
-       self.myQtab = self.appliEficas.myQtab
-
-       self.myQtab.currentChanged.connect(self.indexChanged)
-       self.myQtab.tabCloseRequested.connect(self.closeTab)
-        
-   def indexChanged(self):
-       index=self.myQtab.currentIndex()
-       if index in self.dict_editors:
-           editor=self.dict_editors[index]
-           self.appliEficas.maConfiguration=editor.maConfiguration
-           self.appliEficas.code=editor.maConfiguration.code
-           self.appliEficas.setWindowTitle(editor.titre)
-           self.appliEficas.construitMenu()
-
-   def handleOpen(self,fichier=None,patron=0,units=None):
-       result = None
-       if fichier is None:
-            if self.appliEficas.demande==True : 
-               self.appliEficas.definitCode(None,None)
-               if self.appliEficas.code == None:return
-            
+    def __init__(self,appliEficas):
+        self.appliEficas=appliEficas
+        self.tabWidgets = []
+        self.mesIndexes = {}
+        self.appliEficas=appliEficas
+        self.editors = []
+        self.dictEditors={}
+        self.untitledCount = 0
+        self.doubles = {}
+
+        self.myQtab = self.appliEficas.myQtab
+
+        self.myQtab.currentChanged.connect(self.indexChanged)
+        self.myQtab.tabCloseRequested.connect(self.closeTab)
+
+    def indexChanged(self):
+        index=self.myQtab.currentIndex()
+        if index in self.dictEditors:
+            editor=self.dictEditors[index]
+            if editor.jdc !=None :
+                CONTEXT.unsetCurrentJdC()
+                CONTEXT.setCurrentJdC(editor.jdc)
+            self.appliEficas.maConfiguration=editor.maConfiguration
+            self.appliEficas.code=editor.maConfiguration.code
+            self.appliEficas.setWindowTitle(editor.titre)
+            self.appliEficas.construitMenu()
+
+    def handleOpen(self,fichier=None,patron=0,units=None):
+        result = None
+        if fichier is None:
+            if self.appliEficas.demande==True :
+                self.appliEficas.definitCode(None,None)
+                if self.appliEficas.code == None:return
+
             if self.appliEficas.code in DictExtensions:
-               chaine="JDC (*"+DictExtensions[self.appliEficas.code]+");;"
-               extensions=tr(chaine+ "All Files (*)")
+                chaine="JDC (*"+DictExtensions[self.appliEficas.code]+");;"
+                extensions=tr(chaine+ "All Files (*)")
             elif self.appliEficas.code== "TELEMAC" : extensions=tr('CAS (*.cas);;All Files (*)')
             else :
-               extensions=tr('Fichiers JDC (*.comm);;''Tous les Fichiers (*)')
+                extensions=tr('Fichiers JDC (*.comm);;''Tous les Fichiers (*)')
 
             fichier = QFileDialog.getOpenFileName(self.appliEficas,
                         tr('Ouvrir Fichier'),
                         self.appliEficas.maConfiguration.savedir,
-                         extensions)
+                        extensions)
             fichier=fichier[0]
-       if len(fichier) == 0: return None
-       fichier = os.path.abspath(fichier)
-       ulfile = os.path.abspath(fichier)
-       self.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
-       self.appliEficas.addToRecentList(fichier)
-       maPage=self.getEditor( fichier,units=units)
-       if maPage: result = maPage
-       if maPage : self.myQtab.setTabText(self.myQtab.indexOf(maPage),os.path.basename(fichier))
-       return result
-
-   def closeTab(self,indexAFermer):
-       self.handleClose(indexAFermer = indexAFermer)
-
-   def handleClose(self,doitSauverRecent = 1,texte=tr('&Quitter'),indexAFermer=None):
-       if doitSauverRecent : self.appliEficas.sauveRecents()
-       if indexAFermer == None :index=self.myQtab.currentIndex()
-       else : index = indexAFermer
-       if index < 0 : return
-       res=self.checkDirty(self.dict_editors[index],texte)
-       if res == 2 : return 2             # l utilisateur a annule
-       idx=index
-       while idx < len(self.dict_editors) -1 :
-             self.dict_editors[idx]=self.dict_editors[idx+1]
-             idx = idx + 1
-       del self.dict_editors[len (self.dict_editors) -1]
-       try :
-           del self.doubles[self.dict_editors[index]]
-       except :
-           pass
-       self.myQtab.removeTab(index)
-       return res
-       
-
-   def run(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.run()
-
-   def saveRun(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.saveRun()
-
-   def handleCloseAll(self,texte=tr('Quitter')):
-       res=0
-       self.appliEficas.sauveRecents()
-       while len(self.dict_editors) > 0 :
-             self.myQtab.setCurrentIndex(0)
-             res=self.handleClose(0,texte)
-             if res==2 : return res   # l utilsateur a annule
-       return res
-        
-   def handleRechercher(self):
-       #print "passage dans handleRechercher"
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.handleRechercher()
-
-   def handleRechercherDsCatalogue(self):
-       #print "passage dans handleRechercher"
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.handleRechercherDsCatalogue()
-
-   def handleDeplier(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.handleDeplier()
-   
-   def handleEditCopy(self):
-       #print "passage dans handleEditCopy"
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.handleEditCopy()
-
-   def handleEditCut(self):
-       #print "passage dans handleEditCut"
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.handleEditCut()
-
-   def handleEditPaste(self):
-       #print "passage dans handleEditPaste"
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.handleEditPaste()
-
-   def handleSupprimer(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.handleSupprimer()
-
-   def handleAjoutEtape(self,nomEtape):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.handleAjoutEtape(nomEtape)
-
-
-   def newEditor(self,include=0):
-       if self.appliEficas.demande==True : 
-           self.appliEficas.definitCode(None,None)
-           if self.appliEficas.code == None:return
-       maPage=self.getEditor(include=include)
-
-   def newIncludeEditor(self):
-       self.newEditor(include=1)
-
-   def handleViewJdcFichierSource(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       self.dict_editors[index].viewJdcSource()
-
-   def ouvreArbre(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       self.dict_editors[index].ouvreArbre()
-
-   def fermeArbre(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       self.dict_editors[index].fermeArbre()
-
-   def ajoutCommentaire(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.ajoutCommentaire()
-
-   def handleViewJdcRegles(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       self.dict_editors[index].viewJdcRegles()
-
-   def handleGestionParam(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : 
-          QMessageBox.warning( self.appliEficas,tr(u"Creation Parametre indisponible"),tr(u"les parametres sont lies a un jeu de donnees"))
-          return
-       self.dict_editors[index].gestionParam()
-
-   def handleViewJdcRapport(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       self.dict_editors[index].viewJdcRapport()
-
-   def handleViewJdcPy(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       self.dict_editors[index].viewJdcPy()
-
-   def saveCurrentEditor(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       if editor in self.doubles :
-           QMessageBox.warning(
-                     None,
-                     tr("Fichier Duplique"),
-                     tr("Le fichier ne sera pas sauvegarde."),)
-           return
-       ok, newName = editor.saveFile()
-       if ok :
-           fileName=os.path.basename(newName)
-           self.myQtab.setTabText(index,fileName)
-       return ok
-
-   def saveCompleteCurrentEditor(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       ok, newName = editor.saveCompleteFile()
-       return ok
-
-   def sauveLigneCurrentEditor(self):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       if editor in self.doubles :
-           QMessageBox.warning(
-                     None,
-                     tr("Fichier Duplique"),
-                     tr("Le fichier ne sera pas sauvegarde."),)
-           return
-       ok, newName = editor.sauveLigneFile()
-       if ok :
-           fileName=os.path.basename(newName)
-           self.myQtab.setTabText(index,fileName)
-       return ok
-
-
-   def saveAsCurrentEditor(self):
-       index=self.myQtab.currentIndex()
-       editor=self.dict_editors[index]
-       oldName=editor.fichier
-       ok,newName = editor.saveFileAs()
-       if ok :
-           fileName=os.path.basename(newName)
-           self.myQtab.setTabText(index,fileName)
-       if editor in self.doubles :
-          if oldName != newName :
-             del self.doubles[editor]
-       return ok
-
-   def displayJDC(self,jdc,fn=None):
+        if len(fichier) == 0: return None
+        fichier = os.path.abspath(fichier)
+        ulfile = os.path.abspath(fichier)
+        self.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
+        self.appliEficas.addToRecentList(fichier)
+        maPage = self.getEditor( fichier,units=units)
+        if maPage : result = maPage
+        if maPage : self.myQtab.setTabText(self.myQtab.indexOf(maPage),os.path.basename(fichier))
+        return result
+
+    def closeTab(self,indexAFermer):
+        self.handleClose(indexAFermer = indexAFermer)
+
+    def handleClose(self,doitSauverRecent = 1,texte=tr('&Quitter'),indexAFermer=None):
+        if doitSauverRecent : self.appliEficas.sauveRecents()
+        if indexAFermer == None : index=self.myQtab.currentIndex()
+        else : index = indexAFermer
+        if index < 0 : return
+        res=self.checkDirty(self.dictEditors[index],texte)
+        if res == 2 : return 2             # l utilisateur a annule
+        idx=index
+        while idx < len(self.dictEditors) -1 :
+            self.dictEditors[idx]=self.dictEditors[idx+1]
+            idx = idx + 1
+        del self.dictEditors[len (self.dictEditors) -1]
+        try :
+            del self.doubles[self.dictEditors[index]]
+        except :
+            pass
+        self.myQtab.removeTab(index)
+        return res
+
+
+    def run(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.run()
+
+    def saveRun(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.saveRun()
+
+    def handleCloseAll(self,texte=tr('Quitter')):
+        res=0
+        self.appliEficas.sauveRecents()
+        while len(self.dictEditors) > 0 :
+            self.myQtab.setCurrentIndex(0)
+            res=self.handleClose(0,texte)
+            if res==2 : return res   # l utilsateur a annule
+        return res
+
+    def handleRechercher(self):
+        #print "passage dans handleRechercher"
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.handleRechercher()
+
+    def handleRechercherDsCatalogue(self):
+        #print "passage dans handleRechercher"
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.handleRechercherDsCatalogue()
+
+    def handleDeplier(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.handleDeplier()
+
+    def handleEditCopy(self):
+        #print "passage dans handleEditCopy"
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.handleEditCopy()
+
+    def handleEditCut(self):
+        #print "passage dans handleEditCut"
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.handleEditCut()
+
+    def handleEditPaste(self):
+        #print "passage dans handleEditPaste"
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.handleEditPaste()
+
+    def handleSupprimer(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.handleSupprimer()
+
+    def handleAjoutEtape(self,nomEtape):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.handleAjoutEtape(nomEtape)
+
+
+    def newEditor(self,include=0):
+        if self.appliEficas.demande==True :
+            self.appliEficas.definitCode(None,None)
+            if self.appliEficas.code == None:return
+        maPage=self.getEditor(include=include)
+
+    def newIncludeEditor(self):
+        self.newEditor(include=1)
+
+    def handleViewJdcFichierSource(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        self.dictEditors[index].viewJdcSource()
+
+    def ouvreArbre(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        self.dictEditors[index].ouvreArbre()
+
+    def fermeArbre(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        self.dictEditors[index].fermeArbre()
+
+    def ajoutCommentaire(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.ajoutCommentaire()
+
+    def handleViewJdcRegles(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        self.dictEditors[index].viewJdcRegles()
+
+    def handleGestionParam(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 :
+            QMessageBox.warning( self.appliEficas,tr(u"Creation Parametre indisponible"),tr(u"les parametres sont lies a un jeu de donnees"))
+            return
+        self.dictEditors[index].gestionParam()
+
+    def handleViewJdcRapport(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        self.dictEditors[index].viewJdcRapport()
+
+    def handleViewJdcPy(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        self.dictEditors[index].viewJdcPy()
+
+    def saveCurrentEditor(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        if editor in self.doubles :
+            QMessageBox.warning(
+                      None,
+                      tr("Fichier Duplique"),
+                      tr("Le fichier ne sera pas sauvegarde."),)
+            return
+        ok, newName = editor.saveFile()
+        if ok :
+            fileName=os.path.basename(newName)
+            self.myQtab.setTabText(index,fileName)
+        return ok
+
+    def saveCompleteCurrentEditor(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        ok, newName = editor.saveCompleteFile()
+        return ok
+
+    def sauveLigneCurrentEditor(self):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        if editor in self.doubles :
+            QMessageBox.warning(
+                      None,
+                      tr("Fichier Duplique"),
+                      tr("Le fichier ne sera pas sauvegarde."),)
+            return
+        ok, newName = editor.sauveLigneFile()
+        if ok :
+            fileName=os.path.basename(newName)
+            self.myQtab.setTabText(index,fileName)
+        return ok
+
+    def saveAsCurrentEditor(self):
+        index=self.myQtab.currentIndex()
+        editor=self.dictEditors[index]
+        oldName=editor.fichier
+        ok,newName = editor.saveFileAs()
+        if ok :
+            fileName=os.path.basename(newName)
+            self.myQtab.setTabText(index,fileName)
+        if editor in self.doubles :
+            if oldName != newName :
+                del self.doubles[editor]
+        return ok
+
+    def displayJDC(self,jdc,fn=None):
         """
         Public slot to display a file in an editor.
         @param fn name of file to be opened
@@ -299,43 +301,43 @@ class MyViewManager(object):
         editor = self.getEditor(fichier= fn, jdc = jdc ,include=1)
         self.appliEficas.addToRecentList(editor.getFileName())
 
-   def getEditor(self,fichier = None,jdc = None, units = None,include=0):
-       newWin = 0
-       double = None
-       indexEditor=0
-       for indexEditor in self.dict_editors :
-           editor=self.dict_editors[indexEditor]
-           if self.samePath(fichier, editor.getFileName()):
-              msgBox = QMessageBox()
-              msgBox.setWindowTitle(tr("Fichier"))
-              msgBox.setText(tr("Le fichier <b>%s</b> est deja ouvert", str(fichier)))
-              msgBox.addButton(tr("&Duplication"),0)
-              msgBox.addButton(tr("&Abandonner"),1)
-              abort=msgBox.exec_()
-              if abort: break
-              double=editor
-       else :
+    def getEditor(self,fichier = None,jdc = None, units = None,include=0):
+        newWin = 0
+        double = None
+        indexEditor=0
+        for indexEditor in self.dictEditors :
+            editor=self.dictEditors[indexEditor]
+            if self.samePath(fichier, editor.getFileName()):
+                msgBox = QMessageBox()
+                msgBox.setWindowTitle(tr("Fichier"))
+                msgBox.setText(tr("Le fichier <b>%s</b> est deja ouvert", str(fichier)))
+                msgBox.addButton(tr("&Duplication"),0)
+                msgBox.addButton(tr("&Abandonner"),1)
+                abort=msgBox.exec_()
+                if abort: break
+                double=editor
+        else :
             from .editor import JDCEditor
             editor = JDCEditor(self.appliEficas,fichier, jdc, self.myQtab,units=units,include=include)
-            if double != None : 
-               self.doubles[editor]=double
+            if double != None :
+                self.doubles[editor]=double
             if editor.jdc: # le fichier est bien un jdc
                 self.editors.append(editor)
                 newWin = 1
             else:
                 editor.closeIt()
 
-       if newWin:
+        if newWin:
             self.addView(editor, fichier)
-       elif editor.jdc:
+        elif editor.jdc:
             self.myQtab.setCurrentIndex(indexEditor)
 
-       index=self.myQtab.currentIndex()
-       if index != -1 :
-          self.dict_editors[index]=editor
-       return editor
+        index=self.myQtab.currentIndex()
+        if index != -1 :
+            self.dictEditors[index]=editor
+        return editor
 
-   def addView(self, win, fichier=None):
+    def addView(self, win, fichier=None):
 #PNPNPNPN --> a affiner
         if fichier is None:
             self.untitledCount += 1
@@ -351,31 +353,31 @@ class MyViewManager(object):
         self.currentEditor=win
         win.setFocus()
 
-   def getOpenStartDir(self) :
-       #PN --> Les Preferences
+    def getOpenStartDir(self) :
+        #PN --> Les Preferences
         try :
             userDir=os.path.expanduser("~/Eficas_install/")
             return userDir
         except :
             return ""
 
-   def samePath(self,f1, f2):
-    """
-    compare two paths.
-    """
-    if f1 is None or f2 is None: return 0
-    if os.path.normcase(os.path.normpath(f1)) == os.path.normcase(os.path.normpath(f2)) : return 1
-    return 0
+    def samePath(self,f1, f2):
+        """
+        compare two paths.
+        """
+        if f1 is None or f2 is None: return 0
+        if os.path.normcase(os.path.normpath(f1)) == os.path.normcase(os.path.normpath(f2)) : return 1
+        return 0
 
 
-   def checkDirty(self, editor,texte):
+    def checkDirty(self, editor,texte):
         """
         Private method to check dirty status and open a message window.
-        
+
         @param editor editor window to check
         @return flag indicating successful reset of the dirty flag (boolean)
-        """        
-        res=1 
+        """
+        res=1
         if (editor.modified) and (editor in self.doubles) :
             msgBox = QMessageBox(None)
             msgBox.setWindowTitle(tr("Fichier Duplique"))
@@ -405,27 +407,26 @@ class MyViewManager(object):
                 return ok
         return res
 
-   def handleAjoutGroup(self,listeGroup):
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       editor.handleAjoutGroup(listeGroup)
-  
-   def handleFonctionUtilisateur(self,laFonctionUtilisateur, lesArguments):
-       # Peut-etre a blinder un peu plus sur le nb d argument
-       index=self.myQtab.currentIndex()
-       if index < 0 : return
-       editor=self.dict_editors[index]
-       if editor.getEtapeCourante() == None :
-          QMessageBox.information( self.appliEficas,
-                      tr("Selectionner une etape"),
-                      tr("Le texte ne peut pas etre insere dans un fichier vide,\nCreer un materiau vide ou une zone vide et inserer le catalogue apres"))
-          return
-
-       listeParam = [] 
-       for p in lesArguments:
-          if hasattr(editor,p): listeParam.append(getattr(editor,p))
-          if p=="editor"      : listeParam.append(editor)
-          if p=="etapeCourante" : listeParam.append(editor.getEtapeCourante())
-       laFonctionUtilisateur(*listeParam)
-
+    def handleAjoutGroup(self,listeGroup):
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        editor.handleAjoutGroup(listeGroup)
+
+    def handleFonctionUtilisateur(self,laFonctionUtilisateur, lesArguments):
+        # Peut-etre a blinder un peu plus sur le nb d argument
+        index=self.myQtab.currentIndex()
+        if index < 0 : return
+        editor=self.dictEditors[index]
+        if editor.getEtapeCourante() == None :
+            QMessageBox.information( self.appliEficas,
+                        tr("Selectionner une etape"),
+                        tr("Le texte ne peut pas etre insere dans un fichier vide,\nCreer un materiau vide ou une zone vide et inserer le catalogue apres"))
+            return
+
+        listeParam = []
+        for p in lesArguments:
+            if hasattr(editor,p): listeParam.append(getattr(editor,p))
+            if p=="editor"      : listeParam.append(editor)
+            if p=="etapeCourante" : listeParam.append(editor.getEtapeCourante())
+        laFonctionUtilisateur(*listeParam)
index 916ccdfaf9b766ef0f413c2f461b15ef70f36c99..6a2572019a62e4fa75773d9d9a6e04c71f826ebb 100644 (file)
 
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 
 import os
 from Extensions.i18n import tr
-import six
-from  PyQt5.QtWidgets  import QFileDialog, QMessageBox
-from  PyQt5.QtCore     import QFileInfo
 
 # --------------------------------
 class JdcSsIhmHandler(object):
 # --------------------------------
 # retourne a l utilisateur
 
-   def __init__(self,viewManager):
+    def __init__(self,viewManager):
 #  --------------------------------------
-       self.viewManagerSsIhm=viewManager
+        self.viewManagerSsIhm=viewManager
 
-   def viewJdcPy(self) :
+    def viewJdcPy(self) :
 #  ---------------------
-       self.viewManagerSsIhm.handleViewJdcPy(self)
+        self.viewManagerSsIhm.handleViewJdcPy(self)
 
-   def viewJdcSource(self) :
+    def viewJdcSource(self) :
 #  ---------------------
-       self.viewManagerSsIhm.handleViewJdcSource(self)
+        self.viewManagerSsIhm.handleViewJdcSource(self)
 
-   def getFileName(self):
+    def getFileName(self):
 #  ---------------------
-       self.viewManagerSsIhm.getFileName(self)
+        self.viewManagerSsIhm.getFileName(self)
 
-   def viewJdcRapport(self) :
+    def viewJdcRapport(self) :
 #  ---------------------
-       self.viewManagerSsIhm.handleViewJdcRapport(self)
+        self.viewManagerSsIhm.handleViewJdcRapport(self)
 
-   def getJdcRapport(self) :
+    def getJdcRapport(self) :
 #  ---------------------
-       return self.viewManagerSsIhm.handleGetJdcRapport(self)
+        return self.viewManagerSsIhm.handleGetJdcRapport(self)
 
-   def getDicoPython(self) :
+    def getDicoPython(self) :
 #  -------------------------
-       return self.viewManagerSsIhm.generDico(self)
+        return self.viewManagerSsIhm.generDico(self)
 
-   def isJdcValid(self) :
+    def isJdcValid(self) :
 #  -------------------------
-       return self.viewManagerSsIhm.isJdcValid(self)
+        return self.viewManagerSsIhm.isJdcValid(self)
 
-   def fileSaveAs(self,fileName):
+    def fileSaveAs(self,fileName):
 #  -------------------------
-       return self.viewManagerSsIhm.fileSaveAs(self,fileName)
+        return self.viewManagerSsIhm.fileSaveAs(self,fileName)
 
-   def fileLegerSaveAs(self,fileName):
+    def fileLegerSaveAs(self,fileName):
 #  -----------------------------------
-       return self.viewManagerSsIhm.fileLegerSaveAs(self,fileName)
+        return self.viewManagerSsIhm.fileLegerSaveAs(self,fileName)
 
 
 
@@ -82,335 +79,161 @@ class MyViewManagerSsIhm(object):
 #--------------------------------
 # Symetrique de ViewManager mais pas d heritage entre les 2
 # dans le viewManager pas de souci pour savoir qui est le jdc sur lequel on travaille
-# ici en revanche.... c est moins sur
+# ici en revanche.... c est moins sur . voir avec le fichier
 
 #  --------------------------------
-   def __init__(self,appliEficas):
+    def __init__(self,appliEficas):
 #  --------------------------------
-       self.appliEficas=appliEficas
-       self.tabWidgets = []
-       self.mesIndexes = {}
-       self.dictEditors={}
-       self.untitledCount = 0
-       self.doubles = {}
+        self.appliEficas=appliEficas
+        self.tabWidgets = []
+        self.mesIndexes = {}
+        self.dictEditors={}
+        self.untitledCount = 0
+        self.doubles = {}
 
 #  ------------------------------------------------------
-   def handleOpen(self,fichier=None, units=None):
+    def handleOpen(self,fichier=None, units=None):
 #  ------------------------------------------------------
-       result = None
-       if fichier is None: 
-             print ('nom de fichier obligatoire')
-             return None
+        result = None
+        if fichier is None:
+            print ('nom de fichier obligatoire')
+            return None
 
-       for handler in self.dictEditors :
-           editor=self.dictEditors[handler]
-           if self.samePath(fichier, editor.getFileName()):
-              print ('fichier deja ouvert . pas de nouvel editor')
-              return handler
+        for handler in self.dictEditors :
+            editor=self.dictEditors[handler]
+            if self.samePath(fichier, editor.getFileName()):
+                print ('fichier deja ouvert . pas de nouvel editor')
+                return handler
 
-       monNewHandler = self.getNewEditor(fichier,units)
-       return monNewHandler
+        monNewHandler = self.getNewEditor(fichier,units)
+        return monNewHandler
 
 #  ----------------------------------------------------------------------
-   def getNewEditor(self,fichier = None,jdc = None, units = None,include=0):
+    def getNewEditor(self,fichier = None,jdc = None, units = None,include=0):
 #  ----------------------------------------------------------------------
-
-       from InterfaceQT4.editorSsIhm import JDCEditorSsIhm
-       editor = JDCEditorSsIhm(self.appliEficas,fichier,jdc, units=units,include=include)
-
-       if editor.jdc: # le fichier est bien un jdc
-          monHandler = JdcSsIhmHandler(self)
-          self.dictEditors[monHandler]=editor
-          return monHandler
-       else:
-          print ('impossible de construire le jdc') 
-          return None
+# il faudrait decider entre e handler ou non
+# le cas d usage n est pas tout a fait identique  :
+# avec handler pour les utilisateurs avance
+# sans pour les utilisateurs encore plus ancvances et les tests
+
+        from InterfaceQT4.editorSsIhm import JDCEditorSsIhm
+        editor = JDCEditorSsIhm(self.appliEficas,fichier,jdc, units=units,include=include)
+
+        if editor.jdc: # le fichier est bien un jdc
+            monHandler = JdcSsIhmHandler(self)
+            self.dictEditors[monHandler]=editor
+            return monHandler
+        else:
+            print ('impossible de construire le jdc')
+            return None
+
+#  --------------------------------------------------------------------------------
+    def getNewEditorNormal(self,fichier = None,jdc = None, units = None,include=0):
+#  --------------------------------------------------------------------------------
+
+        from InterfaceQT4.editorSsIhm import JDCEditorSsIhm
+        editor = JDCEditorSsIhm(self.appliEficas,fichier,jdc, units=units,include=include)
+        self.editor=editor
+        return editor
 
 #  -----------------------------
-   def samePath(self,f1, f2):
+    def samePath(self,f1, f2):
 #  ------------------------------
-    """
-    compare two paths.
-    """
-    if f1 is None or f2 is None: return 0
-    if os.path.normcase(os.path.normpath(f1)) == os.path.normcase(os.path.normpath(f2)) : return 1
-    return 0
+        """
+        compare two paths.
+        """
+        if f1 is None or f2 is None: return 0
+        if os.path.normcase(os.path.normpath(f1)) == os.path.normcase(os.path.normpath(f2)) : return 1
+        return 0
 
 #  ---------------------------------
-   def handleViewJdcPy(self,handler):
+    def handleViewJdcPy(self,handler):
 #  ---------------------------------
         if not (handler in self.dictEditors) :
-           print ('editor non trouve')
-           return
+            print ('editor non trouve')
+            return
         self.dictEditors[handler].viewJdcPy()
 
 #  ---------------------------------
-   def getFileName(self,handler):
+    def getFileName(self,handler):
 #  ---------------------------------
         if not (handler in self.dictEditors) :
-           print ('editor non trouve')
-           return
+            print ('editor non trouve')
+            return
         return self.dictEditors[handler].getFileName()
 
 
 #  ---------------------------------------------
-   def handleViewJdcSource(self,handler):
+    def handleViewJdcSource(self,handler):
 #  ---------------------------------------------
         print (handler)
         if not (handler in self.dictEditors) :
-           print ('editor non trouve')
-           return
+            print ('editor non trouve')
+            return
         self.dictEditors[handler].viewJdcSource()
 
 
 #  ---------------------------------------------
-   def handleViewJdcRapport(self,handler):
+    def handleViewJdcRapport(self,handler):
 #  ---------------------------------------------
         print (handler)
         if not (handler in self.dictEditors) :
-           print ('editor non trouve')
-           return
+            print ('editor non trouve')
+            return
         self.dictEditors[handler].viewJdcRapport()
 
 #  ---------------------------------------------
-   def handleGetJdcRapport(self,handler):
+    def handleGetJdcRapport(self,handler):
 #  ---------------------------------------------
         if not (handler in self.dictEditors) :
-           print ('editor non trouve')
-           return
+            print ('editor non trouve')
+            return
         return self.dictEditors[handler].getJdcRapport()
 
 #  ---------------------------------------------
-   def handleViewJdcRapport(self,handler):
+    def handleViewJdcRapport(self,handler):
 #  ---------------------------------------------
         print (handler)
         if not (handler in self.dictEditors) :
-           print ('editor non trouve')
-           return
+            print ('editor non trouve')
+            return
         self.dictEditors[handler].viewJdcRapport()
 
 
 #  ---------------------------------------------
-   def generDico(self,handler):
+    def generDico(self,handler):
 #  ---------------------------------------------
         print (handler)
         if not (handler in self.dictEditors) :
-           print ('editor non trouve')
-           return
+            print ('editor non trouve')
+            return
         return self.dictEditors[handler].generDico()
 
 
 #  ---------------------------------------------
-   def isJdcValid(self,handler):
+    def isJdcValid(self,handler):
 #  ---------------------------------------------
         print (handler)
         if not (handler in self.dictEditors) :
-           print ('editor non trouve')
-           return
+            print ('editor non trouve')
+            return
         return self.dictEditors[handler].jdc.isValid()
 
 
 #  ---------------------------------------------
-   def fileSaveAs(self,handler,fileName):
+    def fileSaveAs(self,handler,fileName):
 #  ---------------------------------------------
         print (handler)
         if not (handler in self.dictEditors) :
-           print ('editor non trouve')
-           return
+            print ('editor non trouve')
+            return
         return self.dictEditors[handler].saveFile(fileName)
 
 #  ---------------------------------------------
-   def fileLegerSaveAs(self, handler,fileName):
+    def fileLegerSaveAs(self, handler,fileName):
 #  ---------------------------------------------
 #        print (handler)
         if not (handler in self.dictEditors) :
-           print ('editor non trouve')
-           return
+            print ('editor non trouve')
+            return
         self.dictEditors[handler].saveFileLegerAs(fileName)
-
-
-#   def handleClose(self,doitSauverRecent = 1,texte=tr('&Quitter')):
-#       if doitSauverRecent : self.appliEficas.sauveRecents()
-#       index=self.myQtab.currentIndex()
-#       if index < 0 : return
-#       res=self.checkDirty(self.dict_editors[index],texte)
-#       if res == 2 : return 2             # l utilisateur a annule
-#       index=self.myQtab.currentIndex()
-#       idx=index
-#       while idx < len(self.dict_editors) -1 :
-#             self.dict_editors[idx]=self.dict_editors[idx+1]
-#             idx = idx + 1
-#       del self.dict_editors[len (self.dict_editors) -1]
-#       try :
-#           del self.doubles[self.dict_editors[index]]
-#       except :
-#           pass
-#       self.myQtab.removeTab(index)
-#       return res
-#       
-
-#
-#   def handleCloseAll(self,texte=tr('Quitter')):
-#       res=0
-#       self.appliEficas.sauveRecents()
-#       while len(self.dict_editors) > 0 :
-#             self.myQtab.setCurrentIndex(0)
-#             res=self.handleClose(0,texte)
-#             if res==2 : return res   # l utilsateur a annule
-#       return res
-#        
-#
-#
-#   def newEditor(self,include=0):
-#       if self.appliEficas.demande==True : 
-#           self.appliEficas.definitCode(None,None)
-#           if self.appliEficas.code == None:return
-#       maPage=self.getEditor(include=include)
-#
-
-#
-#   def handleViewJdcRegles(self):
-#       index=self.myQtab.currentIndex()
-#       if index < 0 : return
-#       self.dict_editors[index].viewJdcRegles()
-#
-#   def handleGestionParam(self):
-#       index=self.myQtab.currentIndex()
-#       if index < 0 : 
-#          QMessageBox.warning( self.appliEficas,tr(u"Creation Parametre indisponible"),tr(u"les parametres sont lies a un jeu de donnees"))
-#          return
-#       self.dict_editors[index].gestionParam()
-#
-#
-#
-#   def saveCurrentEditor(self):
-#       index=self.myQtab.currentIndex()
-#       if index < 0 : return
-#       editor=self.dict_editors[index]
-#       if editor in self.doubles :
-#           QMessageBox.warning(
-#                     None,
-#                     tr("Fichier Duplique"),
-#                     tr("Le fichier ne sera pas sauvegarde."),)
-#           return
-#       ok, newName = editor.saveFile()
-#       if ok :
-#           fileName=os.path.basename(six.text_type(newName))
-#           self.myQtab.setTabText(index,fileName)
-#       return ok
-#
-#   def saveLegerCurrentEditor(self):
-#       index=self.myQtab.currentIndex()
-#       if index < 0 : return
-#       editor=self.dict_editors[index]
-#       ok, newName = editor.saveFileLeger()
-#       return ok
-#
-#   def sauveLigneCurrentEditor(self):
-#       index=self.myQtab.currentIndex()
-#       if index < 0 : return
-#       editor=self.dict_editors[index]
-#       if editor in self.doubles :
-#           QMessageBox.warning(
-#                     None,
-#                     tr("Fichier Duplique"),
-#                     tr("Le fichier ne sera pas sauvegarde."),)
-#           return
-#       ok, newName = editor.sauveLigneFile()
-#       if ok :
-#           fileName=os.path.basename(six.text_type(newName))
-#           self.myQtab.setTabText(index,fileName)
-#       return ok
-#
-#
-#   def saveAsCurrentEditor(self):
-#       index=self.myQtab.currentIndex()
-#       editor=self.dict_editors[index]
-#       oldName=editor.fichier
-#       ok,newName = editor.saveFileAs()
-#       if ok :
-#           fileName=os.path.basename(six.text_type(newName))
-#           self.myQtab.setTabText(index,fileName)
-#       if editor in self.doubles :
-#          if oldName != newName :
-#             del self.doubles[editor]
-#       return ok
-#
-#   def displayJDC(self,jdc,fn=None):
-#        """
-#        Public slot to display a file in an editor.
-#        @param fn name of file to be opened
-#        # insert filename into list of recently opened files
-#        """
-#        titre=None
-#        if fn != None : titre=fn.split("/")[-1]
-#        editor = self.getEditor(fichier= fn, jdc = jdc ,include=1)
-#        self.appliEficas.addToRecentList(editor.getFileName())
-#
-
-##PNPNPNPN --> a affiner
-#        if fichier is None:
-#            self.untitledCount += 1
-#            self.myQtab.addTab(win, tr("Fichier non encore nomme ", self.untitledCount))
-#            #self.myQtab.addTab(win, str(self.appliEficas.code))
-#        else:
-#            liste=fichier.split('/')
-#            txt =  liste[-1]
-#            if not QFileInfo(fichier).isWritable():
-#                txt = '%s (ro)' % txt
-#            self.myQtab.addTab(win,txt )
-#        self.myQtab.setCurrentWidget(win)
-#        self.currentEditor=win
-#        win.setFocus()
-#
-#   def getOpenStartDir(self) :
-#       #PN --> Les Preferences
-#        try :
-#            userDir=os.path.expanduser("~/Eficas_install/")
-#            return userDir
-#        except :
-#            return ""
-#
-#
-#   def checkDirty(self, editor,texte):
-#        """
-#        Private method to check dirty status and open a message window.
-#        
-#        @param editor editor window to check
-#        @return flag indicating successful reset of the dirty flag (boolean)
-#        """        
-#        res=1 
-#        if (editor.modified) and (editor in self.doubles) :
-#            msgBox = QMessageBox(None)
-#            msgBox.setWindowTitle(tr("Fichier Duplique"))
-#            msgBox.setText(tr("Le fichier ne sera pas sauvegarde."))
-#            msgBox.addButton(texte,0)
-#            msgBox.addButton(tr("&Annuler"),1)
-#            res=msgBox.exec_()
-#            if res == 0 : return 1
-#            return 2
-#        if editor.modified:
-#            fn = editor.getFileName()
-#            if fn is None: fn = tr('Noname')
-#            msgBox = QMessageBox(None)
-#            msgBox.setWindowTitle(tr("Fichier Modifie"))
-#            msgBox.setText(tr("Le fichier ne sera pas sauvegarde."))
-#            msgBox.addButton(tr("&Sauvegarder"),1)
-#            msgBox.addButton(tr("&Quitter sans sauvegarder"),0)
-#            msgBox.addButton(tr("&Annuler"),2)
-#            res=msgBox.exec_()
-#            if res == 2 : return res
-#            if res == 0:
-#                (ok, newName) = editor.saveFile()
-#                if ok:
-#                    fileName=os.path.basename(six.text_type(newName))
-#                    index=self.myQtab.currentIndex()
-#                    self.myQtab.setTabText(index,fileName)
-#                return ok
-#        return res
-#
-#   def handleAjoutGroup(self,listeGroup):
-#       index=self.myQtab.currentIndex()
-#       if index < 0 : return
-#       editor=self.dict_editors[index]
-#       editor.handleAjoutGroup(listeGroup)
diff --git a/Med/Cata_MED_FAM.xml b/Med/Cata_MED_FAM.xml
deleted file mode 100755 (executable)
index 75acb49..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<cata xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://chercheurs.edf.com/logiciels/efficas file:///Z:/home_fayolle/MED_SVN/PASCALE/XSD/Model%20Efficas%20(1.1)%20%20v5.xsd">\r
-<commandes>\r
-<PROC xmlns:efficas="http://chercheurs.edf.com/logiciels/efficas" efficas:nom="FAS">\r
-  <efficas:FACT efficas:nom="FAMILY_MESH_NAME_REF" efficas:statut="o" efficas:min_occurs="1" efficas:max_occurs="-1">\r
-               <SIMP efficas:nom="NAME" efficas:statut="o"><typeAttendu>TXM</typeAttendu></SIMP>\r
-               <efficas:FACT efficas:nom="ELEM" efficas:statut="f"  efficas:min_occurs="1" efficas:max_occurs="-1">\r
-<!--                <efficas:regles>\r
-                       --><!-- Ajouter des contraintes de vérification de la présence ATT et GRO --><!--\r
-                               <efficas:PRESENT_PRESENT>ATT GRO</efficas:PRESENT_PRESENT>\r
-                    </efficas:regles>-->\r
-                       <efficas:SIMP efficas:nom="NUM" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
-                       <efficas:SIMP efficas:nom="NAME" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
-                       <efficas:FACT efficas:nom="ATT" efficas:statut="f"  efficas:max_occurs="1">\r
-                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
-                               <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
-                               <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
-                               <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
-                       </efficas:FACT>\r
-                       <efficas:FACT efficas:nom="GRO" efficas:statut="f" efficas:max_occurs="1">\r
-                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
-                           <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
-                       </efficas:FACT>\r
-               </efficas:FACT>\r
-       </efficas:FACT>\r
-</PROC>\r
-</commandes>\r
-</cata>\r
diff --git a/Med/Cata_MED_FAM.xml.mini b/Med/Cata_MED_FAM.xml.mini
deleted file mode 100755 (executable)
index 75acb49..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<cata xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://chercheurs.edf.com/logiciels/efficas file:///Z:/home_fayolle/MED_SVN/PASCALE/XSD/Model%20Efficas%20(1.1)%20%20v5.xsd">\r
-<commandes>\r
-<PROC xmlns:efficas="http://chercheurs.edf.com/logiciels/efficas" efficas:nom="FAS">\r
-  <efficas:FACT efficas:nom="FAMILY_MESH_NAME_REF" efficas:statut="o" efficas:min_occurs="1" efficas:max_occurs="-1">\r
-               <SIMP efficas:nom="NAME" efficas:statut="o"><typeAttendu>TXM</typeAttendu></SIMP>\r
-               <efficas:FACT efficas:nom="ELEM" efficas:statut="f"  efficas:min_occurs="1" efficas:max_occurs="-1">\r
-<!--                <efficas:regles>\r
-                       --><!-- Ajouter des contraintes de vérification de la présence ATT et GRO --><!--\r
-                               <efficas:PRESENT_PRESENT>ATT GRO</efficas:PRESENT_PRESENT>\r
-                    </efficas:regles>-->\r
-                       <efficas:SIMP efficas:nom="NUM" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
-                       <efficas:SIMP efficas:nom="NAME" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
-                       <efficas:FACT efficas:nom="ATT" efficas:statut="f"  efficas:max_occurs="1">\r
-                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
-                               <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
-                               <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
-                               <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
-                       </efficas:FACT>\r
-                       <efficas:FACT efficas:nom="GRO" efficas:statut="f" efficas:max_occurs="1">\r
-                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
-                           <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
-                       </efficas:FACT>\r
-               </efficas:FACT>\r
-       </efficas:FACT>\r
-</PROC>\r
-</commandes>\r
-</cata>\r
diff --git a/Med/Cata_MED_FAM.xml.origin b/Med/Cata_MED_FAM.xml.origin
deleted file mode 100755 (executable)
index 75acb49..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<cata xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://chercheurs.edf.com/logiciels/efficas file:///Z:/home_fayolle/MED_SVN/PASCALE/XSD/Model%20Efficas%20(1.1)%20%20v5.xsd">\r
-<commandes>\r
-<PROC xmlns:efficas="http://chercheurs.edf.com/logiciels/efficas" efficas:nom="FAS">\r
-  <efficas:FACT efficas:nom="FAMILY_MESH_NAME_REF" efficas:statut="o" efficas:min_occurs="1" efficas:max_occurs="-1">\r
-               <SIMP efficas:nom="NAME" efficas:statut="o"><typeAttendu>TXM</typeAttendu></SIMP>\r
-               <efficas:FACT efficas:nom="ELEM" efficas:statut="f"  efficas:min_occurs="1" efficas:max_occurs="-1">\r
-<!--                <efficas:regles>\r
-                       --><!-- Ajouter des contraintes de vérification de la présence ATT et GRO --><!--\r
-                               <efficas:PRESENT_PRESENT>ATT GRO</efficas:PRESENT_PRESENT>\r
-                    </efficas:regles>-->\r
-                       <efficas:SIMP efficas:nom="NUM" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
-                       <efficas:SIMP efficas:nom="NAME" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
-                       <efficas:FACT efficas:nom="ATT" efficas:statut="f"  efficas:max_occurs="1">\r
-                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
-                               <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
-                               <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
-                               <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
-                       </efficas:FACT>\r
-                       <efficas:FACT efficas:nom="GRO" efficas:statut="f" efficas:max_occurs="1">\r
-                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
-                           <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
-                       </efficas:FACT>\r
-               </efficas:FACT>\r
-       </efficas:FACT>\r
-</PROC>\r
-</commandes>\r
-</cata>\r
diff --git a/Med/README.txt b/Med/README.txt
deleted file mode 100644 (file)
index a167a89..0000000
+++ /dev/null
@@ -1 +0,0 @@
-pyxbgen -u model.xsd -m efficas --write-for-customization
diff --git a/Med/aide1 b/Med/aide1
deleted file mode 100644 (file)
index 96187ef..0000000
--- a/Med/aide1
+++ /dev/null
@@ -1,256 +0,0 @@
-Factory 
-
-OPER 
-
-PROC 
-
-_Abstract 
-
-_AddElement 
-
-_AlternativeConstructor 
-
-_AttributeMap 
-
-_AttributeWildcard 
-
-_Automaton 
-
-_CT_ELEMENT_ONLY 
-
-_CT_EMPTY 
-
-_CT_MIXED 
-
-_CT_SIMPLE 
-
-_CompatibleValue 
-
-_ContentTypeTag 
-
-_DynamicCreate 
-
-_DynamicCreate_mixin__AlternativeConstructorAttribute 
-
-_DynamicCreate_mixin__SupersedingClassAttribute 
-
-_ElementBindingDeclForName 
-
-_ElementMap 
-
-_ExpandedName 
-
-_GetValidationConfig 
-
-_HasWildcardElement 
-
-_IsMixed 
-
-_IsSimpleTypeContent 
-
-_IsUrType 
-
-_Locatable_mixin__location 
-
-_Name 
-
-_PerformValidation 
-
-_PreFactory_vx 
-
-_PyXBFactoryKeywords 
-
-_RequireXSIType 
-
-_ReservedSymbols 
-
-_SetAlternativeConstructor 
-
-_SetSupersedingClass 
-
-_SetValidationConfig 
-
-_SupersedingClass 
-
-_T_commandes__OPER 
-
-_T_commandes__PROC 
-
-_TypeBinding_mixin__AttributesFromDOM 
-
-_TypeBinding_mixin__WarnedUnassociatedElement 
-
-_TypeBinding_mixin__checkNilCtor 
-
-_TypeBinding_mixin__constructedWithValue 
-
-_TypeBinding_mixin__element 
-
-_TypeBinding_mixin__getValidationConfig 
-
-_TypeBinding_mixin__namespaceContext 
-
-_TypeBinding_mixin__xsiNil 
-
-_TypeDefinition 
-
-_UseForTag 
-
-_XSDLocation 
-
-__class__ 
-
-__delattr__ 
-
-__dict__ 
-
-__doc__ 
-
-__format__ 
-
-__getattribute__ 
-
-__hash__ 
-
-__httpchercheurs_edf_comlogicielsefficas_T_commandes_httpchercheurs_edf_comlogicielsefficasOPER 
-
-__httpchercheurs_edf_comlogicielsefficas_T_commandes_httpchercheurs_edf_comlogicielsefficasPROC 
-
-__init__ 
-
-__module__ 
-
-__new__ 
-
-__reduce__ 
-
-__reduce_ex__ 
-
-__repr__ 
-
-__setattr__ 
-
-__sizeof__ 
-
-__str__ 
-
-__subclasshook__ 
-
-__weakref__ 
-
-_addContent 
-
-_appendWildcardElement 
-
-_automatonConfiguration 
-
-_complexTypeDefinition__NeedWarnOnContent 
-
-_complexTypeDefinition__WarnOnContent 
-
-_complexTypeDefinition__automatonConfiguration 
-
-_complexTypeDefinition__childrenForDOM 
-
-_complexTypeDefinition__content 
-
-_complexTypeDefinition__setContent 
-
-_complexTypeDefinition__wildcardAttributeMap 
-
-_complexTypeDefinition__wildcardElements 
-
-_constructedWithValue 
-
-_description 
-
-_diagnosticName 
-
-_element 
-
-_finalizeContentModel 
-
-_isNil 
-
-_location 
-
-_namespaceContext 
-
-_performValidation 
-
-_postDOMValidate 
-
-_postFactory_vx 
-
-_resetAutomaton 
-
-_resetContent 
-
-_setAttribute 
-
-_setAttributesFromKeywordsAndDOM 
-
-_setDOMFromAttributes 
-
-_setElement 
-
-_setIsNil 
-
-_setLocation 
-
-_setNamespaceContext 
-
-_setValidationConfig 
-
-_substitutesFor 
-
-_symbolSet 
-
-_toDOM_csc 
-
-_validateAttributes 
-
-_validateBinding_vx 
-
-_validatedChildren 
-
-_validationConfig 
-
-_validationConfig_ 
-
-append 
-
-content 
-
-extend 
-
-orderedContent 
-
-reset 
-
-toDOM 
-
-toxml 
-
-validateBinding 
-
-value 
-
-wildcardAttributeMap 
-
-wildcardElements 
-
-xsdConstraintsOK 
-
-_______________________
-je passe ds CreerAccas
-PlageValeur
-ValeurDef
-doc
-portee
-statut
-o
-typeAttendu
-TXM
-validators
-_______________________
diff --git a/Med/efficas.py b/Med/efficas.py
deleted file mode 100644 (file)
index 3304e8a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# -*- coding: utf-8 -*-
-from raw.efficas import *
diff --git a/Med/model.xsd b/Med/model.xsd
deleted file mode 100755 (executable)
index 53fe25a..0000000
+++ /dev/null
@@ -1,595 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- edited with XMLSpy v2014 rel. 2 (x64) (http://www.altova.com) by BC (ED) -->\r
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:efficas="http://chercheurs.edf.com/logiciels/efficas" xmlns:altova="http://www.altova.com/xml-schema-extensions" targetNamespace="http://chercheurs.edf.com/logiciels/efficas" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0" vc:minVersion="1.1">\r
-       <xs:element name="doc" type="T_doc"/>\r
-       <xs:element name="cata" type="T_cata"/>\r
-       <xs:element name="regles" type="T_regles"/>\r
-       <xs:element name="typeCree" type="T_classe_utilisateur"/>\r
-       <xs:element name="ValeurDef" type="T_typeAttendu"/>\r
-       <xs:element name="ValeurSugg" type="T_typeAttendu"/>\r
-       <xs:element name="fonction_utilisateur" type="T_fonction_python"/>\r
-       <xs:element name="commandes" type="T_commandes">\r
-               <xs:unique name="Uniq_Command">\r
-                       <xs:selector xpath="*"/>\r
-                       <xs:field xpath="@efficas:nom"/>\r
-               </xs:unique>\r
-               <xs:key name="Uniq_Name_In_Oper">\r
-                       <xs:annotation>\r
-                               <xs:documentation>SIMP devrait Ãªtre selectionné que si .//SIMP[portee='Global']</xs:documentation>\r
-                       </xs:annotation>\r
-                       <xs:selector xpath="./OPER/BLOC |./OPER/FACT|./OPER/SIMP"/>\r
-                       <xs:field xpath="@efficas:nom"/>\r
-               </xs:key>\r
-               <xs:keyref name="Ref_A_Name_In_Oper" refer="Uniq_Name_In_Oper">\r
-                       <xs:selector xpath="./OPER/regles"/>\r
-                       <xs:field xpath="EXCLUS"/>\r
-               </xs:keyref>\r
-               <xs:key name="Uniq_Name_In_Proc">\r
-                       <xs:annotation>\r
-                               <xs:documentation>SIMP devrait Ãªtre selectionné que si .//SIMP[portee='Global']</xs:documentation>\r
-                       </xs:annotation>\r
-                       <xs:selector xpath="./PROC/BLOC | ./PROC/FACT| ./PROC/SIMP"/>\r
-                       <xs:field xpath="@efficas:nom"/>\r
-               </xs:key>\r
-               <xs:keyref name="Ref_A_Name_In_Proc" refer="Uniq_Name_In_Proc">\r
-                       <xs:selector xpath="./PROC/regles"/>\r
-                       <xs:field xpath="EXCLUS"/>\r
-               </xs:keyref>\r
-       </xs:element>\r
-       <xs:element name="validators" type="T_validators"/>\r
-       <xs:element name="PlageValeur" type="T_PlageValeur"/>\r
-       <xs:element name="typeAttendu" type="T_name"/>\r
-       <xs:element name="classeUtilisateurName" type="T_classe_utilisateur_username" abstract="true" substitutionGroup="typeAttendu"/>\r
-       <xs:element name="SIMP" type="T_SIMP"/>\r
-       <xs:element name="portee" type="T_portee" default="None"/>\r
-       <xs:element name="condition" type="T_fonction_python"/>\r
-       <xs:element name="borne_sup" type="T_typeAttendu"/>\r
-       <xs:element name="borne_inf" type="T_typeAttendu"/>\r
-       <!--    <xs:element name="into" type="T_into"/>-->\r
-       <xs:element name="into" type="T_into"/>\r
-       <!--    <xs:element name="into_plus_fonction" type="T_into" abstract="true" substitutionGroup="into"/>-->\r
-       <xs:attribute name="nom" type="AT_nom"/>\r
-       <xs:attribute name="ag" type="AT_ag"/>\r
-       <xs:attribute name="fr" type="xs:string"/>\r
-       <xs:attribute name="ang" type="xs:string"/>\r
-       <xs:attribute name="docu" type="AT_docu"/>\r
-       <xs:attribute name="valeur_sugg" type="AT_valeur_sugg"/>\r
-       <xs:attribute name="statut" type="AT_statut" default="o"/>\r
-       <xs:attribute name="max_occurs" type="AT_max_occurs"/>\r
-       <xs:attribute name="min_occurs" type="AT_min_occurs"/>\r
-       <xs:attribute name="subroutine" type="AT_subroutine" default="None"/>\r
-       <xs:complexType name="T_doc">\r
-               <xs:attribute ref="fr" use="optional"/>\r
-               <xs:attribute ref="ang"/>\r
-               <xs:attribute ref="docu"/>\r
-       </xs:complexType>\r
-       <xs:complexType name="T_cata">\r
-               <xs:sequence>\r
-                       <xs:element ref="commandes" minOccurs="0" maxOccurs="unbounded"/>\r
-               </xs:sequence>\r
-       </xs:complexType>\r
-       <xs:complexType name="T_commandes">\r
-               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
-                       <xs:element ref="OPER"/>\r
-                       <xs:element ref="PROC"/>\r
-               </xs:choice>\r
-       </xs:complexType>\r
-       <xs:complexType name="T_Cardinalite"/>\r
-       <xs:complexType name="T_PlageValeur">\r
-               <xs:choice>\r
-                       <xs:sequence>\r
-                               <xs:element ref="borne_sup" minOccurs="0"/>\r
-                               <xs:element ref="borne_inf" minOccurs="0"/>\r
-                       </xs:sequence>\r
-                       <xs:element ref="into"/>\r
-               </xs:choice>\r
-       </xs:complexType>\r
-       <xs:complexType name="T_Accas.Common">\r
-               <xs:sequence>\r
-                       <xs:element ref="regles" minOccurs="0"/>\r
-                       <xs:element ref="doc" minOccurs="0"/>\r
-                       <xs:choice maxOccurs="unbounded">\r
-                               <xs:element ref="BLOC"/>\r
-                               <xs:element ref="FACT"/>\r
-                               <xs:element ref="SIMP"/>\r
-                       </xs:choice>\r
-               </xs:sequence>\r
-               <xs:attribute ref="nom" use="required"/>\r
-       </xs:complexType>\r
-       <xs:element name="OPER" type="T_OPER"/>\r
-       <xs:complexType name="T_OPER">\r
-               <xs:complexContent>\r
-                       <xs:extension base="T_Accas.Common">\r
-                               <xs:sequence>\r
-                                       <xs:element ref="typeCree"/>\r
-                               </xs:sequence>\r
-                               <xs:attribute ref="subroutine"/>\r
-                       </xs:extension>\r
-               </xs:complexContent>\r
-       </xs:complexType>\r
-       <xs:element name="PROC" type="T_PROC">\r
-               <xs:unique name="Uniqb_NAme_In_PRoc">\r
-                       <xs:selector xpath="BLOC|FACT|SIMP"/>\r
-                       <xs:field xpath="@efficas:nom"/>\r
-               </xs:unique>\r
-       </xs:element>\r
-       <xs:complexType name="T_PROC">\r
-               <xs:complexContent>\r
-                       <xs:extension base="T_Accas.Common">\r
-                               <xs:attribute ref="subroutine"/>\r
-                       </xs:extension>\r
-               </xs:complexContent>\r
-       </xs:complexType>\r
-       <xs:element name="FACT" type="T_FACT"/>\r
-       <!--    <xs:complexType name="T_FACT">\r
-               <xs:complexContent>\r
-                       <xs:restriction base="T_Accas.Common">\r
-                               <xs:sequence>\r
-                                       <xs:element ref="regles" minOccurs="0"/>\r
-                                       <xs:element ref="doc" minOccurs="0"/>\r
-                                       <xs:choice maxOccurs="unbounded">\r
-                                               <xs:element ref="BLOC"/>\r
-                                               <xs:element ref="FACT"/>\r
-                                               <xs:element ref="SIMP"/>\r
-                                       </xs:choice>\r
-                               </xs:sequence>\r
-                       </xs:restriction>\r
-               </xs:complexContent>\r
-       </xs:complexType>-->\r
-       <xs:complexType name="T_FACT">\r
-               <xs:complexContent>\r
-                       <xs:extension base="T_Accas.Common">\r
-                               <xs:attribute ref="statut"/>\r
-                               <xs:attribute ref="min_occurs" default="1"/>\r
-                               <xs:attribute ref="max_occurs" default="1">\r
-                                       <xs:annotation>\r
-                                               <xs:documentation>La valuer -1 equivaut Ã  oo</xs:documentation>\r
-                                       </xs:annotation>\r
-                               </xs:attribute>\r
-                               <xs:assert test=".[exists(@efficas:max_occurs) and exists(@efficas:min_occurs) and @efficas:max_occurs  gt @efficas:min_occurs]"/>\r
-                               <!--<xs:assert test="if (.[exists(@efficas:max_occurs)] and .[exists(@efficas:min_occurs)] ) then (@efficas:max_occurs  gt @efficas:min_occurs) or @efficas:max_occurs = -1 else true" altova:message="Erreur max_occurs  > min_occurs "/>-->\r
-                       </xs:extension>\r
-               </xs:complexContent>\r
-       </xs:complexType>\r
-       <xs:simpleType name="T_fonction_python">\r
-               <xs:restriction base="xs:string"/>\r
-       </xs:simpleType>\r
-       <xs:element name="BLOC" type="T_BLOC"/>\r
-       <xs:complexType name="T_BLOC">\r
-               <xs:complexContent>\r
-                       <xs:extension base="T_Accas.Common">\r
-                               <xs:sequence>\r
-                                       <xs:element ref="condition"/>\r
-                               </xs:sequence>\r
-                       </xs:extension>\r
-               </xs:complexContent>\r
-       </xs:complexType>\r
-       <xs:complexType name="T_SIMP">\r
-               <xs:sequence>\r
-                       <xs:element ref="doc" minOccurs="0"/>\r
-                       <xs:element ref="portee" minOccurs="0">\r
-                               <xs:annotation>\r
-                                       <xs:documentation>La portée pouurait devenir un attribut de SIMP. Une autre solution consisterait a créer un SIMPG pour distinguer les @nom uniques des SIMP a portée globale des autres.</xs:documentation>\r
-                               </xs:annotation>\r
-                       </xs:element>\r
-                       <xs:element ref="ValeurDef" minOccurs="0"/>\r
-                       <xs:element ref="ValeurSugg" minOccurs="0"/>\r
-                       <xs:element ref="PlageValeur" minOccurs="0"/>\r
-                       <xs:element ref="typeAttendu"/>\r
-                       <xs:element ref="validators" minOccurs="0"/>\r
-               </xs:sequence>\r
-               <xs:attribute ref="nom" use="required"/>\r
-               <xs:attribute ref="statut"/>\r
-               <xs:attribute ref="min_occurs" default="1"/>\r
-               <xs:attribute ref="max_occurs" default="1">\r
-                       <xs:annotation>\r
-                               <xs:documentation>La valuer -1 equivaut Ã  oo</xs:documentation>\r
-                       </xs:annotation>\r
-               </xs:attribute>\r
-       </xs:complexType>\r
-       <xs:simpleType name="AT_statut">\r
-               <xs:restriction base="xs:string">\r
-                       <xs:enumeration value="f"/>\r
-                       <xs:enumeration value="o"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-       <!--<xs:simpleType name="T_repetable">\r
-               <xs:restriction base="xs:string">\r
-                       <xs:enumeration value="n"/>\r
-                       <xs:enumeration value="o"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>-->\r
-       <xs:simpleType name="T_portee">\r
-               <xs:restriction base="xs:string">\r
-                       <xs:enumeration value="None"/>\r
-                       <xs:enumeration value="Global"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="AT_max_occurs">\r
-               <xs:restriction base="xs:long">\r
-                       <xs:minInclusive value="-1"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="AT_min_occurs">\r
-               <xs:restriction base="xs:long">\r
-                       <xs:minExclusive value="0"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-       <!-- Comparable -->\r
-       <!--    <xs:simpleType name="AT_borne_sup">\r
-       <xs:atomic base="xs:double"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="AT_borne_inf">\r
-               <xs:restriction base="xs:double"/>\r
-       </xs:simpleType>\r
--->\r
-       <xs:simpleType name="AT_ag">\r
-               <xs:restriction base="xs:string">\r
-                       <xs:enumeration value="No comment"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="AT_docu">\r
-               <xs:annotation>\r
-                       <xs:documentation>Référence une position dans un fichier maître contenant une liste de références Ã  des pages de documentations</xs:documentation>\r
-               </xs:annotation>\r
-               <xs:restriction base="xs:string"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="AT_valeur_sugg">\r
-               <xs:restriction base="xs:string"/>\r
-       </xs:simpleType>\r
-       <!-- TODO: Exclure mots clés python|efficas -->\r
-       <xs:simpleType name="AT_nom">\r
-               <xs:restriction base="xs:string">\r
-                       <xs:pattern value="([A-Z]|[a-z]|_)([A-Z]|[a-z]|_|[0-9])*"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_predicat1">\r
-               <xs:list itemType="AT_nom"/>\r
-               <!-- TODO: Supprimer la liste -->\r
-       </xs:simpleType>\r
-       <xs:complexType name="T_predicat2">\r
-               <xs:sequence>\r
-                       <xs:element name="p1" type="T_predicat1" minOccurs="1"/>\r
-                       <xs:element name="p2" type="AT_nom" minOccurs="1"/>\r
-               </xs:sequence>\r
-               <!-- TODO: Supprimer la séquence -->\r
-       </xs:complexType>\r
-       <xs:element name="A_CLASSER" type="T_predicat2"/>\r
-       <xs:element name="AU_MOINS_UN" type="T_predicat1"/>\r
-       <xs:element name="AU_PLUS_UN" type="T_predicat1"/>\r
-       <xs:element name="ENSEMBLE" type="T_predicat1"/>\r
-       <xs:element name="EXCLUS" type="T_predicat1">\r
-               <!-- A priori, ce n'est pas l'endroit pour le placer : ? scope de Uniq_Command-->\r
-               <!--            <xs:keyref name="referToAnAlreadyDefinedName" refer="Uniq_Command">\r
-                       <xs:selector xpath="."/>\r
-                       <xs:field xpath="."/>\r
-               </xs:keyref>\r
--->\r
-       </xs:element>\r
-       <xs:element name="PRESENT_ABSENT" type="T_predicat1"/>\r
-       <xs:element name="PRESENT_PRESENT" type="T_predicat1"/>\r
-       <xs:element name="UN_PARMI" type="T_predicat1"/>\r
-       <xs:group name="predicat">\r
-               <xs:choice>\r
-                       <xs:element ref="A_CLASSER"/>\r
-                       <xs:element ref="AU_MOINS_UN"/>\r
-                       <xs:element ref="AU_PLUS_UN"/>\r
-                       <xs:element ref="ENSEMBLE"/>\r
-                       <xs:element ref="EXCLUS">\r
-                               <!-- A priori, ce n'est pas l'endroit pour le placer -->\r
-                               <!--                            <xs:keyref name="referToAnAlreadyDefinedName" refer="/Uniq_Command">\r
-                                       <xs:selector xpath="."/>\r
-                                       <xs:field xpath="."/>\r
-                               </xs:keyref>\r
--->\r
-                       </xs:element>\r
-                       <xs:element ref="PRESENT_ABSENT"/>\r
-                       <xs:element ref="PRESENT_PRESENT"/>\r
-                       <xs:element ref="UN_PARMI"/>\r
-               </xs:choice>\r
-       </xs:group>\r
-       <xs:complexType name="T_regles">\r
-               <xs:sequence maxOccurs="unbounded">\r
-                       <xs:group ref="predicat"/>\r
-               </xs:sequence>\r
-       </xs:complexType>\r
-       <!--    <xs:simpleType name="T_typeCree">\r
-               <xs:restriction base="T_classe_utilisateur"/>\r
-       </xs:simpleType>\r
--->\r
-       <xs:simpleType name="AT_subroutine">\r
-               <xs:restriction base="AT_nom"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_validators">\r
-               <xs:restriction base="xs:string">\r
-                       <xs:enumeration value="NoRepeat"/>\r
-                       <xs:enumeration value="OnlyStr"/>\r
-                       <xs:enumeration value="VerifExiste"/>\r
-                       <xs:enumeration value="VerifTypeTuple"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_Bool">\r
-               <xs:restriction base="xs:boolean"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_list_Bool">\r
-               <xs:list itemType="T_Bool"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_I">\r
-               <xs:restriction base="xs:int"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_list_I">\r
-               <xs:list itemType="T_I"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_R">\r
-               <xs:restriction base="xs:double"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_list_R">\r
-               <xs:list itemType="T_R"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_TXM">\r
-               <xs:restriction base="AT_nom"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_list_TXM">\r
-               <xs:list itemType="T_TXM"/>\r
-       </xs:simpleType>\r
-       <!--fonctionne mais ne permet pas de créer une liste de liste -->\r
-       <xs:simpleType name="T_C">\r
-               <xs:restriction>\r
-                       <xs:simpleType>\r
-                               <xs:list itemType="xs:double"/>\r
-                       </xs:simpleType>\r
-                       <xs:minLength value="2"/>\r
-                       <xs:maxLength value="2"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-       <!-- Ajouter une contrainte : taille pair -->\r
-       <!-- Il n'est pas possible de définir des listes de listes -->\r
-       <xs:simpleType name="T_list_C">\r
-               <xs:list itemType="xs:double"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_name_base">\r
-               <xs:restriction base="AT_nom"/>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_simple_name">\r
-               <xs:restriction base="T_name_base">\r
-                       <xs:enumeration value="Fichier"/>\r
-                       <xs:enumeration value="Repertoire"/>\r
-                       <xs:enumeration value="TXM"/>\r
-                       <xs:enumeration value="I"/>\r
-                       <xs:enumeration value="R"/>\r
-                       <xs:enumeration value="C"/>\r
-                       <xs:enumeration value="Bool"/>\r
-                       <xs:enumeration value="grma"/>\r
-                       <xs:enumeration value="grno"/>\r
-                       <xs:enumeration value="SalomeEntry"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-       <!-- On ne peut pas rendre abstrait un simpleType && \r
-          Il n'est pas possible de dérivé par restriction un simplecontent d'un type complex qui\r
-          lui peut Ãªtre abstrait\r
-    -->\r
-       <xs:simpleType name="T_classe_utilisateur_name">\r
-               <xs:restriction base="T_name">\r
-                       <xs:enumeration value="T_classe_utilisateur"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-       <xs:complexType name="T_classe_utilisateur_username">\r
-               <xs:simpleContent>\r
-                       <xs:extension base="T_classe_utilisateur_name">\r
-                               <xs:attribute ref="nom" use="required"/>\r
-                       </xs:extension>\r
-               </xs:simpleContent>\r
-       </xs:complexType>\r
-       <xs:simpleType name="T_name">\r
-               <xs:union memberTypes="T_simple_name">\r
-                       <xs:simpleType>\r
-                               <xs:restriction base="AT_nom">\r
-                                       <xs:enumeration value="T_Matrice_double"/>\r
-                                       <xs:enumeration value="T_Matrice_Symetrique_double"/>\r
-                                       <xs:enumeration value="T_tuple"/>\r
-                                       <xs:enumeration value="T_classe_utilisateur"/>\r
-                               </xs:restriction>\r
-                       </xs:simpleType>\r
-               </xs:union>\r
-       </xs:simpleType>\r
-       <xs:complexType name="T_grma"/>\r
-       <xs:complexType name="T_grno"/>\r
-       <xs:complexType name="T_SalomeEntry"/>\r
-       <xs:complexType name="T_Fichier"/>\r
-       <!--    <xs:complexType name="T_Repertoire"/>-->\r
-       <xs:simpleType name="T_Repertoire">\r
-               <xs:list>\r
-                       <xs:simpleType>\r
-                               <xs:restriction base="xs:string">\r
-                                       <xs:whiteSpace value="preserve"/>\r
-                               </xs:restriction>\r
-                       </xs:simpleType>\r
-               </xs:list>\r
-       </xs:simpleType>\r
-       <xs:simpleType name="T_simple">\r
-               <xs:union memberTypes="T_I T_list_I T_R T_list_R T_C T_list_C T_TXM T_list_TXM T_Bool T_list_Bool T_Repertoire"/>\r
-       </xs:simpleType>\r
-       <!--    <xs:complexType name="T_TXM"/>-->\r
-       <!--    <xs:simpleType name="T_simple">\r
-               <xs:restriction base="xs:string">\r
-                       <xs:enumeration value="Fichier"/>\r
-                       <xs:enumeration value="Repertoire"/>\r
-                       <xs:enumeration value="TXM"/>\r
-                       <xs:enumeration value="I"/>\r
-                       <xs:enumeration value="R"/>\r
-                       <xs:enumeration value="C"/>\r
-                       <xs:enumeration value="Bool"/>\r
-                       <xs:enumeration value="grma"/>\r
-                       <xs:enumeration value="grno"/>\r
-                       <xs:enumeration value="SalomeEntry"/>\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
--->\r
-       <xs:simpleType name="T_list_double">\r
-               <xs:list itemType="xs:double"/>\r
-       </xs:simpleType>\r
-       <!-- Possibilité d'utiliser un type paramétré ? -->\r
-       <xs:complexType name="T_Matrice_double">\r
-               <xs:simpleContent>\r
-                       <xs:extension base="T_list_double">\r
-                               <xs:attribute name="n" type="xs:integer" use="required"/>\r
-                               <xs:attribute name="m" type="xs:integer" use="required"/>\r
-                       </xs:extension>\r
-               </xs:simpleContent>\r
-       </xs:complexType>\r
-       <!-- Faire l'exercice de dériver de T_Matrice_double -->\r
-       <xs:complexType name="T_Matrice_Symetrique_double">\r
-               <xs:simpleContent>\r
-                       <xs:extension base="T_list_double">\r
-                               <xs:attribute name="n" type="xs:int" use="required"/>\r
-                       </xs:extension>\r
-               </xs:simpleContent>\r
-       </xs:complexType>\r
-       <!-- Une liste est aussi un type simple !!!! -->\r
-       <!--    <xs:simpleType name="T_list_anySimpleType">\r
-               <xs:list itemType="xs:anySimpleType"/>\r
-       </xs:simpleType>\r
--->\r
-       <!-- Le fait de ne pas déclarer une liste risque d'être problématique pour le parsing : A voir-->\r
-       <xs:complexType name="T_tuple">\r
-               <xs:simpleContent>\r
-                       <xs:extension base="xs:anySimpleType">\r
-                               <xs:attribute name="n" type="xs:int" use="required"/>\r
-                       </xs:extension>\r
-               </xs:simpleContent>\r
-       </xs:complexType>\r
-       <xs:simpleType name="T_classe_utilisateur">\r
-               <xs:restriction base="AT_nom"/>\r
-       </xs:simpleType>\r
-       <xs:element name="typesimple" type="T_simple"/>\r
-       <xs:element name="matrice_double" type="T_Matrice_double"/>\r
-       <xs:element name="matrice_symetrique_double" type="T_Matrice_Symetrique_double"/>\r
-       <xs:element name="tuple" type="T_tuple"/>\r
-       <xs:element name="classe_utilisateur" type="T_classe_utilisateur"/>\r
-       <!-- Essai -->\r
-       <!--    <xs:group name="T_Attendu_group1">\r
-               <xs:choice>\r
-                       <xs:element ref="typesimple"/>\r
-                       <xs:element ref="matrice_double"/>\r
-                       <xs:element ref="matrice_symetrique_double"/>\r
-                       <xs:element ref="tuple"/>\r
-                       <xs:element ref="classe_utilisateur"/>\r
-               </xs:choice>\r
-       </xs:group>\r
-\r
-       <xs:group name="T_Attendu_group2">\r
-               <xs:choice>\r
-                       <xs:element ref="typesimple"/>\r
-                       <xs:element ref="matrice_double"/>\r
-                       <xs:element ref="matrice_symetrique_double"/>\r
-                       <xs:element ref="tuple"/>\r
-                       <xs:element ref="classe_utilisateur"/>\r
-                       <xs:element ref="fonction_utilisateur" minOccurs="1" maxOccurs="unbounded"/>\r
-               </xs:choice>\r
-       </xs:group>\r
-\r
-       <xs:complexType name="T_typeAttendu">\r
-               <xs:group ref="T_Attendu_group1"/>\r
-       </xs:complexType>\r
-       -->\r
-       <!-- Faire plutot un groupe de substitution pour ne pas croiser les choix -->\r
-       <!--\r
-       <xs:complexType name="T_into">\r
-         <xs:group ref="T_Attendu_group2"/>\r
-       </xs:complexType>\r
-       -->\r
-       <xs:complexType name="T_into">\r
-               <xs:choice>\r
-                       <!--                    <xs:element ref="typesimple" type="T_Base"/>-->\r
-                       <xs:element ref="typesimple" minOccurs="0" maxOccurs="unbounded"/>\r
-                       <xs:element ref="matrice_double" minOccurs="0" maxOccurs="unbounded"/>\r
-                       <xs:element ref="matrice_symetrique_double" minOccurs="0" maxOccurs="unbounded"/>\r
-                       <xs:element ref="tuple" minOccurs="0" maxOccurs="unbounded"/>\r
-                       <xs:element ref="classe_utilisateur" minOccurs="0" maxOccurs="unbounded"/>\r
-                       <xs:element ref="fonction_utilisateur" minOccurs="1" maxOccurs="unbounded"/>\r
-               </xs:choice>\r
-       </xs:complexType>\r
-       <xs:complexType name="T_typeAttendu">\r
-               <xs:complexContent>\r
-                       <xs:restriction base="T_into">\r
-                               <xs:choice>\r
-                                       <xs:element ref="typesimple" minOccurs="0" maxOccurs="unbounded"/>\r
-                                       <xs:element ref="matrice_double" minOccurs="0" maxOccurs="unbounded"/>\r
-                                       <xs:element ref="matrice_symetrique_double" minOccurs="0" maxOccurs="unbounded"/>\r
-                                       <xs:element ref="tuple" minOccurs="0" maxOccurs="unbounded"/>\r
-                                       <xs:element ref="classe_utilisateur" minOccurs="0" maxOccurs="unbounded"/>\r
-                               </xs:choice>\r
-                       </xs:restriction>\r
-               </xs:complexContent>\r
-       </xs:complexType>\r
-</xs:schema>\r
-<!-- Catalogue EFFICAS Ã©quivalent\r
-\r
-# coding: utf-8\r
-from Accas import *\r
-\r
-class carte   (ASSD) : pass\r
-class maille   (ASSD) : pass\r
-class carte_flux_r   (carte):pass\r
-\r
-class NOM_CHAM_INTO:\r
-    def __call__(self, *l_typ_cham, **kwargs):\r
-        return tuple(('A','B','C'))\r
-C_NOM_CHAM_INTO = NOM_CHAM_INTO()\r
-\r
-JdC = JDC_CATA(code='MAP',\r
-               execmodul=None,\r
-               regles=ENSEMBLE('E1','E2','E3')\r
-               )\r
-\r
-CREECARTE = OPER(nom="CREECARTE",op=None, sd_prod=carte, UNITE=SIMP(statut='f',typ='I',defaut=21),);\r
-\r
-CREECARTEFLUX = OPER(nom="CREECARTEFLUX",op=None, sd_prod=carte_flux_r,\r
-                   NOMFLUX=SIMP(statut='o',typ='TXM',defaut='monFlux'),\r
-                );\r
-\r
-CREEMAILLE = OPER(nom="CREEMAILLE",op=None, sd_prod=maille,\r
-                NOEUDS=SIMP(statut='o',typ='I',defaut=(1,2),min=2,max=2)\r
-              );\r
-\r
-E1=PROC(nom="E1",\r
-        op=None,\r
-        regles    = (EXCLUS('ETAT_INIT','RESULTAT',),),\r
-        ETAT_INIT = FACT(statut='f', max='**',\r
-                         GROUP_MA_1=SIMP(statut='o',typ='I',validators=NoRepeat(),max='**'),\r
-                         GROUP_NO_2=SIMP(statut='f',typ='I',validators=NoRepeat(),max='**'),\r
-                    ),\r
-\r
-        RESULTAT  = FACT(statut='f',\r
-                         DEPL=SIMP(statut='o', typ='R',  validators=NoRepeat()),\r
-                         VITE=SIMP(statut='f', typ='R',  validators=NoRepeat()),\r
-                         ACCE=SIMP(statut='f', typ='R',  validators=NoRepeat()),\r
-                    ), \r
-        );\r
-\r
-E2=PROC(nom="E2", op=None,\r
-        regles   = (UN_PARMI('CONCEPT','CHAINE','TOUT' ),),\r
-        CONCEPT  = FACT(statut='f',max='**',\r
-                   NOM = SIMP(statut='o',typ=assd,validators=NoRepeat(),max='**'),\r
-                   ),\r
-        CHAINE   = SIMP(statut='f',typ='TXM'),\r
-        POSITION = SIMP(statut='f',typ='I',defaut=1),\r
-        TOUT     = SIMP(statut='f',typ='TXM',into=("OUI",) ),\r
-        );\r
-\r
-E3=PROC(nom="E3",op=None,\r
-        DEFORMATION = SIMP(statut='f',typ='TXM',defaut="PETIT",\r
-                           into=("PETIT","PETIT_REAC","GROT_GDEP","SIMO_MIEHE","GDEF_HYPO_ELAS","GDEF_LOG")),\r
-        b_blocIn    = BLOC(condition = "DEFORMATION in ('PETIT','PETIT_REAC','GROT_GDEP')",\r
-             ITER_INTE_PAS = SIMP(statut='f',typ='I',defaut= 0 ),\r
-             ALGO_INTE     = SIMP(statut='f',typ='TXM',into=("ANALYTIQUE", "SECANTE", "DEKKER", "NEWTON_1D","BRENT",),),\r
-             CARTE        = SIMP(statut='f',typ=carte,),\r
-             b_carte       = BLOC(condition= "(AsType(CARTE) != carte_flux_r)",\r
-                             CONTRAINTE = SIMP(statut='f',typ='TXM',validators=NoRepeat(),max='**',\r
-                                          fr="Options pour le calcul de contraintes et efforts generalises",\r
-                                           into=C_NOM_CHAM_INTO(phenomene='CONTRAINTE',categorie='lin'),)\r
-                             ),\r
-                      ),  \r
-       );\r
-\r
--->\r
diff --git a/Med/raw/__init__.py b/Med/raw/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Med/raw/efficas.py b/Med/raw/efficas.py
deleted file mode 100644 (file)
index de150a9..0000000
+++ /dev/null
@@ -1,2685 +0,0 @@
-# ./raw/efficas.py
-# -*- coding: utf-8 -*-
-# PyXB bindings for NM:759f40938b7670cd6d5941e706557eb2115fb17f
-# Generated 2016-11-23 16:51:37.568270 by PyXB version 1.2.3
-# Namespace http://chercheurs.edf.com/logiciels/efficas
-
-import pyxb
-import pyxb.binding
-import pyxb.binding.saxer
-import io
-import pyxb.utils.utility
-import pyxb.utils.domutils
-import sys
-
-# Unique identifier for bindings created at the same time
-_GenerationUID = pyxb.utils.utility.UniqueIdentifier('urn:uuid:b79c3f70-b194-11e6-bb0f-b05adafd94d6')
-
-# Version of PyXB used to generate the bindings
-_PyXBVersion = '1.2.3'
-# Generated bindings are not compatible across PyXB versions
-if pyxb.__version__ != _PyXBVersion:
-    raise pyxb.PyXBVersionError(_PyXBVersion)
-
-# Import bindings for namespaces imported into schema
-import pyxb.binding.datatypes
-
-# NOTE: All namespace declarations are reserved within the binding
-Namespace = pyxb.namespace.NamespaceForURI(u'http://chercheurs.edf.com/logiciels/efficas', create_if_missing=True)
-Namespace.configureCategories(['typeBinding', 'elementBinding'])
-
-def CreateFromDocument (xml_text, default_namespace=None, location_base=None):
-    """Parse the given XML and use the document element to create a
-    Python instance.
-
-    @param xml_text An XML document.  This should be data (Python 2
-    str or Python 3 bytes), or a text (Python 2 unicode or Python 3
-    str) in the L{pyxb._InputEncoding} encoding.
-
-    @keyword default_namespace The L{pyxb.Namespace} instance to use as the
-    default namespace where there is no default namespace in scope.
-    If unspecified or C{None}, the namespace of the module containing
-    this function will be used.
-
-    @keyword location_base: An object to be recorded as the base of all
-    L{pyxb.utils.utility.Location} instances associated with events and
-    objects handled by the parser.  You might pass the URI from which
-    the document was obtained.
-    """
-
-    if pyxb.XMLStyle_saxer != pyxb._XMLStyle:
-        dom = pyxb.utils.domutils.StringToDOM(xml_text)
-        return CreateFromDOM(dom.documentElement)
-    if default_namespace is None:
-        default_namespace = Namespace.fallbackNamespace()
-    saxer = pyxb.binding.saxer.make_parser(fallback_namespace=default_namespace, location_base=location_base)
-    handler = saxer.getContentHandler()
-    xmld = xml_text
-    if isinstance(xmld, unicode):
-        xmld = xmld.encode(pyxb._InputEncoding)
-    saxer.parse(io.BytesIO(xmld))
-    instance = handler.rootObject()
-    return instance
-
-def CreateFromDOM (node, default_namespace=None):
-    """Create a Python instance from the given DOM node.
-    The node tag must correspond to an element declaration in this module.
-
-    @deprecated: Forcing use of DOM interface is unnecessary; use L{CreateFromDocument}."""
-    if default_namespace is None:
-        default_namespace = Namespace.fallbackNamespace()
-    return pyxb.binding.basis.element.AnyCreateFromDOM(node, default_namespace)
-
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_fonction_python
-class T_fonction_python (pyxb.binding.datatypes.string):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_fonction_python')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 154, 1)
-    _Documentation = None
-T_fonction_python._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_fonction_python', T_fonction_python)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_statut
-class AT_statut (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_statut')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 190, 1)
-    _Documentation = None
-AT_statut._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=AT_statut, enum_prefix=None)
-AT_statut.f = AT_statut._CF_enumeration.addEnumeration(unicode_value=u'f', tag=u'f')
-AT_statut.o = AT_statut._CF_enumeration.addEnumeration(unicode_value=u'o', tag=u'o')
-AT_statut._InitializeFacetMap(AT_statut._CF_enumeration)
-Namespace.addCategoryObject('typeBinding', u'AT_statut', AT_statut)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_portee
-class T_portee (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_portee')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 202, 1)
-    _Documentation = None
-T_portee._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_portee, enum_prefix=None)
-T_portee.None_ = T_portee._CF_enumeration.addEnumeration(unicode_value=u'None', tag=u'None_')
-T_portee.Global = T_portee._CF_enumeration.addEnumeration(unicode_value=u'Global', tag=u'Global')
-T_portee._InitializeFacetMap(T_portee._CF_enumeration)
-Namespace.addCategoryObject('typeBinding', u'T_portee', T_portee)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_max_occurs
-class AT_max_occurs (pyxb.binding.datatypes.long):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_max_occurs')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 208, 1)
-    _Documentation = None
-AT_max_occurs._CF_minInclusive = pyxb.binding.facets.CF_minInclusive(value_datatype=AT_max_occurs, value=pyxb.binding.datatypes.long(-1L))
-AT_max_occurs._InitializeFacetMap(AT_max_occurs._CF_minInclusive)
-Namespace.addCategoryObject('typeBinding', u'AT_max_occurs', AT_max_occurs)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_min_occurs
-class AT_min_occurs (pyxb.binding.datatypes.long):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_min_occurs')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 213, 1)
-    _Documentation = None
-AT_min_occurs._CF_minExclusive = pyxb.binding.facets.CF_minExclusive(value_datatype=pyxb.binding.datatypes.long, value=pyxb.binding.datatypes.integer(0L))
-AT_min_occurs._InitializeFacetMap(AT_min_occurs._CF_minExclusive)
-Namespace.addCategoryObject('typeBinding', u'AT_min_occurs', AT_min_occurs)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_ag
-class AT_ag (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_ag')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 226, 1)
-    _Documentation = None
-AT_ag._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=AT_ag, enum_prefix=None)
-AT_ag.No_comment = AT_ag._CF_enumeration.addEnumeration(unicode_value=u'No comment', tag=u'No_comment')
-AT_ag._InitializeFacetMap(AT_ag._CF_enumeration)
-Namespace.addCategoryObject('typeBinding', u'AT_ag', AT_ag)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_docu
-class AT_docu (pyxb.binding.datatypes.string):
-
-    """Référence une position dans un fichier maître contenant une liste de références Ã  des pages de documentations"""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_docu')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 231, 1)
-    _Documentation = u'R\xe9f\xe9rence une position dans un fichier ma\xeetre contenant une liste de r\xe9f\xe9rences \xe0 des pages de documentations'
-AT_docu._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'AT_docu', AT_docu)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_valeur_sugg
-class AT_valeur_sugg (pyxb.binding.datatypes.string):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_valeur_sugg')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 237, 1)
-    _Documentation = None
-AT_valeur_sugg._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'AT_valeur_sugg', AT_valeur_sugg)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_nom
-class AT_nom (pyxb.binding.datatypes.string):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_nom')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 241, 1)
-    _Documentation = None
-AT_nom._CF_pattern = pyxb.binding.facets.CF_pattern()
-AT_nom._CF_pattern.addPattern(pattern=u'([A-Z]|[a-z]|_)([A-Z]|[a-z]|_|[0-9])*')
-AT_nom._InitializeFacetMap(AT_nom._CF_pattern)
-Namespace.addCategoryObject('typeBinding', u'AT_nom', AT_nom)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_validators
-class T_validators (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_validators')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 303, 1)
-    _Documentation = None
-T_validators._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_validators, enum_prefix=None)
-T_validators.NoRepeat = T_validators._CF_enumeration.addEnumeration(unicode_value=u'NoRepeat', tag=u'NoRepeat')
-T_validators.OnlyStr = T_validators._CF_enumeration.addEnumeration(unicode_value=u'OnlyStr', tag=u'OnlyStr')
-T_validators.VerifExiste = T_validators._CF_enumeration.addEnumeration(unicode_value=u'VerifExiste', tag=u'VerifExiste')
-T_validators.VerifTypeTuple = T_validators._CF_enumeration.addEnumeration(unicode_value=u'VerifTypeTuple', tag=u'VerifTypeTuple')
-T_validators._InitializeFacetMap(T_validators._CF_enumeration)
-Namespace.addCategoryObject('typeBinding', u'T_validators', T_validators)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_Bool
-class T_Bool (pyxb.binding.datatypes.boolean):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Bool')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 311, 1)
-    _Documentation = None
-T_Bool._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_Bool', T_Bool)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_I
-class T_I (pyxb.binding.datatypes.int):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_I')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 317, 1)
-    _Documentation = None
-T_I._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_I', T_I)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_R
-class T_R (pyxb.binding.datatypes.double):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_R')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 323, 1)
-    _Documentation = None
-T_R._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_R', T_R)
-
-# List simple type: [anonymous]
-# superclasses pyxb.binding.datatypes.anySimpleType
-class STD_ANON (pyxb.binding.basis.STD_list):
-
-    """Simple type that is a list of pyxb.binding.datatypes.double."""
-
-    _ExpandedName = None
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 338, 3)
-    _Documentation = None
-
-    _ItemType = pyxb.binding.datatypes.double
-STD_ANON._InitializeFacetMap()
-
-# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_C
-# superclasses pyxb.binding.datatypes.anySimpleType
-class T_list_C (pyxb.binding.basis.STD_list):
-
-    """Simple type that is a list of pyxb.binding.datatypes.double."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_C')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 347, 1)
-    _Documentation = None
-
-    _ItemType = pyxb.binding.datatypes.double
-T_list_C._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_list_C', T_list_C)
-
-# Atomic simple type: [anonymous]
-class STD_ANON_ (pyxb.binding.datatypes.string):
-
-    """An atomic simple type."""
-
-    _ExpandedName = None
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 402, 3)
-    _Documentation = None
-STD_ANON_._CF_whiteSpace = pyxb.binding.facets.CF_whiteSpace(value=pyxb.binding.facets._WhiteSpace_enum.preserve)
-STD_ANON_._InitializeFacetMap(STD_ANON_._CF_whiteSpace)
-
-# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_double
-# superclasses pyxb.binding.datatypes.anySimpleType
-class T_list_double (pyxb.binding.basis.STD_list):
-
-    """Simple type that is a list of pyxb.binding.datatypes.double."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_double')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 428, 1)
-    _Documentation = None
-
-    _ItemType = pyxb.binding.datatypes.double
-T_list_double._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_list_double', T_list_double)
-
-# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_predicat1
-# superclasses pyxb.binding.datatypes.anySimpleType
-class T_predicat1 (pyxb.binding.basis.STD_list):
-
-    """Simple type that is a list of AT_nom."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_predicat1')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 246, 1)
-    _Documentation = None
-
-    _ItemType = AT_nom
-T_predicat1._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_predicat1', T_predicat1)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_subroutine
-class AT_subroutine (AT_nom):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_subroutine')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 300, 1)
-    _Documentation = None
-AT_subroutine._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'AT_subroutine', AT_subroutine)
-
-# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_Bool
-# superclasses pyxb.binding.datatypes.anySimpleType
-class T_list_Bool (pyxb.binding.basis.STD_list):
-
-    """Simple type that is a list of T_Bool."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_Bool')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 314, 1)
-    _Documentation = None
-
-    _ItemType = T_Bool
-T_list_Bool._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_list_Bool', T_list_Bool)
-
-# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_I
-# superclasses pyxb.binding.datatypes.anySimpleType
-class T_list_I (pyxb.binding.basis.STD_list):
-
-    """Simple type that is a list of T_I."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_I')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 320, 1)
-    _Documentation = None
-
-    _ItemType = T_I
-T_list_I._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_list_I', T_list_I)
-
-# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_R
-# superclasses pyxb.binding.datatypes.anySimpleType
-class T_list_R (pyxb.binding.basis.STD_list):
-
-    """Simple type that is a list of T_R."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_R')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 326, 1)
-    _Documentation = None
-
-    _ItemType = T_R
-T_list_R._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_list_R', T_list_R)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_TXM
-class T_TXM (AT_nom):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_TXM')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 329, 1)
-    _Documentation = None
-T_TXM._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_TXM', T_TXM)
-
-# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_C
-# superclasses STD_ANON
-class T_C (pyxb.binding.basis.STD_list):
-
-    """Simple type that is a list of pyxb.binding.datatypes.double."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_C')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 336, 1)
-    _Documentation = None
-
-    _ItemType = pyxb.binding.datatypes.double
-T_C._CF_maxLength = pyxb.binding.facets.CF_maxLength(value=pyxb.binding.datatypes.nonNegativeInteger(2L))
-T_C._CF_minLength = pyxb.binding.facets.CF_minLength(value=pyxb.binding.datatypes.nonNegativeInteger(2L))
-T_C._InitializeFacetMap(T_C._CF_maxLength,
-   T_C._CF_minLength)
-Namespace.addCategoryObject('typeBinding', u'T_C', T_C)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_name_base
-class T_name_base (AT_nom):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_name_base')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 350, 1)
-    _Documentation = None
-T_name_base._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_name_base', T_name_base)
-
-# Atomic simple type: [anonymous]
-class STD_ANON_2 (AT_nom, pyxb.binding.basis.enumeration_mixin):
-
-    """An atomic simple type."""
-
-    _ExpandedName = None
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 385, 3)
-    _Documentation = None
-STD_ANON_2._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=STD_ANON_2, enum_prefix=None)
-STD_ANON_2.T_Matrice_double = STD_ANON_2._CF_enumeration.addEnumeration(unicode_value=u'T_Matrice_double', tag=u'T_Matrice_double')
-STD_ANON_2.T_Matrice_Symetrique_double = STD_ANON_2._CF_enumeration.addEnumeration(unicode_value=u'T_Matrice_Symetrique_double', tag=u'T_Matrice_Symetrique_double')
-STD_ANON_2.T_tuple = STD_ANON_2._CF_enumeration.addEnumeration(unicode_value=u'T_tuple', tag=u'T_tuple')
-STD_ANON_2.T_classe_utilisateur = STD_ANON_2._CF_enumeration.addEnumeration(unicode_value=u'T_classe_utilisateur', tag=u'T_classe_utilisateur')
-STD_ANON_2._InitializeFacetMap(STD_ANON_2._CF_enumeration)
-
-# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_Repertoire
-# superclasses pyxb.binding.datatypes.anySimpleType
-class T_Repertoire (pyxb.binding.basis.STD_list):
-
-    """Simple type that is a list of STD_ANON_."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Repertoire')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 400, 1)
-    _Documentation = None
-
-    _ItemType = STD_ANON_
-T_Repertoire._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_Repertoire', T_Repertoire)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_classe_utilisateur
-class T_classe_utilisateur (AT_nom):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_classe_utilisateur')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 461, 1)
-    _Documentation = None
-T_classe_utilisateur._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_classe_utilisateur', T_classe_utilisateur)
-
-# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_TXM
-# superclasses pyxb.binding.datatypes.anySimpleType
-class T_list_TXM (pyxb.binding.basis.STD_list):
-
-    """Simple type that is a list of T_TXM."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_TXM')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 332, 1)
-    _Documentation = None
-
-    _ItemType = T_TXM
-T_list_TXM._InitializeFacetMap()
-Namespace.addCategoryObject('typeBinding', u'T_list_TXM', T_list_TXM)
-
-# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_simple_name
-class T_simple_name (T_name_base, pyxb.binding.basis.enumeration_mixin):
-
-    """An atomic simple type."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_simple_name')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 353, 1)
-    _Documentation = None
-T_simple_name._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_simple_name, enum_prefix=None)
-T_simple_name.Fichier = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'Fichier', tag=u'Fichier')
-T_simple_name.Repertoire = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'Repertoire', tag=u'Repertoire')
-T_simple_name.TXM = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'TXM', tag=u'TXM')
-T_simple_name.I = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'I', tag=u'I')
-T_simple_name.R = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'R', tag=u'R')
-T_simple_name.C = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'C', tag=u'C')
-T_simple_name.Bool = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'Bool', tag=u'Bool')
-T_simple_name.grma = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'grma', tag=u'grma')
-T_simple_name.grno = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'grno', tag=u'grno')
-T_simple_name.SalomeEntry = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'SalomeEntry', tag=u'SalomeEntry')
-T_simple_name._InitializeFacetMap(T_simple_name._CF_enumeration)
-Namespace.addCategoryObject('typeBinding', u'T_simple_name', T_simple_name)
-
-# Union simple type: {http://chercheurs.edf.com/logiciels/efficas}T_name
-# superclasses pyxb.binding.datatypes.anySimpleType
-class T_name (pyxb.binding.basis.STD_union):
-
-    """Simple type that is a union of T_simple_name, STD_ANON_2."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_name')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 383, 1)
-    _Documentation = None
-
-    _MemberTypes = ( T_simple_name, STD_ANON_2, )
-T_name._CF_pattern = pyxb.binding.facets.CF_pattern()
-T_name._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_name)
-T_name.Fichier = u'Fichier'                       # originally T_simple_name.Fichier
-T_name.Repertoire = u'Repertoire'                 # originally T_simple_name.Repertoire
-T_name.TXM = u'TXM'                               # originally T_simple_name.TXM
-T_name.I = u'I'                                   # originally T_simple_name.I
-T_name.R = u'R'                                   # originally T_simple_name.R
-T_name.C = u'C'                                   # originally T_simple_name.C
-T_name.Bool = u'Bool'                             # originally T_simple_name.Bool
-T_name.grma = u'grma'                             # originally T_simple_name.grma
-T_name.grno = u'grno'                             # originally T_simple_name.grno
-T_name.SalomeEntry = u'SalomeEntry'               # originally T_simple_name.SalomeEntry
-T_name.T_Matrice_double = u'T_Matrice_double'     # originally STD_ANON_2.T_Matrice_double
-T_name.T_Matrice_Symetrique_double = u'T_Matrice_Symetrique_double'# originally STD_ANON_2.T_Matrice_Symetrique_double
-T_name.T_tuple = u'T_tuple'                       # originally STD_ANON_2.T_tuple
-T_name.T_classe_utilisateur = u'T_classe_utilisateur'# originally STD_ANON_2.T_classe_utilisateur
-T_name._InitializeFacetMap(T_name._CF_pattern,
-   T_name._CF_enumeration)
-Namespace.addCategoryObject('typeBinding', u'T_name', T_name)
-
-# Union simple type: {http://chercheurs.edf.com/logiciels/efficas}T_simple
-# superclasses pyxb.binding.datatypes.anySimpleType
-class T_simple (pyxb.binding.basis.STD_union):
-
-    """Simple type that is a union of T_I, T_list_I, T_R, T_list_R, T_C, T_list_C, T_TXM, T_list_TXM, T_Bool, T_list_Bool, T_Repertoire."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_simple')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 409, 1)
-    _Documentation = None
-
-    _MemberTypes = ( T_I, T_list_I, T_R, T_list_R, T_C, T_list_C, T_TXM, T_list_TXM, T_Bool, T_list_Bool, T_Repertoire, )
-T_simple._CF_pattern = pyxb.binding.facets.CF_pattern()
-T_simple._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_simple)
-T_simple._InitializeFacetMap(T_simple._CF_pattern,
-   T_simple._CF_enumeration)
-Namespace.addCategoryObject('typeBinding', u'T_simple', T_simple)
-
-# Union simple type: {http://chercheurs.edf.com/logiciels/efficas}T_classe_utilisateur_name
-# superclasses T_name, pyxb.binding.basis.enumeration_mixin
-class T_classe_utilisateur_name (pyxb.binding.basis.STD_union):
-
-    """Simple type that is a union of T_simple_name, STD_ANON_2."""
-
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_classe_utilisateur_name')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 371, 1)
-    _Documentation = None
-
-    _MemberTypes = ( T_simple_name, STD_ANON_2, )
-T_classe_utilisateur_name._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_classe_utilisateur_name, enum_prefix=None)
-T_classe_utilisateur_name.T_classe_utilisateur = T_classe_utilisateur_name._CF_enumeration.addEnumeration(unicode_value=u'T_classe_utilisateur', tag=u'T_classe_utilisateur')
-T_classe_utilisateur_name._InitializeFacetMap(T_classe_utilisateur_name._CF_enumeration)
-Namespace.addCategoryObject('typeBinding', u'T_classe_utilisateur_name', T_classe_utilisateur_name)
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_cata with content type ELEMENT_ONLY
-class T_cata (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_cata with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_cata')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 66, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}commandes uses Python identifier commandes
-    __commandes = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'commandes'), 'commandes', '__httpchercheurs_edf_comlogicielsefficas_T_cata_httpchercheurs_edf_comlogicielsefficascommandes', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 11, 1), )
-
-    
-    commandes = property(__commandes.value, __commandes.set, None, None)
-
-    _ElementMap.update({
-        __commandes.name() : __commandes
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_cata', T_cata)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_commandes with content type ELEMENT_ONLY
-class T_commandes (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_commandes with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_commandes')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 71, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}OPER uses Python identifier OPER
-    __OPER = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'OPER'), 'OPER', '__httpchercheurs_edf_comlogicielsefficas_T_commandes_httpchercheurs_edf_comlogicielsefficasOPER', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 99, 1), )
-
-    
-    OPER = property(__OPER.value, __OPER.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}PROC uses Python identifier PROC
-    __PROC = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'PROC'), 'PROC', '__httpchercheurs_edf_comlogicielsefficas_T_commandes_httpchercheurs_edf_comlogicielsefficasPROC', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 110, 1), )
-
-    
-    PROC = property(__PROC.value, __PROC.set, None, None)
-
-    _ElementMap.update({
-        __OPER.name() : __OPER,
-        __PROC.name() : __PROC
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_commandes', T_commandes)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Cardinalite with content type EMPTY
-class T_Cardinalite (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Cardinalite with content type EMPTY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Cardinalite')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 77, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_Cardinalite', T_Cardinalite)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_PlageValeur with content type ELEMENT_ONLY
-class T_PlageValeur (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_PlageValeur with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_PlageValeur')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 78, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}borne_sup uses Python identifier borne_sup
-    __borne_sup = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'borne_sup'), 'borne_sup', '__httpchercheurs_edf_comlogicielsefficas_T_PlageValeur_httpchercheurs_edf_comlogicielsefficasborne_sup', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 46, 1), )
-
-    
-    borne_sup = property(__borne_sup.value, __borne_sup.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}borne_inf uses Python identifier borne_inf
-    __borne_inf = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'borne_inf'), 'borne_inf', '__httpchercheurs_edf_comlogicielsefficas_T_PlageValeur_httpchercheurs_edf_comlogicielsefficasborne_inf', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 47, 1), )
-
-    
-    borne_inf = property(__borne_inf.value, __borne_inf.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}into uses Python identifier into
-    __into = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'into'), 'into', '__httpchercheurs_edf_comlogicielsefficas_T_PlageValeur_httpchercheurs_edf_comlogicielsefficasinto', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 49, 1), )
-
-    
-    into = property(__into.value, __into.set, None, None)
-
-    _ElementMap.update({
-        __borne_sup.name() : __borne_sup,
-        __borne_inf.name() : __borne_inf,
-        __into.name() : __into
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_PlageValeur', T_PlageValeur)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_predicat2 with content type ELEMENT_ONLY
-class T_predicat2 (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_predicat2 with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_predicat2')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 250, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}p1 uses Python identifier p1
-    __p1 = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'p1'), 'p1', '__httpchercheurs_edf_comlogicielsefficas_T_predicat2_httpchercheurs_edf_comlogicielsefficasp1', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 252, 3), )
-
-    
-    p1 = property(__p1.value, __p1.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}p2 uses Python identifier p2
-    __p2 = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'p2'), 'p2', '__httpchercheurs_edf_comlogicielsefficas_T_predicat2_httpchercheurs_edf_comlogicielsefficasp2', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 253, 3), )
-
-    
-    p2 = property(__p2.value, __p2.set, None, None)
-
-    _ElementMap.update({
-        __p1.name() : __p1,
-        __p2.name() : __p2
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_predicat2', T_predicat2)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_regles with content type ELEMENT_ONLY
-class T_regles (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_regles with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_regles')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 291, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}A_CLASSER uses Python identifier A_CLASSER
-    __A_CLASSER = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'A_CLASSER'), 'A_CLASSER', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasA_CLASSER', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 257, 1), )
-
-    
-    A_CLASSER = property(__A_CLASSER.value, __A_CLASSER.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}AU_MOINS_UN uses Python identifier AU_MOINS_UN
-    __AU_MOINS_UN = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'AU_MOINS_UN'), 'AU_MOINS_UN', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasAU_MOINS_UN', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 258, 1), )
-
-    
-    AU_MOINS_UN = property(__AU_MOINS_UN.value, __AU_MOINS_UN.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}AU_PLUS_UN uses Python identifier AU_PLUS_UN
-    __AU_PLUS_UN = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'AU_PLUS_UN'), 'AU_PLUS_UN', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasAU_PLUS_UN', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 259, 1), )
-
-    
-    AU_PLUS_UN = property(__AU_PLUS_UN.value, __AU_PLUS_UN.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}ENSEMBLE uses Python identifier ENSEMBLE
-    __ENSEMBLE = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'ENSEMBLE'), 'ENSEMBLE', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasENSEMBLE', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 260, 1), )
-
-    
-    ENSEMBLE = property(__ENSEMBLE.value, __ENSEMBLE.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}EXCLUS uses Python identifier EXCLUS
-    __EXCLUS = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'EXCLUS'), 'EXCLUS', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasEXCLUS', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 261, 1), )
-
-    
-    EXCLUS = property(__EXCLUS.value, __EXCLUS.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}PRESENT_ABSENT uses Python identifier PRESENT_ABSENT
-    __PRESENT_ABSENT = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_ABSENT'), 'PRESENT_ABSENT', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasPRESENT_ABSENT', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 269, 1), )
-
-    
-    PRESENT_ABSENT = property(__PRESENT_ABSENT.value, __PRESENT_ABSENT.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}PRESENT_PRESENT uses Python identifier PRESENT_PRESENT
-    __PRESENT_PRESENT = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_PRESENT'), 'PRESENT_PRESENT', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasPRESENT_PRESENT', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 270, 1), )
-
-    
-    PRESENT_PRESENT = property(__PRESENT_PRESENT.value, __PRESENT_PRESENT.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}UN_PARMI uses Python identifier UN_PARMI
-    __UN_PARMI = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'UN_PARMI'), 'UN_PARMI', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasUN_PARMI', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 271, 1), )
-
-    
-    UN_PARMI = property(__UN_PARMI.value, __UN_PARMI.set, None, None)
-
-    _ElementMap.update({
-        __A_CLASSER.name() : __A_CLASSER,
-        __AU_MOINS_UN.name() : __AU_MOINS_UN,
-        __AU_PLUS_UN.name() : __AU_PLUS_UN,
-        __ENSEMBLE.name() : __ENSEMBLE,
-        __EXCLUS.name() : __EXCLUS,
-        __PRESENT_ABSENT.name() : __PRESENT_ABSENT,
-        __PRESENT_PRESENT.name() : __PRESENT_PRESENT,
-        __UN_PARMI.name() : __UN_PARMI
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_regles', T_regles)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_grma with content type EMPTY
-class T_grma (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_grma with content type EMPTY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_grma')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 395, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_grma', T_grma)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_grno with content type EMPTY
-class T_grno (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_grno with content type EMPTY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_grno')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 396, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_grno', T_grno)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_SalomeEntry with content type EMPTY
-class T_SalomeEntry (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_SalomeEntry with content type EMPTY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_SalomeEntry')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 397, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_SalomeEntry', T_SalomeEntry)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Fichier with content type EMPTY
-class T_Fichier (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Fichier with content type EMPTY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Fichier')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 398, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_Fichier', T_Fichier)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_tuple with content type SIMPLE
-class T_tuple (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_tuple with content type SIMPLE"""
-    _TypeDefinition = pyxb.binding.datatypes.anySimpleType
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_tuple')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 454, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anySimpleType
-    
-    # Attribute n uses Python identifier n
-    __n = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(None, u'n'), 'n', '__httpchercheurs_edf_comlogicielsefficas_T_tuple_n', pyxb.binding.datatypes.int, required=True)
-    __n._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 457, 4)
-    __n._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 457, 4)
-    
-    n = property(__n.value, __n.set, None, None)
-
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        __n.name() : __n
-    })
-Namespace.addCategoryObject('typeBinding', u'T_tuple', T_tuple)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_into with content type ELEMENT_ONLY
-class T_into (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_into with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_into')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 501, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}fonction_utilisateur uses Python identifier fonction_utilisateur
-    __fonction_utilisateur = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'fonction_utilisateur'), 'fonction_utilisateur', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficasfonction_utilisateur', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 10, 1), )
-
-    
-    fonction_utilisateur = property(__fonction_utilisateur.value, __fonction_utilisateur.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}typesimple uses Python identifier typesimple
-    __typesimple = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'typesimple'), 'typesimple', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficastypesimple', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 464, 1), )
-
-    
-    typesimple = property(__typesimple.value, __typesimple.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}matrice_double uses Python identifier matrice_double
-    __matrice_double = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'matrice_double'), 'matrice_double', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficasmatrice_double', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 465, 1), )
-
-    
-    matrice_double = property(__matrice_double.value, __matrice_double.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}matrice_symetrique_double uses Python identifier matrice_symetrique_double
-    __matrice_symetrique_double = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'matrice_symetrique_double'), 'matrice_symetrique_double', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficasmatrice_symetrique_double', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 466, 1), )
-
-    
-    matrice_symetrique_double = property(__matrice_symetrique_double.value, __matrice_symetrique_double.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}tuple uses Python identifier tuple
-    __tuple = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'tuple'), 'tuple', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficastuple', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 467, 1), )
-
-    
-    tuple = property(__tuple.value, __tuple.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}classe_utilisateur uses Python identifier classe_utilisateur
-    __classe_utilisateur = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'classe_utilisateur'), 'classe_utilisateur', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficasclasse_utilisateur', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 468, 1), )
-
-    
-    classe_utilisateur = property(__classe_utilisateur.value, __classe_utilisateur.set, None, None)
-
-    _ElementMap.update({
-        __fonction_utilisateur.name() : __fonction_utilisateur,
-        __typesimple.name() : __typesimple,
-        __matrice_double.name() : __matrice_double,
-        __matrice_symetrique_double.name() : __matrice_symetrique_double,
-        __tuple.name() : __tuple,
-        __classe_utilisateur.name() : __classe_utilisateur
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_into', T_into)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_doc with content type EMPTY
-class T_doc (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_doc with content type EMPTY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_doc')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 61, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}fr uses Python identifier fr
-    __fr = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'fr'), 'fr', '__httpchercheurs_edf_comlogicielsefficas_T_doc_httpchercheurs_edf_comlogicielsefficasfr', pyxb.binding.datatypes.string)
-    __fr._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 53, 1)
-    __fr._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 62, 2)
-    
-    fr = property(__fr.value, __fr.set, None, None)
-
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}ang uses Python identifier ang
-    __ang = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'ang'), 'ang', '__httpchercheurs_edf_comlogicielsefficas_T_doc_httpchercheurs_edf_comlogicielsefficasang', pyxb.binding.datatypes.string)
-    __ang._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 54, 1)
-    __ang._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 63, 2)
-    
-    ang = property(__ang.value, __ang.set, None, None)
-
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}docu uses Python identifier docu
-    __docu = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'docu'), 'docu', '__httpchercheurs_edf_comlogicielsefficas_T_doc_httpchercheurs_edf_comlogicielsefficasdocu', AT_docu)
-    __docu._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 55, 1)
-    __docu._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 64, 2)
-    
-    docu = property(__docu.value, __docu.set, None, None)
-
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        __fr.name() : __fr,
-        __ang.name() : __ang,
-        __docu.name() : __docu
-    })
-Namespace.addCategoryObject('typeBinding', u'T_doc', T_doc)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common with content type ELEMENT_ONLY
-class T_Accas_Common (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Accas.Common')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 87, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}doc uses Python identifier doc
-    __doc = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'doc'), 'doc', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasdoc', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 4, 1), )
-
-    
-    doc = property(__doc.value, __doc.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}regles uses Python identifier regles
-    __regles = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'regles'), 'regles', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasregles', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 6, 1), )
-
-    
-    regles = property(__regles.value, __regles.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}SIMP uses Python identifier SIMP
-    __SIMP = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'SIMP'), 'SIMP', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasSIMP', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 43, 1), )
-
-    
-    SIMP = property(__SIMP.value, __SIMP.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}FACT uses Python identifier FACT
-    __FACT = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'FACT'), 'FACT', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasFACT', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 123, 1), )
-
-    
-    FACT = property(__FACT.value, __FACT.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}BLOC uses Python identifier BLOC
-    __BLOC = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'BLOC'), 'BLOC', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasBLOC', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 157, 1), )
-
-    
-    BLOC = property(__BLOC.value, __BLOC.set, None, None)
-
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}nom uses Python identifier nom
-    __nom = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'nom'), 'nom', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasnom', AT_nom, required=True)
-    __nom._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 51, 1)
-    __nom._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 97, 2)
-    
-    nom = property(__nom.value, __nom.set, None, None)
-
-    _ElementMap.update({
-        __doc.name() : __doc,
-        __regles.name() : __regles,
-        __SIMP.name() : __SIMP,
-        __FACT.name() : __FACT,
-        __BLOC.name() : __BLOC
-    })
-    _AttributeMap.update({
-        __nom.name() : __nom
-    })
-Namespace.addCategoryObject('typeBinding', u'T_Accas.Common', T_Accas_Common)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_SIMP with content type ELEMENT_ONLY
-class T_SIMP (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_SIMP with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_SIMP')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 167, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is pyxb.binding.datatypes.anyType
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}doc uses Python identifier doc
-    __doc = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'doc'), 'doc', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasdoc', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 4, 1), )
-
-    
-    doc = property(__doc.value, __doc.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}ValeurDef uses Python identifier ValeurDef
-    __ValeurDef = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'ValeurDef'), 'ValeurDef', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasValeurDef', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 8, 1), )
-
-    
-    ValeurDef = property(__ValeurDef.value, __ValeurDef.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}ValeurSugg uses Python identifier ValeurSugg
-    __ValeurSugg = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'ValeurSugg'), 'ValeurSugg', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasValeurSugg', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 9, 1), )
-
-    
-    ValeurSugg = property(__ValeurSugg.value, __ValeurSugg.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}validators uses Python identifier validators
-    __validators = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'validators'), 'validators', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasvalidators', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 39, 1), )
-
-    
-    validators = property(__validators.value, __validators.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}PlageValeur uses Python identifier PlageValeur
-    __PlageValeur = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'PlageValeur'), 'PlageValeur', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasPlageValeur', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 40, 1), )
-
-    
-    PlageValeur = property(__PlageValeur.value, __PlageValeur.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}typeAttendu uses Python identifier typeAttendu
-    __typeAttendu = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'typeAttendu'), 'typeAttendu', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficastypeAttendu', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 41, 1), )
-
-    
-    typeAttendu = property(__typeAttendu.value, __typeAttendu.set, None, None)
-
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}portee uses Python identifier portee
-    __portee = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'portee'), 'portee', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasportee', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 44, 1), )
-
-    
-    portee = property(__portee.value, __portee.set, None, None)
-
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}nom uses Python identifier nom
-    __nom = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'nom'), 'nom', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasnom', AT_nom, required=True)
-    __nom._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 51, 1)
-    __nom._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 181, 2)
-    
-    nom = property(__nom.value, __nom.set, None, None)
-
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}statut uses Python identifier statut
-    __statut = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'statut'), 'statut', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasstatut', AT_statut, unicode_default=u'o')
-    __statut._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 57, 1)
-    __statut._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 182, 2)
-    
-    statut = property(__statut.value, __statut.set, None, None)
-
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}max_occurs uses Python identifier max_occurs
-    __max_occurs = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'max_occurs'), 'max_occurs', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasmax_occurs', AT_max_occurs, unicode_default=u'1')
-    __max_occurs._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 58, 1)
-    __max_occurs._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 184, 2)
-    
-    max_occurs = property(__max_occurs.value, __max_occurs.set, None, None)
-
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}min_occurs uses Python identifier min_occurs
-    __min_occurs = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'min_occurs'), 'min_occurs', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasmin_occurs', AT_min_occurs, unicode_default=u'1')
-    __min_occurs._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 59, 1)
-    __min_occurs._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 183, 2)
-    
-    min_occurs = property(__min_occurs.value, __min_occurs.set, None, None)
-
-    _ElementMap.update({
-        __doc.name() : __doc,
-        __ValeurDef.name() : __ValeurDef,
-        __ValeurSugg.name() : __ValeurSugg,
-        __validators.name() : __validators,
-        __PlageValeur.name() : __PlageValeur,
-        __typeAttendu.name() : __typeAttendu,
-        __portee.name() : __portee
-    })
-    _AttributeMap.update({
-        __nom.name() : __nom,
-        __statut.name() : __statut,
-        __max_occurs.name() : __max_occurs,
-        __min_occurs.name() : __min_occurs
-    })
-Namespace.addCategoryObject('typeBinding', u'T_SIMP', T_SIMP)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Matrice_double with content type SIMPLE
-class T_Matrice_double (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Matrice_double with content type SIMPLE"""
-    _TypeDefinition = T_list_double
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Matrice_double')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 432, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is T_list_double
-    
-    # Attribute n uses Python identifier n
-    __n = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(None, u'n'), 'n', '__httpchercheurs_edf_comlogicielsefficas_T_Matrice_double_n', pyxb.binding.datatypes.integer, required=True)
-    __n._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 435, 4)
-    __n._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 435, 4)
-    
-    n = property(__n.value, __n.set, None, None)
-
-    
-    # Attribute m uses Python identifier m
-    __m = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(None, u'm'), 'm', '__httpchercheurs_edf_comlogicielsefficas_T_Matrice_double_m', pyxb.binding.datatypes.integer, required=True)
-    __m._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 436, 4)
-    __m._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 436, 4)
-    
-    m = property(__m.value, __m.set, None, None)
-
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        __n.name() : __n,
-        __m.name() : __m
-    })
-Namespace.addCategoryObject('typeBinding', u'T_Matrice_double', T_Matrice_double)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Matrice_Symetrique_double with content type SIMPLE
-class T_Matrice_Symetrique_double (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Matrice_Symetrique_double with content type SIMPLE"""
-    _TypeDefinition = T_list_double
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Matrice_Symetrique_double')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 441, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is T_list_double
-    
-    # Attribute n uses Python identifier n
-    __n = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(None, u'n'), 'n', '__httpchercheurs_edf_comlogicielsefficas_T_Matrice_Symetrique_double_n', pyxb.binding.datatypes.int, required=True)
-    __n._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 444, 4)
-    __n._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 444, 4)
-    
-    n = property(__n.value, __n.set, None, None)
-
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        __n.name() : __n
-    })
-Namespace.addCategoryObject('typeBinding', u'T_Matrice_Symetrique_double', T_Matrice_Symetrique_double)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_typeAttendu with content type ELEMENT_ONLY
-class T_typeAttendu (T_into):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_typeAttendu with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_typeAttendu')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 512, 1)
-    _ElementMap = T_into._ElementMap.copy()
-    _AttributeMap = T_into._AttributeMap.copy()
-    # Base type is T_into
-    
-    # Element typesimple ({http://chercheurs.edf.com/logiciels/efficas}typesimple) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_into
-    
-    # Element matrice_double ({http://chercheurs.edf.com/logiciels/efficas}matrice_double) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_into
-    
-    # Element matrice_symetrique_double ({http://chercheurs.edf.com/logiciels/efficas}matrice_symetrique_double) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_into
-    
-    # Element tuple ({http://chercheurs.edf.com/logiciels/efficas}tuple) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_into
-    
-    # Element classe_utilisateur ({http://chercheurs.edf.com/logiciels/efficas}classe_utilisateur) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_into
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_typeAttendu', T_typeAttendu)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_OPER with content type ELEMENT_ONLY
-class T_OPER (T_Accas_Common):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_OPER with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_OPER')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 100, 1)
-    _ElementMap = T_Accas_Common._ElementMap.copy()
-    _AttributeMap = T_Accas_Common._AttributeMap.copy()
-    # Base type is T_Accas_Common
-    
-    # Element doc ({http://chercheurs.edf.com/logiciels/efficas}doc) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element regles ({http://chercheurs.edf.com/logiciels/efficas}regles) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}typeCree uses Python identifier typeCree
-    __typeCree = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'typeCree'), 'typeCree', '__httpchercheurs_edf_comlogicielsefficas_T_OPER_httpchercheurs_edf_comlogicielsefficastypeCree', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 7, 1), )
-
-    
-    typeCree = property(__typeCree.value, __typeCree.set, None, None)
-
-    
-    # Element SIMP ({http://chercheurs.edf.com/logiciels/efficas}SIMP) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element FACT ({http://chercheurs.edf.com/logiciels/efficas}FACT) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element BLOC ({http://chercheurs.edf.com/logiciels/efficas}BLOC) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Attribute nom inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}subroutine uses Python identifier subroutine
-    __subroutine = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'subroutine'), 'subroutine', '__httpchercheurs_edf_comlogicielsefficas_T_OPER_httpchercheurs_edf_comlogicielsefficassubroutine', AT_subroutine, unicode_default=u'None')
-    __subroutine._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 60, 1)
-    __subroutine._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 106, 4)
-    
-    subroutine = property(__subroutine.value, __subroutine.set, None, None)
-
-    _ElementMap.update({
-        __typeCree.name() : __typeCree
-    })
-    _AttributeMap.update({
-        __subroutine.name() : __subroutine
-    })
-Namespace.addCategoryObject('typeBinding', u'T_OPER', T_OPER)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_PROC with content type ELEMENT_ONLY
-class T_PROC (T_Accas_Common):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_PROC with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_PROC')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 116, 1)
-    _ElementMap = T_Accas_Common._ElementMap.copy()
-    _AttributeMap = T_Accas_Common._AttributeMap.copy()
-    # Base type is T_Accas_Common
-    
-    # Element doc ({http://chercheurs.edf.com/logiciels/efficas}doc) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element regles ({http://chercheurs.edf.com/logiciels/efficas}regles) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element SIMP ({http://chercheurs.edf.com/logiciels/efficas}SIMP) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element FACT ({http://chercheurs.edf.com/logiciels/efficas}FACT) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element BLOC ({http://chercheurs.edf.com/logiciels/efficas}BLOC) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Attribute nom inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}subroutine uses Python identifier subroutine
-    __subroutine = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'subroutine'), 'subroutine', '__httpchercheurs_edf_comlogicielsefficas_T_PROC_httpchercheurs_edf_comlogicielsefficassubroutine', AT_subroutine, unicode_default=u'None')
-    __subroutine._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 60, 1)
-    __subroutine._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 119, 4)
-    
-    subroutine = property(__subroutine.value, __subroutine.set, None, None)
-
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        __subroutine.name() : __subroutine
-    })
-Namespace.addCategoryObject('typeBinding', u'T_PROC', T_PROC)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_FACT with content type ELEMENT_ONLY
-class T_FACT (T_Accas_Common):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_FACT with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_FACT')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 139, 1)
-    _ElementMap = T_Accas_Common._ElementMap.copy()
-    _AttributeMap = T_Accas_Common._AttributeMap.copy()
-    # Base type is T_Accas_Common
-    
-    # Element doc ({http://chercheurs.edf.com/logiciels/efficas}doc) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element regles ({http://chercheurs.edf.com/logiciels/efficas}regles) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element SIMP ({http://chercheurs.edf.com/logiciels/efficas}SIMP) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element FACT ({http://chercheurs.edf.com/logiciels/efficas}FACT) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element BLOC ({http://chercheurs.edf.com/logiciels/efficas}BLOC) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Attribute nom inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}statut uses Python identifier statut
-    __statut = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'statut'), 'statut', '__httpchercheurs_edf_comlogicielsefficas_T_FACT_httpchercheurs_edf_comlogicielsefficasstatut', AT_statut, unicode_default=u'o')
-    __statut._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 57, 1)
-    __statut._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 142, 4)
-    
-    statut = property(__statut.value, __statut.set, None, None)
-
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}max_occurs uses Python identifier max_occurs
-    __max_occurs = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'max_occurs'), 'max_occurs', '__httpchercheurs_edf_comlogicielsefficas_T_FACT_httpchercheurs_edf_comlogicielsefficasmax_occurs', AT_max_occurs, unicode_default=u'1')
-    __max_occurs._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 58, 1)
-    __max_occurs._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 144, 4)
-    
-    max_occurs = property(__max_occurs.value, __max_occurs.set, None, None)
-
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}min_occurs uses Python identifier min_occurs
-    __min_occurs = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'min_occurs'), 'min_occurs', '__httpchercheurs_edf_comlogicielsefficas_T_FACT_httpchercheurs_edf_comlogicielsefficasmin_occurs', AT_min_occurs, unicode_default=u'1')
-    __min_occurs._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 59, 1)
-    __min_occurs._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 143, 4)
-    
-    min_occurs = property(__min_occurs.value, __min_occurs.set, None, None)
-
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        __statut.name() : __statut,
-        __max_occurs.name() : __max_occurs,
-        __min_occurs.name() : __min_occurs
-    })
-Namespace.addCategoryObject('typeBinding', u'T_FACT', T_FACT)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_BLOC with content type ELEMENT_ONLY
-class T_BLOC (T_Accas_Common):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_BLOC with content type ELEMENT_ONLY"""
-    _TypeDefinition = None
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_BLOC')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 158, 1)
-    _ElementMap = T_Accas_Common._ElementMap.copy()
-    _AttributeMap = T_Accas_Common._AttributeMap.copy()
-    # Base type is T_Accas_Common
-    
-    # Element doc ({http://chercheurs.edf.com/logiciels/efficas}doc) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element regles ({http://chercheurs.edf.com/logiciels/efficas}regles) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element SIMP ({http://chercheurs.edf.com/logiciels/efficas}SIMP) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element {http://chercheurs.edf.com/logiciels/efficas}condition uses Python identifier condition
-    __condition = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'condition'), 'condition', '__httpchercheurs_edf_comlogicielsefficas_T_BLOC_httpchercheurs_edf_comlogicielsefficascondition', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 45, 1), )
-
-    
-    condition = property(__condition.value, __condition.set, None, None)
-
-    
-    # Element FACT ({http://chercheurs.edf.com/logiciels/efficas}FACT) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Element BLOC ({http://chercheurs.edf.com/logiciels/efficas}BLOC) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    
-    # Attribute nom inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
-    _ElementMap.update({
-        __condition.name() : __condition
-    })
-    _AttributeMap.update({
-        
-    })
-Namespace.addCategoryObject('typeBinding', u'T_BLOC', T_BLOC)
-
-
-# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_classe_utilisateur_username with content type SIMPLE
-class T_classe_utilisateur_username (pyxb.binding.basis.complexTypeDefinition):
-    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_classe_utilisateur_username with content type SIMPLE"""
-    _TypeDefinition = T_classe_utilisateur_name
-    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE
-    _Abstract = False
-    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_classe_utilisateur_username')
-    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 376, 1)
-    _ElementMap = {}
-    _AttributeMap = {}
-    # Base type is T_classe_utilisateur_name
-    
-    # Attribute {http://chercheurs.edf.com/logiciels/efficas}nom uses Python identifier nom
-    __nom = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'nom'), 'nom', '__httpchercheurs_edf_comlogicielsefficas_T_classe_utilisateur_username_httpchercheurs_edf_comlogicielsefficasnom', AT_nom, required=True)
-    __nom._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 51, 1)
-    __nom._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 379, 4)
-    
-    nom = property(__nom.value, __nom.set, None, None)
-
-    _ElementMap.update({
-        
-    })
-    _AttributeMap.update({
-        __nom.name() : __nom
-    })
-Namespace.addCategoryObject('typeBinding', u'T_classe_utilisateur_username', T_classe_utilisateur_username)
-
-
-cata = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'cata'), T_cata, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 5, 1))
-Namespace.addCategoryObject('elementBinding', cata.name().localName(), cata)
-
-regles = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'regles'), T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 6, 1))
-Namespace.addCategoryObject('elementBinding', regles.name().localName(), regles)
-
-fonction_utilisateur = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'fonction_utilisateur'), T_fonction_python, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 10, 1))
-Namespace.addCategoryObject('elementBinding', fonction_utilisateur.name().localName(), fonction_utilisateur)
-
-commandes = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'commandes'), T_commandes, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 11, 1))
-Namespace.addCategoryObject('elementBinding', commandes.name().localName(), commandes)
-
-validators = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'validators'), T_validators, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 39, 1))
-Namespace.addCategoryObject('elementBinding', validators.name().localName(), validators)
-
-PlageValeur = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PlageValeur'), T_PlageValeur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 40, 1))
-Namespace.addCategoryObject('elementBinding', PlageValeur.name().localName(), PlageValeur)
-
-portee = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'portee'), T_portee, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 44, 1), unicode_default=u'None')
-Namespace.addCategoryObject('elementBinding', portee.name().localName(), portee)
-
-condition = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'condition'), T_fonction_python, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 45, 1))
-Namespace.addCategoryObject('elementBinding', condition.name().localName(), condition)
-
-into = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'into'), T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 49, 1))
-Namespace.addCategoryObject('elementBinding', into.name().localName(), into)
-
-A_CLASSER = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'A_CLASSER'), T_predicat2, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 257, 1))
-Namespace.addCategoryObject('elementBinding', A_CLASSER.name().localName(), A_CLASSER)
-
-tuple = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'tuple'), T_tuple, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 467, 1))
-Namespace.addCategoryObject('elementBinding', tuple.name().localName(), tuple)
-
-doc = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'doc'), T_doc, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 4, 1))
-Namespace.addCategoryObject('elementBinding', doc.name().localName(), doc)
-
-typeCree = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typeCree'), T_classe_utilisateur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 7, 1))
-Namespace.addCategoryObject('elementBinding', typeCree.name().localName(), typeCree)
-
-ValeurDef = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ValeurDef'), T_typeAttendu, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 8, 1))
-Namespace.addCategoryObject('elementBinding', ValeurDef.name().localName(), ValeurDef)
-
-ValeurSugg = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ValeurSugg'), T_typeAttendu, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 9, 1))
-Namespace.addCategoryObject('elementBinding', ValeurSugg.name().localName(), ValeurSugg)
-
-SIMP = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'SIMP'), T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 43, 1))
-Namespace.addCategoryObject('elementBinding', SIMP.name().localName(), SIMP)
-
-borne_sup = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'borne_sup'), T_typeAttendu, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 46, 1))
-Namespace.addCategoryObject('elementBinding', borne_sup.name().localName(), borne_sup)
-
-borne_inf = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'borne_inf'), T_typeAttendu, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 47, 1))
-Namespace.addCategoryObject('elementBinding', borne_inf.name().localName(), borne_inf)
-
-AU_MOINS_UN = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'AU_MOINS_UN'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 258, 1))
-Namespace.addCategoryObject('elementBinding', AU_MOINS_UN.name().localName(), AU_MOINS_UN)
-
-AU_PLUS_UN = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'AU_PLUS_UN'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 259, 1))
-Namespace.addCategoryObject('elementBinding', AU_PLUS_UN.name().localName(), AU_PLUS_UN)
-
-ENSEMBLE = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ENSEMBLE'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 260, 1))
-Namespace.addCategoryObject('elementBinding', ENSEMBLE.name().localName(), ENSEMBLE)
-
-EXCLUS = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'EXCLUS'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 261, 1))
-Namespace.addCategoryObject('elementBinding', EXCLUS.name().localName(), EXCLUS)
-
-PRESENT_ABSENT = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_ABSENT'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 269, 1))
-Namespace.addCategoryObject('elementBinding', PRESENT_ABSENT.name().localName(), PRESENT_ABSENT)
-
-PRESENT_PRESENT = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_PRESENT'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 270, 1))
-Namespace.addCategoryObject('elementBinding', PRESENT_PRESENT.name().localName(), PRESENT_PRESENT)
-
-UN_PARMI = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'UN_PARMI'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 271, 1))
-Namespace.addCategoryObject('elementBinding', UN_PARMI.name().localName(), UN_PARMI)
-
-matrice_double = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'matrice_double'), T_Matrice_double, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 465, 1))
-Namespace.addCategoryObject('elementBinding', matrice_double.name().localName(), matrice_double)
-
-matrice_symetrique_double = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'matrice_symetrique_double'), T_Matrice_Symetrique_double, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 466, 1))
-Namespace.addCategoryObject('elementBinding', matrice_symetrique_double.name().localName(), matrice_symetrique_double)
-
-classe_utilisateur = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'classe_utilisateur'), T_classe_utilisateur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 468, 1))
-Namespace.addCategoryObject('elementBinding', classe_utilisateur.name().localName(), classe_utilisateur)
-
-OPER = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'OPER'), T_OPER, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 99, 1))
-Namespace.addCategoryObject('elementBinding', OPER.name().localName(), OPER)
-
-PROC = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PROC'), T_PROC, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 110, 1))
-Namespace.addCategoryObject('elementBinding', PROC.name().localName(), PROC)
-
-FACT = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'FACT'), T_FACT, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 123, 1))
-Namespace.addCategoryObject('elementBinding', FACT.name().localName(), FACT)
-
-BLOC = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'BLOC'), T_BLOC, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 157, 1))
-Namespace.addCategoryObject('elementBinding', BLOC.name().localName(), BLOC)
-
-typeAttendu = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typeAttendu'), T_name, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 41, 1))
-Namespace.addCategoryObject('elementBinding', typeAttendu.name().localName(), typeAttendu)
-
-typesimple = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typesimple'), T_simple, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 464, 1))
-Namespace.addCategoryObject('elementBinding', typesimple.name().localName(), typesimple)
-
-classeUtilisateurName = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'classeUtilisateurName'), T_classe_utilisateur_username, abstract=pyxb.binding.datatypes.boolean(1), location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 42, 1))
-Namespace.addCategoryObject('elementBinding', classeUtilisateurName.name().localName(), classeUtilisateurName)
-
-
-
-T_cata._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'commandes'), T_commandes, scope=T_cata, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 11, 1)))
-
-def _BuildAutomaton ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton
-    del _BuildAutomaton
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 68, 3))
-    counters.add(cc_0)
-    states = []
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_0, False))
-    symbol = pyxb.binding.content.ElementUse(T_cata._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'commandes')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 68, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    st_0._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, True, containing_state=None)
-T_cata._Automaton = _BuildAutomaton()
-
-
-
-
-T_commandes._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'OPER'), T_OPER, scope=T_commandes, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 99, 1)))
-
-T_commandes._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PROC'), T_PROC, scope=T_commandes, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 110, 1)))
-
-def _BuildAutomaton_ ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_
-    del _BuildAutomaton_
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 72, 2))
-    counters.add(cc_0)
-    states = []
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_0, False))
-    symbol = pyxb.binding.content.ElementUse(T_commandes._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'OPER')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 73, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_0, False))
-    symbol = pyxb.binding.content.ElementUse(T_commandes._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'PROC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 74, 3))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    st_1._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, True, containing_state=None)
-T_commandes._Automaton = _BuildAutomaton_()
-
-
-
-
-T_PlageValeur._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'borne_sup'), T_typeAttendu, scope=T_PlageValeur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 46, 1)))
-
-T_PlageValeur._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'borne_inf'), T_typeAttendu, scope=T_PlageValeur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 47, 1)))
-
-T_PlageValeur._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'into'), T_into, scope=T_PlageValeur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 49, 1)))
-
-def _BuildAutomaton_2 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_2
-    del _BuildAutomaton_2
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 81, 4))
-    counters.add(cc_0)
-    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 82, 4))
-    counters.add(cc_1)
-    states = []
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_0, False))
-    symbol = pyxb.binding.content.ElementUse(T_PlageValeur._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'borne_sup')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 81, 4))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_1, False))
-    symbol = pyxb.binding.content.ElementUse(T_PlageValeur._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'borne_inf')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 82, 4))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_PlageValeur._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'into')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 84, 3))
-    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_2)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_1, True) ]))
-    st_1._set_transitionSet(transitions)
-    transitions = []
-    st_2._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, True, containing_state=None)
-T_PlageValeur._Automaton = _BuildAutomaton_2()
-
-
-
-
-T_predicat2._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'p1'), T_predicat1, scope=T_predicat2, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 252, 3)))
-
-T_predicat2._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'p2'), AT_nom, scope=T_predicat2, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 253, 3)))
-
-def _BuildAutomaton_3 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_3
-    del _BuildAutomaton_3
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    states = []
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_predicat2._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'p1')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 252, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_predicat2._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'p2')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 253, 3))
-    st_1 = fac.State(symbol, is_initial=False, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    transitions = []
-    transitions.append(fac.Transition(st_1, [
-         ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    st_1._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, False, containing_state=None)
-T_predicat2._Automaton = _BuildAutomaton_3()
-
-
-
-
-T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'A_CLASSER'), T_predicat2, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 257, 1)))
-
-T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'AU_MOINS_UN'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 258, 1)))
-
-T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'AU_PLUS_UN'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 259, 1)))
-
-T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ENSEMBLE'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 260, 1)))
-
-T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'EXCLUS'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 261, 1)))
-
-T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_ABSENT'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 269, 1)))
-
-T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_PRESENT'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 270, 1)))
-
-T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'UN_PARMI'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 271, 1)))
-
-def _BuildAutomaton_4 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_4
-    del _BuildAutomaton_4
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    states = []
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'A_CLASSER')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 274, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'AU_MOINS_UN')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 275, 3))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'AU_PLUS_UN')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 276, 3))
-    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_2)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'ENSEMBLE')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 277, 3))
-    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_3)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'EXCLUS')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 278, 3))
-    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_4)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_ABSENT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 286, 3))
-    st_5 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_5)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_PRESENT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 287, 3))
-    st_6 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_6)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'UN_PARMI')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 288, 3))
-    st_7 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_7)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-         ]))
-    transitions.append(fac.Transition(st_1, [
-         ]))
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    transitions.append(fac.Transition(st_6, [
-         ]))
-    transitions.append(fac.Transition(st_7, [
-         ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-         ]))
-    transitions.append(fac.Transition(st_1, [
-         ]))
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    transitions.append(fac.Transition(st_6, [
-         ]))
-    transitions.append(fac.Transition(st_7, [
-         ]))
-    st_1._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-         ]))
-    transitions.append(fac.Transition(st_1, [
-         ]))
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    transitions.append(fac.Transition(st_6, [
-         ]))
-    transitions.append(fac.Transition(st_7, [
-         ]))
-    st_2._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-         ]))
-    transitions.append(fac.Transition(st_1, [
-         ]))
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    transitions.append(fac.Transition(st_6, [
-         ]))
-    transitions.append(fac.Transition(st_7, [
-         ]))
-    st_3._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-         ]))
-    transitions.append(fac.Transition(st_1, [
-         ]))
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    transitions.append(fac.Transition(st_6, [
-         ]))
-    transitions.append(fac.Transition(st_7, [
-         ]))
-    st_4._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-         ]))
-    transitions.append(fac.Transition(st_1, [
-         ]))
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    transitions.append(fac.Transition(st_6, [
-         ]))
-    transitions.append(fac.Transition(st_7, [
-         ]))
-    st_5._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-         ]))
-    transitions.append(fac.Transition(st_1, [
-         ]))
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    transitions.append(fac.Transition(st_6, [
-         ]))
-    transitions.append(fac.Transition(st_7, [
-         ]))
-    st_6._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-         ]))
-    transitions.append(fac.Transition(st_1, [
-         ]))
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    transitions.append(fac.Transition(st_6, [
-         ]))
-    transitions.append(fac.Transition(st_7, [
-         ]))
-    st_7._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, False, containing_state=None)
-T_regles._Automaton = _BuildAutomaton_4()
-
-
-
-
-T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'fonction_utilisateur'), T_fonction_python, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 10, 1)))
-
-T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typesimple'), T_simple, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 464, 1)))
-
-T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'matrice_double'), T_Matrice_double, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 465, 1)))
-
-T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'matrice_symetrique_double'), T_Matrice_Symetrique_double, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 466, 1)))
-
-T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'tuple'), T_tuple, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 467, 1)))
-
-T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'classe_utilisateur'), T_classe_utilisateur, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 468, 1)))
-
-def _BuildAutomaton_5 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_5
-    del _BuildAutomaton_5
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 504, 3))
-    counters.add(cc_0)
-    cc_1 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 505, 3))
-    counters.add(cc_1)
-    cc_2 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 506, 3))
-    counters.add(cc_2)
-    cc_3 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 507, 3))
-    counters.add(cc_3)
-    cc_4 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 508, 3))
-    counters.add(cc_4)
-    states = []
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_0, False))
-    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'typesimple')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 504, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_1, False))
-    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'matrice_double')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 505, 3))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_2, False))
-    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'matrice_symetrique_double')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 506, 3))
-    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_2)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_3, False))
-    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'tuple')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 507, 3))
-    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_3)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_4, False))
-    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'classe_utilisateur')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 508, 3))
-    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_4)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'fonction_utilisateur')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 509, 3))
-    st_5 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_5)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_1, True) ]))
-    st_1._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_2, True) ]))
-    st_2._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_3, True) ]))
-    st_3._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_4, True) ]))
-    st_4._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    st_5._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, True, containing_state=None)
-T_into._Automaton = _BuildAutomaton_5()
-
-
-
-
-T_Accas_Common._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'doc'), T_doc, scope=T_Accas_Common, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 4, 1)))
-
-T_Accas_Common._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'regles'), T_regles, scope=T_Accas_Common, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 6, 1)))
-
-T_Accas_Common._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'SIMP'), T_SIMP, scope=T_Accas_Common, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 43, 1)))
-
-T_Accas_Common._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'FACT'), T_FACT, scope=T_Accas_Common, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 123, 1)))
-
-T_Accas_Common._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'BLOC'), T_BLOC, scope=T_Accas_Common, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 157, 1)))
-
-def _BuildAutomaton_6 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_6
-    del _BuildAutomaton_6
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
-    counters.add(cc_0)
-    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
-    counters.add(cc_1)
-    states = []
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_Accas_Common._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'regles')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_Accas_Common._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_Accas_Common._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'BLOC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 92, 4))
-    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_2)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_Accas_Common._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'FACT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 93, 4))
-    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_3)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_Accas_Common._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'SIMP')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 94, 4))
-    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_4)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_1, True) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    st_1._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    st_2._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    st_3._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    st_4._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, False, containing_state=None)
-T_Accas_Common._Automaton = _BuildAutomaton_6()
-
-
-
-
-T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'doc'), T_doc, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 4, 1)))
-
-T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ValeurDef'), T_typeAttendu, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 8, 1)))
-
-T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ValeurSugg'), T_typeAttendu, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 9, 1)))
-
-T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'validators'), T_validators, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 39, 1)))
-
-T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PlageValeur'), T_PlageValeur, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 40, 1)))
-
-T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typeAttendu'), T_name, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 41, 1)))
-
-T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'portee'), T_portee, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 44, 1), unicode_default=u'None'))
-
-def _BuildAutomaton_7 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_7
-    del _BuildAutomaton_7
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 169, 3))
-    counters.add(cc_0)
-    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 170, 3))
-    counters.add(cc_1)
-    cc_2 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 175, 3))
-    counters.add(cc_2)
-    cc_3 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 176, 3))
-    counters.add(cc_3)
-    cc_4 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 177, 3))
-    counters.add(cc_4)
-    cc_5 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 179, 3))
-    counters.add(cc_5)
-    states = []
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 169, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'portee')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 170, 3))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'ValeurDef')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 175, 3))
-    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_2)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'ValeurSugg')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 176, 3))
-    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_3)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'PlageValeur')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 177, 3))
-    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_4)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'typeAttendu')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 178, 3))
-    st_5 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_5)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_5, False))
-    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'validators')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 179, 3))
-    st_6 = fac.State(symbol, is_initial=False, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_6)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_5, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_1, True) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_5, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    st_1._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_2, True) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_2, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_2, False) ]))
-    transitions.append(fac.Transition(st_5, [
-        fac.UpdateInstruction(cc_2, False) ]))
-    st_2._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_3, True) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_3, False) ]))
-    transitions.append(fac.Transition(st_5, [
-        fac.UpdateInstruction(cc_3, False) ]))
-    st_3._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_4, True) ]))
-    transitions.append(fac.Transition(st_5, [
-        fac.UpdateInstruction(cc_4, False) ]))
-    st_4._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_6, [
-         ]))
-    st_5._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_6, [
-        fac.UpdateInstruction(cc_5, True) ]))
-    st_6._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, False, containing_state=None)
-T_SIMP._Automaton = _BuildAutomaton_7()
-
-
-
-
-def _BuildAutomaton_8 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_8
-    del _BuildAutomaton_8
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 516, 5))
-    counters.add(cc_0)
-    cc_1 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 517, 5))
-    counters.add(cc_1)
-    cc_2 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 518, 5))
-    counters.add(cc_2)
-    cc_3 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 519, 5))
-    counters.add(cc_3)
-    cc_4 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 520, 5))
-    counters.add(cc_4)
-    states = []
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_0, False))
-    symbol = pyxb.binding.content.ElementUse(T_typeAttendu._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'typesimple')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 516, 5))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_1, False))
-    symbol = pyxb.binding.content.ElementUse(T_typeAttendu._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'matrice_double')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 517, 5))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_2, False))
-    symbol = pyxb.binding.content.ElementUse(T_typeAttendu._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'matrice_symetrique_double')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 518, 5))
-    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_2)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_3, False))
-    symbol = pyxb.binding.content.ElementUse(T_typeAttendu._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'tuple')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 519, 5))
-    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_3)
-    final_update = set()
-    final_update.add(fac.UpdateInstruction(cc_4, False))
-    symbol = pyxb.binding.content.ElementUse(T_typeAttendu._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'classe_utilisateur')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 520, 5))
-    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_4)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_1, True) ]))
-    st_1._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_2, True) ]))
-    st_2._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_3, True) ]))
-    st_3._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_4, True) ]))
-    st_4._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, True, containing_state=None)
-T_typeAttendu._Automaton = _BuildAutomaton_8()
-
-
-
-
-T_OPER._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typeCree'), T_classe_utilisateur, scope=T_OPER, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 7, 1)))
-
-def _BuildAutomaton_9 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_9
-    del _BuildAutomaton_9
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
-    counters.add(cc_0)
-    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
-    counters.add(cc_1)
-    states = []
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'regles')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'BLOC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 92, 4))
-    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_2)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'FACT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 93, 4))
-    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_3)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'SIMP')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 94, 4))
-    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_4)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'typeCree')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 104, 5))
-    st_5 = fac.State(symbol, is_initial=False, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_5)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_1, True) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    st_1._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    st_2._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    st_3._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    st_4._set_transitionSet(transitions)
-    transitions = []
-    st_5._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, False, containing_state=None)
-T_OPER._Automaton = _BuildAutomaton_9()
-
-
-
-
-def _BuildAutomaton_10 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_10
-    del _BuildAutomaton_10
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
-    counters.add(cc_0)
-    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
-    counters.add(cc_1)
-    states = []
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_PROC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'regles')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_PROC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_PROC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'BLOC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 92, 4))
-    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_2)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_PROC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'FACT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 93, 4))
-    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_3)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_PROC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'SIMP')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 94, 4))
-    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_4)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_1, True) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    st_1._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    st_2._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    st_3._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    st_4._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, False, containing_state=None)
-T_PROC._Automaton = _BuildAutomaton_10()
-
-
-
-
-def _BuildAutomaton_11 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_11
-    del _BuildAutomaton_11
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
-    counters.add(cc_0)
-    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
-    counters.add(cc_1)
-    states = []
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_FACT._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'regles')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_FACT._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_FACT._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'BLOC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 92, 4))
-    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_2)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_FACT._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'FACT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 93, 4))
-    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_3)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_FACT._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'SIMP')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 94, 4))
-    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_4)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_1, True) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    st_1._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    st_2._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    st_3._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    st_4._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, False, containing_state=None)
-T_FACT._Automaton = _BuildAutomaton_11()
-
-
-
-
-T_BLOC._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'condition'), T_fonction_python, scope=T_BLOC, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 45, 1)))
-
-def _BuildAutomaton_12 ():
-    # Remove this helper function from the namespace after it is invoked
-    global _BuildAutomaton_12
-    del _BuildAutomaton_12
-    import pyxb.utils.fac as fac
-
-    counters = set()
-    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
-    counters.add(cc_0)
-    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
-    counters.add(cc_1)
-    states = []
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'regles')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
-    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_0)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
-    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_1)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'BLOC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 92, 4))
-    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_2)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'FACT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 93, 4))
-    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_3)
-    final_update = None
-    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'SIMP')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 94, 4))
-    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_4)
-    final_update = set()
-    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'condition')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 162, 5))
-    st_5 = fac.State(symbol, is_initial=False, final_update=final_update, is_unordered_catenation=False)
-    states.append(st_5)
-    transitions = []
-    transitions.append(fac.Transition(st_0, [
-        fac.UpdateInstruction(cc_0, True) ]))
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_0, False) ]))
-    st_0._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_1, [
-        fac.UpdateInstruction(cc_1, True) ]))
-    transitions.append(fac.Transition(st_2, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_3, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    transitions.append(fac.Transition(st_4, [
-        fac.UpdateInstruction(cc_1, False) ]))
-    st_1._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    st_2._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    st_3._set_transitionSet(transitions)
-    transitions = []
-    transitions.append(fac.Transition(st_2, [
-         ]))
-    transitions.append(fac.Transition(st_3, [
-         ]))
-    transitions.append(fac.Transition(st_4, [
-         ]))
-    transitions.append(fac.Transition(st_5, [
-         ]))
-    st_4._set_transitionSet(transitions)
-    transitions = []
-    st_5._set_transitionSet(transitions)
-    return fac.Automaton(states, counters, False, containing_state=None)
-T_BLOC._Automaton = _BuildAutomaton_12()
-
-
-classeUtilisateurName._setSubstitutionGroup(typeAttendu)
diff --git a/Med/readerEfficas.py b/Med/readerEfficas.py
deleted file mode 100755 (executable)
index afd1249..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-import sys,os
-import raw.efficas as efficas
-import types
-
-sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..')))
-sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..','UiQT5')))
-
-
-from Accas import *
-
-
-# Attention pas d heritage possible (cf doc pyxbe)
-
-dictSIMPEficasXML= { 'typ'    : 'typeAttendu', 'statut'     : 'statut', 
-                     'min_occurs': 'min'        , 'max_occurs' : 'max', 
-                     'homo'      : 'homo'       , 'position'   : 'portee', 
-                     'validators': 'validators' , 'sug'        : 'valeur_sugg',
-                     'defaut'    : 'ValeurDef'  , 'into'       : ('PlageValeur','into'), 
-                     'val_min'   : ('PlageValeur','borne_inf') , 'val_max'    : ('PlageValeur','borne_sup'),
-                     'ang'       : ('doc','ang')               , 'fr'         : ('doc','fr',)   ,
-                     'docu'      : ('doc','docu'),}
-dictSIMPXMLEficas = {'doc' : {'fr' : 'fr' , 'ang' : 'ang' , 'docu' : 'docu' },
-                    'PlageValeur' : {'borne_sup' : 'val_max' , 'into' : 'into' , 'borne_inf' : 'val_min' ,},
-                    'statut' : 'statut' , 'validators' : 'validators' , 'homo' : 'homo' ,
-                    'ValeurDef' : 'defaut' ,  'min' : 'min_occurs' ,
-                    'valeur_sugg' : 'sug' , 'portee' : 'position' , 'max' : 'max_occurs' , }
-
-
-# ------------------------------
-class monSIMP (efficas.T_SIMP):
-# ------------------------------
-
-   def explore(self):
-      print "je passe dans  explore pour SIMP ", self.nom
-      self.dictArgsEficas={}
-      self.dictArgsEficas['typ']=self.typeAttendu
-      for nomXMLArg in dir(self) :
-          if nomXMLArg in dictSIMPXMLEficas.keys() :
-              nomEficasArg=dictSIMPXMLEficas[nomXMLArg]
-              argu=getattr(self,nomXMLArg)
-              if argu==None : continue
-              if type(nomEficasArg) == types.DictionaryType:
-                 for nomXML in nomEficasArg.keys():
-                      arguDecoupe=getattr(argu,nomXML)
-                      nomEficasDecoupe=nomEficasArg[nomXML]
-                      self.dictArgsEficas[nomEficasDecoupe]=arguDecoupe
-              else :
-                 self.dictArgsEficas[nomEficasArg] = argu
-                    
-              #if argNew != None : print argNew
-      self.objAccas=A_SIMP.SIMP(**self.dictArgsEficas)
-      self.objAccas.nom=self.nom
-     
-   def getAccasEquivalent(self):
-       return self.nom, self.objAccas
-
-# ------------------------------
-class monPROC(efficas.T_PROC):
-# ------------------------------
-   def explore(self):
-      print "je passe dans  explore pour PROC ", self.nom
-      self.dictConstruction={}
-      self.dictConstruction['nom']=self.nom
-      
-      for obj in self.content(): 
-          if  hasattr(obj,'explore') : obj.explore ()
-          if  hasattr(obj,'getAccasEquivalent') : 
-              nom,objetAccas=obj.getAccasEquivalent()
-              self.dictConstruction[nom]=objetAccas
-      self.dictConstruction['op']=None
-      self.objAccas=A_PROC.PROC(**self.dictConstruction)
-      print dir(self.objAccas)
-      print self.objAccas.entites
-
-
-# ------------------------------
-class monFACT(efficas.T_FACT):
-# ------------------------------
-   def explore(self):
-      #print "je passe dans  explore pour FACT ", self.nom
-      self.dictConstruction={}
-      for obj in self.content(): 
-          if  hasattr(obj,'explore') : obj.explore 
-          if  hasattr(obj,'creeAccasEquivalent') : 
-              nom,objetAccas=obj.creeAccasEquivalent()
-              self.dictConstruction[nom]=objetAccas
-      self.objAccas=A_FACT.FACT(**self.dictConstruction)
-
-   def getAccasEquivalent(self):
-       return self.nom, self.objAccas
-
-
-# ------------------------------
-class monCata(efficas.T_cata):
-# ------------------------------
-   def exploreCata(self):
-   # On positionne le contexte ACCAS
-      self.JdC = JDC_CATA (code = 'MED', execmodul = None,)
-      objAExplorer=self.commandes[0]
-      for obj in objAExplorer.content(): 
-         if  hasattr(obj,'explore') : obj.explore()
-    
-     
-
-efficas.T_SIMP._SetSupersedingClass(monSIMP)
-efficas.T_FACT._SetSupersedingClass(monFACT)
-efficas.T_PROC._SetSupersedingClass(monPROC)
-efficas.T_cata._SetSupersedingClass(monCata)
-
-if __name__ == "__main__":
-#   print dir(efficas)
-#   print dir(efficas.T_SIMP)
-
-
-   xml = open('Cata_MED_FAM.xml').read()
-   SchemaMed = efficas.CreateFromDocument(xml)
-   SchemaMed.exploreCata()
-
-   #print dir(efficas.T_SIMP)
-   #print dir(efficas.T_SIMP)
-
-   #for maCommande in monCata.commandes :
-   #    for monProc in maCommande.PROC:
-   #        for monFact in monProc.FACT:
-   #            for simp in monFact.SIMP:
-   #                simp.creeAccasEquivalent()
index 1ac832fc45d5991b3fa151c63d90bc901341e14d..5f3dea15d49370cb6c328576c80fd66366140169 100644 (file)
@@ -25,7 +25,7 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-  from builtins import object
+    from builtins import object
 except : pass
 
 class ASSD(object):
@@ -103,7 +103,7 @@ class ASSD(object):
         return self.etape[key]
 
     def setName(self, nom):
-        """Positionne le nom de self 
+        """Positionne le nom de self
         """
         self.nom = nom
 
@@ -217,13 +217,13 @@ class ASSD(object):
         return val == 'OUI'
 
 
-    def getEficasAttribut(self, attribut): 
+    def getEficasAttribut(self, attribut):
         #print ('getEficasAttribut : ', self, attribut)
         valeur=self.etape.getMocle(attribut)
         try :
-          valeur=self.etape.getMocle(attribut)
+            valeur=self.etape.getMocle(attribut)
         except :
-          valeur = None
+            valeur = None
         #print (valeur)
         return valeur
 
@@ -231,20 +231,24 @@ class ASSD(object):
         from .N_MCLIST import MCList
         #print ('getEficasListOfAttributs pour', self,listeAttributs)
         aTraiter=(self.etape,)
-        while len(listeAttributs) > 0 : 
-          attribut=listeAttributs.pop(0)
-          nvListe=[]
-          for mc in aTraiter :
-             try : 
-               resultat=mc.getMocle(attribut)
-               if isinstance(resultat,MCList): 
-                  for rmc in resultat : nvListe.append(rmc) 
-               else : nvListe.append(resultat)
-             except : pass
-          aTraiter=nvListe
+        while len(listeAttributs) > 0 :
+            attribut=listeAttributs.pop(0)
+            nvListe=[]
+            for mc in aTraiter :
+                try :
+                    resultat=mc.getMocle(attribut)
+                    if isinstance(resultat,MCList):
+                        for rmc in resultat : nvListe.append(rmc)
+                    else : nvListe.append(resultat)
+                except : pass
+            aTraiter=nvListe
         #print ('fin getEficasListOfAttributs ', nvListe)
         return nvListe
 
+    def ajouteUnPere(self,pere):
+        # ne fait rien mais est appeler pour tous les types de ASSD
+        pass
+
 class assd(ASSD):
 
     def __convert__(cls, valeur):
index 255b94fa9769471fe5cd14daa6983bf987d7d20e..aa565492e4476c474a5a520fec7f335d6e4040ec 100644 (file)
@@ -108,9 +108,7 @@ class BLOC(N_ENTITE.ENTITE):
            Cette méthode vérifie si le dictionnaire passé en argument (dict)
            est susceptible de contenir un bloc de mots-clés conforme Ã  la
            définition qu'il porte.
-
            Si la réponse est oui, la méthode retourne 1
-
            Si la réponse est non, la méthode retourne 0
 
            Le dictionnaire dict a pour clés les noms des mots-clés et pour valeurs
@@ -153,12 +151,12 @@ class BLOC(N_ENTITE.ENTITE):
 
 
 
-    
+
     def longueurDsArbre(self):
-      longueur=0
-      for mc in self.mcListe : 
-         longueur = longueur + mc.longueurDsArbre()
-      return longueur
+        longueur=0
+        for mc in self.mcListe :
+            longueur = longueur + mc.longueurDsArbre()
+        return longueur
 
 def blocUtils():
     """Définit un ensemble de fonctions utilisables pour Ã©crire les
index 2560cadc41d6070bd4f66a857c6752cd46ef6209..426caa461c3db00fbac61fa8dee3d776a62b15a8 100644 (file)
@@ -23,7 +23,7 @@
 
 from __future__ import absolute_import
 try:
-   from builtins import object
+    from builtins import object
 except : pass
 
 from .N_types import isInt, isFloat, isSequence
@@ -112,6 +112,17 @@ class UserASSDConversion(TypeConversion):
         #import traceback
         #traceback.print_stack()
         if o == None : return None
+        #print ('je cree UserASSDConversion', o, ' ', self.typeACreer)
+        nouvelObj=self.typeACreer(o)
+        return nouvelObj
+
+class UserASSDMultipleConversion(TypeConversion):
+    def __init__(self, classUser):
+        TypeConversion.__init__(self, classUser)
+
+    def function(self, o):
+        if o == None : return None
+        #print ('je cree dans UserASSDMultipleConversion', o, ' ', self.typeACreer)
         nouvelObj=self.typeACreer(o)
         return nouvelObj
 
@@ -124,6 +135,8 @@ def ConversionFactory(name, typ):
         if 'I' in typ   : return _convertI
         elif 'R' in typ : return _convertR
     if name == 'UserASSD':
-       #print(typ)
-       return (UserASSDConversion(typ))
+        #print(typ)
+        return (UserASSDConversion(typ))
+    if name == 'UserASSDMultiple':
+        return (UserASSDMultipleConversion(typ))
     return None
index 858f29b4ff19b094f1cdf86865ecd293ba01ece2..4ce27e7da2eec9c0f25e6b85e552a748cd8959fa 100644 (file)
 
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except :
-   pass
+    pass
 import six
 
 
index b1ca94f505efa8126d485d06d01ac90eb492e123..bdb2535088102fcf015830ba8a0ba4de7b88e6cf 100644 (file)
@@ -1,6 +1,6 @@
 # coding=utf-8
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except :
-   pass
+    pass
 import re
 from . import N_CR
 from . import N_OPS
@@ -70,6 +70,7 @@ class ENTITE(object):
         #self.doitSenregistrerComme = None
         self.txtNomComplet=''
         self.redefinit=False
+        self.dejaPrepareDump=False
 
     def affecter_parente(self):
         """
@@ -94,7 +95,7 @@ class ENTITE(object):
         """
             Cette methode doit retourner un objet dérivé de la classe OBJECT
         """
-     
+
         raise NotImplementedError("La méthode __call__ de la classe %s doit Ãªtre implémentée"
                                   % self.__class__.__name__)
 
@@ -262,58 +263,80 @@ class ENTITE(object):
 
     def checkPosition(self):
         """Vérifie l'attribut position."""
-        if self.position not in ('local', 'global', 'global_jdc'):
-            self.cr.fatal(_(u"L'attribut 'position' doit valoir 'local', 'global' "
+        if self.position not in ('local', 'global', 'global_jdc', 'inGetAttribut', 'reCalculeEtape'):
+            self.cr.fatal(_(u"L'attribut 'position' doit valoir 'local', 'global' ,'global_jdc', 'inGetAttribut', 'reCalculeEtape' "
                             u"ou 'global_jdc' : %r"), self.position)
 
     def nomComplet(self):
         if self.txtNomComplet  != '' : return self.txtNomComplet
         qui=self
         while hasattr(qui, 'pere' ):
-              self.txtNomComplet+='_'+qui.nom
-              qui=qui.pere
+            self.txtNomComplet+='_'+qui.nom
+            qui=qui.pere
         self.txtNomComplet+='_'+qui.nom
         return self.txtNomComplet
 
+    def geneaCompleteSousFormeDeListe(self):
+        geneaCompleteSousFormeDeListe=[]
+        qui=self
+        while hasattr(qui, 'pere' ):
+            geneaCompleteSousFormeDeListe.append(qui)
+            qui=qui.pere
+        geneaCompleteSousFormeDeListe.append(qui)
+        return geneaCompleteSousFormeDeListe
+
     def addDefinitionMC(self,listeMCAvant,**args):
         ouChercher=self
         for mot in listeMCAvant:
             try :
-              ouChercher=ouChercher.entites[mot]
+                ouChercher=ouChercher.entites[mot]
             except :
-              print ('impossible de trouver : ',mot,' ',listeMCAvant)
+                print ('impossible de trouver : ',mot,' ',listeMCAvant)
         (nomMC,defMC)=args.items()[0]
         defMC.pere = ouChercher
         defMC.pere.propageRedefinit()
         defMC.nom = nomMC
         cata = CONTEXT.getCurrentCata()
-        print (cata)
+        #print (cata)
         ouChercher.entites[nomMC]=defMC
 
     def changeDefinitionMC(self,listeMCAvant,**args):
         ouChercher=self
         for mot in listeMCAvant:
             try :
-              ouChercher=ouChercher.entites[mot]
+                ouChercher=ouChercher.entites[mot]
             except :
-              print ('impossible de trouver : ',mot,' ',listeMCAvant)
+                print ('impossible de trouver : ',mot,' ',listeMCAvant)
         monSIMP=ouChercher
         for (nomAttributDef,valeurAttributDef) in args.items():
-             if hasattr(monSIMP, nomAttributDef) :
-               setattr(monSIMP, nomAttributDef, valeurAttributDef) 
-             else :
-               print ('pb avec ', nomAttributdef,valeurAttributMC)
+            if hasattr(monSIMP, nomAttributDef) :
+                setattr(monSIMP, nomAttributDef, valeurAttributDef)
+            else :
+                print ('pb avec ', nomAttributdef,valeurAttributMC)
         monSIMP.propageRedefinit()
 
     def propageRedefinit(self):
-   # a reflechir
-       self.redefinit=True
-       # PNPN il faut remonter a l etape
-   
+    # a reflechir
+        self.redefinit=True
+        # PNPN il faut remonter a l etape
+
 
 
-    def makeObjetPourVerifSignature(self,**args):
-        etape = self.class_instance(oper=self, args=args)
+    def makeObjetPourVerifSignature(self,*args,**kwargs):
+        etape = self.class_instance(oper=self, args=kwargs)
         etape.MCBuild()
         return etape
 
+
+    def dumpStructure(self,decal=0):
+        if self.label == 'SIMP':
+            texte = decal * '   ' + self.nom + ' \n'
+            return texte
+        texte = decal * '   ' + self.nom
+        if self.label == 'BLOC' : texte+= " " + self.condition
+        if self.label == 'OPER' : texte+ " " + str(self.sd_prod) + "\n"
+        texte+=' \n'
+        for c in self.entites.values():
+            texte+=c.dumpStructure(decal+1)
+        texte += decal * '   ' + 'fin pour   ' + self.nom + ' \n'
+        return texte
index 2e6e4db910d9c0514e2c0e1ff8041c89b77ccf6e..1523bd4a4db06ec3ac0fdd391579a42510eecdb4 100644 (file)
@@ -27,9 +27,9 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
+    from builtins import str
 except :
-   pass
+    pass
 import types
 import sys
 import os
@@ -71,10 +71,10 @@ class ETAPE(N_MCCOMPO.MCCOMPO):
         # faut il le faire ds MC_Build ?
         # traitement de Pyxb si Pyxb
         self.dicoPyxbDeConstruction = args.get('dicoPyxbDeConstruction', None)
-        if self.dicoPyxbDeConstruction : 
+        if self.dicoPyxbDeConstruction :
             del args['dicoPyxbDeConstruction']
             self.objPyxbDeConstruction=self.dicoPyxbDeConstruction['objEnPyxb']
-        else : 
+        else :
             self.objPyxbDeConstruction=None
         self.definition = oper
         self.reuse = reuse
@@ -86,10 +86,12 @@ class ETAPE(N_MCCOMPO.MCCOMPO):
         self.idracine = oper.label
         self.appel = N_utils.calleeWhere(niveau)
         self.mc_globaux = {}
+        self.doitEtreRecalculee = False
         self.sd = None
         self.actif = 1
         self.makeRegister()
         self.icmd = None
+        self.userASSDCrees=[]
 
     def makeRegister(self):
         """
@@ -463,4 +465,3 @@ Causes possibles :
         # pourrait etre appelee par une commande fortran faisant appel a des fonctions python
         # on passe la main au parent
         return self.parent.getConcept(nomsd)
index 459c5b1732a3595f25e9cfa7228a9a37e56706fb..5ff4b37af6bbed8d0c171ab3821f45630b598d83 100644 (file)
@@ -1,6 +1,6 @@
 # coding=utf-8
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
index a6108272fe3fa0069c2487d919a5dfa4f19dff62..c5737a07940852de3c49eb46c083eb866c74d830 100644 (file)
@@ -54,7 +54,7 @@ class FACT(N_ENTITE.ENTITE):
     list_instance = N_MCLIST.MCList
     label = 'FACT'
 
-    def __init__(self, fr="", docu="", regles=(), statut='f', defaut=None,ang="",fenetreIhm=None, 
+    def __init__(self, fr="", docu="", regles=(), statut='f', defaut=None,ang="",fenetreIhm=None,
                  min=0, max=1, validators=None, **args):
         """
             Un mot-clé facteur est caractérisé par les attributs suivants :
@@ -134,34 +134,36 @@ class FACT(N_ENTITE.ENTITE):
             for v in val:
                 if type(v) == dict or isinstance(v, _F):
                     if dicoPyxbDeConstruction :
-                       objet = self.class_instance(
-                          nom=nom, definition=self, val=v, parent=parent,dicoPyxbDeConstruction=dicoPyxbDeConstruction[indice])
-                    else : 
-                       objet = self.class_instance(
-                          nom=nom, definition=self, val=v, parent=parent,dicoPyxbDeConstruction=None)
+                        objet = self.class_instance(
+                           nom=nom, definition=self, val=v, parent=parent,dicoPyxbDeConstruction=dicoPyxbDeConstruction[indice])
+                    else :
+                        objet = self.class_instance(
+                           nom=nom, definition=self, val=v, parent=parent,dicoPyxbDeConstruction=None)
                     indice=indice+1
                     l.append(objet)
                 elif isinstance(v, self.class_instance):
-# if faut gerer ici --> on passe la avec une liste de concept ? 
+# if faut gerer ici --> on passe la avec une liste de concept ?
 # PNPN --> si pyxb
                     l.append(v)
                 else:
                     l.append(N_OBJECT.ErrorObj(self, v, parent, nom))
         elif type(val) == dict or isinstance(val, _F):
-             if dicoPyxbDeConstruction :
+            if dicoPyxbDeConstruction :
                 objet = self.class_instance(
                    nom=nom, definition=self, val=val, parent=parent,dicoPyxbDeConstruction=dicoPyxbDeConstruction)
-             else : 
+            else :
                 objet = self.class_instance(
                 nom=nom, definition=self, val=val, parent=parent,dicoPyxbDeConstruction=None)
-             l.append(objet)
+            l.append(objet)
         elif isinstance(val, self.class_instance):
-# idem --> quand passe t on la 
+# idem --> quand passe t on la
             l.append(val)
         else:
             l.append(N_OBJECT.ErrorObj(self, val, parent, nom))
-        l.cata=l.jdc.cata
-        l.buildObjPyxb(l)
+        # pour tenir compte du validateFonction
+        if l.jdc :
+            l.cata=l.jdc.cata
+            l.buildObjPyxb(l)
         return l
 
     def verifCata(self):
@@ -172,5 +174,3 @@ class FACT(N_ENTITE.ENTITE):
         self.checkDocu()
         self.checkValidators()
         self.verifCataRegles()
-
-
index 72fe2969c0dfef3aeabddd5f5b87aa4f5cdfd6cb..537959f54dad49fc825abf8ef5e8c0da1e17def1 100644 (file)
 from __future__ import division
 from __future__ import absolute_import
 try :
-   from builtins import zip
-   from builtins import str
+    from builtins import zip
+    from builtins import str
 except :
-   pass
+    pass
 from math import sin, cos, tan, asin, acos, atan2, atan, sinh, cosh, tanh
 from math import pi, exp, log, log10, sqrt
 
index b12f002b37d1d21a246d48f401cd8f28789f80c5..4f1e7ba973b752aa105a9ffb974a79f65d13d44f 100644 (file)
@@ -26,8 +26,8 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import range
+    from builtins import str
+    from builtins import range
 except : pass
 import os
 import traceback
@@ -183,7 +183,7 @@ Causes possibles :
            Cette methode execute le jeu de commandes compile dans le contexte
            self.g_context de l'objet JDC
         """
-      
+
         CONTEXT.setCurrentStep(self)
         # Le module nommage utilise le module linecache pour acceder
         # au source des commandes du jeu de commandes.
@@ -199,10 +199,10 @@ Causes possibles :
                     init2 = "from " + obj_cata.__name__ + " import *"
                     exec(init2, self.g_context)
                 else :
-                   # ici on a un catalogue en grammaire Eficas XML
-                   # il faut ajouter ce qu on a construit au contexte
-                   for (k,v) in obj_cata.contexteXML.items() :
-                       self.g_context[k]=v
+                    # ici on a un catalogue en grammaire Eficas XML
+                    # il faut ajouter ce qu on a construit au contexte
+                    for (k,v) in obj_cata.contexteXML.items() :
+                        self.g_context[k]=v
             # Initialisation du contexte global pour l'evaluation des conditions de BLOC
             # On utilise une copie de l'initialisation du contexte du jdc
             self.condition_context = self.g_context.copy()
@@ -259,7 +259,7 @@ Causes possibles :
         except NameError as e:
             etype, value, tb = sys.exc_info()
             l = traceback.extract_tb(tb)
-            s = traceback.format_exception_only(NameError, e)
+            s = traceback.format_exception_only("Erreur de nom", e)[0][:-1]
             msg = "erreur de syntaxe,  %s ligne %d" % (s, l[-1][1])
             if CONTEXT.debug:
                 traceback.print_exc()
@@ -396,9 +396,9 @@ Causes possibles :
     def regUserSD(self,sd):
     # utilisee pour creer les references
     # se contente d appeler la methode equivalente sur le jdc
-      id=self.regSD(sd)
-      self.nommerSDProd(sd,sd.nom)
-      return id
+        id=self.regSD(sd)
+        self.nommerSDProd(sd,sd.nom)
+        return id
 
 
     def regSD(self, sd):
@@ -451,9 +451,9 @@ Causes possibles :
         #        if os.path.exists("fort." + str(unite)):
         #            fname = "fort." + str(unite)
         if fname == None:
-           raise AsException("Impossible de trouver le fichier correspondant")
+            raise AsException("Impossible de trouver le fichier correspondant")
         if not os.path.exists(fname):
-                raise AsException(fname + " n'est pas un fichier existant" )
+            raise AsException(fname + " n'est pas un fichier existant" )
         fproc = open(fname, 'r')
         text = fproc.read()
         fproc.close()
@@ -646,6 +646,17 @@ Causes possibles :
             print((' `- JDC sdAccessible : PAR_LOT =', self.parLot))
         return self.parLot == 'NON'
 
+    def getEtapesByName(self,name):
+        listeDEtapes=[]
+        for e in self.etapes :
+            if e.nom  == name : listeDEtapes.append(e) 
+        return listeDEtapes
+
+    def getEtapeByConceptName(self,conceptName):
+        for e in self.etapes :
+            if e.sdnom  == conceptName :  return e 
+
+
     def _build_reserved_kw_list(self):
         """Construit la liste des mots-cles reserves (interdits pour le
         nommage des concepts)."""
@@ -659,4 +670,3 @@ Causes possibles :
             ['OPER', 'MACRO', 'BLOC', 'SIMP', 'FACT', 'FORM',
              'GEOM', 'MCSIMP', 'MCFACT'])
 
-
index 7f9368ab11810f8cded326e49e4b88fe61206d87..3f6fcafa7e66c5513cbbc354a21fb61d3a2ee7ed 100644 (file)
@@ -48,12 +48,14 @@ class JDC_CATA(N_ENTITE.ENTITE):
     class_instance = N_JDC.JDC
     label = 'JDC'
 
-    def __init__(self, code='', execmodul=None, regles=(), niveaux=(),fichierSource=None, **args):
+    def __init__(self, code='', execmodul=None, regles=(), niveaux=(),fichierSource=None, fr='', ang ='', **args):
         """
         on se laisse la possibilite d initier fichierSource avec autre chose que le nom du fichier
         au cas ou ... pour pouvoir changer le nom du 'sous code' implementer (cf readercata)
         """
         self.code = code
+        self.fr = fr
+        self.ang = ang
         self.execmodul = execmodul
         if type(regles) == tuple:
             self.regles = regles
@@ -73,12 +75,16 @@ class JDC_CATA(N_ENTITE.ENTITE):
         CONTEXT.unsetCurrentCata()
         CONTEXT.setCurrentCata(self)
         self.fenetreIhm=None
+        self.definitUserASSD = False
+        self.definitUserASSDMultiple = False
         self.dictTypesXSD={}
-        self.listeDesTypesXSDRedefini=[]
+        self.dictTypesXSDJumeaux={}
         self.dictTypesASSDorUserASSDCrees={}
         self.dictTypesASSDorUserASSDUtilises={}
+        self.listeUserASSDDumpes=set()
+        self.listeTypeTXMAvecBlancs=set()
+
 
     def __call__(self, procedure=None, cata=None, cata_ord_dico=None,
                  nom='SansNom', parent=None, **args):
         """
@@ -141,3 +147,13 @@ class JDC_CATA(N_ENTITE.ENTITE):
              ou None s'il n'existe pas
         """
         return self.d_niveaux.get(nom_niveau, None)
+
+
+    def dumpStructure(self):
+        texte=""
+        for c in self.commandes:
+            if not(c.label != "OPER") and not(c.label != 'PROC')  : continue
+            if c.label == "OPER"  : texte+=c.nom + " "+ str(c.sd_prod) + "\n"
+            if c.label == "PROC"  : texte+=c.nom + " \n"
+            texte+=c.dumpStructure()
+        return texte
index 619b9676d3295593378c39e2330995dd64a7de72..4da07525abfcdeff913718865481400a71a3a6bf 100644 (file)
@@ -27,7 +27,7 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 import types
 import sys
index 007eac773095ea5f9c83387fed05c994c9434cce..212d7e2611236f37ffda79b7e6acb5cdb18b84b1 100644 (file)
@@ -64,6 +64,7 @@ class MCBLOC(N_MCCOMPO.MCCOMPO):
         self.valeur = val
         self.objPyxbDeConstruction=None
         self.dicoPyxbDeConstruction=dicoPyxbDeConstruction
+        self.estIdentifiePar=None
         if parent:
             self.jdc = self.parent.jdc
             self.niveau = self.parent.niveau
index 88ed885bc8f5e323718a04b5457578428094706a..934ba63696a79fb50bb79d7302008fecc2d56c86 100644 (file)
@@ -41,7 +41,7 @@ class MCCOMPO(N_OBJECT.OBJECT):
             Construit la liste des sous-entites du MCCOMPO
             Ã  partir du dictionnaire des arguments (valeur)
         """
-        
+
         #import traceback
         #traceback.print_stack()
         #print(("MCCOMPO.buildMc _____________________________________", self.nom))
@@ -56,7 +56,7 @@ class MCCOMPO(N_OBJECT.OBJECT):
         #print ('MCCOMPO___________________', self.valeur)
         if args == None: args = {}
         mcListe = []
-        
+
 
         # On recopie le dictionnaire des arguments pour protéger l'original des
         # delete (del args[k])
@@ -78,11 +78,11 @@ class MCCOMPO(N_OBJECT.OBJECT):
                 # si une valeur existe dans args ou est obligatoire (generique si toutes les
                 # entites ont l attribut statut )
                 #
-                if self.dicoPyxbDeConstruction and  k in self.dicoPyxbDeConstruction : 
-                   objPyxbDeConstruction=self.dicoPyxbDeConstruction[k]
-                   del self.dicoPyxbDeConstruction[k]
+                if self.dicoPyxbDeConstruction and  k in self.dicoPyxbDeConstruction :
+                    objPyxbDeConstruction=self.dicoPyxbDeConstruction[k]
+                    del self.dicoPyxbDeConstruction[k]
                 else :
-                   objPyxbDeConstruction=None
+                    objPyxbDeConstruction=None
                 #print (args.get(k, None))
                 objet = v(val=args.get(k, None), nom=k, parent=self,objPyxbDeConstruction=objPyxbDeConstruction)
                 mcListe.append(objet)
@@ -91,27 +91,30 @@ class MCCOMPO(N_OBJECT.OBJECT):
                 if hasattr(objet.definition, 'position'):
                     if objet.definition.position == 'global':
                         self.append_mc_global(objet)
+                    if objet.definition.position == 'reCalculeEtape':
+                        #print ('-------------------------- rencontre reCalculeEtape: ', objet.nom)
+                        self.append_mc_global_avecRecalcule(objet)
                     elif objet.definition.position == 'global_jdc':
                         self.append_mc_global_jdc(objet)
             if k in args:
                 del args[k]
 
         # Phase 1.2 : on traite les autres entites que SIMP
-        # (FACT en fait car un BLOC ne peut avoir le meme nom qu'un mot-clef)
+        # FACT ou listeDeFAct en fait car un BLOC ne peut etre present dans les args
         for k, v in list(self.definition.entites.items()):
-            if v.label == 'SIMP':
-                continue
+            if v.label == 'SIMP': continue
             if k in args or v.statut == 'o':
+                #print ('construit', k)
                 #
                 # Creation par appel de la methode __call__ de la definition de la sous entite k de self
                 # si une valeur existe dans args ou est obligatoire (generique si toutes les
                 # entites ont l attribut statut )
                 #
-                if self.dicoPyxbDeConstruction and  k in self.dicoPyxbDeConstruction : 
-                   dicoPyxbDeConstruction=self.dicoPyxbDeConstruction[k]
-                   del self.dicoPyxbDeConstruction[k]
+                if self.dicoPyxbDeConstruction and  k in self.dicoPyxbDeConstruction :
+                    dicoPyxbDeConstruction=self.dicoPyxbDeConstruction[k]
+                    del self.dicoPyxbDeConstruction[k]
                 else :
-                   dicoPyxbDeConstruction=None
+                    dicoPyxbDeConstruction=None
                 objet = v(val=args.get(k, None), nom=k, parent=self,dicoPyxbDeConstruction=dicoPyxbDeConstruction)
                 mcListe.append(objet)
             if k in args:
@@ -130,6 +133,7 @@ class MCCOMPO(N_OBJECT.OBJECT):
             dico_valeurs = self.creeDictCondition(mcListe, condition=1)
             globs = self.jdc and self.jdc.condition_context or {}
             if v.verifPresence(dico_valeurs, globs):
+                #print ('appel construit bloc', k, 'avec', args, 'a partir de', self.nom )
                     # Si le bloc existe :
                     #        1- on le construit
                     #        2- on l'ajoute Ã  mcListe
@@ -138,12 +142,18 @@ class MCCOMPO(N_OBJECT.OBJECT):
                 bloc = v(nom=k, val=args, parent=self,dicoPyxbDeConstruction=self.dicoPyxbDeConstruction)
                 mcListe.append(bloc)
                 args = bloc.reste_val
+                #print ('les args deviennent ', args)
                 # On ne recalcule pas le contexte car on ne tient pas compte des blocs
                 # pour Ã©valuer les conditions de présence des blocs
                 # dico_valeurs = self.creeDictValeurs(mcListe)
 
         # On conserve les arguments superflus dans l'attribut reste_val
+        # les reste_val des blocs  vont contenir trop de MC
+        # car ils sont appeles avec tous les MC de leur niveau qui n ont pas ete consommes
+        # et le reste_val n est pas remis a jour
+        # est-ce un pb ? a priori non
         self.reste_val = args
+        #print ('self.reste_val de ', self.nom, self.reste_val)
         # On ordonne la liste ainsi créée suivant l'ordre du catalogue
         # (utile seulement pour IHM graphique)
         mcListe = self.ordonneListe(mcListe)
@@ -151,17 +161,45 @@ class MCCOMPO(N_OBJECT.OBJECT):
         if self.jdc  : self.cata=self.jdc.cata
         else : self.cata = None
         self.buildObjPyxb(mcListe)
-        #else : print ('pas de construction pour ', self.nom, self.objPyxbDeConstruction)
-        #print ('buildObjPyxb : ' , self.nom)
-        #print(("MCCOMPO.buildMc fin_____________________________________", self.nom))
+        #print ('______________________________________ fin ', self.nom)
         return mcListe
 
-    def buildMcApresGlobal(self):
-        print ('Noyau ---------------- buildMcApresGlobal pour', self.nom)
+    def buildMcApresGlobalEnSuppression(self):
+        blocsDejaLa=[]
+        for mc in self.mcListe :
+            if mc.nature == 'MCBLOC' : blocsDejaLa.append(mc)
+        for mc in  blocsDejaLa :
+            dico_valeurs = self.creeDictCondition(self.mcListe, condition=1)
+            globs = self.jdc and self.jdc.condition_context or {}
+            defBloc = mc.definition
+            if not (defBloc.verifPresence(dico_valeurs, globs)):
+                self.suppEntite(mc)
+
+
+    def reConstruitResteVal(self):
+    # normal que apres buildMcApresGlobalEnCreation les reste_val ne soient pas corrects
+        for mc in self.mcListe :
+            if mc.nom in self.reste_val :
+                del self.reste_val[mc.nom]
+            if mc.nature == 'MCBLOC' :
+                ancetre=mc.parent
+                for mcFDuMc in mc.mcListe :
+                    while ancetre.nature == 'MCBLOC' :
+                        ancetre=ancetre.parent
+                        if mcFDuMc.nom in ancetre.reste_val : del ancetre.reste_val[mcFDuMc.nom]
+            if mc.nature == 'MCSIMP' : continue
+            if mc.nature == 'MCList' :
+                for mcObj in mc.data :
+                    mcObj.reConstruitResteVal()
+            else :
+                mc.reConstruitResteVal()
+
+
+    def buildMcApresGlobalEnCreation(self):
         nouveau_args = self.reste_val
         blocsDejaLa=[]
         for mc in self.mcListe :
-            if mc.nature == 'MCBLOC' : blocsDejaLa.append(mc.nom) 
+            if mc.nature == 'MCBLOC' : blocsDejaLa.append(mc.nom)
         for k, v in list(self.definition.entites.items()):
             if v.label != 'BLOC': continue
             if k in blocsDejaLa : continue
@@ -170,9 +208,11 @@ class MCCOMPO(N_OBJECT.OBJECT):
             if v.verifPresence(dico_valeurs, globs):
                 bloc = v(nom=k, val=nouveau_args, parent=self,dicoPyxbDeConstruction=self.dicoPyxbDeConstruction)
                 if bloc :
-                   self.mcListe.append(bloc)
-                   self.reste_val = bloc.reste_val
-       
+                    self.mcListe.append(bloc)
+                    bloc.addObjPyxb(self.chercheIndiceDsLeContenu(bloc))
+                    nouveau_args = self.reste_val
+                    self.reste_val = bloc.reste_val
+
 
     def ordonneListe(self, mcListe):
         """
@@ -302,18 +342,19 @@ class MCCOMPO(N_OBJECT.OBJECT):
             Cette méthode interroge la définition de self et retourne la liste des mots-clés fils
             directs de self de type 'global'.
             position='global' n'est donc possible (et n'a de sens) qu'au plus haut niveau.
+            du coup ici on ajoute les globaux de l etape qui sont dans mc_recalculeEtape
         """
+        #print ('je passe par ici', self.nom)
         dico = {}
         etape = self.getEtape()
         if not etape:
             return {}
         for k, v in list(etape.definition.entites.items()):
-            if v.label != 'SIMP':
-                continue
-            if v.position != 'global':
-                continue
-            if v.statut == 'o':
-                continue
+            if v.label != 'SIMP': continue
+            if v.position == 'local': continue
+            if v.position == 'inGetAttribut': continue
+            if v.position == 'reCalculeEtape': continue
+            if v.statut == 'o': continue
             obj = v(val=None, nom=k, parent=etape)
             dico[k] = obj.getValeur()
         return dico
@@ -398,6 +439,35 @@ class MCCOMPO(N_OBJECT.OBJECT):
 
         return None
 
+    def getChildOrChildInBloc(self, name, restreint='non'):
+    # cherche dans les fils et les fils des blocs
+    # tout est base sur le fait que deux freres ne peuvent pas avoir le meme nom
+    # dans des blocs non exclusifs, sinon le .comm n est pas du python valide
+        for v in self.mcListe:
+            if v.nom == name: return v
+        if restreint == 'non':
+            try:
+                entite = self.definition.entites[name]
+                if entite.label == 'SIMP' or (entite.label == 'FACT' and entite.statut in ('c', 'd')):
+                    return entite(None, name, None)
+            except:
+                pass
+        for v in self.mcListe:
+            if v.nature == 'MCBLOC' :
+                petitFils=v.getChildOrChildInBloc(name, restreint) 
+                if petitFils !=None :  return petitFils
+        return None
+
+    def append_mc_global_avecRecalcule(self, mc):
+        etape = self.getEtape()
+        if etape:
+            nom = mc.nom
+            if not(nom in etape.mc_globaux) :
+                etape.doitEtreRecalculee = True
+            etape.mc_globaux[nom] = mc
+            #print ('ajout de nom', mc.nom, 'ds les mc_globaux de', etape.nom)
+
+
     def append_mc_global(self, mc):
         """
            Ajoute le mot-clé mc Ã  la liste des mots-clés globaux de l'étape
@@ -417,11 +487,9 @@ class MCCOMPO(N_OBJECT.OBJECT):
     def copy(self):
         """ Retourne une copie de self """
         objet = self.makeobjet()
-        # FR : attention !!! avec makeobjet, objet a le meme parent que self
+        # attention !!! avec makeobjet, objet a le meme parent que self
         # ce qui n'est pas du tout bon dans le cas d'une copie !!!!!!!
-        # FR : peut-on passer par là autrement que dans le cas d'une copie ???
-        # FR --> je suppose que non
-        # XXX CCAR : le pb c'est qu'on vérifie ensuite quel parent avait l'objet
+        # le pb c'est qu'on vérifie ensuite quel parent avait l'objet
         # Il me semble preferable de changer le parent a la fin quand la copie
         # est acceptee
         objet.valeur = copy(self.valeur)
@@ -495,6 +563,21 @@ class MCCOMPO(N_OBJECT.OBJECT):
         return l
 
 
+    #def getSdCreeParObjetAvecFiltre(self,objetAssdMultiple):
+    # est-ce que si on est bloc, il faut passer Ã  parent ?
+    # ou prevoir une autre fonction qui tienne compte de cela
+    # ou prevoir un xpath
+    #   classeAChercher = objetAssdMultiple.definition.type
+    #   filtre  = objetAssdMultiple.definition.filtre
+    #   print ('getSdCreeParObjetAvecFiltre', classeAChercher, filtre)
+    #   dicoValeurs = self.creeDictCondition(self.mcListe, condition=1)
+    #   l=[]
+    #   for k,v in self.jdc.sdsDict.items():
+    #      if (isinstance(v, classeAChercher)) :
+    #         if v.executeExpression(filtre,dicoValeurs) : l.append(k)
+    #   return l
+
+
 
 def intersection_vide(dict1, dict2):
     """Verification qu'il n'y a pas de clé commune entre 'dict1' et 'dict2'."""
index 1b2bcd943f6eef9dcd86b5b2197d21bf05261161..1f539f08bc7ed72ab41825f8a89019bcb5a619ef 100644 (file)
@@ -47,14 +47,15 @@ class MCFACT(N_MCCOMPO.MCCOMPO):
         #traceback.print_stack()
         self.dicoPyxbDeConstruction=dicoPyxbDeConstruction
         if self.dicoPyxbDeConstruction :
-           self.objPyxbDeConstruction=self.dicoPyxbDeConstruction['objEnPyxb']
-           del self.dicoPyxbDeConstruction['objEnPyxb']
+            self.objPyxbDeConstruction=self.dicoPyxbDeConstruction['objEnPyxb']
+            del self.dicoPyxbDeConstruction['objEnPyxb']
         else :
-           self.objPyxbDeConstruction=None
+            self.objPyxbDeConstruction=None
         self.definition = definition
         self.nom = nom
         self.val = val
         self.parent = parent
+        self.estIdentifiePar=None
         self.valeur = self.getValeurEffective(self.val)
         if parent:
             self.jdc = self.parent.jdc
index edf97d337468b772da7c1c6fa481aa114600c8c8..45b096df39f90af0bc0ffc6b60edb7e67a026153 100644 (file)
 
 from __future__ import absolute_import
 try :
-   from future import standard_library
-   standard_library.install_aliases()
-except : 
-   pass
+    from future import standard_library
+    standard_library.install_aliases()
+except :
+    pass
 from copy import copy
 import types
 
 try:
-   from UserList import UserList
+    from UserList import UserList
 except ImportError:
-   from collections import UserList
+    from collections import UserList
 
 
 
@@ -117,6 +117,15 @@ class MCList(UserList):
         # print "Erreur : %s ne peut etre un descendant de %s" %(name,self.nom)
         return None
 
+    def getAllChild(self, name):
+    # A utiliser uniquement dans un filtre
+        maListeRetour= MCList()
+        for obj in self.data:
+            for objFils in obj.getChild(name) :
+                maListeRetour.append(objFils)
+        return maListeRetour
+
+
     def isBLOC(self):
         """
              Indique si l'objet est de type BLOC
@@ -242,7 +251,7 @@ class MCList(UserList):
                     del dico[i]
             dresu.append(dico)
         return dresu
-    
+
     def longueurDsArbre(self):
     # pour Pyxb : longueur  dans le orderedcontent de pyxb
         return len(self)
index 979bddae42b9cfa331e331de2c579e32803f1f13..b993b668e705505233f303964aef34440d73f2f3 100644 (file)
@@ -28,6 +28,7 @@ from __future__ import absolute_import
 from copy import copy
 
 from Noyau.N_ASSD import ASSD
+from Noyau.N_UserASSDMultiple import UserASSDMultiple
 from Noyau.N_CO import CO
 from . import N_OBJECT
 from .N_CONVERT import ConversionFactory
@@ -70,24 +71,28 @@ class MCSIMP(N_OBJECT.OBJECT):
             # Le mot cle simple a Ã©té créé sans parent
             # est-ce possible ?
             print ('je suis dans le else sans parent du build')
-            print (poum)
             self.jdc    = None
             self.cata   = None
             self.niveau = None
             self.etape  = None
-        if self.definition.creeDesObjets : 
-           self.convProto = ConversionFactory('UserASSD', self.definition.creeDesObjetsDeType)
-        else : 
-           self.convProto = ConversionFactory('type', typ=self.definition.type)
+        if self.definition.creeDesObjets :
+            if issubclass(self.definition.creeDesObjetsDeType, UserASSDMultiple) :
+                self.convProto = ConversionFactory('UserASSDMultiple', self.definition.creeDesObjetsDeType)
+            else :
+                self.convProto = ConversionFactory('UserASSD', self.definition.creeDesObjetsDeType)
+        else :
+            self.convProto = ConversionFactory('type', typ=self.definition.type)
         self.valeur = self.getValeurEffective(self.val)
         if self.definition.utiliseUneReference :
-          if self.valeur != None: 
-             if not type(self.valeur) in (list, tuple): self.valeur.ajoutUtilisePar(self)
-             else : 
-               #PNPN --> chgt pour Vimmp
-               for v in self.valeur : 
-                   try : v.ajoutUtilisePar(self)
-                   except : print ('il y a un souci ici', self.nom, self.valeur)
+            if self.valeur != None:
+                if not type(self.valeur) in (list, tuple): self.valeur.ajoutUtilisePar(self)
+                else :
+                    #PNPN --> chgt pour Vimmp
+                    for v in self.valeur :
+                        print (v, type(v))
+                        v.ajoutUtilisePar(self)
+                        #try : v.ajoutUtilisePar(self)
+                        #except : print ('il y a un souci ici', self.nom, self.valeur)
         self.buildObjPyxb()
         self.listeNomsObjsCrees = []
 
@@ -95,65 +100,101 @@ class MCSIMP(N_OBJECT.OBJECT):
         """
             Retourne la valeur effective du mot-clé en fonction
             de la valeur donnée. Defaut si val == None
+            Attention aux UserASSD et aux into (exple Wall gp de maille et 'Wall')
         """
+        #print ('getValeurEffective ________________', val)
         if (val is None and hasattr(self.definition, 'defaut')): val = self.definition.defaut
-        if self.jdc != None and val in list(self.jdc.sdsDict.keys()): return self.jdc.sdsDict[val]
-         # dans le cas de lecture de .comm, il est possible que l objet est deja ete cree
-         # peut-etre devrait on aussi verifier que val est de type string ?
-        if self.definition.creeDesObjets : 
-           # isinstance(val, self.definition.creeDesObjetsDeType) ne fonctionne pas car il y a un avec cata devant et l autre non
-           if val != None :
-             if  (not(val.__class__.__name__ == self.definition.creeDesObjetsDeType.__name__)) : 
-                 val=self.convProto.convert(val)
-             else :
-                 if val.nom=='sansNom' : 
-                    for leNom,laVariable in self.jdc.g_context.items():
-                      if id(laVariable)== id(val) and (leNom != 'sansNom'):
-                         val.initialiseNom(leNom)
-                 if val.parent== None : val.initialiseParent(self) 
-           return val
+        if self.definition.type[0] == 'TXM' and isinstance(val,str) : return val
+        if self.definition.creeDesObjets :
+            # isinstance(val, self.definition.creeDesObjetsDeType) ne fonctionne pas car il y a un avec cata devant et l autre non
+            if val == None : return val
+            if not isinstance(val,(list,tuple)) : valATraiter=[val,]
+            else : valATraiter=val
+            listeRetour=[]
+            for v in valATraiter:
+                #print (v.__class__.__name__, self.definition.creeDesObjetsDeType.__name__)
+                if  (not(v.__class__.__name__ == self.definition.creeDesObjetsDeType.__name__)) :
+                    if self.jdc != None and v in list(self.jdc.sdsDict.keys()): v=self.jdc.sdsDict[v]
+                    else : v=self.convProto.convert(v)
+                    if v.parent== None : v.initialiseParent(self)
+                    if issubclass(self.definition.creeDesObjetsDeType, UserASSDMultiple) :
+                        v.ajouteUnPere(self)
+                else :
+                    if v.nom=='sansNom' :
+                        for leNom,laVariable in self.jdc.g_context.items():
+                            #print (leNom,laVariable)
+                            if id(laVariable) == id(v) and (leNom != 'sansNom'):
+                                v.initialiseNom(leNom)
+                    if v.parent== None : v.initialiseParent(self)
+                    if issubclass(self.definition.creeDesObjetsDeType, UserASSDMultiple) :
+                        v.ajouteUnPere(self)
+                listeRetour.append(v)
+            if isinstance(val,(list,tuple)) :newVal=listeRetour
+            else : newVal=listeRetour[0]
+            return newVal
         if self.convProto:
-           val = self.convProto.convert(val)
+            val = self.convProto.convert(val)
         return val
 
     def creeUserASSDetSetValeur(self, val):
         self.state='changed'
         nomVal=val
         if nomVal in self.jdc.sdsDict.keys():
-           if isinstance(self.jdc.sdsDict[nomVal],self.definition.creeDesObjetsDeType): return (0, 'concept deja reference')
-           else : return (0, 'concept d un autre type existe deja')
+            if isinstance(self.jdc.sdsDict[nomVal],self.definition.creeDesObjetsDeType):
+                if issubclass(self.definition.creeDesObjetsDeType, UserASSDMultiple) :
+                    p=self.parent
+                    while p in self.parent :
+                        if hasattr(p, 'listeDesReferencesCrees') : p.listeDesReferencesCrees.append(self.jdc.sdsDict[nomVal])
+                        else : p.listeDesReferencesCrees=[self.jdc.sdsDict[nomVal],]
+                        p=p.parent
+                        self.jdc.sdsDict[nomVal].ajouteUnPere(self)
+                        #return (1, 'reference ajoutee')
+                else :
+                    return (0, 'concept non multiple deja reference')
+            else : return (0, 'concept d un autre type existe deja')
         if self.convProto:
             objVal = self.convProto.convert(nomVal)
             objVal.initialiseNom(nomVal)
-            if objVal.parent== None : objVal.initialiseParent(self) 
+            if objVal.parent== None : objVal.initialiseParent(self)
+            objVal.ajouteUnPere(self)
             p=self.parent
             while p in self.parent :
-                  print ('mise a jour de ',p)
-                  if hasattr(p, 'listeDesReferencesCrees') : p.listeDesReferencesCrees.append(objVal)
-                  else : p.listeDesReferencesCrees=(objVal,)
-                  p=p.parent
+                print ('mise a jour de ',p)
+                if hasattr(p, 'listeDesReferencesCrees') : p.listeDesReferencesCrees.append(objVal)
+                else : p.listeDesReferencesCrees=[objVal,]
+                p=p.parent
         return (self.setValeur(objVal), 'reference creee')
 
     def creeUserASSD(self, val):
         self.state='changed'
         nomVal=val
         if nomVal in self.jdc.sdsDict.keys():
-           if isinstance(self.jdc.sdsDict[nomVal],self.definition.creeDesObjetsDeType): return (0,None, 'concept deja reference')
-           else : return (0, None, 'concept d un autre type existe deja')
+            if isinstance(self.jdc.sdsDict[nomVal],self.definition.creeDesObjetsDeType):
+                if issubclass(self.definition.creeDesObjetsDeType, UserASSDMultiple) :
+                    p=self.parent
+                    while p in self.parent :
+                        if hasattr(p, 'listeDesReferencesCrees') : p.listeDesReferencesCrees.append(self.jdc.sdsDict[nomVal])
+                        else : p.listeDesReferencesCrees=[self.jdc.sdsDict[nomVal],]
+                        p=p.parent
+                        self.jdc.sdsDict[nomVal].ajouteUnPere(self)
+                        return (1,self.jdc.sdsDict[nomVal], 'reference ajoutee')
+                else : return (0, None, 'concept d un autre type existe deja')
+            else : return (0, None, 'concept d un autre type existe deja')
         if self.convProto:
             objVal = self.convProto.convert(nomVal)
             objVal.initialiseNom(nomVal)
+            objVal.ajouteUnPere(self)
         return (1, objVal, 'reference creee')
 
     def rattacheUserASSD(self, objASSD):
-        if objASSD.parent== None : objASSD.initialiseParent(self) 
+        if objASSD.parent== None : objASSD.initialiseParent(self)
         p=self.parent
         while p in self.parent :
-           if hasattr(p, 'listeDesReferencesCrees') : p.listeDesReferencesCrees.append(objASSD)
-           else : p.listeDesReferencesCrees=(objASSD,)
-           p=p.parent
+            if hasattr(p, 'listeDesReferencesCrees') : p.listeDesReferencesCrees.append(objASSD)
+            else : p.listeDesReferencesCrees=[objASSD,]
+            p=p.parent
+
 
-      
     def getValeur(self):
         """
             Retourne la "valeur" d'un mot-clé simple.
@@ -264,5 +305,64 @@ class MCSIMP(N_OBJECT.OBJECT):
                 if isinstance(co, CO) and co.isTypCO()]
 
     def supprime(self):
-        if hasattr(self, 'val') and hasattr(self.val, 'supprime') :self.val.supprime()
+        if not type(self.valeur) in (list, tuple): lesValeurs=(self.valeur,)
+        else : lesValeurs=self.valeur
+        if self.valeur == None or self.valeur == [] : lesValeurs=[]
+        for val in lesValeurs:
+            if self.definition.creeDesObjets : val.deleteReference(self)
+            else :
+                if (hasattr (val, 'enleveUtilisePar')) : val.enleveUtilisePar(self)
         N_OBJECT.OBJECT.supprime(self)
+
+    def getUserAssdPossible(self):
+        debug=False
+        if self.nom == 'ApplyOn' : debug = True
+        if debug : print ('____________', self, self.nom)
+        classeAChercher = self.definition.type
+        if debug : print ('____________', classeAChercher)
+        l=[]
+        dicoValeurs={}
+        d={}
+        if debug : print ('____________', self.definition.filtreVariables)
+        if self.definition.filtreVariables != None :
+            for (nomMC, Xpath) in self.definition.filtreVariables :
+                if debug : print (nomMC, Xpath)
+                if Xpath == None : dicoValeurs[nomMC] = getattr(self,nomMC)
+                else :
+                    try: #if 1 :
+                        pereMC=eval(Xpath)
+                        if debug : print ('pereMC :',pereMC)
+                        if pereMC :
+                            exp=Xpath+'.getChild("'+nomMC+'")'
+                            leMotCle=eval(exp)
+                        else : leMotCle=None
+                        if debug : print ('leMotCle', leMotCle)
+                        if leMotCle :
+                            if leMotCle.val : dicoValeurs[nomMC]=leMotCle.val
+                            elif leMotCle.definition.max != 1 : dicoValeurs[nomMC] = []
+                            else : dicoValeurs[nomMC] = None
+                            if debug : print ('dicoValeurs', dicoValeurs)
+                        else :
+                        #PN PN est-ce sur ? sinon quoi None ou []
+                        # je pense que les 2 valeurs doivent Ãªtre renseignees si le filtre depend de 2 valeurs
+                            return l
+                    except:
+                        return l
+
+
+        for k,v in self.parent.jdc.sdsDict.items():
+            if (isinstance(v, classeAChercher)) :
+                if debug : print ('je traite', v)
+                if self.definition.filtreExpression :
+                    if debug : print ('expression', self.definition.filtreExpression)
+                    if debug : 
+                       print (v.executeExpression(self.definition.filtreExpression ,dicoValeurs) )
+                    try :
+                        if v.executeExpression(self.definition.filtreExpression ,dicoValeurs) : l.append(v)
+                    except :
+                        print ('il faut comprendre except pour', self.nom)
+                        #print (self.nom)
+                        #print (self.parent.nom)
+                        #print (k,v)
+                else : l.append(v)
+        return l
index d7f829df212ddc331523b71be9b218c5e272177d..80f31056de66ebc88e0247000121d63c3fc3ea66 100644 (file)
@@ -24,9 +24,9 @@
 """
 from __future__ import absolute_import
 try :
-   from builtins import object
+    from builtins import object
 except :
-   pass 
+    pass
 from .N_CR import CR
 
 
@@ -109,7 +109,9 @@ class OBJECT(object):
         return 0
 
     def longueurDsArbre(self):
-      return 1
+        if self.nom == "Consigne" : return 0
+        if self.nom == "blocConsigne" : return 0
+        return 1
 
 
 
@@ -147,3 +149,29 @@ class ErrorObj(OBJECT):
         return self.cr
 
 
+def newGetattr(self,name):
+    try :
+       fils=self.getChildOrChildInBloc(name,restreint='non')
+       if fils : 
+          if fils.nature == 'MCSIMP' : return fils.valeur
+          if fils.nature == 'MCList' : 
+             if fils[0].definition.max == 1 : return fils[0]
+          return fils
+    except :
+       raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name))
+    raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name))
+
+def newGetattrForEtape(self,name):
+    try :
+       lesFils=self.getEtapesByName(name)
+       if lesFils != [] : return lesFils
+    except :
+       raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name))
+    raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name))
+
+def activeSurcharge():
+    from .N_MCCOMPO import MCCOMPO
+    MCCOMPO.__getattr__ = newGetattr
+    from .N_JDC import JDC
+    JDC.__getattr__ = newGetattrForEtape
+        
index 512b12184a5466b6260bcd3f877a81f2b32b0bff..0c13833a7b03c65e0f2344ac9306f9c823f736a6 100644 (file)
@@ -120,15 +120,24 @@ class OPER(N_ENTITE.ENTITE):
         self.affecter_parente()
         self.checkDefinition(self.nom)
         self.txtNomComplet=""
+        self.dejaPrepareDump=False
 
-    def __call__(self, reuse=None, **args):
+    def __call__(self, reuse=None, nomXML=None,**args):
         """
             Construit l'objet ETAPE a partir de sa definition (self),
             puis demande la construction de ses sous-objets et du concept produit.
         """
-        nomsd = self.nommage.getNomConceptResultat(self.nom)
+        if nomXML == None : nomsd = self.nommage.getNomConceptResultat(self.nom)
+        else : nomsd = nomXML
         etape = self.class_instance(oper=self, reuse=reuse, args=args)
         etape.MCBuild()
+        while etape.doitEtreRecalculee == True :
+            etape.doitEtreRecalculee = False
+            etape.deepUpdateConditionBlocApresCreation()
+            etape.reConstruitResteVal()
+            etape.state='modified'
+            #print ('on recalcule la validite depuis N_OPER')
+        #   etape.isValid(cr='oui')
         etape.metAJourNomASSD(nomsd)
         return etape.buildSd(nomsd)
 
index 9ff0efdd26c97145a775199c8ab964487afab468..d861fd87a69e432d965969d3478a6eb9dbe03dcc 100644 (file)
@@ -19,9 +19,9 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import object
+    from builtins import object
 except :
-   pass
+    pass
 from .N_utils import importObject
 
 
index 8e6a099385c73c0e1d822d1a1c7be6be03fe2344..f12d13f60483a88ec0fad5ee3b88ea2421698503 100644 (file)
@@ -115,6 +115,8 @@ class PROC(N_ENTITE.ENTITE):
         self.UIinfo = UIinfo
         self.affecter_parente()
         self.checkDefinition(self.nom)
+        self.dejaPrepareDump=False
+        self.txtNomComplet=''
 
     def __call__(self, **args):
         """
@@ -123,6 +125,10 @@ class PROC(N_ENTITE.ENTITE):
         """
         etape = self.class_instance(oper=self, args=args)
         etape.MCBuild()
+        while etape.doitEtreRecalculee == True :
+            etape.doitEtreRecalculee = False
+            etape.deepUpdateConditionBlocApresCreation()
+            etape.reConstruitResteVal()
         return etape.buildSd()
 
     def make_objet(self, mc_list='oui'):
index ff0fd8bec5a8dad6384f3d136140cfef981d7a44..062230c86e4b92473dd4d0bfae7b30d1a8862d54 100644 (file)
 """
 
 from __future__ import absolute_import
-try : 
-   from builtins import object
+try :
+    from builtins import object
 except :
-   pass
+    pass
 import types
 
 
index 8ba50089160e9e5f410fdd79619627e3f4dc7b90..89e9ed6839453106b5ac2c298a942f6cb7bf4e1a 100644 (file)
@@ -29,155 +29,154 @@ from .N_REGLE import REGLE
 
 # -----------------------------------------------------------------------------
 class CONCEPT_SENSIBLE(REGLE):
-   """Règle permettant de renseigner au niveau du catalogue comment sera
-   rempli le concept (valeur nominale ou dérivée(s) ou les deux...).
-   """
-   def __init__(self, mode, mocle='SENSIBILITE'):
-      """Constructeur.
-
-         mode : manière dont la commande rempli le concept
-            - 'ENSEMBLE' : concept nominal ET dérivées en une seule passe
-            - 'SEPARE'   : concept nominal OU dérivée (une ou plusieurs)
-            
-         mocle : mot-clé contenant les paramètres sensibles.
-      """
-      REGLE.__init__(self)
-      self.mocle = mocle
-      self._modes = { 'ENSEMBLE' : 0, 'SEPARE' : 1 }
-      self.mode = self._modes.get(mode, self._modes['ENSEMBLE'])
-
-   def getText(self):
-      """Pour EFICAS
-      """
-      return ''
-
-   def verif(self, args):
-      """Retourne texte + 1 si ok, 0 si nook.
-      On stocke dans sd.sensi l'étape courante, c'est-à-dire celle qui
-      renseigne le concept si cela n'a pas déjà Ã©té fait (car verif est
-      appelé Ã  chaque validation).
-      """
-      obj = args["self"]
-      etape = obj.etape
-      id_etape = '%s_%s' % (etape.id, id(etape))
-      if etape.sd == None:
-          return '',1
-      if not hasattr(etape.sd,"sensi"):
-         etape.sd.sensi = {}
-      # si ENSEMBLE, la sd nominale est forcément produite
-      if self.mode == self._modes['ENSEMBLE'] and not 'nominal' in etape.sd.sensi :
-         etape.sd.sensi['nominal'] = id_etape
-      # liste des paramètres sensibles
-      valeur = obj[self.mocle]
-      if valeur == None:
-         # pas de sensibilité, la sd nominale est produite
-         if not 'nominal' in etape.sd.sensi:
+    """Règle permettant de renseigner au niveau du catalogue comment sera
+    rempli le concept (valeur nominale ou dérivée(s) ou les deux...).
+    """
+    def __init__(self, mode, mocle='SENSIBILITE'):
+        """Constructeur.
+
+           mode : manière dont la commande rempli le concept
+              - 'ENSEMBLE' : concept nominal ET dérivées en une seule passe
+              - 'SEPARE'   : concept nominal OU dérivée (une ou plusieurs)
+
+           mocle : mot-clé contenant les paramètres sensibles.
+        """
+        REGLE.__init__(self)
+        self.mocle = mocle
+        self._modes = { 'ENSEMBLE' : 0, 'SEPARE' : 1 }
+        self.mode = self._modes.get(mode, self._modes['ENSEMBLE'])
+
+    def getText(self):
+        """Pour EFICAS
+        """
+        return ''
+
+    def verif(self, args):
+        """Retourne texte + 1 si ok, 0 si nook.
+        On stocke dans sd.sensi l'étape courante, c'est-à-dire celle qui
+        renseigne le concept si cela n'a pas déjà Ã©té fait (car verif est
+        appelé Ã  chaque validation).
+        """
+        obj = args["self"]
+        etape = obj.etape
+        id_etape = '%s_%s' % (etape.id, id(etape))
+        if etape.sd == None:
+            return '',1
+        if not hasattr(etape.sd,"sensi"):
+            etape.sd.sensi = {}
+        # si ENSEMBLE, la sd nominale est forcément produite
+        if self.mode == self._modes['ENSEMBLE'] and not 'nominal' in etape.sd.sensi :
             etape.sd.sensi['nominal'] = id_etape
-         return '', 1
-      if not type(valeur) in (list, tuple):
-         valeur = [valeur,]
-      for v in valeur:
-         if not v.getName() in etape.sd.sensi:
-            etape.sd.sensi[v.getName()] = id_etape
-      return '', 1
+        # liste des paramètres sensibles
+        valeur = obj[self.mocle]
+        if valeur == None:
+            # pas de sensibilité, la sd nominale est produite
+            if not 'nominal' in etape.sd.sensi:
+                etape.sd.sensi['nominal'] = id_etape
+            return '', 1
+        if not type(valeur) in (list, tuple):
+            valeur = [valeur,]
+        for v in valeur:
+            if not v.getName() in etape.sd.sensi:
+                etape.sd.sensi[v.getName()] = id_etape
+        return '', 1
 
 
 # -----------------------------------------------------------------------------
 class REUSE_SENSIBLE(REGLE):
-   """Limite le caractère réentrant de la commande.
-   On autorisera reuse seulement si le concept (au sens fortran) n'a pas déjà
-   Ã©té calculé (d'après sd.sensi). Ce sera interdit dans les cas suivants :
-      - sd nominale calculée et SENSIBILITE absent
-      - PS1 dans SENSIBILITE et sd dérivée par rapport Ã  PS1 calculée
-   """
-   def __init__(self, mocle='SENSIBILITE'):
-      """Constructeur.
-         mocle : mot-clé SENSIBILITE.
-      """
-      REGLE.__init__(self)
-      self.mocle = mocle
-
-   def getText(self):
-      """Pour EFICAS
-      """
-      return ''
-
-   def verif(self,args):
-      """Retourne texte + 1 si ok, 0 si nook = reuse interdit.
-      Comme CONCEPT_SENSIBLE est appelé avant (et Ã  chaque validation),
-      on regarde si sd.sensi[ps] a Ã©té renseigné par une Ã©tape précédente.
-      """
-      obj = args["self"]
-      etape = obj.etape
-      id_etape = '%s_%s' % (etape.id, id(etape))
-      sd = etape.sd
-      # si la commande n'est pas réentrante, rien Ã  faire
-      if etape.reuse is not None:
-         valeur = obj[self.mocle]
-         if valeur is None:
-            if not hasattr(sd, 'sensi') or sd.sensi.get('nominal', id_etape) != id_etape:
-               # pas de sensibilite et concept nominal déjà calculé : reuse interdit
-               text = "Commande non réentrante en l'absence de sensibilité."
-               return text, 0
-         else:
-            if not type(valeur) in (list, tuple):
-               valeur = [valeur,]
-            for ps in valeur:
-               if hasattr(sd, 'sensi') and sd.sensi.get(ps.nom, id_etape) != id_etape:
-                  # concept dérivé par rapport Ã  ps déjà calculé : reuse interdit
-                  text = "Commande non réentrante : dérivée par rapport Ã  %s déjà calculée" % ps.nom
-                  return text, 0
-      return '', 1
+    """Limite le caractère réentrant de la commande.
+    On autorisera reuse seulement si le concept (au sens fortran) n'a pas déjà
+    Ã©té calculé (d'après sd.sensi). Ce sera interdit dans les cas suivants :
+       - sd nominale calculée et SENSIBILITE absent
+       - PS1 dans SENSIBILITE et sd dérivée par rapport Ã  PS1 calculée
+    """
+    def __init__(self, mocle='SENSIBILITE'):
+        """Constructeur.
+           mocle : mot-clé SENSIBILITE.
+        """
+        REGLE.__init__(self)
+        self.mocle = mocle
+
+    def getText(self):
+        """Pour EFICAS
+        """
+        return ''
+
+    def verif(self,args):
+        """Retourne texte + 1 si ok, 0 si nook = reuse interdit.
+        Comme CONCEPT_SENSIBLE est appelé avant (et Ã  chaque validation),
+        on regarde si sd.sensi[ps] a Ã©té renseigné par une Ã©tape précédente.
+        """
+        obj = args["self"]
+        etape = obj.etape
+        id_etape = '%s_%s' % (etape.id, id(etape))
+        sd = etape.sd
+        # si la commande n'est pas réentrante, rien Ã  faire
+        if etape.reuse is not None:
+            valeur = obj[self.mocle]
+            if valeur is None:
+                if not hasattr(sd, 'sensi') or sd.sensi.get('nominal', id_etape) != id_etape:
+                    # pas de sensibilite et concept nominal déjà calculé : reuse interdit
+                    text = "Commande non réentrante en l'absence de sensibilité."
+                    return text, 0
+            else:
+                if not type(valeur) in (list, tuple):
+                    valeur = [valeur,]
+                for ps in valeur:
+                    if hasattr(sd, 'sensi') and sd.sensi.get(ps.nom, id_etape) != id_etape:
+                        # concept dérivé par rapport Ã  ps déjà calculé : reuse interdit
+                        text = "Commande non réentrante : dérivée par rapport Ã  %s déjà calculée" % ps.nom
+                        return text, 0
+        return '', 1
 
 
 # -----------------------------------------------------------------------------
 class DERIVABLE(REGLE):
-   """Déclare que le concept fourni derrière un mot-clé est dérivable.
-   Sa présence ne suffit pas Ã  le valider, il faut encore que son attribut
-   '.sensi' soit cohérent avec le contenu du mot-clé SENSIBILITE (ou l'absence
-   de celui-ci).
-   """
-   def __init__(self, mocle):
-      """Constructeur.
-         mocle : mot-clé dérivable.
-      """
-      REGLE.__init__(self)
-      self.mocle = mocle
-
-   def getText(self):
-      """Pour EFICAS
-      """
-      return ''
-
-   def verif(self,args):
-      """
-      """
-      obj = args["self"]
-      try:
-         concept = obj[self.mocle]
-      except IndexError:
-         return '', 1
-      if not type(concept) in (list, tuple):
-         concept = [concept,]
-      l_ps = obj["SENSIBILITE"]
-      for co in concept:
-         if co is None:
-            text = "Concept non défini (None) sous le mot-clé %s" % self.mocle
-            return text, 0
-         if not l_ps:
-            # pas de sensibilité
-            if hasattr(co,"sensi") and not co.sensi.get('nominal'):
-               text = "%s ne contient que des valeurs dérivées, utilisez le mot cle SENSIBILITE" %\
-                     co.nom
-               return text, 0
-         else:
-            # sensibilité spécifiée
-            if not type(l_ps) in (list, tuple):
-               l_ps = [l_ps,]
-            for ps in l_ps:
-               if not hasattr(co,"sensi") or not co.sensi.get(ps.nom):
-                  text = "La dérivée de %s par rapport Ã  %s n'est pas disponible." %\
-                        (co.nom, ps.nom)
-                  return text, 0
-      return '', 1
-
+    """Déclare que le concept fourni derrière un mot-clé est dérivable.
+    Sa présence ne suffit pas Ã  le valider, il faut encore que son attribut
+    '.sensi' soit cohérent avec le contenu du mot-clé SENSIBILITE (ou l'absence
+    de celui-ci).
+    """
+    def __init__(self, mocle):
+        """Constructeur.
+           mocle : mot-clé dérivable.
+        """
+        REGLE.__init__(self)
+        self.mocle = mocle
+
+    def getText(self):
+        """Pour EFICAS
+        """
+        return ''
+
+    def verif(self,args):
+        """
+        """
+        obj = args["self"]
+        try:
+            concept = obj[self.mocle]
+        except IndexError:
+            return '', 1
+        if not type(concept) in (list, tuple):
+            concept = [concept,]
+        l_ps = obj["SENSIBILITE"]
+        for co in concept:
+            if co is None:
+                text = "Concept non défini (None) sous le mot-clé %s" % self.mocle
+                return text, 0
+            if not l_ps:
+                # pas de sensibilité
+                if hasattr(co,"sensi") and not co.sensi.get('nominal'):
+                    text = "%s ne contient que des valeurs dérivées, utilisez le mot cle SENSIBILITE" %\
+                          co.nom
+                    return text, 0
+            else:
+                # sensibilité spécifiée
+                if not type(l_ps) in (list, tuple):
+                    l_ps = [l_ps,]
+                for ps in l_ps:
+                    if not hasattr(co,"sensi") or not co.sensi.get(ps.nom):
+                        text = "La dérivée de %s par rapport Ã  %s n'est pas disponible." %\
+                              (co.nom, ps.nom)
+                        return text, 0
+        return '', 1
index 34e22b204382c394f08c9ef8eae130180d8b2829..e8bc122201c6a3d54f4fc3175ef9cf8122a60ec8 100644 (file)
@@ -48,9 +48,10 @@ class SIMP(N_ENTITE.ENTITE):
     label = 'SIMP'
 
     def __init__(self, typ,ang="", fr="", statut='f', into=None, intoSug = None,siValide = None, defaut=None,
-                 min=1, max=1, homo=1, position='local',
+                 min=1, max=1, homo=1, position='local',filtre=None,
                  val_min=float('-inf'), val_max=float('inf'), docu="", validators=None, nomXML=None,
-                 sug=None,fenetreIhm=None, attribut=False,  sortie='n', intoXML=None):
+                 sug=None,fenetreIhm=None, attribut=False,  sortie='n', intoXML=None, metAJour=None,
+                 avecBlancs=False, unite=None):
         """
             Un mot-clé simple est caractérisé par les attributs suivants :
             - type : cet attribut est obligatoire et indique le type de valeur attendue
@@ -89,17 +90,20 @@ class SIMP(N_ENTITE.ENTITE):
         else:
             self.type = (typ,)
         for t in (self.type) :
-            try :   
-              if issubclass(t,Accas.UserASSD) : 
-                 creeDesObjetsDeType = t 
-                 self.utiliseUneReference = True
+            try :
+                if issubclass(t,Accas.UserASSDMultiple) :
+                    creeDesObjetsDeType = t
+                    self.utiliseUneReference = True
+                elif issubclass(t,Accas.UserASSD) :
+                    creeDesObjetsDeType = t
+                    self.utiliseUneReference = True
             except : pass
             if t == 'createObject' : self.creeDesObjets=True
-        if self.utiliseUneReference : 
-           if self.creeDesObjets : 
-                  self.utiliseUneReference = False
-                  self.creeDesObjetsDeType = creeDesObjetsDeType
-           else : self.utiliseDesObjetsDeType = creeDesObjetsDeType
+        if self.utiliseUneReference :
+            if self.creeDesObjets :
+                self.utiliseUneReference = False
+                self.creeDesObjetsDeType = creeDesObjetsDeType
+            else : self.utiliseDesObjetsDeType = creeDesObjetsDeType
         self.fr       = fr
         self.statut   = statut
         self.into     = into
@@ -124,6 +128,29 @@ class SIMP(N_ENTITE.ENTITE):
         self.nomXML     = nomXML
         self.intoXML    = intoXML
         self.sortie     = sortie
+        self.filtre     = filtre
+        self.avecBlancs = avecBlancs
+        self.unite      = unite
+        if not(self.avecBlancs) and self.max > 1 and 'TXM' in self.type and self.into != None :
+            for val in self.into :
+                if val.find(' ')  > -1: 
+                   self.avecBlancs = True  
+                   break
+        if not(self.avecBlancs) and self.max > 1 and 'TXM' in self.type and self.intoXML != None :
+            for val in self.intoXML :
+                if val.find(' ')  > -1: 
+                   self.avecBlancs = True  
+                   break
+        if self.avecBlancs and not ('TXM' in self.type) : 
+            print ('definition incoherente avecBlanc et non texte pour ', self) 
+            exit()
+        if self.filtre  :
+            self.filtreExpression = self.filtre[0]
+            self.filtreVariables = self.filtre[1]
+        else :
+            self.filtreExpression = []
+            self.filtreVariables = []
+        self.metAJour=metAJour
 
     def verifCata(self):
         """
@@ -137,7 +164,7 @@ class SIMP(N_ENTITE.ENTITE):
         self.checkInto()
         self.checkPosition()
         self.checkValidators()
-   
+
 
     def __call__(self, val, nom, parent=None, objPyxbDeConstruction = None):
         """
@@ -145,5 +172,3 @@ class SIMP(N_ENTITE.ENTITE):
             de sa valeur (val), de son nom (nom) et de son parent dans l arboresence (parent)
         """
         return self.class_instance(nom=nom, definition=self, val=val, parent=parent, objPyxbDeConstruction=objPyxbDeConstruction)
-
-           
diff --git a/Noyau/N_TUPLE.py b/Noyau/N_TUPLE.py
new file mode 100644 (file)
index 0000000..d4f9ccb
--- /dev/null
@@ -0,0 +1,87 @@
+import types
+import Accas
+import inspect
+class N_Tuple:
+    def __init__(self,ntuple):
+        self.ntuple=ntuple
+
+    def __convert__(self,valeur):
+        try:
+            if isinstance(valeur, basestring) : return None
+        except NameError:
+            if isinstance(valeur, str): return None
+        if len(valeur) != self.ntuple: return None
+        return valeur
+
+    def info(self):
+        return "Tuple de %s elements" % self.ntuple
+
+class N_Matrice:
+    def __init__(self, nbLigs=None, nbCols=None,
+                 methodeCalculTaille=None, formatSortie="ligne",
+                 valSup=None, valMin=None, structure=None, typElt='R',
+                 typEltInto=None, listeHeaders=None, coloree=False):
+        self.nbLigs = nbLigs
+        self.nbCols = nbCols
+        self.methodeCalculTaille = methodeCalculTaille
+        self.formatSortie = formatSortie
+        self.valSup = valSup
+        self.valMin = valMin
+        self.structure = structure
+        self.typElt = typElt
+        self.listeHeaders = listeHeaders
+        self.typEltInto = typEltInto
+        self.jdc=None
+        self.coloree=coloree
+        if self.coloree : self.activeCouleur()
+
+    def __convert__(self, valeur):
+        # Attention ne verifie pas grand chose
+        if not isinstance(valeur, types.ListType):
+            return None
+        return valeur
+
+    def verifItem(self,texte,mc):
+        val=''
+        if self.typElt == 'R' :
+            try    : val=float(str(texte)); ok=True
+            except : return (False,"Entrer un float SVP")
+        if self.typElt == 'I' :
+            try    : val=int(str(texte)); ok=True
+            except : return (False,"Entrer un float SVP")
+        if self.typElt in ('R', 'I') and self.valSup != None :
+            if val > self.valSup :
+               return (False, "Entrer un nombre inferieur a " + repr(self.valSup))
+        if self.typElt in ('R', 'I') and self.valMin != None :
+            if val < self.valMin :
+               return (False, "Entrer un nombre superieur a " + repr(self.valMin))
+        if val=='' : val = texte
+        if self.typEltInto != None and val not in self.typEltInto :
+                return ( "Entrer une valeur contenue dans " + str(self.typEltInto))
+        try :
+           if issubclass (self.typElt, Accas.ASSD):
+              if not self.jdc : self.jdc = CONTEXT.getCurrentJdC()
+              if not(val in self.jdc.sdsDict.keys()) : return (False, 'Concept inexistant')
+              if not (isinstance(self.jdc.sdsDict[val],self.typElt)) : return (False, 'Concept d un autre type')
+              a=self.jdc.getSdAvantDuBonType(mc.etape,(self.typElt,))
+              if texte not in self.jdc.getSdAvantDuBonType(mc.etape,(self.typElt,)) : 
+                 return (False, 'Le concept doit etre defini avant')
+        except :
+              pass
+        return ( True, "")
+
+    def convertItem(self,texte):
+        if self.typElt == 'R' : val=float(str(texte))
+        if self.typElt == 'I' : val=int(str(texte))
+        try : 
+          if issubclass (self.typElt, Accas.ASSD): return self.jdc.sdsDict[texte]
+        except : 
+          pass
+
+
+    def info(self):
+        return "Matrice %s x %s" % (self.nbLigs, self.nbCols)
+
+    __repr__ = info
+    __str__ = info
+
index a20f046f6adc67b54f7ef22d59801b225b611742..7f8a0f2fa790ec2fa105f9a43ec334b16da678fc 100644 (file)
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-  from builtins import object
+    from builtins import object
 except : pass
 import traceback
 import sys
 
 from .N_ASSD import ASSD
+from Ihm import CONNECTOR
 
 class UserASSD(ASSD):
     """
-       Classe de base pour definir des types de structures de donnees definie par 
+       Classe de base pour definir des types de structures de donnees definie par
        l utilisateur
        equivalent d un concept ASSD pour un SIMP ou un FACT
        Attention : le parent est a None au debut  et non le MC createur que l on ne connait pas
@@ -44,82 +45,125 @@ class UserASSD(ASSD):
     """
 
     def __init__(self,nom='sansNom'):
-       self.nom    = nom
-       self.jdc    = CONTEXT.getCurrentJdC()
-       self.parent = None 
-       self.initialiseValeur()
-       self.utilisePar = set()
-       if self.nom  != 'sansNom' : self.id = self.jdc.regSD(self)
-       else : self.id = None
-       self.ptr_sdj   = None
+        #print ('dans init de UserASSD pour ', nom, type(nom))
+        self.nom = nom
+        self.jdc = CONTEXT.getCurrentJdC()
+        self.parent = None
+        self.initialiseValeur()
+        self.utilisePar = set()
+        if self.nom  != 'sansNom' : self.id = self.jdc.regSD(self)
+        if self.nom  != 'sansNom' : self.initialiseNom(nom)
+        else : self.id = None
+        self.ptr_sdj   = None
 
 
     def initialiseParent(self, parent):
-       #print ('je passe initialiseParent pour : ', self, parent)
-       self.parent= parent
+    # attention parent.parent peut Ãªtre un bloc
+        #print ('je passe initialiseParent pour : ', self, parent.nom)
+        self.parent = parent
+        self.etape = self.parent.getEtape()
+        self.etape.userASSDCrees.append(self)
+        if self.parent.parent != self.etape :
+            if self.parent.parent.estIdentifiePar != None :
+                print ('il y a un souci dans l initialisation de l identifiant pour', self.parent.parent.nom)
+                print (self.parent.nom)
+                print (self.nom)
+            self.parent.parent.estIdentifiePar = self
 
     def initialiseNom(self,nom):
-       #print ('je passe initialiseNom pour : ', self, nom)
-       for (i,j)  in self.jdc.sdsDict.items() :
-          if j == self : 
-             del(self.jdc.sdsDict[i])
-       self.jdc.sdsDict[nom]=self
-       self.nom=nom
-       if self.nom != 'sansNom' and self.id ==None : self.id = self.jdc.regSD(self)
+        #print ('je passe initialiseNom pour : ', self, nom, type(nom))
+        for (i,j)  in list(self.jdc.sdsDict.items()) :
+            if j == self :
+                del(self.jdc.sdsDict[i])
+        self.jdc.sdsDict[nom]=self
+        self.nom=nom
+        if self.nom != 'sansNom' and self.id ==None : self.id = self.jdc.regSD(self)
 
     def initialiseValeur(self,valeur=None):
-       self.valeur=valeur
+        self.valeur=valeur
 
     def ajoutUtilisePar(self,mc):
-       self.utilisePar.add(mc)
+        #print ('je passe ajoutUtilisePar pour : ', self.nom)
+        self.utilisePar.add(mc)
 
     def enleveUtilisePar(self,mc):
-       try : self.utilisePar.remove(mc)
-       except : pass
+        try : self.utilisePar.remove(mc)
+        except : pass
 
     def renomme(self,nouveauNom):
-       self.jdc.delConcept(self.nom)
-       self.jdc.sdsDict[nouveauNom] = self
-       self.setName(nouveauNom)
-       #print ('je suis dans renomme',nouveauNom, self.nom)
-       #print (self.utilisePar)
-       for mc in (self.utilisePar):
-           mc.demandeRedessine()
-       
-
-    def deleteReference(self):
-       print ('dans deleteReference')
-       for MC in self.utilisePar : 
-           # le delete est appele en cascade par toute la hierachie
-           # du mcsimp (au cas ou on detruise le fact ou le proc)
-           # du coup pas beau
-           try :
-              if type(MC.valeur) in (list,tuple): 
-                 MC.valeur=list(MC.valeur)
-                 while MC in MC.valeur: MC.valeur.remove(self)
-                 if MC.valeur == [] : MC.Valeur = None
-              else : MC.valeur=None
-              MC.state='changed'
-              MC.isValid()
-              #MC.demandeRedessine()
-              self.jdc.delConcept(self.nom)
-           except :
-              pass
+        print ('je passe dans renomme')
+        self.jdc.delConcept(self.nom)
+        self.jdc.sdsDict[nouveauNom] = self
+        self.setName(nouveauNom)
+        #print ('je suis dans renomme',nouveauNom, self.nom)
+        #print (self.utilisePar)
+        for mc in (self.utilisePar):
+            mc.demandeRedessine()
+
+    def transfere (self,obj):
+    # uniquement utise pour les lectures XML
+        self.utilisePar=obj.utilisePar
+        self.id=obj.id
+        for mc in self.utilisePar: mc.valeur=self
+
+    def deleteReference(self, mcCreateur=None):
+        print ('je passe dans supprime de N_UserASSDMultiple')
+    # meme signature que UserASSDMultiple
+        for MC in self.utilisePar :
+            # le delete est appele en cascade par toute la hierachie
+            # du mcsimp (au cas ou on detruise le fact ou le proc)
+            # du coup pas beau
+            try :
+                if type(MC.valeur) in (list,tuple):
+                    MC.valeur=list(MC.valeur)
+                    while self in MC.valeur: MC.valeur.remove(self)
+                    if MC.valeur == [] : MC.Valeur = None
+                else : MC.valeur=None
+                MC.state='changed'
+                MC.isValid()
+                CONNECTOR.Emit(MC,"valid")
+            except : pass
+            # on peut avoir des listes qui contiennent plusieurs fois la meme valeur
+        self.jdc.delConcept(self.nom)
+
+    def executeExpression(self, condition, dico) :
+        #if self.nom == 'shape1' : print ('je suis dans executeExpression ', self.nom, ' ', condition)
+        dict = locals()
+        dict.update(dico)
+        #if self.nom == 'shape1' or self.nom == 'G1' : print (dict)
+        #if self.nom == 'shape1' :
+        #    print (self.getParentsWithId().getListeUserASSD("systemGeometryId"))
+        #    print (self.getParentsWithId().getListeUserASSD("SystemGeometryId"))
+        #    test = eval(condition, globals(), dict)
+        #    print ('-------------------------------------------------------------------------')
+        try :
+            test = eval(condition, globals(), dict)
+        except :
+            print ('executeExpression ', self.nom, ' ', condition , 'exception')
+            test = 0
+        return test
 
     def getEficasAttribut(self, attribut):
-       #print ('je suis dans getEficasAttr', attribut)
-       if self.parent == None : return None
-       #print ('apres if')
-       # parent est le SIMP donc c est bien parent.parent
-       try : 
-          valeur = self.parent.parent.getMocle(attribut)
-       except :
-          valeur = None
-       #print (valeur)
-       return valeur
-       
-        
-    def supprime(self):
-        self.deleteReference()
-        ASSD.supprime(self)
-        
+        #print ('je suis dans getEficasAttr', attribut)
+        if self.parent == None : return None
+        #print ('apres if')
+        # parent est le SIMP donc c est bien parent.parent
+        try :
+            valeur = self.parent.parent.getMocle(attribut)
+        except :
+            valeur = None
+        #print (valeur)
+        return valeur
+
+
+    def supprime(self, mcCreateur=None):
+    # mcCreateur utile pour N_UserASSDMultiple
+        print ('je passe dans supprime de N_UserASSDMultiple')
+        self.deleteReference(mcCreateur)
+
+    def __repr__(self):
+        return "concept " + self.getName() + " type " + self.__class__.__name__
+
+    def __str__(self):
+        return self.getName() or "<None>"
+
diff --git a/Noyau/N_UserASSDMultiple.py b/Noyau/N_UserASSDMultiple.py
new file mode 100644 (file)
index 0000000..d2dc560
--- /dev/null
@@ -0,0 +1,124 @@
+# coding=utf-8
+# Copyright (C) 2007-2021   EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+"""
+
+"""
+
+from __future__ import absolute_import
+from __future__ import print_function
+try :
+    from builtins import object
+except : pass
+import traceback
+import sys
+
+from .N_UserASSD import UserASSD
+from .N_ASSD import ASSD
+
+from collections import UserList
+class UserASSDMultiple(UserASSD):
+    """
+       Classe de base pour definir des types de structures de donnees definie par
+       l utilisateur
+       equivalent d un concept ASSD pour un SIMP ou un FACT
+       mais pouvant referencer 2 objets par exemple les groupes de mailles qui peuvent porter
+       le meme nom dans 2 maillages differents
+    """
+    def __init__(self,nom='sansNom'):
+        #print ('dans init de UserASSDMultiple ',nom)
+        UserASSD.__init__(self,nom)
+        self.peres=[]
+
+    def ajouteUnPere(self,pere):
+        #print ('dans ajouteUnPere', self.peres, self.nom, pere)
+        if pere not in self.peres : self.peres.append(pere)
+        etape = pere.getEtape()
+        if self not in etape.userASSDCrees : etape.userASSDCrees.append(self)
+
+    def renomme(self,nouveauNom):
+        print ('je passe dans renomme')
+        #import traceback
+        #traceback.print_stack()
+        self.jdc.delConcept(self.nom)
+        self.jdc.sdsDict[nouveauNom] = self
+        self.setName(nouveauNom)
+        for mc in (self.utilisePar):
+            mc.demandeRedessine()
+
+
+    def initialiseParent(self, pere):
+        # surcharge N_UserASSD  parent ici n a pas de sens
+        pass
+
+    def deleteReference(self,mcCreateur):
+        print ('je passe dans deleteReference', mcCreateur.nom)
+        if not(mcCreateur in self.peres) : return
+        self.peres.pop(self.peres.index(mcCreateur))
+        if len(self.peres)==0 :
+            UserASSD.deleteReference(self)
+
+
+    def getParentsWithId(self):
+        #print ('je suis dans getParentsWithId ')
+        listeRetour= listUserASSD()
+        for pere in self.peres :
+            pereWithId = pere.parent
+            monEtape = pere.getEtape()
+            while (pereWithId) :
+                if pereWithId==monEtape :
+                    listeRetour.append(pereWithId)
+                    break
+                if pereWithId.estIdentifiePar != None :
+                    listeRetour.append(pereWithId)
+                    break
+                pereWithId=pereWithId.parent
+        return listeRetour
+
+    def getEtapes(self):
+        listeRetour= listUserASSD()
+        for pere in self.peres :
+            if pere.etape not in listeRetour : listeRetour.append(pere.etape)
+        return listeRetour
+
+
+class listUserASSD(UserList):
+
+    def getListeMotsCles(self,nomMc):
+        if self.data == None : return []
+        listeRetour=[]
+        for concept in self.data:
+            listeRetour.append(concept.getChild(nomMc).val)
+        return listeRetour
+
+    def getListeNomsUserASSD(self,nomMc):
+        if self.data == None : return []
+        listeRetour=[]
+        for concept in self.data:
+            listeRetour.append(concept.getChild(nomMc).val.nom)
+        return listeRetour
+
+    def getListeUserASSD(self,nomMc):
+        if self.data == None : return []
+        listeRetour=[]
+        for concept in self.data:
+            if concept.getChild(nomMc) :
+                if concept.getChild(nomMc).val :
+                    listeRetour.append(concept.getChild(nomMc).val)
+        return listeRetour
index b49decfcf5d434b2aad82fe5c67a9950d04462d6..6eb770ea79d721a6d149d19c76f97cec8e8f14b9 100644 (file)
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
-   
+
 import types
 import traceback
 import re
@@ -158,19 +158,19 @@ class TypeProtocol(PProtocol):
                 if self.isComplexe(obj):
                     return obj
             elif type_permis == 'TXM':
-                if isStr(obj): 
-                   return obj
+                if isStr(obj):
+                    return obj
             elif type_permis == 'shell':
                 if isStr(obj):
                     return obj
             elif type_permis == 'Fichier':
                 import os
                 try :
-                   if (len(typ) > 2 and typ[2] == "Sauvegarde") or os.path.isfile(obj):
-                      return obj
-                   else:
-                    raise ValError( "%s n'est pas un fichier valide" % repr(obj))
-                except : 
+                    if (len(typ) > 2 and typ[2] == "Sauvegarde") or os.path.isfile(obj):
+                        return obj
+                    else:
+                        raise ValError( "%s n'est pas un fichier valide" % repr(obj))
+                except :
                     raise ValError( "%s n'est pas un fichier valide" % repr(obj))
 
             elif type_permis == 'FichierNoAbs':
@@ -182,18 +182,18 @@ class TypeProtocol(PProtocol):
 
             elif type_permis == 'Repertoire':
                 import os
-                try : 
-                  if os.path.isdir(obj): return obj
-                  else: raise ValError( "%s n'est pas un repertoire valide" % repr(obj))
+                try :
+                    if os.path.isdir(obj): return obj
+                    else: raise ValError( "%s n'est pas un repertoire valide" % repr(obj))
                 except :
-                  raise ValError( "%s n'est pas un repertoire valide" % repr(obj))
+                    raise ValError( "%s n'est pas un repertoire valide" % repr(obj))
             elif type_permis == 'FichierOuRepertoire':
                 import os
-                try : 
-                  if os.path.isdir(obj) or os.path.isfile(obj): return obj
-                  else: raise ValError( "%s n'est pas un fichier ou un repertoire valide" % repr(obj))
+                try :
+                    if os.path.isdir(obj) or os.path.isfile(obj): return obj
+                    else: raise ValError( "%s n'est pas un fichier ou un repertoire valide" % repr(obj))
                 except :
-                  raise ValError( "%s n'est pas un fichier ou un repertoire valide" % repr(obj))
+                    raise ValError( "%s n'est pas un fichier ou un repertoire valide" % repr(obj))
             elif type(type_permis) == type or isinstance(type_permis, type):
                 try:
                     if self.isObjectFrom(obj, type_permis):
@@ -286,16 +286,16 @@ class IntoProtocol(PProtocol):
     registry = {}
 
     def __init__(self, name, into=None, val_min=float('-inf'), val_max=float('inf')):
-     
+
         PProtocol.__init__(
             self, name, into=into, val_min=val_min, val_max=val_max)
         self.val_min = val_min
         self.val_max = val_max
 
     def default(self, obj, into, val_min, val_max):
-        if type(into)  ==types.FunctionType : 
-               maListeDeValeur=into()
-               into=maListeDeValeur
+        if type(into)  ==types.FunctionType :
+            maListeDeValeur=into()
+            into=maListeDeValeur
         if into:
             if obj not in into:
                 raise ValError(
@@ -1622,7 +1622,7 @@ class VerifTypeTuple(ListVal):
             if type(valeur) == bytes or type(valeur) == str:
                 return 1
         elif isinstance(valeur, type_permis):
-                return 1
+            return 1
         return 0
 
     def verif(self, valeur):
@@ -1747,7 +1747,7 @@ class CreeMotClef(object):
     def __init__(self,MotClef ):
         self.MotClef=MotClef
         self.MCSimp=None
-         
+
     def convert(self, lval):
         try : valeur=lval[0]
         except  : return lval
@@ -1760,20 +1760,20 @@ class CreeMotClef(object):
         else : longueur=len(parent.getChild(self.MotClef))
 
         pos=parent.getIndexChild(self.MCSimp.nom)+1
-        while longueur < valeur : 
-           parent.inhibeValidator=1
-           parent.addEntite(self.MotClef,pos)
-           pos=pos+1
-           parent.inhibeValidator=0
-           longueur=len(parent.getChild(self.MotClef))
-
-        if longueur > valeur : 
-           parent.inhibeValide=1
-           parentObj=parent.getChild(self.MotClef)
-           obj=parent.getChild(self.MotClef)[-1]
-           parentObj.suppEntite(obj)
-           longueur=len(parent.getChild(self.MotClef))
-           parent.inhibeValide=0
+        while longueur < valeur :
+            parent.inhibeValidator=1
+            parent.addEntite(self.MotClef,pos)
+            pos=pos+1
+            parent.inhibeValidator=0
+            longueur=len(parent.getChild(self.MotClef))
+
+        if longueur > valeur :
+            parent.inhibeValide=1
+            parentObj=parent.getChild(self.MotClef)
+            obj=parent.getChild(self.MotClef)[-1]
+            parentObj.suppEntite(obj)
+            longueur=len(parent.getChild(self.MotClef))
+            parent.inhibeValide=0
         return lval
 
     def info(self):
index 122719d274320d5292da49bab076a02f3ee6ee64..07a405d9eb5828031e6424c8c7232cbddf3458f8 100644 (file)
 
 from __future__ import absolute_import
 try :
-   from past.builtins import cmp
+    from past.builtins import cmp
 except :
-   pass
+    pass
 try:
-   from UserDict import UserDict
+    from UserDict import UserDict
 except ImportError:
-   from collections import UserDict
+    from collections import UserDict
 
 
 class _F(UserDict):
index 21e928fd37e309e048cf9355af0a3e03e7a249f5..5e1ba24a9004291cbfb991d1434e77c7d81fbebb 100644 (file)
@@ -27,10 +27,10 @@ from __future__ import absolute_import
 from __future__ import print_function
 from __future__ import division
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except :
-   pass
+    pass
 import sys
 
 # Modules EFICAS
@@ -41,9 +41,9 @@ from .strfunc import getEncoding
 SEP = '_'
 
 try :
-  cur_frame = sys._getframe
+    cur_frame = sys._getframe
 except :
-  print ('pb avec la version de python pour cur_frame = sys._getframe')
+    print ('pb avec la version de python pour cur_frame = sys._getframe')
 
 def calleeWhere(niveau=4):
     """
index f2ab7062d05d87654c63fff378a688f4ffcfdea5..fbbfde0df7c81fcdbd5dc5dca8984212e554c543 100644 (file)
@@ -1,6 +1,6 @@
 # coding=utf-8
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -35,11 +35,11 @@ from __future__ import absolute_import
 from . import context
 
 try :
-   import __builtin__
-   __builtin__.CONTEXT = context
-except : 
-   import builtins
-   builtins.CONTEXT = context
+    import __builtin__
+    __builtin__.CONTEXT = context
+except :
+    import builtins
+    builtins.CONTEXT = context
 
 
 # Classes de base
index 0101982f8e0e965537ceefab8c5f81f0e33cd091..602800fe2e151d92914ea0a596045a06381651f2 100644 (file)
@@ -1,6 +1,6 @@
 # coding=utf-8
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
index a636018e1ef542c31261ef2fd5441ef19c85ea26..93c8db067a7da46f27253022b22f4fdde3baf1d9 100644 (file)
@@ -36,9 +36,9 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except :
-   pass
+    pass
 import re
 import linecache
 import sys
@@ -76,10 +76,10 @@ def _getNomConceptResultat(ope, level=2):
     # lineno = f_lineno(f)  # Ne marche pas toujours
     co = f.f_code
     if sys.version_info >= (3,0) :
-       filename = co.co_filename
-    else : 
-       import six
-       filename = six.text_type(co.co_filename, getEncoding())
+        filename = co.co_filename
+    else :
+        import six
+        filename = six.text_type(co.co_filename, getEncoding())
     name = co.co_name
     # pattern pour identifier le debut de la commande
     pattern_oper = re.compile(regex1 % ope)
index b4565567a1936761f1b5c29eb13cfa71e33bd423..4bb51c42eb3856384a99110bd00584c7fd7d7d9b 100644 (file)
@@ -24,7 +24,7 @@ de chaines de caractères
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import locale
diff --git a/OldCodes/Med/Cata_MED_FAM.xml b/OldCodes/Med/Cata_MED_FAM.xml
new file mode 100755 (executable)
index 0000000..75acb49
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<cata xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://chercheurs.edf.com/logiciels/efficas file:///Z:/home_fayolle/MED_SVN/PASCALE/XSD/Model%20Efficas%20(1.1)%20%20v5.xsd">\r
+<commandes>\r
+<PROC xmlns:efficas="http://chercheurs.edf.com/logiciels/efficas" efficas:nom="FAS">\r
+  <efficas:FACT efficas:nom="FAMILY_MESH_NAME_REF" efficas:statut="o" efficas:min_occurs="1" efficas:max_occurs="-1">\r
+               <SIMP efficas:nom="NAME" efficas:statut="o"><typeAttendu>TXM</typeAttendu></SIMP>\r
+               <efficas:FACT efficas:nom="ELEM" efficas:statut="f"  efficas:min_occurs="1" efficas:max_occurs="-1">\r
+<!--                <efficas:regles>\r
+                       --><!-- Ajouter des contraintes de vérification de la présence ATT et GRO --><!--\r
+                               <efficas:PRESENT_PRESENT>ATT GRO</efficas:PRESENT_PRESENT>\r
+                    </efficas:regles>-->\r
+                       <efficas:SIMP efficas:nom="NUM" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
+                       <efficas:SIMP efficas:nom="NAME" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
+                       <efficas:FACT efficas:nom="ATT" efficas:statut="f"  efficas:max_occurs="1">\r
+                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
+                               <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
+                               <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
+                               <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
+                       </efficas:FACT>\r
+                       <efficas:FACT efficas:nom="GRO" efficas:statut="f" efficas:max_occurs="1">\r
+                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
+                           <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
+                       </efficas:FACT>\r
+               </efficas:FACT>\r
+       </efficas:FACT>\r
+</PROC>\r
+</commandes>\r
+</cata>\r
diff --git a/OldCodes/Med/Cata_MED_FAM.xml.mini b/OldCodes/Med/Cata_MED_FAM.xml.mini
new file mode 100755 (executable)
index 0000000..75acb49
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<cata xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://chercheurs.edf.com/logiciels/efficas file:///Z:/home_fayolle/MED_SVN/PASCALE/XSD/Model%20Efficas%20(1.1)%20%20v5.xsd">\r
+<commandes>\r
+<PROC xmlns:efficas="http://chercheurs.edf.com/logiciels/efficas" efficas:nom="FAS">\r
+  <efficas:FACT efficas:nom="FAMILY_MESH_NAME_REF" efficas:statut="o" efficas:min_occurs="1" efficas:max_occurs="-1">\r
+               <SIMP efficas:nom="NAME" efficas:statut="o"><typeAttendu>TXM</typeAttendu></SIMP>\r
+               <efficas:FACT efficas:nom="ELEM" efficas:statut="f"  efficas:min_occurs="1" efficas:max_occurs="-1">\r
+<!--                <efficas:regles>\r
+                       --><!-- Ajouter des contraintes de vérification de la présence ATT et GRO --><!--\r
+                               <efficas:PRESENT_PRESENT>ATT GRO</efficas:PRESENT_PRESENT>\r
+                    </efficas:regles>-->\r
+                       <efficas:SIMP efficas:nom="NUM" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
+                       <efficas:SIMP efficas:nom="NAME" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
+                       <efficas:FACT efficas:nom="ATT" efficas:statut="f"  efficas:max_occurs="1">\r
+                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
+                               <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
+                               <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
+                               <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
+                       </efficas:FACT>\r
+                       <efficas:FACT efficas:nom="GRO" efficas:statut="f" efficas:max_occurs="1">\r
+                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
+                           <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
+                       </efficas:FACT>\r
+               </efficas:FACT>\r
+       </efficas:FACT>\r
+</PROC>\r
+</commandes>\r
+</cata>\r
diff --git a/OldCodes/Med/Cata_MED_FAM.xml.origin b/OldCodes/Med/Cata_MED_FAM.xml.origin
new file mode 100755 (executable)
index 0000000..75acb49
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<cata xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://chercheurs.edf.com/logiciels/efficas file:///Z:/home_fayolle/MED_SVN/PASCALE/XSD/Model%20Efficas%20(1.1)%20%20v5.xsd">\r
+<commandes>\r
+<PROC xmlns:efficas="http://chercheurs.edf.com/logiciels/efficas" efficas:nom="FAS">\r
+  <efficas:FACT efficas:nom="FAMILY_MESH_NAME_REF" efficas:statut="o" efficas:min_occurs="1" efficas:max_occurs="-1">\r
+               <SIMP efficas:nom="NAME" efficas:statut="o"><typeAttendu>TXM</typeAttendu></SIMP>\r
+               <efficas:FACT efficas:nom="ELEM" efficas:statut="f"  efficas:min_occurs="1" efficas:max_occurs="-1">\r
+<!--                <efficas:regles>\r
+                       --><!-- Ajouter des contraintes de vérification de la présence ATT et GRO --><!--\r
+                               <efficas:PRESENT_PRESENT>ATT GRO</efficas:PRESENT_PRESENT>\r
+                    </efficas:regles>-->\r
+                       <efficas:SIMP efficas:nom="NUM" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
+                       <efficas:SIMP efficas:nom="NAME" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>TXM</typeAttendu></efficas:SIMP>\r
+                       <efficas:FACT efficas:nom="ATT" efficas:statut="f"  efficas:max_occurs="1">\r
+                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
+                               <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
+                               <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
+                               <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>I</typeAttendu></SIMP>\r
+                       </efficas:FACT>\r
+                       <efficas:FACT efficas:nom="GRO" efficas:statut="f" efficas:max_occurs="1">\r
+                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1"><typeAttendu>I</typeAttendu></SIMP>\r
+                           <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1"><typeAttendu>TXM</typeAttendu></SIMP>\r
+                       </efficas:FACT>\r
+               </efficas:FACT>\r
+       </efficas:FACT>\r
+</PROC>\r
+</commandes>\r
+</cata>\r
diff --git a/OldCodes/Med/README.txt b/OldCodes/Med/README.txt
new file mode 100644 (file)
index 0000000..a167a89
--- /dev/null
@@ -0,0 +1 @@
+pyxbgen -u model.xsd -m efficas --write-for-customization
diff --git a/OldCodes/Med/aide1 b/OldCodes/Med/aide1
new file mode 100644 (file)
index 0000000..96187ef
--- /dev/null
@@ -0,0 +1,256 @@
+Factory 
+
+OPER 
+
+PROC 
+
+_Abstract 
+
+_AddElement 
+
+_AlternativeConstructor 
+
+_AttributeMap 
+
+_AttributeWildcard 
+
+_Automaton 
+
+_CT_ELEMENT_ONLY 
+
+_CT_EMPTY 
+
+_CT_MIXED 
+
+_CT_SIMPLE 
+
+_CompatibleValue 
+
+_ContentTypeTag 
+
+_DynamicCreate 
+
+_DynamicCreate_mixin__AlternativeConstructorAttribute 
+
+_DynamicCreate_mixin__SupersedingClassAttribute 
+
+_ElementBindingDeclForName 
+
+_ElementMap 
+
+_ExpandedName 
+
+_GetValidationConfig 
+
+_HasWildcardElement 
+
+_IsMixed 
+
+_IsSimpleTypeContent 
+
+_IsUrType 
+
+_Locatable_mixin__location 
+
+_Name 
+
+_PerformValidation 
+
+_PreFactory_vx 
+
+_PyXBFactoryKeywords 
+
+_RequireXSIType 
+
+_ReservedSymbols 
+
+_SetAlternativeConstructor 
+
+_SetSupersedingClass 
+
+_SetValidationConfig 
+
+_SupersedingClass 
+
+_T_commandes__OPER 
+
+_T_commandes__PROC 
+
+_TypeBinding_mixin__AttributesFromDOM 
+
+_TypeBinding_mixin__WarnedUnassociatedElement 
+
+_TypeBinding_mixin__checkNilCtor 
+
+_TypeBinding_mixin__constructedWithValue 
+
+_TypeBinding_mixin__element 
+
+_TypeBinding_mixin__getValidationConfig 
+
+_TypeBinding_mixin__namespaceContext 
+
+_TypeBinding_mixin__xsiNil 
+
+_TypeDefinition 
+
+_UseForTag 
+
+_XSDLocation 
+
+__class__ 
+
+__delattr__ 
+
+__dict__ 
+
+__doc__ 
+
+__format__ 
+
+__getattribute__ 
+
+__hash__ 
+
+__httpchercheurs_edf_comlogicielsefficas_T_commandes_httpchercheurs_edf_comlogicielsefficasOPER 
+
+__httpchercheurs_edf_comlogicielsefficas_T_commandes_httpchercheurs_edf_comlogicielsefficasPROC 
+
+__init__ 
+
+__module__ 
+
+__new__ 
+
+__reduce__ 
+
+__reduce_ex__ 
+
+__repr__ 
+
+__setattr__ 
+
+__sizeof__ 
+
+__str__ 
+
+__subclasshook__ 
+
+__weakref__ 
+
+_addContent 
+
+_appendWildcardElement 
+
+_automatonConfiguration 
+
+_complexTypeDefinition__NeedWarnOnContent 
+
+_complexTypeDefinition__WarnOnContent 
+
+_complexTypeDefinition__automatonConfiguration 
+
+_complexTypeDefinition__childrenForDOM 
+
+_complexTypeDefinition__content 
+
+_complexTypeDefinition__setContent 
+
+_complexTypeDefinition__wildcardAttributeMap 
+
+_complexTypeDefinition__wildcardElements 
+
+_constructedWithValue 
+
+_description 
+
+_diagnosticName 
+
+_element 
+
+_finalizeContentModel 
+
+_isNil 
+
+_location 
+
+_namespaceContext 
+
+_performValidation 
+
+_postDOMValidate 
+
+_postFactory_vx 
+
+_resetAutomaton 
+
+_resetContent 
+
+_setAttribute 
+
+_setAttributesFromKeywordsAndDOM 
+
+_setDOMFromAttributes 
+
+_setElement 
+
+_setIsNil 
+
+_setLocation 
+
+_setNamespaceContext 
+
+_setValidationConfig 
+
+_substitutesFor 
+
+_symbolSet 
+
+_toDOM_csc 
+
+_validateAttributes 
+
+_validateBinding_vx 
+
+_validatedChildren 
+
+_validationConfig 
+
+_validationConfig_ 
+
+append 
+
+content 
+
+extend 
+
+orderedContent 
+
+reset 
+
+toDOM 
+
+toxml 
+
+validateBinding 
+
+value 
+
+wildcardAttributeMap 
+
+wildcardElements 
+
+xsdConstraintsOK 
+
+_______________________
+je passe ds CreerAccas
+PlageValeur
+ValeurDef
+doc
+portee
+statut
+o
+typeAttendu
+TXM
+validators
+_______________________
diff --git a/OldCodes/Med/efficas.py b/OldCodes/Med/efficas.py
new file mode 100644 (file)
index 0000000..3304e8a
--- /dev/null
@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*-
+from raw.efficas import *
diff --git a/OldCodes/Med/model.xsd b/OldCodes/Med/model.xsd
new file mode 100755 (executable)
index 0000000..53fe25a
--- /dev/null
@@ -0,0 +1,595 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!-- edited with XMLSpy v2014 rel. 2 (x64) (http://www.altova.com) by BC (ED) -->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:efficas="http://chercheurs.edf.com/logiciels/efficas" xmlns:altova="http://www.altova.com/xml-schema-extensions" targetNamespace="http://chercheurs.edf.com/logiciels/efficas" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0" vc:minVersion="1.1">\r
+       <xs:element name="doc" type="T_doc"/>\r
+       <xs:element name="cata" type="T_cata"/>\r
+       <xs:element name="regles" type="T_regles"/>\r
+       <xs:element name="typeCree" type="T_classe_utilisateur"/>\r
+       <xs:element name="ValeurDef" type="T_typeAttendu"/>\r
+       <xs:element name="ValeurSugg" type="T_typeAttendu"/>\r
+       <xs:element name="fonction_utilisateur" type="T_fonction_python"/>\r
+       <xs:element name="commandes" type="T_commandes">\r
+               <xs:unique name="Uniq_Command">\r
+                       <xs:selector xpath="*"/>\r
+                       <xs:field xpath="@efficas:nom"/>\r
+               </xs:unique>\r
+               <xs:key name="Uniq_Name_In_Oper">\r
+                       <xs:annotation>\r
+                               <xs:documentation>SIMP devrait Ãªtre selectionné que si .//SIMP[portee='Global']</xs:documentation>\r
+                       </xs:annotation>\r
+                       <xs:selector xpath="./OPER/BLOC |./OPER/FACT|./OPER/SIMP"/>\r
+                       <xs:field xpath="@efficas:nom"/>\r
+               </xs:key>\r
+               <xs:keyref name="Ref_A_Name_In_Oper" refer="Uniq_Name_In_Oper">\r
+                       <xs:selector xpath="./OPER/regles"/>\r
+                       <xs:field xpath="EXCLUS"/>\r
+               </xs:keyref>\r
+               <xs:key name="Uniq_Name_In_Proc">\r
+                       <xs:annotation>\r
+                               <xs:documentation>SIMP devrait Ãªtre selectionné que si .//SIMP[portee='Global']</xs:documentation>\r
+                       </xs:annotation>\r
+                       <xs:selector xpath="./PROC/BLOC | ./PROC/FACT| ./PROC/SIMP"/>\r
+                       <xs:field xpath="@efficas:nom"/>\r
+               </xs:key>\r
+               <xs:keyref name="Ref_A_Name_In_Proc" refer="Uniq_Name_In_Proc">\r
+                       <xs:selector xpath="./PROC/regles"/>\r
+                       <xs:field xpath="EXCLUS"/>\r
+               </xs:keyref>\r
+       </xs:element>\r
+       <xs:element name="validators" type="T_validators"/>\r
+       <xs:element name="PlageValeur" type="T_PlageValeur"/>\r
+       <xs:element name="typeAttendu" type="T_name"/>\r
+       <xs:element name="classeUtilisateurName" type="T_classe_utilisateur_username" abstract="true" substitutionGroup="typeAttendu"/>\r
+       <xs:element name="SIMP" type="T_SIMP"/>\r
+       <xs:element name="portee" type="T_portee" default="None"/>\r
+       <xs:element name="condition" type="T_fonction_python"/>\r
+       <xs:element name="borne_sup" type="T_typeAttendu"/>\r
+       <xs:element name="borne_inf" type="T_typeAttendu"/>\r
+       <!--    <xs:element name="into" type="T_into"/>-->\r
+       <xs:element name="into" type="T_into"/>\r
+       <!--    <xs:element name="into_plus_fonction" type="T_into" abstract="true" substitutionGroup="into"/>-->\r
+       <xs:attribute name="nom" type="AT_nom"/>\r
+       <xs:attribute name="ag" type="AT_ag"/>\r
+       <xs:attribute name="fr" type="xs:string"/>\r
+       <xs:attribute name="ang" type="xs:string"/>\r
+       <xs:attribute name="docu" type="AT_docu"/>\r
+       <xs:attribute name="valeur_sugg" type="AT_valeur_sugg"/>\r
+       <xs:attribute name="statut" type="AT_statut" default="o"/>\r
+       <xs:attribute name="max_occurs" type="AT_max_occurs"/>\r
+       <xs:attribute name="min_occurs" type="AT_min_occurs"/>\r
+       <xs:attribute name="subroutine" type="AT_subroutine" default="None"/>\r
+       <xs:complexType name="T_doc">\r
+               <xs:attribute ref="fr" use="optional"/>\r
+               <xs:attribute ref="ang"/>\r
+               <xs:attribute ref="docu"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="T_cata">\r
+               <xs:sequence>\r
+                       <xs:element ref="commandes" minOccurs="0" maxOccurs="unbounded"/>\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <xs:complexType name="T_commandes">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element ref="OPER"/>\r
+                       <xs:element ref="PROC"/>\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="T_Cardinalite"/>\r
+       <xs:complexType name="T_PlageValeur">\r
+               <xs:choice>\r
+                       <xs:sequence>\r
+                               <xs:element ref="borne_sup" minOccurs="0"/>\r
+                               <xs:element ref="borne_inf" minOccurs="0"/>\r
+                       </xs:sequence>\r
+                       <xs:element ref="into"/>\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="T_Accas.Common">\r
+               <xs:sequence>\r
+                       <xs:element ref="regles" minOccurs="0"/>\r
+                       <xs:element ref="doc" minOccurs="0"/>\r
+                       <xs:choice maxOccurs="unbounded">\r
+                               <xs:element ref="BLOC"/>\r
+                               <xs:element ref="FACT"/>\r
+                               <xs:element ref="SIMP"/>\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute ref="nom" use="required"/>\r
+       </xs:complexType>\r
+       <xs:element name="OPER" type="T_OPER"/>\r
+       <xs:complexType name="T_OPER">\r
+               <xs:complexContent>\r
+                       <xs:extension base="T_Accas.Common">\r
+                               <xs:sequence>\r
+                                       <xs:element ref="typeCree"/>\r
+                               </xs:sequence>\r
+                               <xs:attribute ref="subroutine"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <xs:element name="PROC" type="T_PROC">\r
+               <xs:unique name="Uniqb_NAme_In_PRoc">\r
+                       <xs:selector xpath="BLOC|FACT|SIMP"/>\r
+                       <xs:field xpath="@efficas:nom"/>\r
+               </xs:unique>\r
+       </xs:element>\r
+       <xs:complexType name="T_PROC">\r
+               <xs:complexContent>\r
+                       <xs:extension base="T_Accas.Common">\r
+                               <xs:attribute ref="subroutine"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <xs:element name="FACT" type="T_FACT"/>\r
+       <!--    <xs:complexType name="T_FACT">\r
+               <xs:complexContent>\r
+                       <xs:restriction base="T_Accas.Common">\r
+                               <xs:sequence>\r
+                                       <xs:element ref="regles" minOccurs="0"/>\r
+                                       <xs:element ref="doc" minOccurs="0"/>\r
+                                       <xs:choice maxOccurs="unbounded">\r
+                                               <xs:element ref="BLOC"/>\r
+                                               <xs:element ref="FACT"/>\r
+                                               <xs:element ref="SIMP"/>\r
+                                       </xs:choice>\r
+                               </xs:sequence>\r
+                       </xs:restriction>\r
+               </xs:complexContent>\r
+       </xs:complexType>-->\r
+       <xs:complexType name="T_FACT">\r
+               <xs:complexContent>\r
+                       <xs:extension base="T_Accas.Common">\r
+                               <xs:attribute ref="statut"/>\r
+                               <xs:attribute ref="min_occurs" default="1"/>\r
+                               <xs:attribute ref="max_occurs" default="1">\r
+                                       <xs:annotation>\r
+                                               <xs:documentation>La valuer -1 equivaut Ã  oo</xs:documentation>\r
+                                       </xs:annotation>\r
+                               </xs:attribute>\r
+                               <xs:assert test=".[exists(@efficas:max_occurs) and exists(@efficas:min_occurs) and @efficas:max_occurs  gt @efficas:min_occurs]"/>\r
+                               <!--<xs:assert test="if (.[exists(@efficas:max_occurs)] and .[exists(@efficas:min_occurs)] ) then (@efficas:max_occurs  gt @efficas:min_occurs) or @efficas:max_occurs = -1 else true" altova:message="Erreur max_occurs  > min_occurs "/>-->\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <xs:simpleType name="T_fonction_python">\r
+               <xs:restriction base="xs:string"/>\r
+       </xs:simpleType>\r
+       <xs:element name="BLOC" type="T_BLOC"/>\r
+       <xs:complexType name="T_BLOC">\r
+               <xs:complexContent>\r
+                       <xs:extension base="T_Accas.Common">\r
+                               <xs:sequence>\r
+                                       <xs:element ref="condition"/>\r
+                               </xs:sequence>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <xs:complexType name="T_SIMP">\r
+               <xs:sequence>\r
+                       <xs:element ref="doc" minOccurs="0"/>\r
+                       <xs:element ref="portee" minOccurs="0">\r
+                               <xs:annotation>\r
+                                       <xs:documentation>La portée pouurait devenir un attribut de SIMP. Une autre solution consisterait a créer un SIMPG pour distinguer les @nom uniques des SIMP a portée globale des autres.</xs:documentation>\r
+                               </xs:annotation>\r
+                       </xs:element>\r
+                       <xs:element ref="ValeurDef" minOccurs="0"/>\r
+                       <xs:element ref="ValeurSugg" minOccurs="0"/>\r
+                       <xs:element ref="PlageValeur" minOccurs="0"/>\r
+                       <xs:element ref="typeAttendu"/>\r
+                       <xs:element ref="validators" minOccurs="0"/>\r
+               </xs:sequence>\r
+               <xs:attribute ref="nom" use="required"/>\r
+               <xs:attribute ref="statut"/>\r
+               <xs:attribute ref="min_occurs" default="1"/>\r
+               <xs:attribute ref="max_occurs" default="1">\r
+                       <xs:annotation>\r
+                               <xs:documentation>La valuer -1 equivaut Ã  oo</xs:documentation>\r
+                       </xs:annotation>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <xs:simpleType name="AT_statut">\r
+               <xs:restriction base="xs:string">\r
+                       <xs:enumeration value="f"/>\r
+                       <xs:enumeration value="o"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <!--<xs:simpleType name="T_repetable">\r
+               <xs:restriction base="xs:string">\r
+                       <xs:enumeration value="n"/>\r
+                       <xs:enumeration value="o"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>-->\r
+       <xs:simpleType name="T_portee">\r
+               <xs:restriction base="xs:string">\r
+                       <xs:enumeration value="None"/>\r
+                       <xs:enumeration value="Global"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="AT_max_occurs">\r
+               <xs:restriction base="xs:long">\r
+                       <xs:minInclusive value="-1"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="AT_min_occurs">\r
+               <xs:restriction base="xs:long">\r
+                       <xs:minExclusive value="0"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <!-- Comparable -->\r
+       <!--    <xs:simpleType name="AT_borne_sup">\r
+       <xs:atomic base="xs:double"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="AT_borne_inf">\r
+               <xs:restriction base="xs:double"/>\r
+       </xs:simpleType>\r
+-->\r
+       <xs:simpleType name="AT_ag">\r
+               <xs:restriction base="xs:string">\r
+                       <xs:enumeration value="No comment"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="AT_docu">\r
+               <xs:annotation>\r
+                       <xs:documentation>Référence une position dans un fichier maître contenant une liste de références Ã  des pages de documentations</xs:documentation>\r
+               </xs:annotation>\r
+               <xs:restriction base="xs:string"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="AT_valeur_sugg">\r
+               <xs:restriction base="xs:string"/>\r
+       </xs:simpleType>\r
+       <!-- TODO: Exclure mots clés python|efficas -->\r
+       <xs:simpleType name="AT_nom">\r
+               <xs:restriction base="xs:string">\r
+                       <xs:pattern value="([A-Z]|[a-z]|_)([A-Z]|[a-z]|_|[0-9])*"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_predicat1">\r
+               <xs:list itemType="AT_nom"/>\r
+               <!-- TODO: Supprimer la liste -->\r
+       </xs:simpleType>\r
+       <xs:complexType name="T_predicat2">\r
+               <xs:sequence>\r
+                       <xs:element name="p1" type="T_predicat1" minOccurs="1"/>\r
+                       <xs:element name="p2" type="AT_nom" minOccurs="1"/>\r
+               </xs:sequence>\r
+               <!-- TODO: Supprimer la séquence -->\r
+       </xs:complexType>\r
+       <xs:element name="A_CLASSER" type="T_predicat2"/>\r
+       <xs:element name="AU_MOINS_UN" type="T_predicat1"/>\r
+       <xs:element name="AU_PLUS_UN" type="T_predicat1"/>\r
+       <xs:element name="ENSEMBLE" type="T_predicat1"/>\r
+       <xs:element name="EXCLUS" type="T_predicat1">\r
+               <!-- A priori, ce n'est pas l'endroit pour le placer : ? scope de Uniq_Command-->\r
+               <!--            <xs:keyref name="referToAnAlreadyDefinedName" refer="Uniq_Command">\r
+                       <xs:selector xpath="."/>\r
+                       <xs:field xpath="."/>\r
+               </xs:keyref>\r
+-->\r
+       </xs:element>\r
+       <xs:element name="PRESENT_ABSENT" type="T_predicat1"/>\r
+       <xs:element name="PRESENT_PRESENT" type="T_predicat1"/>\r
+       <xs:element name="UN_PARMI" type="T_predicat1"/>\r
+       <xs:group name="predicat">\r
+               <xs:choice>\r
+                       <xs:element ref="A_CLASSER"/>\r
+                       <xs:element ref="AU_MOINS_UN"/>\r
+                       <xs:element ref="AU_PLUS_UN"/>\r
+                       <xs:element ref="ENSEMBLE"/>\r
+                       <xs:element ref="EXCLUS">\r
+                               <!-- A priori, ce n'est pas l'endroit pour le placer -->\r
+                               <!--                            <xs:keyref name="referToAnAlreadyDefinedName" refer="/Uniq_Command">\r
+                                       <xs:selector xpath="."/>\r
+                                       <xs:field xpath="."/>\r
+                               </xs:keyref>\r
+-->\r
+                       </xs:element>\r
+                       <xs:element ref="PRESENT_ABSENT"/>\r
+                       <xs:element ref="PRESENT_PRESENT"/>\r
+                       <xs:element ref="UN_PARMI"/>\r
+               </xs:choice>\r
+       </xs:group>\r
+       <xs:complexType name="T_regles">\r
+               <xs:sequence maxOccurs="unbounded">\r
+                       <xs:group ref="predicat"/>\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!--    <xs:simpleType name="T_typeCree">\r
+               <xs:restriction base="T_classe_utilisateur"/>\r
+       </xs:simpleType>\r
+-->\r
+       <xs:simpleType name="AT_subroutine">\r
+               <xs:restriction base="AT_nom"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_validators">\r
+               <xs:restriction base="xs:string">\r
+                       <xs:enumeration value="NoRepeat"/>\r
+                       <xs:enumeration value="OnlyStr"/>\r
+                       <xs:enumeration value="VerifExiste"/>\r
+                       <xs:enumeration value="VerifTypeTuple"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_Bool">\r
+               <xs:restriction base="xs:boolean"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_list_Bool">\r
+               <xs:list itemType="T_Bool"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_I">\r
+               <xs:restriction base="xs:int"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_list_I">\r
+               <xs:list itemType="T_I"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_R">\r
+               <xs:restriction base="xs:double"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_list_R">\r
+               <xs:list itemType="T_R"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_TXM">\r
+               <xs:restriction base="AT_nom"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_list_TXM">\r
+               <xs:list itemType="T_TXM"/>\r
+       </xs:simpleType>\r
+       <!--fonctionne mais ne permet pas de créer une liste de liste -->\r
+       <xs:simpleType name="T_C">\r
+               <xs:restriction>\r
+                       <xs:simpleType>\r
+                               <xs:list itemType="xs:double"/>\r
+                       </xs:simpleType>\r
+                       <xs:minLength value="2"/>\r
+                       <xs:maxLength value="2"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <!-- Ajouter une contrainte : taille pair -->\r
+       <!-- Il n'est pas possible de définir des listes de listes -->\r
+       <xs:simpleType name="T_list_C">\r
+               <xs:list itemType="xs:double"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_name_base">\r
+               <xs:restriction base="AT_nom"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_simple_name">\r
+               <xs:restriction base="T_name_base">\r
+                       <xs:enumeration value="Fichier"/>\r
+                       <xs:enumeration value="Repertoire"/>\r
+                       <xs:enumeration value="TXM"/>\r
+                       <xs:enumeration value="I"/>\r
+                       <xs:enumeration value="R"/>\r
+                       <xs:enumeration value="C"/>\r
+                       <xs:enumeration value="Bool"/>\r
+                       <xs:enumeration value="grma"/>\r
+                       <xs:enumeration value="grno"/>\r
+                       <xs:enumeration value="SalomeEntry"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <!-- On ne peut pas rendre abstrait un simpleType && \r
+          Il n'est pas possible de dérivé par restriction un simplecontent d'un type complex qui\r
+          lui peut Ãªtre abstrait\r
+    -->\r
+       <xs:simpleType name="T_classe_utilisateur_name">\r
+               <xs:restriction base="T_name">\r
+                       <xs:enumeration value="T_classe_utilisateur"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <xs:complexType name="T_classe_utilisateur_username">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="T_classe_utilisateur_name">\r
+                               <xs:attribute ref="nom" use="required"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <xs:simpleType name="T_name">\r
+               <xs:union memberTypes="T_simple_name">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="AT_nom">\r
+                                       <xs:enumeration value="T_Matrice_double"/>\r
+                                       <xs:enumeration value="T_Matrice_Symetrique_double"/>\r
+                                       <xs:enumeration value="T_tuple"/>\r
+                                       <xs:enumeration value="T_classe_utilisateur"/>\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:union>\r
+       </xs:simpleType>\r
+       <xs:complexType name="T_grma"/>\r
+       <xs:complexType name="T_grno"/>\r
+       <xs:complexType name="T_SalomeEntry"/>\r
+       <xs:complexType name="T_Fichier"/>\r
+       <!--    <xs:complexType name="T_Repertoire"/>-->\r
+       <xs:simpleType name="T_Repertoire">\r
+               <xs:list>\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:string">\r
+                                       <xs:whiteSpace value="preserve"/>\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:list>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T_simple">\r
+               <xs:union memberTypes="T_I T_list_I T_R T_list_R T_C T_list_C T_TXM T_list_TXM T_Bool T_list_Bool T_Repertoire"/>\r
+       </xs:simpleType>\r
+       <!--    <xs:complexType name="T_TXM"/>-->\r
+       <!--    <xs:simpleType name="T_simple">\r
+               <xs:restriction base="xs:string">\r
+                       <xs:enumeration value="Fichier"/>\r
+                       <xs:enumeration value="Repertoire"/>\r
+                       <xs:enumeration value="TXM"/>\r
+                       <xs:enumeration value="I"/>\r
+                       <xs:enumeration value="R"/>\r
+                       <xs:enumeration value="C"/>\r
+                       <xs:enumeration value="Bool"/>\r
+                       <xs:enumeration value="grma"/>\r
+                       <xs:enumeration value="grno"/>\r
+                       <xs:enumeration value="SalomeEntry"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+-->\r
+       <xs:simpleType name="T_list_double">\r
+               <xs:list itemType="xs:double"/>\r
+       </xs:simpleType>\r
+       <!-- Possibilité d'utiliser un type paramétré ? -->\r
+       <xs:complexType name="T_Matrice_double">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="T_list_double">\r
+                               <xs:attribute name="n" type="xs:integer" use="required"/>\r
+                               <xs:attribute name="m" type="xs:integer" use="required"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- Faire l'exercice de dériver de T_Matrice_double -->\r
+       <xs:complexType name="T_Matrice_Symetrique_double">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="T_list_double">\r
+                               <xs:attribute name="n" type="xs:int" use="required"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- Une liste est aussi un type simple !!!! -->\r
+       <!--    <xs:simpleType name="T_list_anySimpleType">\r
+               <xs:list itemType="xs:anySimpleType"/>\r
+       </xs:simpleType>\r
+-->\r
+       <!-- Le fait de ne pas déclarer une liste risque d'être problématique pour le parsing : A voir-->\r
+       <xs:complexType name="T_tuple">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:anySimpleType">\r
+                               <xs:attribute name="n" type="xs:int" use="required"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <xs:simpleType name="T_classe_utilisateur">\r
+               <xs:restriction base="AT_nom"/>\r
+       </xs:simpleType>\r
+       <xs:element name="typesimple" type="T_simple"/>\r
+       <xs:element name="matrice_double" type="T_Matrice_double"/>\r
+       <xs:element name="matrice_symetrique_double" type="T_Matrice_Symetrique_double"/>\r
+       <xs:element name="tuple" type="T_tuple"/>\r
+       <xs:element name="classe_utilisateur" type="T_classe_utilisateur"/>\r
+       <!-- Essai -->\r
+       <!--    <xs:group name="T_Attendu_group1">\r
+               <xs:choice>\r
+                       <xs:element ref="typesimple"/>\r
+                       <xs:element ref="matrice_double"/>\r
+                       <xs:element ref="matrice_symetrique_double"/>\r
+                       <xs:element ref="tuple"/>\r
+                       <xs:element ref="classe_utilisateur"/>\r
+               </xs:choice>\r
+       </xs:group>\r
+\r
+       <xs:group name="T_Attendu_group2">\r
+               <xs:choice>\r
+                       <xs:element ref="typesimple"/>\r
+                       <xs:element ref="matrice_double"/>\r
+                       <xs:element ref="matrice_symetrique_double"/>\r
+                       <xs:element ref="tuple"/>\r
+                       <xs:element ref="classe_utilisateur"/>\r
+                       <xs:element ref="fonction_utilisateur" minOccurs="1" maxOccurs="unbounded"/>\r
+               </xs:choice>\r
+       </xs:group>\r
+\r
+       <xs:complexType name="T_typeAttendu">\r
+               <xs:group ref="T_Attendu_group1"/>\r
+       </xs:complexType>\r
+       -->\r
+       <!-- Faire plutot un groupe de substitution pour ne pas croiser les choix -->\r
+       <!--\r
+       <xs:complexType name="T_into">\r
+         <xs:group ref="T_Attendu_group2"/>\r
+       </xs:complexType>\r
+       -->\r
+       <xs:complexType name="T_into">\r
+               <xs:choice>\r
+                       <!--                    <xs:element ref="typesimple" type="T_Base"/>-->\r
+                       <xs:element ref="typesimple" minOccurs="0" maxOccurs="unbounded"/>\r
+                       <xs:element ref="matrice_double" minOccurs="0" maxOccurs="unbounded"/>\r
+                       <xs:element ref="matrice_symetrique_double" minOccurs="0" maxOccurs="unbounded"/>\r
+                       <xs:element ref="tuple" minOccurs="0" maxOccurs="unbounded"/>\r
+                       <xs:element ref="classe_utilisateur" minOccurs="0" maxOccurs="unbounded"/>\r
+                       <xs:element ref="fonction_utilisateur" minOccurs="1" maxOccurs="unbounded"/>\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="T_typeAttendu">\r
+               <xs:complexContent>\r
+                       <xs:restriction base="T_into">\r
+                               <xs:choice>\r
+                                       <xs:element ref="typesimple" minOccurs="0" maxOccurs="unbounded"/>\r
+                                       <xs:element ref="matrice_double" minOccurs="0" maxOccurs="unbounded"/>\r
+                                       <xs:element ref="matrice_symetrique_double" minOccurs="0" maxOccurs="unbounded"/>\r
+                                       <xs:element ref="tuple" minOccurs="0" maxOccurs="unbounded"/>\r
+                                       <xs:element ref="classe_utilisateur" minOccurs="0" maxOccurs="unbounded"/>\r
+                               </xs:choice>\r
+                       </xs:restriction>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+</xs:schema>\r
+<!-- Catalogue EFFICAS Ã©quivalent\r
+\r
+# coding: utf-8\r
+from Accas import *\r
+\r
+class carte   (ASSD) : pass\r
+class maille   (ASSD) : pass\r
+class carte_flux_r   (carte):pass\r
+\r
+class NOM_CHAM_INTO:\r
+    def __call__(self, *l_typ_cham, **kwargs):\r
+        return tuple(('A','B','C'))\r
+C_NOM_CHAM_INTO = NOM_CHAM_INTO()\r
+\r
+JdC = JDC_CATA(code='MAP',\r
+               execmodul=None,\r
+               regles=ENSEMBLE('E1','E2','E3')\r
+               )\r
+\r
+CREECARTE = OPER(nom="CREECARTE",op=None, sd_prod=carte, UNITE=SIMP(statut='f',typ='I',defaut=21),);\r
+\r
+CREECARTEFLUX = OPER(nom="CREECARTEFLUX",op=None, sd_prod=carte_flux_r,\r
+                   NOMFLUX=SIMP(statut='o',typ='TXM',defaut='monFlux'),\r
+                );\r
+\r
+CREEMAILLE = OPER(nom="CREEMAILLE",op=None, sd_prod=maille,\r
+                NOEUDS=SIMP(statut='o',typ='I',defaut=(1,2),min=2,max=2)\r
+              );\r
+\r
+E1=PROC(nom="E1",\r
+        op=None,\r
+        regles    = (EXCLUS('ETAT_INIT','RESULTAT',),),\r
+        ETAT_INIT = FACT(statut='f', max='**',\r
+                         GROUP_MA_1=SIMP(statut='o',typ='I',validators=NoRepeat(),max='**'),\r
+                         GROUP_NO_2=SIMP(statut='f',typ='I',validators=NoRepeat(),max='**'),\r
+                    ),\r
+\r
+        RESULTAT  = FACT(statut='f',\r
+                         DEPL=SIMP(statut='o', typ='R',  validators=NoRepeat()),\r
+                         VITE=SIMP(statut='f', typ='R',  validators=NoRepeat()),\r
+                         ACCE=SIMP(statut='f', typ='R',  validators=NoRepeat()),\r
+                    ), \r
+        );\r
+\r
+E2=PROC(nom="E2", op=None,\r
+        regles   = (UN_PARMI('CONCEPT','CHAINE','TOUT' ),),\r
+        CONCEPT  = FACT(statut='f',max='**',\r
+                   NOM = SIMP(statut='o',typ=assd,validators=NoRepeat(),max='**'),\r
+                   ),\r
+        CHAINE   = SIMP(statut='f',typ='TXM'),\r
+        POSITION = SIMP(statut='f',typ='I',defaut=1),\r
+        TOUT     = SIMP(statut='f',typ='TXM',into=("OUI",) ),\r
+        );\r
+\r
+E3=PROC(nom="E3",op=None,\r
+        DEFORMATION = SIMP(statut='f',typ='TXM',defaut="PETIT",\r
+                           into=("PETIT","PETIT_REAC","GROT_GDEP","SIMO_MIEHE","GDEF_HYPO_ELAS","GDEF_LOG")),\r
+        b_blocIn    = BLOC(condition = "DEFORMATION in ('PETIT','PETIT_REAC','GROT_GDEP')",\r
+             ITER_INTE_PAS = SIMP(statut='f',typ='I',defaut= 0 ),\r
+             ALGO_INTE     = SIMP(statut='f',typ='TXM',into=("ANALYTIQUE", "SECANTE", "DEKKER", "NEWTON_1D","BRENT",),),\r
+             CARTE        = SIMP(statut='f',typ=carte,),\r
+             b_carte       = BLOC(condition= "(AsType(CARTE) != carte_flux_r)",\r
+                             CONTRAINTE = SIMP(statut='f',typ='TXM',validators=NoRepeat(),max='**',\r
+                                          fr="Options pour le calcul de contraintes et efforts generalises",\r
+                                           into=C_NOM_CHAM_INTO(phenomene='CONTRAINTE',categorie='lin'),)\r
+                             ),\r
+                      ),  \r
+       );\r
+\r
+-->\r
diff --git a/OldCodes/Med/raw/__init__.py b/OldCodes/Med/raw/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/OldCodes/Med/raw/efficas.py b/OldCodes/Med/raw/efficas.py
new file mode 100644 (file)
index 0000000..de150a9
--- /dev/null
@@ -0,0 +1,2685 @@
+# ./raw/efficas.py
+# -*- coding: utf-8 -*-
+# PyXB bindings for NM:759f40938b7670cd6d5941e706557eb2115fb17f
+# Generated 2016-11-23 16:51:37.568270 by PyXB version 1.2.3
+# Namespace http://chercheurs.edf.com/logiciels/efficas
+
+import pyxb
+import pyxb.binding
+import pyxb.binding.saxer
+import io
+import pyxb.utils.utility
+import pyxb.utils.domutils
+import sys
+
+# Unique identifier for bindings created at the same time
+_GenerationUID = pyxb.utils.utility.UniqueIdentifier('urn:uuid:b79c3f70-b194-11e6-bb0f-b05adafd94d6')
+
+# Version of PyXB used to generate the bindings
+_PyXBVersion = '1.2.3'
+# Generated bindings are not compatible across PyXB versions
+if pyxb.__version__ != _PyXBVersion:
+    raise pyxb.PyXBVersionError(_PyXBVersion)
+
+# Import bindings for namespaces imported into schema
+import pyxb.binding.datatypes
+
+# NOTE: All namespace declarations are reserved within the binding
+Namespace = pyxb.namespace.NamespaceForURI(u'http://chercheurs.edf.com/logiciels/efficas', create_if_missing=True)
+Namespace.configureCategories(['typeBinding', 'elementBinding'])
+
+def CreateFromDocument (xml_text, default_namespace=None, location_base=None):
+    """Parse the given XML and use the document element to create a
+    Python instance.
+
+    @param xml_text An XML document.  This should be data (Python 2
+    str or Python 3 bytes), or a text (Python 2 unicode or Python 3
+    str) in the L{pyxb._InputEncoding} encoding.
+
+    @keyword default_namespace The L{pyxb.Namespace} instance to use as the
+    default namespace where there is no default namespace in scope.
+    If unspecified or C{None}, the namespace of the module containing
+    this function will be used.
+
+    @keyword location_base: An object to be recorded as the base of all
+    L{pyxb.utils.utility.Location} instances associated with events and
+    objects handled by the parser.  You might pass the URI from which
+    the document was obtained.
+    """
+
+    if pyxb.XMLStyle_saxer != pyxb._XMLStyle:
+        dom = pyxb.utils.domutils.StringToDOM(xml_text)
+        return CreateFromDOM(dom.documentElement)
+    if default_namespace is None:
+        default_namespace = Namespace.fallbackNamespace()
+    saxer = pyxb.binding.saxer.make_parser(fallback_namespace=default_namespace, location_base=location_base)
+    handler = saxer.getContentHandler()
+    xmld = xml_text
+    if isinstance(xmld, unicode):
+        xmld = xmld.encode(pyxb._InputEncoding)
+    saxer.parse(io.BytesIO(xmld))
+    instance = handler.rootObject()
+    return instance
+
+def CreateFromDOM (node, default_namespace=None):
+    """Create a Python instance from the given DOM node.
+    The node tag must correspond to an element declaration in this module.
+
+    @deprecated: Forcing use of DOM interface is unnecessary; use L{CreateFromDocument}."""
+    if default_namespace is None:
+        default_namespace = Namespace.fallbackNamespace()
+    return pyxb.binding.basis.element.AnyCreateFromDOM(node, default_namespace)
+
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_fonction_python
+class T_fonction_python (pyxb.binding.datatypes.string):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_fonction_python')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 154, 1)
+    _Documentation = None
+T_fonction_python._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_fonction_python', T_fonction_python)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_statut
+class AT_statut (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_statut')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 190, 1)
+    _Documentation = None
+AT_statut._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=AT_statut, enum_prefix=None)
+AT_statut.f = AT_statut._CF_enumeration.addEnumeration(unicode_value=u'f', tag=u'f')
+AT_statut.o = AT_statut._CF_enumeration.addEnumeration(unicode_value=u'o', tag=u'o')
+AT_statut._InitializeFacetMap(AT_statut._CF_enumeration)
+Namespace.addCategoryObject('typeBinding', u'AT_statut', AT_statut)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_portee
+class T_portee (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_portee')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 202, 1)
+    _Documentation = None
+T_portee._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_portee, enum_prefix=None)
+T_portee.None_ = T_portee._CF_enumeration.addEnumeration(unicode_value=u'None', tag=u'None_')
+T_portee.Global = T_portee._CF_enumeration.addEnumeration(unicode_value=u'Global', tag=u'Global')
+T_portee._InitializeFacetMap(T_portee._CF_enumeration)
+Namespace.addCategoryObject('typeBinding', u'T_portee', T_portee)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_max_occurs
+class AT_max_occurs (pyxb.binding.datatypes.long):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_max_occurs')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 208, 1)
+    _Documentation = None
+AT_max_occurs._CF_minInclusive = pyxb.binding.facets.CF_minInclusive(value_datatype=AT_max_occurs, value=pyxb.binding.datatypes.long(-1L))
+AT_max_occurs._InitializeFacetMap(AT_max_occurs._CF_minInclusive)
+Namespace.addCategoryObject('typeBinding', u'AT_max_occurs', AT_max_occurs)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_min_occurs
+class AT_min_occurs (pyxb.binding.datatypes.long):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_min_occurs')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 213, 1)
+    _Documentation = None
+AT_min_occurs._CF_minExclusive = pyxb.binding.facets.CF_minExclusive(value_datatype=pyxb.binding.datatypes.long, value=pyxb.binding.datatypes.integer(0L))
+AT_min_occurs._InitializeFacetMap(AT_min_occurs._CF_minExclusive)
+Namespace.addCategoryObject('typeBinding', u'AT_min_occurs', AT_min_occurs)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_ag
+class AT_ag (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_ag')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 226, 1)
+    _Documentation = None
+AT_ag._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=AT_ag, enum_prefix=None)
+AT_ag.No_comment = AT_ag._CF_enumeration.addEnumeration(unicode_value=u'No comment', tag=u'No_comment')
+AT_ag._InitializeFacetMap(AT_ag._CF_enumeration)
+Namespace.addCategoryObject('typeBinding', u'AT_ag', AT_ag)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_docu
+class AT_docu (pyxb.binding.datatypes.string):
+
+    """Référence une position dans un fichier maître contenant une liste de références Ã  des pages de documentations"""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_docu')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 231, 1)
+    _Documentation = u'R\xe9f\xe9rence une position dans un fichier ma\xeetre contenant une liste de r\xe9f\xe9rences \xe0 des pages de documentations'
+AT_docu._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'AT_docu', AT_docu)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_valeur_sugg
+class AT_valeur_sugg (pyxb.binding.datatypes.string):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_valeur_sugg')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 237, 1)
+    _Documentation = None
+AT_valeur_sugg._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'AT_valeur_sugg', AT_valeur_sugg)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_nom
+class AT_nom (pyxb.binding.datatypes.string):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_nom')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 241, 1)
+    _Documentation = None
+AT_nom._CF_pattern = pyxb.binding.facets.CF_pattern()
+AT_nom._CF_pattern.addPattern(pattern=u'([A-Z]|[a-z]|_)([A-Z]|[a-z]|_|[0-9])*')
+AT_nom._InitializeFacetMap(AT_nom._CF_pattern)
+Namespace.addCategoryObject('typeBinding', u'AT_nom', AT_nom)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_validators
+class T_validators (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_validators')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 303, 1)
+    _Documentation = None
+T_validators._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_validators, enum_prefix=None)
+T_validators.NoRepeat = T_validators._CF_enumeration.addEnumeration(unicode_value=u'NoRepeat', tag=u'NoRepeat')
+T_validators.OnlyStr = T_validators._CF_enumeration.addEnumeration(unicode_value=u'OnlyStr', tag=u'OnlyStr')
+T_validators.VerifExiste = T_validators._CF_enumeration.addEnumeration(unicode_value=u'VerifExiste', tag=u'VerifExiste')
+T_validators.VerifTypeTuple = T_validators._CF_enumeration.addEnumeration(unicode_value=u'VerifTypeTuple', tag=u'VerifTypeTuple')
+T_validators._InitializeFacetMap(T_validators._CF_enumeration)
+Namespace.addCategoryObject('typeBinding', u'T_validators', T_validators)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_Bool
+class T_Bool (pyxb.binding.datatypes.boolean):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Bool')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 311, 1)
+    _Documentation = None
+T_Bool._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_Bool', T_Bool)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_I
+class T_I (pyxb.binding.datatypes.int):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_I')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 317, 1)
+    _Documentation = None
+T_I._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_I', T_I)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_R
+class T_R (pyxb.binding.datatypes.double):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_R')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 323, 1)
+    _Documentation = None
+T_R._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_R', T_R)
+
+# List simple type: [anonymous]
+# superclasses pyxb.binding.datatypes.anySimpleType
+class STD_ANON (pyxb.binding.basis.STD_list):
+
+    """Simple type that is a list of pyxb.binding.datatypes.double."""
+
+    _ExpandedName = None
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 338, 3)
+    _Documentation = None
+
+    _ItemType = pyxb.binding.datatypes.double
+STD_ANON._InitializeFacetMap()
+
+# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_C
+# superclasses pyxb.binding.datatypes.anySimpleType
+class T_list_C (pyxb.binding.basis.STD_list):
+
+    """Simple type that is a list of pyxb.binding.datatypes.double."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_C')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 347, 1)
+    _Documentation = None
+
+    _ItemType = pyxb.binding.datatypes.double
+T_list_C._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_list_C', T_list_C)
+
+# Atomic simple type: [anonymous]
+class STD_ANON_ (pyxb.binding.datatypes.string):
+
+    """An atomic simple type."""
+
+    _ExpandedName = None
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 402, 3)
+    _Documentation = None
+STD_ANON_._CF_whiteSpace = pyxb.binding.facets.CF_whiteSpace(value=pyxb.binding.facets._WhiteSpace_enum.preserve)
+STD_ANON_._InitializeFacetMap(STD_ANON_._CF_whiteSpace)
+
+# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_double
+# superclasses pyxb.binding.datatypes.anySimpleType
+class T_list_double (pyxb.binding.basis.STD_list):
+
+    """Simple type that is a list of pyxb.binding.datatypes.double."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_double')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 428, 1)
+    _Documentation = None
+
+    _ItemType = pyxb.binding.datatypes.double
+T_list_double._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_list_double', T_list_double)
+
+# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_predicat1
+# superclasses pyxb.binding.datatypes.anySimpleType
+class T_predicat1 (pyxb.binding.basis.STD_list):
+
+    """Simple type that is a list of AT_nom."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_predicat1')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 246, 1)
+    _Documentation = None
+
+    _ItemType = AT_nom
+T_predicat1._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_predicat1', T_predicat1)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}AT_subroutine
+class AT_subroutine (AT_nom):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'AT_subroutine')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 300, 1)
+    _Documentation = None
+AT_subroutine._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'AT_subroutine', AT_subroutine)
+
+# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_Bool
+# superclasses pyxb.binding.datatypes.anySimpleType
+class T_list_Bool (pyxb.binding.basis.STD_list):
+
+    """Simple type that is a list of T_Bool."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_Bool')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 314, 1)
+    _Documentation = None
+
+    _ItemType = T_Bool
+T_list_Bool._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_list_Bool', T_list_Bool)
+
+# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_I
+# superclasses pyxb.binding.datatypes.anySimpleType
+class T_list_I (pyxb.binding.basis.STD_list):
+
+    """Simple type that is a list of T_I."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_I')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 320, 1)
+    _Documentation = None
+
+    _ItemType = T_I
+T_list_I._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_list_I', T_list_I)
+
+# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_R
+# superclasses pyxb.binding.datatypes.anySimpleType
+class T_list_R (pyxb.binding.basis.STD_list):
+
+    """Simple type that is a list of T_R."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_R')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 326, 1)
+    _Documentation = None
+
+    _ItemType = T_R
+T_list_R._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_list_R', T_list_R)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_TXM
+class T_TXM (AT_nom):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_TXM')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 329, 1)
+    _Documentation = None
+T_TXM._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_TXM', T_TXM)
+
+# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_C
+# superclasses STD_ANON
+class T_C (pyxb.binding.basis.STD_list):
+
+    """Simple type that is a list of pyxb.binding.datatypes.double."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_C')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 336, 1)
+    _Documentation = None
+
+    _ItemType = pyxb.binding.datatypes.double
+T_C._CF_maxLength = pyxb.binding.facets.CF_maxLength(value=pyxb.binding.datatypes.nonNegativeInteger(2L))
+T_C._CF_minLength = pyxb.binding.facets.CF_minLength(value=pyxb.binding.datatypes.nonNegativeInteger(2L))
+T_C._InitializeFacetMap(T_C._CF_maxLength,
+   T_C._CF_minLength)
+Namespace.addCategoryObject('typeBinding', u'T_C', T_C)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_name_base
+class T_name_base (AT_nom):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_name_base')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 350, 1)
+    _Documentation = None
+T_name_base._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_name_base', T_name_base)
+
+# Atomic simple type: [anonymous]
+class STD_ANON_2 (AT_nom, pyxb.binding.basis.enumeration_mixin):
+
+    """An atomic simple type."""
+
+    _ExpandedName = None
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 385, 3)
+    _Documentation = None
+STD_ANON_2._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=STD_ANON_2, enum_prefix=None)
+STD_ANON_2.T_Matrice_double = STD_ANON_2._CF_enumeration.addEnumeration(unicode_value=u'T_Matrice_double', tag=u'T_Matrice_double')
+STD_ANON_2.T_Matrice_Symetrique_double = STD_ANON_2._CF_enumeration.addEnumeration(unicode_value=u'T_Matrice_Symetrique_double', tag=u'T_Matrice_Symetrique_double')
+STD_ANON_2.T_tuple = STD_ANON_2._CF_enumeration.addEnumeration(unicode_value=u'T_tuple', tag=u'T_tuple')
+STD_ANON_2.T_classe_utilisateur = STD_ANON_2._CF_enumeration.addEnumeration(unicode_value=u'T_classe_utilisateur', tag=u'T_classe_utilisateur')
+STD_ANON_2._InitializeFacetMap(STD_ANON_2._CF_enumeration)
+
+# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_Repertoire
+# superclasses pyxb.binding.datatypes.anySimpleType
+class T_Repertoire (pyxb.binding.basis.STD_list):
+
+    """Simple type that is a list of STD_ANON_."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Repertoire')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 400, 1)
+    _Documentation = None
+
+    _ItemType = STD_ANON_
+T_Repertoire._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_Repertoire', T_Repertoire)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_classe_utilisateur
+class T_classe_utilisateur (AT_nom):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_classe_utilisateur')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 461, 1)
+    _Documentation = None
+T_classe_utilisateur._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_classe_utilisateur', T_classe_utilisateur)
+
+# List simple type: {http://chercheurs.edf.com/logiciels/efficas}T_list_TXM
+# superclasses pyxb.binding.datatypes.anySimpleType
+class T_list_TXM (pyxb.binding.basis.STD_list):
+
+    """Simple type that is a list of T_TXM."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_list_TXM')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 332, 1)
+    _Documentation = None
+
+    _ItemType = T_TXM
+T_list_TXM._InitializeFacetMap()
+Namespace.addCategoryObject('typeBinding', u'T_list_TXM', T_list_TXM)
+
+# Atomic simple type: {http://chercheurs.edf.com/logiciels/efficas}T_simple_name
+class T_simple_name (T_name_base, pyxb.binding.basis.enumeration_mixin):
+
+    """An atomic simple type."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_simple_name')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 353, 1)
+    _Documentation = None
+T_simple_name._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_simple_name, enum_prefix=None)
+T_simple_name.Fichier = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'Fichier', tag=u'Fichier')
+T_simple_name.Repertoire = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'Repertoire', tag=u'Repertoire')
+T_simple_name.TXM = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'TXM', tag=u'TXM')
+T_simple_name.I = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'I', tag=u'I')
+T_simple_name.R = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'R', tag=u'R')
+T_simple_name.C = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'C', tag=u'C')
+T_simple_name.Bool = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'Bool', tag=u'Bool')
+T_simple_name.grma = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'grma', tag=u'grma')
+T_simple_name.grno = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'grno', tag=u'grno')
+T_simple_name.SalomeEntry = T_simple_name._CF_enumeration.addEnumeration(unicode_value=u'SalomeEntry', tag=u'SalomeEntry')
+T_simple_name._InitializeFacetMap(T_simple_name._CF_enumeration)
+Namespace.addCategoryObject('typeBinding', u'T_simple_name', T_simple_name)
+
+# Union simple type: {http://chercheurs.edf.com/logiciels/efficas}T_name
+# superclasses pyxb.binding.datatypes.anySimpleType
+class T_name (pyxb.binding.basis.STD_union):
+
+    """Simple type that is a union of T_simple_name, STD_ANON_2."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_name')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 383, 1)
+    _Documentation = None
+
+    _MemberTypes = ( T_simple_name, STD_ANON_2, )
+T_name._CF_pattern = pyxb.binding.facets.CF_pattern()
+T_name._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_name)
+T_name.Fichier = u'Fichier'                       # originally T_simple_name.Fichier
+T_name.Repertoire = u'Repertoire'                 # originally T_simple_name.Repertoire
+T_name.TXM = u'TXM'                               # originally T_simple_name.TXM
+T_name.I = u'I'                                   # originally T_simple_name.I
+T_name.R = u'R'                                   # originally T_simple_name.R
+T_name.C = u'C'                                   # originally T_simple_name.C
+T_name.Bool = u'Bool'                             # originally T_simple_name.Bool
+T_name.grma = u'grma'                             # originally T_simple_name.grma
+T_name.grno = u'grno'                             # originally T_simple_name.grno
+T_name.SalomeEntry = u'SalomeEntry'               # originally T_simple_name.SalomeEntry
+T_name.T_Matrice_double = u'T_Matrice_double'     # originally STD_ANON_2.T_Matrice_double
+T_name.T_Matrice_Symetrique_double = u'T_Matrice_Symetrique_double'# originally STD_ANON_2.T_Matrice_Symetrique_double
+T_name.T_tuple = u'T_tuple'                       # originally STD_ANON_2.T_tuple
+T_name.T_classe_utilisateur = u'T_classe_utilisateur'# originally STD_ANON_2.T_classe_utilisateur
+T_name._InitializeFacetMap(T_name._CF_pattern,
+   T_name._CF_enumeration)
+Namespace.addCategoryObject('typeBinding', u'T_name', T_name)
+
+# Union simple type: {http://chercheurs.edf.com/logiciels/efficas}T_simple
+# superclasses pyxb.binding.datatypes.anySimpleType
+class T_simple (pyxb.binding.basis.STD_union):
+
+    """Simple type that is a union of T_I, T_list_I, T_R, T_list_R, T_C, T_list_C, T_TXM, T_list_TXM, T_Bool, T_list_Bool, T_Repertoire."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_simple')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 409, 1)
+    _Documentation = None
+
+    _MemberTypes = ( T_I, T_list_I, T_R, T_list_R, T_C, T_list_C, T_TXM, T_list_TXM, T_Bool, T_list_Bool, T_Repertoire, )
+T_simple._CF_pattern = pyxb.binding.facets.CF_pattern()
+T_simple._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_simple)
+T_simple._InitializeFacetMap(T_simple._CF_pattern,
+   T_simple._CF_enumeration)
+Namespace.addCategoryObject('typeBinding', u'T_simple', T_simple)
+
+# Union simple type: {http://chercheurs.edf.com/logiciels/efficas}T_classe_utilisateur_name
+# superclasses T_name, pyxb.binding.basis.enumeration_mixin
+class T_classe_utilisateur_name (pyxb.binding.basis.STD_union):
+
+    """Simple type that is a union of T_simple_name, STD_ANON_2."""
+
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_classe_utilisateur_name')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 371, 1)
+    _Documentation = None
+
+    _MemberTypes = ( T_simple_name, STD_ANON_2, )
+T_classe_utilisateur_name._CF_enumeration = pyxb.binding.facets.CF_enumeration(value_datatype=T_classe_utilisateur_name, enum_prefix=None)
+T_classe_utilisateur_name.T_classe_utilisateur = T_classe_utilisateur_name._CF_enumeration.addEnumeration(unicode_value=u'T_classe_utilisateur', tag=u'T_classe_utilisateur')
+T_classe_utilisateur_name._InitializeFacetMap(T_classe_utilisateur_name._CF_enumeration)
+Namespace.addCategoryObject('typeBinding', u'T_classe_utilisateur_name', T_classe_utilisateur_name)
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_cata with content type ELEMENT_ONLY
+class T_cata (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_cata with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_cata')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 66, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}commandes uses Python identifier commandes
+    __commandes = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'commandes'), 'commandes', '__httpchercheurs_edf_comlogicielsefficas_T_cata_httpchercheurs_edf_comlogicielsefficascommandes', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 11, 1), )
+
+    
+    commandes = property(__commandes.value, __commandes.set, None, None)
+
+    _ElementMap.update({
+        __commandes.name() : __commandes
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_cata', T_cata)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_commandes with content type ELEMENT_ONLY
+class T_commandes (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_commandes with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_commandes')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 71, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}OPER uses Python identifier OPER
+    __OPER = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'OPER'), 'OPER', '__httpchercheurs_edf_comlogicielsefficas_T_commandes_httpchercheurs_edf_comlogicielsefficasOPER', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 99, 1), )
+
+    
+    OPER = property(__OPER.value, __OPER.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}PROC uses Python identifier PROC
+    __PROC = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'PROC'), 'PROC', '__httpchercheurs_edf_comlogicielsefficas_T_commandes_httpchercheurs_edf_comlogicielsefficasPROC', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 110, 1), )
+
+    
+    PROC = property(__PROC.value, __PROC.set, None, None)
+
+    _ElementMap.update({
+        __OPER.name() : __OPER,
+        __PROC.name() : __PROC
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_commandes', T_commandes)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Cardinalite with content type EMPTY
+class T_Cardinalite (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Cardinalite with content type EMPTY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Cardinalite')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 77, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_Cardinalite', T_Cardinalite)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_PlageValeur with content type ELEMENT_ONLY
+class T_PlageValeur (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_PlageValeur with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_PlageValeur')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 78, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}borne_sup uses Python identifier borne_sup
+    __borne_sup = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'borne_sup'), 'borne_sup', '__httpchercheurs_edf_comlogicielsefficas_T_PlageValeur_httpchercheurs_edf_comlogicielsefficasborne_sup', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 46, 1), )
+
+    
+    borne_sup = property(__borne_sup.value, __borne_sup.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}borne_inf uses Python identifier borne_inf
+    __borne_inf = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'borne_inf'), 'borne_inf', '__httpchercheurs_edf_comlogicielsefficas_T_PlageValeur_httpchercheurs_edf_comlogicielsefficasborne_inf', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 47, 1), )
+
+    
+    borne_inf = property(__borne_inf.value, __borne_inf.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}into uses Python identifier into
+    __into = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'into'), 'into', '__httpchercheurs_edf_comlogicielsefficas_T_PlageValeur_httpchercheurs_edf_comlogicielsefficasinto', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 49, 1), )
+
+    
+    into = property(__into.value, __into.set, None, None)
+
+    _ElementMap.update({
+        __borne_sup.name() : __borne_sup,
+        __borne_inf.name() : __borne_inf,
+        __into.name() : __into
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_PlageValeur', T_PlageValeur)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_predicat2 with content type ELEMENT_ONLY
+class T_predicat2 (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_predicat2 with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_predicat2')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 250, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}p1 uses Python identifier p1
+    __p1 = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'p1'), 'p1', '__httpchercheurs_edf_comlogicielsefficas_T_predicat2_httpchercheurs_edf_comlogicielsefficasp1', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 252, 3), )
+
+    
+    p1 = property(__p1.value, __p1.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}p2 uses Python identifier p2
+    __p2 = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'p2'), 'p2', '__httpchercheurs_edf_comlogicielsefficas_T_predicat2_httpchercheurs_edf_comlogicielsefficasp2', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 253, 3), )
+
+    
+    p2 = property(__p2.value, __p2.set, None, None)
+
+    _ElementMap.update({
+        __p1.name() : __p1,
+        __p2.name() : __p2
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_predicat2', T_predicat2)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_regles with content type ELEMENT_ONLY
+class T_regles (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_regles with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_regles')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 291, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}A_CLASSER uses Python identifier A_CLASSER
+    __A_CLASSER = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'A_CLASSER'), 'A_CLASSER', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasA_CLASSER', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 257, 1), )
+
+    
+    A_CLASSER = property(__A_CLASSER.value, __A_CLASSER.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}AU_MOINS_UN uses Python identifier AU_MOINS_UN
+    __AU_MOINS_UN = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'AU_MOINS_UN'), 'AU_MOINS_UN', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasAU_MOINS_UN', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 258, 1), )
+
+    
+    AU_MOINS_UN = property(__AU_MOINS_UN.value, __AU_MOINS_UN.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}AU_PLUS_UN uses Python identifier AU_PLUS_UN
+    __AU_PLUS_UN = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'AU_PLUS_UN'), 'AU_PLUS_UN', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasAU_PLUS_UN', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 259, 1), )
+
+    
+    AU_PLUS_UN = property(__AU_PLUS_UN.value, __AU_PLUS_UN.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}ENSEMBLE uses Python identifier ENSEMBLE
+    __ENSEMBLE = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'ENSEMBLE'), 'ENSEMBLE', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasENSEMBLE', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 260, 1), )
+
+    
+    ENSEMBLE = property(__ENSEMBLE.value, __ENSEMBLE.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}EXCLUS uses Python identifier EXCLUS
+    __EXCLUS = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'EXCLUS'), 'EXCLUS', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasEXCLUS', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 261, 1), )
+
+    
+    EXCLUS = property(__EXCLUS.value, __EXCLUS.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}PRESENT_ABSENT uses Python identifier PRESENT_ABSENT
+    __PRESENT_ABSENT = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_ABSENT'), 'PRESENT_ABSENT', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasPRESENT_ABSENT', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 269, 1), )
+
+    
+    PRESENT_ABSENT = property(__PRESENT_ABSENT.value, __PRESENT_ABSENT.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}PRESENT_PRESENT uses Python identifier PRESENT_PRESENT
+    __PRESENT_PRESENT = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_PRESENT'), 'PRESENT_PRESENT', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasPRESENT_PRESENT', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 270, 1), )
+
+    
+    PRESENT_PRESENT = property(__PRESENT_PRESENT.value, __PRESENT_PRESENT.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}UN_PARMI uses Python identifier UN_PARMI
+    __UN_PARMI = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'UN_PARMI'), 'UN_PARMI', '__httpchercheurs_edf_comlogicielsefficas_T_regles_httpchercheurs_edf_comlogicielsefficasUN_PARMI', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 271, 1), )
+
+    
+    UN_PARMI = property(__UN_PARMI.value, __UN_PARMI.set, None, None)
+
+    _ElementMap.update({
+        __A_CLASSER.name() : __A_CLASSER,
+        __AU_MOINS_UN.name() : __AU_MOINS_UN,
+        __AU_PLUS_UN.name() : __AU_PLUS_UN,
+        __ENSEMBLE.name() : __ENSEMBLE,
+        __EXCLUS.name() : __EXCLUS,
+        __PRESENT_ABSENT.name() : __PRESENT_ABSENT,
+        __PRESENT_PRESENT.name() : __PRESENT_PRESENT,
+        __UN_PARMI.name() : __UN_PARMI
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_regles', T_regles)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_grma with content type EMPTY
+class T_grma (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_grma with content type EMPTY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_grma')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 395, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_grma', T_grma)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_grno with content type EMPTY
+class T_grno (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_grno with content type EMPTY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_grno')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 396, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_grno', T_grno)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_SalomeEntry with content type EMPTY
+class T_SalomeEntry (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_SalomeEntry with content type EMPTY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_SalomeEntry')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 397, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_SalomeEntry', T_SalomeEntry)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Fichier with content type EMPTY
+class T_Fichier (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Fichier with content type EMPTY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Fichier')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 398, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_Fichier', T_Fichier)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_tuple with content type SIMPLE
+class T_tuple (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_tuple with content type SIMPLE"""
+    _TypeDefinition = pyxb.binding.datatypes.anySimpleType
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_tuple')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 454, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anySimpleType
+    
+    # Attribute n uses Python identifier n
+    __n = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(None, u'n'), 'n', '__httpchercheurs_edf_comlogicielsefficas_T_tuple_n', pyxb.binding.datatypes.int, required=True)
+    __n._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 457, 4)
+    __n._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 457, 4)
+    
+    n = property(__n.value, __n.set, None, None)
+
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        __n.name() : __n
+    })
+Namespace.addCategoryObject('typeBinding', u'T_tuple', T_tuple)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_into with content type ELEMENT_ONLY
+class T_into (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_into with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_into')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 501, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}fonction_utilisateur uses Python identifier fonction_utilisateur
+    __fonction_utilisateur = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'fonction_utilisateur'), 'fonction_utilisateur', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficasfonction_utilisateur', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 10, 1), )
+
+    
+    fonction_utilisateur = property(__fonction_utilisateur.value, __fonction_utilisateur.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}typesimple uses Python identifier typesimple
+    __typesimple = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'typesimple'), 'typesimple', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficastypesimple', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 464, 1), )
+
+    
+    typesimple = property(__typesimple.value, __typesimple.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}matrice_double uses Python identifier matrice_double
+    __matrice_double = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'matrice_double'), 'matrice_double', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficasmatrice_double', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 465, 1), )
+
+    
+    matrice_double = property(__matrice_double.value, __matrice_double.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}matrice_symetrique_double uses Python identifier matrice_symetrique_double
+    __matrice_symetrique_double = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'matrice_symetrique_double'), 'matrice_symetrique_double', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficasmatrice_symetrique_double', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 466, 1), )
+
+    
+    matrice_symetrique_double = property(__matrice_symetrique_double.value, __matrice_symetrique_double.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}tuple uses Python identifier tuple
+    __tuple = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'tuple'), 'tuple', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficastuple', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 467, 1), )
+
+    
+    tuple = property(__tuple.value, __tuple.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}classe_utilisateur uses Python identifier classe_utilisateur
+    __classe_utilisateur = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'classe_utilisateur'), 'classe_utilisateur', '__httpchercheurs_edf_comlogicielsefficas_T_into_httpchercheurs_edf_comlogicielsefficasclasse_utilisateur', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 468, 1), )
+
+    
+    classe_utilisateur = property(__classe_utilisateur.value, __classe_utilisateur.set, None, None)
+
+    _ElementMap.update({
+        __fonction_utilisateur.name() : __fonction_utilisateur,
+        __typesimple.name() : __typesimple,
+        __matrice_double.name() : __matrice_double,
+        __matrice_symetrique_double.name() : __matrice_symetrique_double,
+        __tuple.name() : __tuple,
+        __classe_utilisateur.name() : __classe_utilisateur
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_into', T_into)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_doc with content type EMPTY
+class T_doc (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_doc with content type EMPTY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_doc')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 61, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}fr uses Python identifier fr
+    __fr = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'fr'), 'fr', '__httpchercheurs_edf_comlogicielsefficas_T_doc_httpchercheurs_edf_comlogicielsefficasfr', pyxb.binding.datatypes.string)
+    __fr._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 53, 1)
+    __fr._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 62, 2)
+    
+    fr = property(__fr.value, __fr.set, None, None)
+
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}ang uses Python identifier ang
+    __ang = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'ang'), 'ang', '__httpchercheurs_edf_comlogicielsefficas_T_doc_httpchercheurs_edf_comlogicielsefficasang', pyxb.binding.datatypes.string)
+    __ang._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 54, 1)
+    __ang._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 63, 2)
+    
+    ang = property(__ang.value, __ang.set, None, None)
+
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}docu uses Python identifier docu
+    __docu = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'docu'), 'docu', '__httpchercheurs_edf_comlogicielsefficas_T_doc_httpchercheurs_edf_comlogicielsefficasdocu', AT_docu)
+    __docu._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 55, 1)
+    __docu._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 64, 2)
+    
+    docu = property(__docu.value, __docu.set, None, None)
+
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        __fr.name() : __fr,
+        __ang.name() : __ang,
+        __docu.name() : __docu
+    })
+Namespace.addCategoryObject('typeBinding', u'T_doc', T_doc)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common with content type ELEMENT_ONLY
+class T_Accas_Common (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Accas.Common')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 87, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}doc uses Python identifier doc
+    __doc = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'doc'), 'doc', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasdoc', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 4, 1), )
+
+    
+    doc = property(__doc.value, __doc.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}regles uses Python identifier regles
+    __regles = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'regles'), 'regles', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasregles', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 6, 1), )
+
+    
+    regles = property(__regles.value, __regles.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}SIMP uses Python identifier SIMP
+    __SIMP = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'SIMP'), 'SIMP', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasSIMP', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 43, 1), )
+
+    
+    SIMP = property(__SIMP.value, __SIMP.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}FACT uses Python identifier FACT
+    __FACT = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'FACT'), 'FACT', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasFACT', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 123, 1), )
+
+    
+    FACT = property(__FACT.value, __FACT.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}BLOC uses Python identifier BLOC
+    __BLOC = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'BLOC'), 'BLOC', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasBLOC', True, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 157, 1), )
+
+    
+    BLOC = property(__BLOC.value, __BLOC.set, None, None)
+
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}nom uses Python identifier nom
+    __nom = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'nom'), 'nom', '__httpchercheurs_edf_comlogicielsefficas_T_Accas_Common_httpchercheurs_edf_comlogicielsefficasnom', AT_nom, required=True)
+    __nom._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 51, 1)
+    __nom._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 97, 2)
+    
+    nom = property(__nom.value, __nom.set, None, None)
+
+    _ElementMap.update({
+        __doc.name() : __doc,
+        __regles.name() : __regles,
+        __SIMP.name() : __SIMP,
+        __FACT.name() : __FACT,
+        __BLOC.name() : __BLOC
+    })
+    _AttributeMap.update({
+        __nom.name() : __nom
+    })
+Namespace.addCategoryObject('typeBinding', u'T_Accas.Common', T_Accas_Common)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_SIMP with content type ELEMENT_ONLY
+class T_SIMP (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_SIMP with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_SIMP')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 167, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is pyxb.binding.datatypes.anyType
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}doc uses Python identifier doc
+    __doc = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'doc'), 'doc', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasdoc', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 4, 1), )
+
+    
+    doc = property(__doc.value, __doc.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}ValeurDef uses Python identifier ValeurDef
+    __ValeurDef = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'ValeurDef'), 'ValeurDef', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasValeurDef', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 8, 1), )
+
+    
+    ValeurDef = property(__ValeurDef.value, __ValeurDef.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}ValeurSugg uses Python identifier ValeurSugg
+    __ValeurSugg = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'ValeurSugg'), 'ValeurSugg', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasValeurSugg', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 9, 1), )
+
+    
+    ValeurSugg = property(__ValeurSugg.value, __ValeurSugg.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}validators uses Python identifier validators
+    __validators = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'validators'), 'validators', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasvalidators', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 39, 1), )
+
+    
+    validators = property(__validators.value, __validators.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}PlageValeur uses Python identifier PlageValeur
+    __PlageValeur = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'PlageValeur'), 'PlageValeur', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasPlageValeur', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 40, 1), )
+
+    
+    PlageValeur = property(__PlageValeur.value, __PlageValeur.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}typeAttendu uses Python identifier typeAttendu
+    __typeAttendu = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'typeAttendu'), 'typeAttendu', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficastypeAttendu', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 41, 1), )
+
+    
+    typeAttendu = property(__typeAttendu.value, __typeAttendu.set, None, None)
+
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}portee uses Python identifier portee
+    __portee = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'portee'), 'portee', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasportee', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 44, 1), )
+
+    
+    portee = property(__portee.value, __portee.set, None, None)
+
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}nom uses Python identifier nom
+    __nom = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'nom'), 'nom', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasnom', AT_nom, required=True)
+    __nom._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 51, 1)
+    __nom._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 181, 2)
+    
+    nom = property(__nom.value, __nom.set, None, None)
+
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}statut uses Python identifier statut
+    __statut = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'statut'), 'statut', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasstatut', AT_statut, unicode_default=u'o')
+    __statut._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 57, 1)
+    __statut._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 182, 2)
+    
+    statut = property(__statut.value, __statut.set, None, None)
+
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}max_occurs uses Python identifier max_occurs
+    __max_occurs = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'max_occurs'), 'max_occurs', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasmax_occurs', AT_max_occurs, unicode_default=u'1')
+    __max_occurs._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 58, 1)
+    __max_occurs._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 184, 2)
+    
+    max_occurs = property(__max_occurs.value, __max_occurs.set, None, None)
+
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}min_occurs uses Python identifier min_occurs
+    __min_occurs = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'min_occurs'), 'min_occurs', '__httpchercheurs_edf_comlogicielsefficas_T_SIMP_httpchercheurs_edf_comlogicielsefficasmin_occurs', AT_min_occurs, unicode_default=u'1')
+    __min_occurs._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 59, 1)
+    __min_occurs._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 183, 2)
+    
+    min_occurs = property(__min_occurs.value, __min_occurs.set, None, None)
+
+    _ElementMap.update({
+        __doc.name() : __doc,
+        __ValeurDef.name() : __ValeurDef,
+        __ValeurSugg.name() : __ValeurSugg,
+        __validators.name() : __validators,
+        __PlageValeur.name() : __PlageValeur,
+        __typeAttendu.name() : __typeAttendu,
+        __portee.name() : __portee
+    })
+    _AttributeMap.update({
+        __nom.name() : __nom,
+        __statut.name() : __statut,
+        __max_occurs.name() : __max_occurs,
+        __min_occurs.name() : __min_occurs
+    })
+Namespace.addCategoryObject('typeBinding', u'T_SIMP', T_SIMP)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Matrice_double with content type SIMPLE
+class T_Matrice_double (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Matrice_double with content type SIMPLE"""
+    _TypeDefinition = T_list_double
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Matrice_double')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 432, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is T_list_double
+    
+    # Attribute n uses Python identifier n
+    __n = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(None, u'n'), 'n', '__httpchercheurs_edf_comlogicielsefficas_T_Matrice_double_n', pyxb.binding.datatypes.integer, required=True)
+    __n._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 435, 4)
+    __n._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 435, 4)
+    
+    n = property(__n.value, __n.set, None, None)
+
+    
+    # Attribute m uses Python identifier m
+    __m = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(None, u'm'), 'm', '__httpchercheurs_edf_comlogicielsefficas_T_Matrice_double_m', pyxb.binding.datatypes.integer, required=True)
+    __m._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 436, 4)
+    __m._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 436, 4)
+    
+    m = property(__m.value, __m.set, None, None)
+
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        __n.name() : __n,
+        __m.name() : __m
+    })
+Namespace.addCategoryObject('typeBinding', u'T_Matrice_double', T_Matrice_double)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Matrice_Symetrique_double with content type SIMPLE
+class T_Matrice_Symetrique_double (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_Matrice_Symetrique_double with content type SIMPLE"""
+    _TypeDefinition = T_list_double
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_Matrice_Symetrique_double')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 441, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is T_list_double
+    
+    # Attribute n uses Python identifier n
+    __n = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(None, u'n'), 'n', '__httpchercheurs_edf_comlogicielsefficas_T_Matrice_Symetrique_double_n', pyxb.binding.datatypes.int, required=True)
+    __n._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 444, 4)
+    __n._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 444, 4)
+    
+    n = property(__n.value, __n.set, None, None)
+
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        __n.name() : __n
+    })
+Namespace.addCategoryObject('typeBinding', u'T_Matrice_Symetrique_double', T_Matrice_Symetrique_double)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_typeAttendu with content type ELEMENT_ONLY
+class T_typeAttendu (T_into):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_typeAttendu with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_typeAttendu')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 512, 1)
+    _ElementMap = T_into._ElementMap.copy()
+    _AttributeMap = T_into._AttributeMap.copy()
+    # Base type is T_into
+    
+    # Element typesimple ({http://chercheurs.edf.com/logiciels/efficas}typesimple) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_into
+    
+    # Element matrice_double ({http://chercheurs.edf.com/logiciels/efficas}matrice_double) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_into
+    
+    # Element matrice_symetrique_double ({http://chercheurs.edf.com/logiciels/efficas}matrice_symetrique_double) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_into
+    
+    # Element tuple ({http://chercheurs.edf.com/logiciels/efficas}tuple) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_into
+    
+    # Element classe_utilisateur ({http://chercheurs.edf.com/logiciels/efficas}classe_utilisateur) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_into
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_typeAttendu', T_typeAttendu)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_OPER with content type ELEMENT_ONLY
+class T_OPER (T_Accas_Common):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_OPER with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_OPER')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 100, 1)
+    _ElementMap = T_Accas_Common._ElementMap.copy()
+    _AttributeMap = T_Accas_Common._AttributeMap.copy()
+    # Base type is T_Accas_Common
+    
+    # Element doc ({http://chercheurs.edf.com/logiciels/efficas}doc) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element regles ({http://chercheurs.edf.com/logiciels/efficas}regles) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}typeCree uses Python identifier typeCree
+    __typeCree = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'typeCree'), 'typeCree', '__httpchercheurs_edf_comlogicielsefficas_T_OPER_httpchercheurs_edf_comlogicielsefficastypeCree', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 7, 1), )
+
+    
+    typeCree = property(__typeCree.value, __typeCree.set, None, None)
+
+    
+    # Element SIMP ({http://chercheurs.edf.com/logiciels/efficas}SIMP) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element FACT ({http://chercheurs.edf.com/logiciels/efficas}FACT) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element BLOC ({http://chercheurs.edf.com/logiciels/efficas}BLOC) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Attribute nom inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}subroutine uses Python identifier subroutine
+    __subroutine = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'subroutine'), 'subroutine', '__httpchercheurs_edf_comlogicielsefficas_T_OPER_httpchercheurs_edf_comlogicielsefficassubroutine', AT_subroutine, unicode_default=u'None')
+    __subroutine._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 60, 1)
+    __subroutine._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 106, 4)
+    
+    subroutine = property(__subroutine.value, __subroutine.set, None, None)
+
+    _ElementMap.update({
+        __typeCree.name() : __typeCree
+    })
+    _AttributeMap.update({
+        __subroutine.name() : __subroutine
+    })
+Namespace.addCategoryObject('typeBinding', u'T_OPER', T_OPER)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_PROC with content type ELEMENT_ONLY
+class T_PROC (T_Accas_Common):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_PROC with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_PROC')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 116, 1)
+    _ElementMap = T_Accas_Common._ElementMap.copy()
+    _AttributeMap = T_Accas_Common._AttributeMap.copy()
+    # Base type is T_Accas_Common
+    
+    # Element doc ({http://chercheurs.edf.com/logiciels/efficas}doc) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element regles ({http://chercheurs.edf.com/logiciels/efficas}regles) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element SIMP ({http://chercheurs.edf.com/logiciels/efficas}SIMP) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element FACT ({http://chercheurs.edf.com/logiciels/efficas}FACT) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element BLOC ({http://chercheurs.edf.com/logiciels/efficas}BLOC) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Attribute nom inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}subroutine uses Python identifier subroutine
+    __subroutine = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'subroutine'), 'subroutine', '__httpchercheurs_edf_comlogicielsefficas_T_PROC_httpchercheurs_edf_comlogicielsefficassubroutine', AT_subroutine, unicode_default=u'None')
+    __subroutine._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 60, 1)
+    __subroutine._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 119, 4)
+    
+    subroutine = property(__subroutine.value, __subroutine.set, None, None)
+
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        __subroutine.name() : __subroutine
+    })
+Namespace.addCategoryObject('typeBinding', u'T_PROC', T_PROC)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_FACT with content type ELEMENT_ONLY
+class T_FACT (T_Accas_Common):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_FACT with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_FACT')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 139, 1)
+    _ElementMap = T_Accas_Common._ElementMap.copy()
+    _AttributeMap = T_Accas_Common._AttributeMap.copy()
+    # Base type is T_Accas_Common
+    
+    # Element doc ({http://chercheurs.edf.com/logiciels/efficas}doc) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element regles ({http://chercheurs.edf.com/logiciels/efficas}regles) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element SIMP ({http://chercheurs.edf.com/logiciels/efficas}SIMP) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element FACT ({http://chercheurs.edf.com/logiciels/efficas}FACT) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element BLOC ({http://chercheurs.edf.com/logiciels/efficas}BLOC) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Attribute nom inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}statut uses Python identifier statut
+    __statut = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'statut'), 'statut', '__httpchercheurs_edf_comlogicielsefficas_T_FACT_httpchercheurs_edf_comlogicielsefficasstatut', AT_statut, unicode_default=u'o')
+    __statut._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 57, 1)
+    __statut._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 142, 4)
+    
+    statut = property(__statut.value, __statut.set, None, None)
+
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}max_occurs uses Python identifier max_occurs
+    __max_occurs = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'max_occurs'), 'max_occurs', '__httpchercheurs_edf_comlogicielsefficas_T_FACT_httpchercheurs_edf_comlogicielsefficasmax_occurs', AT_max_occurs, unicode_default=u'1')
+    __max_occurs._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 58, 1)
+    __max_occurs._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 144, 4)
+    
+    max_occurs = property(__max_occurs.value, __max_occurs.set, None, None)
+
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}min_occurs uses Python identifier min_occurs
+    __min_occurs = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'min_occurs'), 'min_occurs', '__httpchercheurs_edf_comlogicielsefficas_T_FACT_httpchercheurs_edf_comlogicielsefficasmin_occurs', AT_min_occurs, unicode_default=u'1')
+    __min_occurs._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 59, 1)
+    __min_occurs._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 143, 4)
+    
+    min_occurs = property(__min_occurs.value, __min_occurs.set, None, None)
+
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        __statut.name() : __statut,
+        __max_occurs.name() : __max_occurs,
+        __min_occurs.name() : __min_occurs
+    })
+Namespace.addCategoryObject('typeBinding', u'T_FACT', T_FACT)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_BLOC with content type ELEMENT_ONLY
+class T_BLOC (T_Accas_Common):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_BLOC with content type ELEMENT_ONLY"""
+    _TypeDefinition = None
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_BLOC')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 158, 1)
+    _ElementMap = T_Accas_Common._ElementMap.copy()
+    _AttributeMap = T_Accas_Common._AttributeMap.copy()
+    # Base type is T_Accas_Common
+    
+    # Element doc ({http://chercheurs.edf.com/logiciels/efficas}doc) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element regles ({http://chercheurs.edf.com/logiciels/efficas}regles) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element SIMP ({http://chercheurs.edf.com/logiciels/efficas}SIMP) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element {http://chercheurs.edf.com/logiciels/efficas}condition uses Python identifier condition
+    __condition = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(Namespace, u'condition'), 'condition', '__httpchercheurs_edf_comlogicielsefficas_T_BLOC_httpchercheurs_edf_comlogicielsefficascondition', False, pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 45, 1), )
+
+    
+    condition = property(__condition.value, __condition.set, None, None)
+
+    
+    # Element FACT ({http://chercheurs.edf.com/logiciels/efficas}FACT) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Element BLOC ({http://chercheurs.edf.com/logiciels/efficas}BLOC) inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    
+    # Attribute nom inherited from {http://chercheurs.edf.com/logiciels/efficas}T_Accas.Common
+    _ElementMap.update({
+        __condition.name() : __condition
+    })
+    _AttributeMap.update({
+        
+    })
+Namespace.addCategoryObject('typeBinding', u'T_BLOC', T_BLOC)
+
+
+# Complex type {http://chercheurs.edf.com/logiciels/efficas}T_classe_utilisateur_username with content type SIMPLE
+class T_classe_utilisateur_username (pyxb.binding.basis.complexTypeDefinition):
+    """Complex type {http://chercheurs.edf.com/logiciels/efficas}T_classe_utilisateur_username with content type SIMPLE"""
+    _TypeDefinition = T_classe_utilisateur_name
+    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE
+    _Abstract = False
+    _ExpandedName = pyxb.namespace.ExpandedName(Namespace, u'T_classe_utilisateur_username')
+    _XSDLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 376, 1)
+    _ElementMap = {}
+    _AttributeMap = {}
+    # Base type is T_classe_utilisateur_name
+    
+    # Attribute {http://chercheurs.edf.com/logiciels/efficas}nom uses Python identifier nom
+    __nom = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(Namespace, u'nom'), 'nom', '__httpchercheurs_edf_comlogicielsefficas_T_classe_utilisateur_username_httpchercheurs_edf_comlogicielsefficasnom', AT_nom, required=True)
+    __nom._DeclarationLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 51, 1)
+    __nom._UseLocation = pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 379, 4)
+    
+    nom = property(__nom.value, __nom.set, None, None)
+
+    _ElementMap.update({
+        
+    })
+    _AttributeMap.update({
+        __nom.name() : __nom
+    })
+Namespace.addCategoryObject('typeBinding', u'T_classe_utilisateur_username', T_classe_utilisateur_username)
+
+
+cata = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'cata'), T_cata, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 5, 1))
+Namespace.addCategoryObject('elementBinding', cata.name().localName(), cata)
+
+regles = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'regles'), T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 6, 1))
+Namespace.addCategoryObject('elementBinding', regles.name().localName(), regles)
+
+fonction_utilisateur = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'fonction_utilisateur'), T_fonction_python, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 10, 1))
+Namespace.addCategoryObject('elementBinding', fonction_utilisateur.name().localName(), fonction_utilisateur)
+
+commandes = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'commandes'), T_commandes, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 11, 1))
+Namespace.addCategoryObject('elementBinding', commandes.name().localName(), commandes)
+
+validators = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'validators'), T_validators, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 39, 1))
+Namespace.addCategoryObject('elementBinding', validators.name().localName(), validators)
+
+PlageValeur = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PlageValeur'), T_PlageValeur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 40, 1))
+Namespace.addCategoryObject('elementBinding', PlageValeur.name().localName(), PlageValeur)
+
+portee = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'portee'), T_portee, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 44, 1), unicode_default=u'None')
+Namespace.addCategoryObject('elementBinding', portee.name().localName(), portee)
+
+condition = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'condition'), T_fonction_python, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 45, 1))
+Namespace.addCategoryObject('elementBinding', condition.name().localName(), condition)
+
+into = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'into'), T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 49, 1))
+Namespace.addCategoryObject('elementBinding', into.name().localName(), into)
+
+A_CLASSER = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'A_CLASSER'), T_predicat2, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 257, 1))
+Namespace.addCategoryObject('elementBinding', A_CLASSER.name().localName(), A_CLASSER)
+
+tuple = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'tuple'), T_tuple, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 467, 1))
+Namespace.addCategoryObject('elementBinding', tuple.name().localName(), tuple)
+
+doc = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'doc'), T_doc, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 4, 1))
+Namespace.addCategoryObject('elementBinding', doc.name().localName(), doc)
+
+typeCree = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typeCree'), T_classe_utilisateur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 7, 1))
+Namespace.addCategoryObject('elementBinding', typeCree.name().localName(), typeCree)
+
+ValeurDef = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ValeurDef'), T_typeAttendu, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 8, 1))
+Namespace.addCategoryObject('elementBinding', ValeurDef.name().localName(), ValeurDef)
+
+ValeurSugg = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ValeurSugg'), T_typeAttendu, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 9, 1))
+Namespace.addCategoryObject('elementBinding', ValeurSugg.name().localName(), ValeurSugg)
+
+SIMP = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'SIMP'), T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 43, 1))
+Namespace.addCategoryObject('elementBinding', SIMP.name().localName(), SIMP)
+
+borne_sup = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'borne_sup'), T_typeAttendu, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 46, 1))
+Namespace.addCategoryObject('elementBinding', borne_sup.name().localName(), borne_sup)
+
+borne_inf = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'borne_inf'), T_typeAttendu, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 47, 1))
+Namespace.addCategoryObject('elementBinding', borne_inf.name().localName(), borne_inf)
+
+AU_MOINS_UN = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'AU_MOINS_UN'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 258, 1))
+Namespace.addCategoryObject('elementBinding', AU_MOINS_UN.name().localName(), AU_MOINS_UN)
+
+AU_PLUS_UN = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'AU_PLUS_UN'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 259, 1))
+Namespace.addCategoryObject('elementBinding', AU_PLUS_UN.name().localName(), AU_PLUS_UN)
+
+ENSEMBLE = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ENSEMBLE'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 260, 1))
+Namespace.addCategoryObject('elementBinding', ENSEMBLE.name().localName(), ENSEMBLE)
+
+EXCLUS = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'EXCLUS'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 261, 1))
+Namespace.addCategoryObject('elementBinding', EXCLUS.name().localName(), EXCLUS)
+
+PRESENT_ABSENT = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_ABSENT'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 269, 1))
+Namespace.addCategoryObject('elementBinding', PRESENT_ABSENT.name().localName(), PRESENT_ABSENT)
+
+PRESENT_PRESENT = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_PRESENT'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 270, 1))
+Namespace.addCategoryObject('elementBinding', PRESENT_PRESENT.name().localName(), PRESENT_PRESENT)
+
+UN_PARMI = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'UN_PARMI'), T_predicat1, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 271, 1))
+Namespace.addCategoryObject('elementBinding', UN_PARMI.name().localName(), UN_PARMI)
+
+matrice_double = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'matrice_double'), T_Matrice_double, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 465, 1))
+Namespace.addCategoryObject('elementBinding', matrice_double.name().localName(), matrice_double)
+
+matrice_symetrique_double = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'matrice_symetrique_double'), T_Matrice_Symetrique_double, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 466, 1))
+Namespace.addCategoryObject('elementBinding', matrice_symetrique_double.name().localName(), matrice_symetrique_double)
+
+classe_utilisateur = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'classe_utilisateur'), T_classe_utilisateur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 468, 1))
+Namespace.addCategoryObject('elementBinding', classe_utilisateur.name().localName(), classe_utilisateur)
+
+OPER = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'OPER'), T_OPER, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 99, 1))
+Namespace.addCategoryObject('elementBinding', OPER.name().localName(), OPER)
+
+PROC = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PROC'), T_PROC, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 110, 1))
+Namespace.addCategoryObject('elementBinding', PROC.name().localName(), PROC)
+
+FACT = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'FACT'), T_FACT, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 123, 1))
+Namespace.addCategoryObject('elementBinding', FACT.name().localName(), FACT)
+
+BLOC = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'BLOC'), T_BLOC, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 157, 1))
+Namespace.addCategoryObject('elementBinding', BLOC.name().localName(), BLOC)
+
+typeAttendu = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typeAttendu'), T_name, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 41, 1))
+Namespace.addCategoryObject('elementBinding', typeAttendu.name().localName(), typeAttendu)
+
+typesimple = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typesimple'), T_simple, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 464, 1))
+Namespace.addCategoryObject('elementBinding', typesimple.name().localName(), typesimple)
+
+classeUtilisateurName = pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'classeUtilisateurName'), T_classe_utilisateur_username, abstract=pyxb.binding.datatypes.boolean(1), location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 42, 1))
+Namespace.addCategoryObject('elementBinding', classeUtilisateurName.name().localName(), classeUtilisateurName)
+
+
+
+T_cata._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'commandes'), T_commandes, scope=T_cata, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 11, 1)))
+
+def _BuildAutomaton ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton
+    del _BuildAutomaton
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 68, 3))
+    counters.add(cc_0)
+    states = []
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_0, False))
+    symbol = pyxb.binding.content.ElementUse(T_cata._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'commandes')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 68, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    st_0._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, True, containing_state=None)
+T_cata._Automaton = _BuildAutomaton()
+
+
+
+
+T_commandes._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'OPER'), T_OPER, scope=T_commandes, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 99, 1)))
+
+T_commandes._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PROC'), T_PROC, scope=T_commandes, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 110, 1)))
+
+def _BuildAutomaton_ ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_
+    del _BuildAutomaton_
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 72, 2))
+    counters.add(cc_0)
+    states = []
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_0, False))
+    symbol = pyxb.binding.content.ElementUse(T_commandes._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'OPER')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 73, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_0, False))
+    symbol = pyxb.binding.content.ElementUse(T_commandes._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'PROC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 74, 3))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    st_1._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, True, containing_state=None)
+T_commandes._Automaton = _BuildAutomaton_()
+
+
+
+
+T_PlageValeur._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'borne_sup'), T_typeAttendu, scope=T_PlageValeur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 46, 1)))
+
+T_PlageValeur._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'borne_inf'), T_typeAttendu, scope=T_PlageValeur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 47, 1)))
+
+T_PlageValeur._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'into'), T_into, scope=T_PlageValeur, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 49, 1)))
+
+def _BuildAutomaton_2 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_2
+    del _BuildAutomaton_2
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 81, 4))
+    counters.add(cc_0)
+    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 82, 4))
+    counters.add(cc_1)
+    states = []
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_0, False))
+    symbol = pyxb.binding.content.ElementUse(T_PlageValeur._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'borne_sup')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 81, 4))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_1, False))
+    symbol = pyxb.binding.content.ElementUse(T_PlageValeur._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'borne_inf')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 82, 4))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_PlageValeur._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'into')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 84, 3))
+    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_2)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_1, True) ]))
+    st_1._set_transitionSet(transitions)
+    transitions = []
+    st_2._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, True, containing_state=None)
+T_PlageValeur._Automaton = _BuildAutomaton_2()
+
+
+
+
+T_predicat2._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'p1'), T_predicat1, scope=T_predicat2, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 252, 3)))
+
+T_predicat2._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'p2'), AT_nom, scope=T_predicat2, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 253, 3)))
+
+def _BuildAutomaton_3 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_3
+    del _BuildAutomaton_3
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    states = []
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_predicat2._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'p1')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 252, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_predicat2._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'p2')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 253, 3))
+    st_1 = fac.State(symbol, is_initial=False, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    transitions = []
+    transitions.append(fac.Transition(st_1, [
+         ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    st_1._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, False, containing_state=None)
+T_predicat2._Automaton = _BuildAutomaton_3()
+
+
+
+
+T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'A_CLASSER'), T_predicat2, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 257, 1)))
+
+T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'AU_MOINS_UN'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 258, 1)))
+
+T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'AU_PLUS_UN'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 259, 1)))
+
+T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ENSEMBLE'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 260, 1)))
+
+T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'EXCLUS'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 261, 1)))
+
+T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_ABSENT'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 269, 1)))
+
+T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_PRESENT'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 270, 1)))
+
+T_regles._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'UN_PARMI'), T_predicat1, scope=T_regles, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 271, 1)))
+
+def _BuildAutomaton_4 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_4
+    del _BuildAutomaton_4
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    states = []
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'A_CLASSER')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 274, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'AU_MOINS_UN')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 275, 3))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'AU_PLUS_UN')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 276, 3))
+    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_2)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'ENSEMBLE')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 277, 3))
+    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_3)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'EXCLUS')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 278, 3))
+    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_4)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_ABSENT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 286, 3))
+    st_5 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_5)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'PRESENT_PRESENT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 287, 3))
+    st_6 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_6)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_regles._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'UN_PARMI')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 288, 3))
+    st_7 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_7)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+         ]))
+    transitions.append(fac.Transition(st_1, [
+         ]))
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    transitions.append(fac.Transition(st_6, [
+         ]))
+    transitions.append(fac.Transition(st_7, [
+         ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+         ]))
+    transitions.append(fac.Transition(st_1, [
+         ]))
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    transitions.append(fac.Transition(st_6, [
+         ]))
+    transitions.append(fac.Transition(st_7, [
+         ]))
+    st_1._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+         ]))
+    transitions.append(fac.Transition(st_1, [
+         ]))
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    transitions.append(fac.Transition(st_6, [
+         ]))
+    transitions.append(fac.Transition(st_7, [
+         ]))
+    st_2._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+         ]))
+    transitions.append(fac.Transition(st_1, [
+         ]))
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    transitions.append(fac.Transition(st_6, [
+         ]))
+    transitions.append(fac.Transition(st_7, [
+         ]))
+    st_3._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+         ]))
+    transitions.append(fac.Transition(st_1, [
+         ]))
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    transitions.append(fac.Transition(st_6, [
+         ]))
+    transitions.append(fac.Transition(st_7, [
+         ]))
+    st_4._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+         ]))
+    transitions.append(fac.Transition(st_1, [
+         ]))
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    transitions.append(fac.Transition(st_6, [
+         ]))
+    transitions.append(fac.Transition(st_7, [
+         ]))
+    st_5._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+         ]))
+    transitions.append(fac.Transition(st_1, [
+         ]))
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    transitions.append(fac.Transition(st_6, [
+         ]))
+    transitions.append(fac.Transition(st_7, [
+         ]))
+    st_6._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+         ]))
+    transitions.append(fac.Transition(st_1, [
+         ]))
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    transitions.append(fac.Transition(st_6, [
+         ]))
+    transitions.append(fac.Transition(st_7, [
+         ]))
+    st_7._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, False, containing_state=None)
+T_regles._Automaton = _BuildAutomaton_4()
+
+
+
+
+T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'fonction_utilisateur'), T_fonction_python, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 10, 1)))
+
+T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typesimple'), T_simple, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 464, 1)))
+
+T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'matrice_double'), T_Matrice_double, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 465, 1)))
+
+T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'matrice_symetrique_double'), T_Matrice_Symetrique_double, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 466, 1)))
+
+T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'tuple'), T_tuple, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 467, 1)))
+
+T_into._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'classe_utilisateur'), T_classe_utilisateur, scope=T_into, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 468, 1)))
+
+def _BuildAutomaton_5 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_5
+    del _BuildAutomaton_5
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 504, 3))
+    counters.add(cc_0)
+    cc_1 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 505, 3))
+    counters.add(cc_1)
+    cc_2 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 506, 3))
+    counters.add(cc_2)
+    cc_3 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 507, 3))
+    counters.add(cc_3)
+    cc_4 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 508, 3))
+    counters.add(cc_4)
+    states = []
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_0, False))
+    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'typesimple')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 504, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_1, False))
+    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'matrice_double')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 505, 3))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_2, False))
+    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'matrice_symetrique_double')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 506, 3))
+    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_2)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_3, False))
+    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'tuple')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 507, 3))
+    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_3)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_4, False))
+    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'classe_utilisateur')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 508, 3))
+    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_4)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_into._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'fonction_utilisateur')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 509, 3))
+    st_5 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_5)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_1, True) ]))
+    st_1._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_2, True) ]))
+    st_2._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_3, True) ]))
+    st_3._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_4, True) ]))
+    st_4._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    st_5._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, True, containing_state=None)
+T_into._Automaton = _BuildAutomaton_5()
+
+
+
+
+T_Accas_Common._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'doc'), T_doc, scope=T_Accas_Common, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 4, 1)))
+
+T_Accas_Common._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'regles'), T_regles, scope=T_Accas_Common, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 6, 1)))
+
+T_Accas_Common._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'SIMP'), T_SIMP, scope=T_Accas_Common, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 43, 1)))
+
+T_Accas_Common._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'FACT'), T_FACT, scope=T_Accas_Common, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 123, 1)))
+
+T_Accas_Common._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'BLOC'), T_BLOC, scope=T_Accas_Common, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 157, 1)))
+
+def _BuildAutomaton_6 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_6
+    del _BuildAutomaton_6
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
+    counters.add(cc_0)
+    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
+    counters.add(cc_1)
+    states = []
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_Accas_Common._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'regles')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_Accas_Common._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_Accas_Common._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'BLOC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 92, 4))
+    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_2)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_Accas_Common._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'FACT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 93, 4))
+    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_3)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_Accas_Common._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'SIMP')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 94, 4))
+    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_4)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_1, True) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    st_1._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    st_2._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    st_3._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    st_4._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, False, containing_state=None)
+T_Accas_Common._Automaton = _BuildAutomaton_6()
+
+
+
+
+T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'doc'), T_doc, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 4, 1)))
+
+T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ValeurDef'), T_typeAttendu, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 8, 1)))
+
+T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'ValeurSugg'), T_typeAttendu, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 9, 1)))
+
+T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'validators'), T_validators, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 39, 1)))
+
+T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'PlageValeur'), T_PlageValeur, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 40, 1)))
+
+T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typeAttendu'), T_name, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 41, 1)))
+
+T_SIMP._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'portee'), T_portee, scope=T_SIMP, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 44, 1), unicode_default=u'None'))
+
+def _BuildAutomaton_7 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_7
+    del _BuildAutomaton_7
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 169, 3))
+    counters.add(cc_0)
+    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 170, 3))
+    counters.add(cc_1)
+    cc_2 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 175, 3))
+    counters.add(cc_2)
+    cc_3 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 176, 3))
+    counters.add(cc_3)
+    cc_4 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 177, 3))
+    counters.add(cc_4)
+    cc_5 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 179, 3))
+    counters.add(cc_5)
+    states = []
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 169, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'portee')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 170, 3))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'ValeurDef')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 175, 3))
+    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_2)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'ValeurSugg')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 176, 3))
+    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_3)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'PlageValeur')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 177, 3))
+    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_4)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'typeAttendu')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 178, 3))
+    st_5 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_5)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_5, False))
+    symbol = pyxb.binding.content.ElementUse(T_SIMP._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'validators')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 179, 3))
+    st_6 = fac.State(symbol, is_initial=False, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_6)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_5, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_1, True) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_5, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    st_1._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_2, True) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_2, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_2, False) ]))
+    transitions.append(fac.Transition(st_5, [
+        fac.UpdateInstruction(cc_2, False) ]))
+    st_2._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_3, True) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_3, False) ]))
+    transitions.append(fac.Transition(st_5, [
+        fac.UpdateInstruction(cc_3, False) ]))
+    st_3._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_4, True) ]))
+    transitions.append(fac.Transition(st_5, [
+        fac.UpdateInstruction(cc_4, False) ]))
+    st_4._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_6, [
+         ]))
+    st_5._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_6, [
+        fac.UpdateInstruction(cc_5, True) ]))
+    st_6._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, False, containing_state=None)
+T_SIMP._Automaton = _BuildAutomaton_7()
+
+
+
+
+def _BuildAutomaton_8 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_8
+    del _BuildAutomaton_8
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 516, 5))
+    counters.add(cc_0)
+    cc_1 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 517, 5))
+    counters.add(cc_1)
+    cc_2 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 518, 5))
+    counters.add(cc_2)
+    cc_3 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 519, 5))
+    counters.add(cc_3)
+    cc_4 = fac.CounterCondition(min=0L, max=None, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 520, 5))
+    counters.add(cc_4)
+    states = []
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_0, False))
+    symbol = pyxb.binding.content.ElementUse(T_typeAttendu._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'typesimple')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 516, 5))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_1, False))
+    symbol = pyxb.binding.content.ElementUse(T_typeAttendu._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'matrice_double')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 517, 5))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_2, False))
+    symbol = pyxb.binding.content.ElementUse(T_typeAttendu._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'matrice_symetrique_double')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 518, 5))
+    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_2)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_3, False))
+    symbol = pyxb.binding.content.ElementUse(T_typeAttendu._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'tuple')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 519, 5))
+    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_3)
+    final_update = set()
+    final_update.add(fac.UpdateInstruction(cc_4, False))
+    symbol = pyxb.binding.content.ElementUse(T_typeAttendu._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'classe_utilisateur')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 520, 5))
+    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_4)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_1, True) ]))
+    st_1._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_2, True) ]))
+    st_2._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_3, True) ]))
+    st_3._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_4, True) ]))
+    st_4._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, True, containing_state=None)
+T_typeAttendu._Automaton = _BuildAutomaton_8()
+
+
+
+
+T_OPER._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'typeCree'), T_classe_utilisateur, scope=T_OPER, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 7, 1)))
+
+def _BuildAutomaton_9 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_9
+    del _BuildAutomaton_9
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
+    counters.add(cc_0)
+    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
+    counters.add(cc_1)
+    states = []
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'regles')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'BLOC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 92, 4))
+    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_2)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'FACT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 93, 4))
+    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_3)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'SIMP')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 94, 4))
+    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_4)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_OPER._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'typeCree')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 104, 5))
+    st_5 = fac.State(symbol, is_initial=False, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_5)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_1, True) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    st_1._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    st_2._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    st_3._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    st_4._set_transitionSet(transitions)
+    transitions = []
+    st_5._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, False, containing_state=None)
+T_OPER._Automaton = _BuildAutomaton_9()
+
+
+
+
+def _BuildAutomaton_10 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_10
+    del _BuildAutomaton_10
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
+    counters.add(cc_0)
+    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
+    counters.add(cc_1)
+    states = []
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_PROC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'regles')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_PROC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_PROC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'BLOC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 92, 4))
+    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_2)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_PROC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'FACT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 93, 4))
+    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_3)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_PROC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'SIMP')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 94, 4))
+    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_4)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_1, True) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    st_1._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    st_2._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    st_3._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    st_4._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, False, containing_state=None)
+T_PROC._Automaton = _BuildAutomaton_10()
+
+
+
+
+def _BuildAutomaton_11 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_11
+    del _BuildAutomaton_11
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
+    counters.add(cc_0)
+    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
+    counters.add(cc_1)
+    states = []
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_FACT._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'regles')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_FACT._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_FACT._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'BLOC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 92, 4))
+    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_2)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_FACT._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'FACT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 93, 4))
+    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_3)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_FACT._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'SIMP')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 94, 4))
+    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_4)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_1, True) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    st_1._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    st_2._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    st_3._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    st_4._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, False, containing_state=None)
+T_FACT._Automaton = _BuildAutomaton_11()
+
+
+
+
+T_BLOC._AddElement(pyxb.binding.basis.element(pyxb.namespace.ExpandedName(Namespace, u'condition'), T_fonction_python, scope=T_BLOC, location=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 45, 1)))
+
+def _BuildAutomaton_12 ():
+    # Remove this helper function from the namespace after it is invoked
+    global _BuildAutomaton_12
+    del _BuildAutomaton_12
+    import pyxb.utils.fac as fac
+
+    counters = set()
+    cc_0 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
+    counters.add(cc_0)
+    cc_1 = fac.CounterCondition(min=0L, max=1, metadata=pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
+    counters.add(cc_1)
+    states = []
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'regles')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 89, 3))
+    st_0 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_0)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'doc')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 90, 3))
+    st_1 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_1)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'BLOC')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 92, 4))
+    st_2 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_2)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'FACT')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 93, 4))
+    st_3 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_3)
+    final_update = None
+    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'SIMP')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 94, 4))
+    st_4 = fac.State(symbol, is_initial=True, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_4)
+    final_update = set()
+    symbol = pyxb.binding.content.ElementUse(T_BLOC._UseForTag(pyxb.namespace.ExpandedName(Namespace, u'condition')), pyxb.utils.utility.Location('/home/A96028/EchangesEric/EssaiExt/model.xsd', 162, 5))
+    st_5 = fac.State(symbol, is_initial=False, final_update=final_update, is_unordered_catenation=False)
+    states.append(st_5)
+    transitions = []
+    transitions.append(fac.Transition(st_0, [
+        fac.UpdateInstruction(cc_0, True) ]))
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_0, False) ]))
+    st_0._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_1, [
+        fac.UpdateInstruction(cc_1, True) ]))
+    transitions.append(fac.Transition(st_2, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_3, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    transitions.append(fac.Transition(st_4, [
+        fac.UpdateInstruction(cc_1, False) ]))
+    st_1._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    st_2._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    st_3._set_transitionSet(transitions)
+    transitions = []
+    transitions.append(fac.Transition(st_2, [
+         ]))
+    transitions.append(fac.Transition(st_3, [
+         ]))
+    transitions.append(fac.Transition(st_4, [
+         ]))
+    transitions.append(fac.Transition(st_5, [
+         ]))
+    st_4._set_transitionSet(transitions)
+    transitions = []
+    st_5._set_transitionSet(transitions)
+    return fac.Automaton(states, counters, False, containing_state=None)
+T_BLOC._Automaton = _BuildAutomaton_12()
+
+
+classeUtilisateurName._setSubstitutionGroup(typeAttendu)
diff --git a/OldCodes/Med/readerEfficas.py b/OldCodes/Med/readerEfficas.py
new file mode 100755 (executable)
index 0000000..afd1249
--- /dev/null
@@ -0,0 +1,129 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+import sys,os
+import raw.efficas as efficas
+import types
+
+sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..')))
+sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..','UiQT5')))
+
+
+from Accas import *
+
+
+# Attention pas d heritage possible (cf doc pyxbe)
+
+dictSIMPEficasXML= { 'typ'    : 'typeAttendu', 'statut'     : 'statut', 
+                     'min_occurs': 'min'        , 'max_occurs' : 'max', 
+                     'homo'      : 'homo'       , 'position'   : 'portee', 
+                     'validators': 'validators' , 'sug'        : 'valeur_sugg',
+                     'defaut'    : 'ValeurDef'  , 'into'       : ('PlageValeur','into'), 
+                     'val_min'   : ('PlageValeur','borne_inf') , 'val_max'    : ('PlageValeur','borne_sup'),
+                     'ang'       : ('doc','ang')               , 'fr'         : ('doc','fr',)   ,
+                     'docu'      : ('doc','docu'),}
+dictSIMPXMLEficas = {'doc' : {'fr' : 'fr' , 'ang' : 'ang' , 'docu' : 'docu' },
+                    'PlageValeur' : {'borne_sup' : 'val_max' , 'into' : 'into' , 'borne_inf' : 'val_min' ,},
+                    'statut' : 'statut' , 'validators' : 'validators' , 'homo' : 'homo' ,
+                    'ValeurDef' : 'defaut' ,  'min' : 'min_occurs' ,
+                    'valeur_sugg' : 'sug' , 'portee' : 'position' , 'max' : 'max_occurs' , }
+
+
+# ------------------------------
+class monSIMP (efficas.T_SIMP):
+# ------------------------------
+
+   def explore(self):
+      print "je passe dans  explore pour SIMP ", self.nom
+      self.dictArgsEficas={}
+      self.dictArgsEficas['typ']=self.typeAttendu
+      for nomXMLArg in dir(self) :
+          if nomXMLArg in dictSIMPXMLEficas.keys() :
+              nomEficasArg=dictSIMPXMLEficas[nomXMLArg]
+              argu=getattr(self,nomXMLArg)
+              if argu==None : continue
+              if type(nomEficasArg) == types.DictionaryType:
+                 for nomXML in nomEficasArg.keys():
+                      arguDecoupe=getattr(argu,nomXML)
+                      nomEficasDecoupe=nomEficasArg[nomXML]
+                      self.dictArgsEficas[nomEficasDecoupe]=arguDecoupe
+              else :
+                 self.dictArgsEficas[nomEficasArg] = argu
+                    
+              #if argNew != None : print argNew
+      self.objAccas=A_SIMP.SIMP(**self.dictArgsEficas)
+      self.objAccas.nom=self.nom
+     
+   def getAccasEquivalent(self):
+       return self.nom, self.objAccas
+
+# ------------------------------
+class monPROC(efficas.T_PROC):
+# ------------------------------
+   def explore(self):
+      print "je passe dans  explore pour PROC ", self.nom
+      self.dictConstruction={}
+      self.dictConstruction['nom']=self.nom
+      
+      for obj in self.content(): 
+          if  hasattr(obj,'explore') : obj.explore ()
+          if  hasattr(obj,'getAccasEquivalent') : 
+              nom,objetAccas=obj.getAccasEquivalent()
+              self.dictConstruction[nom]=objetAccas
+      self.dictConstruction['op']=None
+      self.objAccas=A_PROC.PROC(**self.dictConstruction)
+      print dir(self.objAccas)
+      print self.objAccas.entites
+
+
+# ------------------------------
+class monFACT(efficas.T_FACT):
+# ------------------------------
+   def explore(self):
+      #print "je passe dans  explore pour FACT ", self.nom
+      self.dictConstruction={}
+      for obj in self.content(): 
+          if  hasattr(obj,'explore') : obj.explore 
+          if  hasattr(obj,'creeAccasEquivalent') : 
+              nom,objetAccas=obj.creeAccasEquivalent()
+              self.dictConstruction[nom]=objetAccas
+      self.objAccas=A_FACT.FACT(**self.dictConstruction)
+
+   def getAccasEquivalent(self):
+       return self.nom, self.objAccas
+
+
+# ------------------------------
+class monCata(efficas.T_cata):
+# ------------------------------
+   def exploreCata(self):
+   # On positionne le contexte ACCAS
+      self.JdC = JDC_CATA (code = 'MED', execmodul = None,)
+      objAExplorer=self.commandes[0]
+      for obj in objAExplorer.content(): 
+         if  hasattr(obj,'explore') : obj.explore()
+    
+     
+
+efficas.T_SIMP._SetSupersedingClass(monSIMP)
+efficas.T_FACT._SetSupersedingClass(monFACT)
+efficas.T_PROC._SetSupersedingClass(monPROC)
+efficas.T_cata._SetSupersedingClass(monCata)
+
+if __name__ == "__main__":
+#   print dir(efficas)
+#   print dir(efficas.T_SIMP)
+
+
+   xml = open('Cata_MED_FAM.xml').read()
+   SchemaMed = efficas.CreateFromDocument(xml)
+   SchemaMed.exploreCata()
+
+   #print dir(efficas.T_SIMP)
+   #print dir(efficas.T_SIMP)
+
+   #for maCommande in monCata.commandes :
+   #    for monProc in maCommande.PROC:
+   #        for monFact in monProc.FACT:
+   #            for simp in monFact.SIMP:
+   #                simp.creeAccasEquivalent()
index b31fad100fee460e9291fbe2fb7ff02d06077505..c8879f13491b31d9e9f9344bf26e7d6a786bc328 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+#### -*- coding: utf-8 -*-
 # Copyright (C) 2007-2021   EDF R&D
 #
 # This library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 from Traducteur.parseur import FactNode
-from Traducteur.load import jdcSet 
+from Traducteur.load import jdcSet
 import logging
 
 dict_commande={}
@@ -29,129 +29,127 @@ import sys
 #--------------------------------------------------------------------------
 def traitementRayon(jdc):
 #--------------------------------------------------------------------------
-   
+
     if "DEFI_FONCTION" not in jdcSet : return
     for c in jdc.root.childNodes:
-       if c.name != "DEFI_FONCTION" : continue
-       monTexte=jdc.getLines()[c.lineno-1]
-       monNomVariable=monTexte.split("=")[0]
-       aExecuter=monNomVariable+'=0'
-       dict_commande[monNomVariable]=c
-       exec aExecuter in dict_contexte
+        if c.name != "DEFI_FONCTION" : continue
+        monTexte=jdc.getLines()[c.lineno-1]
+        monNomVariable=monTexte.split("=")[0]
+        aExecuter=monNomVariable+'=0'
+        dict_commande[monNomVariable]=c
+        exec aExecuter in dict_contexte
     liste_MC=(("CALC_G","R_INF_FO"),("CALC_G","R_SUP_FO"),("CALC_G","MODULE_FO"))
     liste_achanger = chercheValeurSelonGenea2 (jdc,liste_MC)
     liste_MC=(("CALC_THETA","THETA_3D","R_INF_FO"),("CALC_THETA","THETA_3D","R_SUP_FO"),("CALC_THETA","THETA_3D","MODULE_FO"))
     liste_achanger2 = chercheValeurSelonGenea3 (jdc,liste_MC)
     liste_achanger=liste_achanger+liste_achanger2
     for item in liste_achanger :
-       commande=dict_commande[item]
-       changeValeurABSCNiveau1(commande,jdc)
+        commande=dict_commande[item]
+        changeValeurABSCNiveau1(commande,jdc)
 
 #----------------------------------
 def changeValeurABSCNiveau1(c,jdc):
 #----------------------------------
     for child in c.childNodes:
-       if child.name != "NOM_PARA":continue
-       MonTexte=child.getText(jdc)
-       if len(MonTexte.splitlines()) > 1 :
-          print "Le Traducteur ne sait pas gerer"
-          assert(0)
-       MonTexte=jdc.getLines()[child.lineno-1]
-       debut=MonTexte.find("NOM_PARA")
-       debChaine=MonTexte[0:debut+8]
-       ancien=MonTexte[debut+8:]
-       egal,nomval,fin=ancien.split("'",2)
-       nouvelleLigne=debChaine+egal+"'ABSC'"+fin
-       jdc.getLines()[child.lineno-1]=nouvelleLigne
-       logging.info("renommage parametre ABSC ligne %d",child.lineno-1)
+        if child.name != "NOM_PARA":continue
+        MonTexte=child.getText(jdc)
+        if len(MonTexte.splitlines()) > 1 :
+            print "Le Traducteur ne sait pas gerer"
+            assert(0)
+        MonTexte=jdc.getLines()[child.lineno-1]
+        debut=MonTexte.find("NOM_PARA")
+        debChaine=MonTexte[0:debut+8]
+        ancien=MonTexte[debut+8:]
+        egal,nomval,fin=ancien.split("'",2)
+        nouvelleLigne=debChaine+egal+"'ABSC'"+fin
+        jdc.getLines()[child.lineno-1]=nouvelleLigne
+        logging.info("renommage parametre ABSC ligne %d",child.lineno-1)
     return
-      
+
 #--------------------------------------------------------------------------
 def chercheValeurSelonGenea2(jdc,liste_cherche_valeur):
 #
 #--------------------------------------------------------------------------
     liste_valeurs=[]
     for genea in liste_cherche_valeur:
-       profondeur=len(genea)
-       if profondeur > 2 :
-          print "la methode chercheValeurSelonGenea ne convient"
-          print "pas pour cette généalogie"
-          assert(0)
-       command=genea[0]
-       fact=genea[1]
-      
-       for c in jdc.root.childNodes:
-          if c.name != command:continue
-          for mc in c.childNodes:
-             if mc.name != fact:continue
-             MonTexte=mc.getText(jdc)
-             try :
-             #if ( 1) :
-                exec MonTexte in dict_contexte
-                monNomVar=MonTexte.split("=")[1]
-                monNomVarOk=monNomVar
-                i=-1
-                while (monNomVar[i] == "," or  monNomVar[i] == " ") :
-                   monNomVarOk=monNomVar[0:i]
-                   i=i-1
-                monNomVar=monNomVarOk
-                i=0
-                while (monNomVar[i] == " ") :
-                   monNomVarOk=monNomVar[1:]
-                   i=i+1
-                monNomVar=monNomVarOk
-                if monNomVar not in liste_valeurs : liste_valeurs.append(monNomVar)
-             except :
-             #else :
-                logging.error("Pb pour renommer le parametre ABSC dans defi_fonctions selon calcg")
-                pass
+        profondeur=len(genea)
+        if profondeur > 2 :
+            print "la methode chercheValeurSelonGenea ne convient"
+            print "pas pour cette genealogie"
+            assert(0)
+        command=genea[0]
+        fact=genea[1]
+
+        for c in jdc.root.childNodes:
+            if c.name != command:continue
+            for mc in c.childNodes:
+                if mc.name != fact:continue
+                MonTexte=mc.getText(jdc)
+                try :
+                #if ( 1) :
+                    exec MonTexte in dict_contexte
+                    monNomVar=MonTexte.split("=")[1]
+                    monNomVarOk=monNomVar
+                    i=-1
+                    while (monNomVar[i] == "," or  monNomVar[i] == " ") :
+                        monNomVarOk=monNomVar[0:i]
+                        i=i-1
+                    monNomVar=monNomVarOk
+                    i=0
+                    while (monNomVar[i] == " ") :
+                        monNomVarOk=monNomVar[1:]
+                        i=i+1
+                    monNomVar=monNomVarOk
+                    if monNomVar not in liste_valeurs : liste_valeurs.append(monNomVar)
+                except :
+                #else :
+                    logging.error("Pb pour renommer le parametre ABSC dans defi_fonctions selon calcg")
+                    pass
     return liste_valeurs
 
-      
+
 #--------------------------------------------------------------------------
 def chercheValeurSelonGenea3(jdc,liste_cherche_valeur):
 #--------------------------------------------------------------------------
     liste_valeurs=[]
     for genea in liste_cherche_valeur:
-       profondeur=len(genea)
-       if profondeur > 3 :
-          print "la methode chercheValeurSelonGenea ne convient"
-          print "pas pour cette généalogie"
-          assert(0)
-       command=genea[0]
-       fact=genea[1]
-       mc=genea[2]
-      
-       for c in jdc.root.childNodes:
-          if c.name != command : continue
-          for mcf in c.childNodes:
-             if mcf.name != fact : continue
-             l=mcf.childNodes[:]
-             for ll in l:
-                 for lc in ll.childNodes:
-                    if lc.name !=mc : continue
-                    MonTexte=lc.getText(jdc)
-                    try :
-                    #if ( 1) :
-                       exec MonTexte in dict_contexte
-                       #monNomVar=MonTexte.split("=")[1][0:-1]
-                       monNomVar=MonTexte.split("=")[1]
-                       monNomVarOk=monNomVar
-                       i=-1
-                       while (monNomVar[i] == "," or  monNomVar[i] == " ") :
-                         monNomVarOk=monNomVar[0:i]
-                         i=i-1
-                       monNomVar=monNomVarOk
-                       i=0
-                       while (monNomVar[i] == " ") :
-                          monNomVarOk=monNomVar[1:]
-                          i=i+1
-                       monNomVar=monNomVarOk
-                       if monNomVar not in liste_valeurs : liste_valeurs.append(monNomVar)
-                    except :
-                    #else :
-                       logging.error("Pb pour renommer le parametre ABSC dans defi_fonctions selon calcg")
-                       pass
-    return liste_valeurs
-
+        profondeur=len(genea)
+        if profondeur > 3 :
+            print "la methode chercheValeurSelonGenea ne convient"
+            print "pas pour cette genealogie"
+            assert(0)
+        command=genea[0]
+        fact=genea[1]
+        mc=genea[2]
 
+        for c in jdc.root.childNodes:
+            if c.name != command : continue
+            for mcf in c.childNodes:
+                if mcf.name != fact : continue
+                l=mcf.childNodes[:]
+                for ll in l:
+                    for lc in ll.childNodes:
+                        if lc.name !=mc : continue
+                        MonTexte=lc.getText(jdc)
+                        try :
+                        #if ( 1) :
+                            exec MonTexte in dict_contexte
+                            #monNomVar=MonTexte.split("=")[1][0:-1]
+                            monNomVar=MonTexte.split("=")[1]
+                            monNomVarOk=monNomVar
+                            i=-1
+                            while (monNomVar[i] == "," or  monNomVar[i] == " ") :
+                                monNomVarOk=monNomVar[0:i]
+                                i=i-1
+                            monNomVar=monNomVarOk
+                            i=0
+                            while (monNomVar[i] == " ") :
+                                monNomVarOk=monNomVar[1:]
+                                i=i+1
+                            monNomVar=monNomVarOk
+                            if monNomVar not in liste_valeurs : liste_valeurs.append(monNomVar)
+                        except :
+                        #else :
+                            logging.error("Pb pour renommer le parametre ABSC dans defi_fonctions selon calcg")
+                            pass
+    return liste_valeurs
index 22d1bf919074f3426f37fd15ff51a85bf9d5ecf8..3beb5fe1ee0aaf62a8e1f6d87db3ae376fbbf556 100644 (file)
@@ -20,7 +20,7 @@
 from Traducteur.utils import lineToDict
 import logging
 from Traducteur.dictErreurs import ecritErreur
-from Traducteur.load import jdcSet 
+from Traducteur.load import jdcSet
 from Traducteur.renamemocle import decaleLignesdeNBlancs
 from Traducteur.removemocle import removeMotCleInFact
 from Traducteur import regles
@@ -32,45 +32,45 @@ def changementValeur(jdc,command,motcle,DictNouvVal,liste=(),defaut=0):
     if command  not in jdcSet : return
     boolChange=0
     for c in jdc.root.childNodes:
-       if c.name != command  : continue
-       trouveUnMC=0
-       for mc in c.childNodes:
-          if mc.name != motcle : continue
-          trouveUnMC=1
-          TexteMC=mc.getText(jdc)
-          liste_ligne_MC=TexteMC.splitlines()
-          indexLigneGlob=mc.lineno-1
-          indexTexteMC=0
-          while indexLigneGlob < mc.endline  :
-             if indexTexteMC > len(liste_ligne_MC)-1 : break
-             MaLigneGlob=jdc.getLines()[indexLigneGlob]
-             MaLigneTexte=liste_ligne_MC[indexTexteMC]
-             for Valeur in DictNouvVal :
-                MaLigneTexteDict=lineToDict(MaLigneTexte)
-                trouvecol=MaLigneTexte.find(Valeur)
-                if trouvecol > -1:
-                    trouve=(Valeur==MaLigneTexteDict[trouvecol])
-                else:
-                    trouve=False
-                if trouve:
-                   debut=MaLigneGlob.find(motcle)
-                   if debut==-1 : debut=0
-                  Nouveau=MaLigneGlob[debut:].replace(Valeur,DictNouvVal[Valeur])
-                   Nouveau=MaLigneGlob[0:debut]+Nouveau
-                   jdc.getLines()[indexLigneGlob]=Nouveau
-                   MaLigneTexte=Nouveau # raccourci honteux mais ...
-                   MaLigneGlob=Nouveau
-                   if Valeur in liste :
-                      ecritErreur((command,motcle,Valeur),indexLigneGlob)
-                   else :
-                      logging.info("Changement de %s par %s dans %s ligne %d",Valeur,DictNouvVal[Valeur],command,indexLigneGlob)
-                   boolChange=1
-             indexLigneGlob=indexLigneGlob+1
-             indexTexteMC=indexTexteMC+1
-       if (trouveUnMC == 0) and ( defaut == 1):
-          ecritErreur((command,motcle,"DEFAUT"),c.lineno)
+        if c.name != command  : continue
+        trouveUnMC=0
+        for mc in c.childNodes:
+            if mc.name != motcle : continue
+            trouveUnMC=1
+            TexteMC=mc.getText(jdc)
+            liste_ligne_MC=TexteMC.splitlines()
+            indexLigneGlob=mc.lineno-1
+            indexTexteMC=0
+            while indexLigneGlob < mc.endline  :
+                if indexTexteMC > len(liste_ligne_MC)-1 : break
+                MaLigneGlob=jdc.getLines()[indexLigneGlob]
+                MaLigneTexte=liste_ligne_MC[indexTexteMC]
+                for Valeur in DictNouvVal :
+                    MaLigneTexteDict=lineToDict(MaLigneTexte)
+                    trouvecol=MaLigneTexte.find(Valeur)
+                    if trouvecol > -1:
+                        trouve=(Valeur==MaLigneTexteDict[trouvecol])
+                    else:
+                        trouve=False
+                    if trouve:
+                        debut=MaLigneGlob.find(motcle)
+                        if debut==-1 : debut=0
+                        Nouveau=MaLigneGlob[debut:].replace(Valeur,DictNouvVal[Valeur])
+                        Nouveau=MaLigneGlob[0:debut]+Nouveau
+                        jdc.getLines()[indexLigneGlob]=Nouveau
+                        MaLigneTexte=Nouveau # raccourci honteux mais ...
+                        MaLigneGlob=Nouveau
+                        if Valeur in liste :
+                            ecritErreur((command,motcle,Valeur),indexLigneGlob)
+                        else :
+                            logging.info("Changement de %s par %s dans %s ligne %d",Valeur,DictNouvVal[Valeur],command,indexLigneGlob)
+                        boolChange=1
+                indexLigneGlob=indexLigneGlob+1
+                indexTexteMC=indexTexteMC+1
+        if (trouveUnMC == 0) and ( defaut == 1):
+            ecritErreur((command,motcle,"DEFAUT"),c.lineno)
     if boolChange : jdc.reset(jdc.getSource())
-             
+
 #--------------------------------------------------------------------------------
 def changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste=(),ensemble=regles.SansRegle,defaut=0):
 #--------------------------------------------------------------------------------
@@ -86,7 +86,7 @@ def changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste=(),ensemble=
             for ll in l:
                 trouveUnMC=0
                 for mc in ll.childNodes:
-                    if mc.name != motcle:continue                    
+                    if mc.name != motcle:continue
                     if ensemble.verif(c) == 0 : continue
                     trouveUnMC=1
                     TexteMC=mc.getText(jdc)
@@ -113,17 +113,17 @@ def changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste=(),ensemble=
                                 MaLigneTexte=Nouveau # raccourci honteux mais ...
                                 MaLigneGlob=Nouveau
                                 if Valeur in liste :
-                                   ecritErreur((command,fact,motcle,Valeur),indexLigneGlob)
+                                    ecritErreur((command,fact,motcle,Valeur),indexLigneGlob)
                                 else :
-                                   logging.info("Changement de %s par %s dans %s ligne %d",Valeur,DictNouvVal[Valeur],command,indexLigneGlob)
+                                    logging.info("Changement de %s par %s dans %s ligne %d",Valeur,DictNouvVal[Valeur],command,indexLigneGlob)
                         boolChange=1
                         indexLigneGlob=indexLigneGlob+1
                         indexTexteMC=indexTexteMC+1
                 if (trouveUnMC == 0) and ( defaut == 1):
-                   logging.warning("OPTION  (defaut) de CALCG Ã  verifier ligne %s" ,c.lineno )                     
-                   ecritErreur((command,fact,motcle,"DEFAUT"),c.lineno)
+                    logging.warning("OPTION  (defaut) de CALCG a verifier ligne %s" ,c.lineno )
+                    ecritErreur((command,fact,motcle,"DEFAUT"),c.lineno)
     if boolChange : jdc.reset(jdc.getSource())
-             
+
 #--------------------------------------------------------------------------------
 def changementValeurDsMCFSiRegle(jdc,command,fact,motcle,DictNouvVal,liste_regles,defaut=0):
 #--------------------------------------------------------------------------------
@@ -131,14 +131,14 @@ def changementValeurDsMCFSiRegle(jdc,command,fact,motcle,DictNouvVal,liste_regle
     mesRegles=regles.ensembleRegles(liste_regles)
     liste=()
     changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste,mesRegles,defaut)
-             
+
 #---------------------------------------------------------------------------------------
 def changementValeurDsMCFAvecAvertissement(jdc, command, fact,motcle,DictNouvVal,liste):
 #---------------------------------------------------------------------------------------
     if command  not in jdcSet : return
     defaut=0
-    if liste[-1] == "defaut" : 
-       defaut=1
+    if liste[-1] == "defaut" :
+        defaut=1
     changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste,defaut)
 
 #--------------------------------------------------------------------------
@@ -146,8 +146,8 @@ def changementValeurAvecAvertissement(jdc, command,motcle,DictNouvVal,liste):
 #--------------------------------------------------------------------------
     if command  not in jdcSet : return
     defaut=0
-    if liste[-1] == "defaut" : 
-       defaut=1
+    if liste[-1] == "defaut" :
+        defaut=1
     changementValeur(jdc,command,motcle,DictNouvVal,liste,defaut)
 
 #--------------------------------------------------------------------------
@@ -157,52 +157,52 @@ def suppressionValeurs(jdc, command,motcle,liste):
     if command not in jdcSet : return
     boolChange=0
     for c in jdc.root.childNodes:
-       if c.name != command  : continue
-       for mc in c.childNodes:
-          if mc.name != motcle : continue
-          indexLigneGlob=mc.lineno-1
-          while indexLigneGlob < mc.endline-1  :
-             MaLigneTexte = jdc.getLines()[indexLigneGlob]
-             MaLigne=MaLigneTexte
-             for Valeur in liste :
-                debutMC =MaLigne.find(motcle)
-                if debutMC ==-1 : debutMC=0
-                debut1=MaLigne[0:debutMC]
-                chercheLigne=MaLigne[debutMC:]
-                trouve=chercheLigne.find(Valeur)
-                premier=0
-                if trouve > 1 : #on a au moins une quote
-                   debut=debut1 + chercheLigne[0:trouve-1]
-                   index = -1
-                   while (-1 * index) < len(debut) :
-                      if (debut[index] == "(")  :
-                         premier = 1
-                         if index == -1 :
-                            index=len(debut)
-                         else :
-                            index=index+1
-                         break
-                      if (debut[index] == "," ) : 
-                          break
-                      if (debut[index] != " " ) :
-                         assert(0)
-                      index = index -1
-                   debLigne = debut[0:index]
-                   fin=trouve+len(Valeur)+1
-                   if premier == 1 and chercheLigne[fin] == ',': fin = fin + 1 # on supprime la ,
-                   finLigne = chercheLigne[fin:]
-                   MaLigne_tmp=debLigne+finLigne
-                   # traitement ligne commancant par ,
-                   if len(MaLigne_tmp.strip()) > 0 :
-                      if MaLigne_tmp.strip()[0]==',' :
-                         MaLigne=MaLigne_tmp.strip()[1:]
-                      else :
-                         MaLigne=MaLigne_tmp[0:]
-                   else :
-                      MaLigne=MaLigne_tmp[0:]
-                   boolChange=1
-                jdc.getLines()[indexLigneGlob]=MaLigne
-             indexLigneGlob=indexLigneGlob+1
+        if c.name != command  : continue
+        for mc in c.childNodes:
+            if mc.name != motcle : continue
+            indexLigneGlob=mc.lineno-1
+            while indexLigneGlob < mc.endline-1  :
+                MaLigneTexte = jdc.getLines()[indexLigneGlob]
+                MaLigne=MaLigneTexte
+                for Valeur in liste :
+                    debutMC =MaLigne.find(motcle)
+                    if debutMC ==-1 : debutMC=0
+                    debut1=MaLigne[0:debutMC]
+                    chercheLigne=MaLigne[debutMC:]
+                    trouve=chercheLigne.find(Valeur)
+                    premier=0
+                    if trouve > 1 : #on a au moins une quote
+                        debut=debut1 + chercheLigne[0:trouve-1]
+                        index = -1
+                        while (-1 * index) < len(debut) :
+                            if (debut[index] == "(")  :
+                                premier = 1
+                                if index == -1 :
+                                    index=len(debut)
+                                else :
+                                    index=index+1
+                                break
+                            if (debut[index] == "," ) :
+                                break
+                            if (debut[index] != " " ) :
+                                assert(0)
+                            index = index -1
+                        debLigne = debut[0:index]
+                        fin=trouve+len(Valeur)+1
+                        if premier == 1 and chercheLigne[fin] == ',': fin = fin + 1 # on supprime la ,
+                        finLigne = chercheLigne[fin:]
+                        MaLigne_tmp=debLigne+finLigne
+                        # traitement ligne commancant par ,
+                        if len(MaLigne_tmp.strip()) > 0 :
+                            if MaLigne_tmp.strip()[0]==',' :
+                                MaLigne=MaLigne_tmp.strip()[1:]
+                            else :
+                                MaLigne=MaLigne_tmp[0:]
+                        else :
+                            MaLigne=MaLigne_tmp[0:]
+                        boolChange=1
+                    jdc.getLines()[indexLigneGlob]=MaLigne
+                indexLigneGlob=indexLigneGlob+1
     if boolChange : jdc.reset(jdc.getSource())
 
 #----------------------------------------------
@@ -214,100 +214,100 @@ def appelleMacroSelonValeurConcept(jdc,macro,genea):
     motcle=genea[1]
     chaine="CO"
     for c in jdc.root.childNodes:
-       if c.name != macro  : continue
-       for mcF in c.childNodes:
-          if mcF.name != fact : continue
-          l=mcF.childNodes[:]
-          l.reverse()
-          for ll in l:
-             trouveValeur=0
-             for mc in ll.childNodes:
-                if mc.name != motcle:continue
-                TexteMC=mc.getText(jdc)
-                liste_ligne_MC=TexteMC.splitlines()
-                indexLigneGlob=mc.lineno-2
-                trouveTexteMC=0
-                trouveegal=0
-                trouvechaine=0
-                trouveparent=0
-                trouvequote=0
-                while indexLigneGlob < mc.endline  :
-                   indexLigneGlob=indexLigneGlob+1
-                   MaLigneTexte=jdc.getLines()[indexLigneGlob]
+        if c.name != macro  : continue
+        for mcF in c.childNodes:
+            if mcF.name != fact : continue
+            l=mcF.childNodes[:]
+            l.reverse()
+            for ll in l:
+                trouveValeur=0
+                for mc in ll.childNodes:
+                    if mc.name != motcle:continue
+                    TexteMC=mc.getText(jdc)
+                    liste_ligne_MC=TexteMC.splitlines()
+                    indexLigneGlob=mc.lineno-2
+                    trouveTexteMC=0
+                    trouveegal=0
+                    trouvechaine=0
+                    trouveparent=0
+                    trouvequote=0
+                    while indexLigneGlob < mc.endline  :
+                        indexLigneGlob=indexLigneGlob+1
+                        MaLigneTexte=jdc.getLines()[indexLigneGlob]
+
+                        # on commence par chercher TABLE par exemple
+                        # si on ne trouve pas on passe a la ligne suivante
+                        if ( trouveTexteMC == 0 ) :
+                            indice=MaLigneTexte.find(motcle)
+                            if indice < 0 : continue
+                            trouveTexteMC=1
+                        else :
+                            indice=0
+
+                        # on cherche =
+                        aChercher=MaLigneTexte[indice:]
+                        if (trouveegal == 0 ):
+                            indice=aChercher.find("=")
+                            if indice < 0 : continue
+                            trouveegal = 1
+                        else :
+                            indice = 0
+
+                        # on cherche CO
+                        aChercher2=aChercher[indice:]
+                        if (trouvechaine == 0 ):
+                            indice=aChercher2.find(chaine)
+                            if indice < 0 : continue
+                            trouvechaine = 1
+                        else :
+                            indice = 0
 
-                   # on commence par chercher TABLE par exemple
-                   # si on ne trouve pas on passe a la ligne suivante
-                   if ( trouveTexteMC == 0 ) :
-                       indice=MaLigneTexte.find(motcle)
-                       if indice < 0 : continue
-                       trouveTexteMC=1
-                   else :
-                      indice=0
+                        #on cherche (
+                        aChercher3=aChercher2[indice:]
+                        if (trouveparent == 0 ):
+                            indice=aChercher3.find('(')
+                            if indice < 0 : continue
+                            trouveparent = 1
+                        else :
+                            indice = 0
 
-                   # on cherche =
-                   aChercher=MaLigneTexte[indice:]
-                   if (trouveegal == 0 ):
-                       indice=aChercher.find("=")
-                       if indice < 0 : continue
-                       trouveegal = 1
-                   else :
-                       indice = 0
+                        #on cherche la '
+                        aChercher4=aChercher3[indice:]
+                        if (trouvequote == 0 ):
+                            indice=aChercher4.find("'")
+                            indice2=aChercher4.find('"')
+                            if (indice < 0) and (indice2 < 0): continue
+                            if (indice < 0) : indice=indice2
+                            trouvequote = 1
+                        else :
+                            indice = 0
 
-                   # on cherche CO
-                   aChercher2=aChercher[indice:]
-                   if (trouvechaine == 0 ):
-                       indice=aChercher2.find(chaine)
-                       if indice < 0 : continue
-                       trouvechaine = 1
-                   else :
-                       indice = 0
+                        trouveValeur=1
+                        aChercher5=aChercher4[indice+1:]
+                        indice=aChercher5.find("'")
+                        if indice < 0 :  indice=aChercher5.find('"')
+                        valeur=aChercher5[:indice]
+                        break
 
-                   #on cherche (
-                   aChercher3=aChercher2[indice:]
-                   if (trouveparent == 0 ):
-                       indice=aChercher3.find('(')
-                       if indice < 0 : continue
-                       trouveparent = 1
-                   else :
-                       indice = 0
-                 
-                   #on cherche la '
-                   aChercher4=aChercher3[indice:]
-                   if (trouvequote == 0 ):
-                       indice=aChercher4.find("'")
-                       indice2=aChercher4.find('"')
-                       if (indice < 0) and (indice2 < 0): continue
-                       if (indice < 0) : indice=indice2
-                       trouvequote = 1
-                   else :
-                       indice = 0
+                if trouveValeur==0 :
+                    logging.error("Pb de traduction pour MACR_LIGNE_COUPE : Pas de nom de Concept identifiable")
+                    return
 
-                   trouveValeur=1
-                   aChercher5=aChercher4[indice+1:]
-                   indice=aChercher5.find("'")
-                   if indice < 0 :  indice=aChercher5.find('"')
-                   valeur=aChercher5[:indice]
-                   break
-                    
-             if trouveValeur==0 :
-                  logging.error("Pb de traduction pour MACR_LIGNE_COUPE : Pas de nom de Concept identifiable")
-                  return
-             
-             if boolChange :
-                  jdc.reset(jdc.getSource())
-                  logging.error("Pb du traduction pour MACR_LIGNE_COUPE : Deux noms de Concept possibles")
-                  return
+                if boolChange :
+                    jdc.reset(jdc.getSource())
+                    logging.error("Pb du traduction pour MACR_LIGNE_COUPE : Deux noms de Concept possibles")
+                    return
 
-             boolChange=1
-             ligneaTraiter=jdc.getLines()[c.lineno-1]
-             debut=ligneaTraiter[0:c.colno]
-             suite=valeur+"="
-             fin=ligneaTraiter[c.colno:]
-             ligne=debut+suite+fin
-             jdc.getLines()[c.lineno-1]=ligne
-             nbBlanc=len(valeur)+1
-             if c.lineno < c.endline:
-                decaleLignesdeNBlancs(jdc,c.lineno,c.endline-1,nbBlanc)
+                boolChange=1
+                ligneaTraiter=jdc.getLines()[c.lineno-1]
+                debut=ligneaTraiter[0:c.colno]
+                suite=valeur+"="
+                fin=ligneaTraiter[c.colno:]
+                ligne=debut+suite+fin
+                jdc.getLines()[c.lineno-1]=ligne
+                nbBlanc=len(valeur)+1
+                if c.lineno < c.endline:
+                    decaleLignesdeNBlancs(jdc,c.lineno,c.endline-1,nbBlanc)
     if boolChange : jdc.reset(jdc.getSource())
 
 #----------------------------------------------
index e15e4e5e64cbf4c139394fd3395c7ab11b449ee9..9499e408ae056eb7c1aba2f380e25b6824ad9dfc 100644 (file)
@@ -19,7 +19,7 @@
 #
 
 import logging
-from Traducteur.load import jdcSet 
+from Traducteur.load import jdcSet
 
 
 def ecritErreur(listeGena,ligne=None) :
@@ -29,23 +29,23 @@ def ecritErreur(listeGena,ligne=None) :
         maCle=maCle+"_"+Mot
     #try :
     if ( 1 == 1) :
-       maClef=maCle[1:]
+        maClef=maCle[1:]
         if maClef in dict_erreurs :
-           if ligne != None :
-             logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef])
-           else :
-             logging.warning("%s",dict_erreurs[maClef])
+            if ligne != None :
+                logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef])
+            else :
+                logging.warning("%s",dict_erreurs[maClef])
         else :
-           maCle=""
-           for Mot in listeGena[:-1] :
-              maCle=maCle+"_"+Mot
-          maClef=maCle[1:]
-          maClef=maCle+"_"+"VALEUR"
-           if maClef in dict_erreurs :
-              if ligne != None :
-                 logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef])
-              else :
-                 logging.warning("%s",dict_erreurs[maClef])
+            maCle=""
+            for Mot in listeGena[:-1] :
+                maCle=maCle+"_"+Mot
+            maClef=maCle[1:]
+            maClef=maCle+"_"+"VALEUR"
+            if maClef in dict_erreurs :
+                if ligne != None :
+                    logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef])
+                else :
+                    logging.warning("%s",dict_erreurs[maClef])
     #except :
     #    pass
 
@@ -53,10 +53,10 @@ def genereErreurPourCommande(jdc,listeCommande) :
     commands= jdc.root.childNodes[:]
     commands.reverse()
     for c in commands:
-        if type(listeCommande)==list: 
+        if type(listeCommande)==list:
             for Mot in listeCommande :
-               if c.name != Mot :continue
-               ecritErreur((Mot,),c.lineno)
+                if c.name != Mot :continue
+                ecritErreur((Mot,),c.lineno)
         else:
             if c.name != listeCommande :continue
             ecritErreur((listeCommande,),c.lineno)
@@ -70,9 +70,9 @@ def genereErreurMotCleInFact(jdc,command,fact,mocle):
             for ll in l:
                 for n in ll.childNodes:
                     if n.name != mocle:
-                       continue
-                   else :
-                       ecritErreur((command,fact,mocle,),c.lineno)
+                        continue
+                    else :
+                        ecritErreur((command,fact,mocle,),c.lineno)
 
 def genereErreurMCF(jdc,command,fact):
     for c in jdc.root.childNodes:
@@ -80,7 +80,7 @@ def genereErreurMCF(jdc,command,fact):
         for mc in c.childNodes:
             if mc.name != fact:
                 continue
-            else : 
+            else :
                 ecritErreur((command,fact,),c.lineno)
 
 def genereErreurValeur(jdc,command,fact,list_valeur):
@@ -90,9 +90,9 @@ def genereErreurValeur(jdc,command,fact,list_valeur):
             if mc.name != fact:continue
             texte=mc.getText(jdc)
             for valeur in list_valeur:
-               trouve=texte.find(valeur)
-               if trouve > -1 :  
-                  logging.warning("%s doit etre supprimee ou modifiee dans %s : ligne %d",valeur,c.name,mc.lineno)
+                trouve=texte.find(valeur)
+                if trouve > -1 :
+                    logging.warning("%s doit etre supprimee ou modifiee dans %s : ligne %d",valeur,c.name,mc.lineno)
 
 def genereErreurValeurDsMCF(jdc,command,fact,mocle,list_valeur):
     for c in jdc.root.childNodes:
@@ -106,5 +106,5 @@ def genereErreurValeurDsMCF(jdc,command,fact,mocle,list_valeur):
                     texte=n.getText(jdc)
                     for valeur in list_valeur:
                         trouve=texte.find(valeur)
-                        if trouve > -1 :  
+                        if trouve > -1 :
                             logging.warning("%s doit etre supprimee ou modifiee dans %s : ligne %d",valeur,c.name,n.lineno)
index 1745d4870a60ce855e5514b48b4ab8dde4bd6aa2..4de6dd02d3d664b491a4f421ea40ebea4d19ad08 100644 (file)
@@ -19,7 +19,7 @@
 #
 import logging
 from Traducteur.parseur import FactNode
-from Traducteur.load import jdcSet 
+from Traducteur.load import jdcSet
 from Traducteur.dictErreurs import ecritErreur
 from Traducteur import regles
 debug=0
@@ -28,14 +28,14 @@ debug=0
 #-----------------------------------
 def insereMotCle(jdc,recepteur,texte):
 #-----------------------------------
-# appelle la methode selon la classe 
+# appelle la methode selon la classe
 # du recepteur
 
     if recepteur.name  not in jdcSet : return
     if recepteur.__class__.__name__ == "Command" :
-       if debug : print " Ajout de ", texte, "dans la commande : " ,recepteur.name 
-       insereMotCleDansCommande(jdc,recepteur,texte)
-       return
+        if debug : print (" Ajout de ", texte, "dans la commande : " ,recepteur.name )
+        insereMotCleDansCommande(jdc,recepteur,texte)
+        return
 
 
 #--------------------------------------------
@@ -44,27 +44,27 @@ def insereMotCleDansCommande(jdc,command,texte):
 # insere le texte comme 1er mot cle
 # de la commande
     if command.name  not in jdcSet : return
-    if debug : print "insereMotCle ", texte , " dans ", command.name
+    if debug : print ("insereMotCle ", texte , " dans ", command.name)
     numcol=chercheDebut1Mot(jdc,command)
     if numcol > 0 :
-       jdc.splitLine(command.lineno,numcol)
+        jdc.splitLine(command.lineno,numcol)
     indice = -1
-    while texte[indice] == " " or texte[indice] == "\n": 
-       indice = indice -1
+    while texte[indice] == " " or texte[indice] == "\n":
+        indice = indice -1
     if texte[indice] != "," : texte=texte+","
     texteinfo=texte
     texte=texte+'\n'
-    jdc.addLine(texte,command.lineno) 
+    jdc.addLine(texte,command.lineno)
     logging.info("Insertion de : %s ligne %d", texteinfo,command.lineno)
-    if numcol > 0 :            # Les mots clefs etaient sur la même ligne
+    if numcol > 0 :             # Les mots clefs etaient sur la meme ligne
         jdc.joinLineandNext(command.lineno)
 
 #-------------------------------------------------------------
 def insereMotCleDansFacteur(jdc,facteur,texte,plusieursFois=True):
 #----------------------------------------------------------------
-    if debug : print "insereMotCle ", texte , " dans ", facteur.name
+    if debug : print ("insereMotCle ", texte , " dans ", facteur.name)
 
-    if texte[-1] == "\n" : texte=texte[0:-1] 
+    if texte[-1] == "\n" : texte=texte[0:-1]
     ancien=jdc.getLine(facteur.lineno)
 
     # On va chercher la derniere ) pour ajouter avant
@@ -73,16 +73,16 @@ def insereMotCleDansFacteur(jdc,facteur,texte,plusieursFois=True):
     # on en met une
 
     indice = -1
-    while texte[indice] == " " : 
-       indice = indice -1
-    if texte[indice] != "," : 
-       texte=texte+","
+    while texte[indice] == " " :
+        indice = indice -1
+    if texte[indice] != "," :
+        texte=texte+","
     if (texte.find("#") > -1) and (texte.find("#") < texte.find(",")) :
-          texte=texte+"\n,"
-          
+        texte=texte+"\n,"
+
     texteinfo=texte
     texte=texte+"\n"
-  
+
     ligneaCouper=facteur.lineno
     while ligneaCouper < facteur.endline + 1 :
         trouve=0
@@ -93,31 +93,31 @@ def insereMotCleDansFacteur(jdc,facteur,texte,plusieursFois=True):
             longueur=len(ancien)
             indice=ancien.find("_F")
             indiceParcours=0
-            # pour ne pas tenir compte des autres noms 
+            # pour ne pas tenir compte des autres noms
             # Attention si 2 MCF sur la meme ligne (la 1ere)
             if trouveF == 0 :
                 if ((ligneaCouper!=facteur.lineno) or ((ancien.find(facteur.name) < indice ) or (ancien.find(facteur.name) < 0))) :
-                   trouveF=1
-                   indiceParcours=indice + 2
-            # attention pour regler DEFI_FONCTION .. 
+                    trouveF=1
+                    indiceParcours=indice + 2
+            # attention pour regler DEFI_FONCTION ..
                 else :
-                   indiceDeCoupe=indiceDeCoupe+indice+2
-                   ancien=ancien[indice +2:]
-                   continue
+                    indiceDeCoupe=indiceDeCoupe+indice+2
+                    ancien=ancien[indice +2:]
+                    continue
             if trouveF == 1 :
                 indiceDeCoupe=indiceDeCoupe+indice
     #            print "indice de Parcours" ,indiceParcours
-    #            print ancien[indiceParcours] 
-    #            print ancien[indiceParcours+1] 
-    #            print ancien[indiceParcours+2] 
+    #            print ancien[indiceParcours]
+    #            print ancien[indiceParcours+1]
+    #            print ancien[indiceParcours+2]
                 while  indiceParcours < longueur :
                     if ancien[indiceParcours] == "(" :
                         trouveP=1
-    #                    print "trouve"
+    #                    print ("trouve".
                         break
                     if ancien[indiceParcours] != " " :
                         trouveP=0
-    #                    print "mouv"
+    #                    print ("mouv")
                         break
                     indiceParcours = indiceParcours+1
             trouve = trouveP * trouveF
@@ -143,18 +143,18 @@ def insereMotCleDansFacteur(jdc,facteur,texte,plusieursFois=True):
 #-----------------------------------
 def chercheDebut1Mot(jdc,command):
 #-----------------------------------
-# Retourne le numero de colonne si le 1er mot clef est 
+# Retourne le numero de colonne si le 1er mot clef est
 # sur la meme ligne que le mot clef facteur
 # -1 sinon
     assert (command.childNodes != [])
     debut=-1
     node1=command.childNodes[0]
     if hasattr(node1,"lineno"):
-       if node1.lineno == command.lineno :
-          debut=node1.colno
+        if node1.lineno == command.lineno :
+            debut=node1.colno
     else:
-       debut=chercheDebutFacteur(jdc,command) 
-    if debut == -1 and debug : print "attention!!! pb pour trouver le debut dans ", command
+        debut=chercheDebutFacteur(jdc,command)
+    if debut == -1 and debug : print ("attention!!! pb pour trouver le debut dans ", command)
     return debut
 
 #-----------------------------------
@@ -165,14 +165,14 @@ def chercheDebutFacteur(jdc,facteur):
     debut=ligne.find("_F")
     if debut >  -1 : debut=debut + 3
     return debut
-    
+
 
 #-----------------------------------
 def chercheAlignement(jdc,command):
 #-----------------------------------
 # Retourne le nb de blanc
 # pour aligner sur le 1er mot clef fils
-    assert (command.childNodes != []) 
+    assert (command.childNodes != [])
     node1=command.childNodes[0]
     nbBlanc=node1.colno
     return " "*nbBlanc
@@ -185,10 +185,10 @@ def chercheOperInsereFacteur(jdc,nomcommande,nouveau,ensemble=regles.SansRegle,
 # appelle insereMotCle pour ajouter le texte
 #
     boolChange=0
-    if estunFacteur : 
-      texte=nouveau+"=_F(),"
+    if estunFacteur :
+        texte=nouveau+"=_F(),"
     else :
-      texte=nouveau
+        texte=nouveau
     if nomcommande  not in jdcSet : return
     commands= jdc.root.childNodes[:]
     commands.reverse()
@@ -218,7 +218,7 @@ def chercheOperInsereMotCleSiRegle(jdc,nomcommande,nouveau,liste_regles, estunFa
     mesRegles=regles.ensembleRegles(liste_regles)
     chercheOperInsereFacteur(jdc,nomcommande,nouveau,mesRegles,estunFacteur)
 
-    
+
 #---------------------------------------------------------------------------------------------------------
 def chercheOperInsereFacteurSiRegleAvecAvertissement(jdc,nomcommande,nouveau,liste_regles, estunFacteur=1):
 #---------------------------------------------------------------------------------------------------------
@@ -235,10 +235,10 @@ def ajouteMotClefDansFacteur(jdc,commande,fact,nouveau,ensemble=regles.SansRegle
 # appelle insereMotCle pour ajouter le texte
 #
     if commande  not in jdcSet : return
-    if estunFacteur : 
-      texte=nouveau+"=_F(),"
+    if estunFacteur :
+        texte=nouveau+"=_F(),"
     else :
-      texte=nouveau
+        texte=nouveau
     commands= jdc.root.childNodes[:]
     commands.reverse()
     boolChange=0
@@ -271,19 +271,19 @@ def ajouteMotClefDansFacteurCourantSiRegle(jdc,commande,fact,nouveau,liste_regle
     for c in commands:
         if c.name != commande : continue
         for mcF in c.childNodes:
-          if mcF.name != fact : continue
-          l=mcF.childNodes[:]
-          l.reverse()
-          for ll in l:
-             if ensemble.verif(ll) == 0 : continue
-             boolChange=1
-             n=ll.childNodes[0]
-             ligneaCouper=n.lineno-1
-             numcol=n.colno
-             jdc.splitLine(ligneaCouper+1,numcol)
-             texte=nouveau+",\n"
-             jdc.addLine(texte,ligneaCouper+1)
-             logging.info("Insertion de %s dans %s : ligne %d", nouveau,c.name,ligneaCouper+1)
-             if numcol > 0 :    
-                 jdc.joinLineandNext(ligneaCouper+1)
+            if mcF.name != fact : continue
+            l=mcF.childNodes[:]
+            l.reverse()
+            for ll in l:
+                if ensemble.verif(ll) == 0 : continue
+                boolChange=1
+                n=ll.childNodes[0]
+                ligneaCouper=n.lineno-1
+                numcol=n.colno
+                jdc.splitLine(ligneaCouper+1,numcol)
+                texte=nouveau+",\n"
+                jdc.addLine(texte,ligneaCouper+1)
+                logging.info("Insertion de %s dans %s : ligne %d", nouveau,c.name,ligneaCouper+1)
+                if numcol > 0 :
+                    jdc.joinLineandNext(ligneaCouper+1)
     if boolChange : jdc.reset(jdc.getSource())
index 850c2c0c5926bb7a5914a18dae9620a31720b08d..84702cb0c1be46342049ca3c4d0f0e2da74b6cab 100644 (file)
@@ -28,7 +28,7 @@ jdcSet=sets.Set()
 
 
 class JDCTrad:
-    """Cet objet conserve toutes les informations relatives Ã  un fichier de commandes .comm"""
+    """Cet objet conserve toutes les informations relatives a un fichier de commandes .comm"""
 
     def __init__(self,src,atraiter):
     #----------------------------------------
@@ -52,14 +52,14 @@ class JDCTrad:
 
     def reset(self,src):
     #-----------------------
-    # reconstruction 
+    # reconstruction
         self.init(src,self.atraiter)
         self.parseKeywords()
 
     def getSource(self):
     #-----------------------
     # retourne la concatenation de
-    # toutes les lignes 
+    # toutes les lignes
         return  "".join(self.getLines())
 
     def getLine(self,linenum):
@@ -69,7 +69,7 @@ class JDCTrad:
 
     def getLines(self):
     #----------------------------
-    # retourne toutes les lignes 
+    # retourne toutes les lignes
         return self.lines
 
     def addLine(self,ligne,numero) :
@@ -86,13 +86,13 @@ class JDCTrad:
     #----------------------------------------------
     # coupe la ligne numeroLigne en 2 a numeroColonne
     # ajoute des blancs en debut de 2nde Ligne pour
-    # aligner 
+    # aligner
         numeroLigne = numeroLigne -1
         Ldebut=self.lines[0:numeroLigne]
         if len(self.lines) > numeroLigne :
-           Lfin=self.lines[numeroLigne+1:]
+            Lfin=self.lines[numeroLigne+1:]
         else :
-           Lfin=[]
+            Lfin=[]
         Lsplit=self.lines[numeroLigne]
         LigneSplitDebut=Lsplit[0:numeroColonne]+"\n"
         LigneSplitFin=" "*numeroColonne+Lsplit[numeroColonne:]
@@ -106,17 +106,17 @@ class JDCTrad:
     # enleve les blancs de debut de la ligne (numeroLigne +1)
         Ldebut=self.lines[0:numeroLigne-1]
         if len(self.lines) > numeroLigne :
-           Lfin=self.lines[numeroLigne+1:]
+            Lfin=self.lines[numeroLigne+1:]
         else :
-           Lfin=[]
+            Lfin=[]
 
         ligneMilieuDeb=self.lines[numeroLigne - 1 ]
         ligneMilieuDeb=ligneMilieuDeb[0:-1]
         ligneMilieuFin=self.lines[numeroLigne]
         for i in range(len(ligneMilieuFin)):
             if ligneMilieuFin[i] != " " :
-               ligneMilieuFin=ligneMilieuFin[i:]
-               break
+                ligneMilieuFin=ligneMilieuFin[i:]
+                break
         Lmilieu=[ligneMilieuDeb+ligneMilieuFin,]
 
         self.lines=Ldebut+Lmilieu+Lfin
index cd1b62e0266e8aa46a439062b18b205bb8bc4375..385becf8cbfa1cb02e76bdd1363921f3bca32caa 100644 (file)
@@ -23,23 +23,23 @@ import os
 logger=logging.getLogger()
 
 def initialise(flog=None):
-    if flog == None : 
-          MonHome=os.environ['HOME']
-          MaDir=MonHome+"/Eficas_install"
-          try :
+    if flog == None :
+        MonHome=os.environ['HOME']
+        MaDir=MonHome+"/Eficas_install"
+        try :
             os.mkdir(MaDir)
-          except :
+        except :
             pass
-          try :
+        try :
             os.listdir(MaDir)
             flog=MaDir+"/convert.log"
-          except :
+        except :
             flog='/tmp/convert.log'
 
     hdlr=logging.FileHandler(flog,'w')
     formatter = logging.Formatter('%(levelname)s: %(message)s')
     hdlr.setFormatter(formatter)
-    logger.addHandler(hdlr) 
+    logger.addHandler(hdlr)
     logger.setLevel(logging.INFO)
     return hdlr
 
index 173870620560f619325abb5eef796c1251293172..dbbe738aa52f1875b337303ac1ae617ceb44be2c 100644 (file)
@@ -32,7 +32,7 @@ def parseFact(match,c,kw):
     submatch=match[2]
     lastpar=match[0]+lastParen(c.src[match[0]:])
     if type(submatch[0][0]) ==types.IntType:
-        #mot cle facteur isolé
+        #mot cle facteur isole
         no=FactNode()
         kw.addChild(no)
         for ii in range(len(submatch)-1):
@@ -84,7 +84,7 @@ def parseFact(match,c,kw):
 #-----------------------
 def parseKeywords(root):
 #-----------------------
-    """A partir d'un arbre contenant des commandes, ajoute les noeuds 
+    """A partir d'un arbre contenant des commandes, ajoute les noeuds
        fils correspondant aux mocles de la commande
     """
     #print "parseKeywords"
@@ -103,9 +103,9 @@ def parseKeywords(root):
         visitor.walk(ast, matchFinder)
         #print matchFinder.matches
         if len(matchFinder.matches) > 1:
-            # plusieurs mocles trouvés : 
-            # un mocle commence au début du keyword (matchFinder.matches[i][0])
-            # et finit juste avant le keyword suivant 
+            # plusieurs mocles trouves :
+            # un mocle commence au debut du keyword (matchFinder.matches[i][0])
+            # et finit juste avant le keyword suivant
             # (matchFinder.matches[i+1][0]])
             for i in range(len(matchFinder.matches)-1):
                 if debug:print "texte:",c.src[matchFinder.matches[i][0]:matchFinder.matches[i+1][0]]
@@ -122,8 +122,8 @@ def parseKeywords(root):
                 if submatch:
                     parseFact(matchFinder.matches[i],c,kw)
 
-            # dernier mocle : 
-            #   il commence au debut du dernier keyword 
+            # dernier mocle :
+            #   il commence au debut du dernier keyword
             #   (matchFinder.matches[i+1][0]) et
             #   finit avant la parenthese fermante de la commande (c.lastParen)
 
@@ -142,9 +142,9 @@ def parseKeywords(root):
                 parseFact(matchFinder.matches[i+1],c,kw)
 
         elif len(matchFinder.matches) == 1:
-            #un seul mocle trouve : 
-            # il commence au début du keyword (matchFinder.matches[0][0]) et 
-            # finit juste avant la parenthese fermante de la 
+            #un seul mocle trouve :
+            # il commence au debut du keyword (matchFinder.matches[0][0]) et
+            # finit juste avant la parenthese fermante de la
             # commande (c.lastParen)
             if debug:print "texte:",c.src[matchFinder.matches[0][0]:c.lastParen]
             x,y=indexToCoordinates(c.src,matchFinder.matches[0][0])
@@ -161,4 +161,3 @@ def parseKeywords(root):
                 parseFact(matchFinder.matches[0],c,kw)
         else:
             pass
-
index 9c67ff9b19e119f7f59fa2e63ee3623347a2f710..f4f8fb31fc3594c23483270fd9353098f4e22d35 100644 (file)
@@ -61,7 +61,7 @@ def moveMotCleFromFactToFactMulti(jdc,oper,factsource,mocle,liste_factcible):
 #----------------------------------------------------------------------------
 # exemple type STAT_NON_LINE et RESI_INTER_RELA
     for factcible in liste_factcible :
-       moveMotCleFromFactToFact(jdc,oper,factsource,mocle,factcible)
+        moveMotCleFromFactToFact(jdc,oper,factsource,mocle,factcible)
     removemocle.removeMotCleInFact(jdc,oper,factsource,mocle)
 
 
@@ -77,35 +77,35 @@ def moveMotCleFromFactToFact(jdc,oper,factsource,mocle,factcible):
         if c.name != oper : continue
         cible=None
         for mc in c.childNodes:
-           if mc.name != factcible : 
-              continue
-           else :
-              cible=mc
-              break
+            if mc.name != factcible :
+                continue
+            else :
+                cible=mc
+                break
         if cible==None :
-           if debug : print "Pas de changement pour ", oper, " ", factsource, " ",mocle, "cible non trouvée"
-           continue
+            if debug : print "Pas de changement pour ", oper, " ", factsource, " ",mocle, "cible non trouvée"
+            continue
 
         for mc in c.childNodes:
-           source=None
-           if mc.name != factsource:
-              continue
-           else :
-              source=mc
-              break
+            source=None
+            if mc.name != factsource:
+                continue
+            else :
+                source=mc
+                break
         if source==None :
-           if debug : print "Pas de changement pour ", oper, " ", factsource, " ",mocle, "source non trouvée"
-           continue
+            if debug : print "Pas de changement pour ", oper, " ", factsource, " ",mocle, "source non trouvée"
+            continue
 
         if debug : print "Changement pour ", oper, " ", factsource, " ",mocle, "cible et source trouvées"
         l=source.childNodes[:]
         for ll in l:
-           for n in ll.childNodes:
-              if n.name != mocle:continue
-              MonTexte=n.getText(jdc);
-              inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte)
-              boolChange=1
-              logging.info("Changement de place   %s ligne %s vers %s",n.name, n.lineno, cible.name)
+            for n in ll.childNodes:
+                if n.name != mocle:continue
+                MonTexte=n.getText(jdc);
+                inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte)
+                boolChange=1
+                logging.info("Changement de place   %s ligne %s vers %s",n.name, n.lineno, cible.name)
     if boolChange : jdc.reset(jdc.getSource())
     removemocle.removeMotCleInFact(jdc,oper,factsource,mocle)
 
@@ -126,25 +126,25 @@ def moveMotClefInOperToFact(jdc,oper,mocle,factcible,plusieursFois=True):
         if c.name != oper : continue
         cible=None
         for mc in c.childNodes:
-           if mc.name != factcible : 
-              continue
-           else :
-              cible=mc
-              break
+            if mc.name != factcible :
+                continue
+            else :
+                cible=mc
+                break
         if cible==None :
-           if debug : print "Pas de changement pour ", oper, " ", factcible, " ", "cible non trouvée"
-           continue
+            if debug : print "Pas de changement pour ", oper, " ", factcible, " ", "cible non trouvée"
+            continue
 
         source=None
         for mc in c.childNodes:
-           if mc.name != mocle:
-              continue
-           else :
-              source=mc
-              break
+            if mc.name != mocle:
+                continue
+            else :
+                source=mc
+                break
         if source==None :
-           if debug : print "Pas de changement pour ", oper, " ", mocle, " source non trouvée"
-           continue
+            if debug : print "Pas de changement pour ", oper, " ", mocle, " source non trouvée"
+            continue
         MonTexte=source.getText(jdc);
         boolChange=1
         inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte,plusieursFois)
@@ -164,51 +164,51 @@ def copyMotClefInOperToFact(jdc,oper,mocle,factcible):
         if c.name != oper : continue
         cible=None
         for mc in c.childNodes:
-           if mc.name != factcible : 
-              continue
-           else :
-              cible=mc
-              break
+            if mc.name != factcible :
+                continue
+            else :
+                cible=mc
+                break
         if cible==None :
-           if debug : print "Pas de changement pour ", oper, " ", factcible, " ", "cible non trouvée"
-           continue
+            if debug : print "Pas de changement pour ", oper, " ", factcible, " ", "cible non trouvée"
+            continue
 
         source=None
         for mc in c.childNodes:
-           if mc.name != mocle:
-              continue
-           else :
-              source=mc
-              break
+            if mc.name != mocle:
+                continue
+            else :
+                source=mc
+                break
         if source==None :
-           if debug : print "Pas de changement pour ", oper, " ", mocle, " source non trouvée"
-           continue
+            if debug : print "Pas de changement pour ", oper, " ", mocle, " source non trouvée"
+            continue
         MonTexte=source.getText(jdc);
         boolChange=1
         inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte)
     if boolChange : jdc.reset(jdc.getSource())
-    
+
 #----------------------------------------------------------------------
 def moveMCFToCommand(jdc,command,factsource,commandcible,factcible):
 #----------------------------------------------------------------------
 # exemple CONTACT en 10
-# CONTACT devient commande DEFI_CONTACT/ZONE 
-# 
+# CONTACT devient commande DEFI_CONTACT/ZONE
+#
     if command not in jdcSet : return
     boolChange=0
     commands= jdc.root.childNodes[:]
     commands.reverse()
     for c in commands:
-       if c.name != command  : continue
-       for mcF in c.childNodes:
-           if mcF.name != factsource : continue
-           l=mcF.getText(jdc)
-           texte=l.replace(factsource,factcible)
-           texte='xxxx='+commandcible+'('+texte+')\n'
-           jdc.splitLine(c.lineno,0)
-           jdc.addLine(texte,c.lineno)
-           logging.info("Deplacement de %s dans %s ligne %s",factsource,commandcible,c.lineno)
-           boolChange=1
+        if c.name != command  : continue
+        for mcF in c.childNodes:
+            if mcF.name != factsource : continue
+            l=mcF.getText(jdc)
+            texte=l.replace(factsource,factcible)
+            texte='xxxx='+commandcible+'('+texte+')\n'
+            jdc.splitLine(c.lineno,0)
+            jdc.addLine(texte,c.lineno)
+            logging.info("Deplacement de %s dans %s ligne %s",factsource,commandcible,c.lineno)
+            boolChange=1
     if boolChange :
         jdc.reset(jdc.getSource())
         jdcSet.add(commandcible)
@@ -221,26 +221,26 @@ def fusionMotCleToFact(jdc,command,listeMc,factcible,defaut=0):
     commands= jdc.root.childNodes[:]
     commands.reverse()
     for c in commands:
-       if c.name != command  : continue
-       list_val=[]
-       trouveUnMC=0
-       for mc in c.childNodes:
-           if mc.name not in listeMc : continue
-           val=mc.getText(jdc).split("=")[1].split(",")[0]
-           list_val.append(val)
-           trouveUnMC=1
-       if trouveUnMC :
-           TexteMC=factcible+"=("
-           for val in list_val : TexteMC=TexteMC+val+","
-           TexteMC=TexteMC[:-1]+"),"
-           inseremocle.insereMotCle(jdc,c,TexteMC)
-           jdc.reset(jdc.getSource())
-           boolChange=1
+        if c.name != command  : continue
+        list_val=[]
+        trouveUnMC=0
+        for mc in c.childNodes:
+            if mc.name not in listeMc : continue
+            val=mc.getText(jdc).split("=")[1].split(",")[0]
+            list_val.append(val)
+            trouveUnMC=1
+        if trouveUnMC :
+            TexteMC=factcible+"=("
+            for val in list_val : TexteMC=TexteMC+val+","
+            TexteMC=TexteMC[:-1]+"),"
+            inseremocle.insereMotCle(jdc,c,TexteMC)
+            jdc.reset(jdc.getSource())
+            boolChange=1
     if boolChange :
         jdc.reset(jdc.getSource())
-        for mc in listeMc : 
-           removemocle.removeMotCle(jdc,command,mc)
-           jdc.reset(jdc.getSource())
+        for mc in listeMc :
+            removemocle.removeMotCle(jdc,command,mc)
+            jdc.reset(jdc.getSource())
 
 #-----------------------------------------------------
 def fusionMotCleInFact(jdc,command,fact,listeMc,new_name,defaut=0):
@@ -268,9 +268,9 @@ def fusionMotCleInFact(jdc,command,fact,listeMc,new_name,defaut=0):
                     boolChange=1
     if boolChange :
         jdc.reset(jdc.getSource())
-        for mc in listeMc : 
-           removemocle.removeMotCleInFact(jdc,command,fact,mc)
-           jdc.reset(jdc.getSource())
+        for mc in listeMc :
+            removemocle.removeMotCleInFact(jdc,command,fact,mc)
+            jdc.reset(jdc.getSource())
 
 #-----------------------------------------------------
 def fusionMCFToMCF(jdc,command,listeMcF,factcible,defaut=0):
@@ -312,7 +312,7 @@ def fusionMCFToMCF(jdc,command,listeMcF,factcible,defaut=0):
             boolChange=1
     if boolChange :
         jdc.reset(jdc.getSource())
-        for mcF in listeMcF : 
+        for mcF in listeMcF :
             removemocle.removeMotCle(jdc,command,mcF)
             jdc.reset(jdc.getSource())
 
@@ -326,21 +326,21 @@ def eclaMotCleToFact(jdc,command,motcle,mot1,mot2,defaut=0):
     if command  not in jdcSet : return
     boolChange=0
     for c in jdc.root.childNodes:
-       if c.name != command  : continue
-       trouveUnMC=0
-       for mc in c.childNodes:
-           if mc.name != motcle : continue
-           trouveUnMC=1
-           TexteMC=mc.getText(jdc)
-           indexLigneGlob=mc.lineno-1
-           MaLigneGlob=jdc.getLines()[indexLigneGlob]
-           Ligne=TexteMC.split('(')[1].split(')')[0].split(',')
-           motcle1=mot1+"="+Ligne[0]
-           motcle2=mot2+"=("+Ligne[1]+','+Ligne[2]+','+Ligne[3]+')'
-           texte=motcle+'=_F('+motcle1+','+motcle2+')'
-           num=lastParen(TexteMC)
-           Nouveau=MaLigneGlob.replace(TexteMC[0:num],texte)
-           jdc.getLines()[indexLigneGlob]=Nouveau
-           logging.info("Transformation de %s dans %s ligne %s",motcle,command,c.lineno)
-           boolChange=1
+        if c.name != command  : continue
+        trouveUnMC=0
+        for mc in c.childNodes:
+            if mc.name != motcle : continue
+            trouveUnMC=1
+            TexteMC=mc.getText(jdc)
+            indexLigneGlob=mc.lineno-1
+            MaLigneGlob=jdc.getLines()[indexLigneGlob]
+            Ligne=TexteMC.split('(')[1].split(')')[0].split(',')
+            motcle1=mot1+"="+Ligne[0]
+            motcle2=mot2+"=("+Ligne[1]+','+Ligne[2]+','+Ligne[3]+')'
+            texte=motcle+'=_F('+motcle1+','+motcle2+')'
+            num=lastParen(TexteMC)
+            Nouveau=MaLigneGlob.replace(TexteMC[0:num],texte)
+            jdc.getLines()[indexLigneGlob]=Nouveau
+            logging.info("Transformation de %s dans %s ligne %s",motcle,command,c.lineno)
+            boolChange=1
     if boolChange : jdc.reset(jdc.getSource())
index 7c8e88307a4f63e6f4526b67f0ab783de092f17e..88315dedd1a8385f5da75f8c6542499865a92074 100644 (file)
@@ -110,14 +110,14 @@ class Keyword(Node):
             debut=jdc.getLines()[self.lineno-1][self.colno:]
             fin  = jdc.getLines()[self.endline-1][:self.endcol]
             texte=debut
-            lignecourante=self.lineno  
+            lignecourante=self.lineno
             while  lignecourante < self.endline -1  :
                 texte = texte + jdc.getLines()[lignecourante]
                 lignecourante = lignecourante + 1
-            if chaineBlanche(fin) == 0 :  
-               texte=texte + fin
+            if chaineBlanche(fin) == 0 :
+                texte=texte + fin
             if texte[-1] == "\n" :
-               texte=texte[0:-1]
+                texte=texte[0:-1]
         else:
             texte = jdc.getLines()[self.lineno-1][self.colno:self.endcol]
         return texte
@@ -147,7 +147,7 @@ def parser(src,atraiter):
 #------------------------
     """Parse le texte src et retourne un arbre syntaxique (root).
 
-       Cet arbre syntaxique a comme noeuds (childNodes) les commandes Ã  traiter (liste atraiter)
+       Cet arbre syntaxique a comme noeuds (childNodes) les commandes a traiter (liste atraiter)
     """
     lines=src.splitlines(1)
     maskedSrc=maskStringsAndComments(src)
@@ -155,8 +155,8 @@ def parser(src,atraiter):
 
     root=JDCNode(src)
 
-    # (a) dans un premier temps on extrait les commandes et on les insère 
-    #     dans un arbre (root)  les noeuds fils sont stockés dans 
+    # (a) dans un premier temps on extrait les commandes et on les insere
+    #     dans un arbre (root)  les noeuds fils sont stockes dans
     #     root.childNodes (liste)
     lineno=0
     for line in maskedLines:
@@ -171,16 +171,16 @@ def parser(src,atraiter):
             if m and (m.group(2) in atraiter):
                 root.addChild(Command(m.group(2),lineno,m.start(2),m.end(4)))
 
-    #(b) dans un deuxième temps , on récupère le texte complet de la commande 
-    #    jusqu'à la  dernière parenthèse fermante
+    #(b) dans un deuxieme temps , on recupere le texte complet de la commande
+    #    jusqu'a la  derniere parenthese fermante
 
-    # iterateur sur les lignes physiques masquées
+    # iterateur sur les lignes physiques masquees
     iterlines=iter(maskedLines)
 
     linenum=0
     for c in root.childNodes:
         lineno=c.lineno
-        colno=c.colno                       # début de la commande
+        colno=c.colno                       # debut de la commande
         while linenum < lineno:
             line=iterlines.next()
             linenum=linenum+1
@@ -200,7 +200,7 @@ def parser(src,atraiter):
 
             hangingComments ^= line.count('"""') % 2
             hangingComments ^= line.count("'''") % 2
-    
+
             if hangingBraces[0] < 0 or hangingBraces[1] < 0 or hangingBraces[2] < 0:
                 raise UnbalancedBracesException()
 
@@ -271,4 +271,3 @@ def lastParen2(src):
             if level == 0:
                 #derniere parenthese fermante
                 return i
-
index 829649b5f0859dd013de91826c2a26dfe392e75e..caed7b1fe711269b649f6947a65ef176c9503df3 100644 (file)
@@ -60,7 +60,7 @@ class pasDeRegle(ensembleRegles):
         Vérification
         """
         return 1
+
 
 #------------
 class regle :
@@ -79,7 +79,7 @@ class regle :
         """
         f = self.fonction(self.list_args)
         return f.verif(commande)
-        
+
 #---------------------
 class existeMCFParmi :
 #---------------------
@@ -95,7 +95,7 @@ class existeMCFParmi :
         """
         bool = 0
         for c in commande.childNodes :
-            if c.name in self.listeMCF : 
+            if c.name in self.listeMCF :
                 bool = 1
                 break
         return bool
@@ -116,7 +116,7 @@ class nexistepasMCFParmi(existeMCFParmi) :
         bool = existeMCFParmi.verif(self, commande)
         if bool : return 0
         return 1
-        
+
 #----------------------
 class existeMCsousMCF :
 #----------------------
@@ -134,7 +134,7 @@ class existeMCsousMCF :
         """
         bool = 0
         for mcf in commande.childNodes :
-            if mcf.name != self.MCF : continue 
+            if mcf.name != self.MCF : continue
             l = mcf.childNodes[:]
             l.reverse()
             for ll in l:
@@ -173,7 +173,7 @@ class nexistepasMCsousMCF(existeMCsousMCF):
     """
     def __init__(self, list_arg):
         existeMCsousMCF.__init__(self, list_arg)
-        
+
 
     def verif(self, commande):
         """
@@ -191,7 +191,7 @@ class nexistepasMCsousMCFcourant(existeMCsousMCFcourant):
     """
     def __init__(self, list_arg):
         existeMCsousMCFcourant.__init__(self, list_arg)
-        
+
 
     def verif(self, commande):
         """
@@ -218,7 +218,7 @@ class existe :
         if niveau == len(self.genea) : return 1
         texte = self.genea[niveau]
         for c in commande.childNodes :
-            if c.name == texte : 
+            if c.name == texte :
                 niveau = niveau+1
                 return self.chercheMot(niveau, c)
         return None
@@ -248,7 +248,7 @@ class nexistepas :
         if niveau    == len(self.genea) : return 1
         texte = self.genea[niveau]
         for c in commande.childNodes :
-            if c.name == texte : 
+            if c.name == texte :
                 niveau = niveau+1
                 return self.chercheMot(niveau, c)
         return None
@@ -281,7 +281,7 @@ class MCsousMCFaPourValeur :
         """
         bool = 0
         for mcf in commande.childNodes :
-            if mcf.name != self.MCF : continue 
+            if mcf.name != self.MCF : continue
             l = mcf.childNodes[:]
             l.reverse()
             for ll in l:
@@ -324,7 +324,7 @@ class MCsousMCFcourantaPourValeur :
 class MCsousMCFaPourValeurDansListe :
 #----------------------------
     """
-    Ã‰galité du mot-clé simple Ã  une valeur dans une liste 
+    Ã‰galité du mot-clé simple Ã  une valeur dans une liste
     sous le mot-clé facteur
     """
     def __init__(self, list_arg):
@@ -341,7 +341,7 @@ class MCsousMCFaPourValeurDansListe :
         """
         bool = 0
         for mcf in commande.childNodes :
-            if mcf.name != self.MCF : continue 
+            if mcf.name != self.MCF : continue
             l = mcf.childNodes[:]
             l.reverse()
             for ll in l:
@@ -351,13 +351,13 @@ class MCsousMCFaPourValeurDansListe :
                     for Val in self.LVal:
                         if (TexteMC.find(Val) < 0 ): continue
                         bool = 1
-        return bool        
+        return bool
 
 #-----------------------------
 class MCsousMCFcourantaPourValeurDansListe :
 #----------------------------
     """
-    Ã‰galité du mot-clé simple Ã  une valeur dans une liste 
+    Ã‰galité du mot-clé simple Ã  une valeur dans une liste
     sous le mot-clé facteur
     """
     def __init__(self, list_arg):
@@ -371,7 +371,7 @@ class MCsousMCFcourantaPourValeurDansListe :
         """
         Vérification
         """
-        bool = 0        
+        bool = 0
         l = mcf.childNodes[:]
         l.reverse()
         for mc in l:
@@ -380,40 +380,40 @@ class MCsousMCFcourantaPourValeurDansListe :
             for Val in self.LVal:
                 if (TexteMC.find(Val) < 0 ): continue
                 bool = 1
-        return bool    
+        return bool
 
 #-----------------------------------------
 class MCsousMCFcourantnaPasPourValeurDansListe(MCsousMCFcourantaPourValeurDansListe) :
 #-----------------------------------------
     """
-    Non Ã©galité du mot-clé simple Ã  une valeur dans une liste 
+    Non Ã©galité du mot-clé simple Ã  une valeur dans une liste
     sous le mot-clé facteur
     """
     def __init__(self, list_arg):
         MCsousMCFcourantaPourValeurDansListe.__init__(self, list_arg)
-        
+
 
     def verif(self, commande):
         bool = MCsousMCFcourantaPourValeurDansListe.verif(self, commande)
         if bool : return 0
         return 1
-  
+
 #-----------------------------------------
 class MCsousMCFnaPasPourValeurDansListe(MCsousMCFaPourValeurDansListe) :
 #-----------------------------------------
     """
-    Non Ã©galité du mot-clé simple Ã  une valeur dans une liste 
+    Non Ã©galité du mot-clé simple Ã  une valeur dans une liste
     sous le mot-clé facteur
     """
     def __init__(self, list_arg):
         MCsousMCFaPourValeurDansListe.__init__(self, list_arg)
-        
+
 
     def verif(self, commande):
         bool = MCsousMCFaPourValeurDansListe.verif(self, commande)
         if bool : return 0
         return 1
-  
+
 #------------------------------
 class MCaPourValeur :
 #------------------------------
@@ -432,7 +432,7 @@ class MCaPourValeur :
         """
         bool = 0
         for mc in commande.childNodes :
-            if mc.name != self.MC : continue 
+            if mc.name != self.MC : continue
             TexteMC = mc.getText(self.Jdc)
             if (TexteMC.find(self.Val) < 0 ): continue
             bool = 1
@@ -442,7 +442,7 @@ class MCaPourValeur :
 class MCnaPasPourValeur(MCaPourValeur) :
 #-----------------------------------------
     """
-       Non Ã©galité du mot-clé Ã  une valeur 
+        Non Ã©galité du mot-clé Ã  une valeur
     """
     def __init__(self, list_arg):
         MCaPourValeur.__init__(self, list_arg)
@@ -473,7 +473,7 @@ class MCaPourValeurDansListe :
         """
         bool = 0
         for mc in commande.childNodes :
-            if mc.name != self.MC : continue 
+            if mc.name != self.MC : continue
             TexteMC = mc.getText(self.Jdc)
             #print "TexteMC=",type(TexteMC),TexteMC
             #print "LVal=",type(self.LVal),self.LVal
@@ -488,7 +488,7 @@ class MCaPourValeurDansListe :
 class MCnaPasPourValeurDansListe(MCaPourValeurDansListe) :
 #-----------------------------------------
     """
-       Non Ã©galité du mot-clé Ã  une valeur dans une liste
+        Non Ã©galité du mot-clé Ã  une valeur dans une liste
     """
     def __init__(self, list_arg):
         MCaPourValeurDansListe.__init__(self, list_arg)
index 98152fbc2e128cf1d44964332f17ccd3bdea5b93..b960e22adc706c845935dcae1de96fb443bd094d 100644 (file)
@@ -25,8 +25,8 @@ from Traducteur.load import jdcSet
 
 debug=0
 #debug=1
-#on n'a qu'un mocle par commande. On peut donc supprimer le mocle sans trop de précautions (a part iterer a l'envers sur les commandes)
-#avant de supprimer un autre mocle, on remet Ã  jour l'arbre syntaxique (lineno,colno,etc.)
+#on n'a qu'un mocle par commande. On peut donc supprimer le mocle sans trop de precautions (a part iterer a l'envers sur les commandes)
+#avant de supprimer un autre mocle, on remet a jour l'arbre syntaxique (lineno,colno,etc.)
 
 
 #-----------------------------------------------------------------------
@@ -67,7 +67,7 @@ def removeMotCleAvecErreur(jdc,command,mocle) :
 #--------------------------------------------------------------
     if command not in jdcSet : return
     removeMotCle(jdc,command,mocle,erreur=1)
-      
+
 
 #--------------------------------------------------------------------
 def removeCommande(jdc,command,ensemble=regles.SansRegle,erreur=0):
@@ -98,7 +98,7 @@ def removeCommandeSiRegleAvecErreur(jdc,command,liste_regles):
     if command not in jdcSet : return
     mesRegles=regles.ensembleRegles(liste_regles)
     removeCommande(jdc,command,mesRegles,1)
-                
+
 #---------------------------------
 def removeMC(jdc,c,mc):
 #---------------------------------
@@ -110,7 +110,7 @@ def removeMC(jdc,c,mc):
         jdc.getLines()[mc.lineno-1]=jdc.getLines()[mc.lineno-1][:mc.colno]
         jdc.getLines()[mc.endline-1]=jdc.getLines()[mc.endline-1][mc.endcol:]
 
-        #attention : supprimer les lignes Ã  la fin
+        #attention : supprimer les lignes a la fin
         jdc.getLines()[mc.lineno:mc.endline-1]=[]
     else:
         if debug:print "mocle sur une ligne--%s--" % jdc.getLines()[mc.lineno-1][mc.colno:mc.endcol]
@@ -121,7 +121,7 @@ def removeMC(jdc,c,mc):
 #---------------------------------------------------------------------------------
 def removeMotCleInFact(jdc,command,fact,mocle,ensemble=regles.SansRegle,erreur=0):
 #----------------------------------------------------------------------------------
-    # on itere sur les commandes a l'envers pour ne pas polluer 
+    # on itere sur les commandes a l'envers pour ne pas polluer
     # les numeros de ligne avec les modifications
     if command not in jdcSet : return
     commands= jdc.root.childNodes[:]
@@ -183,7 +183,7 @@ def removeMotCleInFactCourantSiRegle(jdc,command,fact,mocle,liste_regles,erreur=
                     removeMC(jdc,c,n)
 
     if boolChange : jdc.reset(jdc.getSource())
-    
+
 #------------------------------------------
 def fusionne(jdc,numLigne):
 #------------------------------------------
@@ -198,18 +198,18 @@ def fusionne(jdc,numLigne):
     texte=jdc.getLines()[numLigne]
     fusion=1
     while (index < len(texte)) :
-      if texte[index] not in (" ",",",")",";","\n") :
-         fusion=0
-         break
-      index=index+1
-       
+        if texte[index] not in (" ",",",")",";","\n") :
+            fusion=0
+            break
+        index=index+1
+
     if fusion == 0 : return;
 
     texte=jdc.getLines()[numLigne -1]
     if texte.find("#") < 0 :
-       fusion=1
+        fusion=1
     else :
-       fusion=0
-    if fusion : 
-       jdc.joinLineandNext(numLigne)
+        fusion=0
+
+    if fusion :
+        jdc.joinLineandNext(numLigne)
index 1ef63624b0a0cc800569a860a3b8ca5aae4e7bb0..da2862e5e40794f944d37ae3fe45543b51f29c68 100644 (file)
 import logging
 import sys
 from Traducteur.parseur import FactNode
-from Traducteur.load import jdcSet 
+from Traducteur.load import jdcSet
 from Traducteur import regles
 from Traducteur.dictErreurs import ecritErreur
 #debug=1
 debug=0
 
-#on n'a qu'un mocle par commande. 
-#en fin de traitement, on remet Ã  jour l'arbre syntaxique (lineno,colno,etc.)
+#on n'a qu'un mocle par commande.
+#en fin de traitement, on remet a jour l'arbre syntaxique (lineno,colno,etc.)
 
 #--------------------------------------------------------------------------------
 def renameMotCle(jdc,command,mocle,new_name, erreur=0,ensemble=regles.SansRegle):
@@ -42,16 +42,16 @@ def renameMotCle(jdc,command,mocle,new_name, erreur=0,ensemble=regles.SansRegle)
             boolChange=1
             if debug:print "Renommage de:",c.name,mc.name,mc.lineno,mc.colno
             if erreur :
-               ecritErreur((command,mocle),c.lineno)
+                ecritErreur((command,mocle),c.lineno)
             else :
-               logging.info("Renommage de: %s  %s ligne %d en %s",c.name,mc.name,mc.lineno,new_name)
+                logging.info("Renommage de: %s  %s ligne %d en %s",c.name,mc.name,mc.lineno,new_name)
             s=jdc.getLines()[mc.lineno-1]
             jdc.getLines()[mc.lineno-1]=s[:mc.colno]+new_name+s[mc.colno+len(mocle):]
             diff=len(new_name) - len(mocle)
             decaleLignesdeNBlancs(jdc,mc.lineno,mc.endline-1,diff)
 
     if boolChange : jdc.reset(jdc.getSource())
-                
+
 #------------------------------------------------------
 def renameMotCleAvecErreur(jdc,command,mocle,new_name):
 #------------------------------------------------------
@@ -87,14 +87,14 @@ def decaleLignesdeNBlancs(jdc,premiere,derniere,nbBlanc):
 #----------------------------------------------------------
     ligne = premiere + 1
     while ligne < derniere :
-       s=jdc.getLines()[ligne]
-       if nbBlanc > 0 :
-         jdc.getLines()[ligne] = nbBlanc*" " + s
-       else :
-         toutblancs=-1*nbBlanc*" "
-         if jdc.getLines()[ligne][0:-1*nbBlanc] == toutblancs: 
-            jdc.getLines()[ligne] = s[-1*nbBlanc:]
-       ligne=ligne+1
+        s=jdc.getLines()[ligne]
+        if nbBlanc > 0 :
+            jdc.getLines()[ligne] = nbBlanc*" " + s
+        else :
+            toutblancs=-1*nbBlanc*" "
+            if jdc.getLines()[ligne][0:-1*nbBlanc] == toutblancs:
+                jdc.getLines()[ligne] = s[-1*nbBlanc:]
+        ligne=ligne+1
 
 #---------------------------------------------------------------------------------------------
 def renameMotCleInFact(jdc,command,fact,mocle,new_name, ensemble=regles.SansRegle, erreur=0):
@@ -116,9 +116,9 @@ def renameMotCleInFact(jdc,command,fact,mocle,new_name, ensemble=regles.SansRegl
                     jdc.getLines()[n.lineno-1]=s[:n.colno]+new_name+s[n.colno+len(mocle):]
                     boolChange=1
                     if erreur :
-                       ecritErreur((command,fact,mocle),c.lineno)
+                        ecritErreur((command,fact,mocle),c.lineno)
                     else :
-                       logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name)
+                        logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name)
 
     if boolChange : jdc.reset(jdc.getSource())
 
@@ -149,13 +149,13 @@ def renameMotCleInFactCourantSiRegle(jdc,command,fact,mocle,new_name,liste_regle
                     jdc.getLines()[n.lineno-1]=s[:n.colno]+new_name+s[n.colno+len(mocle):]
                     boolChange=1
                     if erreur :
-                       ecritErreur((command,fact,mocle),c.lineno)
+                        ecritErreur((command,fact,mocle),c.lineno)
                     else :
-                       logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name)
+                        logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name)
 
     if boolChange : jdc.reset(jdc.getSource())
-    
-    
+
+
 #-----------------------------------------------------------------
 def renameCommande(jdc,command,new_name,ensemble=regles.SansRegle):
 #-----------------------------------------------------------------
@@ -165,9 +165,9 @@ def renameCommande(jdc,command,new_name,ensemble=regles.SansRegle):
     boolChange=0
     if debug :
         if ensemble != regles.SansRegle :
-          logging.info("traitement de %s renomme en %s sous conditions", command, new_name)
+            logging.info("traitement de %s renomme en %s sous conditions", command, new_name)
         else  :
-          logging.info("traitement de %s renomme en %s ", command, new_name)
+            logging.info("traitement de %s renomme en %s ", command, new_name)
     for c in jdc.root.childNodes:
         if c.name != command:continue
         if ensemble.verif(c) == 0 : continue
@@ -182,8 +182,7 @@ def renameCommande(jdc,command,new_name,ensemble=regles.SansRegle):
 #-----------------------------------------------------------
 def renameCommandeSiRegle(jdc,command,new_name,liste_regles):
 #-----------------------------------------------------------
-    
+
     if command not in jdcSet : return
     mesRegles=regles.ensembleRegles(liste_regles)
     renameCommande(jdc,command,new_name,mesRegles)
-
diff --git a/Traducteur/toto.comm b/Traducteur/toto.comm
deleted file mode 100644 (file)
index a2f211e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-DEBUT();
-
-CALC_NONO(reuse=MSLIN,
-        RESULTAT=MSLIN,
-        OPTION=('EPSI_NOEU','SIEQ_NOEU','EPEQ_NOEU','SIGM_NOEU',),);
-
-CALC_NONO(reuse=MSLIN,
-        RESULTAT=MSLIN,
-        OPTION=('AA','EPSI_NOEU','SIEQ_NOEU','EPEQ_NOEU','SIGM_NOEU',),);
-FIN();
index 2ceec81b2aa647ccba777b55c986d3e4505f3a8e..5f638c2c2a5911cfb9f9cfd8f689d847fa0b777f 100755 (executable)
@@ -221,11 +221,11 @@ atraiter=(
           "THER_LINEAIRE",
           "THER_NON_LINE",
           "THER_NON_LINE_MO",
-          
+
           "CALC_CHAMPNO",
           "CALC_METANO",
           "CALC_ERREURNO",
-          
+
           )
 
 dict_erreurs={
@@ -497,7 +497,7 @@ def traduc(infile,outfile,flog=None):
     suppressionValeurs(jdc,"CALC_CHAMP","ACOUSTIQUE",list(set(lTOUT)-set(lACOUSTIQUE)))
     suppressionValeurs(jdc,"CALC_CHAMP","ERREUR",list(set(lTOUT)-set(lERREUR)))
     suppressionValeurs(jdc,"CALC_CHAMP","META",list(set(lTOUT)-set(lMETA)))
-    ## ajout CALC_META ou CALC_ERREUR   
+    ## ajout CALC_META ou CALC_ERREUR
     lMOTCLE=[]
     lMOTCLE=["reuse","RESULTAT","TOUT_ORDRE","NUME_ORDRE","NUME_MODE","NOEUD_CMP","NOM_CAS",
               "INST","FREQ","LIST_INST","LIST_FREQ","LIST_ORDRE","CRITERE","PRECISION","EXCIT"]
@@ -506,10 +506,10 @@ def traduc(infile,outfile,flog=None):
     llistMETA=list(lMOTCLE)
     llistMETA.extend(["META",])
     for mc in llistMETA :
-               copyMotClefInOperToFact(jdc,"CALC_CHAMP",mc,"TEMPORAIRE")
+        copyMotClefInOperToFact(jdc,"CALC_CHAMP",mc,"TEMPORAIRE")
     moveMCFToCommand(jdc,"CALC_CHAMP","TEMPORAIRE","CALC_META","TEMPORAIRE")
     for mc in llistMETA :
-               moveMotCleFromFactToFather(jdc,"CALC_META","TEMPORAIRE",mc)
+        moveMotCleFromFactToFather(jdc,"CALC_META","TEMPORAIRE",mc)
     removeCommandeSiRegle(jdc,"CALC_META",((("META","COMP_INCR","ETAT_INIT"),"nexistepasMCFParmi"),))
     renameMotCle(jdc,"CALC_META","META","OPTION")
     removeMotCle(jdc,"CALC_META","TEMPORAIRE",pasDeRegle(),0)
@@ -519,10 +519,10 @@ def traduc(infile,outfile,flog=None):
     llistERREUR=list(lMOTCLE)
     llistERREUR.extend(["ERREUR","SOLVEUR","RESU_DUAL","PREC_ESTI","TYPE_ESTI"])
     for mc in llistERREUR :
-               copyMotClefInOperToFact(jdc,"CALC_CHAMP",mc,"TEMPORAIRE")
+        copyMotClefInOperToFact(jdc,"CALC_CHAMP",mc,"TEMPORAIRE")
     moveMCFToCommand(jdc,"CALC_CHAMP","TEMPORAIRE","CALC_ERREUR","TEMPORAIRE")
     for mc in llistERREUR :
-               moveMotCleFromFactToFather(jdc,"CALC_ERREUR","TEMPORAIRE",mc)
+        moveMotCleFromFactToFather(jdc,"CALC_ERREUR","TEMPORAIRE",mc)
     removeCommandeSiRegle(jdc,"CALC_ERREUR",((("ERREUR"),"nexistepasMCFParmi"),))
     renameMotCle(jdc,"CALC_ERREUR","ERREUR","OPTION")
     removeMotCle(jdc,"CALC_ERREUR","TEMPORAIRE",pasDeRegle(),0)
@@ -703,7 +703,7 @@ def traduc(infile,outfile,flog=None):
     suppressionValeurs(jdc,"CALC_CHAMPNO","FORCE",list(set(lTOUT)-set(lFORCE)))
     suppressionValeurs(jdc,"CALC_CHAMPNO","ERREUR",list(set(lTOUT)-set(lERREUR)))
     suppressionValeurs(jdc,"CALC_CHAMPNO","META",list(set(lTOUT)-set(lMETA)))
-    ## ajout CALC_METANO ou CALC_ERREURNO   
+    ## ajout CALC_METANO ou CALC_ERREURNO
     lMOTCLE=[]
     lMOTCLE=["reuse","RESULTAT","TOUT_ORDRE","NUME_ORDRE","NUME_MODE","NOEUD_CMP","NOM_CAS",
               "INST","FREQ","LIST_INST","LIST_FREQ","LIST_ORDRE","CRITERE","PRECISION","EXCIT"]
@@ -712,10 +712,10 @@ def traduc(infile,outfile,flog=None):
     llistMETA=list(lMOTCLE)
     llistMETA.append("META")
     for mc in llistMETA :
-               copyMotClefInOperToFact(jdc,"CALC_CHAMPNO",mc,"TEMPORAIRE")
+        copyMotClefInOperToFact(jdc,"CALC_CHAMPNO",mc,"TEMPORAIRE")
     moveMCFToCommand(jdc,"CALC_CHAMPNO","TEMPORAIRE","CALC_METANO","TEMPORAIRE")
     for mc in llistMETA :
-               moveMotCleFromFactToFather(jdc,"CALC_METANO","TEMPORAIRE",mc)
+        moveMotCleFromFactToFather(jdc,"CALC_METANO","TEMPORAIRE",mc)
     removeCommandeSiRegle(jdc,"CALC_METANO",((("META"),"nexistepasMCFParmi"),))
     renameMotCle(jdc,"CALC_METANO","META","OPTION")
     removeMotCle(jdc,"CALC_METANO","TEMPORAIRE",pasDeRegle(),0)
@@ -725,10 +725,10 @@ def traduc(infile,outfile,flog=None):
     llistERREUR=list(lMOTCLE)
     llistERREUR.append("ERREUR")
     for mc in llistERREUR :
-               copyMotClefInOperToFact(jdc,"CALC_CHAMPNO",mc,"TEMPORAIRE")
+        copyMotClefInOperToFact(jdc,"CALC_CHAMPNO",mc,"TEMPORAIRE")
     moveMCFToCommand(jdc,"CALC_CHAMPNO","TEMPORAIRE","CALC_ERREURNO","TEMPORAIRE")
     for mc in llistERREUR :
-               moveMotCleFromFactToFather(jdc,"CALC_ERREURNO","TEMPORAIRE",mc)
+        moveMotCleFromFactToFather(jdc,"CALC_ERREURNO","TEMPORAIRE",mc)
     removeCommandeSiRegle(jdc,"CALC_ERREURNO",((("ERREUR"),"nexistepasMCFParmi"),))
     renameMotCle(jdc,"CALC_ERREURNO","ERREUR","OPTION")
     removeMotCle(jdc,"CALC_ERREURNO","TEMPORAIRE",pasDeRegle(),0)
@@ -1126,7 +1126,7 @@ def traduc(infile,outfile,flog=None):
 
     ####   traitement de FORMULE   ##############################
     # Rien Ã  faire
-    
+
     ####   traitement de GENE_ACCE_SEISME   ##############################
     # Rien Ã  faire, n'existe pas en 10
 
@@ -1353,7 +1353,7 @@ def traduc(infile,outfile,flog=None):
     renameMotCleInFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","STOP_FREQ_VIDE","STOP_BANDE_VIDE",pasDeRegle(),0)
     # Renommage critere de Sturm
     changementValeurDsMCF(jdc,"MACRO_MODE_MECA","VERI_MODE","STURM",{"OUI":"GLOBAL",})
+
     ####   traitement de MACRO_PROJ_BASE   ##############################
     renameMotCle(jdc,"MACRO_PROJ_BASE","PROFIL","STOCKAGE")
     # Renommage de la commande
@@ -1434,7 +1434,7 @@ def traduc(infile,outfile,flog=None):
 
     ####   traitement de POST_BORDET   ##############################
     # Rien Ã  faire
-    
+
     ####   traitement de POST_CHAMP   ##############################
     # Rien Ã  faire, n'existe pas en 10
 
index 47df1bfea7b27af372ef18e26b3e9f71663e7744..da0acf71838fc2e92ad56827cd7c7aa9696e89c4 100755 (executable)
@@ -107,7 +107,7 @@ atraiter=(
           "SIMU_POINT_MAT",
           "TEST_COMPOR",
           "THER_NON_LINE",
-          "DEFI_PART_FETI"       
+          "DEFI_PART_FETI"
           )
 
 dict_erreurs={
@@ -162,7 +162,7 @@ def traduc(infile,outfile,flog=None):
 
     #Parse les mocles des commandes
     parseKeywords(root)
-    
+
     ####   traitement de DEFI_PART_PA_OPS   ##############################
     genereErreurPourCommande(jdc,"DEFI_PART_PA_OPS")
 
@@ -177,7 +177,7 @@ def traduc(infile,outfile,flog=None):
 
     ####   traitement de AFFE_CHAR_MECA   ##############################
     # Suppression du mot-clé METHODE
-    removeMotCle(jdc,"AFFE_CHAR_MECA","METHODE",pasDeRegle(),0)    
+    removeMotCle(jdc,"AFFE_CHAR_MECA","METHODE",pasDeRegle(),0)
     # Suppression des mot-clés LIAISON_XFEM
     removeMotCle(jdc,"AFFE_CHAR_MECA","LIAISON_XFEM",pasDeRegle(),0)
     removeMotCle(jdc,"AFFE_CHAR_MECA","CONTACT_XFEM",pasDeRegle(),0)
@@ -270,9 +270,9 @@ def traduc(infile,outfile,flog=None):
     ####   traitement de CREA_MAILLAGE   ##############################
     renameMotCle(jdc,"CREA_MAILLAGE","CREA_GROUP_MA","CREA_MAILLE")
     genereErreurMCF(jdc,"CREA_MAILLAGE","ECLA_PG")
-    
+
     lMCLEF=['COQU_VOLU', 'CREA_FISS', 'CREA_GROUP_MA', 'CREA_MAILLE', 'CREA_POI1',
-    'ECLA_PG', 'HEXA20_27', 'LINE_QUAD', 'MODI_MAILLE','QUAD_LINE', 
+    'ECLA_PG', 'HEXA20_27', 'LINE_QUAD', 'MODI_MAILLE','QUAD_LINE',
     'REPERE','RESTREINT','PENTA15_18']
     genereErreurMCF(jdc,"CREA_MAILLAGE","DETR_GROUP_MA")
     removeMotCleInFactSiRegle(jdc,"CREA_MAILLAGE","DETR_GROUP_MA","NB_MAILLE",((lMCLEF,"nexistepasMCFParmi"),))
@@ -284,7 +284,7 @@ def traduc(infile,outfile,flog=None):
     removeMotCleInFact(jdc,"DEBUT","CODE","NOM",pasDeRegle(),0)
 
     ####   traitement de DEFI_COMPOR   ##############################
-    genereErreurValeur(jdc,"DEFI_COMPOR","LOCALISATION",["'RL'",]) 
+    genereErreurValeur(jdc,"DEFI_COMPOR","LOCALISATION",["'RL'",])
     genereErreurValeur(jdc,"DEFI_COMPOR","RELATION_KIT",["'RVMIS_ISOT_CINE'",])
     genereErreurValeurDsMCF(jdc,"DEFI_COMPOR","MULTIFIBRE","RELATION",["'LABORD_1D'"])
     genereErreurMCF(jdc,"DEFI_COMPOR","POLYCRISTAL")
@@ -309,8 +309,8 @@ def traduc(infile,outfile,flog=None):
     genereErreurMCF(jdc,"DEFI_MATER_GC","MAZARS")
 
     ####   traitement de DEFI_MATERIAU   ##############################
-    lMLA=["F_MRR_RR", "C_MRR_RR", "F_MTT_TT", "C_MTT_TT", "F_MZZ_ZZ", 
-           "C_MZZ_ZZ", "F_MRT_RT", "C_MRT_RT", "F_MRZ_RZ", "C_MRZ_RZ", 
+    lMLA=["F_MRR_RR", "C_MRR_RR", "F_MTT_TT", "C_MTT_TT", "F_MZZ_ZZ",
+           "C_MZZ_ZZ", "F_MRT_RT", "C_MRT_RT", "F_MRZ_RZ", "C_MRZ_RZ",
            "F_MTZ_TZ", "C_MTZ_TZ",]
     for param in lMLA:
         removeMotCleInFact(jdc,"DEFI_MATERIAU","META_LEMA_ANI",param,pasDeRegle(),0)
@@ -320,15 +320,15 @@ def traduc(infile,outfile,flog=None):
     for mcle in lMDC:
         removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC",mcle,pasDeRegle(),0)
         removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC_IRRA",mcle,pasDeRegle(),0)
-    
+
     removeMotCleInFact(jdc,"DEFI_MATERIAU","UMAT","NB_VALE",pasDeRegle(),0)
     removeMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO","NB_VALE",pasDeRegle(),0)
     listeMc=["C"+str(i) for i in range(1,198)]
     fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT",listeMc,"LISTE_COEF")
     fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO",listeMc,"LISTE_COEF")
-    
-    removeMotCle(jdc,"DEFI_MATERIAU","LABORD_1D",pasDeRegle(),0) 
-    
+
+    removeMotCle(jdc,"DEFI_MATERIAU","LABORD_1D",pasDeRegle(),0)
+
     genereErreurMCF(jdc,"DEFI_MATERIAU","DIS_VISC")
     lDISC=["PUIS_DX", "PUIS_DY", "PUIS_DZ", "PUIS_RX", "PUIS_RY", "PUIS_RZ",
      "COEF_DX", "COEF_DY", "COEF_DZ", "COEF_RX", "COEF_RY", "COEF_RZ"]
@@ -383,7 +383,7 @@ def traduc(infile,outfile,flog=None):
     ####   traitement de EXTR_TABLE   ##############################
     changementValeurDsMCF(jdc,"EXTR_TABLE","FILTRE","VALE_K",{"MATR_ELEM":"MATR_TANG_ELEM"})
     changementValeurDsMCF(jdc,"EXTR_TABLE","FILTRE","VALE_K",{"CODE_RETOUR":"CODE_RETOUR_INTE"})
-    
+
     ####   traitement de FACTORISER   ##############################
     renameMotCle(jdc,"FACTORISER","ELIM_LAGR2","ELIM_LAGR")
     changementValeur(jdc,"FACTORISER","ELIM_LAGR",{"OUI":"LAGR2",})
@@ -427,7 +427,7 @@ def traduc(infile,outfile,flog=None):
     ####   traitement de MACR_ECREVISSE   ##############################
     genereErreurMCF(jdc,"MACR_ECREVISSE","COMP_INCR")
 
-    ####   traitement de MACR_INFO_MAIL   ##############################    
+    ####   traitement de MACR_INFO_MAIL   ##############################
     changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_6":"V11_2"})
     changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_N":"V11_N"})
     changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_N_PERSO":"V11_N_PERSO"})
@@ -468,7 +468,7 @@ def traduc(infile,outfile,flog=None):
         moveMotCleFromFactToFact(jdc,"MODE_ITER_INV","CALC_FREQ",mcle,"SOLVEUR_MODAL")
     moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","PREC_JACOBI","SOLVEUR_MODAL")
     moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","PREC_BATHE","SOLVEUR_MODAL")
-    
+
     removeMotCle(jdc,"MODE_ITER_INV","CALC_MODE",pasDeRegle(),0)
 
     chercheOperInsereMotCleSiRegle(jdc,"MODE_ITER_INV","OPTION='AJUSTE'",((("OPTION",),"nexistepas"),),0)
@@ -493,7 +493,7 @@ def traduc(infile,outfile,flog=None):
     moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","DIM_SOUS_ESPACE","SOLVEUR_MODAL")
     moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","COEF_DIM_ESPACE","SOLVEUR_MODAL")
     moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","DIM_SOUS_ESPACE","SOLVEUR_MODAL")
-    
+
     removeMotCleInFactSiRegle(jdc,"MODE_ITER_SIMULT","CALC_FREQ","APPROCHE",
                                     ((("SOLVEUR_MODAL","METHODE",["QZ"],jdc),"MCsousMCFnaPasPourValeurDansListe")or
                                      (("SOLVEUR_MODAL","METHODE",),"nexistepasMCsousMCF"),
@@ -564,7 +564,7 @@ def traduc(infile,outfile,flog=None):
         changementValeur(jdc,com,"OPTION",{"FORC_INT_ELEM":"FORC_INTE_ELEM"})
 
         removeMotCleInFactSiRegle(jdc,com,"COMPORTEMENT","NB_VARI",((("COMPORTEMENT","RELATION","'MFRONT'",jdc),"MCsousMCFaPourValeur"),))
-        
+
 
     ####   traitement de TEST_COMPOR   ##############################
     genereErreurPourCommande(jdc,"TEST_COMPOR")
@@ -574,9 +574,9 @@ def traduc(infile,outfile,flog=None):
 
     ####   traitement de C_SOLVEUR   ##############################
     lCOM=['CALC_ERREUR', 'CALC_FORC_AJOU', 'CALC_IFS_DNL', 'CALC_MATR_AJOU', 'CALC_PRECONT',
-        'CREA_ELEM_SSD', 'DEFI_BASE_MODALE', 'DYNA_LINE_HARM', 'DYNA_LINE_TRAN', 'DYNA_NON_LINE', 
-        'DYNA_TRAN_MODAL', 'INFO_MODE', 'MACR_ASCOUF_CALC', 'MACR_ASPIC_CALC', 'MACRO_BASCULE_SCHEMA', 
-        'MACRO_MATR_AJOU', 'MECA_STATIQUE', 'MODE_ITER_SIMULT', 'MODE_ITER_INV', 'MODE_STATIQUE', 
+        'CREA_ELEM_SSD', 'DEFI_BASE_MODALE', 'DYNA_LINE_HARM', 'DYNA_LINE_TRAN', 'DYNA_NON_LINE',
+        'DYNA_TRAN_MODAL', 'INFO_MODE', 'MACR_ASCOUF_CALC', 'MACR_ASPIC_CALC', 'MACRO_BASCULE_SCHEMA',
+        'MACRO_MATR_AJOU', 'MECA_STATIQUE', 'MODE_ITER_SIMULT', 'MODE_ITER_INV', 'MODE_STATIQUE',
         'STAT_NON_LINE', 'THER_LINEAIRE', 'THER_NON_LINE', 'THER_NON_LINE_MO', 'CALC_ERC_DYN','CALC_MODES',]
     for com in lCOM:
         # Suppression de ELIM_LAGR2
@@ -589,11 +589,11 @@ def traduc(infile,outfile,flog=None):
         lMCLE=["NB_REORTHO_DD","NMAX_ITER","INFO_FETI","RESI_RELA","PARTITION"]
         for mocle in lMCLE:
             genereErreurMotCleInFact(jdc,com,"SOLVEUR",mocle)
-    
+
     ####   traitement de DEFI_PART_FETI   ##############################
     genereErreurMCF(jdc,"DEFI_PART_FETI","EXCIT")
     removeMotCle(jdc,"DEFI_PART_FETI","EXCIT",pasDeRegle(),0)
-    removeMotCle(jdc,"DEFI_PART_FETI","CORRECTION_CONNEX",pasDeRegle(),0)    
+    removeMotCle(jdc,"DEFI_PART_FETI","CORRECTION_CONNEX",pasDeRegle(),0)
     genereErreurPourCommande(jdc,"DEFI_PART_FETI")
     renameCommande(jdc,"DEFI_PART_FETI","DEFI_PARTITION", )
 
index f8303044be3b18625f8c56693eebe2119cf54887..3962c0fdf92dc5e0fee6e7b55e858187e70430d1 100644 (file)
@@ -86,11 +86,11 @@ dict_erreurs={
               "CALC_CHAM_ELEM":"reecrire la partie SOUR_ELGA_ELEC",
               "CALC_G_THETA_T_OPTION_VALEUR":"verifier la valeur d OPTION",
               "CALC_G_THETA_T_OPTION_DEFAUT":"verifier la valeur d OPTION donnee a la place du defaut",
-              "CALC_G_MODELE":"Mot Clef MODELE supprimé sous CALC_G",
-              "CALC_G_DEPL":"Mot Clef DEPL supprimé sous CALC_G",
-              "CALC_G_CHAM_MATER":"Mot Clef CHAM_MATER supprimé sous CALC_G",
-              "CALC_G_CARA_ELEM":"Mot Clef CARA_ELEM supprimé sous CALC_G",
-              "CALC_G_RESULTAT=XXX,":"Mot Clef RESULTAT Ã  completer sous CALC_G",
+              "CALC_G_MODELE":"Mot Clef MODELE supprime sous CALC_G",
+              "CALC_G_DEPL":"Mot Clef DEPL supprime sous CALC_G",
+              "CALC_G_CHAM_MATER":"Mot Clef CHAM_MATER supprime sous CALC_G",
+              "CALC_G_CARA_ELEM":"Mot Clef CARA_ELEM supprime sous CALC_G",
+              "CALC_G_RESULTAT=XXX,":"Mot Clef RESULTAT a completer sous CALC_G",
               "AFFE_MODELE_AFFE_MODELISATION_VALEUR":"verifier la valeur de MODELISATION",
               "STAT_NON_LINE_COMP_INCR_RELATION_VALEUR":"verifier la valeur de RELATION",
               "STAT_NON_LINE_COMP_INCR_RELATION_KIT_VALEUR":"verifier la valeur de RELATION_KIT",
@@ -129,7 +129,7 @@ def traduc(infile,outfile,flog=None):
 
     #Parse les mocles des commandes
     parseKeywords(root)
-    
+
     ####################### traitement erreurs ########################
     genereErreurPourCommande(jdc,("DEBUT","POST_RCCM","DIST_LIGN_3D","IMPR_OAR","COMB_CHAM_NO","COMB_CHAM_ELEM"))
 
@@ -256,7 +256,7 @@ def traduc(infile,outfile,flog=None):
     moveMotClefInOperToFact(jdc,"CALC_G_LOCAL_T","LISSAGE_THETA","LISSAGE")
     moveMotClefInOperToFact(jdc,"CALC_G_LOCAL_T","LISSAGE_G","LISSAGE")
     moveMotClefInOperToFact(jdc,"CALC_G_LOCAL_T","DEGRE","LISSAGE")
-    
+
     dlocal={"CALC_G_LGLO":"G_LAGR", "G_BILINEAIRE":"G_BILI", "CALC_G_MAX":"G_MAX"}
     changementValeur(jdc,"CALC_G_LOCAL_T","OPTION",dlocal)
     #
@@ -268,13 +268,13 @@ def traduc(infile,outfile,flog=None):
     renameOper(jdc,"CALC_G_THETA_T","CALC_G")
 
     # Attention cela necessite un traitement particulier et ne peut pas etre generalise tel quel
-    # Attention egalement doit etre fait avant le regroupement dans THETA 
+    # Attention egalement doit etre fait avant le regroupement dans THETA
     calcG.traitementRayon(jdc)
     renameMotCle(jdc,"CALC_G","THETA","THETA_OLD")
     chercheOperInsereFacteur(jdc,"CALC_G","THETA")
     moveMotClefInOperToFact(jdc,"CALC_G","THETA_OLD","THETA")
     renameMotCleInFact(jdc,"CALC_G","THETA","THETA_OLD","THETA")
-    
+
     moveMotClefInOperToFact(jdc,"CALC_G","FOND_FISS","THETA")
     moveMotClefInOperToFact(jdc,"CALC_G","R_INF_FO","THETA")
     moveMotClefInOperToFact(jdc,"CALC_G","R_SUP_FO","THETA")
@@ -297,7 +297,7 @@ def traduc(infile,outfile,flog=None):
     removeMotCleSiRegleAvecErreur(jdc,"AFFE_MODELE","AFFE",((("AFFE","MODELISATION","ASSE_GRIL",jdc),"MCsousMCFaPourValeur"),))
     removeMotCleSiRegleAvecErreur(jdc,"AFFE_MODELE","AFFE",((("AFFE","MODELISATION","3D_JOINT_CT",jdc),"MCsousMCFaPourValeur"),))
     renameMotCleInFact(jdc,"AFFE_MODELE","AFFE_SOUS_STRUC","MAILLE","SUPER_MAILLE")
+
     ####################### traitement PROJ_MESU_MODAL #######################
     removeMotCleInFact(jdc,"PROJ_MESU_MODAL","MODELE_MESURE","NOM_PARA")
     removeMotCleInFactSiRegleAvecErreur(jdc,"AFFE_CHAR_MECA","CONTACT","FROTTEMENT",((("CONTACT","METHODE","CONTRAINTE",jdc),"MCsousMCFaPourValeur"),))
@@ -316,7 +316,7 @@ def traduc(infile,outfile,flog=None):
     moveMotClefInOperToFact(jdc,"CALC_ELEM","ANGLE","REPE_COQUE")
     moveMotClefInOperToFact(jdc,"CALC_ELEM","PLAN","REPE_COQUE")
 
-    
+
     ####################### traitement EXTR_MODE #######################
     ajouteMotClefDansFacteurSiRegle(jdc,"EXTR_MODE","FILTRE_MODE","SEUIL=1.E-3", ((("FILTRE_MODE","CRIT_EXTR",),"existeMCsousMCF"),(("FILTRE_MODE","SEUIL",),"nexistepasMCsousMCF")))
 
@@ -508,7 +508,7 @@ def main():
     parser = optparse.Optionparser(usage=usage)
 
     parser.add_option('-i','--infile', dest="infile", default='toto.comm',
-        help="Le fichier Ã  traduire")
+        help="Le fichier a traduire")
     parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm',
         help="Le fichier traduit")
 
@@ -517,4 +517,3 @@ def main():
 
 if __name__ == '__main__':
     main()
-
index 96b4fd0a4cefe8aa089588021391760530a7f88f..975f4982b8ac8b38acf4d39524cc217d09c853e0 100644 (file)
@@ -85,7 +85,7 @@ def traduc(infile,outfile,flog=None):
 
     #Parse les mocles des commandes
     parseKeywords(root)
-    
+
     ####################### traitement erreurs ########################
     genereErreurPourCommande(jdc,("POST_RCCM","DEFI_MATERIAU","TEST_FICHIER","DYNA_NON_LINE","DEFI_FISS_XFEM","POST_MAIL_XFEM"))
 
@@ -204,7 +204,7 @@ def traduc(infile,outfile,flog=None):
     renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","K_VP","UN_SUR_K")
     renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","SEDVP1","ALPHA_D")
     renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","SEDVP2","BETA_D")
-    # GLRC 
+    # GLRC
     renameCommandeSiRegle(jdc,"DEFI_MATERIAU","DEFI_GLRC", ((("GLRC_DAMAGE","GLRC_ACIER",),"existeMCFParmi"),))
     #########################################################################
 
@@ -425,7 +425,7 @@ def main():
     parser = optparse.Optionparser(usage=usage)
 
     parser.add_option('-i','--infile', dest="infile", default='toto.comm',
-        help="Le fichier Ã  traduire")
+        help="Le fichier a traduire")
     parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm',
         help="Le fichier traduit")
 
@@ -434,4 +434,3 @@ def main():
 
 if __name__ == '__main__':
     main()
-
index 8dadf50498ef53b64549fc2a214fc984effc77ed..36a23e29f65ba274929b2ffd175657188407a642 100755 (executable)
@@ -37,7 +37,7 @@ from Traducteur.renamemocle  import *
 from Traducteur.inseremocle  import *
 from Traducteur.changeValeur import *
 from Traducteur.movemocle    import *
-from Traducteur.dictErreurs  import * 
+from Traducteur.dictErreurs  import *
 from Traducteur.regles import pasDeRegle
 
 atraiter=("AFFE_CARA_ELEM","AFFE_CHAR_CINE","AFFE_CHAR_MECA","AFFE_CHAR_MECA_F","AFFE_MATERIAU","AFFE_MODELE",
@@ -56,16 +56,16 @@ atraiter=("AFFE_CARA_ELEM","AFFE_CHAR_CINE","AFFE_CHAR_MECA","AFFE_CHAR_MECA_F",
 dict_erreurs={
 # STA10
 #
-             "AFFE_CHAR_MECA_CONTACT":"Attention, modification de la définition du CONTACT : nommer DEFI_CONTACT,verifier les paramètres globaux et le mettre dans le calcul",
-             "AFFE_CHAR_MECA_LIAISON_UNILATER":"Attention, modification de la définition du CONTACT : nommer DEFI_CONTACT,verifier les paramètres globaux et le mettre dans le calcul",
-             "AFFE_CHAR_MECA_F_LIAISON_UNILATER":"Attention, modification de la définition du CONTACT : nommer DEFI_CONTACT,verifier les paramètres globaux et le mettre dans le calcul",
+             "AFFE_CHAR_MECA_CONTACT":"Attention, modification de la definition du CONTACT : nommer DEFI_CONTACT,verifier les parametres globaux et le mettre dans le calcul",
+             "AFFE_CHAR_MECA_LIAISON_UNILATER":"Attention, modification de la definition du CONTACT : nommer DEFI_CONTACT,verifier les parametres globaux et le mettre dans le calcul",
+             "AFFE_CHAR_MECA_F_LIAISON_UNILATER":"Attention, modification de la definition du CONTACT : nommer DEFI_CONTACT,verifier les parametres globaux et le mettre dans le calcul",
              "AFFE_CHAR_MECA_GRAPPE_FLUIDE":"Resorption de GRAPPE_FLUIDE en version 10",
              "DEFI_MATERIAU_LMARC":"Resorption loi LMARC en version 10",
              "DEFI_MATERIAU_LMARC_FO":"Resorption loi LMARC en version 10",
              "POST_ZAC":"Resorption POST_ZAC en version 10",
              "AFFE_CHAR_MECA_ARLEQUIN":"Resorption ARLEQUIN en version 10",
-             
-             "PROJ_CHAMP_CHAM_NO":"Attention, verifier pour PROJ_CHAMP la présence de MODELE1/MAILLAGE1 et MODELE2/MAILLAGE2",
+
+             "PROJ_CHAMP_CHAM_NO":"Attention, verifier pour PROJ_CHAMP la presence de MODELE1/MAILLAGE1 et MODELE2/MAILLAGE2",
 
              "COMB_SISM_MODAL_COMB_MULT_APPUI":"Attention, verifier GROUP_APPUI pour COMB_SISM_MODAL car on est dans le cas MULTI_APPUI=DECORRELE",
 
@@ -103,7 +103,7 @@ dict_erreurs={
              "MACR_ASPIQ_CALC_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans MACR_ASPIQ_CALC",
              "SIMU_POINT_MAT_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans SIMU_POINT_MAT",
 
-             "CALC_ELEM_SENSIBILITE":"Le post-traitement SENSIBILITE est Ã  supprimer de CALC_ELEM et Ã  faire via CALC_SENSI",
+             "CALC_ELEM_SENSIBILITE":"Le post-traitement SENSIBILITE est a supprimer de CALC_ELEM et a faire via CALC_SENSI",
 
              "CALC_MISS_OPTION":"Attention, transfert MACRO_MISS_3D en CALC_MISS : utiliser un DEFI_SOL_MISS pour obtenir TABLE_SOL",
               }
@@ -132,7 +132,7 @@ def traduc(infile,outfile,flog=None):
 
 
     #####SOLVEUR
-    
+
     ####################### traitement MUMPS/PARALELLISME-PARTITION ##################
     #commandes concernes en plus : CALC_FORC_AJOU?,CALC_MATR_AJOU?
      # */SOLVEUR/CHARGE_PROCO_MA(SD)--> AFFE_MODELE (ou MODI_MODELE)/PARTITION/.
@@ -197,7 +197,7 @@ def traduc(infile,outfile,flog=None):
     removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0)
     renameMotCle(jdc,"CALC_PRECONT","INCREMENT_NEW","INCREMENT")
 
-    
+
     renameMotCleSiRegle(jdc,"DYNA_NON_LINE","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1)
     moveMCFToCommand(jdc,"DYNA_NON_LINE","INCREMENT_NEW","DEFI_LIST_INST","ECHEC")
     removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0)
@@ -210,7 +210,7 @@ def traduc(infile,outfile,flog=None):
     removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0)
     removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0)
     renameMotCle(jdc,"DYNA_NON_LINE","INCREMENT_NEW","INCREMENT")
-    
+
     renameMotCleSiRegle(jdc,"MACR_ASCOUF_CALC","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1)
     moveMCFToCommand(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","DEFI_LIST_INST","ECHEC")
     removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0)
@@ -223,7 +223,7 @@ def traduc(infile,outfile,flog=None):
     removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0)
     removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0)
     renameMotCle(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","INCREMENT")
-    
+
     renameMotCleSiRegle(jdc,"MACR_ASPIQ_CALC","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1)
     moveMCFToCommand(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","DEFI_LIST_INST","ECHEC")
     removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0)
@@ -236,7 +236,7 @@ def traduc(infile,outfile,flog=None):
     removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0)
     removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0)
     renameMotCle(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","INCREMENT")
-    
+
     renameMotCleSiRegle(jdc,"SIMU_POINT_MAT","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1)
     moveMCFToCommand(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","DEFI_LIST_INST","ECHEC")
     removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0)
@@ -247,7 +247,7 @@ def traduc(infile,outfile,flog=None):
     removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0)
     removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0)
     removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0)
-    removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0)  
+    removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0)
     renameMotCle(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","INCREMENT")
 
     removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","INST_INIT")
@@ -265,7 +265,7 @@ def traduc(infile,outfile,flog=None):
     removeMotCleInFact(jdc,"CALC_MODAL","CALC_FREQ","NPREC_SOLVEUR",pasDeRegle(),0)
     removeMotCle(jdc,"IMPR_STURM","NPREC_SOLVEUR")
     removeMotCleInFact(jdc,"MACRO_MATR_AJOU","CALC_FREQ","NPREC_SOLVEUR",pasDeRegle(),0)
-    
+
     ###################### traitement CALC_MODAL SOLVEUR ############
     removeMotCle(jdc,"CALC_MODAL","SOLVEUR",pasDeRegle())
 
@@ -289,7 +289,7 @@ def traduc(infile,outfile,flog=None):
 
     ###################  traitement AFFE_MODELE/SHB8 ##########################
     changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",{"SHB8":"SHB"})
-    
+
     ###################  traitement COMP_ELAS et COMP_INCR  DEFORMATION = GREEN ##############"
     dGREEN={"GREEN_GR":"GROT_GDEP","GREEN":"GROT_GDEP","REAC_GEOM":"GROT_GDEP","EULER_ALMANSI":"GROT_GDEP","COROTATIONNEL":"GDEF_HYPO_ELAS"}
     changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_ELAS","DEFORMATION",dGREEN)
@@ -388,7 +388,7 @@ def traduc(infile,outfile,flog=None):
 
     ################ traitement DEFI_MATERIAU/THER_HYDR #######
     removeMotCleInFact(jdc,"DEFI_MATERIAU","THER_HYDR","QSR_K")
-     
+
     ##################### traitement AFFE_CARA_ELEM/DISCRET ###############"
     dDISCRET={"K_T_N_NS":"K_T_N",  "K_T_L_NS":"K_T_L",  "K_TR_N_NS":"K_TR_N",  "K_TR_L_NS":"K_TR_L",
               "M_T_N_NS":"M_T_N",  "M_T_L_NS":"M_T_L",  "M_TR_N_NS":"M_TR_N",  "M_TR_L_NS":"M_TR_L",
@@ -403,7 +403,7 @@ def traduc(infile,outfile,flog=None):
     changementValeurDsMCF(jdc,"AFFE_CARA_ELEM","DISCRET","CARA",dDISCRET)
 
     #####CHARGEMENT
-    
+
     ####################### traitement  CONTACT ###############################################
 
 
@@ -414,13 +414,13 @@ def traduc(infile,outfile,flog=None):
     moveMCFToCommand(jdc,"AFFE_CHAR_MECA","CONTACT","DEFI_CONTACT","ZONE")
     removeMotCle(jdc,"AFFE_CHAR_MECA","CONTACT",pasDeRegle(),1)
 
-    
+
     removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","METHODE")
     ajouteMotClefDansFacteur(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","METHODE='LIAISON_UNIL'",pasDeRegle())
     copyMotClefInOperToFact(jdc,"AFFE_CHAR_MECA","MODELE","LIAISON_UNILATER")
     moveMCFToCommand(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","DEFI_CONTACT","ZONE")
     removeMotCle(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER",pasDeRegle(),1)
-    
+
     removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","METHODE")
     ajouteMotClefDansFacteur(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","METHODE='LIAISON_UNIL'",pasDeRegle())
     ajouteMotClefDansFacteur(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","FORMULATION='LIAISON_UNIL'",pasDeRegle())
@@ -441,8 +441,8 @@ def traduc(infile,outfile,flog=None):
     ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_FROT='PENALISATION'",((("METHODE","PENALISATION",jdc),"MCsousMCFcourantaPourValeur"),(("COULOMB",),"existeMCsousMCFcourant"),))
     ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT='CONTRAINTE'",((("METHODE","CONTRAINTE",jdc),"MCsousMCFcourantaPourValeur"),))
     removeMotCleInFact(jdc,"DEFI_CONTACT","ZONE","METHODE")
-    
-    
+
+
     moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","COEF_RESI")
     moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","FROTTEMENT")
     moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_CONT_MAXI")
@@ -463,7 +463,7 @@ def traduc(infile,outfile,flog=None):
     moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","NB_ITER_GEOM")
     moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","MODELE")
 
-    
+
     # FORMULATION = DEPL/VITE
     # Si EXCL_FROT_1
     # Si EXCL_FROT_2
@@ -482,9 +482,9 @@ def traduc(infile,outfile,flog=None):
     renameMotCleInFact(jdc,"AFFE_CHAR_CINE","MECA_IMPO","DCZ","DZ")
     # QUESTION Non pris en compte : AFFE_CHAR_MECA/LIAISON_DDL","DDL",Liste de valeurs avec DC*)
     # peut_etre avec changeTouteValeur ?
-    
+
     ######################### traitement COMB_SISM_MODAL APPUI #######################""
-    # attention il faut traiter d'abord DECORRELE avant CORRELE sinon CORRELE apparaît dans DECORELLE
+    # attention il faut traiter d'abord DECORRELE avant CORRELE sinon CORRELE apparait dans DECORELLE
     moveMotCleFromFactToFather(jdc,"COMB_SISM_MODAL","EXCIT","MONO_APPUI")
     moveMotCleFromFactToFather(jdc,"COMB_SISM_MODAL","EXCIT","MULTI_APPUI")
     removeMotCleInFactSiRegle(jdc,"COMB_SISM_MODAL","COMB_MULT_APPUI","TYPE_COMBI",((("MULTI_APPUI","DECORRELE",jdc),"MCaPourValeur"),))
@@ -507,7 +507,7 @@ def traduc(infile,outfile,flog=None):
 
 
     #####IMPRESSION
-    
+
     #################### traitement IMPR_RESU  #######################
     removeMotCleInFact(jdc,"IMPR_RESU","RESU","INFO_RESU")
 
@@ -629,7 +629,7 @@ def traduc(infile,outfile,flog=None):
     changementValeurDsMCF(jdc,"POST_ELEM","INTEGRALE","NOM_CHAM",dOPTION)
     changementValeurDsMCF(jdc,"POST_ELEM","MINMAX","NOM_CHAM",dOPTION)
     changementValeurDsMCF(jdc,"POST_RCCM","RESU_MECA","NOM_CHAM",dOPTION)
-    changementValeurDsMCF(jdc,"POST_RELEVE_T","ACTION","NOM_CHAM",dOPTION)    
+    changementValeurDsMCF(jdc,"POST_RELEVE_T","ACTION","NOM_CHAM",dOPTION)
     changementValeur(jdc,"PROJ_CHAMP","NOM_CHAM",dOPTION)
     changementValeurDsMCF(jdc,"PROJ_MESU_MODAL","MODELE_MESURE","NOM_CHAM",dOPTION)
     changementValeur(jdc,"RECU_FONCTION","NOM_CHAM",dOPTION)
@@ -638,7 +638,7 @@ def traduc(infile,outfile,flog=None):
     changementValeur(jdc,"REST_SPEC_PHYS","NOM_CHAM",dOPTION)
     changementValeurDsMCF(jdc,"TEST_RESU","RESU","NOM_CHAM",dOPTION)
     changementValeurDsMCF(jdc,"TEST_RESU","GENE","NOM_CHAM",dOPTION)
-    
+
     changementValeur(jdc,"CALC_CHAM_ELEM","OPTION",dOPTION)
     changementValeur(jdc,"CALC_ELEM","OPTION",dOPTION)
     changementValeur(jdc,"CALC_META","OPTION",dOPTION)
@@ -656,7 +656,7 @@ def traduc(infile,outfile,flog=None):
              "'PRES_ELNO_DBEL'", "'VARI_NOEU'")
     # Options ambigue :  PRES_ELNO_DBEL --> prac_elno/prme_elno, ERRE* --> ERME_ELNO ou ERTH_ELNO selon PHENOMENE
     # En commentaires les commandes non concernees par rOPTION
-    
+
     genereErreurValeurDsMCF(jdc,"AFFE_MATERIAU","AFFE_VARC","NOM_CHAM",rOPTION)
     #genereErreurValeur(jdc,"COMB_FOURIER","NOM_CHAM",rOPTION)
     genereErreurValeur(jdc,"CREA_CHAMP","NOM_CHAM",rOPTION)
@@ -673,7 +673,7 @@ def traduc(infile,outfile,flog=None):
     #genereErreurValeurDsMCF(jdc,"POST_RCCM","RESU_MECA","NOM_CHAM",rOPTION)
     genereErreurValeurDsMCF(jdc,"POST_ELEM","INTEGRALE","NOM_CHAM",rOPTION)
     genereErreurValeurDsMCF(jdc,"POST_ELEM","MINMAX","NOM_CHAM",rOPTION)
-    genereErreurValeurDsMCF(jdc,"POST_RELEVE_T","ACTION","NOM_CHAM",rOPTION)    
+    genereErreurValeurDsMCF(jdc,"POST_RELEVE_T","ACTION","NOM_CHAM",rOPTION)
     genereErreurValeur(jdc,"PROJ_CHAMP","NOM_CHAM",rOPTION)
     #genereErreurValeurDsMCF(jdc,"PROJ_MESU_MODAL","MODELE_MESURE","NOM_CHAM",rOPTION)
     genereErreurValeur(jdc,"RECU_FONCTION","NOM_CHAM",rOPTION)
@@ -682,7 +682,7 @@ def traduc(infile,outfile,flog=None):
     #genereErreurValeur(jdc,"REST_SPEC_PHYS","NOM_CHAM",rOPTION)
     genereErreurValeurDsMCF(jdc,"TEST_RESU","RESU","NOM_CHAM",rOPTION)
     genereErreurValeurDsMCF(jdc,"TEST_RESU","GENE","NOM_CHAM",rOPTION)
-    
+
     genereErreurValeur(jdc,"CALC_CHAM_ELEM","OPTION",rOPTION)
     genereErreurValeur(jdc,"CALC_ELEM","OPTION",rOPTION)
     #genereErreurValeur(jdc,"CALC_META","OPTION",rOPTION)
@@ -690,8 +690,8 @@ def traduc(infile,outfile,flog=None):
     #genereErreurValeur(jdc,"COMB_SISM_MODAL","OPTION",rOPTION)
     #genereErreurValeur(jdc,"MECA_STATIQUE","OPTION",rOPTION)
     genereErreurValeurDsMCF(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","OPTION",rOPTION)
-    #genereErreurValeur(jdc,"THER_NON_LINE","OPTION",rOPTION)        
-    
+    #genereErreurValeur(jdc,"THER_NON_LINE","OPTION",rOPTION)
+
     ########### Message si CALC_ELEM/SENSIBILITE
     genereErreurMCF(jdc,"CALC_ELEM","SENSIBILITE")
 
@@ -716,16 +716,16 @@ def traduc(infile,outfile,flog=None):
     for c in jdc.root.childNodes:
         if c.name != "IMPR_MACR_ELEM" : continue
         for mc in c.childNodes:
-             if mc.name == "MACR_ELEM_DYNA" : macr=mc.getText(jdc)
-             if mc.name == "GROUP_MA_INTERF": interf=mc.getText(jdc)
-             if mc.name == "AMOR_REDUIT": amor=mc.getText(jdc)
+            if mc.name == "MACR_ELEM_DYNA" : macr=mc.getText(jdc)
+            if mc.name == "GROUP_MA_INTERF": interf=mc.getText(jdc)
+            if mc.name == "AMOR_REDUIT": amor=mc.getText(jdc)
     if amor != "" : chercheOperInsereFacteur(jdc,"CALC_MISS",amor,pasDeRegle(),0)
     if interf != "" : chercheOperInsereFacteur(jdc,"CALC_MISS",interf,pasDeRegle(),0)
     if macr != "" : chercheOperInsereFacteur(jdc,"CALC_MISS",macr,pasDeRegle(),0)
 
     chercheOperInsereFacteur(jdc,"CALC_MISS","TABLE_SOL=''",pasDeRegle(),0)
     chercheOperInsereFacteur(jdc,"CALC_MISS","TYPE_RESU='FICHIER'",pasDeRegle(),0)
-    
+
     #################################################################
     f=open(outfile,'w')
     f.write(jdc.getSource())
@@ -737,7 +737,7 @@ def main():
     parser = optparse.Optionparser(usage=usage)
 
     parser.add_option('-i','--infile', dest="infile", default='toto.comm',
-        help="Le fichier Ã  traduire")
+        help="Le fichier a traduire")
     parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm',
         help="Le fichier traduit")
 
@@ -746,4 +746,3 @@ def main():
 
 if __name__ == '__main__':
     main()
-
index a8cea6c3272abe45b6aee73f39a8c3efdb2994d9..51174a6c70286a7747f55de6b538a1883896545d 100644 (file)
@@ -28,8 +28,8 @@ def indexToCoordinates(src, index):
     return x, y
 
 def lineToDict(line):
-    """Transforme une ligne (string) en un dictionnaire de mots 
-        repérés par le numéro de la colonne"""
+    """Transforme une ligne (string) en un dictionnaire de mots
+        reperes par le numero de la colonne"""
 
     words = re.split("(\w+)", line)
     h = {};i = 0
@@ -39,7 +39,7 @@ def lineToDict(line):
     return h
 
 def dictToLine(d):
-    """Transformation inverse: Ã  partir d'un dictionnaire retourne une ligne"""
+    """Transformation inverse: a partir d'un dictionnaire retourne une ligne"""
     cols = d
     cols.sort()
     return "".join([d[colno]for colno in cols])
index d3f9c5a3034b2a85b93fbee9e7f416cb07ec3ee5..c7d9db447d1085e0e3fa83f4e3ee1d84366bd2e9 100644 (file)
@@ -71,7 +71,7 @@ class KeywordFinder(MatchFinder):
             self._matches = []
             self.visit(child)
             if self._matches:
-                # Pour eviter les tuples et listes ordinaires, 
+                # Pour eviter les tuples et listes ordinaires,
                 # on ne garde que les visites fructueuses
                 matchlist.append(self._matches)
         self._matches=matchlist
diff --git a/UiQT5/GNUmakefile b/UiQT5/GNUmakefile
new file mode 100644 (file)
index 0000000..70a5762
--- /dev/null
@@ -0,0 +1,63 @@
+PYUIC = pyuic5
+QTRELEASE = lrelease
+.PHONY : all
+.SUFFIXES : .ui .py .ts .qm
+
+SHELL=bash
+
+ifdef EFICAS4VIMMP_ROOT
+srcdir?=${EFICAS4VIMMP_ROOT}
+else
+srcdir?=..
+endif
+
+confdir?=$(srcdir)/config
+tooldir=$(srcdir)/Tools
+
+# Règle en tête de Makefile
+all : $(PY_FILES) $(QM_FILES)
+
+############# ENVIRONEMENT DE CONSTRUCTION VIMMP Traning ################
+
+ifeq ($(findstring vimmp,$dir($(realpath GNUmakefile))),vimmp)
+include $(confdir)/GNUmakefile.mdm
+include $(confdir)/GNUmakefile.env
+else
+include $(confdir)/GNUmakefile.env
+endif
+
+PYXB            ?=pyxbgen
+
+#################     REGLES DE CONSTRUCTION     ########################
+
+
+PY_FILES = myMain.py desBaseWidget.py desChoixCata.py desChoixCode.py desChoixCommandes.py \
+        desChoixLangue.py desRecherche.py  desRechercheCatalogue.py\
+       desSelectVal.py desViewTexte.py desViewRegles.py desVisu.py desWidgetCreeParam.py desWidgetCommande.py \
+       desWidgetOptionnel.py Tuple2.py Tuple3.py  Tuple4.py Tuple5.py Tuple6.py Tuple7.py Tuple8.py Tuple9.py\
+       Tuple10.py desWidgetBloc.py desWidgetCB.py desWidgetCBIntoSug.py desWidgetCommentaire.py desWidgetDate.py \
+       desWidgetFact.py desWidgetFactPlie.py desWidgetFactTableau.py desWidgetFormule.py desGroupeOptionnel.py \
+       desWidgetHeure.py  desWidgetInformation.py desWidgetIntoSug.py desWidgetInactif.py \
+       desWidgetMatrice.py desWidgetParam.py desWidgetPlusieursBase.py desWidgetPlusieursInto.py \
+       desWidgetPlusieursIntoOrdonne.py desWidgetPlusieursTuple.py desWidgetRadioButton.py \
+       desWidget4a6RadioButton.py desWidgetSimpBase.py desWidgetSDCOInto.py desWidgetSimpBool.py \
+        desWidgetSimpSalome.py  desPBOptionnelMT.py desWidgetTableau.py\
+       desWidgetSimpComplexe.py desWidgetSimpFichier.py desWidgetSimpTxt.py desWidgetTuple2.py \
+        desWidgetTuple3.py desWidgetTuple4.py desWidgetTuple5.py desWidgetTuple6.py desWidgetTuple7.py \
+        desWidgetTuple8.py desWidgetTuple9.py desWidgetTuple10.py desWidgetVide.py desWidgetUniqueSDCO.py \
+        desWidgetPlusieursPlie.py desWidgetNiveauFact.py dateEtHeure.py 
+
+
+
+QM_FILES=eficas_en.qm eficas_fr.qm
+
+%.py:%.ui
+       ${PYUIC} -x -o $@ $<
+
+%.qm:%.ts
+       ${QTRELEASE}  -qm $@ $<
+
+all : $(PY_FILES) $(QM_FILES)
+clean :
+       -rm -rf $(PY_FILES) *.pyc
+
index 102166a10eba4c626f90a47a69b02204ce66bfe6..c81497844a665cb013ff881306ae1121c0bd725c 100644 (file)
@@ -28,7 +28,7 @@
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_1">
+    <widget class="LECustomTuple" name="lineEditVal1">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -66,7 +66,7 @@ border:0px;
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_2">
+    <widget class="LECustomTuple" name="lineEditVal2">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -102,7 +102,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_3">
+    <widget class="LECustomTuple" name="lineEditVal3">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -138,7 +138,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_4">
+    <widget class="LECustomTuple" name="lineEditVal4">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -174,7 +174,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_5">
+    <widget class="LECustomTuple" name="lineEditVal5">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -210,7 +210,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_6">
+    <widget class="LECustomTuple" name="lineEditVal6">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -246,7 +246,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_7">
+    <widget class="LECustomTuple" name="lineEditVal7">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -282,7 +282,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_8">
+    <widget class="LECustomTuple" name="lineEditVal8">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -318,7 +318,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_9">
+    <widget class="LECustomTuple" name="lineEditVal9">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -347,7 +347,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_10">
+    <widget class="LECustomTuple" name="lineEditVal10">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
index fb7c2ab6703138e98531dfb5f3c01ed28c680fda..9a17ce5f00605884760623574cf9fa9eea3045b6 100644 (file)
@@ -43,7 +43,7 @@
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_1">
+    <widget class="LECustomTuple" name="lineEditVal1">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -84,7 +84,7 @@ border:0px;
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_2">
+    <widget class="LECustomTuple" name="lineEditVal2">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
index 9d77748364069fb93d4c047f3ee345fc811646c1..de3d4528fc40f3e23a5af220efd0a95e81c996f8 100644 (file)
@@ -43,7 +43,7 @@
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_1">
+    <widget class="LECustomTuple" name="lineEditVal1">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -81,7 +81,7 @@ border:0px;
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_2">
+    <widget class="LECustomTuple" name="lineEditVal2">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -117,7 +117,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_3">
+    <widget class="LECustomTuple" name="lineEditVal3">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
index d551c2b8e939ce9fdc1ee59e3e40dc552c9b5e8f..e2db872854ec3f6acb458cec4260da4f2b0e1564 100644 (file)
@@ -28,7 +28,7 @@
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_1">
+    <widget class="LECustomTuple" name="lineEditVal1">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -66,7 +66,7 @@ border:0px;
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_2">
+    <widget class="LECustomTuple" name="lineEditVal2">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -102,7 +102,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_3">
+    <widget class="LECustomTuple" name="lineEditVal3">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -138,7 +138,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_4">
+    <widget class="LECustomTuple" name="lineEditVal4">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
index b301339029d898faee33de28cfde2e126e0d65b6..e8b64bfdab34238d2ac269e5538923c03ff2c9d1 100644 (file)
@@ -28,7 +28,7 @@
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_1">
+    <widget class="LECustomTuple" name="lineEditVal1">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -66,7 +66,7 @@ border:0px;
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_2">
+    <widget class="LECustomTuple" name="lineEditVal2">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -102,7 +102,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_3">
+    <widget class="LECustomTuple" name="lineEditVal3">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -138,7 +138,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_4">
+    <widget class="LECustomTuple" name="lineEditVal4">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -174,7 +174,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_5">
+    <widget class="LECustomTuple" name="lineEditVal5">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
index 192bf670fd1a23910294784c48c82fdaaacd83e8..c870ea9af5f6b8e284a781bb6d5a4eec41b2839b 100644 (file)
@@ -28,7 +28,7 @@
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_1">
+    <widget class="LECustomTuple" name="lineEditVal1">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -66,7 +66,7 @@ border:0px;
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_2">
+    <widget class="LECustomTuple" name="lineEditVal2">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -102,7 +102,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_3">
+    <widget class="LECustomTuple" name="lineEditVal3">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -138,7 +138,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_4">
+    <widget class="LECustomTuple" name="lineEditVal4">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -174,7 +174,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_5">
+    <widget class="LECustomTuple" name="lineEditVal5">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -210,7 +210,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_6">
+    <widget class="LECustomTuple" name="lineEditVal6">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
index 242b5b17e12a6a1633cae78879782a7cf82d01ef..47df62d69dbefdfa2cb4e93b610f3ec1aede350f 100644 (file)
@@ -28,7 +28,7 @@
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_1">
+    <widget class="LECustomTuple" name="lineEditVal1">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -66,7 +66,7 @@ border:0px;
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_2">
+    <widget class="LECustomTuple" name="lineEditVal2">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -102,7 +102,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_3">
+    <widget class="LECustomTuple" name="lineEditVal3">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -138,7 +138,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_4">
+    <widget class="LECustomTuple" name="lineEditVal4">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -174,7 +174,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_5">
+    <widget class="LECustomTuple" name="lineEditVal5">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -210,7 +210,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_6">
+    <widget class="LECustomTuple" name="lineEditVal6">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -246,7 +246,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_7">
+    <widget class="LECustomTuple" name="lineEditVal7">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
index 169b2608aea22ace8b5152ae71dcbe1f0140dace..b3d0f63a3157d69cec003a4a67abe7f76c1718d0 100644 (file)
@@ -28,7 +28,7 @@
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_1">
+    <widget class="LECustomTuple" name="lineEditVal1">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -66,7 +66,7 @@ border:0px;
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_2">
+    <widget class="LECustomTuple" name="lineEditVal2">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -102,7 +102,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_3">
+    <widget class="LECustomTuple" name="lineEditVal3">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -138,7 +138,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_4">
+    <widget class="LECustomTuple" name="lineEditVal4">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -174,7 +174,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_5">
+    <widget class="LECustomTuple" name="lineEditVal5">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -210,7 +210,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_6">
+    <widget class="LECustomTuple" name="lineEditVal6">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -246,7 +246,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_7">
+    <widget class="LECustomTuple" name="lineEditVal7">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -282,7 +282,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_8">
+    <widget class="LECustomTuple" name="lineEditVal8">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
index 6a7f25a14e117313baec6b47ee966c5b3522ab41..7f8e3f0341a9088a197e64439e9acae114644779 100644 (file)
@@ -40,7 +40,7 @@
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_1">
+    <widget class="LECustomTuple" name="lineEditVal1">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -78,7 +78,7 @@ border:0px;
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_2">
+    <widget class="LECustomTuple" name="lineEditVal2">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -114,7 +114,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_3">
+    <widget class="LECustomTuple" name="lineEditVal3">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -150,7 +150,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_4">
+    <widget class="LECustomTuple" name="lineEditVal4">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -186,7 +186,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_5">
+    <widget class="LECustomTuple" name="lineEditVal5">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -222,7 +222,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_6">
+    <widget class="LECustomTuple" name="lineEditVal6">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -258,7 +258,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_7">
+    <widget class="LECustomTuple" name="lineEditVal7">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -294,7 +294,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_8">
+    <widget class="LECustomTuple" name="lineEditVal8">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -330,7 +330,7 @@ border:0px;</string>
     </widget>
    </item>
    <item>
-    <widget class="LECustomTuple" name="lineEditVal_9">
+    <widget class="LECustomTuple" name="lineEditVal9">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
index 43289173739015395cc57b52d482a165c21a3f32..dc7c0593342b9bbbcc807edcffbda3befef108f4 100644 (file)
    <string notr="true"/>
   </property>
   <layout class="QGridLayout" name="gridLayout">
-   <property name="margin">
+   <property name="leftMargin">
+    <number>0</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>0</number>
+   </property>
+   <property name="bottomMargin">
     <number>0</number>
    </property>
    <item row="0" column="0">
 </string>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_2">
-       <property name="margin">
+       <property name="leftMargin">
+        <number>0</number>
+       </property>
+       <property name="topMargin">
+        <number>0</number>
+       </property>
+       <property name="rightMargin">
+        <number>0</number>
+       </property>
+       <property name="bottomMargin">
         <number>0</number>
        </property>
       </layout>
      </widget>
      <widget class="QWidget" name="widgetCentrale" native="true">
       <layout class="QVBoxLayout" name="widgetCentraleLayout">
-       <property name="margin">
+       <property name="leftMargin">
+        <number>0</number>
+       </property>
+       <property name="topMargin">
+        <number>0</number>
+       </property>
+       <property name="rightMargin">
+        <number>0</number>
+       </property>
+       <property name="bottomMargin">
         <number>0</number>
        </property>
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
       </layout>
      </widget>
     </widget>
index f9a8b15a01e8540acf33e57ac59a9c341ad5faa4..8a0f4d8bbe631282554666b8df0e7e00d24e5580 100644 (file)
@@ -25,7 +25,7 @@
   <property name="maximumSize">
    <size>
     <width>16777215</width>
-    <height>16777215</height>
+    <height>160</height>
    </size>
   </property>
   <property name="windowTitle">
index b4d801dc97329ed612754e5f7c296c190d8469b7..d47cef8960513b215a1c92841d2e3dce2c47abf5 100644 (file)
              <string>...</string>
             </property>
             <property name="icon">
-             <iconset theme="remove"/>
+             <iconset theme="remove">
+              <normaloff>.</normaloff>.</iconset>
             </property>
             <property name="iconSize">
              <size>
              <string>...</string>
             </property>
             <property name="icon">
-             <iconset theme="add"/>
+             <iconset theme="add">
+              <normaloff>.</normaloff>.</iconset>
             </property>
             <property name="iconSize">
              <size>
              <string>...</string>
             </property>
             <property name="icon">
-             <iconset theme="find"/>
+             <iconset theme="find">
+              <normaloff>.</normaloff>.</iconset>
             </property>
             <property name="iconSize">
              <size>
        </item>
       </layout>
      </item>
+     <item>
+      <widget class="QLabel" name="lineEditUnite">
+       <property name="text">
+        <string>TextLabel</string>
+       </property>
+      </widget>
+     </item>
      <item>
       <spacer name="verticalSpacer_6">
        <property name="orientation">
index a77932397e0b63382d40f2e88cabd27804d42020..7c684a7e42fa153c5ecd5e88e9e1aa56b1866551 100644 (file)
   <property name="minimumSize">
    <size>
     <width>0</width>
-    <height>200</height>
+    <height>100</height>
    </size>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
   <layout class="QHBoxLayout" name="horizontalLayout_2">
+   <property name="leftMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>0</number>
+   </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
      <property name="spacing">
             </property>
             <property name="icon">
              <iconset theme="find">
-              <normaloff/>
-             </iconset>
+              <normaloff>.</normaloff>.</iconset>
             </property>
             <property name="iconSize">
              <size>
           <x>0</x>
           <y>0</y>
           <width>300</width>
-          <height>129</height>
+          <height>143</height>
          </rect>
         </property>
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <layout class="QGridLayout" name="gridLayout_2">
-         <property name="horizontalSpacing">
+         <property name="leftMargin">
+          <number>0</number>
+         </property>
+         <property name="topMargin">
           <number>0</number>
          </property>
-         <property name="margin">
+         <property name="rightMargin">
+          <number>0</number>
+         </property>
+         <property name="bottomMargin">
+          <number>0</number>
+         </property>
+         <property name="horizontalSpacing">
           <number>0</number>
          </property>
          <item row="0" column="0">
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>465</width>
+        <width>474</width>
         <height>308</height>
        </rect>
       </property>
        <property name="spacing">
         <number>0</number>
        </property>
-       <property name="margin">
+       <property name="leftMargin">
+        <number>0</number>
+       </property>
+       <property name="topMargin">
+        <number>0</number>
+       </property>
+       <property name="rightMargin">
+        <number>0</number>
+       </property>
+       <property name="bottomMargin">
         <number>0</number>
        </property>
        <item>
index 1b4ccfbf7531c5969ef1e7d6649900a497a2316c..c2aefeabcf192de5d4855e0ccff0f101de093b35 100644 (file)
    <string>Form</string>
   </property>
   <layout class="QHBoxLayout" name="horizontalLayout_2">
+   <property name="leftMargin">
+    <number>0</number>
+   </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_5">
+     <property name="spacing">
+      <number>0</number>
+     </property>
      <item>
       <layout class="QVBoxLayout" name="verticalLayout_2">
        <property name="spacing">
             <rect>
              <x>0</x>
              <y>0</y>
-             <width>270</width>
+             <width>279</width>
              <height>307</height>
             </rect>
            </property>
            <string>...</string>
           </property>
           <property name="icon">
-           <iconset theme="find"/>
+           <iconset theme="find">
+            <normaloff>.</normaloff>.</iconset>
           </property>
           <property name="iconSize">
            <size>
       </layout>
      </item>
      <item>
-      <widget class="QPushButton" name="PBValideFeuille">
+      <widget class="QLabel" name="lineEditUnite">
        <property name="text">
-        <string>Valide</string>
+        <string>TextLabel</string>
        </property>
       </widget>
      </item>
        </property>
       </spacer>
      </item>
+     <item>
+      <widget class="QPushButton" name="PBValideFeuille">
+       <property name="text">
+        <string>Valide</string>
+       </property>
+      </widget>
+     </item>
     </layout>
    </item>
   </layout>
index 60c7dce52c33d88302b4e8a1c90811aecd4c0c6d..1169925d666f2818179d05155de43e78fb2eab3c 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>743</width>
-    <height>60</height>
+    <width>613</width>
+    <height>56</height>
    </rect>
   </property>
   <property name="sizePolicy">
        <item>
         <widget class="QLineEdit" name="lineEditVal">
          <property name="sizePolicy">
-          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
@@ -199,7 +199,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <spacer name="horizontalSpacer_4">
+        <spacer name="horizontalSpacer">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
@@ -208,23 +208,68 @@ border:0px;</string>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
-           <width>3</width>
+           <width>5</width>
            <height>20</height>
           </size>
          </property>
         </spacer>
        </item>
+       <item>
+        <widget class="QLabel" name="lineEditUnite">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>TextLabel</string>
+         </property>
+        </widget>
+       </item>
        <item>
         <spacer name="horizontalSpacer_2">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
          <property name="sizeType">
-          <enum>QSizePolicy::Expanding</enum>
+          <enum>QSizePolicy::Minimum</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
-           <width>58</width>
+           <width>5</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="checkBoxUQ">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="toolTip">
+          <string>Active le parametre comme variable UQ</string>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_4">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>3</width>
            <height>20</height>
           </size>
          </property>
index 4e9db7e612d7752fc5019aa0bf84bb13309ce2a7..5d21e1560f522c7262b3db0aee571d90c1c47f5e 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>1242</width>
-    <height>87</height>
+    <width>940</width>
+    <height>97</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -45,13 +45,13 @@ border:0px;
     <number>0</number>
    </property>
    <property name="topMargin">
-    <number>1</number>
+    <number>0</number>
    </property>
    <property name="rightMargin">
     <number>0</number>
    </property>
    <property name="bottomMargin">
-    <number>1</number>
+    <number>0</number>
    </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -178,74 +178,6 @@ border:0px;
      </property>
      <layout class="QGridLayout" name="gridLayout">
       <item row="0" column="0">
-       <layout class="QHBoxLayout" name="horizontalLayout_4">
-        <item>
-         <widget class="QLabel" name="label_2">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="minimumSize">
-           <size>
-            <width>0</width>
-            <height>29</height>
-           </size>
-          </property>
-          <property name="maximumSize">
-           <size>
-            <width>16777215</width>
-            <height>29</height>
-           </size>
-          </property>
-          <property name="text">
-           <string>Complexe : a+bj</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_2">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>19</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLineEdit" name="LEComp">
-        <property name="frame">
-         <bool>false</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <widget class="QLabel" name="label_3">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>50</width>
-          <height>24</height>
-         </size>
-        </property>
-        <property name="text">
-         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;OU &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="2">
        <layout class="QHBoxLayout" name="horizontalLayout_2">
         <property name="leftMargin">
          <number>4</number>
@@ -269,7 +201,7 @@ border:0px;
         </item>
        </layout>
       </item>
-      <item row="1" column="2">
+      <item row="1" column="0">
        <layout class="QHBoxLayout" name="horizontalLayout_3">
         <item>
          <widget class="QLineEdit" name="LEReel">
@@ -300,22 +232,59 @@ border:0px;
         </item>
        </layout>
       </item>
-      <item row="1" column="1">
-       <spacer name="verticalSpacer_3">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>17</width>
-          <height>20</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
      </layout>
     </widget>
    </item>
+   <item>
+    <spacer name="horizontalSpacer_2">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>10</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
+    <widget class="MonLabelClic" name="lineEditUnite">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize">
+      <size>
+       <width>25</width>
+       <height>25</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>178</width>
+       <height>16777215</height>
+      </size>
+     </property>
+     <property name="frameShape">
+      <enum>QFrame::NoFrame</enum>
+     </property>
+     <property name="text">
+      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;aaa&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+     </property>
+     <property name="scaledContents">
+      <bool>false</bool>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     </property>
+    </widget>
+   </item>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_3">
      <item>
@@ -380,8 +349,6 @@ border:0px;
   </customwidget>
  </customwidgets>
  <tabstops>
-  <tabstop>LEComp</tabstop>
-  <tabstop>RBRI</tabstop>
   <tabstop>RBMP</tabstop>
   <tabstop>RBPoubelle</tabstop>
  </tabstops>
index e3c047107aa5035798ca0638c0ac2039e6705b71..ef748cf48cd6f68a09017ea545aeb8275687a7c6 100644 (file)
    </item>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout">
+     <property name="topMargin">
+      <number>2</number>
+     </property>
+     <property name="bottomMargin">
+      <number>2</number>
+     </property>
      <item>
       <layout class="QHBoxLayout" name="horizontalLayout">
        <item>
@@ -276,7 +282,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_4">
+        <widget class="QLineEdit" name="lineEditVal4">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -312,7 +318,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_5">
+        <widget class="QLineEdit" name="lineEditVal5">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -348,7 +354,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_6">
+        <widget class="QLineEdit" name="lineEditVal6">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -384,7 +390,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_8">
+        <widget class="QLineEdit" name="lineEditVal8">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -420,7 +426,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_7">
+        <widget class="QLineEdit" name="lineEditVal7">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -456,7 +462,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_9">
+        <widget class="QLineEdit" name="lineEditVal9">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -498,6 +504,45 @@ border:0px;</string>
          </property>
         </widget>
        </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="lineEditUnite">
+         <property name="text">
+          <string>TextLabel</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_4">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
        <item>
         <spacer name="horizontalSpacer">
          <property name="orientation">
@@ -579,11 +624,6 @@ border:0px;</string>
    <extends>QLabel</extends>
    <header>monLabelClic.h</header>
   </customwidget>
-  <customwidget>
-   <class>LECustomTuple</class>
-   <extends>QLineEdit</extends>
-   <header>gereListe.h</header>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
index 9c45154bb6192029e38e01425efafa66a6c9496a..d540c45782f5869744f7b5e5f0f433eaba79b6b5 100644 (file)
     <number>0</number>
    </property>
    <property name="topMargin">
-    <number>1</number>
+    <number>2</number>
    </property>
    <property name="rightMargin">
     <number>0</number>
    </property>
    <property name="bottomMargin">
-    <number>1</number>
+    <number>2</number>
    </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -261,7 +261,27 @@ border:0px;</string>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
-           <width>58</width>
+           <width>5</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="lineEditUnite">
+         <property name="text">
+          <string>TextLabel</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>80</width>
            <height>20</height>
           </size>
          </property>
@@ -315,7 +335,7 @@ border:0px;</string>
        <property name="sizeHint" stdset="0">
         <size>
          <width>20</width>
-         <height>5</height>
+         <height>13</height>
         </size>
        </property>
       </spacer>
index a31e9b551f0e8416ec4aaf3a00d36c60bfbb09b3..3e0fc3c21e194ba4e5cc11060ab8fe588ecbe44a 100644 (file)
     <number>1</number>
    </property>
    <property name="topMargin">
-    <number>0</number>
+    <number>2</number>
    </property>
    <property name="rightMargin">
     <number>0</number>
    </property>
    <property name="bottomMargin">
-    <number>1</number>
+    <number>2</number>
    </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -275,6 +275,29 @@ border:0px;</string>
          </property>
         </widget>
        </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="lineEditUnite">
+         <property name="text">
+          <string>TextLabel</string>
+         </property>
+        </widget>
+       </item>
        <item>
         <spacer name="horizontalSpacer">
          <property name="orientation">
index c939a9fbcd2a2f575c26ae9ae76102860e3e8c13..ef4d83ccd145fe8f49b37108a361c5bb0896118c 100644 (file)
     <number>1</number>
    </property>
    <property name="topMargin">
-    <number>0</number>
+    <number>2</number>
    </property>
    <property name="rightMargin">
     <number>0</number>
    </property>
    <property name="bottomMargin">
-    <number>1</number>
+    <number>2</number>
    </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -276,7 +276,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_4">
+        <widget class="QLineEdit" name="lineEditVal4">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -311,6 +311,29 @@ border:0px;</string>
          </property>
         </widget>
        </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="lineEditUnite">
+         <property name="text">
+          <string>TextLabel</string>
+         </property>
+        </widget>
+       </item>
        <item>
         <spacer name="horizontalSpacer">
          <property name="orientation">
@@ -392,11 +415,6 @@ border:0px;</string>
    <extends>QLabel</extends>
    <header>monLabelClic.h</header>
   </customwidget>
-  <customwidget>
-   <class>LECustomTuple</class>
-   <extends>QLineEdit</extends>
-   <header>gereListe.h</header>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
index c592ac6d34a6f20920e5fe87f7cfe4530dde58e7..b687f748776b54d6d78ecc123164f1a7b911f794 100644 (file)
     <number>1</number>
    </property>
    <property name="topMargin">
-    <number>0</number>
+    <number>2</number>
    </property>
    <property name="rightMargin">
     <number>0</number>
    </property>
    <property name="bottomMargin">
-    <number>1</number>
+    <number>2</number>
    </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -276,7 +276,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_4">
+        <widget class="QLineEdit" name="lineEditVal4">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -312,7 +312,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_5">
+        <widget class="QLineEdit" name="lineEditVal5">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -347,6 +347,29 @@ border:0px;</string>
          </property>
         </widget>
        </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="lineEditUnite">
+         <property name="text">
+          <string>TextLabel</string>
+         </property>
+        </widget>
+       </item>
        <item>
         <spacer name="horizontalSpacer">
          <property name="orientation">
@@ -428,11 +451,6 @@ border:0px;</string>
    <extends>QLabel</extends>
    <header>monLabelClic.h</header>
   </customwidget>
-  <customwidget>
-   <class>LECustomTuple</class>
-   <extends>QLineEdit</extends>
-   <header>gereListe.h</header>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
index 92aac0af60b1931494a6128965ec3efcb1afbb55..b90b6fb10f5f46f292002fa5838126a3c45f4c67 100644 (file)
     <number>1</number>
    </property>
    <property name="topMargin">
-    <number>0</number>
+    <number>2</number>
    </property>
    <property name="rightMargin">
     <number>0</number>
    </property>
    <property name="bottomMargin">
-    <number>1</number>
+    <number>2</number>
    </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -276,7 +276,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_4">
+        <widget class="QLineEdit" name="lineEditVal4">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -312,7 +312,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_5">
+        <widget class="QLineEdit" name="lineEditVal5">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -348,7 +348,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_6">
+        <widget class="QLineEdit" name="lineEditVal6">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -383,6 +383,29 @@ border:0px;</string>
          </property>
         </widget>
        </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="lineEditUnite">
+         <property name="text">
+          <string>TextLabel</string>
+         </property>
+        </widget>
+       </item>
        <item>
         <spacer name="horizontalSpacer">
          <property name="orientation">
@@ -464,11 +487,6 @@ border:0px;</string>
    <extends>QLabel</extends>
    <header>monLabelClic.h</header>
   </customwidget>
-  <customwidget>
-   <class>LECustomTuple</class>
-   <extends>QLineEdit</extends>
-   <header>gereListe.h</header>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
index 43b719de6f95c990e6d02cce70fa8ec52177e98e..cb871f51727d00c36e50f0f044aeda01593fa827 100644 (file)
     <number>1</number>
    </property>
    <property name="topMargin">
-    <number>0</number>
+    <number>2</number>
    </property>
    <property name="rightMargin">
     <number>0</number>
    </property>
    <property name="bottomMargin">
-    <number>1</number>
+    <number>2</number>
    </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -276,7 +276,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_4">
+        <widget class="QLineEdit" name="lineEditVal4">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -312,7 +312,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_5">
+        <widget class="QLineEdit" name="lineEditVal5">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -348,7 +348,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_6">
+        <widget class="QLineEdit" name="lineEditVal6">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -384,7 +384,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_7">
+        <widget class="QLineEdit" name="lineEditVal7">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -432,6 +432,42 @@ border:0px;</string>
          </property>
         </spacer>
        </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="lineEditUnite">
+         <property name="text">
+          <string>TextLabel</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_4">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
        <item>
         <widget class="QToolButton" name="RBPoubelle">
          <property name="minimumSize">
@@ -500,11 +536,6 @@ border:0px;</string>
    <extends>QLabel</extends>
    <header>monLabelClic.h</header>
   </customwidget>
-  <customwidget>
-   <class>LECustomTuple</class>
-   <extends>QLineEdit</extends>
-   <header>gereListe.h</header>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
index 6cbb52dd943a7ea1ae8cb6e9c629f87991bfc059..a7c44b12f23a3da025c4339d326bc84cfb3fa33f 100644 (file)
     <number>1</number>
    </property>
    <property name="topMargin">
-    <number>0</number>
+    <number>2</number>
    </property>
    <property name="rightMargin">
     <number>0</number>
    </property>
    <property name="bottomMargin">
-    <number>1</number>
+    <number>2</number>
    </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -276,7 +276,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_4">
+        <widget class="QLineEdit" name="lineEditVal4">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -312,7 +312,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_5">
+        <widget class="QLineEdit" name="lineEditVal5">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -348,7 +348,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_6">
+        <widget class="QLineEdit" name="lineEditVal6">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -384,7 +384,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_8">
+        <widget class="QLineEdit" name="lineEditVal8">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -420,7 +420,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_7">
+        <widget class="QLineEdit" name="lineEditVal7">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -455,6 +455,22 @@ border:0px;</string>
          </property>
         </widget>
        </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
        <item>
         <spacer name="horizontalSpacer">
          <property name="orientation">
@@ -468,6 +484,29 @@ border:0px;</string>
          </property>
         </spacer>
        </item>
+       <item>
+        <widget class="QLabel" name="lineEditUnite">
+         <property name="text">
+          <string>TextLabel</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_4">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
        <item>
         <widget class="QToolButton" name="RBPoubelle">
          <property name="minimumSize">
@@ -536,11 +575,6 @@ border:0px;</string>
    <extends>QLabel</extends>
    <header>monLabelClic.h</header>
   </customwidget>
-  <customwidget>
-   <class>LECustomTuple</class>
-   <extends>QLineEdit</extends>
-   <header>gereListe.h</header>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
index 7dde54399b823ffa10a3ada415ec5fbb4427fa09..87644824dc1e34b69760aab8e52264b8320a1907 100644 (file)
     <number>0</number>
    </property>
    <property name="leftMargin">
-    <number>1</number>
+    <number>0</number>
    </property>
    <property name="topMargin">
-    <number>0</number>
+    <number>2</number>
    </property>
    <property name="rightMargin">
     <number>0</number>
    </property>
    <property name="bottomMargin">
-    <number>1</number>
+    <number>2</number>
    </property>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -276,7 +276,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_4">
+        <widget class="QLineEdit" name="lineEditVal4">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -312,7 +312,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_5">
+        <widget class="QLineEdit" name="lineEditVal5">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -348,7 +348,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_6">
+        <widget class="QLineEdit" name="lineEditVal6">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -384,7 +384,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_8">
+        <widget class="QLineEdit" name="lineEditVal8">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -420,7 +420,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_7">
+        <widget class="QLineEdit" name="lineEditVal7">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -456,7 +456,7 @@ border:0px;</string>
         </widget>
        </item>
        <item>
-        <widget class="LECustomTuple" name="lineEditVal_9">
+        <widget class="QLineEdit" name="lineEditVal9">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -491,6 +491,45 @@ border:0px;</string>
          </property>
         </widget>
        </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="lineEditUnite">
+         <property name="text">
+          <string>TextLabel</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_4">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>10</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
        <item>
         <spacer name="horizontalSpacer">
          <property name="orientation">
@@ -572,11 +611,6 @@ border:0px;</string>
    <extends>QLabel</extends>
    <header>monLabelClic.h</header>
   </customwidget>
-  <customwidget>
-   <class>LECustomTuple</class>
-   <extends>QLineEdit</extends>
-   <header>gereListe.h</header>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
index 0a2416b51d5382bd67f1028e55ac57d580a6a87e..1ab63f61e8c6d7bbe5b4919e9245ad3e344d7ff8 100644 (file)
@@ -524,10 +524,8 @@ ask eficas team
     </message>
     <message>
         <location filename="Ihm/I_MACRO_ETAPE.py" line="1195"/>
-        <source>Ce fichier ne sera pas pris en compte
- %s</source>
-        <translation>the file is ignored
-%s</translation>
+        <source>Ce fichier ne sera pas pris en compte</source>
+        <translation>the file is ignored</translation>
     </message>
     <message>
         <location filename="Ihm/I_MACRO_ETAPE.py" line="735"/>
index f923d94cac8287976e61b25635fcdbe071760117..31f48bb064bb073de73c27a9f932ec90c56b173a 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -21,8 +21,8 @@
 
 
 from __future__ import absolute_import
-try : 
-   from builtins import object
+try :
+    from builtins import object
 except : pass
 
 class AU_MOINS_UN(object):
index 4ce96d53967ad524ecc74c53f058dbb132597314..2bb1f303ec6a62c4f159aac9f0385258e52a6700 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -19,8 +19,8 @@
 
 
 from __future__ import absolute_import
-try : 
-   from builtins import object
+try :
+    from builtins import object
 except : pass
 
 class AU_PLUS_UN(object):
index 5c6bc8e9a5924386eb2f9ab3bc8ba4a79a22c5b1..5f417fc47cd47bc0ddefe8fd1d1895ce8da1b9a8 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
 from __future__ import print_function
 from __future__ import absolute_import
 try :
-  from builtins import str
-  from builtins import object
-except : 
-  pass
+    from builtins import str
+    from builtins import object
+except :
+    pass
 
 class A_CLASSER(object):
 
index 2120ad0c07ca3c3cabccec6127c7195557185caa..b8dd83fcdde9e32124bf17561805a0e72b2ca28f 100644 (file)
@@ -21,8 +21,8 @@
 
 
 from __future__ import absolute_import
-try : 
-   from builtins import object
+try :
+    from builtins import object
 except : pass
 
 class ENSEMBLE(object):
index 75479958a197bf571a56b3dd9c7470c3e32e3691..2d3d2b5251c00c828132791351397589eedbbed9 100644 (file)
@@ -1,6 +1,6 @@
 # coding=utf-8
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -114,14 +114,22 @@ class ETAPE(V_MCCOMPO.MCCOMPO):
             - produire un compte-rendu : self.cr
 
         """
-        if CONTEXT.debug:
-            print(("ETAPE.isValid ", self.nom))
+        #if CONTEXT.debug:
+        #if 1 :
+        #   print(("ETAPE.isValid ", self.nom, self.state))
+        #   import traceback
+        #   traceback.print_stack()
         if self.state == 'unchanged':
             return self.valid
         else:
             valid = self.validChild()
             valid = valid * self.validRegles(cr)
-
+            if cr == 'oui' :
+                if not hasattr(self,'cr') :
+                    from Noyau.N_CR import CR
+                    self.cr=CR()
+                else :
+                    self.cr.purge()
             if self.reste_val != {}:
                 if cr == 'oui':
                     self.cr.fatal(
index 79431fe1d0a867ee9b560c8098781f0ce9bec2c2..ba1d6fc6fe253a894984f4fd954a97efd69b2d12 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -21,8 +21,8 @@
 
 
 from __future__ import absolute_import
-try : 
-   from builtins import object
+try :
+    from builtins import object
 except : pass
 
 class EXCLUS(object):
index 8cc88484d57ec6c082e41bd94a19032c6097c1f2..23bfa89f4dc718ba5897691a45c2ccc125d2c1ca 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
index f389055520921547fb82e6b05028fbb42ce6aae8..7b8e0a9e764f8c658abc55af653a34cbdb008705 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
index 5741e579cf9c38a0f4ff91902f99cffe068b8e42..dad07df4dfb2a62c2385bfc956152f1575eb637f 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
index d1cc11137e5773c4fdece805c7dc299cfd90281e..7653734ed27a0e818bb5d0d54adebfff7514d3b2 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -28,8 +28,8 @@ from __future__ import print_function
 # Modules Python
 from __future__ import absolute_import
 try :
-  from builtins import str
-  from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 
 import os
index 97698e7755e8de5bb6a67c3615ab25d85e2f5e2b..0567294efeb6ba71060493a65a6526e210d32cf0 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
index ec5b2d98b1a2a803082d607379aaf8114cf3fd8e..875c741decad46cbc589d5c0b98fab5d76d08014 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -31,8 +31,8 @@
 # Modules Python
 from __future__ import print_function
 from __future__ import absolute_import
-try : 
-  from builtins import object
+try :
+    from builtins import object
 except : pass
 
 import traceback
index 00694c950c523af446f8165b0b0996a1dff8fb1f..49df4914b59ee209bc1c1c057253266ef4b76796 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -30,8 +30,8 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 import traceback
 
@@ -57,6 +57,7 @@ class MCSIMP(object):
 
            - Est il indispensable de faire l'evaluation de la valeur dans le contexte
              du jdc dans cette classe.
+             oui surtout pour les filtres et les validateurs
 
            - Ne pourrait on pas doter les objets en presence des methodes suffisantes
              pour eviter les tests un peu particuliers sur GEOM, PARAMETRE et autres. J'ai
@@ -113,10 +114,10 @@ class MCSIMP(object):
             # Ajout PN
             # Pour tenir compte des Tuples
             if hasattr(self.definition.type[0],'ntuple') :
-               try :
-                  if (not (type(lval[0]) is tuple)) and (not (type(lval[0]) is list)) : lval=(lval,)
-               except :
-                  pass
+                try :
+                    if (not (type(lval[0]) is tuple)) and (not (type(lval[0]) is list)) : lval=(lval,)
+                except :
+                    pass
             if lval is None:
                 valid = 0
                 if cr == 'oui':
index 9431bf2fa7693998d608e312158ce146d3ce12b6..feb49dc63a87d75a0ced786637777c3090b1f0d5 100644 (file)
@@ -1,6 +1,6 @@
 # coding=utf-8
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -19,8 +19,8 @@
 
 
 from __future__ import absolute_import
-try : 
-   from builtins import object
+try :
+    from builtins import object
 except : pass
 
 class MEME_NOMBRE(object):
index 59a93bcad449a2aad6e8fe661fec782a95a511e7..cf8cc210bf6a6c636d27a509bab8369c2988345f 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -22,7 +22,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import object
+    from builtins import object
 except : pass
 
 class PRESENT_ABSENT(object):
index 1537863462f6fe340cebce543efa9728a6efbefa..fe839d9e49de6a0aef7db6d3cc002cc5fd60e504 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -21,8 +21,8 @@
 
 
 from __future__ import absolute_import
-try : 
-   from builtins import object
+try :
+    from builtins import object
 except : pass
 
 class PRESENT_PRESENT(object):
index edd5b1388e773a894cc0b6cd6b91aa9cc17a6e42..63e55b76abd601e910e329f0635ee301e426cc3c 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -65,7 +65,10 @@ class PROC_ETAPE(V_ETAPE.ETAPE):
             valid = self.validChild()
             valid = valid * self.validRegles(cr)
             if self.reste_val != {}:
-                if cr == 'oui':
+                if not hasattr(self,'cr') :
+                    from Noyau.N_CR import CR
+                    self.cr=CR()
+                if  cr == 'oui':
                     self.cr.fatal(
                         tr("unknown keywords : %s") % ','.join(list(self.reste_val.keys())))
                 valid = 0
index dda549f11f45a5e4a7c5373f2f9752dbf8820f0c..2b7780e53f76ca1159a5ad8f524ce847fe4a7dae 100644 (file)
@@ -1,7 +1,7 @@
 # coding=utf-8
 # person_in_charge: mathieu.courtois at edf.fr
 # ======================================================================
-# COPYRIGHT (C) 1991 - 2017  EDF R&D                  WWW.CODE-ASTER.ORG
+# COPYRIGHT (C) 2007-2021  EDF R&D                  
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
@@ -21,8 +21,8 @@
 
 
 from __future__ import absolute_import
-try : 
-   from builtins import object
+try :
+    from builtins import object
 except : pass
 
 class UN_PARMI(object):
index 5e849d2898de8d8ec09646cd7da213ea0b5832a5..b743c777c4eb507f972df157c5f450827c14e9d5 100644 (file)
@@ -18,8 +18,8 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-   Ce package contient la fonctionnalité de validation des objets de type OBJECT. 
+   Ce package contient la fonctionnalité de validation des objets de type OBJECT.
    Cette fonctionnalité est implémentée sous la forme de classes de type MIXIN qui
-   doivent etre combinées aux classes de bases de Noyau par héritage multiple dans 
+   doivent etre combinées aux classes de bases de Noyau par héritage multiple dans
    un troisième package, en général, Accas.
 """
index 08f74e6cb41e28e899af37fa59889e84e23bbaef..a4dadfdd77c5d997a7ce914d07ceca0f2f3b55bc 100644 (file)
@@ -13,33 +13,33 @@ monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stab
          }\r
 \r
 class Tuple:\r
-  def __init__(self,ntuple):\r
-    self.ntuple=ntuple\r
+    def __init__(self,ntuple):\r
+        self.ntuple=ntuple\r
 \r
-  def __convert__(self,valeur):\r
-    if type(valeur) == types.StringType: return None\r
-    if len(valeur) != self.ntuple: return None\r
-    return valeur\r
+    def __convert__(self,valeur):\r
+        if type(valeur) == types.StringType: return None\r
+        if len(valeur) != self.ntuple: return None\r
+        return valeur\r
 \r
-  def info(self):\r
-    return "Tuple de %s elements" % self.ntuple\r
+    def info(self):\r
+        return "Tuple de %s elements" % self.ntuple\r
 \r
-  __repr__=info\r
-  __str__=info\r
+    __repr__=info\r
+    __str__=info\r
 \r
 #class ObjetUtilisateur(ASSD): pass\r
 \r
 class classeVisuEquation :\r
-   def __init__(self,dicoListeAffiche, listEquation, listModele,listPostTraitement):\r
-      self.dicoListeAffiche=dicoListeAffiche\r
-      self.listEquation=listEquation\r
-      self.listModele=listModele\r
-      self.listPostTraitement=listPostTraitement\r
-   \r
+    def __init__(self,dicoListeAffiche, listEquation, listModele,listPostTraitement):\r
+        self.dicoListeAffiche=dicoListeAffiche\r
+        self.listEquation=listEquation\r
+        self.listModele=listModele\r
+        self.listPostTraitement=listPostTraitement\r
+\r
 \r
 def maFunc():\r
     return ('a1','a2','a3')\r
-     \r
+\r
 def maFuncWithArg(monMC):\r
     if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
     monMC.dsMaFunct = True\r
@@ -50,9 +50,9 @@ def maFuncWithArg(monMC):
 \r
     change=editor.changeIntoDefMC('AGING', ('Equation', 'b_approved','b_type_creation','Equation_Modification','Type2'), monInto )\r
     if change :\r
-       print ('j ai change le into')\r
-       editor.reCalculeValiditeMCApresChgtInto('AGING', 'Type2', ('Equation', 'b_approved','b_type_creation','Equation_Modification')) \r
-       if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
+        print ('j ai change le into')\r
+        editor.reCalculeValiditeMCApresChgtInto('AGING', 'Type2', ('Equation', 'b_approved','b_type_creation','Equation_Modification'))\r
+        if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
 \r
     monMC.dsMaFunct = False\r
 \r
@@ -64,7 +64,7 @@ def recupereDicoGenerique(monMC):
     if valeurDB == None : valeurDB=editor.getValeur('Modele','Modele_DB',())\r
     correspond=pckdb.DBRENAME\r
     if valeurDB != None :\r
-       listEquation, listModele,listPostTraitement=pckdb.read_pckdb(correspond[valeurDB])\r
+        listEquation, listModele,listPostTraitement=pckdb.read_pckdb(correspond[valeurDB])\r
     monMC.dsMaFunct = False\r
     return listEquation, listModele,listPostTraitement\r
 \r
@@ -76,7 +76,7 @@ def recupereDicoEquation(monMC):
     valeurEquationListe=editor.getValeur('Equation','Equation_Liste',('b_type_show',))\r
     valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_reaction_type',))\r
     if valeurAgingType == None :\r
-       valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_aging_type',))\r
+        valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_aging_type',))\r
     if valeurAgingType == None : monMC.dsMaFunct = False; return\r
 \r
     listeEquationPourIhm = []\r
@@ -84,19 +84,19 @@ def recupereDicoEquation(monMC):
     dicoListeAffiche={}\r
     for equation in listEquation :\r
         if valeurEquationListe == 'aging_type' :\r
-           if equation.type_vieil == valeurAgingType : \r
-              listeEquationPourIhm.append(equation)\r
-              listeReprEquationPourIhm.append(equation.representation)\r
-              dicoListeAffiche[equation.representation]=equation\r
+            if equation.type_vieil == valeurAgingType :\r
+                listeEquationPourIhm.append(equation)\r
+                listeReprEquationPourIhm.append(equation.representation)\r
+                dicoListeAffiche[equation.representation]=equation\r
         else:\r
-           if equation.type_react == valeurAgingType : \r
-              listeEquationPourIhm.append(equation)\r
-              listeReprEquationPourIhm.append(equation.representation)\r
-              dicoListeAffiche[equation.representation]=equation\r
+            if equation.type_react == valeurAgingType :\r
+                listeEquationPourIhm.append(equation)\r
+                listeReprEquationPourIhm.append(equation.representation)\r
+                dicoListeAffiche[equation.representation]=equation\r
     change=editor.changeIntoDefMC('Equation', ('b_type_show','ListeEquation'), listeReprEquationPourIhm )\r
     if change :\r
-       editor.reCalculeValiditeMCApresChgtInto('Equation', 'listeEquation', ('b_type_show',)) \r
-       if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
+        editor.reCalculeValiditeMCApresChgtInto('Equation', 'listeEquation', ('b_type_show',))\r
+        if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
     editor.maClasseVisuEquation = classeVisuEquation(dicoListeAffiche,listEquation, listModele,listPostTraitement)\r
     monMC.dsMaFunct = False\r
 \r
@@ -104,12 +104,12 @@ def afficheValeurEquation(monMC):
     if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
     editor=monMC.jdc.editor\r
     valeur=monMC.valeur\r
-    if valeur == None : \r
-       monMC.dsMaFunct = False\r
-       return\r
+    if valeur == None :\r
+        monMC.dsMaFunct = False\r
+        return\r
     editor.maClasseVisuEquation.valeurEquationChoisie=valeur\r
     monMC.dsMaFunct = False\r
-              \r
+\r
 \r
 def instancieChemicalFormulation(monMC):\r
     if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
@@ -130,7 +130,7 @@ def instancieChemicalFormulation(monMC):
     change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Aging_Type'), type_vieil )\r
 \r
     for index,valeurConstituant in enumerate(monEquation.constituants):\r
-        valeurEquation=monEquation.equation[index] \r
+        valeurEquation=monEquation.equation[index]\r
         editor.ajoutMC(monMC.etape,'OptionnelConstituant',None,('b_type_show','b_modification','b_modif',))\r
         print (index,valeurConstituant,valeurEquation)\r
 \r
@@ -138,11 +138,11 @@ def instancieChemicalFormulation(monMC):
             #    Constituant = SIMP (statut = 'o', typ = 'TXM'),\r
             #    Differential_Equation =  SIMP(statut= 'o',typ= 'TXM'),\r
     for index,valeurConstituant in enumerate(monEquation.const_cine_nom):\r
-         valeurArrhe=monEquation.arrhenius[index] \r
-         if valeurArrhe : valeurConstanteType='Arrhenius type'\r
-         else           : valeurConstanteType='non Arrhenius type'\r
+        valeurArrhe=monEquation.arrhenius[index]\r
+        if valeurArrhe : valeurConstanteType='Arrhenius type'\r
+        else           : valeurConstanteType='non Arrhenius type'\r
 \r
-         print (index,valeurConstituant,valeurConstanteType)\r
+        print (index,valeurConstituant,valeurConstanteType)\r
             #OptionnelleConstante  = FACT (statut = 'f', max = '**',\r
             #     ConstanteName= SIMP (statut = 'o', typ = 'TXM',),\r
             #    ConstanteType =  SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
@@ -152,8 +152,8 @@ def instancieChemicalFormulation(monMC):
     if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
     monMC.dsMaFunct = False\r
     editor.dsMaFunct = False\r
\r
-# TEMPORAIRE \r
+\r
+# TEMPORAIRE\r
 # TODO TODO TODO\r
 # PNPNPNPNPN\r
 \r
@@ -175,7 +175,7 @@ def creeListeEquation(monMC):
     if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
 \r
     editor=monMC.jdc.editor\r
-# TEMPORAIRE \r
+# TEMPORAIRE\r
 # TODO TODO TODO\r
     listeEquationsAAfficher=[]\r
     listeConstantesAAfficher=[]\r
@@ -186,7 +186,7 @@ def creeListeEquation(monMC):
 \r
     monMC.dsMaFunct = False\r
 \r
-  #        listeEquation_stabilization=SIMP(statut='o', homo='SansOrdreNiDoublon', max='**', min=0 ),\r
+    #        listeEquation_stabilization=SIMP(statut='o', homo='SansOrdreNiDoublon', max='**', min=0 ),\r
 \r
 def recupereModeleEquation(monMC):\r
     if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
@@ -198,12 +198,12 @@ def recupereModeleEquation(monMC):
     dicoListeEquationAAfficher={}\r
 \r
     for valeurReactionType in monDico['Equation_Liste']:\r
-      dicoListeEquationAAfficher[valeurReactionType] = [] \r
-      for index,equation in enumerate( editor.maClasseVisuEquation.listEquation):\r
-        if equation.type_react==valeurReactionType : \r
-           dicoListeEquationAAfficher[valeurReactionType].append(equation.representation)\r
+        dicoListeEquationAAfficher[valeurReactionType] = []\r
+        for index,equation in enumerate( editor.maClasseVisuEquation.listEquation):\r
+            if equation.type_react==valeurReactionType :\r
+                dicoListeEquationAAfficher[valeurReactionType].append(equation.representation)\r
     print (dicoListeEquationAAfficher)\r
-       \r
+\r
     change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_initiation'),dicoListeEquationAAfficher['initiation'] )\r
     change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_propagation'),dicoListeEquationAAfficher['propagation'] )\r
     change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_termination'),dicoListeEquationAAfficher['termination'] )\r
@@ -223,13 +223,13 @@ def prepareDiffusion(monMC):
     editor.dicoCoefD={}\r
     for c in maClasseDeModele.coef[0].keys() :\r
         if c[0]=='S':\r
-           clef=c[1:]\r
-           valeur= maClasseDeModele.coef[0][c]\r
-           editor.dicoCoefS[clef]=valeur\r
+            clef=c[1:]\r
+            valeur= maClasseDeModele.coef[0][c]\r
+            editor.dicoCoefS[clef]=valeur\r
         if c[0]=='D':\r
-           clef=c[1:]\r
-           valeur= maClasseDeModele.coef[0][c]\r
-           editor.dicoCoefD[clef]=valeur\r
+            clef=c[1:]\r
+            valeur= maClasseDeModele.coef[0][c]\r
+            editor.dicoCoefD[clef]=valeur\r
     print (editor.dicoCoefS,editor.dicoCoefD)\r
     monMC.dsMaFunct=False\r
     editor.dsMaFunct = False\r
@@ -250,7 +250,7 @@ def ajouteDiffusion(monMC):
         print (v)\r
         mesValeurs=editor.dicoCoefS[v]\r
         print (editor.dicoCoefS)\r
-        print (mesValeurs) \r
+        print (mesValeurs)\r
         MCFils='S'+v\r
         for e in monMC.jdc.etapes:\r
             if e.nom == Modele :break\r
@@ -269,7 +269,7 @@ JdC = JDC_CATA(code='VP',
                 )\r
 \r
 \r
-  \r
+\r
 #---------------------------------\r
 Equation = PROC (nom="Equation",\r
       op=None,\r
@@ -277,7 +277,7 @@ Equation = PROC (nom="Equation",
       Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ),\r
       Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),),\r
 \r
-      \r
+\r
 #     ---------------------------------------------------------------------------\r
        b_type_show = BLOC(condition = " Equation_Type == 'Show equation database'",\r
 #      ---------------------------------------------------------------------------\r
@@ -294,7 +294,7 @@ Equation = PROC (nom="Equation",
          ListeEquation = SIMP(statut='o', typ='TXM',  homo='SansOrdreNiDoublon',siValide=afficheValeurEquation),\r
          b_modification = BLOC(condition = " ListeEquation != None ",\r
            modification = SIMP(typ = bool, statut = 'o',defaut = False, fr='toto', ang='toto en anglais', siValide=instancieChemicalFormulation),\r
-           \r
+\r
            b_modif = BLOC(condition = "modification == True",\r
             Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),\r
             Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),),\r
@@ -310,7 +310,7 @@ Equation = PROC (nom="Equation",
             Commentaire =  SIMP (statut = 'f', typ = 'TXM', defaut = ' '),\r
 \r
            ),# fin b_modif\r
-         \r
+\r
          ), # fin b_modification\r
        ), # Fin b_type_show\r
 \r
@@ -319,7 +319,7 @@ Equation = PROC (nom="Equation",
       b_type_creation = BLOC(condition = " Equation_Type == 'Equation creation'",\r
 #         ---------------------------------------------------------------------------\r
          Equation_Modification = FACT ( statut = 'o',\r
\r
+\r
             ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'),\r
 \r
             Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),\r
@@ -351,7 +351,7 @@ Equation = PROC (nom="Equation",
                   ),# fin ConstanteOptionnelle\r
             ), # fin constante\r
             Commentaire =  SIMP (statut = 'f', typ = 'TXM', defaut = ' '),\r
-                  \r
+\r
          ), # Fin Equation_Modification\r
 \r
                  #Chemical_Formulation =  SIMP(statut= 'o',typ= 'TXM', defaut = 'POOH->P',siValide=maFuncWithArg),\r
@@ -359,8 +359,8 @@ Equation = PROC (nom="Equation",
                  #Type2 = SIMP(statut='o', typ = 'TXM'),\r
 \r
         ),  # fin b_type_creation\r
-                 \r
-      \r
+\r
+\r
 ) # Fin Equation\r
 \r
 #---------------------------------\r
@@ -377,9 +377,9 @@ Modele = PROC (nom="Modele",
         stabilizer = SIMP(typ = bool, statut = 'o',defaut = maClasseDeModele.stabilise),\r
         model_developed_by_for_EDF = SIMP(typ = bool, statut = 'o',defaut = maClasseDeModele.dvt_EDF[0]),\r
         documentation=SIMP(statut='o',typ='TXM',defaut=maClasseDeModele.reference,),\r
-        \r
+\r
        # ajouter la liste des equations et le remove (il faut garder ceux qu on a enlever)\r
-      \r
+\r
 \r
        AjoutEquation=SIMP(statut= 'o',typ= bool, defaut=False, siValide=recupereModeleEquation),\r
        b_ajout_equation = BLOC(condition = " AjoutEquation == True",\r
@@ -388,7 +388,7 @@ Modele = PROC (nom="Modele",
           listeEquation_termination=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[] ),\r
           listeEquation_stabilization=SIMP(statut='o',typ='TXM', homo='SansOrdreNiDoublon', max='**', min=0, defaut=[] ),\r
        ),# fin b_ajout_equation\r
-       \r
+\r
         # coefficients maClasseDeModele.coef = liste de dictionnaire mais il faut prendre que le 0\r
         # on enleve ceux qui commence par D, S et B(casse imprtante)\r
         # la clef est le coef, puis les valeurs\r
@@ -399,9 +399,9 @@ Modele = PROC (nom="Modele",
         b_diffusion = BLOC(condition = " Diffusion == True",\r
          #coefficients maClasseDeModele.coef = liste de dictionnaire mais il faut prendre que le 0\r
         # on met ceux qui commence par D, S et pas les B ni les aitres( casse imprtante)\r
-           listeProduitPourLaDiffusion=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = maClasseDeModele.param_ini.keys(),siValide=ajouteDiffusion), \r
+           listeProduitPourLaDiffusion=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = maClasseDeModele.param_ini.keys(),siValide=ajouteDiffusion),\r
        ),  # fin b_diffusion\r
\r
+\r
        ),  # fin b_type_creation\r
 \r
 \r
index 87c0391867527cbd920064def518eb1cfec4e0c0..6aede499c461a1374379181677a2fa9d19f71e2f 100644 (file)
@@ -17,25 +17,25 @@ monPost=listesDB.sModele().monPost
 \r
 import types\r
 class Tuple:\r
-  def __init__(self,ntuple):\r
-    self.ntuple=ntuple\r
+    def __init__(self,ntuple):\r
+        self.ntuple=ntuple\r
 \r
-  def __convert__(self,valeur):\r
-    if type(valeur) == types.StringType:\r
-      return None\r
-    if len(valeur) != self.ntuple:\r
-      return None\r
-    return valeur\r
+    def __convert__(self,valeur):\r
+        if type(valeur) == types.StringType:\r
+            return None\r
+        if len(valeur) != self.ntuple:\r
+            return None\r
+        return valeur\r
 \r
-  def info(self):\r
-    return "Tuple de %s elements" % self.ntuple\r
+    def info(self):\r
+        return "Tuple de %s elements" % self.ntuple\r
 \r
 \r
 JdC = JDC_CATA(code='VP',\r
                execmodul=None,\r
                 )\r
 \r
-  \r
+\r
 #---------------------------------\r
 Equation = PROC (nom="Equation",\r
       op=None,\r
@@ -47,7 +47,7 @@ Equation = PROC (nom="Equation",
       #b_suite_2 = BLOC(condition = "Equation_DB ==  'Approved data base' ",\r
       #Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", ),),\r
       #),\r
-      \r
+\r
 #     ---------------------------------------------------------------------------\r
        b_type_show = BLOC(condition = " Equation_Type == 'Show equation database'",\r
 #      ---------------------------------------------------------------------------\r
@@ -65,7 +65,7 @@ Equation = PROC (nom="Equation",
          #ListeEquation = SIMP(statut='o', typ='TXM',  homo='SansOrdreNiDoublon'),\r
          b_modification = BLOC(condition = " ListeEquation != None ",\r
            modification = SIMP(typ = bool, statut = 'o',defaut = False, fr='toto', ang='toto en anglais', siValide=lienDB.instancieChemicalFormulation),\r
-           \r
+\r
            b_modif = BLOC(condition = "modification == True",\r
             Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),\r
             Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),),\r
@@ -83,7 +83,7 @@ Equation = PROC (nom="Equation",
 \r
 \r
            ),# fin b_modif\r
-         \r
+\r
          ), # fin b_modification\r
        ), # Fin b_type_show\r
 \r
@@ -92,7 +92,7 @@ Equation = PROC (nom="Equation",
       b_type_creation = BLOC(condition = " Equation_Type == 'Equation creation'",\r
 #         ---------------------------------------------------------------------------\r
          Equation_Modification = FACT ( statut = 'o',\r
\r
+\r
             ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'),\r
 \r
             Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),\r
@@ -129,11 +129,11 @@ Equation = PROC (nom="Equation",
                   ),# fin ConstanteOptionnelle\r
             ), # fin constante\r
             Commentaire =  SIMP (statut = 'f', typ = 'TXM', defaut = ' '),\r
-                  \r
+\r
          ), # Fin Equation_Modification\r
         ),  # fin b_type_creation\r
-                 \r
-      \r
+\r
+\r
 ) # Fin Equation\r
 \r
 #---------------------------------\r
@@ -154,10 +154,10 @@ Modele = PROC (nom="Modele",
           # il faudrait que position=global_jdc fonctionne\r
           model_developed_by_for_EDF = SIMP(typ = bool, statut = 'o',defaut = monModele.dvt_EDF[0]),\r
           documentation=SIMP(statut='o',typ='TXM',defaut=monModele.reference,),\r
-        \r
+\r
        ), # fin ID\r
        # ajouter la liste des equations et le remove (il faut garder ceux qu on a enlever)\r
-      \r
+\r
       Chemical_Equation = FACT( statut='o',\r
        Initial_Equation_List=SIMP(statut='o',typ='TXM',max="**",homo='SansOrdreNiDoublon',into=[],defaut=[], siValide=lienDB.recupereModeleEquation),\r
 \r
@@ -168,13 +168,13 @@ Modele = PROC (nom="Modele",
           listeEquation_termination=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[],siValide=lienDB.ajoutDUneEquation ),\r
           listeEquation_stabilization=SIMP(statut='o',typ='TXM', homo='SansOrdreNiDoublon', max='**', min=0, defaut=[],siValide=lienDB.ajoutDUneEquation ),\r
        ),# fin b_ajout_equation\r
-       \r
+\r
       ), # fin Equation\r
         # coefficients monModele.coef = liste de dictionnaire mais il faut prendre que le 0\r
         # on enleve ceux qui commence par D, S et B(casse imprtante)\r
         # la clef est le coef, puis les valeurs\r
 \r
-      \r
+\r
       #b_material_thickness =  BLOC(condition = "material_thickness == 'thick'",\r
       # si position=global fonctionne\r
         Transport = FACT( statut = 'o',\r
@@ -182,15 +182,15 @@ Modele = PROC (nom="Modele",
         Diffusion = SIMP(typ = bool, statut = 'o',defaut = False ,siValide = lienDB.prepareDiffusion),\r
 \r
         b_diffusion = BLOC(condition = " Diffusion == True",\r
-           listeProduitPourLaDiffusion=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = [],siValide=lienDB.ajouteDiffusion), \r
+           listeProduitPourLaDiffusion=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = [],siValide=lienDB.ajouteDiffusion),\r
           ),  # fin b_diffusion\r
 \r
         Evaporation = SIMP(typ = bool, statut = 'o',defaut = False ,siValide = lienDB.prepareDiffusion),\r
         b_evaporation = BLOC(condition = " Evaporation == True",\r
-           listeProduitPourLEvaporation=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = [],siValide=lienDB.ajouteEvaporation), \r
+           listeProduitPourLEvaporation=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = [],siValide=lienDB.ajouteEvaporation),\r
          ),  # fin b_evaporation\r
\r
\r
+\r
+\r
          ),  # fin TRANSPORT\r
        #),  # fin b_material_thickness\r
 \r
@@ -235,7 +235,7 @@ Modele = PROC (nom="Modele",
 \r
 # il faut recopier toute la suite en changeant eventuellement le nom du modele\r
 # il faut cocher toutes les equations par defaut\r
-        \r
+\r
               ), # fin ID\r
              ), # fin b_type_modify\r
 #     ---------------------------------------------------------------------------\r
@@ -293,10 +293,10 @@ PostTraitement = PROC (nom="PostTraitement",
         results_units=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.results_units,defaut=monPost.results_units),\r
         #integrate=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.results_units,defaut=monPost.results_units),\r
         prerequisite=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.prerequisite,defaut=monPost.prerequisite),\r
-        \r
+\r
         ),\r
-        constituant=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.constituants,defaut=monPost.constituants) \r
-        \r
+        constituant=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.constituants,defaut=monPost.constituants)\r
+\r
       )# fin b_post_creation\r
 #         ---------------------------------------------------------------------------\r
 #---------------------------------\r
index b9b56fe0ffdafaa203382b58347dfbfc0fa3bc87..af6212934ed07e7a966a1be5b7a276553586ac42 100644 (file)
@@ -28,16 +28,15 @@ import os
 \r
 class CONFIG(configuration.CONFIG_BASE):\r
 \r
-  #-----------------------------------\r
-  def __init__(self,appli,repIni):\r
-  #-----------------------------------\r
+    #-----------------------------------\r
+    def __init__(self,appli,repIni):\r
+    #-----------------------------------\r
 \r
-      self.labels_user=['catalogues','lang']\r
-      self.labels_eficas=['lang','rep_cata','catalogues']\r
+        self.labels_user=['catalogues','lang']\r
+        self.labels_eficas=['lang','rep_cata','catalogues']\r
 \r
-      configuration.CONFIG_BASE.__init__(self,appli,repIni)\r
+        configuration.CONFIG_BASE.__init__(self,appli,repIni)\r
 \r
 \r
 def make_config(appli,rep):\r
     return CONFIG(appli,rep)\r
-\r
index b834fc4d93c77be8e9b8800b3efd85075b7d85cb..a53b62e213866f9039e2d5f1911f399dad63fc4b 100644 (file)
@@ -12,21 +12,21 @@ monPost=listesDB.sModele().monPost
 \r
 import types\r
 class Tuple:\r
-  def __init__(self,ntuple):\r
-    self.ntuple=ntuple\r
+    def __init__(self,ntuple):\r
+        self.ntuple=ntuple\r
 \r
-  def __convert__(self,valeur):\r
-    if type(valeur) == types.StringType:\r
-      return None\r
-    if len(valeur) != self.ntuple:\r
-      return None\r
-    return valeur\r
+    def __convert__(self,valeur):\r
+        if type(valeur) == types.StringType:\r
+            return None\r
+        if len(valeur) != self.ntuple:\r
+            return None\r
+        return valeur\r
 \r
-  def info(self):\r
-    return "Tuple de %s elements" % self.ntuple\r
+    def info(self):\r
+        return "Tuple de %s elements" % self.ntuple\r
 \r
-  __repr__=info\r
-  __str__=info\r
+    __repr__=info\r
+    __str__=info\r
 \r
 \r
 dicoAgingFactor={ '40years BR top' : {'temperature' : 50, 'simulationTime' : 350640}}\r
@@ -34,15 +34,15 @@ dicoAgingFactor={ '40years BR top' : {'temperature' : 50, 'simulationTime' : 350
 # --------------------------------------\r
 # Fonctions appellees depuis le catalogue\r
 # --------------------------------------\r
\r
+\r
 # --------------------------------------\r
 # Dans Equation\r
 # --------------------------------------\r
 \r
 def recupereDicoEquation(monMC):\r
-    # Equation_reaction (ds 2 blocs)\r
-    #  ou dans Equation b_type_show b_reaction_type\r
-    #  ou dans Equation b_type_show b_aging_type\r
+        # Equation_reaction (ds 2 blocs)\r
+        #  ou dans Equation b_type_show b_reaction_type\r
+        #  ou dans Equation b_type_show b_aging_type\r
 \r
     if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
     editor=monMC.jdc.editor\r
@@ -55,30 +55,30 @@ def recupereDicoEquation(monMC):
     valeurEquationListe=editor.getValeur('Equation','Equation_Liste',('b_type_show',))\r
     valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_reaction_type',))\r
     if valeurAgingType == None :\r
-       valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_aging_type',))\r
+        valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_aging_type',))\r
     if valeurAgingType == None : monMC.dsMaFunct = False; return\r
 \r
     listeEquationPourIhm = []\r
     listeReprEquationPourIhm = []\r
     dicoListAffiche = {}\r
-   \r
+\r
     for equation in listEquation :\r
         if valeurEquationListe == 'aging_type' :\r
-           if equation.type_vieil == valeurAgingType : \r
-              listeEquationPourIhm.append(equation)\r
-              listeReprEquationPourIhm.append(equation.representation)\r
-              dicoListAffiche[equation.representation]=equation\r
+            if equation.type_vieil == valeurAgingType :\r
+                listeEquationPourIhm.append(equation)\r
+                listeReprEquationPourIhm.append(equation.representation)\r
+                dicoListAffiche[equation.representation]=equation\r
         else:\r
-           if equation.type_react == valeurAgingType : \r
-              listeEquationPourIhm.append(equation)\r
-              listeReprEquationPourIhm.append(equation.representation)\r
-              dicoListAffiche[equation.representation]=equation\r
+            if equation.type_react == valeurAgingType :\r
+                listeEquationPourIhm.append(equation)\r
+                listeReprEquationPourIhm.append(equation.representation)\r
+                dicoListAffiche[equation.representation]=equation\r
     maClasseDelistesDB.dicoListAffiche = dicoListAffiche\r
 \r
     change=editor.changeIntoDefMC('Equation', ('b_type_show','ListeEquation'), listeReprEquationPourIhm )\r
     if change :\r
-       editor.reCalculeValiditeMCApresChgtInto('Equation', 'listeEquation', ('b_type_show',)) \r
-       if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
+        editor.reCalculeValiditeMCApresChgtInto('Equation', 'listeEquation', ('b_type_show',))\r
+        if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
     monMC.dsMaFunct = False\r
 \r
 def afficheValeurEquation(monMC):\r
@@ -93,9 +93,9 @@ def afficheValeurEquation(monMC):
     aAfficher=str(monEquation)\r
     editor=monMC.jdc.editor\r
     editor._viewText(aAfficher, "Id",largeur=80,hauteur=300)\r
-    \r
+\r
     monMC.dsMaFunct = False\r
-              \r
+\r
 \r
 def instancieChemicalFormulation(monMC):\r
     print ('instancieChemicalFormulation pour ', monMC.nom)\r
@@ -120,8 +120,8 @@ def instancieChemicalFormulation(monMC):
     change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Aging_Type'), type_vieil )\r
 \r
     for index,valeurConstituant in enumerate(monEquation.constituants):\r
-        valeurEquation=monEquation.equation[index] \r
-        \r
+        valeurEquation=monEquation.equation[index]\r
+\r
         #PNPNPN --> decider des noms SVP ave un nom python\r
         monMcl1=('Constituant','TXM',{'statut':'o','defaut':valeurConstituant})\r
         monMcl2=('Differential_Equation','TXM',{'statut':'o','defaut':valeurEquation})\r
@@ -135,14 +135,14 @@ def instancieChemicalFormulation(monMC):
             #    Differential_Equation =  SIMP(statut= 'o',typ= 'TXM'),\r
 \r
     for index,valeurConstituant in enumerate(monEquation.const_cine_nom):\r
-         valeurArrhe=monEquation.arrhenius[index] \r
-         if valeurArrhe : valeurConstanteType='Arrhenius type'\r
-         else           : valeurConstanteType='non Arrhenius type'\r
-         monMcl1=('ConstanteName','TXM',{'statut':'o','defaut':valeurConstituant})\r
-         monMcl2=('ConstanteType','TXM',{'statut':'o','defaut':valeurConstanteType,'into': ('Arrhenius type','non Arrhenius type') })\r
-         listeMC=(monMcl1,monMcl2)\r
-         editor.ajoutDefinitionMCFact ('Equation',('b_type_show','b_modification','b_modif',),valeurConstituant,listeMC,statut='f')\r
-         #editor.ajoutMC(e,MCFils,mesValeurs,('b_type_creation','b_diffusion',))\r
+        valeurArrhe=monEquation.arrhenius[index]\r
+        if valeurArrhe : valeurConstanteType='Arrhenius type'\r
+        else           : valeurConstanteType='non Arrhenius type'\r
+        monMcl1=('ConstanteName','TXM',{'statut':'o','defaut':valeurConstituant})\r
+        monMcl2=('ConstanteType','TXM',{'statut':'o','defaut':valeurConstanteType,'into': ('Arrhenius type','non Arrhenius type') })\r
+        listeMC=(monMcl1,monMcl2)\r
+        editor.ajoutDefinitionMCFact ('Equation',('b_type_show','b_modification','b_modif',),valeurConstituant,listeMC,statut='f')\r
+        #editor.ajoutMC(e,MCFils,mesValeurs,('b_type_creation','b_diffusion',))\r
 \r
 \r
     change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Commentaire'),monEquation.comment )\r
@@ -151,7 +151,7 @@ def instancieChemicalFormulation(monMC):
 \r
     monMC.dsMaFunct = False\r
     editor.dsMaFunct = False\r
\r
+\r
 \r
 \r
 \r
@@ -197,7 +197,7 @@ def creeListeEquation(monMC):
 \r
     editor.dsMaFunct = False\r
 \r
-  #        listeEquation_stabilization=SIMP(statut='o', homo='SansOrdreNiDoublon', max='**', min=0 ),\r
+    #        listeEquation_stabilization=SIMP(statut='o', homo='SansOrdreNiDoublon', max='**', min=0 ),\r
 \r
 def recupereModeleEquation(monMC):\r
     if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
@@ -213,15 +213,15 @@ def recupereModeleEquation(monMC):
     from VP_Cata_V2 import monDico\r
     listEquation=maClasseDelistesDB.getListEquation()\r
     for valeurReactionType in monDico['Equation_Liste']:\r
-      dicoListeEquationAAfficher[valeurReactionType] = [] \r
-      for index,equation in enumerate( listEquation):\r
-        if equation.type_react==valeurReactionType : \r
-           dicoListeEquationAAfficher[valeurReactionType].append(equation.representation)\r
-           maClasseDelistesDB.dictParametresInitiaux[equation.representation]=equation\r
+        dicoListeEquationAAfficher[valeurReactionType] = []\r
+        for index,equation in enumerate( listEquation):\r
+            if equation.type_react==valeurReactionType :\r
+                dicoListeEquationAAfficher[valeurReactionType].append(equation.representation)\r
+                maClasseDelistesDB.dictParametresInitiaux[equation.representation]=equation\r
     #print (dicoListeEquationAAfficher)\r
     #print('maClasseDelistesDB.dictParametresInitiaux', maClasseDelistesDB.dictParametresInitiaux)\r
     prepareDiffusionSansMC(editor,monMC.nom)\r
-       \r
+\r
     change=editor.changeIntoDefMC('Modele', ('b_type_creation','Chemical_Equation','b_ajout_equation','listeEquation_initiation'),dicoListeEquationAAfficher['initiation'])\r
     change=editor.changeIntoDefMC('Modele', ('b_type_creation','Chemical_Equation','b_ajout_equation','listeEquation_propagation'),dicoListeEquationAAfficher['propagation'] )\r
     change=editor.changeIntoDefMC('Modele', ('b_type_creation','Chemical_Equation','b_ajout_equation','listeEquation_termination'),dicoListeEquationAAfficher['termination'] )\r
@@ -265,42 +265,42 @@ def prepareDiffusionSansMC(editor,monMCNom):
 \r
     print (lInitialCoche,lInititiationCoche,lPropagationCoche,lTerminationCoche,lStabilizationCoche)\r
     for liste in (lInitialCoche,lInititiationCoche,lPropagationCoche,lTerminationCoche,lStabilizationCoche):\r
-        # Il est possible qu'une liste soit vide lors de l initialisation\r
-        if liste == None : continue \r
+            # Il est possible qu'une liste soit vide lors de l initialisation\r
+        if liste == None : continue\r
         for equation in liste :\r
             print (equation)\r
             for const in maClasseDelistesDB.dictParametresInitiaux[equation].constituants :\r
-              if const not in maClasseDelistesDB.listeParametresInitiaux : maClasseDelistesDB.listeParametresInitiaux.append(const)\r
+                if const not in maClasseDelistesDB.listeParametresInitiaux : maClasseDelistesDB.listeParametresInitiaux.append(const)\r
             #for coef in maClasseDelistesDB.dictParametresInitiaux[equation].const_cine_nom :\r
             #  if coef not in maClasseDelistesDB.listeCoefInitiaux : maClasseDelistesDB.listeCoefInitiaux.append(coef)\r
             for num,coef in enumerate(maClasseDelistesDB.dictParametresInitiaux[equation].const_cine_nom ):\r
-              maClasseDelistesDB.dicoCoefAffichageArr[coef]=maClasseDelistesDB.dictParametresInitiaux[equation].arrhenius[num]\r
-              if coef not in maClasseDelistesDB.listeCoefInitiaux : maClasseDelistesDB.listeCoefInitiaux.append(coef)\r
+                maClasseDelistesDB.dicoCoefAffichageArr[coef]=maClasseDelistesDB.dictParametresInitiaux[equation].arrhenius[num]\r
+                if coef not in maClasseDelistesDB.listeCoefInitiaux : maClasseDelistesDB.listeCoefInitiaux.append(coef)\r
 \r
     #print('maClasseDelistesDB.dictParametresInitiaux', maClasseDelistesDB.dictParametresInitiaux)\r
     if monMCNom == 'Diffusion' :\r
-       change=editor.changeIntoDefMC('Modele', ('b_type_creation','Transport','b_diffusion','listeProduitPourLaDiffusion'), maClasseDelistesDB.listeParametresInitiaux )\r
+        change=editor.changeIntoDefMC('Modele', ('b_type_creation','Transport','b_diffusion','listeProduitPourLaDiffusion'), maClasseDelistesDB.listeParametresInitiaux )\r
     if monMCNom == 'Evaporation' :\r
-       change=editor.changeIntoDefMC('Modele', ('b_type_creation','Transport','b_evaporation','listeProduitPourLEvaporation'), maClasseDelistesDB.listeParametresInitiaux )\r
+        change=editor.changeIntoDefMC('Modele', ('b_type_creation','Transport','b_evaporation','listeProduitPourLEvaporation'), maClasseDelistesDB.listeParametresInitiaux )\r
 \r
     if monMCNom in ('Evaporation','Diffusion') :\r
-       for c in list(monModele.coef[0].keys()) :\r
-        if c[0]=='D':\r
-           clef=c[1:]\r
-           if clef in maClasseDelistesDB.listeParametresInitiaux :\r
-              maClasseDelistesDB.listeCoefD.append(clef)\r
-              maClasseDelistesDB.listeCoefInitiaux.append('D'+clef)\r
-              maClasseDelistesDB.listeCoefInitiaux.append('S'+clef)\r
-           else :\r
-              maClasseDelistesDB.listeCoefASupprimer.append('S'+clef)\r
-              maClasseDelistesDB.listeCoefASupprimer.append('D'+clef)\r
-        if c[0]=='B':\r
-           clef=c[1:]\r
-           if clef in maClasseDelistesDB.listeParametresInitiaux :\r
-              maClasseDelistesDB.listeCoefB.append(clef)\r
-              maClasseDelistesDB.listeCoefInitiaux.append(c)\r
-           else :\r
-              maClasseDelistesDB.listeCoefASupprimer.append(c)\r
+        for c in list(monModele.coef[0].keys()) :\r
+            if c[0]=='D':\r
+                clef=c[1:]\r
+                if clef in maClasseDelistesDB.listeParametresInitiaux :\r
+                    maClasseDelistesDB.listeCoefD.append(clef)\r
+                    maClasseDelistesDB.listeCoefInitiaux.append('D'+clef)\r
+                    maClasseDelistesDB.listeCoefInitiaux.append('S'+clef)\r
+                else :\r
+                    maClasseDelistesDB.listeCoefASupprimer.append('S'+clef)\r
+                    maClasseDelistesDB.listeCoefASupprimer.append('D'+clef)\r
+            if c[0]=='B':\r
+                clef=c[1:]\r
+                if clef in maClasseDelistesDB.listeParametresInitiaux :\r
+                    maClasseDelistesDB.listeCoefB.append(clef)\r
+                    maClasseDelistesDB.listeCoefInitiaux.append(c)\r
+                else :\r
+                    maClasseDelistesDB.listeCoefASupprimer.append(c)\r
     print ('aClasseDelistesDB.listeCoefB',maClasseDelistesDB.listeCoefB)\r
     print ('aClasseDelistesDB.listeCoefB',maClasseDelistesDB.listeCoefD)\r
     print ('maClasseDelistesDB.listeCoefInitiaux',maClasseDelistesDB.listeCoefInitiaux)\r
@@ -310,9 +310,9 @@ def prepareDiffusionSansMC(editor,monMCNom):
     # Paraetres_initiaux avec maClasseDelistesDB.listeParametresInitiaux\r
     # TO DO TO DO PNPN\r
     # si on arrive avex\r
-    # if monMC.nom = Diffusion \r
+    # if monMC.nom = Diffusion\r
     if monMCNom == 'Diffusion' :\r
-      editor.setValeur('Modele','listeProduitPourLaDiffusion' ,maClasseDelistesDB.listeCoefD, ('b_type_creation','Transport','b_diffusion',))\r
+        editor.setValeur('Modele','listeProduitPourLaDiffusion' ,maClasseDelistesDB.listeCoefD, ('b_type_creation','Transport','b_diffusion',))\r
     #editor.changeValeur(....,'listeProduitPourLaDiffusion',maClasseDelistesDB.listeCoefD')\r
     # if monMCNom == 'Evaporation' :\r
     #editor.changeValeur(....,'listeProduitPourLaDiffusion',maClasseDelistesDB.listeCoefB')\r
@@ -330,7 +330,7 @@ def ajouteEvaporation(monMC):
     for v in monMC.valeur :\r
         clef='B'+v\r
         if clef not in maClasseDelistesDB.listeCoefInitiaux :\r
-              maClasseDelistesDB.listeCoefInitiaux.append(clef)\r
+            maClasseDelistesDB.listeCoefInitiaux.append(clef)\r
 \r
     print ('sortie de ajouteDiffusion' , maClasseDelistesDB.listeCoefInitiaux)\r
     monMC.dsMaFunct=False\r
@@ -347,32 +347,32 @@ def ajouteDiffusion(monMC):
     for v in monMC.valeur :\r
         clef='D'+v\r
         if clef not in maClasseDelistesDB.listeCoefInitiaux :\r
-              maClasseDelistesDB.listeCoefInitiaux.append(clef)\r
-              maClasseDelistesDB.listeCoefInitiaux.append('S'+v)\r
-              maClasseDelistesDB.dicoCoefAffichageArr[clef] = True\r
-              maClasseDelistesDB.dicoCoefAffichageArr['S'+v] = False\r
-              #maClasseDelistesDB.dicoCoefAffichageArr['B'+v] = True\r
-        \r
-        # on affiche dans l interface  un mot clef avec clef comme nom et \r
+            maClasseDelistesDB.listeCoefInitiaux.append(clef)\r
+            maClasseDelistesDB.listeCoefInitiaux.append('S'+v)\r
+            maClasseDelistesDB.dicoCoefAffichageArr[clef] = True\r
+            maClasseDelistesDB.dicoCoefAffichageArr['S'+v] = False\r
+            #maClasseDelistesDB.dicoCoefAffichageArr['B'+v] = True\r
+\r
+        # on affiche dans l interface  un mot clef avec clef comme nom et\r
         # 2 reels si ce commence par D soit iniitialise a 0 si pas de valeur\r
         # soit avec comme deifaut nomCoef in monModele.coef[0].keys()\r
     print ('sortie de ajouteDiffusion' , maClasseDelistesDB.listeCoefInitiaux)\r
 \r
     for nomCoef in maClasseDelistesDB.listeCoefInitiaux:\r
-        #A jout Ds Coef d'un MC \r
-        nomMC='Coef_'+nomCoef \r
+        #A jout Ds Coef d'un MC\r
+        nomMC='Coef_'+nomCoef\r
         if maClasseDelistesDB.dicoCoefAffichageArr[nomCoef]  == True:\r
-           print ('2 r'), \r
-           if nomCoef in monModele.coef[0].keys() :\r
-              print (monModele.coef[0][nomCoef])\r
-           else :\r
-              print ((0,0))\r
+            print ('2 r'),\r
+            if nomCoef in monModele.coef[0].keys() :\r
+                print (monModele.coef[0][nomCoef])\r
+            else :\r
+                print ((0,0))\r
         else :\r
-           print ('1 r') \r
-           if nomCoef in monModele.coef[0].keys() :\r
-              print (monModele.coef[0][nomCoef])\r
-           else :\r
-              print (0)\r
+            print ('1 r')\r
+            if nomCoef in monModele.coef[0].keys() :\r
+                print (monModele.coef[0][nomCoef])\r
+            else :\r
+                print (0)\r
 \r
     print ('______________________')\r
     #for v in monMC.valeur :\r
@@ -405,17 +405,17 @@ def creeListeMateriauxSelonModele(monMC):
     listMateriauxFiltre=[]\r
     for modele in listModele :\r
         if modele.technical_use == monMC.valeur :\r
-           maClasseDelistesDB.dicoModeleFiltre[modele.nom]=modele\r
-           listModeleFiltre.append(modele.nom)\r
-           if type(modele.materiaux) not in (list, tuple): modeleATraiter= modele.materiaux\r
-           else : modeleATraiter= modele.materiaux[0]\r
-           if modeleATraiter not in listMateriauxFiltre :\r
-              listMateriauxFiltre.append(modeleATraiter)\r
-              maClasseDelistesDB.dicoMateriauxFiltre[modeleATraiter]=[modele.nom,]\r
-           else :\r
-              maClasseDelistesDB.dicoMateriauxFiltre[modeleATraiter].append(modele.nom)\r
\r
-           \r
+            maClasseDelistesDB.dicoModeleFiltre[modele.nom]=modele\r
+            listModeleFiltre.append(modele.nom)\r
+            if type(modele.materiaux) not in (list, tuple): modeleATraiter= modele.materiaux\r
+            else : modeleATraiter= modele.materiaux[0]\r
+            if modeleATraiter not in listMateriauxFiltre :\r
+                listMateriauxFiltre.append(modeleATraiter)\r
+                maClasseDelistesDB.dicoMateriauxFiltre[modeleATraiter]=[modele.nom,]\r
+            else :\r
+                maClasseDelistesDB.dicoMateriauxFiltre[modeleATraiter].append(modele.nom)\r
+\r
+\r
 \r
     change=editor.changeIntoDefMC('Modele', ('b_type_modification','b_technicalUse','material'),listMateriauxFiltre )\r
 \r
@@ -451,9 +451,9 @@ def afficheModele(monMC):
     aAfficher=str(maClasseDelistesDB.monModele)\r
     editor=monMC.jdc.editor\r
     editor._viewText(aAfficher, "Id",largeur=700,hauteur=500)\r
-    \r
+\r
     monMC.dsMaFunct = False\r
-              \r
+\r
 def changeValeurDefautModele(monMC):\r
     if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
     monMC.dsMaFunct = True\r
@@ -487,15 +487,15 @@ def creeCoefAModifier(monMC):
     dicoNonArr={}\r
     for coef in maClasseDelistesDB.monModele.coef[0] :\r
         if len (maClasseDelistesDB.monModele.coef[0][coef]) == 1 :\r
-               dicoNonArr[coef]=maClasseDelistesDB.monModele.coef[0][coef][0]\r
+            dicoNonArr[coef]=maClasseDelistesDB.monModele.coef[0][coef][0]\r
         else :\r
-               dicoArr[coef]=maClasseDelistesDB.monModele.coef[0][coef]\r
-               if coef[0] == 'D' : maClasseDelistesDB.listeDiffusion.append(coef[1:])\r
+            dicoArr[coef]=maClasseDelistesDB.monModele.coef[0][coef]\r
+            if coef[0] == 'D' : maClasseDelistesDB.listeDiffusion.append(coef[1:])\r
     print (dicoNonArr)\r
     print (dicoArr)\r
     if 'ri' in dicoNonArr :\r
-       print ('ajoutDefinitionMC debitOfDose')\r
-       editor.ajoutDefinitionMC('Modele', ('b_type_modification','b_technicalUse','b_modele','b_type_use2','Aging_Factor'), 'debitOfDose',typ='R',statut='o' )\r
+        print ('ajoutDefinitionMC debitOfDose')\r
+        editor.ajoutDefinitionMC('Modele', ('b_type_modification','b_technicalUse','b_modele','b_type_use2','Aging_Factor'), 'debitOfDose',typ='R',statut='o' )\r
 \r
     for coef in dicoNonArr :\r
         print (coef)\r
@@ -503,9 +503,9 @@ def creeCoefAModifier(monMC):
         editor.ajoutDefinitionMC('Modele',('b_type_modification','b_technicalUse','b_modele','b_type_use',),coef, 'R', statut='o',defaut=dicoNonArr[coef])\r
         # a faire marcher\r
         # pour les Arr il faut un tuple(2)\r
-       \r
+\r
     # il fait creer un fact Boundary_Conditions_Param pour chacque espece de listeDiffusion\r
-   \r
+\r
     if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
 \r
     monMC.dsMaFunct = False\r
@@ -517,11 +517,11 @@ def remplirAgingFactor(monMC):
     monMC.dsMaFunct = True\r
     editor=monMC.jdc.editor\r
     if monMC.valeur in dicoAgingFactor:\r
-       print (monMC.valeur, 'trouve')\r
-       for MC in dicoAgingFactor[monMC.valeur]:\r
-           print (MC)\r
-           print (dicoAgingFactor[monMC.valeur][MC]),\r
-           editor.setValeur('Modele',MC,dicoAgingFactor[monMC.valeur][MC],('b_type_modification','b_technicalUse','b_modele','b_type_use2','Aging_Factor'))\r
+        print (monMC.valeur, 'trouve')\r
+        for MC in dicoAgingFactor[monMC.valeur]:\r
+            print (MC)\r
+            print (dicoAgingFactor[monMC.valeur][MC]),\r
+            editor.setValeur('Modele',MC,dicoAgingFactor[monMC.valeur][MC],('b_type_modification','b_technicalUse','b_modele','b_type_use2','Aging_Factor'))\r
     monMC.dsMaFunct = False\r
 \r
 \r
index e95cfa78835dac54c8d67b17d5e434955d8e0faf..957060e5667f9cf107ed64fce3a3d4337423bcad 100644 (file)
@@ -10,71 +10,70 @@ import pckdb, class_data, instruction, equation_part, utils
 class sModele :\r
 # --------------------------------------\r
 \r
-   _instance = None\r
+    _instance = None\r
 \r
-   def __new__(cls, *args, **kwargs):\r
+    def __new__(cls, *args, **kwargs):\r
         if not cls._instance:\r
             cls._instance = super(sModele, cls).__new__(\r
                                 cls, *args, **kwargs)\r
 \r
         return cls._instance\r
 \r
-   def __init__ (self):\r
-       self.monModele=class_data.Modele()\r
-       self.monPost=class_data.Post_traitement()\r
+    def __init__ (self):\r
+        self.monModele=class_data.Modele()\r
+        self.monPost=class_data.Post_traitement()\r
 \r
 \r
 # --------------------------------------\r
 class classeListesDB :\r
 # --------------------------------------\r
 \r
-   _instance = None\r
+    _instance = None\r
 \r
-   def __new__(cls, *args, **kwargs):\r
+    def __new__(cls, *args, **kwargs):\r
         if not cls._instance:\r
             cls._instance = super(listesDB, cls).__new__(\r
                                 cls, *args, **kwargs)\r
 \r
         return cls._instance\r
 \r
-   def __init__ (self):\r
-      self.listEquation       = None\r
-      self.listModele         = None\r
-      self.listPostTraitement = None\r
-      self.dicoListAffiche   = {}\r
-      self.valeurEquationChoisie = None\r
-      self.listeConstantesAAfficher = []\r
-      self.listeEquationsAAfficher = []\r
-      self.listeCoefD  = []\r
-      self.listeCoefB  = []\r
-      self.dictParametresInitiaux = {}\r
-      self.listeParametresInitiaux= []\r
-      self.listeCoefInitiaux= []\r
-      self.listeCoefASupprimer= []\r
-      self.dicoCoefAffichageArr   = {}\r
-      self.dicoModeleFiltre = {}\r
-      self.dicoMateriauxFiltre = {}\r
-      self.monModele = None\r
-      self.listeDiffusion = []\r
-   \r
-   def metAJour(self,valeur):\r
-      print ('metAJour')\r
-      if valeur == None : return\r
-      correspond=pckdb.DBRENAME\r
-      self.listEquation, self.listModele,self.listPostTraitement=pckdb.read_pckdb(correspond[valeur])\r
-      self.dicoListeEquation   = {}\r
-      for equation in self.listEquation :\r
-          self.dicoListeEquation[equation.representation]=equation\r
-\r
-   def getListEquation(self):\r
-      return self.listEquation\r
-    \r
-   def getListModele(self):\r
-      return self.listModele\r
-\r
-   def getListPostTraitement(self):\r
-      return self.listPostTraitement\r
-    \r
-   def getdicoListAffiche(self):\r
-      return self.dicoListAffiche\r
+    def __init__ (self):\r
+        self.listEquation       = None\r
+        self.listModele         = None\r
+        self.listPostTraitement = None\r
+        self.dicoListAffiche   = {}\r
+        self.valeurEquationChoisie = None\r
+        self.listeConstantesAAfficher = []\r
+        self.listeEquationsAAfficher = []\r
+        self.listeCoefD  = []\r
+        self.listeCoefB  = []\r
+        self.dictParametresInitiaux = {}\r
+        self.listeParametresInitiaux= []\r
+        self.listeCoefInitiaux= []\r
+        self.listeCoefASupprimer= []\r
+        self.dicoCoefAffichageArr   = {}\r
+        self.dicoModeleFiltre = {}\r
+        self.dicoMateriauxFiltre = {}\r
+        self.monModele = None\r
+        self.listeDiffusion = []\r
 \r
+    def metAJour(self,valeur):\r
+        print ('metAJour')\r
+        if valeur == None : return\r
+        correspond=pckdb.DBRENAME\r
+        self.listEquation, self.listModele,self.listPostTraitement=pckdb.read_pckdb(correspond[valeur])\r
+        self.dicoListeEquation   = {}\r
+        for equation in self.listEquation :\r
+            self.dicoListeEquation[equation.representation]=equation\r
+\r
+    def getListEquation(self):\r
+        return self.listEquation\r
+\r
+    def getListModele(self):\r
+        return self.listModele\r
+\r
+    def getListPostTraitement(self):\r
+        return self.listPostTraitement\r
+\r
+    def getdicoListAffiche(self):\r
+        return self.dicoListAffiche\r
index 0b82747e504e76778a0ba34142de152174bb7dc9..926aa4bc2ea47278e3aaf2d11ad9b7ac2c61bf68 100644 (file)
@@ -16,7 +16,7 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-code="VP" 
+code="VP"
 import sys, os
 if os.path.dirname(os.path.abspath(__file__)) not in sys.path :
-   sys.path.insert(0,os.path.dirname(os.path.abspath(__file__)))
+    sys.path.insert(0,os.path.dirname(os.path.abspath(__file__)))
index 2d50d82184c4e481cd6e854a93499ca69d293105..6630de72da515e41fdb91d999eacd103b632b443 100644 (file)
@@ -39,7 +39,6 @@ catalogues=(
 )
 nombreDeBoutonParLigne=2
 closeFrameRechercheCommande = True
-closeEntete = True 
+closeEntete = True
 #closeArbre = True
 afficheOptionnelVide=False
-
index 1d328a4606b9f4b67459317ace64af77b19c000b..e5dd129708ea27ba20d3e6bcc3a02d3280747840 100644 (file)
@@ -4,17 +4,17 @@
 # COPYRIGHT (C) 1991 - 2001  EDF R&D                  WWW.CODE-ASTER.ORG
 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
-# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR   
-# (AT YOUR OPTION) ANY LATER VERSION.                                 
+# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
+# (AT YOUR OPTION) ANY LATER VERSION.
 #
-# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT 
-# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF          
-# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU    
-# GENERAL PUBLIC LICENSE FOR MORE DETAILS.                            
+# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
+# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
+# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
+# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
 #
-# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE   
-# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,       
-#    1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.      
+# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
+# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
+#    1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
 # ======================================================================
 #     IDENTIFICATION DU GESTIONNAIRE DE COMMANDE ACCAS A PARTIR
 #     DE LA VERSION DU CODE_ASTER ASSOCIE
index 604bebabf41d2fa14e2bbc9fcae1c68da8ee19ad..bb1a346b5369560ebea1fd7ae0bf6c7409d3267e 100755 (executable)
@@ -19,7 +19,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-   Ce module sert a lancer EFICAS configure pour MAP 
+   Ce module sert a lancer EFICAS configure pour MAP
 """
 # Modules Python
 # Modules Eficas
index 778060675e262ff31ba532cbffd942a4b82e37ff..0a063d7a33061ca2466505deda285af52fd956c5 100644 (file)
@@ -30,4 +30,3 @@ from Extensions import pluginloader
 import convert
 
 plugins=pluginloader.PluginLoader(convert)
-
index 983c868f0200691c9e3c19894004148a901fcd16..02428b5bf638f754eb7ffa604ef67ebdcc95b80d 100644 (file)
 #
 from __future__ import absolute_import
 from __future__ import print_function
-try : 
-  from future import standard_library
-  standard_library.install_aliases()
+try :
+    from future import standard_library
+    standard_library.install_aliases()
 except :
-  pass
-try : 
-  from builtins import str
+    pass
+try :
+    from builtins import str
 except :
-  pass
+    pass
 from builtins import object
 import sys,re,tokenize
 import io
@@ -65,7 +65,7 @@ class COMMENTAIRE(ENTITE_JDC):
             # le diese n'est pas sur le premier caractere
             amont,aval = texte.split('#',1) # on decoupe suivant la premiere occurrence de #
             self.texte = self.texte +amont + aval
-        
+
 class AFFECTATION(ENTITE_JDC):
 
     def appendText(self,texte):
@@ -73,7 +73,7 @@ class AFFECTATION(ENTITE_JDC):
         Ajoute texte a self.texte en enlevant tout retour chariot et tout point virgule
         """
         self.texte = self.texte+texte
-        
+
     def __str__(self):
         """
         Retourne une expression de l'affectation comprehensible par ACCAS
@@ -100,7 +100,7 @@ class COMMANDE_COMMENTARISEE(ENTITE_JDC):
         """
         return "COMMANDE_COMM(texte="+repr(self.texte)+")\n"
 
-        
+
 next = {}
 next['if'] = next['elif'] = 'elif', 'else', 'end'
 next['while'] = next['for'] = 'else', 'end'
@@ -112,7 +112,7 @@ start = 'if', 'while', 'for', 'try', 'def', 'class'
 
 class PARSEUR_PYTHON(object):
     """
-    Cette classe sert a creer un objet PARSEUR_PYTHON qui realise l'analyse d'un texte 
+    Cette classe sert a creer un objet PARSEUR_PYTHON qui realise l'analyse d'un texte
     representant un JDC Python en distinguant :
       - les commentaires inter commandes
       - les affectations
@@ -155,14 +155,14 @@ class PARSEUR_PYTHON(object):
     def getOptions(self):
         m= self.optionprog.match(self.line)
         if m:
-           option=m.group(1)
-           name=option[1:]
-           flag=(option[0] == '+')
-           if name == "affectation": self.affectation_flag=flag
-           if name == "comment": self.comment_flag=flag
-           if name == "all": 
-              self.comment_flag=flag
-              self.affectation_flag=flag
+            option=m.group(1)
+            name=option[1:]
+            flag=(option[0] == '+')
+            if name == "affectation": self.affectation_flag=flag
+            if name == "comment": self.comment_flag=flag
+            if name == "all":
+                self.comment_flag=flag
+                self.affectation_flag=flag
 
     def readline(self):
         self.line= self.texte.readline()
@@ -226,8 +226,8 @@ class PARSEUR_PYTHON(object):
     def updateIndent(self):
         #print "updateIndent",len(self.indent_list[-1]),len(self.buffer_indent)
         if len(self.indent_list[-1]) > len(self.buffer_indent):
-           self.out=self.out+(len(self.indent_list[-1]) - len(self.buffer_indent))*" "
-           self.buffer_indent=self.indent_list[-1]
+            self.out=self.out+(len(self.indent_list[-1]) - len(self.buffer_indent))*" "
+            self.buffer_indent=self.indent_list[-1]
 
     def doIndent(self):
         #print "indentation dans doIndent",len(self.indent_list)
@@ -235,141 +235,141 @@ class PARSEUR_PYTHON(object):
         self.out=self.out+self.indent_list[-1]
         self.buffer_indent=self.indent_list[-1]
         if self.lastcol+len(self.indent_list[-1]) > self.thiscol:
-           self.lastcol=self.thiscol
+            self.lastcol=self.thiscol
         else:
-           self.lastcol=self.lastcol+len(self.indent_list[-1])
+            self.lastcol=self.lastcol+len(self.indent_list[-1])
         self.please_indent = None
 
     def flush_buffer(self):
         #if self.buffer:
         #   print len(self.indent_list),self.please_indent
         for ob in self.buffer:
-           self.out= self.out+ str(ob)
-           self.doIndent()
+            self.out= self.out+ str(ob)
+            self.doIndent()
         self.buffer=[]
         self.objet_courant=None
 
     def NL(self, tstring):
         if self.affectation:
-           if self.paren_level == 0:
-              # affectation en cours mais complete
-              self.out= self.out+ str(self.affectation_courante)
-              self.affectation_courante=None
-              self.please_indent=1
-              self.affectation=0
-           else:
-              # affectation en cours, on ajoute
-              if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
-              self.affectation_courante.appendText(tstring)
-              return
-           
+            if self.paren_level == 0:
+                # affectation en cours mais complete
+                self.out= self.out+ str(self.affectation_courante)
+                self.affectation_courante=None
+                self.please_indent=1
+                self.affectation=0
+            else:
+                # affectation en cours, on ajoute
+                if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
+                self.affectation_courante.appendText(tstring)
+                return
+
         if self.objet_courant:
-           self.objet_courant=None
-           self.buffer.append(tstring)
+            self.objet_courant=None
+            self.buffer.append(tstring)
         #   self.please_indent = None
-           return
+            return
         self.output(tstring)
         self.please_indent = 1
 
     def COMMENT(self, tstring):
         liste= string.split(self.line,"##",1)
         if len(liste) > 1:
-           # On a trouve un double commentaire
-           before,after=liste
-           if self.affectation:
-              # affectation en cours, on ignore
-              pass
-           elif self.paren_level > 0:
-              self.output(tstring)
-           elif self.comment_flag and not self.pattern_ligne_non_blanche.search(before):
-              # il s'agit d'une commande commentarisee
-              if self.objet_courant == None:
-                 if not self.buffer:self.buffer_indent=self.indent_list[-1]
-                 self.objet_courant=COMMANDE_COMMENTARISEE()
-                 self.buffer.append(self.objet_courant)
-                 self.objet_courant.appendText(tstring)
-                 self.please_indent = None
-              elif isinstance(self.objet_courant,COMMENTAIRE):
-                 self.objet_courant=COMMANDE_COMMENTARISEE()
-                 self.buffer.append(self.objet_courant)
-                 self.objet_courant.appendText(tstring)
-                 self.please_indent = None
-              else:
-                 self.objet_courant.appendText(tstring)
-                 self.please_indent = None
-           else:
-              # commentaire inline
-              self.output(tstring)
-              self.please_indent = 1
-           return
+            # On a trouve un double commentaire
+            before,after=liste
+            if self.affectation:
+                # affectation en cours, on ignore
+                pass
+            elif self.paren_level > 0:
+                self.output(tstring)
+            elif self.comment_flag and not self.pattern_ligne_non_blanche.search(before):
+                # il s'agit d'une commande commentarisee
+                if self.objet_courant == None:
+                    if not self.buffer:self.buffer_indent=self.indent_list[-1]
+                    self.objet_courant=COMMANDE_COMMENTARISEE()
+                    self.buffer.append(self.objet_courant)
+                    self.objet_courant.appendText(tstring)
+                    self.please_indent = None
+                elif isinstance(self.objet_courant,COMMENTAIRE):
+                    self.objet_courant=COMMANDE_COMMENTARISEE()
+                    self.buffer.append(self.objet_courant)
+                    self.objet_courant.appendText(tstring)
+                    self.please_indent = None
+                else:
+                    self.objet_courant.appendText(tstring)
+                    self.please_indent = None
+            else:
+                # commentaire inline
+                self.output(tstring)
+                self.please_indent = 1
+            return
 
         else:
-           # On a un commentaire simple
-           new_line = self.line.split('#')[0]
-           if self.affectation:
-              # affectation en cours, on ignore
-              pass
-           elif self.paren_level > 0:
-              self.output(tstring)
-           elif self.comment_flag and not self.pattern_ligne_non_blanche.search(new_line):
-              # commentaire precede de blancs
-              if self.objet_courant == None:
-                 if not self.buffer:self.buffer_indent=self.indent_list[-1]
-                 self.objet_courant=COMMENTAIRE()
-                 self.buffer.append(self.objet_courant)
-                 self.objet_courant.appendText(tstring)
-                 self.please_indent = None
-              elif isinstance(self.objet_courant,COMMANDE_COMMENTARISEE):
-                 self.objet_courant=COMMENTAIRE()
-                 self.buffer.append(self.objet_courant)
-                 self.objet_courant.appendText(tstring)
-                 self.please_indent = None
-              else:
-                 self.objet_courant.appendText(tstring)
-                 self.please_indent = None
-           else:
-              # commentaire inline
-              self.output(tstring)
-              self.please_indent = 1
-           return
+            # On a un commentaire simple
+            new_line = self.line.split('#')[0]
+            if self.affectation:
+                # affectation en cours, on ignore
+                pass
+            elif self.paren_level > 0:
+                self.output(tstring)
+            elif self.comment_flag and not self.pattern_ligne_non_blanche.search(new_line):
+                # commentaire precede de blancs
+                if self.objet_courant == None:
+                    if not self.buffer:self.buffer_indent=self.indent_list[-1]
+                    self.objet_courant=COMMENTAIRE()
+                    self.buffer.append(self.objet_courant)
+                    self.objet_courant.appendText(tstring)
+                    self.please_indent = None
+                elif isinstance(self.objet_courant,COMMANDE_COMMENTARISEE):
+                    self.objet_courant=COMMENTAIRE()
+                    self.buffer.append(self.objet_courant)
+                    self.objet_courant.appendText(tstring)
+                    self.please_indent = None
+                else:
+                    self.objet_courant.appendText(tstring)
+                    self.please_indent = None
+            else:
+                # commentaire inline
+                self.output(tstring)
+                self.please_indent = 1
+            return
 
     def ERRORTOKEN(self, tstring):
         print("ERRORTOKEN", tstring)
 
     def NAME(self, tstring):
         if self.buffer:
-           self.updateIndent()
+            self.updateIndent()
         self.flush_buffer()
 
         if self.affectation ==1:
-           # on a une expression du type NAME=NAME
-           # on ne veut pas des expressions qui commencent par NAME=NAME(NAME=
-           # on en prend le chemin : on met affectation a 3 pour le signaler
-           # on attend d'en savoir plus
-           if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
-           self.affectation_courante.appendText(tstring)
-           self.affectation=3
-           return
+            # on a une expression du type NAME=NAME
+            # on ne veut pas des expressions qui commencent par NAME=NAME(NAME=
+            # on en prend le chemin : on met affectation a 3 pour le signaler
+            # on attend d'en savoir plus
+            if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
+            self.affectation_courante.appendText(tstring)
+            self.affectation=3
+            return
         elif self.affectation ==4:
-           # on a une expression qui commence par NAME=NAME(NAME
-           # il s'agit tres probablement d'une commande
-           # on annule l'affectation en cours
-           if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
-           self.affectation_courante.appendText(tstring)
-           self.affectation=5
-           return
+            # on a une expression qui commence par NAME=NAME(NAME
+            # il s'agit tres probablement d'une commande
+            # on annule l'affectation en cours
+            if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
+            self.affectation_courante.appendText(tstring)
+            self.affectation=5
+            return
         elif self.affectation == 2:
-           # affectation en cours, on ajoute
-           if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
-           self.affectation_courante.appendText(tstring)
-           self.affectation=2
-           return
+            # affectation en cours, on ajoute
+            if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
+            self.affectation_courante.appendText(tstring)
+            self.affectation=2
+            return
         self.affectation=0
         self.name=None
-        if self.paren_level == 0 and self.affectation_flag: 
-           # si on est en dehors de parentheses et en mode transformation d'affectation
-           # on initialise l'attribut name qui indique une affectation en cours
-           self.name=tstring
+        if self.paren_level == 0 and self.affectation_flag:
+            # si on est en dehors de parentheses et en mode transformation d'affectation
+            # on initialise l'attribut name qui indique une affectation en cours
+            self.name=tstring
         self.output(tstring)
 
     def ident(self, tstring):
@@ -380,11 +380,11 @@ class PARSEUR_PYTHON(object):
     def NUMBER(self, tstring):
         self.flush_buffer()
         if self.affectation>=1:
-           # affectation en cours, on ajoute
-           if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
-           self.affectation_courante.appendText(tstring)
-           self.affectation=2
-           return
+            # affectation en cours, on ajoute
+            if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
+            self.affectation_courante.appendText(tstring)
+            self.affectation=2
+            return
         self.output(tstring)
 
     def OP(self,tstring):
@@ -393,45 +393,45 @@ class PARSEUR_PYTHON(object):
         if tstring in (')',']','}'): self.paren_level=self.paren_level-1
 
         if tstring == '=' and self.affectation ==5:
-           # on a une expression qui commence par NAME=NAME(NAME=)
-           # il peut s'agir d'une commande
-           # on annule l'affectation en cours
-           self.out= self.out+ self.affectation_courante.texte
-           self.affectation_courante=None
-           self.name=None
-           self.affectation=0
+            # on a une expression qui commence par NAME=NAME(NAME=)
+            # il peut s'agir d'une commande
+            # on annule l'affectation en cours
+            self.out= self.out+ self.affectation_courante.texte
+            self.affectation_courante=None
+            self.name=None
+            self.affectation=0
         elif tstring == ')' and self.affectation ==4:
-           # on a une expression qui commence par NAME=NAME()
-           # il peut s'agir d'une commande
-           # on annule l'affectation en cours
-           self.out= self.out+ self.affectation_courante.texte
-           self.affectation_courante=None
-           self.affectation=0
+            # on a une expression qui commence par NAME=NAME()
+            # il peut s'agir d'une commande
+            # on annule l'affectation en cours
+            self.out= self.out+ self.affectation_courante.texte
+            self.affectation_courante=None
+            self.affectation=0
         elif tstring == '(' and self.affectation == 3:
-           # on a deja trouve NAME=NAME
-           # on passe affectation a 4
-           if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
-           self.affectation_courante.appendText(tstring)
-           self.affectation=4
-           return
+            # on a deja trouve NAME=NAME
+            # on passe affectation a 4
+            if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
+            self.affectation_courante.appendText(tstring)
+            self.affectation=4
+            return
         elif tstring == ';' and self.affectation>=1:
-           # l'affectation est terminee
-           self.out= self.out+ str(self.affectation_courante)
-           self.affectation_courante=None
-           self.please_indent=1
-           self.affectation=0
+            # l'affectation est terminee
+            self.out= self.out+ str(self.affectation_courante)
+            self.affectation_courante=None
+            self.please_indent=1
+            self.affectation=0
         elif self.affectation>=1:
-           # on complete l'affectation
-           if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
-           self.affectation_courante.appendText(tstring)
-           self.affectation=2
-           return
+            # on complete l'affectation
+            if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
+            self.affectation_courante.appendText(tstring)
+            self.affectation=2
+            return
 
         self.affectation=0
-        if self.name and tstring=='=': 
-           self.affectation=1
-           self.affectation_courante=AFFECTATION()
-           self.affectation_courante.name=self.name
+        if self.name and tstring=='=':
+            self.affectation=1
+            self.affectation_courante=AFFECTATION()
+            self.affectation_courante.name=self.name
         self.output(tstring)
 
     ENDMARKER = ident
@@ -439,37 +439,37 @@ class PARSEUR_PYTHON(object):
 
     def INDENT(self, tstring):
         #tstring=str(len(self.indent_list))*len(tstring)
-        self.indent_list.append(tstring) 
+        self.indent_list.append(tstring)
         #print "indentation dans INDENT",len(self.indent_list),len(tstring)
         self.affectation=0
         if self.buffer:
-           self.updateIndent()
+            self.updateIndent()
         self.flush_buffer()
 
     def DEDENT(self, tstring):
         #print "DEDENT",tstring,len(tstring)
         if self.buffer:
-           self.out= self.out+ str(self.buffer[0])
-           if len(self.buffer) > 1:
-              for ob in self.buffer[1:]:
-                  self.doIndent()
-                  self.out= self.out+ str(ob)
-           self.buffer=[]
-           self.objet_courant=None
-           self.please_indent=1
+            self.out= self.out+ str(self.buffer[0])
+            if len(self.buffer) > 1:
+                for ob in self.buffer[1:]:
+                    self.doIndent()
+                    self.out= self.out+ str(ob)
+            self.buffer=[]
+            self.objet_courant=None
+            self.please_indent=1
 
         self.affectation=0
-        self.indent_list = self.indent_list[:-1] 
+        self.indent_list = self.indent_list[:-1]
         #print "indentation dans DEDENT",len(self.indent_list)
 
     def STRING(self, tstring):
         self.flush_buffer()
         if self.affectation>=1:
-           # affectation en cours, on ajoute
-           if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
-           self.affectation_courante.appendText(tstring)
-           self.affectation=2
-           return
+            # affectation en cours, on ajoute
+            if self.thiscol > self.lastcol :self.affectation_courante.appendText((self.thiscol - self.lastcol)*" ")
+            self.affectation_courante.appendText(tstring)
+            self.affectation=2
+            return
         self.output(tstring)
 
 if __name__ == "__main__" :
@@ -528,7 +528,7 @@ TEST_TABLE( TABLE=RELV[k],
                FILTRE=(
                         _F( NOM_PARA = 'QUANTITE',
                             VALE_K = 'MAXIMUM'),),
-        # commentaire 
+        # commentaire
                NOM_PARA='VMIS',  # comm
                VALE=1.9669824189084E9,
                REFERENCE='NON_REGRESSION',
@@ -770,7 +770,7 @@ for k in range(1,10):
 #comm
 
                if t:
-                 a=5  
+                 a=5
 #comm
 if 1:
   a=2
@@ -818,7 +818,7 @@ for k in range(1,10):
 
    f=open("coque.geo","w")
 #comm
-   if 1: 
+   if 1:
       if 2:
          if 3:
             a=1
@@ -896,12 +896,12 @@ def POST_GOUJ_ops(self,TABLE):
 
 """
     if len(sys.argv)== 2:
-       progname, input = sys.argv
-       f=open(input)
-       t=f.read()
-       f.close()
+        progname, input = sys.argv
+        f=open(input)
+        t=f.read()
+        f.close()
     else:
-       t=text
+        t=text
     txt = PARSEUR_PYTHON(t).getTexte()
     print (txt)
     compile(txt,"<string>",'exec')
index 9862ff098d6275a7cdc5a9c7f29d9a9e15198181..26d74151311d575e65f696a74d8f8796db516535 100644 (file)
@@ -27,9 +27,9 @@ from Extensions.i18n import tr
 
 from convert.convert_python import Pythonparser
 try:
-  basestring
+    basestring
 except NameError:
-  basestring = str
+    basestring = str
 
 pattern_comment_slash        = re.compile(r"^\s*/")
 pattern_comment_slash_vide   = re.compile(r"^\s*/\s*$")
@@ -75,405 +75,425 @@ from Extensions import localisation
 
 
 def entryPoint():
-   """
-   Return a dictionary containing the description needed to load the plugin
-   """
-   return {
-          'name' : 'TELEMAC',
-          'factory' : TELEMACparser
-          }
+    """
+    Return a dictionary containing the description needed to load the plugin
+    """
+    return {
+           'name' : 'TELEMAC',
+           'factory' : TELEMACparser
+           }
 
 class TELEMACparser(Pythonparser):
-   """
-   This converter works like Pythonparser, except that it also initializes all
-   model variables to None in order to avoid Python syntax errors when loading
-   a file with a different or inexistent definition of variables.
-   """
-
-   
-
-   def convert(self, outformat, appliEficas=None):
-
-
-      from Accas import A_BLOC, A_FACT, A_SIMP
-      try :
-        self.dicoCasToCata = appliEficas.readercata.dicoCasToCata
-      except :
-        self.dicoCasToCata = {}
-        print ('pas de dicoCasToCata')
-      self.dicoInverse              = appliEficas.readercata.dicoInverse
-      self.dicoMC                   = appliEficas.readercata.dicoMC
-      self.Ordre_Des_Commandes      = appliEficas.readercata.Ordre_Des_Commandes
-      try :
-        self.TelemacdicoEn            = appliEficas.readercata.TelemacdicoEn
-      except :
-        self.TelemacdicoEn = {}
-        print ('pas de TelemacdicoEn')
-      try :
-        self.DicoEnumCasFrToEnumCasEn = appliEficas.readercata.DicoEnumCasFrToEnumCasEn
-      except :
-        self.DicoEnumCasFrToEnumCasEn = {}
-        print ('pas de DicoEnumCasFrToEnumCasEn')
-      
-
-      if appliEficas.langue=='fr' :
-          #from enum_Telemac2d_auto       import DicoEnumCasFrToEnumCasEn
-          for k in self.DicoEnumCasFrToEnumCasEn :
-              self.TelemacdicoEn[k]=self.DicoEnumCasFrToEnumCasEn[k]
-
-      text=""
-      self.dictSimp={}
-
-      l_lignes_texte_all = self.text.split('\n')
-      l_lignes_texte = []
-      listeComment = []
-      dicoComment={}
-      dicoCommentSimp={}
-      dicoCommentMC={}
-      texteComment=""
-      debut=True
-      trouveComment = 0
-      for l  in l_lignes_texte_all :
-        if pattern_eta.match(l) : continue
-        if pattern_fin.match(l) : continue
-        if pattern_blanc.match(l) : continue
-
-        if not(pattern_comment_slash.match(l)):
-              l_lignes_texte.append(l)
-              if trouveComment :
-                 if debut:  dicoComment['debut']=texteComment
-                 else : dicoComment[l]=texteComment
-                 trouveComment = 0
-                 texteComment=""
-              if debut : debut = False
-
-        if pattern_comment_slash.match(l):
-             #if pattern_comment_slash_vide.match(l) : continue
-             if pattern_comment_tiret.match(l) : continue
-             texteComment+=l.replace ('/','',1)
-             texteComment+='\n'
-             trouveComment=1
-
-      if texteComment != "" : dicoComment['fin']= texteComment
-
-
-      l_lignes=[]
-      i=0
-      while (i < len(l_lignes_texte)) :
-          ligne=l_lignes_texte[i]
-          i=i+1
-          if not(pattern_finit_par_virgule_ou_affect.match(ligne)):
-             l_lignes.append(ligne)
-             continue
-          nouvelle_ligne=ligne
-          while (i < len(l_lignes_texte)):
-             ligne_traitee=l_lignes_texte[i]
-             i=i+1
-             nouvelle_ligne += ligne_traitee
-             if not(pattern_finit_par_virgule_ou_affect.match(ligne_traitee)):
-                l_lignes.append(nouvelle_ligne)
-                break
-
-
-      for ligne in l_lignes :
-          if pattern_comment_slash.match(ligne) : continue
-          #PN : deja teste
-          #if pattern_eta.match(ligne) : continue
-          #if pattern_fin.match(ligne) : continue
-          #if pattern_blanc.match(ligne) : continue
-
-
-          finLigne=ligne
-          while finLigne != "" :
-              if pattern_comment_slash.match(finLigne) : finLigne=""; continue
-              valeur=""
-              if pattern_variables.match(finLigne) :
-                 m=pattern_variables.match(finLigne)
-                 simpCas=self.traiteIdent(m.group('ident'))
-                 valeur=m.group('valeur')
-                 finLigne=m.group('reste')
-                 self.dictSimp[simpCas]=valeur
-                 continue
-
-
-              m=pattern_ligne.match(finLigne)
-              if m == None :
-                 #print( "________________________________________________")
-                 print ('pb avec ****', finLigne , '**** dans ', ligne)
-                 #print( "________________________________________________")
-                 break
-
-              simpCas=self.traiteIdent(m.group('ident'))
-              if not simpCas :
-                 finLigne=m.group('reste')
-                 continue
-
-              finLigne=m.group('reste')
-              # attention, l ordre des if est important
-              if pattern_liste.match(finLigne) :
-                 m=pattern_liste.match(finLigne)
-              elif pattern_liste_texte.match(finLigne) :
-                 m=pattern_liste_texte.match(finLigne)
-              elif pattern_texteQuote.match(finLigne) :
-                 m=pattern_texteQuote.match(finLigne)
-              elif pattern_flottant.match(finLigne) :
-                 m=pattern_flottant.match(finLigne)
-              elif pattern_texteVide.match(finLigne):
-                 m=pattern_texteVide.match(finLigne)
-              elif pattern_texteSimple.match(finLigne):
-                 m=pattern_texteSimple.match(finLigne)
-              else :
-                 #print ("________________________________________________")
-                 print ('pb avec ****', finLigne , '**** dans ', ligne)
-                 print ("non match")
-                 #print ("________________________________________________")
-                 break
-
-
-              valeur=m.group('valeur')
-              if pattern_blanc.match(valeur) : valeur=None
-
-              if pattern_flottant.match(finLigne) :
-                 valeur=re.sub("d","e",valeur)
-                 valeur=re.sub("D","E",valeur)
-
-              if pattern_liste.match(finLigne) or pattern_liste_texte.match(finLigne):
-                 valeur=valeur.split(";")
-
-
-              finLigne=m.group('reste')
-              self.dictSimp[simpCas]=valeur
-
-              if ligne in dicoComment.keys():
-                 dicoCommentSimp[simpCas]=dicoComment[ligne]
-
-      if 'TITLE' not in self.dictSimp :
-          import os
-          #self.dictSimp['TITLE']=os.path.basename(self.filename)
-
-
-      dicoParMC={}
-      for simp in self.dictSimp:
-          if simp in TELEMACparser.__dict__ : TELEMACparser.__dict__[simp](self,)
-
-      for simp in self.dictSimp:
-          if simp not in self.dicoInverse :
-             #print ( "************")
-             print  ("pb avec dans dicoInverse", simp,'------')
-             print("dicoInverse",sorted(self.dicoInverse.keys()))
-             #print  ("************")
-             continue
-          listeGenea=self.dicoInverse[simp]
-          listeGeneaReverse=[]
-          for (u,v) in listeGenea :
-              if isinstance(v,A_BLOC.BLOC): continue
-              listeGeneaReverse.append(u)
-          listeGeneaReverse.reverse()
-          dicoTravail=dicoParMC
-          i=0
-          if simp in dicoCommentSimp :
-             MC=listeGeneaReverse[0]
-             if MC in dicoCommentMC : dicoCommentMC[MC]+dicoCommentSimp[simp]
-             else                   : dicoCommentMC[MC]=dicoCommentSimp[simp]
-          while i < len(listeGeneaReverse[0:-1]) :
-            mot=listeGeneaReverse[i]
+    """
+    This converter works like Pythonparser, except that it also initializes all
+    model variables to None in order to avoid Python syntax errors when loading
+    a file with a different or inexistent definition of variables.
+    """
+
+
+
+    def convert(self, outformat, appliEficas=None):
+
+
+        from Accas import A_BLOC, A_FACT, A_SIMP
+        try :
+            self.dicoCasToCata = appliEficas.readercata.dicoCasToCata
+        except :
+            self.dicoCasToCata = {}
+            print ('pas de dicoCasToCata')
+        self.dicoInverse              = appliEficas.readercata.dicoInverse
+        self.dicoMC                   = appliEficas.readercata.dicoMC
+        self.Ordre_Des_Commandes      = appliEficas.readercata.Ordre_Des_Commandes
+        try :
+            self.TelemacdicoEn            = appliEficas.readercata.TelemacdicoEn
+        except :
+            self.TelemacdicoEn = {}
+            print ('pas de TelemacdicoEn')
+        try :
+            self.DicoEnumCasFrToEnumCasEn = appliEficas.readercata.DicoEnumCasFrToEnumCasEn
+        except :
+            self.DicoEnumCasFrToEnumCasEn = {}
+            print ('pas de DicoEnumCasFrToEnumCasEn')
+
+
+        if appliEficas.langue=='fr' :
+            #from enum_Telemac2d_auto       import DicoEnumCasFrToEnumCasEn
+            for k in self.DicoEnumCasFrToEnumCasEn :
+                self.TelemacdicoEn[k]=self.DicoEnumCasFrToEnumCasEn[k]
+
+        text=""
+        self.dictSimp={}
+
+        l_lignes_texte_all = self.text.split('\n')
+        l_lignes_texte = []
+        listeComment = []
+        dicoComment={}
+        dicoCommentSimp={}
+        dicoCommentMC={}
+        texteComment=""
+        debut=True
+        trouveComment = 0
+        for l  in l_lignes_texte_all :
+            if pattern_eta.match(l) : continue
+            if pattern_fin.match(l) : continue
+            if pattern_blanc.match(l) : continue
+
+            if not(pattern_comment_slash.match(l)):
+                l_lignes_texte.append(l)
+                if trouveComment :
+                    if debut:  dicoComment['debut']=texteComment
+                    else : dicoComment[l]=texteComment
+                    trouveComment = 0
+                    texteComment=""
+                if debut : debut = False
+
+            if pattern_comment_slash.match(l):
+                #if pattern_comment_slash_vide.match(l) : continue
+                if pattern_comment_tiret.match(l) : continue
+                texteComment+=l.replace ('/','',1)
+                texteComment+='\n'
+                trouveComment=1
+
+        if texteComment != "" : dicoComment['fin']= texteComment
+
+
+        l_lignes=[]
+        i=0
+        while (i < len(l_lignes_texte)) :
+            ligne=l_lignes_texte[i]
             i=i+1
-            if mot not in dicoTravail: dicoTravail[mot]={}
-            dicoTravail=dicoTravail[mot]
-          dicoTravail[simp]=self.dictSimp[simp]
-
-      self.textePy=""
-      listeMC=self.tri(list(dicoParMC.keys()))
-      for k in listeMC :
-          if k in dicoCommentMC :
+            if not(pattern_finit_par_virgule_ou_affect.match(ligne)):
+                l_lignes.append(ligne)
+                continue
+            nouvelle_ligne=ligne
+            while (i < len(l_lignes_texte)):
+                ligne_traitee=l_lignes_texte[i]
+                i=i+1
+                nouvelle_ligne += ligne_traitee
+                if not(pattern_finit_par_virgule_ou_affect.match(ligne_traitee)):
+                    l_lignes.append(nouvelle_ligne)
+                    break
+
+
+        for ligne in l_lignes :
+            if pattern_comment_slash.match(ligne) : continue
+            #PN : deja teste
+            #if pattern_eta.match(ligne) : continue
+            #if pattern_fin.match(ligne) : continue
+            #if pattern_blanc.match(ligne) : continue
+
+
+            finLigne=ligne
+            while finLigne != "" :
+                if pattern_comment_slash.match(finLigne) : finLigne=""; continue
+                valeur=""
+                if pattern_variables.match(finLigne) :
+                    m=pattern_variables.match(finLigne)
+                    simpCas=self.traiteIdent(m.group('ident'))
+                    if simpCas in ["COUPLING WITH", "COUPLAGE AVEC"]:
+                        if "," in m.group('valeur'):
+                            valeur=m.group('valeur').split(",")
+                        else:
+                            valeur=m.group('valeur').split(";")
+                    else:
+                        valeur=m.group('valeur')
+                    finLigne=m.group('reste')
+                    self.dictSimp[simpCas]=valeur
+                    continue
+
+
+                m=pattern_ligne.match(finLigne)
+                if m == None :
+                    #print( "________________________________________________")
+                    print ('pb avec ****', finLigne , '**** dans ', ligne)
+                    #print( "________________________________________________")
+                    break
+
+                simpCas=self.traiteIdent(m.group('ident'))
+                if not simpCas :
+                    finLigne=m.group('reste')
+                    continue
+
+                finLigne=m.group('reste')
+                # attention, l ordre des if est important
+                if pattern_liste.match(finLigne) :
+                    m=pattern_liste.match(finLigne)
+                elif pattern_liste_texte.match(finLigne) :
+                    m=pattern_liste_texte.match(finLigne)
+                elif pattern_texteQuote.match(finLigne) :
+                    m=pattern_texteQuote.match(finLigne)
+                elif pattern_flottant.match(finLigne) :
+                    m=pattern_flottant.match(finLigne)
+                elif pattern_texteVide.match(finLigne):
+                    m=pattern_texteVide.match(finLigne)
+                elif pattern_texteSimple.match(finLigne):
+                    m=pattern_texteSimple.match(finLigne)
+                else :
+                    #print ("________________________________________________")
+                    print ('pb avec ****', finLigne , '**** dans ', ligne)
+                    print ("non match")
+                    #print ("________________________________________________")
+                    break
+
+
+                valeur=m.group('valeur')
+                if pattern_blanc.match(valeur) : valeur=None
+
+                if pattern_flottant.match(finLigne) :
+                    valeur=re.sub("d","e",valeur)
+                    valeur=re.sub("D","E",valeur)
+
+                if pattern_liste.match(finLigne) or \
+                   pattern_liste_texte.match(finLigne):
+                    valeur=valeur.split(";")
+
+
+                finLigne=m.group('reste')
+                self.dictSimp[simpCas]=valeur
+
+                if ligne in dicoComment.keys():
+                    dicoCommentSimp[simpCas]=dicoComment[ligne]
+
+        if 'TITLE' not in self.dictSimp :
+            import os
+            #self.dictSimp['TITLE']=os.path.basename(self.filename)
+
+
+        dicoParMC={}
+        for simp in self.dictSimp:
+            if simp in TELEMACparser.__dict__ : TELEMACparser.__dict__[simp](self,)
+
+        for simp in self.dictSimp:
+            if simp not in self.dicoInverse :
+                #print ( "************")
+                print  ("pb avec dans dicoInverse", simp,'------')
+                print("dicoInverse",sorted(self.dicoInverse.keys()))
+                #print  ("************")
+                continue
+            listeGenea=self.dicoInverse[simp]
+            listeGeneaReverse=[]
+            for (u,v) in listeGenea :
+                if isinstance(v,A_BLOC.BLOC): continue
+                listeGeneaReverse.append(u)
+            listeGeneaReverse.reverse()
+            dicoTravail=dicoParMC
+            i=0
+            if simp in dicoCommentSimp :
+                MC=listeGeneaReverse[0]
+                if MC in dicoCommentMC : dicoCommentMC[MC]+dicoCommentSimp[simp]
+                else                   : dicoCommentMC[MC]=dicoCommentSimp[simp]
+            while i < len(listeGeneaReverse[0:-1]) :
+                mot=listeGeneaReverse[i]
+                i=i+1
+                if mot not in dicoTravail: dicoTravail[mot]={}
+                dicoTravail=dicoTravail[mot]
+            dicoTravail[simp]=self.dictSimp[simp]
+
+        self.textePy=""
+        listeMC=self.tri(list(dicoParMC.keys()))
+        for k in listeMC :
+            if k in dicoCommentMC :
                 commentaire="COMMENTAIRE("+repr(dicoCommentMC[k])+")\n"
                 self.textePy+=commentaire
-          self.textePy += str(k )+ "("
-          self.traiteMC(dicoParMC[k])
-          self.textePy += ");\n"
-
-
-      # ne sert plus
-      #appliEficas.listeTelemac=self.dictSimp
-      appliEficas.listeTelemac={}
-      if 'debut' in dicoComment :
-          commentaire="COMMENTAIRE("+repr(dicoComment['debut'])+")\n"
-          self.textePy=commentaire+self.textePy
-      if 'fin' in dicoComment :
-          commentaire="COMMENTAIRE("+repr(dicoComment['fin'])+")\n"
-          self.textePy=self.textePy+commentaire
-
-      #print (self.textePy)
-      return self.textePy
-
-
-   #----------------------------------------
-   def traiteIdent(self,ident):
-   # enleve les espaces de part et autre
-   # traduit du langage Telemac vers le langage Catalogue
-   #----------------------------------------
-          while ident[-1] == " " or ident[-1] == '\t' : ident=ident[0:-1]
-          while ident[0]  == " " or ident[0]  == '\t' : ident=ident[1:]
-          try : identCata=self.dicoCasToCata[ident]
-          except :
+            self.textePy += str(k )+ "("
+            self.traiteMC(dicoParMC[k])
+            self.textePy += ");\n"
+
+
+        # ne sert plus
+        #appliEficas.listeTelemac=self.dictSimp
+        appliEficas.listeTelemac={}
+        if 'debut' in dicoComment :
+            commentaire="COMMENTAIRE("+repr(dicoComment['debut'])+")\n"
+            self.textePy=commentaire+self.textePy
+        if 'fin' in dicoComment :
+            commentaire="COMMENTAIRE("+repr(dicoComment['fin'])+")\n"
+            self.textePy=self.textePy+commentaire
+
+        #print (self.textePy)
+        return self.textePy
+
+
+    #----------------------------------------
+    def traiteIdent(self,ident):
+    # enleve les espaces de part et autre
+    # traduit du langage Telemac vers le langage Catalogue
+    #----------------------------------------
+        while ident[-1] == " " or ident[-1] == '\t' : ident=ident[0:-1]
+        while ident[0]  == " " or ident[0]  == '\t' : ident=ident[1:]
+        try : identCata=self.dicoCasToCata[ident]
+        except :
             print ( "---> ", "pb mot clef  pour", ident)
             identCata=None
-          return identCata
-
-
-   def traiteMC(self,dico) :
-       from Accas import A_BLOC, A_FACT, A_SIMP
-       for k in dico :
-           valeur= dico[k]
-           if k not in self.dicoMC : kA=self.dicoFrancaisAnglais[k]
-           else : kA=k
-           obj=self.dicoMC[kA]
-           if isinstance(obj,A_FACT.FACT):   self.convertFACT(obj,kA,valeur)
-           elif isinstance(obj,A_BLOC.BLOC): self.convertBLOC(obj,kA,valeur)
-           elif isinstance(obj,A_SIMP.SIMP): self.convertSIMP(obj,kA,valeur)
-           else : print ("%%%%%%%%%%%\n", "pb conversion type pour", k, obj, "\n%%%%%%%%%%%")
-
-
-   def convertFACT(self,obj,nom,valeur):
-       # traitement LIQUID_BOUNDARIES
-       if nom in TELEMACparser.__dict__ :
-          TELEMACparser.__dict__[nom](self,)
-          return
-       self.textePy +=  nom + "=_F( "
-       self.traiteMC(valeur)
-       self.textePy += '),\n'
-
-
-   def convertBLOC(self,obj,nom,valeur):
-       print ("ANOMALIE _________ BLOC ")
-       print (nom)
-
-   def convertSIMP(self,obj,nom,valeur):
-       #print ('in convertSIMP', nom,valeur)
-       #if nom in ("PRESCRIBED_FLOWRATES", "PRESCRIBED_VELOCITIES", "PRESCRIBED_ELEVATIONS" ): return
-       if obj.max==1 :
-          if hasattr(obj.type[0],'ntuple') :
-             lval=[]
-             for v in valeur :
-               try :    v=eval(v,{})
-               except : pass
-               lval.append(v)
-             self.textePy += nom + "=" + str(lval) +","
-             return
-          if 'TXM' in obj.type :
-
-              if pattern_ContientDouble.match(str(valeur)):
-                 valeur=re.sub("''","\'\'",str(valeur))
-                 self.textePy += nom + "=" + str(valeur) +","
-                 return
-              valeur=str(valeur)
-
-              # ceinture et bretelle si les re sont correctes -)
-              while valeur[-1] == " " or valeur[-1] == '\t' : valeur=valeur[0:-1]
-              while valeur[0]  == " " or valeur[0]  == '\t' : valeur=valeur[1:]
-
-
-
-          # Pour les enum
-          try    : valeur=eval(valeur,{})
-          except : pass
-
-          if nom in self.TelemacdicoEn:
-             try    :
-               valeur=self.TelemacdicoEn[nom][valeur]
-               self.textePy += nom + "= '" + str(valeur) +"',"
-               return
-             except : pass
-
-
-          if obj.into != [] and obj.into != None and not('R' in obj.type) and not('I' in obj.type):
-             for possible in obj.into :
-                try :
-                  if possible.upper() == valeur.upper():
-                     valeur=possible
-                     break
-                  v=valeur[0].upper()+valeur[1:].lower()
-                  v2=tr(v)
-                  if possible.upper() == v2.upper():
-                     valeur=possible
-                     break
-                except:
-                   if valeur != None :
-                      print ("pb avec le type de ", obj.nom, obj.type, 'et la valeur ', valeur)
-
-          if 'Fichier' in obj.type or 'TXM' in obj.type or 'Repertoire' in obj.type or 'FichierOuRepertoire' in obj.type :
-              valeur=str(valeur)
-              if valeur == "" or valeur == " " :
-                 self.textePy += nom + "= '" + str(valeur) +"' ,"
-                 return
-              while valeur[-1] == " " : valeur=valeur[0:-1]
-              while valeur[0]  == " " : valeur=valeur[1:]
-              self.textePy += nom + "= '" + str(valeur) +"' ,"
-              return
-
-          if bool in obj.type :
-            if   valeur == True  :  self.textePy += nom + "= True,"
-            elif valeur == False :  self.textePy += nom + "= False,"
-            elif pattern_oui.match(valeur) : self.textePy += nom + "= True,"
-            elif pattern_non.match(valeur) : self.textePy += nom + "= False,"
-            else :  self.textePy += nom + "= None,"
+        return identCata
+
+
+    def traiteMC(self,dico) :
+        from Accas import A_BLOC, A_FACT, A_SIMP
+        for k in dico :
+            valeur= dico[k]
+            if k not in self.dicoMC : kA=self.dicoFrancaisAnglais[k]
+            else : kA=k
+            obj=self.dicoMC[kA]
+            if isinstance(obj,A_FACT.FACT):   self.convertFACT(obj,kA,valeur)
+            elif isinstance(obj,A_BLOC.BLOC): self.convertBLOC(obj,kA,valeur)
+            elif isinstance(obj,A_SIMP.SIMP): self.convertSIMP(obj,kA,valeur)
+            else : print ("%%%%%%%%%%%\n", "pb conversion type pour", k, obj, "\n%%%%%%%%%%%")
+
+
+    def convertFACT(self,obj,nom,valeur):
+        # traitement LIQUID_BOUNDARIES
+        if nom in TELEMACparser.__dict__ :
+            TELEMACparser.__dict__[nom](self,)
             return
-          self.textePy += nom + "=" + str(valeur) +","
-
-       else :
-          if valeur == () or valeur ==[] or pattern_listeVide.match(str(valeur)) :
-             self.textePy += nom + "= None,"
-             return
-
-          # les 4 lignes suivantes sont probablement inutiles
-          while valeur[-1] == " " or  valeur[-1]=="'" : valeur=valeur[0:-1]
-          while valeur[0]  == " " or  valeur[-0]=="'" : valeur=valeur[1:]
-          oldValeur=valeur
-          if isinstance(valeur, basestring) :
-             if   ";" in valeur : valeur=valeur.split(';')
-             else  : valeur=valeur.split(',')
-
-          if len(valeur)< 2 and pattern_flottant.match(oldValeur):
-          # Attention : on attend une liste mais on a une seule valeur!
-             try :    oldValeur=eval(oldValeur,{})
-             except : pass
-             if nom in self.TelemacdicoEn :
-                v=self.TelemacdicoEn[nom][oldValeur]
-                self.textePy += nom + "= ('" + str(v) +"',),"
-             else :
-                self.textePy += nom + "= (" + str(oldValeur) +",),"
-             return
-
-
-          if valeur == None : return
-          newVal=[]
-          for v in valeur :
-            try :    v=eval(v,{})
+        self.textePy +=  nom + "=_F( "
+        self.traiteMC(valeur)
+        self.textePy += '),\n'
+
+
+    def convertBLOC(self,obj,nom,valeur):
+        print ("ANOMALIE _________ BLOC ")
+        print (nom)
+
+    def convertSIMP(self,obj,nom,valeur):
+        #print ('in convertSIMP', nom,valeur)
+        #if nom in ("PRESCRIBED_FLOWRATES", "PRESCRIBED_VELOCITIES", "PRESCRIBED_ELEVATIONS" ): return
+        if obj.max==1 :
+            if hasattr(obj.type[0],'ntuple') :
+                lval=[]
+                for v in valeur :
+                    try :    v=eval(v,{})
+                    except : pass
+                    lval.append(v)
+                self.textePy += nom + "=" + str(lval) +","
+                return
+            if 'TXM' in obj.type :
+
+                if pattern_ContientDouble.match(str(valeur)):
+                    valeur=re.sub("''","\'\'",str(valeur))
+                    self.textePy += nom + "=" + str(valeur) +","
+                    return
+                valeur=str(valeur)
+
+                # ceinture et bretelle si les re sont correctes -)
+                while valeur[-1] == " " or valeur[-1] == '\t' : valeur=valeur[0:-1]
+                while valeur[0]  == " " or valeur[0]  == '\t' : valeur=valeur[1:]
+
+
+
+            # Pour les enum
+            try    : valeur=eval(valeur,{})
             except : pass
+
             if nom in self.TelemacdicoEn:
-               try    : v=self.TelemacdicoEn[nom][v]
-               except : pass
-            newVal.append(v)
-          self.textePy += nom + "=" + str(newVal) +","
-
-
-
-   def tri(self, listeIn):
-      if len(listeIn) == 1 : return listeIn
-      if self.Ordre_Des_Commandes == None : return listeIn
-      listeOut=[listeIn[0],]
-      for k in listeIn[1:]:
-          #k=str(self.dicoFrancaisAnglais[kF])
-          ordreK=self.Ordre_Des_Commandes.index(k)
-          i=0
-          while i < len(listeOut):
-             #ordreI=self.Ordre_Des_Commandes.index(self.dicoFrancaisAnglais[listeOut[i]])
-             ordreI=self.Ordre_Des_Commandes.index(listeOut[i])
-             if ordreK < ordreI : break
-             i=i+1
-          #listeOut.insert(i,kF)
-          listeOut.insert(i,k)
-      return listeOut
+                try    :
+                    valeur=self.TelemacdicoEn[nom][valeur]
+                    self.textePy += nom + "= '" + str(valeur) +"',"
+                    return
+                except : pass
+
+
+            if obj.into != [] and obj.into != None and not('R' in obj.type) and not('I' in obj.type):
+                for possible in obj.into :
+                    try :
+                        if possible.upper() == valeur.upper():
+                            valeur=possible
+                            break
+                        v=valeur[0].upper()+valeur[1:].lower()
+                        v2=tr(v)
+                        if possible.upper() == v2.upper():
+                            valeur=possible
+                            break
+                    except:
+                        if valeur != None :
+                            print ("pb avec le type de ", obj.nom, obj.type, 'et la valeur ', valeur)
+
+            if 'Fichier' in obj.type or 'TXM' in obj.type or 'Repertoire' in obj.type or 'FichierOuRepertoire' in obj.type :
+                valeur=str(valeur)
+                if valeur == "" or valeur == " " :
+                    self.textePy += nom + "= '" + str(valeur) +"' ,"
+                    return
+                while valeur[-1] == " " : valeur=valeur[0:-1]
+                while valeur[0]  == " " : valeur=valeur[1:]
+                self.textePy += nom + "= '" + str(valeur) +"' ,"
+                return
+
+            if bool in obj.type :
+                if   valeur == True  :  self.textePy += nom + "= True,"
+                elif valeur == False :  self.textePy += nom + "= False,"
+                elif pattern_oui.match(valeur) : self.textePy += nom + "= True,"
+                elif pattern_non.match(valeur) : self.textePy += nom + "= False,"
+                else :  self.textePy += nom + "= None,"
+                return
+            self.textePy += nom + "=" + str(valeur) +","
+
+        else :
+            if valeur == () or valeur ==[] or pattern_listeVide.match(str(valeur)) :
+                self.textePy += nom + "= None,"
+                return
+
+            # les 4 lignes suivantes sont probablement inutiles
+            while valeur[-1] == " " or  valeur[-1]=="'" : valeur=valeur[0:-1]
+            while valeur[0]  == " " or  valeur[-0]=="'" : valeur=valeur[1:]
+            oldValeur=valeur
+            if isinstance(valeur, basestring) :
+                if   ";" in valeur : valeur=valeur.split(';')
+                else  : valeur=valeur.split(',')
+
+            if len(valeur)< 2 and pattern_flottant.match(oldValeur):
+            # Attention : on attend une liste mais on a une seule valeur!
+                try :    oldValeur=eval(oldValeur,{})
+                except : pass
+                if nom in self.TelemacdicoEn :
+                    v=self.TelemacdicoEn[nom][oldValeur]
+                    self.textePy += nom + "= ('" + str(v) +"',),"
+                else :
+                    self.textePy += nom + "= (" + str(oldValeur) +",),"
+                return
+
+            # Cas des liste de booléen
+            if bool in obj.type:
+                values = []
+                for val in valeur:
+                    if val == True or pattern_oui.match(val) or val == 'True':
+                        values.append('True')
+                    elif val == False or pattern_non.match(val) or val == 'False':
+                        values.append('False')
+                    else:
+                        values.append('None')
+                self.textePy += nom + "= [" + ','.join(values) + '],'
+                return
+
+
+            if valeur == None : return
+            newVal=[]
+            for v in valeur :
+                try :    v=eval(v,{})
+                except : pass
+                if nom in self.TelemacdicoEn:
+                    try    : v=self.TelemacdicoEn[nom][v]
+                    except : pass
+                newVal.append(v)
+            self.textePy += nom + "=" + str(newVal) +","
+
+
+
+    def tri(self, listeIn):
+        if len(listeIn) == 1 : return listeIn
+        if self.Ordre_Des_Commandes == None : return listeIn
+        listeOut=[listeIn[0],]
+        for k in listeIn[1:]:
+            #k=str(self.dicoFrancaisAnglais[kF])
+            ordreK=self.Ordre_Des_Commandes.index(k)
+            i=0
+            while i < len(listeOut):
+                #ordreI=self.Ordre_Des_Commandes.index(self.dicoFrancaisAnglais[listeOut[i]])
+                ordreI=self.Ordre_Des_Commandes.index(listeOut[i])
+                if ordreK < ordreI : break
+                i=i+1
+            #listeOut.insert(i,kF)
+            listeOut.insert(i,k)
+        return listeOut
 
 #   def BOUNDARY_CONDITIONS(self):
 #       texte_Boundaries="BOUNDARY_CONDITIONS=_F(LIQUID_BOUNDARIES=( "
index 68e226ba4e8fd08c3701ed4561bbf706d8ce7249..7a6be7b06677eb893ae0c3c67e8bc4c5668ccb4d 100644 (file)
@@ -30,50 +30,46 @@ from Noyau import N_CR
 
 
 def entryPoint():
-   """
-   Return a dictionary containing the description needed to load the plugin
-   """
-   return {
-          'name' : 'xml',
-          'factory' : XMLparser
-          }
+    """
+    Return a dictionary containing the description needed to load the plugin
+    """
+    return {
+           'name' : 'xml',
+           'factory' : XMLparser
+           }
 
 class XMLparser:
-   """
-   This converter works like Pythonparser, except that it is supposed to read XML
-   """
+    """
+    This converter works like Pythonparser, except that it is supposed to read XML
+    """
 
-   def __init__(self,cr=None):
-      print ('dans XML convert')
-      self.text=''
-      if cr : self.cr=cr
-      else: self.cr=N_CR.CR(debut='CR convertisseur format XML',
-                         fin='fin CR format XML')
+    def __init__(self,cr=None):
+        print ('dans XML convert')
+        self.text=''
+        if cr : self.cr=cr
+        else: self.cr=N_CR.CR(debut='CR convertisseur format XML',
+                           fin='fin CR format XML')
 
-   def readfile(self,filename):
-      self.filename=filename
-      try:
-         self.text=open(filename).read()
-      except:
-         self.cr.exception(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
-         self.cr.fatal(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
-         return
+    def readfile(self,filename):
+        self.filename=filename
+        try:
+            with open(filename) as fd :
+                self.text=fd.read()
+        except:
+            self.cr.exception(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
+            self.cr.fatal(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
+            return
 
 
 
-   def convert(self, outformat, appliEficas=None):
-   # ici on ne fait rien
-   # on le fera a la creation du JDC
-       try:
+    def convert(self, outformat, appliEficas=None):
+    # ici on ne fait rien
+    # on le fera a la creation du JDC
+        try:
             return self.text
-       except EficasException:
+        except EficasException:
             # Erreur lors de la conversion
             l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],
                                          sys.exc_info()[2])
             self.cr.exception(tr("Impossible de convertir le fichier XML\n %s", ''.join(l)))
             return ""
-         
-
-      
-
-
index 3cda9313ca5f82d63fc5a3e64093e3590a1fd202..9b77999d1e2f41fb7d8778da6b3d13d2f4d309cc 100644 (file)
@@ -27,74 +27,74 @@ from .convert_python import Pythonparser
 from Noyau import N_CR
 
 try:
-  basestring
+    basestring
 except NameError:
-  basestring = str
+    basestring = str
 
 
 
 def entryPoint():
-   """
-   Return a dictionary containing the description needed to load the plugin
-   """
-   return {
-          'name' : 'dico',
-          'factory' : Dicoparser
-          }
+    """
+    Return a dictionary containing the description needed to load the plugin
+    """
+    return {
+           'name' : 'dico',
+           'factory' : Dicoparser
+           }
 
 class Dicoparser(Pythonparser):
-  """
-   This converter initializes model variable from a python dictionnary
-  """
+    """
+     This converter initializes model variable from a python dictionnary
+    """
 
-  def __init__(self,cr=None):
-      # Si l'objet compte-rendu n'est pas fourni, on utilise le
-      # compte-rendu standard
-      self.text=''
-      self.textePy=''
-      if cr :
-         self.cr=cr
-      else:
-         self.cr=N_CR.CR(debut='CR convertisseur format dico',
-                         fin='fin CR format dico')
+    def __init__(self,cr=None):
+        # Si l'objet compte-rendu n'est pas fourni, on utilise le
+        # compte-rendu standard
+        self.text=''
+        self.textePy=''
+        if cr :
+            self.cr=cr
+        else:
+            self.cr=N_CR.CR(debut='CR convertisseur format dico',
+                            fin='fin CR format dico')
 
-  def readfile(self,filename):
-     self.filename=filename
-     try:
-        self.text=open(filename).read()
-     except:
-        self.cr.exception(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
-        self.cr.fatal(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
-        return
+    def readfile(self,filename):
+        self.filename=filename
+        try:
+            with open(filename) as fd :
+                self.text=fd.read()
+        except:
+            self.cr.exception(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
+            self.cr.fatal(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
+            return
 
-  def convert(self,outformat,appli=None):
-     monTexteDico={}
-     exec (self.text,globals(),monTexteDico)
-     if len(monTexteDico.keys()) != 1 : 
-        self.cr.exception(tr("Impossible de traiter le fichier %s" ,str(filename)))
-        self.cr.fatal(tr("Impossible de traiter le fichier %s" ,str(filename)))
-        return
-     self.textePy=""
-     monDico=monTexteDico[monTexteDico.keys()[0]]
-     for commande in monDico :
-         valeurs=monDico[commande]
-         if valeurs.has_key('NomDeLaSdCommande') :
-            # cas d un oper 
-              self.textePy+=valeurs['NomDeLaSdCommande']+' = '+commande+'('
-              del valeurs['NomDeLaSdCommande']
-         else :
-              self.textePy+=commande+'('
-         for mot in valeurs :
-             if isinstance(valeurs[mot],dict) : self.traiteMCFact(mot,valeurs[mot])
-             else : self.textePy += mot+' = ' +str(valeurs[mot])+','
-         self.textePy+=');\n' # fin de la commande
-     #print (self.textePy)
-     return self.textePy
-
-  def traiteMCFact(self,mot,valeurs):
-      self.textePy += mot + '=_F('
-      for mot in valeurs :
-          if isinstance(valeurs[mot],dict) : self.traiteMCFact(mot,valeurs[mot])
-          else : self.textePy +=mot+' = ' +str(valeurs[mot])+','
-      self.textePy +='),'
+    def convert(self,outformat,appli=None):
+        monTexteDico={}
+        exec (self.text,globals(),monTexteDico)
+        if len(monTexteDico.keys()) != 1 :
+            self.cr.exception(tr("Impossible de traiter le fichier %s" ,str(filename)))
+            self.cr.fatal(tr("Impossible de traiter le fichier %s" ,str(filename)))
+            return
+        self.textePy=""
+        monDico=monTexteDico[monTexteDico.keys()[0]]
+        for commande in monDico :
+            valeurs=monDico[commande]
+            if valeurs.has_key('NomDeLaSdCommande') :
+               # cas d un oper
+                self.textePy+=valeurs['NomDeLaSdCommande']+' = '+commande+'('
+                del valeurs['NomDeLaSdCommande']
+            else :
+                self.textePy+=commande+'('
+            for mot in valeurs :
+                if isinstance(valeurs[mot],dict) : self.traiteMCFact(mot,valeurs[mot])
+                else : self.textePy += mot+' = ' +str(valeurs[mot])+','
+            self.textePy+=');\n' # fin de la commande
+        #print (self.textePy)
+        return self.textePy
 
+    def traiteMCFact(self,mot,valeurs):
+        self.textePy += mot + '=_F('
+        for mot in valeurs :
+            if isinstance(valeurs[mot],dict) : self.traiteMCFact(mot,valeurs[mot])
+            else : self.textePy +=mot+' = ' +str(valeurs[mot])+','
+        self.textePy +='),'
index 61dd60f07f811b2318387acc108bed1acfdfb362..f36a0b3a0b0fd4cdb02bda33815080781b43e5c2 100644 (file)
@@ -24,15 +24,13 @@ from __future__ import absolute_import
 from .convert_python import Pythonparser
 
 def entryPoint():
-   """
-       Retourne les informations necessaires pour le chargeur de plugins
-       Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'MAP',
-        # La factory pour creer une instance du plugin
-          'factory' : Pythonparser,
-          }
-
-
+    """
+        Retourne les informations necessaires pour le chargeur de plugins
+        Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'MAP',
+         # La factory pour creer une instance du plugin
+           'factory' : Pythonparser,
+           }
index 86b091471ae0e05a9ff9fe864e6421d12caa967c..b0dee9850feb91a11b0f3a353bfcdc853f126abc 100644 (file)
@@ -34,7 +34,7 @@
     Le format eval est un texte source Python qui peut etre evalue. Le
     resultat de l'evaluation est un objet Python quelconque.
     Le format dict est un dictionnaire Python.
-    Le format exec est un texte source Python qui peut etre execute. 
+    Le format exec est un texte source Python qui peut etre execute.
 
     La methode readfile a pour fonction de lire un fichier dont le
     nom est passe en argument de la fonction.
 """
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except :
-   pass
+    pass
 
 import sys,traceback
 
@@ -61,68 +61,69 @@ from Extensions.i18n import tr
 from Extensions.eficas_exception import EficasException
 
 def entryPoint():
-   """
-       Retourne les informations necessaires pour le chargeur de plugins
-       Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'pyth',
-        # La factory pour creer une instance du plugin
-          'factory' : Pythparser,
-          }
+    """
+        Retourne les informations necessaires pour le chargeur de plugins
+        Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'pyth',
+         # La factory pour creer une instance du plugin
+           'factory' : Pythparser,
+           }
 
 
 class Pythparser(object):
-   """
-       Ce convertisseur lit un fichier au format pyth avec la 
-       methode readfile : convertisseur.readfile(nom_fichier)
-       et retourne le texte au format outformat avec la 
-       methode convertisseur.convert(outformat)
-
-       Ses caracteristiques principales sont exposees dans 2 attributs 
-       de classe :
-         - extensions : qui donne une liste d'extensions de fichier preconisees
-         - formats : qui donne une liste de formats de sortie supportes
-   """
-   # Les extensions de fichier preconisees
-   extensions=('.pyth',)
-   # Les formats de sortie supportes (eval dict ou exec)
-   formats=('dict',)
-
-   def __init__(self,cr=None):
-      # Si l'objet compte-rendu n'est pas fourni, on utilise le compte-rendu standard
-      if cr :
-         self.cr=cr
-      else:
-         self.cr=N_CR.CR(debut='CR convertisseur format pyth',
-                         fin='fin CR format pyth')
-      self.g={}
-
-   def readfile(self,filename):
-      self.filename=filename
-      try:
-         self.text=open(filename).read()
-      except:
-         self.cr.fatal(tr("Impossible d'ouvrir le fichier : %s",str( filename)))
-         return
-      self.g={}
-      try:
-         exec(self.text, self.g)
-      except EficasException as e:
-         l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2])
-         s= ''.join(l[2:])
-         s= s.replace('"<string>"','"<%s>"'%self.filename)
-         self.cr.fatal(tr("Erreur a l'evaluation :\n %s", s))
-
-   def convert(self,outformat,appliEficas=None):
-      if outformat == 'dict':
-         return self.getdict()
-      else:
-         raise EficasException(tr("Format de sortie : %s, non supporte", outformat))
-
-   def getdict(self):
-      d={}
-      for k,v in list(self.g.items()):
-         if k[0] != '_':d[k]=v
-      return d
+    """
+        Ce convertisseur lit un fichier au format pyth avec la
+        methode readfile : convertisseur.readfile(nom_fichier)
+        et retourne le texte au format outformat avec la
+        methode convertisseur.convert(outformat)
+
+        Ses caracteristiques principales sont exposees dans 2 attributs
+        de classe :
+          - extensions : qui donne une liste d'extensions de fichier preconisees
+          - formats : qui donne une liste de formats de sortie supportes
+    """
+    # Les extensions de fichier preconisees
+    extensions=('.pyth',)
+    # Les formats de sortie supportes (eval dict ou exec)
+    formats=('dict',)
+
+    def __init__(self,cr=None):
+        # Si l'objet compte-rendu n'est pas fourni, on utilise le compte-rendu standard
+        if cr :
+            self.cr=cr
+        else:
+            self.cr=N_CR.CR(debut='CR convertisseur format pyth',
+                            fin='fin CR format pyth')
+        self.g={}
+
+    def readfile(self,filename):
+        self.filename=filename
+        try:
+            with open(filename) as fd :
+                self.text=fd.read()
+        except:
+            self.cr.fatal(tr("Impossible d'ouvrir le fichier : %s",str( filename)))
+            return
+        self.g={}
+        try:
+            exec(self.text, self.g)
+        except EficasException as e:
+            l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2])
+            s= ''.join(l[2:])
+            s= s.replace('"<string>"','"<%s>"'%self.filename)
+            self.cr.fatal(tr("Erreur a l'evaluation :\n %s", s))
+
+    def convert(self,outformat,appliEficas=None):
+        if outformat == 'dict':
+            return self.getdict()
+        else:
+            raise EficasException(tr("Format de sortie : %s, non supporte", outformat))
+
+    def getdict(self):
+        d={}
+        for k,v in list(self.g.items()):
+            if k[0] != '_':d[k]=v
+        return d
index 49344ca7ce50bd40b462144a6f332a8f965eb4bd..535dfaf42ed76969e3574c6a3a8054d3a5415ff5 100644 (file)
@@ -34,7 +34,7 @@
     Le format eval est un texte source Python qui peut etre evalue. Le
     resultat de l'evaluation est un objet Python quelconque.
     Le format dict est un dictionnaire Python.
-    Le format exec est un texte source Python qui peut etre execute. 
+    Le format exec est un texte source Python qui peut etre execute.
 
     La methode readfile a pour fonction de lire un fichier dont le
     nom est passe en argument de la fonction.
 """
 from __future__ import absolute_import
 try :
-  from builtins import str
-  from builtins import object
+    from builtins import str
+    from builtins import object
 except :
-  pass
+    pass
 import sys,traceback
 
 from .parseur_python import PARSEUR_PYTHON
@@ -61,82 +61,83 @@ from Extensions.i18n import tr
 from Extensions.eficas_exception import EficasException
 
 def entryPoint():
-   """
-       Retourne les informations necessaires pour le chargeur de plugins
-       Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'python',
-        # La factory pour creer une instance du plugin
-          'factory' : Pythonparser,
-          }
+    """
+        Retourne les informations necessaires pour le chargeur de plugins
+        Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'python',
+         # La factory pour creer une instance du plugin
+           'factory' : Pythonparser,
+           }
 
 
 class Pythonparser(object):
-   """
-       Ce convertisseur lit un fichier au format python avec la 
-       methode readfile : convertisseur.readfile(nom_fichier)
-       et retourne le texte au format outformat avec la 
-       methode convertisseur.convert(outformat)
-
-       Ses caracteristiques principales sont exposees dans 2 attributs 
-       de classe :
-          - extensions : qui donne une liste d'extensions de fichier preconisees
-          - formats : qui donne une liste de formats de sortie supportes
-   """
-   # Les extensions de fichier preconisees
-   extensions=('.py',)
-   # Les formats de sortie supportes (eval dict ou exec)
-   # Le format exec est du python executable (commande exec) converti avec PARSEUR_PYTHON
-   # Le format execnoparseur est du python executable (commande exec) non converti
-   formats=('exec','execnoparseur')
-
-   def __init__(self,cr=None):
-      # Si l'objet compte-rendu n'est pas fourni, on utilise le 
-      # compte-rendu standard
-      self.text=''
-      if cr :
-         self.cr=cr
-      else:
-         self.cr=N_CR.CR(debut='CR convertisseur format python',
-                         fin='fin CR format python')
-
-   def readfile(self,filename):
-      self.filename=filename
-      try:
-         self.text=open(filename).read()
-      except:
-         self.cr.exception(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
-         self.cr.fatal(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
-         return
-   
-   def convert(self,outformat,appliEficas=None):
-      if outformat == 'exec':
-         try:
-            #import cProfile, pstats, StringIO
-            #pr = cProfile.Profile()
-            #pr.enable()            
-            l= PARSEUR_PYTHON(self.text).getTexte(appliEficas)
-
-            #pr.disable()
-            #s = StringIO.StringIO()
-            #sortby = 'cumulative'
-            #ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
-            #ps.print_stats()
-            #print (s.getValue())
-
-            return l
-         except EficasException:
-            # Erreur lors de la conversion
-            l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],
-                                         sys.exc_info()[2])
-            self.cr.exception(tr("Impossible de convertir le fichier Python qui doit contenir des erreurs.\n\
-                                  On retourne le fichier non converti. Prevenir la maintenance.\n\n %s", ''.join(l)))
-            # On retourne neanmoins le source initial non converti (au cas ou)
+    """
+        Ce convertisseur lit un fichier au format python avec la
+        methode readfile : convertisseur.readfile(nom_fichier)
+        et retourne le texte au format outformat avec la
+        methode convertisseur.convert(outformat)
+
+        Ses caracteristiques principales sont exposees dans 2 attributs
+        de classe :
+           - extensions : qui donne une liste d'extensions de fichier preconisees
+           - formats : qui donne une liste de formats de sortie supportes
+    """
+    # Les extensions de fichier preconisees
+    extensions=('.py',)
+    # Les formats de sortie supportes (eval dict ou exec)
+    # Le format exec est du python executable (commande exec) converti avec PARSEUR_PYTHON
+    # Le format execnoparseur est du python executable (commande exec) non converti
+    formats=('exec','execnoparseur')
+
+    def __init__(self,cr=None):
+        # Si l'objet compte-rendu n'est pas fourni, on utilise le
+        # compte-rendu standard
+        self.text=''
+        if cr :
+            self.cr=cr
+        else:
+            self.cr=N_CR.CR(debut='CR convertisseur format python',
+                            fin='fin CR format python')
+
+    def readfile(self,filename):
+        self.filename=filename
+        try:
+            with open(filename) as fd :
+                self.text=fd.read()
+        except:
+            self.cr.exception(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
+            self.cr.fatal(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
+            return
+
+    def convert(self,outformat,appliEficas=None):
+        if outformat == 'exec':
+            try:
+                #import cProfile, pstats, StringIO
+                #pr = cProfile.Profile()
+                #pr.enable()
+                l= PARSEUR_PYTHON(self.text).getTexte(appliEficas)
+
+                #pr.disable()
+                #s = StringIO.StringIO()
+                #sortby = 'cumulative'
+                #ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
+                #ps.print_stats()
+                #print (s.getValue())
+
+                return l
+            except EficasException:
+                # Erreur lors de la conversion
+                l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],
+                                             sys.exc_info()[2])
+                self.cr.exception(tr("Impossible de convertir le fichier Python qui doit contenir des erreurs.\n\
+                                      On retourne le fichier non converti. Prevenir la maintenance.\n\n %s", ''.join(l)))
+                # On retourne neanmoins le source initial non converti (au cas ou)
+                return self.text
+        elif outformat == 'execnoparseur':
             return self.text
-      elif outformat == 'execnoparseur':
-         return self.text
-      else:
-         raise EficasException(tr("Format de sortie : %s, non supporte", outformat))
-         return None
+        else:
+            raise EficasException(tr("Format de sortie : %s, non supporte", outformat))
+            return None
index 699f3706894e5f6a0ac2c68bc4524a54ea410092..19d73256de77e60caf79b1e4929d2c6745ff8044 100644 (file)
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-  from builtins import str
-  from builtins import object
+    from builtins import str
+    from builtins import object
 except :
-  pass
+    pass
 import sys,string,re
 import traceback
 from Extensions.i18n import tr
@@ -34,11 +34,11 @@ stringsAndCommentsRE =  \
 #stringsAndCommentsRE =  \
 #      re.compile(u"(\"\"\".*\"\"\"|'''.*'''|\"[^\"]*\"|\'[^\']*\'|#.*\n)", re.DOTALL)
 import six
-if six.PY2 : 
+if six.PY2 :
     allchars = string.maketrans(u"", "")
     allcharsExceptNewline = allchars[: allchars.index('\n')]+allchars[allchars.index('\n')+1:]
     allcharsExceptNewlineTranstable = string.maketrans(allcharsExceptNewline, '*'*len(allcharsExceptNewline))
-else : 
+else :
     allchars=bytes.maketrans(b"",b"")
     allcharsExceptNewline = allchars[: allchars.index(b'\n')]+allchars[allchars.index(b'\n')+1:]
     allcharsExceptNewlineTranstable = bytes.maketrans(allcharsExceptNewline, b'*'*len(allcharsExceptNewline))
@@ -53,12 +53,12 @@ else :
 def maskStringsAndComments(src):
     """Masque tous les caracteres de src contenus dans des commentaires ou des strings multilignes (triples
        quotes et guillemets.
-       Le masquage est realise en remplacant les caracteres par des * 
+       Le masquage est realise en remplacant les caracteres par des *
        Attention : cette fonction doit etre utilisee sur un texte complet et pas ligne par ligne
     """
 # remplace les \\, les \" les \'  par **
 # supprime toutes les chaines ou commentaires ,y compris multiligne i
-# entre 3 ou 1 simples ou doubles quotes (ouvrantes fermantes) ou # 
+# entre 3 ou 1 simples ou doubles quotes (ouvrantes fermantes) ou #
 # laisse les non fermantes ou non ouvrantes
 # on prend 1 sur 2 en raison du split qui donne python, commentaire, python, commentaire...
 
@@ -192,7 +192,7 @@ class COMMENTAIRE(ENTITE_JDC):
             # le diese n'est pas sur le premier caractere
             amont,aval = texte.split('#',1) # on decoupe suivant la premiere occurrence de #
             self.texte = self.texte +amont + aval
-        
+
 class COMMANDE(ENTITE_JDC):
 
     def __str__(self):
@@ -200,7 +200,7 @@ class COMMANDE(ENTITE_JDC):
         Retourne self.texte
         """
         return self.texte+'\n'
-        
+
     def getNbPar(self):
         """
         Retourne la difference entre le nombre de parentheses ouvrantes
@@ -228,7 +228,7 @@ class AFFECTATION(ENTITE_JDC):
         if texte[-1] == '\n' : texte = texte[0:-1].rstrip()
         if texte[-1] == ';'  : texte = texte[0:-1].rstrip()
         self.texte = self.texte+texte+'\n'
-        
+
     def __str__(self):
         """
         Retourne une expression de l'affectation comprehensible par ACCAS
@@ -266,7 +266,7 @@ class AFFECTATION_EVAL(ENTITE_JDC):
         """
         if texte[-1] == '\n' : texte = texte[1:-1]
         self.texte = self.texte+texte
-        
+
     def __str__(self):
         """
         Retourne une expression du parametre EVAL comprehensible par ACCAS
@@ -277,10 +277,10 @@ class AFFECTATION_EVAL(ENTITE_JDC):
         if valeur[-1] == '\n': valeur = valeur[:-1]
         valeur = valeur.strip()
         return nom+' = PARAMETRE_EVAL(nom=\''+nom+'\',valeur=\''+valeur+'\')\n\n'
-        
+
 class PARSEUR_PYTHON(object):
     """
-    Cette classe sert a generer un objet PARSEUR_PYTHON qui realise l'analyse d'un texte 
+    Cette classe sert a generer un objet PARSEUR_PYTHON qui realise l'analyse d'un texte
     representant un JDC Python en distinguant :
       - les commentaires inter commandes
       - les affectations
@@ -290,7 +290,7 @@ class PARSEUR_PYTHON(object):
     pattern_eval       = re.compile(r'^(EVAL)([ \t\r\f\v]*)\(([\w\W]*)')
     pattern_ligne_vide = re.compile(r'^[\t\r\f\v\n]+')
     pattern_name       = re.compile(r'[a-zA-Z_]\w*')
-    
+
     def __init__(self,texte):
         self.texte = texte
         self.l_objets=None
@@ -335,7 +335,7 @@ class PARSEUR_PYTHON(object):
             return 1
         else:
             return 0
-            
+
     def isCommande(self,texte):
         """
         Methode booleenne qui retourne 1 si le texte est celui d'une commande dans un jeu de commandes
@@ -357,7 +357,7 @@ class PARSEUR_PYTHON(object):
 
     def isModificationCatalogue(self,texte) :
         if self.pattern_commande.match(texte):
-           return 1
+            return 1
 
     def analyse(self):
         """
@@ -397,7 +397,7 @@ class PARSEUR_PYTHON(object):
             hangingComments ^= line.count('"""') % 2
             hangingComments ^= line.count(u"'''") % 2
             #print (hangingComments,hangingBraces)
-            if hangingBraces[0] < 0 or hangingBraces[1] < 0 or hangingBraces[2] < 0: 
+            if hangingBraces[0] < 0 or hangingBraces[1] < 0 or hangingBraces[2] < 0:
                 raise parserException()
 
             if ligne.strip() == '':
@@ -421,7 +421,7 @@ class PARSEUR_PYTHON(object):
                     commande_commentarisee_courante.appendText(ligne)
                     # on a 2 commandes commentarisees de suite
                     if pattern_finComments.match(ligne) :
-                       commande_commentarisee_courante = None
+                        commande_commentarisee_courante = None
                 else:
                     # debut de commande commentarisee : on cree un objet commande_commentarisee_courante
                     commande_commentarisee_courante = COMMANDE_COMMENTARISEE(self)
@@ -438,7 +438,7 @@ class PARSEUR_PYTHON(object):
 
                 if commande_courante :
                     # il s'agit d'un commentaire a l'interieur d'une commande --> on ne fait rien de special
-                    #on l'ajoute au texte de la commande 
+                    #on l'ajoute au texte de la commande
                     commande_courante.appendText(ligne)
                 elif commentaire_courant :
                     # il s'agit de la nieme ligne d'un commentaire entre deux commandes
@@ -468,7 +468,7 @@ class PARSEUR_PYTHON(object):
                 if not linecontinueRE.search(line) \
                    and (hangingBraces == emptyHangingBraces) \
                    and not hangingComments:
-                    #la commande est terminee 
+                    #la commande est terminee
                     self.analyseReel(commande_courante.texte)
                     commande_courante = None
 
@@ -536,13 +536,13 @@ class PARSEUR_PYTHON(object):
                 if not linecontinueRE.search(line) \
                    and (hangingBraces == emptyHangingBraces) \
                    and not hangingComments:
-                    #la commande est terminee 
+                    #la commande est terminee
                     self.analyseReel(commande_courante.texte)
                     commande_courante = None
                 #on passe a la ligne suivante
                 continue
 
+
     def enleve (self,texte) :
         """Supprime de texte tous les caracteres blancs, fins de ligne, tabulations
            Le nouveau texte est retourne
@@ -550,87 +550,87 @@ class PARSEUR_PYTHON(object):
         i=0
         chaine=""
         while (i<len(texte)):
-          if (texte[i] == " " or texte[i] == "\n" or texte[i] == "\t") :
-             i=i+1
-          else :
-             chaine=chaine+texte[i]
-             i=i+1
-        return chaine 
-            
+            if (texte[i] == " " or texte[i] == "\n" or texte[i] == "\t") :
+                i=i+1
+            else :
+                chaine=chaine+texte[i]
+                i=i+1
+        return chaine
+
     def construitGenea(self,texte):
         indiceC=0
         mot=""
         dict_reel_concept={}
 
         # traitement pour chaque caractere
-        while (indiceC < len(texte)): 
-           c=texte[indiceC]
-           if ( c == "," or c == "(u" or c == ")"):
-              mot=""
-           elif ( c== "="):
-              #on doit trouver derriere soit une valeur soit une parenthese
-              valeur=""
-              nouvelindice=indiceC+1
-              if texte[nouvelindice] != "(u":
-                 #pas de parenthese ouvrante derriere un signe =, on a une valeur.
-                 while ( texte[nouvelindice] != "," and texte[nouvelindice] != ")"):
-                    valeur=valeur+texte[nouvelindice]
-                    nouvelindice=nouvelindice+1
-                    if nouvelindice == len(texte) :
-                        nouvelindice=nouvelindice -1
-                        break
-                 if mot in self.appliEficas.liste_simp_reel:
-                    if valeur[0] != "'":
-                       try :
-                         clef=eval(valeur)
-                         if str(clef) != str(valeur) :
-                            dict_reel_concept[clef]=valeur
-                       except :
-                         pass
-                 mot=""
-                 indiceC=nouvelindice
-              else:
-                 #parenthese ouvrante derriere un signe =, on a un tuple de valeur ou de mots cles facteurs.
-                 # s agit -il d un tuple 
-                 if texte[nouvelindice+1] != "(u":
-                    #le suivant n'est pas une parenthese ouvrante : on a un tuple de valeurs ou un mot cle facteur
-                    tuple=False
-                    #on avance jusqu'a la fin du tuple de valeurs ou jusqu'a la fin du premier mot cle simple
-                    #contenu dans le mot cle facteur
-                    while ( texte[nouvelindice] != "="):
-                       if texte[nouvelindice] == ")" :
-                          tuple=True
-                          break
-                       else :
-                          nouvelindice=nouvelindice+1
-                          if nouvelindice == len(texte) :
-                             nouvelindice=nouvelindice -1
-                             break
-                    if tuple :
-                       #cas du tuple de valeurs
-                       valeur=texte[indiceC+1:nouvelindice+1]
-                       indiceC=nouvelindice+1 
-                       if mot in self.appliEficas.liste_simp_reel:
-                          valeur=valeur[1:-1]
-                          for val in valeur.split(',') :
-                          # Attention la derniere valeur est""
-                             try :
-                                if val[0] != "'":
-                                  clef=eval(val)
-                                  if str(clef) != str(val) :
-                                     dict_reel_concept[clef]=val
-                             except :
-                                  pass
-                       mot=""
-               # ou de ( imbriquees
-                 else :
-                    #cas du mocle facteur simple ou 
+        while (indiceC < len(texte)):
+            c=texte[indiceC]
+            if ( c == "," or c == "(u" or c == ")"):
+                mot=""
+            elif ( c== "="):
+                #on doit trouver derriere soit une valeur soit une parenthese
+                valeur=""
+                nouvelindice=indiceC+1
+                if texte[nouvelindice] != "(u":
+                    #pas de parenthese ouvrante derriere un signe =, on a une valeur.
+                    while ( texte[nouvelindice] != "," and texte[nouvelindice] != ")"):
+                        valeur=valeur+texte[nouvelindice]
+                        nouvelindice=nouvelindice+1
+                        if nouvelindice == len(texte) :
+                            nouvelindice=nouvelindice -1
+                            break
+                    if mot in self.appliEficas.liste_simp_reel:
+                        if valeur[0] != "'":
+                            try :
+                                clef=eval(valeur)
+                                if str(clef) != str(valeur) :
+                                    dict_reel_concept[clef]=valeur
+                            except :
+                                pass
                     mot=""
-           else :
-              mot=mot+texte[indiceC]
-           indiceC=indiceC+1
+                    indiceC=nouvelindice
+                else:
+                    #parenthese ouvrante derriere un signe =, on a un tuple de valeur ou de mots cles facteurs.
+                    # s agit -il d un tuple
+                    if texte[nouvelindice+1] != "(u":
+                        #le suivant n'est pas une parenthese ouvrante : on a un tuple de valeurs ou un mot cle facteur
+                        tuple=False
+                        #on avance jusqu'a la fin du tuple de valeurs ou jusqu'a la fin du premier mot cle simple
+                        #contenu dans le mot cle facteur
+                        while ( texte[nouvelindice] != "="):
+                            if texte[nouvelindice] == ")" :
+                                tuple=True
+                                break
+                            else :
+                                nouvelindice=nouvelindice+1
+                                if nouvelindice == len(texte) :
+                                    nouvelindice=nouvelindice -1
+                                    break
+                        if tuple :
+                            #cas du tuple de valeurs
+                            valeur=texte[indiceC+1:nouvelindice+1]
+                            indiceC=nouvelindice+1
+                            if mot in self.appliEficas.liste_simp_reel:
+                                valeur=valeur[1:-1]
+                                for val in valeur.split(',') :
+                                # Attention la derniere valeur est""
+                                    try :
+                                        if val[0] != "'":
+                                            clef=eval(val)
+                                            if str(clef) != str(val) :
+                                                dict_reel_concept[clef]=val
+                                    except :
+                                        pass
+                            mot=""
+                    # ou de ( imbriquees
+                    else :
+                        #cas du mocle facteur simple ou
+                        mot=""
+            else :
+                mot=mot+texte[indiceC]
+            indiceC=indiceC+1
         # traitement du dernier inutile
-        # c est un ; 
+        # c est un ;
         return dict_reel_concept
 
     def analyseReel(self,commande) :
@@ -638,25 +638,25 @@ class PARSEUR_PYTHON(object):
         # On verifie qu on a bien un OPER
         # et pas une MACRO
         if commande.find(u"=") > commande.find(u"(u") :
-           return
+            return
         if commande.find(u"=") > 0:
-           #epure1=self.enleve(commande)
-           epure1=pattern_blancs.sub(u"",commande)
-           nomConcept,corps=epure1.split(u"=",1)
-           epure2=corps.replace(u"_F(u","(u")
-           #nomConcept=epure1.split(u"=")[0]
-           #index=epure1.find(u"=")
-           #epure2=epure1[index+1:len(epure1)].replace(u"_F(u","(u")
-           #dict_reel_concept=self.construitGenea(epure2)
-           if self.appliEficas:
-             dict_reel_concept=construitGenea(epure2,self.appliEficas.liste_simp_reel)
-           else:
-             dict_reel_concept={}
+            #epure1=self.enleve(commande)
+            epure1=pattern_blancs.sub(u"",commande)
+            nomConcept,corps=epure1.split(u"=",1)
+            epure2=corps.replace(u"_F(u","(u")
+            #nomConcept=epure1.split(u"=")[0]
+            #index=epure1.find(u"=")
+            #epure2=epure1[index+1:len(epure1)].replace(u"_F(u","(u")
+            #dict_reel_concept=self.construitGenea(epure2)
+            if self.appliEficas:
+                dict_reel_concept=construitGenea(epure2,self.appliEficas.liste_simp_reel)
+            else:
+                dict_reel_concept={}
         if nomConcept == "sansnom" :
-           nomConcept = ""
+            nomConcept = ""
         if nomConcept !=None :
-           if len(dict_reel_concept) != 0:
-              self.appliEficas.dict_reels[nomConcept]=dict_reel_concept
+            if len(dict_reel_concept) != 0:
+                self.appliEficas.dict_reels[nomConcept]=dict_reel_concept
 
     def getTexte(self,appliEficas=None):
         """
@@ -676,19 +676,20 @@ class PARSEUR_PYTHON(object):
         return txt
 
 def test():
-  #import parseur_python
-  import doctest
-  doctest.testmod(parseur_python)
+    #import parseur_python
+    import doctest
+    doctest.testmod(parseur_python)
 
 
 if __name__ == "__main__" :
     import time
     #fichier = 'D:/Eficas_dev/Tests/zzzz100a.comm'
     #fichier = 'U:/Eficas_dev/Tests/test_eval.comm'
-    texte = open(fichier,'r').read()
+    with open(fichier) as fd:
+        texte = fd.read()
     class appliEficas(object):
-       dict_reels={}
-       liste_simp_reel=["VALE","VALE_C","GROUP_MA","RAYON"]
+        dict_reels={}
+        liste_simp_reel=["VALE","VALE_C","GROUP_MA","RAYON"]
     a=appliEficas()
 
     compile(txt, '<string>', 'exec')
index 4b0b4d770328a3bd8594e146e695f6ccefd047c2..6e71a4094aa8dc5e0ce121f5a69c211840260403 100644 (file)
@@ -25,7 +25,7 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import object
+    from builtins import object
 except : pass
 import types,re
 from Extensions.i18n import tr
@@ -33,295 +33,293 @@ filePattern="'[^\(\)]([^\(\)]*\([^\(\)]*\))*[^\(\)]*'"
 filePattern2='"[^\(\)]([^\(\)]*\([^\(\)]*\))*[^\(\)]*"'
 
 class Formatage (object):
-  """
-     Cette classe contient toutes les méthodes nécessaires au formatage
-     de la chaine de caracteres issue d'un generator en un fichier
-     'lisible' ie avec indentations
-
-     L'objet attend en parametre du constructeur (argument l_jdc) une representation
-     du jeu de commandes sous la forme d'une liste.
-
-     Chaque element de la liste est la representation d'une etape.
-
-     La representation d'une etape est une liste dont le premier element est une chaine de
-     caracteres donnant le debut de la commande ("xxx=lire_maillage(", par exemple).
-     Les elements suivants sont les representations des mots cles simples et facteurs.
-     Elle se termine avec un element de fin : ");"
-
-     La representation d'un mot cle simple est une chaine de caracteres (info=2, par exemple).
-
-     La representation d'un mot cle facteur est semblable Ã  celle de l'étape : premier element
-     caracteristique du mot cle facteur suivi d'elements representatifs des mots cles simples.
-     Elle se termine avec un element de fin : ")" ou "),".
-  """
-  def __init__(self,l_jdc,code=None,mode=None,sep='=',l_max=72):
-    # l_jdc représente le jeu de commandes brut sous forme de liste
-    self.l_jdc = l_jdc
-    self.jdc_fini =''
-    self.count = 0
-    self.sep=sep
-    self.l_max=l_max
-    if mode == '.py':
-       self.sep = '='
-       self.l_max = 132
-    elif code == 'ASTER':
-       self.sep = ':'
-       self.l_max = 72
-
-  def formateJdc(self):
-    comment=re.compile("\n#")
-    commentaireavant=0
-    for etape in self.l_jdc:
-      self.count = self.count+1
-      self.texte_etape = ''
-      if type(etape)==list:
-        # L'etape est sous la forme d'une liste dont le premier element est une chaine
-        self.indent=[]
-        self.indent.append(len(etape[0]))
-        self.indent_courant = self.indent[0]
-        self.texte_etape = '\n' + etape[0]
-        if len(etape)>1 :
-          self.formateEtape(etape[1:])
-      else :
-        # L'etape est deja sous forme de chaine de caracteres
-        self.indent=[]
-        self.texte_etape = etape
+    """
+       Cette classe contient toutes les méthodes nécessaires au formatage
+       de la chaine de caracteres issue d'un generator en un fichier
+       'lisible' ie avec indentations
 
-      m=comment.match(self.texte_etape)
-      # si ce n est pas la premiere ligne
-      if self.jdc_fini != ""  :
-        # si il n y avait pas de commentaire avant on met un saut de ligne
-        if commentaireavant == 0 :
-           self.jdc_fini = self.jdc_fini + '\n' + self.texte_etape
-        else :
-           self.jdc_fini = self.jdc_fini + self.texte_etape
-      # si c est la premiere ligne
-      else :
-        # on ne met pas de saut de ligne avant la premiere ligne
-        # si c est un commentaire on enleve le saut de ligne precedent
-        if m : self.texte_etape=self.texte_etape[1:]
-        self.jdc_fini = self.texte_etape
-      if m :
-        commentaireavant=1
-      else :
-        commentaireavant=0
+       L'objet attend en parametre du constructeur (argument l_jdc) une representation
+       du jeu de commandes sous la forme d'une liste.
 
-    return self.jdc_fini
+       Chaque element de la liste est la representation d'une etape.
 
+       La representation d'une etape est une liste dont le premier element est une chaine de
+       caracteres donnant le debut de la commande ("xxx=lire_maillage(", par exemple).
+       Les elements suivants sont les representations des mots cles simples et facteurs.
+       Elle se termine avec un element de fin : ");"
 
+       La representation d'un mot cle simple est une chaine de caracteres (info=2, par exemple).
 
-  def formateEtape(self,liste):
+       La representation d'un mot cle facteur est semblable Ã  celle de l'étape : premier element
+       caracteristique du mot cle facteur suivi d'elements representatifs des mots cles simples.
+       Elle se termine avec un element de fin : ")" ou "),".
     """
-        Enrichissement de la chaine de caracteres representant l'etape (attribut
-        texte_etape de l'objet Formatage).
-        Les elements a ajouter sont dans l'argument liste de la methode.
-        L'objet "liste" Ã  traiter a Ã©té produit par le module generator. En particulier
-        les parenthèses et les virgules ont Ã©té produites par ce module
-    """
-    l_patterns_fin_etape = ( ');' , ');\n' )
-    l_patterns_fin_mcf   = ( ')'  , '),'   )
-
-    ind = 0
-    for element in liste :
-      if type(element)==list:
+    def __init__(self,l_jdc,code=None,mode=None,sep='=',l_max=72):
+        # l_jdc représente le jeu de commandes brut sous forme de liste
+        self.l_jdc = l_jdc
+        self.jdc_fini =''
+        self.count = 0
+        self.sep=sep
+        self.l_max=l_max
+        if mode == '.py':
+            self.sep = '='
+            self.l_max = 132
+        elif code == 'ASTER':
+            self.sep = ':'
+            self.l_max = 72
+
+    def formateJdc(self):
+        comment=re.compile("\n#")
+        commentaireavant=0
+        for etape in self.l_jdc:
+            self.count = self.count+1
+            self.texte_etape = ''
+            if type(etape)==list:
+                # L'etape est sous la forme d'une liste dont le premier element est une chaine
+                self.indent=[]
+                self.indent.append(len(etape[0]))
+                self.indent_courant = self.indent[0]
+                self.texte_etape = '\n' + etape[0]
+                if len(etape)>1 :
+                    self.formateEtape(etape[1:])
+            else :
+                # L'etape est deja sous forme de chaine de caracteres
+                self.indent=[]
+                self.texte_etape = etape
+
+            m=comment.match(self.texte_etape)
+            # si ce n est pas la premiere ligne
+            if self.jdc_fini != ""  :
+                # si il n y avait pas de commentaire avant on met un saut de ligne
+                if commentaireavant == 0 :
+                    self.jdc_fini = self.jdc_fini + '\n' + self.texte_etape
+                else :
+                    self.jdc_fini = self.jdc_fini + self.texte_etape
+            # si c est la premiere ligne
+            else :
+                # on ne met pas de saut de ligne avant la premiere ligne
+                # si c est un commentaire on enleve le saut de ligne precedent
+                if m : self.texte_etape=self.texte_etape[1:]
+                self.jdc_fini = self.texte_etape
+            if m :
+                commentaireavant=1
+            else :
+                commentaireavant=0
+
+        return self.jdc_fini
+
+
+
+    def formateEtape(self,liste):
+        """
+            Enrichissement de la chaine de caracteres representant l'etape (attribut
+            texte_etape de l'objet Formatage).
+            Les elements a ajouter sont dans l'argument liste de la methode.
+            L'objet "liste" Ã  traiter a Ã©té produit par le module generator. En particulier
+            les parenthèses et les virgules ont Ã©té produites par ce module
+        """
+        l_patterns_fin_etape = ( ');' , ');\n' )
+        l_patterns_fin_mcf   = ( ')'  , '),'   )
+
+        ind = 0
+        for element in liste :
+            if type(element)==list:
+
+                # il s'agit d'un mot-clé facteur
+                # on Ã©crit son nom (element[0])
+                longueur = self.longueur(self.texte_etape)
+                try:
+                    increment = len(('\n'+self.indent_courant*' ')*ind + element[0])
+                except:
+                    print (tr('ERREUR'))
+                    print (liste)
+                    print (element)
+                self.texte_etape = self.texte_etape + (u'\n'+self.indent_courant*' ')*ind + element[0]
+                length = len(self.indent)
+                self.indent.insert(length,self.indent[length-1]+len(element[0]))
+                self.indent_courant = self.indent[length]
+                # on Ã©crit ses fils
+                self.formateEtape(element[1:])
+            #elif type(element) == types.StringType:
+            #elif type(element) == bytes:
+            # PNPNPN -> marre du python 2 et 3
+            # on remplace par else dans if
+            else :
 
-        # il s'agit d'un mot-clé facteur
-        # on Ã©crit son nom (element[0])
-        longueur = self.longueur(self.texte_etape)
-        try:
-          increment = len(('\n'+self.indent_courant*' ')*ind + element[0])
-        except:
-          print (tr('ERREUR'))
-          print (liste)
-          print (element)
-        self.texte_etape = self.texte_etape + (u'\n'+self.indent_courant*' ')*ind + element[0]
+                # il s'agit d'un mot-clé simple ou de ')' ou ');' ou '),' ou ');\n'
+
+                if element in l_patterns_fin_mcf :
+                    self.traiteMcfact(s_mcfact=element,ind=ind)
+                elif element in l_patterns_fin_etape :
+                    self.traiteEtape(s_etape=element,ind=ind)
+                else :
+                    self.traiteMcsimp(s_mcsimp=element,ind=ind)
+
+            ind = 1
+
+    def traiteEtape(self,s_etape,ind) :
+        """
+            Traite une partie du jdc formaté : s_etape, une chaîne de caractères
+            contenant une Ã©tape
+            L'attribut self.texte_etape est modifié (complété) par le traitement
+            L'attribut self.indent est modifié par le traitement
+            L'attribut self.indent_courant est modifié par le traitement
+        """
         length = len(self.indent)
-        self.indent.insert(length,self.indent[length-1]+len(element[0]))
-        self.indent_courant = self.indent[length]
-        # on Ã©crit ses fils
-        self.formateEtape(element[1:])
-      #elif type(element) == types.StringType:
-      #elif type(element) == bytes:
-      # PNPNPN -> marre du python 2 et 3
-      # on remplace par else dans if
-      else :
-
-        # il s'agit d'un mot-clé simple ou de ')' ou ');' ou '),' ou ');\n'
-
-        if element in l_patterns_fin_mcf :
-              self.traiteMcfact(s_mcfact=element,ind=ind)
-        elif element in l_patterns_fin_etape :
-              self.traiteEtape(s_etape=element,ind=ind)
+        if length > 1:
+            last = self.indent[length-1]
+            self.indent.remove(last)
+            self.indent_courant=self.indent[length-2]
         else :
-              self.traiteMcsimp(s_mcsimp=element,ind=ind)
-
-      ind = 1
-
-  def traiteEtape(self,s_etape,ind) :
-      """
-          Traite une partie du jdc formaté : s_etape, une chaîne de caractères
-          contenant une Ã©tape
-          L'attribut self.texte_etape est modifié (complété) par le traitement
-          L'attribut self.indent est modifié par le traitement
-          L'attribut self.indent_courant est modifié par le traitement
-      """
-      length = len(self.indent)
-      if length > 1:
-          last = self.indent[length-1]
-          self.indent.remove(last)
-          self.indent_courant=self.indent[length-2]
-      else :
-          self.indent_courant=self.indent[0]
-      self.texte_etape = self.texte_etape + s_etape.strip()
-
-  def traiteMcfact(self,s_mcfact,ind) :
-      """
-          Traite une partie du jdc formaté : s_mcfact, une chaîne de caractères
-          contenant un mot-clef facteur.
-          L'attribut self.texte_etape est modifié (complété) par le traitement
-          L'attribut self.indent est modifié par le traitement
-          L'attribut self.indent_courant est modifié par le traitement
-      """
-      self.texte_etape = self.texte_etape + s_mcfact.strip()
-      length = len(self.indent)
-      if length > 1:
-           last = self.indent[length-1]
-           self.indent.remove(last)
-           self.indent_courant=self.indent[length-2]
-      else :
-           self.indent_courant=self.indent[0]
-      return
-
-
-  def traiteMcsimp(self,s_mcsimp,ind) :
-      """
-          Traite une partie du jdc formaté : s_mcsimp, une chaîne de caractères
-          contenant un mot-clef simple.
-          L'attribut self.texte_etape est modifié (complété) par le traitement
-      """
-      #
-      # Ajout PN pour defi_fonction
-      if self.texte_etape.find("DEFI_FONCTION") > 1 :
-          bool_fonction=1
-          if s_mcsimp.find("\n")  > 1:
-              txt=""; bool = 0; numident=1
-              for l in s_mcsimp.splitlines() :
-                 if bool == 0 :
-                    bool = 1
-                    numident=s_mcsimp.find("=")+2
-                    txt=l
-                 else :
-                    txt=txt+('\n'+self.indent_courant*' '+numident*' ')*ind+l
-              s_mcsimp = txt
-      else :
-          bool_fonction=0
-      longueur = self.longueur(self.texte_etape)
-      increment = len((u'\n'+self.indent_courant*' ')*ind + s_mcsimp.strip())
-      if (bool_fonction == 1 ) :
-          self.texte_etape = self.texte_etape+'\n'+self.indent_courant*' ' +s_mcsimp
-      elif ( ((1-ind)*longueur+increment) <= self.l_max ) :
-          self.texte_etape = self.texte_etape + ('\n'+self.indent_courant*' ')*ind +s_mcsimp.strip()
-      else :
-          # il faut couper ...
-          nom,valeur = str.split(s_mcsimp,self.sep,1)
-          chaine = self.creerChaine(nom,valeur,'\n'+self.indent_courant*' ',ind)
-          self.texte_etape = self.texte_etape + chaine
-      return
-
-
-  def longueur(self,texte):
-    """
-       texte est une string qui peut contenir des retours chariots
-       Cette méthode retourne la longueur de la dernière ligne de texte
-    """
-    #liste = texte.split('\n')
-    #return len(liste[-1])
-    if texte [-1] == '\n' : return 0
-    return len(texte[texte.rfind('\n'):-1])
-
-
-  def creerChaine(self,nom,valeur,increment,ind):
-    """
-        La methode creerChaine reconstitue un objet Eficas Ã  partir de
-             - son nom,
-             - sa valeur.
-    """
-    s=''
-    if len(increment + nom + self.sep) <= self.l_max:
-      texte = increment*ind
-      label = nom + self.sep
-      s=texte + label
-      longueur = len(increment + label)
+            self.indent_courant=self.indent[0]
+        self.texte_etape = self.texte_etape + s_etape.strip()
+
+    def traiteMcfact(self,s_mcfact,ind) :
+        """
+            Traite une partie du jdc formaté : s_mcfact, une chaîne de caractères
+            contenant un mot-clef facteur.
+            L'attribut self.texte_etape est modifié (complété) par le traitement
+            L'attribut self.indent est modifié par le traitement
+            L'attribut self.indent_courant est modifié par le traitement
+        """
+        self.texte_etape = self.texte_etape + s_mcfact.strip()
+        length = len(self.indent)
+        if length > 1:
+            last = self.indent[length-1]
+            self.indent.remove(last)
+            self.indent_courant=self.indent[length-2]
+        else :
+            self.indent_courant=self.indent[0]
+        return
+
+
+    def traiteMcsimp(self,s_mcsimp,ind) :
+        """
+            Traite une partie du jdc formaté : s_mcsimp, une chaîne de caractères
+            contenant un mot-clef simple.
+            L'attribut self.texte_etape est modifié (complété) par le traitement
+        """
+        #
+        # Ajout PN pour defi_fonction
+        if self.texte_etape.find("DEFI_FONCTION") > 1 :
+            bool_fonction=1
+            if s_mcsimp.find("\n")  > 1:
+                txt=""; bool = 0; numident=1
+                for l in s_mcsimp.splitlines() :
+                    if bool == 0 :
+                        bool = 1
+                        numident=s_mcsimp.find("=")+2
+                        txt=l
+                    else :
+                        txt=txt+('\n'+self.indent_courant*' '+numident*' ')*ind+l
+                s_mcsimp = txt
+        else :
+            bool_fonction=0
+        longueur = self.longueur(self.texte_etape)
+        increment = len((u'\n'+self.indent_courant*' ')*ind + s_mcsimp.strip())
+        if (bool_fonction == 1 ) :
+            self.texte_etape = self.texte_etape+'\n'+self.indent_courant*' ' +s_mcsimp
+        elif ( ((1-ind)*longueur+increment) <= self.l_max ) :
+            self.texte_etape = self.texte_etape + ('\n'+self.indent_courant*' ')*ind +s_mcsimp.strip()
+        else :
+            # il faut couper ...
+            nom,valeur = str.split(s_mcsimp,self.sep,1)
+            chaine = self.creerChaine(nom,valeur,'\n'+self.indent_courant*' ',ind)
+            self.texte_etape = self.texte_etape + chaine
+        return
+
+
+    def longueur(self,texte):
+        """
+           texte est une string qui peut contenir des retours chariots
+           Cette méthode retourne la longueur de la dernière ligne de texte
+        """
+        #liste = texte.split('\n')
+        #return len(liste[-1])
+        if texte [-1] == '\n' : return 0
+        return len(texte[texte.rfind('\n'):-1])
+
+
+    def creerChaine(self,nom,valeur,increment,ind):
+        """
+            La methode creerChaine reconstitue un objet Eficas Ã  partir de
+                 - son nom,
+                 - sa valeur.
+        """
+        s=''
+        if len(increment + nom + self.sep) <= self.l_max:
+            texte = increment*ind
+            label = nom + self.sep
+            s=texte + label
+            longueur = len(increment + label)
+
+            if ('(' not in valeur) or (valeur[0:3]=='"""') :
+                # il s'agit d'une vraie chaîne de caractères
+                val = len(valeur)
+                texte = (self.l_max-2-val)*' '+valeur
+                s=s+'\\\n'+texte
+            elif re.match(filePattern,valeur) or re.match(filePattern2,valeur):
+                val = len(valeur)
+                texte = (self.l_max-2-val)*' '+valeur
+                s=s+'\\\n'+texte
+            elif ',' in valeur:
+                # il s'agit d'une liste de tuple
+                # c est trop complique on ne splitte pas
+                if valeur[0:2]=='((' or valeur[0:2]=='[(':
+                    s=s+valeur
+                    return s
+                # il s'agit d'une liste
+                liste = valeur.split(',')
+                i=0
+                for arg in liste :
+                    ajout = arg.strip()
+                    if len(ajout) == 0 : continue
+                    longueur = self.longueur(texte = (texte + label)) + len(ajout +',') + (1-i)*len(increment)
+                    if longueur  <= self.l_max:
+                        if ajout[-1] != ')':
+                            texte = texte + ajout +','
+                        else :
+                            texte = texte + ajout
+                    else :
+                        i=1
+                        if ajout[-1] != ')':
+                            texte = texte  + increment + (len(label)+2)*' ' + ajout  + ','
+                        else :
+                            texte = texte  + increment + (len(label)+2)*' ' + ajout
+
+                s=s+texte
+                s =  s + ','
 
-      if ('(' not in valeur) or (valeur[0:3]=='"""') :
-        # il s'agit d'une vraie chaîne de caractères
-        val = len(valeur)
-        texte = (self.l_max-2-val)*' '+valeur
-        s=s+'\\\n'+texte
-      elif re.match(filePattern,valeur) or re.match(filePattern2,valeur):
-        val = len(valeur)
-        texte = (self.l_max-2-val)*' '+valeur
-        s=s+'\\\n'+texte
-      elif ',' in valeur:
-        # il s'agit d'une liste de tuple
-        # c est trop complique on ne splitte pas
-        if valeur[0:2]=='((' or valeur[0:2]=='[(':
-           s=s+valeur
-           return s
-        # il s'agit d'une liste
-        liste = valeur.split(',')
-        i=0
-        for arg in liste :
-          ajout = arg.strip()
-          if len(ajout) == 0 : continue
-          longueur = self.longueur(texte = (texte + label)) + len(ajout +',') + (1-i)*len(increment)
-          if longueur  <= self.l_max:
-              if ajout[-1] != ')':
-                texte = texte + ajout +','
-              else :
-                texte = texte + ajout
-          else :
-            i=1
-            if ajout[-1] != ')':
-              texte = texte  + increment + (len(label)+2)*' ' + ajout  + ','
             else :
-              texte = texte  + increment + (len(label)+2)*' ' + ajout
-
-        s=s+texte
-        s =  s + ','
-
-      else :
-        # On a une ( mais pas de , . On passe la chaine sans modification
-        val = len(valeur) +len(label)
-        texte = (self.l_max-2-val)*' '+valeur
-        s='\n'+s+texte
-    else : 
-      label = nom + self.sep
-      val = len(valeur) +len(label)
-      s = '\n'+(self.l_max-2-val)*' '+label+valeur
-    return s
+                # On a une ( mais pas de , . On passe la chaine sans modification
+                val = len(valeur) +len(label)
+                texte = (self.l_max-2-val)*' '+valeur
+                s='\n'+s+texte
+        else :
+            label = nom + self.sep
+            val = len(valeur) +len(label)
+            s = '\n'+(self.l_max-2-val)*' '+label+valeur
+        return s
 
 class FormatageLigne(Formatage) :
-  def __init__(self,l_jdc,code=None,mode=None,sep='=',l_max="**"):
-      Formatage.__init__(self,l_jdc,code=None,mode=None,sep='=',l_max="**")
-
-  def formateJdc(self):
-      texte1=Formatage.formateJdc(self)
-      newText=""
-      lignes=texte1.split("\n")
-      texte=""
-      pattern_debut_blanc  = re.compile(r"^ \s*.*")
-      pattern_commentaire   = re.compile(r"^\s*#.*")
-      pattern_vide=re.compile(r"\s*^$")
-      for l in lignes :
-          if pattern_commentaire.match(l) or pattern_vide.match(l):
-             newText+=l+"\n"
-             continue
-          if not pattern_debut_blanc.match(l) : texte=l
-          else : texte+=re.sub(r'^ \s*',' ',l)
-          if texte[-1]==";" :
-             newText+=texte+"\n"
-             texte=""
-      return newText
-
-
+    def __init__(self,l_jdc,code=None,mode=None,sep='=',l_max="**"):
+        Formatage.__init__(self,l_jdc,code=None,mode=None,sep='=',l_max="**")
+
+    def formateJdc(self):
+        texte1=Formatage.formateJdc(self)
+        newText=""
+        lignes=texte1.split("\n")
+        texte=""
+        pattern_debut_blanc  = re.compile(r"^ \s*.*")
+        pattern_commentaire   = re.compile(r"^\s*#.*")
+        pattern_vide=re.compile(r"\s*^$")
+        for l in lignes :
+            if pattern_commentaire.match(l) or pattern_vide.match(l):
+                newText+=l+"\n"
+                continue
+            if not pattern_debut_blanc.match(l) : texte=l
+            else : texte+=re.sub(r'^ \s*',' ',l)
+            if texte[-1]==";" :
+                newText+=texte+"\n"
+                texte=""
+        return newText
index 2de311049290dcb71c2a37f1ed440f8c96d36fa9..f75236bf22080736d0aada9ad67a6b3bac0b6c68 100644 (file)
@@ -30,4 +30,3 @@ from Extensions import pluginloader
 import generator
 
 plugins=pluginloader.PluginLoader(generator)
-
index 2a2db80c878096b67a9d5c0a408c4af1641eb652..6a67088a4308063d06f73e95765c079591e6594a 100644 (file)
@@ -26,55 +26,55 @@ import types,re
 
 from .generator_python import PythonGenerator
 def entryPoint():
-   """
-       Retourne les informations necessaires pour le chargeur de plugins
+    """
+        Retourne les informations necessaires pour le chargeur de plugins
 
-       Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'GroupMA',
-        # La factory pour creer une instance du plugin
-          'factory' : GroupMAGenerator,
-          }
+        Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'GroupMA',
+         # La factory pour creer une instance du plugin
+           'factory' : GroupMAGenerator,
+           }
 
 
 class GroupMAGenerator(PythonGenerator):
-   """
-       Ce generateur parcourt un objet de type JDC et produit
-       un texte au format eficas et 
-       un texte au format homard 
+    """
+        Ce generateur parcourt un objet de type JDC et produit
+        un texte au format eficas et
+        un texte au format homard
 
-   """
-   # Les extensions de fichier preconisees
-   extensions=('.comm',)
+    """
+    # Les extensions de fichier preconisees
+    extensions=('.comm',)
 
-   def __init__(self):
-      PythonGenerator.__init__(self)
-      self.listeMA=[]
-      self.listeNO=[]
+    def __init__(self):
+        PythonGenerator.__init__(self)
+        self.listeMA=[]
+        self.listeNO=[]
 
-   def gener(self,obj,format='brut',config=None):
-      self.liste=[]
-      self.text=PythonGenerator.gener(self,obj,'brut',config=None)
-      return self.listeMA,self.listeNO
+    def gener(self,obj,format='brut',config=None):
+        self.liste=[]
+        self.text=PythonGenerator.gener(self,obj,'brut',config=None)
+        return self.listeMA,self.listeNO
 
-   def generMCSIMP(self,obj) :
-       if 'grma' in repr(obj.definition.type) :
-          if not type(obj.valeur) in (list, tuple):
-             aTraiter=(obj.valeur,)
-          else :
-             aTraiter=obj.valeur
-          for group in aTraiter :
-             if group not in self.listeMA :
-                self.listeMA.append(group)
-       if 'grno' in repr(obj.definition.type) :
-          if not type(obj.valeur) in (list, tuple):
-             aTraiter=(obj.valeur,)
-          else :
-             aTraiter=obj.valeur
-          for group in aTraiter :
-             if group not in self.listeNO :
-                self.listeNO.append(group)
-       s=PythonGenerator.generMCSIMP(self,obj)
-       return s
+    def generMCSIMP(self,obj) :
+        if 'grma' in repr(obj.definition.type) :
+            if not type(obj.valeur) in (list, tuple):
+                aTraiter=(obj.valeur,)
+            else :
+                aTraiter=obj.valeur
+            for group in aTraiter :
+                if group not in self.listeMA :
+                    self.listeMA.append(group)
+        if 'grno' in repr(obj.definition.type) :
+            if not type(obj.valeur) in (list, tuple):
+                aTraiter=(obj.valeur,)
+            else :
+                aTraiter=obj.valeur
+            for group in aTraiter :
+                if group not in self.listeNO :
+                    self.listeNO.append(group)
+        s=PythonGenerator.generMCSIMP(self,obj)
+        return s
index 0b940daa089b3508d54f0b6818998de8e8c42cfc..b083c96111127f3ea76fa7e8c275d25be12bed5a 100755 (executable)
@@ -22,7 +22,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 texte_debut="int main() \n{ \n   init_var();\n"
@@ -33,78 +33,78 @@ from Extensions.i18n import tr
 from .generator_dicoImbrique import DicoImbriqueGenerator
 
 def entryPoint():
-   """
-      Retourne les informations necessaires pour le chargeur de plugins
-      Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'PSEN',
-        # La factory pour creer une instance du plugin
-          'factory' : PSENGenerator,
-          }
+    """
+       Retourne les informations necessaires pour le chargeur de plugins
+       Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'PSEN',
+         # La factory pour creer une instance du plugin
+           'factory' : PSENGenerator,
+           }
 
 
 class PSENGenerator(DicoImbriqueGenerator):
-   """
-      Ce generateur parcourt un objet de type JDC et produit
-      un texte au format eficas et 
-      un texte au format dictionnaire
+    """
+       Ce generateur parcourt un objet de type JDC et produit
+       un texte au format eficas et
+       un texte au format dictionnaire
 
-   """
-   # Les extensions de fichier permis?
-   extensions=('.comm',)
+    """
+    # Les extensions de fichier permis?
+    extensions=('.comm',)
 
 #----------------------------------------------------------------------------------------
-   def gener(self,obj,format='brut',config=None, appliEficas=None):
-
-      try :
-         self.MachineDico = obj.MachineDico
-         self.LoadDico = obj.LoadDico
-         self.LineDico = obj.LineDico
-         self.TransfoDico = obj.TransfoDico
-         self.MotorDico = obj.MotorDico
-      except :
-         self.MachineDico = None
-         self.LoadDico = None
-         self.LineDico = None
-         self.TransfoDico = None
-         self.MotorDico = None
-      
-      self.initDico()
-      # Cette instruction genere le contenu du fichier de commandes (persistance)
-      self.text=DicoImbriqueGenerator.gener(self,obj,format)
-      return self.text
+    def gener(self,obj,format='brut',config=None, appliEficas=None):
+
+        try :
+            self.MachineDico = obj.MachineDico
+            self.LoadDico = obj.LoadDico
+            self.LineDico = obj.LineDico
+            self.TransfoDico = obj.TransfoDico
+            self.MotorDico = obj.MotorDico
+        except :
+            self.MachineDico = None
+            self.LoadDico = None
+            self.LineDico = None
+            self.TransfoDico = None
+            self.MotorDico = None
+
+        self.initDico()
+        # Cette instruction genere le contenu du fichier de commandes (persistance)
+        self.text=DicoImbriqueGenerator.gener(self,obj,format)
+        return self.text
 
 
 #----------------------------------------------------------------------------------------
 # initialisations
 #----------------------------------------------------------------------------------------
-   
-   def initDico(self) :
-      DicoImbriqueGenerator.initDico(self)
-      self.Entete = 'MachineDico = ' + str(self.MachineDico) +'\n'
-      self.Entete += 'LoadDico = ' + str(self.LoadDico) +'\n'
-      self.Entete += 'LineDico = ' + str(self.LineDico) +'\n'
-      self.Entete += 'TransfoDico = ' + str(self.TransfoDico) +'\n'
-      self.Entete += 'MotorDico = ' + str(self.MotorDico) + '\n'
-      self.Entete +='\n'
+
+    def initDico(self) :
+        DicoImbriqueGenerator.initDico(self)
+        self.Entete = 'MachineDico = ' + str(self.MachineDico) +'\n'
+        self.Entete += 'LoadDico = ' + str(self.LoadDico) +'\n'
+        self.Entete += 'LineDico = ' + str(self.LineDico) +'\n'
+        self.Entete += 'TransfoDico = ' + str(self.TransfoDico) +'\n'
+        self.Entete += 'MotorDico = ' + str(self.MotorDico) + '\n'
+        self.Entete +='\n'
 
 
 #----------------------------------------------------------------------------------------
 # ecriture
 #----------------------------------------------------------------------------------------
 
-   def writeDefault(self,fn) :
-       fileDico=os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),'..','PSEN_Eficas','PSEN','PSENconfig.py'))
-       f = open( str(fileDico), 'wb')
-       f.write( self.Entete + "Dico =" + str(self.Dico) )
-       f.close()
+    def writeDefault(self,fn) :
+        fileDico=os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),'..','PSEN_Eficas','PSEN','PSENconfig.py'))
+        f = open( str(fileDico), 'wb')
+        f.write( self.Entete + "Dico =" + str(self.Dico) )
+        f.close()
+
 
-   
 
 #----------------------------------------------------------------------------------------
-#  analyse de chaque noeud de l'arbre 
+#  analyse de chaque noeud de l'arbre
 #----------------------------------------------------------------------------------------
 
 ##   def generMCSIMP(self,obj) :
@@ -122,5 +122,5 @@ class PSENGenerator(DicoImbriqueGenerator):
 ##        self.dicoTemp={}
 ##        return s
 
-  
+
 # si repertoire on change tous les noms de fichier
index fe84bce414efffde77fd64882364352086d61b4d..7c87e7e84acdd8dbdcac433c2528a2265402f192 100755 (executable)
@@ -27,38 +27,38 @@ from .generator_python import PythonGenerator
 from .generator_modification import ModificationGenerator
 
 def entryPoint():
-   """
-      Retourne les informations necessaires pour le chargeur de plugins
-      Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'ProcessOutputs',
-        # La factory pour creer une instance du plugin
-          'factory' : ProcessOutputsGenerator,
-          }
+    """
+       Retourne les informations necessaires pour le chargeur de plugins
+       Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'ProcessOutputs',
+         # La factory pour creer une instance du plugin
+           'factory' : ProcessOutputsGenerator,
+           }
 
 
 class ProcessOutputsGenerator(PythonGenerator,ModificationGenerator):
-   """
-      Ce generateur parcourt un objet de type JDC et produit
-      un texte au format eficas et 
-      un texte au format dictionnaire
+    """
+       Ce generateur parcourt un objet de type JDC et produit
+       un texte au format eficas et
+       un texte au format dictionnaire
 
-   """
-   # Les extensions de fichier permis?
-   extensions=('.comm',)
+    """
+    # Les extensions de fichier permis?
+    extensions=('.comm',)
 
 #----------------------------------------------------------------------------------------
-   def gener(self,obj,format='brut',config=None, appliEficas=None):
+    def gener(self,obj,format='brut',config=None, appliEficas=None):
 
-      # Cette instruction genere le contenu du fichier de commandes (persistance)
-      texteModification=self.generTexteModif(obj)
-      text=PythonGenerator.gener(self,obj,format)
-      self.text=texteModification+text
+        # Cette instruction genere le contenu du fichier de commandes (persistance)
+        texteModification=self.generTexteModif(obj)
+        text=PythonGenerator.gener(self,obj,format)
+        self.text=texteModification+text
+
+        return self.text
 
-      return self.text
 
 
-  
 # si repertoire on change tous les noms de fichier
index 0250fe21a946fa29c4a7643e2a54b81cb284da80..0a50355294137b2d8fc1ec56d548124833bc4cf9 100644 (file)
@@ -23,7 +23,7 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import traceback
@@ -37,95 +37,95 @@ extensions=('.comm',)
 
 
 def entryPoint():
-   """
-      Retourne les informations necessaires pour le chargeur de plugins
-      Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'TELEMAC',
-        # La factory pour creer une instance du plugin
-          'factory' : TELEMACGenerator,
-          }
+    """
+       Retourne les informations necessaires pour le chargeur de plugins
+       Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'TELEMAC',
+         # La factory pour creer une instance du plugin
+           'factory' : TELEMACGenerator,
+           }
 
 
 class TELEMACGenerator(PythonGenerator):
-   """
-      Ce generateur parcourt un objet de type JDC et produit
-      un texte au format eficas et
-      un texte au format dictionnaire
+    """
+       Ce generateur parcourt un objet de type JDC et produit
+       un texte au format eficas et
+       un texte au format dictionnaire
 
-   """
+    """
 
 #----------------------------------------------------------------------------------------
-   def gener(self,obj,format='brut',config=None,appliEficas=None,statut="Leger"):
-      self.statut        = statut
-      self.langue        = appliEficas.langue
-      try : self.TelemacdicoEn = appliEficas.readercata.TelemacdicoEn
-      except : 
-        print ('Attention : pas de TelemacdicoEn declare') 
-        self.TelemacdicoEn = {}
-      self.DicoEnumCasEnInverse = {}
-      #from enum_Telemac2d_auto       import self.TelemacdicoEn
-      for motClef in self.TelemacdicoEn:
-          d={}
-          for valTelemac in self.TelemacdicoEn[motClef]:
-             valEficas   = self.TelemacdicoEn[motClef][valTelemac]
-             d[valEficas] =valTelemac
-          self.DicoEnumCasEnInverse[motClef]=d
-      if self.langue == 'fr' : 
-         #from  enum_Telemac2d_auto import DicoEnumCasFrToEnumCasEn
-         self.DicoEnumCasFrToEnumCasEn = appliEficas.readercata.DicoEnumCasFrToEnumCasEn
-         for motClef in self.DicoEnumCasFrToEnumCasEn:
-              d={}
-              for valTelemac in self.DicoEnumCasFrToEnumCasEn[motClef]:
-                 valEficas    = self.DicoEnumCasFrToEnumCasEn[motClef][valTelemac]
-                 d[valEficas] = valTelemac
-              self.DicoEnumCasEnInverse[motClef]=d
-      self.initDico()
-      # Pour Simplifier les verifs d ecriture
-      if hasattr(appliEficas,'listeTelemac') : self.listeTelemac=appliEficas.listeTelemac
-      else : self.listeTelemac = ()
-
-      self.dicoCataToCas={}
-      try :
-        self.dicoCasToCata=appliEficas.readercata.dicoCasToCata
-      except :
-        print ('Attention pas de dicoCasToCata declare')
-        self.dicoCasToCata={}
-        self.dicoCataToCas={} 
-      for motClef in self.dicoCasToCata:
-           self.dicoCataToCas[self.dicoCasToCata[motClef]]=motClef
-
-
-
-      # Cette instruction genere le contenu du fichier de commandes (persistance)
-      self.text=PythonGenerator.gener(self,obj,format)
-      return self.text
+    def gener(self,obj,format='brut',config=None,appliEficas=None,statut="Leger"):
+
+        self.statut        = statut
+        self.langue        = appliEficas.langue
+        try : self.TelemacdicoEn = appliEficas.readercata.TelemacdicoEn
+        except :
+            print ('Attention : pas de TelemacdicoEn declare')
+            self.TelemacdicoEn = {}
+        self.DicoEnumCasEnInverse = {}
+        #from enum_Telemac2d_auto       import self.TelemacdicoEn
+        for motClef in self.TelemacdicoEn:
+            d={}
+            for valTelemac in self.TelemacdicoEn[motClef]:
+                valEficas   = self.TelemacdicoEn[motClef][valTelemac]
+                d[valEficas] =valTelemac
+            self.DicoEnumCasEnInverse[motClef]=d
+        if self.langue == 'fr' :
+            #from  enum_Telemac2d_auto import DicoEnumCasFrToEnumCasEn
+            self.DicoEnumCasFrToEnumCasEn = appliEficas.readercata.DicoEnumCasFrToEnumCasEn
+            for motClef in self.DicoEnumCasFrToEnumCasEn:
+                d={}
+                for valTelemac in self.DicoEnumCasFrToEnumCasEn[motClef]:
+                    valEficas    = self.DicoEnumCasFrToEnumCasEn[motClef][valTelemac]
+                    d[valEficas] = valTelemac
+                self.DicoEnumCasEnInverse[motClef]=d
+        self.initDico()
+        # Pour Simplifier les verifs d ecriture
+        if hasattr(appliEficas,'listeTelemac') : self.listeTelemac=appliEficas.listeTelemac
+        else : self.listeTelemac = ()
+
+        self.dicoCataToCas={}
+        try :
+            self.dicoCasToCata=appliEficas.readercata.dicoCasToCata
+        except :
+            print ('Attention pas de dicoCasToCata declare')
+            self.dicoCasToCata={}
+            self.dicoCataToCas={}
+        for motClef in self.dicoCasToCata:
+            self.dicoCataToCas[self.dicoCasToCata[motClef]]=motClef
+
+
+
+        # Cette instruction genere le contenu du fichier de commandes (persistance)
+        self.text=PythonGenerator.gener(self,obj,format)
+        return self.text
 
 
 #----------------------------------------------------------------------------------------
 # initialisations
 #----------------------------------------------------------------------------------------
 
-   def initDico(self) :
+    def initDico(self) :
 
-      self.PE=False
-      self.FE=False
-      self.VE=False
-      self.commentaireAvant = False
-      self.texteCom=''
-      if self.langue == "fr" :
-        self.textPE = 'COTES IMPOSEES :'
-        self.textFE = 'DEBITS IMPOSES :'
-        self.textVE = 'VITESSES IMPOSEES :'
-      else :
-        self.textPE = 'PRESCRIBED ELEVATIONS :'
-        self.textFE = 'PRESCRIBED FLOWRATES :'
-        self.textVE = 'PRESCRIBED VELOCITIES :'
-      self.nbTracers = 0
-      self.texteDico = ""
+        self.PE=False
+        self.FE=False
+        self.VE=False
+        self.commentaireAvant = False
+        self.texteCom=''
+        if self.langue == "fr" :
+            self.textPE = 'COTES IMPOSEES :'
+            self.textFE = 'DEBITS IMPOSES :'
+            self.textVE = 'VITESSES IMPOSEES :'
+        else :
+            self.textPE = 'PRESCRIBED ELEVATIONS :'
+            self.textFE = 'PRESCRIBED FLOWRATES :'
+            self.textVE = 'PRESCRIBED VELOCITIES :'
+        self.nbTracers = 0
+        self.texteDico = ""
 
 
 
@@ -134,30 +134,30 @@ class TELEMACGenerator(PythonGenerator):
 # ecriture de tout
 #----------------------------------------------------------------------------------------
 
-   def writeDefault(self,fn) :
-       self.texteDico+='&ETA\n'
-       #if self.statut == 'Leger' : extension = ".Lcas"
-       #else                      : extension = ".cas"
-       extension=".cas"
-       fileDico = fn[:fn.rfind(".")] + extension
-       f = open( str(fileDico), 'w')
-       f.write( self.texteDico )
-       f.close()
+    def writeDefault(self,fn) :
+        self.texteDico+='&ETA\n'
+        #if self.statut == 'Leger' : extension = ".Lcas"
+        #else                      : extension = ".cas"
+        extension=".cas"
+        fileDico = fn[:fn.rfind(".")] + extension
+        f = open( str(fileDico), 'w')
+        f.write( self.texteDico )
+        f.close()
 
 #----------------------------------------------------------------------------------------
 # ecriture de Leger
 #----------------------------------------------------------------------------------------
 
-   def writeComplet(self,fn,jdc,config,appliEficas) :
-       jdc_formate=self.gener(jdc,config=config,appliEficas=appliEficas,statut="Entier")
-       self.writeDefault(fn)
+    def writeComplet(self,fn,jdc,config,appliEficas) :
+        jdc_formate=self.gener(jdc,config=config,appliEficas=appliEficas,statut="Entier")
+        self.writeDefault(fn)
 
 
 #----------------------------------------------------------------------------------------
 #  analyse de chaque noeud de l'arbre
 #----------------------------------------------------------------------------------------
 
-   def generPROC_ETAPE(self,obj):
+    def generPROC_ETAPE(self,obj):
         if  not self.commentaireAvant or self.texteCom.find(obj.nom) < 0:
             self.texteDico += '/------------------------------------------------------------------/\n'
             self.texteDico += '/\t\t\t'+obj.nom +'\n'
@@ -169,7 +169,7 @@ class TELEMACGenerator(PythonGenerator):
 
         return s
 
-   def generMCSIMP(self,obj) :
+    def generMCSIMP(self,obj) :
         """recuperation de l objet MCSIMP"""
         s=PythonGenerator.generMCSIMP(self,obj)
 
@@ -178,60 +178,60 @@ class TELEMACGenerator(PythonGenerator):
         # a reflechir avec Yoann
         # ajouter le statut ?
         if self.statut == 'Leger' :
-          if hasattr(obj.definition,'defaut') and (obj.definition.defaut == obj.valeur) and (obj.nom not in self.listeTelemac) : return s
-          if hasattr(obj.definition,'defaut') and obj.definition.defaut != None and (type(obj.valeur) == tuple or type(obj.valeur) == list) and (tuple(obj.definition.defaut) == tuple(obj.valeur)) and (obj.nom not in self.listeTelemac) : return s
+            if hasattr(obj.definition,'defaut') and (obj.definition.defaut == obj.valeur) and (obj.nom not in self.listeTelemac) : return s
+            if hasattr(obj.definition,'defaut') and obj.definition.defaut != None and (type(obj.valeur) == tuple or type(obj.valeur) == list) and (tuple(obj.definition.defaut) == tuple(obj.valeur)) and (obj.nom not in self.listeTelemac) : return s
 
 
         #nomMajuscule=obj.nom.upper()
         #nom=nomMajuscule.replace('_',' ')
         #if nom in listeSupprime or s == "" : return s
-        if s == "None," : s=None 
+        if s == "None," : s=None
         if s == "" or s==None : return s
 
         sTelemac=s[0:-1]
         if not( type(obj.valeur) in (tuple,list) ):
-           if obj.nom in self.DicoEnumCasEnInverse:
-             try : sTelemac=str(self.DicoEnumCasEnInverse[obj.nom][obj.valeur])
-             except :
-               if obj.valeur==None :  sTelemac=obj.valeur
-               else : print(("generMCSIMP Pb valeur avec ", obj.nom, obj.valeur))
-             # Si le resultat est du texte on ajoute des guillemets
-             if sTelemac[0] not in '0123456789':
-               sTelemac = "'" + sTelemac +"'"
+            if obj.nom in self.DicoEnumCasEnInverse:
+                try : sTelemac=str(self.DicoEnumCasEnInverse[obj.nom][obj.valeur])
+                except :
+                    if obj.valeur==None :  sTelemac=obj.valeur
+                    else : print(("generMCSIMP Pb valeur avec ", obj.nom, obj.valeur))
+                # Si le resultat est du texte on ajoute des guillemets
+                if sTelemac[0] not in '0123456789':
+                    sTelemac = "'" + sTelemac +"'"
 
         if type(obj.valeur) in (tuple,list) :
-           if obj.nom in self.DicoEnumCasEnInverse:
-             #sT = "'"
-             sT=''
-             for v in obj.valeur:
-               try : sT +=str(self.DicoEnumCasEnInverse[obj.nom][v]) +";"
-               except :
-                 if obj.definition.intoSug != [] : sT +=str(v) + ";"
-                 else : print(("generMCSIMP Pb Tuple avec ", obj.nom, v, obj.valeur))
-             #sTelemac=sT[0:-1]+"'"
-             sTelemac=sT[0:-1]
-           else  :
-             sTelemac=sTelemac[0:-1]
-             if sTelemac.find("'") > 0 :
-                sTelemac= sTelemac.replace (',',';\n   ')
-                # on enleve le dernier  ';'
-                index=(sTelemac.rfind(";"))
-                sTelemac=sTelemac[:index]+' '+sTelemac[index+1:]
+            if obj.nom in self.DicoEnumCasEnInverse:
+                #sT = "'"
+                sT=''
+                for v in obj.valeur:
+                    try : sT +=str(self.DicoEnumCasEnInverse[obj.nom][v]) +";"
+                    except :
+                        if obj.definition.intoSug != [] : sT +=str(v) + ";"
+                        else : print(("generMCSIMP Pb Tuple avec ", obj.nom, v, obj.valeur))
+                #sTelemac=sT[0:-1]+"'"
+                sTelemac=sT[0:-1]
+            else  :
+                sTelemac=sTelemac[0:-1]
+                if sTelemac.find("'") > 0 :
+                    sTelemac= sTelemac.replace (',',';\n    ')
+                    # on enleve le dernier  ';'
+                    index=(sTelemac.rfind(";"))
+                    sTelemac=sTelemac[:index]+' '+sTelemac[index+1:]
 
         if self.langue=='fr' :
-           s1=str(sTelemac).replace('True','OUI')
-           s2=s1.replace('False','NON')
+            s1=str(sTelemac).replace('True','OUI')
+            s2=s1.replace('False','NON')
         else :
-           s1=str(sTelemac).replace('True','YES')
-           s2=s1.replace('False','NO')
+            s1=str(sTelemac).replace('True','YES')
+            s2=s1.replace('False','NO')
         if hasattr(obj.definition,'max'):
-           if obj.definition.max != 1:
-              s3=s2.replace(',',';')
-           else:
-              s3=s2
+            if obj.definition.max != 1:
+                s3=s2.replace(',',';')
+            else:
+                s3=s2
         if s3 != "" and s3[0]=='(' :
-          try : s3=s3[1:-1] # cas de liste vide
-          except : s3 = ' '
+            try : s3=s3[1:-1] # cas de liste vide
+            except : s3 = ' '
 
 
         # LIQUID_BOUNDARIES
@@ -240,119 +240,126 @@ class TELEMACGenerator(PythonGenerator):
 
         # cas des Tuples
         if obj.waitTuple()  and s3 != '' and s3  != 'None':
-           s3=s
-           if s3[-1] == ',': s3=s3[:-1] 
+            s3=s
+            if s3[-1] == ',': s3=s3[:-1]
 
 
         if obj.nom not in self.dicoCataToCas :
-           if obj.nom == 'Consigne' : return ""
-           return s
+            if obj.nom == 'Consigne' : return ""
+            return s
 
         nom=self.dicoCataToCas[obj.nom]
-        if nom in ["VARIABLES FOR GRAPHIC PRINTOUTS", "VARIABLES POUR LES SORTIES GRAPHIQUES", "VARIABLES TO BE PRINTED","VARIABLES A IMPRIMER"] :
-              if s3 != '' and s3  != 'None':
+        if nom in ["VARIABLES FOR GRAPHIC PRINTOUTS", "VARIABLES POUR LES SORTIES GRAPHIQUES",
+                   "VARIABLES TO BE PRINTED","VARIABLES A IMPRIMER",
+                   "VARIABLES FOR 3D GRAPHIC PRINTOUTS", "VARIABLES POUR LES SORTIES GRAPHIQUES 3D",
+                   "VARIABLES POUR LES SORTIES GRAPHIQUES 2D", "VARIABLES FOR 2D GRAPHIC PRINTOUTS",
+                   "C_VSM_PRINTOUT_SELECTION"]:
+            if s3 != '' and s3  != 'None':
                 s3=s3.replace(';',',')
                 s3="'"+ s3 +"'"
-              else:
+            else:
                 s3 = "''"
+        if nom in ["COUPLING WITH", "COUPLAGE AVEC"]:
+            s3 = s3.strip().replace("\n","")\
+                           .replace(" ", "")\
+                           .replace("\t", "")\
+                           .replace("';'", ",")
         if s3 == "" or s3 == " " : s3 = " "
         ligne=nom+ " : " + s3 + "\n"
         if len(ligne) > 72 : ligne=self.redecoupeLigne(nom,s3)
         self.texteDico+=ligne
 
-   def generMCFACT(self,obj):
-      """
-      """
-      s=PythonGenerator.generMCFACT(self,obj)
-      if obj.nom in TELEMACGenerator.__dict__ : TELEMACGenerator.__dict__[obj.nom](self,obj)
-
-      return s
-
-
-   def TRACERS(self,obj):
-       if self.nbTracers != 0 :  self.texteDico += 'NUMBER_OF_TRACERS : '+str(self.nbTracers) + '\n'
-
-
-   def NAME_OF_TRACER(self,obj):
-       print((dir(obj) ))
-       print((obj.getGenealogiePrecise()))
-
-   def Validation(self,obj):
-       self.texteDico += "VALIDATION : True \n"
-
-   def Date_De_L_Origine_Des_Temps (self,obj):
-       an=obj.getChild('Year').valeur
-       mois=obj.getChild('Month').valeur
-       jour=obj.getChild('Day').valeur
-       self.texteDico += "ORIGINAL DATE OF TIME  :"+ str(an)+ " ,"+str(mois)+ "," +str(jour)+ "\n"
-
-   def Original_Hour_Of_Time (self,obj):
-       hh=obj.getChild('Hour').valeur
-       mm=obj.getChild('Minute').valeur
-       ss=obj.getChild('Second').valeur
-       self.texteDico += "ORIGINAL HOUR OF TIME :"+str(hh)+" ,"+str(mm)+ ","+str(ss)+"\n"
-
-   def Type_Of_Advection(self,obj):
-       listeAdvection=[1,5,1,1]
-       listeSupg=[2,2,2,2]
-       listeUpwind=[1.,1.,1.,1.]
-       self.listeMCAdvection=[]
-       self.chercheChildren(obj)
-       dicoSuf={ 'U_And_V' : 0, 'H' : 1, 'K_And_Epsilon' : 2, 'Tracers' : 3}
-       for c in  self.listeMCAdvection:
-           if c.nom[0:18] == 'Type_Of_Advection_' and c.valeur!=None:
-              suf=c.nom[18:]
-              index=dicoSuf[suf]
-              listeAdvection[index]=self.DicoEnumCasEnInverse['Type_Of_Advection'][c.valeur]
-           if c.nom[0:13] == 'Supg_Option_' and c.valeur!=None:
-              suf=c.nom[13:]
-              index=dicoSuf[suf]
-              listeAdvection[index]=self.DicoEnumCasEnInverse['Supg_Option'][c.valeur]
-           if c.nom[0:23] == 'Upwind_Coefficients_Of_' and c.valeur!=None:
-              suf=c.nom[23:]
-              index=dicoSuf[suf]
-              listeUpwind[index]=c.valeur
-       self.texteDico += "TYPE OF ADVECTION = "+ str(listeAdvection) + "\n"
-       self.texteDico += "SUPG OPTION = "+ str(listeSupg) + "\n"
-       self.texteDico += "UPWIND COEFFICIENTS = "+ str(listeUpwind) + "\n"
-
-   def chercheChildren(self,obj):
-       for c in obj.listeMcPresents():
-           objc=obj.getChild(c)
-           if hasattr(objc,'listeMcPresents') and objc.listeMcPresents() != [] : self.chercheChildren(objc)
-           else : self.listeMCAdvection.append(objc)
-
-
-
-   def redecoupeLigne(self,nom,valeur) :
-       text=nom+ " : \n"
-       valeur=valeur
-       if valeur.find("'") > -1:
-          lval=valeur.split(";")
-          for v in lval : text+='   '+v+';'
-          text=text[0:-1]+'\n'
-       else :
-         lval=valeur.split(";")
-         ligne="   "
-         for v in lval :
-           if len(ligne+ str(v)+'; ') < 70 : ligne += str(v)+'; '
-           else :
-              text+= ligne+"\n"
-              ligne="   "+str(v)+'; '
-         text+= ligne[0:-2]+'\n'
-       return text
-
-   def generCOMMENTAIRE(self,obj):
-       sans_saut = re.sub("\n$","",obj.valeur)
-       l_lignes = sans_saut.split('\n')
-       txt='/'+66*'-'+'/'+'\n'
-       i=1
-       for ligne in l_lignes:
-         self.texteCom+=ligne+'\n'
-         txt = txt + '/'+ligne+'\n'
-       txt= txt + '/'+66*'-'+'/'+'\n'
-       self.texteDico += txt
-       self.commentaireAvant= True
-       return PythonGenerator.generCOMMENTAIRE(self,obj)
+    def generMCFACT(self,obj):
+        """
+        """
+        s=PythonGenerator.generMCFACT(self,obj)
+        if obj.nom in TELEMACGenerator.__dict__ : TELEMACGenerator.__dict__[obj.nom](self,obj)
+
+        return s
 
 
+    def TRACERS(self,obj):
+        if self.nbTracers != 0 :  self.texteDico += 'NUMBER_OF_TRACERS : '+str(self.nbTracers) + '\n'
+
+
+    def NAME_OF_TRACER(self,obj):
+        print((dir(obj) ))
+        print((obj.getGenealogiePrecise()))
+
+    def Validation(self,obj):
+        self.texteDico += "VALIDATION : True \n"
+
+    def Date_De_L_Origine_Des_Temps (self,obj):
+        an=obj.getChild('Year').valeur
+        mois=obj.getChild('Month').valeur
+        jour=obj.getChild('Day').valeur
+        self.texteDico += "ORIGINAL DATE OF TIME  :"+ str(an)+ " ,"+str(mois)+ "," +str(jour)+ "\n"
+
+    def Original_Hour_Of_Time (self,obj):
+        hh=obj.getChild('Hour').valeur
+        mm=obj.getChild('Minute').valeur
+        ss=obj.getChild('Second').valeur
+        self.texteDico += "ORIGINAL HOUR OF TIME :"+str(hh)+" ,"+str(mm)+ ","+str(ss)+"\n"
+
+    def Type_Of_Advection(self,obj):
+        listeAdvection=[1,5,1,1]
+        listeSupg=[2,2,2,2]
+        listeUpwind=[1.,1.,1.,1.]
+        self.listeMCAdvection=[]
+        self.chercheChildren(obj)
+        dicoSuf={ 'U_And_V' : 0, 'H' : 1, 'K_And_Epsilon' : 2, 'Tracers' : 3}
+        for c in  self.listeMCAdvection:
+            if c.nom[0:18] == 'Type_Of_Advection_' and c.valeur!=None:
+                suf=c.nom[18:]
+                index=dicoSuf[suf]
+                listeAdvection[index]=self.DicoEnumCasEnInverse['Type_Of_Advection'][c.valeur]
+            if c.nom[0:13] == 'Supg_Option_' and c.valeur!=None:
+                suf=c.nom[13:]
+                index=dicoSuf[suf]
+                listeAdvection[index]=self.DicoEnumCasEnInverse['Supg_Option'][c.valeur]
+            if c.nom[0:23] == 'Upwind_Coefficients_Of_' and c.valeur!=None:
+                suf=c.nom[23:]
+                index=dicoSuf[suf]
+                listeUpwind[index]=c.valeur
+        self.texteDico += "TYPE OF ADVECTION = "+ str(listeAdvection) + "\n"
+        self.texteDico += "SUPG OPTION = "+ str(listeSupg) + "\n"
+        self.texteDico += "UPWIND COEFFICIENTS = "+ str(listeUpwind) + "\n"
+
+    def chercheChildren(self,obj):
+        for c in obj.listeMcPresents():
+            objc=obj.getChild(c)
+            if hasattr(objc,'listeMcPresents') and objc.listeMcPresents() != [] : self.chercheChildren(objc)
+            else : self.listeMCAdvection.append(objc)
+
+
+
+    def redecoupeLigne(self,nom,valeur) :
+        text=nom+ " : \n"
+        valeur=valeur
+        if valeur.find("'") > -1:
+            lval=valeur.split(";")
+            for v in lval : text+='   '+v+';'
+            text=text[0:-1]+'\n'
+        else :
+            lval=valeur.split(";")
+            ligne="   "
+            for v in lval :
+                if len(ligne+ str(v)+'; ') < 70 : ligne += str(v)+'; '
+                else :
+                    text+= ligne+"\n"
+                    ligne="   "+str(v)+'; '
+            text+= ligne[0:-2]+'\n'
+        return text
+
+    def generCOMMENTAIRE(self,obj):
+        sans_saut = re.sub("\n$","",obj.valeur)
+        l_lignes = sans_saut.split('\n')
+        txt='/'+66*'-'+'/'+'\n'
+        i=1
+        for ligne in l_lignes:
+            self.texteCom+=ligne+'\n'
+            txt = txt + '/'+ligne+'\n'
+        txt= txt + '/'+66*'-'+'/'+'\n'
+        self.texteDico += txt
+        self.commentaireAvant= True
+        return PythonGenerator.generCOMMENTAIRE(self,obj)
index 78119fecd9205df23c2c64c7e9502a9abb266dab..f336e41609ecf46c2ce1505d8fa36b9c29d58258 100644 (file)
@@ -23,7 +23,7 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import traceback
@@ -32,83 +32,85 @@ from Extensions.i18n import tr
 from .generator_python import PythonGenerator
 
 def entryPoint():
-   """
-      Retourne les informations necessaires pour le chargeur de plugins
-      Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'xml',
-        # La factory pour creer une instance du plugin
-          'factory' : XMLGenerator,
-          }
+    """
+       Retourne les informations necessaires pour le chargeur de plugins
+       Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'xml',
+         # La factory pour creer une instance du plugin
+           'factory' : XMLGenerator,
+           }
 
 
 class XMLGenerator(PythonGenerator):
-   """
-      Ce generateur parcourt un objet de type JDC et produit
-      un texte au format eficas et 
+    """
+       Ce generateur parcourt un objet de type JDC et produit
+       un texte au format eficas et
 
-   """
-   # Les extensions de fichier permis?
-   extensions=('.comm',)
+    """
+    # Les extensions de fichier permis?
+    extensions=('.comm',)
 
 #----------------------------------------------------------------------------------------
-   def gener(self,obj,format='brut',config=None,appliEficas=None):
-       
-      print ('dans gener XMLGenerator Attention if 1 a la place de try ')
-      #try :
-      if 1 :
-        self.texteXML=obj.toXml()
-      #except : 
-      #  self.texteXML='erreur generation'
-      #  pass
-      
-      print (self.texteXML)
-      self.textePourAide =""
-      self.dictNbNomObj={}
-      # Cette instruction genere le contenu du fichier de commandes (persistance)
-      self.text=PythonGenerator.gener(self,obj,format)
-      return self.text
+    def gener(self,obj,format='brut',config=None,appliEficas=None):
+
+        try :
+        #if 1 :
+            self.texteXML=obj.toXml()
+        except :
+            self.texteXML='erreur generation'
+            #print (self.texteXML)
+        #  pass
+
+        self.textePourAide =""
+        self.dictNbNomObj={}
+        # Cette instruction genere le contenu du fichier de commandes (persistance)
+        self.text=PythonGenerator.gener(self,obj,format)
+        return self.text
 
 
 #----------------------------------------------------------------------------------------
 # initialisations
 #----------------------------------------------------------------------------------------
-   
+
 # ecriture
 #----------------------------------------------------------------------------------------
 
-   def writeDefault(self,fn) :
-       fileXML  = fn[:fn.rfind(".")] + '.xml'
-       #filePyxb = fn[:fn.rfind(".")] + '.py'
-       fileBase = os.path.basename(fileXML)
-       fileBase = fileBase[:fileBase.rfind(".")] + '.py'
-       filePyxb = '/tmp/' + fileBase
-       print (filePyxb)
-       #fileDico='/tmp/toto.xml'
-       #print (self.texteXML)
-       f = open( str(fileXML), 'w')
-       f.write(str(self.texteXML))
-       f.close()
-
-       f = open( str(filePyxb), 'w')
-       f.write(str(self.textePourAide))
-       f.close()
-
-
-   def generMCSIMP(self,obj) :
-       if obj.nom in self.dictNbNomObj.keys():
-          nomUtil = obj.nom + "_" + str(self.dictNbNomObj[obj.nom])
-          self.dictNbNomObj[obj.nom] += 1
-       else :
-          nomUtil = obj.nom 
-          self.dictNbNomObj[obj.nom] = 1
-       self.textePourAide +=  nomUtil + " = vimmpCase." + obj.getNomDsXML() + "\n"
-       #self.textePourAide +=  "print  '"+ nomUtil+ " ='  , " + str(nomUtil) + "\n"
-       #self.textePourAide +='txt += "' + nomUtil + '" + " = " +str( ' + nomUtil + ') ' + "\n"
-
-
-
-       s=PythonGenerator.generMCSIMP(self,obj)
-       return s
+    def writeDefault(self,fn) :
+        fileXML  = fn[:fn.rfind(".")] + '.xml'
+        #filePyxb = fn[:fn.rfind(".")] + '.py'
+        fileBase = os.path.basename(fileXML)
+        fileBase = fileBase[:fileBase.rfind(".")] + '.py'
+        filePyxb = '/tmp/example_' + fileBase
+        #print (filePyxb)
+        #fileDico='/tmp/toto.xml'
+        #print (self.texteXML)
+        f = open( str(fileXML), 'w')
+        f.write(str(self.texteXML))
+        f.close()
+
+        f = open( str(filePyxb), 'w')
+        self.textePourAide='txt=""'+'\n'+self.textePourAide
+        self.textePourAide=self.textePourAide+'print (txt)'+'\n'
+        f.write(str(self.textePourAide))
+        f.close()
+
+
+    def generMCSIMP(self,obj) :
+        if obj.nom != 'Consigne' :
+            if obj.nom in self.dictNbNomObj.keys():
+                nomUtil = obj.nom + "_" + str(self.dictNbNomObj[obj.nom])
+                self.dictNbNomObj[obj.nom] += 1
+            else :
+                nomUtil = obj.nom
+                self.dictNbNomObj[obj.nom] = 1
+            if obj.definition.avecBlancs : self.textePourAide +=  nomUtil + " = vimmpCase." + obj.getNomDsXML() + ".s\n"
+            else : self.textePourAide +=  nomUtil + " = vimmpCase." + obj.getNomDsXML() + "\n"
+            self.textePourAide +='txt += "' + nomUtil + '" + " = " +str( ' + nomUtil + ')+"\\n"'+ "\n"
+
+
+
+        s=PythonGenerator.generMCSIMP(self,obj)
+        return s
index 857f53885bd0c351cd7981ec0295c808f90ca8d8..10511063f5f087a6e85ad4a2d99c5ff104bb4236 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-    Ce module contient le plugin generateur de fichier au format 
+    Ce module contient le plugin generateur de fichier au format
     aplat pour EFICAS.
 
 """
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 
 import traceback
@@ -40,308 +40,306 @@ from Accas import GEOM,ASSD,MCNUPLET
 from Accas import COMMENTAIRE,PARAMETRE, PARAMETRE_EVAL,COMMANDE_COMM
 
 def entryPoint():
-   """
-       Retourne les informations necessaires pour le chargeur de plugins
+    """
+        Retourne les informations necessaires pour le chargeur de plugins
 
-       Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'aplat',
-        # La factory pour creer une instance du plugin
-          'factory' : AplatGenerator,
-          }
+        Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'aplat',
+         # La factory pour creer une instance du plugin
+           'factory' : AplatGenerator,
+           }
 
 
 class AplatGenerator(object):
-   """
-       Ce generateur parcourt un objet de type JDC et produit
-       un fichier au format aplat 
-
-       L'acquisition et le parcours sont realises par la methode
-       generator.gener(objet_jdc,format)
-
-       L'ecriture du fichier au format ini par appel de la methode
-       generator.writefile(nom_fichier)
-
-       Ses caracteristiques principales sont exposees dans des attributs 
-       de classe :
-         - extensions : qui donne une liste d'extensions de fichier preconisees
-
-   """
-   # Les extensions de fichier preconisees
-   extensions=('.*',)
-
-   def __init__(self,cr=None):
-      # Si l'objet compte-rendu n'est pas fourni, on utilise le compte-rendu standard
-      if cr :
-         self.cr=cr
-      else:
-         self.cr=N_CR.CR(debut='CR generateur format aplat pour eficas',
-                         fin='fin CR format aplat pour eficas')
-      self.init=''
-      # Le separateur utiise
-      self.sep='//'
-      # Le texte au format aplat est stocke dans l'attribut text
-      self.text=''
-
-   def writefile(self,filename):
-      fp=open(filename,'w')
-      fp.write(self.text)
-      fp.close()
-
-   def gener(self,obj,format='brut',config=None,appliEficas=None):
-      """
-          Retourne une representation du JDC obj sous une forme qui est parametree par format.
-          Si format vaut 'brut', 'standard' ou 'beautifie', retourne le texte issu de generator
-      """
-      liste= self.generator(obj)
-      if format == 'brut':
-         self.text=liste
-      elif format == 'standard':
-         self.text=liste
-      elif format == 'beautifie':
-         self.text=liste
-      else:
-        raise EficasException(tr("Format pas implemente : %s", format))
-      return self.text
-
-   def generator(self,obj):
-      """
-         Cette methode joue un role d'aiguillage en fonction du type de obj
-         On pourrait utiliser les methodes accept et visitxxx a la 
-         place (depend des gouts !!!)
-      """
-      # ATTENTION a l'ordre des tests : il peut avoir de l'importance (heritage)
-      if isinstance(obj,PROC_ETAPE):
-         return self.generPROC_ETAPE(obj)
-      elif isinstance(obj,MACRO_ETAPE):
-         return self.generMACRO_ETAPE(obj)
-      elif isinstance(obj,FORM_ETAPE):
-         return self.generFORM_ETAPE(obj)
-      elif isinstance(obj,ETAPE):
-         return self.generETAPE(obj)
-      elif isinstance(obj,MCFACT):
-         return self.generMCFACT(obj)
-      elif isinstance(obj,MCList):
-         return self.generMCList(obj)
-      elif isinstance(obj,MCBLOC):
-         return self.generMCBLOC(obj)
-      elif isinstance(obj,MCSIMP):
-         return self.generMCSIMP(obj)
-      elif isinstance(obj,ASSD):
-         return self.generASSD(obj)
-      elif isinstance(obj,ETAPE_NIVEAU):
-         return self.generETAPE_NIVEAU(obj)
-      elif isinstance(obj,COMMENTAIRE):
-         return self.generCOMMENTAIRE(obj)
-      # Attention doit etre place avant PARAMETRE (raison : heritage)
-      elif isinstance(obj,PARAMETRE_EVAL):
-         return self.generPARAMETRE_EVAL(obj)
-      elif isinstance(obj,PARAMETRE):
-         return self.generPARAMETRE(obj)
-      elif isinstance(obj,EVAL):
-         return self.generEVAL(obj)
-      elif isinstance(obj,COMMANDE_COMM):
-         return self.generCOMMANDE_COMM(obj)
-      elif isinstance(obj,JDC):
-         return self.generJDC(obj)
-      elif isinstance(obj,MCNUPLET):
-         return self.generMCNUPLET(obj)
-      else:
-         raise EficasException(tr("Format non implemente : %s", format))
-
-
-   def generJDC(self,obj):
-      """
-         Cette methode convertit un objet JDC en une chaine de
-         caracteres a la syntaxe aplat
-      """
-      text=''
-      if obj.definition.l_niveaux == ():
-         # Il n'y a pas de niveaux
-         for etape in obj.etapes:
-            text=text+self.generator(etape)+'\n'
-      else:
-         # Il y a des niveaux
-         for etape_niveau in obj.etapes_niveaux:
-            text=text+self.generator(etape_niveau)+'\n'
-      return text
-
-   def generCOMMANDE_COMM(self,obj):
-      """
-         Cette methode convertit un COMMANDE_COMM
-         en une chaine de caracteres a la syntaxe aplat 
-      """
-      l_lignes = obj.valeur.split('\n')
-      txt=''
-      for ligne in l_lignes:
-          txt = txt + '##'+ligne+'\n'
-      return txt
-
-   def generEVAL(self,obj):
-      """
-         Cette methode convertit un EVAL
-         en une chaine de caracteres a la syntaxe aplat 
-      """
-      return 'EVAL("""'+ obj.valeur +'""")'
-
-   def generCOMMENTAIRE(self,obj):
-      """
-         Cette methode convertit un COMMENTAIRE
-         en une chaine de caracteres a la syntaxe aplat  
-      """
-      l_lignes = obj.valeur.split('\n')
-      txt=''
-      for ligne in l_lignes:
-        txt = txt + '#'+ligne+'\n'
-      return txt
-
-   def generPARAMETRE_EVAL(self,obj):
-      """
-         Cette methode convertit un PARAMETRE_EVAL
-         en une chaine de caracteres a la syntaxe aplat 
-      """
-      if obj.valeur == None:
-         return obj.nom + ' = None ;\n'
-      else:
-         return obj.nom + ' = '+ self.generator(obj.valeur) +';\n'
-
-   def generPARAMETRE(self,obj):
-      """
-         Cette methode convertit un PARAMETRE
-         en une chaine de caracteres a la syntaxe aplat 
-      """
-      if type(obj.valeur) == bytes or  type(obj.valeur) == str:
-        # PN pour corriger le bug a='3+4' au lieu de a= 3+4
-        #return obj.nom + " = '" + obj.valeur + "';\n"
-        return obj.nom + " = " + obj.valeur + ";\n"
-      else:
-        return obj.nom + ' = ' + str(obj.valeur) + ';\n'
-
-   def generETAPE_NIVEAU(self,obj):
-      """
-         Cette methode convertit une etape niveau
-         en une chaine de caracteres a la syntaxe aplat 
-      """
-      text=''
-      if obj.etapes_niveaux == []:
-        for etape in obj.etapes:
-          text=text+self.generator(etape)+'\n'
-      else:
-        for etape_niveau in obj.etapes_niveaux:
-          text=text+self.generator(etape_niveau)+'\n'
-      return text
-
-   def gener_etape(self,obj):
-      """
-         Cette methode est utilise pour convertir les objets etape
-         en une chaine de caracteres a la syntaxe aplat 
-      """
-      text=''
-      for v in obj.mcListe:
-         text=text + self.generator(v)
-      if text=='':
-         return self.init+'\n'
-      else:
-         return text
-
-   def generETAPE(self,obj):
-      """
-         Cette methode convertit une etape
-         en une chaine de caracteres a la syntaxe aplat 
-      """
-      try:
-        sdname= self.generator(obj.sd)
-      except:
-        sdname='sansnom'
-      self.init = sdname + self.sep + obj.nom
-      return self.gener_etape(obj)
-
-   def generMACRO_ETAPE(self,obj):
-      """
-         Cette methode convertit une macro-etape
-         en une chaine de caracteres a la syntaxe aplat 
-      """
-      try:
-        if obj.sd == None:
-          self.init = obj.nom
-        else:
-          sdname= self.generator(obj.sd)
-          self.init = sdname + self.sep + obj.nom
-      except:
-        self.init = 'sansnom' + self.sep + obj.nom
-
-      return self.gener_etape(obj)
-
-   generPROC_ETAPE = generMACRO_ETAPE
-
-   generFORM_ETAPE = generMACRO_ETAPE
-
-   def generASSD(self,obj):
-      """
-          Convertit un objet derive d'ASSD en une chaine de caracteres a la
-          syntaxe aplat 
-      """
-      return obj.getName()
-
-   def generMCList(self,obj):
-      """
-          Convertit un objet MCList en une chaine de caracteres a la
-          syntaxe aplat
-      """
-      i=0
-      text = ''
-      init = self.init + self.sep + obj.nom
-      old_init=self.init
-      for data in obj.data :
-        i=i+1
-        self.init = init + self.sep + "occurrence n"+repr(i)
-        text = text + self.generator(data)
-      self.init=old_init
-      return text
-
-   def generMCSIMP(self,obj) :
-      """
-          Convertit un objet MCSIMP en une chaine de caracteres a la
-          syntaxe aplat 
-      """
-      if type(obj.valeur) in (tuple,list) :
-         # On est en presence d'une liste de valeur
-         rep = '('
-         for val in obj.valeur:
-           #if type(val) == types.InstanceType :
-           if isinstance(val,object):
-             rep = rep + self.generator(val) +','
-           else:
-             rep = rep + repr(val)+','
-         rep = rep + ')'
-      #elif type(obj.valeur) == types.InstanceType :
-      elif type(obj.valeur) == object :
-         # On est en presence d'une valeur unique de type instance
-         rep = self.generator(obj.valeur)
-      else :
-         # On est en presence d'une valeur unique
-         rep = repr(obj.valeur)
-      return self.init + self.sep + obj.nom + ' :' + rep + '\n'
-
-   def generMCCOMPO(self,obj):
-      """
-          Convertit un objet MCCOMPO en une chaine de caracteres a la
-          syntaxe aplat
-      """
-      text = ''
-      old_init=self.init
-      self.init = self.init + self.sep + obj.nom
-      for mocle in obj.mcListe :
-        text = text + self.generator(mocle)
-      self.init=old_init
-      return text
-
-   generMCFACT=generMCCOMPO
-
-   generMCBLOC=generMCCOMPO
-
-   generMCNUPLET=generMCCOMPO
+    """
+        Ce generateur parcourt un objet de type JDC et produit
+        un fichier au format aplat
+
+        L'acquisition et le parcours sont realises par la methode
+        generator.gener(objet_jdc,format)
+
+        L'ecriture du fichier au format ini par appel de la methode
+        generator.writeFile(nom_fichier)
 
+        Ses caracteristiques principales sont exposees dans des attributs
+        de classe :
+          - extensions : qui donne une liste d'extensions de fichier preconisees
 
+    """
+    # Les extensions de fichier preconisees
+    extensions=('.*',)
+
+    def __init__(self,cr=None):
+        # Si l'objet compte-rendu n'est pas fourni, on utilise le compte-rendu standard
+        if cr :
+            self.cr=cr
+        else:
+            self.cr=N_CR.CR(debut='CR generateur format aplat pour eficas',
+                            fin='fin CR format aplat pour eficas')
+        self.init=''
+        # Le separateur utiise
+        self.sep='//'
+        # Le texte au format aplat est stocke dans l'attribut text
+        self.text=''
+
+    def writefile(self,filename):
+        fp=open(filename,'w')
+        fp.write(self.text)
+        fp.close()
+
+    def gener(self,obj,format='brut',config=None,appliEficas=None):
+        """
+            Retourne une representation du JDC obj sous une forme qui est parametree par format.
+            Si format vaut 'brut', 'standard' ou 'beautifie', retourne le texte issu de generator
+        """
+        liste= self.generator(obj)
+        if format == 'brut':
+            self.text=liste
+        elif format == 'standard':
+            self.text=liste
+        elif format == 'beautifie':
+            self.text=liste
+        else:
+            raise EficasException(tr("Format pas implemente : %s", format))
+        return self.text
+
+    def generator(self,obj):
+        """
+           Cette methode joue un role d'aiguillage en fonction du type de obj
+           On pourrait utiliser les methodes accept et visitxxx a la
+           place (depend des gouts !!!)
+        """
+        # ATTENTION a l'ordre des tests : il peut avoir de l'importance (heritage)
+        if isinstance(obj,PROC_ETAPE):
+            return self.generPROC_ETAPE(obj)
+        elif isinstance(obj,MACRO_ETAPE):
+            return self.generMACRO_ETAPE(obj)
+        elif isinstance(obj,FORM_ETAPE):
+            return self.generFORM_ETAPE(obj)
+        elif isinstance(obj,ETAPE):
+            return self.generETAPE(obj)
+        elif isinstance(obj,MCFACT):
+            return self.generMCFACT(obj)
+        elif isinstance(obj,MCList):
+            return self.generMCList(obj)
+        elif isinstance(obj,MCBLOC):
+            return self.generMCBLOC(obj)
+        elif isinstance(obj,MCSIMP):
+            return self.generMCSIMP(obj)
+        elif isinstance(obj,ASSD):
+            return self.generASSD(obj)
+        elif isinstance(obj,ETAPE_NIVEAU):
+            return self.generETAPE_NIVEAU(obj)
+        elif isinstance(obj,COMMENTAIRE):
+            return self.generCOMMENTAIRE(obj)
+        # Attention doit etre place avant PARAMETRE (raison : heritage)
+        elif isinstance(obj,PARAMETRE_EVAL):
+            return self.generPARAMETRE_EVAL(obj)
+        elif isinstance(obj,PARAMETRE):
+            return self.generPARAMETRE(obj)
+        elif isinstance(obj,EVAL):
+            return self.generEVAL(obj)
+        elif isinstance(obj,COMMANDE_COMM):
+            return self.generCOMMANDE_COMM(obj)
+        elif isinstance(obj,JDC):
+            return self.generJDC(obj)
+        elif isinstance(obj,MCNUPLET):
+            return self.generMCNUPLET(obj)
+        else:
+            raise EficasException(tr("Format non implemente : %s", format))
+
+
+    def generJDC(self,obj):
+        """
+           Cette methode convertit un objet JDC en une chaine de
+           caracteres a la syntaxe aplat
+        """
+        text=''
+        if obj.definition.l_niveaux == ():
+            # Il n'y a pas de niveaux
+            for etape in obj.etapes:
+                text=text+self.generator(etape)+'\n'
+        else:
+            # Il y a des niveaux
+            for etape_niveau in obj.etapes_niveaux:
+                text=text+self.generator(etape_niveau)+'\n'
+        return text
+
+    def generCOMMANDE_COMM(self,obj):
+        """
+           Cette methode convertit un COMMANDE_COMM
+           en une chaine de caracteres a la syntaxe aplat
+        """
+        l_lignes = obj.valeur.split('\n')
+        txt=''
+        for ligne in l_lignes:
+            txt = txt + '##'+ligne+'\n'
+        return txt
+
+    def generEVAL(self,obj):
+        """
+           Cette methode convertit un EVAL
+           en une chaine de caracteres a la syntaxe aplat
+        """
+        return 'EVAL("""'+ obj.valeur +'""")'
+
+    def generCOMMENTAIRE(self,obj):
+        """
+           Cette methode convertit un COMMENTAIRE
+           en une chaine de caracteres a la syntaxe aplat
+        """
+        l_lignes = obj.valeur.split('\n')
+        txt=''
+        for ligne in l_lignes:
+            txt = txt + '#'+ligne+'\n'
+        return txt
+
+    def generPARAMETRE_EVAL(self,obj):
+        """
+           Cette methode convertit un PARAMETRE_EVAL
+           en une chaine de caracteres a la syntaxe aplat
+        """
+        if obj.valeur == None:
+            return obj.nom + ' = None ;\n'
+        else:
+            return obj.nom + ' = '+ self.generator(obj.valeur) +';\n'
+
+    def generPARAMETRE(self,obj):
+        """
+           Cette methode convertit un PARAMETRE
+           en une chaine de caracteres a la syntaxe aplat
+        """
+        if type(obj.valeur) == bytes or  type(obj.valeur) == str:
+            # PN pour corriger le bug a='3+4' au lieu de a= 3+4
+            #return obj.nom + " = '" + obj.valeur + "';\n"
+            return obj.nom + " = " + obj.valeur + ";\n"
+        else:
+            return obj.nom + ' = ' + str(obj.valeur) + ';\n'
+
+    def generETAPE_NIVEAU(self,obj):
+        """
+           Cette methode convertit une etape niveau
+           en une chaine de caracteres a la syntaxe aplat
+        """
+        text=''
+        if obj.etapes_niveaux == []:
+            for etape in obj.etapes:
+                text=text+self.generator(etape)+'\n'
+        else:
+            for etape_niveau in obj.etapes_niveaux:
+                text=text+self.generator(etape_niveau)+'\n'
+        return text
+
+    def gener_etape(self,obj):
+        """
+           Cette methode est utilise pour convertir les objets etape
+           en une chaine de caracteres a la syntaxe aplat
+        """
+        text=''
+        for v in obj.mcListe:
+            text=text + self.generator(v)
+        if text=='':
+            return self.init+'\n'
+        else:
+            return text
+
+    def generETAPE(self,obj):
+        """
+           Cette methode convertit une etape
+           en une chaine de caracteres a la syntaxe aplat
+        """
+        try:
+            sdname= self.generator(obj.sd)
+        except:
+            sdname='sansnom'
+        self.init = sdname + self.sep + obj.nom
+        return self.gener_etape(obj)
+
+    def generMACRO_ETAPE(self,obj):
+        """
+           Cette methode convertit une macro-etape
+           en une chaine de caracteres a la syntaxe aplat
+        """
+        try:
+            if obj.sd == None:
+                self.init = obj.nom
+            else:
+                sdname= self.generator(obj.sd)
+                self.init = sdname + self.sep + obj.nom
+        except:
+            self.init = 'sansnom' + self.sep + obj.nom
+
+        return self.gener_etape(obj)
+
+    generPROC_ETAPE = generMACRO_ETAPE
+
+    generFORM_ETAPE = generMACRO_ETAPE
+
+    def generASSD(self,obj):
+        """
+            Convertit un objet derive d'ASSD en une chaine de caracteres a la
+            syntaxe aplat
+        """
+        return obj.getName()
+
+    def generMCList(self,obj):
+        """
+            Convertit un objet MCList en une chaine de caracteres a la
+            syntaxe aplat
+        """
+        i=0
+        text = ''
+        init = self.init + self.sep + obj.nom
+        old_init=self.init
+        for data in obj.data :
+            i=i+1
+            self.init = init + self.sep + "occurrence n"+repr(i)
+            text = text + self.generator(data)
+        self.init=old_init
+        return text
+
+    def generMCSIMP(self,obj) :
+        """
+            Convertit un objet MCSIMP en une chaine de caracteres a la
+            syntaxe aplat
+        """
+        if type(obj.valeur) in (tuple,list) :
+            # On est en presence d'une liste de valeur
+            rep = '('
+            for val in obj.valeur:
+                #if type(val) == types.InstanceType :
+                if isinstance(val,object):
+                    rep = rep + self.generator(val) +','
+                else:
+                    rep = rep + repr(val)+','
+            rep = rep + ')'
+        #elif type(obj.valeur) == types.InstanceType :
+        elif type(obj.valeur) == object :
+            # On est en presence d'une valeur unique de type instance
+            rep = self.generator(obj.valeur)
+        else :
+            # On est en presence d'une valeur unique
+            rep = repr(obj.valeur)
+        return self.init + self.sep + obj.nom + ' :' + rep + '\n'
+
+    def generMCCOMPO(self,obj):
+        """
+            Convertit un objet MCCOMPO en une chaine de caracteres a la
+            syntaxe aplat
+        """
+        text = ''
+        old_init=self.init
+        self.init = self.init + self.sep + obj.nom
+        for mocle in obj.mcListe :
+            text = text + self.generator(mocle)
+        self.init=old_init
+        return text
+
+    generMCFACT=generMCCOMPO
+
+    generMCBLOC=generMCCOMPO
+
+    generMCNUPLET=generMCCOMPO
index 5de017968d3d9d848853f2c849ff9eb1df1930c2..5122789aa8b0e99f0c8c21c08c7eb96fd8e59ec6 100644 (file)
@@ -23,7 +23,7 @@
 from __future__ import absolute_import
 from __future__ import print_function
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import traceback
@@ -32,63 +32,63 @@ from Extensions.i18n import tr
 from .generator_python import PythonGenerator
 
 def entryPoint():
-   """
-      Retourne les informations necessaires pour le chargeur de plugins
-      Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'dico',
-        # La factory pour creer une instance du plugin
-          'factory' : DicoGenerator,
-          }
+    """
+       Retourne les informations necessaires pour le chargeur de plugins
+       Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'dico',
+         # La factory pour creer une instance du plugin
+           'factory' : DicoGenerator,
+           }
 
 
 class DicoGenerator(PythonGenerator):
-   """
-      Ce generateur parcourt un objet de type JDC et produit
-      un texte au format eficas et 
-      un texte au format dictionnaire
+    """
+       Ce generateur parcourt un objet de type JDC et produit
+       un texte au format eficas et
+       un texte au format dictionnaire
 
-   """
-   # Les extensions de fichier permis?
-   extensions=('.comm',)
+    """
+    # Les extensions de fichier permis?
+    extensions=('.comm',)
 
 #----------------------------------------------------------------------------------------
-   def gener(self,obj,format='brut',config=None,appliEficas=None):
-       
-      self.initDico()
-      
-      # Cette instruction genere le contenu du fichier de commandes (persistance)
-      self.text=PythonGenerator.gener(self,obj,format)
-      return self.text
+    def gener(self,obj,format='brut',config=None,appliEficas=None):
+
+        self.initDico()
+
+        # Cette instruction genere le contenu du fichier de commandes (persistance)
+        self.text=PythonGenerator.gener(self,obj,format)
+        return self.text
 
 
 #----------------------------------------------------------------------------------------
 # initialisations
 #----------------------------------------------------------------------------------------
-   
-   def initDico(self) :
-      self.Dico={}
-      self.texteDico = ""
+
+    def initDico(self) :
+
+        self.Dico={}
+        self.texteDico = ""
 
 
 #----------------------------------------------------------------------------------------
 # ecriture
 #----------------------------------------------------------------------------------------
 
-   def writeDefault(self,fn) :
-       fileDico = fn[:fn.rfind(".")] + '.py'
-       f = open( str(fileDico), 'w')
-       f.write('Dico = '+str(self.Dico))
-       f.close()
+    def writeDefault(self,fn) :
+        fileDico = fn[:fn.rfind(".")] + '.py'
+        f = open( str(fileDico), 'w')
+        f.write('Dico = '+str(self.Dico))
+        f.close()
 
 #----------------------------------------------------------------------------------------
-#  analyse de chaque noeud de l'arbre 
+#  analyse de chaque noeud de l'arbre
 #----------------------------------------------------------------------------------------
 
-   def generMCSIMP(self,obj) :
+    def generMCSIMP(self,obj) :
         """recuperation de l objet MCSIMP"""
         s=PythonGenerator.generMCSIMP(self,obj)
         courant=self.Dico
@@ -98,4 +98,3 @@ class DicoGenerator(PythonGenerator):
         courant[obj.nom]=obj.val
         self.texteDico+=obj.nom+ "=" + s[0:-1]+ "\n"
         return s
-
index 3346a1641ade6dcc7445b978fdb5c215ddbd9cf4..07c91ccd3f7b39e6c1f8e26dae15f38c98f3c423 100644 (file)
@@ -22,7 +22,7 @@
 
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import traceback
@@ -31,121 +31,120 @@ from Extensions.i18n import tr
 from .generator_python import PythonGenerator
 
 def entryPoint():
-   """
-      Retourne les informations necessaires pour le chargeur de plugins
-      Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'dicoImbrique',
-        # La factory pour creer une instance du plugin
-          'factory' : DicoImbriqueGenerator,
-          }
+    """
+       Retourne les informations necessaires pour le chargeur de plugins
+       Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'dicoImbrique',
+         # La factory pour creer une instance du plugin
+           'factory' : DicoImbriqueGenerator,
+           }
 
 
 class DicoImbriqueGenerator(PythonGenerator):
-   """
-      Ce generateur parcourt un objet de type JDC et produit
-      un texte au format eficas et 
-      un texte au format dictionnaire
+    """
+       Ce generateur parcourt un objet de type JDC et produit
+       un texte au format eficas et
+       un texte au format dictionnaire
 
-   """
-   # Les extensions de fichier permis?
-   extensions=('.comm',)
+    """
+    # Les extensions de fichier permis?
+    extensions=('.comm',)
 
 #----------------------------------------------------------------------------------------
-   def gener(self,obj,format='brut',config=None, appliEficas=None):
-       
-      self.initDico()
-      
-      # Cette instruction genere le contenu du fichier de commandes (persistance)
-      self.text=PythonGenerator.gener(self,obj,format)
-      #print (self.text)
-      print (self.Dico)
-      return self.text
+    def gener(self,obj,format='brut',config=None, appliEficas=None):
+
+        self.initDico()
+
+        # Cette instruction genere le contenu du fichier de commandes (persistance)
+        self.text=PythonGenerator.gener(self,obj,format)
+        #print (self.text)
+        print (self.Dico)
+        return self.text
 
 
 
 #----------------------------------------------------------------------------------------
 # initialisations
 #----------------------------------------------------------------------------------------
-   
-   def initDico(self) :
-      self.Dico={}
-      self.DicoDejaLa={}
-      self.Entete = ''
+
+    def initDico(self) :
+
+        self.Dico={}
+        self.DicoDejaLa={}
+        self.Entete = ''
 
 
 #----------------------------------------------------------------------------------------
 # ecriture
 #----------------------------------------------------------------------------------------
 
-   def writeDefault(self,fn) :
-       fileDico = fn[:fn.rfind(".")] + '.py'
-       f = open( str(fileDico), 'wb')
+    def writeDefault(self,fn) :
+        fileDico = fn[:fn.rfind(".")] + '.py'
+        f = open( str(fileDico), 'w')
 
-       f.write( self.Entete + "Dico =" + str(self.Dico) )
-       f.close()
+        f.write( "Dico =" + str(self.Dico) )
+        #f.write( self.Entete + "Dico =" + str(self.Dico) )
+        f.close()
 
 #----------------------------------------------------------------------------------------
-#  analyse de chaque noeud de l'arbre 
+#  analyse de chaque noeud de l'arbre
 #----------------------------------------------------------------------------------------
 
-   def generMCSIMP(self,obj) :
+    def generMCSIMP(self,obj) :
         """recuperation de l objet MCSIMP"""
 
         s=PythonGenerator.generMCSIMP(self,obj)
         if obj.isInformation() : return s
-        if not obj.isValid() :  return s 
+        if not obj.isValid() :  return s
 
-        liste=obj.getGenealogiePrecise() 
+        liste=obj.getGenealogiePrecise()
 
         if obj.etape.nom=='MODIFICATION_CATALOGUE' : return s
         nom = obj.etape.nom
-        
-        if hasattr(obj.etape,'sdnom') and obj.etape.sdnom != None and obj.etape.sdnom != "" : 
-           nom = nom+ obj.etape.sdnom
+
+        if hasattr(obj.etape,'sdnom') and obj.etape.sdnom != None and obj.etape.sdnom != "" :
+            nom = nom+ obj.etape.sdnom
 
         if not(nom in self.Dico) : dicoCourant={}
         else : dicoCourant=self.Dico [nom]
 
         nomFeuille=liste[-1]
         if nomFeuille in dicoCourant or nomFeuille in self.DicoDejaLa:
-           if nomFeuille in self.DicoDejaLa:
-              nomTravail= nomFeuille +'_'+str(self.DicoDejaLa[nomFeuille])
-              self.DicoDejaLa[nomFeuille]=self.DicoDejaLa[nomFeuille]+1
-              nomFeuille=nomTravail
-           else :
-              self.DicoDejaLa[nomFeuille]=3
-              nom1=nomFeuille +'_1'
-              dicoCourant[nom1]= dicoCourant[nomFeuille]
-              del dicoCourant[nomFeuille]
-              nomFeuille=nomFeuille +'_2'
+            if nomFeuille in self.DicoDejaLa:
+                nomTravail= nomFeuille +'_'+str(self.DicoDejaLa[nomFeuille])
+                self.DicoDejaLa[nomFeuille]=self.DicoDejaLa[nomFeuille]+1
+                nomFeuille=nomTravail
+            else :
+                self.DicoDejaLa[nomFeuille]=3
+                nom1=nomFeuille +'_1'
+                dicoCourant[nom1]= dicoCourant[nomFeuille]
+                del dicoCourant[nomFeuille]
+                nomFeuille=nomFeuille +'_2'
 
 
         if hasattr(obj.valeur,'nom'): dicoCourant[nomFeuille]=obj.valeur.nom
-        else : 
-           if type(obj.valeur)  in (list,tuple):
-              try :
+        else :
+            if type(obj.valeur)  in (list,tuple):
+                try :
 #PNPNPN a remplacer par plus propre
-                 if obj.definition.validators.typeDesTuples[0] !='R' :
-                    val=[]
-                    elt=[]
-                    for tupleElt in obj.valeur :
-                        elt=(str(tupleElt[0]),tupleElt[1])
-                        val.append(elt)
-                    dicoCourant[nomFeuille]=val
-                 else :
-                    dicoCourant[nomFeuille]=obj.valeur
-              except :
-                 dicoCourant[nomFeuille]=obj.valeurFormatee
-           #else :dicoCourant[nomFeuille]=obj.valeurFormatee
-           else :
-              dicoCourant[nomFeuille]=obj.valeurFormatee
-              #print nomFeuille, obj.valeurFormatee
+                    if obj.definition.validators.typeDesTuples[0] !='R' :
+                        val=[]
+                        elt=[]
+                        for tupleElt in obj.valeur :
+                            elt=(str(tupleElt[0]),tupleElt[1])
+                            val.append(elt)
+                        dicoCourant[nomFeuille]=val
+                    else :
+                        dicoCourant[nomFeuille]=obj.valeur
+                except :
+                    dicoCourant[nomFeuille]=obj.valeurFormatee
+            #else :dicoCourant[nomFeuille]=obj.valeurFormatee
+            else :
+                dicoCourant[nomFeuille]=obj.valeurFormatee
+                #print nomFeuille, obj.valeurFormatee
         self.Dico[nom]=dicoCourant
 
         return s
-
-  
index d66d49d7f0f6f10aa77381b82fbb7176360d8694..32cee7be66def2773834b97d2b429bc10d8d6f0f 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-   Ce module contient le plugin generateur de fichier au format 
+   Ce module contient le plugin generateur de fichier au format
    CARMEL3D pour EFICAS.
 
 """
 from __future__ import print_function
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import traceback
@@ -35,77 +35,77 @@ import Accas
 from .generator_python import PythonGenerator
 
 def entryPoint():
-   """
-      Retourne les informations necessaires pour le chargeur de plugins
+    """
+       Retourne les informations necessaires pour le chargeur de plugins
 
-      Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'MAP',
-        # La factory pour creer une instance du plugin
-          'factory' : MapGenerator,
-          }
+       Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'MAP',
+         # La factory pour creer une instance du plugin
+           'factory' : MapGenerator,
+           }
 
 
 class MapGenerator(PythonGenerator):
-   """
-      Ce generateur parcourt un objet de type JDC et produit
-      un texte au format eficas et 
-      un texte au format py 
-
-   """
-
-   def gener(self,obj,format='brut',config=None,appliEficas=None):
-      self.initDico()
-      self.text=PythonGenerator.gener(self,obj,format)
-      if obj.isValid() :self.genereExeMap()
-      return self.text
-
-
-   def genereExeMap(self) :
-      '''
-      Prepare le contenu du fichier de parametres python
-      peut ensuite etre obtenu au moyen de la fonction getTubePy().
-      '''
-      nomSpec="spec_"+self.schema
-      self.texteEXE="from map.spec import %s;\n"%nomSpec
-      self.texteEXE+="node=%s.new();\n"%nomSpec
-      self.texteEXE+="node.getInputData();\n"
-      self.texteEXE+="node.setInputData(%s);\n"%self.dictValeur
-      self.texteEXE+="node.execute();\n"
-      self.texteEXE+="res=node.getOutputData();\n"
-      
-
-   def initDico(self) :
-      if not hasattr(self,'schema') : self.schema=""
-      self.dictParam={}
-      self.dictValeur={}
-  
-   def writeDefault(self, fn):
-      fileEXE = fn[:fn.rfind(".")] + '.py'
-      f = open( str(fileEXE), 'wb')
-      f.write( self.texteEXE )
-      f.close()
-
-   def generMCSIMP(self,obj) :
-      """
-      Convertit un objet MCSIMP en texte python
-      Remplit le dictionnaire des MCSIMP 
-      """
-      
-      if obj.getGenealogie()[0][-6:-1]=="_PARA":
-         self.dictParam[obj.nom]=obj.valeur
-      else :
-         self.dictValeur[obj.nom]=obj.valeur
-      s=PythonGenerator.generMCSIMP(self,obj)
-      return s
-  
-  
-   def generRUN(self,obj,schema):
-       if not(obj.isValid()) :
-          print ("TODO TODO TODO")
-       self.texteEXE=""
-       self.schema=schema
-       textComm=self.gener(obj)
-       return self.texteEXE
+    """
+       Ce generateur parcourt un objet de type JDC et produit
+       un texte au format eficas et
+       un texte au format py
+
+    """
+
+    def gener(self,obj,format='brut',config=None,appliEficas=None):
+        self.initDico()
+        self.text=PythonGenerator.gener(self,obj,format)
+        if obj.isValid() :self.genereExeMap()
+        return self.text
+
+
+    def genereExeMap(self) :
+        '''
+        Prepare le contenu du fichier de parametres python
+        peut ensuite etre obtenu au moyen de la fonction getTubePy().
+        '''
+        nomSpec="spec_"+self.schema
+        self.texteEXE="from map.spec import %s;\n"%nomSpec
+        self.texteEXE+="node=%s.new();\n"%nomSpec
+        self.texteEXE+="node.getInputData();\n"
+        self.texteEXE+="node.setInputData(%s);\n"%self.dictValeur
+        self.texteEXE+="node.execute();\n"
+        self.texteEXE+="res=node.getOutputData();\n"
+
+
+    def initDico(self) :
+        if not hasattr(self,'schema') : self.schema=""
+        self.dictParam={}
+        self.dictValeur={}
+
+    def writeDefault(self, fn):
+        fileEXE = fn[:fn.rfind(".")] + '.py'
+        f = open( str(fileEXE), 'wb')
+        f.write( self.texteEXE )
+        f.close()
+
+    def generMCSIMP(self,obj) :
+        """
+        Convertit un objet MCSIMP en texte python
+        Remplit le dictionnaire des MCSIMP
+        """
+
+        if obj.getGenealogie()[0][-6:-1]=="_PARA":
+            self.dictParam[obj.nom]=obj.valeur
+        else :
+            self.dictValeur[obj.nom]=obj.valeur
+        s=PythonGenerator.generMCSIMP(self,obj)
+        return s
+
+
+    def generRUN(self,obj,schema):
+        if not(obj.isValid()) :
+            print ("TODO TODO TODO")
+        self.texteEXE=""
+        self.schema=schema
+        textComm=self.gener(obj)
+        return self.texteEXE
index 84098a559e0342257bbbf452b9db100123fcea2d..a5b8ef4c41cf5ffab44f91228d0e464c1715fd89 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-   Ce module contient le plugin generateur de fichier au format 
+   Ce module contient le plugin generateur de fichier au format
    CARMEL3D pour EFICAS.
 
 """
 from __future__ import print_function
 from __future__ import absolute_import
 try :
-   from builtins import str
+    from builtins import str
 except : pass
 
 import traceback
@@ -35,204 +35,203 @@ import Accas
 from .generator_python import PythonGenerator
 
 listeCalParName = ('Time' , 'Temperature', 'DoseRate', 'Thickness')        #'calculation_parameter_names'
-                  
+
+
 def entryPoint():
-   """
-      Retourne les informations necessaires pour le chargeur de plugins
+    """
+       Retourne les informations necessaires pour le chargeur de plugins
 
-      Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'MAPVp',
-        # La factory pour creer une instance du plugin
-          'factory' : MapGenerator,
-          }
+       Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'MAPVp',
+         # La factory pour creer une instance du plugin
+           'factory' : MapGenerator,
+           }
 
 
 class MapGenerator(PythonGenerator):
-   """
-      Ce generateur parcourt un objet de type JDC et produit
-      un texte au format eficas et 
-      un texte au format py 
-
-   """
-
-   def gener(self,obj,format='brut',config=None,appliEficas=None):
-      self.appliEficas=appliEficas
-      self.cata=self.appliEficas.readercata.cata
-      self.initDico()
-      self.text=PythonGenerator.gener(self,obj,format)
-      if obj.isValid() :self.genereTexte(obj)
-      return self.text
-
-   def initDico(self) :
-      self.texteInput = ""
-      self.dictParam={}
-      self.dictValeur={}
-      self.listeEquations=[]
-      self.typeEtude = ""
-  
-
-   def genereTexte(self,obj) :
-     print ('genereTexte', self.typeEtude)
-     if self.typeEtude == "Calculation" : self.genereCalculation()
-
-
-   def generPROC_ETAPE(self,obj):
-     s=PythonGenerator.generPROC_ETAPE(self,obj)
-     if obj.nom == "Calculation_for_Mechanistic" : print ('hjkhjkh');self.typeEtude="Calculation" 
-     return s 
-      
-   def genereCalculation(self) :
-      '''
-      Prepare le contenu du fichier de parametres python
-      '''
-      self.texteInput = ""
-      self.texteInput += self.genereCsv()
-      self.texteInput += self.genereCalculationParams()
-      self.texteInput += self.txtNomCst
-      self.texteInput += self.txtVal
-      self.texteInput += self.txtValAct
-      self.texteInput += self.txtNomCstNA
-      self.texteInput += self.txtValNA
-      self.texteInput += self.txtInitName
-      self.texteInput += self.txtInitVal
-      self.texteInput += self.genereEquations()
-      print (self.texteInput)
-      
-   def writeDefault(self, fn):
-      # normalement c_solver_polymer_kinetics_myStudy.input ou myStudy est le nom de l etude 
-      fileInput = fn[:fn.rfind(".")] + '.input'
-      f = open( str(fileInput), 'wb')
-      f.write( self.texteInput )
-      f.close()
-      
-
-   def genereCalculationParams(self) :
-     txtNom  = "calculation_parameter_names = [ "
-     txtVal = "calculation_parameters = [ "
-     for param in ('Time' , 'Temperature', 'DoseRate', 'Thickness')  :
-         if param in self.dictValeur.keys() :
-           txtNom  += "'"+param +  "', "
-           txtVal += str(self.dictValeur[param]) + ", "
-     # on enleve les dernieres , et on ferme
-     txtNom = txtNom[0:-2]
-     txtNom += "]\n"
-     txtVal = txtVal[0:-2]
-     txtVal += "]\n"
-     txt = txtNom + txtVal 
-     return txt
-
-   def genereEquations(self) :
-      txt="equation =["
-      index=0
-      TechnicalUse = self.dictValeur['TechnicalUse']
-      ModelName    = self.dictValeur['ModelName']
-      for param in  self.listInitialParameters:
-          print ('*******************************************')
-          print (' je  traite ', param , 'index : ', index)
-          trouveParam=False
-
-          if index != 0 : txtParam = 'Dy[j*5 + '+str(index)+ '] = '
-          else :          txtParam = 'Dy[j*5] = '
-
-          for equation in  self.listeEquations : 
-            if param in (self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation].keys()):
-               print ('____________ trouve : ', param , 'in ', equation, ' ',  self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation][param])
-               trouveParam = True
-               if self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation][param][0] == '-' :
-                  txtParam += ' ' + self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation][param] 
-               else :
-                  if index != 0 :
-                     txtParam += ' + ' + self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation][param] 
-                  else :  
-                     txtParam +=  self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation][param] 
-               print ('         txtParam   intermediaire ', txtParam)
-
-          if trouveParam :   
-               txtParam = txtParam + ", "
-               txt += txtParam
-               index = index+1
-          print (txtParam)
-          print ('fin param', param, 'trouve ', trouveParam, '___________________________')
-          print ('*************************************************')
-          print (' ')
-      print ('_________________fin for')
-      txt=txt[0:-3]
-      txt+="]\n"
-      return txt
-
-   def genereCsv(self) :
-      txt =  'study_name = ' +self.dictValeur['SimulationName'] +  "\n"
-      txt += 'csv_output_file_name = ' + self.dictValeur['OutPutFolder'] + '/c_solver_stiff_ode_1d_' + self.dictValeur['SimulationName']+ '.csv\n'
-      return txt
-
-
-   def generMCList(self,obj):
-      s=PythonGenerator.generMCList(self,obj)
-      if obj.nom == 'ConstantesArrhenius' :
-         self.txtNomCst  = "Arrhenius_Name = [ "
-         self.txtVal     = "Arrhenius_A = [ "
-         self.txtValAct  = "Arrhenius_Ea = [ "
-         for objFils in obj.data:
-           for mc in objFils.mcListe :  
-              self.txtNomCst +=  "'" + mc.nom + "', "
-              self.txtVal    +=  str(mc.valeur[0]) + ", "
-              self.txtValAct +=  str(mc.valeur[1]) + ", "
-         self.txtNomCst = self.txtNomCst[0:-2]
-         self.txtVal    = self.txtVal[0:-2]
-         self.txtValAct = self.txtValAct [0:-2]
-         self.txtNomCst += ']\n'
-         self.txtVal    += ']\n'
-         self.txtValAct += ']\n'
-
-      if obj.nom == 'ConstantesNonArrhenius' :
-         self.txtNomCstNA  = "non_Arrhenius_coefs_names = [ "
-         self.txtValNA     = "non_Arrhenius_coefs = [ "
-         for objFils in obj.data:
-           for mc in objFils.mcListe :  
-              self.txtNomCstNA +=  "'" + mc.nom + "', "
-              self.txtValNA    +=  str(mc.valeur) + ", "
-         self.txtNomCstNA  = self.txtNomCstNA[0:-2]
-         self.txtValNA     = self.txtValNA[0:-2]
-         self.txtNomCstNA += ']\n'
-         self.txtValNA    += ']\n'
-           
-      if obj.nom == 'InitialParameters' :
-         self.listInitialParameters =[]
-         self.txtInitName  = "initial_Value_names = [ "
-         self.txtInitVal   = "initial_Values = [ "
-         for objFils in obj.data:
-           for mc in objFils.mcListe :  
-              self.txtInitName +=  "'" + mc.nom + "', "
-              self.txtInitVal  +=  str(mc.valeur) + ", "
-              self.listInitialParameters.append(mc.nom)
-         self.txtInitName  = self.txtInitName[0:-2]
-         self.txtInitVal   = self.txtInitVal[0:-2]
-         self.txtInitName += ']\n'
-         self.txtInitVal  += ']\n'
-
-      if obj.nom in( 'initiation','propagation','termination','stabilization') :
-         for o in obj : 
-           for mc  in o.mcListe :
-            nom=mc.nom.replace (' ','').replace ('+','_').replace ('-','_').replace ('>','_').replace('(','').replace(')','').replace('*','').replace('[','').replace(']','')
-            nom=obj.nom+'_'+nom
-            self.listeEquations.append(nom ) 
-      return s
-    
-   def generMCSIMP(self,obj) :
-      """
-      Convertit un objet MCSIMP en texte python
-      Remplit le dictionnaire des MCSIMP 
-      """
-      s=PythonGenerator.generMCSIMP(self,obj)
-      if obj.nom=='Consigne' : return s 
-      
-      if obj.getGenealogie()[0][-6:-1]=="_PARA":
-         self.dictParam[obj.nom]=obj.valeur
-      else :
-         self.dictValeur[obj.nom]=obj.valeur
-      return s
-  
+    """
+       Ce generateur parcourt un objet de type JDC et produit
+       un texte au format eficas et
+       un texte au format py
+
+    """
+
+    def gener(self,obj,format='brut',config=None,appliEficas=None):
+        self.appliEficas=appliEficas
+        self.cata=self.appliEficas.readercata.cata
+        self.initDico()
+        self.text=PythonGenerator.gener(self,obj,format)
+        if obj.isValid() :self.genereTexte(obj)
+        return self.text
+
+    def initDico(self) :
+        self.texteInput = ""
+        self.dictParam={}
+        self.dictValeur={}
+        self.listeEquations=[]
+        self.typeEtude = ""
+
+
+    def genereTexte(self,obj) :
+        print ('genereTexte', self.typeEtude)
+        if self.typeEtude == "Calculation" : self.genereCalculation()
+
+
+    def generPROC_ETAPE(self,obj):
+        s=PythonGenerator.generPROC_ETAPE(self,obj)
+        if obj.nom == "Calculation_for_Mechanistic" : print ('hjkhjkh');self.typeEtude="Calculation"
+        return s
+
+    def genereCalculation(self) :
+        '''
+        Prepare le contenu du fichier de parametres python
+        '''
+        self.texteInput = ""
+        self.texteInput += self.genereCsv()
+        self.texteInput += self.genereCalculationParams()
+        self.texteInput += self.txtNomCst
+        self.texteInput += self.txtVal
+        self.texteInput += self.txtValAct
+        self.texteInput += self.txtNomCstNA
+        self.texteInput += self.txtValNA
+        self.texteInput += self.txtInitName
+        self.texteInput += self.txtInitVal
+        self.texteInput += self.genereEquations()
+        print (self.texteInput)
+
+    def writeDefault(self, fn):
+        # normalement c_solver_polymer_kinetics_myStudy.input ou myStudy est le nom de l etude
+        fileInput = fn[:fn.rfind(".")] + '.input'
+        f = open( str(fileInput), 'wb')
+        f.write( self.texteInput )
+        f.close()
+
+
+    def genereCalculationParams(self) :
+        txtNom  = "calculation_parameter_names = [ "
+        txtVal = "calculation_parameters = [ "
+        for param in ('Time' , 'Temperature', 'DoseRate', 'Thickness')  :
+            if param in self.dictValeur.keys() :
+                txtNom  += "'"+param +  "', "
+                txtVal += str(self.dictValeur[param]) + ", "
+        # on enleve les dernieres , et on ferme
+        txtNom = txtNom[0:-2]
+        txtNom += "]\n"
+        txtVal = txtVal[0:-2]
+        txtVal += "]\n"
+        txt = txtNom + txtVal
+        return txt
+
+    def genereEquations(self) :
+        txt="equation =["
+        index=0
+        TechnicalUse = self.dictValeur['TechnicalUse']
+        ModelName    = self.dictValeur['ModelName']
+        for param in  self.listInitialParameters:
+            print ('*******************************************')
+            print (' je  traite ', param , 'index : ', index)
+            trouveParam=False
+
+            if index != 0 : txtParam = 'Dy[j*5 + '+str(index)+ '] = '
+            else :          txtParam = 'Dy[j*5] = '
+
+            for equation in  self.listeEquations :
+                if param in (self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation].keys()):
+                    print ('____________ trouve : ', param , 'in ', equation, ' ',  self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation][param])
+                    trouveParam = True
+                    if self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation][param][0] == '-' :
+                        txtParam += ' ' + self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation][param]
+                    else :
+                        if index != 0 :
+                            txtParam += ' + ' + self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation][param]
+                        else :
+                            txtParam +=  self.cata.dicoEquations[TechnicalUse][ModelName]['equa_diff'][equation][param]
+                    print ('         txtParam   intermediaire ', txtParam)
+
+            if trouveParam :
+                txtParam = txtParam + ", "
+                txt += txtParam
+                index = index+1
+            print (txtParam)
+            print ('fin param', param, 'trouve ', trouveParam, '___________________________')
+            print ('*************************************************')
+            print (' ')
+        print ('_________________fin for')
+        txt=txt[0:-3]
+        txt+="]\n"
+        return txt
+
+    def genereCsv(self) :
+        txt =  'study_name = ' +self.dictValeur['SimulationName'] +  "\n"
+        txt += 'csv_output_file_name = ' + self.dictValeur['OutPutFolder'] + '/c_solver_stiff_ode_1d_' + self.dictValeur['SimulationName']+ '.csv\n'
+        return txt
+
+
+    def generMCList(self,obj):
+        s=PythonGenerator.generMCList(self,obj)
+        if obj.nom == 'ConstantesArrhenius' :
+            self.txtNomCst  = "Arrhenius_Name = [ "
+            self.txtVal     = "Arrhenius_A = [ "
+            self.txtValAct  = "Arrhenius_Ea = [ "
+            for objFils in obj.data:
+                for mc in objFils.mcListe :
+                    self.txtNomCst +=  "'" + mc.nom + "', "
+                    self.txtVal    +=  str(mc.valeur[0]) + ", "
+                    self.txtValAct +=  str(mc.valeur[1]) + ", "
+            self.txtNomCst = self.txtNomCst[0:-2]
+            self.txtVal    = self.txtVal[0:-2]
+            self.txtValAct = self.txtValAct [0:-2]
+            self.txtNomCst += ']\n'
+            self.txtVal    += ']\n'
+            self.txtValAct += ']\n'
+
+        if obj.nom == 'ConstantesNonArrhenius' :
+            self.txtNomCstNA  = "non_Arrhenius_coefs_names = [ "
+            self.txtValNA     = "non_Arrhenius_coefs = [ "
+            for objFils in obj.data:
+                for mc in objFils.mcListe :
+                    self.txtNomCstNA +=  "'" + mc.nom + "', "
+                    self.txtValNA    +=  str(mc.valeur) + ", "
+            self.txtNomCstNA  = self.txtNomCstNA[0:-2]
+            self.txtValNA     = self.txtValNA[0:-2]
+            self.txtNomCstNA += ']\n'
+            self.txtValNA    += ']\n'
+
+        if obj.nom == 'InitialParameters' :
+            self.listInitialParameters =[]
+            self.txtInitName  = "initial_Value_names = [ "
+            self.txtInitVal   = "initial_Values = [ "
+            for objFils in obj.data:
+                for mc in objFils.mcListe :
+                    self.txtInitName +=  "'" + mc.nom + "', "
+                    self.txtInitVal  +=  str(mc.valeur) + ", "
+                    self.listInitialParameters.append(mc.nom)
+            self.txtInitName  = self.txtInitName[0:-2]
+            self.txtInitVal   = self.txtInitVal[0:-2]
+            self.txtInitName += ']\n'
+            self.txtInitVal  += ']\n'
+
+        if obj.nom in( 'initiation','propagation','termination','stabilization') :
+            for o in obj :
+                for mc  in o.mcListe :
+                    nom=mc.nom.replace (' ','').replace ('+','_').replace ('-','_').replace ('>','_').replace('(','').replace(')','').replace('*','').replace('[','').replace(']','')
+                    nom=obj.nom+'_'+nom
+                    self.listeEquations.append(nom )
+        return s
+
+    def generMCSIMP(self,obj) :
+        """
+        Convertit un objet MCSIMP en texte python
+        Remplit le dictionnaire des MCSIMP
+        """
+        s=PythonGenerator.generMCSIMP(self,obj)
+        if obj.nom=='Consigne' : return s
+
+        if obj.getGenealogie()[0][-6:-1]=="_PARA":
+            self.dictParam[obj.nom]=obj.valeur
+        else :
+            self.dictValeur[obj.nom]=obj.valeur
+        return s
index dbdf22e765acd6e654d808e7c99b666d36a86d62..bcb3d3409d0989b13fba0ddd26d524e6adbce27e 100644 (file)
@@ -23,8 +23,8 @@
 # Modules Python
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import object
+    from builtins import str
+    from builtins import object
 except : pass
 
 import os, sys,  types, re
@@ -32,16 +32,16 @@ from Extensions.i18n import tr
 
 class ModificationGenerator(object):
     def generTexteModif(self,obj):
-      texteModification=""
-      for t in  list(obj.editor.dicoNouveauxMC.keys()) :
-          # 'ajoutDefinitionMC',etape,listeAvant,nomDuMC,typ,args
-          fonction,Etape,Genea,nomSIMP,typeSIMP,arguments = obj.editor.dicoNouveauxMC[t]
-          texteModification += "MODIFICATION_CATALOGUE(Fonction  = '" + str(fonction)+ "',\n"
-          texteModification += "                       Etape     = '" + str(Etape)   + "',\n"
-          texteModification += "                       Genea     = "  + str(Genea)   + ",\n" 
-          texteModification += "                       NomSIMP   = '" + str(nomSIMP) + "',\n"
-          texteModification += "                       TypeSIMP  = '" + str(typeSIMP)+ "',\n"
-          texteModification += "                       PhraseArguments = " +'"' + str(arguments)+ '"'+ ",);\n"
-          
+        texteModification=""
+        for t in  list(obj.editor.dicoNouveauxMC.keys()) :
+            # 'ajoutDefinitionMC',etape,listeAvant,nomDuMC,typ,args
+            fonction,Etape,Genea,nomSIMP,typeSIMP,arguments = obj.editor.dicoNouveauxMC[t]
+            texteModification += "MODIFICATION_CATALOGUE(Fonction  = '" + str(fonction)+ "',\n"
+            texteModification += "                       Etape     = '" + str(Etape)   + "',\n"
+            texteModification += "                       Genea     = "  + str(Genea)   + ",\n"
+            texteModification += "                       NomSIMP   = '" + str(nomSIMP) + "',\n"
+            texteModification += "                       TypeSIMP  = '" + str(typeSIMP)+ "',\n"
+            texteModification += "                       PhraseArguments = " +'"' + str(arguments)+ '"'+ ",);\n"
 
-      return texteModification
+
+        return texteModification
index a07f128f325ecff74b95458c540120139c23c4ab..de0032511cc0565de93d16da40baafe851c5c304 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-    Ce module contient le plugin generateur de fichier au format 
+    Ce module contient le plugin generateur de fichier au format
     python pour EFICAS.
 
 """
 from __future__ import absolute_import
 try :
-   from builtins import str
-   from builtins import object
-   from builtins import range
+    from builtins import str
+    from builtins import object
+    from builtins import range
 except : pass
 
 import traceback
@@ -37,7 +37,7 @@ from Noyau.N_utils import repr_float
 import Accas
 import Extensions
 from Extensions.parametre import ITEM_PARAMETRE
-from .Formatage import Formatage 
+from .Formatage import Formatage
 from .Formatage import FormatageLigne
 from Extensions.param2 import Formula
 from Extensions.eficas_exception import EficasException
@@ -45,306 +45,306 @@ from Extensions.i18n import tr
 
 
 def entryPoint():
-   """
-       Retourne les informations necessaires pour le chargeur de plugins
+    """
+        Retourne les informations necessaires pour le chargeur de plugins
 
-       Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'python',
-        # La factory pour creer une instance du plugin
-          'factory' : PythonGenerator,
-          }
+        Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'python',
+         # La factory pour creer une instance du plugin
+           'factory' : PythonGenerator,
+           }
 
 
 class PythonGenerator(object):
-   """
-       Ce generateur parcourt un objet de type JDC et produit
-       un fichier au format python 
-
-       L'acquisition et le parcours sont realises par la methode
-       generator.gener(objet_jdc,format)
-
-       L'ecriture du fichier au format ini par appel de la methode
-       generator.writefile(nom_fichier)
-
-       Ses caracteristiques principales sont exposees dans des attributs 
-       de classe :
-         - extensions : qui donne une liste d'extensions de fichier preconisees
-
-   """
-   # Les extensions de fichier preconisees
-   extensions=('.comm',)
-
-   def __init__(self,cr=None):
-      # Si l'objet compte-rendu n'est pas fourni, on utilise le compte-rendu standard
-      if cr :
-         self.cr=cr
-      else:
-         self.cr=N_CR.CR(debut='CR generateur format python pour python',
-                         fin='fin CR format python pour python')
-      # Le texte au format python est stocke dans l'attribut text
-      self.text=''
-      self.appliEficas=None
-
-   def writefile(self,filename):
-      fp=open(filename,'w')
-      fp.write(self.text)
-      fp.close()
-
-   def gener(self,obj,format='brut',config=None,appliEficas=None):
-      """
-          Retourne une representation du JDC obj sous une
-          forme qui est parametree par format.
-          Si format vaut 'brut', retourne une liste de listes de ...
-          Si format vaut 'standard', retourne un texte obtenu par concatenation de la liste
-          Si format vaut 'beautifie', retourne le meme texte beautifie
-      """
-      import logging
-      if obj == None : 
-         print ('appel a gener avec None')
-         return
-      self.appliEficas=appliEficas
-      liste= self.generator(obj)
-      #format='standard'
-      if format == 'brut':
-         self.text=liste
-      elif format == 'standard':
-         self.text=''.join(liste)
-      elif format == 'beautifie':
-         jdc_formate = Formatage(liste,mode='.py')
-         #import cProfile, pstats, StringIO
-         #pr = cProfile.Profile()
-         #pr.enable()
-         self.text=jdc_formate.formateJdc()
-         #pr.disable()
-         #s = StringIO.StringIO()
-         #sortby = 'cumulative'
-         #ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
-         #ps.print_stats()
-         #print (s.getValue())
-
-      elif format == 'Ligne':
-         jdc_formate = FormatageLigne(liste,mode='.py')
-         self.text=jdc_formate.formateJdc()
-      else:
-         raise EficasException(tr("Format non implemente ") +format)
-      return self.text
-
-   def generator(self,obj):
-      """
-         Cette methode joue un role d'aiguillage en fonction du type de obj
-         On pourrait utiliser les methodes accept et visitxxx a la 
-         place (depend des gouts !!!)
-      """
-      # ATTENTION a l'ordre des tests : il peut avoir de l'importance (heritage)
-      if isinstance(obj,Accas.PROC_ETAPE):
-         return self.generPROC_ETAPE(obj)
-      # Attention doit etre place avant MACRO (raison : heritage)
-      elif isinstance(obj,Accas.FORM_ETAPE):
-         return self.generFORM_ETAPE(obj)
-      elif isinstance(obj,Accas.MACRO_ETAPE):
-         return self.generMACRO_ETAPE(obj)
-      elif isinstance(obj,Accas.ETAPE):
-         return self.generETAPE(obj)
-      elif isinstance(obj,Accas.MCFACT):
-         return self.generMCFACT(obj)
-      elif isinstance(obj,Accas.MCList):
-         return self.generMCList(obj)
-      elif isinstance(obj,Accas.MCBLOC):
-         return self.generMCBLOC(obj)
-      elif isinstance(obj,Accas.MCSIMP):
-         return self.generMCSIMP(obj)
-      elif isinstance(obj,Accas.ASSD):
-         return self.generASSD(obj)
-      elif isinstance(obj,Accas.ETAPE_NIVEAU):
-         return self.generETAPE_NIVEAU(obj)
-      elif isinstance(obj,Accas.COMMENTAIRE):
-         return self.generCOMMENTAIRE(obj)
-      # Attention doit etre place avant PARAMETRE (raison : heritage)
-      elif isinstance(obj,Accas.PARAMETRE_EVAL):
-         return self.generPARAMETRE_EVAL(obj)
-      elif isinstance(obj,Accas.PARAMETRE):
-         return self.generPARAMETRE(obj)
-      elif isinstance(obj,Accas.EVAL):
-         return self.generEVAL(obj)
-      elif isinstance(obj,Accas.COMMANDE_COMM):
-         return self.generCOMMANDE_COMM(obj)
-      elif isinstance(obj,Accas.JDC):
-         return self.generJDC(obj)
-      elif isinstance(obj,Accas.MCNUPLET):
-         return self.generMCNUPLET(obj)
-      elif isinstance(obj,ITEM_PARAMETRE):
-         return self.generITEM_PARAMETRE(obj)
-      elif isinstance(obj,Formula):
-         return self.generFormula(obj)
-      else:
-         raise EficasException(tr("Type d'objet non prevu") +obj)
-
-   def generJDC(self,obj):
-      """
-         Cette methode convertit un objet JDC en une liste de chaines de
-         caracteres a la syntaxe python
-      """
-      l=[]
-
-      #print ('generJDC', obj.sdsDict)
-      for objRef in obj.sdsDict :
-          if (isinstance(obj.sdsDict[objRef],Accas.UserASSD)):
-              l.append(self.generUserASSD(obj.sdsDict[objRef]))
-      if obj.definition.l_niveaux == ():
-         # Il n'y a pas de niveaux
-         for etape in obj.etapes:
-            l.append(self.generator(etape))
-      else:
-         # Il y a des niveaux
-         for etape_niveau in obj.etapes_niveaux:
-            l.extend(self.generator(etape_niveau))
-      if l != [] :
-         # Si au moins une etape, on ajoute le retour chariot sur la derniere etape
-         if type(l[-1])==list:
-            l[-1][-1] = l[-1][-1]+'\n'
-         elif type(l[-1])==bytes or  type(l[-1])==str:
-            l[-1] = l[-1]+'\n'
-      return l
-
-   def generUserASSD(self,obj):
-       classeName =  obj.__class__.__name__
-       if obj.valeur == None :
-          texte = obj.nom + '=' + classeName + '()'
-          return texte
-
-   def generMCNUPLET(self,obj):
-      """ 
-          Methode generant une representation de self permettant son ecriture
-          dans le format python
-      """
-      l=[]
-      l.append('(')
-      for v in obj.mcListe:
-        text = re.sub(".*=","",self.generator(v))
-        l.append(text)
-      l.append('),')
-      return l
-
-   def generCOMMANDE_COMM(self,obj):
-      """
-         Cette methode convertit un COMMANDE_COMM
-         en une liste de chaines de caracteres a la syntaxe python
-      """
-      l_lignes = obj.valeur.split('\n')
-      txt=''
-      for ligne in l_lignes:
-          txt = txt + '##'+ligne+'\n'
-      return txt
-
-   def generEVAL(self,obj):
-      """
-         Cette methode convertit un EVAL
-         en une liste de chaines de caracteres a la syntaxe python
-      """
-      return 'EVAL("""'+ obj.valeur +'""")'
-
-   def generCOMMENTAIRE(self,obj):
-      """
-         Cette methode convertit un COMMENTAIRE
-         en une liste de chaines de caracteres a la syntaxe python
-      """
-      # modification pour repondre a la demande de C. Durand, d'eviter
-      # l'ajout systematique d'un diese, a la suite du commentaire
-      # Dans la chaine de caracteres obj.valeur, on supprime le dernier
-      # saut de ligne
-      sans_saut = re.sub("\n$","",obj.valeur)
-      l_lignes = sans_saut.split('\n')
-      txt=''
-      i=1
-      for ligne in l_lignes:
-        txt = txt + '#'+ligne+'\n'
-
-      # suppression du dernier saut de ligne
-      #txt = re.sub("\n$","",txt)
-      # on ajoute un saut de ligne avant
-      pattern=re.compile(" ?\#")
-      m=pattern.match(txt)
-      if m:
-         txt="\n"+txt
-      return txt
-
-   def generPARAMETRE_EVAL(self,obj):
-      """
-         Cette methode convertit un PARAMETRE_EVAL
-         en une liste de chaines de caracteres a la syntaxe python
-      """
-      if obj.valeur == None:
-         return obj.nom + ' = None ;\n'
-      else:
-         return obj.nom + ' = '+ self.generator(obj.valeur) +';\n'
-
-   def generITEM_PARAMETRE(self,obj):
-       return repr(obj) 
-
-   def generFormula(self,obj):
-       #return repr(obj) 
-       return str(obj) 
-
-   def generPARAMETRE(self,obj):
-      """
-         Cette methode convertit un PARAMETRE
-         en une liste de chaines de caracteres a la syntaxe python
-      """
-      return repr(obj) + ";\n"
-
-   def generETAPE_NIVEAU(self,obj):
-      """
-         Cette methode convertit une etape niveau
-         en une liste de chaines de caracteres a la syntaxe python
-      """
-      l=[]
-      if obj.etapes_niveaux == []:
-        for etape in obj.etapes:
-          l.append(self.generator(etape))
-      else:
-        for etape_niveau in obj.etapes_niveaux:
-          l.extend(self.generator(etape_niveau))
-      return l
-
-   def generETAPE(self,obj):
-      """
-         Cette methode convertit une etape
-         en une liste de chaines de caracteres a la syntaxe python
-      """
-      try:
-        sdname= self.generator(obj.sd)
-        if  sdname.find('SD_') != -1: sdname='sansnom'
-      except:
-        sdname='sansnom'
-      l=[]
-      label=sdname + '='+obj.definition.nom+'('
-      l.append(label)
-      if obj.reuse != None :
-        str = 'reuse ='+ self.generator(obj.reuse) + ','
-        l.append(str)
-      for v in obj.mcListe:
-        if isinstance(v,Accas.MCBLOC) :
-          liste=self.generator(v)
-          for mocle in liste :
-            l.append(mocle)
-        elif isinstance(v,Accas.MCSIMP) :
-          text=self.generator(v)
-          l.append(v.nom+'='+text)
+    """
+        Ce generateur parcourt un objet de type JDC et produit
+        un fichier au format python
+
+        L'acquisition et le parcours sont realises par la methode
+        generator.gener(objet_jdc,format)
+
+        L'ecriture du fichier au format ini par appel de la methode
+        generator.writeFile(nom_fichier)
+
+        Ses caracteristiques principales sont exposees dans des attributs
+        de classe :
+          - extensions : qui donne une liste d'extensions de fichier preconisees
+
+    """
+    # Les extensions de fichier preconisees
+    extensions=('.comm',)
+
+    def __init__(self,cr=None):
+        # Si l'objet compte-rendu n'est pas fourni, on utilise le compte-rendu standard
+        if cr :
+            self.cr=cr
         else:
-          # MCFACT ou MCList
-          liste=self.generator(v)
-          liste[0]=v.nom+'='+liste[0]
-          l.append(liste)
-      if len(l) == 1:
-        l[0]=label+');'
-      else :
-        l.append(');')
-      return l
+            self.cr=N_CR.CR(debut='CR generateur format python pour python',
+                            fin='fin CR format python pour python')
+        # Le texte au format python est stocke dans l'attribut text
+        self.text=''
+        self.appliEficas=None
+
+    def writeFile(self,filename):
+        fp=open(filename,'w')
+        fp.write(self.text)
+        fp.close()
+
+    def gener(self,obj,format='brut',config=None,appliEficas=None):
+        """
+            Retourne une representation du JDC obj sous une
+            forme qui est parametree par format.
+            Si format vaut 'brut', retourne une liste de listes de ...
+            Si format vaut 'standard', retourne un texte obtenu par concatenation de la liste
+            Si format vaut 'beautifie', retourne le meme texte beautifie
+        """
+        import logging
+        if obj == None :
+            print ('appel a gener avec None')
+            return
+        self.appliEficas=appliEficas
+        liste= self.generator(obj)
+        #format='standard'
+        if format == 'brut':
+            self.text=liste
+        elif format == 'standard':
+            self.text=''.join(liste)
+        elif format == 'beautifie':
+            jdc_formate = Formatage(liste,mode='.py')
+            #import cProfile, pstats, StringIO
+            #pr = cProfile.Profile()
+            #pr.enable()
+            self.text=jdc_formate.formateJdc()
+            #pr.disable()
+            #s = StringIO.StringIO()
+            #sortby = 'cumulative'
+            #ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
+            #ps.print_stats()
+            #print (s.getValue())
+
+        elif format == 'Ligne':
+            jdc_formate = FormatageLigne(liste,mode='.py')
+            self.text=jdc_formate.formateJdc()
+        else:
+            raise EficasException(tr("Format non implemente ") +format)
+        return self.text
+
+    def generator(self,obj):
+        """
+           Cette methode joue un role d'aiguillage en fonction du type de obj
+           On pourrait utiliser les methodes accept et visitxxx a la
+           place (depend des gouts !!!)
+        """
+        # ATTENTION a l'ordre des tests : il peut avoir de l'importance (heritage)
+        if isinstance(obj,Accas.PROC_ETAPE):
+            return self.generPROC_ETAPE(obj)
+        # Attention doit etre place avant MACRO (raison : heritage)
+        elif isinstance(obj,Accas.FORM_ETAPE):
+            return self.generFORM_ETAPE(obj)
+        elif isinstance(obj,Accas.MACRO_ETAPE):
+            return self.generMACRO_ETAPE(obj)
+        elif isinstance(obj,Accas.ETAPE):
+            return self.generETAPE(obj)
+        elif isinstance(obj,Accas.MCFACT):
+            return self.generMCFACT(obj)
+        elif isinstance(obj,Accas.MCList):
+            return self.generMCList(obj)
+        elif isinstance(obj,Accas.MCBLOC):
+            return self.generMCBLOC(obj)
+        elif isinstance(obj,Accas.MCSIMP):
+            return self.generMCSIMP(obj)
+        elif isinstance(obj,Accas.ASSD):
+            return self.generASSD(obj)
+        elif isinstance(obj,Accas.ETAPE_NIVEAU):
+            return self.generETAPE_NIVEAU(obj)
+        elif isinstance(obj,Accas.COMMENTAIRE):
+            return self.generCOMMENTAIRE(obj)
+        # Attention doit etre place avant PARAMETRE (raison : heritage)
+        elif isinstance(obj,Accas.PARAMETRE_EVAL):
+            return self.generPARAMETRE_EVAL(obj)
+        elif isinstance(obj,Accas.PARAMETRE):
+            return self.generPARAMETRE(obj)
+        elif isinstance(obj,Accas.EVAL):
+            return self.generEVAL(obj)
+        elif isinstance(obj,Accas.COMMANDE_COMM):
+            return self.generCOMMANDE_COMM(obj)
+        elif isinstance(obj,Accas.JDC):
+            return self.generJDC(obj)
+        elif isinstance(obj,Accas.MCNUPLET):
+            return self.generMCNUPLET(obj)
+        elif isinstance(obj,ITEM_PARAMETRE):
+            return self.generITEM_PARAMETRE(obj)
+        elif isinstance(obj,Formula):
+            return self.generFormula(obj)
+        else:
+            raise EficasException(tr("Type d'objet non prevu") +obj)
+
+    def generJDC(self,obj):
+        """
+           Cette methode convertit un objet JDC en une liste de chaines de
+           caracteres a la syntaxe python
+        """
+        l=[]
+
+        #print ('generJDC', obj.sdsDict)
+        for objRef in obj.sdsDict :
+            if (isinstance(obj.sdsDict[objRef],Accas.UserASSD)):
+                l.append(self.generUserASSD(obj.sdsDict[objRef]))
+        if obj.definition.l_niveaux == ():
+            # Il n'y a pas de niveaux
+            for etape in obj.etapes:
+                l.append(self.generator(etape))
+        else:
+            # Il y a des niveaux
+            for etape_niveau in obj.etapes_niveaux:
+                l.extend(self.generator(etape_niveau))
+        if l != [] :
+            # Si au moins une etape, on ajoute le retour chariot sur la derniere etape
+            if type(l[-1])==list:
+                l[-1][-1] = l[-1][-1]+'\n'
+            elif type(l[-1])==bytes or  type(l[-1])==str:
+                l[-1] = l[-1]+'\n'
+        return l
+
+    def generUserASSD(self,obj):
+        classeName =  obj.__class__.__name__
+        if obj.valeur == None :
+            texte = obj.nom + '=' + classeName + '()'
+            return texte
+
+    def generMCNUPLET(self,obj):
+        """
+            Methode generant une representation de self permettant son ecriture
+            dans le format python
+        """
+        l=[]
+        l.append('(')
+        for v in obj.mcListe:
+            text = re.sub(".*=","",self.generator(v))
+            l.append(text)
+        l.append('),')
+        return l
+
+    def generCOMMANDE_COMM(self,obj):
+        """
+           Cette methode convertit un COMMANDE_COMM
+           en une liste de chaines de caracteres a la syntaxe python
+        """
+        l_lignes = obj.valeur.split('\n')
+        txt=''
+        for ligne in l_lignes:
+            txt = txt + '##'+ligne+'\n'
+        return txt
+
+    def generEVAL(self,obj):
+        """
+           Cette methode convertit un EVAL
+           en une liste de chaines de caracteres a la syntaxe python
+        """
+        return 'EVAL("""'+ obj.valeur +'""")'
+
+    def generCOMMENTAIRE(self,obj):
+        """
+           Cette methode convertit un COMMENTAIRE
+           en une liste de chaines de caracteres a la syntaxe python
+        """
+        # modification pour repondre a la demande de C. Durand, d'eviter
+        # l'ajout systematique d'un diese, a la suite du commentaire
+        # Dans la chaine de caracteres obj.valeur, on supprime le dernier
+        # saut de ligne
+        sans_saut = re.sub("\n$","",obj.valeur)
+        l_lignes = sans_saut.split('\n')
+        txt=''
+        i=1
+        for ligne in l_lignes:
+            txt = txt + '#'+ligne+'\n'
+
+        # suppression du dernier saut de ligne
+        #txt = re.sub("\n$","",txt)
+        # on ajoute un saut de ligne avant
+        pattern=re.compile(" ?\#")
+        m=pattern.match(txt)
+        if m:
+            txt="\n"+txt
+        return txt
+
+    def generPARAMETRE_EVAL(self,obj):
+        """
+           Cette methode convertit un PARAMETRE_EVAL
+           en une liste de chaines de caracteres a la syntaxe python
+        """
+        if obj.valeur == None:
+            return obj.nom + ' = None ;\n'
+        else:
+            return obj.nom + ' = '+ self.generator(obj.valeur) +';\n'
+
+    def generITEM_PARAMETRE(self,obj):
+        return repr(obj)
+
+    def generFormula(self,obj):
+        #return repr(obj)
+        return str(obj)
+
+    def generPARAMETRE(self,obj):
+        """
+           Cette methode convertit un PARAMETRE
+           en une liste de chaines de caracteres a la syntaxe python
+        """
+        return repr(obj) + ";\n"
+
+    def generETAPE_NIVEAU(self,obj):
+        """
+           Cette methode convertit une etape niveau
+           en une liste de chaines de caracteres a la syntaxe python
+        """
+        l=[]
+        if obj.etapes_niveaux == []:
+            for etape in obj.etapes:
+                l.append(self.generator(etape))
+        else:
+            for etape_niveau in obj.etapes_niveaux:
+                l.extend(self.generator(etape_niveau))
+        return l
+
+    def generETAPE(self,obj):
+        """
+           Cette methode convertit une etape
+           en une liste de chaines de caracteres a la syntaxe python
+        """
+        try:
+            sdname= self.generator(obj.sd)
+            if  sdname.find('SD_') != -1: sdname='sansnom'
+        except:
+            sdname='sansnom'
+        l=[]
+        label=sdname + '='+obj.definition.nom+'('
+        l.append(label)
+        if obj.reuse != None :
+            str = 'reuse ='+ self.generator(obj.reuse) + ','
+            l.append(str)
+        for v in obj.mcListe:
+            if isinstance(v,Accas.MCBLOC) :
+                liste=self.generator(v)
+                for mocle in liste :
+                    l.append(mocle)
+            elif isinstance(v,Accas.MCSIMP) :
+                text=self.generator(v)
+                l.append(v.nom+'='+text)
+            else:
+                # MCFACT ou MCList
+                liste=self.generator(v)
+                liste[0]=v.nom+'='+liste[0]
+                l.append(liste)
+        if len(l) == 1:
+            l[0]=label+');'
+        else :
+            l.append(');')
+        return l
 
-   def generFORM_ETAPE(self,obj):
+    def generFORM_ETAPE(self,obj):
         """
             Methode particuliere pour les objets de type FORMULE
         """
@@ -358,270 +358,270 @@ class PythonGenerator(object):
         l.append(');')
         return l
 
-   def generMACRO_ETAPE(self,obj):
-      """
-         Cette methode convertit une macro-etape
-         en une liste de chaines de caracteres a la syntaxe python
-      """
-      try:
-        if obj.sd == None:
-          sdname=''
-        else:
-          sdname= self.generator(obj.sd)+'='
-        if  sdname.find('SD_') != -1: sdname=''
-      except:
-        sdname='sansnom='
-      l=[]
-      label = sdname + obj.definition.nom+'('
-      l.append(label)
-      if obj.reuse != None:
-         # XXX faut il la virgule ou pas ????
-         str = "reuse =" + self.generator(obj.reuse) + ','
-         l.append(str)
-      for v in obj.mcListe:
-        if isinstance(v,Accas.MCBLOC) :
-          liste=self.generator(v)
-          for mocle in liste :
-            l.append(mocle)
-        elif isinstance(v,Accas.MCSIMP) :
-          text=self.generator(v)
-          l.append(v.nom+'='+text)
-        else:
-          # MCFACT ou MCList
-          liste=self.generator(v)
-          liste[0]=v.nom+'='+liste[0]
-          l.append(liste)
-
-      if len(l) == 1:
-        l[0]=label+');'
-      else :
-        l.append(');')
-      return l
-
-   def generPROC_ETAPE(self,obj):
-      """
-         Cette methode convertit une PROC etape
-         en une liste de chaines de caracteres a la syntaxe python
-      """
-      l=[]
-      label=obj.definition.nom+'('
-      l.append(label)
-      for v in obj.mcListe:
-        if isinstance(v,Accas.MCBLOC) :
-          liste=self.generator(v)
-          for mocle in liste :
-            l.append(mocle)
-        elif isinstance(v,Accas.MCSIMP) :
-          text=self.generator(v)
-          if text==None : text= ""
-          l.append(v.nom+'='+text)
-        else:
-          # MCFACT ou MCList
-          liste=self.generator(v)
-          liste[0]=v.nom+'='+liste[0]
-          l.append(liste)
-
-      if len(l) == 1:
-        l[0]=label+');'
-      else :
-        l.append(');')
-      return l
-
-   def generASSD(self,obj):
-      """
-          Convertit un objet derive d'ASSD en une chaine de caracteres a la
-          syntaxe python
-      """
-      return obj.getName()
-
-
-   def generMCFACT(self,obj):
-      """
-          Convertit un objet MCFACT en une liste de chaines de caracteres a la
-          syntaxe python
-      """
-      l=[]
-      l.append('_F(')
-      for v in obj.mcListe:
-         if not isinstance(v,Accas.MCSIMP) and not isinstance (v,Accas.MCBLOC) :
-           # on est en presence d'une entite composee : on recupere une liste
-           liste=self.generator(v)
-           liste[0]=v.nom+'='+liste[0]
-           l.append(liste)
-         elif isinstance(v,Accas.MCBLOC):
-           liste=self.generator(v)
-           for arg in liste :
-             l.append(arg)
-         else:
-           # on est en presence d'un MCSIMP : on recupere une string
-           text =self.generator(v)
-           if text== None : text =""
-           if v.nom != "Consigne" :  l.append(v.nom+'='+text)
-      # il faut etre plus subtil dans l'ajout de la virgule en differenciant 
-      # le cas ou elle est obligatoire (si self a des freres cadets 
-      # dans self.parent) ou non
-      # (cas ou self est seul ou le benjamin de self.parent)
-      l.append('),')
-      return l
-
-   def generMCList(self,obj):
-      """
-          Convertit un objet MCList en une liste de chaines de caracteres a la
-          syntaxe python
-      """
-      if len(obj.data) > 1:
-         l=['(']
-         for mcfact in obj.data: l.append(self.generator(mcfact))
-         l.append('),')
-      else:
-         l= self.generator(obj.data[0])
-      return l
-
-   def generMCBLOC(self,obj):
-      """
-          Convertit un objet MCBLOC en une liste de chaines de caracteres a la
-          syntaxe python
-      """
-      l=[]
-      for v in obj.mcListe:
-        if isinstance(v,Accas.MCBLOC) :
-          liste=self.generator(v)
-          for mocle in liste :
-            l.append(mocle)
-        elif isinstance(v,Accas.MCFACT):
-          liste=self.generator(v)
-        elif isinstance(v,Accas.MCList):
-          liste=self.generator(v)
-          liste[0]=v.nom+'='+liste[0]
-          # PN  essai de correction bug identation
-          if (hasattr(v,'data')) :
-            if (isinstance(v.data[0],Accas.MCFACT) and (len(v.data) == 1)):
-               l.append(liste)
+    def generMACRO_ETAPE(self,obj):
+        """
+           Cette methode convertit une macro-etape
+           en une liste de chaines de caracteres a la syntaxe python
+        """
+        try:
+            if obj.sd == None:
+                sdname=''
+            else:
+                sdname= self.generator(obj.sd)+'='
+            if  sdname.find('SD_') != -1: sdname=''
+        except:
+            sdname='sansnom='
+        l=[]
+        label = sdname + obj.definition.nom+'('
+        l.append(label)
+        if obj.reuse != None:
+            # XXX faut il la virgule ou pas ????
+            str = "reuse =" + self.generator(obj.reuse) + ','
+            l.append(str)
+        for v in obj.mcListe:
+            if isinstance(v,Accas.MCBLOC) :
+                liste=self.generator(v)
+                for mocle in liste :
+                    l.append(mocle)
+            elif isinstance(v,Accas.MCSIMP) :
+                text=self.generator(v)
+                l.append(v.nom+'='+text)
             else:
-               for mocle in liste :
-                 l.append(mocle)
-          else :
-             for mocle in liste :
-               l.append(mocle)
+                # MCFACT ou MCList
+                liste=self.generator(v)
+                liste[0]=v.nom+'='+liste[0]
+                l.append(liste)
+
+        if len(l) == 1:
+            l[0]=label+');'
+        else :
+            l.append(');')
+        return l
+
+    def generPROC_ETAPE(self,obj):
+        """
+           Cette methode convertit une PROC etape
+           en une liste de chaines de caracteres a la syntaxe python
+        """
+        l=[]
+        label=obj.definition.nom+'('
+        l.append(label)
+        for v in obj.mcListe:
+            if isinstance(v,Accas.MCBLOC) :
+                liste=self.generator(v)
+                for mocle in liste :
+                    l.append(mocle)
+            elif isinstance(v,Accas.MCSIMP) :
+                text=self.generator(v)
+                if text==None : text= ""
+                l.append(v.nom+'='+text)
+            else:
+                # MCFACT ou MCList
+                liste=self.generator(v)
+                liste[0]=v.nom+'='+liste[0]
+                l.append(liste)
+
+        if len(l) == 1:
+            l[0]=label+');'
+        else :
+            l.append(');')
+        return l
+
+    def generASSD(self,obj):
+        """
+            Convertit un objet derive d'ASSD en une chaine de caracteres a la
+            syntaxe python
+        """
+        return obj.getName()
+
+
+    def generMCFACT(self,obj):
+        """
+            Convertit un objet MCFACT en une liste de chaines de caracteres a la
+            syntaxe python
+        """
+        l=[]
+        l.append('_F(')
+        for v in obj.mcListe:
+            if not isinstance(v,Accas.MCSIMP) and not isinstance (v,Accas.MCBLOC) :
+                # on est en presence d'une entite composee : on recupere une liste
+                liste=self.generator(v)
+                liste[0]=v.nom+'='+liste[0]
+                l.append(liste)
+            elif isinstance(v,Accas.MCBLOC):
+                liste=self.generator(v)
+                for arg in liste :
+                    l.append(arg)
+            else:
+                # on est en presence d'un MCSIMP : on recupere une string
+                text =self.generator(v)
+                if text== None : text =""
+                if v.nom != "Consigne" :  l.append(v.nom+'='+text)
+        # il faut etre plus subtil dans l'ajout de la virgule en differenciant
+        # le cas ou elle est obligatoire (si self a des freres cadets
+        # dans self.parent) ou non
+        # (cas ou self est seul ou le benjamin de self.parent)
+        l.append('),')
+        return l
+
+    def generMCList(self,obj):
+        """
+            Convertit un objet MCList en une liste de chaines de caracteres a la
+            syntaxe python
+        """
+        if len(obj.data) > 1:
+            l=['(']
+            for mcfact in obj.data: l.append(self.generator(mcfact))
+            l.append('),')
         else:
-          data=self.generator(v)
-          if data==None : data= ""
-          if type(data) == list:
-            data[0]=v.nom+'='+data[0]
-          else:
-            data=v.nom+'='+data
-          l.append(data)
-      return l
-
-
-   def formatItem(self,valeur,etape,obj,vientDeListe=0):
-      if (type(valeur) == float or 'R' in obj.definition.type) and not(isinstance(valeur,Accas.PARAMETRE)) :
-         # Pour un flottant on utilise str ou repr si on vient d une liste
-         # ou la notation scientifique
-         # On ajoute un . si il n y en a pas dans la valeur
-         s = str(valeur)
-         if vientDeListe and repr(valeur) != str(valeur) : s=repr(valeur)
-         if (s.find('.')== -1 and s.find('e')== -1 and s.find('E')==-1) : s=s+'.0'
-         clefobj=etape.getSdname()
-         if self.appliEficas and clefobj in self.appliEficas.dict_reels:
-           if valeur in self.appliEficas.dict_reels[clefobj]:
-             s=self.appliEficas.dict_reels[clefobj][valeur]
-         
-      elif type(valeur) == bytes or type(valeur) == str :
-         if valeur.find('\n') == -1:
-            # pas de retour chariot, on utilise repr
-            s = repr(valeur)
-         elif valeur.find('"""') == -1:
-            # retour chariot mais pas de triple ", on formatte
-            s='"""'+valeur+'"""'
-         else:
-            s = repr(valeur)
-      elif isinstance(valeur,Accas.CO) or hasattr(etape,'sdprods') and valeur in etape.sdprods:
-         s = "CO('"+ self.generator(valeur) +"')"
-      elif isinstance(valeur,Accas.UserASSD):
-      # ici on ne prend que la reference
-         s = valeur.nom
-      elif isinstance(valeur,Accas.ASSD):
-         s = self.generator(valeur)
-      elif isinstance(valeur,Accas.PARAMETRE):
-         # il ne faut pas prendre la string que retourne gener
-         # mais seulement le nom dans le cas d'un parametre
-         s = valeur.nom
-
-      #elif type(valeur) == types.InstanceType or isinstance(valeur,object):
-      #   if valeur.__class__.__name__ == 'CO' or hasattr(etape,'sdprods') and valeur in etape.sdprods :
-      #      s = "CO('"+ self.generator(valeur) +"')"
-      #   elif isinstance(valeur,Accas.PARAMETRE):
+            l= self.generator(obj.data[0])
+        return l
+
+    def generMCBLOC(self,obj):
+        """
+            Convertit un objet MCBLOC en une liste de chaines de caracteres a la
+            syntaxe python
+        """
+        l=[]
+        for v in obj.mcListe:
+            if isinstance(v,Accas.MCBLOC) :
+                liste=self.generator(v)
+                for mocle in liste :
+                    l.append(mocle)
+            elif isinstance(v,Accas.MCFACT):
+                liste=self.generator(v)
+            elif isinstance(v,Accas.MCList):
+                liste=self.generator(v)
+                liste[0]=v.nom+'='+liste[0]
+                # PN  essai de correction bug identation
+                if (hasattr(v,'data')) :
+                    if (isinstance(v.data[0],Accas.MCFACT) and (len(v.data) == 1)):
+                        l.append(liste)
+                    else:
+                        for mocle in liste :
+                            l.append(mocle)
+                else :
+                    for mocle in liste :
+                        l.append(mocle)
+            else:
+                data=self.generator(v)
+                if data==None : data= ""
+                if type(data) == list:
+                    data[0]=v.nom+'='+data[0]
+                else:
+                    data=v.nom+'='+data
+                l.append(data)
+        return l
+
+
+    def formatItem(self,valeur,etape,obj,vientDeListe=0):
+        if (type(valeur) == float or 'R' in obj.definition.type) and not(isinstance(valeur,Accas.PARAMETRE)) :
+            # Pour un flottant on utilise str ou repr si on vient d une liste
+            # ou la notation scientifique
+            # On ajoute un . si il n y en a pas dans la valeur
+            s = str(valeur)
+            if vientDeListe and repr(valeur) != str(valeur) : s=repr(valeur)
+            if (s.find('.')== -1 and s.find('e')== -1 and s.find('E')==-1) : s=s+'.0'
+            clefobj=etape.getSdname()
+            if self.appliEficas and clefobj in self.appliEficas.dict_reels:
+                if valeur in self.appliEficas.dict_reels[clefobj]:
+                    s=self.appliEficas.dict_reels[clefobj][valeur]
+
+        elif type(valeur) == bytes or type(valeur) == str :
+            if valeur.find('\n') == -1:
+                    # pas de retour chariot, on utilise repr
+                s = repr(valeur)
+            elif valeur.find('"""') == -1:
+                # retour chariot mais pas de triple ", on formatte
+                s='"""'+valeur+'"""'
+            else:
+                s = repr(valeur)
+        elif isinstance(valeur,Accas.CO) or hasattr(etape,'sdprods') and valeur in etape.sdprods:
+            s = "CO('"+ self.generator(valeur) +"')"
+        elif isinstance(valeur,Accas.UserASSD):
+        # ici on ne prend que la reference
+            s = valeur.nom
+        elif isinstance(valeur,Accas.ASSD):
+            s = self.generator(valeur)
+        elif isinstance(valeur,Accas.PARAMETRE):
             # il ne faut pas prendre la string que retourne gener
             # mais seulement le nom dans le cas d'un parametre
-      #      s = valeur.nom
-      #   else:
-      #      s = self.generator(valeur)
-
-      else :
-         # Pour les autres types on utilise repr
-         s = repr(valeur)
-      return s
-
-   def generMCSIMP(self,obj) :
-      """
-          Convertit un objet MCSIMP en une liste de chaines de caracteres a la
-          syntaxe python
-      """
-      waitTuple=0
-      if type(obj.valeur) in (tuple,list) :
-         s = ''
-         for ss_type in obj.definition.type:
-          if repr(ss_type).find('Tuple') != -1 :
-             waitTuple=1
-             break
-
-         if waitTuple :
-            #s = str(obj.valeur) +','
-            #obj.valeurFormatee=obj.valeur
-            s = obj.getText() +','
-            obj.valeurFormatee=obj.getText()
-         else :
-            obj.valeurFormatee=[]
-            for val in obj.valeur :
-               s =s +self.formatItem(val,obj.etape,obj,1) + ','
-               if obj.waitTxm() :
-                  obj.valeurFormatee.append(val)
-               else :
-                 obj.valeurFormatee.append(self.formatItem(val,obj.etape,obj))
-            if len(obj.valeur) >= 1:
-               s = '(' + s + '),'
-            if obj.valeur==[] or obj.valeur==() : s="(),"
-         if obj.nbrColonnes() :
-            s=self.formatColonnes(obj.nbrColonnes(),obj.valeur,obj)
-      else :
-         obj.valeurFormatee=obj.valeur
-         s=self.formatItem(obj.valeur,obj.etape,obj) + ','
-      return s
-
-
-   def formatColonnes(self,nbrColonnes,listeValeurs,obj):
-      try :
-      #if 1 == 1 :
-        indice=0
-        textformat="("
-        while ( indice < len(listeValeurs) ) :
-          try :
-          #if 1 :
-            for l in range(nbrColonnes) :
-                texteVariable=self.formatItem(listeValeurs[indice],obj.etape,obj)
-                textformat=textformat+texteVariable+" ,"
-                indice=indice+1
-            textformat=textformat+"\n"
-          except :
-          #else :
+            s = valeur.nom
+
+        #elif type(valeur) == types.InstanceType or isinstance(valeur,object):
+        #   if valeur.__class__.__name__ == 'CO' or hasattr(etape,'sdprods') and valeur in etape.sdprods :
+        #      s = "CO('"+ self.generator(valeur) +"')"
+        #   elif isinstance(valeur,Accas.PARAMETRE):
+                # il ne faut pas prendre la string que retourne gener
+                # mais seulement le nom dans le cas d'un parametre
+        #      s = valeur.nom
+        #   else:
+        #      s = self.generator(valeur)
+
+        else :
+            # Pour les autres types on utilise repr
+            s = repr(valeur)
+        return s
+
+    def generMCSIMP(self,obj) :
+        """
+            Convertit un objet MCSIMP en une liste de chaines de caracteres a la
+            syntaxe python
+        """
+        waitTuple=0
+        if type(obj.valeur) in (tuple,list) :
+            s = ''
+            for ss_type in obj.definition.type:
+                if repr(ss_type).find('Tuple') != -1 :
+                    waitTuple=1
+                    break
+
+            if waitTuple :
+                #s = str(obj.valeur) +','
+                #obj.valeurFormatee=obj.valeur
+                s = obj.getText() +','
+                obj.valeurFormatee=obj.getText()
+            else :
+                obj.valeurFormatee=[]
+                for val in obj.valeur :
+                    s =s +self.formatItem(val,obj.etape,obj,1) + ','
+                    if obj.waitTxm() :
+                        obj.valeurFormatee.append(val)
+                    else :
+                        obj.valeurFormatee.append(self.formatItem(val,obj.etape,obj))
+                if len(obj.valeur) >= 1:
+                    s = '(' + s + '),'
+                if obj.valeur==[] or obj.valeur==() : s="(),"
+            if obj.nbrColonnes() :
+                s=self.formatColonnes(obj.nbrColonnes(),obj.valeur,obj)
+        else :
+            obj.valeurFormatee=obj.valeur
+            s=self.formatItem(obj.valeur,obj.etape,obj) + ','
+        return s
+
+
+    def formatColonnes(self,nbrColonnes,listeValeurs,obj):
+        try :
+        #if 1 == 1 :
+            indice=0
+            textformat="("
             while ( indice < len(listeValeurs) ) :
-                texteVariable=self.formatItem(listeValeurs[indice],obj.etape,obj)
-                textformat=textformat+texteVariable+", "
-                indice=indice+1
-            textformat=textformat+"\n"
-        textformat=textformat[0:-1]+"),\n"
-      except :
-      #else :
-         textformat=str(obj.valeur)
-      return textformat
+                try :
+                #if 1 :
+                    for l in range(nbrColonnes) :
+                        texteVariable=self.formatItem(listeValeurs[indice],obj.etape,obj)
+                        textformat=textformat+texteVariable+" ,"
+                        indice=indice+1
+                    textformat=textformat+"\n"
+                except :
+                #else :
+                    while ( indice < len(listeValeurs) ) :
+                        texteVariable=self.formatItem(listeValeurs[indice],obj.etape,obj)
+                        textformat=textformat+texteVariable+", "
+                        indice=indice+1
+                    textformat=textformat+"\n"
+            textformat=textformat[0:-1]+"),\n"
+        except :
+        #else :
+            textformat=str(obj.valeur)
+        return textformat
index bd54a5be2ca73e1643446640ad5f2736095b9174..05b2dc14d3e46c8a38c097864a6117d804d4de10 100644 (file)
@@ -18,7 +18,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
-    Ce module contient le plugin generateur de fichier au format 
+    Ce module contient le plugin generateur de fichier au format
     python pour EFICAS.
     PN
 
@@ -27,9 +27,9 @@ from __future__ import absolute_import
 from __future__ import print_function
 from __future__ import division
 try :
-  from builtins import range
+    from builtins import range
 except :
-  pass
+    pass
 import traceback
 import types,re
 import math
@@ -45,199 +45,199 @@ from six.moves import range
 #from Editeur.widgets import showerror
 
 def entryPoint():
-   """
-       Retourne les informations necessaires pour le chargeur de plugins
+    """
+        Retourne les informations necessaires pour le chargeur de plugins
 
-       Ces informations sont retournees dans un dictionnaire
-   """
-   return {
-        # Le nom du plugin
-          'name' : 'vers3DSalome',
-        # La factory pour creer une instance du plugin
-          'factory' : vers3DSalomeGenerator,
-          }
+        Ces informations sont retournees dans un dictionnaire
+    """
+    return {
+         # Le nom du plugin
+           'name' : 'vers3DSalome',
+         # La factory pour creer une instance du plugin
+           'factory' : vers3DSalomeGenerator,
+           }
 
 
 class vers3DSalomeGenerator(PythonGenerator):
-   """
-       Ce generateur parcourt un objet AFFE-CARA_ELEM
-       et produit un fichier au format texte contenant
-       les instructions idl pour PAL 
-   """
-
-   def __init__(self,cr=None):
-      self.list_commandes=[];
-      self.jdc=None
-      self.node=None
-      self.clefs=None
-      self.liste_motetat = ("AFFE_CARA_ELEM", "ORIG_AXE", "AXE" , 
-                            "BARRE", "CABLE", "CARA", "COQUE", "EPAIS", 
-                            "EXCENTREMENT", "GROUP_MA", "ORIENTATION", 
-                            "POUTRE", "SECTION", "VALE", "VARI_SECT",
-                            "GRILLE", "ANGL_REP", "VECTEUR",
-                             "b_constant", "b_homothetique", 
-                            "b_rectangle", "b_affine", "b_cercle", "b_generale" )
-      self.dict_deb_com={"POUTRE":"VisuPoutre", "CABLE" : "VisuCable",
-                         "COQUE" : "VisuCoque", "GRILLE" : "VisuGrille",
-                         "ORIENTATION" : "Orientation", "BARRE" : "VisuBarre"}
-
-      self.dict_suite_com={"RECTANGLE":"Rectangle","GENERALE":"Generale",
-                           "CERCLE":"Cercle"}
-
-      self.dict_traduit={"VARI_SECT":"extrusion","EXCENTREMENT":"Excentre","EPAIS":"Epais","VECTEUR":"Vecteur"}
-
-      self.initLigne () 
-
-   def initJdc(self,jdc) :
-      self.jdc=jdc
-
-   def initLigne  (self) :
-      self.boolGpMa = 0
-      self.commande = ""
-      self.dict_attributs = {} 
-
-   def gener(self,node,config=None,appliEficas=None):
-      """
-      """
-      self.node=node
-      self.list_commandes=[];
-      self.generator(self.node.object)
-      return self.list_commandes
-
-   def generator(self,obj):
-      if (obj.nom in self.liste_motetat) and (self.calculeOuiNon(obj)):
-         PythonGenerator.generator(self,obj)
-      """
-        f1=PythonGenerator.generator(self,obj)
-      else :
-        return ""
-      """
-
-   def calculeOuiNon(self,obj):
-      ouinon=1
-      for l in obj.getGenealogie() :
-          if not l in self.liste_motetat :
-             ouinon=0
-             break
-      return ouinon
-
-       
-   def generETAPE(self,obj):
-      """
-      """
-      if obj.isValid() == 0 :
-         #showerror("Element non valide","Salome ne sait pas traiter les elements non valides")
-         return
-      for v in obj.mcListe:
-         liste=self.generator(v)
-
-   def generMACRO_ETAPE(self,obj):
-      """
-      """
-      if obj.isValid() == 0 :
-         #showerror("Element non valide","Salome ne sait pas traiter les elements non valides")
-         return
-      for v in obj.mcListe:
-         liste=self.generator(v)
-
-
-   def generMCSIMP(self,obj) :
-      """
-      """
-      if obj.nom in dir(self) :
-         suite = self.__class__.__dict__[obj.nom](self,obj)
-      else :
-         clef=self.dict_traduit[obj.nom]
-         # traitement des parametres
-         try :
-             self.dict_attributs[clef]=obj.val.eval()
-         except :
-             self.dict_attributs[clef]=obj.val
-
-
-   def generMCFACT(self,obj):
-      """
-          Convertit un objet MCFACT en une liste de chaines de caracteres a la
-          syntaxe python
-      """
-      self.initLigne ()
-      self.commande=self.dict_deb_com[obj.nom]
-      for v in obj.mcListe:
-         self.generator(v)
-      if self.boolGpMa == 1:
-         self.list_commandes.append((self.commande,self.dict_attributs)) 
-      else :
-         #showerror("Elements ne portant pas sur un Groupe de Maille","Salome ne sait pas montrer ce type d' element")
-         print(("Elements ne portant pas sur un Groupe de Maille","Salome ne sait pas montrer ce type d' element"))
-         pass
-
-   def generMCList(self,obj):
-      """
-      """
-      for mcfact in obj.data:
-          self.generator(mcfact)
-
-   def generMCBLOC(self,obj):
-      """
-      """
-      for v in obj.mcListe:
-         self.generator(v)
-
-   def GROUP_MA(self,obj):
-      self.boolGpMa = 1
-      self.dict_attributs["Group_Maille"]=obj.val
-
-   def SECTION(self,obj):
-      assert (self.commande != "" )
-      if self.commande == "VisuCable" :
-         self.dict_attributs["R"]= math.sqrt(obj.val/math.pi).eval()
-      elif (self.commande !="VisuGrille")  :
-         self.commande=self.commande+self.dict_suite_com[obj.valeur]
-
-   def CARA(self,obj) :
-       self.clefs=obj.val
-       if type(self.clefs) == bytes or  type(self.clefs) == str:
-          self.clefs=(obj.val,)
-
-   def VALE(self,obj) :
-       atraiter=obj.val
-       if len(self.clefs) > 1 :
-           assert (len(atraiter) == len(self.clefs))
-       else :
-           atraiter=(atraiter,)
-       for k in range(len(atraiter)) :
-           clef=self.clefs[k]
-           val =atraiter[k] 
-           if isinstance(val, (tuple, list)) and len(val) == 1:
-               val = val[0]
-           if isinstance (val, Extensions.parametre.PARAMETRE):
-              val=val.valeur
-              print(( val.__class))
-              context={}
-              if type(val) == type("aaa") :
-                 for p in self.jdc.params:
-                     context[p.nom]=eval(p.val,self.jdc.const_context, context)
-                     print((context[p.nom]))
-                 res=eval(val,self.jdc.const_context, context)
-                 val=res
-           self.dict_attributs[clef]=val
-
-   def ANGL_REP(self,obj) :
-      assert (len(obj.val) == 2)
-      alpha,beta=obj.val
-      self.dict_attributs["angleAlpha"]=alpha
-      self.dict_attributs["angleBeta"]=beta
-
-   def ORIG_AXE(self,obj) :
-      assert (len(obj.val) == 3)
-      alpha,beta,gamma=obj.val
-      self.dict_attributs["origAxeX"]=alpha
-      self.dict_attributs["origAxeY"]=beta
-      self.dict_attributs["origAxeZ"]=gamma
-
-   def AXE(self,obj) :
-      assert (len(obj.val) == 3)
-      alpha,beta,gamma=obj.val
-      self.dict_attributs["axeX"]=alpha
-      self.dict_attributs["axeY"]=beta
-      self.dict_attributs["axeZ"]=gamma
+    """
+        Ce generateur parcourt un objet AFFE-CARA_ELEM
+        et produit un fichier au format texte contenant
+        les instructions idl pour PAL
+    """
+
+    def __init__(self,cr=None):
+        self.list_commandes=[];
+        self.jdc=None
+        self.node=None
+        self.clefs=None
+        self.liste_motetat = ("AFFE_CARA_ELEM", "ORIG_AXE", "AXE" ,
+                              "BARRE", "CABLE", "CARA", "COQUE", "EPAIS",
+                              "EXCENTREMENT", "GROUP_MA", "ORIENTATION",
+                              "POUTRE", "SECTION", "VALE", "VARI_SECT",
+                              "GRILLE", "ANGL_REP", "VECTEUR",
+                               "b_constant", "b_homothetique",
+                              "b_rectangle", "b_affine", "b_cercle", "b_generale" )
+        self.dict_deb_com={"POUTRE":"VisuPoutre", "CABLE" : "VisuCable",
+                           "COQUE" : "VisuCoque", "GRILLE" : "VisuGrille",
+                           "ORIENTATION" : "Orientation", "BARRE" : "VisuBarre"}
+
+        self.dict_suite_com={"RECTANGLE":"Rectangle","GENERALE":"Generale",
+                             "CERCLE":"Cercle"}
+
+        self.dict_traduit={"VARI_SECT":"extrusion","EXCENTREMENT":"Excentre","EPAIS":"Epais","VECTEUR":"Vecteur"}
+
+        self.initLigne ()
+
+    def initJdc(self,jdc) :
+        self.jdc=jdc
+
+    def initLigne  (self) :
+        self.boolGpMa = 0
+        self.commande = ""
+        self.dict_attributs = {}
+
+    def gener(self,node,config=None,appliEficas=None):
+        """
+        """
+        self.node=node
+        self.list_commandes=[];
+        self.generator(self.node.object)
+        return self.list_commandes
+
+    def generator(self,obj):
+        if (obj.nom in self.liste_motetat) and (self.calculeOuiNon(obj)):
+            PythonGenerator.generator(self,obj)
+        """
+          f1=PythonGenerator.generator(self,obj)
+        else :
+          return ""
+        """
+
+    def calculeOuiNon(self,obj):
+        ouinon=1
+        for l in obj.getGenealogie() :
+            if not l in self.liste_motetat :
+                ouinon=0
+                break
+        return ouinon
+
+
+    def generETAPE(self,obj):
+        """
+        """
+        if obj.isValid() == 0 :
+            #showerror("Element non valide","Salome ne sait pas traiter les elements non valides")
+            return
+        for v in obj.mcListe:
+            liste=self.generator(v)
+
+    def generMACRO_ETAPE(self,obj):
+        """
+        """
+        if obj.isValid() == 0 :
+            #showerror("Element non valide","Salome ne sait pas traiter les elements non valides")
+            return
+        for v in obj.mcListe:
+            liste=self.generator(v)
+
+
+    def generMCSIMP(self,obj) :
+        """
+        """
+        if obj.nom in dir(self) :
+            suite = self.__class__.__dict__[obj.nom](self,obj)
+        else :
+            clef=self.dict_traduit[obj.nom]
+            # traitement des parametres
+            try :
+                self.dict_attributs[clef]=obj.val.eval()
+            except :
+                self.dict_attributs[clef]=obj.val
+
+
+    def generMCFACT(self,obj):
+        """
+            Convertit un objet MCFACT en une liste de chaines de caracteres a la
+            syntaxe python
+        """
+        self.initLigne ()
+        self.commande=self.dict_deb_com[obj.nom]
+        for v in obj.mcListe:
+            self.generator(v)
+        if self.boolGpMa == 1:
+            self.list_commandes.append((self.commande,self.dict_attributs))
+        else :
+            #showerror("Elements ne portant pas sur un Groupe de Maille","Salome ne sait pas montrer ce type d' element")
+            print(("Elements ne portant pas sur un Groupe de Maille","Salome ne sait pas montrer ce type d' element"))
+            pass
+
+    def generMCList(self,obj):
+        """
+        """
+        for mcfact in obj.data:
+            self.generator(mcfact)
+
+    def generMCBLOC(self,obj):
+        """
+        """
+        for v in obj.mcListe:
+            self.generator(v)
+
+    def GROUP_MA(self,obj):
+        self.boolGpMa = 1
+        self.dict_attributs["Group_Maille"]=obj.val
+
+    def SECTION(self,obj):
+        assert (self.commande != "" )
+        if self.commande == "VisuCable" :
+            self.dict_attributs["R"]= math.sqrt(obj.val/math.pi).eval()
+        elif (self.commande !="VisuGrille")  :
+            self.commande=self.commande+self.dict_suite_com[obj.valeur]
+
+    def CARA(self,obj) :
+        self.clefs=obj.val
+        if type(self.clefs) == bytes or  type(self.clefs) == str:
+            self.clefs=(obj.val,)
+
+    def VALE(self,obj) :
+        atraiter=obj.val
+        if len(self.clefs) > 1 :
+            assert (len(atraiter) == len(self.clefs))
+        else :
+            atraiter=(atraiter,)
+        for k in range(len(atraiter)) :
+            clef=self.clefs[k]
+            val =atraiter[k]
+            if isinstance(val, (tuple, list)) and len(val) == 1:
+                val = val[0]
+            if isinstance (val, Extensions.parametre.PARAMETRE):
+                val=val.valeur
+                print(( val.__class))
+                context={}
+                if type(val) == type("aaa") :
+                    for p in self.jdc.params:
+                        context[p.nom]=eval(p.val,self.jdc.const_context, context)
+                        print((context[p.nom]))
+                    res=eval(val,self.jdc.const_context, context)
+                    val=res
+            self.dict_attributs[clef]=val
+
+    def ANGL_REP(self,obj) :
+        assert (len(obj.val) == 2)
+        alpha,beta=obj.val
+        self.dict_attributs["angleAlpha"]=alpha
+        self.dict_attributs["angleBeta"]=beta
+
+    def ORIG_AXE(self,obj) :
+        assert (len(obj.val) == 3)
+        alpha,beta,gamma=obj.val
+        self.dict_attributs["origAxeX"]=alpha
+        self.dict_attributs["origAxeY"]=beta
+        self.dict_attributs["origAxeZ"]=gamma
+
+    def AXE(self,obj) :
+        assert (len(obj.val) == 3)
+        alpha,beta,gamma=obj.val
+        self.dict_attributs["axeX"]=alpha
+        self.dict_attributs["axeY"]=beta
+        self.dict_attributs["axeZ"]=gamma