From 9c7acdb00da830b9ee065abb26a9380f322faad2 2020-10-18 00:23:58 From: Snir Broshi Date: 2020-10-18 00:23:58 Subject: [PATCH] fix unpacking in docs/autogen_shortcuts.py --- diff --git a/docs/autogen_shortcuts.py b/docs/autogen_shortcuts.py index e752384..27eb335 100755 --- a/docs/autogen_shortcuts.py +++ b/docs/autogen_shortcuts.py @@ -78,7 +78,12 @@ if __name__ == '__main__': here = Path(__file__).parent dest = here / 'source' / 'config' / 'shortcuts' + def sort_key(item): + k, v = item + shortcut, flt = k + return (str(shortcut), str(flt)) + for filters, output_filename in [(single_filter, 'single_filtered'), (multi_filter, 'multi_filtered')]: with (dest / '{}.csv'.format(output_filename)).open('w') as csv: - for (shortcut, flt), v in sorted(filters.items(), key=lambda ((shortcut, flt), v): (str(shortcut), str(flt))): + for (shortcut, flt), v in sorted(filters.items(), key=sort_key): csv.write(':kbd:`{}`\t{}\t{}\n'.format(shortcut, flt, v))