#!/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
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
#
import killSalomeWithPort
self.killSalomeWithPort = killSalomeWithPort
return
- def __del__(self):
+ def delete(self):
self.killSalomeWithPort.killMyPort(self.port)
return
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
from searchFreePort import searchFreePort
searchFreePort(args, 0)
clt = useSalome(args, modules_list, modules_root_dir)
+
+ if args.has_key('shutdown_servers') :
+ var = args['shutdown_servers']
+ if hasattr(var, 'delete') and callable(getattr(var, 'delete')) :
+ var.delete()
return clt
# -----------------------------------------------------------------------------
# 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
foreGround(clt, args)
pass
# --
+ if args.has_key('shutdown_servers') :
+ var = args['shutdown_servers']
+ if hasattr(var, 'delete') and callable(getattr(var, 'delete')) :
+ var.delete()
pass
#