add geo field to nodes

This commit is contained in:
Nils Schneider 2012-06-07 00:02:45 +02:00
parent 32ee0a7032
commit 81b26edbf8

View file

@ -10,7 +10,8 @@ class D3MapBuilder:
nodes = self._db.get_nodes()
output['nodes'] = [{'group': x.group, 'name': x.name, 'id': x.id,
'macs': ', '.join(x.macs)
'macs': ', '.join(x.macs),
'geo': x.gps.split(" ") if x.gps else None
} for x in nodes if x.online]
output['links'] = [{'source': x.pair[0], 'target': x.pair[1],
'distance': x.distance,