python-fragments 0.32__tar.gz → 0.33__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_fragments-0.32 → python_fragments-0.33}/PKG-INFO +1 -1
- {python_fragments-0.32 → python_fragments-0.33}/fragments/ast_nodes.py +1 -1
- {python_fragments-0.32 → python_fragments-0.33}/fragments/html/elements.py +1 -1
- {python_fragments-0.32 → python_fragments-0.33}/pyproject.toml +1 -1
- {python_fragments-0.32 → python_fragments-0.33}/python_fragments.egg-info/PKG-INFO +1 -1
- {python_fragments-0.32 → python_fragments-0.33}/tests/test_end_to_end.py +40 -2
- {python_fragments-0.32 → python_fragments-0.33}/LICENSE +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/README.md +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/__init__.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/cli.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/grammar.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/html/__init__.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/loader.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/__init__.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/based_proxy.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/__init__.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/code_actions.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/completion.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/definition.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/diagnostics.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/document_highlight.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/document_symbols.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/folding_range.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/hover.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/inlay_hints.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/lifecycle.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/references.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/rename.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/semantic_tokens.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/signature_help.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/file_state.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/message_queue.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/pyright_notification_handlers/__init__.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/pyright_notification_handlers/capability.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/pyright_notification_handlers/configuration.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/pyright_notification_handlers/diagnostics.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/types.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/source.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/transpiler.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/fragments/types.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/python_fragments.egg-info/SOURCES.txt +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/python_fragments.egg-info/dependency_links.txt +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/python_fragments.egg-info/entry_points.txt +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/python_fragments.egg-info/requires.txt +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/python_fragments.egg-info/top_level.txt +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/setup.cfg +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/tests/test_grammar.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/tests/test_html_elements.py +0 -0
- {python_fragments-0.32 → python_fragments-0.33}/tests/test_source_map.py +0 -0
|
@@ -464,7 +464,7 @@ class ASTHTMLAttribute:
|
|
|
464
464
|
return
|
|
465
465
|
|
|
466
466
|
if self.interpolation is None:
|
|
467
|
-
self.transpiled_content = f
|
|
467
|
+
self.transpiled_content = f"{self.name}"
|
|
468
468
|
self.transpiled_end = self.transpiled_start + len(self.transpiled_content)
|
|
469
469
|
return
|
|
470
470
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-fragments"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.33"
|
|
8
8
|
description = "Modern HTML template rendering in Python"
|
|
9
9
|
authors = [{ name = "The Running Algorithm", email = "services@therunningalgorithm.info" }]
|
|
10
10
|
readme = "README.md"
|
|
@@ -34,7 +34,7 @@ def test_self_closing_element():
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def test_empty_fragment():
|
|
37
|
-
assert render(
|
|
37
|
+
assert render("<></>") == ""
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
# ---------------------------------------------------------------------------
|
|
@@ -131,7 +131,7 @@ def test_component_no_children():
|
|
|
131
131
|
def Badge(children: str, label: str) -> str:
|
|
132
132
|
return f"<span>{label}</span>"
|
|
133
133
|
|
|
134
|
-
result = render(
|
|
134
|
+
result = render('<><Badge label="hi" /></>', Badge=Badge)
|
|
135
135
|
assert result == "<span>hi</span>"
|
|
136
136
|
|
|
137
137
|
|
|
@@ -181,3 +181,41 @@ def test_interpolated_style_dict():
|
|
|
181
181
|
def test_interpolated_style_string():
|
|
182
182
|
result = render("<><div style={{ styles }}>text</div></>", styles="color: red")
|
|
183
183
|
assert result == '<div style="color: red">text</div>'
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
# ---------------------------------------------------------------------------
|
|
187
|
+
# Boolean attributes
|
|
188
|
+
# ---------------------------------------------------------------------------
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def test_bare_boolean_attribute():
|
|
192
|
+
assert render("<><input disabled /></>") == "<input disabled />"
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def test_bare_boolean_attribute_with_regular_attribute():
|
|
196
|
+
result = render('<><input type="checkbox" checked /></>')
|
|
197
|
+
assert result == '<input type="checkbox" checked />'
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def test_multiple_bare_boolean_attributes():
|
|
201
|
+
assert render("<><input disabled required /></>") == "<input disabled required />"
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def test_boolean_attribute_none_value():
|
|
205
|
+
assert render("<><input disabled={{ None }} /></>") == "<input />"
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def test_boolean_attribute_true_value():
|
|
209
|
+
assert render("<><input disabled={{ True }} /></>") == '<input disabled="true" />'
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def test_boolean_attribute_false_value():
|
|
213
|
+
assert render("<><input disabled={{ False }} /></>") == '<input disabled="false" />'
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def test_boolean_attribute_true_or_none_value():
|
|
217
|
+
assert render("<><input disabled={{ True or None }} /></>") == '<input disabled="true" />'
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def test_boolean_attribute_false_or_none_value():
|
|
221
|
+
assert render("<><input disabled={{ False or None }} /></>") == "<input />"
|
|
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_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/completion.py
RENAMED
|
File without changes
|
{python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/definition.py
RENAMED
|
File without changes
|
{python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/diagnostics.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/hover.py
RENAMED
|
File without changes
|
{python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/inlay_hints.py
RENAMED
|
File without changes
|
{python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/lifecycle.py
RENAMED
|
File without changes
|
{python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/references.py
RENAMED
|
File without changes
|
{python_fragments-0.32 → python_fragments-0.33}/fragments/lsp/client_message_handlers/rename.py
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_fragments-0.32 → python_fragments-0.33}/python_fragments.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
|