[Pkg-gnupg-commit] [gpgme] 06/132: python: Make Context have a repr method.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Apr 26 01:00:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gpgme.

commit 154389f2a5e4c13081cf0624222aad29ee480b56
Author: Tobias Mueller <muelli at cryptobitch.de>
Date:   Tue Nov 29 23:26:20 2016 +0100

    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 <muelli at cryptobitch.de>
---
 lang/python/gpg/core.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lang/python/gpg/core.py b/lang/python/gpg/core.py
index 748bcbb..43856ab 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):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git



More information about the Pkg-gnupg-commit mailing list