summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/path.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/path.py')
-rw-r--r--lib/python/qmk/path.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py
index 591fad034b..54def1d5d6 100644
--- a/lib/python/qmk/path.py
+++ b/lib/python/qmk/path.py
@@ -28,15 +28,21 @@ def under_qmk_firmware():
return None
-def keymap(keyboard):
+def keyboard(keyboard_name):
+ """Returns the path to a keyboard's directory relative to the qmk root.
+ """
+ return Path('keyboards') / keyboard_name
+
+
+def keymap(keyboard_name):
"""Locate the correct directory for storing a keymap.
Args:
- keyboard
+ keyboard_name
The name of the keyboard. Example: clueboard/66/rev3
"""
- keyboard_folder = Path('keyboards') / keyboard
+ keyboard_folder = keyboard(keyboard_name)
for i in range(MAX_KEYBOARD_SUBFOLDERS):
if (keyboard_folder / 'keymaps').exists():
@@ -45,7 +51,7 @@ def keymap(keyboard):
keyboard_folder = keyboard_folder.parent
logging.error('Could not find the keymaps directory!')
- raise NoSuchKeyboardError('Could not find keymaps directory for: %s' % keyboard)
+ raise NoSuchKeyboardError('Could not find keymaps directory for: %s' % keyboard_name)
def normpath(path):