On Mar 3, 2008, at 3:47 PM, Mike Orr wrote:

Well, that would give an excuse for pylons.g to exist.  But it's an
unusual place to do application configuration, which is normally in
load_environment().

Agreed, no reason the appropriate loader couldn't be created and attached to 'g' in load_environment. I'll recode it to do that, with a template toggle that includes the appropriate one for Mako/Genshi at least.

One problem is you're combining data variables and rendering options
into the same 'kwargs' namespace, which we were trying to avoid.
Buffet 1 never specified whether keyword args were one or the other,
although I think the plugins use them only for rendering options.  But
those who prefer @expose or render(template, var1="value 1") over
pylons.c would like passing data values as keyword args.  Our plan for
Buffet 2 was:

render(template, data_dict, cache_bla_bla_bla=None, **rendering_args)

Technically, render_mako should only take the cache args, nothing else. Since Pylons says you should use 'c' for template args. If someone wants to pass args themselves, they should tweak the render function as desired for what they want to do. I'll switch it to work like that as well.

This resolves the mixing issue, and those who want to pass variables instead can easily change the render function as desired. With the TemplateLoader creation in load_environment, the render function is down to about 4-6 lines of code. I don't think it will hurt people to write one that works as they want.

Cheers,
Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to