##// END OF EJS Templates
Sort by filter, before sorting by shortcut....
Matthias Bussonnier -
Show More
@@ -71,13 +71,15 b' for kb in ipy_bindings:'
71
71
72 if __name__ == '__main__':
72 if __name__ == '__main__':
73
73
74 sort_key = lambda k:(str(k[0][1]),str(k[0][0]))
75
74 here = abspath(dirname(__file__))
76 here = abspath(dirname(__file__))
75 dest = join(here, 'source', 'config', 'shortcuts')
77 dest = join(here, 'source', 'config', 'shortcuts')
76
78
77 with open(join(dest, 'single_filtered.csv'), 'w') as csv:
79 with open(join(dest, 'single_filtered.csv'), 'w') as csv:
78 for k, v in sorted(single_filter.items()):
80 for k, v in sorted(single_filter.items(), key=sort_key):
79 csv.write(':kbd:`{}`\t{}\t{}\n'.format(k[0], k[1], v))
81 csv.write(':kbd:`{}`\t{}\t{}\n'.format(k[0], k[1], v))
80
82
81 with open(join(dest, 'multi_filtered.csv'), 'w') as csv:
83 with open(join(dest, 'multi_filtered.csv'), 'w') as csv:
82 for k, v in sorted(multi_filter.items()):
84 for k, v in sorted(multi_filter.items(), key=sort_key):
83 csv.write(':kbd:`{}`\t{}\t{}\n'.format(k[0], k[1], v))
85 csv.write(':kbd:`{}`\t{}\t{}\n'.format(k[0], k[1], v))
General Comments 0
You need to be logged in to leave comments. Login now