X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleCatalog%2FTestModuleCatalog.py;h=de3c69a6acd823fe1f134d265bbe9bbb8d011940;hb=dc4b16b9dd53dd42139fd22ef26556861db58989;hp=aa22de9debed84591a1f4e82cb1b2d70abe93544;hpb=7d2fe213bdf5bf962ce11e253020c9d3e0bc1cce;p=modules%2Fkernel.git diff --git a/src/ModuleCatalog/TestModuleCatalog.py b/src/ModuleCatalog/TestModuleCatalog.py index aa22de9de..de3c69a6a 100755 --- a/src/ModuleCatalog/TestModuleCatalog.py +++ b/src/ModuleCatalog/TestModuleCatalog.py @@ -1,84 +1,86 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + import batchmode_salome import SALOME_ModuleCatalog -print -print "======================================================================" -print " XML Catalog file generation from idl file" -print "======================================================================" +print() +print("======================================================================") +print(" XML Catalog file generation from idl file") +print("======================================================================") import os os.system('runIDLparser -Wbcatalog=x \ ${KERNEL_ROOT_DIR}/idl/salome/SALOME_TestModuleCatalog.idl') -print "======================================================================" -print " Get Catalog " -print "======================================================================" +print("======================================================================") +print(" Get Catalog ") +print("======================================================================") obj = batchmode_salome.naming_service.Resolve('Kernel/ModulCatalog') catalog = obj._narrow(SALOME_ModuleCatalog.ModuleCatalog) catalog.GetComponentList() -print -print "======================================================================" -print " Import xml file " -print "======================================================================" +print() +print("======================================================================") +print(" Import xml file ") +print("======================================================================") catalog.ImportXmlCatalogFile("x.xml") name = "AddComponent" -print -print "======================================================================" -print " Dump component <", name, "> " -print "======================================================================" +print() +print("======================================================================") +print(" Dump component <", name, "> ") +print("======================================================================") C = catalog.GetComponent(name) -print "name : ", C._get_componentname() -print "username : ", C._get_componentusername() -print "type : ", C._get_component_type() -print "constraint : ", C._get_constraint() -print "icon : ", C._get_component_icone() +print("name : ", C._get_componentname()) +print("username : ", C._get_componentusername()) +print("type : ", C._get_component_type()) +print("constraint : ", C._get_constraint()) +print("icon : ", C._get_component_icone()) for iL in C.GetInterfaceList(): I = C.GetInterface(iL) - print "interface : ", I.interfacename + print("interface : ", I.interfacename) for S in I.interfaceservicelist: - print " service : ", S.ServiceName - print " ", len(S.ServiceinParameter), "in params : " + print(" service : ", S.ServiceName) + print(" ", len(S.ServiceinParameter), "in params : ") for iP in S.ServiceinParameter: - print ' ' + iP.Parametername + '(' + iP.Parametertype + ')' + print(' ' + iP.Parametername + '(' + iP.Parametertype + ')') pass - print " ", len(S.ServiceoutParameter), "out params : " + print(" ", len(S.ServiceoutParameter), "out params : ") for iP in S.ServiceoutParameter: - print ' ' + iP.Parametername + '(' + iP.Parametertype + ')' + print(' ' + iP.Parametername + '(' + iP.Parametertype + ')') pass - print " ", len(S.ServiceinDataStreamParameter), "in datastream params : " + print(" ", len(S.ServiceinDataStreamParameter), "in datastream params : ") for iP in S.ServiceinDataStreamParameter: - print ' ' + iP.Parametername + '(' + str(iP.Parametertype) + ', ' + \ - str(iP.Parameterdependency) + ')' + print(' ' + iP.Parametername + '(' + str(iP.Parametertype) + ', ' + \ + str(iP.Parameterdependency) + ')') pass - print " ", len(S.ServiceoutDataStreamParameter), "out datastream params : " + print(" ", len(S.ServiceoutDataStreamParameter), "out datastream params : ") for iP in S.ServiceoutDataStreamParameter: - print ' ' + iP.Parametername + '(' + str(iP.Parametertype) + ', ' + \ - str(iP.Parameterdependency) + ')' + print(' ' + iP.Parametername + '(' + str(iP.Parametertype) + ', ' + \ + str(iP.Parameterdependency) + ')') pass pass pass