Show More
@@ -78,7 +78,12 b" if __name__ == '__main__':" | |||||
78 | here = Path(__file__).parent |
|
78 | here = Path(__file__).parent | |
79 | dest = here / 'source' / 'config' / 'shortcuts' |
|
79 | dest = here / 'source' / 'config' / 'shortcuts' | |
80 |
|
80 | |||
|
81 | def sort_key(item): | |||
|
82 | k, v = item | |||
|
83 | shortcut, flt = k | |||
|
84 | return (str(shortcut), str(flt)) | |||
|
85 | ||||
81 | for filters, output_filename in [(single_filter, 'single_filtered'), (multi_filter, 'multi_filtered')]: |
|
86 | for filters, output_filename in [(single_filter, 'single_filtered'), (multi_filter, 'multi_filtered')]: | |
82 | with (dest / '{}.csv'.format(output_filename)).open('w') as csv: |
|
87 | with (dest / '{}.csv'.format(output_filename)).open('w') as csv: | |
83 |
for (shortcut, flt), v in sorted(filters.items(), key= |
|
88 | for (shortcut, flt), v in sorted(filters.items(), key=sort_key): | |
84 | csv.write(':kbd:`{}`\t{}\t{}\n'.format(shortcut, flt, v)) |
|
89 | csv.write(':kbd:`{}`\t{}\t{}\n'.format(shortcut, flt, v)) |
General Comments 0
You need to be logged in to leave comments.
Login now