[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] Fwd: [Templates] Python and TT




Well, I'll be...

You can do Template Toolkit in Python now...

What WILL they think of next?   :)

j



Begin forwarded message:

From: "Sean McAfee" <eefacm@gmail.com>
Date: March 10, 2008 8:05:49 PM CDT
To: "Sean Allen" <sean@ardishealth.com>
Cc: templates@template-toolkit.org
Subject: Re: [Templates] Python and TT

On Mon, Mar 10, 2008 at 5:29 PM, Sean Allen <sean@ardishealth.com> wrote:
We are getting ready to embark on porting a bunch of old code ( and
several hundred TT templates ) to Python  and plan on using template-
python to ease everything along. Anyone else but in any serious work
with the python version of TT? If yes, do you have any gotchas to
share that we should be aware of ahead of time?

As the implementor of template-python, I'm probably the person with most serious work under my belt--the most that I know of, anyway. While I haven't yet attempted to convert any sizeable Perl-TT project to Python, I did document every potential gotcha I could think of in the file README.python, located at the top of the Python source distribution. I'd encourage you to read that file carefully. Other than that, all of the inline POD documentation from the Perl source code has been carried over into the Python source code, suitably translated into the Python paradigm. It can be read either by browsing the source code, or (as noted in README.python) by the built-in help feature of the interactive Python interpreter. For example:

>>> import template.stash
>>> help(template.stash.Stash)
... documentation for the Stash class ...

If you come across any problems I didn't foresee, I'd be happy to help you resolve them. You can contact me privately, or--more preferably--bring up any issues here on the mailing list.


--Sean
_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates