aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-08-30python bindings: estreams fixben/estreams-fixBen McGinnes1-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]>
2018-08-29python bindings: coreBen McGinnes1-6/+7
* lang/python/src/core.py: expanded gpgme_error check lists.
2018-08-29python bindings: coreBen McGinnes1-0/+1
* lang/python/src/core.py: added gpgme_data_set_flag to the errorcheck funtion.
2018-08-29python bindings: coreBen McGinnes1-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.
2018-08-29docs: python bindings - protonmail examplesBen McGinnes3-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.
2018-08-28docs: python bindings HOWTOBen McGinnes1-13/+24
* Finished CFFI vs SWIG bit in known issues. * tidied up some of the structure. * Fixed some minor errors and links.
2018-08-28docs: python bindingsBen McGinnes1-3/+22
* Added section on why no CFFI.
2018-08-28docs: python howtoBen McGinnes1-0/+94
* Added another key import example using ProtonMail's new keyserver.
2018-08-27docs: python bindingsBen McGinnes1-1/+157
* Added details on installation troubleshooting.
2018-08-19Python bindings examplesBen McGinnes3-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.
2018-08-18Python bindings setup fileBen McGinnes1-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.
2018-08-18Python bindings tests: Near PEP8 complianceBen McGinnes31-500/+773
* PEP8 compliance for the vast majoeity of the tests.
2018-08-18Python bindings examples: PEP8 conplianceBen McGinnes12-35/+49
* Appears to be complete compliance.
2018-08-18Python bindings setup: Near PEP8 complianceBen McGinnes2-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.
2018-08-18Python bindings constants: PEP8 compliance (almost)Ben McGinnes19-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.
2018-08-18Python bindings src: PEP8 complianceBen McGinnes5-13/+18
* import namespace clearance for src/*.py. * Fixed a handful of is/is not None checks as well.
2018-08-13Symmetric exampleBen McGinnes1-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]>
2018-08-13Symmetric encryption exampleBen McGinnes1-4/+4
* lang/python/examples/howto/symcrypt-file.py: Fixed the error code and the passphrase key word arg.
2018-08-13Symmetric encryption example.Ben McGinnes1-0/+63
* lang/python/examples/howto/symcrypt-file.py: A variation on standard key based encryption.
2018-08-10PEP8 compliance and other code fixesBen McGinnes10-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]>
2018-08-09Link fixesBen McGinnes2-18/+18
* lang/python/README: Fixed links in both versions of the README.
2018-08-06Make GNUPGHOME for tests overridableAndre Heinecke1-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
2018-07-22docs: python bindings howtoBen McGinnes1-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]>
2018-07-22doc: python bindings howtoBen McGinnes1-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.
2018-07-22doc: python bindings howtoBen McGinnes1-0/+1
* Added org-mode byline.
2018-07-13python bindings: example scriptsBen McGinnes2-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.
2018-07-10example scripts: python work-aroundsBen McGinnes1-3/+3
* fixed three typos which were guaranteed to break said script.
2018-07-09docs: python bindings howtoBen McGinnes1-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.
2018-07-07python bindings: howto examplesBen McGinnes13-67/+71
* Made sure all example scripts meet PEP8 compliance. * Required fixing approx. a dozen of them in minor ways.
2018-07-01python bindings: scheming serpentsBen McGinnes1-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.
2018-07-01python bindings: gpg.coreBen McGinnes1-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).
2018-06-29python bindings: python 3.7Ben McGinnes4-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.
2018-06-28whitespace police:Ben McGinnes1-2/+2
* There's always one or, in this case, two.
2018-06-28docs: python bindings howtoBen McGinnes1-0/+358
* Updated official doc (the org-mode file) with the instructions on importing and exporting both public and secret keys.
2018-06-28python bindings examplesBen McGinnes1-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.
2018-06-28python bindings examplesBen McGinnes1-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.
2018-06-28python bindings examples: three export scriptsBen McGinnes3-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]>
2018-06-28python bindings: import exampleBen McGinnes1-0/+91
* Added an example script for importing a key from a file (either ASCII armoured or not).
2018-06-28python bindings: export secret keysBen McGinnes1-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]>
2018-06-28python bindings: export public keysBen McGinnes1-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.
2018-06-28python bindings: export public keysBen McGinnes1-1/+58
* Added functions for exporting public keys to gpg.core in both complete form and in minimised form. * Rather than letting people need to worry about the export modes we are simply separating the functions as people would be more familiar with from the command line usage anyway. * Functions added for Context are: ctx.key_export_minimal and ctx.key_export as the default or full export. Signed-off-by: Ben McGinnes <[email protected]>
2018-06-17python bindings: core import statementsBen McGinnes1-3/+3
* Fixed the bit I broke while fixing the PEP8 compliance issues.
2018-06-17python bindings: core — PEP8 complianceBen McGinnes1-77/+101
* Fixed most of the PEP8 errors in core.py * Those remaining may need more than little edits and are a bit strange (too clearly the result of a programmer who has spent far too much time dealing with Lisp so that for Python it looks ... strange).
2018-06-17python bindings: core - key importgsoc/jacob-key-importBen McGinnes1-9/+37
* Wrapped the key import function in the try/exception statements needed to catch at least the most likely unsuccessful import attempt errors. * Mostly draws on the file error and no data import statuses for errors, with a couple of exceptions. Signed-off-by: Ben McGinnes <[email protected]>
2018-06-16python bindings: core key importBen McGinnes2-5/+28
* The foundation of a pythonic key import function authored by Jacob Adams. * A unit testing script for the same function originally authored by Tobias Mueller * Added DCO reference for Jacob Adams to the GPGME AUTHORS file. * Additional details regarding this patch are available here: https://dev.gnupg.org/T4001 Signed-off-by: Ben McGinnes <[email protected]>
2018-06-10script: groups.pyBen McGinnes1-1/+7
* Added check for if it is run on a Windows system so that the correct binary filename is invoked.
2018-06-07examples: python howtoBen McGinnes3-0/+262
* Uses the groups module to prepare a list of recipients and encrypt to those. * The main version (encrypt-to-group.py) tries to check for invalid recipients, but still falls back to always trust for the second encryption attempt. * The gullible version doesn't try pruning the recipient list at all, it just tries to encrypt and if it fails, switches straight to always trust. * The trustno1 version doesn't use the always trust model at all and only attempts pruning the list of invalid recipients.
2018-06-02docs: python bindings howtoBen McGinnes1-66/+73
* Another attempt at fixing the org-mode version. * A proof reader ascertained there were tabs in it instead of whitespace. * Stripped the lot out and replaced with standard 4 spaces, fixed every incorrect example ... and it still breaks upon save and/or export. * Added the reference to the mutt-groups.py script to demonstrate the groups.py module/code.
2018-05-24examples: mutt crypt-hooks generatorBen McGinnes1-0/+64
* Added a script which demonstrates how the groups module works. * Script generates Mutt/Neomutt crypt-hooks for every group entry in gpg.conf, including those entries for multiple keys (Mutt handles that differently).
2018-05-24docs: python bindings howtoBen McGinnes2-9/+13
* Fixed the groups.py script so it really does what is described (the old code had the same result for groups, group_lines and group_lists). * Updated the corresponding example in the doc to match.