[or-cvs] [bridgedb/master 3/4] Savefile

nickm at torproject.org nickm at torproject.org
Mon Sep 27 20:10:51 UTC 2010


Author: Christian Fromme <kaner at strace.org>
Date: Fri, 3 Sep 2010 12:51:34 +0200
Subject: Savefile
Commit: 58342b68ee97832bf5c7c1a3f8e29faf496cc1b7

---
 lib/bridgedb/Bucket.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/bridgedb/Bucket.py b/lib/bridgedb/Bucket.py
index ab6d83b..bf56097 100644
--- a/lib/bridgedb/Bucket.py
+++ b/lib/bridgedb/Bucket.py
@@ -102,8 +102,9 @@ class BucketManager:
         self.unallocatedList.append(hex_key)
         self.unallocated_available = True
 
-    def isBucketIdentKnown(self, bucketIdent):
-        """Do we know this bucket identifier?
+    def getBucketIdent(self, bucketIdent):
+        """Do we know this bucket identifier? If yes, return the corresponding
+           BucketData object.
         """
         for d in self.bucketList:
             if d.name == bucketIdent:
@@ -143,8 +144,8 @@ class BucketManager:
                 self.addToUnallocatedList(bridge.hex_key)
                 continue
 
-            # Check if we know this distributor
-            d = self.isBucketIdentKnown(bridge.distributor)
+            # Return the buckt identifier in case we know it already
+            d = self.getBucketIdent(bridge.distributor)
             if d is not None:
                 # Does this distributor need another one?
                 # We assume that d.allocated is 0 in the beginning
@@ -193,4 +194,4 @@ class BucketManager:
             for bridge in bForBucket:
                 line = "%s:%s" % (bridge.address, bridge.or_port)
                 f.write(line + '\n')
-            f.close
+            f.close()
-- 
1.7.1




More information about the tor-commits mailing list