python: Add keylist mode parameter.

* NEWS: Update.
* lang/python/gpg/core.py (Context.keylist): Add 'mode' parameter.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2017-02-14 15:56:41 +01:00
parent e17ab84129
commit fdc4e33dc3
No known key found for this signature in database
GPG Key ID: DD1A52F9DA8C9020
2 changed files with 6 additions and 2 deletions

1
NEWS
View File

@ -15,6 +15,7 @@ Noteworthy changes in version 1.8.1 (unreleased)
gpgme_data_rewind UN-DEPRECATE.
py: Context.__init__ EXTENDED: New keyword argument home_dir.
py: Context.home_dir NEW.
py: Context.keylist EXTENDED: New keyword argument mode.
Noteworthy changes in version 1.8.0 (2016-11-16)

View File

@ -483,12 +483,14 @@ class Context(GpgmeWrapper):
plainbytes = data.read()
return plainbytes, result
def keylist(self, pattern=None, secret=False):
def keylist(self, pattern=None, secret=False,
mode=constants.keylist.mode.LOCAL):
"""List keys
Keyword arguments:
pattern -- return keys matching pattern (default: all keys)
secret -- return only secret keys
secret -- return only secret keys (default: False)
mode -- keylist mode (default: list local keys)
Returns:
-- an iterator returning key objects
@ -496,6 +498,7 @@ class Context(GpgmeWrapper):
Raises:
GPGMEError -- as signaled by the underlying library
"""
self.set_keylist_mode(mode)
return self.op_keylist_all(pattern, secret)
def assuan_transact(self, command,