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 json | 6 import json |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 from collections import defaultdict, Mapping | 9 from collections import defaultdict, Mapping |
10 | 10 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 'description': self._FormatDescription(event.description), | 196 'description': self._FormatDescription(event.description), |
197 'filters': [self._GenerateProperty(f) for f in event.filters], | 197 'filters': [self._GenerateProperty(f) for f in event.filters], |
198 'conditions': [self._GetLink(condition) | 198 'conditions': [self._GetLink(condition) |
199 for condition in event.conditions], | 199 for condition in event.conditions], |
200 'actions': [self._GetLink(action) for action in event.actions], | 200 'actions': [self._GetLink(action) for action in event.actions], |
201 'supportsRules': event.supports_rules, | 201 'supportsRules': event.supports_rules, |
202 'supportsListeners': event.supports_listeners, | 202 'supportsListeners': event.supports_listeners, |
203 'properties': [], | 203 'properties': [], |
204 'id': _CreateId(event, 'event') | 204 'id': _CreateId(event, 'event') |
205 } | 205 } |
206 if (event.deprecated is not None): | |
not at google - send to devlin
2013/10/31 20:23:13
no need for parens
dhnishi (use Chromium)
2013/10/31 21:29:23
Done.
| |
207 event_dict['deprecated'] = self._FormatDescription( | |
208 event.deprecated) | |
206 if (event.parent is not None and | 209 if (event.parent is not None and |
207 not isinstance(event.parent, model.Namespace)): | 210 not isinstance(event.parent, model.Namespace)): |
208 event_dict['parentName'] = event.parent.simple_name | 211 event_dict['parentName'] = event.parent.simple_name |
209 # For the addRules method we can use the common definition, because addRules | 212 # For the addRules method we can use the common definition, because addRules |
210 # has the same signature for every event. | 213 # has the same signature for every event. |
211 if event.supports_rules: | 214 if event.supports_rules: |
212 event_dict['addRulesFunction'] = self._add_rules_schema_function() | 215 event_dict['addRulesFunction'] = self._add_rules_schema_function() |
213 # We need to create the method description for addListener based on the | 216 # We need to create the method description for addListener based on the |
214 # information stored in |event|. | 217 # information stored in |event|. |
215 if event.supports_listeners: | 218 if event.supports_listeners: |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
649 | 652 |
650 if self._disable_refs: | 653 if self._disable_refs: |
651 cache, ext = ( | 654 cache, ext = ( |
652 (self._idl_cache_no_refs, '.idl') if (unix_name in idl_names) else | 655 (self._idl_cache_no_refs, '.idl') if (unix_name in idl_names) else |
653 (self._json_cache_no_refs, '.json')) | 656 (self._json_cache_no_refs, '.json')) |
654 else: | 657 else: |
655 cache, ext = ((self._idl_cache, '.idl') if (unix_name in idl_names) else | 658 cache, ext = ((self._idl_cache, '.idl') if (unix_name in idl_names) else |
656 (self._json_cache, '.json')) | 659 (self._json_cache, '.json')) |
657 return self._GenerateHandlebarContext( | 660 return self._GenerateHandlebarContext( |
658 cache.GetFromFile('%s/%s%s' % (self._base_path, unix_name, ext)).Get()) | 661 cache.GetFromFile('%s/%s%s' % (self._base_path, unix_name, ext)).Get()) |
OLD | NEW |