Salome HOME
projects
/
modules
/
kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[EDF30356] : Extend management of maximum_time attribute format from pylauncher to...
[modules/kernel.git]
/
bin
/
salomeContextUtils.py.in
diff --git
a/bin/salomeContextUtils.py.in
b/bin/salomeContextUtils.py.in
index c45076dd5352ed195ab247544cb5ed4f39f18ff9..71192305de34aaf0b1ec1d1330cf2097ebcf3791 100644
(file)
--- a/
bin/salomeContextUtils.py.in
+++ b/
bin/salomeContextUtils.py.in
@@
-1,4
+1,4
@@
-# Copyright (C) 2013-202
0 CEA/DEN, EDF R&D
, OPEN CASCADE
+# Copyright (C) 2013-202
4 CEA, EDF
, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@
-261,9
+261,10
@@
def getScriptsAndArgs(args=None, searchPathList=None):
ispython = True
break
pass
ispython = True
break
pass
- fn.close()
- except:
+ except Exception:
pass
pass
+ finally:
+ fn.close()
if not ispython and script_extension == ".py":
currentKey = "@PYTHONBIN@ "+currentScript
else:
if not ispython and script_extension == ".py":
currentKey = "@PYTHONBIN@ "+currentScript
else:
@@
-286,12
+287,18
@@
def getScriptsAndArgs(args=None, searchPathList=None):
# Formatting scripts and args as a Bash-like command-line:
# script1.py [args] ; script2.py [args] ; ...
# scriptArgs is a list of ScriptAndArgs objects; their output parameters are omitted
# Formatting scripts and args as a Bash-like command-line:
# script1.py [args] ; script2.py [args] ; ...
# scriptArgs is a list of ScriptAndArgs objects; their output parameters are omitted
-def formatScriptsAndArgs(scriptArgs=None):
+def formatScriptsAndArgs(scriptArgs=None
, escapeSpaces=False
):
if scriptArgs is None:
return ""
commands = []
for sa_obj in scriptArgs:
cmd = sa_obj.script
if scriptArgs is None:
return ""
commands = []
for sa_obj in scriptArgs:
cmd = sa_obj.script
+ if escapeSpaces and cmd:
+ if sys.platform == "win32":
+ cmd = cmd.replace(' ', ' "', 1)
+ cmd = cmd + '"'
+ else:
+ cmd = cmd.replace(' ', '\ ').replace('\ ', ' ', 1)
if sa_obj.args:
cmd = " ".join([cmd]+sa_obj.args)
commands.append(cmd)
if sa_obj.args:
cmd = " ".join([cmd]+sa_obj.args)
commands.append(cmd)
@@
-329,7
+336,7
@@
def setOmniOrbUserPath():
if not os.access(temp_dir, os.W_OK):
raise Exception("Unable to get write access to directory: %s"%temp_dir)
os.environ["OMNIORB_USER_PATH"] = temp_dir
if not os.access(temp_dir, os.W_OK):
raise Exception("Unable to get write access to directory: %s"%temp_dir)
os.environ["OMNIORB_USER_PATH"] = temp_dir
- except:
+ except
Exception
:
homePath = os.path.realpath(os.path.expanduser('~'))
#defaultOmniorbUserPath = os.path.join(homePath, ".salomeConfig/USERS")
defaultOmniorbUserPath = homePath
homePath = os.path.realpath(os.path.expanduser('~'))
#defaultOmniorbUserPath = os.path.join(homePath, ".salomeConfig/USERS")
defaultOmniorbUserPath = homePath