Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: third_party/logilab/common/cli.py

Issue 753543006: pylint: upgrade to 1.4.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/logilab/common/__pkginfo__.py ('k') | third_party/logilab/common/configuration.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/logilab/common/cli.py
diff --git a/third_party/logilab/common/cli.py b/third_party/logilab/common/cli.py
index 0ad4e4c3f6aa5509621be12a5f0baeb5a9df4da5..cdeef974f482eb8258625ed9b82db307dc24a677 100644
--- a/third_party/logilab/common/cli.py
+++ b/third_party/logilab/common/cli.py
@@ -33,15 +33,17 @@ Example::
help_do_pionce = ("pionce", "pionce duree", _("met ton corps en veille"))
def do_pionce(self):
- print 'nap is good'
+ print('nap is good')
help_do_ronfle = ("ronfle", "ronfle volume", _("met les autres en veille"))
def do_ronfle(self):
- print 'fuuuuuuuuuuuu rhhhhhrhrhrrh'
+ print('fuuuuuuuuuuuu rhhhhhrhrhrrh')
cl = BookShell()
"""
+from __future__ import print_function
+
__docformat__ = "restructuredtext en"
from six.moves import builtins, input
@@ -66,7 +68,7 @@ def init_readline(complete_method, histfile=None):
import atexit
atexit.register(readline.write_history_file, histfile)
except:
- print 'readline is not available :-('
+ print('readline is not available :-(')
class Completer :
@@ -157,10 +159,10 @@ class CLIHelper:
return self.commands.keys()
def _print_help(self, cmd, syntax, explanation):
- print _('Command %s') % cmd
- print _('Syntax: %s') % syntax
- print '\t', explanation
- print
+ print(_('Command %s') % cmd)
+ print(_('Syntax: %s') % syntax)
+ print('\t', explanation)
+ print()
# predefined commands #####################################################
@@ -170,20 +172,20 @@ class CLIHelper:
if command in self._command_help:
self._print_help(*self._command_help[command])
elif command is None or command not in self._topics:
- print _("Use help <topic> or help <command>.")
- print _("Available topics are:")
+ print(_("Use help <topic> or help <command>."))
+ print(_("Available topics are:"))
topics = sorted(self._topics.keys())
for topic in topics:
- print '\t', topic
- print
- print _("Available commands are:")
+ print('\t', topic)
+ print()
+ print(_("Available commands are:"))
commands = self.commands.keys()
commands.sort()
for command in commands:
- print '\t', command[len(self.CMD_PREFIX):]
+ print('\t', command[len(self.CMD_PREFIX):])
else:
- print _('Available commands about %s:') % command
+ print(_('Available commands about %s:') % command)
print
for command_help_method in self._topics[command]:
try:
@@ -194,8 +196,8 @@ class CLIHelper:
except:
import traceback
traceback.print_exc()
- print 'ERROR in help method %s'% (
- command_help_method.__name__)
+ print('ERROR in help method %s'% (
+ command_help_method.__name__))
help_do_help = ("help", "help [topic|command]",
_("print help message for the given topic/command or \
« no previous file with comments | « third_party/logilab/common/__pkginfo__.py ('k') | third_party/logilab/common/configuration.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698