0

genPOI: apply consistent sorting to markers.js and markersDB.js

use json.dumps(sort_keys=True) to apply a consistent sorting to the output JS files.
improves the readability of diffs and making config testing easier
This commit is contained in:
Cliff Meyers
2020-04-05 08:29:17 -04:00
parent 7af188da4e
commit 80e45c4d66

View File

@@ -598,11 +598,11 @@ def main():
with open(os.path.join(destdir, "markersDB.js"), "w") as output:
output.write("var markersDB=")
json.dump(markers, output, indent=2)
json.dump(markers, output, sort_keys=True, indent=2)
output.write(";\n")
with open(os.path.join(destdir, "markers.js"), "w") as output:
output.write("var markers=")
json.dump(marker_groups, output, indent=2)
json.dump(marker_groups, output, sort_keys=True, indent=2)
output.write(";\n")
with open(os.path.join(destdir, "baseMarkers.js"), "w") as output:
output.write("overviewer.util.injectMarkerScript('markersDB.js');\n")