-
-
Save encukou/a5a5a3d7bb52cfad3f28b7ef31e71089 to your computer and use it in GitHub Desktop.
Watch my FTBFSes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env -S bash -c 'watch -n 300 I=$(whoami) python3.8 myfailures.py' | |
import re | |
import sys | |
import os | |
from urllib.request import urlopen | |
URL = 'https://kojipkgs.fedoraproject.org/mass-rebuild/f31-failures.html' | |
#USER = sys.argv[1] | |
USER = os.environ['I'] | |
USER_RE = re.compile(fr'<dt>{USER} \(\d+\):</dt>') | |
FAIL_RE = re.compile(r'<dd><a href="(?P<link>[^"]+)">(?P<pkg>[^<]+)</a></dd>') | |
with urlopen(URL) as response: | |
text = response.read().decode('utf-8') | |
mine = False | |
for line in text.splitlines(): | |
if mine: | |
if match := FAIL_RE.match(line): | |
pkg = match.group('pkg') | |
link = match.group('link') | |
print(f'{pkg:20}{link}') | |
else: | |
break | |
elif USER_RE.match(line): | |
mine = True | |
print('---') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment