Files
felhom.eu/documentation/audits/night-2026-09-25/tools/applines.py
T

14 lines
751 B
Python

"""The app page's lines (auto-update / undone / update error / held) for the four drill apps, both languages."""
import re, sys
import walk as w
w.login()
out = sys.argv[1]
with open(out, "w") as f:
for lang in ("hu", "en"):
for a in ("wishlist", "navidrome", "romm", "vikunja"):
h = w.page(f"/apps/{a}" + ("?lang=en" if lang == "en" else ""))
m = re.findall(r'<div class="alert[^"]*"[^>]*data-(?:auto-update|update-undone|update-error|held|unhealthy-stop)[^>]*>(.*?)</div>', h, re.S)
b = re.findall(r'<span class="tag tag-[^"]*"[^>]*>([^<]*)<', h)[:2]
f.write(f"[{lang}] {a}: badge={[x.strip() for x in b]} lines={[re.sub(r'<[^>]+>', '', x).strip() for x in m]}\n")
print(open(out).read())