python-fasthtml 0.14.15__tar.gz → 0.14.16__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.15/python_fasthtml.egg-info → python_fasthtml-0.14.16}/PKG-INFO +1 -1
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/__init__.py +1 -1
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/_modidx.py +1 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/core.py +8 -2
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/xtend.py +3 -2
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16/python_fasthtml.egg-info}/PKG-INFO +1 -1
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/CONTRIBUTING.md +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/LICENSE +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/MANIFEST.in +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/README.md +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/authmw.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/basics.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/cli.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/common.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/components.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/components.pyi +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/core.pyi +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/fastapp.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/ft.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/js.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/jupyter.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/katex.js +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/live_reload.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/oauth.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/pico.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/starlette.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/stripe_otp.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/svg.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/toaster.py +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/fasthtml/xtend.pyi +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/pyproject.toml +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/python_fasthtml.egg-info/SOURCES.txt +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/python_fasthtml.egg-info/dependency_links.txt +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/python_fasthtml.egg-info/entry_points.txt +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/python_fasthtml.egg-info/requires.txt +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/python_fasthtml.egg-info/top_level.txt +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/setup.cfg +0 -0
- {python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/tests/test_toaster.py +0 -0
|
@@ -115,6 +115,7 @@ d = { 'settings': { 'branch': 'main',
|
|
|
115
115
|
'fasthtml.core._form_arg': ('api/core.html#_form_arg', 'fasthtml/core.py'),
|
|
116
116
|
'fasthtml.core._formitem': ('api/core.html#_formitem', 'fasthtml/core.py'),
|
|
117
117
|
'fasthtml.core._from_body': ('api/core.html#_from_body', 'fasthtml/core.py'),
|
|
118
|
+
'fasthtml.core._get_header': ('api/core.html#_get_header', 'fasthtml/core.py'),
|
|
118
119
|
'fasthtml.core._get_htmx': ('api/core.html#_get_htmx', 'fasthtml/core.py'),
|
|
119
120
|
'fasthtml.core._handle': ('api/core.html#_handle', 'fasthtml/core.py'),
|
|
120
121
|
'fasthtml.core._is_body': ('api/core.html#_is_body', 'fasthtml/core.py'),
|
|
@@ -119,8 +119,14 @@ class HtmxHeaders:
|
|
|
119
119
|
trigger_name:str|None=None; trigger:str|None=None
|
|
120
120
|
def __bool__(self): return any(hasattr(self,o) for o in htmx_hdrs)
|
|
121
121
|
|
|
122
|
+
def _get_header(h, k):
|
|
123
|
+
k = k.lower()
|
|
124
|
+
res = h.get(k)
|
|
125
|
+
encoded = h.get(k+'-uri-autoencoded')=='true' or (k=='hx-prompt' and h.get('hx-request-type'))
|
|
126
|
+
return unquote(res) if res is not None and encoded else res
|
|
127
|
+
|
|
122
128
|
def _get_htmx(h):
|
|
123
|
-
res = {k:h
|
|
129
|
+
res = {k:_get_header(h, v) for k,v in htmx_hdrs.items()}
|
|
124
130
|
return HtmxHeaders(**res)
|
|
125
131
|
|
|
126
132
|
# %% ../nbs/api/00_core.ipynb #1d53e8e7
|
|
@@ -293,7 +299,7 @@ async def _find_p(conn, data, hdrs, arg:str, p:Parameter):
|
|
|
293
299
|
# Not a special name or a special annotation
|
|
294
300
|
res = conn.path_params.get(arg, None)
|
|
295
301
|
if res in (empty,None): res = conn.cookies.get(arg, None)
|
|
296
|
-
if res in (empty,None): res = hdrs
|
|
302
|
+
if res in (empty,None): res = _get_header(hdrs, snake2hyphens(arg))
|
|
297
303
|
if res in (empty,None): res = _formitem(conn.query_params, arg)
|
|
298
304
|
if res in (empty,None): res = _formitem(data, arg)
|
|
299
305
|
if res in (empty,None) and isinstance(vals := data.get('values'), dict): res = _formitem(vals, arg) # htmx v4 nests form data under `values`
|
|
@@ -353,8 +353,9 @@ def sitemap_xml(app, urls, loc_base=""):
|
|
|
353
353
|
return Urlset(*urlset, xmlns="http://www.sitemaps.org/schemas/sitemap/0.9")
|
|
354
354
|
|
|
355
355
|
# %% ../nbs/api/02_xtend.ipynb #6a1990ed
|
|
356
|
-
def upload_pb_attrs(id='uploadprog'):
|
|
357
|
-
"Form
|
|
356
|
+
def upload_pb_attrs(id='uploadprog', htmx4=False):
|
|
357
|
+
"Form attrs for an upload progress bar (htmx2) or request indicator (htmx4)"
|
|
358
|
+
if htmx4: return {'hx-indicator': f'#{id}'}
|
|
358
359
|
js = """{ const p=document.getElementById('%s');
|
|
359
360
|
if(event.detail.total) {p.classList.remove('hidden'); p.value=event.detail.loaded/event.detail.total*100} }""" % id
|
|
360
361
|
return {'hx-on::xhr:progress': js}
|
|
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.15 → python_fasthtml-0.14.16}/python_fasthtml.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{python_fasthtml-0.14.15 → python_fasthtml-0.14.16}/python_fasthtml.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|