Just as a related use-case, this can be really helpful for using
gettext and i18n. You can make the _ function a template global, and
then encase any translatable strings in that call. Compile to python
using the GAE method, and pygettext, (and newer versions of gnu
gettext) will strip out the calls correctly, and doesn't need to be
able to parse the templates. This is really cool Anand -- I bet there
are other use cases (it might be possible, for instance, to run pylint
on these?).
On Nov 27, 4:41 am, "Anand Chitipothu" <[EMAIL PROTECTED]> wrote:
> > [...]
> > e.g. web.template.Template.globals['sorted'] = sorted
>
> using web.template.Template.globals is deprecated.
> Preferred use is:
>
> render = web.template.render('templates', globals={'x': 1})
>
> > Can you think of a better way to hack this limitation?
>
> I think it is fixed now.
> Can you try again and let me know if there are any issues?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---