From 3d81e0a414ecb876f2429c0108a685152bd4ee54 Mon Sep 17 00:00:00 2001 From: Jan de Groot Date: Thu, 21 Mar 2013 20:47:57 +0100 Subject: [PATCH] Make gtester-report work with Python 3.x: - fix indentations (tabs to spaces) - Replace print with print(), still works with Python 2.x --- glib/gtester-report | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/glib/gtester-report b/glib/gtester-report index 0fcdd9a..00296ea 100755 --- a/glib/gtester-report +++ b/glib/gtester-report @@ -308,20 +308,20 @@ class HTMLReportWriter(ReportWriter): if binary.success_cases: oklink = 'href="javascript:toggle_display (\'ResultTable\', \'tr\', \'b%u_\', \'success\')"' % self.bcounter if real_cases != 0: - self.oprint ('ER\n' % erlink) - self.oprint ('OK\n' % oklink) - self.oprint ('\n') - perc = binary.success_cases * 100.0 / real_cases - pcolor = { - 100 : 'bgcolor="lightgreen"', - 0 : 'bgcolor="red"', - }.get (int (perc), 'bgcolor="yellow"') - self.oprint ('%.2f%%\n' % (pcolor, perc)) - self.oprint ('\n') + self.oprint ('ER\n' % erlink) + self.oprint ('OK\n' % oklink) + self.oprint ('\n') + perc = binary.success_cases * 100.0 / real_cases + pcolor = { + 100 : 'bgcolor="lightgreen"', + 0 : 'bgcolor="red"', + }.get (int (perc), 'bgcolor="yellow"') + self.oprint ('%.2f%%\n' % (pcolor, perc)) + self.oprint ('\n') else: - self.oprint ('Empty\n') - self.oprint ('\n') - self.oprint ('\n') + self.oprint ('Empty\n') + self.oprint ('\n') + self.oprint ('\n') for tc in binary.testcases: self.handle_testcase (tc, binary) def handle_totals (self): @@ -466,7 +466,7 @@ def parse_opts(): " Needs python-subunit]") options, files = parser.parse_args() if options.version: - print parser.epilog + print(parser.epilog) return None, None if len(files) != 1: parser.error("Must supply a log file to parse.") -- 1.8.2