refactor: use factory functions for hotkey and inserter in main

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vitali Graf
2026-04-08 10:38:56 +02:00
parent fc96e9a10c
commit 45ad54a79c
2 changed files with 18 additions and 18 deletions
+4 -4
View File
@@ -5,8 +5,8 @@ import logging
import sys
from whisper_local.config import Config, load_config
from whisper_local.hotkey import HotkeyListener
from whisper_local.inserter import Inserter
from whisper_local.hotkey import create_listener
from whisper_local.inserter import create_inserter
from whisper_local.recorder import Recorder
from whisper_local.transcriber import Transcriber
@@ -28,8 +28,8 @@ class App:
compute_type=config.compute_type,
language=config.language,
)
self.inserter = Inserter()
self.hotkey = HotkeyListener(key_name=config.hotkey)
self.inserter = create_inserter()
self.hotkey = create_listener(key_name=config.hotkey)
self.hotkey.on_press = self.on_press
self.hotkey.on_release = self.on_release