Spaces:
Build error
Build error
Download flet_extensions.py from Hypecat/ChessCommanderFlet: direct link, hf CLI and curl.
- Browser
- Download file 436 Bytes
-
https://huggingface.co/spaces/Hypecat/ChessCommanderFlet/resolve/main/flet_extensions.py
- Command line
-
hf download hf://spaces/Hypecat/ChessCommanderFlet/flet_extensions.py
-
curl -L -o flet_extensions.py https://huggingface.co/spaces/Hypecat/ChessCommanderFlet/resolve/main/flet_extensions.py
436 Bytes
| import flet as ft | |
| from js_execution import js_execution_router | |
| async def eval_js(self: ft.Page, js_code: str) -> str: | |
| async with js_execution_router.create_dynamic_endpoint(js_code) as context: | |
| self.launch_url(context.endpoint, web_window_name=context.hidden_iframe_name) | |
| return await context.result_future | |
| def extend_flet_page(): | |
| if not hasattr(ft.Page, 'eval_js'): | |
| ft.Page.eval_js = eval_js |