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

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

Issue 10546078: Extension docs server: APIDataSource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/echo_handler.py
diff --git a/chrome/common/extensions/docs/server2/echo_handler.py b/chrome/common/extensions/docs/server2/echo_handler.py
index 78195cb94a22d9477d5880410b23507ae2eba67c..d7159247ab401e794d3ef4256cdba480101207ff 100755
--- a/chrome/common/extensions/docs/server2/echo_handler.py
+++ b/chrome/common/extensions/docs/server2/echo_handler.py
@@ -19,6 +19,7 @@ import urlfetch
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
+from api_data_source import APIDataSource
from local_fetcher import LocalFetcher
from server_instance import ServerInstance
from subversion_fetcher import SubversionFetcher
@@ -26,6 +27,7 @@ from template_data_source import TemplateDataSource
EXTENSIONS_PATH = 'chrome/common/extensions/'
DOCS_PATH = 'docs/'
+API_PATH = 'api/'
PUBLIC_TEMPLATE_PATH = DOCS_PATH + 'template2/public/'
PRIVATE_TEMPLATE_PATH = DOCS_PATH + 'template2/private/'
@@ -43,11 +45,15 @@ class Server(webapp.RequestHandler):
else:
fetcher = SubversionFetcher(branch, EXTENSIONS_PATH, urlfetch)
cache_timeout_seconds = 300
- data_source = TemplateDataSource(
+ template_data_source = TemplateDataSource(
fetcher,
[PUBLIC_TEMPLATE_PATH, PRIVATE_TEMPLATE_PATH],
cache_timeout_seconds)
- SERVER_INSTANCES[branch] = ServerInstance(data_source, fetcher)
+ api_data_source = APIDataSource(fetcher, [API_PATH], cache_timeout_seconds)
+ SERVER_INSTANCES[branch] = ServerInstance(
+ api_data_source,
+ template_data_source,
+ fetcher)
return SERVER_INSTANCES[branch]
def _HandleRequest(self, path):

Powered by Google App Engine
This is Rietveld 408576698