[git] GPGME - branch, master, updated. gpgme-1.6.0-256-g56e26b5

by Justus Winter cvs at cvs.gnupg.org
Wed Aug 3 16:34:38 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  56e26b54da9f16961209275d7a61883d3ea898ca (commit)
      from  4c8265d32ddff5960a464b8d4e8d7d2258495b2e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 56e26b54da9f16961209275d7a61883d3ea898ca
Author: Justus Winter <justus at g10code.com>
Date:   Wed Aug 3 16:32:30 2016 +0200

    python: Add a nicer interface to list keys.
    
    * lang/python/pyme/core.py (Context.keylist): New method.
    * lang/python/tests/t-keylist.py: Test new method.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/lang/python/pyme/core.py b/lang/python/pyme/core.py
index e12dc7b..f9df6e8 100644
--- a/lang/python/pyme/core.py
+++ b/lang/python/pyme/core.py
@@ -468,6 +468,21 @@ class Context(GpgmeWrapper):
             plainbytes = data.read()
         return plainbytes, result
 
+    def keylist(self, pattern=None, secret=False):
+        """List keys
+
+        Keyword arguments:
+        pattern	-- return keys matching pattern (default: all keys)
+        secret	-- return only secret keys
+
+        Returns:
+                -- an iterator returning key objects
+
+        Raises:
+        GPGMEError	-- as signaled by the underlying library
+        """
+        return self.op_keylist_all(pattern, secret)
+
     def assuan_transact(self, command,
                         data_cb=None, inquire_cb=None, status_cb=None):
         """Issue a raw assuan command
diff --git a/lang/python/tests/t-keylist.py b/lang/python/tests/t-keylist.py
index fb59321..40d9c80 100755
--- a/lang/python/tests/t-keylist.py
+++ b/lang/python/tests/t-keylist.py
@@ -216,7 +216,7 @@ result = c.op_keylist_result()
 assert not result.truncated, "Key listing unexpectedly truncated"
 
 
-for i, key in enumerate(c.op_keylist_all(None, False)):
+for i, key in enumerate(c.keylist()):
     try:
         if len(keys[i]) == 4:
             fpr, sec_keyid, uids, n_subkeys = keys[i]

-----------------------------------------------------------------------

Summary of changes:
 lang/python/pyme/core.py       | 15 +++++++++++++++
 lang/python/tests/t-keylist.py |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list