[Pkg-gnupg-commit] [gpgme] 242/412: python: Add accessors for the protocol.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Sep 22 21:26:55 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gpgme.
commit 78f7bf4dcf75206faae5776c2ee4166628313532
Author: Justus Winter <justus at g10code.com>
Date: Thu Jul 28 10:59:46 2016 +0200
python: Add accessors for the protocol.
* lang/python/pyme/core.py (Context.__init__): Add 'protocol'
parameter.
(Context.protocol): New accessors.
Signed-off-by: Justus Winter <justus at g10code.com>
---
lang/python/pyme/core.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lang/python/pyme/core.py b/lang/python/pyme/core.py
index 6ca8cb8..3ca4747 100644
--- a/lang/python/pyme/core.py
+++ b/lang/python/pyme/core.py
@@ -169,6 +169,7 @@ class Context(GpgmeWrapper):
def __init__(self, armor=False, textmode=False, offline=False,
signers=[], pinentry_mode=constants.PINENTRY_MODE_DEFAULT,
+ protocol=constants.PROTOCOL_OpenPGP,
wrapped=None):
"""Construct a context object
@@ -178,6 +179,7 @@ class Context(GpgmeWrapper):
offline -- do not contact external key sources (default False)
signers -- list of keys used for signing (default [])
pinentry_mode -- pinentry mode (default PINENTRY_MODE_DEFAULT)
+ protocol -- protocol to use (default PROTOCOL_OpenPGP)
"""
if wrapped:
@@ -194,6 +196,7 @@ class Context(GpgmeWrapper):
self.offline = offline
self.signers = signers
self.pinentry_mode = pinentry_mode
+ self.protocol = protocol
def encrypt(self, plaintext, recipients=[], sign=True, sink=None,
passphrase=None, always_trust=False, add_encrypt_to=False,
@@ -487,6 +490,14 @@ class Context(GpgmeWrapper):
def pinentry_mode(self, value):
self.set_pinentry_mode(value)
+ @property
+ def protocol(self):
+ """Protocol to use"""
+ return self.get_protocol()
+ @protocol.setter
+ def protocol(self, value):
+ self.set_protocol(value)
+
_ctype = 'gpgme_ctx_t'
_cprefix = 'gpgme_'
--
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