[ANN] pkgdata (was: Re: [Pythonmac-SIG] Re: [pygame] python + pygame
on OSX)
Bob Ippolito
bob at redivi.com
Tue Mar 2 21:45:09 EST 2004
To end this thread, I went ahead and implemented it. I have also
modified pygame accordingly to support this mechanism.
http://undefined.org/python/pkgdata-0.1.tgz
"""
pkgdata is a simple, extensible way for a package to acquire data file
resources.
The implementation is lightweight, and is intended to be included
*inside*
your Python packages.
"""
It's based on PyProtocols (but the implementation doesn't require it
unless you want to override the default mechanism). Basically, it's
useful for py2exe and OS X bundlebuilder type situations. It's a
simple and flexible alternative to
os.path.join(os.path.dirname(__file__), "myresource"). The source is
simple, and has lots of examples. Read if you're interested.
If you would like to see additional examples of its use, checked out
pygame CVS:
pygame/lib/pkgdata.py (this is the pkgdata "client")
pygame/lib/macosx.py (usage from python)
pygame/src/font.c (usage from C)
pygame/src/display.c (more usage from C)
pygame/examples/macosx/aliens_app_example/ (this has the pkgdata "host
adapter" for bundlebuilder type situations)
-bob
More information about the Pythonmac-SIG
mailing list