Private
Public Access
0
0

feat(hot-reload): Final style polish and gap fix

This commit is contained in:
2026-05-16 04:47:51 -04:00
parent 3c2fde3c83
commit 5b76607293
2 changed files with 22 additions and 204 deletions
+22
View File
@@ -0,0 +1,22 @@
import sys
import re
def fix_gaps():
file_path = "src/gui_2.py"
with open(file_path, "r", encoding="utf-8") as f:
content = f.read()
# Replace 3+ newlines with 2 newlines (one empty line)
# Using \r\n for Windows support if needed, but \n is standard for Python reads
content = re.sub(r"\n\n\n+", "\n\n", content)
# Specific fix for regions: ensure no extra space after region start or before region end
content = re.sub(r"(#region: .*)\n\n+", r"\1\n", content)
content = re.sub(r"\n\n+(#endregion: .*)", r"\n\1", content)
with open(file_path, "w", encoding="utf-8") as f:
f.write(content)
print("Whitespace gaps fixed.")
if __name__ == "__main__":
fix_gaps()