Chromium Code Reviews| 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 4f4f9de7e68122109841c36d7d2bf25b61913b0f..6d5f15f15a69be2d8d585d86b0ad4fec0c90511c 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) |
|
not at google - send to devlin
2012/08/09 07:52:36
optimisation: the github file system isn't version
cduvall
2012/08/09 19:20:08
Done.
|
| + |
| 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): |