Rob Landley | 37aa821 | 2012-07-21 00:29:27 -0500 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | import subprocess,sys |
| 4 | |
| 5 | stuff={} |
Rob Landley | 8f90d3a | 2012-07-21 23:58:40 -0500 | [diff] [blame] | 6 | blob=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 Landley | 37aa821 | 2012-07-21 00:29:27 -0500 | [diff] [blame] | 7 | for i in blob.stdout.read().split("\n"): |
| 8 | if not i: continue |
| 9 | i=i.split() |
| 10 | stuff[i[0]]=i[1:] |
| 11 | |
Rob Landley | fdc10c9 | 2012-10-16 17:09:30 -0500 | [diff] [blame] | 12 | stuff['toolbox'] |
Rob Landley | 8f90d3a | 2012-07-21 23:58:40 -0500 | [diff] [blame] | 13 | |
Rob Landley | 37aa821 | 2012-07-21 00:29:27 -0500 | [diff] [blame] | 14 | reverse={} |
| 15 | for i in stuff: |
| 16 | for j in stuff[i]: |
| 17 | try: |
| 18 | reverse[j].append(i) |
| 19 | except: |
| 20 | reverse[j]=[i] |
| 21 | |
| 22 | pending=[] |
| 23 | done=[] |
| 24 | |
| 25 | outfile=open("www/status.gen", "w") |
Rob Landley | e0cc81e | 2012-12-01 18:27:37 -0600 | [diff] [blame^] | 26 | outfile.write("<a name=all><h2><a href=#all>All commands</a></h2><blockquote><p>\n") |
Rob Landley | 37aa821 | 2012-07-21 00:29:27 -0500 | [diff] [blame] | 27 | |
| 28 | blah=list(reverse) |
| 29 | blah.sort() |
| 30 | for i in blah: |
| 31 | out=i |
Rob Landley | e0cc81e | 2012-12-01 18:27:37 -0600 | [diff] [blame^] | 32 | if "posix" in reverse[i]: out='[<a href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/%s.html">%s</a>]' % (i,out) |
Rob Landley | 37aa821 | 2012-07-21 00:29:27 -0500 | [diff] [blame] | 33 | elif "lsb" in reverse[i]: out='<<a href="http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/%s.html">%s</a>>' % (i,out) |
| 34 | elif "development" in reverse[i]: out='(<a href="http://linux.die.net/man/1/%s">%s</a>)' % (i,out) |
Rob Landley | 8f90d3a | 2012-07-21 23:58:40 -0500 | [diff] [blame] | 35 | elif "request" in reverse[i]: out='<a href="http://linux.die.net/man/1/%s">%s</a>' % (i,out) |
Rob Landley | 37aa821 | 2012-07-21 00:29:27 -0500 | [diff] [blame] | 36 | 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 Landley | 37aa821 | 2012-07-21 00:29:27 -0500 | [diff] [blame] | 41 | done.append(out) |
Rob Landley | 8f90d3a | 2012-07-21 23:58:40 -0500 | [diff] [blame] | 42 | out='<strike>%s</strike>' % out |
Rob Landley | 37aa821 | 2012-07-21 00:29:27 -0500 | [diff] [blame] | 43 | else: pending.append(out) |
| 44 | |
| 45 | outfile.write(out+"\n") |
| 46 | |
| 47 | outfile.write("</p></blockquote>\n") |
| 48 | |
Rob Landley | e0cc81e | 2012-12-01 18:27:37 -0600 | [diff] [blame^] | 49 | outfile.write("<a name=todo><h2><a href=#todo>TODO</a></h2><blockquote><p>%s</p></blockquote>\n" % "\n".join(pending)) |
| 50 | outfile.write("<a name=done><h2><a href=#done>Done</a></h2><blockquote><p>%s</p></blockquote>\n" % "\n".join(done)) |