Matt Good wrote:
The "python.templating.engines" entry point is just a specification
implemented either by your templating engine (Myghty, Kid, Genshi,
...), or by your framework (TurboGears, Buffet, Pylons, ...)
As long as both sides properly implement the spec they should all work
interchangably. So, you shouldn't need to write separate plugin
implementations for Buffet and Pylons. I originally tested the Genshi
plugin on TurboGears, but it worked fine on Pylons without
modification.
What's the error you're getting with the Pylons version?
Actually I've tracked it down. I was trying to use this bit of code as
an example:
http://pylonshq.com/project/pylonshq/browser/Pylons/trunk/pylons/templating.py?rev=1236&format=txt
def __init__(self, extra_vars_func=None, options=None):
if options is None:
options = {}
myt_opts = {}
for k, v in options.iteritems():
if k.startswith('myghty.'):
myt_opts[k[7:]] = v
myt_opts['global_args'] = dict(
c=pylons.c,
h=pylons.h,
request=pylons.request,
g=pylons.g,
session=pylons.session,
s=pylons.session,
render=render,
)
self.interpreter = Interpreter(**myt_opts)
What I was getting was an error about the pylons module not having any
of the attributes c, h, request, session, or s. As it turns out, those
are passed into the render() method via the info parameter and so aren't
needed anyway.
Anyway, as I write this I realize the source of my error: the link to
SVN above was found via Google and I failed to notice the rev=1236 in
the URL. So I was using an old example as the basis for my code.
So yes, it appears I won't be needing a separate Pylons support plugin.
The regular Buffet plugin should work fine.
Regards,
Cliff
-- Matt Good
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---