The Gaudi Framework  master (37c0b60a)
Gaudi._ConfigurablesModule Class Reference
Inheritance diagram for Gaudi._ConfigurablesModule:
Collaboration diagram for Gaudi._ConfigurablesModule:

Public Member Functions

def __init__ (self)
 
def __getattr__ (self, name)
 

Public Attributes

 ignoreMissingConfigurables
 

Private Attributes

 __name__
 
 __loader__
 

Detailed Description

Definition at line 27 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

def Gaudi._ConfigurablesModule.__init__ (   self)

Definition at line 29 of file __init__.py.

29  def __init__(self):
30  # If set to true, does not raise an AttributeError if the configurable is not found.
31  self.ignoreMissingConfigurables = False
32  self.__name__ = __configurables_module_fullname__
33  self.__loader__ = None
34 

Member Function Documentation

◆ __getattr__()

def Gaudi._ConfigurablesModule.__getattr__ (   self,
  name 
)

Definition at line 35 of file __init__.py.

35  def __getattr__(self, name):
36  # trigger the load of the configurables database
37  from Gaudi.CommonGaudiConfigurables import aliases
38  from Gaudi.Configuration import cfgDb, confDbGetConfigurable
39 
40  # return value
41  retval = None
42  # handle the special cases (needed for modules): __all__, __path__
43  if name == "__all__":
44  retval = cfgDb.keys()
45  elif name == "__spec__":
46  import importlib
47 
48  retval = importlib.machinery.ModuleSpec(
49  name=__configurables_module_fullname__,
50  loader=self.__loader__,
51  )
52  elif name == "__package__":
53  retval = self.__name__
54  elif name == "__path__":
55  raise AttributeError("'module' object has no attribute '__path__'")
56  elif name in cfgDb.keys(): # ignore private names
57  retval = confDbGetConfigurable(name)
58  elif name in aliases: # special case of aliases
59  retval = aliases[name]
60  elif self.ignoreMissingConfigurables:
61  import logging
62 
63  logging.getLogger(__configurables_module_fullname__).warning(
64  "Configurable class %s not in database", name
65  )
66  else:
67  # We raise an AttributeError exception if the configurable could not be found
68  # to respect the Python semantic.
69  raise AttributeError(
70  "module '%s' does not have attribute '%s'"
71  % (__configurables_module_fullname__, name)
72  )
73  return retval
74 
75 
76 # install the facade module instance as a module

Member Data Documentation

◆ __loader__

Gaudi._ConfigurablesModule.__loader__
private

Definition at line 33 of file __init__.py.

◆ __name__

Gaudi._ConfigurablesModule.__name__
private

Definition at line 32 of file __init__.py.

◆ ignoreMissingConfigurables

Gaudi._ConfigurablesModule.ignoreMissingConfigurables

Definition at line 31 of file __init__.py.


The documentation for this class was generated from the following file:
Gaudi.CommonGaudiConfigurables
Definition: CommonGaudiConfigurables.py:1
GaudiPartProp.decorators.__getattr__
__getattr__
decorate the attribute access for Gaudi.ParticleProperty
Definition: decorators.py:186
Gaudi.Configuration
Definition: Configuration.py:1