From 0d9c0c19a86657a1d99dfc208e6952b607a816d8 Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Tue, 13 Apr 2021 13:58:03 +0200 Subject: [PATCH] ajout doc dans XSD --- Accas/A_JDC_CATA.py | 2 -- Efi2Xsd/AccasXsd.py | 50 +++++++++++++++++++++++++++++-------------- Efi2Xsd/balisesXSD.py | 22 +++++++++++-------- Noyau/N_JDC_CATA.py | 4 +++- 4 files changed, 50 insertions(+), 28 deletions(-) diff --git a/Accas/A_JDC_CATA.py b/Accas/A_JDC_CATA.py index 8b492daa..00e8cd48 100644 --- a/Accas/A_JDC_CATA.py +++ b/Accas/A_JDC_CATA.py @@ -26,7 +26,5 @@ from Efi2Xsd.AccasXsd import X_JDC_CATA class JDC_CATA(I_JDC_CATA.JDC_CATA,N_JDC_CATA.JDC_CATA,X_JDC_CATA): class_instance=A_JDC.JDC def __init__(self,*pos,**kw): - #print pos - #print kw N_JDC_CATA.JDC_CATA.__init__(self,*pos,**kw) I_JDC_CATA.JDC_CATA.__init__(self) diff --git a/Efi2Xsd/AccasXsd.py b/Efi2Xsd/AccasXsd.py index 371b10a4..e230c270 100755 --- a/Efi2Xsd/AccasXsd.py +++ b/Efi2Xsd/AccasXsd.py @@ -537,9 +537,11 @@ class X_definitionComposee (X_definition): else : self.texteComplexe = "" - self.texteElt=eltCompoDsSequence.format(self.nom,self.nomDuCodeDumpe,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs) - #print (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): # ______________________ @@ -830,24 +832,33 @@ class X_SIMP (X_definition): 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 + if self.max > 1 or self.max == '**' or self.max == float('inf') : txtDefaut="" + if not('TXM' in (self.type)) : separe = ' ' + else : separe ='\n' for val in self.defaut : - #val2=val.replace(' ','\\u0020') - txtDefaut+=str(val) + " " + txtDefaut+=str(val) + separe txtDefaut+=txtDefaut[0:-1] - self.texteElt = eltWithDefautDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut) + if not('TXM' in (self.type)) : + # a revoir pour les tuples avec defaut + if self.ang != '' : self.texteElt = eltDsSequenceWithDefautAndHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.ang) + elif self.fr != '' : self.texteElt = eltDsSequenceWithDefautAndHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.fr) + else : self.texteElt = eltDsSequenceWithDefaut.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut) + else : + if self.ang != '' : texteAide = self.ang + else : texteAide = self.fr + texteAide :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 self.ang != '' : self.texteElt = eltWithDefautAndHelpDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.ang) - elif self.fr != '' : self.texteElt = eltWithDefautAndHelpDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.fr) - else : self.texteElt = eltWithDefautDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut) + if self.ang != '' : self.texteElt = eltDsSequenceWithDefautAndHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.ang) + elif self.fr != '' : self.texteElt = eltDsSequenceWithDefautAndHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.fr) + else : self.texteElt = eltDsSequenceWithDefaut.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut) else : - if self.ang != '' : self.texteElt = eltWithHelpDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.ang) - elif self.fr != '' : self.texteElt = eltWithHelpDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.fr) + if self.ang != '' : self.texteElt = eltDsSequenceWithHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.ang) + elif self.fr != '' : self.texteElt = eltDsSequenceWithHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.fr) else : self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.ang) elif first: # PNPN --> Que faire de l'aide ? @@ -1029,10 +1040,16 @@ class X_JDC_CATA : if self.implement == self.code : self.texteCata += eltAbstraitCataPPal.format(self.code) - self.texteCata += eltCataPPal.format(self.code,self.code,self.code) + #if self.ang != '' : self.texteCataWithHelp += eltCataPPal.format(self.code,self.code,self.code, self.ang) + #elif self.fr != '' : self.texteCataWithHelp += eltCataPPal.format(self.code,self.code,self.code, self.fr) + 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) + #if self.ang != '' : self.texteCata += eltCataFilsWithHelp.format(self.implement,self.nomDuXsdPere,self.nomDuXsdPere,self.nomDuXsdPere) + #elif self.fr != '' : self.texteCata += eltCataFilsWithHelp.format(self.implement,self.nomDuXsdPere,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) @@ -1218,6 +1235,7 @@ class X_JDC_CATA : 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 diff --git a/Efi2Xsd/balisesXSD.py b/Efi2Xsd/balisesXSD.py index 3b3aeaea..f2ea09e3 100644 --- a/Efi2Xsd/balisesXSD.py +++ b/Efi2Xsd/balisesXSD.py @@ -17,14 +17,14 @@ 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' -eltWithHelpDsSequence = '\t\t\t\n\t\t\t\t\n\t\t\t\t\t{}\n\t\t\t\t\n\t\t\t\n' -eltWithDefautAndHelpDsSequence = '\t\t\t\n\t\t\t\t\n\t\t\t\t\t{}\n\t\t\t\t\n\t\t\t\n' -eltWithDefautDsSequence = '\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' +eltDsSequenceWithHelp = '\t\t\t\n\t\t\t\t\n\t\t\t\t\t{}\n\t\t\t\t\n\t\t\t\n' +eltDsSequenceWithDefautAndHelp = '\t\t\t\n\t\t\t\t\n\t\t\t\t\t{}\n\t\t\t\t\n\t\t\t\n' +eltDsSequenceWithDefaut = '\t\t\t\n' UsingASSDkeyRefDeclaration = '\n\t \n\t\t\n\t\t\n\t\n' # # @@ -45,12 +45,13 @@ debutTypeCompoSeq = '\t\t\n' finTypeCompoSeq = '\t\t\n' finTypeCompo = '\t\n' eltCompoDsSequence = '\t\t\t\n' -eltCompoWithHelpDsSequence = '\t\t\t\n' +eltCompoDsSequenceWithHelp = '\t\t\t\n' #name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}">\n\t\t\t\t\n\t\t\t\t\t{}\n\t\t\t\t\n\t\t\t\n' #eltCompoDsSequenceInExtension = '\t\t\t\n' # ETAPE eltEtape = '\t\n' +eltEtapeWithHelp = '\t\n\t\t\t\t\n\t\t\t\t\t{}\n\t\t\t\t\n\t\t\t\n' # BLOC debutTypeSubst = '\t \n\t\t\n' @@ -98,7 +99,10 @@ finExtension = '\t\t\n\t\t\n\t\t eltAbstraitCataPPal = '\t\n' eltAbstraitCataFils = '\t\n\t\t\n\t\t\t\n\t\t\n\t\n' eltCataPPal = '\t\n' +eltCataPPalWithHelp = '\t\n\t\t\t\t\n\t\t\t\t\t{}\n\t\t\t\t\n\t\t\t\n' eltCataFils = '\t\n' +eltCataFilsWithHelp = '\t\n\t\t\t\t\n\t\t\t\t\t{}\n\t\t\t\t\n\t\t\t\n' + eltCata = '\t\n\t\t\n\t\t \n\t\t\t\n\t\t \n\t\t\n' #\n\t\n' diff --git a/Noyau/N_JDC_CATA.py b/Noyau/N_JDC_CATA.py index f5d3a973..53f3ae5b 100644 --- a/Noyau/N_JDC_CATA.py +++ b/Noyau/N_JDC_CATA.py @@ -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 -- 2.39.2