fix handling of wiki entries with multiple nodes

alfred-data
Nils Schneider 2012-09-05 00:59:13 +02:00
parent ba866a65ce
commit c8a4882f38
1 changed files with 7 additions and 5 deletions

View File

@ -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