Aaron1011 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/97876
Change subject: Fixed print statements
......................................................................
Fixed print statements
Change-Id: Ia0edaf1b30b27d424d2b3fc2fd0fd827947dd72d
---
M pywikibot/config2.py
M pywikibot/date.py
M pywikibot/pagegenerators.py
M pywikibot/textlib.py
M pywikibot/userinterfaces/terminal_interface_base.py
M pywikibot/userinterfaces/win32_unicode.py
M scripts/i18n
7 files changed, 23 insertions(+), 23 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/76/97876/1
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index c758295..399fb42 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -674,11 +674,11 @@
if __sys.platform == 'win32' or _filemode & 002 == 0 or True:
execfile(_filename)
else:
- print "WARNING: Skipped '%(fn)s': writeable by others." \
- % {'fn': _filename}
+ print("WARNING: Skipped '%(fn)s': writeable by others." \
+ % {'fn': _filename})
else:
- print "WARNING: Skipped '%(fn)s': owned by someone else." \
- % {'fn': _filename}
+ print("WARNING: Skipped '%(fn)s': owned by someone else." \
+ % {'fn': _filename})
# Test for obsoleted and/or unknown variables.
for _key, _val in globals().items():
@@ -696,14 +696,14 @@
elif ot is int and (nt is float or nt is bool):
pass
else:
- print "WARNING: Type of '%(_key)s' changed" % locals()
- print " %(was)s: %(old)s" % {'was': "Was", 'old': ot}
- print " %(now)s: %(new)s" % {'now': "Now", 'new': nt}
+ print("WARNING: Type of '%(_key)s' changed" % locals())
+ print(" %(was)s: %(old)s" % {'was': "Was", 'old': ot})
+ print(" %(now)s: %(new)s" % {'now': "Now", 'new': nt})
del nt, ot
else:
- print("WARNING: "
+ print(("WARNING: "
"Configuration variable %(_key)r is defined but unknown.\n"
- "Misspelled?" % locals())
+ "Misspelled?" % locals()))
# Fix up default console_encoding
if console_encoding is None:
@@ -739,7 +739,7 @@
if _arg == "modified":
_all = 0
else:
- print "Unknown arg %(_arg)s ignored" % locals()
+ print("Unknown arg %(_arg)s ignored" % locals())
_k = globals().keys()
_k.sort()
for _name in _k:
@@ -747,7 +747,7 @@
if not type(globals()[_name]) in [types.FunctionType,
types.ModuleType]:
if _all or _glv[_name] != globals()[_name]:
- print _name, "=", repr(globals()[_name])
+ print(_name, "=", repr(globals()[_name]))
# cleanup all locally-defined variables
for __var in globals().keys():
diff --git a/pywikibot/date.py b/pywikibot/date.py
index 4aaf983..948bfec 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -2349,8 +2349,8 @@
if value is not None:
start, stop = value, value + 1
if showAll:
- print(u"Processing %s with limits from %d to %d and step %d"
- % (formatName, start, stop - 1, step))
+ print((u"Processing %s with limits from %d to %d and step %d"
+ % (formatName, start, stop - 1, step)))
for code, convFunc in formats[formatName].iteritems():
## import time
@@ -2366,12 +2366,12 @@
" %s != %s: assert failed, values didn't match"
% (newValue, value))
if showAll:
- print(u"date.formats['%s']['%s'](%d): '%s' -> %d"
+ print((u"date.formats['%s']['%s'](%d): '%s' -> %d"
% (formatName, code, value, convFunc(value),
- newValue))
+ newValue)))
except:
- print(u"********** Error in date.formats['%s']['%s'](%d)"
- % (formatName, code, value))
+ print((u"********** Error in date.formats['%s']['%s'](%d)"
+ % (formatName, code, value)))
raise
## print(u"%s\t%s\t%f" % (formatName, code, time.clock() - startClock))
@@ -2393,7 +2393,7 @@
else:
# Extensive test! Test decade rounding
testMapEntry(formatName, showAll)
- print(u"'%s' complete." % formatName)
+ print((u"'%s' complete." % formatName))
if quick:
## print(u'Date module quick consistency test passed')
pass
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 1970294..02191a0 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -1222,7 +1222,7 @@
while True:
try:
namespaceNumber, pageName = cursor.fetchone()
- print namespaceNumber, pageName
+ print(namespaceNumber, pageName)
except TypeError:
# Limit reached or no more results
break
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index b4eb950..748abd0 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -231,8 +231,8 @@
match.group(groupID) + \
replacement[groupMatch.end():])
except IndexError:
- print '\nInvalid group reference:', groupID
- print 'Groups found:\n', match.groups()
+ print('\nInvalid group reference:', groupID)
+ print('Groups found:\n', match.groups())
raise IndexError
text = text[:match.start()] + replacement + text[match.end():]
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py
b/pywikibot/userinterfaces/terminal_interface_base.py
index b1fcbe1..894b598 100755
--- a/pywikibot/userinterfaces/terminal_interface_base.py
+++ b/pywikibot/userinterfaces/terminal_interface_base.py
@@ -238,7 +238,7 @@
try:
import gui
except ImportError, e:
- print 'Could not load GUI modules: %s' % e
+ print('Could not load GUI modules: %s' % e)
return text
editor = gui.EditBoxWindow()
return editor.edit(text, jumpIndex=jumpIndex, highlight=highlight)
diff --git a/pywikibot/userinterfaces/win32_unicode.py
b/pywikibot/userinterfaces/win32_unicode.py
index b06025a..97a611a 100755
--- a/pywikibot/userinterfaces/win32_unicode.py
+++ b/pywikibot/userinterfaces/win32_unicode.py
@@ -42,7 +42,7 @@
# So be paranoid about catching errors and reporting them to
original_stderr,
# so that we can at least see them.
def _complain(message):
- print >>original_stderr, isinstance(message, str) and message or
repr(message)
+ print(isinstance(message, str) and message or repr(message),
file=original_stderr)
# Work around <http://bugs.python.org/issue6058>.
codecs.register(lambda name: name == 'cp65001' and codecs.lookup('utf-8')
or None)
diff --git a/scripts/i18n b/scripts/i18n
index e8ee2a4..984576b 160000
--- a/scripts/i18n
+++ b/scripts/i18n
-Subproject commit e8ee2a4a5bd135d9a93a4a3678525323c08924c1
+Subproject commit 984576bdf2f92bcf760dccd9a32b4c98f9605b5c
--
To view, visit https://gerrit.wikimedia.org/r/97876
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0edaf1b30b27d424d2b3fc2fd0fd827947dd72d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Aaron1011 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits