Permalink
Commits on Jul 14, 2018
  1. Begin next cycle

    malthe committed Jul 14, 2018
  2. Preparing release

    malthe committed Jul 14, 2018
Commits on Jul 8, 2018
  1. Merge pull request #264 from fschulze/fix-multi-node-translation

    malthe committed Jul 8, 2018
    Fix regression with translations in case of multiple nodes.
Commits on Jun 26, 2018
  1. Merge pull request #263 from luhn/stable-cache

    malthe committed Jun 26, 2018
    Make the hash used for cache busting more stable.
  2. Make the hash used for cache busting more stable.

    luhn committed Jun 26, 2018
    The hash is init'd with the package name and the versions of the other
    packages in the PYTHONPATH.  Small changes in PYTHONPATH could bust the
    cache.  This commit adds deduplication and sorting, which stabilizes the
    hash against inconsequential changes to PYTHONPATH.
Commits on May 23, 2018
  1. Start development of 3.4.

    malthe committed May 23, 2018
  2. Prepare release

    malthe committed May 23, 2018
  3. Merge pull request #261 from malthe/token-error-fix

    malthe committed May 23, 2018
    Add token fix to reset errors before rendering internal macros
Commits on May 8, 2018
  1. Add token fix to reset errors before rendering internal macros

    malthe committed May 8, 2018
    This was discussed in issue #260.
  2. Merge pull request #260 from MatthewWilkes/fix-excessive-error-when-n…

    malthe committed May 8, 2018
    …esting
    
    Fix edge case in exception handler causing recursion
Commits on May 7, 2018
  1. Fix edge case in exception handler causing recursion

    MatthewWilkes committed May 7, 2018
    During Plone's porting efforts to Python 3.6 a bug was found
    that caused Python to dump core with a stack overflow. This
    is caused in the field handling, where a template calls a
    macro which then inserts the rendered body of another pagetemplate.
    
    The inner page template is rendered and calls the exception handler
    correctly, which causes the exception's `__str__` method to be
    replaced with an instance of `ExceptionFormatter`. However, as
    this is within a macro the `visit_Macro` function causes that
    exception to be added to `rcontext['__error__']``, meaning that
    when the outer template attempts to format its exception the
    handling of the `__errors__` list causes recursion into the
    `ExceptionFormatter` until the maximum recursion depth is reached
    at which point the error handling is aborted as unformattable
    by the traceback module in the standard library.
    
    If the exception is sufficiently large it smashes the stack before
    this can happen, causing a core dump. If it isn't sufficiently
    large a confusingly repetitious error is shown.
Commits on Nov 6, 2017
  1. Merge pull request #253 from NextThought/docs-version

    malthe committed Nov 6, 2017
    Ensure version number in documentation matches install
Commits on Oct 11, 2017
  1. Ensure version number in documentation matches install

    jamadden committed Oct 11, 2017
    - Remove docs/requirements.txt that pinned an old Chameleon version.
    
    This will require that the "install this project" checkbox is checked
    in the RTD settings. It may also require the "install this
    requirements file" setting be cleared.
  2. Merge pull request #252 from NextThought/multiple_defines

    malthe committed Oct 11, 2017
    Document variable unpacking in tal:define and tal:repeat.
Commits on Oct 10, 2017
  1. Document variable unpacking in tal:define and tal:repeat.

    jamadden committed Oct 10, 2017
    Also adjust the BNF for tal:define to be more correct.
  2. Merge pull request #250 from NextThought/issue249

    malthe committed Oct 10, 2017
    Remove documentation of repeat.first/last and provide itertools.groupby example
  3. Remove documentation of repeat.first/last and provide itertools.group…

    jamadden committed Oct 10, 2017
    …by example
    
    The example has to be unfortunately complex to be correct. The trivial
    version produces incorrect results (note the missing data in the first
    groups):
    
    ```pycon
    In [1]: class O(object):
       ...:     def __init__(self, mt, id):
       ...:         self.meta_type = mt
       ...:         self.id = id
       ...:
    
    In [2]: objects = [O("MT1", 1), O("MT1", 2), O("MT2", "A"), O("MT2", "B"), O("MT3", "C"), O("MT4", "a")]
    
    In [3]: from chameleon import PageTemplate
    
    In [4]: src = """
        ...:         <div tal:repeat="type_objects itertools.groupby(objects, key=lambda o: o.meta_type)"
        ...:              tal:define="itertools import:itertools">
        ...:           <h2 tal:content="type_objects[0]">Meta Type</h2>
        ...:           <p tal:repeat="object type_objects[1]"
        ...:              tal:content="object.id">Object ID</p>
        ...:           <hr />
        ...:         </div>
        ...: """
    
    In [5]: pt = PageTemplate(src)
    
    In [6]: print(pt(objects=objects))
    
            <div>
              <h2>MT1</h2>
    
              <hr />
            </div>
            <div>
              <h2>MT2</h2>
    
              <hr />
            </div>
            <div>
              <h2>MT3</h2>
    
              <hr />
            </div>
            <div>
              <h2>MT4</h2>
              <p>a</p>
              <hr />
            </div>
    ```
    
    It takes the complex expression in the example to get the expected
    results:
    
    ```pycon
    In [7]: src = """
       ...:
       ...:         <div tal:repeat="type_objects list(map(lambda g: (g[0], list(g[1])), itertools.groupby(objects, key=lambda o: o.meta_type)))"
       ...:              tal:define="itertools import:itertools">
       ...:           <h2 tal:content="type_objects[0]">Meta Type</h2>
       ...:           <p tal:repeat="object type_objects[1]"
       ...:              tal:content="object.id">Object ID</p>
       ...:           <hr />
       ...:         </div>
       ...:
       ...: """
    
    In [8]: pt = PageTemplate(src)
    
    In [9]: print(pt(objects=objects))
    
            <div>
              <h2>MT1</h2>
              <p>1</p>
              <p>2</p>
              <hr />
            </div>
            <div>
              <h2>MT2</h2>
              <p>A</p>
              <p>B</p>
              <hr />
            </div>
            <div>
              <h2>MT3</h2>
              <p>C</p>
              <hr />
            </div>
            <div>
              <h2>MT4</h2>
              <p>a</p>
              <hr />
            </div>
    ```
    
    - Introduce a tox ``docs`` environment for ease of building the docs.
    - Add intersphinx references to docs.python.org for linking to
      itertools.groupby.
Commits on Oct 6, 2017
  1. Version bump

    malthe committed Oct 6, 2017
  2. Update version

    malthe committed Oct 6, 2017
  3. Add changelog entry

    malthe committed Oct 6, 2017
Commits on Oct 4, 2017
  1. Merge pull request #247 from mrh1997/issue246

    malthe committed Oct 4, 2017
    Make cameleon also work when sources (.py files) are not available.
Commits on Sep 14, 2017
  1. Make cameleon also work when sources (.py files) are not available.

    mrh1997 committed Sep 14, 2017
    This commit addresses issue 246 (#246)
Commits on May 8, 2017
  1. Merge pull request #240 from NextThought/issue238

    malthe committed May 8, 2017
    Assign to macroname at the point of use, not definition.
  2. Assign to macroname at the point of use, not definition.

    jamadden committed May 8, 2017
    Refs #238 and #239.
    
    This actually fixes running zope.app.authentication tests (using
    zope.app.rotterdam) under Chameleon.
  3. Fix changelog

    malthe committed May 8, 2017
  4. Update version

    malthe committed Apr 18, 2017
  5. Unused inheritance

    malthe committed Feb 21, 2017