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

Unified Diff: doc/recipes.py

Issue 2782323002: make doc/recipes.py supported version 1 and 2 (Closed)
Patch Set: todo Created 3 years, 9 months 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 | unittests/repo_test_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: doc/recipes.py
diff --git a/doc/recipes.py b/doc/recipes.py
index 270f14169c91fb7c361cb8b3b161f8f314ea30cc..777da820f7ee303ce896abb63aabc5fbca4e9c9b 100755
--- a/doc/recipes.py
+++ b/doc/recipes.py
@@ -67,11 +67,15 @@ def parse(repo_root, recipes_cfg_path):
with open(recipes_cfg_path, 'rU') as fh:
pb = json.load(fh)
- engine = next(
- (d for d in pb['deps'] if d['project_id'] == 'recipe_engine'), None)
- if engine is None:
- raise ValueError('could not find recipe_engine dep in %r'
- % recipes_cfg_path)
+ if pb['api_version'] == 1:
+ # TODO(iannucci): remove when we only support version 2
+ engine = next(
+ (d for d in pb['deps'] if d['project_id'] == 'recipe_engine'), None)
+ if engine is None:
+ raise ValueError('could not find recipe_engine dep in %r'
+ % recipes_cfg_path)
+ else:
+ engine = pb['deps']['recipe_engine']
engine_url = engine['url']
engine_revision = engine.get('revision', '')
engine_subpath = engine.get('path_override', '')
« no previous file with comments | « no previous file | unittests/repo_test_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698