From ed445c5c57018ee29abfcb3faec17739a678edbc Mon Sep 17 00:00:00 2001 From: mzn Date: Wed, 19 Sep 2007 14:06:49 +0000 Subject: [PATCH] Fix for Bug NPAL16630 (runSalome and runAppli use python option "-i" when it has arguments, and no option otherwise). --- bin/appliskel/runAppli | 2 +- bin/launchConfigureParser.py | 20 +++++++++++++++++--- bin/runSalome | 2 +- bin/runSalome.ksh | 2 +- bin/runSalome.py | 4 ++++ 5 files changed, 24 insertions(+), 6 deletions(-) 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 ac9b89fd9..575c32061 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -48,6 +48,7 @@ key_nam = "key" 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) @@ -61,7 +62,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 @@ -486,6 +487,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 @@ -502,7 +510,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", @@ -667,7 +677,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 @@ -752,6 +762,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 1aa76c4c6..afd859e37 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -785,6 +785,10 @@ 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 -- 2.39.2