Jim Steil schrieb:
> Chris: A couple of questions. First, for solution a, it appears as
> though I'd need to know the path to my config file to implement step 1.
> I don't think that would work for me because if I knew that path, I
> could figure out the image path. Please correct me if my assumption is
> incorrect.
Yes, that's correct. The deployment specific TG config file (dev.cfg/prod.cfg)
can be located anywhere, it doesn't necessarily need to be located in your
project directory (which doesn't even exists when you have installed your TG
app as an egg). Thatswhy you need to specifiy its path.
> For option b, this works great when running under
> TurboGears, but I received an error on line 2 when I ran it in a bare
> Python shell with the following error:
>
> static_dir = pkg_resources.resource_filename("motion", "static")
> ImportError: No module named motion
Is "motion" the name of the package directory of your TG app? Is it on the
Python path? If not, you might need to install you application or add your
project directory to the Python path.
pkg_resources.resource_filename() should work regardless of whether a package
was installed as an egg or just sits somewhere on your Python path.
> I used the previous suggestion offered by David and it is working fine
> under both of the necessary scenarios. Dave, thanks for pointing me in
> that direction.
This can also only work if your package directory is on the Python path, so I
don't know why this solution works for you and b) doesn't.
Chris
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---