[glib] Make gtester-report compatible with Python 3
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Make gtester-report compatible with Python 3
- Date: Thu, 5 Nov 2015 11:53:38 +0000 (UTC)
commit 4d74ca4c3ad3c9900caf320b39433e68a7db8465
Author: Jan de Groot <jan jgc homeip net>
Date: Thu Mar 21 19:51:28 2013 +0000
Make gtester-report compatible with Python 3
Convert tabs to spaces and replace print with print().
The script still works with Python 2.x.
https://bugzilla.gnome.org/show_bug.cgi?id=696324
glib/gtester-report | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/glib/gtester-report b/glib/gtester-report
index 5bf076c..b910284 100755
--- a/glib/gtester-report
+++ b/glib/gtester-report
@@ -306,20 +306,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 ('<a %s>ER</a>\n' % erlink)
- self.oprint ('<a %s>OK</a>\n' % oklink)
- self.oprint ('</td>\n')
- perc = binary.success_cases * 100.0 / real_cases
- pcolor = {
- 100 : 'bgcolor="lightgreen"',
- 0 : 'bgcolor="red"',
- }.get (int (perc), 'bgcolor="yellow"')
- self.oprint ('<td align="right" %s>%.2f%%</td>\n' % (pcolor, perc))
- self.oprint ('</tr>\n')
+ self.oprint ('<a %s>ER</a>\n' % erlink)
+ self.oprint ('<a %s>OK</a>\n' % oklink)
+ self.oprint ('</td>\n')
+ perc = binary.success_cases * 100.0 / real_cases
+ pcolor = {
+ 100 : 'bgcolor="lightgreen"',
+ 0 : 'bgcolor="red"',
+ }.get (int (perc), 'bgcolor="yellow"')
+ self.oprint ('<td align="right" %s>%.2f%%</td>\n' % (pcolor, perc))
+ self.oprint ('</tr>\n')
else:
- self.oprint ('Empty\n')
- self.oprint ('</td>\n')
- self.oprint ('</tr>\n')
+ self.oprint ('Empty\n')
+ self.oprint ('</td>\n')
+ self.oprint ('</tr>\n')
for tc in binary.testcases:
self.handle_testcase (tc, binary)
def handle_totals (self):
@@ -464,7 +464,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.")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]