From d31d0cf1311576b226229904a4bdbddc94b641db Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Mon, 9 Mar 2015 08:12:41 +0000 Subject: [PATCH] Handle MISSING_PASSPHRASE in _parsers.Sign. * FIXES #91. --- gnupg/_parsers.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gnupg/_parsers.py b/gnupg/_parsers.py index cddbc2c..dbdcb79 100644 --- a/gnupg/_parsers.py +++ b/gnupg/_parsers.py @@ -912,6 +912,7 @@ class Sign(object): timestamp = None #: xxx fill me in what = None + status = None def __init__(self, gpg): self._gpg = gpg @@ -934,9 +935,9 @@ class Sign(object): :raises: :exc:`~exceptions.ValueError` if the status message is unknown. """ if key in ("USERID_HINT", "NEED_PASSPHRASE", "BAD_PASSPHRASE", - "GOOD_PASSPHRASE", "BEGIN_SIGNING", "CARDCTRL", - "INV_SGNR", "SIGEXPIRED"): - pass + "GOOD_PASSPHRASE", "MISSING_PASSPHRASE", + "BEGIN_SIGNING", "CARDCTRL", "INV_SGNR", "SIGEXPIRED"): + self.status = key.replace("_", " ").lower() elif key == "SIG_CREATED": (self.sig_type, self.sig_algo, self.sig_hash_algo, self.what, self.timestamp, self.fingerprint) = value.split() @@ -953,6 +954,7 @@ class Sign(object): else: raise ValueError("Unknown status message: %r" % key) + class ListKeys(list): """Handle status messages for --list-keys.