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

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

Issue 12996003: Dynamically generate a heading for Extension Docs API pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revisions, Offline/Online Access (bypassed-hooks) Created 7 years, 7 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
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 import copy 5 import copy
6 import json 6 import json
7 import logging
8 7
9 import compiled_file_system as compiled_fs 8 import compiled_file_system as compiled_fs
10 from third_party.json_schema_compiler.model import UnixName 9 from third_party.json_schema_compiler.model import UnixName
11 10
12 class SidenavDataSource(object): 11 class SidenavDataSource(object):
13 """This class reads in and caches a JSON file representing the side navigation 12 """This class reads in and caches a JSON file representing the side navigation
14 menu. 13 menu.
15 """ 14 """
16 class Factory(object): 15 class Factory(object):
17 def __init__(self, compiled_fs_factory, json_path): 16 def __init__(self, compiled_fs_factory, json_path):
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 if self._AddSelected(item['items']): 53 if self._AddSelected(item['items']):
55 item['child_selected'] = True 54 item['child_selected'] = True
56 return True 55 return True
57 return False 56 return False
58 57
59 def get(self, key): 58 def get(self, key):
60 sidenav = copy.deepcopy(self._cache.GetFromFile( 59 sidenav = copy.deepcopy(self._cache.GetFromFile(
61 '%s/%s_sidenav.json' % (self._json_path, key))) 60 '%s/%s_sidenav.json' % (self._json_path, key)))
62 self._AddSelected(sidenav) 61 self._AddSelected(sidenav)
63 return sidenav 62 return sidenav
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698