[Pythonmac-SIG] Design question - where should resources go?

Jack Jansen Jack.Jansen@cwi.nl
Fri, 21 Jun 2002 15:24:20 +0200


Folks,
playing with Bill's wonderful new OSA stuff (btw: are Bill and myself 
the only two people interested in Interface Builder and such, or is 
everyone just too busy? In just one week two people announce stuff that 
allows Python to be used with IB, and nobody else seems interested....) 
I noticed a problem with MachoPython that I already knew was there, but 
managed to ignore up until now.

The problem is that I don't know where to put various resources (.rsrc 
files, in other words). Historically, MacPython has been sloppy about 
where resources were. Some were in the application (although that's 
mainly to allow them to be overridden with EditPythonPrefs) and most 
were in PythonCore. Actually, there's some stuff in PythonCore that 
doesn't really belong there. For example the DLOG resources and such 
used by EasyDialogs: they've always been in PythonCore, but they really 
belong in Mac/Lib/EasyDialogs.rsrc (just like all other private 
resources).

For MachoPython i took the quick and dirty approach of stuffing all 
resources into a Python.rsrc file inside the Python.app application. 
This is fine if you are using Python.app (or a copy of it) to run your 
stuff, but breaks in other cases (such as when using Python through 
Script Editor with Bill's python scripting component). If you attempt to 
use EasyDialogs it simply won't work (resource not found) and other 
things also work sub-optimal (i.e. no explanatory strings for MacOS 
error codes are available).

What I'm planning to do is to move the core resources into 
/Library/Framework/Python.framework, where they belong. What I'm not 
100% sure about is the EasyDialogs resources (and similar ones). I'm 
tempted to put them in their own .rsrc file in the Lib folder. But: this 
may break things if people expect these resources to be available 
outside of EasyDialogs.

Any ideas on this matter?

--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -