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

Side by Side Diff: tools/json_schema_compiler/model.py

Issue 1695563002: Media Galleries Partial Deprecation: Remove scan functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 os.path 5 import os.path
6 6
7 from json_parse import OrderedDict 7 from json_parse import OrderedDict
8 from memoize import memoize 8 from memoize import memoize
9 9
10 10
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 self.name = name 296 self.name = name
297 self.simple_name = _StripNamespace(self.name, namespace) 297 self.simple_name = _StripNamespace(self.name, namespace)
298 self.platforms = _GetPlatforms(json) 298 self.platforms = _GetPlatforms(json)
299 self.params = [] 299 self.params = []
300 self.description = json.get('description') 300 self.description = json.get('description')
301 self.deprecated = json.get('deprecated') 301 self.deprecated = json.get('deprecated')
302 self.callback = None 302 self.callback = None
303 self.optional = json.get('optional', False) 303 self.optional = json.get('optional', False)
304 self.parent = parent 304 self.parent = parent
305 self.nocompile = json.get('nocompile') 305 self.nocompile = json.get('nocompile')
306 self.nodefine = json.get('nodefine')
306 options = json.get('options', {}) 307 options = json.get('options', {})
307 self.conditions = options.get('conditions', []) 308 self.conditions = options.get('conditions', [])
308 self.actions = options.get('actions', []) 309 self.actions = options.get('actions', [])
309 self.supports_listeners = options.get('supportsListeners', True) 310 self.supports_listeners = options.get('supportsListeners', True)
310 self.supports_rules = options.get('supportsRules', False) 311 self.supports_rules = options.get('supportsRules', False)
311 self.supports_dom = options.get('supportsDom', False) 312 self.supports_dom = options.get('supportsDom', False)
312 313
313 def GeneratePropertyFromParam(p): 314 def GeneratePropertyFromParam(p):
314 return Property(self, p['name'], p, namespace, origin) 315 return Property(self, p['name'], p, namespace, origin)
315 316
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 # Sanity check: platforms should not be an empty list. 608 # Sanity check: platforms should not be an empty list.
608 if not json['platforms']: 609 if not json['platforms']:
609 raise ValueError('"platforms" cannot be an empty list') 610 raise ValueError('"platforms" cannot be an empty list')
610 platforms = [] 611 platforms = []
611 for platform_name in json['platforms']: 612 for platform_name in json['platforms']:
612 for platform_enum in _Enum.GetAll(Platforms): 613 for platform_enum in _Enum.GetAll(Platforms):
613 if platform_name == platform_enum.name: 614 if platform_name == platform_enum.name:
614 platforms.append(platform_enum) 615 platforms.append(platform_enum)
615 break 616 break
616 return platforms 617 return platforms
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/idl_schema_test.py ('k') | tools/json_schema_compiler/test/idl_basics.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698