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 keyword | 7 import keyword |
8 import re | 8 import re |
9 import types | 9 import types |
10 | 10 |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 @property | 447 @property |
448 def name(self): | 448 def name(self): |
449 return self._module.NAME | 449 return self._module.NAME |
450 | 450 |
451 | 451 |
452 class RecipeApi(RecipeApiPlain): | 452 class RecipeApi(RecipeApiPlain): |
453 __metaclass__ = RecipeApiMeta | 453 __metaclass__ = RecipeApiMeta |
454 | 454 |
455 | 455 |
456 class RecipeScriptApi(RecipeApiPlain, ModuleInjectionSite): | 456 class RecipeScriptApi(RecipeApiPlain, ModuleInjectionSite): |
457 pass | 457 def depend_on(self, recipe, properties, **kwargs): |
| 458 return self._engine.depend_on(recipe, properties, **kwargs) |
458 | 459 |
| 460 def depend_on_test(self, recipe, properties, value, **kwargs): |
| 461 return self._engine.depend_on_test(recipe, properties, value, **kwargs) |
459 | 462 |
460 # This is a sentinel object for the Property system. This allows users to | 463 # This is a sentinel object for the Property system. This allows users to |
461 # specify a default of None that will actually be respected. | 464 # specify a default of None that will actually be respected. |
462 PROPERTY_SENTINEL = object() | 465 PROPERTY_SENTINEL = object() |
463 | 466 |
464 class BoundProperty(object): | 467 class BoundProperty(object): |
465 """ | 468 """ |
466 A bound, named version of a Property. | 469 A bound, named version of a Property. |
467 | 470 |
468 A BoundProperty is different than a Property, in that it requires a name, | 471 A BoundProperty is different than a Property, in that it requires a name, |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 """ | 631 """ |
629 Gets the BoundProperty version of this Property. Requires a name. | 632 Gets the BoundProperty version of this Property. Requires a name. |
630 """ | 633 """ |
631 return BoundProperty( | 634 return BoundProperty( |
632 self._default, self.help, self.kind, name, property_type, module, | 635 self._default, self.help, self.kind, name, property_type, module, |
633 self.param_name) | 636 self.param_name) |
634 | 637 |
635 class UndefinedPropertyException(TypeError): | 638 class UndefinedPropertyException(TypeError): |
636 pass | 639 pass |
637 | 640 |
OLD | NEW |