Commit Graph

954 Commits

Author SHA1 Message Date
Andre Heinecke
6175025c82
cpp: Make GpgME::Data::toKeys really const
* lang/cpp/src/data.cpp (GpgME::Data::toKeys): Rewind afterards.

--
This fixes unexpected behavior that the seek pointer is changed
after calling the const toKeys.
2019-02-21 13:04:54 +01:00
Ben McGinnes
302d5ef52e python: examples
* A rather obvious variant of the existing key import examples, except
  directed at Mailvelope's keyserver.
* Yeah, Werner, I know ... but it exists because I used it and there's
  no harm in sharing.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2019-02-11 06:34:40 +11:00
Ben McGinnes
e005052f4d python: docs
* Version bump in preparation for whenever GPGME 1.13.0 happens.
* Ran the post_installer.py for docs preparation again.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2019-01-31 05:52:59 +11:00
Ben McGinnes
2de1e59977 python: post installer script
* Removed auto-generated .texi files from doc/src/ so only the
  corrected versions are left.
* Which means now it is complete, but with the initial work to expand
  it with info file generation later.
2019-01-27 16:02:24 +11:00
Ben McGinnes
1e26572365 python: post installer docs fix script
* Moved post_installer.py into the examples/howto/ directory.
* Added instructions for its use to the Python Bindings HOWTO.
* Ran it as intended from the lang/python/ directory in order to both
  prove it works and quickly and easily get the updated howto
  replicated.  Also to fix all those .texi files.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2019-01-27 14:57:53 +11:00
NIIBE Yutaka
66bcb8acb2 build: With LD_LIBRARY_PATH defined, use --disable-new-dtags.
* configure.ac (LDADD_FOR_TESTS_KLUDGE): New for --disable-new-dtags.
* tests/Makefile.am (LDADD): Use LDADD_FOR_TESTS_KLUDGE.
* lang/cpp/tests/Makefile.am, lang/qt/tests/Makefile.am: Likewise.
* tests/gpg/Makefile.am, tests/gpgsm/Makefile.am: Likewise.
* tests/json/Makefile.am, tests/opassuan/Makefile.am: Likewise.

--

GnuPG-bug-id: 4298
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2019-01-16 10:59:25 +09:00
Andre Heinecke
66376f3e20
qt: Use tofu conflict test keys without expiry
* lang/qt/tests/t-tofuinfo.cpp: Use new test keys without
expiry.

--
The old keys expired on 2019-01-06.

GnuPG-Bug-Id: T3815
2019-01-09 08:26:25 +01:00
Ben McGinnes
a2e7c863c8 python: post installer doc fix script
* Got rid of the bash bit in the comments.
* Made the final printed instructions far more obvious.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2019-01-02 11:08:43 +11:00
Ben McGinnes
207d4289d8 python: examples
* Fixed inter-edit.py so it will actually work now.
* made 3 others executable.
* Fixed the semantics of assuan.py's instructions.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2019-01-02 11:08:43 +11:00
Ben McGinnes
ef9355c2fe python: docs processing
* Added some EPUB specific config options to the Sphinx config file
  which might help reduce some of Sphinx's more stupid default errors
  with EPUB validation.
* Added lang/python/post_installer.py script for automating the
  generation of .texi and .rst "source" files from the real source
  files written in Org mode.  Includes recreating the Sphinx Makefile
  which is excluded due to the m4 toolchain in parent directories, it
  also handles the rewriting of the reST index file properly and
  rewrites the .texi files so they don't impale themselves on Unicode.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-25 00:18:10 +11:00
Ben McGinnes
06bca0eaa8 python: docs
* Found a bug in org-mode's export to texinfo function which will
  require either manual modification of each file or a customs sed run
  over the generated files for all updates.
* Manually updated the current files for now, but will need to add
  some post-install processing scripts for future use (I already have
  some of these for my specific setup, they just need to be made a
  little more generic and platform independent for here).

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-22 09:39:13 +11:00
Ben McGinnes
dc5f416351 python: groups example
* Tightened code a little more.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-21 21:01:04 +11:00
Ben McGinnes
daded49254 python docs: house keeping
* Dropped the ASCII copyright line, since even MS have conceded their
  battle against Unicode enough to load UTF-8.
* Fixed the drafts section since there will be less need of multiple
  output format testing from next year.
2018-12-18 04:07:29 +11:00
Ben McGinnes
fbc298dc1b python: howto and examples
* Tightening up both the documentation and some of the example code.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-16 17:12:21 +11:00
Ben McGinnes
4308d17281 python: examples bugfix
* Fixed a bug in the ProtonMail importers (pmkey-*.py) where multiple
  keys found for a username would always result in the last email
  address checked being returned in the printed output for all located
  keys.
2018-12-14 05:17:10 +11:00
Ben McGinnes
3849b60e22 python: new example script
* Though Keybase really should not be encouraged due to
  disengenuosness and FUD emanating from that souce, this new script
  will obtain a key hosted on that site and import it when supplied
  with the keybase username.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-13 04:54:51 +11:00
Ben McGinnes
3ca7cf07f5 python: what's new summary
* Added a little more detail to the what's new section.
2018-12-12 23:18:22 +11:00
Ben McGinnes
64758a0dac python: advanced howto example
* Added Cython requirement to this advanced use case.
2018-12-12 23:05:50 +11:00
Ben McGinnes
4c324ac1be python: howto examples equirements
* Added small requirements.txt file for additional modules not in the
  standard python library and not including the bindings themselves
  and not including Cython, which is for more advanced examples.
2018-12-12 23:01:16 +11:00
Ben McGinnes
772b5aae24 python: hkp key importer
* Tweaked it slightly to avoid repetition of key searches when there
  is only one search pattern to check (i.e. usually a single key ID or
  fingerprint).
2018-12-11 09:55:15 +11:00
Ben McGinnes
2e7a14c9b3 python: HKP search and import updates
* Tweaked the code again so that it can also handle the cases where
  someone has included a hexadecimal string in their user ID.
* Updated the HOWTO to match.
* Exported to .rst and .texi.
2018-12-11 07:14:28 +11:00
Ben McGinnes
fe7e01d164 python: key import via HKP example
* Fixed the logic used to search for any given pattern.
* Added a sensible method of checking whether a pattern is a key ID or
  fingerprint.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-11 04:41:03 +11:00
Ben McGinnes
7c63bfe4ab python: docs updates
* Multiple updates, expanding on the Windows installation issues.
* Also adding to the new maintenance mode reference document.
* Includes content relating to the resolution of T4271 and T4191.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-10 16:05:14 +11:00
Ben McGinnes
ad030234b4 Merge branch 'master' of ssh+git://playfair.gnupg.org/git/gpgme 2018-12-06 01:53:08 +11:00
Ben McGinnes
dc5600d306 python: examples
* cut some of then poor len usage.
2018-12-06 01:50:52 +11:00
Daniel Kahn Gillmor
65c28da4e4
python: overhaul logic of Context.decrypt()
* lang/python/src/core.py (Context.decrypt): simplify and clarify the
logic behind handling verify=False.
* lang/python/tests/t-decrypt.py: ensure that we test verify=False

--

The function-internal variables were pretty unclear to the reader, and
the logic caused pretty nasty breakage when verify=False.

GnuPG-Bug-Id: 4271
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-12-05 11:46:10 +01:00
Daniel Kahn Gillmor
878a0ad012
python: ctx.decrypt() has problematic error handling
* lang/python/src/core.py (Context.decrypt): document odd
error-handling behavior as a potential problem to be addressed.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-12-05 11:46:09 +01:00
Daniel Kahn Gillmor
5d8b4f7489
python: Clarify the meaning of ctx.decrypt(verify=[])
* lang/python/src/core.py (Context.decrypt): docstring clarification
of what it means to pass an empty list to the verify argument.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-12-05 11:46:09 +01:00
Daniel Kahn Gillmor
b8fa76a30c
python: gpg.Context.decrypt verify_sigs and sink_result are bools
Both of these function-internal variables are never used for anything
other than a binary state.  Implement them as the booleans they are.
Otherwise, casual readers of the code might think that they're
supposed to represent something other than a flag (e.g. "verify_sigs"
could mean "the signatures to verify", and "sink_result" could mean
"the place where we sink the result").

Signed-Off-By: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-12-05 11:46:09 +01:00
Daniel Kahn Gillmor
49af6d76e5
python: clarify documentation for verify argument for Context.decrypt()
It's easy to miss that verify can take a list of keys.  Make it more
obvious to the average python dev who reads docstrings.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-12-05 11:46:09 +01:00
Daniel Kahn Gillmor
2491e6f92f
python: simplify Context.decrypt()
In the course of trying to address https://dev.gnupg.org/T4271, i
discovered that gpg.Context.decrypt() has a bit of superfluous code.
This changeset is intended to simplify the code without making any
functional changes.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-12-05 11:46:09 +01:00
Ben McGinnes
1dffdcc6e9 python: windows c and cython
* added warning that he Windows C runtime issues will also affect use
  with Cython and that relying on binary installers would remove that
  possible use case.
2018-12-05 10:51:59 +11:00
Ben McGinnes
c8a04af676 python: sphinx modification
* The make.bat file incorrectly triggers the trailing whitespace check
  in the git repo (it doesn't actually have any trailing whitespace,
  but triggers the error on every line).
* Will need to add a script to handle future org-mode conversions of
  the index page anyway, so will get that script to deal with this
  problem too by generating the make.bat file if the platform is
  detected as Windows.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-05 09:31:10 +11:00
Ben McGinnes
6d8823b811 python: Sphinx support
* Added framework from sphinx-quickstart to lang/python/doc/rst/ so
  that Python developers already using Sphinx can use the generated
  reST files with existing documentation systems.
* Note that when generating source files from Org-mode, the index page
  will require manual intervention to match the Sphinx requirements.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-05 09:17:31 +11:00
Ben McGinnes
8d2621fcad Merge branch 'master' of ssh+git://playfair.gnupg.org/git/gpgme 2018-12-05 08:49:41 +11:00
Ben McGinnes
8613727f1e python: docs update
* Expanded the section on issues with Windows installations, with
  greater detail of which versions of Visual Studio are needed
  depending on which version of CPython is to be used.
* Included a recommendation which is a bit harsh without being totally
  prickish.
* Updated all files to not link to author's key or related data in
  order to make them all consistent with the changes in commit
  649b196881.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-05 08:42:08 +11:00
Andre Heinecke
1d31420650
qt,cpp: Consistently use nullptr and override
* lang/cpp/src/Makefile.am, lang/qt/src/Makefile.am (AM_CPPFLAGS):
Add suggest-override and zero-as-null-pointer-constant warnings.

* lang/cpp/src/*, lang/qt/src/*: Consistenly use nullptr and override.

--
This was especially important for the headers so that downstream
users of GpgME++ or QGpgME do not get flooded by warnings if
they have these warnings enabled.

It also improves compiler errors/warnings in case of accidental
mistakes.
2018-12-03 12:25:00 +01:00
Werner Koch
649b196881
doc: Minor comment cleanups.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2018-12-03 10:41:00 +01:00
Ben McGinnes
2e3a681d0c python: documentation fixes
* Typographic and whitespace error correction pertaining to the
  previous update.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-01 08:15:43 +11:00
Ben McGinnes
3b056a01a2 python: documentation
* Added long description to setup.py.in.
* Added maintenance mode details with clarification for what type of
  things would be a bug as far as MM is concerned and what wouldn't
  be.
** Includes a not too subtle hint directed towards the donations page.
* Miscellaneous tightening of documentation.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-12-01 07:45:50 +11:00
Ben McGinnes
1c92f3ff55 python docs: checking key signatures
* Added instructions for checking key certifications or key
  signatures (depending on preferred terminology).
* Added pendulum module to recommended installations, but not to
  requirements.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-11-26 13:19:34 +11:00
Ben McGinnes
c87155e6eb python: docs update
* Added documentation for the new methods added to gpgme.version.
* Removed the Flask based advanced use case from the what-is-new
  section as that type of code will not be added here.
2018-11-22 20:00:12 +11:00
Ben McGinnes
de6bb23279 python: version as integers
* lang/python/version.py.in: added gpg.version.versionintlist
* If gpg.version.versionintlist[2] ever returns -1 then there's a
  serious problem with the build and it should be lodged as a bug if
  it's repeatable.  Seeing this should never happen, but checking for
  it is better than not doing so.
2018-11-22 18:00:22 +11:00
Ben McGinnes
fd34415bdd python: import type
* Fixed bug T4242 and tested that dropping "Import" in favour of
  "import_type" does indeed work just fine.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-11-19 21:38:50 +11:00
Ben McGinnes
f773ad392d python: import constant
* lang/python/src/constants/__init__.py: dropped use of Import
  capitalisation and renamed lang/python/src/constants/import.py to
  lang/python/src/constants/import_type.py to address bug T4242.
* lang/python/doc/src/gpgme-python-howto: minor docs updates.
2018-11-19 21:19:42 +11:00
Werner Koch
8d91c0f4cd
Add SPDX identifiers to most source files
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2018-11-16 13:27:33 +01:00
Daniel Kahn Gillmor
2557d0ae6f spelling: fix misspellings
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-11-08 12:34:27 +07:00
Ben McGinnes
d0a5caf73c docs: python bindings
* Continued restructuring as part of moving beyond mere;y the HOWTO
  file.
* Generated the alternative source files for reST and Texinfo.
* Fixed some errors and updated links after moving the what's new
  section to two new files (yes, two).
2018-11-06 16:22:50 +11:00
Ben McGinnes
0cb625da84 python examples: another importer
* Fixed a similar type of bug with the non-protonmail importer.
2018-11-06 14:58:15 +11:00
Ben McGinnes
1b9d30db08 python examples: protonmail hkp scripts
* fixed a bug in the import try statement for both versions.
2018-11-06 14:11:01 +11:00
Ben McGinnes
13e09bd21a docs: typo
* lang/python/doc/src/gpgme-python-howto: s/Revokinging/Revoking/g
2018-11-03 18:12:25 +11:00
Ben McGinnes
78be1e2f54 docs: python docs restructure
* Moved the what's new section out of the HOWTO (mostly), in
  anticipation of expanding the docs to be more than merely a HOWTO.
2018-10-31 03:41:47 +11:00
Ben McGinnes
d5c22966d5 docs: python
* dropped the ".org" extension and added a mode line for each file as
  this will make scripting format conversions a lot easier.
2018-10-31 03:06:24 +11:00
Andre Heinecke
62c736ba76
cpp,tests: Add another test runner
* lang/cpp/tests/run-verify.cpp: New.
* lang/cpp/tests/Makefile.am: Update accordingly.

--
Add another test runner which helps to find problems on windows.
2018-10-29 15:36:45 +01:00
Andre Heinecke
05a0e97f5c
cpp: Add some convenience functions
* lang/cpp/src/context.cpp (Context::create): New.
* lang/cpp/src/context.h: Update accordingly.
* lang/cpp/src/key.cpp, lang/cpp/src/key.h:
(Key::isBad, Subkey::isBad, UserID::isBad)
(UserID::Signature::isBad): Add shorthand for the isX checks.
* NEWS: Mention it.

--
I don't know how often I wrote:
if (key.isNull() || key.isExpired() || key.isRevoked() ...

And for the context it is good practice to use a unique ptr
so the API should make it easy.
2018-10-25 14:13:39 +02:00
Ben McGinnes
04791c8967 docs: python howto
* Fixed a few spelling and grammatical errors.
2018-10-23 23:38:56 +11:00
Ben McGinnes
59e38e3d2c Python: docs tweaks
* Fixed a minor error in how the reST version of the HOWTO is
  generated.
* Updated the help() in __init__.py with a little more detail as to
  why not to use the lower level functions.
2018-10-22 05:43:36 +11:00
Ben McGinnes
651a1afe80 python bindings: callback test
* lang/python/tests/t-callbacks.py: Updated test logic to try
  generating a key which expires in 2099 and if that fails then
  fallback to an expiration in 2037 in an attempt to catch the 32-bit
  systems.
2018-10-20 11:07:55 +11:00
Daniel Kahn Gillmor
9de1c96ac3 python: do not export HAVE_CXX11 definition
* lang/python/gpgme.i: ignore HAVE_CXX11 in SWIG interface

--

If there are two distinct builds (a) and (b) of gpgme which both build
python bindings, and build (a) also happens to build the C++ bindings,
then the generated gpg/gpgme.py file from build (a) will not be usable
with the .so generated in build (b), despite them being exactly the
same, and having nothing to do with C++.

In particular, it will fail with:

-----------
  File "…/gpg/__init__.py", line 99, in <module>
    from . import core
  File "…/gpg/core.py", line 10, in <module>
    from . import gpgme
  File "…/gpg/gpgme.py", line 152, in <module>
    HAVE_CXX11 = _gpgme.HAVE_CXX11
AttributeError: module 'gpg._gpgme' has no attribute 'HAVE_CXX11'
-----------

By asking SWIG to ignore this definition, we stabilize the generated
.py and the .so, ensuring that they are more cleanly interoperable.
2018-10-18 00:30:32 -04:00
Daniel Kahn Gillmor
a81534fed8 doc: convert more http:// links to https://
--

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-10-18 00:28:51 -04:00
Daniel Kahn Gillmor
2f12427e41 doc: use https:// for www.gnu.org
--

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-10-18 00:28:51 -04:00
Maximilian Krambach
9b6ed6a80f js: increase default startup timeout
--

* src/index.js: change the init default if none is given, so that all
  initialization defaults line up to 1000 miliseconds
2018-10-17 13:13:31 +02:00
Werner Koch
233d2f3d35
cl: Add missing file
--
Fixes-commit: 85d7af8ff2
My fault, sorry.

Signed-off-by: Werner Koch <wk@gnupg.org>
2018-10-12 09:05:41 +02:00
Guillaume LE VAILLANT
85d7af8ff2
cl: Several fixes
--

* Use wrapper types calling translation functions instead of
  TRANSLATE-{FROM,TO}-FOREIGN methods as they seem not to be
  called in some cases.
* Use the (:STRUCT SOME-C-STRUCT) notation instead of the
  deprecated direct reference to SOME-C-STRUCT.
* Add missing values in enums and bit fields.
* Use cffi-grovel to define system types (SIZE-T, OFF-T, etc).
* Wrap GPGME-DATA-T in a class (like contexts).
* Use the FINALIZE function from trivial-garbage to free the
  C objects for contexts, keys and data automatically.
* Make DATA-READ-CB and DATA-WRITE-CB run faster.
* Update the README file.

Signed-off-by: Guillaume LE VAILLANT <glv@posteo.net>
2018-10-12 09:02:18 +02:00
Andre Heinecke
c565cf42a3
cpp: Add KeyListMode::Locate
* cpp/src/global.h (KeyListMode): Add Locate.

--
Similar to locate in core.
2018-10-09 11:26:15 +02:00
Andre Heinecke
9f85f4967e
cpp: Add first manual tests
* lang/cpp/Makefile.am: Add tests subdir.
* lang/cpp/tests/Makefile.am: New.
* lang/cpp/tests/README,
lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp: New.
* configure.ac: Configure tests makefile.

--
The autotests for c++ live in lang/qt/tests these
tests are more for manual experiments to validate some
functionality.
2018-10-09 11:24:18 +02:00
Andre Heinecke
7a1e6dbfb1
cpp: Initialize all gpgme_key_t's in context
* lang/cpp/src/context.cpp (Context::startKeyListing),
(Context::keyListResult, Context::signingKeys): Initialize key.

--
"Should" not be neccessary but it's cleaner and would have
covered the case of the previous commit.
2018-10-09 10:47:16 +02:00
Andre Heinecke
bf4aae4512
qt, tests: Add test for single get key
* lang/qt/tests/t-keylist.cpp (testGetKey): New.

--
Added this to check if there was a memleak in that function.
2018-10-09 09:37:28 +02:00
Werner Koch
1aff2512d8
Release 1.12.0
* configure.ac: Bump core LT version to C32/A21/R0.  Bump C++ LT
version to C14/A8/R0.

* lang/qt/tests/Makefile.am (CLEANFILES): Add reader status files.
* Makefile.am (EXTRA_DIST): Add conf/whatisthis.

Signed-off-by: Werner Koch <wk@gnupg.org>
2018-10-08 11:17:01 +02:00
Werner Koch
ecfa48fffa
build: Move config.h to conf/config.h
* conf/: New dir.
* configure.ac (AC_CONFIG_HEADER): Move header to conf dir.
* doc/Makefile.am (mkdefsinc): Adjust rule.
* lang/python/Makefile.am (copystamp): Ditto.
--

C++ uses those stupid files without a suffix and thus the new standard
header <version> as included by newer other libc++ versions may
conflict with the VERSION file in out top directory.   This change
should solve the problem.

GnuPG-bug-id: 4168
Signed-off-by: Werner Koch <wk@gnupg.org>
2018-10-05 15:14:58 +02:00
Ben McGinnes
033da18b88 docs: whitespace bug
* Same as before, but exported.
2018-10-05 02:41:45 +10:00
Ben McGinnes
a8d4aa6f76 docs: org to texinfo whitspace bug
* replaced "." in headings with "·" to prevent whitspace being
  appended by texinfo and breaking git.
2018-10-05 02:38:14 +10:00
Ben McGinnes
0b5930b276 docs: python
* Fixed an error in the new index page and then exported to the other
  two "source" formats.
2018-10-05 02:30:20 +10:00
Ben McGinnes
4825887972 docs: python
* lang/python/doc/meta/TODO.org: Added the two major documentation
  build system tasks to the TODO list.
* Added an index page in preparation for sorting out the second of
  those TODO lists (Docutils is a lot easier to handle than Texinfo).
* Meanwhile, have confirmed that it all builds just fine under
  GNU/Linux, OS X and FreeBSD while retaining the documentation, so
  that's a nice improvement from 1.11.1.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-10-05 01:47:56 +10:00
Ben McGinnes
f3fc737382 python: makefiles
* doc/Makefile.am: Removed a bit I forgot about.
* Renamed lang/python/docs to lang/python/doc bvecause apparently
  automake cares about that too.
* Decided to be extra explicit in the manifest because if I don't then
  all sorts of things get deleted ... like lang/python
* Tested on an external linux system just in case my osx workstation
  introduces too much weirdness.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-10-04 21:10:46 +10:00
Ben McGinnes
2cca422ca4 python: make file
* lang/python/Makefile.am: Attempting to remove the docs/meta
  directory did a lot worse than I thought it was doing, so better to
  just be sure the documentation is available than destroy the entire
  bindings directory.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-10-04 18:28:47 +10:00
Ben McGinnes
582f14d97a python: make file
* lang/python/Makefile.am: Now that gpg2 has been renamed back to gpg
  and gpg1 is semi-deprecated, we should check what the actual gpg
  binary is with gpgconf and use that rather than make assumptions per
  system.
* Also, it means less worry if gpg3 is ever a thing.  (Trust me, I
  remember the Python 1 to 2 transition as well as the current 2 to 3
  transition).  ;)

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-10-04 18:11:01 +10:00
Ben McGinnes
a174b26943 docs: more whitespace checks
* lang/python/docs/texinfo/short-history.texi:
2018-10-04 07:20:32 +10:00
Ben McGinnes
962dfca9b8 dpcs: python howto
* More updates to the docs themselves and the versions to be available
  with the next release.
* .texi and .rst copies of the HOWTO and the short history of (this
  part) of the project.
2018-10-04 07:09:40 +10:00
Ben McGinnes
2151b9828a docs: python
* More restructuring.  Also the painstaking task of deciphering some
  of the more eclectic aspects of Texinfo and make.
2018-10-04 07:06:57 +10:00
Ben McGinnes
a982f91315 docs: python bindings
* Restructured the docs directory to account for the GNU preferred
  source doc format (.texi) and the Python preferred source doc
  format (.rst) and the real source doc format (.org).
* Both the perceived source formats will need to be generated from the
  .org files and included at this stage.  Unfortunately there is not
  yet a native org-to-rst transformation method in the org-mode
  software in Emacs nor is there a a direct means of going from reST
  to Org-mode from Docutils.  There's only third party packages like
  Pandoc and, while very good, there is no guarantee of consistency;
  so we can't entirely automate this bit (yet).
2018-10-04 06:57:51 +10:00
Ben McGinnes
b280205319 docs: pre-python preparation
* doc/Makefile.am: removed the python howto from this file, restoring
  it to just the main project and the newer .js files.
* deleted: doc/gpgme-python-howto.texi
* renamed the Short_History.org file to short-history.org to keep the
  naming conventions similar.
* All the Python files can (and should) live together.
2018-10-04 01:42:12 +10:00
Ben McGinnes
23894ac9a9 python bindings: CPython order
* Changed the order of python versions the configure/make process
  checks for, placing Python 3.7 ahead of 3.6.
* Updated the HOWTO documentation to reflect this change.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-10-03 06:58:51 +10:00
Ben McGinnes
76bdfabb05 docs: python bindings
* Tightened up the docs a little bit, updated the "what's new"
  section, dropped the "-draft" version in preparation for GPGME
  1.12.0's release.
* Exported another .texi version (and updated the draft copies to this
  commit (which ought to be 1.11.1-beta313).

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-10-01 02:10:03 +10:00
Ben McGinnes
837a476053 python bindings: fixing decrypt-verify
* lang/python/src/core.py: First restoring the exception to the being
  just that.
* The means to manipulate the error output is temporarily in commented
  out code, but ought to be added to a proper test later.
* In the mean time the original test, with a very slight change, works
  again.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-09-30 19:32:45 +10:00
Ben McGinnes
11403a4635 python bindings: ctx.decrypt
* lang/python/src/core.py: Fixed methods of detecting whether verify
  is a boolean variable or a list.
* Added methods of catching the missing keys exceptions.
* Still retained PEP8 compliance (which might have been where one or
  two problems crept in).
* Though this is essentially the correct behaviour, it still does not
  quite fit the otiginal test; so that will also require some adjustment.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-09-30 16:28:54 +10:00
Ben McGinnes
ce045a1ef9 example: local signatures
* lang/python/examples/howto/local-sign-group.py: added the bit where
  specifying the signing key is actually used for signing rather than
  just pruning the list of keys to certify.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-09-27 23:23:37 +10:00
Ben McGinnes
a047e0f68e example: python bindings
* lang/python/examples/howto/local-sign-group.py: locally sign every
  key in a group line except one's own keys.  Intended to address the
  sort of thing one might see on lists like PGPNET or other closed
  groups amongst activists, journalists, etc. where everyone encrypts
  to all recipients, but may not sign everyone's keys publicly..

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-09-27 22:45:37 +10:00
Ben McGinnes
1d40d360bc docs: python bindings installation
* lang/python/docs/gpgme-python-howto.org: added a section on
  installing the bindings to a python virtualenv.
2018-09-27 14:06:48 +10:00
Ben McGinnes
b9aea3b9c2 tests: python bindings
* Fixed the final assertion to look for what will actually be reported
  in that case instead of something else (i.e. it looks for an
  IMPORT_ERROR status code).
2018-09-27 10:07:08 +10:00
Ben McGinnes
7c9f49a499 examples: python bindings
* Fixed homedir specifying logic in several cases.
2018-09-27 09:57:50 +10:00
Ben McGinnes
b625258d54 docs: a typographical two-step
* Sometimes you really do need or want punctuation in a heading, but
  ideally without something else generating whitespace and other
  annoyances to go with it.
* Trying a real decimal point instead.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-09-25 10:17:39 +10:00
Ben McGinnes
62e4e2cb5e docs and examples: python bindings
* Woumd up the "what's new" section.
* Added an example for sending a key to the keyservers via hkp4py.
* Updated the export key code to use a more complete check for the
  $GNUPGHOME location.
* Expanded on the installation and reinstallation troubleshooting
  section.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-09-25 09:59:31 +10:00
Ben McGinnes
e9da4d9710 docs: python bindings howto
* Added a What's New section to summarise changes since the last
  release.  There have been quite a few and some attention does need
  to be drawn to some of them.
* Confirming certain issues with some platform builds, especially
  BSD/OSX vs. Linux issues which will need to update the installation
  troubleshooting guides.
2018-09-25 04:32:13 +10:00
Ben McGinnes
b12b2cc996 docs and examples: python bindings howto
* Added more comprehensive examples using hkp4py and added a couple
  more example scripts for protonmail.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-09-23 19:36:54 +10:00
Ben McGinnes
ced4bdbbb2 examples: python bindings and hkp4py updates
* Mostly tightening up the details on the hkp4py example script.
* Also fixed a typo in the LGPL boiler plate text included in all the
  other example scripts for the HOWTO.
2018-09-23 11:43:34 +10:00
Ben McGinnes
6ed9a77c92 python bindings: importing from keyservers with hkp4py
* added a new example script to search the keyservers and import the
  results, this time using Marcel Fest's hkp4py module.
* Updated the key importing section to match this addition.
* Tested with the current version of hkp4py from github.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-09-23 08:18:44 +10:00
Ben McGinnes
3622576105 docs: python bindings howto
* Confirmed that updates to the tests have significant'y improved that
  output.
* Updated some of the additional notes for the section on hkp4py.
** This is in anticipation adding at least import examples using that
   module as well.  It may also include adding examples of exporting a
   key and uploading it to the keyservers.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-09-23 05:37:40 +10:00
Werner Koch
6878126b6f
python: Fix a couple of syntax errors.
* lang/python/tests/t-keylist-from-data.py: Add missing line
continuation.
* lang/python/tests/t-keylist.py: Ditto.
* lang/python/tests/t-quick-key-creation.py: Ditto.
* lang/python/tests/t-quick-subkey-creation.py: Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
2018-09-20 17:45:07 +02:00
Werner Koch
dcdabf5f2e
python: Silence a few warnings.
* src/gpgme.h.in: Obsolete "class" also for Python.
* lang/python/gpgme.i: Silenece a swig warning.  Silence a gcc
warning.

Signed-off-by: Werner Koch <wk@gnupg.org>
2018-09-20 17:45:07 +02:00