Apply suggestions from code review

Co-authored-by: xs5871 <60395129+xs5871@users.noreply.github.com>
This commit is contained in:
James Fitzgerald 2022-07-08 07:19:55 -07:00 committed by xs5871
parent 50279f88fb
commit 664a557483
2 changed files with 6 additions and 4 deletions

View File

@ -97,8 +97,9 @@ class TextReplacement(Module):
self,
dictionary: dict,
):
for entry in dictionary:
self._rules.append(Rule(Phrase(entry), Phrase(dictionary[entry])))
for key,value in dictionary.items():
self._rules.append(Rule(Phrase(key), Phrase(value)))
def process_key(self, keyboard, key, is_pressed, int_coord):
if not self._state == State.LISTENING:
@ -142,7 +143,8 @@ class TextReplacement(Module):
self._state = State.DELETING
# if we have a match there's no reason to continue the full key processing, so return out
return
return super().process_key(keyboard, key, is_pressed, int_coord)
return key
def during_bootup(self, keyboard):
return

View File

@ -16,7 +16,7 @@ class TestTextReplacement(unittest.TestCase):
[
[KC.A, KC.B, KC.N1, KC.LSHIFT, KC.LCTRL, KC.C, KC.D],
],
debug_enabled=True,
debug_enabled=False,
)
return super().setUp()