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

Side by Side Diff: cit.py

Issue 1682293002: Sort the list of tools shown by cit.py's help message (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 6
7 """Wrapper for updating and calling infra.git tools. 7 """Wrapper for updating and calling infra.git tools.
8 8
9 This tool does a two things: 9 This tool does a two things:
10 * Maintains a infra.git checkout pinned at "deployed" in the home dir 10 * Maintains a infra.git checkout pinned at "deployed" in the home dir
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 cwd=TARGET_DIR, 70 cwd=TARGET_DIR,
71 stdout=subprocess.PIPE) 71 stdout=subprocess.PIPE)
72 72
73 73
74 def get_available_tools(): 74 def get_available_tools():
75 tools = [] 75 tools = []
76 starting = os.path.join(TARGET_DIR, 'infra', 'infra', 'tools') 76 starting = os.path.join(TARGET_DIR, 'infra', 'infra', 'tools')
77 for root, _, files in os.walk(starting): 77 for root, _, files in os.walk(starting):
78 if '__main__.py' in files: 78 if '__main__.py' in files:
79 tools.append(root[len(starting)+1:].replace(os.path.sep, '.')) 79 tools.append(root[len(starting)+1:].replace(os.path.sep, '.'))
80 return tools 80 return sorted(tools)
81 81
82 82
83 def run(args): 83 def run(args):
84 if args: 84 if args:
85 tool_name = args[0] 85 tool_name = args[0]
86 cmd = [ 86 cmd = [
87 sys.executable, os.path.join(TARGET_DIR, 'infra', 'run.py'), 87 sys.executable, os.path.join(TARGET_DIR, 'infra', 'run.py'),
88 'infra.tools.%s' % tool_name] 88 'infra.tools.%s' % tool_name]
89 cmd.extend(args[1:]) 89 cmd.extend(args[1:])
90 return subprocess.call(cmd) 90 return subprocess.call(cmd)
(...skipping 20 matching lines...) Expand all
111 args.args.pop(0) 111 args.args.pop(0)
112 if extras: 112 if extras:
113 args.args = extras + args.args 113 args.args = extras + args.args
114 114
115 if need_to_update(args.infra_branch): 115 if need_to_update(args.infra_branch):
116 ensure_infra(args.infra_branch) 116 ensure_infra(args.infra_branch)
117 return run(args.args) 117 return run(args.args)
118 118
119 if __name__ == '__main__': 119 if __name__ == '__main__':
120 sys.exit(main()) 120 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698