mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
refactoring
This commit is contained in:
@@ -107,7 +107,7 @@ def _read_keyboard_layout(path: str) -> Dict[int, At1Key]: # Keysym to evdev (a
|
||||
lines = list(map(str.strip, layout_file.read().split("\n")))
|
||||
|
||||
layout: Dict[int, At1Key] = {}
|
||||
for (number, line) in enumerate(lines):
|
||||
for (lineno, line) in enumerate(lines):
|
||||
if len(line) == 0 or line.startswith(("#", "map ", "include ")):
|
||||
continue
|
||||
|
||||
@@ -122,5 +122,5 @@ def _read_keyboard_layout(path: str) -> Dict[int, At1Key]: # Keysym to evdev (a
|
||||
ctrl=("ctrl" in parts[2:]),
|
||||
)
|
||||
except ValueError as err:
|
||||
logger.error("Syntax error at %s:%d: %s", path, number, err)
|
||||
logger.error("Syntax error at %s:%d: %s", path, lineno, err)
|
||||
return layout
|
||||
|
||||
Reference in New Issue
Block a user