pass # end of LoggerServer class
# ---
-
-class SessionServer(Server):
+import abc
+class CommonSessionServer(Server):
def __init__(self,args,modules_list,modules_root_dir):
self.args = args.copy()
# Bug 11512 (Problems with runSalome --xterm on Mandrake and Debian Sarge)
#self.args['xterm']=0
#
self.initArgs()
- self.SCMD1=['SALOME_Session_Server']
+ self.SCMD1=[self.getSessionServerExe()]
if "SQUISH_PREFIX" in os.environ:
if platform.system() == "Windows" :
self.SCMD1 = [os.path.join(os.getenv("SQUISH_PREFIX"), "bin", "dllpreload.exe"),os.path.join(os.getenv("SQUISH_SALOME_PATH"), "W64", "GUI", "bin", "salome", self.SCMD1[0])]
self.SCMD2+=['--language=%s' % self.args['language']]
pass
+ @abc.abstractmethod
+ def getSessionServerExe(self):
+ pass
+
def setpath(self,modules_list,modules_root_dir):
list_modules = modules_list[:]
list_modules.reverse()
self.CMD = l + self.CMD
pass
+class SessionServer(CommonSessionServer):
+ def __init__(self,args,modules_list,modules_root_dir):
+ super().__init__(args,modules_list,modules_root_dir)
+ import KernelBasis
+ KernelBasis.setSSLMode(False)
+
+ def getSessionServerExe(self):
+ return "SALOME_Session_Server"
# ---
class LauncherServer(Server):
import runSalome
import os
-class NoSessionServer(runSalome.SessionServer):
+class NoSessionServer(runSalome.CommonSessionServer):
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)
+ def getSessionServerExe(self):
+ return "SALOME_Session_Server_No_Server"
def main():
args, modules_list, modules_root_dir = setenv.get_config()
Commands:
=========
- start Start a new SALOME instance.
+ start Start a new SALOME instance. Start a single SALOME_Session_Server_No_Server
+ process with environment relevant to the application and hosting all servants in it.
context Initialize SALOME context. Current environment is extended.
shell Initialize SALOME context, attached to the last created SALOME
instance if any, and executes scripts passed as command arguments.
User works in a Shell terminal. SALOME environment is set but
application is not started.
- connect Connect a Python console to the active SALOME instance.
- remote run command in SALOME environment from remote call, ssh or rsh.
- kill <port(s)> Terminate SALOME instances running on given ports for current user.
- Port numbers must be separated by blank characters.
- killall Terminate *all* SALOME running instances for current user.
- Do not start a new one.
test Run SALOME tests.
info Display some information about SALOME.
doc <module(s)> Show online module documentation (if available).
Module names must be separated by blank characters.
help Show this message.
+ remote run command in SALOME environment from remote call, ssh or rsh.
+ withsession Start a new SWS SALOME instance with multiple servers hosting all servants.
+ connect In SWS context, Connect a Python console to the active SALOME instance.
+ kill <port(s)> In SWS context, Terminate SALOME instances running on given ports for current user.
+ Port numbers must be separated by blank characters.
+ killall Terminate *all* SALOME running SWS instances for current user.
+ Do not start a new one.
If no command is given, default is start.
options = args[1:]
availableCommands = {
- 'start' : '_runAppli',
- 'sessionless' : '_sessionless',
+ 'start' : '_sessionless',
+ 'withsession' : '_runAppli',
'context' : '_setContext',
'shell' : '_runSession',
'remote' : '_runRemote',
usage()
return 0
# try to default to "start" command
- command = "_runAppli"
+ command = "_sessionless"
try:
res = getattr(self, command)(options) # run appropriate method
if "-v" in args or "--version" in args:
print("Running with python", platform.python_version())
- return self._runAppli(["--version"])
+ return self._sessionless(["--version"])
return 0
#
#include "KernelBasis.hxx"
-static bool DEFAULT_SSL_MODE = false;
+static bool DEFAULT_SSL_MODE = true;
static bool GUI_MODE = false;
// IOR of SALOME_Embedded_NamingService servant
salome_initial=True
-__EMB_SERVANT_ENV_VAR_NAME = "SALOME_EMB_SERVANT"
-
def standalone():
- import os
- os.environ[__EMB_SERVANT_ENV_VAR_NAME] = "1"
+ pass
+
+def withServers():
import KernelBasis
- KernelBasis.setSSLMode(True)
+ KernelBasis.setSSLMode(False)
def salome_init(path=None, embedded=False):
- import os
import KernelBasis
- if __EMB_SERVANT_ENV_VAR_NAME in os.environ:
- KernelBasis.setSSLMode(True)
- #
if KernelBasis.getSSLMode():
if KernelBasis.getIOROfEmbeddedNS() == "":
salome_init_without_session(path, embedded)