<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gpgme/lang/python/gpgme.i, branch dkg/fix-T3464</title>
<subtitle>GnuPG Made Easy.</subtitle>
<id>http://git.bktus.com/gpgfrontend/gpgme/atom?h=dkg%2Ffix-T3464</id>
<link rel='self' href='http://git.bktus.com/gpgfrontend/gpgme/atom?h=dkg%2Ffix-T3464'/>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/'/>
<updated>2018-10-18T04:30:32Z</updated>
<entry>
<title>python: do not export HAVE_CXX11 definition</title>
<updated>2018-10-18T04:30:32Z</updated>
<author>
<name>Daniel Kahn Gillmor</name>
<email>dkg@fifthhorseman.net</email>
</author>
<published>2018-10-18T02:23:59Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=9de1c96ac3cf6fa126325002b61a1b606037ca88'/>
<id>urn:sha1:9de1c96ac3cf6fa126325002b61a1b606037ca88</id>
<content type='text'>
* 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 &lt;module&gt;
    from . import core
  File "…/gpg/core.py", line 10, in &lt;module&gt;
    from . import gpgme
  File "…/gpg/gpgme.py", line 152, in &lt;module&gt;
    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.
</content>
</entry>
<entry>
<title>python: Silence a few warnings.</title>
<updated>2018-09-20T15:45:07Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-09-20T15:28:25Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=dcdabf5f2ef84e1f304fcc0590ec4bb160354af5'/>
<id>urn:sha1:dcdabf5f2ef84e1f304fcc0590ec4bb160354af5</id>
<content type='text'>
* 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 &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>python: Default whence argument for Data() to SEEK_SET.</title>
<updated>2017-12-04T07:10:06Z</updated>
<author>
<name>Tobias Mueller</name>
<email>muelli@cryptobitch.de</email>
</author>
<published>2017-08-22T15:48:25Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=3cf9aedc92b6c65d2cb34037e52b9a299637d03b'/>
<id>urn:sha1:3cf9aedc92b6c65d2cb34037e52b9a299637d03b</id>
<content type='text'>
* lang/python/gpgme.i: copied signature from gpgme.h and defaulted the
value to SEEK_SET.
* lang/python/tests/t-data.py: Added a test for no second argument
--

Having to import the os package when wanting to read a Data object is a
slight annoyance. With SWIG, we can define default parameters. This
change defaults the whence argument to SEEK_SET which is how StringIO
and BytesIO behave.

Signed-off-by: Tobias Mueller &lt;muelli@cryptobitch.de&gt;
</content>
</entry>
<entry>
<title>python: Wrap 'gpgme_op_keylist_from_data_start'.</title>
<updated>2017-03-21T11:55:33Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2017-03-21T11:32:31Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=f3e8d8a4518de2768692e0b392262d0da6d0fd84'/>
<id>urn:sha1:f3e8d8a4518de2768692e0b392262d0da6d0fd84</id>
<content type='text'>
* NEWS: Update.
* lang/python/gpg/core.py (Context.keylist): New keyword argument
'source'.  If given, list keys from 'source'.
* lang/python/gpgme.i: Wrap the argument to
'gpgme_op_keylist_from_data_start'.
* lang/python/tests/Makefile.am (py_tests): Add new test.
* lang/python/tests/support.py (EphemeralContext): Do not throw an
error if no agent has been started in the context.
* lang/python/tests/t-keylist-from-data.py: New file.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Support manipulating the TOFU policy.</title>
<updated>2017-02-17T16:08:03Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2017-02-17T16:07:05Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=15fbac9e72a4d1bff9a3b9e9822f9175b09fbcd5'/>
<id>urn:sha1:15fbac9e72a4d1bff9a3b9e9822f9175b09fbcd5</id>
<content type='text'>
* NEWS: Update.
* doc/gpgme.texi: Fix typos.
* lang/python/gpg/constants/__init__.py: Import new files.
* lang/python/gpg/constants/tofu/__init__.py: New file.
* lang/python/gpg/constants/tofu/policy.py: New file.
* lang/python/gpg/core.py (Context.key_tofu_policy): New function.
* lang/python/gpgme.i: Nice reprs for gpgme_tofu_info_t.
* lang/python/setup.py.in: Install new package.
* lang/python/tests/t-quick-key-manipulation.py: Extend test.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Fix error handling.</title>
<updated>2017-02-16T13:42:17Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2017-02-16T13:42:17Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=048c5f74b61d5e4fa7617ce7c9111c6754bd4409'/>
<id>urn:sha1:048c5f74b61d5e4fa7617ce7c9111c6754bd4409</id>
<content type='text'>
* lang/python/gpgme.i (typemap gpgme_key_t[]): Set an error if a
non-key element is discovered.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Wrap utility functions.</title>
<updated>2017-02-14T15:33:55Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2017-02-14T15:30:30Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=92adc9bbf640eb5d9177d3ba0189e0f6cee4e995'/>
<id>urn:sha1:92adc9bbf640eb5d9177d3ba0189e0f6cee4e995</id>
<content type='text'>
* NEWS: Update.
* lang/python/gpg/core.py (pubkey_algo_string): New function.
(pubkey_algo_name): Add docstring.
(hash_algo_name): Likewise.
(get_protocol_name): Likewise.
(addrspec_from_uid): New function.
* lang/python/gpgme.i (gpgme_pubkey_algo_string): Result must be
freed.
(gpgme_addrspec_from_uid): Likewise.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Use the correct function to free buffers.</title>
<updated>2017-02-14T15:33:54Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2017-02-14T15:16:05Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=9fc9533c2835ec53c4fd4f822b09e9fec14626d0'/>
<id>urn:sha1:9fc9533c2835ec53c4fd4f822b09e9fec14626d0</id>
<content type='text'>
* lang/python/gpgme.i (char *): Free using 'gpgme_free'.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Nicer repr for user ids.</title>
<updated>2017-02-14T15:33:37Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2017-02-14T14:55:20Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=e17ab84129045512cf60c221ee43aa877507662f'/>
<id>urn:sha1:e17ab84129045512cf60c221ee43aa877507662f</id>
<content type='text'>
* lang/python/gpgme.i (_gpgme_user_id): Provide a nicer repr() for
user ids.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Extend SWIG gpgme_{sub,}key with a __repr__ method.</title>
<updated>2017-02-14T10:19:50Z</updated>
<author>
<name>Tobias Mueller</name>
<email>muelli@cryptobitch.de</email>
</author>
<published>2016-12-20T17:02:36Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=01d5c17587578c729bbbb60f8a65635975e35592'/>
<id>urn:sha1:01d5c17587578c729bbbb60f8a65635975e35592</id>
<content type='text'>
* lang/python/gpgme.i: Added a genericrepr macro and use it for
gpgme_key, gpgme_subkey, and gpgme_key_sig.
--

To look nicer in Python's REPL.

We define a generic __repr__ as a SWIG macro and use that to extend some
defined SWIG objects.

The alternative would have been to write a custom __repr__ function for
each class but that would need to be changed everytime the object's
structure changes. The bindings should be easy to maintain, I guess.
This comes at the expense that the reprs are now relatively long and
contain, for example, both keyid and fingerprint.

Signed-off-by: Tobias Mueller &lt;muelli@cryptobitch.de&gt;
</content>
</entry>
</feed>
