Skip to content

Commit

Permalink
Get rid of more print functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremysanders committed Aug 11, 2013
1 parent be10e2b commit b7b2e63
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion Documents/document_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Creates an xml file designed to be processed into a web page using xsl
"""

from __future__ import division, print_function
import re

import veusz.widgets as widgets
Expand Down Expand Up @@ -72,7 +73,7 @@ def processWidgetType(root, name):
widgetxml = ET.SubElement(root, "widget")

klass = document.thefactory.getWidgetClass(name)
print klass
print(klass)

ET.SubElement(widgetxml, "apiname").text = name

Expand Down
4 changes: 2 additions & 2 deletions examples/embedexample.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
time.sleep(2)

# let the user see the final result
print "Waiting for 10 seconds"
print("Waiting for 10 seconds")
time.sleep(10)
print "Done!"
print("Done!")

# close the window (this is not strictly necessary)
g.Close()
2 changes: 1 addition & 1 deletion examples/mandelbrot.vsz
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ size = 300
maxiters = 20
image = zeros( (size, size) )

print "This takes some time, please wait"
print("This takes some time, please wait")

minx = 100000
maxx = -100000
Expand Down
19 changes: 10 additions & 9 deletions tests/runselftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

# messes up loaded files if set
# from __future__ import division
from __future__ import print_function
import glob
import os
import os.path
Expand Down Expand Up @@ -137,25 +138,25 @@ def __init__(self):
def renderAllTests():
"""Check documents produce same output as in comparison directory."""

print "Regenerating all test output"
print("Regenerating all test output")

d = Dirs()
for vsz in d.invszfiles:
base = os.path.basename(vsz)
print base
print(base)
outfile = os.path.join(d.comparisondir, base + '.selftest')
renderTest(vsz, outfile)

def runTests():
print "Testing output"
print("Testing output")

fails = 0
passes = 0

d = Dirs()
for vsz in sorted(d.invszfiles):
base = os.path.basename(vsz)
print base
print(base)

outfile = os.path.join(d.thisdir, base + '.temp.selftest')
renderTest(vsz, outfile)
Expand All @@ -169,19 +170,19 @@ def runTests():
f2.close()

if not comp:
print " FAIL: results differed"
print(" FAIL: results differed")
fails += 1
else:
print " PASS"
print(" PASS")
passes += 1
os.unlink(outfile)

print
print()
if fails == 0:
print "All tests %i/%i PASSED" % (passes, passes)
print("All tests %i/%i PASSED" % (passes, passes))
sys.exit(0)
else:
print "%i/%i tests FAILED" % (fails, passes+fails)
print("%i/%i tests FAILED" % (fails, passes+fails))
sys.exit(fails)

oldflt = svg_export.fltStr
Expand Down

0 comments on commit b7b2e63

Please sign in to comment.