| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 import argparse | 6 import argparse |
| 7 import re | 7 import re |
| 8 import sys | 8 import sys |
| 9 import urllib2 | 9 import urllib2 |
| 10 | 10 |
| 11 | 11 |
| 12 _BUILD_REGEX = r'builds/(\d+)' | 12 _BUILD_REGEX = r'builds/(\d+)' |
| 13 _REVISION_REGEX = r'Cr-Commit-Position: refs/heads/master@{#(\d+)}' | 13 _REVISION_REGEX = r'\nCr-Commit-Position: refs/heads/master@{#(\d+)}' |
| 14 | 14 |
| 15 | 15 |
| 16 class _Color(object): | 16 class _Color(object): |
| 17 HEADER = '\033[95m' | 17 HEADER = '\033[95m' |
| 18 OKBLUE = '\033[94m' | 18 OKBLUE = '\033[94m' |
| 19 OKGREEN = '\033[92m' | 19 OKGREEN = '\033[92m' |
| 20 WARNING = '\033[93m' | 20 WARNING = '\033[93m' |
| 21 FAIL = '\033[91m' | 21 FAIL = '\033[91m' |
| 22 ENDC = '\033[0m' | 22 ENDC = '\033[0m' |
| 23 BOLD = '\033[1m' | 23 BOLD = '\033[1m' |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 (min(first_failure_revisions), max(first_failure_revisions)), | 96 (min(first_failure_revisions), max(first_failure_revisions)), |
| 97 len(set(first_failure_revisions))), | 97 len(set(first_failure_revisions))), |
| 98 _Color.BOLD, _Color.OKGREEN) | 98 _Color.BOLD, _Color.OKGREEN) |
| 99 _PrintWithColor('First failed build: %s' % first_failed_build, | 99 _PrintWithColor('First failed build: %s' % first_failed_build, |
| 100 _Color.BOLD, _Color.OKGREEN) | 100 _Color.BOLD, _Color.OKGREEN) |
| 101 return 0 | 101 return 0 |
| 102 | 102 |
| 103 | 103 |
| 104 if __name__ == '__main__': | 104 if __name__ == '__main__': |
| 105 sys.exit(Main(sys.argv[1:])) | 105 sys.exit(Main(sys.argv[1:])) |
| OLD | NEW |