]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Implement the --foreground=0/1 to force old behavior
authoradam <adam>
Tue, 10 May 2011 13:33:06 +0000 (13:33 +0000)
committeradam <adam>
Tue, 10 May 2011 13:33:06 +0000 (13:33 +0000)
with runSalome --foreground=0

bin/launchConfigureParser.py
bin/runSalome.py

index 7cfd8fc6d4b660780df5feea46e5ad1e1134ddd1..1089e83a36a9b4d1ed72dc8e95bddfb39072a3b5 100755 (executable)
@@ -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 (<module_name> 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
index 27bac6f596f4c0fbf277d58d15fd1828c064b5b4..c6229908b08289d4756951d760d73bf52a62dd29 100755 (executable)
@@ -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)