Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1605)

Side by Side Diff: recipe_engine/recipe_api.py

Issue 1421843006: Add simple depends_on API. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Remove old expectation, move tests to their own folder. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « recipe_engine/package.py ('k') | recipe_engine/recipe_test_api.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « recipe_engine/package.py ('k') | recipe_engine/recipe_test_api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698