summaryrefslogtreecommitdiff
path: root/test/regress/78AB4B87.py
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2016-01-27 10:44:41 +0100
committerJohn Wiegley <johnw@newartisans.com>2019-12-05 15:06:44 +0100
commite1bba5d977a8b9385e9ffdb05861833485003d23 (patch)
tree40876bb3d289ced0fd871e94cc9e79c9e934327b /test/regress/78AB4B87.py
parente264eb618b8eabf9670084f40687af916a63567e (diff)
downloadfork-ledger-e1bba5d977a8b9385e9ffdb05861833485003d23.tar.gz
fork-ledger-e1bba5d977a8b9385e9ffdb05861833485003d23.tar.bz2
fork-ledger-e1bba5d977a8b9385e9ffdb05861833485003d23.zip
Make tests scripts Python 3 compatible
Diffstat (limited to 'test/regress/78AB4B87.py')
-rw-r--r--test/regress/78AB4B87.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/test/regress/78AB4B87.py b/test/regress/78AB4B87.py
index fed95b54..affc3496 100644
--- a/test/regress/78AB4B87.py
+++ b/test/regress/78AB4B87.py
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
import ledger
eur = ledger.commodities.find_or_create('EUR')
@@ -7,8 +9,8 @@ total_gbp = ledger.Amount("0.00 GBP")
total = ledger.Amount("0.00 EUR")
for post in ledger.read_journal("test/regress/78AB4B87.dat").query("^income:"):
- print post.amount
- print post.amount.commodity
+ print(post.amount)
+ print(post.amount.commodity)
if post.amount.commodity == "EUR":
total_eur += post.amount
elif post.amount.commodity == "GBP":
@@ -16,12 +18,12 @@ for post in ledger.read_journal("test/regress/78AB4B87.dat").query("^income:"):
a = post.amount.value(eur)
if a:
- print "Total is presently: (%s)" % total
- print "Converted to EUR: (%s)" % a
+ print("Total is presently: (%s)" % total)
+ print("Converted to EUR: (%s)" % a)
total += a
- print "Total is now: (%s)" % total
+ print("Total is now: (%s)" % total)
else:
- print "Cannot convert '%s'" % post.amount
- print
+ print("Cannot convert '%s'" % post.amount)
+ print()
-print total
+print(total)