How to use the qmk.errors.NoSuchKeyboardError function in qmk

To help you get started, we’ve selected a few qmk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github qmk / qmk_firmware / lib / python / qmk / View on Github external
def keymap(keyboard):
    """Locate the correct directory for storing a keymap.

            The name of the keyboard. Example: clueboard/66/rev3
    for directory in ['.', '..', '../..', '../../..', '../../../..', '../../../../..']:
        basepath = os.path.normpath(os.path.join('keyboards', keyboard, directory, 'keymaps'))

        if os.path.exists(basepath):
            return basepath

    logging.error('Could not find keymaps directory!')
    raise NoSuchKeyboardError('Could not find keymaps directory for: %s' % keyboard)