sys.path[:0] = pythonpath
#
- def _runAppli(self, args=[]):
+ def _runAppli(self, args=None):
+ if args is None:
+ args = []
# Initialize SALOME environment
sys.argv = ['runSalome'] + args
import setenv
return proc.communicate()
#
- def _runSession(self, args=[]):
+ def _runSession(self, args=None):
+ if args is None:
+ args = []
sys.argv = ['runSession'] + args
import runSession
params, args = runSession.configureSession(args, exe="salome shell")
return runSession.runSession(params, args)
#
- def _runConsole(self, args=[]):
+ def _runConsole(self, args=None):
+ if args is None:
+ args = []
# Initialize SALOME environment
sys.argv = ['runConsole'] + args
import setenv
return proc.communicate()
#
- def _kill(self, args=[]):
+ def _kill(self, args=None):
+ if args is None:
+ args = []
ports = args
if not ports:
print "Port number(s) not provided to command: salome kill <port(s)>"
pass
#
- def _runTests(self, args=[]):
+ def _runTests(self, args=None):
+ if args is None:
+ args = []
sys.argv = ['runTests']
import setenv
setenv.main(True)
return json.JSONEncoder.default(self, obj)
#
-def getShortAndExtraArgs(args=[]):
+def getShortAndExtraArgs(args=None):
+ if args is None:
+ args = []
try:
pos = args.index("--") # raise a ValueError if not found
short_args = args[:pos]
#
# Return an array of ScriptAndArgs objects
-def getScriptsAndArgs(args=[], searchPathList=None):
+def getScriptsAndArgs(args=None, searchPathList=None):
+ if args is None:
+ args = []
short_args, extra_args = getShortAndExtraArgs(args)
args = short_args