]> SALOME platform Git repositories - modules/eficas.git/commitdiff
Salome HOME
mise en conformite avec le modele V8
authorpascale.noyret <pascale.noyret@edf.fr>
Mon, 5 Mar 2018 16:20:14 +0000 (17:20 +0100)
committerpascale.noyret <pascale.noyret@edf.fr>
Mon, 5 Mar 2018 16:20:14 +0000 (17:20 +0100)
Efi2Xsd/readerEfficas.py
Efi2Xsd/writerEfficas.py
Med/Catalogues/Cata_MED_FAM_test_v7.xml [new file with mode: 0755]
Med/Catalogues/Cata_MED_FAM_test_v8.xml [new file with mode: 0755]
Noyau/N_JDC.py

index 34a178f5be25f52c2c4bd9b866c80a72284c4d1b..036371d5fc4994d0075cb5fd80fefc4b6ae409cc 100755 (executable)
@@ -9,125 +9,167 @@ sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..')))
 
 from Accas import *
 
+# traiter le cas des tuples
 
-# Attention pas d heritage possible (cf doc pyxbe)
-# bizarre le comportement de max est different entre les facts et les simps ?
-
-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_occurs' : 'min' ,
-                    'valeur_sugg' : 'sug' , 'portee' : 'position' , 'max_occurs' : 'max' , }
-
-dictFACTXMLEficas = {'doc' : {'fr' : 'fr' , 'ang' : 'ang' , 'docu' : 'docu' },
-                    'statut' : 'statut' , 'validators' : 'validators' ,
-                    'min_occurs' : 'min' , 'max_occurs' : 'max' , }
+# ds l init du SIMP il manque siValide et fenetreIhm
+
+from mapDesTypes import dictSIMPEficasXML, dictSIMPXMLEficas
+from mapDesTypes import dictFACTEficasXML, dictFACTXMLEficas
+from mapDesTypes import dictPROCEficasXML, dictPROCXMLEficas
+from mapDesTypes import listeParamDeTypeTypeAttendu, listeParamDeTypeStr, dicoPourCast
+from mapDesTypes import listeParamEnListeSiMax,  listeParamTjsEnListe
 
 # ------------------------------
-class monSIMP (efficas.T_SIMP):
+class objetDefinitionAccas:
 # ------------------------------
 
-   def explore(self,cata):
-      #print "je passe dans  explore pour SIMP ", self.nom
+   def argumentXMLToEficas(self):
+   # ---------------------------
+      # Attention, pas de validation pour l instant
+      # il faut verifier la coherence entre les types contenus dans defaut, sug ... et le typeAttendu
+      # tout cela dans une fonction verifie pas faite -)
+
+      # Recuperation parametres
       self.dictArgsEficas={}
-      self.dictArgsEficas['typ']=self.typeAttendu
       for nomXMLArg in dir(self) :
-          if nomXMLArg in dictSIMPXMLEficas.keys() :
-              nomEficasArg=dictSIMPXMLEficas[nomXMLArg]
+          if nomXMLArg in self.dictATraiter :
+              nomEficasArg=self.dictATraiter[nomXMLArg]
               argu=getattr(self,nomXMLArg)
               if argu==None : continue
-              if nomEficasArg == 'defaut' : print (argu); 
-              if nomEficasArg == 'defaut' : print (dir(argu)); 
-              if nomEficasArg == 'defaut' : print (argu.value)
-              #if nomEficasArg == 'defaut' : print (efficas.T_I(argu))
-              if nomEficasArg == 'defaut' : print (argu.content())
+
               if type(nomEficasArg) == types.DictionaryType:
-                 for nomXML in nomEficasArg.keys():
+                 for nomXML in list(nomEficasArg.keys()):
                       arguDecoupe=getattr(argu,nomXML)
                       nomEficasDecoupe=nomEficasArg[nomXML]
+                      if arguDecoupe == None : continue
                       self.dictArgsEficas[nomEficasDecoupe]=arguDecoupe
               else :
-                 self.dictArgsEficas[nomEficasArg] = argu
+                self.dictArgsEficas[nomEficasArg] = argu
                     
-      if 'min' in self.dictArgsEficas.keys(): self.dictArgsEficas['min']=int(self.dictArgsEficas['min'])
-      if 'max' in self.dictArgsEficas.keys(): 
+      # Cast dans le bon type des parametres si necessaire
+      if 'min' in list(self.dictArgsEficas.keys()): 
+            self.dictArgsEficas['min']=int(self.dictArgsEficas['min'])
+
+      if 'max' in list(self.dictArgsEficas.keys()): 
             if self.dictArgsEficas['max']== -1   :  self.dictArgsEficas['max']="**"
             else                                 :  self.dictArgsEficas['max']=int(self.dictArgsEficas['max'])
-      self.objAccas=A_SIMP.SIMP(**self.dictArgsEficas)
-      self.objAccas.nom=self.nom
-      self.strNomObj=str(self.nom)
-     
-   def getAccasEquivalent(self):
-       return self.strNomObj, self.objAccas
 
-# ------------------------------
-class monPROC(efficas.T_PROC):
-# ------------------------------
-   def explore(self,cata):
-      #print "je passe dans  explore pour PROC ", self.nom
-      self.dictConstruction={}
-      self.dictConstruction['nom']=self.nom
+      #for param in list(self.dictArgsEficas.keys()):
+      #    if param in listeParamDeTypeStr :
+      #       self.dictArgsEficas[param]=unicode(self.dictArgsEficas[param])
+      
+      # Pour commodite ? pas sur que cela soit necessaire
+      #self.strNomObj=str(self.nom)
+          
+         
+   def getAccasEquivalent(self):
+   # ---------------------------
+       return self.nom, self.objAccas
+#
+
+# ---------------------------------------------------------
+class objetComposeDefinitionAccas (objetDefinitionAccas):
+# ---------------------------------------------------------
+    def exploreArbre(self):
+    # --------------------------
       liste=[]
       for obj in self.content(): liste.append(obj)
       liste.reverse()
+      # PNPNPN essayer de comprendre reverse ou non
+
       for obj in liste: 
-          if  hasattr(obj,'explore') : obj.explore (cata)
+          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)
-      self.strNomObj=str(self.nom)
-      setattr(cata, self.strNomObj,self.objAccas)
+              self.dictArgsEficas[nom]=objetAccas
+     
+# ----------------------------------------------------
+class monSIMP (efficas.T_SIMP,  objetDefinitionAccas):
+# ----------------------------------------------------
 
+   def explore(self):
+   # --------------------
+   # 2 arguments pour ne pas avoir a differencier les appels explore
+      self.dictATraiter= dictSIMPXMLEficas
+      self.argumentXMLToEficas()
 
-# ------------------------------
-class monFACT(efficas.T_FACT):
-# ------------------------------
-   def explore(self,cata):
+      self.objAccas=A_SIMP.SIMP(**self.dictArgsEficas)
+      self.objAccas.nom=self.nom
+      #self.strNomObj=str(self.nom)
+
+   def argumentXMLToEficas(self):
+   # ----------------------------
+      objetDefinitionAccas.argumentXMLToEficas(self)
+      self.convertitEnListes()
+      self.convertitLesTypes()
+
+   def estListe(self):
+   # ---------------
+       if hasattr(self,'max') and self.max > 1 : return True
+       else : return False
+
+   def attendTuple(self):
+   # -------------------
+       return False
+
+   def convertitEnListes(self):
+   # ------------------------
+   # Cas des Tuples non traites
+       for param in listeParamTjsEnListe :
+          if  param in self.dictArgsEficas :
+              if not self.attendTuple() :
+                 self.dictArgsEficas[param]=[self.dictArgsEficas[param],]
+
+       if self.estListe() :
+         for param in listeParamEnListeSiMax:
+             if param in self.dictArgsEficas :
+                if not self.attendTuple() :
+                   self.dictArgsEficas[param]=[self.dictArgsEficas[param],]
+
+   def convertitLesTypes(self):
+   # ------------------------
+   # Cas des Tuples non traites
+
+       typeAttendu = self.dictArgsEficas['typ']
+       if typeAttendu in list(dicoPourCast.keys()):
+          for param in listeParamDeTypeTypeAttendu :
+             if param in list(self.dictArgsEficas.keys()):
+                castDsLeTypeAttendu=dicoPourCast[typeAttendu]
+                valeurACaster=self.dictArgsEficas[param].typesimple
+                if not isinstance(valeurACaster, (list, tuple)) :
+                   val=castDsLeTypeAttendu(valeurACaster)
+                   self.dictArgsEficas[param]=val
+                else :
+                   print (dir(self.dictArgsEficas[param]))
+       print ('==========',  self.dictArgsEficas)
+
+
+# -------------------------------------------------------
+class monFACT(efficas.T_FACT, objetComposeDefinitionAccas):
+# -------------------------------------------------------
+   def explore(self):
+   # --------------------
       #print "je passe dans  explore pour FACT ", self.nom
-      self.dictConstruction={}
 
-      for nomXMLArg in dir(self) :
-          if nomXMLArg in dictFACTXMLEficas.keys() :
-              nomEficasArg=dictFACTXMLEficas[nomXMLArg]
-              argu=getattr(self,nomXMLArg)
-              if argu==None : continue
-              argu=str(argu)
-              if type(nomEficasArg) == types.DictionaryType:
-                 for nomXML in nomEficasArg.keys():
-                      arguDecoupe=getattr(argu,nomXML)
-                      nomEficasDecoupe=nomEficasArg[nomXML]
-                      self.dictConstruction[nomEficasDecoupe]=arguDecoupe
-              else :
-                 self.dictConstruction[nomEficasArg] = argu
-      if 'min' in self.dictConstruction.keys(): self.dictConstruction['min']=int(self.dictConstruction['min'])
-      if 'max' in self.dictConstruction.keys(): 
-            if self.dictConstruction['max']== '-1' :  self.dictConstruction['max']="**"
-            else                                 :  self.dictConstruction['max']=int(self.dictConstruction['max'])
-      liste=[]
-      for obj in self.content(): liste.append(obj)
-      liste.reverse()
-      for obj in liste: 
-          if  hasattr(obj,'explore') : obj.explore(cata)
-          if  hasattr(obj,'getAccasEquivalent') : 
-              nom,objetAccas=obj.getAccasEquivalent()
-              self.dictConstruction[nom]=objetAccas
-      
-      self.objAccas=A_FACT.FACT(**self.dictConstruction)
-      self.strNomObj=str(self.nom)
+      self.dictATraiter= dictFACTXMLEficas
+      self.argumentXMLToEficas()
+      self.exploreArbre()
+      self.objAccas=A_FACT.FACT(**self.dictArgsEficas)
 
-   def getAccasEquivalent(self):
-       return self.strNomObj, self.objAccas
+
+# ---------------------------------------------------------
+class monPROC(efficas.T_PROC, objetComposeDefinitionAccas):
+# ---------------------------------------------------------
+   def explore(self,cata):
+   # --------------------
+      #print "je passe dans  explore pour PROC ", self.nom
+      self.dictATraiter= dictPROCXMLEficas
+      self.argumentXMLToEficas()
+      self.exploreArbre()
+      self.dictArgsEficas['op']=None
+
+      self.objAccas=A_PROC.PROC(**self.dictArgsEficas)
+      setattr(cata, self.nom,self.objAccas)
 
 
 # ------------------------------
@@ -155,7 +197,8 @@ if __name__ == "__main__":
 #   print dir(efficas.T_SIMP)
 
 
-   xml = open('Cata_MED_FAM.xml').read()
+   xml = open('cata_test1.xml').read()
+   #xml = open('Cata_MED_FAM.xml').read()
    SchemaMed = efficas.CreateFromDocument(xml)
    SchemaMed.exploreCata()
    #print dir(SchemaMed)
index 0a1cc1e98dfdae0079cf0da81ee9ab680df04399..99cfcbd42098a09a6bea2881449f59cb0c182a27 100755 (executable)
@@ -3,6 +3,7 @@
 import sys,os
 import raw.efficas as efficas
 import types
+import pyxb
 
 sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..')))
 
@@ -152,6 +153,16 @@ dictFACTXMLEficas = {'doc' : {'fr' : 'fr' , 'ang' : 'ang' , 'docu' : 'docu' },
 #
 if __name__ == "__main__":
 
-   xml = open('Cata_MED_FAM.xml').read()
-   SchemaMed = efficas.CreateFromDocument(xml)
-   SchemaMed.exploreCata()
+   #xml = open('Cata_MED_FAM.xml').read()
+   #Cata = efficas.T_cata()
+   #Commande=T_commandes()
+   #T_PROC()
+   #T_SIMP()
+   print (dir(efficas.T_SIMP))
+   print (dir(efficas.T_PROC))
+   print (dir(efficas.T_cata))
+   
+   #pyxb.RequireValidWhenGenerating(False)
+   #print(SchemaMed.toxml("utf-8").decode('utf-8'))
+   
+   #SchemaMed.exploreCata()
diff --git a/Med/Catalogues/Cata_MED_FAM_test_v7.xml b/Med/Catalogues/Cata_MED_FAM_test_v7.xml
new file mode 100755 (executable)
index 0000000..44d19da
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<cata xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:efficas="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%20v6%20ext.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" >\r
+                                       <typeAttendu>TXM</typeAttendu>\r
+                               </SIMP>\r
+                               <efficas:FACT efficas:nom="ELEME" efficas:statut="f" efficas:min_occurs="1" efficas:max_occurs="1">\r
+                                       <efficas:FACT efficas:nom="FAMILY_NAME_ELEM" efficas:statut="f" efficas:min_occurs="1" efficas:max_occurs="-1">\r
+                                               <!--                 <efficas:regles>\r
+                       -->\r
+                                               <!-- Ajouter des contraintes de vérification de la présence ATT et GRO -->\r
+                                               <!--\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" >\r
+                                                       <typeAttendu>I</typeAttendu>\r
+                                               </efficas:SIMP>\r
+                                               <efficas:SIMP efficas:nom="NAME" efficas:statut="o" efficas:max_occurs="1" >\r
+                                                       <typeAttendu>TXM</typeAttendu>\r
+                                               </efficas:SIMP>\r
+                                               <efficas:FACT efficas:nom="ATT" efficas:statut="f" efficas:max_occurs="1">\r
+                                                       <efficas:regles>\r
+                                                               <efficas:ENSEMBLE>DES IDE VAL</efficas:ENSEMBLE>\r
+                                                       </efficas:regles>\r
+                                                       <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1" >\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>TXM</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </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" >\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>TXM</typeAttendu>\r
+                                                       </SIMP>\r
+                                               </efficas:FACT>\r
+                                       </efficas:FACT>\r
+                               </efficas:FACT>\r
+                               <efficas:FACT efficas:nom="FAMILLE_ZERO" efficas:min_occurs="1" efficas:max_occurs="1" efficas:statut="o">\r
+                                       <efficas:SIMP efficas:nom="NUM" efficas:statut="o" efficas:max_occurs="1" >\r
+                                               <efficas:valeurDef>\r
+                                                       <efficas:typesimple>0</efficas:typesimple>\r
+                                               </efficas:valeurDef>\r
+                                               <efficas:plageValeur>\r
+                                                       <efficas:into>\r
+                                                               <efficas:typesimple>0</efficas:typesimple>\r
+                                                       </efficas:into>\r
+                                               </efficas:plageValeur>\r
+                                               <typeAttendu>I</typeAttendu>\r
+                                       </efficas:SIMP>\r
+                                       <efficas:FACT efficas:nom="ATT" efficas:statut="f" efficas:max_occurs="1">\r
+                                               <efficas:regles>\r
+                                                       <efficas:ENSEMBLE>DES IDE VAL</efficas:ENSEMBLE>\r
+                                               </efficas:regles>\r
+                                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1" >\r
+                                                       <typeAttendu>I</typeAttendu>\r
+                                               </SIMP>\r
+                                               <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                       <typeAttendu>TXM</typeAttendu>\r
+                                               </SIMP>\r
+                                               <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                       <typeAttendu>I</typeAttendu>\r
+                                               </SIMP>\r
+                                               <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                       <typeAttendu>I</typeAttendu>\r
+                                               </SIMP>\r
+                                       </efficas:FACT>\r
+                               </efficas:FACT>\r
+                               <efficas:FACT efficas:nom="NOEUD" efficas:statut="f" efficas:min_occurs="1" efficas:max_occurs="-1">\r
+                                       <efficas:FACT efficas:nom="FAMILY_NAME_NOE" 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" >\r
+                                                       <typeAttendu>I</typeAttendu>\r
+                                               </efficas:SIMP>\r
+                                               <efficas:SIMP efficas:nom="NAME" efficas:statut="o" efficas:max_occurs="1" >\r
+                                                       <typeAttendu>TXM</typeAttendu>\r
+                                               </efficas:SIMP>\r
+                                               <efficas:FACT efficas:nom="ATT" efficas:statut="f" efficas:max_occurs="1">\r
+                                                       <efficas:regles>\r
+                                                               <efficas:ENSEMBLE>DES IDE VAL</efficas:ENSEMBLE>\r
+                                                       </efficas:regles>\r
+                                                       <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1" >\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>TXM</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </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" >\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>TXM</typeAttendu>\r
+                                                       </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" >\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>TXM</typeAttendu>\r
+                                                       </SIMP>\r
+                                               </efficas:FACT>\r
+-->                                    </efficas:FACT>\r
+                               </efficas:FACT>\r
+                       </efficas:FACT>\r
+               </PROC>\r
+       </commandes>\r
+</cata>\r
diff --git a/Med/Catalogues/Cata_MED_FAM_test_v8.xml b/Med/Catalogues/Cata_MED_FAM_test_v8.xml
new file mode 100755 (executable)
index 0000000..44d19da
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<cata xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:efficas="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%20v6%20ext.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" >\r
+                                       <typeAttendu>TXM</typeAttendu>\r
+                               </SIMP>\r
+                               <efficas:FACT efficas:nom="ELEME" efficas:statut="f" efficas:min_occurs="1" efficas:max_occurs="1">\r
+                                       <efficas:FACT efficas:nom="FAMILY_NAME_ELEM" efficas:statut="f" efficas:min_occurs="1" efficas:max_occurs="-1">\r
+                                               <!--                 <efficas:regles>\r
+                       -->\r
+                                               <!-- Ajouter des contraintes de vérification de la présence ATT et GRO -->\r
+                                               <!--\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" >\r
+                                                       <typeAttendu>I</typeAttendu>\r
+                                               </efficas:SIMP>\r
+                                               <efficas:SIMP efficas:nom="NAME" efficas:statut="o" efficas:max_occurs="1" >\r
+                                                       <typeAttendu>TXM</typeAttendu>\r
+                                               </efficas:SIMP>\r
+                                               <efficas:FACT efficas:nom="ATT" efficas:statut="f" efficas:max_occurs="1">\r
+                                                       <efficas:regles>\r
+                                                               <efficas:ENSEMBLE>DES IDE VAL</efficas:ENSEMBLE>\r
+                                                       </efficas:regles>\r
+                                                       <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1" >\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>TXM</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </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" >\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>TXM</typeAttendu>\r
+                                                       </SIMP>\r
+                                               </efficas:FACT>\r
+                                       </efficas:FACT>\r
+                               </efficas:FACT>\r
+                               <efficas:FACT efficas:nom="FAMILLE_ZERO" efficas:min_occurs="1" efficas:max_occurs="1" efficas:statut="o">\r
+                                       <efficas:SIMP efficas:nom="NUM" efficas:statut="o" efficas:max_occurs="1" >\r
+                                               <efficas:valeurDef>\r
+                                                       <efficas:typesimple>0</efficas:typesimple>\r
+                                               </efficas:valeurDef>\r
+                                               <efficas:plageValeur>\r
+                                                       <efficas:into>\r
+                                                               <efficas:typesimple>0</efficas:typesimple>\r
+                                                       </efficas:into>\r
+                                               </efficas:plageValeur>\r
+                                               <typeAttendu>I</typeAttendu>\r
+                                       </efficas:SIMP>\r
+                                       <efficas:FACT efficas:nom="ATT" efficas:statut="f" efficas:max_occurs="1">\r
+                                               <efficas:regles>\r
+                                                       <efficas:ENSEMBLE>DES IDE VAL</efficas:ENSEMBLE>\r
+                                               </efficas:regles>\r
+                                               <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1" >\r
+                                                       <typeAttendu>I</typeAttendu>\r
+                                               </SIMP>\r
+                                               <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                       <typeAttendu>TXM</typeAttendu>\r
+                                               </SIMP>\r
+                                               <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                       <typeAttendu>I</typeAttendu>\r
+                                               </SIMP>\r
+                                               <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                       <typeAttendu>I</typeAttendu>\r
+                                               </SIMP>\r
+                                       </efficas:FACT>\r
+                               </efficas:FACT>\r
+                               <efficas:FACT efficas:nom="NOEUD" efficas:statut="f" efficas:min_occurs="1" efficas:max_occurs="-1">\r
+                                       <efficas:FACT efficas:nom="FAMILY_NAME_NOE" 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" >\r
+                                                       <typeAttendu>I</typeAttendu>\r
+                                               </efficas:SIMP>\r
+                                               <efficas:SIMP efficas:nom="NAME" efficas:statut="o" efficas:max_occurs="1" >\r
+                                                       <typeAttendu>TXM</typeAttendu>\r
+                                               </efficas:SIMP>\r
+                                               <efficas:FACT efficas:nom="ATT" efficas:statut="f" efficas:max_occurs="1">\r
+                                                       <efficas:regles>\r
+                                                               <efficas:ENSEMBLE>DES IDE VAL</efficas:ENSEMBLE>\r
+                                                       </efficas:regles>\r
+                                                       <SIMP efficas:nom="NBR" efficas:statut="o" efficas:max_occurs="1" >\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="DES" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>TXM</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="IDE" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="VAL" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </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" >\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>TXM</typeAttendu>\r
+                                                       </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" >\r
+                                                               <typeAttendu>I</typeAttendu>\r
+                                                       </SIMP>\r
+                                                       <SIMP efficas:nom="NOM" efficas:statut="o" efficas:max_occurs="-1">\r
+                                                               <typeAttendu>TXM</typeAttendu>\r
+                                                       </SIMP>\r
+                                               </efficas:FACT>\r
+-->                                    </efficas:FACT>\r
+                               </efficas:FACT>\r
+                       </efficas:FACT>\r
+               </PROC>\r
+       </commandes>\r
+</cata>\r
index 85eb6b70b3b0fab6a5b0070672a9a51eb04469d4..cdcf0e9abe2f34e4a92248ef2f41c94b3dee43aa 100644 (file)
@@ -196,7 +196,11 @@ Causes possibles :
                 if type(obj_cata) == types.ModuleType:
                     init2 = "from " + obj_cata.__name__ + " import *"
                     exec(init2, self.g_context)
-
+                else :
+                   # ici on est en 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()