aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/helpers.h
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-06-06 11:11:15 +0000
committerJustus Winter <[email protected]>2016-06-06 12:16:04 +0000
commit8196edf9ca5c8f2f02553e7f22d9c79dbd229882 (patch)
treed3bacbbbe7f72ba90bbe2715b5a87acac6871445 /lang/python/helpers.h
parentpython: Move helper function. (diff)
downloadgpgme-8196edf9ca5c8f2f02553e7f22d9c79dbd229882.tar.gz
gpgme-8196edf9ca5c8f2f02553e7f22d9c79dbd229882.zip
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 <[email protected]>
Diffstat (limited to '')
-rw-r--r--lang/python/helpers.h2
1 files changed, 2 insertions, 0 deletions
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);