Gaudi Framework, version v23r0 |
Home | Generated: Mon Jan 30 2012 |
Small class that allows to access all the configurables as attributes of the instance. More...
Public Member Functions | |
def | __init__ |
Initializes the instance. | |
def | __getattr__ |
Public Attributes | |
ignoreMissingConfigurables | |
If set to true, does not raise an AttributeError if the configurable is not found. |
Small class that allows to access all the configurables as attributes of the instance.
Used as module to allow code like
from Gaudi.Configuration import Configurables Configurables.MyConf()
Definition at line 13 of file __init__.py.
def Gaudi::_ConfigurablesModule::__init__ | ( | self ) |
Initializes the instance.
Definition at line 15 of file __init__.py.
00016 : 00017 ## If set to true, does not raise an AttributeError if the configurable is not found. 00018 self.ignoreMissingConfigurables = False
def Gaudi::_ConfigurablesModule::__getattr__ | ( | self, | |
name | |||
) |
Definition at line 19 of file __init__.py.
00020 : 00021 # trigger the load of the configurables database 00022 from Gaudi.Configuration import confDbGetConfigurable, cfgDb 00023 from Gaudi.CommonGaudiConfigurables import aliases 00024 # return value 00025 retval = None 00026 # handle the special cases (needed for modules): __all__, __path__ 00027 if name == "__all__": 00028 retval = cfgDb.keys() 00029 elif name == "__path__": 00030 retval == None 00031 elif name in cfgDb.keys(): # ignore private names 00032 retval = confDbGetConfigurable(name) 00033 elif name in aliases: # special case of aliases 00034 retval = aliases[name] 00035 elif self.ignoreMissingConfigurables: 00036 import logging 00037 logging.getLogger(__configurables_module_fullname__).warning('Configurable class %s not in database', name) 00038 else: 00039 # We raise an AttributeError exception if the configurable could not be found 00040 # to respect the Python semantic. 00041 raise AttributeError("module '%s' does not have attribute '%s'" % (__configurables_module_fullname__, name)) 00042 return retval 00043 # install the facade module instance as a module
Gaudi::_ConfigurablesModule::ignoreMissingConfigurables |
If set to true, does not raise an AttributeError if the configurable is not found.
Definition at line 16 of file __init__.py.