Explorer
/tmp/patch_filter_labels_p5.py
← Zurück ↓ Download
from pathlib import Path
p=Path('/opt/struktur/social-media-agent/templates/cockpit.html')
s=p.read_text()
old="""  {% for sk,sl in [('op_priority','Priorität'),('relevance','Score'),('newest','Neu'),('virality','Viral'),('linkedin','LI'),('facebook','FB')] %}\n"""
new="""  {% for sk,sl in [('op_priority','Priorität ↓'),('relevance','Score ↓'),('newest','Neu ↓'),('virality','Viral ↓'),('linkedin','LI · Quelle'),('facebook','FB · Quelle')] %}\n"""
if old not in s: raise SystemExit('button label anchor missing')
p.write_text(s.replace(old,new,1))