OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 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 script around Rietveld's upload.py that simplifies working with groups | 7 Wrapper script around Rietveld's upload.py that simplifies working with groups |
8 of files. | 8 of files. |
9 """ | 9 """ |
10 | 10 |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 os.mkdir(GetCacheDir()) | 1322 os.mkdir(GetCacheDir()) |
1323 | 1323 |
1324 if command: | 1324 if command: |
1325 return command(argv[1:]) | 1325 return command(argv[1:]) |
1326 # Unknown command, try to pass that to svn | 1326 # Unknown command, try to pass that to svn |
1327 return CMDpassthru(argv) | 1327 return CMDpassthru(argv) |
1328 except gclient_utils.Error, e: | 1328 except gclient_utils.Error, e: |
1329 print >> sys.stderr, 'Got an exception' | 1329 print >> sys.stderr, 'Got an exception' |
1330 print >> sys.stderr, str(e) | 1330 print >> sys.stderr, str(e) |
1331 return 1 | 1331 return 1 |
| 1332 except upload.ClientLoginError, e: |
| 1333 print >> sys.stderr, 'Got an exception logging in to Rietveld' |
| 1334 print >> sys.stderr, str(e) |
1332 except urllib2.HTTPError, e: | 1335 except urllib2.HTTPError, e: |
1333 if e.code != 500: | 1336 if e.code != 500: |
1334 raise | 1337 raise |
1335 print >> sys.stderr, ( | 1338 print >> sys.stderr, ( |
1336 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1339 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
1337 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1340 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
1338 return 1 | 1341 return 1 |
1339 | 1342 |
1340 | 1343 |
1341 if __name__ == "__main__": | 1344 if __name__ == "__main__": |
1342 sys.exit(main(sys.argv[1:])) | 1345 sys.exit(main(sys.argv[1:])) |
OLD | NEW |