From 8e1801bd3c8597805de87a0c1ae9800328b961cb Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 31 Aug 2006 07:17:44 +0000 Subject: [PATCH] Join modifications from branch BR_JR_from_V3_2_0b1: --terminal option for CCRT. --- bin/launchConfigureParser.py | 5 +++++ bin/runSalome.py | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index 4a568215c..ed3129933 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -53,6 +53,7 @@ plugins_nam = "plugins" appname_nam = "appname" port_nam = "port" appname = "SalomeApp" +script_nam = "pyscript" # values of boolean type (must be '0' or '1'). # xml_parser.boolValue() is used for correct setting @@ -362,6 +363,8 @@ if cmd_opts.has_key("h"): --help or -h : print this help --gui or -g : launching with GUI --terminal -t : launching without gui (to deny --gui) + or -t=PythonScript[,...] + : import of PythonScript(s) --logger or -l : redirect messages in a CORBA collector --file=filename or -f=filename: redirect messages in a log file --xterm or -x : execute servers in xterm console (messages appear in xterm windows) @@ -427,8 +430,10 @@ if not cmd_opts.has_key( "m" ) and os.getenv( "SALOME_MODULES" ): pass # 'terminal' must be processed in the end: to deny any 'gui' options +args[script_nam] = [] if 't' in cmd_opts: args[gui_nam] = 0 + args[script_nam] = cmd_opts['t'] pass # now modify SalomeAppConfig environment variable diff --git a/bin/runSalome.py b/bin/runSalome.py index 7311f00d9..33490ab1a 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -820,6 +820,19 @@ def useSalome(args, modules_list, modules_root_dir): print " --- registered objects tree in Naming Service ---" clt.showNS() + # run python scripts, passed via -t option + toimport = args['pyscript'] + i = 0 + while i < len( toimport ) : + if toimport[ i ] == 'killall': + print "killall : option disabled" + #killAllPorts() + else: + print 'importing',toimport[ i ] + doimport = 'import ' + toimport[ i ] + exec doimport + i = i + 1 + return clt # ----------------------------------------------------------------------------- -- 2.39.2