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

Unified Diff: doc/recipes.py

Issue 2782323002: make doc/recipes.py supported version 1 and 2 (Closed)
Patch Set: move exception 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') | unittests/repo_test_util.py » ('J')
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..0c18a87d1b92f48f69d7159edbf7f6e48365f7fa 100755
--- a/doc/recipes.py
+++ b/doc/recipes.py
@@ -67,11 +67,14 @@ 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:
iannucci 2017/03/29 22:15:08 This section will go away when we only support ver
dnj 2017/03/29 22:16:15 Add a TODO then?
iannucci 2017/03/29 22:17:20 Done
+ 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') | unittests/repo_test_util.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698