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

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

Issue 491653002: Docserver: Use GitilesFileSystem instead of SubversionFileSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/sidenav_data_source.py
diff --git a/chrome/common/extensions/docs/server2/sidenav_data_source.py b/chrome/common/extensions/docs/server2/sidenav_data_source.py
index 1a7bae9d68494a5c171332e215dfe2b17bc66bb2..41dade7b5e41fa207ba5b814d5d32eabdec94708 100644
--- a/chrome/common/extensions/docs/server2/sidenav_data_source.py
+++ b/chrome/common/extensions/docs/server2/sidenav_data_source.py
@@ -24,13 +24,13 @@ def _AddLevels(items, level):
def _AddAnnotations(items, path, parent=None):
- '''Add 'selected', 'child_selected' and 'related' properties to
- |items| so that the sidenav can be expanded to show which menu item has
+ '''Add 'selected', 'child_selected' and 'related' properties to
+ |items| so that the sidenav can be expanded to show which menu item has
been selected and the related pages section can be drawn. 'related'
is added to all items with the same parent as the selected item.
- If more than one item exactly matches the path, the deepest one is considered
+ If more than one item exactly matches the path, the deepest one is considered
'selected'. A 'parent' property is added to the selected path.
-
+
Returns True if an item was marked 'selected'.
'''
for item in items:
@@ -42,12 +42,12 @@ def _AddAnnotations(items, path, parent=None):
if item.get('href', '') == path:
item['selected'] = True
if parent:
- item['parent'] = { 'title': parent.get('title', None),
+ item['parent'] = { 'title': parent.get('title', None),
'href': parent.get('href', None) }
-
+
for sibling in items:
sibling['related'] = True
-
+
return True
return False
@@ -59,7 +59,7 @@ class SidenavDataSource(DataSource):
'''
def __init__(self, server_instance, request):
self._cache = server_instance.compiled_fs_factory.Create(
- server_instance.host_file_system_provider.GetTrunk(),
+ server_instance.host_file_system_provider.GetMaster(),
self._CreateSidenavDict,
SidenavDataSource)
self._server_instance = server_instance

Powered by Google App Engine
This is Rietveld 408576698