]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
call back from GetValues each time we get some new values
authorburris <burris>
Tue, 3 Sep 2002 08:24:47 +0000 (08:24 +0000)
committerburris <burris>
Tue, 3 Sep 2002 08:24:47 +0000 (08:24 +0000)
actions.py

index 3112027332d7c9a0b64f3cf3a1e2a785e596601f..a4d9514f0de6a8c833c8a1b42c788f6fd4ab2d41 100644 (file)
@@ -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