Salome HOME
b53952cf314e42689a6538691b54beb2d9044dc9
[tools/eficas.git] / Editeur / chercheNbElem.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                     print (maCommande.nom)
39                     print (maCommande.entites )
40                     print (len(maCommande.entites) )
41
42
43 #        def construitListeInto(self,e):
44 #            if isinstance(e,Accas.A_BLOC.BLOC) :
45 #               print (e.condition.
46 #            for nomFils, fils in e.entites.items():
47 #                self.construitListeInto(fils)
48
49
50 if __name__ == "__main__" :
51         #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
52         #monCata="/local/noyret/Install_Eficas/Aster/Cata/cataSTA11/cata.py"
53         #monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
54         monCata="/local/noyret/Install_Eficas/MAP/mapcata.py"
55         code="MAP"
56         version=None
57
58         from Editeur  import session
59         options=session.parse(sys.argv)
60         if options.code!= None :    code=options.code
61         if options.cata!= None : monCata=options.cata
62         if options.ssCode!= None :  ssCode=options.ssCode
63
64         sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..',code))
65
66         from InterfaceQT4.ssIhm  import QWParentSSIhm, appliEficasSSIhm
67         Eficas=appliEficasSSIhm(code=code)
68         parent=QWParentSSIhm(code,Eficas,version)
69
70         import readercata
71         monreadercata  = readercata.READERCATA( parent, parent )
72         Eficas.readercata=monreadercata
73         monCata=monreadercata.cata[0]
74
75         monConstruitInto=ChercheInto(monCata,code)
76
77
78
79