Allow for qmk compile -kb all
. (#22022)
This commit is contained in:
parent
a26e1c8b63
commit
abd432fd7a
3 changed files with 83 additions and 38 deletions
|
@ -30,9 +30,29 @@ BOX_DRAWING_CHARACTERS = {
|
|||
},
|
||||
}
|
||||
|
||||
|
||||
class AllKeyboards:
|
||||
"""Represents all keyboards.
|
||||
"""
|
||||
def __str__(self):
|
||||
return 'all'
|
||||
|
||||
def __repr__(self):
|
||||
return 'all'
|
||||
|
||||
def __eq__(self, other):
|
||||
return isinstance(other, AllKeyboards)
|
||||
|
||||
|
||||
base_path = os.path.join(os.getcwd(), "keyboards") + os.path.sep
|
||||
|
||||
|
||||
def is_all_keyboards(keyboard):
|
||||
"""Returns True if the keyboard is an AllKeyboards object.
|
||||
"""
|
||||
return isinstance(keyboard, AllKeyboards)
|
||||
|
||||
|
||||
def find_keyboard_from_dir():
|
||||
"""Returns a keyboard name based on the user's current directory.
|
||||
"""
|
||||
|
@ -86,6 +106,18 @@ def keyboard_folder(keyboard):
|
|||
return keyboard
|
||||
|
||||
|
||||
def keyboard_folder_or_all(keyboard):
|
||||
"""Returns the actual keyboard folder.
|
||||
|
||||
This checks aliases and DEFAULT_FOLDER to resolve the actual path for a keyboard.
|
||||
If the supplied argument is "all", it returns an AllKeyboards object.
|
||||
"""
|
||||
if keyboard == 'all':
|
||||
return AllKeyboards()
|
||||
|
||||
return keyboard_folder(keyboard)
|
||||
|
||||
|
||||
def _find_name(path):
|
||||
"""Determine the keyboard name by stripping off the base_path and rules.mk.
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue