wilder scheiss um die macs für die geomap zuzuordnen
This commit is contained in:
parent
02d5026491
commit
2e5f3c3ea5
|
@ -32,6 +32,8 @@ if options['aliases']:
|
|||
|
||||
db.import_wikigps("http://freifunk.metameute.de/Knoten")
|
||||
|
||||
db.wilder_scheiss()
|
||||
|
||||
m = GeoMapBuilder(db)
|
||||
|
||||
print(m.build())
|
||||
|
|
23
nodedb.py
23
nodedb.py
|
@ -178,3 +178,26 @@ class NodeDB:
|
|||
self._nodes.append(node)
|
||||
|
||||
node.gps = pair[1]
|
||||
|
||||
def find_link(self, i):
|
||||
for link in self._links:
|
||||
if i in link:
|
||||
return link
|
||||
|
||||
def wilder_scheiss(self):
|
||||
for node in self._nodes:
|
||||
if node.group == 3 and node.gps:
|
||||
i = self._nodes.index(node)
|
||||
link = self.find_link(i)
|
||||
if link:
|
||||
linklist = list(link)
|
||||
linklist.remove(i)
|
||||
j = linklist[0]
|
||||
|
||||
for mac in self._nodes[i].macs:
|
||||
self._nodes[j].add_mac(mac)
|
||||
|
||||
self._nodes[j].gps = self._nodes[i].gps
|
||||
|
||||
self._links.remove(link)
|
||||
self._nodes.remove(node)
|
||||
|
|
Loading…
Reference in a new issue