From 6b9268bd15f8db22855d91849749b879f2d553a1 Mon Sep 17 00:00:00 2001 From: xmo-odoo Date: Tue, 25 Apr 2017 13:27:54 +0200 Subject: [FIX] print statement -> function In Python 3, ``print`` becomes a builtin function. This is available in Python 2 by importing the ``print_function`` feature from ``__future__``, the feature is conveniently still available in Python 3 (it just does nothing). Fixers: libfuturize.fixes.fix_print_with_import #8530 --- odoo/cli/command.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'odoo/cli/command.py') diff --git a/odoo/cli/command.py b/odoo/cli/command.py index 75aa392fdfb..2ab042f58e8 100644 --- a/odoo/cli/command.py +++ b/odoo/cli/command.py @@ -1,3 +1,4 @@ +from __future__ import print_function import logging import sys import os @@ -26,14 +27,14 @@ class Command(object): class Help(Command): """Display the list of available commands""" def run(self, args): - print "Available commands:\n" + print("Available commands:\n") names = commands.keys() padding = max([len(k) for k in names]) + 2 for k in sorted(names): name = k.ljust(padding, ' ') doc = (commands[k].__doc__ or '').strip() - print " %s%s" % (name, doc) - print "\nUse '%s --help' for individual command help." % sys.argv[0].split(os.path.sep)[-1] + print(" %s%s" % (name, doc)) + print("\nUse '%s --help' for individual command help." % sys.argv[0].split(os.path.sep)[-1]) def main(): args = sys.argv[1:] -- cgit v1.2.3