[GRASS-dev] Howto use a Python function as error handler in libgis

2015-02-06 Thread Sören Gebbert
Dear developers, i am trying to register a Python function as error handler callback using ctypes in libgis. I use this code in the temporal framework: {{{ def error_handler(data): pass CALLBACK = CFUNCTYPE(None, c_void_p) CALLBACK.restype = None CALLBACK.argtypes = c_void_p cerror_handler

Re: [GRASS-dev] Howto use a Python function as error handler in libgis

2015-02-11 Thread Sören Gebbert
Dear Developers, any clue about how to register a Python function as error handler in libgis using libgis.G_add_error_handler()? Or is there any other way to recognize a fatal error call from libgis in Python? I tried to catch the signals, unfortunately is Python not able to catch signals emitted

Re: [GRASS-dev] Howto use a Python function as error handler in libgis

2015-02-13 Thread Glynn Clements
Sören Gebbert wrote: > Dear developers, > i am trying to register a Python function as error handler callback > using ctypes in libgis. > I use this code in the temporal framework: > > > {{{ > def error_handler(data): > pass > > CALLBACK = CFUNCTYPE(None, c_void_p) AFAICT, this needs to b

Re: [GRASS-dev] Howto use a Python function as error handler in libgis

2015-02-15 Thread Sören Gebbert
Hi Glynn, thanks a lot, that solved the issue. Best regards Soeren 2015-02-14 4:10 GMT+01:00 Glynn Clements : > > Sören Gebbert wrote: > >> Dear developers, >> i am trying to register a Python function as error handler callback >> using ctypes in libgis. >> I use this code in the temporal framewo

Re: [GRASS-dev] Howto use a Python function as error handler in libgis

2015-02-17 Thread Glynn Clements
Sören Gebbert wrote: > > AFAICT, this needs to be: > > > > CALLBACK = CFUNCTYPE(c_void_p, c_void_p) > > > > For callbacks, ctypesgen converts any return type which isn't a > > primitive C type to c_void_p. And None isn't a primitive C type. > > thanks a lot, that solved the issue. Actual