Chameleon

Latest version: v4.5.4

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

Scan your dependencies

Page 12 of 19

2.7.0

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

Features:

- The ``load:`` expression now derives from the string expression such
that the ``${...}`` operator can be used for expression
interpolation.

- The ``load:`` expression now accepts asset specs; these are resolved
by the ``pkg_resources.resource_filename`` function::

<package_name>:<path>

An example from the test suite::

chameleon:tests/inputs/hello_world.pt

Bugfixes:

- If an attribute name for translation was not a valid Python
identifier, the compiler would generate invalid code. This has been
fixed, and the compiler now also throws an exception if an attribute
specification contains a comma. (Note that the only valid separator
character is the semicolon, when specifying attributes for
translation via the ``i18n:translate`` statement). This addresses
issue 76.

2.6.2

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

Bugfixes:

- Fixed issue where ``tal:on-error`` would not respect
``tal:omit-tag`` or namespace elements which are omitted by default
(such as ``<tal:block />``).

- Fixed issue where ``macros`` attribute would not be available on
file-based templates due to incorrect initialization.

- The ``TryExcept`` and ``TryFinally`` AST nodes are not available on
Python 3.3. These have been aliased to ``Try``. This fixes issue
75.

Features:

- The TAL repeat item now makes a security declaration that grants
access to unprotected subobjects on the Zope 2 platform::

__allow_access_to_unprotected_subobjects__ = True

This is required for legacy compatibility and does not affect other
environments.

- The template object now has a method ``write(body)`` which
explicitly decodes and cooks a string input.

- Added configuration option ``loader_class`` which sets the class
used to create the template loader object.

The class (essentially a callable) is created at template
construction time.

2.6.1

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

Bugfixes:

- Decode HTML entities in expression interpolation strings. This fixes
issue 74.

- Allow ``xml`` and ``xmlns`` attributes on TAL, I18N and METAL
namespace elements. This fixes issue 73.

2.6.0

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

Features:

- Added support for implicit translation:

The ``implicit_i18n_translate`` option enables implicit translation
of text. The ``implicit_i18n_attributes`` enables implicit
translation of attributes. The latter must be a set and for an
attribute to be implicitly translated, its lowercase string value
must be included in the set.

- Added option ``strict`` (enabled by default) which decides whether
expressions are required to be valid at compile time. That is, if
not set, an exception is only raised for an invalid expression at
evaluation time.

- An expression error now results in an exception only if the
expression is attempted evaluated during a rendering.

- Added a configuration option ``prepend_relative_search_path`` which
decides whether the path relative to a file-based template is
prepended to the load search path. The default is ``True``.

- Added a configuration option ``search_path`` to the file-based
template class, which adds additional paths to the template load
instance bound to the ``load:`` expression. The option takes a
string path or an iterable yielding string paths. The default value
is the empty set.

Bugfixes:

- Exception instances now support pickle/unpickle.

- An attributes in i18n:attributes no longer needs to match an
existing or dynamic attribute in order to appear in the
element. This fixes issue 66.

2.5.3

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

Bugfixes:

- Fixed an issue where a nested macro slot definition would fail even
though there existed a parent macro definition. This fixes issue
69.

2.5.2

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

Bugfixes:

- Fixed an issue where technically invalid input would result in a
compiler error.

Features:

- The markup class now inherits from the unicode string type such that
it's compatible with the string interface.

Page 12 of 19

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.