From 07b4af5be377117388d3c15c460db56dc6ffb40c Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Fri, 19 Aug 2016 16:02:49 +0200 Subject: [PATCH] remove obsolete scripts --- bin/CMakeLists.txt | 3 -- bin/salomeConsole.py | 114 ------------------------------------------ bin/salome_session.py | 78 ----------------------------- bin/shutdownSalome.py | 38 -------------- 4 files changed, 233 deletions(-) delete mode 100755 bin/salomeConsole.py delete mode 100644 bin/salome_session.py delete mode 100755 bin/shutdownSalome.py diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 587e841fd..ceef7b047 100755 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -49,16 +49,13 @@ SET(SCRIPTS runSession.py runConsole.py runTests.py - salomeConsole.py ${CMAKE_CURRENT_BINARY_DIR}/salomeContextUtils.py salomeContext.py - salome_session.py salome_utils.py searchFreePort.py server.py setenv.py showNS.py - shutdownSalome.py virtual_salome.py waitContainers.py waitNS.py diff --git a/bin/salomeConsole.py b/bin/salomeConsole.py deleted file mode 100755 index 8e0ffcbfa..000000000 --- a/bin/salomeConsole.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python -# -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2016 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, 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 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# 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 - -#------------------------------- -# Python completion and others if you want -# You should have set PYTHONSTARTUP env variable -# or import user should try to import $HOME/.pythonrc.py -#------------------------------- -import user - -#------------------------------- -# Get major CORBA objects -#------------------------------- -from omniORB import CORBA -import CosNaming -import salome_utils - -import orbmodule - -def getRunningSession(): - omniorbUserPath = os.getenv("OMNIORB_USER_PATH") - files = glob.glob(os.path.join(omniorbUserPath,".omniORB_"+salome_utils.getUserName()+"_*[!last].cfg")) - - filename="" - if len(files)==1: - filename=files[0] - else: - print "You have %d sessions running" % len(files) - for f in files: - print "Session:",f - rep= raw_input("Do you want to connect to this session [y|n]") - if rep == "y": - filename=f - break - - if filename != "": - os.environ['OMNIORB_CONFIG']=filename - else: - rep= raw_input("Do you want to try a local session on port 2810 ? [y|n]") - if rep == "y": - # Try a local session running on port 2810 - sys.argv=sys.argv+['-ORBInitRef','NameService=corbaname::localhost:2810'] - else: - sys.exit(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 startClient(): - try: - clt=client() - except Exception: - sys.exit(1) - # - print "Naming Service address: ",clt.orb.object_to_string(clt.rootContext) - - clt.showNS() - - 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 - salome.salome_init() - from salome import lcc -# - -getRunningSession() -startClient() diff --git a/bin/salome_session.py b/bin/salome_session.py deleted file mode 100644 index 933cbcc62..000000000 --- a/bin/salome_session.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2016 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, 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 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -## @package salome_session -# \brief Module that provides the SalomeSession object that helps to launch -# a SALOME script session -# - -import os -import sys -import string -import socket - -_session = None - -def startSession(modules=None): - if modules is None: - modules = [] - global _session - if _session: return - from searchFreePort import searchFreePort - searchFreePort() - _session = SalomeSession(modules) - return - -def getShortHostName(): - """ - gives Hostname without domain extension. - SALOME naming service needs short Hostnames (without domain extension). - HOSTNAME is not allways defined in environment, - socket.gethostname() gives short or complete Hostname, depending on - defined aliases. - """ - from salome_utils import getShortHostName - return getShortHostName() - - -class SalomeSession(object): - """Salome session launcher""" - import runSalome - import killSalomeWithPort - import killSalome - def __init__(self, modules): - import runSalome - sys.argv = ["dummy.py"] - sys.argv += ["--terminal"] - if modules: - sys.argv += ['--modules=%s'%(",".join(modules))] - pass - runSalome.clt, runSalome.args = runSalome.main() - import salome - salome.salome_init() - return - def __del__(self): - import runSalome - runSalome.killLocalPort() - return - pass diff --git a/bin/shutdownSalome.py b/bin/shutdownSalome.py deleted file mode 100755 index a8a39ba8c..000000000 --- a/bin/shutdownSalome.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -# -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2016 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, 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 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -## \file shutdownSalome.py -# shutdown all %SALOME servers and naming service -# - -import time -from omniORB import CORBA -from LifeCycleCORBA import * - -orb = CORBA.ORB_init([''], CORBA.ORB_ID) -lcc = LifeCycleCORBA(orb) -lcc.shutdownServers() -time.sleep(1) -LifeCycleCORBA.killOmniNames() -time.sleep(1) -- 2.39.2