Use print function instead of print statement

svn: r15271
This commit is contained in:
Gerald Britton 2010-04-22 19:41:48 +00:00
parent 5a7c72338f
commit 8cecd15dab
3 changed files with 12 additions and 17 deletions

View File

@ -26,6 +26,8 @@
#
#------------------------------------------------------------------------
from __future__ import print_function
"""
HTML operations.
@ -95,18 +97,6 @@ _START_CLOSE = set([
'param'
])
#------------------------------------------------------------------------
#
# Helper functions.
#
#------------------------------------------------------------------------
def print_(line):
"""
Print function
"""
print line
#------------------------------------------------------------------------
#
# Html class.
@ -383,7 +373,7 @@ class Html(list):
#
iterkeys = itervalues = iteritems = __iter__
#
def write(self, method=print_, indent='\t', tabs=''):
def write(self, method=print, indent='\t', tabs=''):
"""
Output function: performs an insertion-order tree traversal
and calls supplied method for each item found.

View File

@ -37,6 +37,8 @@ Narrative Web Page generator.
# python modules
#
#------------------------------------------------------------------------
from __future__ print_function
from functools import partial
import gc
import os
import sys
@ -1861,7 +1863,7 @@ class BasePage(object):
src/plugins/lib/libhtml.py
"""
htmlinstance.write(lambda line: of.write(line + '\n'))
htmlinstance.write(partial(print, file=of))
# closes the file
self.report.close_file(of)
@ -5640,8 +5642,8 @@ class NavWebReport(Report):
try:
shutil.copyfile(from_fname, dest)
except:
print "Copying error: %s" % sys.exc_info()[1]
print "Continuing..."
print("Copying error: %s" % sys.exc_info()[1])
print("Continuing...")
elif self.warn_dir:
WarningDialog(
_("Possible destination error") + "\n" +

View File

@ -27,9 +27,12 @@
"""
Web Calendar generator.
"""
#------------------------------------------------------------------------
# python modules
#------------------------------------------------------------------------
from __future__ import print_function
from functools import partial
import os, codecs, shutil, re
import datetime, calendar
from gen.ggettext import sgettext as _
@ -1241,7 +1244,7 @@ class WebCalReport(Report):
"""
# writes the file out from the page variable; Html instance
page.write(lambda line: of.write(line + '\n'))
page.write(partial(print, file=of.write))
# close the file now...
self.close_file(of)