leaflet, accept valueerrors in json stream

master
Michael Murtaugh 7 years ago
parent fc83652e3b
commit 6f6755adb3

@ -618,9 +618,11 @@ def make_gallery(args):
for line in sys.stdin: for line in sys.stdin:
line = line.rstrip() line = line.rstrip()
if line and not line.startswith("#"): if line and not line.startswith("#"):
item = json.loads(line) try:
items.append(item) item = json.loads(line)
items.append(item)
except ValueError as e:
print (u"Error reading line {0}, {1}".format(line, e).encode("utf-8"), file=sys.stderr)
# Ensure / Generate tiles per image # Ensure / Generate tiles per image
# items.sort(key=lambda x: x['url']) # items.sort(key=lambda x: x['url'])
tiles = [] tiles = []

Loading…
Cancel
Save