The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Gaudi._ConfigurablesModule Class Reference
Inheritance diagram for Gaudi._ConfigurablesModule:
Collaboration diagram for Gaudi._ConfigurablesModule:

Public Member Functions

 __init__ (self)
 
 __getattr__ (self, name)
 

Public Attributes

bool ignoreMissingConfigurables = False
 

Private Attributes

 __name__ = __configurables_module_fullname__
 
 __loader__ = None
 

Detailed Description

Definition at line 29 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

Gaudi._ConfigurablesModule.__init__ ( self)

Definition at line 31 of file __init__.py.

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

Member Function Documentation

◆ __getattr__()

Gaudi._ConfigurablesModule.__getattr__ ( self,
name )

Definition at line 37 of file __init__.py.

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

Member Data Documentation

◆ __loader__

Gaudi._ConfigurablesModule.__loader__ = None
private

Definition at line 35 of file __init__.py.

◆ __name__

Gaudi._ConfigurablesModule.__name__ = __configurables_module_fullname__
private

Definition at line 34 of file __init__.py.

◆ ignoreMissingConfigurables

bool Gaudi._ConfigurablesModule.ignoreMissingConfigurables = False

Definition at line 33 of file __init__.py.


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