From 5a2d4803603931d8cbc989e0eab3edb551ad221b Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sat, 12 May 2012 14:57:25 +0200 Subject: [PATCH] make attribute db private --- d3mapbuilder.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/d3mapbuilder.py b/d3mapbuilder.py index 4fd10db..fc1f255 100644 --- a/d3mapbuilder.py +++ b/d3mapbuilder.py @@ -1,21 +1,19 @@ import json class D3MapBuilder: - db = None - def __init__(self, db): - self.db = db + self._db = db def build(self): output = dict() output['nodes'] = [{'group': x.group, 'name': x.name, 'macs': ', '.join(x.macs) - } for x in self.db.get_nodes() if x.online] + } for x in self._db.get_nodes() if x.online] output['links'] = [{'source': x.pair[0], 'target': x.pair[1], 'distance': x.distance, 'strength': x.strength - } for x in self.db.get_links()] + } for x in self._db.get_links()] return json.dumps(output)