+ def fullImgLink(self, pngName):
+ ps = "<a href='%s'>Plot source</a>" % ("plot"+pngName[5:-4]+".gp")
+ if 'NO_PDF' in os.environ:
+ return "<div><img src='%s' />%s</div>" % (pngName, ps)
+ else:
+ return "<div><a href='%s'><img src='%s' /></a>%s</div>" % \
+ (pngName[:-4]+".pdf", pngName, ps)
+
+ def htmlPrintStats(self, html):
+ cwd = os.getcwd()
+ os.chdir(self.path)
+ stats = glob.glob("*-stat.txt")
+ print >>html, "<h3>Statistics</h3>"
+ print >>html, "<table><tr>"
+ stats.sort()
+ for i in stats:
+ lines = open(i).readlines()
+ def fixupLine(l):
+ comment = l.find("#")
+ if comment >= 0:
+ l = l[:comment-1]
+ if l.find("cmdline=") == 0:
+ l = "<abbr title=%s>cmdline=...</abbr>" % str(l[8:])
+ return l
+ lines = [fixupLine(l) for l in lines]
+ print >>html, "<td><h4>%s</h4>%s</td>" % (i, "<br />".join(lines))
+ print >>html, "</tr></table>"
+ os.chdir(cwd)
+