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 """\ | 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 """Adds a comment for an issue on Rietveld. | 396 """Adds a comment for an issue on Rietveld. |
397 As a side effect, this will email everyone associated with the issue.""" | 397 As a side effect, this will email everyone associated with the issue.""" |
398 return self.RpcServer().add_comment(self.issue, comment) | 398 return self.RpcServer().add_comment(self.issue, comment) |
399 | 399 |
400 def PrimeLint(self): | 400 def PrimeLint(self): |
401 """Do background work on Rietveld to lint the file so that the results are | 401 """Do background work on Rietveld to lint the file so that the results are |
402 ready when the issue is viewed.""" | 402 ready when the issue is viewed.""" |
403 if self.issue and self.patchset: | 403 if self.issue and self.patchset: |
404 try: | 404 try: |
405 self.SendToRietveld('/lint/issue%s_%s' % (self.issue, self.patchset), | 405 self.SendToRietveld('/lint/issue%s_%s' % (self.issue, self.patchset), |
406 timeout=10) | 406 timeout=60) |
407 except ssl.SSLError as e: | 407 except ssl.SSLError as e: |
408 # It takes more than 10 seconds to lint some CLs. Silently ignore | 408 # It takes more than 60 seconds to lint some CLs. Silently ignore |
409 # the expected timeout. | 409 # the expected timeout. |
410 if e.message != 'The read operation timed out': | 410 if e.message != 'The read operation timed out': |
411 raise | 411 raise |
412 | 412 |
413 def SendToRietveld(self, request_path, timeout=None, **kwargs): | 413 def SendToRietveld(self, request_path, timeout=None, **kwargs): |
414 """Send a POST/GET to Rietveld. Returns the response body.""" | 414 """Send a POST/GET to Rietveld. Returns the response body.""" |
415 try: | 415 try: |
416 return self.RpcServer().Send(request_path, timeout=timeout, **kwargs) | 416 return self.RpcServer().Send(request_path, timeout=timeout, **kwargs) |
417 except urllib2.URLError: | 417 except urllib2.URLError: |
418 if timeout is None: | 418 if timeout is None: |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 raise | 1496 raise |
1497 print >> sys.stderr, ( | 1497 print >> sys.stderr, ( |
1498 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1498 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
1499 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1499 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
1500 return 1 | 1500 return 1 |
1501 | 1501 |
1502 | 1502 |
1503 if __name__ == "__main__": | 1503 if __name__ == "__main__": |
1504 fix_encoding.fix_encoding() | 1504 fix_encoding.fix_encoding() |
1505 sys.exit(main(sys.argv[1:])) | 1505 sys.exit(main(sys.argv[1:])) |
OLD | NEW |