Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The LUCI Authors. All rights reserved. | 1 # Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 from __future__ import absolute_import | 5 from __future__ import absolute_import |
| 6 import contextlib | 6 import contextlib |
| 7 import keyword | 7 import keyword |
| 8 import re | 8 import re |
| 9 import types | 9 import types |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 len(self.result.failures), len(self.result.all_results)) | 111 len(self.result.failures), len(self.result.all_results)) |
| 112 msg += ', '.join((f.reason or f.name) for f in self.result.failures) | 112 msg += ', '.join((f.reason or f.name) for f in self.result.failures) |
| 113 return msg | 113 return msg |
| 114 | 114 |
| 115 def __str__(self): # pragma: no cover | 115 def __str__(self): # pragma: no cover |
| 116 return "Aggregate Step Failure" | 116 return "Aggregate Step Failure" |
| 117 | 117 |
| 118 | 118 |
| 119 _FUNCTION_REGISTRY = { | 119 _FUNCTION_REGISTRY = { |
| 120 'aggregated_result': {'combine': lambda a, b: b}, | 120 'aggregated_result': {'combine': lambda a, b: b}, |
| 121 'cwd': {'combine': lambda a, b: b}, | |
|
Sergiy Byelozyorov
2016/06/29 13:56:30
This would always return value passed second and n
Paweł Hajdan Jr.
2016/06/29 13:57:57
See other entries here which already do this. The
Sergiy Byelozyorov
2016/06/29 14:00:10
But the point is that it doesn't... it just return
Paweł Hajdan Jr.
2016/06/29 14:14:31
While I have to provide a combine function here, I
| |
| 121 'env': {'combine': lambda a, b: dict(a, **b)}, | 122 'env': {'combine': lambda a, b: dict(a, **b)}, |
| 122 'name': {'combine': lambda a, b: '%s.%s' % (a, b)}, | 123 'name': {'combine': lambda a, b: '%s.%s' % (a, b)}, |
| 123 'nest_level': {'combine': lambda a, b: a + b}, | 124 'nest_level': {'combine': lambda a, b: a + b}, |
| 124 'ran_step': {'combine': lambda a, b: b}, | 125 'ran_step': {'combine': lambda a, b: b}, |
| 125 } | 126 } |
| 126 | 127 |
| 127 | 128 |
| 128 class AggregatedResult(object): | 129 class AggregatedResult(object): |
| 129 """Holds the result of an aggregated run of steps. | 130 """Holds the result of an aggregated run of steps. |
| 130 | 131 |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 662 """ | 663 """ |
| 663 Gets the BoundProperty version of this Property. Requires a name. | 664 Gets the BoundProperty version of this Property. Requires a name. |
| 664 """ | 665 """ |
| 665 return BoundProperty( | 666 return BoundProperty( |
| 666 self._default, self.help, self.kind, name, property_type, module, | 667 self._default, self.help, self.kind, name, property_type, module, |
| 667 self.param_name) | 668 self.param_name) |
| 668 | 669 |
| 669 class UndefinedPropertyException(TypeError): | 670 class UndefinedPropertyException(TypeError): |
| 670 pass | 671 pass |
| 671 | 672 |
| OLD | NEW |