From c8a4882f38eaca9fb56bf31fcaad9983c673a75b Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 5 Sep 2012 00:59:13 +0200 Subject: [PATCH] fix handling of wiki entries with multiple nodes --- nodedb.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nodedb.py b/nodedb.py index 17afbef..6bc0121 100644 --- a/nodedb.py +++ b/nodedb.py @@ -267,23 +267,25 @@ class NodeDB: nodes = zip_longest(node['MAC'], node['GPS'], node['Knotenname']) + for data in nodes: - if not data[0]: + mac = data[0].strip() + if not mac: continue try: - node = self.maybe_node_by_fuzzy_mac(data[0]) + node = self.maybe_node_by_fuzzy_mac(mac) except KeyError: node = Node() self._nodes.append(node) - node.add_mac(data[0]) + node.add_mac(mac) if data[1]: - node.gps = data[1] + node.gps = data[1].strip() if data[2]: - node.name = data[2] + node.name = data[2].strip() # compares two MACs and decides whether they are # similar and could be from the same node