summaryrefslogtreecommitdiff
path: root/lib/python/qmk/util.py
diff options
context:
space:
mode:
authorXelus22 <17491233+Xelus22@users.noreply.github.com>2025-11-23 22:21:13 +1100
committerGitHub <noreply@github.com>2025-11-23 22:21:13 +1100
commitfd65390496cb47b3164c507656798664b8c2fcd1 (patch)
treec54c8643c55b2ae79bbfa1f3a176d56a152e65ab /lib/python/qmk/util.py
parent28a11ff6f7a721820cc335287e44e2fefe22ac71 (diff)
[core] add BCD versions of QMK Version (#25804)
Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'lib/python/qmk/util.py')
-rw-r--r--lib/python/qmk/util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/python/qmk/util.py b/lib/python/qmk/util.py
index 8f99410e1d..6da684a577 100644
--- a/lib/python/qmk/util.py
+++ b/lib/python/qmk/util.py
@@ -3,9 +3,12 @@
3import contextlib 3import contextlib
4import multiprocessing 4import multiprocessing
5import sys 5import sys
6import re
6 7
7from milc import cli 8from milc import cli
8 9
10TRIPLET_PATTERN = re.compile(r'^(\d+)\.(\d+)\.(\d+)')
11
9maybe_exit_should_exit = True 12maybe_exit_should_exit = True
10maybe_exit_reraise = False 13maybe_exit_reraise = False
11 14
@@ -96,3 +99,10 @@ def parallel_map(*args, **kwargs):
96 # before the results are returned. Returning a list ensures results are 99 # before the results are returned. Returning a list ensures results are
97 # materialised before any worker pool is shut down. 100 # materialised before any worker pool is shut down.
98 return list(map_fn(*args, **kwargs)) 101 return list(map_fn(*args, **kwargs))
102
103
104def triplet_to_bcd(ver: str):
105 m = TRIPLET_PATTERN.match(ver)
106 if not m:
107 return '0x00000000'
108 return f'0x{int(m.group(1)):02d}{int(m.group(2)):02d}{int(m.group(3)):04d}'