Change map() to zip() to support python3

This commit is contained in:
Manna Harbour 2021-06-04 15:25:40 +10:00
parent a8a1402782
commit 5fdfc80210

View File

@ -1,3 +1,4 @@
# After making changes to code or tables call org-babel-tangle (C-c C-v t). # After making changes to code or tables call org-babel-tangle (C-c C-v t).
#+Title: Miryoku ZMK Babel [[https://raw.githubusercontent.com/manna-harbour/miryoku/master/data/logos/miryoku-roa-32.png]] #+Title: Miryoku ZMK Babel [[https://raw.githubusercontent.com/manna-harbour/miryoku/master/data/logos/miryoku-roa-32.png]]
@ -297,8 +298,8 @@ for standard, local in keycode_translation_table:
if local != '': if local != '':
keycode_translation_dict[standard] = local keycode_translation_dict[standard] = local
results = '' results = ''
for tap_row, hold_row in map(None, tap_table, hold_table): for tap_row, hold_row in zip(tap_table, hold_table):
for tap, hold in map(None, tap_row, hold_row): for tap, hold in zip(tap_row, hold_row):
if tap == '': if tap == '':
code = 'U_NU' code = 'U_NU'
elif tap in symbol_names_dict: elif tap in symbol_names_dict:
@ -348,7 +349,7 @@ for standard, local in keycode_translation_table:
keycode_translation_dict[standard] = local keycode_translation_dict[standard] = local
length = len(half_table[0]) length = len(half_table[0])
results = '' results = ''
for half_row, hold_row in map(None, half_table, hold_table): for half_row, hold_row in zip(half_table, hold_table):
hold_row_l, hold_row_r = hold_row[:length], hold_row[length:] hold_row_l, hold_row_r = hold_row[:length], hold_row[length:]
for lr, hold_row_lr in ('l', hold_row_l), ('r', hold_row_r): for lr, hold_row_lr in ('l', hold_row_l), ('r', hold_row_r):
if lr == mode: if lr == mode: