On Jan 11, 2007, at 1:17 PM, Robin Bryce wrote:
> > Hi All, > > I'm using Genshi (0.3.6) for my templates. I'm working with an > 'application + plugins' model. Where applications and plugins are > separate python packages. The plugins want to use genshi's > <xi:include> directive. In order to allow plugins to xi:include > templates from the application (and other locations) I would, at the > very least, like to parametrize the instantiation of > genshi.template.TemplateLoader such that I can pass in the > `search_path` variable. > > I've been staring at: > > * http://trac.turbogears.org/ticket/468 > * http://trac.turbogears.org/changeset/1728 > * The thread in this group with the subject "Template engine > configured before configuration loaded?" [1] > > And experimenting with turbgears (trunk r2346). > > The obvious thing to do would be to patch > turbogears.view.base.load_engines, adding another genshi variable to > the config vars. > > But I can't see how this would ever work. AFAICT, The module level > call to load_engines() in turbogears.view.base forces the global > config to be examined *before* there is any possibility of updating to > config. It does not matter whether the update comes from a .cfg file, > pr is procedural. Any attempt to import turbogears will force a call > to load_engines() > > This is ultimately a consequence of the decision to bind widget > templates using __metaclass__ isn't it ? Probably. However, trunk is not going to include widgets anymore (replaced by ToscaWidgets, which loads templates lazily) so this problem will magically go away ;) What might work is the following: 1) patch turbogears.view.base.load_engines to add another genshi var to the engine config vars (if you can take the time, it woul be cool to add *all* templates that begin with "genshi", etc...) 2) import cherrypy 3) cherrpy.config.update(.....) 4) import turbogears (which can pickup vars you updated in 3) Alberto BTW, Question regarding TG trunk should be posted at the trunk ML instead --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

