blob: 6c24d1a1de475726e68df15c9e54bf5a03d3debf [file] [log] [blame]
Rob Landley37aa8212012-07-21 00:29:27 -05001#!/usr/bin/python
2
3import subprocess,sys
4
5stuff={}
Rob Landley8f90d3a2012-07-21 23:58:40 -05006blob=subprocess.Popen(["sed","-n", 's/<span id=\\([a-z_]*\\)>/\\1 /;t good;d;:good;h;:loop;n;s@</span>@@;t out;H;b loop;:out;g;s/\\n/ /g;p', "www/roadmap.html", "www/status.html"], stdout=subprocess.PIPE, shell=False)
Rob Landley37aa8212012-07-21 00:29:27 -05007for i in blob.stdout.read().split("\n"):
8 if not i: continue
9 i=i.split()
10 stuff[i[0]]=i[1:]
11
Rob Landleyfdc10c92012-10-16 17:09:30 -050012stuff['toolbox']
Rob Landley8f90d3a2012-07-21 23:58:40 -050013
Rob Landley37aa8212012-07-21 00:29:27 -050014reverse={}
15for i in stuff:
16 for j in stuff[i]:
17 try:
18 reverse[j].append(i)
19 except:
20 reverse[j]=[i]
21
22pending=[]
23done=[]
24
25outfile=open("www/status.gen", "w")
Rob Landleye0cc81e2012-12-01 18:27:37 -060026outfile.write("<a name=all><h2><a href=#all>All commands</a></h2><blockquote><p>\n")
Rob Landley37aa8212012-07-21 00:29:27 -050027
28blah=list(reverse)
29blah.sort()
30for i in blah:
31 out=i
Rob Landleye0cc81e2012-12-01 18:27:37 -060032 if "posix" in reverse[i]: out='[<a href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/%s.html">%s</a>]' % (i,out)
Rob Landley37aa8212012-07-21 00:29:27 -050033 elif "lsb" in reverse[i]: out='&lt;<a href="http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/%s.html">%s</a>&gt;' % (i,out)
34 elif "development" in reverse[i]: out='(<a href="http://linux.die.net/man/1/%s">%s</a>)' % (i,out)
Rob Landley8f90d3a2012-07-21 23:58:40 -050035 elif "request" in reverse[i]: out='<a href="http://linux.die.net/man/1/%s">%s</a>' % (i,out)
Rob Landley37aa8212012-07-21 00:29:27 -050036 elif "toolbox" in reverse[i]: out='{%s}' % out
37 elif "ready" in reverse[i]: pass
38 else: sys.stderr.write("unknown %s %s\n" % (i, reverse[i]))
39
40 if "ready" in reverse[i] or "pending" in reverse[i]:
Rob Landley37aa8212012-07-21 00:29:27 -050041 done.append(out)
Rob Landley8f90d3a2012-07-21 23:58:40 -050042 out='<strike>%s</strike>' % out
Rob Landley37aa8212012-07-21 00:29:27 -050043 else: pending.append(out)
44
45 outfile.write(out+"\n")
46
47outfile.write("</p></blockquote>\n")
48
Rob Landleye0cc81e2012-12-01 18:27:37 -060049outfile.write("<a name=todo><h2><a href=#todo>TODO</a></h2><blockquote><p>%s</p></blockquote>\n" % "\n".join(pending))
50outfile.write("<a name=done><h2><a href=#done>Done</a></h2><blockquote><p>%s</p></blockquote>\n" % "\n".join(done))