87 from ctypes
import (PyDLL, util, c_void_p, c_bool, c_char_p, c_int,
93 class IInterface_p(c_void_p):
95 return "IInterface_p(0x%x)" % (0
if self.value
is None else 98 self.
log = logging.getLogger(
'BootstrapHelper')
99 libname = util.find_library(
'GaudiKernel')
or 'libGaudiKernel.so' 100 self.log.debug(
'loading GaudiKernel (%s)', libname)
104 self.
lib = gkl = PyDLL(libname, mode=RTLD_GLOBAL)
107 (
'createApplicationMgr', IInterface_p, []),
108 (
'getService', IInterface_p, [IInterface_p, c_char_p]),
109 (
'setProperty', c_bool, [IInterface_p, c_char_p, c_char_p]),
110 (
'getProperty', c_char_p, [IInterface_p, c_char_p]),
111 (
'addPropertyToCatalogue', c_bool,
112 [IInterface_p, c_char_p, c_char_p, c_char_p]),
113 (
'ROOT_VERSION_CODE', c_int, []),
116 for name, restype, argtypes
in functions:
117 f = getattr(gkl,
'py_bootstrap_%s' % name)
118 f.restype, f.argtypes = restype, argtypes
121 if name
not in self.__class__.__dict__:
122 setattr(self, name, f)
124 for name
in (
'configure',
'initialize',
'start',
'stop',
'finalize',
126 f = getattr(gkl,
'py_bootstrap_fsm_%s' % name)
127 f.restype, f.argtypes = c_bool, [IInterface_p]
128 gkl.py_bootstrap_app_run.restype = c_bool
129 gkl.py_bootstrap_app_run.argtypes = [IInterface_p, c_int]
131 gkl.py_helper_printAlgsSequences.restype =
None 132 gkl.py_helper_printAlgsSequences.argtypes = [IInterface_p]