durusmail: quixote-users: Support $-substitution in templates
Support $-substitution in templates
2004-12-14
2004-12-14
2004-12-14
2004-12-14
2004-12-16
2004-12-16
2004-12-17
2004-12-17
2004-12-14
2005-01-01
2004-12-14
Support $-substitution in templates
David Binger
2004-12-14
On Dec 14, 2004, at 1:59 PM, Oscar Rambla wrote:

> In Quixote 2.0a2:
>
>   * Support $-substitution in templates, as in Python 2.4's
> string.Template
>     class.  $-substitution is applied to every '$'-containing literal
> in a
>     template.  Templates written before this change, if they contain
> literals
>     containing '$', *must* be converted by replacing each '$' with
> '$$'.
>
> I realized that PTL templates functions use local scope for resolving
> $parameters.

The 2.0a3 ptl compiler essentially replaces '$foo' with '"%(foo)s" %
vars()'.
Does anyone like or dislike this feature?

>
> Also in Python 2.4 an arbitrary mapping can be provided as a single
> argument.

I don't understand.  Do you mean as an argument to the '%' operator?
I think that *does* work with htmltext in 2.0a3.


reply