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

Unified Diff: chrome/common/extensions/docs/server2/handler.py

Issue 10825067: Extensions Docs Server: Apps samples page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no more zip file Created 8 years, 5 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/handler.py
diff --git a/chrome/common/extensions/docs/server2/handler.py b/chrome/common/extensions/docs/server2/handler.py
index ee8b3bb2b507b1a474f0d980b836d52bdd0be981..7da3415dfe02ccfac2bc1872433cd48b1cac3ec9 100644
--- a/chrome/common/extensions/docs/server2/handler.py
+++ b/chrome/common/extensions/docs/server2/handler.py
@@ -17,6 +17,7 @@ from appengine_url_fetcher import AppEngineUrlFetcher
from branch_utility import BranchUtility
from example_zipper import ExampleZipper
from file_system_cache import FileSystemCache
+from github_file_system import GithubFileSystem
from intro_data_source import IntroDataSource
from local_file_system import LocalFileSystem
from memcache_file_system import MemcacheFileSystem
@@ -24,20 +25,15 @@ from samples_data_source import SamplesDataSource
from server_instance import ServerInstance
from subversion_file_system import SubversionFileSystem
from template_data_source import TemplateDataSource
-from appengine_url_fetcher import AppEngineUrlFetcher
+import url_constants
# The branch that the server will default to when no branch is specified in the
# URL. This is necessary because it is not possible to pass flags to the script
# handler.
DEFAULT_BRANCH = 'local'
-SVN_URL = 'http://src.chromium.org/chrome'
-TRUNK_URL = SVN_URL + '/trunk'
-BRANCH_URL = SVN_URL + '/branches'
-
-OMAHA_PROXY_URL = 'http://omahaproxy.appspot.com/json'
BRANCH_UTILITY_MEMCACHE = AppEngineMemcache('branch_utility')
-BRANCH_UTILITY = BranchUtility(OMAHA_PROXY_URL,
+BRANCH_UTILITY = BranchUtility(url_constants.OMAHA_PROXY_URL,
DEFAULT_BRANCH,
AppEngineUrlFetcher(''),
BRANCH_UTILITY_MEMCACHE)
@@ -67,6 +63,11 @@ def _GetInstanceForBranch(branch, local_path):
file_system = MemcacheFileSystem(SubversionFileSystem(fetcher),
AppEngineMemcache(branch))
+ github_file_system = MemcacheFileSystem(
+ GithubFileSystem(AppEngineUrlFetcher(url_constants.GITHUB_URL)),
+ AppEngineMemcache('github'))
+ github_cache_builder = FileSystemCache.Builder(github_file_system)
+
cache_builder = FileSystemCache.Builder(file_system)
api_data_source = APIDataSource(cache_builder, API_PATH)
api_list_data_source = APIListDataSource(cache_builder,
@@ -77,7 +78,9 @@ def _GetInstanceForBranch(branch, local_path):
[INTRO_PATH, ARTICLE_PATH])
samples_data_source_factory = SamplesDataSource.Factory(branch,
file_system,
+ github_file_system,
cache_builder,
+ github_cache_builder,
EXAMPLES_PATH)
template_data_source_factory = TemplateDataSource.Factory(
branch,
@@ -100,8 +103,8 @@ def _GetInstanceForBranch(branch, local_path):
def _GetURLFromBranch(branch):
if branch == 'trunk':
- return TRUNK_URL + '/src'
- return BRANCH_URL + '/' + branch + '/src'
+ return url_constants.SVN_TRUNK_URL + '/src'
+ return url_constants.SVN_BRANCH_URL + '/' + branch + '/src'
class Handler(webapp.RequestHandler):
def __init__(self, request, response, local_path=EXTENSIONS_PATH):

Powered by Google App Engine
This is Rietveld 408576698