TUI von direkten Service-Importen auf httpx API-Calls umgestellt. Neue tui/api_client.py als schlanker async HTTP-Client. Background- Worker pollt API alle 5s für Echtzeit-Updates. Neuer tui_standalone.py Entry-Point für 'textual serve --port 8001 tui_standalone.py'.
22 lines
497 B
Python
22 lines
497 B
Python
from __future__ import annotations
|
||
|
||
from textual.app import App
|
||
|
||
from tui.api_client import MCMApiClient
|
||
from tui.screens.main_screen import MainScreen
|
||
|
||
|
||
class MCMApp(App):
|
||
"""MCM – MultiCustomerMessenger TUI."""
|
||
|
||
TITLE = "MCM – MultiCustomerMessenger"
|
||
CSS_PATH = "styles.tcss"
|
||
SCREENS = {"main": MainScreen}
|
||
|
||
def __init__(self) -> None:
|
||
super().__init__()
|
||
self._api_client = MCMApiClient()
|
||
|
||
def on_mount(self) -> None:
|
||
self.push_screen("main")
|