CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Config._ParameterModifier Class Reference
Inheritance diagram for Config._ParameterModifier:

Public Member Functions

def __call__
 
def __init__
 

Private Member Functions

def _raiseUnknownKey
 

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

Constructor & Destructor Documentation

def Config._ParameterModifier.__init__ (   self,
  args 
)

Definition at line 1107 of file Config.py.

1108  def __init__(self,args):
self.__args = args

Member Function Documentation

def Config._ParameterModifier.__call__ (   self,
  obj 
)

Definition at line 1109 of file Config.py.

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

1110  def __call__(self,obj):
1111  params = {}
1112  for k in self.__args.iterkeys():
1113  if hasattr(obj,k):
1114  params[k] = getattr(obj,k)
1115  else:
1116  params[k] = self.__args[k]
1118  for k in self.__args.iterkeys():
1119  if k in params:
1120  setattr(obj,k,params[k])
1121  else:
1122  #the parameter must have been removed
delattr(obj,k)
def _modifyParametersFromDict
Definition: Mixins.py:613
def Config._ParameterModifier._raiseUnknownKey (   key)
private

Definition at line 1123 of file Config.py.

Referenced by Config._ParameterModifier.__call__().

1124  def _raiseUnknownKey(key):
1125  raise KeyError("Unknown parameter name "+k+" specified while calling Modifier")

Member Data Documentation

Config._ParameterModifier.__args
private

Definition at line 1108 of file Config.py.

Referenced by Config._ParameterModifier.__call__().