import os;
import dircache;
import sys;
+import urllib
os.chdir(sys.argv[1])
self.type = atype
self.values = dircache.listdir('by-%s'%atype)
- def __str__(self):
- if self.type == "kern": return "kernel"
- elif self.type == "clck": return "CPU clock"
- elif self.type == "test": return "test"
- else: raise Exception, "Unknown type"
-
def __iter__(self):
return iter(self.values)
def __getitem__(self, key):
return self.values[key]
- def getLabel(self, v):
- if self.type == "clck": return v+" MHz"
- elif self.type == "test": return "<a href='%s.sh.html'>%s</a>"%(v, v)
- else: return v
-
-
def labels(self):
for v in self.values:
yield self.getLabel(v)
-
-kernels = Axis('kern')
-clocks = Axis('clck')
-tests = Axis('test')
+
+class AxisKern(Axis):
+ def __init__(self):
+ Axis.__init__(self, 'kern')
+ def getLabel(self, v):
+ i=v.find(":")
+ if i>0: kver=v[:i]
+ else: kver=v
+ return v+"<br><a href='config-%s'>config</a>"%(urllib.quote(kver))
+
+
+class AxisClck(Axis):
+ def __init__(self):
+ Axis.__init__(self, 'clck')
+ def getLabel(self, v):
+ return v+" MHz"
+
+class AxisTest(Axis):
+ def __init__(self):
+ Axis.__init__(self, 'test')
+ def getLabel(self, v):
+ return v+"<br><a href='%s.sh.html'>source</a>"%(urllib.quote(v))
+
+kernels = AxisKern()
+clocks = AxisClck()
+tests = AxisTest()
class PageSet:
def __init__(self, values, x, y):
for ps in pagesets:
print >>html, "View only %s: " % str(ps.values)
for v in ps.values:
- print >>html, "<a href='%s-%s.html'>%s</a> | "%(ps.values.type, v, v)
+ print >>html, "<a href='%s-%s.html'>%s</a> | "%(ps.values.type, urllib.quote(v), v)
print >>html, "<br>"
print >>html, "<table><thead><tr><td> </td>"
for x in self.xvals.labels():
- print >>html, "<td>%s</td>" % x
+ print >>html, "<th>%s</th>" % x
print >>html, "</tr></thead>"
for y in self.yvals:
print >>html, "<tr><td>%s</td>" % self.yvals.getLabel(y)
dthumb = d+"thumb"
try:
for img in dircache.listdir(dthumb):
- print >>html, "<a href='%s/%s'><img src='%s/thumb/%s'></a>" % (d, img, d, img)
+ print >>html, "<a href='%s/%s'><img src='%s/thumb/%s'></a>" % (urllib.quote(d), img, urllib.quote(d), img)
except OSError:
print "warning: no images in %s?"%dthumb
print >>html, "</td>"