diff options
author | Tobias Mueller <[email protected]> | 2016-12-20 17:02:36 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-02-14 10:19:50 +0000 |
commit | 01d5c17587578c729bbbb60f8a65635975e35592 (patch) | |
tree | 392609c38a1c2ef1dd07683f68e3d91b6622cca6 /lang/python/gpg/core.py | |
parent | python: Remove the -builtin flag for SWIG. (diff) | |
download | gpgme-01d5c17587578c729bbbb60f8a65635975e35592.tar.gz gpgme-01d5c17587578c729bbbb60f8a65635975e35592.zip |
python: Extend SWIG gpgme_{sub,}key with a __repr__ method.
* 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 <[email protected]>
Diffstat (limited to 'lang/python/gpg/core.py')
0 files changed, 0 insertions, 0 deletions