15 __configurables_module_fullname__ = __name__ +
".Configurables"
16 __ignore_missing_configurables__ =
False
32 self.
__name__ = __configurables_module_fullname__
45 elif name ==
"__spec__":
48 retval = importlib.machinery.ModuleSpec(
49 name=__configurables_module_fullname__,
52 elif name ==
"__package__":
54 elif name ==
"__path__":
55 raise AttributeError(
"'module' object has no attribute '__path__'")
56 elif name
in cfgDb.keys():
57 retval = confDbGetConfigurable(name)
59 retval = aliases[name]
63 logging.getLogger(__configurables_module_fullname__).warning(
64 "Configurable class %s not in database", name
70 "module '%s' does not have attribute '%s'"
71 % (__configurables_module_fullname__, name)
77 Configurables = _ConfigurablesModule()
78 sys.modules[__configurables_module_fullname__] = Configurables
80 _GaudiKernelLib =
None
84 _fields_ = [(
"key", ctypes.c_char_p), (
"value", ctypes.c_char_p)]
88 def __init__(self, opts, appType="Gaudi::Application
"):
89 global _GaudiKernelLib
90 if _GaudiKernelLib
is None:
93 gkl = _GaudiKernelLib = ctypes.CDLL(
94 "libGaudiKernel" + (
".dylib" if sys.platform ==
"darwin" else ".so"),
95 mode=ctypes.RTLD_GLOBAL,
97 gkl._py_Gaudi__Application__create.restype = ctypes.c_void_p
98 gkl._py_Gaudi__Application__run.argtypes = [ctypes.c_void_p]
99 gkl._py_Gaudi__Application__run.restype = ctypes.c_int
100 gkl._py_Gaudi__Application__delete.argtypes = [ctypes.c_void_p]
102 c_opts = (c_opt_t * len(opts))()
103 for idx, item
in enumerate(opts.items()):
104 c_opts[idx].key = item[0].encode(
"ascii")
105 c_opts[idx].value = item[1].encode(
"ascii")
107 self.
_impl = _GaudiKernelLib._py_Gaudi__Application__create(
108 appType.encode(
"ascii"), c_opts, ctypes.c_ulong(len(c_opts))
113 return cls(opts, appType=appType)
116 return _GaudiKernelLib._py_Gaudi__Application__run(self.
_impl)
119 _GaudiKernelLib._py_Gaudi__Application__delete(self.
_impl)