mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-10-19 07:30:21 +02:00
Align spec discovery for multi-digit versions
This commit is contained in:
@@ -8,10 +8,13 @@ def list_lighting_versions(feature):
|
||||
"""Return available versions - sorted newest first
|
||||
"""
|
||||
ret = []
|
||||
for file in Path('data/constants/lighting/').glob(f'{feature}_[0-9].[0-9].[0-9].hjson'):
|
||||
ret.append(file.stem.split('_')[-1])
|
||||
for file in Path('data/constants/lighting/').glob(f'{feature}_*.hjson'):
|
||||
version = file.stem[len(feature) + 1:]
|
||||
parts = version.split('.')
|
||||
if len(parts) == 3 and all(part.isascii() and part.isdigit() for part in parts):
|
||||
ret.append(version)
|
||||
|
||||
ret.sort(reverse=True)
|
||||
ret.sort(key=lambda version: tuple(map(int, version.split('.'))), reverse=True)
|
||||
return ret
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,16 @@ def get_xap_definition_files():
|
||||
"""Get the sorted list of XAP definition files, from <QMK>/data/xap.
|
||||
"""
|
||||
xap_defs = qmk.constants.QMK_FIRMWARE / "data" / "xap"
|
||||
return list(sorted(xap_defs.glob('**/xap_*.hjson')))
|
||||
versions = []
|
||||
for file in xap_defs.glob('**/xap_*.hjson'):
|
||||
version = file.stem[len('xap_'):]
|
||||
parts = version.split('.')
|
||||
if len(parts) == 3 and all(part.isascii() and part.isdigit() for part in parts):
|
||||
versions.append(version)
|
||||
|
||||
versions.sort(key=lambda version: tuple(map(int, version.split('.'))))
|
||||
|
||||
return list(map(lambda version: xap_defs / f'xap_{version}.hjson', versions))
|
||||
|
||||
|
||||
def update_xap_definitions(original, new):
|
||||
|
||||
Reference in New Issue
Block a user