kovidgoyal/calibre — pull request #334 by cbhaley (2014-11-17 17:26:52+00:00)
Title: Fix regression in evaluating composite columns that use other composite ...

...columns.

Assume column X uses column Y. If X assigns to template variables then evaluated Y, the variables were cleared. The regression happened because the performance increase changes to use ProxyMetadata also caused X and Y to be evaluated in the same formatter instance where before they were evaluated in separate instances. This triggered a long-standing latent bug where a 'global' local variable dictionary was cleared every time a template was executed. The fix is to make the local variable dict local to the template evaluation instance.