From 7f88e4ffdde0595bc64ace916bfb8cc42e24cf28 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Wed, 28 Jan 2015 14:50:48 +0200 Subject: [PATCH] Adding possibility to get all providers by type from catalog --- objects/catalog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/objects/catalog.py b/objects/catalog.py index bd265052..56826245 100644 --- a/objects/catalog.py +++ b/objects/catalog.py @@ -33,14 +33,14 @@ class AbstractCatalog(object): return attribute @classmethod - def __all_providers__(cls): + def __all_providers__(cls, provider_type=Provider): """ Returns set of all class providers. """ providers = set() for attr_name in set(dir(cls)) - set(dir(AbstractCatalog)): provider = getattr(cls, attr_name) - if not isinstance(provider, Provider): + if not isinstance(provider, provider_type): continue providers.add((attr_name, provider)) return providers