diff --git a/pddnsc/plugins.py b/pddnsc/plugins.py index 15db193..86466d0 100644 --- a/pddnsc/plugins.py +++ b/pddnsc/plugins.py @@ -3,23 +3,28 @@ from httpx import AsyncHTTPTransport from .base import BaseSourceProvider, BaseFilterProvider, BaseOutputProvider from . import sources -from . import outputs from . import filters +from . import outputs + + +def unused(): + """Чтобы убрать предупреждение о неиспользуемых импортах""" + return sources, filters, outputs def use_plugins(config: dict, ipv4t: AsyncHTTPTransport, ipv6t: AsyncHTTPTransport): """Регистрация всех плагинов указаных в конфигурации""" - for source_name in config["sources"]: + for source_name in config.get("sources", []): BaseSourceProvider.register_provider( source_name, config["sources"][source_name], ipv4t, ipv6t ) - for filter_name in config["filters"]: + for filter_name in config.get("filters", []): BaseFilterProvider.register_provider( filter_name, config["filters"][filter_name], ipv4t, ipv6t ) - for output_name in config["outputs"]: + for output_name in config.get("outputs", []): BaseOutputProvider.register_provider( output_name, config["outputs"][output_name], ipv4t, ipv6t )