aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* python: Robust exception handling in callbacks.Justus Winter2016-05-196-13/+187
| | | | | | | | | | | | | | | | | | * 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 <[email protected]>
* python: Add more tests.Justus Winter2016-05-196-8/+157
| | | | | | | | | | | * 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 <[email protected]>
* python: More type conversion fixes.Justus Winter2016-05-191-2/+24
| | | | | | | | * lang/python/helpers.c (pyPassphraseCb): Cope with 'uid_hint' being NULL, convert it to an Unicode object, and cope with the callback returning both Unicode and bytes objects. Signed-off-by: Justus Winter <[email protected]>
* python: Fix import.Justus Winter2016-05-191-1/+4
| | | | | | | * lang/python/helpers.c (pygpgme_exception_init): Make module import relative. Signed-off-by: Justus Winter <[email protected]>
* python: Various fixes.Justus Winter2016-05-181-1/+1
| | | | | | | * configure.ac: Fix SWIG detection, bump required Python version. * lang/python/Makefile.am: Portability fix. Signed-off-by: Justus Winter <[email protected]>
* python: Delete duplicated license texts/Werner Koch2016-05-172-848/+0
| | | | --
* Merge branch 'justus/pyme3'Justus Winter2016-05-179-12/+1
|
* python: Clean up examples.Justus Winter2016-05-1710-43/+46
| | | | | | | | | | | | | | | * lang/python/examples/delkey.py: Clean up example. * lang/python/examples/encrypt-to-all.py: Likewise. * lang/python/examples/genkey.py: Likewise. * lang/python/examples/inter-edit.py: Likewise. * lang/python/examples/sign.py: Likewise. * lang/python/examples/signverify.py: Likewise. * lang/python/examples/simple.py: Likewise. * lang/python/examples/t-edit.py: Likewise. * lang/python/examples/verifydetails.py: Likewise. * lang/python/pyme/__init__.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Import GPGMEError.Justus Winter2016-05-171-1/+1
| | | | | | | | * pyme/core.py: Import GPGMEError. Fixes c5d118b2. Signed-off-by: Justus Winter <[email protected]>
* python: Port more tests.Justus Winter2016-05-174-1/+166
| | | | | | | | | * 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 <[email protected]>
* python: Share generated methods between objects.justus/pyme3Justus Winter2016-05-122-10/+18
| | | | | | | | * 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 <[email protected]>
* python: Raise exceptions on write errors.Justus Winter2016-05-122-1/+8
| | | | | | | * lang/python/pyme/core.py (Data.write): Handle errors. * lang/python/pyme/errors.py (GPGMEError.fromSyserror): New function. Signed-off-by: Justus Winter <[email protected]>
* python: Fix writing to data buffers.Justus Winter2016-05-124-3/+71
| | | | | | | | | * 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 <[email protected]>
* python: Add a test suite.Justus Winter2016-05-123-0/+46
| | | | | | | | | * 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 <[email protected]>
* python: Cache generated wrapper functions.Justus Winter2016-05-121-3/+6
| | | | | | | * lang/python/util.py (GpgmeWrap.__getattr__): Cache generated wrapper functions. Signed-off-by: Justus Winter <[email protected]>
* python: Fix function invocation.Justus Winter2016-05-121-1/+1
| | | | | | | * lang/python/pyme/core.py (Data.new_from_fd): Fix function invocation. Signed-off-by: Justus Winter <[email protected]>
* python: Fix name of exception, make slot methods explicit.Justus Winter2016-05-121-1/+18
| | | | | | | | | * lang/python/pyme/util.py (GpgmeWrapper._getctype): Fix exception, add docstring. (GpgmeWrapper._getnameprepend): New function. (GpgmeWrapper._errorcheck): Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Handle interpreter shutdown.Justus Winter2016-05-121-8/+22
| | | | | | | | | * lang/python/pyme/core.py: Avoid races at interpreter shutdown. This silences the most annoying occurrences, however this problem also affects the SWIG generated code, which might indicate that the real problem is somewhere else. If so, this change can be easily reverted. Signed-off-by: Justus Winter <[email protected]>
* python: Make test case more robust.Justus Winter2016-05-121-0/+4
| | | | | | * lang/python/examples/t-edit.py: Check if key is found. Signed-off-by: Justus Winter <[email protected]>
* python: Fix type translation.Justus Winter2016-05-123-27/+41
| | | | | | | | | | | | * lang/python/gpgme.i: Adjust to Python3's string type being 'Unicode', not 'bytes'. Fix type checking. * lang/python/core.py (Data.write): Add docstring mentioning the expected type of parameter 'buffer'. (Data.read): Adjust read loop. Also, use a saner chunk size, and join all chunks at the end instead of adding them. * lang/python/examples/simple.py: Adjust example. Signed-off-by: Justus Winter <[email protected]>
* python: Fix simple example.Justus Winter2016-05-111-1/+2
| | | | | | | * lang/python/examples/simple.py: Flush stdout, encode name as UTF-8 before passing it to GPGME. Signed-off-by: Justus Winter <[email protected]>
* python: Integrate into the build system.Justus Winter2016-05-112-30/+65
| | | | | | | | | | * configure.ac: Make Python bindings configurable, add new Makefile. * lang/python/Makefile.am: New file. * lang/python/setup.py: Integrate into the build system. * m4/ax_pkg_swig.m4: New file from the autoconf archive. * m4/m4_ax_swig_python.m4: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: PEP8 fixes.Justus Winter2016-05-104-33/+38
| | | | | | Cherry picked from 0267c151. Signed-off-by: Justus Winter <[email protected]>
* python: Delete trailing whitespace.Justus Winter2016-05-1014-78/+74
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* python: Drop Debian packaging.Justus Winter2016-05-107-261/+0
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* python: Rename bindings.Justus Winter2016-05-1053-0/+6021
-- Signed-off-by: Justus Winter <[email protected]>