Justus Winter
0d4e95621e
python: Improve progress callbacks.
...
* lang/python/helpers.c (pyProgressCb): Stash python errors, convert
'what' to Unicode object.
* lang/python/pyme/core.py (Context.set_progress_cb): Hand in 'self'.
* lang/python/tests/t-callbacks.py: Test progress callbacks.
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-19 16:08:33 +02:00
Justus Winter
d90857a08c
python: Robust exception handling in callbacks.
...
* lang/python/helpers.c (pygpgme_stash_callback_exception): New
function.
(pygpgme_raise_callback_exception): Likewise.
(pyPassphraseCb): Stash python errors.
* lang/python/helpers.h (pygpgme_raise_callback_exception): New
prototype.
* lang/python/pyme/core.py ({Context,Data}.__init__): Move common
initialization to superclass.
(Context.set_progress_cb): Hand in 'self'.
* lang/python/pyme/util.py (GpgmeWrapper.__init__): New function.
(GpgmeWrapper.__getattr__): Raise stashed exceptions.
* lang/python/tests/Makefile.am (py_tests): Add new test.
* lang/python/tests/t-callbacks.py: New file.
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-19 15:58:45 +02:00
Justus Winter
464d404c88
python: Add more tests.
...
* lang/python/tests/Makefile.am (py_tests): Add new tests.
* lang/python/tests/support.py (print_data): New function.
* lang/python/tests/t-decrypt.py: Use new function.
* lang/python/tests/t-encrypt.py: Likewise.
* lang/python/tests/t-sign.py: New file.
* lang/python/tests/t-encrypt-sym.py: Likewise.
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-19 11:09:45 +02:00
Justus Winter
9ceaec2591
python: Port more tests.
...
* lang/python/Makefile.am: Add bits from the c test suite.
* lang/python/support.py: New file.
* lang/python/t-decrypt.py: Likewise.
* lang/python/t-encrypt.py: Likewise.
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-17 14:18:21 +02:00
Justus Winter
11314f0db6
python: Share generated methods between objects.
...
* lang/python/pyme/util.py (GpgmeWrapper.__getattr__): Monkey-patch
the class.
* lang/python/tests/t-wrapper.py: Demonstrate the sharing.
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 18:29:04 +02:00
Justus Winter
f7094d8358
python: Fix writing to data buffers.
...
* lang/python/gpgme.i: Add typemap for buffers.
* lang/python/pyme/core.py (Data.write): Fix function.
* lang/python/tests/Makefile.am: Add new test.
* lang/python/tests/t-data.py: New file.
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 17:59:21 +02:00
Justus Winter
e64bffe030
python: Add a test suite.
...
* configure.ac: Add new Makefile.
* lang/python/Makefile.am: Add subdirectory.
* lang/python/tests/Makefile.am: New file.
* lang/python/tests/t-wrapper.py: Likewise.
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 15:37:00 +02:00