python-fasthtml 0.14.19__tar.gz → 0.14.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_fasthtml-0.14.19/python_fasthtml.egg-info → python_fasthtml-0.14.21}/PKG-INFO +1 -1
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/__init__.py +1 -1
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/core.py +3 -1
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/jupyter.py +5 -3
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21/python_fasthtml.egg-info}/PKG-INFO +1 -1
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/CONTRIBUTING.md +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/LICENSE +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/MANIFEST.in +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/README.md +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/_modidx.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/authmw.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/basics.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/cli.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/common.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/components.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/components.pyi +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/core.pyi +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/fastapp.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/ft.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/js.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/katex.js +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/live_reload.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/oauth.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/pico.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/starlette.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/stripe_otp.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/svg.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/toaster.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/xtend.py +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/fasthtml/xtend.pyi +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/pyproject.toml +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/python_fasthtml.egg-info/SOURCES.txt +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/python_fasthtml.egg-info/dependency_links.txt +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/python_fasthtml.egg-info/entry_points.txt +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/python_fasthtml.egg-info/requires.txt +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/python_fasthtml.egg-info/top_level.txt +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/setup.cfg +0 -0
- {python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/tests/test_toaster.py +0 -0
|
@@ -607,7 +607,9 @@ def _wrap_ex(f, status_code, hdrs, ftrs, htmlkw, bodykw, body_wrap):
|
|
|
607
607
|
req.hdrs,req.ftrs,req.htmlkw,req.bodykw = map(deepcopy, (hdrs, ftrs, htmlkw, bodykw))
|
|
608
608
|
req.body_wrap = body_wrap
|
|
609
609
|
res = await _handle(f, req, exc)
|
|
610
|
-
|
|
610
|
+
code = status_code if isinstance(status_code, int) else getattr(exc, 'status_code', 500)
|
|
611
|
+
if not isinstance(code, int): code = 500
|
|
612
|
+
return _resp(req, res, status_code=code)
|
|
611
613
|
return _f
|
|
612
614
|
|
|
613
615
|
# %% ../nbs/api/00_core.ipynb #bc323fd4
|
|
@@ -8,7 +8,7 @@ Docs: https://www.fastht.ml/docs/api/jupyter.html.md"""
|
|
|
8
8
|
__all__ = ['nb_serve', 'nb_serve_async', 'show', 'render_ft', 'htmx_config_port', 'JupyUvi', 'JupyUviAsync', 'HTMX', 'ws_client']
|
|
9
9
|
|
|
10
10
|
# %% ../nbs/api/06_jupyter.ipynb #2c69d9d0
|
|
11
|
-
import asyncio, time, uvicorn
|
|
11
|
+
import asyncio, json, time, uvicorn
|
|
12
12
|
from threading import Thread
|
|
13
13
|
from fastcore.utils import *
|
|
14
14
|
from fastcore.meta import delegates
|
|
@@ -48,8 +48,10 @@ def render_ft(**kw):
|
|
|
48
48
|
"Call once in a notebook or solveit dialog to auto-render components with HTMX support"
|
|
49
49
|
@patch
|
|
50
50
|
def _repr_html_(self:FT):
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
uid = unqid()
|
|
52
|
+
selector = json.dumps(f'[data-ft-output="{uid}"]')
|
|
53
|
+
scr = Script(f'if (window.htmx) htmx.process(document.querySelector({selector}))')
|
|
54
|
+
return to_xml(Div(self, scr, **(kw | {'data-ft-output': uid})))
|
|
53
55
|
|
|
54
56
|
# %% ../nbs/api/06_jupyter.ipynb #1daaa0e1
|
|
55
57
|
def htmx_config_port(port=8000):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/python_fasthtml.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{python_fasthtml-0.14.19 → python_fasthtml-0.14.21}/python_fasthtml.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|