[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] py2exe on fonty.py fails with segfault



On Jan 11, 2004, at 2:35 PM, Bob Ippolito wrote:

On Jan 10, 2004, at 6:54 PM, Bob Ippolito wrote:

On Jan 10, 2004, at 6:40 PM, Pete Shinners wrote:

Bob Ippolito wrote:
Pete, what do you think about coming up with a smarter scheme for resource acquisition?
I have not done any research to see if a module like this already exists.
I haven't seen anything directly like this. I believe the new "import hook" stuff that allows zipfiles had something like this, to help locating files near the imported sources. Well I heard talk of that anyways.

If anything I'd take some python code that tried a few "smart" guesses for finding a data file. Just some special cases and whatnot. If anyone knows of anything better, I'd probably just roll it directly into the pygame source if possible.
The "standard module" approach seems preferable to me because that the packaging software (be it bundlebuilder, py2exe, etc) can make one or two function calls and then any software that needs data files (so long as they use the same module) would be able to find them. If the code was in pygame, then packaging software would need code specific to pygame.

I'll figure out whether something like this already exists by Tuesday or so.. if not I'll draft something up. I'm sure it was discussed when import hooks were added, but I don't know if an implementation is floating around.
There is an existing implementation of something called ResourcePackage by Mike Fletcher, see:
http://sourceforge.net/projects/resourcepackage/
http://mail.python.org/pipermail/python-dev/2003-January/032127.html

I haven't tried it yet so I don't know if it's quite suitable as-is.
Ok, I've looked at it. I'm not sure it's the most desirable solution for several reasons:
(1) it embeds data inside the code (uses more memory, modules don't really get unloaded)
(2) the data is only available as a string (either needs to spit out temp files or pygame needs to be refactored to take file-like-objects or strings for ttf, etc)

-bob

Attachment: smime.p7s
Description: application/pkcs7-signature