In CRL Core, added helpers.overload() to modificate Python tuples.

This commit is contained in:
Jean-Paul Chaput 2017-11-29 17:06:24 +01:00
parent e89eae6272
commit 62a433ad3c
1 changed files with 17 additions and 0 deletions

View File

@ -279,6 +279,23 @@ def setTraceLevel ( level ):
return
def overload ( defaultParameters, parameters ):
overloads = {}
overloadParameters = []
for parameter in parameters:
overloads[ parameter[0] ] = parameter
for parameter in defaultParameters:
if overloads.has_key(parameter[0]):
overloadParameters.append( overloads[parameter[0]] )
else:
overloadParameters.append( parameter )
return tuple(overloadParameters)
def lambdaMode ():
global unitsLambda
unitsLambda = true