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

Unified Diff: recipe_engine/config_types.py

Issue 2512253002: Add name, package_repo_resource and resource support to recipe scripts. (Closed)
Patch Set: Fix bug, add additional test Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | recipe_engine/doc.py » ('j') | recipe_engine/loader.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/config_types.py
diff --git a/recipe_engine/config_types.py b/recipe_engine/config_types.py
index c2797f6a0801313c470a7b17284d502a7f688ece..b7a2705e77c25ed5750db2e76d8ee5e94c4cceed 100644
--- a/recipe_engine/config_types.py
+++ b/recipe_engine/config_types.py
@@ -116,6 +116,17 @@ class ModuleBasePath(BasePath, namedtuple('ModuleBasePath', 'module')):
return 'RECIPE_MODULE[%s]' % re.sub('\.', '::', name)
+class RecipeScriptBasePath(
+ BasePath, namedtuple('RecipeScriptBasePath', 'recipe_name script_path')):
+ def resolve(self, test_enabled):
+ if test_enabled:
+ return repr(self)
+ return os.path.splitext(self.script_path)[0]+".resources" # pragma: no cover
iannucci 2016/11/19 00:15:32 this was a bug
+
+ def __repr__(self):
+ return 'RECIPE[%s].resources' % self.recipe_name
+
+
class PackageRepoBasePath(
BasePath, namedtuple('PackageRepoBasePath', 'package')):
def resolve(self, test_enabled):
« no previous file with comments | « no previous file | recipe_engine/doc.py » ('j') | recipe_engine/loader.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698