1 #! /usr/bin/env python3
2 # Copyright (C) 2021-2022 CEA/DEN, EDF R&D
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.
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.
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
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 import runSalomeCommon
24 logger = logging.getLogger()
26 class NoSessionServer(runSalomeCommon.CommonSessionServer):
27 def __init__(self,args,modules_list,modules_root_dir):
28 super().__init__(args,modules_list,modules_root_dir)
29 SalomeAppSLConfig=os.getenv("SalomeAppConfig","")
30 os.putenv("SalomeAppSLConfig", SalomeAppSLConfig)
31 def getSessionServerExe(self):
32 return "SALOME_Session_Server_No_Server"
34 from server import process_id
35 from addToKillList import addToKillList,killList
38 args, modules_list, modules_root_dir = setenv.get_config()
39 mySessionServ = NoSessionServer(args, args.get('modules', []), modules_root_dir)
40 runSalomeCommon.setVerbose(mySessionServ.args["verbosity"])
41 if mySessionServ.args["killall"]:
43 logger.debug("Effective args : {}".format(mySessionServ.args))
44 mySessionServ.setpath(modules_list, modules_root_dir)
46 for pid, cmd in list(process_id.items()):
47 logger.debug("Killing {} {}".format(pid, cmd))
48 addToKillList(pid, cmd)
50 if __name__ == "__main__":