1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 import batchmode_salome
23 import SALOME_ModuleCatalog
26 print "======================================================================"
27 print " XML Catalog file generation from idl file"
28 print "======================================================================"
31 os.system('runIDLparser -Wbcatalog=x \
32 ${KERNEL_ROOT_DIR}/idl/salome/SALOME_TestModuleCatalog.idl')
34 print "======================================================================"
36 print "======================================================================"
37 obj = batchmode_salome.naming_service.Resolve('Kernel/ModulCatalog')
38 catalog = obj._narrow(SALOME_ModuleCatalog.ModuleCatalog)
39 catalog.GetComponentList()
42 print "======================================================================"
43 print " Import xml file "
44 print "======================================================================"
45 catalog.ImportXmlCatalogFile("x.xml")
49 print "======================================================================"
50 print " Dump component <", name, "> "
51 print "======================================================================"
52 C = catalog.GetComponent(name)
54 print "name : ", C._get_componentname()
55 print "username : ", C._get_componentusername()
56 print "type : ", C._get_component_type()
57 print "constraint : ", C._get_constraint()
58 print "icon : ", C._get_component_icone()
60 for iL in C.GetInterfaceList():
61 I = C.GetInterface(iL)
62 print "interface : ", I.interfacename
63 for S in I.interfaceservicelist:
64 print " service : ", S.ServiceName
65 print " ", len(S.ServiceinParameter), "in params : "
66 for iP in S.ServiceinParameter:
67 print ' ' + iP.Parametername + '(' + iP.Parametertype + ')'
69 print " ", len(S.ServiceoutParameter), "out params : "
70 for iP in S.ServiceoutParameter:
71 print ' ' + iP.Parametername + '(' + iP.Parametertype + ')'
73 print " ", len(S.ServiceinDataStreamParameter), "in datastream params : "
74 for iP in S.ServiceinDataStreamParameter:
75 print ' ' + iP.Parametername + '(' + str(iP.Parametertype) + ', ' + \
76 str(iP.Parameterdependency) + ')'
78 print " ", len(S.ServiceoutDataStreamParameter), "out datastream params : "
79 for iP in S.ServiceoutDataStreamParameter:
80 print ' ' + iP.Parametername + '(' + str(iP.Parametertype) + ', ' + \
81 str(iP.Parameterdependency) + ')'