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

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

Issue 11747025: Run the JSON Schema Compiler's bundle compilation on JSON files. Previously it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ms release build Created 7 years, 11 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
« no previous file with comments | « chrome/common/extensions/api/windows.json ('k') | chrome/common/extensions_api_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 logging 6 import logging
7 import os 7 import os
8 8
9 import compiled_file_system as compiled_fs 9 import compiled_file_system as compiled_fs
10 from file_system import FileNotFoundError 10 from file_system import FileNotFoundError
11 import third_party.json_schema_compiler.json_parse as json_parse 11 import third_party.json_schema_compiler.json_parse as json_parse
12 import third_party.json_schema_compiler.model as model 12 import third_party.json_schema_compiler.model as model
13 import third_party.json_schema_compiler.idl_schema as idl_schema 13 import third_party.json_schema_compiler.idl_schema as idl_schema
14 import third_party.json_schema_compiler.idl_parser as idl_parser 14 import third_party.json_schema_compiler.idl_parser as idl_parser
15 15
16 # Increment this version when there are changes to the data stored in any of 16 # Increment this version when there are changes to the data stored in any of
17 # the caches used by APIDataSource. This allows the cache to be invalidated 17 # the caches used by APIDataSource. This would include changes to model.py in
18 # without having to flush memcache on the production server. 18 # JSON schema compiler! This allows the cache to be invalidated without having
19 _VERSION = 9 19 # to flush memcache on the production server.
20 _VERSION = 10
20 21
21 def _RemoveNoDocs(item): 22 def _RemoveNoDocs(item):
22 if json_parse.IsDict(item): 23 if json_parse.IsDict(item):
23 if item.get('nodoc', False): 24 if item.get('nodoc', False):
24 return True 25 return True
25 to_remove = [] 26 to_remove = []
26 for key, value in item.items(): 27 for key, value in item.items():
27 if _RemoveNoDocs(value): 28 if _RemoveNoDocs(value):
28 to_remove.append(key) 29 to_remove.append(key)
29 for k in to_remove: 30 for k in to_remove:
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 if self._disable_refs: 428 if self._disable_refs:
428 cache, ext = ( 429 cache, ext = (
429 (self._idl_cache_no_refs, '.idl') if (unix_name in idl_names) else 430 (self._idl_cache_no_refs, '.idl') if (unix_name in idl_names) else
430 (self._json_cache_no_refs, '.json')) 431 (self._json_cache_no_refs, '.json'))
431 else: 432 else:
432 cache, ext = ((self._idl_cache, '.idl') if (unix_name in idl_names) else 433 cache, ext = ((self._idl_cache, '.idl') if (unix_name in idl_names) else
433 (self._json_cache, '.json')) 434 (self._json_cache, '.json'))
434 return self._GenerateHandlebarContext( 435 return self._GenerateHandlebarContext(
435 cache.GetFromFile('%s/%s%s' % (self._base_path, unix_name, ext)), 436 cache.GetFromFile('%s/%s%s' % (self._base_path, unix_name, ext)),
436 path) 437 path)
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/windows.json ('k') | chrome/common/extensions_api_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698