ee****@gmail.com a écrit :
On Jan 15, 1:45 pm, George Sakkis <george.sak...@gmail.comwrote:
>>eef...@gmail.com wrote:
I'd like to inform the Python community that the powerful and popular
Template Toolkit system, previously available only in its original
Perl implementation, is now also available in a beta Python
implementation:
http://tt2.org/python/index.html
I created this port both as a fun programming project, and for use in
environments where Perl is not available, for reasons technical,
cultural, or otherwise. The extensive Perl test suites have also been
ported, and most templates require no or very little modification.
>How does it compare with other "mainstream" Python template engines
such as Cheetah, Mako, etc. ?
I can't claim a comprehensive familiarity with Python template
offerings, but all of the packages approved for use at my previous
workplace left me cold. The most popular were ClearSilver and Django,
and both felt horribly limiting compared to the Template Toolkit,
ClearSilver is not a Python templating system, but a C templating system
with bindings for various languages including Python. Being (by design)
language-agnostic, it's indeed *very* limited (and that's an
understatement).
wrt/ Django templates, it indeed imposes severe limitations on what can
be simply expressed when you are familiar with Python. This is by design
- since it has been designed to be safe to use for non-programmers. Now
while not my cup of tea, it has proven to be fairly usable, quite less
limiting that what I feared at first, and really easy to use for our web
designer/integrator.
Now there are way more flexible/expressive templating systems in Python,
either XML oriented (genshi) or more generic (my favorite one so far
being Mako).
But anyway, I'm not the one that will complain with Perl templating
systems being ported to Python - FWIW, Mako was born from it's author
previous experience with porting Mason to Python !-)