From 8196edf9ca5c8f2f02553e7f22d9c79dbd229882 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 6 Jun 2016 13:11:15 +0200 Subject: python: Wrap file-like objects on demand. * lang/python/gpgme.i (gpgme_data_t): Use new function to create wrapper objects if necessary, and deallocate them after the function call. * lang/python/helpers.c (object_to_gpgme_data_t): New function. * lang/python/helpers.h (object_to_gpgme_data_t): New prototype. * lang/python/tests/Makefile.am (pytests): Add new test. * lang/python/tests/t-idiomatic.py: New file. Signed-off-by: Justus Winter --- lang/python/helpers.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lang/python/helpers.h') diff --git a/lang/python/helpers.h b/lang/python/helpers.h index 952b31f2..24502631 100644 --- a/lang/python/helpers.h +++ b/lang/python/helpers.h @@ -29,6 +29,8 @@ void pygpgme_exception_init(void); gpgme_error_t pygpgme_exception2code(void); PyObject *object_to_gpgme_t(PyObject *input, const char *objtype, int argnum); +PyObject *object_to_gpgme_data_t(PyObject *input, int argnum, + PyObject **wrapper); void pygpgme_clear_generic_cb(PyObject **cb); PyObject *pygpgme_raise_callback_exception(PyObject *self); -- cgit v1.2.3