1
0
mirror of https://github.com/tumic0/GPXSee-maps.git synced 2025-06-29 04:29:16 +02:00

Sort the maps properly by map name

This commit is contained in:
2020-02-28 00:28:43 +01:00
parent c31313c794
commit c2bf9630af
2 changed files with 35 additions and 32 deletions

View File

@ -298,11 +298,14 @@ def mapinfo(xmlfile):
def processmaps(maps, htmlfile):
htmlfile.write("<table>\n<tr>\n")
i = 0
maps.sort()
items = []
for xmlfile in maps:
shutil.copyfile(xmlfile, "../maps/" + os.path.basename(xmlfile))
info = mapinfo(xmlfile)
items.append(mapinfo(xmlfile))
items.sort(key=lambda tup: tup["name"])
i = 0
for info in items:
if i and i % 4 == 0:
htmlfile.write("</tr><tr>\n")
htmlfile.write("<td>" + "<a href=\"" + info["url"] + "\" download><img src=\""