From 4227af90e2adce576ca3b2880b8330333f3ce555 Mon Sep 17 00:00:00 2001 From: Ovidiu MIRCESCU Date: Thu, 15 Jul 2021 12:35:03 +0200 Subject: [PATCH] Add sessionless option to salome command. --- bin/runSalomeNoServer.py | 5 ++++- bin/salomeContext.py | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/runSalomeNoServer.py b/bin/runSalomeNoServer.py index 6e6ee91f8..0305716a8 100755 --- a/bin/runSalomeNoServer.py +++ b/bin/runSalomeNoServer.py @@ -31,8 +31,11 @@ class NoSessionServer(runSalome.SessionServer): SalomeAppSLConfig=os.getenv("SalomeAppConfig","") os.putenv("SalomeAppSLConfig", SalomeAppSLConfig) -if __name__ == "__main__": +def 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() + +if __name__ == "__main__": + main() diff --git a/bin/salomeContext.py b/bin/salomeContext.py index d4d44afdd..32543205e 100755 --- a/bin/salomeContext.py +++ b/bin/salomeContext.py @@ -224,6 +224,7 @@ class SalomeContext: availableCommands = { 'start' : '_runAppli', + 'sessionless' : '_sessionless', 'context' : '_setContext', 'shell' : '_runSession', 'remote' : '_runRemote', @@ -358,6 +359,14 @@ class SalomeContext: return 0 # + def _sessionless(self, args=None): + if args is None: + args = [] + sys.argv = ['runSalome'] + args + import runSalomeNoServer + runSalomeNoServer.main() + # + def _setContext(self, args=None): salome_context_set = os.getenv("SALOME_CONTEXT_SET") if salome_context_set: -- 2.39.2