diff --git a/modules/ts/misc/chart.py b/modules/ts/misc/chart.py index 822ce4b7f8a82d97de7076e17e51e6ad1652fc0c..f17395b95ac0c970215e928a99e6d5212ad595d7 100644 --- a/modules/ts/misc/chart.py +++ b/modules/ts/misc/chart.py @@ -145,7 +145,7 @@ if __name__ == "__main__": for i in range(argsnum): arglists[i] = sorted([str(key) for key in arglists[i].iterkeys()], key=keyselector) - if options.generateHtml: + if options.generateHtml and options.format != "moinwiki": htmlPrintHeader(sys.stdout, "Report %s for %s" % (args[0], sname)) indexes = [0] * argsnum @@ -191,11 +191,11 @@ if __name__ == "__main__": tbl.newCell(col, "-") if options.generateHtml: - tbl.htmlPrintTable(sys.stdout) + tbl.htmlPrintTable(sys.stdout, options.format == "moinwiki") else: tbl.consolePrintTable(sys.stdout) if not nextPermutation(indexes, arglists, x, y): break - if options.generateHtml: + if options.generateHtml and options.format != "moinwiki": htmlPrintFooter(sys.stdout) \ No newline at end of file diff --git a/modules/ts/misc/report.py b/modules/ts/misc/report.py index ef24313befe2a7db263213cdaf6de097084257c5..bf747fd97c8a59b56dce4553cc5e773bf3b53c76 100644 --- a/modules/ts/misc/report.py +++ b/modules/ts/misc/report.py @@ -91,8 +91,11 @@ if __name__ == "__main__": # output table if options.generateHtml: - htmlPrintHeader(sys.stdout, "Report %s tests from %s" % (len(tests), ", ".join(files))) - tbl.htmlPrintTable(sys.stdout) - htmlPrintFooter(sys.stdout) + if options.format == "moinwiki": + tbl.htmlPrintTable(sys.stdout, True) + else: + htmlPrintHeader(sys.stdout, "Report %s tests from %s" % (len(tests), ", ".join(files))) + tbl.htmlPrintTable(sys.stdout) + htmlPrintFooter(sys.stdout) else: tbl.consolePrintTable(sys.stdout) \ No newline at end of file diff --git a/modules/ts/misc/summary.py b/modules/ts/misc/summary.py index 3279930c134c5f0cc247824ed88124c5f71ce16a..b4f9987ca50bb58672d0cab2211145a5ae0ffb8d 100644 --- a/modules/ts/misc/summary.py +++ b/modules/ts/misc/summary.py @@ -137,8 +137,11 @@ if __name__ == "__main__": # output table if options.generateHtml: - htmlPrintHeader(sys.stdout, "Summary report for %s tests from %s test logs" % (len(test_cases), setsCount)) - tbl.htmlPrintTable(sys.stdout) - htmlPrintFooter(sys.stdout) + if options.format == "moinwiki": + tbl.htmlPrintTable(sys.stdout, True) + else: + htmlPrintHeader(sys.stdout, "Summary report for %s tests from %s test logs" % (len(test_cases), setsCount)) + tbl.htmlPrintTable(sys.stdout) + htmlPrintFooter(sys.stdout) else: tbl.consolePrintTable(sys.stdout) diff --git a/modules/ts/misc/table_formatter.py b/modules/ts/misc/table_formatter.py index 276f01cd44fb33df28e81353a7372d1a8a210fd8..c573e7c44a799a33ff387a293a41ffcd59862653 100644 --- a/modules/ts/misc/table_formatter.py +++ b/modules/ts/misc/table_formatter.py @@ -328,20 +328,26 @@ class table(object): return (height - space + 1) / 2 return 0 - def htmlPrintTable(self, out): + def htmlPrintTable(self, out, embeedcss = False): columns = self.layoutTable() - out.write("
\n\n") + if embeedcss: + out.write("
\n
\n") + else: + out.write("
\n
\n") if self.caption: - out.write(" \n" % htmlEncode(self.reformatTextValue(self.caption))) + if embeedcss: + out.write(" \n" % htmlEncode(self.reformatTextValue(self.caption))) + else: + out.write(" \n" % htmlEncode(self.reformatTextValue(self.caption))) out.write(" \n") headerRow = tblRow(len(columns), {"align": "center", "valign": "top", "bold": True, "header": True}) headerRow.cells = columns header_rows = [headerRow] - header_rows.extend([row for row in self.rows if self.getValue("header")]) + last_row = header_rows[len(header_rows) - 1] for row in header_rows: out.write(" \n") @@ -353,7 +359,12 @@ class table(object): attr += " align=\"%s\"" % align if valign: attr += " valign=\"%s\"" % valign - out.write(" \n" % attr) + css = "" + if embeedcss: + css = " style=\"border:none;color:#003399;font-size:16px;font-weight:normal;white-space:nowrap;padding:3px 10px;\"" + if row == last_row: + css = css[:-1] + "padding-bottom:5px;\"" + out.write(" \n" % (attr, css)) if th is not None: out.write(" %s\n" % htmlEncode(th.text)) out.write(" \n") @@ -399,7 +410,12 @@ class table(object): rows[q].cells[i] = colspan if style: attr += " style=\"%s\"" % style - out.write(" \n" % attr) + css = "" + if embeedcss: + css = " style=\"border:none;border-bottom:1px solid #CCCCCC;color:#666699;padding:6px 8px;white-space:nowrap;\"" + if r == 0: + css = css[:-1] + "border-top:2px solid #6678B1;\"" + out.write(" \n" % (attr, css)) if th is not None: out.write(" %s\n" % htmlEncode(td.text)) out.write(" \n") @@ -423,8 +439,8 @@ html, body {font-family: Lucida Console, Courier New, Courier;font-size: 16px;co .tbl span{display:block;white-space:nowrap;} .tbl thead tr:last-child th {padding-bottom:5px;} .tbl tbody tr:first-child td {border-top:2px solid #6678B1;} -.tbl th{color:#003399;font-size:16px;font-weight:normal;white-space:nowrap;padding:3px 10px;} -.tbl td{border-bottom:1px solid #CCCCCC;color:#666699;padding:6px 8px;white-space:nowrap;} +.tbl th{border:none;color:#003399;font-size:16px;font-weight:normal;white-space:nowrap;padding:3px 10px;} +.tbl td{border:none;border-bottom:1px solid #CCCCCC;color:#666699;padding:6px 8px;white-space:nowrap;} .tbl tbody tr:hover td{color:#000099;} .tbl caption{font:italic 16px "Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;padding:0 0 5px;text-align:right;white-space:normal;} @@ -452,7 +468,7 @@ def getStdoutFilename(): def detectHtmlOutputType(requestedType): if requestedType == "txt": return False - elif requestedType == "html": + elif requestedType in ["html", "moinwiki"]: return True else: if sys.stdout.isatty():
%s%s%s