read nickname from wiki

This commit is contained in:
Nils Schneider 2012-06-04 18:37:40 +02:00
parent 1a5f5f745b
commit 03853a8ac0
2 changed files with 7 additions and 1 deletions

View file

@ -33,6 +33,8 @@ db.import_batman(list(fileinput.input(options['batmanjson'])))
if options['aliases']:
db.import_aliases(json.load(open(options['aliases'])))
db.import_wikigps("http://freifunk.metameute.de/Knoten")
if options['gateway']:
db.mark_gateways(options['gateway'])

View file

@ -190,8 +190,9 @@ class NodeDB:
macs = [s for s in [s.strip() for s in node['MAC'].split(',')] if s]
gps = [s for s in [s.strip() for s in node['GPS'].split(',')] if s]
names = [s for s in [s.strip() for s in node['Nick'].split(',')] if s]
for pair in zip(macs, gps):
for pair in zip(macs, gps, names):
try:
node = self.maybe_node_by_mac((pair[0], ))
except:
@ -199,6 +200,9 @@ class NodeDB:
node.add_mac(pair[0])
self._nodes.append(node)
if pair[2]:
node.name = pair[2]
node.gps = pair[1]
def find_link(self, i):