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

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

Issue 92143003: Docserver: Reorganise the site templates into a single site.html file which (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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/table_of_contents_renderer.py
diff --git a/chrome/common/extensions/docs/server2/table_of_contents_renderer.py b/chrome/common/extensions/docs/server2/table_of_contents_renderer.py
index 71c94a061e65d34b048b1fe3afb1c8441e3ab19e..38580f09173c381c2aabf9731cc0ae48b482a5ac 100644
--- a/chrome/common/extensions/docs/server2/table_of_contents_renderer.py
+++ b/chrome/common/extensions/docs/server2/table_of_contents_renderer.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
from extensions_paths import PRIVATE_TEMPLATES
+from file_system import FileNotFoundError
class TableOfContentsRenderer(object):
@@ -20,8 +21,11 @@ class TableOfContentsRenderer(object):
'''Renders a list of DocumentSections |sections| and returns a tuple
(text, warnings).
'''
- table_of_contents_template = self._templates.GetFromFile(
- '%s/table_of_contents.html' % PRIVATE_TEMPLATES).Get()
+ path = '%s/table_of_contents.html' % PRIVATE_TEMPLATES
+ try:
+ table_of_contents_template = self._templates.GetFromFile(path).Get()
+ except FileNotFoundError:
+ return '', ['%s not found' % path]
def make_toc_items(entries):
return [{
« no previous file with comments | « chrome/common/extensions/docs/server2/strings_data_source.py ('k') | chrome/common/extensions/docs/static/css/index.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698