python-fasthtml 0.6.12__tar.gz → 0.6.13__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.6.12/python_fasthtml.egg-info → python-fasthtml-0.6.13}/PKG-INFO +1 -1
- python-fasthtml-0.6.13/fasthtml/__init__.py +2 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/components.py +1 -1
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/core.py +4 -2
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/svg.py +2 -2
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13/python_fasthtml.egg-info}/PKG-INFO +1 -1
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/settings.ini +1 -1
- python-fasthtml-0.6.12/fasthtml/__init__.py +0 -2
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/CONTRIBUTING.md +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/LICENSE +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/MANIFEST.in +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/README.md +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/_modidx.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/authmw.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/basics.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/cli.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/common.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/components.pyi +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/core.pyi +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/fastapp.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/ft.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/js.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/jupyter.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/katex.js +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/live_reload.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/oauth.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/pico.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/starlette.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/toaster.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/xtend.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/xtend.pyi +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/pyproject.toml +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/SOURCES.txt +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/dependency_links.txt +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/entry_points.txt +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/not-zip-safe +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/requires.txt +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/top_level.txt +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/setup.cfg +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/setup.py +0 -0
- {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/tests/test_toaster.py +0 -0
|
@@ -175,6 +175,7 @@ async def _find_p(req, arg:str, p:Parameter):
|
|
|
175
175
|
if anno is empty:
|
|
176
176
|
if 'request'.startswith(arg.lower()): return req
|
|
177
177
|
if 'session'.startswith(arg.lower()): return req.scope.get('session', {})
|
|
178
|
+
if arg.lower()=='scope': return dict2obj(req.scope)
|
|
178
179
|
if arg.lower()=='auth': return req.scope.get('auth', None)
|
|
179
180
|
if arg.lower()=='htmx': return _get_htmx(req.headers)
|
|
180
181
|
if arg.lower()=='app': return req.scope['app']
|
|
@@ -229,6 +230,7 @@ def _find_wsp(ws, data, hdrs, arg:str, p:Parameter):
|
|
|
229
230
|
if issubclass(anno, Starlette): return ws.scope['app']
|
|
230
231
|
if anno is empty:
|
|
231
232
|
if arg.lower()=='ws': return ws
|
|
233
|
+
if arg.lower()=='scope': return dict2obj(ws.scope)
|
|
232
234
|
if arg.lower()=='data': return data
|
|
233
235
|
if arg.lower()=='htmx': return _get_htmx(hdrs)
|
|
234
236
|
if arg.lower()=='app': return ws.scope['app']
|
|
@@ -554,8 +556,8 @@ class FastHTML(Starlette):
|
|
|
554
556
|
|
|
555
557
|
def ws(self, path:str, conn=None, disconn=None, name=None):
|
|
556
558
|
"Add a websocket route at `path`"
|
|
557
|
-
def f(func):
|
|
558
|
-
self.router.add_ws(path, func, conn=conn, disconn=disconn, name=name)
|
|
559
|
+
def f(func=None):
|
|
560
|
+
self.router.add_ws(path, func or noop, conn=conn, disconn=disconn, name=name)
|
|
559
561
|
return func
|
|
560
562
|
return f
|
|
561
563
|
|
|
@@ -31,12 +31,12 @@ g = globals()
|
|
|
31
31
|
for o in _all_: g[o] = partial(ft_hx, o[0].lower() + o[1:])
|
|
32
32
|
|
|
33
33
|
# %% ../nbs/api/05_svg.ipynb
|
|
34
|
-
def Svg(*args, viewBox=None, h=None, w=None, height=None, width=None, **kwargs):
|
|
34
|
+
def Svg(*args, viewBox=None, h=None, w=None, height=None, width=None, xmlns="http://www.w3.org/2000/svg", **kwargs):
|
|
35
35
|
"An SVG tag; xmlns is added automatically, and viewBox defaults to height and width if not provided"
|
|
36
36
|
if h: height=h
|
|
37
37
|
if w: width=w
|
|
38
38
|
if not viewBox and height and width: viewBox=f'0 0 {width} {height}'
|
|
39
|
-
return ft_svg('svg', *args, xmlns=
|
|
39
|
+
return ft_svg('svg', *args, xmlns=xmlns, viewBox=viewBox, height=height, width=width, **kwargs)
|
|
40
40
|
|
|
41
41
|
# %% ../nbs/api/05_svg.ipynb
|
|
42
42
|
@delegates(ft_hx)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[DEFAULT]
|
|
2
2
|
repo = fasthtml
|
|
3
3
|
lib_name = fasthtml
|
|
4
|
-
version = 0.6.
|
|
4
|
+
version = 0.6.13
|
|
5
5
|
min_python = 3.10
|
|
6
6
|
license = apache2
|
|
7
7
|
requirements = fastcore>=1.7.15 python-dateutil starlette>0.33 oauthlib itsdangerous uvicorn[standard]>=0.30 httpx fastlite>=0.0.9 python-multipart beautifulsoup4
|
|
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.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|