39496-vm/patch_index2.py
2026-04-07 13:31:46 +00:00

15 lines
384 B
Python

import re
with open("index.php", "r", encoding="utf-8") as f:
content = f.read()
# Pattern to remove the entire panel-card block
pattern = r'<div class="panel-card">[\s\S]*?</div>\s*<\?php endif; \?>'
replacement = '<?php endif; ?>'
new_content = re.sub(pattern, replacement, content)
with open("index.php", "w", encoding="utf-8") as f:
f.write(new_content)
print("done")