[tor-commits] [bridgedb/master] Fix class and __init__ docstrings for EmailBasedDistributor.

isis at torproject.org isis at torproject.org
Wed Mar 26 05:49:31 UTC 2014


commit ce8604c52f4b9f1488a9676794116addccb0b78a
Author: Isis Lovecruft <isis at torproject.org>
Date:   Mon Mar 17 03:04:19 2014 +0000

    Fix class and __init__ docstrings for EmailBasedDistributor.
---
 lib/bridgedb/Dist.py |   24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py
index 9d3b06e..dddc84b 100644
--- a/lib/bridgedb/Dist.py
+++ b/lib/bridgedb/Dist.py
@@ -413,17 +413,25 @@ def normalizeEmail(addr, domainmap, domainrules):
 
 class EmailBasedDistributor(Distributor):
     """Object that hands out bridges based on the email address of an incoming
-       request and the current time period.
+    request and the current time period.
+
+    :type splitter: :class:`~bridgedb.Bridges.BridgeRing`
+    :ivar splitter: A hashring to hold all the bridges we hand out.
     """
-    ## Fields:
-    ##   emailHmac -- an hmac function used to order email addresses within
-    ##       a ring.
-    ##   ring -- a BridgeRing object to hold all the bridges we hand out.
-    ##   store -- a database object to remember what we've given to whom.
-    ##   domainmap -- a map from lowercase domains that we support mail from
-    ##       to their canonical forms.
+
     def __init__(self, key, domainmap, domainrules,
                  answerParameters=None):
+        """Create a bridge distributor which uses email.
+
+        :type emailHmac: callable
+        :param emailHmac: An hmac function used to order email addresses
+            within a ring. See :func:`~bridgedb.crypto.getHMACFunc`.
+        :param dict domainmap: A map from lowercase domains that we support
+            mail from to their canonical forms. See `EMAIL_DOMAIN_MAP` option
+            in `bridgedb.conf`.
+        :param domainrules: DOCDOC
+        :param answerParameters: DOCDOC
+        """
         key1 = getHMAC(key, "Map-Addresses-To-Ring")
         self.emailHmac = getHMACFunc(key1, hex=False)
 





More information about the tor-commits mailing list