[Distutils] [Python-Dev] PEP 365 (Adding the pkg_resources module)
Guido van Rossum
guido at python.org
Wed Mar 19 18:25:22 CET 2008
On Mon, Mar 17, 2008 at 2:19 PM, zooko <zooko at zooko.com> wrote:
> 4. The standard Python library includes a tool to find and read
> resources (other than Python modules) that came bundled in a Python
> Consider, for example, this snippets of code in Nevow:
> When Nevow uses pkg_resources to import its files such as
> "default.css", then it is able to find at runtime, even if is being
> imported from a py2exe or py2app zip, or on other platforms where its
> homegrown setup script and homegrown "find my file" function fail.
> So using pkg_resources (and setuptools to install it) makes
> "test_nevow" pass on all of the allmydata.org buildslaves:
I think we're pretty close to this already. PEP 302 defines a
getdata() method. Hopefully most PEP 302 implementations support it.
The only thing missing IMO is a little function that does what
getdata() does when there is no __loader__ object (i.e. when the
default "import-from-filesystem" import method is used).
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Distutils-SIG