aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* docs: python bindings howtoBen McGinnes2018-09-164-0/+3135
| | | | | | | | | | | | * Added new advanced section with an example of using the Python bindings with CPython code compiled back to C code using Cython. * Though it may seem a bit counter-intuitive to use the bindings just to go back to C via a different route, this is not actually stupid. * Added examples/howto/advanced/cython/ directory. * Added keycount.pyx, setup.py and the keycount.c file which the first two generated with Cython. Not including the .so and .o files from the build. * Exported the .texi version of the howto for the main docs.
* docs: even more editsBen McGinnes2018-09-161-1/+1
| | | | | * doc/gpgme-python-howto.texi: hunting down and killing commas, Oxford or not it can't stay in a heading.
* docs: more editsBen McGinnes2018-09-161-1/+3
| | | | | | * lang/python/docs/gpgme-python-howto.org: more tweaks and edits, along with another build of output formats. * doc/gpgme-python-howto.texi: updated texinfo version for parent docs.
* docs: whitespace culledBen McGinnes2018-09-151-4/+16
| | | | | | * lang/python/docs/gpgme-python-howto.org: Identified and fixed the headings which kept generating lines with trailing whitespace when exporting to Texinfo format and adjusted them to prevent that.
* docs: renaming and draftsBen McGinnes2018-09-151-0/+34
| | | | | | | | * lang/python/docs/gpgme-python-howto.org: Renamed file to better fit the rest of the project's docs. * Added a section on the very unofficial drafts I periodically post links to since they're often the easiest way to get a web version in front of someone in a hurry.
* docs: Python howto updateBen McGinnes2018-09-151-1/+7
| | | | | | | | * lang/python/docs/GPGMEpythonHOWTOen.org: Added corresponding GPGME version number to table at the start and cut the shortcut from the groups.py example. * doc/gpgme-python-howto.texi: New export of Texinfo file for docs build.
* Python bindings: docsBen McGinnes2018-09-151-16/+38
| | | | | | | * lang/python/docs/GPGMEpythonHOWTOen.org: Fixed a few errors in the newer sections. * Updated code in the examples using secret key exporting and group lines to reflect the Python 2.7 compatibility fixes added.
* Python bindings: examplesBen McGinnes2018-09-152-2/+8
| | | | | | * lang/python/examples/howto/export-secret-keys.py and groups.py: Updated the backwards compatibility adjustments to account for unicode differences between python 2 and 3.
* Python examples: backwards compatibilityBen McGinnes2018-09-152-2/+13
| | | | | | | | | | | * lang/python/examples/howto/groups.py: subprocess update * lang/python/examples/howto/export-secret-keys.py: subprocess update Both of these try the nice and easy method of getting the subprocess output available in Python 3, but will fall back to the older Popen method if it doesn't work. Essentially this is to be a little nicer to Python 2.7.15 (even though the examples are filled with warnings that py2 support is not guaranteed with the examples).
* docs: python bindingsBen McGinnes2018-08-311-2/+2
| | | | | | * minor typographic update. Signed-off-by: Ben McGinnes <[email protected]>
* python bindings: estreams fixben/estreams-fixBen McGinnes2018-08-301-7/+7
| | | | | | | | | | | | * lang/python/src/core.py: Adjusted new_from_estream function to alias new_from_stream instead of fd. * fixed the _gpgme import errors introduced in commit 08cd34afb762975b0273575035dacf69449ef241 by changing the exported functions/types to match the inner module where all the work is done, rather than the outer one(s). Tested-by: Ben McGinnes <[email protected]> Signed-off-by: Ben McGinnes <[email protected]>
* python bindings: coreBen McGinnes2018-08-291-6/+7
| | | | * lang/python/src/core.py: expanded gpgme_error check lists.
* python bindings: coreBen McGinnes2018-08-291-0/+1
| | | | | * lang/python/src/core.py: added gpgme_data_set_flag to the errorcheck funtion.
* python bindings: coreBen McGinnes2018-08-291-1/+7
| | | | | * lang/python/src/core.py: added new function new_from_estream to wrap new_from_fd just like new_from_stream does and for the same reason.
* docs: python bindings - protonmail examplesBen McGinnes2018-08-293-1/+17
| | | | | | | | * lang/python/docs/GPGMEpythonHOWTOen.org: Updated links to the ProtonMail keyserver import scripts and added a warning regarding being unable to update third party keys. * lang/python/examples/howto/pmkey-import-alt.py: added usage. * lang/python/examples/howto/pmkey-import.py: added usage.
* docs: python bindings HOWTOBen McGinnes2018-08-281-13/+24
| | | | | | * Finished CFFI vs SWIG bit in known issues. * tidied up some of the structure. * Fixed some minor errors and links.
* docs: python bindingsBen McGinnes2018-08-281-3/+22
| | | | * Added section on why no CFFI.
* docs: python howtoBen McGinnes2018-08-281-0/+94
| | | | * Added another key import example using ProtonMail's new keyserver.
* docs: python bindingsBen McGinnes2018-08-271-1/+157
| | | | * Added details on installation troubleshooting.
* Python bindings examplesBen McGinnes2018-08-193-1/+251
| | | | | | | * import-key.py: fixed a minor typo. * pmkey-import.py: locates and imports keys from the ProtonMail keyserver. * pmkey-import-alt.py: the same as the previous except with setting an alternative $GNUPGHOME directory.
* Python bindings setup fileBen McGinnes2018-08-181-2/+11
| | | | | | * Moved the build import back up where it belongs. * Included comments indicating how to build and install for multiple Python versions beyond the first 2 on the same system.
* Python bindings tests: Near PEP8 complianceBen McGinnes2018-08-1831-500/+773
| | | | * PEP8 compliance for the vast majoeity of the tests.
* Python bindings examples: PEP8 conplianceBen McGinnes2018-08-1812-35/+49
| | | | * Appears to be complete compliance.
* Python bindings setup: Near PEP8 complianceBen McGinnes2018-08-182-89/+119
| | | | | | * lang/python/version.py.in: Fixed most things, but there's still an issue near the build portion with the existing Python bugs referenced. * lang/python/setup.py.in: Now PEP8 compliant.
* Python bindings constants: PEP8 compliance (almost)Ben McGinnes2018-08-1819-35/+29
| | | | | | * PEP8 compliance for all constants except the globals in src/constants/__init__.py depending on whether the import sequence affects the globals themselves.
* Python bindings src: PEP8 complianceBen McGinnes2018-08-185-13/+18
| | | | | * import namespace clearance for src/*.py. * Fixed a handful of is/is not None checks as well.
* Symmetric exampleBen McGinnes2018-08-131-2/+2
| | | | | | | | * lang/python/examples/howto/symcrypt-file.py: *sigh*; passphrase was right the first time, just the error check that wasn't. * I really should stop second guessing myself one of these days ... Signed-off-by: Ben McGinnes <[email protected]>
* Symmetric encryption exampleBen McGinnes2018-08-131-4/+4
| | | | | * lang/python/examples/howto/symcrypt-file.py: Fixed the error code and the passphrase key word arg.
* Symmetric encryption example.Ben McGinnes2018-08-131-0/+63
| | | | | * lang/python/examples/howto/symcrypt-file.py: A variation on standard key based encryption.
* PEP8 compliance and other code fixesBen McGinnes2018-08-1010-130/+220
| | | | | | | | | | | * Ran all the .py files in src/ and below through Yapf. * Included some manual edits of core.py, this time successfully making two notorious sections a bit more pythonic than scheming. * Left the module imports as is. * This will be committed if it passes the most essential test: compiling, installing and running it. Signed-off-by: Ben McGinnes <[email protected]>
* Link fixesBen McGinnes2018-08-092-18/+18
| | | | * lang/python/README: Fixed links in both versions of the README.
* Make GNUPGHOME for tests overridableAndre Heinecke2018-08-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/python/tests/Makefile.am, lang/qt/tests/Makefile.am, tests/Makefile.am, tests/gpg/Makefile.am, tests/gpgsm/Makefile.am, tests/opassuan/Makefile.am (GNUPGHOME): Make variable explict. -- If the build directory has too long path, gpgme could fail. This is similar to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847206 In order to fix that, this patch extracts the GNUPGHOME variable to be presented directly in the Makefile and thus overridable by command line option. A build system can then create a symlink to the GNUPGHOME directory in /tmp and use that symlink as the GNUPGHOME directory thus making the path very short. GnuPG-Bug-Id: T4091 Patch provided by vlmarek
* docs: python bindings howtoBen McGinnes2018-07-221-170/+169
| | | | | | | | | | | | | | | | | | * Fixed and tested the changes necessary for org-mode to correctly parse pythonic (Python 3) indentation. * Updated the source blocks to recommended upper case for BEGIN_SRC and END_SRC. * Tested and confirmed XHTML output matches correct examples. * Tested against pseudo-control output via exporting from org-mode to org-mode and then exporting that to XHTML. Remaining differences appear to be discarding the custom tags used to provide X[HT]ML id elements to each section which does not appear to offer any benefit. * Exporting directly to XHTML or other HTML output should no longer cause problems, but if there are any then the first step should be exporting from org-to-org and then exporting that to XHTML. Tested-by: Ben McGinnes <[email protected]> Signed-off-by: Ben McGinnes <[email protected]>
* doc: python bindings howtoBen McGinnes2018-07-221-624/+623
| | | | | | * Another retrofitting of the HOWTO Python example code, this time following adjustments to python-mode configuration and having trawled through the org-mode mailing lists for clues.
* doc: python bindings howtoBen McGinnes2018-07-221-0/+1
| | | | * Added org-mode byline.
* python bindings: example scriptsBen McGinnes2018-07-132-2/+2
| | | | | | * Fixed incorrect mention of output prompt referencing secret keys when the scripts are only for exporting public keys in whole or minimised forms.
* example scripts: python work-aroundsBen McGinnes2018-07-101-3/+3
| | | | * fixed three typos which were guaranteed to break said script.
* docs: python bindings howtoBen McGinnes2018-07-091-1251/+1235
| | | | | | | | | | | * Complete typographic overhaul. * Removed all section level indentation since it does not affect output formatting, but might affect source code examples. * In text-mode stripped out all tabs which had crept in and replaced them with four spaces. * Updated all code examples (again) to conform with Python-mode. * Bumped version number in preparation for next release of GPG 2.2.9 and corresponding GPGME release.
* python bindings: howto examplesBen McGinnes2018-07-0713-67/+71
| | | | | * Made sure all example scripts meet PEP8 compliance. * Required fixing approx. a dozen of them in minor ways.
* python bindings: scheming serpentsBen McGinnes2018-07-011-69/+17
| | | | | | * Apparently I am wrong and Scheme is the new Python after all. * Non-import related PEP8 compliance must wait for another day, though the other PEP8 fixes remain.
* python bindings: gpg.coreBen McGinnes2018-07-011-27/+79
| | | | | | | | | * Changed id/else statements to a more pythonic form from scheme masquerading as python - sorry Justus, it had to go ;). * With the added bonus of enabling PEP8 compliance in those sections. * Fixed remaining PEP8 compliance issues with the exception of the imports at the beginning of the file (changing those will break the entire module, so we'll cope with it as it is).
* python bindings: python 3.7Ben McGinnes2018-06-294-6/+11
| | | | | | | | * Bindings confirmed to work with the newly released 3.7.0. * Updated M4 file to reflect this change and correct the Python binary search order (3.7 is not yet given priority, but will still be found first via the more generic python3 executable). * Updated setup.py.in, bindings documentation and README to reflect this.
* whitespace police:Ben McGinnes2018-06-281-2/+2
| | | | * There's always one or, in this case, two.
* docs: python bindings howtoBen McGinnes2018-06-281-0/+358
| | | | | * Updated official doc (the org-mode file) with the instructions on importing and exporting both public and secret keys.
* python bindings examplesBen McGinnes2018-06-281-0/+110
| | | | | | * Added a secret key export variant which saves output as both GPG binary and ASCII armoured, plus saves in $GNUPGHOME and uses multiple methods of determining what that location is.
* python bindings examplesBen McGinnes2018-06-281-0/+73
| | | | | * Added a key import variant which accesses the SKS keyservers in a RESTful fashion and then imports or attempts to import the response.
* python bindings examples: three export scriptsBen McGinnes2018-06-283-0/+223
| | | | | | | | * Example of default exporting keys. * Example of exporting minimised keys. * Example of exporting secret keys to a file with correct permissions. Signed-off-by: Ben McGinnes <[email protected]>
* python bindings: import exampleBen McGinnes2018-06-281-0/+91
| | | | | * Added an example script for importing a key from a file (either ASCII armoured or not).
* python bindings: export secret keysBen McGinnes2018-06-281-1/+42
| | | | | | | | | | | | | | * The holy grail: a function to export secret keys. * GPGME will still invoke pinentry and gpg-agent as usual to authorise the export. * Mostly similar to the two previous export functions for public keys except that it will return None if the result had a length of zero bytes. Meaning that the difference between the specified pattern (if any) not matching available keys and an incorrect passphrase is not able to be determined from this function (or the underlying one for that matter). Signed-off-by: Ben McGinnes <[email protected]>
* python bindings: export public keysBen McGinnes2018-06-281-6/+18
| | | | | | * Updated key_export and key_export_minimal to return None where a pattern matched no keys in a manner simnilar to the possible result of key_export_secret.