[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[bridgedb/master] Rename `ring` → `subring` in FilteredBridgeSplitter.addRing().



commit ddb15741e169f3c9870d067dc406c18ab3e1cb07
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Fri Nov 15 13:43:55 2013 +0000

    Rename `ring` â?? `subring` in FilteredBridgeSplitter.addRing().
---
 lib/bridgedb/Bridges.py |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py
index a59c56d..f11a45e 100644
--- a/lib/bridgedb/Bridges.py
+++ b/lib/bridgedb/Bridges.py
@@ -1045,7 +1045,7 @@ class FilteredBridgeSplitter(BridgeHolder):
                 r.insert(bridge)
                 logging.debug("insert bridge into %s" % n)
 
-    def addRing(self, ring, ringname, filterFn, populate_from=None):
+    def addRing(self, subring, ringname, filterFn, populate_from=None):
         """Add a subring to this hashring.
 
         :type subring: :class:`BridgeHolder`
@@ -1060,17 +1060,18 @@ class FilteredBridgeSplitter(BridgeHolder):
         """
         assert isinstance(ring, BridgeHolder)
         assert ringname not in self.filterRings.keys()
-        logging.debug("addRing %s" % ringname)
+        logging.debug("Adding subring '%s' to %s."
+                      % (ringname, self.__class__))
+
 
         #TODO: drop LRU ring if len(self.filterRings) > self.max_cached_rings
-        self.filterRings[ringname] = (filterFn,ring)
+        self.filterRings[ringname] = (filterFn, subring)
 
-        # populate ring from an iterable
         if populate_from:
-            logging.debug("populating ring %s" % ringname)
+            logging.info("Populating hashring %s..." % ringname)
             for bridge in populate_from:
                 if isinstance(bridge, Bridge) and filterFn(bridge):
-                    ring.insert(bridge)
+                    subring.insert(bridge)
 
     def dumpAssignments(self, f, description=""):
         # one ring per filter set



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits