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

Side by Side Diff: chrome/common/extensions/docs/server2/resource_fetcher.py

Issue 10387225: Die build.py, Die: Part 1 (BranchUtility and SubversionFetcher) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Final changes Created 8 years, 7 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
OLDNEW
(Empty)
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 SUBVERSION_URL = 'http://src.chromium.org/viewvc/chrome/'
6 TRUNK_URL = SUBVERSION_URL + 'trunk/'
7 BRANCH_URL = SUBVERSION_URL + 'branches/'
8
9 class SubversionFetcher(object):
10 """Class to fetch code from src.chromium.org.
11 """
12 def __init__(self, urlfetch):
13 self.urlfetch = urlfetch
14
15 def _GetURLFromBranch(self, branch):
16 if branch == 'trunk':
17 return TRUNK_URL
18 return BRANCH_URL + branch + '/'
19
20 def FetchResource(self, branch, path):
21 url = self._GetURLFromBranch(branch) + path
22 result = self.urlfetch.fetch(url)
23 return result
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/echo_handler.py ('k') | chrome/common/extensions/docs/server2/resource_fetcher_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698