Files
redmine/fix_syntax.py
Jason Thistlethwaite 9ee9eb3ec6 Organized
2026-10-17 20:50:35 -04:00

24 lines
654 B
Python

#!/usr/bin/env python3
with open("redmine_tickets.py") as f:
txt = f.read()
# Fix the missing ) after no-preview arg
old = ''' help="Disable fzf right-hand preview pane.",
if add_tui_parser is not None:'''
new = ''' help="Disable fzf right-hand preview pane.",
)
if add_tui_parser is not None:'''
if old in txt:
txt = txt.replace(old, new, 1)
print("Replaced missing ) block")
else:
print("Old not found, trying looser fixes")
# Ensure ) before the if
txt = txt.replace('pane.",\n if add', 'pane.",\n )\n\n if add')
with open("redmine_tickets.py", "w") as f:
f.write(txt)
print("Saved")