Generate api data on each push (#10609)
* add new qmk generate-api command, to generate a complete set of API data. * Generate api data and push it to the keyboard repo * fix typo * Apply suggestions from code review Co-authored-by: Joel Challis <git@zvecr.com> * fixup api workflow * remove file-changes-action * use a more mainstream github action * fix yaml error * Apply suggestions from code review Co-authored-by: Erovia <Erovia@users.noreply.github.com> * more uniform date handling * make flake8 happy * Update lib/python/qmk/decorators.py Co-authored-by: Erovia <Erovia@users.noreply.github.com> Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Erovia <Erovia@users.noreply.github.com>
This commit is contained in:
parent
8ef82c466e
commit
0c42f91f4c
18 changed files with 399 additions and 127 deletions
|
@ -3,10 +3,30 @@
|
|||
from array import array
|
||||
from math import ceil
|
||||
from pathlib import Path
|
||||
import os
|
||||
from glob import glob
|
||||
|
||||
from qmk.c_parse import parse_config_h_file
|
||||
from qmk.makefile import parse_rules_mk_file
|
||||
|
||||
base_path = os.path.join(os.getcwd(), "keyboards") + os.path.sep
|
||||
|
||||
|
||||
def _find_name(path):
|
||||
"""Determine the keyboard name by stripping off the base_path and rules.mk.
|
||||
"""
|
||||
return path.replace(base_path, "").replace(os.path.sep + "rules.mk", "")
|
||||
|
||||
|
||||
def list_keyboards():
|
||||
"""Returns a list of all keyboards.
|
||||
"""
|
||||
# We avoid pathlib here because this is performance critical code.
|
||||
kb_wildcard = os.path.join(base_path, "**", "rules.mk")
|
||||
paths = [path for path in glob(kb_wildcard, recursive=True) if 'keymaps' not in path]
|
||||
|
||||
return sorted(map(_find_name, paths))
|
||||
|
||||
|
||||
def config_h(keyboard):
|
||||
"""Parses all the config.h files for a keyboard.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue