Salome HOME
commentaire
[tools/eficas.git] / Editeur / chercheBlocInto.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 # Copyright (C) 2007-2013   EDF R&D
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18 #
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #
21
22 import sys,os
23 sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..'))
24 sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../InterfaceQT4'))
25 sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../UiQT4'))
26 from Extensions.i18n import tr
27 from string import split,strip,lowercase,uppercase
28 import re,string
29 import Accas
30
31
32 class ChercheInto:
33         def __init__(self,cata,cataName):
34                 self.cata=cata
35                 self.dictInto={}
36                 mesCommandes=self.cata.JdC.commandes
37                 for maCommande in mesCommandes:
38                     self.construitListeInto(maCommande)
39
40
41         def construitListeInto(self,e):
42             if isinstance(e,Accas.A_BLOC.BLOC) :
43                print (e.condition)
44             for nomFils, fils in e.entites.items():
45                 self.construitListeInto(fils)
46
47
48 if __name__ == "__main__" :
49         #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
50         #monCata="/local/noyret/Install_Eficas/Aster/Cata/cataSTA11/cata.py"
51         #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
52         #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
53         code="Aster"
54         version=None
55
56         from Editeur  import session
57         options=session.parse(sys.argv)
58         if options.code!= None :    code=options.code
59         if options.cata!= None : monCata=options.cata
60         if options.ssCode!= None :  ssCode=options.ssCode
61
62         sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..',code))
63
64         from InterfaceQT4.ssIhm  import QWParentSSIhm, appliEficasSSIhm
65         Eficas=appliEficasSSIhm(code=code)
66         parent=QWParentSSIhm(code,Eficas,version)
67
68         import readercata
69         monreadercata  = readercata.READERCATA( parent, parent )
70         Eficas.readercata=monreadercata
71         monCata=monreadercata.cata[0]
72
73         monConstruitInto=ChercheInto(monCata,code)
74
75
76
77