From 9c2ca00074784dbee27b459d71cfc8e75f47b976 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Fri, 28 Nov 2025 00:36:49 +1100 Subject: QMK CLI Environment bootstrapper (#25038) Co-authored-by: Joel Challis Co-authored-by: Pascal Getreuer --- lib/python/qmk/keyboard.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/python/qmk/keyboard.py') diff --git a/lib/python/qmk/keyboard.py b/lib/python/qmk/keyboard.py index 254dc62309..e8534492c9 100644 --- a/lib/python/qmk/keyboard.py +++ b/lib/python/qmk/keyboard.py @@ -175,8 +175,9 @@ def keyboard_completer(prefix, action, parser, parsed_args): return list_keyboards() +@lru_cache(maxsize=None) def list_keyboards(): - """Returns a list of all keyboards + """Returns a list of all keyboards. """ # We avoid pathlib here because this is performance critical code. kb_wildcard = os.path.join(base_path, "**", 'keyboard.json') @@ -184,6 +185,9 @@ def list_keyboards(): found = map(_find_name, paths) + # Convert to posix paths for consistency + found = map(lambda x: str(Path(x).as_posix()), found) + return sorted(set(found)) -- cgit v1.2.3