1
0
Fork 0

[Keyboard] Signum3.0 remove sortedcontainers (#5679)

* Remove dependency on sortedcontainers

* Sort dictionary on output
This commit is contained in:
Jan Christoph Ebersbach 2019-04-30 06:35:34 +02:00 committed by Drashna Jaelre
parent c745d9b82e
commit 4c2453aa1b
3 changed files with 3 additions and 10 deletions

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from sortedcontainers import SortedDict
import layout import layout
import re import re
@ -11,7 +10,7 @@ import re
def gen_uc_iter(): def gen_uc_iter():
length = len(layout.uc_dict) length = len(layout.uc_dict)
for key, value in layout.uc_dict.items(): for key, value in sorted(layout.uc_dict.items()):
length -= 1 length -= 1
if length: if length:
yield (key, value, False) yield (key, value, False)

View file

@ -1,11 +1,9 @@
from sortedcontainers import SortedDict
# Add all used Unicode symbols to this list. # Add all used Unicode symbols to this list.
# The key (e.g. "SNEK") is used in keymap.c for "enum", "unicode_map" and "keymaps", so it needs to be a valid C variable name. # The key (e.g. "SNEK") is used in keymap.c for "enum", "unicode_map" and "keymaps", so it needs to be a valid C variable name.
# The key is also used in this file to define the layout, so use recognizeable names. # The key is also used in this file to define the layout, so use recognizeable names.
# The value (e.g. "0x1f40d") is used in keymap.c for "unicode_map" and to automatically generate the "ASCII"-art comments. # The value (e.g. "0x1f40d") is used in keymap.c for "unicode_map" and to automatically generate the "ASCII"-art comments.
# When adding new Unicode names, use "0x1f40d" until you looked up the correct Unicode code point. # When adding new Unicode names, use "0x1f40d" until you looked up the correct Unicode code point.
uc_dict = SortedDict({ uc_dict = {
"SNEK": "0x1f40d", ## Error "SNEK": "0x1f40d", ## Error
## qwertz ## qwertz
"ACUTE": "0x00b4", "ACUTE": "0x00b4",
@ -329,7 +327,7 @@ uc_dict = SortedDict({
"NOT_PARA": "0x2226", "NOT_PARA": "0x2226",
"TIMES_OP": "0x2297", "TIMES_OP": "0x2297",
"NOT_DIV": "0x2224" "NOT_DIV": "0x2224"
}) }
# Add all used Keycodes to this list. # Add all used Keycodes to this list.
# The key (e.g. "a") is used in keymap.c to automatically generate the comments. The first 7 chars will show as a keycap legend. # The key (e.g. "a") is used in keymap.c to automatically generate the comments. The first 7 chars will show as a keycap legend.

View file

@ -11,10 +11,6 @@ starting point to create your own layouts for the Signum 3.0 with
# Customization # Customization
- Install `python3` and [Sorted Containers
Library](http://www.grantjenks.com/docs/sortedcontainers/), `pip
install sortedcontainers`.
- Customize `layout.py` to your liking. - Customize `layout.py` to your liking.
- Attention 1: keycodes are either translated into symbols and - Attention 1: keycodes are either translated into symbols and
function calls via the `translate()` function in `generate_km.py` function calls via the `translate()` function in `generate_km.py`