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

Unified Diff: recipes/recipe_util.py

Issue 1494793002: Rename recipes/ to fetch_configs/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Renamed recipes to configs 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipes/pdfium.py ('k') | recipes/skia.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes/recipe_util.py
diff --git a/recipes/recipe_util.py b/recipes/recipe_util.py
deleted file mode 100644
index 50429ae24c2dc529b1aa736924c7de4d19eec9cc..0000000000000000000000000000000000000000
--- a/recipes/recipe_util.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This module holds utilities which make writing recipes easier."""
-
-import json
-
-
-class Recipe(object):
- """Base class for all recipes.
-
- Provides methods that are expected to be overridden by child classes. Also
- provides an command-line parsing method that converts the unified command-line
- interface used in depot_tools to the unified python interface defined here."""
-
- @staticmethod
- def fetch_spec(_props):
- """Returns instructions to check out the project, conditioned on |props|."""
- raise NotImplementedError
-
- @staticmethod
- def expected_root(_props):
- """Returns the directory into which the checkout will be performed."""
- raise NotImplementedError
-
- def handle_args(self, argv):
- """Passes the command-line arguments through to the appropriate method."""
- methods = {'fetch': self.fetch_spec,
- 'root': self.expected_root}
- if len(argv) <= 1 or argv[1] not in methods:
- print 'Must specify a a fetch/root action'
- return 1
-
- def looks_like_arg(arg):
- return arg.startswith('--') and arg.count('=') == 1
-
- bad_parms = [x for x in argv[2:] if not looks_like_arg(x)]
- if bad_parms:
- print 'Got bad arguments %s' % bad_parms
- return 1
-
- method = methods[argv[1]]
- props = dict(x.split('=', 1) for x in (y.lstrip('-') for y in argv[2:]))
-
- self.output(method(props))
-
- @staticmethod
- def output(data):
- print(json.dumps(data))
« no previous file with comments | « recipes/pdfium.py ('k') | recipes/skia.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698