On Aug 19, 2008, at 7:06 PM, Malthe Borch wrote:

>
> Currently, an option to keep a cache of translated templates is
> offered via an environment variable, making application startup
> considerably faster. However, it might be more intuitive to follow
> Python's behavior of writing a .pyc-file next to the original file.
>
> This could only work for us, if all current "translations" of the
> template would be kept in the same file. Hence, instead of using the
> canonical symbol ``render`` for the render-method, we'd use
> ``render_some_signature`` and have them appear one next to the other
> in the .pyc file.
>
> The cache would function like so:
>
> 1) Try to import the render-method from the file "my_template.pt.pyc"
> 2) If this fails, compile the template and append it to this .pyc file
> (by remarshalling the module contents).
>
> Benefits:
>
> 1) Follows common Python behavior
> 2) Does not require environment variable
> 3) Plays nice with XIncludes*.
>
> *) As you may know, XIncludes allow including templates by filename,
> which may be computed dynamically at render-time.

+1 to all of this... with the option of using separate .pym or .pyt  
extensions to represent macro vs. direct renderings and keeping a  
single "render" in each (which would cut down on compile time  
presumably).  But either is great by me.

- C


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

Reply via email to