Re: A Buffet replacement

2008-03-05 Thread Ben Bangert
On Mar 5, 2008, at 11:21 AM, Mike Orr wrote: Hmm, Cheetah does not have a loader, so looking for templates in a certain directly would have to be provided by an external (function|class). But render_cheetah() could do that itself from config['pylons.paths']['templates']), and wouldn't need anyt

Re: A Buffet replacement

2008-03-05 Thread Mike Orr
On Wed, Mar 5, 2008 at 10:23 AM, Ben Bangert <[EMAIL PROTECTED]> wrote: > 0.9.7 project > # Create the Mako TemplateLookup > > config['pylons.g'].mako_lookup = TemplateLookup( > directories=paths['templates'], input_encoding='utf-8', > output_encoding='utf-8', module_d

Re: A Buffet replacement

2008-03-05 Thread Ben Bangert
On Mar 5, 2008, at 9:20 AM, Ian Bicking wrote: Putting that code into Pylons is fine, but I think Pylons already has too much code in the project template, and your proposal puts more code in the project template. That code would need to be updated for any kind of public change in a templati

Re: A Buffet replacement

2008-03-05 Thread Ian Bicking
Ben Bangert wrote: > On Mar 4, 2008, at 9:36 PM, Ian Bicking wrote: > >> It's a rendering factory someone wrote. A little like Buffet, except no >> entry points, no standardized way to instantiate the object, and no >> particular need to make the render callable have a completely consistent >> s

Re: A Buffet replacement

2008-03-05 Thread Mike Orr
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 thin

Re: A Buffet replacement

2008-03-05 Thread Ben Bangert
On Mar 4, 2008, at 9:36 PM, Ian Bicking wrote: It's a rendering factory someone wrote. A little like Buffet, except no entry points, no standardized way to instantiate the object, and no particular need to make the render callable have a completely consistent signature. Yet another level

Re: A Buffet replacement

2008-03-04 Thread Ian Bicking
Ben Bangert wrote: > On Mar 4, 2008, at 9:18 AM, Ian Bicking wrote: > >> I would prefer a pattern like: >> >> # in, maybe, helpers.py or something... >> from something import MakoRenderer >> render = MakoRenderer( >> base_path=os.path.join(os.path.dirname(__file__), 'templates'), >> ... whate

Re: A Buffet replacement

2008-03-04 Thread Ben Bangert
On Mar 4, 2008, at 9:18 AM, Ian Bicking wrote: I would prefer a pattern like: # in, maybe, helpers.py or something... from something import MakoRenderer render = MakoRenderer( base_path=os.path.join(os.path.dirname(__file__), 'templates'), ... whatever other options you might set ...) Wha

Re: A Buffet replacement

2008-03-04 Thread Ian Bicking
Ben Bangert wrote: > We've talked about Buffet replacements before, but I've talked with a > few people now about going a different route. Making it so easy to write > your own 'render' function, that Buffet and such wouldn't even be > necessary. I would prefer a pattern like: # in, maybe, he

Re: A Buffet replacement

2008-03-03 Thread Ben Bangert
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_env

Re: A Buffet replacement

2008-03-03 Thread Mike Orr
On Mon, Mar 3, 2008 at 1:41 PM, Ben Bangert <[EMAIL PROTECTED]> wrote: > We've talked about Buffet replacements before, but I've talked with a > few people now about going a different route. Making it so easy to > write your own 'render' function, that Buffet and such wouldn't even > be necessa

A Buffet replacement

2008-03-03 Thread Ben Bangert
We've talked about Buffet replacements before, but I've talked with a few people now about going a different route. Making it so easy to write your own 'render' function, that Buffet and such wouldn't even be necessary. Disadvantages: - It's a few more lines of code to plugin a template eng