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

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: blobstore Created 8 years, 4 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 92e7c77e7c7c399ce7b59ccba2ababe006d84b6d..ea56038e7b3558404358075d23b6a0e429406e21 100644
--- a/chrome/common/extensions/docs/server2/handler.py
+++ b/chrome/common/extensions/docs/server2/handler.py
@@ -12,11 +12,13 @@ from appengine_wrappers import urlfetch
from api_data_source import APIDataSource
from api_list_data_source import APIListDataSource
+from appengine_blobstore import AppEngineBlobstore
from appengine_memcache import AppEngineMemcache
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 +26,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 +64,12 @@ def _GetInstanceForBranch(branch, local_path):
file_system = MemcacheFileSystem(SubversionFileSystem(fetcher),
AppEngineMemcache(branch))
+ github_file_system = GithubFileSystem(
+ AppEngineUrlFetcher(url_constants.GITHUB_URL),
+ AppEngineMemcache('github'),
+ AppEngineBlobstore())
+ github_cache_builder = FileSystemCache.Builder(github_file_system)
+
cache_builder = FileSystemCache.Builder(file_system)
api_list_data_source = APIListDataSource(cache_builder,
file_system,
@@ -76,7 +79,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)
api_data_source_factory = APIDataSource.Factory(cache_builder,
API_PATH,
@@ -102,8 +107,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