OLD | NEW |
---|---|
(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 | |
OLD | NEW |