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

Side by Side Diff: scripts/slave/recipe_modules/gitiles/api.py

Issue 1151423002: Move recipe engine to third_party/recipe_engine. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Moved field_composer_test with its buddies Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 slave import recipe_api 5 from recipe_engine import recipe_api
6 6
7 import base64 7 import base64
8 8
9 9
10 class Gitiles(recipe_api.RecipeApi): 10 class Gitiles(recipe_api.RecipeApi):
11 """Module for polling a git repository using the Gitiles web interface.""" 11 """Module for polling a git repository using the Gitiles web interface."""
12 12
13 def _fetch(self, url, step_name, attempts=None): 13 def _fetch(self, url, step_name, attempts=None):
14 args = [ 14 args = [
15 '--json-file', self.m.json.output(), 15 '--json-file', self.m.json.output(),
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 step_name: (str) If not None, override the step name. 86 step_name: (str) If not None, override the step name.
87 87
88 Returns: 88 Returns:
89 Raw file content. 89 Raw file content.
90 """ 90 """
91 kwargs.setdefault('step_name', 'Gitiles fetch %s' % file_path) 91 kwargs.setdefault('step_name', 'Gitiles fetch %s' % file_path)
92 full_url = '%s/+/%s/%s?format=text' % (repository_url.rstrip('/'), branch, 92 full_url = '%s/+/%s/%s?format=text' % (repository_url.rstrip('/'), branch,
93 file_path.lstrip('/')) 93 file_path.lstrip('/'))
94 b64_data = self.m.url.fetch(full_url, **kwargs) 94 b64_data = self.m.url.fetch(full_url, **kwargs)
95 return base64.b64decode(b64_data) 95 return base64.b64decode(b64_data)
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/git_clone_bundler/api.py ('k') | scripts/slave/recipe_modules/gitiles/test_api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698