On Jan 8, 2007, at 3:27 PM, [EMAIL PROTECTED] wrote:


Hi Alberto!

Ok, I can use pkg-resources.resource_filename, but how can I know the
"wiki20" name without pass it as a template argument? Now, to use
cheetah, I need to expose my method as follow:

 @expose(template='wiki20.templates.index')
 def index(self):
     ...

Because the way my plugin works, I don't need to specify the
wiki20.templates, I search the template on a search path (filenames),
if /home/Projects/wiki20/wiki20/templates is on my path, I can just
refer to the template as follow:

 @expose(template='index')
 def index(self):
     ...

This way, my plugin will search on the template path for a index.tmpl
file and it will find the
/home/Projects/wiki20/wiki20/templates/index.tmpl. Well, is there a way
to know what is the project calling the plugin?

Hmmm, not AFAIK... :( Maybe you could patch expose to accept at "package" kw. argument and pass that to the template plugin. However, that is something you best suited to the python-templating list. IIRC they were discussing something related to template search paths for the template plugin API a while ago...

Alberto




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to