Explorer
/proc/5461/root/tmp/aa045f5_patch_store.py
← Zurück ↓ Download
"""AA-045-F5: watch_intake _store um watch-Felder ergaenzen."""
p = "/opt/struktur/social-media-radar/intake/watch_intake.py"
s = open(p).read()
old = '''        "score_breakdown": json.dumps({"watch_entity": entity["entity_id"],
                                       "sector": entity["sector"],
                                       "priority": entity.get("priority", "normal")}),'''
new = old + '''
        "watch_entity_id":   entity["entity_id"],
        "watch_sector":      entity["sector"],
        "watch_priority":    entity.get("priority", "normal"),'''
assert old in s, "anchor fehlt"
s = s.replace(old, new)
open(p, "w").write(s)
print("patched")