diff options
author | Kevin Schlosser <kdschlosser@users.noreply.github.com> | 2023-05-29 02:46:42 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 10:46:42 +0200 |
commit | 236c1e0c738f0daf786422f3834f972e7ed90581 (patch) | |
tree | bdd07db665273184d2c8335aeb329ffcf768aaf1 /docs/config_builder.py | |
parent | 42d24403c31fed813548ec2738b8567ad59bf902 (diff) | |
download | lvgl-236c1e0c738f0daf786422f3834f972e7ed90581.tar.gz lvgl-236c1e0c738f0daf786422f3834f972e7ed90581.zip |
docs: fixes few things (#4249)
Diffstat (limited to 'docs/config_builder.py')
-rw-r--r-- | docs/config_builder.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/config_builder.py b/docs/config_builder.py new file mode 100644 index 000000000..b53f4fe61 --- /dev/null +++ b/docs/config_builder.py @@ -0,0 +1,35 @@ + +import os + +base_path = os.path.dirname(__file__) +dst_config = os.path.join(base_path, 'lv_conf.h') +src_config = os.path.abspath(os.path.join( + base_path, + '..', + 'lv_conf_template.h' +)) + + +def run(): + 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: + 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 + data = '\n'.join(data) + + with open(dst_config, 'w') as f: + f.write(data) + + +def cleanup(): + if os.path.exists(dst_config): + os.remove(dst_config)
\ No newline at end of file |