diff options
author | Sarah Owens <sarato@inkylabs.com> | 2012-11-01 22:59:27 -0700 |
---|---|---|
committer | Sarah Owens <sarato@inkylabs.com> | 2012-11-13 17:33:56 -0800 |
commit | cecd1d864fc3cf02cf50d367111e0d0e173c5dc6 (patch) | |
tree | b4f660400560dce21cd7a00ffe5a5d74b54bcb81 /subcmds/help.py | |
parent | fc241240d828d7e8302dc0876608a9d27ae1cbc7 (diff) | |
download | git-repo-cecd1d864fc3cf02cf50d367111e0d0e173c5dc6.tar.gz |
Change print statements to work in python3
This is part of a series of changes to introduce Python3 support.
Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
Diffstat (limited to 'subcmds/help.py')
-rw-r--r-- | subcmds/help.py | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/subcmds/help.py b/subcmds/help.py index 375d04d2..57fb3cc2 100644 --- a/subcmds/help.py +++ b/subcmds/help.py | |||
@@ -13,6 +13,7 @@ | |||
13 | # See the License for the specific language governing permissions and | 13 | # See the License for the specific language governing permissions and |
14 | # limitations under the License. | 14 | # limitations under the License. |
15 | 15 | ||
16 | from __future__ import print_function | ||
16 | import re | 17 | import re |
17 | import sys | 18 | import sys |
18 | from formatter import AbstractFormatter, DumbWriter | 19 | from formatter import AbstractFormatter, DumbWriter |
@@ -31,10 +32,8 @@ Displays detailed usage information about a command. | |||
31 | """ | 32 | """ |
32 | 33 | ||
33 | def _PrintAllCommands(self): | 34 | def _PrintAllCommands(self): |
34 | print 'usage: repo COMMAND [ARGS]' | 35 | print('usage: repo COMMAND [ARGS]') |
35 | print """ | 36 | print('The complete list of recognized repo commands are:') |
36 | The complete list of recognized repo commands are: | ||
37 | """ | ||
38 | commandNames = self.commands.keys() | 37 | commandNames = self.commands.keys() |
39 | commandNames.sort() | 38 | commandNames.sort() |
40 | 39 | ||
@@ -49,17 +48,14 @@ The complete list of recognized repo commands are: | |||
49 | summary = command.helpSummary.strip() | 48 | summary = command.helpSummary.strip() |
50 | except AttributeError: | 49 | except AttributeError: |
51 | summary = '' | 50 | summary = '' |
52 | print fmt % (name, summary) | 51 | print(fmt % (name, summary)) |
53 | print """ | 52 | print("See 'repo help <command>' for more information on a" |
54 | See 'repo help <command>' for more information on a specific command. | 53 | 'specific command.') |
55 | """ | ||
56 | 54 | ||
57 | def _PrintCommonCommands(self): | 55 | def _PrintCommonCommands(self): |
58 | print 'usage: repo COMMAND [ARGS]' | 56 | print('usage: repo COMMAND [ARGS]') |
59 | print """ | 57 | print('The most commonly used repo commands are:') |
60 | The most commonly used repo commands are: | 58 | commandNames = [name |
61 | """ | ||
62 | commandNames = [name | ||
63 | for name in self.commands.keys() | 59 | for name in self.commands.keys() |
64 | if self.commands[name].common] | 60 | if self.commands[name].common] |
65 | commandNames.sort() | 61 | commandNames.sort() |
@@ -75,11 +71,10 @@ The most commonly used repo commands are: | |||
75 | summary = command.helpSummary.strip() | 71 | summary = command.helpSummary.strip() |
76 | except AttributeError: | 72 | except AttributeError: |
77 | summary = '' | 73 | summary = '' |
78 | print fmt % (name, summary) | 74 | print(fmt % (name, summary)) |
79 | print """ | 75 | print( |
80 | See 'repo help <command>' for more information on a specific command. | 76 | "See 'repo help <command>' for more information on a specific command.\n" |
81 | See 'repo help --all' for a complete list of recognized commands. | 77 | "See 'repo help --all' for a complete list of recognized commands.") |
82 | """ | ||
83 | 78 | ||
84 | def _PrintCommandHelp(self, cmd): | 79 | def _PrintCommandHelp(self, cmd): |
85 | class _Out(Coloring): | 80 | class _Out(Coloring): |
@@ -162,7 +157,7 @@ See 'repo help --all' for a complete list of recognized commands. | |||
162 | try: | 157 | try: |
163 | cmd = self.commands[name] | 158 | cmd = self.commands[name] |
164 | except KeyError: | 159 | except KeyError: |
165 | print >>sys.stderr, "repo: '%s' is not a repo command." % name | 160 | print("repo: '%s' is not a repo command." % name, file=sys.stderr) |
166 | sys.exit(1) | 161 | sys.exit(1) |
167 | 162 | ||
168 | cmd.manifest = self.manifest | 163 | cmd.manifest = self.manifest |