4
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2025-06-26 12:49:23 +00:00

Handle multiple cjdns instances

This commit is contained in:
Vanhala Antti
2014-06-02 23:22:37 +03:00
parent f51cf2025e
commit 613b5aec09
2 changed files with 47 additions and 25 deletions

View File

@ -17,11 +17,8 @@ class Edge:
def __init__(self, a, b):
self.a, self.b = sorted([a, b])
def is_in(self, edges):
for e in edges:
if e.a.ip == self.a.ip and e.b.ip == self.b.ip:
return True
return False
def __eq__(self, that):
return self.a.ip == that.a.ip and self.b.ip == that.b.ip
def __repr__(self):
return 'Edge(a.ip="%s", b.ip="%s")' % (