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: Created 7 years, 9 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
cduvall 2013/03/21 18:43:53 NICE
epeterson 2013/03/25 19:35:11 Done.
6 import os 5 import os
7 6
8 from file_system import FileNotFoundError 7 from file_system import FileNotFoundError
9 import compiled_file_system as compiled_fs 8 import compiled_file_system as compiled_fs
10 import third_party.json_schema_compiler.model as model 9 import third_party.json_schema_compiler.model as model
11 from docs_server_utils import SanitizeAPIName 10 from docs_server_utils import SanitizeAPIName
12 11
13 # These files are special cases that shouldn't be in the API list. 12 # These files are special cases that shouldn't be in the API list.
14 IGNORED_FILES = [ 13 IGNORED_FILES = [
15 'devtools' 14 'devtools'
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 for i in ['apps', 'extensions']: 72 for i in ['apps', 'extensions']:
74 for j in ['chrome', 'experimental']: 73 for j in ['chrome', 'experimental']:
75 names.extend(self.get(i).get(j)) 74 names.extend(self.get(i).get(j))
76 return [api_name['name'] for api_name in names] 75 return [api_name['name'] for api_name in names]
77 76
78 def get(self, key): 77 def get(self, key):
79 try: 78 try:
80 return self._cache.GetFromFileListing(self._api_path)[key] 79 return self._cache.GetFromFileListing(self._api_path)[key]
81 except FileNotFoundError as e: 80 except FileNotFoundError as e:
82 raise ValueError('%s: Error listing files for "%s".' % (e, key)) 81 raise ValueError('%s: Error listing files for "%s".' % (e, key))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698