17 lines
731 B
Python
17 lines
731 B
Python
import os
|
|
import sys
|
|
|
|
src_dir = r"c:\Users\kaziu\Desktop\esp32-c3-mini\src"
|
|
for root, _, files in os.walk(src_dir):
|
|
for f in files:
|
|
if f.endswith((".c", ".cpp", ".h")):
|
|
filepath = os.path.join(root, f)
|
|
with open(filepath, "r", encoding="utf-8") as file:
|
|
content = file.read()
|
|
if "lv_font_montserrat_" in content and not "ui_font_montserrat" in f and f != "ui.h":
|
|
new_content = content.replace("lv_font_montserrat_", "ui_font_montserrat_")
|
|
if new_content != content:
|
|
with open(filepath, "w", encoding="utf-8") as file:
|
|
file.write(new_content)
|
|
print(f"Updated {filepath}")
|