wilder scheiss um die macs für die geomap zuzuordnen

alfred-data
Nils Schneider 2012-05-31 20:05:04 +02:00
parent 02d5026491
commit 2e5f3c3ea5
2 changed files with 25 additions and 0 deletions

View File

@ -32,6 +32,8 @@ if options['aliases']:
db.import_wikigps("http://freifunk.metameute.de/Knoten")
db.wilder_scheiss()
m = GeoMapBuilder(db)
print(m.build())

View File

@ -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)