From 81b26edbf85796563f25be78fdc537f5e1d1002e Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Thu, 7 Jun 2012 00:02:45 +0200 Subject: [PATCH] add geo field to nodes --- d3mapbuilder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/d3mapbuilder.py b/d3mapbuilder.py index a60665c..fe354b4 100644 --- a/d3mapbuilder.py +++ b/d3mapbuilder.py @@ -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,