[gnumeric] Tests: make python code work for python3 as well as python2
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Tests: make python code work for python3 as well as python2
- Date: Fri, 13 Apr 2018 01:04:47 +0000 (UTC)
commit 44767e429c9e06e8c968ae4639bc3d4492b1f27c
Author: Morten Welinder <terra gnome org>
Date: Thu Apr 12 21:04:09 2018 -0400
Tests: make python code work for python3 as well as python2
test/t3000-introspection-basic.py | 2 +-
test/t3001-introspection-simple.py | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/test/t3000-introspection-basic.py b/test/t3000-introspection-basic.py
index be4b6fe..773d8e3 100755
--- a/test/t3000-introspection-basic.py
+++ b/test/t3000-introspection-basic.py
@@ -6,4 +6,4 @@ gi.require_version('Gnm', '1.12')
from gi.repository import Gnm
Gnm.init()
-print Gnm.qnorm(0.4,0,1,1,0)
+print(Gnm.qnorm(0.4,0,1,1,0))
diff --git a/test/t3001-introspection-simple.py b/test/t3001-introspection-simple.py
index 8749ebe..24edc79 100755
--- a/test/t3001-introspection-simple.py
+++ b/test/t3001-introspection-simple.py
@@ -11,9 +11,9 @@ wb = Gnm.Workbook.new_with_sheets(1)
# Get sheet. Index starts at 0
sheet = wb.sheet_by_index(0)
-print "Name:", sheet.props.name
-print "Number of columns:", sheet.props.columns
-print "Number of rows:", sheet.props.rows
+print("Name:", sheet.props.name)
+print("Number of columns:", sheet.props.columns)
+print("Number of rows:", sheet.props.rows)
# Store values and expressions is some cells. Coordinates are (col,row)
# both starting at 0. (So what the gui sees as row 1 is 0 here.)
@@ -45,15 +45,15 @@ sheet.style_apply_range(r,st)
# Recalculate all cells that need it
wb.recalc()
-print "\nAs string:"
+print("\nAs string:")
for i in range(7):
- print sheet.cell_get_value(0,i).get_as_string()
+ print(sheet.cell_get_value(0,i).get_as_string())
-print "\nAs int:"
+print("\nAs int:")
for i in range(7):
- print sheet.cell_get_value(0,i).get_as_int()
+ print(sheet.cell_get_value(0,i).get_as_int())
-print "\nList of cells in sheet:"
+print("\nList of cells in sheet:")
for c in sheet.cells(None):
st = sheet.style_get (c.pos.col,c.pos.row)
bold = st.get_font_bold()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]