15 __configurables_module_fullname__ = __name__ +
'.Configurables'
16 __ignore_missing_configurables__ =
False
32 self.
__name__ = __configurables_module_fullname__
44 elif name ==
"__spec__":
46 retval = importlib.machinery.ModuleSpec(
47 name=__configurables_module_fullname__,
50 elif name ==
"__package__":
52 elif name ==
"__path__":
53 raise AttributeError(
"'module' object has no attribute '__path__'")
54 elif name
in cfgDb.keys():
55 retval = confDbGetConfigurable(name)
57 retval = aliases[name]
60 logging.getLogger(__configurables_module_fullname__).warning(
61 'Configurable class %s not in database', name)
65 raise AttributeError(
"module '%s' does not have attribute '%s'" %
66 (__configurables_module_fullname__, name))
71 Configurables = _ConfigurablesModule()
72 sys.modules[__configurables_module_fullname__] = Configurables
74 _GaudiKernelLib =
None
78 _fields_ = [(
'key', ctypes.c_char_p), (
'value', ctypes.c_char_p)]
82 def __init__(self, opts, appType="Gaudi::Application
"):
83 global _GaudiKernelLib
84 if _GaudiKernelLib
is None:
87 gkl = _GaudiKernelLib = ctypes.PyDLL(
89 (
'.dylib' if sys.platform ==
'darwin' else '.so'),
90 mode=ctypes.RTLD_GLOBAL)
91 gkl._py_Gaudi__Application__create.restype = ctypes.c_void_p
92 gkl._py_Gaudi__Application__run.argtypes = [ctypes.c_void_p]
93 gkl._py_Gaudi__Application__run.restype = ctypes.c_int
94 gkl._py_Gaudi__Application__delete.argtypes = [ctypes.c_void_p]
96 c_opts = (c_opt_t * len(opts))()
97 for idx, item
in enumerate(opts.items()):
98 c_opts[idx].key = item[0].encode(
'ascii')
99 c_opts[idx].value = item[1].encode(
'ascii')
101 self.
_impl = _GaudiKernelLib._py_Gaudi__Application__create(
102 appType.encode(
'ascii'), c_opts, ctypes.c_ulong(len(c_opts)))
106 return cls(opts, appType=appType)
109 return _GaudiKernelLib._py_Gaudi__Application__run(self.
_impl)
112 _GaudiKernelLib._py_Gaudi__Application__delete(self.
_impl)