[tor-commits] [bridgedb/develop] Remove the __len__() method from all Distributors.

isis at torproject.org isis at torproject.org
Thu Jun 25 07:10:54 UTC 2015


commit e6357735d612074fe32f2273c52d9254427caa37
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sun Apr 19 03:51:43 2015 +0000

    Remove the __len__() method from all Distributors.
---
 lib/bridgedb/Dist.py |    6 ------
 lib/bridgedb/Main.py |    4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py
index fe81c04..e149d17 100644
--- a/lib/bridgedb/Dist.py
+++ b/lib/bridgedb/Dist.py
@@ -346,9 +346,6 @@ class HTTPSDistributor(Distributor):
 
         return answer
 
-    def __len__(self):
-        return len(self.hashring)
-
     def dumpAssignments(self, f, description=""):
         self.hashring.dumpAssignments(f, description)
 
@@ -475,9 +472,6 @@ class EmailBasedDistributor(Distributor):
 
         return result
 
-    def __len__(self):
-        return len(self.hashring)
-
     def cleanDatabase(self):
         with bridgedb.Storage.getDB() as db:
             try:
diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py
index f382cc5..ba74b66 100644
--- a/lib/bridgedb/Main.py
+++ b/lib/bridgedb/Main.py
@@ -215,7 +215,7 @@ def createBridgeRings(cfg, proxyList, key):
             crypto.getHMAC(key, "HTTPS-IP-Dist-Key"),
             proxyList,
             answerParameters=ringParams)
-        hashring.addRing(ipDistributor, "https", cfg.HTTPS_SHARE)
+        hashring.addRing(ipDistributor.hashring, "https", cfg.HTTPS_SHARE)
 
     # As appropriate, create an email-based distributor.
     if cfg.EMAIL_DIST and cfg.EMAIL_SHARE:
@@ -226,7 +226,7 @@ def createBridgeRings(cfg, proxyList, key):
             cfg.EMAIL_DOMAIN_RULES.copy(),
             answerParameters=ringParams,
             whitelist=cfg.EMAIL_WHITELIST.copy())
-        hashring.addRing(emailDistributor, "email", cfg.EMAIL_SHARE)
+        hashring.addRing(emailDistributor.hashring, "email", cfg.EMAIL_SHARE)
 
     # As appropriate, tell the hashring to leave some bridges unallocated.
     if cfg.RESERVED_SHARE:





More information about the tor-commits mailing list