]> git.cworth.org Git - apitrace/commitdiff
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 a1b382f7d3b3d91d58d6066342754af6b20399f3..61e2b21b756e2f241f2d8a7b130e07f18fbce58c 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 ec91d7ef2f81b8d3b06ed36f442246f8d942ee32..0d973a21082bcd1989feeb9b39ad969c1a7a09bc 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