# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2017 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
options, args = __parse_args(args)
host, port, filename = __get_running_session(options.port)
if not port:
- sys.exit(0)
+ return 0
cmd = [
"os.environ['OMNIORB_CONFIG'] = '%s'"%filename,
if command is None:
if args and args[0] in ["-h","--help","help"]:
usage()
- sys.exit(0)
+ return 0
# try to default to "start" command
command = "_runAppli"
except SystemExit, returncode:
if returncode != 0:
self.getLogger().error("SystemExit %s in method %s.", returncode, command)
- sys.exit(returncode)
+ return returncode
except StandardError:
self.getLogger().error("Unexpected error:")
import traceback
traceback.print_exc()
- sys.exit(1)
+ return 1
except SalomeContextException, e:
self.getLogger().error(e)
- sys.exit(1)
+ return 1
#
def __setContextFromConfigFile(self, filename, reserved=None):
except SalomeContextException, e:
msg = "%s"%e
self.getLogger().error(msg)
- sys.exit(1)
+ return 1
# unset variables
for var in unsetVars:
print ""
print " SALOME is working for you; what else?"
print ""
- sys.exit(0)
#
def _getCar(self, unused=None):
print ""
print " Drive your simulation properly with SALOME!"
print ""
- sys.exit(0)
#
# Add the following two methods since logger is not pickable
context = pickle.loads(sys.argv[1])
args = pickle.loads(sys.argv[2])
- (out, err) = context._startSalome(args)
- if out:
- sys.stdout.write(out)
- if err:
- sys.stderr.write(err)
+ context._startSalome(args)
else:
usage()
#