[Pythonmac-SIG] Python.framework under OS X
Jack Jansen
jack@oratrix.nl
Tue, 24 Jul 2001 11:04:41 +0200
>
>
>
> What benefit do you see in packaging python into a framework ?
>
> I can see the benefit of packaging it into an application bundle
> with a local framework for python libs: simple drag and drop
> install, among other things -- but what benefit do you get from
> a library framework ?
My thinking is now somewhat along the following lines for how Python will look
on OSX (note that this is unix-Python, what is now MacPython may continue to
live alongside this for a while, or even be incorporated into it).
1) In /Library/Framework there's a Python.framework. This will look a lot like
a standard Apple framework bundle, but it's really only a lot of symlinks
around a normal Unix Python tree (as would be found in /usr/local/python),
somewhere down in /Library/Framework/Python.framework/Versions/2.2/Resources/py
thon . Maybe the last directory should move one level up, I'm not sure
(comments?).
I think that if a user has no admin privileges they could install all this in
~/Library/Framework and it would still work. Also, when Apple starts shipping
Python with OSX 10.3 (half a :-) they can put it in /System/Library/Frameworks.
2) In /usr/local/bin there's a symlink "python" to
/Library/Framework/Python.framework/Versions/2.2/Resources/python/bin/python.
This makes commandline Python completely happy. Actually, maybe the link
should go to /Library/Framework/Python.framework/python, with that in turn
linking to the path above, so that installing Python 2.3 will automatically
make the /usr/local script point to the right place.
3) In /Applications there's a Python.app application bundle. This has all the
a small executable, the icon and plist mumbojumbo, and that's probably all. It
is probably the same main program as what was used to create the commandline
interpreter deep down the framework specified in (1), but this time it is
linked against the whole framework in stead of against the python shared
library only. Hmm, on second thoughts it might be a slightly different main
program, see below.
4) If the main program above checks for a "PYC " resource and runs that (just
like MacPython does nowadays) if it exists we can use something similar to the
old MacPyhton scheme for createing applets. Just copy the
/Applications/Python.app bundle, drop a PYC resource file in its Resources
folder and off you go.
Ok, lots of verbiage but still no answer to your question:-)
Two advantages to using a library framework. Easy applets (point 4 above) and
also easy creation of extension modules and easy embedding of Python (simply
link against Python.framework). The latter needs a little reorganisation
(like, python/Mac/Include should move to Python/Include/Mac, probably) but
we're almosty there.
--
Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm