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

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

Issue 10546078: Extension docs server: APIDataSource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FetcherCache 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/server_instance.py
diff --git a/chrome/common/extensions/docs/server2/server_instance.py b/chrome/common/extensions/docs/server2/server_instance.py
index 26e96240fc28122f0156cd8266f2b96716c2108f..e09fd010207cf8331cdd665afbd2a15030fc298f 100644
--- a/chrome/common/extensions/docs/server2/server_instance.py
+++ b/chrome/common/extensions/docs/server2/server_instance.py
@@ -11,14 +11,17 @@ class ServerInstance(object):
"""This class is used to hold a data source and fetcher for an instance of a
server. Each new branch will get its own ServerInstance.
"""
- def __init__(self, data_source, fetcher):
- self._data_source = data_source
+ def __init__(self, api_data_source, template_data_source, fetcher):
+ self._api_data_source = api_data_source
+ self._template_data_source = template_data_source
self._fetcher = fetcher
+
def Run(self, path, request_handler):
parts = path.split('/')
filename = parts[-1]
- content = self._data_source.Render(filename, '{"test": "Hello"}')
+ content = self._template_data_source.Render(filename,
+ self._api_data_source[filename])
if not content:
logging.info('Template not found for: ' + filename)
try:

Powered by Google App Engine
This is Rietveld 408576698