ior_fakens_filename = useSalome(args, modules_list, modules_root_dir)
# Management of -t <script.py>
toimport = []
+ env = os.environ
if 'gui' in args and 'session_gui' in args:
if not args['gui'] or not args['session_gui']:
if 'study_hdf' in args:
toopen = args['study_hdf']
if toopen:
- import salome
- salome.salome_init(path=toopen)
+ os.environ["PATH_TO_STUDY_FILE_TO_INITIATE"] = toopen
+ logger.debug("An input Study has been specified {} -> pass it with PATH_TO_STUDY_FILE_TO_INITIATE env var".format(toopen))
if 'pyscript' in args:
toimport = args['pyscript']
from salomeContextUtils import formatScriptsAndArgs
command = formatScriptsAndArgs(toimport, escapeSpaces=True)
if command:
logger.debug("Launching following shell command : {}".format(str(command)))
- proc = subprocess.Popen(command, shell=True)
+ proc = subprocess.Popen(command, shell=True, env = env)
addToKillList(proc.pid, command)
res = proc.wait()
if res: sys.exit(1)
"""
:param iorfakensfile: filename inside which IOR of fake NS will be written
"""
+ PATH_TO_STUDY_FILE_TO_INITIATE = "PATH_TO_STUDY_FILE_TO_INITIATE"
import KernelBasis
if KernelBasis.getSSLMode():
if KernelBasis.getIOROfEmbeddedNS() == "":
+ import os
+ # make runSalome.py -t study.hdf toto.py
+ if path is None and PATH_TO_STUDY_FILE_TO_INITIATE in os.environ:
+ path = os.environ[PATH_TO_STUDY_FILE_TO_INITIATE]
salome_init_without_session(path, embedded, iorfakensfile)
else:
salome_init_without_session_attached(path, embedded)