GaudiKernel.Configurable.ConfigurableUser Class Reference
Inheritance diagram for GaudiKernel.Configurable.ConfigurableUser:
Collaboration diagram for GaudiKernel.Configurable.ConfigurableUser:

Public Member Functions

def __init__ (self, name=Configurable.DefaultName, _enabled=True, kwargs)
 
def getGaudiType (self)
 
def getDlls (self)
 
def getHandle (self)
 
def __detach_used__ (self)
 
def propagateProperty
 
def propagateProperties
 
def __apply_configuration__ (self)
 
def applyConf (self)
 
def getUsedInstance (self, name)
 
def isApplicable (self)
 
def __init__ (self, name=Configurable.DefaultName, _enabled=True, kwargs)
 
def getGaudiType (self)
 
def getDlls (self)
 
def getHandle (self)
 
def __detach_used__ (self)
 
def propagateProperty
 
def propagateProperties
 
def __apply_configuration__ (self)
 
def applyConf (self)
 
def getUsedInstance (self, name)
 
def isApplicable (self)
 
- Public Member Functions inherited from GaudiKernel.Configurable.Configurable
def __new__ (cls, args, kwargs)
 
def __init__
 
def __getstate__ (self)
 
def __getnewargs__ (self)
 
def __setstate__ (self, dict)
 
def __len__ (self)
 
def __iter__ (self)
 
def __deepcopy__ (self, memo)
 
def __iadd__
 
def __getattr__ (self, attr)
 
def __setattr__ (self, name, value)
 
def __delattr__ (self, attr)
 
def __nonzero__ (self)
 
def remove (self, items)
 
def removeAll (self)
 
def copyChild (self, child)
 
def setParent (self, parentName)
 
def getParent (self)
 
def hasParent (self, parent)
 
def copyChildAndSetParent (self, cfg, parent)
 
def getChildren (self)
 
def getTools (self)
 
def children (self)
 
def getAllChildren (self)
 
def getSequence (self)
 
def setup (self)
 
def getProperties (self)
 
def getPropertiesWithDescription (self)
 
def getValuedProperties (self)
 
def properties (self)
 
def getDefaultProperties (cls)
 
def getDefaultProperty (cls, name)
 
def getProp (self, name)
 
def setProp (self, name, value)
 
def isPropertySet (self, name)
 
def getType (cls)
 
def getName (self)
 
def name (self)
 
def getJobOptName (self)
 
def isPublic (self)
 
def jobOptName (self)
 
def getFullName (self)
 
def getFullJobOptName (self)
 
def getPrintTitle (self)
 
def getTitleName (self)
 
def setDefaults (cls, handle)
 
def clone (self, name=None, kwargs)
 
def splitName (self)
 
def addTool
 
def __repr__ (self)
 
def __str__
 
def __new__ (cls, args, kwargs)
 
def __init__
 
def __getstate__ (self)
 
def __getnewargs__ (self)
 
def __setstate__ (self, dict)
 
def __len__ (self)
 
def __iter__ (self)
 
def __deepcopy__ (self, memo)
 
def __iadd__
 
def __getattr__ (self, attr)
 
def __setattr__ (self, name, value)
 
def __delattr__ (self, attr)
 
def __nonzero__ (self)
 
def remove (self, items)
 
def removeAll (self)
 
def copyChild (self, child)
 
def setParent (self, parentName)
 
def getParent (self)
 
def hasParent (self, parent)
 
def copyChildAndSetParent (self, cfg, parent)
 
def getChildren (self)
 
def getTools (self)
 
def children (self)
 
def getAllChildren (self)
 
def getSequence (self)
 
def setup (self)
 
def getProperties (self)
 
def getPropertiesWithDescription (self)
 
def getValuedProperties (self)
 
def properties (self)
 
def getDefaultProperties (cls)
 
def getDefaultProperty (cls, name)
 
def getProp (self, name)
 
def setProp (self, name, value)
 
def isPropertySet (self, name)
 
def getType (cls)
 
def getName (self)
 
def name (self)
 
def getJobOptName (self)
 
def isPublic (self)
 
def jobOptName (self)
 
def getFullName (self)
 
def getFullJobOptName (self)
 
def getPrintTitle (self)
 
def getTitleName (self)
 
def setDefaults (cls, handle)
 
def clone (self, name=None, kwargs)
 
def splitName (self)
 
def addTool
 
def __repr__ (self)
 
def __str__
 

Private Member Functions

def __addActiveUseOf (self, other)
 
def __addPassiveUseOf (self, other)
 
def _instanceName (self, cls)
 
def __addActiveUseOf (self, other)
 
def __addPassiveUseOf (self, other)
 
def _instanceName (self, cls)
 

Private Attributes

 _enabled
 
 __users__
 
 _applied
 
 __used_instances__
 

Static Private Attributes

dictionary __slots__
 
list __used_configurables__ = []
 list of ConfigurableUser classes this one is going to modify in the apply_configuration method. More...
 
list __queried_configurables__ = []
 list of ConfigurableUser classes this one is going to query in the apply_configuration method More...
 

Additional Inherited Members

- Static Public Attributes inherited from GaudiKernel.Configurable.Configurable
string indentUnit = '| '
 
int printHeaderWidth = 100
 
int printHeaderPre = 5
 
dictionary allConfigurables = {}
 
dictionary configurableServices = {}
 

Detailed Description

Definition at line 1136 of file Configurable.py.

Constructor & Destructor Documentation

def GaudiKernel.Configurable.ConfigurableUser.__init__ (   self,
  name = Configurable.DefaultName,
  _enabled = True,
  kwargs 
)

Definition at line 1153 of file Configurable.py.

1153  def __init__( self, name = Configurable.DefaultName, _enabled = True, **kwargs ):
1154  super( ConfigurableUser, self ).__init__( name )
1155  for n, v in kwargs.items():
1156  setattr(self, n, v)
1157  self._enabled = _enabled
1158  self.__users__ = []
1159  self._applied = False
1160 
1161  # Needed to retrieve the actual class if the declaration in __used_configurables__
1162  # and __queried_configurables__ is done with strings.
1163  from GaudiKernel.ConfigurableDb import getConfigurable as confDbGetConfigurable
1164 
1165  # Set the list of users of the used configurables
1166  #
1168  for used in self.__used_configurables__:
1169  # By default we want to use the default name of the instances
1170  # for the used configurables
1171  used_name = Configurable.DefaultName
1172  # If the entry in the list is a tuple, we need a named instance
1173  if type(used) is tuple:
1174  used, used_name = used # we re-set used to re-use the code below
1175  if not used_name:
1176  used_name = self._instanceName(used)
1177  # Check is 'used' is a string or not
1178  if type(used) is str:
1179  used_class = confDbGetConfigurable(used)
1180  else:
1181  used_class = used
1182  # Instantiate the configurable that we are going to use
1183  try:
1184  inst = used_class(name = used_name, _enabled = False)
1185  except AttributeError:
1186  # This cover the case where the used configurable is not a
1187  # ConfigurableUser instance, i.e. id doesn't have the attribute
1188  # '_enabled'.
1189  inst = used_class(name = used_name)
1190  self.__addActiveUseOf(inst)
1191  for queried in self.__queried_configurables__:
1192  try:
1193  if type(queried) is str:
1194  queried = confDbGetConfigurable(queried)
1195  inst = queried(_enabled = False)
1196  except AttributeError:
1197  inst = queried()
1198  self.__addPassiveUseOf(inst)
list __queried_configurables__
list of ConfigurableUser classes this one is going to query in the apply_configuration method ...
def __init__(self, name=Configurable.DefaultName, _enabled=True, kwargs)
list __used_configurables__
list of ConfigurableUser classes this one is going to modify in the apply_configuration method...
string type
Definition: gaudirun.py:151
def GaudiKernel.Configurable.ConfigurableUser.__init__ (   self,
  name = Configurable.DefaultName,
  _enabled = True,
  kwargs 
)

Definition at line 1153 of file Configurable.py.

1153  def __init__( self, name = Configurable.DefaultName, _enabled = True, **kwargs ):
1154  super( ConfigurableUser, self ).__init__( name )
1155  for n, v in kwargs.items():
1156  setattr(self, n, v)
1157  self._enabled = _enabled
1158  self.__users__ = []
1159  self._applied = False
1160 
1161  # Needed to retrieve the actual class if the declaration in __used_configurables__
1162  # and __queried_configurables__ is done with strings.
1163  from GaudiKernel.ConfigurableDb import getConfigurable as confDbGetConfigurable
1164 
1165  # Set the list of users of the used configurables
1166  #
1168  for used in self.__used_configurables__:
1169  # By default we want to use the default name of the instances
1170  # for the used configurables
1171  used_name = Configurable.DefaultName
1172  # If the entry in the list is a tuple, we need a named instance
1173  if type(used) is tuple:
1174  used, used_name = used # we re-set used to re-use the code below
1175  if not used_name:
1176  used_name = self._instanceName(used)
1177  # Check is 'used' is a string or not
1178  if type(used) is str:
1179  used_class = confDbGetConfigurable(used)
1180  else:
1181  used_class = used
1182  # Instantiate the configurable that we are going to use
1183  try:
1184  inst = used_class(name = used_name, _enabled = False)
1185  except AttributeError:
1186  # This cover the case where the used configurable is not a
1187  # ConfigurableUser instance, i.e. id doesn't have the attribute
1188  # '_enabled'.
1189  inst = used_class(name = used_name)
1190  self.__addActiveUseOf(inst)
1191  for queried in self.__queried_configurables__:
1192  try:
1193  if type(queried) is str:
1194  queried = confDbGetConfigurable(queried)
1195  inst = queried(_enabled = False)
1196  except AttributeError:
1197  inst = queried()
1198  self.__addPassiveUseOf(inst)
list __queried_configurables__
list of ConfigurableUser classes this one is going to query in the apply_configuration method ...
def __init__(self, name=Configurable.DefaultName, _enabled=True, kwargs)
list __used_configurables__
list of ConfigurableUser classes this one is going to modify in the apply_configuration method...
string type
Definition: gaudirun.py:151

Member Function Documentation

def GaudiKernel.Configurable.ConfigurableUser.__addActiveUseOf (   self,
  other 
)
private
Declare that we are going to modify the Configurable 'other' in our
__apply_configuration__.

Definition at line 1199 of file Configurable.py.

1199  def __addActiveUseOf(self, other):
1200  """
1201  Declare that we are going to modify the Configurable 'other' in our
1202  __apply_configuration__.
1203  """
1204  self.__used_instances__.append(other)
1205  if hasattr(other, "__users__"): # allow usage of plain Configurables
1206  other.__users__.append(self)
def GaudiKernel.Configurable.ConfigurableUser.__addActiveUseOf (   self,
  other 
)
private
Declare that we are going to modify the Configurable 'other' in our
__apply_configuration__.

Definition at line 1199 of file Configurable.py.

1199  def __addActiveUseOf(self, other):
1200  """
1201  Declare that we are going to modify the Configurable 'other' in our
1202  __apply_configuration__.
1203  """
1204  self.__used_instances__.append(other)
1205  if hasattr(other, "__users__"): # allow usage of plain Configurables
1206  other.__users__.append(self)
def GaudiKernel.Configurable.ConfigurableUser.__addPassiveUseOf (   self,
  other 
)
private
Declare that we are going to retrieve property values from the
ConfigurableUser 'other' in our __apply_configuration__.

Definition at line 1207 of file Configurable.py.

1207  def __addPassiveUseOf(self, other):
1208  """
1209  Declare that we are going to retrieve property values from the
1210  ConfigurableUser 'other' in our __apply_configuration__.
1211  """
1212  if not isinstance(other, ConfigurableUser):
1213  raise Error("'%s': Cannot make passive use of '%s', it is not a ConfigurableUser" % (self.name(), other.name()))
1214  other.__addActiveUseOf(self)
def GaudiKernel.Configurable.ConfigurableUser.__addPassiveUseOf (   self,
  other 
)
private
Declare that we are going to retrieve property values from the
ConfigurableUser 'other' in our __apply_configuration__.

Definition at line 1207 of file Configurable.py.

1207  def __addPassiveUseOf(self, other):
1208  """
1209  Declare that we are going to retrieve property values from the
1210  ConfigurableUser 'other' in our __apply_configuration__.
1211  """
1212  if not isinstance(other, ConfigurableUser):
1213  raise Error("'%s': Cannot make passive use of '%s', it is not a ConfigurableUser" % (self.name(), other.name()))
1214  other.__addActiveUseOf(self)
def GaudiKernel.Configurable.ConfigurableUser.__apply_configuration__ (   self)
Function to be overridden to convert the high level configuration into a
low level one.
The default implementation calls applyConf, which is the method defined
in some ConfigurableUser implementations.

Definition at line 1291 of file Configurable.py.

1292  """
1293  Function to be overridden to convert the high level configuration into a
1294  low level one.
1295  The default implementation calls applyConf, which is the method defined
1296  in some ConfigurableUser implementations.
1297  """
1298  return self.applyConf()
1299 
def GaudiKernel.Configurable.ConfigurableUser.__apply_configuration__ (   self)
Function to be overridden to convert the high level configuration into a
low level one.
The default implementation calls applyConf, which is the method defined
in some ConfigurableUser implementations.

Definition at line 1291 of file Configurable.py.

1292  """
1293  Function to be overridden to convert the high level configuration into a
1294  low level one.
1295  The default implementation calls applyConf, which is the method defined
1296  in some ConfigurableUser implementations.
1297  """
1298  return self.applyConf()
1299 
def GaudiKernel.Configurable.ConfigurableUser.__detach_used__ (   self)
Remove this ConfigurableUser instance from the users list of the used
instances.

Definition at line 1222 of file Configurable.py.

1222  def __detach_used__(self):
1223  """
1224  Remove this ConfigurableUser instance from the users list of the used
1225  instances.
1226  """
1227  for used in self.__used_instances__:
1228  if hasattr(used, "__users__"): # allow usage of plain Configurables
1229  used.__users__.remove(self)
1230 
def GaudiKernel.Configurable.ConfigurableUser.__detach_used__ (   self)
Remove this ConfigurableUser instance from the users list of the used
instances.

Definition at line 1222 of file Configurable.py.

1222  def __detach_used__(self):
1223  """
1224  Remove this ConfigurableUser instance from the users list of the used
1225  instances.
1226  """
1227  for used in self.__used_instances__:
1228  if hasattr(used, "__users__"): # allow usage of plain Configurables
1229  used.__users__.remove(self)
1230 
def GaudiKernel.Configurable.ConfigurableUser._instanceName (   self,
  cls 
)
private
Function used to define the name of the private instance of a given class
name.
This method is used when the __used_configurables_property__ declares the
need of a private used configurable without specifying the name.

Definition at line 1307 of file Configurable.py.

1307  def _instanceName(self, cls):
1308  """
1309  Function used to define the name of the private instance of a given class
1310  name.
1311  This method is used when the __used_configurables_property__ declares the
1312  need of a private used configurable without specifying the name.
1313  """
1314  if type(cls) is str:
1315  clName = cls
1316  else:
1317  clName = cls.__name__
1318  return "%s_%s" % (self.name(), clName)
1319 
string type
Definition: gaudirun.py:151
def GaudiKernel.Configurable.ConfigurableUser._instanceName (   self,
  cls 
)
private
Function used to define the name of the private instance of a given class
name.
This method is used when the __used_configurables_property__ declares the
need of a private used configurable without specifying the name.

Definition at line 1307 of file Configurable.py.

1307  def _instanceName(self, cls):
1308  """
1309  Function used to define the name of the private instance of a given class
1310  name.
1311  This method is used when the __used_configurables_property__ declares the
1312  need of a private used configurable without specifying the name.
1313  """
1314  if type(cls) is str:
1315  clName = cls
1316  else:
1317  clName = cls.__name__
1318  return "%s_%s" % (self.name(), clName)
1319 
string type
Definition: gaudirun.py:151
def GaudiKernel.Configurable.ConfigurableUser.applyConf (   self)
Function to be overridden to convert the high level configuration into a
low level one.

Definition at line 1300 of file Configurable.py.

1300  def applyConf( self ):
1301  """
1302  Function to be overridden to convert the high level configuration into a
1303  low level one.
1304  """
1305  pass
1306 
def GaudiKernel.Configurable.ConfigurableUser.applyConf (   self)
Function to be overridden to convert the high level configuration into a
low level one.

Definition at line 1300 of file Configurable.py.

1300  def applyConf( self ):
1301  """
1302  Function to be overridden to convert the high level configuration into a
1303  low level one.
1304  """
1305  pass
1306 
def GaudiKernel.Configurable.ConfigurableUser.getDlls (   self)

Definition at line 1217 of file Configurable.py.

1217  def getDlls( self ):
1218  return None
def GaudiKernel.Configurable.ConfigurableUser.getDlls (   self)

Definition at line 1217 of file Configurable.py.

1217  def getDlls( self ):
1218  return None
def GaudiKernel.Configurable.ConfigurableUser.getGaudiType (   self)

Definition at line 1215 of file Configurable.py.

1215  def getGaudiType( self ):
1216  return 'User'
def GaudiKernel.Configurable.ConfigurableUser.getGaudiType (   self)

Definition at line 1215 of file Configurable.py.

1215  def getGaudiType( self ):
1216  return 'User'
def GaudiKernel.Configurable.ConfigurableUser.getHandle (   self)

Definition at line 1219 of file Configurable.py.

1219  def getHandle( self ):
1220  return None
1221 
def GaudiKernel.Configurable.ConfigurableUser.getHandle (   self)

Definition at line 1219 of file Configurable.py.

1219  def getHandle( self ):
1220  return None
1221 
def GaudiKernel.Configurable.ConfigurableUser.getUsedInstance (   self,
  name 
)
Return the used instance with a given name.

Definition at line 1320 of file Configurable.py.

1320  def getUsedInstance(self, name):
1321  """
1322  Return the used instance with a given name.
1323  """
1324  for i in self.__used_instances__:
1325  if i.name() == name:
1326  if hasattr(i, "_enabled"):
1327  # ensure that the instances retrieved through the method are
1328  # enabled
1329  i._enabled = True
1330  return i
1331  raise KeyError(name)
1332 
def GaudiKernel.Configurable.ConfigurableUser.getUsedInstance (   self,
  name 
)
Return the used instance with a given name.

Definition at line 1320 of file Configurable.py.

1320  def getUsedInstance(self, name):
1321  """
1322  Return the used instance with a given name.
1323  """
1324  for i in self.__used_instances__:
1325  if i.name() == name:
1326  if hasattr(i, "_enabled"):
1327  # ensure that the instances retrieved through the method are
1328  # enabled
1329  i._enabled = True
1330  return i
1331  raise KeyError(name)
1332 
def GaudiKernel.Configurable.ConfigurableUser.isApplicable (   self)
Return True is the instance can be "applied".

Definition at line 1333 of file Configurable.py.

1333  def isApplicable(self):
1334  '''
1335  Return True is the instance can be "applied".
1336  '''
1337  return (not self.__users__) and (not self._applied)
1338 
1339 
1340 # list of callables to be called after all the __apply_configuration__ are called.
def GaudiKernel.Configurable.ConfigurableUser.isApplicable (   self)
Return True is the instance can be "applied".

Definition at line 1333 of file Configurable.py.

1333  def isApplicable(self):
1334  '''
1335  Return True is the instance can be "applied".
1336  '''
1337  return (not self.__users__) and (not self._applied)
1338 
1339 
1340 # list of callables to be called after all the __apply_configuration__ are called.
def GaudiKernel.Configurable.ConfigurableUser.propagateProperties (   self,
  names = None,
  others = None,
  force = True 
)
Call propagateProperty for each property listed in 'names'.
If 'names' is None, all the properties are propagated.

Definition at line 1280 of file Configurable.py.

1280  def propagateProperties(self, names = None, others = None, force = True):
1281  """
1282  Call propagateProperty for each property listed in 'names'.
1283  If 'names' is None, all the properties are propagated.
1284  """
1285  if names is None:
1286  # use all the non-private slots
1287  names = [ p for p in self.__slots__ if not p.startswith("_") ]
1288  for n in names:
1289  self.propagateProperty(n, others, force)
1290 
def GaudiKernel.Configurable.ConfigurableUser.propagateProperties (   self,
  names = None,
  others = None,
  force = True 
)
Call propagateProperty for each property listed in 'names'.
If 'names' is None, all the properties are propagated.

Definition at line 1280 of file Configurable.py.

1280  def propagateProperties(self, names = None, others = None, force = True):
1281  """
1282  Call propagateProperty for each property listed in 'names'.
1283  If 'names' is None, all the properties are propagated.
1284  """
1285  if names is None:
1286  # use all the non-private slots
1287  names = [ p for p in self.__slots__ if not p.startswith("_") ]
1288  for n in names:
1289  self.propagateProperty(n, others, force)
1290 
def GaudiKernel.Configurable.ConfigurableUser.propagateProperty (   self,
  name,
  others = None,
  force = True 
)
Propagate the property 'name' (if set) to other configurables (if possible).
'others' can be:
    None:
propagate to all the entries in __used_configurables__
    a configurable instance:
propagate only to it
    list of configurable instances:
propagate to all of them.


The logic is:
- if the local property is set, the other property will be overwritten
- local property not set and other set => keep other
- local property not set and other not set => overwrite the default for
    ConfigurableUser instances and set the property for Configurables

Definition at line 1231 of file Configurable.py.

1231  def propagateProperty(self, name, others = None, force = True):
1232  """
1233  Propagate the property 'name' (if set) to other configurables (if possible).
1234  'others' can be:
1235  None:
1236  propagate to all the entries in __used_configurables__
1237  a configurable instance:
1238  propagate only to it
1239  list of configurable instances:
1240  propagate to all of them.
1241 
1242 
1243  The logic is:
1244  - if the local property is set, the other property will be overwritten
1245  - local property not set and other set => keep other
1246  - local property not set and other not set => overwrite the default for
1247  ConfigurableUser instances and set the property for Configurables
1248  """
1249  # transform 'others' to a list of configurable instances
1250  if others is None:
1251  others = self.__used_instances__
1252  elif type(others) not in [ list, tuple ] :
1253  others = [ others ]
1254  # these can be computed before the loop
1255  local_is_set = self.isPropertySet(name)
1256  value = self.getProp(name)
1257  # loop over the others that do have 'name' in their slots
1258  for other in [ o for o in others if name in o.__slots__ ]:
1259  # If self property is set, use it
1260  if local_is_set:
1261  if other.isPropertySet(name):
1262  log.warning("Property '%(prop)s' is set in both '%(self)s' and '%(other)s', using '%(self)s.%(prop)s'"%
1263  { "self": self.name(),
1264  "other": other.name(),
1265  "prop": name } )
1266  other.setProp(name, value)
1267  # If not, and other property also not set, propagate the default
1268  elif not other.isPropertySet(name):
1269  if isinstance(other,ConfigurableUser):
1270  otherType = type(other._properties[name].getDefault())
1271  other._properties[name].setDefault(value)
1272  if otherType in [list, dict]:
1273  # Special case for list and dictionaries:
1274  # also set the property to the same value of the default (copy)
1275  other.setProp(name, otherType(value))
1276  else:
1277  other.setProp(name, value)
1278  # If not set and other set, do nothing
1279 
string type
Definition: gaudirun.py:151
def GaudiKernel.Configurable.ConfigurableUser.propagateProperty (   self,
  name,
  others = None,
  force = True 
)
Propagate the property 'name' (if set) to other configurables (if possible).
'others' can be:
    None:
propagate to all the entries in __used_configurables__
    a configurable instance:
propagate only to it
    list of configurable instances:
propagate to all of them.


The logic is:
- if the local property is set, the other property will be overwritten
- local property not set and other set => keep other
- local property not set and other not set => overwrite the default for
    ConfigurableUser instances and set the property for Configurables

Definition at line 1231 of file Configurable.py.

1231  def propagateProperty(self, name, others = None, force = True):
1232  """
1233  Propagate the property 'name' (if set) to other configurables (if possible).
1234  'others' can be:
1235  None:
1236  propagate to all the entries in __used_configurables__
1237  a configurable instance:
1238  propagate only to it
1239  list of configurable instances:
1240  propagate to all of them.
1241 
1242 
1243  The logic is:
1244  - if the local property is set, the other property will be overwritten
1245  - local property not set and other set => keep other
1246  - local property not set and other not set => overwrite the default for
1247  ConfigurableUser instances and set the property for Configurables
1248  """
1249  # transform 'others' to a list of configurable instances
1250  if others is None:
1251  others = self.__used_instances__
1252  elif type(others) not in [ list, tuple ] :
1253  others = [ others ]
1254  # these can be computed before the loop
1255  local_is_set = self.isPropertySet(name)
1256  value = self.getProp(name)
1257  # loop over the others that do have 'name' in their slots
1258  for other in [ o for o in others if name in o.__slots__ ]:
1259  # If self property is set, use it
1260  if local_is_set:
1261  if other.isPropertySet(name):
1262  log.warning("Property '%(prop)s' is set in both '%(self)s' and '%(other)s', using '%(self)s.%(prop)s'"%
1263  { "self": self.name(),
1264  "other": other.name(),
1265  "prop": name } )
1266  other.setProp(name, value)
1267  # If not, and other property also not set, propagate the default
1268  elif not other.isPropertySet(name):
1269  if isinstance(other,ConfigurableUser):
1270  otherType = type(other._properties[name].getDefault())
1271  other._properties[name].setDefault(value)
1272  if otherType in [list, dict]:
1273  # Special case for list and dictionaries:
1274  # also set the property to the same value of the default (copy)
1275  other.setProp(name, otherType(value))
1276  else:
1277  other.setProp(name, value)
1278  # If not set and other set, do nothing
1279 
string type
Definition: gaudirun.py:151

Member Data Documentation

list GaudiKernel.Configurable.ConfigurableUser.__queried_configurables__ = []
staticprivate

list of ConfigurableUser classes this one is going to query in the apply_configuration method

Definition at line 1152 of file Configurable.py.

dictionary GaudiKernel.Configurable.ConfigurableUser.__slots__
staticprivate
Initial value:
1 = { "__users__": [],
2  "__used_instances__": [],
3  "_enabled": True,
4  "_applied": False }

Definition at line 1137 of file Configurable.py.

list GaudiKernel.Configurable.ConfigurableUser.__used_configurables__ = []
staticprivate

list of ConfigurableUser classes this one is going to modify in the apply_configuration method.

The list may contain class objects, strings representing class objects or tuples with the class object (or a string) as first element and the instance name as second element. If the instance name is None or not present, the function instanceName() is used to determine the name of the instance (the default implementation returns "<this name></em><other name>".

Definition at line 1149 of file Configurable.py.

GaudiKernel.Configurable.ConfigurableUser.__used_instances__
private

Definition at line 1167 of file Configurable.py.

GaudiKernel.Configurable.ConfigurableUser.__users__
private

Definition at line 1158 of file Configurable.py.

GaudiKernel.Configurable.ConfigurableUser._applied
private

Definition at line 1159 of file Configurable.py.

GaudiKernel.Configurable.ConfigurableUser._enabled
private

Definition at line 1157 of file Configurable.py.


The documentation for this class was generated from the following file: