| 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 | 458 return self._engine.depend_on(recipe, properties, **kwargs) |
| 459 | 459 |
| 460 # This is a sentinel object for the Property system. This allows users to | 460 # This is a sentinel object for the Property system. This allows users to |
| 461 # specify a default of None that will actually be respected. | 461 # specify a default of None that will actually be respected. |
| 462 PROPERTY_SENTINEL = object() | 462 PROPERTY_SENTINEL = object() |
| 463 | 463 |
| 464 class BoundProperty(object): | 464 class BoundProperty(object): |
| 465 """ | 465 """ |
| 466 A bound, named version of a Property. | 466 A bound, named version of a Property. |
| 467 | 467 |
| 468 A BoundProperty is different than a Property, in that it requires a name, | 468 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 """ | 628 """ |
| 629 Gets the BoundProperty version of this Property. Requires a name. | 629 Gets the BoundProperty version of this Property. Requires a name. |
| 630 """ | 630 """ |
| 631 return BoundProperty( | 631 return BoundProperty( |
| 632 self._default, self.help, self.kind, name, property_type, module, | 632 self._default, self.help, self.kind, name, property_type, module, |
| 633 self.param_name) | 633 self.param_name) |
| 634 | 634 |
| 635 class UndefinedPropertyException(TypeError): | 635 class UndefinedPropertyException(TypeError): |
| 636 pass | 636 pass |
| 637 | 637 |
| OLD | NEW |