Salome HOME
Add script to launch salome gui in session less mode.
[modules/kernel.git] / bin / runSalomeNoServer.py
1 #! /usr/bin/env python3
2 # Copyright (C) 2021  CEA/DEN, EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 import setenv
21 import runSalome
22 import os
23
24 class NoSessionServer(runSalome.SessionServer):
25     def __init__(self,args,modules_list,modules_root_dir):
26         super().__init__(args,modules_list,modules_root_dir)
27         for i in range (len(self.SCMD1)):
28             if self.SCMD1[i] == "SALOME_Session_Server" :
29                 self.SCMD1[i] = "SALOME_Session_Server_No_Server"
30         os.putenv("SALOME_EMB_SERVANT", "1")
31         SalomeAppSLConfig=os.getenv("SalomeAppConfig","")
32         os.putenv("SalomeAppSLConfig", SalomeAppSLConfig)
33
34 if __name__ == "__main__":
35     args, modules_list, modules_root_dir = setenv.get_config()
36     mySessionServ = NoSessionServer(args, modules_list, modules_root_dir)
37     mySessionServ.setpath(modules_list, modules_root_dir)
38     mySessionServ.run()