#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
self.CMD=self.SCMD1 + ['"' + string.join(cata_path,'"::"') + '"'] + self.SCMD2
else:
self.CMD=self.SCMD1 + self.SCMD2
-
-class NotifyServer(Server):
- def __init__(self,args,modules_root_dir):
- self.args=args
- self.initArgs()
- self.modules_root_dir=modules_root_dir
- myLogName = os.environ["LOGNAME"]
- self.CMD=['notifd','-c',
- self.modules_root_dir["KERNEL"] +'/share/salome/resources/kernel/channel.cfg',
- '-DFactoryIORFileName=/tmp/'+myLogName+'_rdifact.ior',
- '-DChannelIORFileName=/tmp/'+myLogName+'_rdichan.ior',
- '-DReportLogFile=/tmp/'+myLogName+'_notifd.report',
- '-DDebugLogFile=/tmp/'+myLogName+'_notifd.debug',
- ]
-
#
# -----------------------------------------------------------------------------
args["session_object"] = session
return clt
- # Save Naming service port name into
- # the file args["ns_port_log_file"]
- if args.has_key('ns_port_log_file'):
- omniorbUserPath = os.getenv("OMNIORB_USER_PATH")
- file_name = os.path.join(omniorbUserPath, args["ns_port_log_file"])
- f = open(file_name, "w")
- f.write(os.environ['NSPORT'])
- f.close()
-
# Launch Logger Server (optional)
# and wait until it is registered in naming service
#
myServer.run()
clt.waitLogger("Logger")
- # Notify Server launch
- #
-
- if sys.platform != "win32":
- if verbose(): print "Notify Server to launch"
-
- myServer=NotifyServer(args,modules_root_dir)
- myServer.run()
-
# set siman python path before the session server launching to import scripts inside python console
if simanStudyName(args):
# MPV: use os.environ here because session server is launched in separated process and sys.path is missed in this case
else:
clt.waitNSPID("/Containers/" + theComputer + "/FactoryServer",myServer.PID)
- #
- # Launch local Python Container (FactoryServerPy),
- # and wait until it is registered in naming service
- #
-
if 'pyContainer' in args['standalone']:
raise Exception('Python containers no longer supported')
self.killSalomeWithPort.killMyPort(self.port)
return
pass
- args['shutdown_servers'] = __utils__(args['port'])
+ def func(s):
+ del s
+ import atexit
+ atexit.register(func, __utils__(args['port']))
pass
pass
if not args['gui'] or not args['session_gui']:
toimport = args['pyscript']
- from salomeLauncherUtils import formatScriptsAndArgs
+ from salomeContextUtils import formatScriptsAndArgs
command = formatScriptsAndArgs(toimport)
if command:
proc = subprocess.Popen(command, shell=True)
+ addToKillList(proc.pid, command, args['port'])
res = proc.wait()
if res: sys.exit(1) # if there's an error when executing script, we should explicitly exit
# define folder to store omniorb config (initially in virtual application folder)
try:
- from salomeLauncherUtils import setOmniOrbUserPath
+ from salomeContextUtils import setOmniOrbUserPath
setOmniOrbUserPath()
except Exception, e:
print e
sys.exit(1)
from salome_utils import getHostName
- print "runSalome running on %s" % getHostName()
args, modules_list, modules_root_dir = setenv.get_config()
+ print "runSalome running on %s" % getHostName()
kill_salome(args)
save_config = True
if test:
foreGround(clt, args)
pass
- # --
pass
#