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

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: Resource fetcher 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 import logging
Aaron Boodman 2012/05/24 06:10:23 not used
cduvall 2012/05/25 20:02:23 Done.
6
7 SUBVERSION_URL = 'http://src.chromium.org/viewvc/chrome/'
8 TRUNK_URL = SUBVERSION_URL + 'trunk/'
9 BRANCH_URL = SUBVERSION_URL + 'branches/'
10
11 class SubversionFetcher(object):
12 """Class to fetch code from src.chromium.org.
13 """
14 def __init__(self, urlfetch):
15 self.urlfetch = urlfetch
16
17 def _GetURLFromBranch(self, branch):
18 if branch == 'trunk':
19 return TRUNK_URL
20 return BRANCH_URL + branch + '/'
21
22 def FetchResource(self, branch, path):
23 url = self._GetURLFromBranch(branch) + path
24 result = self.urlfetch.fetch(url)
25 return result
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698