Chameleon

Latest version: v4.5.4

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

Scan your dependencies

Page 16 of 19

2.2

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

Features:

- Added new expression type ``load:`` that allows loading a
template. Both relative and absolute paths are supported. If the
path given is relative, then it will be resolved with respect to the
directory of the template.

- Added support for dynamic evaluation of expressions.

Note that this is to support legacy applications. It is not
currently wired into the provided template classes.

- Template classes now have a ``builtins`` attribute which may be used
to define built-in variables always available in the template
variable scope.

Incompatibilities:

- The file-based template class no longer accepts a parameter
``loader``. This parameter would be used to load a template from a
relative path, using a ``find(filename)`` method. This was however,
undocumented, and probably not very useful since we have the
``TemplateLoader`` mechanism already.

- The compiled template module now contains an ``initialize`` function
which takes values that map to the template builtins. The return
value of this function is a dictionary that contains the render
functions.

Bugfixes:

- The file-based template class no longer verifies the existence of a
template file (using ``os.lstat``). This now happens implicitly if
eager parsing is enabled, or otherwise when first needed (e.g. at
render time).

This is classified as a bug fix because the previous behavior was
probably not what you'd expect, especially if an application
initializes a lot of templates without needing to render them
immediately.

2.1.1

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

Features:

- Improved exception display. The expression string is now shown in
the context of the original source (if available) with a marker
string indicating the location of the expression in the template
source.

Bugfixes:

- The ``structure`` insertion mode now correctly decodes entities for
any expression type (including ``string:``). This fixes issue 30.

- Don't show internal variables in the exception formatter variable
listing.

2.1

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

Features:

- Expression interpolation (using the ``${...}`` operator and
previously also ``$identifier``) now requires braces everywhere
except inside the ``string:`` expression type.

This change is motivated by a number of legacy templates in which
the interpolation format without braces ``$identifier`` appears as
text.

2.0.2

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

Bugfixes:

- Don't use dynamic variable scope for lambda-scoped variables (27).

- Avoid duplication of exception class and message in traceback.

- Fixed issue where a ``metal:fill-slot`` would be ignored if a macro
was set to be used on the same element (16).

2.0.1

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

Bugfixes:

- Fixed issue where global variable definition from macro slots would
fail (they would instead be local). This also affects error
reporting from inside slots because this would be recorded
internally as a global.

- Fixed issue with template cache digest (used for filenames); modules
are now invalidated whenever any changes are made to the
distribution set available (packages on ``sys.path``).

- Fixed exception handler to better let exceptions propagate through
the renderer.

- The disk-based module compiler now mangles template source filenames
such that the output Python module is valid and at root level (dots
and hyphens are replaced by an underscore). This fixes issue 17.

- Fixed translations (i18n) on Python 2.5.

2.0

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

- Point release.

Page 16 of 19

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.