From: pascale.noyret Date: Tue, 13 Nov 2018 18:05:34 +0000 (+0100) Subject: dump sans les types X-Git-Tag: avantMenage~65 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d1745a87cc089c21fe675c2bc1187f59e745825e;p=tools%2Feficas.git dump sans les types --- diff --git a/Efi2Xsd/AccasXsd.py b/Efi2Xsd/AccasXsd.py index 6905e17f..db61521f 100755 --- a/Efi2Xsd/AccasXsd.py +++ b/Efi2Xsd/AccasXsd.py @@ -200,23 +200,42 @@ class X_SIMP (X_definition): else : minOccurs = 1 # le defaut est dans l elt Name -> tester la coherence d existence avec Accas # regles Accas - self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1) + 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(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut) + else : + self.texteElt = eltWithDefautDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.defaut) + + else : self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1) # self.aCreer est mis a jour ds definitNomDuTypePyxb if not self.aCreer : return - self.texteSimple += debTypeSimpleNom.format(self.nomDuTypePyxb) - if self.max > 1 or self.max == '**' or self.max == float('inf') : self.texteSimple += debTypeSimpleListe - self.texteSimple += debTypeSimpleType.format(self.nomDuTypeDeBase) - if self.into != None: - for val in self.into : self.texteSimple += typeSimpleWithInto.format(val) - if self.val_min != float('-inf') : self.texteSimple += minBorneTypeSimple.format(self.val_min) - if self.val_max != float('inf') : self.texteSimple += maxBorneTypeSimple.format(self.val_max) - if self.max !=1 and self.max != '**' and self.val_max != float('inf') : self.texteSimple += maxLengthTypeSimple.format(self.max) - if self.min !=1 and self.val_min != float('-inf') : self.texteSimple += minLengthTypeSimple.format(self.min) - self.texteSimple += finTypeSimpleType - if self.max > 1 or self.max == '**' or self.max == float('inf'): self.texteSimple += finTypeSimpleListe - self.texteSimple += finTypeSimpleNom + self.texteSimple += debutSimpleType.format(self.nomDuTypePyxb) + # On est dans une liste + if self.max > 1 or self.max == '**' or self.max == float('inf') : + 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: + for val in self.into : self.texteSimple += "\t\t\t\t"+enumeration.format(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: + for val in self.into : self.texteSimple += enumeration.format(val) + self.texteSimple += fermeRestrictionBase + self.texteSimple += fermeSimpleType #if self.max > 1 : self.isListe=True @@ -241,7 +260,7 @@ class X_SIMP (X_definition): # il faut ajouter les regles # il faut gerer les types tuple et fichier - if hasattr(self.type[0], 'label') and self.type[0].label == "Tuple" : return ('XXXXXXXX') + if hasattr(self.type[0], 'ntuple') : return ('XXXXXXXX') #print (self.type[0]) return dictNomsDesTypes[self.type[0]] diff --git a/Efi2Xsd/balises.py b/Efi2Xsd/balises.py index 53ea6d2d..74896ac7 100644 --- a/Efi2Xsd/balises.py +++ b/Efi2Xsd/balises.py @@ -5,18 +5,22 @@ fermeBalise = "/>" # SIMP -debTypeSimpleNom = '\t\n' -finTypeSimpleNom = '\t\n' -debTypeSimpleListe = '\t\t\n' -finTypeSimpleListe = '\t\t\n' -debTypeSimpleType = '\t\t\n' -finTypeSimpleType = '\t\t\n' -maxLengthTypeSimple = '\t\t\t\n' -minLengthTypeSimple = '\t\t\t\n' -maxBorneTypeSimple = '\t\t\t\n' -minBorneTypeSimple = '\t\t\t\n' -typeSimpleWithInto = '\t\t\t\n' +debutSimpleType = '\t\n' +fermeSimpleType = '\t\n' +debutRestrictionBase = '\t\t\n' +fermeRestrictionBase = '\t\t\n' +enumeration = '\t\t\t\n' +maxInclusiveBorne = '\t\t\t\n' +minInclusiveBorne = '\t\t\t\n' + +debutTypeSimpleListe = '\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n' +finTypeSimpleListe = '\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n' +fermeBalisesMileu = '\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t \n' + +maxLengthTypeSimple = '\t\t\t\n' +minLengthTypeSimple = '\t\t\t\n' eltDsSequence = '\t\t\t\n' +eltWithDefautDsSequence = '\t\t\t\n' # COMPO #debutTypeCompo = '\t\n\t\t\n' @@ -94,7 +98,3 @@ if __name__ == '__main__' : eltRacine=eltCata.format(nomDuCode, 'T_'+nomDuCode) print (texteSimple+texteComplexe+texteCata+eltRacine) -#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'