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

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

Issue 15842014: Doc Server Manifest Generation Followup Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Header absolute URL fix Created 7 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/template_data_source.py
diff --git a/chrome/common/extensions/docs/server2/template_data_source.py b/chrome/common/extensions/docs/server2/template_data_source.py
index 7a1f6e10258fa5e4fae9676615840911d0078006..46260649c56f1bfc1ee53f8a089ece78b7425cda 100644
--- a/chrome/common/extensions/docs/server2/template_data_source.py
+++ b/chrome/common/extensions/docs/server2/template_data_source.py
@@ -27,6 +27,7 @@ def _MakeChannelDict(channel_name):
'channels': [{'name': name} for name in BranchUtility.GetAllChannelNames()],
'current': channel_name
}
+
for channel in channel_dict['channels']:
if channel['name'] == channel_name:
channel['isCurrent'] = True
@@ -57,6 +58,7 @@ class TemplateDataSource(object):
sidenav_data_source_factory,
compiled_fs_factory,
ref_resolver_factory,
+ manifest_data_source,
public_template_path,
private_template_path,
base_path):
@@ -71,6 +73,7 @@ class TemplateDataSource(object):
self._ref_resolver = ref_resolver_factory.Create()
self._public_template_path = public_template_path
self._private_template_path = private_template_path
+ self._manifest_data_source = manifest_data_source
self._static_resources = '%s/static' % base_path
def _CreateTemplate(self, template_name, text):
@@ -87,6 +90,7 @@ class TemplateDataSource(object):
self._samples_data_source_factory.Create(request),
self._sidenav_data_source_factory.Create(path),
self._cache,
+ self._manifest_data_source,
self._public_template_path,
self._private_template_path,
self._static_resources)
@@ -99,6 +103,7 @@ class TemplateDataSource(object):
samples_data_source,
sidenav_data_source,
cache,
+ manifest_data_source,
public_template_path,
private_template_path,
static_resources):
@@ -112,6 +117,7 @@ class TemplateDataSource(object):
self._public_template_path = public_template_path
self._private_template_path = private_template_path
self._static_resources = static_resources
+ self._manifest_data_source = manifest_data_source
def Render(self, template_name):
"""This method will render a template named |template_name|, fetching all
@@ -129,6 +135,7 @@ class TemplateDataSource(object):
'intros': self._intro_data_source,
'sidenavs': self._sidenav_data_source,
'partials': self,
+ 'manifest_source': self._manifest_data_source,
'samples': self._samples_data_source,
'static': self._static_resources,
'apps_samples_url': url_constants.GITHUB_BASE,
@@ -154,5 +161,5 @@ class TemplateDataSource(object):
try:
return self._cache.GetFromFile(
'/'.join((base_path, FormatKey(template_name))))
- except FileNotFoundError as e:
+ except FileNotFoundError:
return None

Powered by Google App Engine
This is Rietveld 408576698