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

Unified Diff: lib/html/scripts/htmleventgenerator.py

Issue 11034022: Make event renames optional, not mandatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/htmleventgenerator.py
diff --git a/lib/html/scripts/htmleventgenerator.py b/lib/html/scripts/htmleventgenerator.py
index 95d82b313f35706bb957ecc8bd6c3881944a60fb..cfc40fe7ce75fca9a0f62b10adeb6f1774d6f7ec 100644
--- a/lib/html/scripts/htmleventgenerator.py
+++ b/lib/html/scripts/htmleventgenerator.py
@@ -5,6 +5,10 @@
"""This module provides functionality to generate dart:html event classes."""
+import logging
+
+_logger = logging.getLogger('dartgenerator')
+
# Events without onEventName attributes in the IDL we want to support.
# We can automatically extract most event names by checking for
# onEventName methods in the IDL but some events aren't listed so we need
@@ -230,11 +234,11 @@ class HtmlEventGenerator(object):
dom_event_names.add(dom_name)
if html_interface_name in _html_manual_events:
dom_event_names.update(_html_manual_events[html_interface_name])
- dom_event_names = sorted(dom_event_names,
- key=lambda name: _html_event_names[name])
- for dom_name in dom_event_names:
+ for dom_name in sorted(dom_event_names):
podivilov 2012/10/02 15:26:54 Doesn't it change the events order?
Anton Muhin 2012/10/02 15:31:46 It might a bit, but I am not sure it's principal:
podivilov 2012/10/02 15:39:17 Looks like ordering is broken now. I vote for not
if dom_name not in _html_event_names:
- raise Exception('No known html even name for event: ' + dom_name)
+ _logger.warn('omitting %s event as there is no HTML name for it' % dom_name)
+ continue
+
html_name = _html_event_names[dom_name]
interface_events_members.Emit('\n EventListenerList get $NAME;\n',
NAME=html_name)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698