Commit Graph

2174 Commits

Author SHA1 Message Date
Justus Winter
09c1e4a85e Merge branch 'master' of git+ssh://playfair.gnupg.org/git/gpgme 2016-05-17 15:13:46 +02:00
Justus Winter
db34332535 Merge branch 'justus/pyme3' 2016-05-17 15:10:28 +02:00
Werner Koch
afc65aa60a
Trailing white space cleanup for 2 files in tests/.
--
2016-05-17 14:33:49 +02:00
Justus Winter
10328324c8 python: Clean up examples.
* 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 <justus@gnupg.org>
2016-05-17 14:22:22 +02:00
Justus Winter
64e5fe767f python: Import GPGMEError.
* pyme/core.py: Import GPGMEError.

Fixes c5d118b2.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-17 14:18:21 +02:00
Justus Winter
9ceaec2591 python: Port more tests.
* 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 <justus@gnupg.org>
2016-05-17 14:18:21 +02:00
Andre Heinecke
52f2295d52 Qt: Add keyLocateJob and test for it
* configure.ac (LIBQGPGME_LT_REVISION): Bump.
* lang/qt/src/protocol.h (locateKeysJob): Add Job.
* lang/qt/src/protocol_p.h (locateKeysJob): Implement.
* lang/qt/tests/Makefile.am: Add t-keylocate.
* lang/qt/tests/t-keylocate.cpp: New.
2016-05-13 13:16:12 +02:00
Andre Heinecke
66ded1a5ce Qt: Add missing copyright header in test
* lang/qt/tests/t-keylist.cpp: Add copyright header.
2016-05-13 12:52:52 +02:00
Justus Winter
11314f0db6 python: Share generated methods between objects.
* 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 <justus@gnupg.org>
2016-05-12 18:29:04 +02:00
Justus Winter
c5d118b2a7 python: Raise exceptions on write errors.
* lang/python/pyme/core.py (Data.write): Handle errors.
* lang/python/pyme/errors.py (GPGMEError.fromSyserror): New function.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 18:01:24 +02:00
Justus Winter
f7094d8358 python: Fix writing to data buffers.
* 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 <justus@gnupg.org>
2016-05-12 17:59:21 +02:00
Justus Winter
e64bffe030 python: Add a test suite.
* 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 <justus@gnupg.org>
2016-05-12 15:37:00 +02:00
Justus Winter
ed0ce84fbd python: Cache generated wrapper functions.
* lang/python/util.py (GpgmeWrap.__getattr__): Cache generated wrapper
functions.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 14:57:42 +02:00
Justus Winter
e3d3d366bd python: Fix function invocation.
* lang/python/pyme/core.py (Data.new_from_fd): Fix function
invocation.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 12:59:05 +02:00
Justus Winter
af9371eb63 python: Fix name of exception, make slot methods explicit.
* lang/python/pyme/util.py (GpgmeWrapper._getctype): Fix exception,
add docstring.
(GpgmeWrapper._getnameprepend): New function.
(GpgmeWrapper._errorcheck): Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 12:59:05 +02:00
Justus Winter
ce5121ad53 python: Handle interpreter shutdown.
* 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 <justus@gnupg.org>
2016-05-12 11:53:43 +02:00
Justus Winter
c89d3a71ad python: Make test case more robust.
* lang/python/examples/t-edit.py: Check if key is found.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 11:51:21 +02:00
Justus Winter
d60deb8a12 python: Fix type translation.
* 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 <justus@gnupg.org>
2016-05-12 11:49:17 +02:00
Andre Heinecke
b8de79160b Cpp: Ensure gpgme.h is taken from current build
* lang/cpp/src/Makefile.am (AM_CPPFLAGS): Add gpgme.h location.
--
This fixes the build in case an incompatible gpgme.h is also
installed in other include locations.
2016-05-11 14:56:20 +02:00
Justus Winter
bbeee5e1a0 python: Fix simple example.
* lang/python/examples/simple.py: Flush stdout, encode name as
UTF-8 before passing it to GPGME.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-11 13:51:40 +02:00
Justus Winter
a29babd07c python: Integrate into the build system.
* 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 <justus@gnupg.org>
2016-05-11 13:33:05 +02:00
Andre Heinecke
34e5c5b33d Merge branch 'gpgmepp' 2016-05-10 16:43:36 +02:00
Andre Heinecke
c303292aca Qt / Cpp: Fix make dist
* lang/cpp/src/Makefile.am (EXTRA_DIST): Fix typo.
(private_gpgmepp_headers): New. Private headers.
(libgpgmepp_la_SOURCES): Add private headers.
* lang/qt/src/Makefile.am (t_keylist_SOURCES): Remove non existent
header.
2016-05-10 15:09:12 +02:00
Justus Winter
11392a80d9 python: PEP8 fixes.
Cherry picked from 0267c151.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-10 14:45:44 +02:00
Andre Heinecke
b7d5c2cced Qt: Fix unkonwn doxygen keyword warnings
--
Reimp is not a keqword and we inherit documentation anyway.
2016-05-10 14:32:22 +02:00
Andre Heinecke
56c4d9ea95 Qt: Make Protocol class public API
* lang/qt/src/Makefile.am (qgpgme_headers): Add protocol.h
(private_qgpgme_headers): Add protocol_p.h
* lang/qt/src/protocol.h: New. From QGpgMEBackend.
* lang/qt/src/protocol_p.h: New. From QGpgMEBackend.
* lang/qt/src/qgpgmebackend.h,
lang/qt/src/qgpgmebackend.cpp (Protocol): Removed.

--
The backend class does not make much sense anymore as we
only have the GpgME backend obviously. It's purpose was
for Libkleo's Backend abstraction.
2016-05-10 14:05:10 +02:00
Andre Heinecke
97225bb01c Qt: Make doxygen quieter
* lang/qt/doc/Doxyfile.in: Quiet and no undocumented warnings.
2016-05-10 14:02:27 +02:00
Andre Heinecke
740f92a7b8 Qt: Only install public headers
* lang/qt/src/Makefile.am: Do not install all headers.
--
The qgpgme classes hide the implementation and thus make it
easier to change it without ABI breaks. They should not
be installed.
2016-05-10 14:02:27 +02:00
Justus Winter
aade53a12b python: Delete trailing whitespace.
--
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-10 13:30:30 +02:00
Justus Winter
000dbb5b9a python: Drop Debian packaging.
--
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-10 13:21:34 +02:00
Justus Winter
f4ba16b31e python: Rename bindings.
--
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-10 13:19:26 +02:00
Justus Winter
f531608539 Merge branch 'master' into justus/pyme3 2016-05-10 13:03:34 +02:00
Andre Heinecke
0e3195948d Qt: Add test for async keylisting
* src/lang/qt/tests/t-keylist.cpp(KeyListTest::testKeyListAsync): New.
2016-05-10 12:51:45 +02:00
Werner Koch
fc38c15136
Allow cc to detect missing cases in a switch.
* src/delete.c (delete_status_handler): Remove default case from a
switch so that cc can check the use of all enum values.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-05-10 10:27:54 +02:00
Andre Heinecke
a579be82c8 Use common error message style for qt lang checks
* configure.ac: Use common error highliting for qt lang options.
2016-05-06 14:47:24 +02:00
Andre Heinecke
11ff8d5964 Qt: Fix license mentioned in README
* lang/qt/README: License is GPLv2+ and not LGPL.
--
The only part under lgpl is the QByteArray dataprovider.
2016-05-06 14:41:22 +02:00
Andre Heinecke
20b02a7dd4 Qt: Fix library name in Copyright headers
--
Files are not part of libkleopatra anymore.
2016-05-06 14:20:45 +02:00
Andre Heinecke
cd267791e9 Add maybe mode for langs and default to it
* configure.ac (languages): Warn and disable langs for which
requirements are not met.

--
If the languages are explicitly enabled on the command line
missing dependencies for them will still lead to errors.
2016-05-06 14:17:15 +02:00
Andre Heinecke
3fad121677 Cpp: Handle PINENTRY_LAUNCHED status line
* lang/cpp/src/editinteractor.cpp (EditInteractor::needsNoResponse):
Add GPGME_STATUS_PINENTRY_LAUNCHED.

--
PINENTRY_LAUNCHED needs no response in any Job. This fixes
Jobs which errored out on unknown status lines.
2016-05-06 13:19:18 +02:00
Andre Heinecke
5489532ad6 Cpp: Add support for pubkey_algo_name
* lang/cpp/src/key.cpp (Subkey::algoName): New.
* lang/cpp/src/key.h: Declare.
2016-04-12 16:08:10 +02:00
Andre Heinecke
d949d711dc Cpp: Add support for gpgme_data_identify
* lang/cpp/src/data.cpp (Data::type): New.
* lang/cpp/src/data.h (Data::Type): New enum mapping.
2016-04-12 16:05:31 +02:00
Andre Heinecke
6dba47c3a2 Fix configuration without Qt language
* configure.ac: Define HAVE_DOXYGEN also if qt should not be built.
2016-04-12 09:42:36 +02:00
Andre Heinecke
8e7074dbb8 Qt/Cpp: Bump so version to 6.
* configure.ac (LIBGPGMEPP_LT_CURRENT, LIBQGPGME_LT_CURRENT): Bump.

--
While the KDE Frameworks versions had a different name increasing
the number avoids a conflict with KDE4 versions and is generally
more consistent.
2016-04-11 18:21:26 +02:00
Andre Heinecke
d2b5510119 Qt / Cpp: Mention coding style in READMES
* src/lang/cpp/README, src/lang/qt/README: Add hacking note.
2016-04-11 18:16:05 +02:00
Andre Heinecke
a1e95f36ce Qt: Add doc generation with doxygen
* configure.ac: Look for doxygen if qt is built.
 Configure new files.
* lang/qt/doc/Doxyfile.in: New.
* lang/qt/doc/Makefile.am: New.
* lang/qt/README: Update.

--
Currently this is a standard doxyfile template without much
customization.
2016-04-11 18:10:54 +02:00
Andre Heinecke
d9f7a18ed8 Qt: Fix unit test by adding initial.test dep
* lang/qt/tests/t-keylist.cpp: Verify that GNUPGHOME is set.
* lang/qt/tests/initial.test: New dummy test.
* lang/qt/tests/Makefile.am: Add dependency to initial.test

--
Feels weird but this follows the pattern in tests/gpg/Makefile.am
and solves the problem that the environment is dirty.
2016-04-11 17:46:03 +02:00
Andre Heinecke
afd8fad6e2 Qt: Remove remaining boost usage
* lang/qt/src/dataprovider.h,
 lang/qt/src/decryptjob.h,
 lang/qt/src/decryptverifyjob.h,
 lang/qt/src/encryptjob.h,
 lang/qt/src/qgpgmeadduseridjob.cpp,
 lang/qt/src/qgpgmechangeexpiryjob.cpp,
 lang/qt/src/qgpgmechangeownertrustjob.cpp,
 lang/qt/src/qgpgmechangepasswdjob.cpp,
 lang/qt/src/qgpgmedecryptjob.cpp,
 lang/qt/src/qgpgmedecryptverifyjob.cpp,
 lang/qt/src/qgpgmedeletejob.cpp,
 lang/qt/src/qgpgmedownloadjob.cpp,
 lang/qt/src/qgpgmeencryptjob.cpp,
 lang/qt/src/qgpgmeexportjob.cpp,
 lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
 lang/qt/src/qgpgmeimportjob.cpp,
 lang/qt/src/qgpgmekeygenerationjob.cpp,
 lang/qt/src/qgpgmekeylistjob.cpp,
 lang/qt/src/qgpgmenewcryptoconfig.cpp,
 lang/qt/src/qgpgmenewcryptoconfig.h,
 lang/qt/src/qgpgmesignencryptjob.cpp,
 lang/qt/src/qgpgmesignjob.cpp,
 lang/qt/src/qgpgmesignkeyjob.cpp,
 lang/qt/src/qgpgmeverifydetachedjob.cpp,
 lang/qt/src/qgpgmeverifyopaquejob.cpp,
 lang/qt/src/signencryptjob.h,
 lang/qt/src/signjob.h,
 lang/qt/src/threadedjobmixin.cpp,
 lang/qt/src/threadedjobmixin.h,
 lang/qt/src/verifydetachedjob.h,
 lang/qt/src/verifyopaquejob.h: Remove boost usage.

--
Mostly done with search and replace.
2016-04-11 17:15:16 +02:00
Andre Heinecke
e18256fc5f Qt: Remove predicates.h and stl_util.h
* src/lang/qt/predicates.h, src/lang/qt/stl_util.h: Removed.

--
The magic is still better placed in libkleo.
2016-04-11 17:14:09 +02:00
Andre Heinecke
d293bd3229 Qt: Remove usage of stl_util.h and predicates.h
* src/lang/qt/qgpgmelistallkeysjob.cpp: Use comperators from
  gpgmepp instead of detail. Remove boost usage.
2016-04-11 17:06:35 +02:00
Andre Heinecke
1bb162a54b Cpp: Add string comparators for keys
* lang/cpp/src/global.h (GPGMEPP_MAKE_STRCMP): New.
  (_gpgmepp_strcmp): NULL save wrapper around std::strcmp.
* lang/cpp/src/key.h: Add comparators for various attributes.

--
This was taken from libkleo predicates.h. Appears generally useful.
2016-04-11 17:06:14 +02:00