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 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 6 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
7 | 7 |
8 """A git-command for integrating reviews on Rietveld.""" | 8 """A git-command for integrating reviews on Rietveld.""" |
9 | 9 |
10 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
(...skipping 3053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3064 colorize_CMDstatus_doc() | 3064 colorize_CMDstatus_doc() |
3065 dispatcher = subcommand.CommandDispatcher(__name__) | 3065 dispatcher = subcommand.CommandDispatcher(__name__) |
3066 try: | 3066 try: |
3067 return dispatcher.execute(OptionParser(), argv) | 3067 return dispatcher.execute(OptionParser(), argv) |
3068 except urllib2.HTTPError, e: | 3068 except urllib2.HTTPError, e: |
3069 if e.code != 500: | 3069 if e.code != 500: |
3070 raise | 3070 raise |
3071 DieWithError( | 3071 DieWithError( |
3072 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 3072 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
3073 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 3073 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 3074 return 0 |
3074 | 3075 |
3075 | 3076 |
3076 if __name__ == '__main__': | 3077 if __name__ == '__main__': |
3077 # These affect sys.stdout so do it outside of main() to simplify mocks in | 3078 # These affect sys.stdout so do it outside of main() to simplify mocks in |
3078 # unit testing. | 3079 # unit testing. |
3079 fix_encoding.fix_encoding() | 3080 fix_encoding.fix_encoding() |
3080 colorama.init() | 3081 colorama.init() |
3081 sys.exit(main(sys.argv[1:])) | 3082 try: |
| 3083 sys.exit(main(sys.argv[1:])) |
| 3084 except KeyboardInterrupt: |
| 3085 sys.stderr.write('interrupted\n') |
| 3086 sys.exit(1) |
OLD | NEW |