aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-10-14python: Call ln(1) in a portable way.Werner Koch1-2/+2
* lang/python/Makefile.am: Specify target dir for ln. Signed-off-by: Werner Koch <[email protected]>
2016-10-13python: Make 'get_key' more idiomatic.Justus Winter4-4/+52
* lang/python/pyme/core.py (Context.get_key): Raise errors.KeyNotFound if the key is not found. This error is both a KeyError for idiomatic error handling as well as a GPGMEError so we don't break existing code. * lang/python/pyme/errors.py (KeyNotFound): New class. * lang/python/tests/support.py (no_such_key): New variable. * lang/python/tests/t-keylist.py: Test the new behavior. Signed-off-by: Justus Winter <[email protected]>
2016-10-13python: Return public keys by default.Justus Winter3-7/+18
* lang/python/pyme/core.py (Core.get_key): Return public keys by default, improve docstring. * lang/python/examples/testCMSgetkey.py: Update example. * lang/python/examples/verifydetails.py: Likewise. GnuPG-bug-id: 2751 Signed-off-by: Justus Winter <[email protected]>
2016-10-13python: Fix example.Justus Winter1-2/+2
* lang/python/examples/inter-edit.py: Fix example. Fixes-commit: a458e7fe Signed-off-by: Justus Winter <[email protected]>
2016-09-30python: Link 'data.h' and 'config.h' into the builddir.Alon Bar-Lev3-10/+11
* lang/python/Makefile.am: Link to the files. * lang/python/gpgme.i: Update path. * lang/python/setup.py.in: Do not add the top builddir to the include path. -- To make it easy to build the subpackage using standard tools without altering environment or CFLAGS, symlink the required artifacts from source tree into subpackage directory when preparing sources. Signed-off-by: Alon Bar-Lev <[email protected]>
2016-09-30python: Add 'prepare' target.Alon Bar-Lev1-0/+3
* lang/python/Makefile.am: Add 'prepare' target. -- This enables preparing the package using autoconf then build using distutils as separate stage. Signed-off-by: Alon Bar-Lev <[email protected]>
2016-09-27tests: Fix blunder.Justus Winter1-1/+1
-- Fixes-commit: a423603f Signed-off-by: Justus Winter <[email protected]>
2016-09-27tests: Fix check for gpg versions not reporting the critical flag.Justus Winter1-0/+1
* lang/python/tests/t-sig-notation.py: Also blacklist 2.0.x. * tests/gpg/t-sig-notation.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-09-26python: Get rid of the last C++-style comments.Justus Winter1-7/+7
-- Signed-off-by: Justus Winter <[email protected]>
2016-09-26python: Correctly translate to size_t.Justus Winter1-7/+22
* lang/python/gpgme.i: Correctly translate Python number to size_t. Signed-off-by: Justus Winter <[email protected]>
2016-09-26python: Correctly translate off_t.Justus Winter1-5/+34
* lang/python/gpgme.i: Improve int/long translations, correctly handle off_t with large file support. Signed-off-by: Justus Winter <[email protected]>
2016-09-26python: Include 'config.h'.Justus Winter5-1/+23
* lang/python/Makefile.am: Pass 'top_builddir' to 'setup.py'. * lang/python/gpgme.i: Include 'config.h'. * lang/python/helpers.c: Likewise. * lang/python/helpers.h: Likewise. * lang/python/setup.py.in: Make sure that 'config.h' can be found. -- Fixes build on 32 bit platforms with large file support. Signed-off-by: Justus Winter <[email protected]>
2016-09-21python: Create install dir.Werner Koch1-0/+1
* lang/python/Makefile.am (install-exec-local): Create dir. Signed-off-by: Werner Koch <[email protected]>
2016-09-20tests: Make "make -j distcheck" work in Python.Werner Koch2-11/+9
* lang/python/Makefile.am (SUBDIRS): Make current dir fist. * lang/python/tests/Makefile.am (xcheck): Depend on pubring-stamp. (CLEANFILES): Remove private-keys-v1.d/gpg-sample.stamp. (check-local): Remove. (initial.py): Remove dependency. (./pubring-stamp): Depend on conf files and the private-keys-v1.d/gpg-sample.stamp file. Also replace use of basename. -- This addresses the problem that two rules might run the private keys copy rule and due to the files being chmod -w during make discheck the second process running that rule's cp would get a permission error. Signed-off-by: Werner Koch <[email protected]>
2016-09-20tests: Use --batch for gpg import.Werner Koch1-3/+3
* lang/python/tests/Makefile.am (./pubring-stamp): Use --batch with GPG to avoid Pinentries during import when using GnuPG >= 2.1. Replace touch by echo. * tests/gpg/Makefile.am (./pubring-stamp): Ditto. Signed-off-by: Werner Koch <[email protected]>
2016-09-20tests: Improve portability.Werner Koch1-2/+2
* lang/qt/tests/Makefile.am (clean-local): Avoid non-portable "--" * lang/python/Makefile.am (copystamp): Use well defined cp -R instead of cp -r. Signed-off-by: Werner Koch <[email protected]>
2016-09-19python: Improve metadata and READMEs.Justus Winter2-20/+23
-- Signed-off-by: Justus Winter <[email protected]>
2016-09-16core: Document the version a function has been deprecated.Werner Koch1-1/+1
* src/gpgme.h.in (_GPGME_DEPRECATED): Change to take versio numbers for documentation. Change all places. (_GPGME_DEPRECATED_OUTSIDE_GPGME): Ditto. * lang/python/gpgme-h-clean.py: Adjust RE. Signed-off-by: Werner Koch <[email protected]>
2016-09-16python: Release the GIL during calls into GPGME.Justus Winter2-7/+45
* lang/python/helpers.c (pyme_raise_callback_exception): Re-acquire the Global Interpreter Lock. (pyPassphraseCb, pyme_set_passphrase_cb, pyProgressCb, pyme_set_progress_cb, pyStatusCb, pyme_set_status_cb, _pyme_interact_cb, pyDataReadCb, pyDataWriteCb, pyDataSeekCb, pyDataReleaseCb, pyme_data_new_from_cbs, _pyme_assuan_data_cb, _pyme_assuan_inquire_cb, _pyme_assuan_status_cb): Likewise. * lang/python/setup.py.in: Make 'gpgme-config' emit the correct cflags, and SWIG generate code to release the GIL before calling us. Co-authored-by: Kai Michaelis <[email protected]> Signed-off-by: Justus Winter <[email protected]>
2016-09-16python: Adapt to 'gpgme_op_interact'.Justus Winter8-38/+296
* lang/python/examples/inter-edit.py: Update example. * lang/python/gpgme.i (gpgme_edit_cb_t): Turn into 'gpgme_interact_cb_t'. * lang/python/helpers.c (_pyme_edit_cb): Turn into '_pyme_interact_cb_t'. * lang/python/private.h (_pyme_edit_cb): Likewise. * lang/python/pyme/constants/__init__.py: Replace numeric status codes with the keywords. * lang/python/pyme/constants/status.py: Likewise. * lang/python/pyme/core.py (Context.interact): New method. (Context.op_edit): Deprecate, update docstring, implement using Context.interact. * lang/python/tests/t-edit.py: Test both interfaces. Signed-off-by: Justus Winter <[email protected]>
2016-09-14python: Clarify that we support Python 2.7 too.Justus Winter3-3/+3
* lang/python/README: Use 'Python' instead of 'Python 3'. * lang/python/pyme/version.py.in: Likewise. * lang/python/setup.py.in: Add classifier for 2.7, drop 3 only. Signed-off-by: Justus Winter <[email protected]>
2016-09-14python: Trim imports.Justus Winter4-4/+0
* lang/python/examples/encrypt-to-all.py: Drop unused import of 'os'. * lang/python/examples/signverify.py: Likewise. * lang/python/examples/simple.py: Likewise. * lang/python/examples/verifydetails.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-09-14python: Improve error handling.Justus Winter1-2/+12
* lang/python/gpgme.i (gpgme_engine_info_t): Improve error handling. Signed-off-by: Justus Winter <[email protected]>
2016-09-14python: Adapt to TOFU changes.Justus Winter1-4/+1
* lang/python/pyme/results.py (TofuInfo): Drop. (Signature): The TOFU information moved to the key. Signed-off-by: Justus Winter <[email protected]>
2016-09-14python: Build for both Python2 and Python3.Justus Winter3-9/+122
* NEWS: Update. * configure.ac: Check for multiple Python versions. * lang/python/Makefile.am: Build and install for both Python versions. * lang/python/tests/Makefile.am: Test both versions. * lang/python/tests/run-tests.py: New test runner. Signed-off-by: Justus Winter <[email protected]>
2016-09-14python: Import from __future__ to align behavior of Python 2.7.Justus Winter59-0/+177
-- Signed-off-by: Justus Winter <[email protected]>
2016-09-14python: Use more generic shebang.Justus Winter38-38/+38
-- Signed-off-by: Justus Winter <[email protected]>
2016-09-13python: Handle slight differences between Python 2 and 3.Justus Winter6-32/+61
* lang/python/helpers.c (pyDataWriteCb): Handle Python integers being returned on Python 2. (pyDataSeekCb): Likewise. * lang/python/pyme/core.py (Data.__init__): Fix testing for string argument. (Data.new_from_filepart): Likewise. * lang/python/pyme/util.py (is_a_string): New function. * lang/python/tests/t-encrypt-large.py (read_cb): Force evaluation of generator. * lang/python/tests/t-idiomatic.py: Partly skip test on Python 2. * lang/python/tests/t-verify.py (check_result): Here, the difference between 2 and 3 really matters. We cannot change the char * conversion in Python 2 without breaking all existing applications, and using bytestrings in Python 3 would be very inconvenient. Signed-off-by: Justus Winter <[email protected]>
2016-09-13python: Fix types and error handling.Justus Winter1-11/+26
* lang/python/helpers.c (_pyme_edit_cb): Drop the const. (_pyme_assuan_{data,inquire,status}_cb): Fix error handling. Signed-off-by: Justus Winter <[email protected]>
2016-09-12python: Avoid Python3-only form of super().Justus Winter1-4/+5
* lang/python/pyme/core.py (GpgmeWrapper.__repr__): Use more compatible form of super. (GpgmeWrapper.__setattr__): Likewise. (Context.__init__): Likewise. (Data.__init__): Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-09-12python: Make type translation compatible with Python 2.7.Justus Winter2-13/+78
* lang/python/gpgme.i: Avoid functions not available in Python 2.7. * lang/python/helpers.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-09-12python: Avoid hardcoding the interpreter.Justus Winter1-2/+2
* lang/python/setup.py.in: Avoid hardcoding the interpreter. Signed-off-by: Justus Winter <[email protected]>
2016-09-12python: Do not rely on subprocess.DEVNULL.Justus Winter1-2/+7
* lang/python/setup.py.in: Do not rely on subprocess.DEVNULL. Signed-off-by: Justus Winter <[email protected]>
2016-09-12tests: Make signature notation test compatible with older GnuPGs.Justus Winter1-1/+10
* lang/python/tests/t-sig-notation.py: Only check the critical flag when GnuPG >= 2.1.13 is used. * tests/gpg/t-sig-notation.c: Likewise. Fixes-commit: c88c9ef3 Signed-off-by: Justus Winter <[email protected]>
2016-08-08Prepend LD_LIBRARY_PATH for python testsAndre Heinecke1-1/+1
* lang/python/tests/Makefile.am (TESTS_ENVIRONMENT): Prepend path instead of setting the value. -- This fixes the case where tools / libararies are needed for a working GnuPG system that are pointed to by LD_LIBRARY_PATH. E.g. GnuPG itself is installed in a custom prefix and PATH / LD_LIBRARY_PATH is set accordingly.
2016-08-05python: Clean up and modernize examples.Justus Winter14-500/+360
* lang/python/examples/Examples.rst: Delete file. * lang/python/examples/t-edit.py: Likewise. This is actually a test case and has been moved to 'tests'. * lang/python/examples/assuan.py: New file. * lang/python/examples/decryption-filter.py: Likewise. * lang/python/examples/delkey.py: Modernize. * lang/python/examples/encrypt-to-all.py: Likewise. * lang/python/examples/exportimport.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/testCMSgetkey.py: Likewise. * lang/python/examples/verifydetails.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-08-03python: Add a nicer interface to list keys.Justus Winter2-1/+16
* lang/python/pyme/core.py (Context.keylist): New method. * lang/python/tests/t-keylist.py: Test new method. Signed-off-by: Justus Winter <[email protected]>
2016-08-02python: Add a flag identifying in-tree builds.Justus Winter4-1/+24
* lang/python/helpers.c (pyme_in_tree_build): New variable. * lang/python/helpers.h (pyme_in_tree_build): New declaration. * lang/python/pyme/version.py.in (in_tree_build): New variable. * lang/python/setup.py.in: Rework macro handling, set 'IN_TREE_BUILD' as appropriate. Signed-off-by: Justus Winter <[email protected]>
2016-08-02python: Fix build system integration.Justus Winter1-3/+17
* lang/python/Makefile.am: Be more careful when cleaning the build directory, we must not delete the generated file 'pyme/version.py'. Signed-off-by: Justus Winter <[email protected]>
2016-07-28python: Fix out-of-tree build.Justus Winter1-1/+1
* lang/python/MANIFEST.in: Add 'private.h'. Fixes-commit: 3d4dc3f0 Signed-off-by: Justus Winter <[email protected]>
2016-07-28python: Improve error handling.Justus Winter1-8/+18
* lang/python/pyme/core.py (Context.protocol): Check that the engine is usable before setting the protocol. (Context._errorcheck): Add missing functions. Signed-off-by: Justus Winter <[email protected]>
2016-07-28python: Drop superfluous imports and trim public interface.Justus Winter8-9/+27
* lang/python/pyme/__init__.py: Avoid leaking low-level 'gpgme', make sure the main module looks nice and tidy, appease pyflakes. * lang/python/pyme/errors.py: Appease pyflakes. * lang/python/pyme/util.py: Avoid leaking low-level 'gpgme' into the module namespace. * lang/python/pyme/version.py.in: Likewise. * lang/python/tests/t-keylist.py: Drop superfluous imports. * lang/python/tests/t-sig-notation.py: Likewise. * lang/python/tests/t-sign.py: Likewise. * lang/python/tests/t-signers.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-07-28python: Rename compiled SWIG module.Justus Winter7-115/+115
Avoid the name pygpgme, as this is the name of another popular Python binding for GPGME. This commit renames the compiled Python module produced by SWIG. * lang/python/Makefile.am: Rename the compiled Python module. * lang/python/gpgme.i: Likewise. * lang/python/pyme/core.py: Likewise. * lang/python/pyme/errors.py: Likewise. * lang/python/pyme/util.py: Likewise. * lang/python/pyme/version.py.in: Likewise. * lang/python/setup.py.in: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-07-28python: Rename exported functions.Justus Winter3-28/+28
Avoid the name pygpgme, as this is the name of another popular Python binding for GPGME. This commit renames all functions that are exported to the Python world. * lang/python/helpers.c: Rename all exported functions. * lang/python/helpers.h: Likewise. * lang/python/pyme/core.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-07-28python: Rename private functions.Justus Winter4-72/+77
Avoid the name pygpgme, as this is the name of another popular Python binding for GPGME. This commit renames all functions that are not exported to the Python world. * lang/python/gpgme.i: Rename all private functions. * lang/python/helpers.c: Likewise. * lang/python/helpers.h: Likewise. * lang/python/private.h: Likewise. Also move the SWIG runtime helper prototypes here. Signed-off-by: Justus Winter <[email protected]>
2016-07-28python: Support the Assuan engine.Justus Winter7-1/+302
* lang/python/gpgme.i: Add typemaps for the Assuan protocol callbacks. * lang/python/helpers.c (_pyme_assuan_{data,inquire,status}_cb): New functions. * lang/python/private.h (_pyme_assuan_{data,inquire,status}_cb): New prototypes. * lang/python/pyme/core.py (Context.assuan_transact): New method. * lang/python/pyme/util.py (percent_escape): New function. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/t-protocol-assuan.py: New file. Signed-off-by: Justus Winter <[email protected]>
2016-07-28python: Improve engine information handling.Justus Winter3-9/+54
* lang/python/gpgme.i (gpgme_engine_info_t): Wrap engine infos. * lang/python/pyme/core.py (Context.engine_info): New property. (Context.{g,s}et_engine_info): Improve docstrings. * lang/python/pyme/results.py (EngineInfo): New class. Signed-off-by: Justus Winter <[email protected]>
2016-07-28python: Add accessors for the protocol.Justus Winter1-0/+11
* lang/python/pyme/core.py (Context.__init__): Add 'protocol' parameter. (Context.protocol): New accessors. Signed-off-by: Justus Winter <[email protected]>
2016-07-28python: Expose less functions to the Python world.Justus Winter5-15/+46
* lang/python/Makefile.am (EXTRA_DIST, COPY_FILES): Add new file. * lang/python/gpgme.i: Include new file and add comments. * lang/python/helpers.c: Include new file. * lang/python/helpers.h: Move functions we do not need to expose... * lang/python/private.h: ... here. Signed-off-by: Justus Winter <[email protected]>
2016-07-15python: Make GPGME's version easily accessible.Justus Winter1-4/+3
* lang/python/pyme/version.py.in (gpgme_versionstr): New variable. Signed-off-by: Justus Winter <[email protected]>