]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
fix some python2.5 incompatibilities, and remove an old webish display that suggested...
authorBrian Warner <warner@allmydata.com>
Wed, 28 Mar 2007 00:44:49 +0000 (17:44 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 28 Mar 2007 00:44:49 +0000 (17:44 -0700)
src/allmydata/test/test_system.py
src/allmydata/web/welcome.xhtml
src/allmydata/webish.py

index 709390ed6787e82010f38fe076bd1b5bd8709c03..346b34dedf9a34085249a6627b56427496d6231a 100644 (file)
@@ -89,7 +89,8 @@ class SystemTest(unittest.TestCase):
 
     def wait_for_connections(self, ignored=None):
         for c in self.clients:
-            if not c.introducer_client or len(c.get_all_peerids()) != self.numclients:
+            if (not c.introducer_client or
+                len(list(c.get_all_peerids())) != self.numclients):
                 d = defer.Deferred()
                 d.addCallback(self.wait_for_connections)
                 reactor.callLater(0.05, d.callback, None)
@@ -103,7 +104,7 @@ class SystemTest(unittest.TestCase):
         def _check(extra_node):
             self.extra_node = extra_node
             for c in self.clients:
-                self.failUnlessEqual(len(c.get_all_peerids()), 6)
+                self.failUnlessEqual(len(list(c.get_all_peerids())), 6)
         d.addCallback(_check)
         def _shutdown_extra_node(res):
             if self.extra_node:
index 5d8ad3b8d57d3a5c1e65f1f965111be68e552ea2..11006bf68ea7c26e5dd8e8eff341b9d417221f5a 100644 (file)
@@ -16,8 +16,7 @@
 
 <div>Queen: <span n:render="string" n:data="queen_pburl" /></div>
 <div>Connected to queen?: <span n:render="string" n:data="connected_to_queen" /></div>
-<div>Known Peers: <span n:render="string" n:data="num_peers" /></div>
-<div>Connected Peers: <span n:render="string" n:data="num_connected_peers" /></div>
+<div>Known+Connected Peers: <span n:render="string" n:data="num_peers" /></div>
 
 <div>
 <table n:render="sequence" n:data="peers" border="1">
index ca86f61eb78bd69fe542568b68daaed4005878b6..f3f38de413b24b2ac3170ba781383099ff09dbcb 100644 (file)
@@ -36,9 +36,7 @@ class Welcome(rend.Page):
     def data_num_peers(self, ctx, data):
         #client = inevow.ISite(ctx)._client
         client = IClient(ctx)
-        return len(client.get_all_peerids())
-    def data_num_connected_peers(self, ctx, data):
-        return len(IClient(ctx).get_all_peerids())
+        return len(list(client.get_all_peerids()))
 
     def data_peers(self, ctx, data):
         d = []