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))
44 Axis.__init__(self, 'clck')
45 def getLabel(self, v):
50 Axis.__init__(self, 'test')
51 def getLabel(self, v):
52 return v+"<br><a href='%s.sh.html'>source</a>"%(urllib.quote(v))
59 def __init__(self, pageclass, values, x, y):
60 self.pageclass = pageclass
67 yield self.pageclass(v, self.x, self.y)
70 def __init__(self, value, xvals, yvals):
75 def generate(self, pagesets):
76 html = open("%s-%s.html"%(self.prefix, self.value), "w")
77 print >> html, """<html>
79 <title>CAN driver benchmark for %s %s</title>
82 table { border-collapse: collapse; }
83 th, td { border: 1px solid lightgray; padding: 4px;}
87 <h1>CAN driver benchmark for %s %s</h1>""" % (self.name, self.value, self.name, self.value)
89 print >>html, "View only %s: " % str(ps.pageclass.name)
91 print >>html, "<a href='%s-%s.html'>%s</a> | "%(ps.values.type, urllib.quote(v), v)
94 print >>html, self.getPreambule()
97 print >>html, "<table><thead><tr><td> </td>"
98 for x in self.xvals.labels():
99 print >>html, "<th>%s</th>" % x
100 print >>html, "</tr></thead>"
102 print >>html, "<tr><th>%s</th>" % self.yvals.getLabel(y)
106 d="by-%s/%s/%s/%s/" % (self.prefix, self.value, y, x)
109 for img in dircache.listdir(dthumb):
110 print >>html, "<a href='%s/%s'><img src='%s/thumb/%s'></a>" % (urllib.quote(d), img, urllib.quote(d), img)
112 print "warning: no images in %s?"%dthumb
113 print >>html, "</td>"
114 print >>html, "</tr>"
120 class PageKern(Page):
123 def __init__(self, value, xvals, yvals):
124 Page.__init__(self, value, xvals, yvals)
125 def getPreambule(self):
126 i=self.value.find(":")
127 if i>0: kver=self.value[:i]
128 else: kver=self.value
129 return "<p><a href='config-%s'>Kernel config</a></p>"%kver
131 class PageClck(Page):
134 def __init__(self, value, xvals, yvals):
135 Page.__init__(self, value, xvals, yvals)
137 class PageTest(Page):
140 def __init__(self, value, xvals, yvals):
141 Page.__init__(self, value, xvals, yvals)
142 def getPreambule(self):
143 return "<p><a href='%s.sh.html'>Test source</a></p>"%(urllib.quote(self.value))
147 pagesets = [ PageSet(PageKern, kernels, clocks, tests),
148 PageSet(PageTest, tests, clocks, kernels),
149 PageSet(PageClck, clocks, kernels, tests)]
152 for p in ps.getPages():
156 os.remove("index.html")
159 os.symlink("%s-%s.html"%(clocks.type, clocks[0]), "index.html")
161 os.system("source-highlight -d --output-dir=. ../*.sh")
164 for v in kernels.versions():
165 os.system("cp /boot/config-%s ."%v)