5
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2024-09-19 00:59:35 +00:00

gofmt and minor parsing fix

This commit is contained in:
Arceliar 2021-07-06 18:48:25 -05:00
parent f094991677
commit b744a6ab1a
2 changed files with 11 additions and 9 deletions

View File

@ -38,11 +38,13 @@ def generate_graph(time_limit=60*60*3):
ip = data[key]['address']
coords = data[key]['coords']
info = NodeInfo(ip, coords)
try:
if 'nodeinfo' in data[key]:
if 'name' in data[key]['nodeinfo']:
label = str(data[key]['nodeinfo']['name'])
if len(label) <= 32:
info.label = label
except: pass
info.label = cgi.escape(info.label)
toAdd.append(info)