Re: [Web-SIG] A trivial template API counter-proposal
[Phillip] API to be provided by a template engine: compile_string(text), compile_stream(input_stream) - return a WSGI application object for the template described by the text or file-like object write_compiled(app, output_stream) - save the compiled form of the template to output_stream read_compiled(input_stream) - read a template from input_stream and return a WSGI application object I am probably missing something, but shouldn't there also be an API to render the template to a string or stream given some context of variable names? I'm looking at this from a very different perspective, namely *using* various templating engines from an app that otherwise doesn't use a framework but still needs templating. (PS having tried WSGI a bit now I'm fine with it. Perhaps wsgiref should go into the Python 2.5 standard library?) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com
Re: [Web-SIG] A trivial template API counter-proposal
On Feb 4, 2006, at 8:17 AM, Guido van Rossum wrote: I am probably missing something, but shouldn't there also be an API to render the template to a string or stream given some context of variable names? I'm looking at this from a very different perspective, namely *using* various templating engines from an app that otherwise doesn't use a framework but still needs templating. Yes, there was a lot of convoluted thought in the larger thread of Standardized template API which got intermingled with a related proposal to standardize common parts used within template languages themselves. We're currently steering back to just standardizing *using* the various templates, and saving the much more complex issue of their internals for a later point. Cheers, Ben ___ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com