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

Unified Diff: bindings/scripts/idl_reader.py

Issue 551053003: Roll IDL Dartium37 (r181477) (Closed) Base URL: https://dart.googlecode.com/svn/third_party/WebCore
Patch Set: Created 6 years, 3 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 | « bindings/dart/scripts/dart_utilities.py ('k') | core/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bindings/scripts/idl_reader.py
diff --git a/bindings/scripts/idl_reader.py b/bindings/scripts/idl_reader.py
index 450c73d9f29a08148fcdbded7a51264b04eae2b1..38286682420e23055e61316665b672f7b153447c 100644
--- a/bindings/scripts/idl_reader.py
+++ b/bindings/scripts/idl_reader.py
@@ -42,7 +42,8 @@ from interface_dependency_resolver import InterfaceDependencyResolver
class IdlReader(object):
- def __init__(self, interfaces_info=None, outputdir=''):
+ def __init__(self, interfaces_info=None, outputdir='', multi_interface=False):
+ self.multi_interface = multi_interface
self.extended_attribute_validator = IDLExtendedAttributeValidator()
if interfaces_info:
@@ -71,23 +72,27 @@ class IdlReader(object):
raise Exception('Failed to parse %s' % idl_filename)
definitions = IdlDefinitions(ast)
- # Validate file contents with filename convention
- # The Blink IDL filenaming convention is that the file
- # <interface_name>.idl MUST contain exactly 1 interface (or exception),
- # and the interface name must agree with the file's basename,
- # unless it is a partial interface.
- # (e.g., 'partial interface Foo' can be in FooBar.idl).
- number_of_interfaces = len(definitions.interfaces)
- if number_of_interfaces != 1:
- raise Exception(
- 'Expected exactly 1 interface in file {0}, but found {1}'
- .format(idl_filename, number_of_interfaces))
- interface = next(definitions.interfaces.itervalues())
- idl_file_basename, _ = os.path.splitext(os.path.basename(idl_filename))
- if not interface.is_partial and interface.name != idl_file_basename:
- raise Exception(
- 'Interface name "{0}" disagrees with IDL file basename "{1}".'
- .format(interface.name, idl_file_basename))
+ if not self.multi_interface:
+ # Validate file contents with filename convention
+ # The Blink IDL filenaming convention is that the file
+ # <interface_name>.idl MUST contain exactly 1 interface (or exception),
+ # and the interface name must agree with the file's basename,
+ # unless it is a partial interface.
+ # (e.g., 'partial interface Foo' can be in FooBar.idl).
+ number_of_interfaces = len(definitions.interfaces)
+ if number_of_interfaces != 1:
+ raise Exception(
+ 'Expected exactly 1 interface in file {0}, but found {1}'
+ .format(idl_filename, number_of_interfaces))
+ interface = next(definitions.interfaces.itervalues())
+ idl_file_basename, _ = os.path.splitext(os.path.basename(idl_filename))
+ if not interface.is_partial and interface.name != idl_file_basename:
+ raise Exception(
+ 'Interface name "{0}" disagrees with IDL file basename "{1}".'
+ .format(interface.name, idl_file_basename))
+ else:
+ if len(definitions.interfaces) > 1:
+ print '----- Supplemental interfaces %s' % len(definitions.interfaces)
# Validate extended attributes
if not self.extended_attribute_validator:
« no previous file with comments | « bindings/dart/scripts/dart_utilities.py ('k') | core/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698