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

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

Issue 10854054: Extensions Docs Server: Fix handling of nodocs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 dcd81c4ffcccf066cc75bcfb42ccf906eefb5e60..2015089c8c73e38f483e4ceb890f14b897693884 100644
--- a/chrome/common/extensions/docs/server2/template_data_source.py
+++ b/chrome/common/extensions/docs/server2/template_data_source.py
@@ -6,6 +6,7 @@ import logging
from docs_server_utils import FormatKey
from third_party.handlebar import Handlebar
+from handlebar_dict_generator import NoDocError
EXTENSIONS_URL = '/chrome/extensions'
@@ -103,17 +104,20 @@ class TemplateDataSource(object):
if not template:
return ''
# TODO error handling
- return template.render({
- 'api_list': self._api_list_data_source,
- 'apis': self._api_data_source,
- 'branchInfo': self._branch_info,
- 'intros': self._intro_data_source,
- 'partials': self,
- 'samples': self._samples_data_source,
- 'static': self._static_resources,
- 'true': True,
- 'false': False
- }).text
+ try:
+ return template.render({
+ 'api_list': self._api_list_data_source,
+ 'apis': self._api_data_source,
+ 'branchInfo': self._branch_info,
+ 'intros': self._intro_data_source,
+ 'partials': self,
+ 'samples': self._samples_data_source,
+ 'static': self._static_resources,
+ 'true': True,
+ 'false': False
+ }).text
+ except NoDocError:
+ return ''
not at google - send to devlin 2012/08/09 05:11:36 See comment in handlebar_dict_generator.py. This f
cduvall 2012/08/09 17:54:05 Done.
def __getitem__(self, key):
return self.get(key)

Powered by Google App Engine
This is Rietveld 408576698