obj=self
while ( not hasattr(obj,'nomDuCodeDumpe') ): obj=obj.pere
self.nomDuCodeDumpe = obj.nomDuCodeDumpe
-
+ self.code=obj.code
+
#def genealogie(self,n):
# texte=self.nom
# obj=self
else :
self.texteComplexe = ""
- self.texteElt=eltCompoDsSequence.format(self.nom,self.nomDuCodeDumpe,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs)
+ self.texteElt=eltCompoDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs)
#print (self.texteComplexe)
#print ('------------------------------------------------')
else :
self.texteComplexe = ""
- self.texteElt=substDsSequence.format(self.nomDuCodeDumpe,self.nomDuTypePyxb,0,1)
+ self.texteElt=substDsSequence.format(self.code,self.nomDuTypePyxb,0,1)
#print ('------------------------------------------------')
# a revoir pour les tuples avec defaut
txtDefaut=""
for val in self.defaut : txtDefaut+=str(val) +" "
- self.texteElt = eltWithDefautDsSequence.format(nomUtil,self.nomDuCodeDumpe,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
+ 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.nomDuCodeDumpe,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
+ self.texteElt = eltWithDefautDsSequence.format(nomUtil,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
- else : self.texteElt = eltDsSequence.format(nomUtil,self.nomDuCodeDumpe,self.nomDuTypePyxb,minOccurs,1)
+ else : self.texteElt = eltDsSequence.format(nomUtil,self.code,self.nomDuTypePyxb,minOccurs,1)
# self.aCreer est mis a jour ds definitNomDuTypePyxb
if not self.aCreer : return
self.texteElt = ""
if self.implement == "" :
- self.nomDuCodeDumpe=self.labelCode
+ self.nomDuCodeDumpe=self.code
self.texteCata += debutTypeCata.format(self.nomDuCodeDumpe)
else :
+ self.implement,self.nomDuXsdInclus=self.implement.split(':')
self.nomDuCodeDumpe = self.implement
self.texteCata += debutTypeCataExtension.format(self.nomDuCodeDumpe)
self.texteCata += debutExtension.format(self.code,self.nomDuCodeDumpe)
- self.texteInclusion += includeCata.format(self.code)
+ self.texteInclusion += includeCata.format(self.nomDuXsdInclus)
self.nomDuTypePyxb = 'T_'+self.nomDuCodeDumpe
self.dumpLesCommandes()
- #self.texteSimple += TypeEtEltAbstraitCodeSpec.format(self.nomDuCodeDumpe)
-
self.texteTypeAbstrait=''
for codeHeritant in self.importedBy:
self.texteCata += EltCodeSpecDsCata.format(codeHeritant)
- self.texteTypeAbstrait += eltAbstrait.format(codeHeritant,codeHeritant,codeHeritant,codeHeritant)
+ self.texteTypeAbstrait += eltAbstrait.format(codeHeritant,codeHeritant,self.code,codeHeritant)
if self.implement != "" : self.texteCata = self.texteCata + finExtension + finTypeCompo
else : self.texteCata += finTypeCata
- self.texteElt = eltCata.format(self.nomDuCodeDumpe,self.nomDuCodeDumpe, self.nomDuTypePyxb)
+ self.texteElt = eltCata.format(self.nomDuCodeDumpe,self.code, self.nomDuTypePyxb)
self.texteXSD = texteDebut.format(self.code,self.code,self.code,self.code)
if self.texteInclusion != "" : self.texteXSD += self.texteInclusion
for c in allClassToDump :
if not(isinstance(c, Accas.OPER)) and not(isinstance(c, Accas.PROC)) : continue
c.nomDuCodeDumpe=self.nomDuCodeDumpe
+ c.code=self.code
c.dumpXsd()
self.texteSimple += c.texteSimple
self.texteComplexe += c.texteComplexe
- c.texteElt=eltCompoDsSequenceInExtension.format(c.nom,self.nomDuCodeDumpe,c.nomDuTypePyxb)
+ c.texteElt=eltCompoDsSequenceInExtension.format(c.nom,self.code,c.nomDuTypePyxb)
self.texteCata += c.texteElt
finTypeCata = '\t\t</xs:choice>\n\t</xs:complexType>\n'
finSchema = '</xs:schema>'
eltCata = '\t<xs:element name="{}" type="{}:{}"/>\n'
-TypeEtEltAbstraitCodeSpec = '\t<xs:complexType name="T_{}_Specific" abstract="true"/>\n\t<xs:element name="{}_Specific" type="{}:T_{}_Specific"/>\n'
-EltCodeSpecDsCata='\t\t\t<xs:element ref="{}:Code_Specific" minOccurs="0" maxOccurs="1"/>\n'
+EltCodeSpecDsCata='\t\t\t<xs:element ref="{}_Abstract" minOccurs="0" maxOccurs="1"/>\n'
includeCata = '<xs:include schemaLocation="cata_{}_genere.xsd" />\n\n'
# EXTENSION
-debutExtension = '\t\t<xs:complexContent>\n\t\t<xs:extension base="{}:T_{}">\n\t\t<xs:choice minOccurs="0" maxOccurs="unbounded">\n'
+debutExtension = '\t\t<xs:complexContent>\n\t\t<xs:extension base="{}:T_{}_Abstract">\n\t\t<xs:choice minOccurs="0" maxOccurs="unbounded">\n'
finExtension = '\t\t</xs:choice>\n\t\t</xs:extension>\n\t\t</xs:complexContent>\n'
# TYPE ABSTRAIT
-eltAbstrait = '\t<xs:complexType name="T_{}" abstract="true"/>\n\t<xs:element name="{}" type="{}:T_{}"/>\n'
+eltAbstrait = '\t<xs:complexType name="T_{}_Abstract" abstract="true"/>\n\t<xs:element name="{}_Abstract" type="{}:T_{}_Abstract"/>\n'
if __name__ == '__main__' :
--- /dev/null
+SUFFIXES= .xsd
+
+PYXB=pyxbgen
+
+#$(PYXB) -m $(basename $@) -u $< --location-prefix-rewrite http://chercheurs.edf.com/logiciels/vimmp= --write-for-customization \
+# L'utilisation de $? ne fonctionne pas dans le cas de catalogues multiple.
+# En effet, si on modifie un seul catalogue, $? donne uniquement le fichier modifié et pyxb détecte
+# que notre génération dépend du fichier non modifié qui n'est pas passé en paramètre et qui n'est pas regénéré.
+# Une solution constiste à utiliser $^
+
+#xmllint ne semble pas vérifier les includes...
+
+.SUFFIXES: _genere.xsd _genere.py .py
+
+.py_genere.xsd:
+ python2 ./generateXSD.py -c ./$<
+
+_genere.xsd_genere.py:
+ xmllint --schema XMLSchema11_local.xsd --xinclude --noout $^
+ $(PYXB) -m $(basename $@) -u $^ --write-for-customization
+
+
+
+all: xsdAll driverAll
+
+xsdAll: xsdTestMutlipleCata
+driverAll: pyTestMutlipleCata
+
+xsdTestMutlipleCata: cata_CFD1_genere.xsd cata_CFD2_genere.xsd cata_CFDCommun_genere.xsd cata_MD1_genere.xsd cata_MD2_genere.xsd cata_MDCommun_genere.xsd cata_modeleCommun_genere.xsd
+
+pyTestMutlipleCata: cata_CFD1_genere.py cata_CFD2_genere.py cata_CFDCommun_genere.py cata_MD1_genere.py cata_MD2_genere.py cata_MDCommun_genere.py cata_modeleCommun_genere.py
+
+
+xml:
+ @echo "Reminder: a .comm file is needed for this step"
+ ./generateXML.py -c cata_1.py cata_1_test_1.comm
+
+clean:
+ rm -f *.pyc *~
+ rm -rf *_genere.py raw __pycache__
+ rm -f *_genere.xsd
+
+check:
+ xmllint --schema XMLSchema11.xsd cata_1_genere.xsd
+
--- /dev/null
+../XMLSchema11_local.xsd
\ No newline at end of file
--- /dev/null
+autonome = 0
+#autonome = 1
+
+if autonome :
+ from Accas import *
+ JdC = JDC_CATA (
+ code = 'CFD1',
+ )
+ importedBy=()
+else :
+ from cata_CFDCommun import *
+ implement='CFD1:CFDCommun'
+ importedBy=()
+
+Proc1DuCFD1=PROC(nom='Proc1DuCFD1',
+ S1DuCFD1= SIMP(statut='o', typ='I', defaut = 91),
+)
+Proc2DuCFD1=PROC(nom='Proc2DuCFD1',
+ S2DuCFD1= SIMP(statut='o', typ='I', defaut = 92),
+)
--- /dev/null
+autonome = 0
+autonome = 1
+
+if autonome :
+ from Accas import *
+ JdC = JDC_CATA (
+ code = 'CFD2',
+ )
+else :
+ from cata_CFDCommun import *
+ implement = 'CFD2:CFDCommun'
+ importedBy=()
+
+Proc1DuCFD2=PROC(nom='Proc1DuCFD2',
+ S1DuCFD2= SIMP(statut='o', typ='I', defaut = 91),
+)
+Proc2DuCFD2=PROC(nom='Proc2DuCFD2',
+ S2DuCFD2= SIMP(statut='o', typ='I', defaut = 92),
+)
--- /dev/null
+autonome = 0
+autonome = 1
+
+if autonome :
+ from Accas import *
+ JdC = JDC_CATA (
+ code = 'CFDCommun',
+ )
+ importedBy=('CFD1','CFD2','CFDSpecific')
+else :
+ from cata_modeleCommun import *
+ importedBy=('CFD1','CFD2','CFDSpecific')
+ implement='CFDCommun:modeleCommun'
+
+Proc1DuCFDCommun=PROC(nom='Proc1DuCFDCommun',
+ S1DuCFDCommun= SIMP(statut='o', typ='I', defaut = 91),
+)
+Proc2DuCFDCommun=PROC(nom='Proc2DuCFDCommun',
+ S2DuCFDCommun= SIMP(statut='o', typ='I', defaut = 92),
+)
--- /dev/null
+autonome = 0
+import traceback;traceback.print_stack()
+
+if autonome :
+ from Accas import *
+ JdC = JDC_CATA (
+ code = 'MD1',
+ )
+else :
+ from cata_MDCommun import *
+ implement='MD1:MDCommun'
+ importedBy=()
+
+Proc1DuMD1=PROC(nom='Proc1DuMD1',
+ S1DuMD1= SIMP(statut='o', typ='I', defaut = 111),
+)
+Proc2DuMD1=PROC(nom='Proc2DuMD1',
+ S2DuMD1= SIMP(statut='o', typ='I', defaut = 112),
+)
--- /dev/null
+autonome = 0
+autonome = 1
+
+
+if autonome :
+ from Accas import *
+ JdC = JDC_CATA (
+ code = 'MD2',
+ )
+else :
+ from cata_MDCommun import *
+ implement='MD2'
+ importedBy=()
+
+Proc1DuMD2=PROC(nom='Proc1DuMD2',
+ S1DuMD2= SIMP(statut='o', typ='I', defaut = 121),
+)
+Proc2DuMD2=PROC(nom='Proc2DuMD2',
+ S2DuMD1= SIMP(statut='o', typ='I', defaut = 122),
+)
--- /dev/null
+autonome = 0
+
+if autonome :
+ from Accas import *
+ JdC = JDC_CATA (
+ code = 'MDCommun',
+ )
+ importedBy=('MD1','MD2','MDSpecific')
+else :
+ from cata_modeleCommun import *
+ implement = 'MDCommun:modeleCommun'
+ importedBy=('MD1','MD2','MDSpecific')
+
+Proc1DuMDCommun=PROC(nom='Proc1DuMDCommun',
+ S1DuMDCommun= SIMP(statut='o', typ='I', defaut = 11),
+)
+Proc2DuMDCommun=PROC(nom='Proc2DuMDCommun',
+ S2DuMDCommun= SIMP(statut='o', typ='I', defaut = 12),
+)
--- /dev/null
+
+from Accas import *
+JdC = JDC_CATA (
+ code = 'modeleCommun',
+)
+importedBy=('MDCommun', 'CFDCommun', 'DomainSpecfic')
+
+Proc1DuModeleCommun=PROC(nom='Proc1DuModeleCommun',
+ S1DuModeleCommun= SIMP(statut='o', typ='I', defaut = 1),
+)
+Proc2DuModeleCommun=PROC(nom='Proc2DuModeleCommun',
+ S2DuModeleCommun= SIMP(statut='o', typ='I', defaut = 2),
+)
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2007-2013 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
+#
+"""
+ Ce module sert a lancer EFICAS configure pour Meteo
+"""
+# Modules Python
+# Modules Eficas
+import prefs
+name='prefs_'+prefs.code
+__import__(name)
+
+import sys
+import os
+sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../../..'))
+
+import prefs
+from InterfaceQT4 import eficas_go
+eficas_go.genereXSD(code=prefs.code)
--- /dev/null
+# Copyright (C) 2007-2012 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
+#
+code="TestMultipleCata"
+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__)))
--- /dev/null
+# -*- coding: utf-8 -*-
+# maConfiguration MANAGEMENT OF EDF VERSION
+# ======================================================================
+# COPYRIGHT (C) 1991 - 2002 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.
+#
+# 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.
+#
+#
+# ======================================================================
+
+import os,sys
+# repIni sert a localiser le fichier editeur.ini
+# Obligatoire
+repIni=os.path.dirname(os.path.abspath(__file__))
+INSTALLDIR=os.path.join(repIni,'..')
+sys.path[:0]=[INSTALLDIR]
+
+
+# lang indique la langue utilisee pour les chaines d'aide : fr ou ang
+lang='ang'
+
+# Codage des strings qui accepte les accents (en remplacement de 'ascii')
+encoding='iso-8859-1'
+
+#
+#typeDeCata='XML'
+catalogues=(
+# ('VimmpEssai','VimmpEssai',os.path.join(repIni,'cata_Vimmp_2304.py'),'python','python'),
+ ('Test1','Test1',os.path.join(repIni,'cata_1.py'),'xml','python'),
+# ('Vimmp','Vimmp',os.path.join(repIni,'cata_Vimmp.py'),'xml','python'),
+# ('MD','VimmpG',os.path.join(repIni,'cata_gromacs.py'),'xml','python'),
+# ('VimmpEN','VimmpEN',os.path.join(repIni,'cata_en.py'),'python','python'),
+)
+nombreDeBoutonParLigne=4
+#simpleClic=True
+closeFrameRechercheCommande=False
+closeFrameRechercheCommandeSurPageDesCommandes=True
+#boutonDsMenuBar=False
+#closeArbre=True
+#afficheListesPliees=False
+#afficheCommandesPliees = False
+afficheCommandesPliees=True
+enleverActionStructures = True
+enleverParametres = True
+enleverSupprimer = True
+#ajoutExecution = True
+#translatorFichier = os.path.join(repIni,'Meteo')
+#withXSD=True
+#dumpXSD=True
+#afficheIhm=False
--- /dev/null
+# -*- coding: utf-8 -*-
+# maConfiguration MANAGEMENT OF EDF VERSION
+# ======================================================================
+# COPYRIGHT (C) 1991 - 2002 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.
+#
+# 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.
+#
+#
+# ======================================================================
+
+import os,sys
+# repIni sert a localiser le fichier editeur.ini
+# Obligatoire
+repIni=os.path.dirname(os.path.abspath(__file__))
+INSTALLDIR=os.path.join(repIni,'..')
+sys.path[:0]=[INSTALLDIR]
+
+
+# lang indique la langue utilisee pour les chaines d'aide : fr ou ang
+lang='ang'
+
+# Codage des strings qui accepte les accents (en remplacement de 'ascii')
+encoding='iso-8859-1'
+
+#
+#typeDeCata='XML'
+catalogues=(
+ ('CFD1' ,'CFD1' ,os.path.join(repIni,'cata_CFD1.py') ,'xml','python'),
+ ('CFD2' ,'CFD2' ,os.path.join(repIni,'cata_CFD2.py') ,'xml','python'),
+ ('CFDCommun' ,'CFDCommun' ,os.path.join(repIni,'cata_CFDCommun.py') ,'xml','python'),
+ ('MD1' ,'MD1' ,os.path.join(repIni,'cata_MD1.py') ,'xml','python'),
+ ('MD2' ,'MD2' ,os.path.join(repIni,'cata_MD2.py') ,'xml','python'),
+ ('MDCommun' ,'MDCommun' ,os.path.join(repIni,'cata_MDCommun.py') ,'xml','python'),
+ ('modeleCommun','modeleCommun' ,os.path.join(repIni,'cata_modeleCommun.py'),'xml','python'),
+)
+
+nombreDeBoutonParLigne=4
+#simpleClic=True
+closeFrameRechercheCommande=False
+closeFrameRechercheCommandeSurPageDesCommandes=True
+#boutonDsMenuBar=False
+#closeArbre=True
+#afficheListesPliees=False
+#afficheCommandesPliees = False
+afficheCommandesPliees=True
+enleverActionStructures = True
+enleverParametres = True
+enleverSupprimer = True
+#ajoutExecution = True
+#translatorFichier = os.path.join(repIni,'Meteo')
+#withXSD=True
+#dumpXSD=True
+#afficheIhm=False
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2007-2013 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
+#
+"""
+ Ce module sert a lancer EFICAS configure pour TEST
+"""
+# Modules Python
+# Modules Eficas
+import prefs
+name='prefs_'+prefs.code
+__import__(name)
+
+import sys
+import os
+sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../../..'))
+
+import prefs
+from InterfaceQT4 import eficas_go
+eficas_go.lanceEficas(code=prefs.code)
--- /dev/null
+../xml.xsd
\ No newline at end of file