OLD | NEW |
1 # Copyright 2013 The LUCI Authors. All rights reserved. | 1 # Copyright 2013 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 import collections | 5 import collections |
6 | 6 |
| 7 from recipe_engine.config import List |
7 from recipe_engine.config import (config_item_context, ConfigGroup, ConfigList, | 8 from recipe_engine.config import (config_item_context, ConfigGroup, ConfigList, |
8 Dict, Single, Set, List) | 9 Dict, Single, Set) |
9 from recipe_engine.config_types import Path | 10 from recipe_engine.config_types import Path |
10 from recipe_engine.util import Placeholder | 11 from recipe_engine.util import Placeholder |
11 | 12 |
12 | 13 |
13 def BaseConfig(**_kwargs): | 14 def BaseConfig(**_kwargs): |
14 def render_cmd(lst): | 15 def render_cmd(lst): |
15 return [(x if isinstance(x, Placeholder) else str(x)) for x in lst] | 16 return [(x if isinstance(x, Placeholder) else str(x)) for x in lst] |
16 | 17 |
17 return ConfigGroup( | 18 return ConfigGroup( |
18 # For compatibility with buildbot, the step name must be ascii, which is why | 19 # For compatibility with buildbot, the step name must be ascii, which is why |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 step_nest_level = Single(int, required=False), | 51 step_nest_level = Single(int, required=False), |
51 ) | 52 ) |
52 | 53 |
53 | 54 |
54 config_ctx = config_item_context(BaseConfig) | 55 config_ctx = config_item_context(BaseConfig) |
55 | 56 |
56 @config_ctx() | 57 @config_ctx() |
57 def test(c): # pragma: no cover | 58 def test(c): # pragma: no cover |
58 c.name = 'test' | 59 c.name = 'test' |
59 c.cmd = [Path('[CHECKOUT]', 'build', 'tools', 'cool_script.py')] | 60 c.cmd = [Path('[CHECKOUT]', 'build', 'tools', 'cool_script.py')] |
OLD | NEW |