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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/resource_fetcher.py
diff --git a/chrome/common/extensions/docs/server2/resource_fetcher.py b/chrome/common/extensions/docs/server2/resource_fetcher.py
new file mode 100644
index 0000000000000000000000000000000000000000..57ea230d5efee4cb0b207892107db622dad8964c
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/resource_fetcher.py
@@ -0,0 +1,23 @@
+# Copyright (c) 2012 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.
+
+SUBVERSION_URL = 'http://src.chromium.org/viewvc/chrome/'
+TRUNK_URL = SUBVERSION_URL + 'trunk/'
+BRANCH_URL = SUBVERSION_URL + 'branches/'
+
+class SubversionFetcher(object):
+ """Class to fetch code from src.chromium.org.
+ """
+ def __init__(self, urlfetch):
+ self.urlfetch = urlfetch
+
+ def _GetURLFromBranch(self, branch):
+ if branch == 'trunk':
+ return TRUNK_URL
+ return BRANCH_URL + branch + '/'
+
+ def FetchResource(self, branch, path):
+ url = self._GetURLFromBranch(branch) + path
+ result = self.urlfetch.fetch(url)
+ return result
« 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