]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
introducer.py: minor rearrangement of methods
authorBrian Warner <warner@allmydata.com>
Tue, 17 Jul 2007 02:47:42 +0000 (19:47 -0700)
committerBrian Warner <warner@allmydata.com>
Tue, 17 Jul 2007 02:47:42 +0000 (19:47 -0700)
src/allmydata/client.py
src/allmydata/introducer.py

index 7c68ba94b7d679265ac5c4196391104c9631d2e8..e54e195ee065cab4514aa6c389ae8ab2ece18c6d 100644 (file)
@@ -139,14 +139,14 @@ class Client(node.Node, Referenceable):
     def get_all_peerids(self):
         if not self.introducer_client:
             return []
-        return self.introducer_client.connections.iterkeys()
+        return self.introducer_client.get_all_peerids()
 
     def get_permuted_peers(self, key):
         """
         @return: list of (permuted-peerid, peerid, connection,)
         """
         results = []
-        for peerid, connection in self.introducer_client.connections.iteritems():
+        for peerid, connection in self.introducer_client.get_all_peers():
             assert isinstance(peerid, str)
             permuted = bytes_to_long(sha.new(key + peerid).digest())
             results.append((permuted, peerid, connection))
index 668be165b9b79ce6fc19d22eed5101f76a6b5ce4..8db66b2dc6169de082878a3ccccf838d8676d4dd 100644 (file)
@@ -123,3 +123,9 @@ class IntroducerClient(service.Service, Referenceable):
 
     def connected_to_introducer(self):
         return self._connected
+
+    def get_all_peerids(self):
+        return self.connections.iterkeys()
+
+    def get_all_peers(self):
+        return self.connections.iteritems()