Explorar el Código

!neighbours: filter duplicate outputs

This can happen when BATMAN displays multiple MACs of neighbouring nodes.
Helge Jung hace 9 años
padre
commit
452014f30f
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      modules/ffpb.py

+ 2 - 2
modules/ffpb.py

@@ -783,10 +783,10 @@ def ffpb_neighbours(bot, trigger):
 	d = '&'.join([ str(n) for n in cave_result ])
 	req = urllib2.urlopen('http://[fdca:ffee:ff12:a255::253]:8888/idmac2name', d)
 
-	neighbours = []
+	neighbours = set()
 	for n in req:
 		ident,name = n.strip().split('=')
-		neighbours.append(name)
+		neighbours.add(name)
 
 	bot.say('; '.join(neighbours))