diff options
author | Maxim Devaev <[email protected]> | 2023-04-29 05:15:28 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-04-29 05:15:28 +0300 |
commit | b5d67314977a7e475fac164446031ca7c83b8bc4 (patch) | |
tree | 4e159159291953036a1137c4b19f4aefbc0a9f7b /kvmd/apps | |
parent | 12422fa1ff460d711098723ca677d6976e8bebe5 (diff) |
refactoring
Diffstat (limited to 'kvmd/apps')
-rw-r--r-- | kvmd/apps/kvmd/__init__.py | 4 | ||||
-rw-r--r-- | kvmd/apps/kvmd/api/streamer.py | 4 | ||||
-rw-r--r-- | kvmd/apps/kvmd/ocr.py (renamed from kvmd/apps/kvmd/tesseract.py) | 2 | ||||
-rw-r--r-- | kvmd/apps/kvmd/server.py | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/kvmd/apps/kvmd/__init__.py b/kvmd/apps/kvmd/__init__.py index a90cd30b..629f90d5 100644 --- a/kvmd/apps/kvmd/__init__.py +++ b/kvmd/apps/kvmd/__init__.py @@ -34,7 +34,7 @@ from .logreader import LogReader from .ugpio import UserGpio from .streamer import Streamer from .snapshoter import Snapshoter -from .tesseract import TesseractOcr +from .ocr import Ocr from .server import KvmdServer @@ -88,7 +88,7 @@ def main(argv: (list[str] | None)=None) -> None: info_manager=InfoManager(global_config), log_reader=(LogReader() if config.log_reader.enabled else None), user_gpio=UserGpio(config.gpio, global_config.otg), - ocr=TesseractOcr(**config.ocr._unpack()), + ocr=Ocr(**config.ocr._unpack()), hid=hid, atx=get_atx_class(config.atx.type)(**config.atx._unpack(ignore=["type"])), diff --git a/kvmd/apps/kvmd/api/streamer.py b/kvmd/apps/kvmd/api/streamer.py index 3030a925..37befda5 100644 --- a/kvmd/apps/kvmd/api/streamer.py +++ b/kvmd/apps/kvmd/api/streamer.py @@ -36,12 +36,12 @@ from ....validators.kvm import valid_stream_quality from ..streamer import Streamer -from ..tesseract import TesseractOcr +from ..ocr import Ocr # ===== class StreamerApi: - def __init__(self, streamer: Streamer, ocr: TesseractOcr) -> None: + def __init__(self, streamer: Streamer, ocr: Ocr) -> None: self.__streamer = streamer self.__ocr = ocr diff --git a/kvmd/apps/kvmd/tesseract.py b/kvmd/apps/kvmd/ocr.py index fff4df2d..c6794340 100644 --- a/kvmd/apps/kvmd/tesseract.py +++ b/kvmd/apps/kvmd/ocr.py @@ -103,7 +103,7 @@ _LANG_SUFFIX = ".traineddata" # ===== -class TesseractOcr: +class Ocr: def __init__(self, data_dir_path: str, default_langs: list[str]) -> None: self.__data_dir_path = data_dir_path self.__default_langs = default_langs diff --git a/kvmd/apps/kvmd/server.py b/kvmd/apps/kvmd/server.py index c02999e4..7305fed9 100644 --- a/kvmd/apps/kvmd/server.py +++ b/kvmd/apps/kvmd/server.py @@ -69,7 +69,7 @@ from .logreader import LogReader from .ugpio import UserGpio from .streamer import Streamer from .snapshoter import Snapshoter -from .tesseract import TesseractOcr +from .ocr import Ocr from .api.auth import AuthApi from .api.auth import check_request_auth @@ -130,7 +130,7 @@ class KvmdServer(HttpServer): # pylint: disable=too-many-arguments,too-many-ins info_manager: InfoManager, log_reader: (LogReader | None), user_gpio: UserGpio, - ocr: TesseractOcr, + ocr: Ocr, hid: BaseHid, atx: BaseAtx, |