Handle MISSING_PASSPHRASE in _parsers.Sign.

* FIXES #91.
fix/91-missing-passphrase
Isis Lovecruft 2015-03-09 08:12:41 +00:00
parent f3c193d8b4
commit d31d0cf131
No known key found for this signature in database
GPG Key ID: 18C16EC5F9F1D673
1 changed files with 5 additions and 3 deletions

View File

@ -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.