1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2013 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 self.appliEficas.format_fichier='python'
50 self.appliEficas.format_fichier_in ='xml'
51 self.modeNouvCommande=self.appliEficas.maConfiguration.modeNouvCommande
52 self.versionCode=self.appliEficas.versionCode
53 self.version_cata=None
57 self.titre='Eficas XML'
58 self.Ordre_Des_Commandes=None
59 self.Classement_Commandes_Ds_Arbre=()
60 self.demandeCatalogue=False
63 #self.creeDicoInverse()
68 #self.fic_cata = 'Cata_MED_FAM.xml'
69 #xml = open('/home/A96028/QT5GitEficasTravail/eficas/Med/Cata_MED_FAM.xml').read()
70 #xml = open('/home/A96028/QT5GitEficasTravail/eficas/CataTestXSD/cata_test1.xml').read()
72 xml=open(self.fic_cata).read()
73 SchemaMed = readerEfiXsd.efficas.CreateFromDocument(xml)
74 SchemaMed.exploreCata()
76 uiinfo.traite_UIinfo(self.cata)
77 self.Commandes_Ordre_Catalogue=[]
78 self.cata_ordonne_dico,self.appliEficas.liste_simp_reel=autre_analyse_cata.analyseCatalogue(self.cata)
79 self.liste_groupes=None