11 def __init__(self, atype):
13 self.values = dircache.listdir('by-%s'%atype)
16 if self.type == "kern": return "kernel"
17 elif self.type == "clck": return "CPU clock"
18 elif self.type == "test": return "test"
19 else: raise Exception, "Unknown type"
22 return iter(self.values)
24 def __getitem__(self, key):
25 return self.values[key]
27 def getLabel(self, v):
28 if self.type == "clck": return v+" MHz"
29 elif self.type == "test": return "<a href='%s.sh.html'>%s</a>"%(urllib.quote(v), v)
35 yield self.getLabel(v)
37 kernels = Axis('kern')
42 def __init__(self, values, x, y):
49 yield Page(self.values.type, str(self.values), v, self.x, self.y)
52 def __init__(self, prefix, name, value, xvals, yvals):
59 def generate(self, pagesets):
60 html = open("%s-%s.html"%(self.prefix, self.value), "w")
61 print >> html, """<html>
63 <title>CAN driver benchmark for %s %s</title>
66 table { border-collapse: collapse; }
67 td { border: 1px solid lightgray; padding: 4px;}
71 <h1>CAN driver benchmark for %s %s</h1>""" % (self.name, self.value, self.name, self.value)
73 print >>html, "View only %s: " % str(ps.values)
75 print >>html, "<a href='%s-%s.html'>%s</a> | "%(ps.values.type, urllib.quote(v), v)
77 print >>html, "<table><thead><tr><td> </td>"
78 for x in self.xvals.labels():
79 print >>html, "<th>%s</th>" % x
80 print >>html, "</tr></thead>"
82 print >>html, "<tr><td>%s</td>" % self.yvals.getLabel(y)
86 d="by-%s/%s/%s/%s/" % (self.prefix, self.value, y, x)
89 for img in dircache.listdir(dthumb):
90 print >>html, "<a href='%s/%s'><img src='%s/thumb/%s'></a>" % (urllib.quote(d), img, urllib.quote(d), img)
92 print "warning: no images in %s?"%dthumb
101 pagesets = [ PageSet(kernels, clocks, tests),
102 PageSet(tests, clocks, kernels),
103 PageSet(clocks, kernels, tests)]
106 for p in ps.getPages():
110 os.remove("index.html")
113 os.symlink("%s-%s.html"%(kernels.type, kernels[0]), "index.html")
115 os.system("source-highlight -d --output-dir=. ../*.sh")