diff options
| author | xmo-odoo <xmo@odoo.com> | 2017-04-25 13:27:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-25 13:27:54 +0200 |
| commit | 6b9268bd15f8db22855d91849749b879f2d553a1 (patch) | |
| tree | a14ed2a0ff1b4eafb0f94b0dfafcea34187499bf /odoo/cli/command.py | |
| parent | 3cbca4b7348b60eb6cfe3f423983d53dada67862 (diff) | |
[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
Diffstat (limited to 'odoo/cli/command.py')
| -rw-r--r-- | odoo/cli/command.py | 7 |
1 files changed, 4 insertions, 3 deletions
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 <command> --help' for individual command help." % sys.argv[0].split(os.path.sep)[-1] + print(" %s%s" % (name, doc)) + print("\nUse '%s <command> --help' for individual command help." % sys.argv[0].split(os.path.sep)[-1]) def main(): args = sys.argv[1:] |
