From c19bffde4df5c879d11ec7ea97b4fa30a07db992 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 28 May 2024 17:56:54 +0200 Subject: [fix] issues reported by pylint-3.2.2 Signed-off-by: Markus Heiser --- searx/infopage/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'searx/infopage') diff --git a/searx/infopage/__init__.py b/searx/infopage/__init__.py index 3f9426beb..1d556d6d2 100644 --- a/searx/infopage/__init__.py +++ b/searx/infopage/__init__.py @@ -17,6 +17,8 @@ Usage in a Flask app route: """ +from __future__ import annotations + __all__ = ['InfoPage', 'InfoPageSet'] import os @@ -37,6 +39,16 @@ from ..locales import LOCALE_NAMES logger = logging.getLogger('searx.infopage') _INFO_FOLDER = os.path.abspath(os.path.dirname(__file__)) +INFO_PAGES: 'InfoPageSet' + + +def __getattr__(name): + if name == 'INFO_PAGES': + global INFO_PAGES # pylint: disable=global-statement + INFO_PAGES = InfoPageSet() + return INFO_PAGES + + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") class InfoPage: -- cgit v1.2.3