Salome HOME
Copyright update: 2016
[samples/atomsolv.git] / bin / runATOMSOLV.py
1 #!/usr/bin/env python
2
3 # Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
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, or (at your option) any later version.
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 def test(clt):
23    """
24         Test function that creates an instance of ATOMSOLV component
25         usage : atomsolv=test(clt)
26    """
27    # create an LifeCycleCORBA instance
28    import LifeCycleCORBA
29    lcc = LifeCycleCORBA.LifeCycleCORBA(clt.orb)
30    import ATOMSOLV_ORB
31    atomsolv = lcc.FindOrLoadComponent("FactoryServer", "ATOMSOLV")
32    return atomsolv
33
34 #
35
36 if __name__ == "__main__":
37    import user
38    from runSalome import *
39    clt,args = main()
40    
41    #
42    #  Impression arborescence Naming Service
43    #
44    
45    if clt != None:
46      print
47      print " --- registered objects tree in Naming Service ---"
48      clt.showNS()
49      session=clt.waitNS("/Kernel/Session")
50      catalog=clt.waitNS("/Kernel/ModulCatalog")
51      import socket
52      container =  clt.waitNS("/Containers/" + socket.gethostname().split('.')[0] + "/FactoryServer")