| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import collections | 5 import collections |
| 6 | 6 |
| 7 from slave.recipe_config import List | 7 from recipe_engine.config import List |
| 8 from slave.recipe_config import (config_item_context, ConfigGroup, ConfigList, | 8 from recipe_engine.config import (config_item_context, ConfigGroup, ConfigList, |
| 9 Dict, Single, Set) | 9 Dict, Single, Set) |
| 10 from slave.recipe_config_types import Path | 10 from recipe_engine.config_types import Path |
| 11 from slave.recipe_util import Placeholder | 11 from recipe_engine.util import Placeholder |
| 12 | 12 |
| 13 | 13 |
| 14 def BaseConfig(**_kwargs): | 14 def BaseConfig(**_kwargs): |
| 15 def render_cmd(lst): | 15 def render_cmd(lst): |
| 16 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] |
| 17 | 17 |
| 18 return ConfigGroup( | 18 return ConfigGroup( |
| 19 # 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 |
| 20 # this is a 'str' and not a 'basestring'. | 20 # this is a 'str' and not a 'basestring'. |
| 21 name = Single(str), | 21 name = Single(str), |
| (...skipping 26 matching lines...) Expand all Loading... |
| 48 infra_step = Single(bool, required=False) | 48 infra_step = Single(bool, required=False) |
| 49 ) | 49 ) |
| 50 | 50 |
| 51 | 51 |
| 52 config_ctx = config_item_context(BaseConfig, {'_DUMMY': ['val']}, 'example') | 52 config_ctx = config_item_context(BaseConfig, {'_DUMMY': ['val']}, 'example') |
| 53 | 53 |
| 54 @config_ctx() | 54 @config_ctx() |
| 55 def test(c): # pragma: no cover | 55 def test(c): # pragma: no cover |
| 56 c.name = 'test' | 56 c.name = 'test' |
| 57 c.cmd = [Path('[CHECKOUT]', 'build', 'tools', 'cool_script.py')] | 57 c.cmd = [Path('[CHECKOUT]', 'build', 'tools', 'cool_script.py')] |
| OLD | NEW |