gpgme/lang/python/pyme
Justus Winter f3618bc615 python: Rework callbacks.
Simplify how the lifetime of callback arguments is managed.

* lang/python/gpgme.i (gpgme_edit_cb_t): Check arguments.
(PyObject_p_p, void_p_p): Drop rather dangerous interface.
(pygpgme_unwrap_gpgme_ctx_t): New function.
* lang/python/helpers.c (pygpgme_clear_generic_cb): Drop dangerous
function.
(pyPassphraseCb): Assert contract.
(pygpgme_set_passphrase_cb): Use Python's calling convention so that
we can raise exceptions.  Hand in 'self', get the wrapped object, and
simply store the hook data as attribute of the wrapper object.
(pyProgressCb, pygpgme_set_progress_cb): Likewise.
(pygpgme_set_status_cb): Likewise.
(pygpgme_data_new_from_cbs): Likewise.
* lang/python/helpers.h (pygpgme_clear_generic_cb): Drop prototype.
(pygpgme_set_passphrase_cb): Update prototype.
(pygpgme_set_progress_cb): Likewise.
(pygpgme_set_status_cb): Likewise.
(pygpgme_data_new_from_cbs): Likewise.
(pygpgme_unwrap_gpgme_ctx_t): New prottotype.
* lang/python/pyme/core.py (Context, Data): Update callsites.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-16 14:19:17 +02:00
..
constants python: Drop obsolete VCS keywords. 2016-06-06 14:16:01 +02:00
__init__.py python: Improve the documentation. 2016-06-16 14:07:41 +02:00
callbacks.py python: Drop obsolete VCS keywords. 2016-06-06 14:16:01 +02:00
core.py python: Rework callbacks. 2016-06-16 14:19:17 +02:00
errors.py python: Drop obsolete VCS keywords. 2016-06-06 14:16:01 +02:00
util.py python: Drop obsolete VCS keywords. 2016-06-06 14:16:01 +02:00
version.py.in python: Get version information from the build system. 2016-06-16 14:07:41 +02:00