Cleanup coding style and docstrings in old module code.
parent
9e851f796d
commit
25e3949633
41
gnupg.py
41
gnupg.py
|
@ -498,40 +498,35 @@ class Sign(object):
|
||||||
"GOOD_PASSPHRASE", "BEGIN_SIGNING", "CARDCTRL", "INV_SGNR"):
|
"GOOD_PASSPHRASE", "BEGIN_SIGNING", "CARDCTRL", "INV_SGNR"):
|
||||||
pass
|
pass
|
||||||
elif key == "SIG_CREATED":
|
elif key == "SIG_CREATED":
|
||||||
(self.type,
|
(self.type, algo, hashalgo, cls, self.timestamp,
|
||||||
algo, hashalgo, cls,
|
self.fingerprint) = value.split()
|
||||||
self.timestamp, self.fingerprint
|
|
||||||
) = value.split()
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("Unknown status message: %r" % key)
|
raise ValueError("Unknown status message: %r" % key)
|
||||||
|
|
||||||
|
|
||||||
class GPG(object):
|
class GPG(object):
|
||||||
|
"""Encapsulate access to the gpg executable"""
|
||||||
decode_errors = 'strict'
|
decode_errors = 'strict'
|
||||||
|
|
||||||
result_map = {
|
result_map = {'crypt': Crypt,
|
||||||
'crypt': Crypt,
|
'delete': DeleteResult,
|
||||||
'delete': DeleteResult,
|
'generate': GenKey,
|
||||||
'generate': GenKey,
|
'import': ImportResult,
|
||||||
'import': ImportResult,
|
'list': ListKeys,
|
||||||
'list': ListKeys,
|
'sign': Sign,
|
||||||
'sign': Sign,
|
'verify': Verify,}
|
||||||
'verify': Verify,
|
|
||||||
}
|
|
||||||
|
|
||||||
"Encapsulate access to the gpg executable"
|
|
||||||
def __init__(self, gpgbinary='gpg', gnupghome=None, verbose=False,
|
def __init__(self, gpgbinary='gpg', gnupghome=None, verbose=False,
|
||||||
use_agent=False, keyring=None, options=None):
|
use_agent=False, keyring=None, options=None):
|
||||||
"""Initialize a GPG process wrapper. Options are:
|
"""
|
||||||
|
Initialize a GPG process wrapper.
|
||||||
|
|
||||||
gpgbinary -- full pathname for GPG binary.
|
@param gpgbinary: Full pathname for GPG binary.
|
||||||
|
@param gnupghome: Full pathname to where we can find the public and
|
||||||
gnupghome -- full pathname to where we can find the public and
|
private keyrings. Default is whatever gpg defaults to.
|
||||||
private keyrings. Default is whatever gpg defaults to.
|
@param keyring: Name of alternative keyring file to use. If specified,
|
||||||
keyring -- name of alternative keyring file to use. If specified,
|
the default keyring is not used.
|
||||||
the default keyring is not used.
|
@options: A list of additional options to pass to the GPG binary.
|
||||||
options =-- a list of additional options to pass to the GPG binary.
|
|
||||||
"""
|
"""
|
||||||
self.gpgbinary = gpgbinary
|
self.gpgbinary = gpgbinary
|
||||||
self.gnupghome = gnupghome
|
self.gnupghome = gnupghome
|
||||||
|
|
Loading…
Reference in New Issue