mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
refactoring
This commit is contained in:
@@ -33,8 +33,8 @@ import mako.template
|
||||
# =====
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class _KeyMapping:
|
||||
arduino_hid_code: int
|
||||
arduino_hid_key: str
|
||||
serial_hid_code: int
|
||||
serial_hid_key: str
|
||||
web_key: str
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ def _read_keymap_in(path: str) -> List[_KeyMapping]:
|
||||
parts = list(map(str.strip, line.split()))
|
||||
if len(parts) >= 3:
|
||||
keymap.append(_KeyMapping(
|
||||
arduino_hid_code=int(parts[0]),
|
||||
arduino_hid_key=parts[1],
|
||||
serial_hid_code=int(parts[0]),
|
||||
serial_hid_key=parts[1],
|
||||
web_key=parts[2],
|
||||
))
|
||||
return keymap
|
||||
|
||||
Reference in New Issue
Block a user