[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[ANN] pkgdata (was: Re: [Pythonmac-SIG] Re: [pygame] python + pygame on OSX)
- To: Bob Ippolito <bob@redivi.com>
- Subject: [ANN] pkgdata (was: Re: [Pythonmac-SIG] Re: [pygame] python + pygame on OSX)
- From: Bob Ippolito <bob@redivi.com>
- Date: Tue, 2 Mar 2004 21:45:09 -0500
- Cc: pythonmac-sig@python.org, pygame-users@seul.org
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Tue, 02 Mar 2004 21:42:21 -0500
- In-reply-to: <B2C15BC7-66DC-11D8-BA2B-000A95686CD8@redivi.com>
- References: <20040216041216.35996.qmail@web21504.mail.yahoo.com> <403730B6.1010700@altern.org> <403807FF.6020408@shinners.org> <C81BEF66-64DC-11D8-847D-000A95686CD8@redivi.com> <ACA63939-6589-11D8-B74B-000A27B19B96@cwi.nl> <3CF78924-658E-11D8-847D-000A95686CD8@redivi.com> <F6D5E84B-65DE-11D8-AC6B-000A958D1666@cwi.nl> <2646CE18-6673-11D8-9E4B-000393D443CE@earthlink.net> <28CE8D77-6676-11D8-BA2B-000A95686CD8@redivi.com> <E0C7133E-668D-11D8-9E4B-000393D443CE@earthlink.net> <7BB6BD02-6690-11D8-BA2B-000A95686CD8@redivi.com> <1D2E8343-66D5-11D8-9E4B-000393D443CE@earthlink.net> <B2C15BC7-66DC-11D8-BA2B-000A95686CD8@redivi.com>
- Reply-to: pygame-users@seul.org
- Sender: owner-pygame-users@seul.org
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