On Wed, Mar 5, 2008 at 12:25 AM, Ben Bangert <[EMAIL PROTECTED]> wrote:
> On Mar 4, 2008, at 9:36 PM, Ian Bicking wrote:
>  > Putting a 15-line recipe into the pylons template seems really
>  > scrappy.
>
>  I don't see this MakoRenderer being any less or more scrappy than a

Scrappy is a bad thing?  Not in basketball or wrestling, or if you're
a little canine detective.

Let's also keep in mind that for TemplateProposal to get off the
ground, somebody needs to finish it and integrate it into Pylons, and
neither Ian nor I nor anybody else has had time to do it for three
months.

The fundamental point is that what a Pylons user needs is a render()
function that does the right thing, where "right" means following the
Pylons c/cache/templatedir policy with a popular template engine by
default, and ideally offering a choice of template engines.  Replacing
a render() function is no more or less difficult than changing a
Buffet configuration, but it has the advantage of simplicity and
obviousness.  A function is better than a class unless the class has
some other reason for existing (which usually means bundling up
methods and data in a way a function can't).

So if a choice of render() functions *can* work, by all means use it.
 Renderer (generic) might be useful if it abstracted away some common
data and initialization code, but the template engines are so
different that there's no point.  Mako has a loader the others don't,
Genshi has a very unusual API, they both use completely different
options for encodings, etc.  If Pylons really means PylonsApp, then
render() has never been a part of it at all; it has always been
something the user called.  So why not let the user build their own
from some utility functions, and provide a couple prebuilt ones for
convenience.

One glaring problem with Buffet 1 is there was no way to customize the
plugins' behavior, which was compounded by most of the plugins being
braindead.  Writing and installing an alternate plugin was a herculean
task of learning entry points and figuring out the undocumented plugin
specs.  Users just wanted to instantiate their own plugin class and
pass it to Buffet.  Voila, here's what you have now.  You take one of
the prebuilt functions or write your own.  You don't even have to
register it anywhere, you just call it.  Easy as py.  (Groan.)

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to