def get_providers(cls, config_providers): """ config is the application configuration """ providers = [] for provider_name, v in config_providers.iteritems(): try: prov = ProviderFactory.get_provider(provider_name) prov.provider_name = provider_name providers.append(prov) except ProviderConfigurationError: logger.error("Unable to configure provider ... skipping " + str(v)) return providers
def get_providers(cls, config_providers, filter_by=None): """ config is the application configuration """ providers = [] for provider_name, v in config_providers: try: prov = ProviderFactory.get_provider(provider_name) prov.provider_name = provider_name providers.append(prov) if filter_by is not None: if not getattr(prov, "provides_"+filter_by): providers.pop() except ProviderConfigurationError: logger.error(u"Unable to configure provider ... skipping " + str(v)) return providers
def get_providers(cls, config_providers, filter_by=None): """ config is the application configuration """ providers = [] for provider_name, v in config_providers: try: prov = ProviderFactory.get_provider(provider_name) prov.provider_name = provider_name providers.append(prov) if filter_by is not None: if not getattr(prov, "provides_" + filter_by): providers.pop() except ProviderConfigurationError: logger.error(u"Unable to configure provider ... skipping " + str(v)) return providers