aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/gpg/core.py
diff options
context:
space:
mode:
authorTobias Mueller <[email protected]>2016-11-29 22:26:20 +0000
committerJustus Winter <[email protected]>2016-12-01 16:37:15 +0000
commit154389f2a5e4c13081cf0624222aad29ee480b56 (patch)
tree311b85056598d41cd134486ce47b6ff9774e8742 /lang/python/gpg/core.py
parentpython: Make Results have a nicer __repr__. (diff)
downloadgpgme-154389f2a5e4c13081cf0624222aad29ee480b56.tar.gz
gpgme-154389f2a5e4c13081cf0624222aad29ee480b56.zip
python: Make Context have a repr method.
* lang/python/gpg/core.py (Context.__repr__): New function. -- This makes Context objects look nicer in a REPL. Signed-off-by: Tobias Mueller <[email protected]>
Diffstat (limited to 'lang/python/gpg/core.py')
-rw-r--r--lang/python/gpg/core.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lang/python/gpg/core.py b/lang/python/gpg/core.py
index 748bcbb9..43856ab7 100644
--- a/lang/python/gpg/core.py
+++ b/lang/python/gpg/core.py
@@ -204,6 +204,14 @@ class Context(GpgmeWrapper):
self.pinentry_mode = pinentry_mode
self.protocol = protocol
+ def __repr__(self):
+ return (
+ "Context(armor={0.armor}, "
+ "textmode={0.textmode}, offline={0.offline}, "
+ "signers={0.signers}, pinentry_mode={0.pinentry_mode}, "
+ "protocol={0.protocol}"
+ ")").format(self)
+
def encrypt(self, plaintext, recipients=[], sign=True, sink=None,
passphrase=None, always_trust=False, add_encrypt_to=False,
prepare=False, expect_sign=False, compress=True):