On 10/14/05, Jeff Watkins <[EMAIL PROTECTED]> wrote: > > On 14 Oct, 2005, at 1:32 pm, Lee McFadden wrote: > > > I believe you can set the filters programmatically, although I've > > never actually tried this myself within TurboGears. > > > > I am creating the static filter entries programmatically. The problem > is I don't know what the *full* path to my package is. I suppose I > don't know this until the controller executes...
There's actually a ticket open on this very problem. The pkg_resources API provides a way to find the full path to your static resources. (That is, full OS filesystem path... not URL path.) The URL path is trickier, but that's what the new url() function buys you when referring to static resources. It's the configuration of static resources that is an unsolved problem. One thing that may alleviate that problem is if we switch from using the static filter to having an object you can drop into your tree representing static files. (This is exactly how you do it in Nevow, and it fits the CherryPy model quite nicely.) It may also be possible to use the static filter via _cpFilterList, but I haven't looked closely at that solution. There's also the VirtualHostFilter and VirtualPathFilter which do some path mangling that might be useful. Anyhow, I just wanted to toss out a few thoughts here. For the next couple of days in particular, my time available for being online is *very* limited, so I wanted to toss out these thoughts with the couple minutes I've got now. Kevin -- Kevin Dangoor Author of the Zesty News RSS newsreader email: [EMAIL PROTECTED] company: http://www.BlazingThings.com blog: http://www.BlueSkyOnMars.com

