| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """This module provides functionality to generate dart:html event classes.""" | 6 """This module provides functionality to generate dart:html event classes.""" |
| 7 | 7 |
| 8 import logging | 8 import logging |
| 9 import monitored | 9 import monitored |
| 10 | 10 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 ELEM_TYPE=elem_type, | 318 ELEM_TYPE=elem_type, |
| 319 NAME=getter_name, | 319 NAME=getter_name, |
| 320 BODY = ('' if emitter == stream_getter_signatures_emitter else | 320 BODY = ('' if emitter == stream_getter_signatures_emitter else |
| 321 ' => %s.%s(this)' % ((('' | 321 ' => %s.%s(this)' % ((('' |
| 322 if emitter != element_stream_getters_emitter else 'Element.') | 322 if emitter != element_stream_getters_emitter else 'Element.') |
| 323 + provider), call_name)), | 323 + provider), call_name)), |
| 324 TYPE=event_type) | 324 TYPE=event_type) |
| 325 | 325 |
| 326 def _GetRawEvents(self, interface): | 326 def _GetRawEvents(self, interface): |
| 327 all_interfaces = ([ interface ] + | 327 all_interfaces = ([ interface ] + |
| 328 self._database.TransitiveSecondaryParents(interface)) | 328 self._database.TransitiveSecondaryParents(interface, |
| 329 False)) |
| 329 events = set([]) | 330 events = set([]) |
| 330 for super_interface in all_interfaces: | 331 for super_interface in all_interfaces: |
| 331 events = events.union( | 332 events = events.union( |
| 332 set([attr.id for attr in super_interface.attributes | 333 set([attr.id for attr in super_interface.attributes |
| 333 if (attr.type.id == 'EventHandler' | 334 if (attr.type.id == 'EventHandler' |
| 334 or attr.type.id == 'EventListener')])) | 335 or attr.type.id == 'EventListener')])) |
| 335 return events | 336 return events |
| 336 | 337 |
| 337 def _GetEvents(self, interface, custom_events): | 338 def _GetEvents(self, interface, custom_events): |
| 338 """ Gets a list of all of the events for the specified interface. | 339 """ Gets a list of all of the events for the specified interface. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 """ | 410 """ |
| 410 key = '%s.%s' % (html_interface_name, dom_event_name) | 411 key = '%s.%s' % (html_interface_name, dom_event_name) |
| 411 if key in _html_event_types: | 412 if key in _html_event_types: |
| 412 return _html_event_types[key] | 413 return _html_event_types[key] |
| 413 key = '*.%s' % dom_event_name | 414 key = '*.%s' % dom_event_name |
| 414 if key in _html_event_types: | 415 if key in _html_event_types: |
| 415 return _html_event_types[key] | 416 return _html_event_types[key] |
| 416 _logger.warn('Cannot resolve event type for %s.%s' % | 417 _logger.warn('Cannot resolve event type for %s.%s' % |
| 417 (html_interface_name, dom_event_name)) | 418 (html_interface_name, dom_event_name)) |
| 418 return None | 419 return None |
| OLD | NEW |