The Gaudi Framework  v33r0 (d5ea422b)
GaudiConfig2._configurables Namespace Reference

Classes

class  ConfigMetaHelper
 
class  Configurable
 
class  ConfigurableMeta
 
class  Property
 

Functions

def useGlobalInstances (enable)
 
def opt_repr (value)
 
def makeConfigurableClass (name, **namespace)
 
def all_options (explicit_defaults=False)
 

Variables

bool _GLOBAL_INSTANCES = False
 

Function Documentation

◆ all_options()

def GaudiConfig2._configurables.all_options (   explicit_defaults = False)
Return a dictionary with all explicitly set options, or with also the
defaults if explicit_defaults is set to True.

Definition at line 288 of file _configurables.py.

288 def all_options(explicit_defaults=False):
289  '''
290  Return a dictionary with all explicitly set options, or with also the
291  defaults if explicit_defaults is set to True.
292  '''
293  opts = {}
294  for c in Configurable.instances.values():
295  opts.update(c.__opt_properties__(explicit_defaults))
296  return opts
def all_options(explicit_defaults=False)

◆ makeConfigurableClass()

def GaudiConfig2._configurables.makeConfigurableClass (   name,
**  namespace 
)
Create a Configurable specialization.

Definition at line 276 of file _configurables.py.

276 def makeConfigurableClass(name, **namespace):
277  '''
278  Create a Configurable specialization.
279  '''
280  properties = namespace.pop('properties', {})
281  namespace.update(
282  {pname: Property(*pargs)
283  for pname, pargs in properties.items()})
284 
285  return type(name, (Configurable, ), namespace)
286 
287 
def makeConfigurableClass(name, **namespace)

◆ opt_repr()

def GaudiConfig2._configurables.opt_repr (   value)
String representation of the value, such that it can be consumed be the
Gaudi option parsers.

Definition at line 120 of file _configurables.py.

120 def opt_repr(value):
121  '''
122  String representation of the value, such that it can be consumed be the
123  Gaudi option parsers.
124  '''
125  if hasattr(value, '__opt_repr__'):
126  return value.__opt_repr__()
127  return repr(value)
128 
129 

◆ useGlobalInstances()

def GaudiConfig2._configurables.useGlobalInstances (   enable)
Enable or disable the global instances database.

By default global instances are enabled.

Definition at line 19 of file _configurables.py.

19 def useGlobalInstances(enable):
20  '''
21  Enable or disable the global instances database.
22 
23  By default global instances are enabled.
24  '''
25  global _GLOBAL_INSTANCES
26  if enable == _GLOBAL_INSTANCES:
27  return
28  if not enable:
29  assert not Configurable.instances, \
30  'Configurable instances DB not empty, cannot be disabled'
31  _GLOBAL_INSTANCES = enable
32 
33 

Variable Documentation

◆ _GLOBAL_INSTANCES

bool GaudiConfig2._configurables._GLOBAL_INSTANCES = False
private

Definition at line 16 of file _configurables.py.