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, pageclass, values, x, y):
53 self.pageclass = pageclass
60 yield self.pageclass(v, self.x, self.y)
63 def __init__(self, value, xvals, yvals):
68 def generate(self, pagesets):
69 html = open("%s-%s.html"%(self.prefix, self.value), "w")
70 print >> html, """<html>
72 <title>CAN driver benchmark for %s %s</title>
75 table { border-collapse: collapse; }
76 th, td { border: 1px solid lightgray; padding: 4px;}
80 <h1>CAN driver benchmark for %s %s</h1>""" % (self.name, self.value, self.name, self.value)
82 print >>html, "View only %s: " % str(ps.pageclass.name)
84 print >>html, "<a href='%s-%s.html'>%s</a> | "%(ps.values.type, urllib.quote(v), v)
87 print >>html, self.getPreambule()
90 print >>html, "<table><thead><tr><td> </td>"
91 for x in self.xvals.labels():
92 print >>html, "<th>%s</th>" % x
93 print >>html, "</tr></thead>"
95 print >>html, "<tr><th>%s</th>" % self.yvals.getLabel(y)
99 d="by-%s/%s/%s/%s/" % (self.prefix, self.value, y, x)
102 for img in dircache.listdir(dthumb):
103 print >>html, "<a href='%s/%s'><img src='%s/thumb/%s'></a>" % (urllib.quote(d), img, urllib.quote(d), img)
105 print "warning: no images in %s?"%dthumb
106 print >>html, "</td>"
107 print >>html, "</tr>"
113 class PageKern(Page):
116 def __init__(self, value, xvals, yvals):
117 Page.__init__(self, value, xvals, yvals)
118 def getPreambule(self):
119 i=self.value.find(":")
120 if i>0: kver=self.value[:i]
121 else: kver=self.value
122 return "<p><a href='config-%s'>Kernel config</a></p>"%kver
124 class PageClck(Page):
127 def __init__(self, value, xvals, yvals):
128 Page.__init__(self, value, xvals, yvals)
130 class PageTest(Page):
133 def __init__(self, value, xvals, yvals):
134 Page.__init__(self, value, xvals, yvals)
135 def getPreambule(self):
136 return "<p><a href='%s.sh.html'>Test source</a></p>"%(urllib.quote(self.value))
140 pagesets = [ PageSet(PageKern, kernels, clocks, tests),
141 PageSet(PageTest, tests, clocks, kernels),
142 PageSet(PageClck, clocks, kernels, tests)]
145 for p in ps.getPages():
149 os.remove("index.html")
152 os.symlink("%s-%s.html"%(kernels.type, kernels[0]), "index.html")
154 os.system("source-highlight -d --output-dir=. ../*.sh")