aboutsummaryrefslogtreecommitdiff
path: root/docs/config_builder.py
diff options
context:
space:
mode:
authorKevin Schlosser <kdschlosser@users.noreply.github.com>2024-06-20 14:02:25 -0600
committerGitHub <noreply@github.com>2024-06-20 22:02:25 +0200
commitec80fe49fa3a3e239109949dd5ef2f84326f0fc5 (patch)
tree9330860a27b9de617935c990c9557da26c961792 /docs/config_builder.py
parent25e993a1372a9e98187c37331a7d0705475ae431 (diff)
downloadlvgl-ec80fe49fa3a3e239109949dd5ef2f84326f0fc5.tar.gz
lvgl-ec80fe49fa3a3e239109949dd5ef2f84326f0fc5.zip
feat: add API JSON generator (#5677)
Co-authored-by: Liam <30486941+liamHowatt@users.noreply.github.com>
Diffstat (limited to 'docs/config_builder.py')
-rw-r--r--docs/config_builder.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/docs/config_builder.py b/docs/config_builder.py
index b53f4fe61..fde52275e 100644
--- a/docs/config_builder.py
+++ b/docs/config_builder.py
@@ -10,20 +10,34 @@ src_config = os.path.abspath(os.path.join(
))
-def run():
+def run(c_path=None):
+ global dst_config
+
+ if c_path is not None:
+ dst_config = c_path
+
with open(src_config, 'r') as f:
data = f.read()
data = data.split('\n')
for i, line in enumerate(data):
- if 'LV_USE' in line or 'LV_FONT' in line:
+ if 'LV_USE_PROFILER' in line:
+ continue
+
+ if 'LV_USE' in line or 'LV_FONT' in line and '#define' in line:
line = [item for item in line.split(' ') if item]
+
for j, item in enumerate(line):
if item == '0':
line[j] = '1'
+
line = ' '.join(line)
data[i] = line
+ elif line.startswith('#if 0'):
+ line = line.replace('#if 0', '#if 1')
+ data[i] = line
+
data = '\n'.join(data)
with open(dst_config, 'w') as f: