| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, 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 """Module to manage IDL files.""" | 6 """Module to manage IDL files.""" |
| 7 | 7 |
| 8 import copy | 8 import copy |
| 9 import pickle | 9 import pickle |
| 10 import logging | 10 import logging |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 raise RuntimeError('Interface %s not found' % interface_name) | 218 raise RuntimeError('Interface %s not found' % interface_name) |
| 219 self._interfaces_to_delete.append(interface_name) | 219 self._interfaces_to_delete.append(interface_name) |
| 220 del self._all_interfaces[interface_name] | 220 del self._all_interfaces[interface_name] |
| 221 | 221 |
| 222 def _DeleteInterfaceFile(self, interface_name): | 222 def _DeleteInterfaceFile(self, interface_name): |
| 223 """Actual file deletion""" | 223 """Actual file deletion""" |
| 224 file_path = self._FilePath(interface_name) | 224 file_path = self._FilePath(interface_name) |
| 225 if os.path.exists(file_path): | 225 if os.path.exists(file_path): |
| 226 _logger.debug('deleting %s' % file_path) | 226 _logger.debug('deleting %s' % file_path) |
| 227 os.remove(file_path) | 227 os.remove(file_path) |
| 228 |
| 229 def Hierarchy(self, interface): |
| 230 yield interface |
| 231 for parent in interface.parents: |
| 232 parent_name = parent.type.id |
| 233 if not self.HasInterface(parent.type.id): |
| 234 continue |
| 235 for parent_interface in self.Hierarchy(self.GetInterface(parent.type.id)): |
| 236 yield parent_interface |
| OLD | NEW |