From: burris Date: Tue, 3 Sep 2002 08:24:47 +0000 (+0000) Subject: call back from GetValues each time we get some new values X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e0d99ef1d31cef0cf5aec945030bb348ad1ab3d7;p=quix0rs-apt-p2p.git call back from GetValues each time we get some new values --- diff --git a/actions.py b/actions.py index 3112027..a4d9514 100644 --- a/actions.py +++ b/actions.py @@ -123,9 +123,13 @@ class GetValue(FindNode): self.found[n.id] = n self.table.insertNode(n) elif l.has_key('values'): - ## done - self.finished = 1 - reactor.callFromThread(self.callback, l['values']) + def x(y, z=self.results): + if not z.has_key(y): + z[y] = 1 + return y + v = filter(None, map(x, l['values'])) + if(len(v)): + reactor.callFromThread(self.callback, v) self.schedule() ## get value @@ -153,6 +157,7 @@ class GetValue(FindNode): ## get value def goWithNodes(self, nodes): + self.results = {} for node in nodes: if node.id == self.table.node.id: continue