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 1261 of file Config.py.

Constructor & Destructor Documentation

def Config._ParameterModifier.__init__ (   self,
  args 
)

Definition at line 1263 of file Config.py.

1263  def __init__(self,args):
1264  self.__args = args
def __init__(self, args)
Definition: Config.py:1263

Member Function Documentation

def Config._ParameterModifier.__call__ (   self,
  obj 
)

Definition at line 1265 of file Config.py.

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

1265  def __call__(self,obj):
1266  params = {}
1267  for k in self.__args.iterkeys():
1268  if hasattr(obj,k):
1269  params[k] = getattr(obj,k)
1271  for k in self.__args.iterkeys():
1272  if k in params:
1273  setattr(obj,k,params[k])
1274  else:
1275  #the parameter must have been removed
1276  delattr(obj,k)
def _modifyParametersFromDict(params, newParams, errorRaiser, keyDepth="")
Definition: Mixins.py:630
def __call__(self, obj)
Definition: Config.py:1265
def Config._ParameterModifier._raiseUnknownKey (   key)
staticprivate

Definition at line 1278 of file Config.py.

Referenced by Config._ParameterModifier.__call__().

1279  raise KeyError("Unknown parameter name "+key+" specified while calling Modifier")
1280 

Member Data Documentation

Config._ParameterModifier.__args
private

Definition at line 1264 of file Config.py.

Referenced by Config._ParameterModifier.__call__().