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 """Front end tool to operate on .isolate files. | 6 """Front end tool to operate on .isolate files. |
7 | 7 |
8 This includes creating, merging or compiling them to generate a .isolated file. | 8 This includes creating, merging or compiling them to generate a .isolated file. |
9 | 9 |
10 See more information at | 10 See more information at |
(...skipping 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2444 | 2444 |
2445 return options, args | 2445 return options, args |
2446 | 2446 |
2447 | 2447 |
2448 def main(argv): | 2448 def main(argv): |
2449 dispatcher = subcommand.CommandDispatcher(__name__) | 2449 dispatcher = subcommand.CommandDispatcher(__name__) |
2450 try: | 2450 try: |
2451 return dispatcher.execute(OptionParserIsolate(version=__version__), argv) | 2451 return dispatcher.execute(OptionParserIsolate(version=__version__), argv) |
2452 except ( | 2452 except ( |
2453 ExecutionError, | 2453 ExecutionError, |
2454 IOError, | |
2454 isolateserver.ConfigError, | 2455 isolateserver.ConfigError, |
2455 isolateserver.MappingError) as e: | 2456 isolateserver.MappingError) as e: |
2456 sys.stderr.write('\nError: ') | 2457 tools.report_error(str(e), include_traceback=True) |
M-A Ruel
2013/10/29 22:42:50
You may want to handle anything then? E.g. "except
| |
2457 sys.stderr.write(str(e)) | |
2458 sys.stderr.write('\n') | |
2459 return 1 | 2458 return 1 |
2460 | 2459 |
2461 | 2460 |
2462 if __name__ == '__main__': | 2461 if __name__ == '__main__': |
2463 fix_encoding.fix_encoding() | 2462 fix_encoding.fix_encoding() |
2464 tools.disable_buffering() | 2463 tools.disable_buffering() |
2465 colorama.init() | 2464 colorama.init() |
2466 sys.exit(main(sys.argv[1:])) | 2465 sys.exit(main(sys.argv[1:])) |
OLD | NEW |