#!/usr/bin/python import subprocess,sys stuff={} blob=subprocess.Popen(["sed","-n", 's//\\1 /;t good;d;:good;h;:loop;n;s@@@;t out;H;b loop;:out;g;s/\\n/ /g;p', "www/roadmap.html", "www/status.html"], stdout=subprocess.PIPE, shell=False) for i in blob.stdout.read().split("\n"): if not i: continue i=i.split() stuff[i[0]]=i[1:] reverse={} for i in stuff: for j in stuff[i]: try: reverse[j].append(i) except: reverse[j]=[i] pending=[] done=[] outfile=open("www/status.gen", "w") outfile.write("
\n") outfile.write("\n") blah=list(reverse) blah.sort() for i in blah: out=i if "posix" in reverse[i]: out='[%s]' % (i,out) elif "lsb" in reverse[i]: out='<%s>' % (i,out) elif "development" in reverse[i]: out='(%s)' % (i,out) elif "toolbox" in reverse[i]: out='{%s}' % out elif "ready" in reverse[i]: pass else: sys.stderr.write("unknown %s %s\n" % (i, reverse[i])) if "ready" in reverse[i] or "pending" in reverse[i]: out='
%s' % out done.append(out) else: pending.append(out) outfile.write(out+"\n") outfile.write("
\n" % "\n".join(pending)) outfile.write("%s
\n" % "\n".join(done))%s