From e47efe9880170ecf24845fb9133ff5f61e18523f Mon Sep 17 00:00:00 2001 From: Ovidiu MIRCESCU Date: Fri, 18 Jun 2021 11:22:50 +0200 Subject: [PATCH] Add script to launch salome gui in session less mode. --- bin/CMakeLists.txt | 1 + bin/runSalomeNoServer.py | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 bin/runSalomeNoServer.py diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index d19f8dc75..c3a8fffa7 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -46,6 +46,7 @@ SET(SCRIPTS parseConfigFile.py PortManager.py runSalome.py + runSalomeNoServer.py runSession.py runConsole.py runRemote.py diff --git a/bin/runSalomeNoServer.py b/bin/runSalomeNoServer.py new file mode 100755 index 000000000..6e6ee91f8 --- /dev/null +++ b/bin/runSalomeNoServer.py @@ -0,0 +1,38 @@ +#! /usr/bin/env python3 +# Copyright (C) 2021 CEA/DEN, EDF R&D +# +# 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 +# +import setenv +import runSalome +import os + +class NoSessionServer(runSalome.SessionServer): + def __init__(self,args,modules_list,modules_root_dir): + super().__init__(args,modules_list,modules_root_dir) + for i in range (len(self.SCMD1)): + if self.SCMD1[i] == "SALOME_Session_Server" : + self.SCMD1[i] = "SALOME_Session_Server_No_Server" + os.putenv("SALOME_EMB_SERVANT", "1") + SalomeAppSLConfig=os.getenv("SalomeAppConfig","") + os.putenv("SalomeAppSLConfig", SalomeAppSLConfig) + +if __name__ == "__main__": + args, modules_list, modules_root_dir = setenv.get_config() + mySessionServ = NoSessionServer(args, modules_list, modules_root_dir) + mySessionServ.setpath(modules_list, modules_root_dir) + mySessionServ.run() -- 2.39.2