105 from ctypes
import (PyDLL, util, c_void_p, c_bool, c_char_p, c_int,
111 class IInterface_p(c_void_p):
113 return "IInterface_p(0x%x)" % (0
if self.value
is None else 116 self.log = logging.getLogger(
'BootstrapHelper')
117 libname = util.find_library(
'GaudiKernel')
or 'libGaudiKernel.so' 118 self.log.debug(
'loading GaudiKernel (%s)', libname)
122 self.lib = gkl = PyDLL(libname, mode=RTLD_GLOBAL)
125 (
'createApplicationMgr', IInterface_p, []),
126 (
'getService', IInterface_p, [IInterface_p, c_char_p]),
127 (
'setProperty', c_bool, [IInterface_p, c_char_p, c_char_p]),
128 (
'getProperty', c_char_p, [IInterface_p, c_char_p]),
129 (
'addPropertyToCatalogue', c_bool,
130 [IInterface_p, c_char_p, c_char_p, c_char_p]),
131 (
'ROOT_VERSION_CODE', c_int, []),
134 for name, restype, argtypes
in functions:
135 f = getattr(gkl,
'py_bootstrap_%s' % name)
136 f.restype, f.argtypes = restype, argtypes
139 if name
not in self.__class__.__dict__:
140 setattr(self, name, f)
142 for name
in (
'configure',
'initialize',
'start',
'stop',
'finalize',
144 f = getattr(gkl,
'py_bootstrap_fsm_%s' % name)
145 f.restype, f.argtypes = c_bool, [IInterface_p]
146 gkl.py_bootstrap_app_run.restype = c_bool
147 gkl.py_bootstrap_app_run.argtypes = [IInterface_p, c_int]
149 gkl.py_helper_printAlgsSequences.restype =
None 150 gkl.py_helper_printAlgsSequences.argtypes = [IInterface_p]