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)
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:
<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">
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 = []