mirror of
https://github.com/Textualize/textual-serve.git
synced 2025-10-17 02:50:37 +03:00
simplify
This commit is contained in:
@@ -40,8 +40,6 @@ class DictionaryApp(App):
|
||||
"""Looks up a word."""
|
||||
url = f"https://api.dictionaryapi.dev/api/v2/entries/en/{word}"
|
||||
|
||||
1 / 0
|
||||
|
||||
async with httpx.AsyncClient() as client:
|
||||
response = await client.get(url)
|
||||
try:
|
||||
|
||||
@@ -176,14 +176,11 @@ class Server:
|
||||
try:
|
||||
await websocket.prepare(request)
|
||||
|
||||
async def on_close():
|
||||
await websocket.close()
|
||||
|
||||
app_service = AppService(
|
||||
self.command,
|
||||
write_bytes=websocket.send_bytes,
|
||||
write_str=websocket.send_str,
|
||||
close=on_close,
|
||||
close=websocket.close,
|
||||
debug=self.debug,
|
||||
)
|
||||
await app_service.start(width, height)
|
||||
|
||||
Reference in New Issue
Block a user