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

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

Issue 13896007: Devserver: run the cron over the examples. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try again to avoid .svn 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 | Annotate | Revision Log
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 5 import logging
6 import os 6 import os
7 7
8 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.
16 IGNORED_FILES = [ 15 IGNORED_FILES = [
17 'devtools' 16 'devtools'
18 ] 17 ]
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 self._api_path = api_path 77 self._api_path = api_path
79 78
80 def GetAllNames(self): 79 def GetAllNames(self):
81 names = [] 80 names = []
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 return self._compiled_fs.GetFromFileListing(self._api_path)[key]
89 return self._compiled_fs.GetFromFileListing(self._api_path)[key]
90 except FileNotFoundError as e:
91 raise ValueError('%s: Error listing files for "%s".' % (e, key))
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/api_data_source.py ('k') | chrome/common/extensions/docs/server2/caching_file_system.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698