Use the print function everywhere

python modernize.py --no-six -f libmodernize.fixes.fix_print -w

With manual fixes as the import was put always on top.
This commit is contained in:
Laurent Bachelier 2014-10-06 14:23:20 +02:00
commit 74a4ef6723
73 changed files with 499 additions and 442 deletions

View file

@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
# vim: ft=python et softtabstop=4 cinoptions=4 shiftwidth=4 ts=4 ai
from .comparoob import Comparoob

View file

@ -17,9 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
from weboob.capabilities.pricecomparison import CapPriceComparison
from weboob.tools.html import html2text
@ -108,18 +106,18 @@ class Comparoob(ReplApplication):
product = None
if len(products) == 0:
print >>self.stderr, 'Error: no product found with this pattern'
print('Error: no product found with this pattern', file=self.stderr)
return 1
elif len(products) == 1:
product = products[0]
else:
print 'What product do you want to compare?'
print('What product do you want to compare?')
for i, p in enumerate(products):
print ' %s%2d)%s %s' % (self.BOLD, i+1, self.NC, p.name)
print(' %s%2d)%s %s' % (self.BOLD, i+1, self.NC, p.name))
r = int(self.ask(' Select a product', regexp='\d+'))
while product is None:
if r <= 0 or r > len(products):
print 'Error: Please enter a valid ID'
print('Error: Please enter a valid ID')
continue
product = products[r-1]
@ -146,12 +144,12 @@ class Comparoob(ReplApplication):
Get information about a product.
"""
if not _id:
print >>self.stderr, 'This command takes an argument: %s' % self.get_command_help('info', short=True)
print('This command takes an argument: %s' % self.get_command_help('info', short=True), file=self.stderr)
return 2
price = self.get_object(_id, 'get_price')
if not price:
print >>self.stderr, 'Price not found: %s' % _id
print('Price not found: %s' % _id, file=self.stderr)
return 3
self.start_format()