[ckan-dev] Paths to resources within eggs
Rufus Pollock
rufus.pollock at okfn.org
Wed Mar 16 12:44:43 UTC 2011
On 12 March 2011 17:45, James Gardner <james at 3aims.com> wrote:
> As Rufus said, using zip_safe=False fixes this but also you can also get the
> files from an egg if you ever really need to:
>
> from pkg_resources import resource_string
> print resource_string('ckan', 'migration/migrate.cfg')
>
>
> This extracts a copy to a temp file and returns it's contents. See this for
> more info:
>
> http://peak.telecommunity.com/DevCenter/PythonEggs#accessing-package-resources
Sure but we're talking about templates and css files on disk here --
I'm not sure our pylons extra templates / public resources knows to
use resource_string ...
Rufus
More information about the ckan-dev
mailing list