aboutsummaryrefslogtreecommitdiffstats
path: root/src/data-user.c
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-06-13 17:16:30 +0000
committerJustus Winter <[email protected]>2016-06-16 12:19:17 +0000
commitf3618bc615e3eff1f52fb5849cbf0f0b95515a61 (patch)
treebfd2d2020b558bc8db7bd028cdc6d24167f657f3 /src/data-user.c
parentpython: Wrap objects implementing the buffer protocol. (diff)
downloadgpgme-f3618bc615e3eff1f52fb5849cbf0f0b95515a61.tar.gz
gpgme-f3618bc615e3eff1f52fb5849cbf0f0b95515a61.zip
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 <[email protected]>
Diffstat (limited to 'src/data-user.c')
0 files changed, 0 insertions, 0 deletions