Salome HOME
Add script to launch salome gui in session less mode.
authorOvidiu MIRCESCU <ovidiu.mircescu@edf.fr>
Fri, 18 Jun 2021 09:22:50 +0000 (11:22 +0200)
committerOvidiu MIRCESCU <ovidiu.mircescu@edf.fr>
Fri, 18 Jun 2021 09:22:50 +0000 (11:22 +0200)
bin/CMakeLists.txt
bin/runSalomeNoServer.py [new file with mode: 0755]

index d19f8dc75ca40a2212e60762deee1c1394f927dd..c3a8fffa75ccfeea891a5fc5dc3e4abfce5feb5d 100644 (file)
@@ -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 (executable)
index 0000000..6e6ee91
--- /dev/null
@@ -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()