95 from ctypes
import (PyDLL, util, c_void_p, c_bool, c_char_p, c_int,
101 class IInterface_p(c_void_p):
103 return "IInterface_p(0x%x)" % (0
if self.value
is None else 106 self.log = logging.getLogger(
'BootstrapHelper')
107 libname = util.find_library(
'GaudiKernel')
or 'libGaudiKernel.so' 108 self.log.debug(
'loading GaudiKernel (%s)', libname)
112 self.lib = gkl = PyDLL(libname, mode=RTLD_GLOBAL)
115 (
'createApplicationMgr', IInterface_p, []),
116 (
'getService', IInterface_p, [IInterface_p, c_char_p]),
117 (
'setProperty', c_bool, [IInterface_p, c_char_p, c_char_p]),
118 (
'getProperty', c_char_p, [IInterface_p, c_char_p]),
119 (
'addPropertyToCatalogue', c_bool,
120 [IInterface_p, c_char_p, c_char_p, c_char_p]),
121 (
'ROOT_VERSION_CODE', c_int, []),
124 for name, restype, argtypes
in functions:
125 f = getattr(gkl,
'py_bootstrap_%s' % name)
126 f.restype, f.argtypes = restype, argtypes
129 if name
not in self.__class__.__dict__:
130 setattr(self, name, f)
132 for name
in (
'configure',
'initialize',
'start',
'stop',
'finalize',
134 f = getattr(gkl,
'py_bootstrap_fsm_%s' % name)
135 f.restype, f.argtypes = c_bool, [IInterface_p]
136 gkl.py_bootstrap_app_run.restype = c_bool
137 gkl.py_bootstrap_app_run.argtypes = [IInterface_p, c_int]
139 gkl.py_helper_printAlgsSequences.restype =
None 140 gkl.py_helper_printAlgsSequences.argtypes = [IInterface_p]