1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2021 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 Ce module sert a lire un catalogue et a construire
22 un objet CataItem pour Eficas.
23 Il s'appuie sur la classe READERCATA
27 import autre_analyse_cata
32 from monChoixCata import MonChoixCata
33 from Extensions.i18n import tr
34 from Extensions.eficas_exception import EficasException
36 from Efi2Xsd import readerEfiXsd
37 # ATtention pas teste depuis le chgt de nom
39 from readercata import ReaderCataCommun
41 class ReaderCata (ReaderCataCommun):
43 def __init__(self,QWParent, appliEficas):
44 self.QWParent=QWParent
45 self.appliEficas=appliEficas
46 self.VERSION_EFICAS=self.appliEficas.VERSION_EFICAS
47 self.code=self.appliEficas.code
48 self.ssCode=self.appliEficas.ssCode
49 # PN ?? bizarre le 22/04/20
50 self.appliEficas.formatfichierOut='python'
51 self.appliEficas.formatfichierIn ='xml'
52 self.modeNouvCommande=self.appliEficas.maConfiguration.modeNouvCommande
53 self.labelCode=self.appliEficas.labelCode
54 self.version_cata=None
58 self.titre='Eficas XML'
59 self.Ordre_Des_Commandes=None
60 self.Classement_Commandes_Ds_Arbre=()
61 self.demandeCatalogue=False
64 #self.creeDicoInverse()
69 #self.ficCata = 'Cata_MED_FAM.xml'
70 #xml = open('/home/A96028/QT5GitEficasTravail/eficas/Med/Cata_MED_FAM.xml').read()
71 #xml = open('/home/A96028/QT5GitEficasTravail/eficas/CataTestXSD/cata_test1.xml').read()
73 xml=open(self.ficCata).read()
74 SchemaMed = readerEfiXsd.efficas.CreateFromDocument(xml)
75 SchemaMed.exploreCata()
77 uiinfo.traite_UIinfo(self.cata)
78 self.Commandes_Ordre_Catalogue=[]
79 self.cata_ordonne_dico,self.appliEficas.liste_simp_reel=autre_analyse_cata.analyseCatalogue(self.cata)
80 self.liste_groupes=None