| 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 generates Dart APIs from the IDL database.""" | 6 """This module generates Dart APIs from the IDL database.""" |
| 7 | 7 |
| 8 import emitter | 8 import emitter |
| 9 import idlnode | 9 import idlnode |
| 10 import logging | 10 import logging |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 for parent in parents: | 345 for parent in parents: |
| 346 if IsDartCollectionType(parent.type.id): | 346 if IsDartCollectionType(parent.type.id): |
| 347 result.append(parent.type.id) | 347 result.append(parent.type.id) |
| 348 continue | 348 continue |
| 349 if self._database.HasInterface(parent.type.id): | 349 if self._database.HasInterface(parent.type.id): |
| 350 parent_interface = self._database.GetInterface(parent.type.id) | 350 parent_interface = self._database.GetInterface(parent.type.id) |
| 351 result.append(parent_interface) | 351 result.append(parent_interface) |
| 352 walk(parent_interface.parents) | 352 walk(parent_interface.parents) |
| 353 | 353 |
| 354 result = [] | 354 result = [] |
| 355 walk(interface.parents[1:]) | 355 if interface.parents: |
| 356 parent = interface.parents[0] |
| 357 if IsPureInterface(parent.type.id): |
| 358 walk(interface.parents) |
| 359 else: |
| 360 walk(interface.parents[1:]) |
| 356 return result; | 361 return result; |
| 357 | 362 |
| 358 | 363 |
| 359 def _CollectExceptions(self, interfaces): | 364 def _CollectExceptions(self, interfaces): |
| 360 """Returns the names of all exception classes raised.""" | 365 """Returns the names of all exception classes raised.""" |
| 361 exceptions = set() | 366 exceptions = set() |
| 362 for interface in interfaces: | 367 for interface in interfaces: |
| 363 for attribute in interface.attributes: | 368 for attribute in interface.attributes: |
| 364 if attribute.get_raises: | 369 if attribute.get_raises: |
| 365 exceptions.add(attribute.get_raises.id) | 370 exceptions.add(attribute.get_raises.id) |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 pass | 487 pass |
| 483 | 488 |
| 484 def AddOperation(self, info): | 489 def AddOperation(self, info): |
| 485 pass | 490 pass |
| 486 | 491 |
| 487 def AddStaticOperation(self, info): | 492 def AddStaticOperation(self, info): |
| 488 pass | 493 pass |
| 489 | 494 |
| 490 def AddEventAttributes(self, event_attrs): | 495 def AddEventAttributes(self, event_attrs): |
| 491 pass | 496 pass |
| OLD | NEW |