From f29e139cbb7e4a4d539cba6e894ef4a6acd312d6 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Wed, 31 May 2023 09:22:00 +0300 Subject: WIP: big refactoring --- test/test_record_upload.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/test_record_upload.py') diff --git a/test/test_record_upload.py b/test/test_record_upload.py index cbd3ca2..835504f 100755 --- a/test/test_record_upload.py +++ b/test/test_record_upload.py @@ -13,7 +13,7 @@ import time from src.home.api import WebAPIClient, RequestParams from src.home.config import config from src.home.media import SoundRecordClient -from src.home.util import parse_addr +from src.home.util import Addr logger = logging.getLogger(__name__) @@ -64,11 +64,11 @@ def api_success_handler(response, name, req: RequestParams): if __name__ == '__main__': - config.load('test_record_upload') + config.load_app('test_record_upload') nodes = {} for name, addr in config['nodes'].items(): - nodes[name] = parse_addr(addr) + nodes[name] = Addr(addr) record = SoundRecordClient(nodes, error_handler=record_error, finished_handler=record_finished, -- cgit v1.2.3 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 --- test/test_record_upload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/test_record_upload.py') diff --git a/test/test_record_upload.py b/test/test_record_upload.py index 835504f..c0daceb 100755 --- a/test/test_record_upload.py +++ b/test/test_record_upload.py @@ -10,7 +10,7 @@ sys.path.extend([ import time -from src.home.api import WebAPIClient, RequestParams +from src.home.api import WebApiClient, RequestParams from src.home.config import config from src.home.media import SoundRecordClient from src.home.util import Addr @@ -74,7 +74,7 @@ if __name__ == '__main__': finished_handler=record_finished, download_on_finish=True) - api = WebAPIClient() + api = WebApiClient() api.enable_async(error_handler=api_error_handler, success_handler=api_success_handler) -- cgit v1.2.3 From a6d8ba93056c1a4e243d56da447e241b2504fae2 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 10 Jun 2023 23:20:37 +0300 Subject: move files again --- test/test_record_upload.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'test/test_record_upload.py') diff --git a/test/test_record_upload.py b/test/test_record_upload.py index c0daceb..f9c83d8 100755 --- a/test/test_record_upload.py +++ b/test/test_record_upload.py @@ -1,19 +1,12 @@ #!/usr/bin/env python3 +import __py_include import logging -import sys -import os.path -sys.path.extend([ - os.path.realpath( - os.path.join(os.path.dirname(os.path.join(__file__)), '..') - ) -]) - import time -from src.home.api import WebApiClient, RequestParams -from src.home.config import config -from src.home.media import SoundRecordClient -from src.home.util import Addr +from homekit.api import WebApiClient, RequestParams +from homekit.config import config +from homekit.media import SoundRecordClient +from homekit.util import Addr logger = logging.getLogger(__name__) -- cgit v1.2.3