__init__.py
Go to the documentation of this file.00001 import os, sys
00002
00003 __configurables_module_fullname__ = __name__ + '.Configurables'
00004 __ignore_missing_configurables__ = False
00005
00006
00007
00008
00009
00010
00011
00012
00013 class _ConfigurablesModule(object):
00014
00015 def __init__(self):
00016
00017 self.ignoreMissingConfigurables = False
00018
00019 def __getattr__(self, name):
00020
00021 from Gaudi.Configuration import confDbGetConfigurable, cfgDb
00022
00023 retval = None
00024
00025 if name == "__all__":
00026 retval = cfgDb.keys()
00027 elif name == "__path__":
00028 retval == None
00029 elif name in cfgDb.keys():
00030 retval = confDbGetConfigurable(name)
00031 elif self.ignoreMissingConfigurables:
00032 import logging
00033 logging.getLogger(__configurables_module_fullname__).warning('Configurable class %s not in database', name)
00034 else:
00035
00036
00037 raise AttributeError("module '%s' does not have attribute '%s'" % (__configurables_module_fullname__, name))
00038 return retval
00039
00040
00041 Configurables = _ConfigurablesModule()
00042 sys.modules[__configurables_module_fullname__] = Configurables