| 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 f3df0e060b74c95d739e64f744bd123a2a3ac634..d5b19f08ca54765a5fefe5f08f73c186c60b7e30 100644
|
| --- a/chrome/common/extensions/docs/server2/template_data_source.py
|
| +++ b/chrome/common/extensions/docs/server2/template_data_source.py
|
| @@ -6,7 +6,6 @@ import logging
|
| import os
|
| import traceback
|
|
|
| -from branch_utility import BranchUtility
|
| import compiled_file_system as compiled_fs
|
| from docs_server_utils import FormatKey
|
| from file_system import FileNotFoundError
|
| @@ -15,16 +14,6 @@ import url_constants
|
|
|
| EXTENSIONS_URL = '/chrome/extensions'
|
|
|
| -def _MakeChannelDict(channel_name):
|
| - channel_dict = {
|
| - '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
|
| - return channel_dict
|
| -
|
| class TemplateDataSource(object):
|
| """Renders Handlebar templates, providing them with the context in which to
|
| render.
|
| @@ -42,7 +31,6 @@ class TemplateDataSource(object):
|
| individual Requests.
|
| """
|
| def __init__(self,
|
| - channel_name,
|
| api_data_source_factory,
|
| api_list_data_source_factory,
|
| intro_data_source_factory,
|
| @@ -53,7 +41,6 @@ class TemplateDataSource(object):
|
| public_template_path,
|
| private_template_path,
|
| static_path):
|
| - self._branch_info = _MakeChannelDict(channel_name)
|
| self._api_data_source_factory = api_data_source_factory
|
| self._api_list_data_source_factory = api_list_data_source_factory
|
| self._intro_data_source_factory = intro_data_source_factory
|
| @@ -64,7 +51,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._static_resources = static_path
|
| + self._static_path = static_path
|
|
|
| def _CreateTemplate(self, template_name, text):
|
| return Handlebar(self._ref_resolver.ResolveAllLinks(text))
|
| @@ -73,7 +60,6 @@ class TemplateDataSource(object):
|
| """Returns a new TemplateDataSource bound to |request|.
|
| """
|
| return TemplateDataSource(
|
| - self._branch_info,
|
| self._api_data_source_factory.Create(request),
|
| self._api_list_data_source_factory.Create(),
|
| self._intro_data_source_factory.Create(),
|
| @@ -82,10 +68,9 @@ class TemplateDataSource(object):
|
| self._cache,
|
| self._public_template_path,
|
| self._private_template_path,
|
| - self._static_resources)
|
| + self._static_path)
|
|
|
| def __init__(self,
|
| - branch_info,
|
| api_data_source,
|
| api_list_data_source,
|
| intro_data_source,
|
| @@ -94,8 +79,7 @@ class TemplateDataSource(object):
|
| cache,
|
| public_template_path,
|
| private_template_path,
|
| - static_resources):
|
| - self._branch_info = branch_info
|
| + static_path):
|
| self._api_list_data_source = api_list_data_source
|
| self._intro_data_source = intro_data_source
|
| self._samples_data_source = samples_data_source
|
| @@ -104,7 +88,7 @@ class TemplateDataSource(object):
|
| self._cache = cache
|
| self._public_template_path = public_template_path
|
| self._private_template_path = private_template_path
|
| - self._static_resources = static_resources
|
| + self._static_path = static_path
|
|
|
| def Render(self, template_name):
|
| """This method will render a template named |template_name|, fetching all
|
| @@ -118,12 +102,11 @@ class TemplateDataSource(object):
|
| render_data = template.render({
|
| 'api_list': self._api_list_data_source,
|
| 'apis': self._api_data_source,
|
| - 'branchInfo': self._branch_info,
|
| 'intros': self._intro_data_source,
|
| 'sidenavs': self._sidenav_data_source,
|
| 'partials': self,
|
| 'samples': self._samples_data_source,
|
| - 'static': self._static_resources,
|
| + 'static': self._static_path,
|
| 'app': 'app',
|
| 'extension': 'extension',
|
| 'apps_title': 'Apps',
|
|
|