CMS 3D CMS Logo

List of all members | Public Member Functions | Static Private Member Functions | Private Attributes
Config._ParameterModifier Class Reference
Inheritance diagram for Config._ParameterModifier:

Public Member Functions

def __call__ (self, obj)
 
def __init__ (self, args)
 

Static Private Member Functions

def _raiseUnknownKey (key)
 

Private Attributes

 __args
 

Detailed Description

Helper class for Modifier that takes key/value pairs and uses them to reset parameters of the object

Definition at line 1508 of file Config.py.

Constructor & Destructor Documentation

◆ __init__()

def Config._ParameterModifier.__init__ (   self,
  args 
)

Definition at line 1510 of file Config.py.

1510  def __init__(self,args):
1511  self.__args = args

Member Function Documentation

◆ __call__()

def Config._ParameterModifier.__call__ (   self,
  obj 
)

Definition at line 1512 of file Config.py.

1512  def __call__(self,obj):
1513  params = {}
1514  for k in six.iterkeys(self.__args):
1515  if hasattr(obj,k):
1516  params[k] = getattr(obj,k)
1517  _modifyParametersFromDict(params, self.__args, self._raiseUnknownKey)
1518  for k in six.iterkeys(self.__args):
1519  if k in params:
1520  setattr(obj,k,params[k])
1521  else:
1522  #the parameter must have been removed
1523  delattr(obj,k)

References Config._ParameterModifier.__args, Mixins._modifyParametersFromDict(), and Config._ParameterModifier._raiseUnknownKey().

◆ _raiseUnknownKey()

def Config._ParameterModifier._raiseUnknownKey (   key)
staticprivate

Definition at line 1525 of file Config.py.

1525  def _raiseUnknownKey(key):
1526  raise KeyError("Unknown parameter name "+key+" specified while calling Modifier")
1527 

Referenced by Config._ParameterModifier.__call__().

Member Data Documentation

◆ __args

Config._ParameterModifier.__args
private

Definition at line 1511 of file Config.py.

Referenced by Config._ParameterModifier.__call__().

Mixins._modifyParametersFromDict
def _modifyParametersFromDict(params, newParams, errorRaiser, keyDepth="")
Definition: Mixins.py:701