markup: spreadsheet remove dupes

This commit is contained in:
2019-10-20 23:26:39 -07:00
parent 1970e2f506
commit 8da277cbde

View File

@ -26,7 +26,9 @@ def write_spreadsheet(matches, workdir, file_base):
# header row
ws.append(['Season', 'Gender', 'Name', 'Style Number', 'Color'])
# TODO: uniquify and sort matches
# TODO: sort matches
seen = {}
for m in matches:
# in the case of kids,
@ -38,7 +40,9 @@ def write_spreadsheet(matches, workdir, file_base):
colors = m['color'].split('\n')
for s, g, n, m, c in zip_longest(seasons, genders, names, materials, colors, fillvalue=''):
if not m in seen:
ws.append([format_season(s), g, n, m, c])
seen[m] = True
# save
ensure_dir(workdir)