aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/pyme/core.py
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-08-03 14:32:30 +0000
committerJustus Winter <[email protected]>2016-08-03 14:32:30 +0000
commit56e26b54da9f16961209275d7a61883d3ea898ca (patch)
treece321c374924d73d9bcc083f4227d558d80734be /lang/python/pyme/core.py
parentpython: Add a flag identifying in-tree builds. (diff)
downloadgpgme-56e26b54da9f16961209275d7a61883d3ea898ca.tar.gz
gpgme-56e26b54da9f16961209275d7a61883d3ea898ca.zip
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 <[email protected]>
Diffstat (limited to 'lang/python/pyme/core.py')
-rw-r--r--lang/python/pyme/core.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/lang/python/pyme/core.py b/lang/python/pyme/core.py
index e12dc7bd..f9df6e84 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