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