]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix for Bug NPAL16630 (runSalome and runAppli use python option "-i" when it has...
authormzn <mzn@opencascade.com>
Thu, 20 Sep 2007 09:16:38 +0000 (09:16 +0000)
committermzn <mzn@opencascade.com>
Thu, 20 Sep 2007 09:16:38 +0000 (09:16 +0000)
bin/appliskel/runAppli
bin/launchConfigureParser.py
bin/runSalome
bin/runSalome.ksh
bin/runSalome.py

index 7693557c178981dec525e55dc7ebcb2309e1f4f4..2bd9f1dae2f94933e7820313fd16dfc75d0164dd 100755 (executable)
@@ -22,7 +22,7 @@ fi
 #     by arguments to this command)
 
 if [ $# -ne 0 ] ; then
-    ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $*
+    ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $*
 
 else
     ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py 
index e3415040099fb35cc1d87b5305520aa3da8fc306..f28a115be9d92b4440128943a0b4fbcf184e3ae1 100755 (executable)
@@ -49,6 +49,7 @@ terminal_nam   = "terminal"
 interp_nam     = "interp"
 except_nam     = "noexcepthandler"
 terminal_nam   = "terminal"
+pinter_nam     = "pinter"
 
 # values in XML configuration file giving specific module parameters (<module_name> section)
 # which are stored in opts with key <module_name>_<parameter> (eg SMESH_plugins)
@@ -62,7 +63,7 @@ script_nam     = "pyscript"
 
 # values of boolean type (must be '0' or '1').
 # xml_parser.boolValue() is used for correct setting
-boolKeys = ( gui_nam, splash_nam, logger_nam, file_nam, xterm_nam, portkill_nam, killall_nam, except_nam )
+boolKeys = ( gui_nam, splash_nam, logger_nam, file_nam, xterm_nam, portkill_nam, killall_nam, except_nam, pinter_nam )
 intKeys = ( interp_nam, )
 
 # values of list type
@@ -493,6 +494,13 @@ def CreateOptionParser (theAdditionalOptions=[]):
                           dest="save_config", default=True,
                           help=help_str)
 
+    # Launch with interactive python console. Default: False.
+    help_str = "Launch with interactive python console."
+    o_pi = optparse.Option("--pinter",
+                          action="store_true",
+                          dest="pinter",
+                          help=help_str)
+
     # All options
     opt_list = [o_t,o_g, # GUI/Terminal
                 o_d,o_o, # Desktop
@@ -509,7 +517,9 @@ def CreateOptionParser (theAdditionalOptions=[]):
                 o_z,     # Splash
                 o_c,     # Catch exceptions
                 o_a,     # Print free port and exit
-                o_n]     # --nosave-config
+                o_n,     # --nosave-config
+                o_pi]     # Interactive python console
+                
 
     #std_options = ["gui", "desktop", "log_file", "py_scripts", "resources",
     #               "xterm", "modules", "embedded", "standalone",
@@ -684,7 +694,7 @@ def get_env(theAdditionalOptions=[], appname="SalomeApp"):
     # Options: gui, desktop, log_file, py_scripts, resources,
     #          xterm, modules, embedded, standalone,
     #          portkill, killall, interp, splash,
-    #          catch_exceptions
+    #          catch_exceptions, pinter
 
     # GUI/Terminal, Desktop, Splash, STUDY_HDF
     args["session_gui"] = False
@@ -769,6 +779,10 @@ def get_env(theAdditionalOptions=[], appname="SalomeApp"):
     if cmd_opts.save_config is not None:
         args['save_config'] = cmd_opts.save_config
 
+    # Interactive python console
+    if cmd_opts.pinter is not None:
+        args[pinter_nam] = cmd_opts.pinter
+
     ####################################################
     # Add <theAdditionalOptions> values to args
     for add_opt in theAdditionalOptions:
index fdb94657bd5394d3ce3c99e65c38397bd5260400..3b364115a33af3e9e1a15733145cefc8b0edf767 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 if [ $# -ne 0 ] ; then
-    ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* 
+    ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* 
 else
     python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py
 fi
index cbee4003dd7765a0d0d149c793f5b0d70caff183..5a0e5a89444d80947a50a85af981923c8b809135 100644 (file)
@@ -39,7 +39,7 @@ searchFreePort
 if [[ "$*" = "-nothing" ]]; then
     echo "port:$NSPORT"
 elif [ $# -ne 0 ] ; then
-    python -i ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* 
+    python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* 
 else
     python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py
 fi
index d39c788dd7ac847b0e228238790fbdccbca06f46..6ccc96453f38a59c5e79fe6a7dada9f46dac0b21 100755 (executable)
@@ -582,7 +582,11 @@ def startSalome(args, modules_list, modules_root_dir):
             print "i=",i
             anInterp=InterpServer(args)
             anInterp.run()
-    
+
+    # set PYTHONINSPECT variable
+    if args['pinter']:
+        os.environ["PYTHONINSPECT"]="1"
+        
     return clt
 
 # -----------------------------------------------------------------------------