Salome HOME
Example of a c++ component with engine from Salome tutorial
[samples/atomsolv.git] / bin / myrunSalome.py
1 #!/usr/bin/env python
2
3 #  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
4 #
5 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
6 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 #
8 #  This library is free software; you can redistribute it and/or
9 #  modify it under the terms of the GNU Lesser General Public
10 #  License as published by the Free Software Foundation; either
11 #  version 2.1 of the License.
12 #
13 #  This library is distributed in the hope that it will be useful,
14 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 #  Lesser General Public License for more details.
17 #
18 #  You should have received a copy of the GNU Lesser General Public
19 #  License along with this library; if not, write to the Free Software
20 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21 #
22 #  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
23
24 def test(clt):
25    """
26         Test function that creates an instance of ATOMSOLV component
27         usage : atomsolv=test(clt)
28    """
29    # create an LifeCycleCORBA instance
30    import LifeCycleCORBA
31    lcc = LifeCycleCORBA.LifeCycleCORBA(clt.orb)
32    import ATOMSOLV_ORB
33    atomsolv = lcc.FindOrLoadComponent("FactoryServer", "ATOMSOLV")
34    return atomsolv
35
36 #
37
38 if __name__ == "__main__":
39    import user
40    from runSalome import *
41    clt,args = main()
42    
43    #
44    #  Impression arborescence Naming Service
45    #
46    
47    if clt != None:
48      print
49      print " --- registered objects tree in Naming Service ---"
50      clt.showNS()
51      session=clt.waitNS("/Kernel/Session")
52      catalog=clt.waitNS("/Kernel/ModulCatalog")
53      import socket
54      container =  clt.waitNS("/Containers/" + socket.gethostname().split('.')[0] + "/FactoryServer")