56 from ctypes
import PyDLL, c_void_p, c_bool, c_char_p, c_int
57 self.
log = logging.getLogger(
'BootstrapHelper')
59 libname =
'libGaudiKernel.so'
60 self.log.debug(
'loading GaudiKernel (%s)', libname)
64 self.
lib = gkl = PyDLL(libname)
66 functions = [(
'createApplicationMgr', c_void_p, []),
67 (
'getService', c_void_p, [c_void_p, c_char_p]),
68 (
'setProperty', c_bool, [c_void_p, c_char_p, c_char_p]),
69 (
'getProperty', c_char_p, [c_void_p, c_char_p]),
70 (
'addPropertyToCatalogue', c_bool, [c_void_p, c_char_p, c_char_p, c_char_p]),
71 (
'ROOT_VERSION_CODE', c_int, []),
74 for name, restype, args
in functions:
75 f = getattr(gkl,
'py_bootstrap_%s' % name)
76 f.restype, f.args = restype, args
79 if name
not in self.__class__.__dict__:
80 setattr(self, name, f)
82 for name
in (
'configure',
'initialize',
'start',
83 'stop',
'finalize',
'terminate'):
84 f = getattr(gkl,
'py_bootstrap_fsm_%s' % name)
85 f.restype, f.args = c_bool, [c_void_p]
86 gkl.py_bootstrap_app_run.restype = c_bool
87 gkl.py_bootstrap_app_run.args = [c_void_p, c_int]
89 gkl.py_helper_printAlgsSequences.restype =
None
90 gkl.py_helper_printAlgsSequences.args = [c_void_p]