Index: Source/bindings/scripts/compute_interfaces_info.py |
diff --git a/Source/bindings/scripts/compute_interfaces_info.py b/Source/bindings/scripts/compute_interfaces_info.py |
index 2333f5c1ff2559314b3dcab6d4a811962d7097cb..9e64cd0d56af4881a5aa40d5d1813ee4e9a43b2d 100755 |
--- a/Source/bindings/scripts/compute_interfaces_info.py |
+++ b/Source/bindings/scripts/compute_interfaces_info.py |
@@ -173,11 +173,16 @@ def compute_individual_info(idl_filename): |
# If not a partial interface, the basename is the interface name |
interface_name, _ = os.path.splitext(os.path.basename(idl_filename)) |
+ # 'implements' statements can be included in either the file for the |
+ # implement*ing* interface (lhs of 'implements') or implement*ed* interface |
+ # (rhs of 'implements'). Store both for now, then merge to implement*ing* |
+ # interface later. |
left_interfaces, right_interfaces = get_implements_from_idl(idl_file_contents, interface_name) |
interfaces_info[interface_name] = { |
'full_path': full_path, |
'implemented_as': implemented_as, |
+ 'implemented_by_interfaces': left_interfaces, # private, merged to next |
'implements_interfaces': right_interfaces, |
'include_path': this_include_path, |
# FIXME: temporary private field, while removing old treatement of |
@@ -193,10 +198,6 @@ def compute_individual_info(idl_filename): |
'referenced_interfaces': get_put_forward_interfaces_from_idl(idl_file_contents), |
} |
- for left_interface_name in left_interfaces: |
- interface_info = interfaces_info[left_interface_name] |
Nils Barth (inactive)
2014/05/08 06:31:45
This fails with
KeyError: 'Window'
...on r-b-t for
|
- interface_info['implements_interfaces'].append(interface_name) |
- |
# Record inheritance information |
inherited_extended_attributes_by_interface[interface_name] = dict( |
(key, value) |
@@ -246,6 +247,15 @@ def compute_interfaces_info(idl_files): |
compute_inheritance_info(interface_name) |
# Compute dependencies |
+ # Move implements info from implement*ed* interface (rhs of 'implements') |
+ # to implement*ing* interface (lhs of 'implements'). |
+ # Note that moving an 'implements' statement between implementing and |
+ # implemented files does not change the info (or hence cause a rebuild)! |
+ for right_interface_name, interface_info in interfaces_info.iteritems(): |
+ for left_interface_name in interface_info['implemented_by_interfaces']: |
+ interfaces_info[left_interface_name]['implements_interfaces'].append(right_interface_name) |
+ del interface_info['implemented_by_interfaces'] |
Nils Barth (inactive)
2014/05/08 06:31:45
We *move* the info, not just copying it, which mea
|
+ |
# An IDL file's dependencies are partial interface files that extend it, |
# and files for other interfaces that this interfaces implements. |
for interface_name, interface_info in interfaces_info.iteritems(): |