From 4191fd0dfe3777ca3aebe8b91e3e58c907e49554 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Aug 2023 13:06:26 +0200 Subject: [PATCH] fix: we do not need special pyodide support (dead code) --- solara/server/pyodide.py | 45 ---------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 solara/server/pyodide.py diff --git a/solara/server/pyodide.py b/solara/server/pyodide.py deleted file mode 100644 index 347cb8b31..000000000 --- a/solara/server/pyodide.py +++ /dev/null @@ -1,45 +0,0 @@ -import json -import logging -from typing import Union - -import js - -from . import app, server -from .websocket import WebsocketWrapper - -connection_id = "single" - -logger = logging.getLogger("solara.server.pyodide") - - -class Websocket(WebsocketWrapper): - def send_text(self, data: str) -> None: - js.sendToPage(data) - - def send_bytes(self, data: bytes) -> None: - js.sendToPage(memoryview(data)) - - def close(self) -> None: - pass - - async def receive(self) -> Union[str, bytes]: - return b"" - - -ws = Websocket() - - -def start(app_name): - logger - app.apps["__default__"].close() - app.apps["__default__"] = app.AppScript(app_name) - app.initialize_virtual_kernel(connection_id, ws) - - -async def processKernelMessage(msg): - msg = json.loads(msg) - context = app.contexts[connection_id] - kernel = context.kernel - with context: - server.process_kernel_messages(kernel, msg) - return 42