inital
This commit is contained in:
20
remove_blank_lines.py
Normal file
20
remove_blank_lines.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from pathlib import Path
|
||||
|
||||
path = Path("F4SDCockpitCommunicationDemo.cs")
|
||||
lines = path.read_text(encoding="utf-8").splitlines()
|
||||
start = None
|
||||
end = None
|
||||
for idx, line in enumerate(lines):
|
||||
if line.strip() == "private void LoadTicketOverviewRelations()":
|
||||
start = idx
|
||||
continue
|
||||
if start is not None and line.strip().startswith("private bool LoadMockupData"):
|
||||
end = idx
|
||||
break
|
||||
if start is None or end is None:
|
||||
raise SystemExit('Could not locate method boundaries for LoadTicketOverviewRelations')
|
||||
method_lines = lines[start:end]
|
||||
filtered = [line for line in method_lines if line.strip()]
|
||||
filtered.append("")
|
||||
new_lines = lines[:start] + filtered + lines[end:]
|
||||
path.write_text("\r\n".join(new_lines) + "\r\n", encoding="utf-8")
|
||||
Reference in New Issue
Block a user