From 80e45c4d663dcee0b1fc7e4975e0b7b9664e1900 Mon Sep 17 00:00:00 2001 From: Cliff Meyers Date: Sun, 5 Apr 2020 08:29:17 -0400 Subject: [PATCH] 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 --- overviewer_core/aux_files/genPOI.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overviewer_core/aux_files/genPOI.py b/overviewer_core/aux_files/genPOI.py index 0e88ea8..2e69450 100644 --- a/overviewer_core/aux_files/genPOI.py +++ b/overviewer_core/aux_files/genPOI.py @@ -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")