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

Side by Side Diff: chrome/common/extensions/docs/server2/api_list_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: Addressing comments - Patch currently being broken up Created 7 years, 6 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 logging
6 import os 5 import os
7 6
8 import third_party.json_schema_compiler.model as model 7 import third_party.json_schema_compiler.model as model
9 import docs_server_utils as utils 8 import docs_server_utils as utils
10 9
11 class APIListDataSource(object): 10 class APIListDataSource(object):
12 """ This class creates a list of chrome.* APIs and chrome.experimental.* APIs 11 """ This class creates a list of chrome.* APIs and chrome.experimental.* APIs
13 for extensions and apps that are used in the api_index.html and 12 for extensions and apps that are used in the api_index.html and
14 experimental.html pages. 13 experimental.html pages.
15 |api_path| is the path to the API schemas. 14 |api_path| is the path to the API schemas.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 67
69 def GetAllNames(self): 68 def GetAllNames(self):
70 names = [] 69 names = []
71 for platform in ['apps', 'extensions']: 70 for platform in ['apps', 'extensions']:
72 for category in ['chrome', 'experimental']: 71 for category in ['chrome', 'experimental']:
73 names.extend(self.get(platform).get(category)) 72 names.extend(self.get(platform).get(category))
74 return [api_name['name'] for api_name in names] 73 return [api_name['name'] for api_name in names]
75 74
76 def get(self, key): 75 def get(self, key):
77 return self._compiled_fs.GetFromFileListing(self._api_path)[key] 76 return self._compiled_fs.GetFromFileListing(self._api_path)[key]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698