Add API::getAllInterfaces helper method.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 31 Jan 2012 10:56:38 +0000 (10:56 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 31 Jan 2012 10:56:38 +0000 (10:56 +0000)
specs/stdapi.py
trace.py

index a1b382f..61e2b21 100644 (file)
@@ -661,6 +661,14 @@ class API:
                 collector.visit(method.type)
         return collector.types
 
+    def getAllInterfaces(self):
+        types = self.getAllTypes()
+        interfaces = [type for type in types if isinstance(type, Interface)]
+        for interface in self.interfaces:
+            if interface not in interfaces:
+                interfaces.append(interface)
+        return interfaces
+
     def addFunction(self, function):
         self.functions.append(function)
 
index ec91d7e..0d973a2 100644 (file)
--- a/trace.py
+++ b/trace.py
@@ -327,7 +327,7 @@ class Tracer:
         print
 
         # Interfaces wrapers
-        interfaces = [type for type in types if isinstance(type, stdapi.Interface)]
+        interfaces = api.getAllInterfaces()
         map(self.declareWrapperInterface, interfaces)
         map(self.implementWrapperInterface, interfaces)
         print