import subprocess
absoluteAppliPath = os.getenv('ABSOLUTE_APPLI_PATH','')
env_copy = os.environ.copy()
- cmdDump=pickle.dumps(cmd,protocol=0)
- cmdString=cmdDump.decode()
- proc = subprocess.Popen(['python', os.path.join(absoluteAppliPath,"bin","salome","runConsole.py"), cmdString], shell=False, close_fds=True, env=env_copy)
- proc = subprocess.Popen(['python', os.path.join(absoluteAppliPath,"bin","salome","runConsole.py"), pickle.dumps(cmd)], shell=False, close_fds=True, env=env_copy)
++ cmdDump = pickle.dumps(cmd, protocol=0)
++ cmdString = cmdDump.decode()
++ proc = subprocess.Popen(['python3', os.path.join(absoluteAppliPath,"bin","salome","runConsole.py"), cmdString], shell=False, close_fds=True, env=env_copy)
proc.communicate()
return proc.returncode
#
# read args from launch configure xml file and command line options
- #*** Test additional option
- #*** import optparse
- #*** help_str = "Test options addition."
- #*** o_j = optparse.Option("-j", "--join", action="store_true", dest="join", help=help_str)
+
import launchConfigureParser
args = launchConfigureParser.get_env(exeName=exeName)
- #*** Test additional option
- #*** args = launchConfigureParser.get_env([o_j])
- #*** if args.has_key("join"): print args["join"]
+
# Check variables <module>_ROOT_DIR
# and set list of used modules (without KERNEL)
modules_list = []
- if args.has_key("modules"):
+ if "modules" in args:
- modules_list += args["modules"]
+ modules_list += [a for a in args["modules"] if a.strip()]
# KERNEL must be last in the list to locate it at the first place in PATH
if args["gui"] :
modules_list[:0] = ["GUI"]
"LD_LIBRARY_PATH")
add_path(os.path.join(module_root_dir,"bin",salome_subdir),
"PATH")
- if os.path.exists(module_root_dir + "/examples") :
+ if os.path.exists(os.path.join(module_root_dir, "examples")):
- add_path(os.path.join(module_root_dir, "examples"),
+ add_path(os.path.join(module_root_dir,"examples"),
"PYTHONPATH")
pass
add_path(os.path.join(module_root_dir,"bin",salome_subdir),
# set trace environment variable
- if not os.environ.has_key("SALOME_trace"):
+ if "SALOME_trace" not in os.environ:
os.environ["SALOME_trace"]="local"
if args['file']:
- os.environ["SALOME_trace"] = "file:" + args['file'][0]
+ os.environ["SALOME_trace"]="file:"+args['file'][0]
if args['logger']:
os.environ["SALOME_trace"]="with_logger"
engine=lcc.FindComponent(param,'SalomeTestComponent')
engine.Coucou(1)
except :
- print 'lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent") failed'
+ print('lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent") failed')
import sys
- import CORBA
+ from omniORB import CORBA
import CosNaming
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
obj = orb.resolve_initial_references("NameService")