OLD | NEW |
---|---|
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 os.path | 6 import os.path |
7 import re | 7 import re |
8 | 8 |
9 from json_parse import OrderedDict | 9 from json_parse import OrderedDict |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 namespace, | 110 namespace, |
111 origin): | 111 origin): |
112 self.name = name | 112 self.name = name |
113 self.namespace = namespace | 113 self.namespace = namespace |
114 self.simple_name = _StripNamespace(self.name, namespace) | 114 self.simple_name = _StripNamespace(self.name, namespace) |
115 self.unix_name = UnixName(self.name) | 115 self.unix_name = UnixName(self.name) |
116 self.description = json.get('description', None) | 116 self.description = json.get('description', None) |
117 self.origin = origin | 117 self.origin = origin |
118 self.parent = parent | 118 self.parent = parent |
119 self.instance_of = json.get('isInstanceOf', None) | 119 self.instance_of = json.get('isInstanceOf', None) |
120 self.custom_bindings = json.get('customBindings', None) | |
not at google - send to devlin
2013/02/23 00:13:07
what is this change for?
SanjoyPal
2013/02/23 00:19:35
Otherwise i am not able to access type_.custom_bin
not at google - send to devlin
2013/02/23 00:22:55
I had no idea we had that. We shouldn't.
The fix
| |
120 | 121 |
121 # TODO(kalman): Only objects need functions/events/properties, but callers | 122 # TODO(kalman): Only objects need functions/events/properties, but callers |
122 # assume that all types have them. Fix this. | 123 # assume that all types have them. Fix this. |
123 self.functions = _GetFunctions(self, json, namespace) | 124 self.functions = _GetFunctions(self, json, namespace) |
124 self.events = _GetEvents(self, json, namespace) | 125 self.events = _GetEvents(self, json, namespace) |
125 self.properties = _GetProperties(self, json, namespace, origin) | 126 self.properties = _GetProperties(self, json, namespace, origin) |
126 | 127 |
127 json_type = json.get('type', None) | 128 json_type = json.get('type', None) |
128 if json_type == 'array': | 129 if json_type == 'array': |
129 self.property_type = PropertyType.ARRAY | 130 self.property_type = PropertyType.ARRAY |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
458 def _GetPlatforms(json): | 459 def _GetPlatforms(json): |
459 if 'platforms' not in json: | 460 if 'platforms' not in json: |
460 return None | 461 return None |
461 platforms = [] | 462 platforms = [] |
462 for platform_name in json['platforms']: | 463 for platform_name in json['platforms']: |
463 for platform_enum in _Enum.GetAll(Platforms): | 464 for platform_enum in _Enum.GetAll(Platforms): |
464 if platform_name == platform_enum.name: | 465 if platform_name == platform_enum.name: |
465 platforms.append(platform_enum) | 466 platforms.append(platform_enum) |
466 break | 467 break |
467 return platforms | 468 return platforms |
OLD | NEW |