Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@DLu
Created July 19, 2014 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DLu/404944486ef8621fc5b1 to your computer and use it in GitHub Desktop.
Save DLu/404944486ef8621fc5b1 to your computer and use it in GitHub Desktop.
Looks at downloaded versions of build status pages (e.g. http://www.ros.org/debbuild/hydro.html)
import sys
import collections
def split(s):
i = s.index('"')
j = s.index('"', i+1)
k = s.index('<', j)
return s[i+1:j], s[j+2:k]
D = collections.defaultdict(dict)
X = set()
for arg in sys.argv[1:]:
distro = arg.split('.')[0]
for line in open(arg).readlines():
if 'willow' in line:
a = line.split('<td>')
url, pkg = split(a[1])
status, x = split(a[5])
authors = []
for p in a[6].split('/a'):
if '@' in p:
authors.append( split(p) )
for author in authors:
if 'willow' in author[0]:
key = '%s (%s)'%(author[1], author[0][7:])
if pkg not in D[key]:
D[key][pkg] = []
D[key][pkg].append ((distro, status))
X.add(status)
for author in sorted(D):
print '===== %s ====='%author
for pkg, stats in sorted(D[author].items()):
s = []
for distro, status in sorted(stats):
c = distro[0].upper()
if status != 'maintained':
c += '*'
s.append(c)
print ' %s (%s)'%(pkg, ','.join(s))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment