xcomponent 0.8.0__tar.gz → 0.8.2__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.
- {xcomponent-0.8.0 → xcomponent-0.8.2}/CHANGELOG.md +8 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/Cargo.lock +1 -1
- {xcomponent-0.8.0 → xcomponent-0.8.2}/Cargo.toml +1 -1
- {xcomponent-0.8.0 → xcomponent-0.8.2}/PKG-INFO +1 -1
- {xcomponent-0.8.0 → xcomponent-0.8.2}/pyproject.toml +2 -2
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/python/xcomponent/__init__.py +2 -2
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/python/xcomponent/adapters/babel.py +11 -3
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/functionals/i18n/babel.ini +1 -1
- {xcomponent-0.8.0 → xcomponent-0.8.2}/uv.lock +1 -1
- {xcomponent-0.8.0 → xcomponent-0.8.2}/.github/workflows/build-sdist.yml +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/.github/workflows/build-wheels.yml +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/.github/workflows/publish-doc.yml +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/.github/workflows/publish-pypi.yml +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/.github/workflows/release.yml +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/.github/workflows/tests-artifacts.yml +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/.github/workflows/tests.yml +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/.gitignore +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/.python-version +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/Justfile +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/LICENSE +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/README.md +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/docs/Makefile +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/docs/source/conf.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/docs/source/develop/.gitkeep +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/docs/source/index.md +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/docs/source/user/changelog.md +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/docs/source/user/getting_started.md +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/scripts/get_version.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/scripts/write_changelog.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/python/xcomponent/adapters/__init__.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/python/xcomponent/py.typed +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/python/xcomponent/service/__init__.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/python/xcomponent/service/catalog.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/python/xcomponent/xcore.pyi +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/catalog/catalog.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/catalog/mod.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/context.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/expression/ast/eval.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/expression/ast/mod.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/expression/ast/model.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/expression/ast/parse.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/expression/grammar.pest +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/expression/i18n.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/expression/mod.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/expression/parser.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/expression/tokens.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/lib.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/markup/grammar.pest +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/markup/mod.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/markup/parser.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/src/rust/markup/tokens.rs +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/__init__.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/functionals/__init__.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/functionals/i18n/__init__.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/functionals/i18n/fr.mo +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/functionals/i18n/fr.po +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/functionals/i18n/mydomain.pot +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/functionals/i18n/test_l10n.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/__init__.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/adapters/__init__.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/adapters/test_babel.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/conftest.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_binary_eq.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_binary_op.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_binary_op_bool.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_default_values.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_field_access.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_for_expr.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_func.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_if_expr.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_let.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_nested.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_render_comment.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_script.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_str_dedent.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_str_method.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_types.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/expression/test_unary.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_core.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_named_component.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_render_attributes.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_render_context.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_render_globals.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_render_globals_obj.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_render_globals_obj2.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_render_nested_dict.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_render_nested_node.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_render_node.py +0 -0
- {xcomponent-0.8.0 → xcomponent-0.8.2}/tests/unittests/test_render_script.py +0 -0
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.8.2 - 2025-10-18
|
|
2
|
+
|
|
3
|
+
* Be tolerant in case of markup or expression error while extracting locales.
|
|
4
|
+
|
|
5
|
+
## 0.8.1 - 2025-10-18
|
|
6
|
+
|
|
7
|
+
* Fix babel entrypoint to find xcomponent messages extraction method.
|
|
8
|
+
|
|
1
9
|
## 0.8.0 - 2025-10-18
|
|
2
10
|
|
|
3
11
|
* Implement extractor for babel in order to get easy i18n support.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "xcomponent"
|
|
3
|
-
version = "0.8.
|
|
3
|
+
version = "0.8.2"
|
|
4
4
|
description = "An embeded component base template engine - inspired by JSX"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Guillaume Gauvrit", email = "guillaume@gauvr.it" }]
|
|
@@ -55,7 +55,7 @@ docs = [
|
|
|
55
55
|
]
|
|
56
56
|
|
|
57
57
|
[project.entry-points."babel.extractors"]
|
|
58
|
-
xcomponent = "xcomponent
|
|
58
|
+
xcomponent = "xcomponent.adapters.babel:extract_xcomponent"
|
|
59
59
|
|
|
60
60
|
[tool.pyright]
|
|
61
61
|
autoSearchPaths = false
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from importlib import metadata
|
|
2
2
|
from xcomponent.service.catalog import Catalog, Component, Function
|
|
3
3
|
from xcomponent.xcore import XNode
|
|
4
|
-
from xcomponent.adapters.babel import
|
|
4
|
+
from xcomponent.adapters.babel import extract_xcomponent
|
|
5
5
|
|
|
6
|
-
__all__ = ["Catalog", "Component", "Function", "XNode", "
|
|
6
|
+
__all__ = ["Catalog", "Component", "Function", "XNode", "extract_xcomponent"]
|
|
7
7
|
__version__ = metadata.version("xcomponent")
|
|
@@ -33,7 +33,11 @@ def extract_from_markup(node: XNode, offset: int) -> Iterator[ExtractionInfo]:
|
|
|
33
33
|
for nfo in extract_from_markup(child, offset):
|
|
34
34
|
yield nfo
|
|
35
35
|
case XExpression(expr):
|
|
36
|
-
|
|
36
|
+
try:
|
|
37
|
+
msgs = extract_expr_i18n_messages(expr)
|
|
38
|
+
except SyntaxError:
|
|
39
|
+
# should log something here
|
|
40
|
+
return
|
|
37
41
|
for msg in msgs:
|
|
38
42
|
match msg.funcname:
|
|
39
43
|
case "gettext":
|
|
@@ -120,7 +124,7 @@ def extract_from_markup(node: XNode, offset: int) -> Iterator[ExtractionInfo]:
|
|
|
120
124
|
pass
|
|
121
125
|
|
|
122
126
|
|
|
123
|
-
def
|
|
127
|
+
def extract_xcomponent(
|
|
124
128
|
fileobj: BinaryIO,
|
|
125
129
|
keywords: list[str],
|
|
126
130
|
comment_tags: list[str],
|
|
@@ -149,6 +153,10 @@ def extract_xtemplate(
|
|
|
149
153
|
|
|
150
154
|
for tok, value, (lineno, _), _, _ in tokens:
|
|
151
155
|
if tok == STRING:
|
|
152
|
-
|
|
156
|
+
try:
|
|
157
|
+
markup = parse_markup(f"<>{value}</>")
|
|
158
|
+
except ValueError:
|
|
159
|
+
# should log something here
|
|
160
|
+
continue
|
|
153
161
|
for messageinfo in extract_from_markup(markup, lineno):
|
|
154
162
|
yield messageinfo
|
|
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
|
|
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
|
|
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
|