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

Side by Side Diff: chrome/common/extensions/docs/server2/template_renderer.py

Issue 228723005: Refactor APIDataSource to work with DataSourceRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tiny cleanup Created 6 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/common/extensions/docs/server2/server_instance.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from data_source_registry import CreateDataSources 5 from data_source_registry import CreateDataSources
6 from third_party.handlebar import Handlebar 6 from third_party.handlebar import Handlebar
7 from url_constants import GITHUB_BASE, EXTENSIONS_SAMPLES 7 from url_constants import GITHUB_BASE, EXTENSIONS_SAMPLES
8 8
9 9
10 class TemplateRenderer(object): 10 class TemplateRenderer(object):
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 }) 44 })
45 if additional_context: 45 if additional_context:
46 render_context.update(additional_context) 46 render_context.update(additional_context)
47 render_data = template.Render(render_context) 47 render_data = template.Render(render_context)
48 return render_data.text, render_data.errors 48 return render_data.text, render_data.errors
49 49
50 def _CreateDataSources(self, request): 50 def _CreateDataSources(self, request):
51 server_instance = self._server_instance 51 server_instance = self._server_instance
52 data_sources = CreateDataSources(server_instance, request=request) 52 data_sources = CreateDataSources(server_instance, request=request)
53 data_sources.update({ 53 data_sources.update({
54 'apis': server_instance.api_data_source_factory.Create(request),
55 'samples': server_instance.samples_data_source_factory.Create(request), 54 'samples': server_instance.samples_data_source_factory.Create(request),
56 }) 55 })
57 return data_sources 56 return data_sources
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/server_instance.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698