| 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 from slave import recipe_api | 5 from recipe_engine import recipe_api |
| 6 from slave import recipe_util | |
| 7 | 6 |
| 8 | 7 |
| 9 # Inherit from RecipeApiPlain because the only thing which is a step is | 8 # Inherit from RecipeApiPlain because the only thing which is a step is |
| 10 # run_from_dict() | 9 # run_from_dict() |
| 11 class StepApi(recipe_api.RecipeApiPlain): | 10 class StepApi(recipe_api.RecipeApiPlain): |
| 12 def __init__(self, **kwargs): | 11 def __init__(self, **kwargs): |
| 13 super(StepApi, self).__init__(**kwargs) | 12 super(StepApi, self).__init__(**kwargs) |
| 14 self._step_names = {} | 13 self._step_names = {} |
| 15 | 14 |
| 16 EXCEPTION = 'EXCEPTION' | 15 EXCEPTION = 'EXCEPTION' |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 kwargs.setdefault('cwd', self.m.path['slave_build']) | 116 kwargs.setdefault('cwd', self.m.path['slave_build']) |
| 118 | 117 |
| 119 schema = self.make_config() | 118 schema = self.make_config() |
| 120 schema.set_val(kwargs) | 119 schema.set_val(kwargs) |
| 121 return self.run_from_dict(self._engine.create_step(schema)) | 120 return self.run_from_dict(self._engine.create_step(schema)) |
| 122 | 121 |
| 123 # TODO(martiniss) delete, and make generator_script use **kwargs on step() | 122 # TODO(martiniss) delete, and make generator_script use **kwargs on step() |
| 124 @recipe_api.composite_step | 123 @recipe_api.composite_step |
| 125 def run_from_dict(self, dct): | 124 def run_from_dict(self, dct): |
| 126 return self._engine.run_step(dct) | 125 return self._engine.run_step(dct) |
| OLD | NEW |