commit b8e8218e856ebfff94ab6fd1728ba67d54095066 Author: Isis Lovecruft isis@torproject.org Date: Tue Apr 22 14:48:39 2014 +0000
Add docstring for crypto._createGPGMEErrorInterpreters(). --- lib/bridgedb/crypto.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/lib/bridgedb/crypto.py b/lib/bridgedb/crypto.py index cddc108..606bce2 100644 --- a/lib/bridgedb/crypto.py +++ b/lib/bridgedb/crypto.py @@ -243,6 +243,20 @@ def getHMACFunc(key, hex=True): return hmac_fn
def _createGPGMEErrorInterpreters(): + """Create a mapping of GPGME ERRNOs ←→ human-readable error names/causes. + + This function is called automatically when :mod:`this module + <bridgedb.crypto>` is loaded. The resulting dictionary mapping is stored + as :attr:`~bridgedb.crypto.gpgmeErrorTranslations`, and is used by + :exc:`~bridgedb.crypto.LessCrypticGPGMEError`. + + :returns: A dict of:: + {str(ERRNO): [ERRORNAME, ANOTHER_ERRORNAME, …], + …, + str(ERRORNAME): str(ERRNO), + …} + for all known error numbers and error names/causes. + """ errorDict = {} errorAttrs = []
tor-commits@lists.torproject.org