diff --git a/weboob/core/modules.py b/weboob/core/modules.py index 0ed2bc3b..c48c2461 100644 --- a/weboob/core/modules.py +++ b/weboob/core/modules.py @@ -82,9 +82,7 @@ class Module(object): return self.klass.ICON def iter_caps(self): - for cap in self.klass.__bases__: - if issubclass(cap, IBaseCap) and cap != IBaseCap: - yield cap + return self.klass.iter_caps() def has_caps(self, *caps): for c in caps: diff --git a/weboob/tools/backend.py b/weboob/tools/backend.py index 9bd3e4b1..54d1463f 100644 --- a/weboob/tools/backend.py +++ b/weboob/tools/backend.py @@ -193,10 +193,15 @@ class BaseBackend(object): return self.BROWSER(*args, **kwargs) - def iter_caps(self): - for cap in self.__class__.__bases__: - if issubclass(cap, IBaseCap) and cap != IBaseCap: - yield cap + @classmethod + def iter_caps(klass): + def iter_caps(cls): + for base in cls.__bases__: + if issubclass(base, IBaseCap) and base != IBaseCap: + yield base + for cap in iter_caps(base): + yield cap + return iter_caps(klass) def has_caps(self, *caps): for c in caps: