"""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'
]*data-(?:auto-update|update-undone|update-error|held|unhealthy-stop)[^>]*>(.*?)
', h, re.S) b = re.findall(r']*>([^<]*)<', 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())