summaryrefslogtreecommitdiffstats
path: root/subcmds/gitc_delete.py
diff options
context:
space:
mode:
authorGavin Mak <gavinmak@google.com>2023-03-11 06:46:20 +0000
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-22 17:46:28 +0000
commitea2e330e43c182dc16b0111ebc69ee5a71ee4ce1 (patch)
treedc33ba0e56825b3e007d0589891756724725a465 /subcmds/gitc_delete.py
parent1604cf255f8c1786a23388db6d5277ac7949a24a (diff)
downloadgit-repo-ea2e330e43c182dc16b0111ebc69ee5a71ee4ce1.tar.gz
Format codebase with black and check formatting in CQ
Apply rules set by https://gerrit-review.googlesource.com/c/git-repo/+/362954/ across the codebase and fix any lingering errors caught by flake8. Also check black formatting in run_tests (and CQ). Bug: b/267675342 Change-Id: I972d77649dac351150dcfeb1cd1ad0ea2efc1956 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/363474 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'subcmds/gitc_delete.py')
-rw-r--r--subcmds/gitc_delete.py42
1 files changed, 24 insertions, 18 deletions
diff --git a/subcmds/gitc_delete.py b/subcmds/gitc_delete.py
index df749469..ae9d4d1f 100644
--- a/subcmds/gitc_delete.py
+++ b/subcmds/gitc_delete.py
@@ -19,28 +19,34 @@ import platform_utils
19 19
20 20
21class GitcDelete(Command, GitcClientCommand): 21class GitcDelete(Command, GitcClientCommand):
22 COMMON = True 22 COMMON = True
23 visible_everywhere = False 23 visible_everywhere = False
24 helpSummary = "Delete a GITC Client." 24 helpSummary = "Delete a GITC Client."
25 helpUsage = """ 25 helpUsage = """
26%prog 26%prog
27""" 27"""
28 helpDescription = """ 28 helpDescription = """
29This subcommand deletes the current GITC client, deleting the GITC manifest 29This subcommand deletes the current GITC client, deleting the GITC manifest
30and all locally downloaded sources. 30and all locally downloaded sources.
31""" 31"""
32 32
33 def _Options(self, p): 33 def _Options(self, p):
34 p.add_option('-f', '--force', 34 p.add_option(
35 dest='force', action='store_true', 35 "-f",
36 help='force the deletion (no prompt)') 36 "--force",
37 dest="force",
38 action="store_true",
39 help="force the deletion (no prompt)",
40 )
37 41
38 def Execute(self, opt, args): 42 def Execute(self, opt, args):
39 if not opt.force: 43 if not opt.force:
40 prompt = ('This will delete GITC client: %s\nAre you sure? (yes/no) ' % 44 prompt = (
41 self.gitc_manifest.gitc_client_name) 45 "This will delete GITC client: %s\nAre you sure? (yes/no) "
42 response = input(prompt).lower() 46 % self.gitc_manifest.gitc_client_name
43 if not response == 'yes': 47 )
44 print('Response was not "yes"\n Exiting...') 48 response = input(prompt).lower()
45 sys.exit(1) 49 if not response == "yes":
46 platform_utils.rmtree(self.gitc_manifest.gitc_client_dir) 50 print('Response was not "yes"\n Exiting...')
51 sys.exit(1)
52 platform_utils.rmtree(self.gitc_manifest.gitc_client_dir)