Skip to content

Commit

Permalink
improve manual testing script
Browse files Browse the repository at this point in the history
  • Loading branch information
Cube707 committed Aug 11, 2024
1 parent b218c1e commit a3e9b0b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/manual-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
known_keys = {v: k for k, v in reversed(vars(key).items()) if not k.startswith("__")}


while True:
data = readkey()
def main():
while True:
read_key = readkey()
mykey = f"got {known_keys[read_key]}" if read_key in known_keys else read_key

if data in known_keys:
print(f"got {known_keys[data]}", end="")
else:
print(data, end="")
print(f"{mykey} - 0x{ read_key.encode().hex() }")

print(" - " + "".join([f"\\x{ord(c):02x}" for c in data]))

if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\nKeyboardInterrupt")

0 comments on commit a3e9b0b

Please sign in to comment.