diff options
author | Jason R. Coombs <jaraco@google.com> | 2023-09-29 11:04:49 -0400 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-10-31 16:03:54 +0000 |
commit | b32ccbb66bb16965ecb8b4e266c4e45186636c1b (patch) | |
tree | 1c1eda32af709f0cbf822de56f696ccd531ce6de /main.py | |
parent | b99272c601bc5f466c3cfc782bb852c2c967ad27 (diff) | |
download | git-repo-b32ccbb66bb16965ecb8b4e266c4e45186636c1b.tar.gz |
cleanup: Update codebase to expect Python 3.6
- Bump minimum version to Python 3.6.
- Use f-strings in a lot of places.
Change-Id: I2aa70197230fcec2eff8e7c8eb754f20c08075bb
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389034
Tested-by: Jason R. Coombs <jaraco@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Jason R. Coombs <jaraco@google.com>
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -198,9 +198,8 @@ class _Repo: | |||
198 | if short: | 198 | if short: |
199 | commands = " ".join(sorted(self.commands)) | 199 | commands = " ".join(sorted(self.commands)) |
200 | wrapped_commands = textwrap.wrap(commands, width=77) | 200 | wrapped_commands = textwrap.wrap(commands, width=77) |
201 | print( | 201 | help_commands = "".join(f"\n {x}" for x in wrapped_commands) |
202 | "Available commands:\n %s" % ("\n ".join(wrapped_commands),) | 202 | print(f"Available commands:{help_commands}") |
203 | ) | ||
204 | print("\nRun `repo help <command>` for command-specific details.") | 203 | print("\nRun `repo help <command>` for command-specific details.") |
205 | print("Bug reports:", Wrapper().BUG_URL) | 204 | print("Bug reports:", Wrapper().BUG_URL) |
206 | else: | 205 | else: |
@@ -236,7 +235,7 @@ class _Repo: | |||
236 | if name in self.commands: | 235 | if name in self.commands: |
237 | return name, [] | 236 | return name, [] |
238 | 237 | ||
239 | key = "alias.%s" % (name,) | 238 | key = f"alias.{name}" |
240 | alias = RepoConfig.ForRepository(self.repodir).GetString(key) | 239 | alias = RepoConfig.ForRepository(self.repodir).GetString(key) |
241 | if alias is None: | 240 | if alias is None: |
242 | alias = RepoConfig.ForUser().GetString(key) | 241 | alias = RepoConfig.ForUser().GetString(key) |