From f80f3d0514ab72a3c533c38c2cc5e498ee6a7868 Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Thu, 21 Jun 2018 10:07:27 +0200 Subject: [PATCH] sauvegarde du 21 juin --- Efi2Xsd/AccasXsd.py | 182 +++++++++++++++++++++++++++++++-------- Efi2Xsd/MCAccasXsd.py | 184 ++++++++++++++++++++++++++++++++++------ Efi2Xsd/balises.py | 24 +++++- Efi2Xsd/mapDesTypes.py | 2 +- Efi2Xsd/readerEfiXsd.py | 16 +++- 5 files changed, 337 insertions(+), 71 deletions(-) mode change 100644 => 100755 Efi2Xsd/AccasXsd.py mode change 100644 => 100755 Efi2Xsd/readerEfiXsd.py diff --git a/Efi2Xsd/AccasXsd.py b/Efi2Xsd/AccasXsd.py old mode 100644 new mode 100755 index e05e7be4..e61df38f --- a/Efi2Xsd/AccasXsd.py +++ b/Efi2Xsd/AccasXsd.py @@ -3,6 +3,8 @@ import sys,os import types +# CONTEXT est accessible (__init__.py de Noyau) + #import raw.efficas as efficas sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..'))) @@ -30,34 +32,50 @@ class X_definition: while ( not hasattr(obj,'code') ): obj=obj.pere self.code = obj.code - def genealogie(self): - texte=self.nom - obj=self - while ( hasattr(obj,'pere') ): - texte=obj.pere.nom+'_'+texte - obj=obj.pere - return 'T_'+texte - - def nomSimple(self): - return 'T_'+self.nom - #return self.genealogie() + #def genealogie(self,n): + # texte=self.nom + # obj=self + # j=1 + # while ( hasattr(obj,'pere') ): + # texte=obj.pere.nom+'_'+texte + # obj=obj.pere + # j=j+1 + # if j > n : return (True, 'T_'+texte) + # return (False, 'T_'+texte) + def definitNomDuTypePyxb(self): + self.aCreer = True + cata = CONTEXT.getCurrentCata() + nom='T_'+self.nom + if not (nom in cata.dictTypesXSD.keys()) : + cata.dictTypesXSD[nom] = [self,] + 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) : return objAComparer.nomDuTypePyxb + indice += 1 + self.aCreer = True + cata.dictTypesXSD[nom].append(self) + nomAlter='T_'+self.nom+'_'+str(indice) + return nomAlter + # def existeDeja(self,nom): + # if nom in cata.dictTypesXSD.keys() : + # self.aCreer = False + # return cata.dictTypesXSD[nom] + # else : + # cata.dictTypesXSD[nom] = self + # return None # ---------------------------------------- class X_definitionComposee (X_definition): # ---------------------------------------- - - def dumpXsd(self): - #print ('------------------------------------------------') - #print ('dumpXsd de ' , self.nom) - - self.getCode() - self.nomDuTypeCree = self.nomSimple() - self.texteSimple = "" # on n ajoute pas de type simple - - self.texteComplexe = debutTypeComplexe.format(self.nomDuTypeCree) + def CreeTexteComplexeVenantDesFils(self): texteComplexeVenantDesFils="" for nom in self.ordre_mc: mcFils = self.entites[nom] @@ -65,11 +83,36 @@ class X_definitionComposee (X_definition): self.texteComplexe += mcFils.texteElt self.texteSimple += mcFils.texteSimple texteComplexeVenantDesFils += mcFils.texteComplexe - self.texteComplexe += finTypeComplexe - self.texteComplexe = texteComplexeVenantDesFils + self.texteComplexe + return texteComplexeVenantDesFils + + def dumpXsd(self): + #print ('------------------------------------------------') + #print ('dumpXsd de ' , self.nom) + + self.getCode() + self.nomDuTypePyxb = self.definitNomDuTypePyxb() + self.texteSimple = "" # on n ajoute pas de type simple self.traduitMinMax() - self.texteElt=eltDsSequence.format(self.nom,self.code,self.nomDuTypeCree,self.minOccurs,self.maxOccurs) + # pour accepter les PROC et ... + # + if self.aCreer : + self.texteComplexe = debutTypeCompo.format(self.nomDuTypePyxb,self.minOccurs,self.maxOccurs) + texteComplexeVenantDesFils=self.CreeTexteComplexeVenantDesFils() + self.texteComplexe = texteComplexeVenantDesFils + self.texteComplexe + self.texteComplexe += finTypeCompo + else : + self.texteComplexe = "" + + minDsSequence=0 + if hasattr(self, 'statut') and self.statut=='f' : minDsSequence=0 + maxDsSequence=1 + if self.label in ('BLOC', 'FACT'): + self.texteElt=eltCompoDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minDsSequence,maxDsSequence) + else : + self.texteElt=eltCompoDsSequenceSiProc.format(self.nom,self.code,self.nomDuTypePyxb) + #print (self.texteComplexe) + #print ('------------------------------------------------') def traduitMinMax(self): # ____________________ @@ -77,6 +120,17 @@ class X_definitionComposee (X_definition): self.minOccurs = 0 self.maxOccurs = 1 + def compare(self,autreMC): + if self.label != autreMC.label : return False + 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 + # --------------------------------- class X_FACT (X_definitionComposee): #--------- ------------------------ @@ -100,7 +154,37 @@ class X_PROC (X_definitionComposee): class X_BLOC (X_definitionComposee): #----------------------------------- def dumpXsd(self): - X_definitionComposee.dumpXsd(self) + #print ('------------------------------------------------') + #print ('dumpXsd de ' , self.nom) + + self.getCode() + 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() + 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 + 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 + #-------------------------------- class X_SIMP (X_definition): @@ -108,19 +192,31 @@ class X_SIMP (X_definition): def dumpXsd(self): #print ('exploreObjet SIMP') self.getCode() + self.aCreer = True # --> homonymie on peut utiliser genealogie #self.traduitMinMax() #self.traduitValMinValMax() self.nomDuTypeDeBase = self.traduitType() - self.nomDuTypeCree = self.nomSimple() - self.texteSimple = typeSimple.format(self.nomDuTypeCree, self.nomDuTypeDeBase) + self.nomDuTypePyxb = self.definitNomDuTypePyxb() + if self.aCreer == True : + if self.into != None: + self.texteSimple = debutTypeSimpleWithInto.format (self.nomDuTypePyxb, self.nomDuTypeDeBase) + for val in self.into : + self.texteSimple += typeSimpleWithInto.format(val) + self.texteSimple += finTypeSimpleWithInto + else : + self.texteSimple = typeSimple.format(self.nomDuTypePyxb, self.nomDuTypeDeBase) + else : + # le type existe deja + self.texteSimple="" self.texteComplexe = "" # on se sert des listes si maxOccurs est > 0 + # a gerer dans le dump if self.statut =='f' : minOccurs = 0 else : minOccurs = 1 - self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypeCree,minOccurs,1) + self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1) def traduitType(self): @@ -142,17 +238,25 @@ class X_SIMP (X_definition): 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 + for attr in ( 'type', 'ang', 'fr', 'into', 'intoSug' , 'siValide', 'defaut', 'min' ,'max' ,'homo' ,'position' ,'val_min' , 'val_max' , 'docu' , 'validators' , 'sug' ) : + val1=getattr(self,attr) + val2=getattr(autreMC,attr) + if val1 != val2 : return False + return True #----------------- class X_JDC_CATA : #----------------- def dumpXsd(self): + self.texteSimple = "" self.texteComplexe = "" - self.nomDuTypeCree='T_'+self.code - self.texteCata = debutTypeCata.format(self.nomDuTypeCree) + self.nomDuTypePyxb='T_'+self.code + self.texteCata = debutTypeCata.format(self.nomDuTypePyxb) for commande in self.commandes : commande.code=self.code commande.dumpXsd() @@ -160,9 +264,15 @@ class X_JDC_CATA : self.texteSimple += commande.texteComplexe self.texteCata += commande.texteElt self.texteCata += finTypeCata - self.texteElt=eltCata.format(self.code, self.nomDuTypeCree) - print (self.texteSimple) - print (self.texteComplexe) - print (self.texteCata) - print (self.texteElt) + self.texteElt=eltCata.format(self.code,self.code, self.nomDuTypePyxb) + + self.texteXSD = texteDebut.format(self.code,self.code,self.code) + self.texteXSD += self.texteSimple + self.texteXSD += self.texteCata + self.texteXSD += self.texteElt + self.texteXSD += texteFin + #print (self.texteSimple) + #print (self.texteCata) + #print (self.texteElt) + print (self.texteXSD) diff --git a/Efi2Xsd/MCAccasXsd.py b/Efi2Xsd/MCAccasXsd.py index 9ac25950..9026b70e 100755 --- a/Efi2Xsd/MCAccasXsd.py +++ b/Efi2Xsd/MCAccasXsd.py @@ -18,37 +18,43 @@ class X_MCSIMP: # ------------- def buildObjPyxb(self) : + # self.valeur tient compte de la valeur par defaut + # utiliser getValeur ? expression numpy if not self.cata.modeleMetier : return - #print ('X_MCSIMP buildObjPyxb', self.nom, self) - self.monNomDeClasseModeleMetier='T_'+self.nom - self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomDeClasseModeleMetier) + #print ('X_MCSIMP buildObjPyxb', self.nom, self,self.valeur) + self.monNomClasseModeleMetier='T_'+self.nom + self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier) #print (self.maClasseModeleMetier) - #print (self.val) - if self.val != None : self.objPyxb=self.maClasseModeleMetier(self.val) - else : self.objPyxb=self.maClasseModeleMetier() + #print (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() #print ('fin X_MCSIMP', self.objPyxb, self.nom,self) def setValeurObjPyxb(self,newVal): + print ('dans setValeurObjPyxb') if not self.cata.modeleMetier : return + try : + print (self.nom , ' a pour pere', self.perePyxb, self.perePyxb.nom) + except : + print ("je sors du setValeur") + return if newVal != None : nvlObj=self.maClasseModeleMetier(newVal) else : nvlObj=self.maClasseModeleMetier() self.val=newVal indexOC=0 - print ('avant', self.perePyxb.objPyxb.orderedContent()) + print ('avant',self.nom, self.perePyxb.objPyxb.orderedContent()) for i in self.perePyxb.objPyxb.orderedContent(): if id(i._Content__value) == id(self.objPyxb) : break indexOC +=1 maSequence = getattr(self.perePyxb.objPyxb, self.nom) if isinstance(maSequence, pyxb.binding.basis.simpleTypeDefinition): - print indexOC #maSequence=nvlObj setattr(self.perePyxb.objPyxb, self.nom, nvlObj) - print ('milieu',self.perePyxb.objPyxb.orderedContent()) self.perePyxb.objPyxb.orderedContent()[indexOC]=self.perePyxb.objPyxb.orderedContent()[-1] del(self.perePyxb.objPyxb.orderedContent()[-1]) - print ('apres',self.perePyxb.objPyxb.orderedContent()) else : index=0 for i in maSequence: @@ -84,6 +90,8 @@ class X_MCSIMP: #print (self.perePyxb.objPyxb.orderedContent()) #print (monBinding) + def deletePyxbObject(self): + print ('je passe par la', self, self.nom) class X_MCCOMPO: @@ -93,37 +101,90 @@ class X_MCCOMPO: if not self.cata.modeleMetier : return #print ('_______________________________________') #print ('X_MCCOMPO buildObjPyxb', self.nom, self, mc_list) - self.monNomDeClasseModeleMetier='T_'+self.nom - self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomDeClasseModeleMetier) + self.monNomClasseModeleMetier='T_'+self.nom + self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier) listArg=[] for objAccas in mc_list : - listArg.append(objAccas.objPyxb) - objAccas.perePyxb=self + # on remonte les mots-clefs des blocs + #print (type (objAccas)) + if type (objAccas.objPyxb) == list : + for fils in objAccas.objPyxb : + listArg.append(fils.objPyxb) + fils.perePyxb=self + print (fils.nom ,' a pour pere Pyxb', self, self.nom) + else : + listArg.append(objAccas.objPyxb) + objAccas.perePyxb=self + print (objAccas.nom ,' a pour pere Pyxb', self, self.nom) #print ( objAccas.nom, ' a pour perepyxb ' , objAccas.perePyxb.nom) self.objPyxb=self.maClasseModeleMetier(*listArg) #print ('Fin ', self.nom, self.objPyxb) #print ('_______________________________________') + + def deletePyxbObject(self): + print ('******************************************') + print ('je passe par la', self, self.nom) + print (self.perePyxb) + print (dir(self)) + print ('******************************************') + + + + +class X_MCBLOC (X_MCCOMPO): +# -------------------------- + def buildObjPyxb(self,mc_list): + if not self.cata.modeleMetier : return + self.perePyxb=None + #print ('_______________________________________') + print ('X_MCBLOC buildObjPyxb', self.nom, self, mc_list) + import traceback + #traceback.print_stack() + # il faut attacher les objets au pere + self.objPyxb=[] + for objAccas in mc_list : + self.objPyxb.append(objAccas) + #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_MCFACT', self.nom, self) - self.monNomDeClasseModeleMetier='T_'+self.nom - self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomDeClasseModeleMetier) + #print ('X_MCLIST buildObjPyxb traite ds X_MCLIST', self.nom, self) + if not self.cata.modeleMetier : return + self.monNomClasseModeleMetier='T_'+self.nom + self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier) listArg=[] # MCList est une liste for nbDeSequence in self : for objAccas in nbDeSequence.mc_liste : - listArg.append(objAccas.objPyxb) - objAccas.perePyxb=self + #print (type (objAccas)) + #print (objAccas.nom, objAccas.objPyxb, type(objAccas.objPyxb)) + #print ( type (objAccas.objPyxb) == list ) + if type (objAccas.objPyxb) == list : + #print ('ds le if') + for fils in objAccas.objPyxb : + listArg.append(fils.objPyxb) + fils.perePyxb=self + print (fils.nom ,' a pour pere Pyxb', self, self.nom) + else : + listArg.append(objAccas.objPyxb) + objAccas.perePyxb=self + print (objAccas.nom ,' a pour pere Pyxb', self, self.nom) + #listArg.append(objAccas.objPyxb) + #objAccas.perePyxb=self #print ( objAccas.nom, ' a pour perepyxb ' , objAccas.perePyxb.nom) + + #print ('X_MCLIST', self.nom, self, listArg) self.objPyxb=self.maClasseModeleMetier(*listArg) - #print ('X_MCFACT', self.nom, self, listArg) - #print ('fin buildObjPyxb traite ds X_MCFACT', self.nom, self) - #print ('_______________________________________') + print ('fin buildObjPyxb traite ds X_MCLIST', self.nom, self, self.objPyxb) + print ('_______________________________________') class X_MCFACT (X_MCCOMPO): # ------------------------- @@ -136,15 +197,16 @@ class X_MCFACT (X_MCCOMPO): pass -class X_JDC: -# ---------- +class X_JDC (X_MCCOMPO): +# --------------------- def __init__(self): #print ('_______________________________________') #print ('X_JDC buildObjPyxb', self) + self.source=None if not self.cata.modeleMetier : return - self.monNomDeClasseModeleMetier=self.code - self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomDeClasseModeleMetier) + 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) @@ -153,8 +215,9 @@ class X_JDC: def enregistreEtapePyxb(self,etape): # OK seulement si sequence (choice ? ...) - #print ('ds enregistreEtapePyxb', etape.nom) + print ('ds enregistreEtapePyxb', etape.nom) if not self.cata.modeleMetier : return + if self.source== "xml" : return self.objPyxb.append(etape.objPyxb) etape.perePyxb = self #self.toXml() @@ -164,7 +227,74 @@ class X_JDC: print(self.objPyxb.toDOM().toprettyxml()) print(self.objPyxb.toxml()) + + def analyseFromXML(self): + print ("je suis la") + if self.procedure == "" : return + self.source='xml' + self.objPyxb=self.cata.modeleMetier.CreateFromDocument(self.procedure) + for objEtape in self.objPyxb.content(): + print ('analyse de ', objEtape) + dictArgs= (self.pyxbToDict(objEtape)) + #objEtape.monNomClasseAccas=objEtape.monNomClasseModeleMetier[2:-2] + #maClasseAccas=getattr(self.cata,objEtape.monNomClasseAccas) + print ( '________________') + print (objEtape.dictArgs) + print ( '________________') + #objAccasEtape=maClasseAccas(**(objEtape.dictArgs)) + self.source='None' + + def pyxbToDict(self,objAAnalyser): + if objAAnalyser is None: return + dictArgs = {} + if isinstance(objAAnalyser, pyxb.binding.basis.simpleTypeDefinition): + if isinstance(objAAnalyser, types.StringTypes): return pyxb.utils.utility.QuotedEscaped(objAAnalyser,) + if isinstance(objAAnalyser, (types.NoneType, types.BooleanType, types.FloatType, types.IntType, types.LongType)): + return repr(objAAnalyser) + #pour une enum getattr(value dans le type) + # return pythonLiteral(ReferenceFacet(facet=value, **kw)) + return objAAnalyser + for expandedName, elementDeclaration in objAAnalyser._ElementMap.items(): + objPyxbName = expandedName.localName() + objPyxbValue = getattr(objAAnalyser, objPyxbName) + print (objPyxbName,objPyxbValue) + if objPyxbValue == None or objPyxbValue == [] : continue + if elementDeclaration.isPlural(): + dictArgs[objPyxbName] = [] + for objPyxb in objPyxbValue : dictArgs[objPyxbName].append(self.pyxbToDict(objPyxb)) + else: + dictArgs[objPyxbName] = self.pyxbToDict(getattr(objAAnalyser, objPyxbName)) + print ("***********************************") + print (objAAnalyser) + print (dictArgs) + for i in dictArgs.keys(): print (i, " ", dictArgs[i], " ", type(dictArgs[i])) + print ("***********************************") + return dictArgs + +# def analyseContent(self,objAAnalyser): +# objAAnalyser.dictArgs={} +# for objContenu in objAAnalyser.content(): +# #print ('j analyse ', objContenu) +# objContenu.monNomClasseModeleMetier=str(objContenu.__class__).split('.')[-1] +# objContenu.monNomClasseAccas=objContenu.monNomClasseModeleMetier[2:-2] +# #maClasseAccas=classeAccasPere.entites[objContenu.monNomClasseAccas] +# if objContenu._IsSimpleTypeContent(): +# print (objContenu.monNomClasseAccas,objContenu.pythonLiteral()) +# print (objContenu.monNomClasseAccas,objContenu.xsdLiteral()) +# #chaine=objContenu.pythonLiteral().split('(')[1].split(')')[0] +# print (dir(objContenu)) +# objAAnalyser.dictArgs[objContenu.monNomClasseAccas]=None +# #objAAnalyser.dictArgs[objContenu.monNomClasseAccas]=objContenu.pythonLiteral() +# 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 ( '________________') + + if __name__ == "__main__": print ('a faire') diff --git a/Efi2Xsd/balises.py b/Efi2Xsd/balises.py index c0eee995..4f2a4636 100644 --- a/Efi2Xsd/balises.py +++ b/Efi2Xsd/balises.py @@ -1,13 +1,29 @@ +texteDebut='\n' +texteFin='' + +# SIMP typeSimple = '\t\n\t\t\n\t\n' +debutTypeSimpleWithInto = '\t\n\t\t\n' +typeSimpleWithInto = '\t\t\t\n' +finTypeSimpleWithInto = '\t\t\n\t\n' eltDsSequence = '\t\t\t\n' -debutTypeComplexe = '\t\n\t\t\n' -finTypeComplexe = '\t\t\n\t\n' +# COMPO +debutTypeCompo = '\t\n\t\t\n' +finTypeCompo = '\t\t\n\t\n' +eltCompoDsSequence = '\t\t\t\n' +eltCompoDsSequenceSiProc = '\t\t\t\n' + +# BLOC +debutTypeSubst = '\t \n\t\t\n' +finTypeSubst = '\t\t\n\t\n' +substDsSequence = '\t\t\t\n' + +# CATA debutTypeCata = '\t\n\t\t\n' finTypeCata = '\t\t\n\t ' - -eltCata = '\n' +eltCata = '\t\n' if __name__ == '__main__' : diff --git a/Efi2Xsd/mapDesTypes.py b/Efi2Xsd/mapDesTypes.py index fcd797f8..d90cbc12 100755 --- a/Efi2Xsd/mapDesTypes.py +++ b/Efi2Xsd/mapDesTypes.py @@ -89,7 +89,7 @@ dictOPEREficasXML = dictPROCEficasXML dictOPERXMLEficas = dictPROCXMLEficas dictPourCast = { 'I' : int, 'R' : float, 'bool' : bool , } -dictNomsDesTypes = { 'I' : 'int', 'R' : 'float', bool : 'bool' , 'TXM' : 'string', 'Fichier' : 'string' } +dictNomsDesTypes = { 'I' : 'int', 'R' : 'float', bool : 'boolean' , 'TXM' : 'string', 'Fichier' : 'string', 'Repertoire':'string', 'FichierNoAbs' : 'string', 'FichierOuRepertoire':'string' } listeParamDeTypeTypeAttendu = ( 'defaut', 'sug', 'val_min', 'val_max', 'into', 'intoSug') listeParamDeTypeStr = ('fr', 'docu', 'ang', 'nom' ) diff --git a/Efi2Xsd/readerEfiXsd.py b/Efi2Xsd/readerEfiXsd.py old mode 100644 new mode 100755 index 82883038..c98a16cd --- a/Efi2Xsd/readerEfiXsd.py +++ b/Efi2Xsd/readerEfiXsd.py @@ -94,6 +94,8 @@ class monSIMP (efficas.T_SIMP, objetDefinitionAccas): #print ("je passe dans explore pour SIMP ", self.nom) self.dictATraiter= dictSIMPXMLEficas self.argumentXMLToEficas() + #print (self.dictArgsEficas) + self.objAccas=A_SIMP.SIMP(**self.dictArgsEficas) self.objAccas.nom=self.nomObj @@ -109,7 +111,6 @@ class monSIMP (efficas.T_SIMP, objetDefinitionAccas): self.traiteLesSequences() - print (self.dictArgsEficas) #self.convertitLesTypes() def attendListe(self): @@ -136,8 +137,15 @@ class monSIMP (efficas.T_SIMP, objetDefinitionAccas): for param in listeParamTjsSequence : if param in self.dictArgsEficas : if listeDeListe == False: - listeDElt=self.dictArgsEficas[param][0].content() + #print ('________________________________') + listeDElt=[] + for i in range(len(self.dictArgsEficas[param])): + # ou typesimple ? + # ici on ne sait pas si on est un type simple ou complexe ? + listeDElt.append(self.dictArgsEficas[param][i].content()[0]) listeRetour=self.convertitListeDsLeBonType(listeDElt) + #print (listeRetour) + #print ('________________________________') self.dictArgsEficas[param]=listeRetour else : listeResultat=[] @@ -268,8 +276,10 @@ class monBLOC(efficas.T_BLOC, objetComposeDefinitionAccas): class monCata(efficas.T_cata): # ------------------------------ def exploreCata(self): + # PNPNPN --> il faut revoir ce mecanisme + self.modeleMetier = None # On positionne le contexte ACCAS - self.JdC = JDC_CATA (code = 'MED', execmodul = None,) + self.JdC = JDC_CATA (code = 'Atmo', execmodul = None,) self.contexteXML={} objAExplorer=self.commandes[0] for obj in objAExplorer.content(): -- 2.39.2