OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Meta checkout manager supporting both Subversion and GIT.""" | 6 """Meta checkout manager supporting both Subversion and GIT.""" |
7 # Files | 7 # Files |
8 # .gclient : Current client configuration, written by 'config' command. | 8 # .gclient : Current client configuration, written by 'config' command. |
9 # Format is a Python script defining 'solutions', a list whose | 9 # Format is a Python script defining 'solutions', a list whose |
10 # entries each are maps binding the strings "name" and "url" | 10 # entries each are maps binding the strings "name" and "url" |
(...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2296 sys.version.split(' ', 1)[0], | 2296 sys.version.split(' ', 1)[0], |
2297 file=sys.stderr) | 2297 file=sys.stderr) |
2298 return 2 | 2298 return 2 |
2299 if not sys.executable: | 2299 if not sys.executable: |
2300 print( | 2300 print( |
2301 '\nPython cannot find the location of it\'s own executable.\n', | 2301 '\nPython cannot find the location of it\'s own executable.\n', |
2302 file=sys.stderr) | 2302 file=sys.stderr) |
2303 return 2 | 2303 return 2 |
2304 fix_encoding.fix_encoding() | 2304 fix_encoding.fix_encoding() |
2305 disable_buffering() | 2305 disable_buffering() |
2306 colorama.init() | 2306 colorama.init(wrap="TERM" not in os.environ) |
2307 dispatcher = subcommand.CommandDispatcher(__name__) | 2307 dispatcher = subcommand.CommandDispatcher(__name__) |
2308 try: | 2308 try: |
2309 return dispatcher.execute(OptionParser(), argv) | 2309 return dispatcher.execute(OptionParser(), argv) |
2310 except KeyboardInterrupt: | 2310 except KeyboardInterrupt: |
2311 gclient_utils.GClientChildren.KillAllRemainingChildren() | 2311 gclient_utils.GClientChildren.KillAllRemainingChildren() |
2312 raise | 2312 raise |
2313 except (gclient_utils.Error, subprocess2.CalledProcessError) as e: | 2313 except (gclient_utils.Error, subprocess2.CalledProcessError) as e: |
2314 print('Error: %s' % str(e), file=sys.stderr) | 2314 print('Error: %s' % str(e), file=sys.stderr) |
2315 return 1 | 2315 return 1 |
2316 finally: | 2316 finally: |
2317 gclient_utils.PrintWarnings() | 2317 gclient_utils.PrintWarnings() |
2318 return 0 | 2318 return 0 |
2319 | 2319 |
2320 | 2320 |
2321 if '__main__' == __name__: | 2321 if '__main__' == __name__: |
2322 try: | 2322 try: |
2323 sys.exit(main(sys.argv[1:])) | 2323 sys.exit(main(sys.argv[1:])) |
2324 except KeyboardInterrupt: | 2324 except KeyboardInterrupt: |
2325 sys.stderr.write('interrupted\n') | 2325 sys.stderr.write('interrupted\n') |
2326 sys.exit(1) | 2326 sys.exit(1) |
2327 | 2327 |
2328 # vim: ts=2:sw=2:tw=80:et: | 2328 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |