5 #-------------------------------
6 # Python completion and others if you want
7 # You should have set PYTHONSTARTUP env variable
8 # or import user should try to import $HOME/.pythonrc.py
9 #-------------------------------
12 #-------------------------------
13 # Get major CORBA objects
14 #-------------------------------
17 # There are cyclic dependencies between Engines, SALOME and SALOMEDS.
18 # import first Engines, then SALOME and then SALOMEDS
19 # Or use reload(Engines) to be safe.
23 import SALOME_ModuleCatalog
30 from runSalome import *
33 files = glob.glob(os.path.join(os.environ["HOME"],Utils_Identity.getapplipath(),".omni*.cfg"))
39 print "You have %d sessions running" % len(files)
42 rep= raw_input("Do you want to connect to this session [y|n]")
48 os.environ['OMNIORB_CONFIG']=filename
50 rep= raw_input("Do you want to try a local session on port 2810 ? [y|n]")
52 # Try a local session running on port 2810
53 sys.argv=sys.argv+['-ORBInitRef','NameService=corbaname::localhost:2810']
59 #direct adress from clt.orb.object_to_string(clt.rootContext)
60 #sys.argv=sys.argv+['-ORBInitRef','NameService=IOR:010000000100000000000000010000000000000023000000010100000a0000006c6f63616c686f737400fa0a0b0000004e616d6553657276696365']
62 class client(orbmodule.client):
64 # Obtain a reference to the root naming context
65 obj = self.orb.resolve_initial_references("NameService")
67 self.rootContext = obj._narrow(CosNaming.NamingContext)
69 except CORBA.COMM_FAILURE:
70 print "It's not a valid naming service"
71 self.rootContext = None
75 print "Naming Service address: ",clt.orb.object_to_string(clt.rootContext)
79 session=clt.waitNS("/Kernel/Session")
80 catalog=clt.waitNS("/Kernel/ModulCatalog")
81 studyMgr=clt.waitNS("/myStudyManager")
82 lcc = LifeCycleCORBA.LifeCycleCORBA(clt.orb)
84 #c=lcc.FindOrStartContainer("","totoPy")