From 3790c2205396cf860738f297e6ddc49cd2b2a03f Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 10 Jun 2023 22:29:24 +0300 Subject: new config: port openwrt_logger and webapiclient --- src/home/api/__init__.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/home/api/__init__.py') diff --git a/src/home/api/__init__.py b/src/home/api/__init__.py index 782a61e..d641f62 100644 --- a/src/home/api/__init__.py +++ b/src/home/api/__init__.py @@ -1,11 +1,19 @@ import importlib -__all__ = ['WebAPIClient', 'RequestParams'] +__all__ = [ + # web_api_client.py + 'WebApiClient', + 'RequestParams', + + # config.py + 'WebApiConfig' +] def __getattr__(name): if name in __all__: - module = importlib.import_module(f'.web_api_client', __name__) + file = 'config' if name == 'WebApiConfig' else 'web_api_client' + module = importlib.import_module(f'.{file}', __name__) return getattr(module, name) raise AttributeError(f"module {__name__!r} has no attribute {name!r}") -- cgit v1.2.3 From b0bf43e6a272d42a55158e657bd937cb82fc3d8d Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 10 Jun 2023 23:02:34 +0300 Subject: move files, rename home package to homekit --- src/home/api/__init__.py | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 src/home/api/__init__.py (limited to 'src/home/api/__init__.py') diff --git a/src/home/api/__init__.py b/src/home/api/__init__.py deleted file mode 100644 index d641f62..0000000 --- a/src/home/api/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -import importlib - -__all__ = [ - # web_api_client.py - 'WebApiClient', - 'RequestParams', - - # config.py - 'WebApiConfig' -] - - -def __getattr__(name): - if name in __all__: - file = 'config' if name == 'WebApiConfig' else 'web_api_client' - module = importlib.import_module(f'.{file}', __name__) - return getattr(module, name) - - raise AttributeError(f"module {__name__!r} has no attribute {name!r}") -- cgit v1.2.3