#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015 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
# 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.
+# 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
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+###############################################
+############### IMPORTANT NOTE ################
+###############################################
+# The salomeConsole.py script is obsolete. #
+# Please consider the new salome launcher. #
+###############################################
+
+
import os
import sys
import glob
#-------------------------------
# Get major CORBA objects
#-------------------------------
-import CORBA
+from omniORB import CORBA
import CosNaming
import salome_utils
def getRunningSession():
omniorbUserPath = os.getenv("OMNIORB_USER_PATH")
- files = glob.glob(os.path.join(omniorbUserPath,".omniORB_"+salome_utils.getUserName()+"_*.cfg"))
+ files = glob.glob(os.path.join(omniorbUserPath,".omniORB_"+salome_utils.getUserName()+"_*[!last].cfg"))
filename=""
if len(files)==1:
#
class client(orbmodule.client):
- def initNS(self,args):
- # Obtain a reference to the root naming context
- obj = self.orb.resolve_initial_references("NameService")
- try:
- self.rootContext = obj._narrow(CosNaming.NamingContext)
- return
- except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE):
- print "It's not a valid naming service"
- self.rootContext = None
- raise
+ def initNS(self,args):
+ # Obtain a reference to the root naming context
+ obj = self.orb.resolve_initial_references("NameService")
+ try:
+ self.rootContext = obj._narrow(CosNaming.NamingContext)
+ return
+ except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE):
+ print "It's not a valid naming service"
+ self.rootContext = None
+ raise
#
def startClient():
clt.showNS()
- session=clt.waitNS("/Kernel/Session")
+ session_server = clt.Resolve('/Kernel/Session')
+ if session_server:
+ session=clt.waitNS("/Kernel/Session")
catalog=clt.waitNS("/Kernel/ModulCatalog")
studyMgr=clt.waitNS("/myStudyManager")
import salome