OLD | NEW |
1 # Copyright 2013-2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2013-2015 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 __future__ import absolute_import | 5 from __future__ import absolute_import |
6 import contextlib | 6 import contextlib |
| 7 import json |
7 import keyword | 8 import keyword |
| 9 import os |
8 import re | 10 import re |
| 11 import subprocess |
| 12 import tempfile |
9 import types | 13 import types |
10 | 14 |
11 from functools import wraps | 15 from functools import wraps |
12 | 16 |
13 from .recipe_test_api import DisabledTestData, ModuleTestData | 17 from .recipe_test_api import DisabledTestData, ModuleTestData |
14 from .config import Single | 18 from .config import Single |
15 | 19 |
16 from .util import ModuleInjectionSite | 20 from .util import ModuleInjectionSite |
17 | 21 |
18 from . import field_composer | 22 from . import field_composer |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 @property | 451 @property |
448 def name(self): | 452 def name(self): |
449 return self._module.NAME | 453 return self._module.NAME |
450 | 454 |
451 | 455 |
452 class RecipeApi(RecipeApiPlain): | 456 class RecipeApi(RecipeApiPlain): |
453 __metaclass__ = RecipeApiMeta | 457 __metaclass__ = RecipeApiMeta |
454 | 458 |
455 | 459 |
456 class RecipeScriptApi(RecipeApiPlain, ModuleInjectionSite): | 460 class RecipeScriptApi(RecipeApiPlain, ModuleInjectionSite): |
457 pass | 461 def depend_on(self, recipe, properties): |
| 462 recipe_script = self._engine._universe.load_recipe(recipe) |
| 463 return recipe_script.run(self, properties) |
458 | 464 |
459 | 465 |
460 # This is a sentinel object for the Property system. This allows users to | 466 # This is a sentinel object for the Property system. This allows users to |
461 # specify a default of None that will actually be respected. | 467 # specify a default of None that will actually be respected. |
462 PROPERTY_SENTINEL = object() | 468 PROPERTY_SENTINEL = object() |
463 | 469 |
464 class BoundProperty(object): | 470 class BoundProperty(object): |
465 """ | 471 """ |
466 A bound, named version of a Property. | 472 A bound, named version of a Property. |
467 | 473 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 """ | 634 """ |
629 Gets the BoundProperty version of this Property. Requires a name. | 635 Gets the BoundProperty version of this Property. Requires a name. |
630 """ | 636 """ |
631 return BoundProperty( | 637 return BoundProperty( |
632 self._default, self.help, self.kind, name, property_type, module, | 638 self._default, self.help, self.kind, name, property_type, module, |
633 self.param_name) | 639 self.param_name) |
634 | 640 |
635 class UndefinedPropertyException(TypeError): | 641 class UndefinedPropertyException(TypeError): |
636 pass | 642 pass |
637 | 643 |
OLD | NEW |