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

Side by Side Diff: support/chromite_wrapper

Issue 14746006: chromite_wrapper: Fix up comment. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 7 years, 7 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) 2011 The Chromium OS Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium OS 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 """Wrapper for chromite tools. 6 """Wrapper for chromite tools.
7 7
8 The script is intend to be symlinked to any number of chromite tools, attempts 8 The script is intend to be symlinked to any number of chromite tools, attempts
9 to find the path for chromite, and hands off to the right tool via exec if 9 to find the path for chromite, and hands off to the right tool via exec if
10 possible. 10 possible.
(...skipping 12 matching lines...) Expand all
23 import os 23 import os
24 import sys 24 import sys
25 25
26 # Due to historical reasons, and the fact depot_tools ToT is used by older 26 # Due to historical reasons, and the fact depot_tools ToT is used by older
27 # factory branches (lacking chromite script cleanups), note we have to 27 # factory branches (lacking chromite script cleanups), note we have to
28 # fallback to some odd import locations. This is the only reason for the 28 # fallback to some odd import locations. This is the only reason for the
29 # fallback code- any/all new scripts symlinked to this script *must* exist 29 # fallback code- any/all new scripts symlinked to this script *must* exist
30 # in chromite/bin/ . 30 # in chromite/bin/ .
31 31
32 def _FindChromite(path): 32 def _FindChromite(path):
33 """Find the chromite dir in a repo or gclient checkout.""" 33 """Find the chromite dir in a repo, gclient, or submodule checkout."""
34 path = os.path.abspath(path) 34 path = os.path.abspath(path)
35 # Depending on the checkout type (whether repo chromeos or gclient chrome) 35 # Depending on the checkout type (whether repo chromeos or gclient chrome)
36 # Chromite lives in a different location. 36 # Chromite lives in a different location.
37 roots = ( 37 roots = (
38 ('.repo', 'chromite/.git'), 38 ('.repo', 'chromite/.git'),
39 ('.gclient', 'src/third_party/chromite/.git'), 39 ('.gclient', 'src/third_party/chromite/.git'),
40 ('src/.gitmodules', 'src/third_party/chromite/.git'), 40 ('src/.gitmodules', 'src/third_party/chromite/.git'),
41 ) 41 )
42 42
43 while path != '/': 43 while path != '/':
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 sys.path.insert(0, os.path.dirname(chromite_dir)) 87 sys.path.insert(0, os.path.dirname(chromite_dir))
88 88
89 try: 89 try:
90 module = __import__(target, fromlist=['main']) 90 module = __import__(target, fromlist=['main'])
91 except ImportError: 91 except ImportError:
92 return _MissingErrorOut(target) 92 return _MissingErrorOut(target)
93 return module.main() 93 return module.main()
94 94
95 if __name__ == '__main__': 95 if __name__ == '__main__':
96 sys.exit(main()) 96 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