In CRL Core, added helpers.overload() to modificate Python tuples.
This commit is contained in:
parent
e89eae6272
commit
62a433ad3c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue