diff options
Diffstat (limited to 'lib/python/qmk/path.py')
-rw-r--r-- | lib/python/qmk/path.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py index 591fad034..54def1d5d 100644 --- a/lib/python/qmk/path.py +++ b/lib/python/qmk/path.py | |||
@@ -28,15 +28,21 @@ def under_qmk_firmware(): | |||
28 | return None | 28 | return None |
29 | 29 | ||
30 | 30 | ||
31 | def keymap(keyboard): | 31 | def keyboard(keyboard_name): |
32 | """Returns the path to a keyboard's directory relative to the qmk root. | ||
33 | """ | ||
34 | return Path('keyboards') / keyboard_name | ||
35 | |||
36 | |||
37 | def keymap(keyboard_name): | ||
32 | """Locate the correct directory for storing a keymap. | 38 | """Locate the correct directory for storing a keymap. |
33 | 39 | ||
34 | Args: | 40 | Args: |
35 | 41 | ||
36 | keyboard | 42 | keyboard_name |
37 | The name of the keyboard. Example: clueboard/66/rev3 | 43 | The name of the keyboard. Example: clueboard/66/rev3 |
38 | """ | 44 | """ |
39 | keyboard_folder = Path('keyboards') / keyboard | 45 | keyboard_folder = keyboard(keyboard_name) |
40 | 46 | ||
41 | for i in range(MAX_KEYBOARD_SUBFOLDERS): | 47 | for i in range(MAX_KEYBOARD_SUBFOLDERS): |
42 | if (keyboard_folder / 'keymaps').exists(): | 48 | if (keyboard_folder / 'keymaps').exists(): |
@@ -45,7 +51,7 @@ def keymap(keyboard): | |||
45 | keyboard_folder = keyboard_folder.parent | 51 | keyboard_folder = keyboard_folder.parent |
46 | 52 | ||
47 | logging.error('Could not find the keymaps directory!') | 53 | logging.error('Could not find the keymaps directory!') |
48 | raise NoSuchKeyboardError('Could not find keymaps directory for: %s' % keyboard) | 54 | raise NoSuchKeyboardError('Could not find keymaps directory for: %s' % keyboard_name) |
49 | 55 | ||
50 | 56 | ||
51 | def normpath(path): | 57 | def normpath(path): |