From: mzn Date: Thu, 20 Sep 2007 09:16:38 +0000 (+0000) Subject: Fix for Bug NPAL16630 (runSalome and runAppli use python option "-i" when it has... X-Git-Tag: V4_1_0a1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2248c2589a3176b7e7fc0b518a69337ce5d7feda;p=modules%2Fkernel.git Fix for Bug NPAL16630 (runSalome and runAppli use python option "-i" when it has arguments, and no option otherwise). --- diff --git a/bin/appliskel/runAppli b/bin/appliskel/runAppli index 7693557c1..2bd9f1dae 100755 --- a/bin/appliskel/runAppli +++ b/bin/appliskel/runAppli @@ -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 diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index e34150400..f28a115be 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -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 ( section) # which are stored in opts with key _ (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 values to args for add_opt in theAdditionalOptions: diff --git a/bin/runSalome b/bin/runSalome index fdb94657b..3b364115a 100755 --- a/bin/runSalome +++ b/bin/runSalome @@ -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 diff --git a/bin/runSalome.ksh b/bin/runSalome.ksh index cbee4003d..5a0e5a894 100644 --- a/bin/runSalome.ksh +++ b/bin/runSalome.ksh @@ -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 diff --git a/bin/runSalome.py b/bin/runSalome.py index d39c788dd..6ccc96453 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -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 # -----------------------------------------------------------------------------