diff --git a/keyboards/dmqdesign/spin/keyboard.json b/keyboards/dmqdesign/spin/keyboard.json index dd3cbaa838..374fb7d7de 100644 --- a/keyboards/dmqdesign/spin/keyboard.json +++ b/keyboards/dmqdesign/spin/keyboard.json @@ -49,19 +49,19 @@ {"matrix": [0, 0], "x": 0, "y": 0}, {"matrix": [1, 0], "x": 1, "y": 0}, {"matrix": [2, 0], "x": 2, "y": 0}, - {"matrix": [2, 4], "x": 3.5, "y": 0}, + {"matrix": [2, 4], "x": 3.5, "y": 0, "encoder": 0}, {"matrix": [0, 1], "x": 0, "y": 1}, {"matrix": [1, 1], "x": 1, "y": 1}, {"matrix": [2, 1], "x": 2, "y": 1}, - {"matrix": [1, 4], "x": 3.5, "y": 1.5}, + {"matrix": [1, 4], "x": 3.5, "y": 1.5, "encoder": 1}, {"matrix": [0, 2], "x": 0, "y": 2}, {"matrix": [1, 2], "x": 1, "y": 2}, {"matrix": [2, 2], "x": 2, "y": 2}, - {"matrix": [0, 4], "x": 3.5, "y": 3}, + {"matrix": [0, 4], "x": 3.5, "y": 3, "encoder": 2}, {"matrix": [0, 3], "x": 0, "y": 3}, {"matrix": [1, 3], "x": 1, "y": 3}, {"matrix": [2, 3], "x": 2, "y": 3} diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py index 542ba26089..3a8fdce1e8 100644 --- a/lib/python/qmk/path.py +++ b/lib/python/qmk/path.py @@ -183,5 +183,17 @@ class FileType(argparse.FileType): """normalize and check exists otherwise magic strings like '-' for stdin resolve to bad paths """ + # TODO: This should not return both Path and TextIOWrapper as consumers + # assume that they can call Path.as_posix without checking type + + # Handle absolute paths and relative paths to CWD norm = normpath(string) - return norm if norm.exists() else super().__call__(string) + if norm.exists(): + return norm + + # Handle relative paths to QMK_HOME + relative = Path(string) + if relative.exists(): + return relative + + return super().__call__(string)