Back to index

salome-kernel  6.5.0
salome_kernel.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00005 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00006 #
00007 # This library is free software; you can redistribute it and/or
00008 # modify it under the terms of the GNU Lesser General Public
00009 # License as published by the Free Software Foundation; either
00010 # version 2.1 of the License.
00011 #
00012 # This library is distributed in the hope that it will be useful,
00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 # Lesser General Public License for more details.
00016 #
00017 # You should have received a copy of the GNU Lesser General Public
00018 # License along with this library; if not, write to the Free Software
00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00020 #
00021 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00022 #
00023 
00024 #  File   : salome_kernel.py
00025 #  Author : Paul RASCLE, EDF
00026 #  Module : SALOME
00027 #  $Header: /home/server/cvs/KERNEL/KERNEL_SRC/src/KERNEL_PY/salome_kernel.py,v 1.4.2.2.14.2.12.1 2012-04-12 14:05:13 vsr Exp $
00028 #
00029 from omniORB import CORBA
00030 from LifeCycleCORBA import *
00031 from SALOME_NamingServicePy import *
00032 from SALOME_utilities import *
00033 import Engines
00034 
00035 salome_kernel_initial=1
00036 
00037 def salome_kernel_init():
00038     global salome_kernel_initial
00039     global orb, lcc, naming_service, cm
00040     
00041     if salome_kernel_initial:
00042         salome_kernel_initial = 0
00043         
00044         # initialise the ORB
00045         orb = CORBA.ORB_init([''], CORBA.ORB_ID)
00046 
00047         # create a LifeCycleCORBA instance
00048         lcc = LifeCycleCORBA(orb)
00049 
00050         #create a naming service instance
00051         naming_service = SALOME_NamingServicePy_i(orb)
00052 
00053         # get Container Manager
00054         obj = naming_service.Resolve('/ContainerManager')
00055         cm = obj._narrow(Engines.ContainerManager)
00056 
00057     return orb, lcc, naming_service, cm