Show More
@@ -1,4 +1,4 b'' | |||
|
1 |
from |
|
|
1 | from pathlib import Path | |
|
2 | 2 | |
|
3 | 3 | from IPython.terminal.shortcuts import create_ipython_shortcuts |
|
4 | 4 | |
@@ -75,16 +75,10 b' for kb in ipy_bindings:' | |||
|
75 | 75 | |
|
76 | 76 | |
|
77 | 77 | if __name__ == '__main__': |
|
78 | here = Path(__file__).parent | |
|
79 | dest = here / 'source' / 'config' / 'shortcuts' | |
|
78 | 80 | |
|
79 | sort_key = lambda k:(str(k[0][1]),str(k[0][0])) | |
|
80 | ||
|
81 | here = abspath(dirname(__file__)) | |
|
82 | dest = join(here, 'source', 'config', 'shortcuts') | |
|
83 | ||
|
84 | with open(join(dest, 'single_filtered.csv'), 'w') as csv: | |
|
85 | for k, v in sorted(single_filter.items(), key=sort_key): | |
|
86 | csv.write(':kbd:`{}`\t{}\t{}\n'.format(k[0], k[1], v)) | |
|
87 | ||
|
88 | with open(join(dest, 'multi_filtered.csv'), 'w') as csv: | |
|
89 | for k, v in sorted(multi_filter.items(), key=sort_key): | |
|
90 | csv.write(':kbd:`{}`\t{}\t{}\n'.format(k[0], k[1], v)) | |
|
81 | for filters, output_filename in [(single_filter, 'single_filtered'), (multi_filter, 'multi_filtered')]: | |
|
82 | with (dest / '{}.csv'.format(output_filename)).open('w') as csv: | |
|
83 | for (shortcut, flt), v in sorted(filters.items(), key=lambda ((shortcut, flt), v): (str(shortcut), str(flt))): | |
|
84 | csv.write(':kbd:`{}`\t{}\t{}\n'.format(shortcut, flt, v)) |
General Comments 0
You need to be logged in to leave comments.
Login now