11 def __init__(self, atype):
13 self.values = dircache.listdir('by-%s'%atype)
16 return iter(self.values)
18 def __getitem__(self, key):
19 return self.values[key]
23 yield self.getLabel(v)
27 Axis.__init__(self, 'kern')
28 def getLabel(self, v):
32 return v+"<br><a href='config-%s'>config</a>"%(urllib.quote(kver))
37 Axis.__init__(self, 'clck')
38 def getLabel(self, v):
43 Axis.__init__(self, 'test')
44 def getLabel(self, v):
45 return v+"<br><a href='%s.sh.html'>source</a>"%(urllib.quote(v))
52 def __init__(self, values, x, y):
59 yield Page(self.values.type, str(self.values), v, self.x, self.y)
62 def __init__(self, prefix, name, value, xvals, yvals):
69 def generate(self, pagesets):
70 html = open("%s-%s.html"%(self.prefix, self.value), "w")
71 print >> html, """<html>
73 <title>CAN driver benchmark for %s %s</title>
76 table { border-collapse: collapse; }
77 td { border: 1px solid lightgray; padding: 4px;}
81 <h1>CAN driver benchmark for %s %s</h1>""" % (self.name, self.value, self.name, self.value)
83 print >>html, "View only %s: " % str(ps.values)
85 print >>html, "<a href='%s-%s.html'>%s</a> | "%(ps.values.type, urllib.quote(v), v)
87 print >>html, "<table><thead><tr><td> </td>"
88 for x in self.xvals.labels():
89 print >>html, "<th>%s</th>" % x
90 print >>html, "</tr></thead>"
92 print >>html, "<tr><td>%s</td>" % self.yvals.getLabel(y)
96 d="by-%s/%s/%s/%s/" % (self.prefix, self.value, y, x)
99 for img in dircache.listdir(dthumb):
100 print >>html, "<a href='%s/%s'><img src='%s/thumb/%s'></a>" % (urllib.quote(d), img, urllib.quote(d), img)
102 print "warning: no images in %s?"%dthumb
103 print >>html, "</td>"
104 print >>html, "</tr>"
111 pagesets = [ PageSet(kernels, clocks, tests),
112 PageSet(tests, clocks, kernels),
113 PageSet(clocks, kernels, tests)]
116 for p in ps.getPages():
120 os.remove("index.html")
123 os.symlink("%s-%s.html"%(kernels.type, kernels[0]), "index.html")
125 os.system("source-highlight -d --output-dir=. ../*.sh")