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

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: Moving logic into availability_data_source Created 7 years, 8 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 from file_system import FileNotFoundError 7 from file_system import FileNotFoundError
9 import third_party.json_schema_compiler.model as model 8 import third_party.json_schema_compiler.model as model
10 import docs_server_utils as utils 9 import docs_server_utils as utils
11 10
12 # Increment this if the data model changes for APIDataSource. 11 # Increment this if the data model changes for APIDataSource.
13 _VERSION = 1 12 _VERSION = 1
14 13
15 # These files are special cases that shouldn't be in the API list. 14 # These files are special cases that shouldn't be in the API list.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 for platform in ['apps', 'extensions']: 81 for platform in ['apps', 'extensions']:
83 for category in ['chrome', 'experimental']: 82 for category in ['chrome', 'experimental']:
84 names.extend(self.get(platform).get(category)) 83 names.extend(self.get(platform).get(category))
85 return [api_name['name'] for api_name in names] 84 return [api_name['name'] for api_name in names]
86 85
87 def get(self, key): 86 def get(self, key):
88 try: 87 try:
89 return self._compiled_fs.GetFromFileListing(self._api_path)[key] 88 return self._compiled_fs.GetFromFileListing(self._api_path)[key]
90 except FileNotFoundError as e: 89 except FileNotFoundError as e:
91 raise ValueError('%s: Error listing files for "%s".' % (e, key)) 90 raise ValueError('%s: Error listing files for "%s".' % (e, key))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698