X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/930f41a0e5e559aa258dc64cb7f95fea173c088d..e2f6ea0a1257b097e4e6278d742733b316d2f553:/gw-tests/genhtml/genhtml.py diff --git a/gw-tests/genhtml/genhtml.py b/gw-tests/genhtml/genhtml.py index b4d2d36..cd4985b 100755 --- a/gw-tests/genhtml/genhtml.py +++ b/gw-tests/genhtml/genhtml.py @@ -5,6 +5,7 @@ import dircache; import sys; import urllib import traceback +import glob class DimValue(object): def __new__(cls, dim, value): @@ -142,14 +143,18 @@ class Test(object): self.values = values self.tests = tests def printThumbLink(self, file): - thumb = self.path+'/thumb' - try: - imgs = [img for img in dircache.listdir(thumb)] - except OSError: - imgs = [ self.name + ".png" ] +# try: +# imgs = [img for img in dircache.listdir(thumb)] +# except OSError: +# imgs = [ self.name + ".png" ] + imgs = [ 'tgraph.png' ] for img in imgs: - print >>file, "" % \ + print >>file, "" % \ (urllib.quote(self.path), urllib.quote(self.path), img) + def fullImgLink(self, pngName): + return "
" % \ + (pngName[:-4]+".pdf", pngName) + def generateHtml(self): html = open(os.path.join(self.path, 'results.html'), "w") title = "CAN gateway timing analysis" @@ -182,10 +187,20 @@ class Test(object): print >>html, "%s" % d, " ".join(links), "" print >>html, "" - print >>html, "
" % (self.name+".pdf", self.name+".png") + print >>html, self.fullImgLink("graph.png") print >>html, "Raw data
" print >>html, "Script source
" % (cdup+self.name+".sh.html") print >>html, "Back to top
" % cdup + + cwd = os.getcwd() + os.chdir(self.path) + additionalImgs = glob.glob("graph?*.png") + if additionalImgs: + print "XXX" + print >>html, "

Additional graphs

" + for i in additionalImgs: + print >>html, self.fullImgLink(i) + os.chdir(cwd) html.close()