Merge remote-tracking branch 'garrettr/fix-verbose-True' into develop

fix/24-enc-to-file
Isis Lovecruft 2013-10-08 13:51:17 +00:00
commit 86d02879a9
No known key found for this signature in database
GPG Key ID: 5C17776E27F7E84D
2 changed files with 13 additions and 0 deletions

View File

@ -139,6 +139,12 @@ class GPGBase(object):
log.error("GPGBase.__init__(): %s" % ae.message)
raise RuntimeError(ae.message)
else:
if verbose is True:
# The caller wants logging, but we need a valid --debug-level
# for gpg. Default to "basic", and warn about the ambiguity.
# (garrettr)
verbose = "basic"
log.warning('GPG(verbose=True) is ambiguous, defaulting to "basic" logging')
self.verbose = verbose
self.use_agent = use_agent

View File

@ -78,6 +78,13 @@ class GPG(GPGBase):
and private keyrings. Default is whatever GnuPG
defaults to.
:param str,int,bool verbose: String or numeric value to pass to gpg's
``--debug-level`` option. See the gpg man
page for the list of valid options. If
False, debug output is not generated by
the gpg binary. If True, defaults to
``--debug-level basic.``
:param str keyring: Name of keyring file containing public key data, if
unspecified, defaults to 'pubring.gpg' in the
``homedir`` directory.