Chameleon

Latest version: v4.5.4

Safety actively analyzes 630360 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 15 of 19

2.3.5

------------------

Features:

- Added support for the set operator (``{item, item, ...}``).

Bugfixes:

- If macro is defined on the same element as a translation name, this
no longer results in a "translation name not allowed outside
translation" error. This fixes issue 43.

- Attribute fallback to dictionary lookup now works on multiple items
(e.g. ``d1.d2.d2``). This fixes issue 42.

2.3.4

------------------

Features:

- When inserting content in either attributes or text, a value of
``True`` (like ``False`` and ``None``) will result in no
action.

- Use statically assigned variables for ``"attrs"`` and
``"default"``. This change yields a performance improvement of
15-20%.

- The template loader class now accepts an optional argument
``default_extension`` which accepts a filename extension which will
be appended to the filename if there's not already an extension.

Bugfixes:

- The default symbol is now ``True`` for an attribute if the attribute
default is not provided. Note that the result is that the attribute
is dropped. This fixes issue 41.

- Fixed an issue where assignment to a variable ``"type"`` would
fail. This fixes issue 40.

- Fixed an issue where an (unsuccessful) assignment for a repeat loop
to a compiler internal name would not result in an error.

- If the translation function returns the identical object, manually
coerce it to string. This fixes a compatibility issue with
translation functions which do not convert non-string objects to a
string value, but simply return them unchanged.

2.3.3

------------------

Features:

- The ``load:`` expression now passes the initial keyword arguments to
its template loader (e.g. ``auto_reload`` and ``encoding``).

- In the exception output, string variable values are now limited to a
limited output of characters, single line only.

Bugfixes:

- Fixed horizontal alignment of exception location info
(i.e. 'String:', 'Filename:' and 'Location:') such that they match
the template exception formatter.

2.3.2

------------------

Bugfixes:

- Fixed issue where i18n:domain would not be inherited through macros
and slots. This fixes issue 37.

2.3.1

------------------

Features:

- The ``Builtin`` node type may now be used to represent any Python
local or global name. This allows expression compilers to refer to
e.g. ``get`` or ``getitem``, or to explicit require a builtin object
such as one from the ``extra_builtins`` dictionary.

Bugfixes:

- Builtins which are not explicitly disallowed may now be redefined
and used as variables (e.g. ``nothing``).

- Fixed compiler issue with circular node annotation loop.

2.3

----------------

Features:

- Added support for the following syntax to disable inline evaluation
in a comment:

<!--? comment appears verbatim (no ${...} evaluation) -->

Note that the initial question mark character (?) will be omitted
from output.

- The parser now accepts '<' and '>' in attributes. Note that this is
invalid markup. Previously, the '<' would not be accepted as a valid
attribute value, but this would result in an 'unexpected end tag'
error elsewhere. This fixes issue 38.

- The expression compiler now provides methods ``assign_text`` and
``assign_value`` such that a template engine might configure this
value conversion to support e.g. encoded strings.

Note that currently, the only client for the ``assign_text`` method
is the string expression type.

- Enable template loader for string-based template classes. Note that
the ``filename`` keyword argument may be provided on initialization
to identify the template source by filename. This fixes issue 36.

- Added ``extra_builtins`` option to the page template class. These
builtins are added to the default builtins dictionary at cook time
and may be provided at initialization using the ``extra_builtins``
keyword argument.

Bugfixes:

- If a translation domain is set for a fill slot, use this setting
instead of the macro template domain.

- The Python expression compiler now correctly decodes HTML entities
``'gt'`` and ``'lt'``. This fixes issue 32.

- The string expression compiler now correctly handles encoded text
(when support for encoded strings is enabled). This fixes issue 35.

- Fixed an issue where setting the ``filename`` attribute on a
file-based template would not automatically cause an invalidation.

- Exceptions raised by Chameleon can now be copied via
``copy.copy``. This fixes issue 36.
[leorochael]

- If copying the exception fails in the exception handler, simply
re-raise the original exception and log a warning.

Page 15 of 19

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.