Files
weval-l99/v107_wtp_link.py
2026-04-24 04:38:58 +02:00

23 lines
714 B
Python

#!/usr/bin/env python3
"""V107 - Add All-IA Hub link in WTP (doctrine #14 additif)"""
path = "/var/www/html/weval-technology-platform.html"
with open(path, "rb") as f:
raw = f.read()
marker = b'<a class="v80-quick" href="/wevia-em-big4.html"><span class="v80-quick-icon"></span>Big4 Model</a>'
if marker not in raw:
print("MARKER NOT FOUND")
exit(1)
if b"all-ia-hub" in raw:
print("ALREADY")
exit(0)
# Add All-IA Hub link RIGHT AFTER Big4 Model
new_link = marker + b'\n <a class="v80-quick" href="/all-ia-hub.html"><span class="v80-quick-icon"></span>All-IA Hub</a>'
raw = raw.replace(marker, new_link, 1)
with open(path, "wb") as f:
f.write(raw)
print(f"PATCHED size={len(raw)}")