Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """Contains generating and parsing systems of the Chromium Buildbot Annotator. | 6 """Contains generating and parsing systems of the Chromium Buildbot Annotator. |
| 7 | 7 |
| 8 When executed as a script, this reads step name / command pairs from a file and | 8 When executed as a script, this reads step name / command pairs from a file and |
| 9 executes those lines while annotating the output. The input is json: | 9 executes those lines while annotating the output. The input is json: |
| 10 | 10 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 374 def FilterLine(self, line): | 374 def FilterLine(self, line): |
| 375 return line.replace('@@@', '###') | 375 return line.replace('@@@', '###') |
| 376 filter_obj = AnnotationFilter() | 376 filter_obj = AnnotationFilter() |
| 377 | 377 |
| 378 ret = None | 378 ret = None |
| 379 try: | 379 try: |
| 380 with stream.step(name) as s: | 380 with stream.step(name) as s: |
| 381 ret = chromium_utils.RunCommand(command=map(str, cmd), | 381 ret = chromium_utils.RunCommand(command=map(str, cmd), |
| 382 cwd=cwd, | 382 cwd=cwd, |
| 383 env=_merge_envs(os.environ, env), | 383 env=_merge_envs(os.environ, env), |
| 384 filter_obj=filter_obj) | 384 filter_obj=filter_obj, |
| 385 pipes=step_dict.get('pipes')) | |
|
iannucci
2013/05/20 19:41:38
I think this is no longer necessary?
mkosiba (inactive)
2013/05/21 10:56:07
Done.
| |
| 385 if ret != 0: | 386 if ret != 0: |
| 386 print 'step returned non-zero exit code: %d' % ret | 387 print 'step returned non-zero exit code: %d' % ret |
| 387 print 'step was: %s' % json.dumps(step_dict) | 388 print 'step was: %s' % json.dumps(step_dict) |
| 388 s.step_failure() | 389 s.step_failure() |
| 389 build_failure = True | 390 build_failure = True |
| 390 except OSError: | 391 except OSError: |
| 391 # File wasn't found, error has been already reported to stream. | 392 # File wasn't found, error has been already reported to stream. |
| 392 build_failure = True | 393 build_failure = True |
| 393 | 394 |
| 394 return build_failure, ret | 395 return build_failure, ret |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 429 steps.extend(json.load(sys.stdin)) | 430 steps.extend(json.load(sys.stdin)) |
| 430 else: | 431 else: |
| 431 with open(args[0], 'rb') as f: | 432 with open(args[0], 'rb') as f: |
| 432 steps.extend(json.load(f)) | 433 steps.extend(json.load(f)) |
| 433 | 434 |
| 434 return 1 if run_steps(steps, False)[0] else 0 | 435 return 1 if run_steps(steps, False)[0] else 0 |
| 435 | 436 |
| 436 | 437 |
| 437 if __name__ == '__main__': | 438 if __name__ == '__main__': |
| 438 sys.exit(main()) | 439 sys.exit(main()) |
| OLD | NEW |