From 3e698da7cd1d7a184ef7a69f82fbf674b0ba2ad3 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 10 May 2011 13:33:06 +0000 Subject: [PATCH] Implement the --foreground=0/1 to force old behavior with runSalome --foreground=0 --- bin/launchConfigureParser.py | 20 ++++++++++++++++++++ bin/runSalome.py | 1 + 2 files changed, 21 insertions(+) diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index 7cfd8fc6d..1089e83a3 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -64,6 +64,7 @@ gdb_session_nam = "gdb_session" ddd_session_nam = "ddd_session" valgrind_session_nam = "valgrind_session" shutdown_servers_nam = "shutdown_servers" +foreground_nam = "foreground" wake_up_session_nam = "wake_up_session" # values in XML configuration file giving specific module parameters ( section) @@ -686,6 +687,17 @@ def CreateOptionParser (theAdditionalOptions=[]): dest="shutdown_servers", help=help_str) + # foreground. Default: True. + help_str = "0 and runSalome exits after have launched the gui, " + help_str += "1 to launch runSalome in foreground mode [default]." + o_foreground = optparse.Option("--foreground", + metavar="<1/0>", + #type="choice", choices=boolean_choices, + type="string", + action="callback", callback=store_boolean, callback_args=('foreground',), + dest="foreground", + help=help_str) + # wake up session help_str = "Wake up a previously closed session. " help_str += "The session object is found in the naming service pointed by the variable OMNIORB_CONFIG. " @@ -721,6 +733,7 @@ def CreateOptionParser (theAdditionalOptions=[]): o_ddd, o_valgrind, o_shutdown, + o_foreground, o_wake_up, ] @@ -1017,6 +1030,13 @@ def get_env(theAdditionalOptions=[], appname="SalomeApp"): args[shutdown_servers_nam] = cmd_opts.shutdown_servers pass + # Foreground + if cmd_opts.foreground is None: + args[foreground_nam] = 1 + else: + args[foreground_nam] = cmd_opts.foreground + pass + # wake up session if cmd_opts.wake_up_session is not None: args[wake_up_session_nam] = cmd_opts.wake_up_session diff --git a/bin/runSalome.py b/bin/runSalome.py index 27bac6f59..c6229908b 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -1025,6 +1025,7 @@ if __name__ == "__main__": pass # -- test = test and os.getenv("SALOME_TEST_MODE", "0") != "1" + test = test and args['foreground'] # -- if test: foreGround(clt, args) -- 2.39.2