From: José Fonseca Date: Tue, 31 Jan 2012 10:56:38 +0000 (+0000) Subject: Add API::getAllInterfaces helper method. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;ds=sidebyside;h=2ef6d5bbcf98d92afb3c2c77608fba5d4297eaa0;p=apitrace Add API::getAllInterfaces helper method. --- diff --git a/specs/stdapi.py b/specs/stdapi.py index a1b382f..61e2b21 100644 --- a/specs/stdapi.py +++ b/specs/stdapi.py @@ -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) diff --git a/trace.py b/trace.py index ec91d7e..0d973a2 100644 --- 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