From 2ef6d5bbcf98d92afb3c2c77608fba5d4297eaa0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Tue, 31 Jan 2012 10:56:38 +0000 Subject: [PATCH] Add API::getAllInterfaces helper method. --- specs/stdapi.py | 8 ++++++++ trace.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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 -- 2.43.0