refactor: convert inserter module to package with wayland backend

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vitali Graf
2026-04-08 10:34:07 +02:00
parent f9402c427c
commit b47045ab9b
4 changed files with 41 additions and 33 deletions
+19
View File
@@ -0,0 +1,19 @@
"""Text-Einfügung — plattformspezifische Backends hinter gemeinsamem Interface."""
import sys
from typing import Protocol, runtime_checkable
@runtime_checkable
class Inserter(Protocol):
async def insert(self, text: str) -> None: ...
def create_inserter() -> Inserter:
"""Erstellt den plattformspezifischen Inserter."""
if sys.platform == "linux":
from whisper_local.inserter._wayland import WaylandInserter
return WaylandInserter()
else:
from whisper_local.inserter._win32 import Win32Inserter
return Win32Inserter()