summaryrefslogtreecommitdiffstats
path: root/Mac/OSX
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-06-08 15:35:45 (GMT)
committerThomas Wouters <thomas@python.org>2006-06-08 15:35:45 (GMT)
commit73e5a5b65d66f4fba9c4f626bcd6400f4a7215e6 (patch)
tree206b2ca44cf23af41ac27cb7b3744f2e60a3341d /Mac/OSX
parent1ba5b3b425e970ec3e4a19165475aa68fa5ac893 (diff)
downloadcpython-73e5a5b65d66f4fba9c4f626bcd6400f4a7215e6.zip
cpython-73e5a5b65d66f4fba9c4f626bcd6400f4a7215e6.tar.gz
cpython-73e5a5b65d66f4fba9c4f626bcd6400f4a7215e6.tar.bz2
Merge the rest of the trunk.
Merged revisions 46490-46494,46496,46498,46500,46506,46521,46538,46558,46563-46567,46570-46571,46583,46593,46595-46598,46604,46606,46609-46753 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r46610 | martin.v.loewis | 2006-06-03 09:42:26 +0200 (Sat, 03 Jun 2006) | 2 lines Updated version (win32-icons2.zip) from #1490384. ........ r46612 | andrew.kuchling | 2006-06-03 20:09:41 +0200 (Sat, 03 Jun 2006) | 1 line [Bug #1472084] Fix description of do_tag ........ r46614 | andrew.kuchling | 2006-06-03 20:33:35 +0200 (Sat, 03 Jun 2006) | 1 line [Bug #1475554] Strengthen text to say 'must' instead of 'should' ........ r46616 | andrew.kuchling | 2006-06-03 20:41:28 +0200 (Sat, 03 Jun 2006) | 1 line [Bug #1441864] Clarify description of 'data' argument ........ r46617 | andrew.kuchling | 2006-06-03 20:43:24 +0200 (Sat, 03 Jun 2006) | 1 line Minor rewording ........ r46619 | andrew.kuchling | 2006-06-03 21:02:35 +0200 (Sat, 03 Jun 2006) | 9 lines [Bug #1497414] _self is a reserved word in the WATCOM 10.6 C compiler. Fix by renaming the variable. In a different module, Neal fixed it by renaming _self to self. There's already a variable named 'self' here, so I used selfptr. (I'm committing this on a Mac without Tk, but it's a simple search-and-replace. <crosses fingers>, so I'll watch the buildbots and see what happens.) ........ r46621 | fredrik.lundh | 2006-06-03 23:56:05 +0200 (Sat, 03 Jun 2006) | 5 lines "_self" is a said to be a reserved word in Watcom C 10.6. I'm not sure that's really standard compliant behaviour, but I guess we have to fix that anyway... ........ r46622 | andrew.kuchling | 2006-06-04 00:44:42 +0200 (Sun, 04 Jun 2006) | 1 line Update readme ........ r46623 | andrew.kuchling | 2006-06-04 00:59:23 +0200 (Sun, 04 Jun 2006) | 1 line Drop 0 parameter ........ r46624 | andrew.kuchling | 2006-06-04 00:59:59 +0200 (Sun, 04 Jun 2006) | 1 line Some code tidying; use curses.wrapper ........ r46625 | andrew.kuchling | 2006-06-04 01:02:15 +0200 (Sun, 04 Jun 2006) | 1 line Use True; value returned from main is unused ........ r46626 | andrew.kuchling | 2006-06-04 01:07:21 +0200 (Sun, 04 Jun 2006) | 1 line Use true division, and the True value ........ r46627 | andrew.kuchling | 2006-06-04 01:09:58 +0200 (Sun, 04 Jun 2006) | 1 line Docstring fix; use True ........ r46628 | andrew.kuchling | 2006-06-04 01:15:56 +0200 (Sun, 04 Jun 2006) | 1 line Put code in a main() function; loosen up the spacing to match current code style ........ r46629 | andrew.kuchling | 2006-06-04 01:39:07 +0200 (Sun, 04 Jun 2006) | 1 line Use functions; modernize code ........ r46630 | andrew.kuchling | 2006-06-04 01:43:22 +0200 (Sun, 04 Jun 2006) | 1 line This demo requires Medusa (not just asyncore); remove it ........ r46631 | andrew.kuchling | 2006-06-04 01:46:36 +0200 (Sun, 04 Jun 2006) | 2 lines Remove xmlrpc demo -- it duplicates the SimpleXMLRPCServer module. ........ r46632 | andrew.kuchling | 2006-06-04 01:47:22 +0200 (Sun, 04 Jun 2006) | 1 line Remove xmlrpc/ directory ........ r46633 | andrew.kuchling | 2006-06-04 01:51:21 +0200 (Sun, 04 Jun 2006) | 1 line Remove dangling reference ........ r46634 | andrew.kuchling | 2006-06-04 01:59:36 +0200 (Sun, 04 Jun 2006) | 1 line Add more whitespace; use a better socket name ........ r46635 | tim.peters | 2006-06-04 03:22:53 +0200 (Sun, 04 Jun 2006) | 2 lines Whitespace normalization. ........ r46637 | tim.peters | 2006-06-04 05:26:02 +0200 (Sun, 04 Jun 2006) | 16 lines In a PYMALLOC_DEBUG build obmalloc adds extra debugging info to each allocated block. This was using 4 bytes for each such piece of info regardless of platform. This didn't really matter before (proof: no bug reports, and the debug-build obmalloc would have assert-failed if it was ever asked for a chunk of memory >= 2**32 bytes), since container indices were plain ints. But after the Py_ssize_t changes, it's at least theoretically possible to allocate a list or string whose guts exceed 2**32 bytes, and the PYMALLOC_DEBUG routines would fail then (having only 4 bytes to record the originally requested size). Now we use sizeof(size_t) bytes for each of a PYMALLOC_DEBUG build's extra debugging fields. This won't make any difference on 32-bit boxes, but will add 16 bytes to each allocation in a debug build on a 64-bit box. ........ r46638 | tim.peters | 2006-06-04 05:38:04 +0200 (Sun, 04 Jun 2006) | 4 lines _PyObject_DebugMalloc(): The return value should add 2*sizeof(size_t) now, not 8. This probably accounts for current disasters on the 64-bit buildbot slaves. ........ r46639 | neal.norwitz | 2006-06-04 08:19:31 +0200 (Sun, 04 Jun 2006) | 1 line SF #1499797, Fix for memory leak in WindowsError_str ........ r46640 | andrew.macintyre | 2006-06-04 14:31:09 +0200 (Sun, 04 Jun 2006) | 2 lines Patch #1454481: Make thread stack size runtime tunable. ........ r46641 | andrew.macintyre | 2006-06-04 14:59:59 +0200 (Sun, 04 Jun 2006) | 2 lines clean up function declarations to conform to PEP-7 style. ........ r46642 | martin.blais | 2006-06-04 15:49:49 +0200 (Sun, 04 Jun 2006) | 15 lines Fixes in struct and socket from merge reviews. - Following Guido's comments, renamed * pack_to -> pack_into * recv_buf -> recv_into * recvfrom_buf -> recvfrom_into - Made fixes to _struct.c according to Neal Norwitz comments on the checkins list. - Converted some ints into the appropriate -- I hope -- ssize_t and size_t. ........ r46643 | ronald.oussoren | 2006-06-04 16:05:28 +0200 (Sun, 04 Jun 2006) | 3 lines "Import" LDFLAGS in Mac/OSX/Makefile.in to ensure pythonw gets build with the right compiler flags. ........ r46644 | ronald.oussoren | 2006-06-04 16:24:59 +0200 (Sun, 04 Jun 2006) | 2 lines Drop Mac wrappers for the WASTE library. ........ r46645 | tim.peters | 2006-06-04 17:49:07 +0200 (Sun, 04 Jun 2006) | 3 lines s_methods[]: Stop compiler warnings by casting s_unpack_from to PyCFunction. ........ r46646 | george.yoshida | 2006-06-04 19:04:12 +0200 (Sun, 04 Jun 2006) | 2 lines Remove a redundant word ........ r46647 | george.yoshida | 2006-06-04 19:17:25 +0200 (Sun, 04 Jun 2006) | 2 lines Markup fix ........ r46648 | martin.v.loewis | 2006-06-04 21:36:28 +0200 (Sun, 04 Jun 2006) | 2 lines Patch #1359618: Speed-up charmap encoder. ........ r46649 | georg.brandl | 2006-06-04 23:46:16 +0200 (Sun, 04 Jun 2006) | 3 lines Repair refleaks in unicodeobject. ........ r46650 | georg.brandl | 2006-06-04 23:56:52 +0200 (Sun, 04 Jun 2006) | 4 lines Patch #1346214: correctly optimize away "if 0"-style stmts (thanks to Neal for review) ........ r46651 | georg.brandl | 2006-06-05 00:15:37 +0200 (Mon, 05 Jun 2006) | 2 lines Bug #1500293: fix memory leaks in _subprocess module. ........ r46654 | tim.peters | 2006-06-05 01:43:53 +0200 (Mon, 05 Jun 2006) | 2 lines Whitespace normalization. ........ r46655 | tim.peters | 2006-06-05 01:52:47 +0200 (Mon, 05 Jun 2006) | 16 lines Revert revisions: 46640 Patch #1454481: Make thread stack size runtime tunable. 46647 Markup fix The first is causing many buildbots to fail test runs, and there are multiple causes with seemingly no immediate prospects for repairing them. See python-dev discussion. Note that a branch can (and should) be created for resolving these problems, like svn copy svn+ssh://svn.python.org/python/trunk -r46640 svn+ssh://svn.python.org/python/branches/NEW_BRANCH followed by merging rev 46647 to the new branch. ........ r46656 | andrew.kuchling | 2006-06-05 02:08:09 +0200 (Mon, 05 Jun 2006) | 1 line Mention second encoding speedup ........ r46657 | gregory.p.smith | 2006-06-05 02:31:01 +0200 (Mon, 05 Jun 2006) | 7 lines bugfix: when log_archive was called with the DB_ARCH_REMOVE flag present in BerkeleyDB >= 4.2 it tried to construct a list out of an uninitialized char **log_list. feature: export the DB_ARCH_REMOVE flag by name in the module on BerkeleyDB >= 4.2. ........ r46658 | gregory.p.smith | 2006-06-05 02:33:35 +0200 (Mon, 05 Jun 2006) | 5 lines fix a bug in the previous commit. don't leak empty list on error return and fix the additional rare (out of memory only) bug that it was supposed to fix of not freeing log_list when the python allocator failed. ........ r46660 | tim.peters | 2006-06-05 02:55:26 +0200 (Mon, 05 Jun 2006) | 9 lines "Flat is better than nested." Move the long-winded, multiply-nested -R support out of runtest() and into some module-level helper functions. This makes runtest() and the -R code easier to follow. That in turn allowed seeing some opportunities for code simplification, and made it obvious that reglog.txt never got closed. ........ r46661 | hyeshik.chang | 2006-06-05 02:59:54 +0200 (Mon, 05 Jun 2006) | 3 lines Fix a potentially invalid memory access of CJKCodecs' shift-jis decoder. (found by Neal Norwitz) ........ r46663 | gregory.p.smith | 2006-06-05 03:39:52 +0200 (Mon, 05 Jun 2006) | 3 lines * support DBEnv.log_stat() method on BerkeleyDB >= 4.0 [patch #1494885] ........ r46664 | tim.peters | 2006-06-05 03:43:03 +0200 (Mon, 05 Jun 2006) | 3 lines Remove doctest.testmod's deprecated (in 2.4) `isprivate` argument. A lot of hair went into supporting that! ........ r46665 | tim.peters | 2006-06-05 03:47:24 +0200 (Mon, 05 Jun 2006) | 2 lines Whitespace normalization. ........ r46666 | tim.peters | 2006-06-05 03:48:21 +0200 (Mon, 05 Jun 2006) | 2 lines Make doctest news more accurate. ........ r46667 | gregory.p.smith | 2006-06-05 03:56:15 +0200 (Mon, 05 Jun 2006) | 3 lines * support DBEnv.lsn_reset() method on BerkeleyDB >= 4.4 [patch #1494902] ........ r46668 | gregory.p.smith | 2006-06-05 04:02:25 +0200 (Mon, 05 Jun 2006) | 3 lines mention the just committed bsddb changes ........ r46671 | gregory.p.smith | 2006-06-05 19:38:04 +0200 (Mon, 05 Jun 2006) | 3 lines * add support for DBSequence objects [patch #1466734] ........ r46672 | gregory.p.smith | 2006-06-05 20:20:07 +0200 (Mon, 05 Jun 2006) | 3 lines forgot to add this file in previous commit ........ r46673 | tim.peters | 2006-06-05 20:36:12 +0200 (Mon, 05 Jun 2006) | 2 lines Whitespace normalization. ........ r46674 | tim.peters | 2006-06-05 20:36:54 +0200 (Mon, 05 Jun 2006) | 2 lines Add missing svn:eol-style property to text files. ........ r46675 | gregory.p.smith | 2006-06-05 20:48:21 +0200 (Mon, 05 Jun 2006) | 4 lines * fix DBCursor.pget() bug with keyword argument names when no data= is supplied [SF pybsddb bug #1477863] ........ r46676 | andrew.kuchling | 2006-06-05 21:05:32 +0200 (Mon, 05 Jun 2006) | 1 line Remove use of Trove name, which isn't very helpful to users ........ r46677 | andrew.kuchling | 2006-06-05 21:08:25 +0200 (Mon, 05 Jun 2006) | 1 line [Bug #1470026] Include link to list of classifiers ........ r46679 | tim.peters | 2006-06-05 22:48:49 +0200 (Mon, 05 Jun 2006) | 10 lines Access _struct attributes directly instead of mucking with getattr. string_reverse(): Simplify. assertRaises(): Raise TestFailed on failure. test_unpack_from(), test_pack_into(), test_pack_into_fn(): never use `assert` to test for an expected result (it doesn't test anything when Python is run with -O). ........ r46680 | tim.peters | 2006-06-05 22:49:27 +0200 (Mon, 05 Jun 2006) | 2 lines Add missing svn:eol-style property to text files. ........ r46681 | gregory.p.smith | 2006-06-06 01:38:06 +0200 (Tue, 06 Jun 2006) | 3 lines add depends = ['md5.h'] to the _md5 module extension for correctness sake. ........ r46682 | brett.cannon | 2006-06-06 01:51:55 +0200 (Tue, 06 Jun 2006) | 4 lines Add 3 more bytes to a buffer to cover constants in string and null byte on top of 10 possible digits for an int. Closes bug #1501223. ........ r46684 | gregory.p.smith | 2006-06-06 01:59:37 +0200 (Tue, 06 Jun 2006) | 5 lines - bsddb: the __len__ method of a DB object has been fixed to return correct results. It could previously incorrectly return 0 in some cases. Fixes SF bug 1493322 (pybsddb bug 1184012). ........ r46686 | tim.peters | 2006-06-06 02:25:07 +0200 (Tue, 06 Jun 2006) | 7 lines _PySys_Init(): It's rarely a good idea to size a buffer to the exact maximum size someone guesses is needed. In this case, if we're really worried about extreme integers, then "cp%d" can actually need 14 bytes (2 for "cp" + 1 for \0 at the end + 11 for -(2**31-1)). So reserve 128 bytes instead -- nothing is actually saved by making a stack-local buffer tiny. ........ r46687 | neal.norwitz | 2006-06-06 09:22:08 +0200 (Tue, 06 Jun 2006) | 1 line Remove unused variable (and stop compiler warning) ........ r46688 | neal.norwitz | 2006-06-06 09:23:01 +0200 (Tue, 06 Jun 2006) | 1 line Fix a bunch of parameter strings ........ r46689 | thomas.heller | 2006-06-06 13:34:33 +0200 (Tue, 06 Jun 2006) | 6 lines Convert CFieldObject tp_members to tp_getset, since there is no structmember typecode for Py_ssize_t fields. This should fix some of the errors on the PPC64 debian machine (64-bit, big endian). Assigning to readonly fields now raises AttributeError instead of TypeError, so the testcase has to be changed as well. ........ r46690 | thomas.heller | 2006-06-06 13:54:32 +0200 (Tue, 06 Jun 2006) | 1 line Damn - the sentinel was missing. And fix another silly mistake. ........ r46691 | martin.blais | 2006-06-06 14:46:55 +0200 (Tue, 06 Jun 2006) | 13 lines Normalized a few cases of whitespace in function declarations. Found them using:: find . -name '*.py' | while read i ; do grep 'def[^(]*( ' $i /dev/null ; done find . -name '*.py' | while read i ; do grep ' ):' $i /dev/null ; done (I was doing this all over my own code anyway, because I'd been using spaces in all defs, so I thought I'd make a run on the Python code as well. If you need to do such fixes in your own code, you can use xx-rename or parenregu.el within emacs.) ........ r46693 | thomas.heller | 2006-06-06 17:34:18 +0200 (Tue, 06 Jun 2006) | 1 line Specify argtypes for all test functions. Maybe that helps on strange ;-) architectures ........ r46694 | tim.peters | 2006-06-06 17:50:17 +0200 (Tue, 06 Jun 2006) | 5 lines BSequence_set_range(): Rev 46688 ("Fix a bunch of parameter strings") changed this function's signature seemingly by mistake, which is causing buildbots to fail test_bsddb3. Restored the pre-46688 signature. ........ r46695 | tim.peters | 2006-06-06 17:52:35 +0200 (Tue, 06 Jun 2006) | 4 lines On python-dev Thomas Heller said these were committed by mistake in rev 46693, so reverting this part of rev 46693. ........ r46696 | andrew.kuchling | 2006-06-06 19:10:41 +0200 (Tue, 06 Jun 2006) | 1 line Fix comment typo ........ r46697 | brett.cannon | 2006-06-06 20:08:16 +0200 (Tue, 06 Jun 2006) | 2 lines Fix coding style guide bug. ........ r46698 | thomas.heller | 2006-06-06 20:50:46 +0200 (Tue, 06 Jun 2006) | 2 lines Add a hack so that foreign functions returning float now do work on 64-bit big endian platforms. ........ r46699 | thomas.heller | 2006-06-06 21:25:13 +0200 (Tue, 06 Jun 2006) | 3 lines Use the same big-endian hack as in _ctypes/callproc.c for callback functions. This fixes the callback function tests that return float. ........ r46700 | ronald.oussoren | 2006-06-06 21:50:24 +0200 (Tue, 06 Jun 2006) | 5 lines * Ensure that "make altinstall" works when the tree was configured with --enable-framework * Also for --enable-framework: allow users to use --prefix to specify the location of the compatibility symlinks (such as /usr/local/bin/python) ........ r46701 | ronald.oussoren | 2006-06-06 21:56:00 +0200 (Tue, 06 Jun 2006) | 3 lines A quick hack to ensure the right key-bindings for IDLE on osx: install patched configuration files during a framework install. ........ r46702 | tim.peters | 2006-06-07 03:04:59 +0200 (Wed, 07 Jun 2006) | 4 lines dash_R_cleanup(): Clear filecmp._cache. This accounts for different results across -R runs (at least on Windows) of test_filecmp. ........ r46705 | tim.peters | 2006-06-07 08:57:51 +0200 (Wed, 07 Jun 2006) | 17 lines SF patch 1501987: Remove randomness from test_exceptions, from ?iga Seilnacht (sorry about the name, but Firefox on my box can't display the first character of the name -- the SF "Unix name" is zseil). This appears to cure the oddball intermittent leaks across runs when running test_exceptions under -R. I'm not sure why, but I'm too sleepy to care ;-) The thrust of the SF patch was to remove randomness in the pickle protocol used. I changed the patch to use range(pickle.HIGHEST_PROTOCOL + 1), to try both pickle and cPickle, and randomly mucked with other test lines to put statements on their own lines. Not a bugfix candidate (this is fiddling new-in-2.5 code). ........ r46706 | andrew.kuchling | 2006-06-07 15:55:33 +0200 (Wed, 07 Jun 2006) | 1 line Add an SQLite introduction, taken from the 'What's New' text ........ r46708 | andrew.kuchling | 2006-06-07 19:02:52 +0200 (Wed, 07 Jun 2006) | 1 line Mention other placeholders ........ r46709 | andrew.kuchling | 2006-06-07 19:03:46 +0200 (Wed, 07 Jun 2006) | 1 line Add an item; also, escape % ........ r46710 | andrew.kuchling | 2006-06-07 19:04:01 +0200 (Wed, 07 Jun 2006) | 1 line Mention other placeholders ........ r46716 | ronald.oussoren | 2006-06-07 20:57:44 +0200 (Wed, 07 Jun 2006) | 2 lines Move Mac/OSX/Tools one level up ........ r46717 | ronald.oussoren | 2006-06-07 20:58:01 +0200 (Wed, 07 Jun 2006) | 2 lines Move Mac/OSX/PythonLauncher one level up ........ r46718 | ronald.oussoren | 2006-06-07 20:58:42 +0200 (Wed, 07 Jun 2006) | 2 lines mv Mac/OSX/BuildScript one level up ........ r46719 | ronald.oussoren | 2006-06-07 21:02:03 +0200 (Wed, 07 Jun 2006) | 2 lines Move Mac/OSX/* one level up ........ r46720 | ronald.oussoren | 2006-06-07 21:06:01 +0200 (Wed, 07 Jun 2006) | 2 lines And the last bit: move IDLE one level up and adjust makefiles ........ r46723 | ronald.oussoren | 2006-06-07 21:38:53 +0200 (Wed, 07 Jun 2006) | 4 lines - Patch the correct version of python in the Info.plists at build time, instead of relying on a maintainer to update them before releases. - Remove the now empty Mac/OSX directory ........ r46727 | ronald.oussoren | 2006-06-07 22:18:44 +0200 (Wed, 07 Jun 2006) | 7 lines * If BuildApplet.py is used as an applet it starts with a version of sys.exutable that isn't usuable on an #!-line. That results in generated applets that don't actually work. Work around this problem by resetting sys.executable. * argvemulator.py didn't work on intel macs. This patch fixes this (bug #1491468) ........ r46728 | tim.peters | 2006-06-07 22:40:06 +0200 (Wed, 07 Jun 2006) | 2 lines Whitespace normalization. ........ r46729 | tim.peters | 2006-06-07 22:40:54 +0200 (Wed, 07 Jun 2006) | 2 lines Add missing svn:eol-style property to text files. ........ r46730 | thomas.heller | 2006-06-07 22:43:06 +0200 (Wed, 07 Jun 2006) | 7 lines Fix for foreign functions returning small structures on 64-bit big endian machines. Should fix the remaininf failure in the PPC64 Debian buildbot. Thanks to Matthias Klose for providing access to a machine to debug and test this. ........ r46731 | brett.cannon | 2006-06-07 23:48:17 +0200 (Wed, 07 Jun 2006) | 2 lines Clarify documentation for bf_getcharbuffer. ........ r46735 | neal.norwitz | 2006-06-08 07:12:45 +0200 (Thu, 08 Jun 2006) | 1 line Fix a refleak in recvfrom_into ........ r46736 | gregory.p.smith | 2006-06-08 07:17:08 +0200 (Thu, 08 Jun 2006) | 9 lines - bsddb: the bsddb.dbtables Modify method now raises the proper error and aborts the db transaction safely when a modifier callback fails. Fixes SF python patch/bug #1408584. Also cleans up the bsddb.dbtables docstrings since thats the only documentation that exists for that unadvertised module. (people really should really just use sqlite3) ........ r46737 | gregory.p.smith | 2006-06-08 07:38:11 +0200 (Thu, 08 Jun 2006) | 4 lines * Turn the deadlock situation described in SF bug #775414 into a DBDeadLockError exception. * add the test case for my previous dbtables commit. ........ r46738 | gregory.p.smith | 2006-06-08 07:39:54 +0200 (Thu, 08 Jun 2006) | 2 lines pasted set_lk_detect line in wrong spot in previous commit. fixed. passes tests this time. ........ r46739 | armin.rigo | 2006-06-08 12:56:24 +0200 (Thu, 08 Jun 2006) | 6 lines (arre, arigo) SF bug #1350060 Give a consistent behavior for comparison and hashing of method objects (both user- and built-in methods). Now compares the 'self' recursively. The hash was already asking for the hash of 'self'. ........ r46740 | andrew.kuchling | 2006-06-08 13:56:44 +0200 (Thu, 08 Jun 2006) | 1 line Typo fix ........ r46741 | georg.brandl | 2006-06-08 14:45:01 +0200 (Thu, 08 Jun 2006) | 2 lines Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds checking. ........ r46743 | georg.brandl | 2006-06-08 14:54:13 +0200 (Thu, 08 Jun 2006) | 2 lines Bug #1502728: Correctly link against librt library on HP-UX. ........ r46745 | georg.brandl | 2006-06-08 14:55:47 +0200 (Thu, 08 Jun 2006) | 3 lines Add news for recent bugfix. ........ r46746 | georg.brandl | 2006-06-08 15:31:07 +0200 (Thu, 08 Jun 2006) | 4 lines Argh. "integer" is a very confusing word ;) Actually, checking for INT_MAX and INT_MIN is correct since the format code explicitly handles a C "int". ........ r46748 | nick.coghlan | 2006-06-08 15:54:49 +0200 (Thu, 08 Jun 2006) | 1 line Add functools.update_wrapper() and functools.wraps() as described in PEP 356 ........ r46751 | georg.brandl | 2006-06-08 16:50:21 +0200 (Thu, 08 Jun 2006) | 4 lines Bug #1502805: don't alias file.__exit__ to file.close since the latter can return something that's true. ........ r46752 | georg.brandl | 2006-06-08 16:50:53 +0200 (Thu, 08 Jun 2006) | 3 lines Convert test_file to unittest. ........
Diffstat (limited to 'Mac/OSX')
-rw-r--r--Mac/OSX/BuildScript/README.txt35
-rwxr-xr-xMac/OSX/BuildScript/build-installer.py1014
-rw-r--r--Mac/OSX/BuildScript/ncurses-5.5.patch36
-rw-r--r--Mac/OSX/BuildScript/resources/ReadMe.txt31
-rw-r--r--Mac/OSX/BuildScript/resources/Welcome.rtf15
-rw-r--r--Mac/OSX/BuildScript/resources/background.jpgbin45421 -> 0 bytes
-rwxr-xr-xMac/OSX/BuildScript/scripts/postflight.documentation12
-rwxr-xr-xMac/OSX/BuildScript/scripts/postflight.framework33
-rwxr-xr-xMac/OSX/BuildScript/scripts/postflight.patch-profile71
-rw-r--r--Mac/OSX/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py110
-rw-r--r--Mac/OSX/Doc/HelpIndexingTool/Miscellaneous_Standards.py49
-rw-r--r--Mac/OSX/Doc/HelpIndexingTool/Required_Suite.py32
-rw-r--r--Mac/OSX/Doc/HelpIndexingTool/Standard_Suite.py343
-rw-r--r--Mac/OSX/Doc/HelpIndexingTool/__init__.py78
-rw-r--r--Mac/OSX/Doc/HelpIndexingTool/odds_and_ends.py49
-rw-r--r--Mac/OSX/Doc/README35
-rw-r--r--Mac/OSX/Doc/setup.py214
-rw-r--r--Mac/OSX/Extras.ReadMe.txt5
-rw-r--r--Mac/OSX/Extras.install.py54
-rw-r--r--Mac/OSX/IDLE/Info.plist55
-rw-r--r--Mac/OSX/IDLE/Makefile.in52
-rw-r--r--Mac/OSX/IDLE/idlemain.py27
-rw-r--r--Mac/OSX/Icons/Disk Image.icnsbin50703 -> 0 bytes
-rw-r--r--Mac/OSX/Icons/IDLE.icnsbin53456 -> 0 bytes
-rw-r--r--Mac/OSX/Icons/Python Folder.icnsbin133608 -> 0 bytes
-rw-r--r--Mac/OSX/Icons/PythonCompiled.icnsbin60777 -> 0 bytes
-rw-r--r--Mac/OSX/Icons/PythonLauncher.icnsbin42658 -> 0 bytes
-rw-r--r--Mac/OSX/Icons/PythonSource.icnsbin54522 -> 0 bytes
-rw-r--r--Mac/OSX/Icons/ReadMe.txt3
-rw-r--r--Mac/OSX/Makefile.in241
-rw-r--r--Mac/OSX/PythonLauncher/English.lproj/Credits.rtf30
-rw-r--r--Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/classes.nib12
-rw-r--r--Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/info.nib21
-rw-r--r--Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/objects.nibbin5016 -> 0 bytes
-rw-r--r--Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib26
-rw-r--r--Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib16
-rw-r--r--Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nibbin4845 -> 0 bytes
-rw-r--r--Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/classes.nib26
-rw-r--r--Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/info.nib16
-rw-r--r--Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/objects.nibbin5882 -> 0 bytes
-rwxr-xr-xMac/OSX/PythonLauncher/FileSettings.h64
-rwxr-xr-xMac/OSX/PythonLauncher/FileSettings.m298
-rw-r--r--Mac/OSX/PythonLauncher/Info.plist65
-rw-r--r--Mac/OSX/PythonLauncher/Makefile.in78
-rw-r--r--Mac/OSX/PythonLauncher/MyAppDelegate.h15
-rw-r--r--Mac/OSX/PythonLauncher/MyAppDelegate.m96
-rwxr-xr-xMac/OSX/PythonLauncher/MyDocument.h41
-rwxr-xr-xMac/OSX/PythonLauncher/MyDocument.m175
-rw-r--r--Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib26
-rw-r--r--Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib16
-rw-r--r--Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nibbin5882 -> 0 bytes
-rw-r--r--Mac/OSX/PythonLauncher/PreferencesWindowController.h38
-rw-r--r--Mac/OSX/PythonLauncher/PreferencesWindowController.m121
-rw-r--r--Mac/OSX/PythonLauncher/doscript.h12
-rw-r--r--Mac/OSX/PythonLauncher/doscript.m118
-rw-r--r--Mac/OSX/PythonLauncher/factorySettings.plist87
-rwxr-xr-xMac/OSX/PythonLauncher/main.m17
-rw-r--r--Mac/OSX/README167
-rw-r--r--Mac/OSX/Tools/pythonw.c17
-rw-r--r--Mac/OSX/fixapplepython23.py118
60 files changed, 0 insertions, 4310 deletions
diff --git a/Mac/OSX/BuildScript/README.txt b/Mac/OSX/BuildScript/README.txt
deleted file mode 100644
index c556de83..0000000
--- a/Mac/OSX/BuildScript/README.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Building a MacPython distribution
-=================================
-
-The ``build-install.py`` script creates MacPython distributions, including
-sleepycat db4, sqlite3 and readline support. It builds a complete
-framework-based Python out-of-tree, installs it in a funny place with
-$DESTROOT, massages that installation to remove .pyc files and such, creates
-an Installer package from the installation plus other files in ``resources``
-and ``scripts`` and placed that on a ``.dmg`` disk image.
-
-Here are the steps you ned to follow to build a MacPython installer:
-
-- Run ``./build-installer.py``. Optionally you can pass a number of arguments
- to specify locations of various files. Please see the top of
- ``build-installer.py`` for its usage.
-- When done the script will tell you where the DMG image is.
-
-The script needs to be run on Mac OS X 10.4 with Xcode 2.2 or later and
-the 10.4u SDK.
-
-When all is done, announcements can be posted to at least the following
-places:
-- pythonmac-sig@python.org
-- python-dev@python.org
-- python-announce@python.org
-- archivist@info-mac.org
-- adcnews@apple.com
-- news@macnn.com
-- http://www.macupdate.com
-- http://guide.apple.com/usindex.lasso
-- http://www.apple.com/downloads/macosx/submit
-- http://www.versiontracker.com/ (userid Jack.Jansen@oratrix.com)
-- http://www.macshareware.net (userid jackjansen)
-
-Also, check out Stephan Deibels http://pythonology.org/market contact list
diff --git a/Mac/OSX/BuildScript/build-installer.py b/Mac/OSX/BuildScript/build-installer.py
deleted file mode 100755
index b24f5dc..0000000
--- a/Mac/OSX/BuildScript/build-installer.py
+++ /dev/null
@@ -1,1014 +0,0 @@
-#!/usr/bin/python2.3
-"""
-This script is used to build the "official unofficial" universal build on
-Mac OS X. It requires Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK to do its
-work.
-
-Please ensure that this script keeps working with Python 2.3, to avoid
-bootstrap issues (/usr/bin/python is Python 2.3 on OSX 10.4)
-
-Usage: see USAGE variable in the script.
-"""
-import platform, os, sys, getopt, textwrap, shutil, urllib2, stat, time, pwd
-
-INCLUDE_TIMESTAMP=1
-VERBOSE=1
-
-from plistlib import Plist
-
-import MacOS
-import Carbon.File
-import Carbon.Icn
-import Carbon.Res
-from Carbon.Files import kCustomIconResource, fsRdWrPerm, kHasCustomIcon
-from Carbon.Files import kFSCatInfoFinderInfo
-
-try:
- from plistlib import writePlist
-except ImportError:
- # We're run using python2.3
- def writePlist(plist, path):
- plist.write(path)
-
-def shellQuote(value):
- """
- Return the string value in a form that can savely be inserted into
- a shell command.
- """
- return "'%s'"%(value.replace("'", "'\"'\"'"))
-
-def grepValue(fn, variable):
- variable = variable + '='
- for ln in open(fn, 'r'):
- if ln.startswith(variable):
- value = ln[len(variable):].strip()
- return value[1:-1]
-
-def getVersion():
- return grepValue(os.path.join(SRCDIR, 'configure'), 'PACKAGE_VERSION')
-
-def getFullVersion():
- fn = os.path.join(SRCDIR, 'Include', 'patchlevel.h')
- for ln in open(fn):
- if 'PY_VERSION' in ln:
- return ln.split()[-1][1:-1]
-
- raise RuntimeError, "Cannot find full version??"
-
-# The directory we'll use to create the build, will be erased and recreated
-WORKDIR="/tmp/_py"
-
-# The directory we'll use to store third-party sources, set this to something
-# else if you don't want to re-fetch required libraries every time.
-DEPSRC=os.path.join(WORKDIR, 'third-party')
-DEPSRC=os.path.expanduser('~/Universal/other-sources')
-
-# Location of the preferred SDK
-SDKPATH="/Developer/SDKs/MacOSX10.4u.sdk"
-#SDKPATH="/"
-
-# Source directory (asume we're in Mac/OSX/Dist)
-SRCDIR=os.path.dirname(
- os.path.dirname(
- os.path.dirname(
- os.path.dirname(
- os.path.abspath(__file__
- )))))
-
-USAGE=textwrap.dedent("""\
- Usage: build_python [options]
-
- Options:
- -? or -h: Show this message
- -b DIR
- --build-dir=DIR: Create build here (default: %(WORKDIR)r)
- --third-party=DIR: Store third-party sources here (default: %(DEPSRC)r)
- --sdk-path=DIR: Location of the SDK (default: %(SDKPATH)r)
- --src-dir=DIR: Location of the Python sources (default: %(SRCDIR)r)
-""")% globals()
-
-
-# Instructions for building libraries that are necessary for building a
-# batteries included python.
-LIBRARY_RECIPES=[
- dict(
- # Note that GNU readline is GPL'd software
- name="GNU Readline 5.1.4",
- url="http://ftp.gnu.org/pub/gnu/readline/readline-5.1.tar.gz" ,
- patchlevel='0',
- patches=[
- # The readline maintainers don't do actual micro releases, but
- # just ship a set of patches.
- 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-001',
- 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-002',
- 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-003',
- 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-004',
- ]
- ),
-
- dict(
- name="SQLite 3.3.5",
- url="http://www.sqlite.org/sqlite-3.3.5.tar.gz",
- checksum='93f742986e8bc2dfa34792e16df017a6feccf3a2',
- configure_pre=[
- '--enable-threadsafe',
- '--enable-tempstore',
- '--enable-shared=no',
- '--enable-static=yes',
- '--disable-tcl',
- ]
- ),
-
- dict(
- name="NCurses 5.5",
- url="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.5.tar.gz",
- configure_pre=[
- "--without-cxx",
- "--without-ada",
- "--without-progs",
- "--without-curses-h",
- "--enable-shared",
- "--with-shared",
- "--datadir=/usr/share",
- "--sysconfdir=/etc",
- "--sharedstatedir=/usr/com",
- "--with-terminfo-dirs=/usr/share/terminfo",
- "--with-default-terminfo-dir=/usr/share/terminfo",
- "--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib"%(getVersion(),),
- "--enable-termcap",
- ],
- patches=[
- "ncurses-5.5.patch",
- ],
- useLDFlags=False,
- install='make && make install DESTDIR=%s && cd %s/usr/local/lib && ln -fs ../../../Library/Frameworks/Python.framework/Versions/%s/lib/lib* .'%(
- shellQuote(os.path.join(WORKDIR, 'libraries')),
- shellQuote(os.path.join(WORKDIR, 'libraries')),
- getVersion(),
- ),
- ),
- dict(
- name="Sleepycat DB 4.4",
- url="http://downloads.sleepycat.com/db-4.4.20.tar.gz",
- #name="Sleepycat DB 4.3.29",
- #url="http://downloads.sleepycat.com/db-4.3.29.tar.gz",
- buildDir="build_unix",
- configure="../dist/configure",
- configure_pre=[
- '--includedir=/usr/local/include/db4',
- ]
- ),
-]
-
-
-# Instructions for building packages inside the .mpkg.
-PKG_RECIPES=[
- dict(
- name="PythonFramework",
- long_name="Python Framework",
- source="/Library/Frameworks/Python.framework",
- readme="""\
- This package installs Python.framework, that is the python
- interpreter and the standard library. This also includes Python
- wrappers for lots of Mac OS X API's.
- """,
- postflight="scripts/postflight.framework",
- ),
- dict(
- name="PythonApplications",
- long_name="GUI Applications",
- source="/Applications/MacPython %(VER)s",
- readme="""\
- This package installs Python.framework, that is the python
- interpreter and the standard library. This also includes Python
- wrappers for lots of Mac OS X API's.
- """,
- required=False,
- ),
- dict(
- name="PythonUnixTools",
- long_name="UNIX command-line tools",
- source="/usr/local/bin",
- readme="""\
- This package installs the unix tools in /usr/local/bin for
- compatibility with older releases of MacPython. This package
- is not necessary to use MacPython.
- """,
- required=False,
- ),
- dict(
- name="PythonDocumentation",
- long_name="Python Documentation",
- topdir="/Library/Frameworks/Python.framework/Versions/%(VER)s/Resources/English.lproj/Documentation",
- source="/pydocs",
- readme="""\
- This package installs the python documentation at a location
- that is useable for pydoc and IDLE. If you have installed Xcode
- it will also install a link to the documentation in
- /Developer/Documentation/Python
- """,
- postflight="scripts/postflight.documentation",
- required=False,
- ),
- dict(
- name="PythonProfileChanges",
- long_name="Shell profile updater",
- readme="""\
- This packages updates your shell profile to make sure that
- the MacPython tools are found by your shell in preference of
- the system provided Python tools.
-
- If you don't install this package you'll have to add
- "/Library/Frameworks/Python.framework/Versions/%(VER)s/bin"
- to your PATH by hand.
- """,
- postflight="scripts/postflight.patch-profile",
- topdir="/Library/Frameworks/Python.framework",
- source="/empty-dir",
- required=False,
- ),
-]
-
-
-def fatal(msg):
- """
- A fatal error, bail out.
- """
- sys.stderr.write('FATAL: ')
- sys.stderr.write(msg)
- sys.stderr.write('\n')
- sys.exit(1)
-
-def fileContents(fn):
- """
- Return the contents of the named file
- """
- return open(fn, 'rb').read()
-
-def runCommand(commandline):
- """
- Run a command and raise RuntimeError if it fails. Output is surpressed
- unless the command fails.
- """
- fd = os.popen(commandline, 'r')
- data = fd.read()
- xit = fd.close()
- if xit != None:
- sys.stdout.write(data)
- raise RuntimeError, "command failed: %s"%(commandline,)
-
- if VERBOSE:
- sys.stdout.write(data); sys.stdout.flush()
-
-def captureCommand(commandline):
- fd = os.popen(commandline, 'r')
- data = fd.read()
- xit = fd.close()
- if xit != None:
- sys.stdout.write(data)
- raise RuntimeError, "command failed: %s"%(commandline,)
-
- return data
-
-def checkEnvironment():
- """
- Check that we're running on a supported system.
- """
-
- if platform.system() != 'Darwin':
- fatal("This script should be run on a Mac OS X 10.4 system")
-
- if platform.release() <= '8.':
- fatal("This script should be run on a Mac OS X 10.4 system")
-
- if not os.path.exists(SDKPATH):
- fatal("Please install the latest version of Xcode and the %s SDK"%(
- os.path.basename(SDKPATH[:-4])))
-
-
-
-def parseOptions(args = None):
- """
- Parse arguments and update global settings.
- """
- global WORKDIR, DEPSRC, SDKPATH, SRCDIR
-
- if args is None:
- args = sys.argv[1:]
-
- try:
- options, args = getopt.getopt(args, '?hb',
- [ 'build-dir=', 'third-party=', 'sdk-path=' , 'src-dir='])
- except getopt.error, msg:
- print msg
- sys.exit(1)
-
- if args:
- print "Additional arguments"
- sys.exit(1)
-
- for k, v in options:
- if k in ('-h', '-?'):
- print USAGE
- sys.exit(0)
-
- elif k in ('-d', '--build-dir'):
- WORKDIR=v
-
- elif k in ('--third-party',):
- DEPSRC=v
-
- elif k in ('--sdk-path',):
- SDKPATH=v
-
- elif k in ('--src-dir',):
- SRCDIR=v
-
- else:
- raise NotImplementedError, k
-
- SRCDIR=os.path.abspath(SRCDIR)
- WORKDIR=os.path.abspath(WORKDIR)
- SDKPATH=os.path.abspath(SDKPATH)
- DEPSRC=os.path.abspath(DEPSRC)
-
- print "Settings:"
- print " * Source directory:", SRCDIR
- print " * Build directory: ", WORKDIR
- print " * SDK location: ", SDKPATH
- print " * third-party source:", DEPSRC
- print ""
-
-
-
-
-def extractArchive(builddir, archiveName):
- """
- Extract a source archive into 'builddir'. Returns the path of the
- extracted archive.
-
- XXX: This function assumes that archives contain a toplevel directory
- that is has the same name as the basename of the archive. This is
- save enough for anything we use.
- """
- curdir = os.getcwd()
- try:
- os.chdir(builddir)
- if archiveName.endswith('.tar.gz'):
- retval = os.path.basename(archiveName[:-7])
- if os.path.exists(retval):
- shutil.rmtree(retval)
- fp = os.popen("tar zxf %s 2>&1"%(shellQuote(archiveName),), 'r')
-
- elif archiveName.endswith('.tar.bz2'):
- retval = os.path.basename(archiveName[:-8])
- if os.path.exists(retval):
- shutil.rmtree(retval)
- fp = os.popen("tar jxf %s 2>&1"%(shellQuote(archiveName),), 'r')
-
- elif archiveName.endswith('.tar'):
- retval = os.path.basename(archiveName[:-4])
- if os.path.exists(retval):
- shutil.rmtree(retval)
- fp = os.popen("tar xf %s 2>&1"%(shellQuote(archiveName),), 'r')
-
- elif archiveName.endswith('.zip'):
- retval = os.path.basename(archiveName[:-4])
- if os.path.exists(retval):
- shutil.rmtree(retval)
- fp = os.popen("unzip %s 2>&1"%(shellQuote(archiveName),), 'r')
-
- data = fp.read()
- xit = fp.close()
- if xit is not None:
- sys.stdout.write(data)
- raise RuntimeError, "Cannot extract %s"%(archiveName,)
-
- return os.path.join(builddir, retval)
-
- finally:
- os.chdir(curdir)
-
-KNOWNSIZES = {
- "http://ftp.gnu.org/pub/gnu/readline/readline-5.1.tar.gz": 7952742,
- "http://downloads.sleepycat.com/db-4.4.20.tar.gz": 2030276,
-}
-
-def downloadURL(url, fname):
- """
- Download the contents of the url into the file.
- """
- try:
- size = os.path.getsize(fname)
- except OSError:
- pass
- else:
- if KNOWNSIZES.get(url) == size:
- print "Using existing file for", url
- return
- fpIn = urllib2.urlopen(url)
- fpOut = open(fname, 'wb')
- block = fpIn.read(10240)
- try:
- while block:
- fpOut.write(block)
- block = fpIn.read(10240)
- fpIn.close()
- fpOut.close()
- except:
- try:
- os.unlink(fname)
- except:
- pass
-
-def buildRecipe(recipe, basedir, archList):
- """
- Build software using a recipe. This function does the
- 'configure;make;make install' dance for C software, with a possibility
- to customize this process, basically a poor-mans DarwinPorts.
- """
- curdir = os.getcwd()
-
- name = recipe['name']
- url = recipe['url']
- configure = recipe.get('configure', './configure')
- install = recipe.get('install', 'make && make install DESTDIR=%s'%(
- shellQuote(basedir)))
-
- archiveName = os.path.split(url)[-1]
- sourceArchive = os.path.join(DEPSRC, archiveName)
-
- if not os.path.exists(DEPSRC):
- os.mkdir(DEPSRC)
-
-
- if os.path.exists(sourceArchive):
- print "Using local copy of %s"%(name,)
-
- else:
- print "Downloading %s"%(name,)
- downloadURL(url, sourceArchive)
- print "Archive for %s stored as %s"%(name, sourceArchive)
-
- print "Extracting archive for %s"%(name,)
- buildDir=os.path.join(WORKDIR, '_bld')
- if not os.path.exists(buildDir):
- os.mkdir(buildDir)
-
- workDir = extractArchive(buildDir, sourceArchive)
- os.chdir(workDir)
- if 'buildDir' in recipe:
- os.chdir(recipe['buildDir'])
-
-
- for fn in recipe.get('patches', ()):
- if fn.startswith('http://'):
- # Download the patch before applying it.
- path = os.path.join(DEPSRC, os.path.basename(fn))
- downloadURL(fn, path)
- fn = path
-
- fn = os.path.join(curdir, fn)
- runCommand('patch -p%s < %s'%(recipe.get('patchlevel', 1),
- shellQuote(fn),))
-
- configure_args = [
- "--prefix=/usr/local",
- "--enable-static",
- "--disable-shared",
- #"CPP=gcc -arch %s -E"%(' -arch '.join(archList,),),
- ]
-
- if 'configure_pre' in recipe:
- args = list(recipe['configure_pre'])
- if '--disable-static' in args:
- configure_args.remove('--enable-static')
- if '--enable-shared' in args:
- configure_args.remove('--disable-shared')
- configure_args.extend(args)
-
- if recipe.get('useLDFlags', 1):
- configure_args.extend([
- "CFLAGS=-arch %s -isysroot %s -I%s/usr/local/include"%(
- ' -arch '.join(archList),
- shellQuote(SDKPATH)[1:-1],
- shellQuote(basedir)[1:-1],),
- "LDFLAGS=-syslibroot,%s -L%s/usr/local/lib -arch %s"%(
- shellQuote(SDKPATH)[1:-1],
- shellQuote(basedir)[1:-1],
- ' -arch '.join(archList)),
- ])
- else:
- configure_args.extend([
- "CFLAGS=-arch %s -isysroot %s -I%s/usr/local/include"%(
- ' -arch '.join(archList),
- shellQuote(SDKPATH)[1:-1],
- shellQuote(basedir)[1:-1],),
- ])
-
- if 'configure_post' in recipe:
- configure_args = configure_args = list(recipe['configure_post'])
-
- configure_args.insert(0, configure)
- configure_args = [ shellQuote(a) for a in configure_args ]
-
- print "Running configure for %s"%(name,)
- runCommand(' '.join(configure_args) + ' 2>&1')
-
- print "Running install for %s"%(name,)
- runCommand('{ ' + install + ' ;} 2>&1')
-
- print "Done %s"%(name,)
- print ""
-
- os.chdir(curdir)
-
-def buildLibraries():
- """
- Build our dependencies into $WORKDIR/libraries/usr/local
- """
- print ""
- print "Building required libraries"
- print ""
- universal = os.path.join(WORKDIR, 'libraries')
- os.mkdir(universal)
- os.makedirs(os.path.join(universal, 'usr', 'local', 'lib'))
- os.makedirs(os.path.join(universal, 'usr', 'local', 'include'))
-
- for recipe in LIBRARY_RECIPES:
- buildRecipe(recipe, universal, ('i386', 'ppc',))
-
-
-
-def buildPythonDocs():
- # This stores the documentation as Resources/English.lproj/Docuentation
- # inside the framwork. pydoc and IDLE will pick it up there.
- print "Install python documentation"
- rootDir = os.path.join(WORKDIR, '_root')
- version = getVersion()
- docdir = os.path.join(rootDir, 'pydocs')
-
- name = 'html-%s.tar.bz2'%(getFullVersion(),)
- sourceArchive = os.path.join(DEPSRC, name)
- if os.path.exists(sourceArchive):
- print "Using local copy of %s"%(name,)
-
- else:
- print "Downloading %s"%(name,)
- downloadURL('http://www.python.org/ftp/python/doc/%s/%s'%(
- getFullVersion(), name), sourceArchive)
- print "Archive for %s stored as %s"%(name, sourceArchive)
-
- extractArchive(os.path.dirname(docdir), sourceArchive)
- os.rename(
- os.path.join(
- os.path.dirname(docdir), 'Python-Docs-%s'%(getFullVersion(),)),
- docdir)
-
-
-def buildPython():
- print "Building a universal python"
-
- buildDir = os.path.join(WORKDIR, '_bld', 'python')
- rootDir = os.path.join(WORKDIR, '_root')
-
- if os.path.exists(buildDir):
- shutil.rmtree(buildDir)
- if os.path.exists(rootDir):
- shutil.rmtree(rootDir)
- os.mkdir(buildDir)
- os.mkdir(rootDir)
- os.mkdir(os.path.join(rootDir, 'empty-dir'))
- curdir = os.getcwd()
- os.chdir(buildDir)
-
- # Not sure if this is still needed, the original build script
- # claims that parts of the install assume python.exe exists.
- os.symlink('python', os.path.join(buildDir, 'python.exe'))
-
- # Extract the version from the configure file, needed to calculate
- # several paths.
- version = getVersion()
-
- print "Running configure..."
- runCommand("%s -C --enable-framework --enable-universalsdk=%s LDFLAGS='-g -L%s/libraries/usr/local/lib' OPT='-g -O3 -I%s/libraries/usr/local/include' 2>&1"%(
- shellQuote(os.path.join(SRCDIR, 'configure')),
- shellQuote(SDKPATH), shellQuote(WORKDIR)[1:-1],
- shellQuote(WORKDIR)[1:-1]))
-
- print "Running make"
- runCommand("make")
-
- print "Runing make frameworkinstall"
- runCommand("make frameworkinstall DESTDIR=%s"%(
- shellQuote(rootDir)))
-
- print "Runing make frameworkinstallextras"
- runCommand("make frameworkinstallextras DESTDIR=%s"%(
- shellQuote(rootDir)))
-
- print "Copy required shared libraries"
- if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')):
- runCommand("mv %s/* %s"%(
- shellQuote(os.path.join(
- WORKDIR, 'libraries', 'Library', 'Frameworks',
- 'Python.framework', 'Versions', getVersion(),
- 'lib')),
- shellQuote(os.path.join(WORKDIR, '_root', 'Library', 'Frameworks',
- 'Python.framework', 'Versions', getVersion(),
- 'lib'))))
-
- print "Fix file modes"
- frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework')
- for dirpath, dirnames, filenames in os.walk(frmDir):
- for dn in dirnames:
- os.chmod(os.path.join(dirpath, dn), 0775)
-
- for fn in filenames:
- if os.path.islink(fn):
- continue
-
- # "chmod g+w $fn"
- p = os.path.join(dirpath, fn)
- st = os.stat(p)
- os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IXGRP)
-
- # We added some directories to the search path during the configure
- # phase. Remove those because those directories won't be there on
- # the end-users system.
- path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework',
- 'Versions', version, 'lib', 'python%s'%(version,),
- 'config', 'Makefile')
- fp = open(path, 'r')
- data = fp.read()
- fp.close()
-
- data = data.replace('-L%s/libraries/usr/local/lib'%(WORKDIR,), '')
- data = data.replace('-I%s/libraries/usr/local/include'%(WORKDIR,), '')
- fp = open(path, 'w')
- fp.write(data)
- fp.close()
-
- # Add symlinks in /usr/local/bin, using relative links
- usr_local_bin = os.path.join(rootDir, 'usr', 'local', 'bin')
- to_framework = os.path.join('..', '..', '..', 'Library', 'Frameworks',
- 'Python.framework', 'Versions', version, 'bin')
- if os.path.exists(usr_local_bin):
- shutil.rmtree(usr_local_bin)
- os.makedirs(usr_local_bin)
- for fn in os.listdir(
- os.path.join(frmDir, 'Versions', version, 'bin')):
- os.symlink(os.path.join(to_framework, fn),
- os.path.join(usr_local_bin, fn))
-
- os.chdir(curdir)
-
-
-
-def patchFile(inPath, outPath):
- data = fileContents(inPath)
- data = data.replace('$FULL_VERSION', getFullVersion())
- data = data.replace('$VERSION', getVersion())
- data = data.replace('$MACOSX_DEPLOYMENT_TARGET', '10.3 or later')
- data = data.replace('$ARCHITECTURES', "i386, ppc")
- data = data.replace('$INSTALL_SIZE', installSize())
- fp = open(outPath, 'wb')
- fp.write(data)
- fp.close()
-
-def patchScript(inPath, outPath):
- data = fileContents(inPath)
- data = data.replace('@PYVER@', getVersion())
- fp = open(outPath, 'wb')
- fp.write(data)
- fp.close()
- os.chmod(outPath, 0755)
-
-
-
-def packageFromRecipe(targetDir, recipe):
- curdir = os.getcwd()
- try:
- pkgname = recipe['name']
- srcdir = recipe.get('source')
- pkgroot = recipe.get('topdir', srcdir)
- postflight = recipe.get('postflight')
- readme = textwrap.dedent(recipe['readme'])
- isRequired = recipe.get('required', True)
-
- print "- building package %s"%(pkgname,)
-
- # Substitute some variables
- textvars = dict(
- VER=getVersion(),
- FULLVER=getFullVersion(),
- )
- readme = readme % textvars
-
- if pkgroot is not None:
- pkgroot = pkgroot % textvars
- else:
- pkgroot = '/'
-
- if srcdir is not None:
- srcdir = os.path.join(WORKDIR, '_root', srcdir[1:])
- srcdir = srcdir % textvars
-
- if postflight is not None:
- postflight = os.path.abspath(postflight)
-
- packageContents = os.path.join(targetDir, pkgname + '.pkg', 'Contents')
- os.makedirs(packageContents)
-
- if srcdir is not None:
- os.chdir(srcdir)
- runCommand("pax -wf %s . 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.pax')),))
- runCommand("gzip -9 %s 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.pax')),))
- runCommand("mkbom . %s 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.bom')),))
-
- fn = os.path.join(packageContents, 'PkgInfo')
- fp = open(fn, 'w')
- fp.write('pmkrpkg1')
- fp.close()
-
- rsrcDir = os.path.join(packageContents, "Resources")
- os.mkdir(rsrcDir)
- fp = open(os.path.join(rsrcDir, 'ReadMe.txt'), 'w')
- fp.write(readme)
- fp.close()
-
- if postflight is not None:
- patchScript(postflight, os.path.join(rsrcDir, 'postflight'))
-
- vers = getFullVersion()
- major, minor = map(int, getVersion().split('.', 2))
- pl = Plist(
- CFBundleGetInfoString="MacPython.%s %s"%(pkgname, vers,),
- CFBundleIdentifier='org.python.MacPython.%s'%(pkgname,),
- CFBundleName='MacPython.%s'%(pkgname,),
- CFBundleShortVersionString=vers,
- IFMajorVersion=major,
- IFMinorVersion=minor,
- IFPkgFormatVersion=0.10000000149011612,
- IFPkgFlagAllowBackRev=False,
- IFPkgFlagAuthorizationAction="RootAuthorization",
- IFPkgFlagDefaultLocation=pkgroot,
- IFPkgFlagFollowLinks=True,
- IFPkgFlagInstallFat=True,
- IFPkgFlagIsRequired=isRequired,
- IFPkgFlagOverwritePermissions=False,
- IFPkgFlagRelocatable=False,
- IFPkgFlagRestartAction="NoRestart",
- IFPkgFlagRootVolumeOnly=True,
- IFPkgFlagUpdateInstalledLangauges=False,
- )
- writePlist(pl, os.path.join(packageContents, 'Info.plist'))
-
- pl = Plist(
- IFPkgDescriptionDescription=readme,
- IFPkgDescriptionTitle=recipe.get('long_name', "MacPython.%s"%(pkgname,)),
- IFPkgDescriptionVersion=vers,
- )
- writePlist(pl, os.path.join(packageContents, 'Resources', 'Description.plist'))
-
- finally:
- os.chdir(curdir)
-
-
-def makeMpkgPlist(path):
-
- vers = getFullVersion()
- major, minor = map(int, getVersion().split('.', 2))
-
- pl = Plist(
- CFBundleGetInfoString="MacPython %s"%(vers,),
- CFBundleIdentifier='org.python.MacPython',
- CFBundleName='MacPython',
- CFBundleShortVersionString=vers,
- IFMajorVersion=major,
- IFMinorVersion=minor,
- IFPkgFlagComponentDirectory="Contents/Packages",
- IFPkgFlagPackageList=[
- dict(
- IFPkgFlagPackageLocation='%s.pkg'%(item['name']),
- IFPkgFlagPackageSelection='selected'
- )
- for item in PKG_RECIPES
- ],
- IFPkgFormatVersion=0.10000000149011612,
- IFPkgFlagBackgroundScaling="proportional",
- IFPkgFlagBackgroundAlignment="left",
- )
-
- writePlist(pl, path)
-
-
-def buildInstaller():
-
- # Zap all compiled files
- for dirpath, _, filenames in os.walk(os.path.join(WORKDIR, '_root')):
- for fn in filenames:
- if fn.endswith('.pyc') or fn.endswith('.pyo'):
- os.unlink(os.path.join(dirpath, fn))
-
- outdir = os.path.join(WORKDIR, 'installer')
- if os.path.exists(outdir):
- shutil.rmtree(outdir)
- os.mkdir(outdir)
-
- pkgroot = os.path.join(outdir, 'MacPython.mpkg', 'Contents')
- pkgcontents = os.path.join(pkgroot, 'Packages')
- os.makedirs(pkgcontents)
- for recipe in PKG_RECIPES:
- packageFromRecipe(pkgcontents, recipe)
-
- rsrcDir = os.path.join(pkgroot, 'Resources')
-
- fn = os.path.join(pkgroot, 'PkgInfo')
- fp = open(fn, 'w')
- fp.write('pmkrpkg1')
- fp.close()
-
- os.mkdir(rsrcDir)
-
- makeMpkgPlist(os.path.join(pkgroot, 'Info.plist'))
- pl = Plist(
- IFPkgDescriptionTitle="Universal MacPython",
- IFPkgDescriptionVersion=getVersion(),
- )
-
- writePlist(pl, os.path.join(pkgroot, 'Resources', 'Description.plist'))
- for fn in os.listdir('resources'):
- if fn == '.svn': continue
- if fn.endswith('.jpg'):
- shutil.copy(os.path.join('resources', fn), os.path.join(rsrcDir, fn))
- else:
- patchFile(os.path.join('resources', fn), os.path.join(rsrcDir, fn))
-
- shutil.copy("../../../LICENSE", os.path.join(rsrcDir, 'License.txt'))
-
-
-def installSize(clear=False, _saved=[]):
- if clear:
- del _saved[:]
- if not _saved:
- data = captureCommand("du -ks %s"%(
- shellQuote(os.path.join(WORKDIR, '_root'))))
- _saved.append("%d"%((0.5 + (int(data.split()[0]) / 1024.0)),))
- return _saved[0]
-
-
-def buildDMG():
- """
- Create DMG containing the rootDir
- """
- outdir = os.path.join(WORKDIR, 'diskimage')
- if os.path.exists(outdir):
- shutil.rmtree(outdir)
-
- imagepath = os.path.join(outdir,
- 'python-%s-macosx'%(getFullVersion(),))
- if INCLUDE_TIMESTAMP:
- imagepath = imagepath + '%04d-%02d-%02d'%(time.localtime()[:3])
- imagepath = imagepath + '.dmg'
-
- os.mkdir(outdir)
- runCommand("hdiutil create -volname 'Univeral MacPython %s' -srcfolder %s %s"%(
- getFullVersion(),
- shellQuote(os.path.join(WORKDIR, 'installer')),
- shellQuote(imagepath)))
-
- return imagepath
-
-
-def setIcon(filePath, icnsPath):
- """
- Set the custom icon for the specified file or directory.
-
- For a directory the icon data is written in a file named 'Icon\r' inside
- the directory. For both files and directories write the icon as an 'icns'
- resource. Furthermore set kHasCustomIcon in the finder flags for filePath.
- """
- ref, isDirectory = Carbon.File.FSPathMakeRef(icnsPath)
- icon = Carbon.Icn.ReadIconFile(ref)
- del ref
-
- #
- # Open the resource fork of the target, to add the icon later on.
- # For directories we use the file 'Icon\r' inside the directory.
- #
-
- ref, isDirectory = Carbon.File.FSPathMakeRef(filePath)
-
- if isDirectory:
- tmpPath = os.path.join(filePath, "Icon\r")
- if not os.path.exists(tmpPath):
- fp = open(tmpPath, 'w')
- fp.close()
-
- tmpRef, _ = Carbon.File.FSPathMakeRef(tmpPath)
- spec = Carbon.File.FSSpec(tmpRef)
-
- else:
- spec = Carbon.File.FSSpec(ref)
-
- try:
- Carbon.Res.HCreateResFile(*spec.as_tuple())
- except MacOS.Error:
- pass
-
- # Try to create the resource fork again, this will avoid problems
- # when adding an icon to a directory. I have no idea why this helps,
- # but without this adding the icon to a directory will fail sometimes.
- try:
- Carbon.Res.HCreateResFile(*spec.as_tuple())
- except MacOS.Error:
- pass
-
- refNum = Carbon.Res.FSpOpenResFile(spec, fsRdWrPerm)
-
- Carbon.Res.UseResFile(refNum)
-
- # Check if there already is an icon, remove it if there is.
- try:
- h = Carbon.Res.Get1Resource('icns', kCustomIconResource)
- except MacOS.Error:
- pass
-
- else:
- h.RemoveResource()
- del h
-
- # Add the icon to the resource for of the target
- res = Carbon.Res.Resource(icon)
- res.AddResource('icns', kCustomIconResource, '')
- res.WriteResource()
- res.DetachResource()
- Carbon.Res.CloseResFile(refNum)
-
- # And now set the kHasCustomIcon property for the target. Annoyingly,
- # python doesn't seem to have bindings for the API that is needed for
- # this. Cop out and call SetFile
- os.system("/Developer/Tools/SetFile -a C %s"%(
- shellQuote(filePath),))
-
- if isDirectory:
- os.system('/Developer/Tools/SetFile -a V %s'%(
- shellQuote(tmpPath),
- ))
-
-def main():
- # First parse options and check if we can perform our work
- parseOptions()
- checkEnvironment()
-
- os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
-
- if os.path.exists(WORKDIR):
- shutil.rmtree(WORKDIR)
- os.mkdir(WORKDIR)
-
- # Then build third-party libraries such as sleepycat DB4.
- buildLibraries()
-
- # Now build python itself
- buildPython()
- buildPythonDocs()
- fn = os.path.join(WORKDIR, "_root", "Applications",
- "MacPython %s"%(getVersion(),), "Update Shell Profile.command")
- shutil.copy("scripts/postflight.patch-profile", fn)
- os.chmod(fn, 0755)
-
- folder = os.path.join(WORKDIR, "_root", "Applications", "MacPython %s"%(
- getVersion(),))
- os.chmod(folder, 0755)
- setIcon(folder, "../Icons/Python Folder.icns")
-
- # Create the installer
- buildInstaller()
-
- # And copy the readme into the directory containing the installer
- patchFile('resources/ReadMe.txt', os.path.join(WORKDIR, 'installer', 'ReadMe.txt'))
-
- # Ditto for the license file.
- shutil.copy('../../../LICENSE', os.path.join(WORKDIR, 'installer', 'License.txt'))
-
- fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w')
- print >> fp, "# BUILD INFO"
- print >> fp, "# Date:", time.ctime()
- print >> fp, "# By:", pwd.getpwuid(os.getuid()).pw_gecos
- fp.close()
-
- # Custom icon for the DMG, shown when the DMG is mounted.
- shutil.copy("../Icons/Disk Image.icns",
- os.path.join(WORKDIR, "installer", ".VolumeIcon.icns"))
- os.system("/Developer/Tools/SetFile -a C %s"%(
- os.path.join(WORKDIR, "installer", ".VolumeIcon.icns")))
-
-
- # And copy it to a DMG
- buildDMG()
-
-
-if __name__ == "__main__":
- main()
diff --git a/Mac/OSX/BuildScript/ncurses-5.5.patch b/Mac/OSX/BuildScript/ncurses-5.5.patch
deleted file mode 100644
index 0eab3d3..0000000
--- a/Mac/OSX/BuildScript/ncurses-5.5.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -r -u ncurses-5.5-orig/test/Makefile.in ncurses-5.5/test/Makefile.in
---- ncurses-5.5-orig/test/Makefile.in 2006-03-24 12:47:40.000000000 +0100
-+++ ncurses-5.5/test/Makefile.in 2006-03-24 12:47:50.000000000 +0100
-@@ -75,7 +75,7 @@
- MATH_LIB = @MATH_LIB@
-
- LD = @LD@
--LINK = @LINK_TESTS@ $(LIBTOOL_LINK) $(CC) $(CFLAGS)
-+LINK = @LINK_TESTS@ $(LIBTOOL_LINK) $(CC)
-
- usFLAGS = @LD_MODEL@ @LOCAL_LDFLAGS@ @LDFLAGS@
-
-diff -ru ncurses-5.5-orig/ncurses/tinfo/read_entry.c ncurses-5.5/ncurses/tinfo/read_entry.c
---- ncurses-5.5-orig/ncurses/tinfo/read_entry.c 2004-01-11 02:57:05.000000000 +0100
-+++ ncurses-5.5/ncurses/tinfo/read_entry.c 2006-03-25 22:49:39.000000000 +0100
-@@ -474,7 +474,7 @@
- }
-
- /* truncate the terminal name to prevent buffer overflow */
-- (void) sprintf(ttn, "%c/%.*s", *tn, (int) sizeof(ttn) - 3, tn);
-+ (void) sprintf(ttn, "%x/%.*s", *tn, (int) sizeof(ttn) - 3, tn);
-
- /* This is System V behavior, in conjunction with our requirements for
- * writing terminfo entries.
-diff -ru ncurses-5.5-orig/configure ncurses-5.5/configure
---- ncurses-5.5-orig/configure 2005-09-24 23:50:50.000000000 +0200
-+++ ncurses-5.5/configure 2006-03-26 22:24:59.000000000 +0200
-@@ -5027,7 +5027,7 @@
- darwin*)
- EXTRA_CFLAGS="-no-cpp-precomp"
- CC_SHARED_OPTS="-dynamic"
-- MK_SHARED_LIB='$(CC) -dynamiclib -install_name $(DESTDIR)$(libdir)/`basename $@` -compatibility_version $(ABI_VERSION) -current_version $(ABI_VERSION) -o $@'
-+ MK_SHARED_LIB='$(CC) $(CFLAGS) -dynamiclib -install_name $(DESTDIR)$(libdir)/`basename $@` -compatibility_version $(ABI_VERSION) -current_version $(ABI_VERSION) -o $@'
- test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
- cf_cv_shlib_version_infix=yes
- ;;
diff --git a/Mac/OSX/BuildScript/resources/ReadMe.txt b/Mac/OSX/BuildScript/resources/ReadMe.txt
deleted file mode 100644
index 1a6e637..0000000
--- a/Mac/OSX/BuildScript/resources/ReadMe.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-This package will install MacPython $FULL_VERSION for Mac OS X
-$MACOSX_DEPLOYMENT_TARGET for the following
-architecture(s): $ARCHITECTURES.
-
-Separate installers are available for older versions
-of Mac OS X, see the homepage, below.
-
-Installation requires approximately $INSTALL_SIZE MB of disk
-space, ignore the message that it will take zero bytes.
-
-You must install onto your current boot disk, even
-though the installer does not enforce this, otherwise
-things will not work.
-
-MacPython consists of the Python programming language
-interpreter, plus a set of programs to allow easy
-access to it for Mac users (an integrated development
-environment, an applet builder), plus a set of pre-built
-extension modules that open up specific Macintosh technologies
-to Python programs (Carbon, AppleScript, Quicktime, more).
-
-The installer puts the applications in "MacPython $VERSION"
-in your Applications folder, command-line tools in
-/usr/local/bin and the underlying machinery in
-$PYTHONFRAMEWORKINSTALLDIR.
-
-More information on MacPython can be found at
-http://www.cwi.nl/~jack/macpython and
-http://pythonmac.org/. More information on
-Python in general can be found at
-http://www.python.org.
diff --git a/Mac/OSX/BuildScript/resources/Welcome.rtf b/Mac/OSX/BuildScript/resources/Welcome.rtf
deleted file mode 100644
index cb65f09..0000000
--- a/Mac/OSX/BuildScript/resources/Welcome.rtf
+++ /dev/null
@@ -1,15 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf330
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;}
-{\colortbl;\red255\green255\blue255;}
-\paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0
-\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
-
-\f0\fs24 \cf0 This package will install
-\f1\b MacPython $FULL_VERSION
-\f0\b0 for
-\f1\b Mac OS X $MACOSX_DEPLOYMENT_TARGET
-\f0\b0 .\
-\
-MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users (an integrated development environment, an applet builder), plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs (Carbon, AppleScript, Quicktime, more).\
-\
-See the ReadMe file for more information.} \ No newline at end of file
diff --git a/Mac/OSX/BuildScript/resources/background.jpg b/Mac/OSX/BuildScript/resources/background.jpg
deleted file mode 100644
index b3c7640..0000000
--- a/Mac/OSX/BuildScript/resources/background.jpg
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/BuildScript/scripts/postflight.documentation b/Mac/OSX/BuildScript/scripts/postflight.documentation
deleted file mode 100755
index 85d400f..0000000
--- a/Mac/OSX/BuildScript/scripts/postflight.documentation
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# FIXME
-PYVER="@PYVER@"
-
-if [ -d /Developer/Documentation ]; then
- if [ ! -d /Developer/Documentation/Python ]; then
- mkdir -p /Developer/Documentation/Python
- fi
-
- ln -fhs /Library/Frameworks/Python.framework/Versions/${PYVER}/Resources/English.lproj/Documentation "/Developer/Documentation/Python/Reference Documentation"
-fi
diff --git a/Mac/OSX/BuildScript/scripts/postflight.framework b/Mac/OSX/BuildScript/scripts/postflight.framework
deleted file mode 100755
index 532e745..0000000
--- a/Mac/OSX/BuildScript/scripts/postflight.framework
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-#
-# Recompile the .py files.
-#
-
-PYVER="@PYVER@"
-FWK="/Library/Frameworks/Python.framework/Versions/@PYVER@/"
-
-"${FWK}/bin/python" -Wi -tt \
- "${FWK}/lib/python${PYVER}/compileall.py" \
- -x badsyntax -x site-packages \
- "${FWK}/lib/python${PYVER}"
-
-"${FWK}/bin/python" -Wi -tt -O \
- "${FWK}/lib/python${PYVER}/compileall.py" \
- -x badsyntax -x site-packages \
- "${FWK}/lib/python${PYVER}"
-
-"${FWK}/bin/python" -Wi -tt \
- "${FWK}/lib/python${PYVER}/compileall.py" \
- -x badsyntax -x site-packages \
- "${FWK}/Mac/Tools"
-
-"${FWK}/bin/python" -Wi -tt -O \
- "${FWK}/lib/python${PYVER}/compileall.py" \
- -x badsyntax -x site-packages \
- "${FWK}/Mac/Tools"
-
-
-chown -R admin "${FWK}"
-chmod -R g+w "${FWK}"
-
-exit 0
diff --git a/Mac/OSX/BuildScript/scripts/postflight.patch-profile b/Mac/OSX/BuildScript/scripts/postflight.patch-profile
deleted file mode 100755
index 48bf701..0000000
--- a/Mac/OSX/BuildScript/scripts/postflight.patch-profile
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/sh
-
-echo "This script will update your shell profile when the 'bin' directory"
-echo "of python is not early enough of the PATH of your shell."
-echo "These changes will be effective only in shell windows that you open"
-echo "after running this script."
-
-PYVER=@PYVER@
-PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/Current"
-
-# Make sure the directory ${PYTHON_ROOT}/bin is on the users PATH.
-BSH="`basename "${SHELL}"`"
-case "${BSH}" in
-bash|ksh|sh|*csh)
- P="`${SHELL} -c 'echo $PATH'`"
- ;;
-*)
- echo "Sorry, I don't know how to patch $BSH shells"
- exit 0
- ;;
-esac
-
-# Now ensure that our bin directory is on $P and before /usr/bin at that
-for elem in `echo $P | tr ':' ' '`
-do
- if [ "${elem}" == "${PYTHON_ROOT}/bin" ]; then
- echo "All right, you're a python lover already"
- exit 0
- elif [ "${elem}" == "/usr/bin" ]; then
- break
- fi
-done
-
-echo "${PYTHON_ROOT}/bin is not on your PATH or at least not early enough"
-case "${BSH}" in
-*csh)
- # Create backup copy before patching
- if [ -f "${HOME}/.cshrc" ]; then
- cp -fp "${HOME}/.cshrc" "${HOME}/.cshrc.pysave"
- fi
- echo "" >> "${HOME}/.cshrc"
- echo "# Setting PATH for MacPython ${PYVER}" >> "${HOME}/.cshrc"
- echo "# The orginal version is saved in .cshrc.pysave" >> "${HOME}/.cshrc"
- echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${HOME}/.cshrc"
- exit 0
- ;;
-bash)
- if [ -e "${HOME}/.profile" ]; then
- PR="${HOME}/.profile"
- else
- PR="${HOME}/.bash_profile"
- fi
- ;;
-*sh)
- PR="${HOME}/.profile"
- ;;
-esac
-
-# Create backup copy before patching
-if [ -f "${PR}" ]; then
- cp -fp "${PR}" "${PR}.pysave"
-fi
-echo "" >> "${PR}"
-echo "# Setting PATH for MacPython ${PYVER}" >> "${PR}"
-echo "# The orginal version is saved in `basename ${PR}`.pysave" >> "${PR}"
-echo 'PATH="'"${PYTHON_ROOT}/bin"':${PATH}"' >> "${PR}"
-echo 'export PATH' >> "${PR}"
-if [ `id -ur` = 0 ]; then
- chown "${LOGNAME}" "${PR}"
-fi
-exit 0
diff --git a/Mac/OSX/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py b/Mac/OSX/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py
deleted file mode 100644
index 58d7307..0000000
--- a/Mac/OSX/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py
+++ /dev/null
@@ -1,110 +0,0 @@
-"""Suite Help Indexing Tool Suite: Special events that just the Help Indexing Tool supports.
-Level 0, version 0
-
-Generated from /Developer/Applications/Apple Help Indexing Tool.app
-AETE/AEUT resource version 1/1, language 0, script 0
-"""
-
-import aetools
-import MacOS
-
-_code = 'HIT '
-
-class Help_Indexing_Tool_Suite_Events:
-
- def turn_anchor_indexing(self, _object, _attributes={}, **_arguments):
- """turn anchor indexing: Turns anchor indexing on or off.
- Required argument: \xd2on\xd3 or \xd2off\xd3, to turn anchor indexing on or off
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'HIT '
- _subcode = 'tAnc'
-
- if _arguments: raise TypeError, 'No optional args expected'
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
- _argmap_turn_remote_root = {
- 'with_root_url' : 'rURL',
- }
-
- def turn_remote_root(self, _object, _attributes={}, **_arguments):
- """turn remote root: Turn usage of remote root for content on the web on or off. If turning \xd2on\xd3, supply a string as second parameter.
- Required argument: \xd2on\xd3 or \xd2off\xd3, to turn remote root on or off
- Keyword argument with_root_url: The remote root to use, in the form of \xd2http://www.apple.com/help/\xd3.
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'HIT '
- _subcode = 'tRem'
-
- aetools.keysubst(_arguments, self._argmap_turn_remote_root)
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
- def use_tokenizer(self, _object, _attributes={}, **_arguments):
- """use tokenizer: Tells the indexing tool which tokenizer to use.
- Required argument: Specify \xd2English\xd3, \xd2European\xd3, \xd2Japanese\xd3, \xd2Korean\xd3, or \xd2Simple\xd3.
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'HIT '
- _subcode = 'uTok'
-
- if _arguments: raise TypeError, 'No optional args expected'
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
-
-class application(aetools.ComponentItem):
- """application - Application class """
- want = 'capp'
-class _Prop_idleStatus(aetools.NProperty):
- """idleStatus - """
- which = 'sIdl'
- want = 'bool'
-application._superclassnames = []
-application._privpropdict = {
- 'idleStatus' : _Prop_idleStatus,
-}
-application._privelemdict = {
-}
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
- 'capp' : application,
-}
-
-_propdeclarations = {
- 'sIdl' : _Prop_idleStatus,
-}
-
-_compdeclarations = {
-}
-
-_enumdeclarations = {
-}
diff --git a/Mac/OSX/Doc/HelpIndexingTool/Miscellaneous_Standards.py b/Mac/OSX/Doc/HelpIndexingTool/Miscellaneous_Standards.py
deleted file mode 100644
index 3cf745f..0000000
--- a/Mac/OSX/Doc/HelpIndexingTool/Miscellaneous_Standards.py
+++ /dev/null
@@ -1,49 +0,0 @@
-"""Suite Miscellaneous Standards: Useful events that aren\xd5t in any other suite
-Level 0, version 0
-
-Generated from /Developer/Applications/Apple Help Indexing Tool.app
-AETE/AEUT resource version 1/1, language 0, script 0
-"""
-
-import aetools
-import MacOS
-
-_code = 'misc'
-
-class Miscellaneous_Standards_Events:
-
- def revert(self, _object, _attributes={}, **_arguments):
- """revert: Revert an object to the most recently saved version
- Required argument: object to revert
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'misc'
- _subcode = 'rvrt'
-
- if _arguments: raise TypeError, 'No optional args expected'
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
-}
-
-_propdeclarations = {
-}
-
-_compdeclarations = {
-}
-
-_enumdeclarations = {
-}
diff --git a/Mac/OSX/Doc/HelpIndexingTool/Required_Suite.py b/Mac/OSX/Doc/HelpIndexingTool/Required_Suite.py
deleted file mode 100644
index eb9fee0..0000000
--- a/Mac/OSX/Doc/HelpIndexingTool/Required_Suite.py
+++ /dev/null
@@ -1,32 +0,0 @@
-"""Suite Required Suite: Terms that every application should support
-Level 1, version 1
-
-Generated from /Developer/Applications/Apple Help Indexing Tool.app
-AETE/AEUT resource version 1/1, language 0, script 0
-"""
-
-import aetools
-import MacOS
-
-_code = 'reqd'
-
-from StdSuites.Required_Suite import *
-class Required_Suite_Events(Required_Suite_Events):
-
- pass
-
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
-}
-
-_propdeclarations = {
-}
-
-_compdeclarations = {
-}
-
-_enumdeclarations = {
-}
diff --git a/Mac/OSX/Doc/HelpIndexingTool/Standard_Suite.py b/Mac/OSX/Doc/HelpIndexingTool/Standard_Suite.py
deleted file mode 100644
index 4f6604c..0000000
--- a/Mac/OSX/Doc/HelpIndexingTool/Standard_Suite.py
+++ /dev/null
@@ -1,343 +0,0 @@
-"""Suite Standard Suite: Common terms for most applications
-Level 1, version 1
-
-Generated from /Developer/Applications/Apple Help Indexing Tool.app
-AETE/AEUT resource version 1/1, language 0, script 0
-"""
-
-import aetools
-import MacOS
-
-_code = 'CoRe'
-
-from StdSuites.Standard_Suite import *
-class Standard_Suite_Events(Standard_Suite_Events):
-
- _argmap_close = {
- 'saving' : 'savo',
- 'in_' : 'kfil',
- }
-
- def close(self, _object, _attributes={}, **_arguments):
- """close: Close an object
- Required argument: the objects to close
- Keyword argument saving: specifies whether or not changes should be saved before closing
- Keyword argument in_: the file in which to save the object
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'core'
- _subcode = 'clos'
-
- aetools.keysubst(_arguments, self._argmap_close)
- _arguments['----'] = _object
-
- aetools.enumsubst(_arguments, 'savo', _Enum_savo)
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
- def data_size(self, _object, _attributes={}, **_arguments):
- """data size: Return the size in bytes of an object
- Required argument: the object whose data size is to be returned
- Keyword argument _attributes: AppleEvent attribute dictionary
- Returns: the size of the object in bytes
- """
- _code = 'core'
- _subcode = 'dsiz'
-
- if _arguments: raise TypeError, 'No optional args expected'
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
- def get(self, _object, _attributes={}, **_arguments):
- """get: Get the data for an object
- Required argument: the object whose data is to be returned
- Keyword argument _attributes: AppleEvent attribute dictionary
- Returns: The data from the object
- """
- _code = 'core'
- _subcode = 'getd'
-
- if _arguments: raise TypeError, 'No optional args expected'
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
- _argmap_make = {
- 'new' : 'kocl',
- 'at' : 'insh',
- 'with_data' : 'data',
- 'with_properties' : 'prdt',
- }
-
- def make(self, _no_object=None, _attributes={}, **_arguments):
- """make: Make a new element
- Keyword argument new: the class of the new element
- Keyword argument at: the location at which to insert the element
- Keyword argument with_data: the initial data for the element
- Keyword argument with_properties: the initial values for the properties of the element
- Keyword argument _attributes: AppleEvent attribute dictionary
- Returns: Object specifier for the new element
- """
- _code = 'core'
- _subcode = 'crel'
-
- aetools.keysubst(_arguments, self._argmap_make)
- if _no_object != None: raise TypeError, 'No direct arg expected'
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
- def open(self, _object, _attributes={}, **_arguments):
- """open: Open the specified object(s)
- Required argument: Objects to open. Can be a list of files or an object specifier.
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'aevt'
- _subcode = 'odoc'
-
- if _arguments: raise TypeError, 'No optional args expected'
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
- def print_(self, _object, _attributes={}, **_arguments):
- """print: Print the specified object(s)
- Required argument: Objects to print. Can be a list of files or an object specifier.
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'aevt'
- _subcode = 'pdoc'
-
- if _arguments: raise TypeError, 'No optional args expected'
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
- _argmap_save = {
- 'in_' : 'kfil',
- 'as' : 'fltp',
- }
-
- def save(self, _object, _attributes={}, **_arguments):
- """save: save a set of objects
- Required argument: Objects to save.
- Keyword argument in_: the file in which to save the object(s)
- Keyword argument as: the file type of the document in which to save the data
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'core'
- _subcode = 'save'
-
- aetools.keysubst(_arguments, self._argmap_save)
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
- _argmap_set = {
- 'to' : 'data',
- }
-
- def set(self, _object, _attributes={}, **_arguments):
- """set: Set an object\xd5s data
- Required argument: the object to change
- Keyword argument to: the new value
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'core'
- _subcode = 'setd'
-
- aetools.keysubst(_arguments, self._argmap_set)
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
-
-class application(aetools.ComponentItem):
- """application - An application program """
- want = 'capp'
-# element 'cwin' as ['indx', 'name', 'rele']
-# element 'docu' as ['name']
-
-class window(aetools.ComponentItem):
- """window - A Window """
- want = 'cwin'
-class _Prop_bounds(aetools.NProperty):
- """bounds - the boundary rectangle for the window """
- which = 'pbnd'
- want = 'qdrt'
-class _Prop_closeable(aetools.NProperty):
- """closeable - Does the window have a close box? """
- which = 'hclb'
- want = 'bool'
-class _Prop_floating(aetools.NProperty):
- """floating - Does the window float? """
- which = 'isfl'
- want = 'bool'
-class _Prop_index(aetools.NProperty):
- """index - the number of the window """
- which = 'pidx'
- want = 'long'
-class _Prop_modal(aetools.NProperty):
- """modal - Is the window modal? """
- which = 'pmod'
- want = 'bool'
-class _Prop_name(aetools.NProperty):
- """name - the title of the window """
- which = 'pnam'
- want = 'itxt'
-class _Prop_position(aetools.NProperty):
- """position - upper left coordinates of window """
- which = 'ppos'
- want = 'QDpt'
-class _Prop_resizable(aetools.NProperty):
- """resizable - Is the window resizable? """
- which = 'prsz'
- want = 'bool'
-class _Prop_titled(aetools.NProperty):
- """titled - Does the window have a title bar? """
- which = 'ptit'
- want = 'bool'
-class _Prop_visible(aetools.NProperty):
- """visible - is the window visible? """
- which = 'pvis'
- want = 'bool'
-class _Prop_zoomable(aetools.NProperty):
- """zoomable - Is the window zoomable? """
- which = 'iszm'
- want = 'bool'
-class _Prop_zoomed(aetools.NProperty):
- """zoomed - Is the window zoomed? """
- which = 'pzum'
- want = 'bool'
-
-class document(aetools.ComponentItem):
- """document - A Document """
- want = 'docu'
-class _Prop_modified(aetools.NProperty):
- """modified - Has the document been modified since the last save? """
- which = 'imod'
- want = 'bool'
-application._superclassnames = []
-application._privpropdict = {
-}
-application._privelemdict = {
- 'document' : document,
- 'window' : window,
-}
-window._superclassnames = []
-window._privpropdict = {
- 'bounds' : _Prop_bounds,
- 'closeable' : _Prop_closeable,
- 'floating' : _Prop_floating,
- 'index' : _Prop_index,
- 'modal' : _Prop_modal,
- 'name' : _Prop_name,
- 'position' : _Prop_position,
- 'resizable' : _Prop_resizable,
- 'titled' : _Prop_titled,
- 'visible' : _Prop_visible,
- 'zoomable' : _Prop_zoomable,
- 'zoomed' : _Prop_zoomed,
-}
-window._privelemdict = {
-}
-document._superclassnames = []
-document._privpropdict = {
- 'modified' : _Prop_modified,
- 'name' : _Prop_name,
-}
-document._privelemdict = {
-}
-_Enum_savo = {
- 'yes' : 'yes ', # Save objects now
- 'no' : 'no ', # Do not save objects
- 'ask' : 'ask ', # Ask the user whether to save
-}
-
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
- 'capp' : application,
- 'cwin' : window,
- 'docu' : document,
-}
-
-_propdeclarations = {
- 'hclb' : _Prop_closeable,
- 'imod' : _Prop_modified,
- 'isfl' : _Prop_floating,
- 'iszm' : _Prop_zoomable,
- 'pbnd' : _Prop_bounds,
- 'pidx' : _Prop_index,
- 'pmod' : _Prop_modal,
- 'pnam' : _Prop_name,
- 'ppos' : _Prop_position,
- 'prsz' : _Prop_resizable,
- 'ptit' : _Prop_titled,
- 'pvis' : _Prop_visible,
- 'pzum' : _Prop_zoomed,
-}
-
-_compdeclarations = {
-}
-
-_enumdeclarations = {
- 'savo' : _Enum_savo,
-}
diff --git a/Mac/OSX/Doc/HelpIndexingTool/__init__.py b/Mac/OSX/Doc/HelpIndexingTool/__init__.py
deleted file mode 100644
index 5359df5..0000000
--- a/Mac/OSX/Doc/HelpIndexingTool/__init__.py
+++ /dev/null
@@ -1,78 +0,0 @@
-"""
-Package generated from /Developer/Applications/Apple Help Indexing Tool.app
-"""
-import aetools
-Error = aetools.Error
-import Standard_Suite
-import Help_Indexing_Tool_Suite
-import odds_and_ends
-import Miscellaneous_Standards
-import Required_Suite
-
-
-_code_to_module = {
- 'CoRe' : Standard_Suite,
- 'HIT ' : Help_Indexing_Tool_Suite,
- 'Odds' : odds_and_ends,
- 'misc' : Miscellaneous_Standards,
- 'reqd' : Required_Suite,
-}
-
-
-
-_code_to_fullname = {
- 'CoRe' : ('HelpIndexingTool.Standard_Suite', 'Standard_Suite'),
- 'HIT ' : ('HelpIndexingTool.Help_Indexing_Tool_Suite', 'Help_Indexing_Tool_Suite'),
- 'Odds' : ('HelpIndexingTool.odds_and_ends', 'odds_and_ends'),
- 'misc' : ('HelpIndexingTool.Miscellaneous_Standards', 'Miscellaneous_Standards'),
- 'reqd' : ('HelpIndexingTool.Required_Suite', 'Required_Suite'),
-}
-
-from Standard_Suite import *
-from Help_Indexing_Tool_Suite import *
-from odds_and_ends import *
-from Miscellaneous_Standards import *
-from Required_Suite import *
-
-def getbaseclasses(v):
- if not getattr(v, '_propdict', None):
- v._propdict = {}
- v._elemdict = {}
- for superclassname in getattr(v, '_superclassnames', []):
- superclass = eval(superclassname)
- getbaseclasses(superclass)
- v._propdict.update(getattr(superclass, '_propdict', {}))
- v._elemdict.update(getattr(superclass, '_elemdict', {}))
- v._propdict.update(getattr(v, '_privpropdict', {}))
- v._elemdict.update(getattr(v, '_privelemdict', {}))
-
-import StdSuites
-
-#
-# Set property and element dictionaries now that all classes have been defined
-#
-getbaseclasses(window)
-getbaseclasses(application)
-getbaseclasses(document)
-getbaseclasses(application)
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
- 'cwin' : window,
- 'capp' : application,
- 'docu' : document,
- 'capp' : application,
-}
-
-
-class HelpIndexingTool(Standard_Suite_Events,
- Help_Indexing_Tool_Suite_Events,
- odds_and_ends_Events,
- Miscellaneous_Standards_Events,
- Required_Suite_Events,
- aetools.TalkTo):
- _signature = 'hiti'
-
- _moduleName = 'HelpIndexingTool'
diff --git a/Mac/OSX/Doc/HelpIndexingTool/odds_and_ends.py b/Mac/OSX/Doc/HelpIndexingTool/odds_and_ends.py
deleted file mode 100644
index 7ee46f3..0000000
--- a/Mac/OSX/Doc/HelpIndexingTool/odds_and_ends.py
+++ /dev/null
@@ -1,49 +0,0 @@
-"""Suite odds and ends: Things that should be in some standard suite, but aren\xd5t
-Level 1, version 1
-
-Generated from /Developer/Applications/Apple Help Indexing Tool.app
-AETE/AEUT resource version 1/1, language 0, script 0
-"""
-
-import aetools
-import MacOS
-
-_code = 'Odds'
-
-class odds_and_ends_Events:
-
- def select(self, _object=None, _attributes={}, **_arguments):
- """select: Select the specified object
- Required argument: the object to select
- Keyword argument _attributes: AppleEvent attribute dictionary
- """
- _code = 'misc'
- _subcode = 'slct'
-
- if _arguments: raise TypeError, 'No optional args expected'
- _arguments['----'] = _object
-
-
- _reply, _arguments, _attributes = self.send(_code, _subcode,
- _arguments, _attributes)
- if _arguments.get('errn', 0):
- raise aetools.Error, aetools.decodeerror(_arguments)
- # XXXX Optionally decode result
- if _arguments.has_key('----'):
- return _arguments['----']
-
-
-#
-# Indices of types declared in this module
-#
-_classdeclarations = {
-}
-
-_propdeclarations = {
-}
-
-_compdeclarations = {
-}
-
-_enumdeclarations = {
-}
diff --git a/Mac/OSX/Doc/README b/Mac/OSX/Doc/README
deleted file mode 100644
index 4f4d53d..0000000
--- a/Mac/OSX/Doc/README
+++ /dev/null
@@ -1,35 +0,0 @@
-In this directory you can build the Python documentation in a form that
-is suitable for access with Apple Help Viewer. This will enable the
-"Python Documentation" menu entries in the MacPython IDE Help menu.
-
-Unfortunately the procedure to build the docs is not very streamlined.
-
-First, edit setup.py. At the top, edit MAJOR_VERSION and MINOR_VERSION,
-and check that DESTDIR makes sense. The documentation will be installed
-inside PythonIDE.app.
-
-In DocBuild.initialize_options, set self.download to True if you want to
-download the docs. Set it to False if you want to build the docs from
-the source tree, but this requires LaTex and lots of other stuff.
-Doable, but not easy.
-
-Second, if you want to download the docs you may need to do a couple
-more edits. The way the docs are packaged will often change between
-major releases. Fiddle DocBuild.downloadDocs to make it do the right
-thing (download the docs from python.org, unpack them, rename the
-directory to "build/html").
-
-After these edits you should be ready to roll. "pythonw setup.py build"
-should download and unpack (or build) the docs. Next, it will do some
-magic to make the docs indexable. Finally, it will run the Apple Help
-Indexing Tool. (This last step is the reason you must use "pythonw" as
-opposed to "python"). Usually it will time out while waiting for AHIT to
-do its work. Wait until AHIT is done.
-
-Now you're ready to install with "python setup.py install".
-
-After this is done test your work. Fire up PythonIDE, and check that
-Help->Python Documentation brings up the documentation in the Help Viewer.
-Also open an IDE edit window, type something like "import sys", select
-"import", and use Help->Lookup in Python Documentation to check that the
-index has been generated correctly.
diff --git a/Mac/OSX/Doc/setup.py b/Mac/OSX/Doc/setup.py
deleted file mode 100644
index bd86a20..0000000
--- a/Mac/OSX/Doc/setup.py
+++ /dev/null
@@ -1,214 +0,0 @@
-# Build and install an Apple Help Viewer compatible version of the Python
-# documentation into the framework.
-# Code by Bill Fancher, with some modifications by Jack Jansen.
-#
-# You must run this as a two-step process
-# 1. python setupDocs.py build
-# 2. Wait for Apple Help Indexing Tool to finish
-# 3. python setupDocs.py install
-#
-# To do:
-# - test whether the docs are available locally before downloading
-# - fix buildDocsFromSource
-# - Get documentation version from sys.version, fallback to 2.2.1
-# - See if we can somehow detect that Apple Help Indexing Tool is finished
-# - data_files to setup() doesn't seem the right way to pass the arguments
-#
-import sys, os, re
-from distutils.cmd import Command
-from distutils.command.build import build
-from distutils.core import setup
-from distutils.file_util import copy_file
-from distutils.dir_util import copy_tree
-from distutils.log import log
-from distutils.spawn import spawn
-from distutils import sysconfig, dep_util
-from distutils.util import change_root
-import HelpIndexingTool
-import Carbon.File
-import time
-
-MAJOR_VERSION='2.4'
-MINOR_VERSION='2.4.1'
-DESTDIR='/Applications/MacPython-%s/PythonIDE.app/Contents/Resources/English.lproj/PythonDocumentation' % MAJOR_VERSION
-
-class DocBuild(build):
- def initialize_options(self):
- build.initialize_options(self)
- self.build_html = None
- self.build_dest = None
- self.download = 1
- self.doc_version = MINOR_VERSION # Only needed if download is true
-
- def finalize_options(self):
- build.finalize_options(self)
- if self.build_html is None:
- self.build_html = os.path.join(self.build_base, 'html')
- if self.build_dest is None:
- self.build_dest = os.path.join(self.build_base, 'PythonDocumentation')
-
- def spawn(self, *args):
- spawn(args, 1, self.verbose, self.dry_run)
-
- def downloadDocs(self):
- workdir = os.getcwd()
- # XXX Note: the next strings may change from version to version
- url = 'http://www.python.org/ftp/python/doc/%s/html-%s.tar.bz2' % \
- (self.doc_version,self.doc_version)
- tarfile = 'html-%s.tar.bz2' % self.doc_version
- dirname = 'Python-Docs-%s' % self.doc_version
-
- if os.path.exists(self.build_html):
- raise RuntimeError, '%s: already exists, please remove and try again' % self.build_html
- os.chdir(self.build_base)
- self.spawn('curl','-O', url)
- self.spawn('tar', '-xjf', tarfile)
- os.rename(dirname, 'html')
- os.chdir(workdir)
-## print "** Please unpack %s" % os.path.join(self.build_base, tarfile)
-## print "** Unpack the files into %s" % self.build_html
-## raise RuntimeError, "You need to unpack the docs manually"
-
- def buildDocsFromSource(self):
- srcdir = '../../..'
- docdir = os.path.join(srcdir, 'Doc')
- htmldir = os.path.join(docdir, 'html')
- spawn(('make','--directory', docdir, 'html'), 1, self.verbose, self.dry_run)
- self.mkpath(self.build_html)
- copy_tree(htmldir, self.build_html)
-
- def ensureHtml(self):
- if not os.path.exists(self.build_html):
- if self.download:
- self.downloadDocs()
- else:
- self.buildDocsFromSource()
-
- def hackIndex(self):
- ind_html = 'index.html'
- #print 'self.build_dest =', self.build_dest
- hackedIndex = file(os.path.join(self.build_dest, ind_html),'w')
- origIndex = file(os.path.join(self.build_html,ind_html))
- r = re.compile('<style type="text/css">.*</style>', re.DOTALL)
- hackedIndex.write(r.sub('<META NAME="AppleTitle" CONTENT="Python Documentation">',origIndex.read()))
-
- def hackFile(self,d,f):
- origPath = os.path.join(d,f)
- assert(origPath[:len(self.build_html)] == self.build_html)
- outPath = os.path.join(self.build_dest, d[len(self.build_html)+1:], f)
- (name, ext) = os.path.splitext(f)
- if os.path.isdir(origPath):
- self.mkpath(outPath)
- elif ext == '.html':
- if self.verbose: print 'hacking %s to %s' % (origPath,outPath)
- hackedFile = file(outPath, 'w')
- origFile = file(origPath,'r')
- hackedFile.write(self.r.sub('<dl><dt><dd>', origFile.read()))
- else:
- copy_file(origPath, outPath)
-
- def hackHtml(self):
- self.r = re.compile('<dl><dd>')
- os.path.walk(self.build_html, self.visit, None)
-
- def visit(self, dummy, dirname, filenames):
- for f in filenames:
- self.hackFile(dirname, f)
-
- def makeHelpIndex(self):
- app = '/Developer/Applications/Apple Help Indexing Tool.app'
- self.spawn('open', '-a', app , self.build_dest)
- print "Please wait until Apple Help Indexing Tool finishes before installing"
-
- def makeHelpIndex(self):
- app = HelpIndexingTool.HelpIndexingTool(start=1)
- app.open(Carbon.File.FSSpec(self.build_dest))
- sys.stderr.write("Waiting for Help Indexing Tool to start...")
- while 1:
- # This is bad design in the suite generation code!
- idle = app._get(HelpIndexingTool.Help_Indexing_Tool_Suite._Prop_idleStatus())
- time.sleep(10)
- if not idle: break
- sys.stderr.write(".")
- sys.stderr.write("\n")
- sys.stderr.write("Waiting for Help Indexing Tool to finish...")
- while 1:
- # This is bad design in the suite generation code!
- idle = app._get(HelpIndexingTool.Help_Indexing_Tool_Suite._Prop_idleStatus())
- time.sleep(10)
- if idle: break
- sys.stderr.write(".")
- sys.stderr.write("\n")
-
-
- def run(self):
- self.ensure_finalized()
- self.mkpath(self.build_base)
- self.ensureHtml()
- if not os.path.isdir(self.build_html):
- raise RuntimeError, \
- "Can't find source folder for documentation."
- self.mkpath(self.build_dest)
- if dep_util.newer(os.path.join(self.build_html,'index.html'), os.path.join(self.build_dest,'index.html')):
- self.mkpath(self.build_dest)
- self.hackHtml()
- self.hackIndex()
- self.makeHelpIndex()
-
-class AHVDocInstall(Command):
- description = "install Apple Help Viewer html files"
- user_options = [('install-doc=', 'd',
- 'directory to install HTML tree'),
- ('root=', None,
- "install everything relative to this alternate root directory"),
- ]
-
- def initialize_options(self):
- self.build_dest = None
- self.install_doc = None
- self.prefix = None
- self.root = None
-
- def finalize_options(self):
- self.set_undefined_options('install',
- ('prefix', 'prefix'),
- ('root', 'root'))
-# import pdb ; pdb.set_trace()
- build_cmd = self.get_finalized_command('build')
- if self.build_dest == None:
- build_cmd = self.get_finalized_command('build')
- self.build_dest = build_cmd.build_dest
- if self.install_doc == None:
- self.install_doc = os.path.join(self.prefix, DESTDIR)
- print 'INSTALL', self.build_dest, '->', self.install_doc
-
- def run(self):
- self.finalize_options()
- self.ensure_finalized()
- print "Running Installer"
- instloc = self.install_doc
- if self.root:
- instloc = change_root(self.root, instloc)
- self.mkpath(instloc)
- copy_tree(self.build_dest, instloc)
- print "Installation complete"
-
-def mungeVersion(infile, outfile):
- i = file(infile,'r')
- o = file(outfile,'w')
- o.write(re.sub('\$\(VERSION\)',sysconfig.get_config_var('VERSION'),i.read()))
- i.close()
- o.close()
-
-def main():
- # turn off warnings when deprecated modules are imported
-## import warnings
-## warnings.filterwarnings("ignore",category=DeprecationWarning)
- setup(name = 'Documentation',
- version = '%d.%d' % sys.version_info[:2],
- cmdclass = {'install_data':AHVDocInstall, 'build':DocBuild},
- data_files = ['dummy'],
- )
-
-if __name__ == '__main__':
- main()
diff --git a/Mac/OSX/Extras.ReadMe.txt b/Mac/OSX/Extras.ReadMe.txt
deleted file mode 100644
index 2d7fd42..0000000
--- a/Mac/OSX/Extras.ReadMe.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This folder contains examples of Python usage and useful scripts and tools.
-
-You should be aware that these are not Macintosh-specific but are shared
-among Python on all platforms, so there are some that only run on Windows
-or Unix or another platform, and/or make little sense on a Macintosh.
diff --git a/Mac/OSX/Extras.install.py b/Mac/OSX/Extras.install.py
deleted file mode 100644
index ce00af3..0000000
--- a/Mac/OSX/Extras.install.py
+++ /dev/null
@@ -1,54 +0,0 @@
-"""Recursively copy a directory but skip undesired files and
-directories (CVS, backup files, pyc files, etc)"""
-
-import sys
-import os
-import shutil
-
-verbose = 1
-debug = 0
-
-def isclean(name):
- if name == 'CVS': return 0
- if name == '.cvsignore': return 0
- if name == '.DS_store': return 0
- if name == '.svn': return 0
- if name.endswith('~'): return 0
- if name.endswith('.BAK'): return 0
- if name.endswith('.pyc'): return 0
- if name.endswith('.pyo'): return 0
- if name.endswith('.orig'): return 0
- return 1
-
-def copycleandir(src, dst):
- for cursrc, dirs, files in os.walk(src):
- assert cursrc.startswith(src)
- curdst = dst + cursrc[len(src):]
- if verbose:
- print "mkdir", curdst
- if not debug:
- if not os.path.exists(curdst):
- os.makedirs(curdst)
- for fn in files:
- if isclean(fn):
- if verbose:
- print "copy", os.path.join(cursrc, fn), os.path.join(curdst, fn)
- if not debug:
- shutil.copy2(os.path.join(cursrc, fn), os.path.join(curdst, fn))
- else:
- if verbose:
- print "skipfile", os.path.join(cursrc, fn)
- for i in range(len(dirs)-1, -1, -1):
- if not isclean(dirs[i]):
- if verbose:
- print "skipdir", os.path.join(cursrc, dirs[i])
- del dirs[i]
-
-def main():
- if len(sys.argv) != 3:
- sys.stderr.write("Usage: %s srcdir dstdir\n" % sys.argv[0])
- sys.exit(1)
- copycleandir(sys.argv[1], sys.argv[2])
-
-if __name__ == '__main__':
- main()
diff --git a/Mac/OSX/IDLE/Info.plist b/Mac/OSX/IDLE/Info.plist
deleted file mode 100644
index bbe2ea1..0000000
--- a/Mac/OSX/IDLE/Info.plist
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleDocumentTypes</key>
- <array>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>py</string>
- <string>pyw</string>
- </array>
- <key>CFBundleTypeIconFile</key>
- <string>PythonSource.icns</string>
- <key>CFBundleTypeName</key>
- <string>Python Script</string>
- <key>CFBundleTypeRole</key>
- <string>Editor</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>pyc</string>
- <string>pyo</string>
- </array>
- <key>CFBundleTypeIconFile</key>
- <string>PythonCompiled.icns</string>
- <key>CFBundleTypeName</key>
- <string>Python Bytecode Document</string>
- <key>CFBundleTypeRole</key>
- <string>Editor</string>
- </dict>
- </array>
- <key>CFBundleExecutable</key>
- <string>IDLE</string>
- <key>CFBundleGetInfoString</key>
- <string>2.5, © 001-2006 Python Software Foundation</string>
- <key>CFBundleIconFile</key>
- <string>IDLE.icns</string>
- <key>CFBundleIdentifier</key>
- <string>org.python.IDLE</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>IDLE</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>2.5</string>
- <key>CFBundleVersion</key>
- <string>2.5</string>
-</dict>
-</plist>
diff --git a/Mac/OSX/IDLE/Makefile.in b/Mac/OSX/IDLE/Makefile.in
deleted file mode 100644
index a96e7ef..0000000
--- a/Mac/OSX/IDLE/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-prefix=@prefix@
-CC=@CC@
-LD=@CC@
-BASECFLAGS=@BASECFLAGS@
-OPT=@OPT@
-CFLAGS=$(BASECFLAGS) $(OPT)
-LDFLAGS=@LDFLAGS@
-srcdir= @srcdir@
-VERSION= @VERSION@
-UNIVERSALSDK=@UNIVERSALSDK@
-builddir= ../../..
-
-RUNSHARED= @RUNSHARED@
-BUILDEXE= @BUILDEXEEXT@
-BUILDPYTHON= ../../../python$(BUILDEXE)
-
-# Deployment target selected during configure, to be checked
-# by distutils
-MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
-@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
-
-BUNDLEBULDER=$(srcdir)/../../../Lib/plat-mac/bundlebuilder.py
-
-PYTHONAPPSDIR=/Applications/MacPython $(VERSION)
-
-all: IDLE.app
-
-install: IDLE.app
- test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
- -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
- cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)"
- touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
-
-clean:
- rm -rf IDLE.app
-
-IDLE.app: \
- $(srcdir)/../Icons/IDLE.icns $(srcdir)/idlemain.py \
- $(srcdir)/../Icons/PythonSource.icns \
- $(srcdir)/../Icons/PythonCompiled.icns
- rm -fr IDLE.app
- $(RUNSHARED) $(BUILDPYTHON) $(BUNDLEBULDER) \
- --builddir=. \
- --name=IDLE \
- --link-exec \
- --plist=$(srcdir)/Info.plist \
- --mainprogram=$(srcdir)/idlemain.py \
- --iconfile=$(srcdir)/../Icons/IDLE.icns \
- --resource=$(srcdir)/../Icons/PythonSource.icns \
- --resource=$(srcdir)/../Icons/PythonCompiled.icns \
- --python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \
- build
diff --git a/Mac/OSX/IDLE/idlemain.py b/Mac/OSX/IDLE/idlemain.py
deleted file mode 100644
index aa75d4c..0000000
--- a/Mac/OSX/IDLE/idlemain.py
+++ /dev/null
@@ -1,27 +0,0 @@
-"""
-Bootstrap script for IDLE as an application bundle.
-"""
-import sys, os
-
-from idlelib.PyShell import main
-
-# Change the current directory the user's home directory, that way we'll get
-# a more useful default location in the open/save dialogs.
-os.chdir(os.path.expanduser('~/Documents'))
-
-
-# Make sure sys.executable points to the python interpreter inside the
-# framework, instead of at the helper executable inside the application
-# bundle (the latter works, but doesn't allow access to the window server)
-sys.executable = os.path.join(sys.prefix, 'bin', 'python')
-
-# Look for the -psn argument that the launcher adds and remove it, it will
-# only confuse the IDLE startup code.
-for idx, value in enumerate(sys.argv):
- if value.startswith('-psn_'):
- del sys.argv[idx]
- break
-
-#argvemulator.ArgvCollector().mainloop()
-if __name__ == '__main__':
- main()
diff --git a/Mac/OSX/Icons/Disk Image.icns b/Mac/OSX/Icons/Disk Image.icns
deleted file mode 100644
index 35f16bf..0000000
--- a/Mac/OSX/Icons/Disk Image.icns
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/Icons/IDLE.icns b/Mac/OSX/Icons/IDLE.icns
deleted file mode 100644
index c12c9da..0000000
--- a/Mac/OSX/Icons/IDLE.icns
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/Icons/Python Folder.icns b/Mac/OSX/Icons/Python Folder.icns
deleted file mode 100644
index ae766ee..0000000
--- a/Mac/OSX/Icons/Python Folder.icns
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/Icons/PythonCompiled.icns b/Mac/OSX/Icons/PythonCompiled.icns
deleted file mode 100644
index 7d9f320..0000000
--- a/Mac/OSX/Icons/PythonCompiled.icns
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/Icons/PythonLauncher.icns b/Mac/OSX/Icons/PythonLauncher.icns
deleted file mode 100644
index e09fd38..0000000
--- a/Mac/OSX/Icons/PythonLauncher.icns
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/Icons/PythonSource.icns b/Mac/OSX/Icons/PythonSource.icns
deleted file mode 100644
index 9e35c1e..0000000
--- a/Mac/OSX/Icons/PythonSource.icns
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/Icons/ReadMe.txt b/Mac/OSX/Icons/ReadMe.txt
deleted file mode 100644
index 226836a..0000000
--- a/Mac/OSX/Icons/ReadMe.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-The icons for use on MacOS X were created by Jacob Rus <jrus@fas.harvard.edu>
-with some feedback from the folks on pythonmac-sig@python.org.
-
diff --git a/Mac/OSX/Makefile.in b/Mac/OSX/Makefile.in
deleted file mode 100644
index a44191d..0000000
--- a/Mac/OSX/Makefile.in
+++ /dev/null
@@ -1,241 +0,0 @@
-# This file can be invoked from the various frameworkinstall... targets in the
-# main Makefile. The next couple of variables are overridden on the
-# commandline in that case.
-
-VERSION=@VERSION@
-builddir = ../..
-srcdir = @srcdir@
-prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION)
-LIBDEST=$(prefix)/lib/python$(VERSION)
-BUILDPYTHON=$(builddir)/python.exe
-DESTDIR=
-
-# These are normally glimpsed from the previous set
-bindir=@exec_prefix@/bin
-PYTHONAPPSDIR=/Applications/MacPython $(VERSION)
-APPINSTALLDIR=$(prefix)/Resources/Python.app
-
-# Variables for installing the "normal" unix binaries
-INSTALLED_PYDOC=$(prefix)/bin/pydoc
-INSTALLED_IDLE=$(prefix)/bin/idle
-INSTALLED_PYTHON=$(prefix)/bin/python
-INSTALLED_PYTHONW=$(prefix)/bin/pythonw
-INSTALLED_PYTHONAPP=$(APPINSTALLDIR)/Contents/MacOS/Python
-
-# Items more-or-less copied from the main Makefile
-DIRMODE=755
-FILEMODE=644
-INSTALL=@INSTALL@
-INSTALL_SYMLINK=ln -fsn
-INSTALL_PROGRAM=@INSTALL_PROGRAM@
-INSTALL_SCRIPT= @INSTALL_SCRIPT@
-INSTALL_DATA=@INSTALL_DATA@
-LN=@LN@
-STRIPFLAG=-s
-CPMAC=/Developer/Tools/CpMac
-
-APPTEMPLATE=$(srcdir)/../OSXResources/app
-APPSUBDIRS=MacOS Resources Resources/English.lproj \
- Resources/English.lproj/Documentation \
- Resources/English.lproj/Documentation/doc \
- Resources/English.lproj/Documentation/ide
-DOCDIR=$(srcdir)/../OSXResources/app/Resources/English.lproj/Documentation
-DOCINDEX=$(DOCDIR)/"Documentation idx"
-CACHERSRC=$(srcdir)/../scripts/cachersrc.py
-compileall=$(srcdir)/../../Lib/compileall.py
-
-installapps: install_Python install_BuildApplet install_PythonLauncher \
- install_IDLE checkapplepython install_pythonw install_versionedtools
-
-install_pythonw: pythonw
- $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
- $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
- ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python"
- ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw"
-
-#
-# Install unix tools in /usr/local/bin. These are just aliases for the
-# actual installation inside the framework.
-#
-installunixtools:
- if [ ! -d "$(DESTDIR)/usr/local/bin" ]; then \
- $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)/usr/local/bin" ;\
- fi
- for fn in `ls "$(DESTDIR)$(prefix)/bin/"` ; \
- do \
- ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)/usr/local/bin/$${fn}" ;\
- done
-
-# By default most tools are installed without a version in their basename, to
-# make it easier to install (and use) several python versions side-by-side move
-# the tools to a version-specific name and add the non-versioned name as an
-# alias.
-install_versionedtools:
- for fn in idle pydoc python-config ;\
- do \
- if [ -h "$(DESTDIR)$(prefix)/bin/$${fn}" ]; then \
- continue ;\
- fi ;\
- mv "$(DESTDIR)$(prefix)/bin/$${fn}" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\
- ln -sf "$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}" ;\
- done
- if [ ! -h "$(DESTDIR)$(prefix)/bin/smtpd.py" ]; then \
- mv "$(DESTDIR)$(prefix)/bin/smtpd.py" "$(DESTDIR)$(prefix)/bin/smtpd$(VERSION).py" ;\
- ln -sf "smtpd$(VERSION).py" "$(DESTDIR)$(prefix)/bin/smtpd.py" ;\
- fi
-
-
-pythonw: $(srcdir)/Tools/pythonw.c
- $(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c \
- -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/Python"'
-
-
-install_PythonLauncher:
- cd PythonLauncher && make install DESTDIR=$(DESTDIR)
-
-install_Python:
- @if test ! -f $(DOCINDEX); then \
- echo WARNING: you should run Apple Help Indexing Tool on $(DOCDIR); \
- fi
- @for i in "$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \
- if test ! -d "$(DESTDIR)$$i"; then \
- echo "Creating directory $(DESTDIR)$$i"; \
- $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$$i"; \
- fi;\
- done
- @for i in $(APPSUBDIRS); do \
- if test ! -d "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; then \
- echo "Creating directory $(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
- $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
- else true; \
- fi; \
- done
- @for d in . $(APPSUBDIRS); \
- do \
- a=$(APPTEMPLATE)/$$d; \
- if test ! -d $$a; then continue; else true; fi; \
- b="$(DESTDIR)$(APPINSTALLDIR)/Contents/$$d"; \
- for i in $$a/*; \
- do \
- case $$i in \
- *CVS) ;; \
- *.svn) ;; \
- *.py[co]) ;; \
- *.orig) ;; \
- *~) ;; \
- *idx) \
- echo $(CPMAC) "$$i" $$b; \
- $(CPMAC) "$$i" "$$b"; \
- ;; \
- *) \
- if test -d $$i; then continue; fi; \
- if test -x $$i; then \
- echo $(INSTALL_SCRIPT) "$$i" "$$b"; \
- $(INSTALL_SCRIPT) "$$i" "$$b"; \
- else \
- echo $(INSTALL_DATA) "$$i" "$$b"; \
- $(INSTALL_DATA) "$$i" "$$b"; \
- fi;; \
- esac; \
- done; \
- done
- $(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/Python"
-
-install_IDLE:
- cd IDLE && make install
-
-install_BuildApplet:
- $(BUILDPYTHON) $(srcdir)/../scripts/BuildApplet.py \
- --destroot "$(DESTDIR)" \
- --python $(INSTALLED_PYTHONAPP) \
- --output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \
- $(srcdir)/../scripts/BuildApplet.py
-
-MACLIBDEST=$(LIBDEST)/plat-mac
-MACTOOLSDEST=$(prefix)/Mac/Tools
-MACTOOLSSRC=$(srcdir)/Mac/Tools
-MACTOOLSSUBDIRS=IDE
-
-installmacsubtree:
- @for i in $(MACTOOLSDEST); \
- do \
- if test ! -d $(DESTDIR)$$i; then \
- echo "Creating directory $(DESTDIR)$$i"; \
- $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
- else true; \
- fi; \
- done
- @for d in $(MACTOOLSSUBDIRS); \
- do \
- a=$(MACTOOLSSRC)/$$d; \
- if test ! -d $$a; then continue; else true; fi; \
- b=$(DESTDIR)$(MACTOOLSDEST)/$$d; \
- if test ! -d $$b; then \
- echo "Creating directory $$b"; \
- $(INSTALL) -d -m $(DIRMODE) $$b; \
- else true; \
- fi; \
- done
- @for d in $(MACTOOLSSUBDIRS); \
- do \
- a=$(MACTOOLSSRC)/$$d; \
- if test ! -d $$a; then continue; else true; fi; \
- b=$(DESTDIR)$(MACTOOLSDEST)/$$d; \
- for i in $$a/*; \
- do \
- case $$i in \
- *CVS) ;; \
- *.svn) ;; \
- *.py[co]) ;; \
- *.orig) ;; \
- *~) ;; \
- *.rsrc) \
- echo $(CPMAC) $$i $$b ; \
- $(CPMAC) $$i $$b ; \
- ;; \
- *) \
- if test -d $$i; then continue; fi; \
- if test -x $$i; then \
- echo $(INSTALL_SCRIPT) $$i $$b; \
- $(INSTALL_SCRIPT) $$i $$b; \
- else \
- echo $(INSTALL_DATA) $$i $$b; \
- $(INSTALL_DATA) $$i $$b; \
- fi;; \
- esac; \
- done; \
- done
-
-
- $(BUILDPYTHON) $(CACHERSRC) -v $(DESTDIR)$(MACLIBDEST) $(DESTDIR)$(MACTOOLSDEST)
- $(BUILDPYTHON) -Wi -tt $(compileall) -d $(MACTOOLSDEST) -x badsyntax $(DESTDIR)$(MACTOOLSDEST)
- $(BUILDPYTHON) -O -Wi -tt $(compileall) -d $(MACTOOLSDEST) -x badsyntax $(DESTDIR)$(MACTOOLSDEST)
-
-#
-# We use the full name here in stead of $(INSTALLED_PYTHONAPP), because
-# the latter may be overridden by Makefile.jaguar when building for a pre-installed
-$(INSTALLED_PYTHONAPP)/Contents/MacOS/Python: install_Python
-
-# $(INSTALLED_PYTHON) has to be done by the main Makefile, we cannot do that here.
-# At least this rule will give an error if it doesn't exist.
-
-installextras:
- $(INSTALL) -d "$(DESTDIR)$(PYTHONAPPSDIR)/Extras"
- $(INSTALL) $(srcdir)/Mac/OSX/Extras.ReadMe.txt "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/ReadMe.txt"
- $(BUILDPYTHON) $(srcdir)/Mac/OSX/Extras.install.py $(srcdir)/Demo \
- "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo"
-
-
-checkapplepython:
- @if ! $(BUILDPYTHON) $(srcdir)/fixapplepython23.py -n; then \
- echo "* WARNING: Apple-installed Python 2.3 will have trouble building extensions from now on."; \
- echo "* WARNING: Run $(srcdir)/fixapplepython23.py with \"sudo\" to fix this."; \
- fi
-
-
-clean:
- rm pythonw
- cd PythonLauncher && make clean
- cd IDLE && make clean
-
-
diff --git a/Mac/OSX/PythonLauncher/English.lproj/Credits.rtf b/Mac/OSX/PythonLauncher/English.lproj/Credits.rtf
deleted file mode 100644
index 930ca22..0000000
--- a/Mac/OSX/PythonLauncher/English.lproj/Credits.rtf
+++ /dev/null
@@ -1,30 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf100
-{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\b\fs24 \cf0 Engineering:
-\f1\b0 \
- Jack Jansen\
-\
-
-\f0\b Human Interface Design:
-\f1\b0 \
- Jack Jansen\
-\
-
-\f0\b Testing:
-\f1\b0 \
- Jack Jansen\
- Pythonmac-SIG@python.org\
-\
-
-\f0\b Documentation:
-\f1\b0 \
- Missing\
-\
-
-\f0\b With special thanks to:
-\f1\b0 \
- Guido, of course\
-} \ No newline at end of file
diff --git a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/classes.nib b/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index 47b40ab..0000000
--- a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- IBClasses = (
- {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
- {
- ACTIONS = {showPreferences = id; };
- CLASS = MyAppDelegate;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/info.nib b/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/info.nib
deleted file mode 100644
index b96759a..0000000
--- a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/info.nib
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
-<plist version="0.9">
-<dict>
- <key>IBDocumentLocation</key>
- <string>99 33 356 240 0 0 800 578 </string>
- <key>IBEditorPositions</key>
- <dict>
- <key>29</key>
- <string>82 396 318 44 0 0 800 578 </string>
- </dict>
- <key>IBFramework Version</key>
- <string>263.2</string>
- <key>IBOpenObjects</key>
- <array>
- <integer>29</integer>
- </array>
- <key>IBSystem Version</key>
- <string>5S66</string>
-</dict>
-</plist>
diff --git a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/objects.nib b/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/objects.nib
deleted file mode 100644
index 532a5c8..0000000
--- a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib
deleted file mode 100644
index bcdc0cd..0000000
--- a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- IBClasses = (
- {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
- {
- ACTIONS = {"do_apply" = id; "do_cancel" = id; "do_reset" = id; "do_run" = id; };
- CLASS = MyDocument;
- LANGUAGE = ObjC;
- OUTLETS = {
- commandline = NSTextField;
- debug = NSButton;
- honourhashbang = NSButton;
- inspect = NSButton;
- interpreter = NSTextField;
- nosite = NSButton;
- optimize = NSButton;
- others = NSTextField;
- scriptargs = NSTextField;
- tabs = NSButton;
- verbose = NSButton;
- "with_terminal" = NSButton;
- };
- SUPERCLASS = NSDocument;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib
deleted file mode 100644
index e258c72..0000000
--- a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBDocumentLocation</key>
- <string>398 60 356 240 0 0 1024 746 </string>
- <key>IBFramework Version</key>
- <string>291.0</string>
- <key>IBOpenObjects</key>
- <array>
- <integer>5</integer>
- </array>
- <key>IBSystem Version</key>
- <string>6L60</string>
-</dict>
-</plist>
diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib
deleted file mode 100644
index 0473a31..0000000
--- a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/classes.nib b/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/classes.nib
deleted file mode 100644
index 467aa8b..0000000
--- a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/classes.nib
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- IBClasses = (
- {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
- {
- ACTIONS = {"do_apply" = id; "do_filetype" = id; "do_reset" = id; };
- CLASS = PreferencesWindowController;
- LANGUAGE = ObjC;
- OUTLETS = {
- commandline = NSTextField;
- debug = NSButton;
- filetype = NSPopUpButton;
- honourhashbang = NSButton;
- inspect = NSButton;
- interpreter = NSTextField;
- nosite = NSButton;
- optimize = NSButton;
- others = NSTextField;
- tabs = NSButton;
- verbose = NSButton;
- "with_terminal" = NSButton;
- };
- SUPERCLASS = NSWindowController;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/info.nib b/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/info.nib
deleted file mode 100644
index bc558f7..0000000
--- a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/info.nib
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBDocumentLocation</key>
- <string>565 235 519 534 0 0 1280 1002 </string>
- <key>IBFramework Version</key>
- <string>364.0</string>
- <key>IBOpenObjects</key>
- <array>
- <integer>5</integer>
- </array>
- <key>IBSystem Version</key>
- <string>7H63</string>
-</dict>
-</plist>
diff --git a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/objects.nib b/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/objects.nib
deleted file mode 100644
index 3dfed33..0000000
--- a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/PythonLauncher/FileSettings.h b/Mac/OSX/PythonLauncher/FileSettings.h
deleted file mode 100755
index d807bae..0000000
--- a/Mac/OSX/PythonLauncher/FileSettings.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// FileSettings.h
-// PythonLauncher
-//
-// Created by Jack Jansen on Sun Jul 21 2002.
-// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@protocol FileSettingsSource
-- (NSString *) interpreter;
-- (BOOL) honourhashbang;
-- (BOOL) debug;
-- (BOOL) verbose;
-- (BOOL) inspect;
-- (BOOL) optimize;
-- (BOOL) nosite;
-- (BOOL) tabs;
-- (NSString *) others;
-- (BOOL) with_terminal;
-- (NSString *) scriptargs;
-@end
-
-@interface FileSettings : NSObject <FileSettingsSource>
-{
- NSString *interpreter; // The pathname of the interpreter to use
- NSArray *interpreters; // List of known interpreters
- BOOL honourhashbang; // #! line overrides interpreter
- BOOL debug; // -d option: debug parser
- BOOL verbose; // -v option: verbose import
- BOOL inspect; // -i option: interactive mode after script
- BOOL optimize; // -O option: optimize bytecode
- BOOL nosite; // -S option: don't import site.py
- BOOL tabs; // -t option: warn about inconsistent tabs
- NSString *others; // other options
- NSString *scriptargs; // script arguments (not for preferences)
- BOOL with_terminal; // Run in terminal window
-
- FileSettings *origsource;
- NSString *prefskey;
-}
-
-+ (id)getDefaultsForFileType: (NSString *)filetype;
-+ (id)getFactorySettingsForFileType: (NSString *)filetype;
-+ (id)newSettingsForFileType: (NSString *)filetype;
-
-//- (id)init;
-- (id)initForFileType: (NSString *)filetype;
-- (id)initForFSDefaultFileType: (NSString *)filetype;
-- (id)initForDefaultFileType: (NSString *)filetype;
-//- (id)initWithFileSettings: (FileSettings *)source;
-
-- (void)updateFromSource: (id <FileSettingsSource>)source;
-- (NSString *)commandLineForScript: (NSString *)script;
-
-//- (void)applyFactorySettingsForFileType: (NSString *)filetype;
-//- (void)saveDefaults;
-//- (void)applyUserDefaults: (NSString *)filetype;
-- (void)applyValuesFromDict: (NSDictionary *)dict;
-- (void)reset;
-- (NSArray *) interpreters;
-
-@end
diff --git a/Mac/OSX/PythonLauncher/FileSettings.m b/Mac/OSX/PythonLauncher/FileSettings.m
deleted file mode 100755
index fc3937b..0000000
--- a/Mac/OSX/PythonLauncher/FileSettings.m
+++ /dev/null
@@ -1,298 +0,0 @@
-//
-// FileSettings.m
-// PythonLauncher
-//
-// Created by Jack Jansen on Sun Jul 21 2002.
-// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
-//
-
-#import "FileSettings.h"
-
-@implementation FileSettings
-
-+ (id)getFactorySettingsForFileType: (NSString *)filetype
-{
- static FileSettings *fsdefault_py, *fsdefault_pyw, *fsdefault_pyc;
- FileSettings **curdefault;
-
- if ([filetype isEqualToString: @"Python Script"]) {
- curdefault = &fsdefault_py;
- } else if ([filetype isEqualToString: @"Python GUI Script"]) {
- curdefault = &fsdefault_pyw;
- } else if ([filetype isEqualToString: @"Python Bytecode Document"]) {
- curdefault = &fsdefault_pyc;
- } else {
- NSLog(@"Funny File Type: %@\n", filetype);
- curdefault = &fsdefault_py;
- filetype = @"Python Script";
- }
- if (!*curdefault) {
- *curdefault = [[FileSettings new] initForFSDefaultFileType: filetype];
- }
- return *curdefault;
-}
-
-+ (id)getDefaultsForFileType: (NSString *)filetype
-{
- static FileSettings *default_py, *default_pyw, *default_pyc;
- FileSettings **curdefault;
-
- if ([filetype isEqualToString: @"Python Script"]) {
- curdefault = &default_py;
- } else if ([filetype isEqualToString: @"Python GUI Script"]) {
- curdefault = &default_pyw;
- } else if ([filetype isEqualToString: @"Python Bytecode Document"]) {
- curdefault = &default_pyc;
- } else {
- NSLog(@"Funny File Type: %@\n", filetype);
- curdefault = &default_py;
- filetype = @"Python Script";
- }
- if (!*curdefault) {
- *curdefault = [[FileSettings new] initForDefaultFileType: filetype];
- }
- return *curdefault;
-}
-
-+ (id)newSettingsForFileType: (NSString *)filetype
-{
- FileSettings *cur;
-
- cur = [FileSettings new];
- [cur initForFileType: filetype];
- return [cur retain];
-}
-
-- (id)initWithFileSettings: (FileSettings *)source
-{
- self = [super init];
- if (!self) return self;
-
- interpreter = [source->interpreter retain];
- honourhashbang = source->honourhashbang;
- debug = source->debug;
- verbose = source->verbose;
- inspect = source->inspect;
- optimize = source->optimize;
- nosite = source->nosite;
- tabs = source->tabs;
- others = [source->others retain];
- scriptargs = [source->scriptargs retain];
- with_terminal = source->with_terminal;
- prefskey = source->prefskey;
- if (prefskey) [prefskey retain];
-
- return self;
-}
-
-- (id)initForFileType: (NSString *)filetype
-{
- FileSettings *defaults;
-
- defaults = [FileSettings getDefaultsForFileType: filetype];
- self = [self initWithFileSettings: defaults];
- origsource = [defaults retain];
- return self;
-}
-
-//- (id)init
-//{
-// self = [self initForFileType: @"Python Script"];
-// return self;
-//}
-
-- (id)initForFSDefaultFileType: (NSString *)filetype
-{
- int i;
- NSString *filename;
- NSDictionary *dict;
- static NSDictionary *factorySettings;
-
- self = [super init];
- if (!self) return self;
-
- if (factorySettings == NULL) {
- NSBundle *bdl = [NSBundle mainBundle];
- NSString *path = [ bdl pathForResource: @"factorySettings"
- ofType: @"plist"];
- factorySettings = [[NSDictionary dictionaryWithContentsOfFile:
- path] retain];
- if (factorySettings == NULL) {
- NSLog(@"Missing %@", path);
- return NULL;
- }
- }
- dict = [factorySettings objectForKey: filetype];
- if (dict == NULL) {
- NSLog(@"factorySettings.plist misses file type \"%@\"", filetype);
- interpreter = [@"no default found" retain];
- return NULL;
- }
- [self applyValuesFromDict: dict];
- interpreters = [dict objectForKey: @"interpreter_list"];
- interpreter = NULL;
- for (i=0; i < [interpreters count]; i++) {
- filename = [interpreters objectAtIndex: i];
- filename = [filename stringByExpandingTildeInPath];
- if ([[NSFileManager defaultManager] fileExistsAtPath: filename]) {
- interpreter = [filename retain];
- break;
- }
- }
- if (interpreter == NULL)
- interpreter = [@"no default found" retain];
- origsource = NULL;
- return self;
-}
-
-- (void)applyUserDefaults: (NSString *)filetype
-{
- NSUserDefaults *defaults;
- NSDictionary *dict;
-
- defaults = [NSUserDefaults standardUserDefaults];
- dict = [defaults dictionaryForKey: filetype];
- if (!dict)
- return;
- [self applyValuesFromDict: dict];
-}
-
-- (id)initForDefaultFileType: (NSString *)filetype
-{
- FileSettings *fsdefaults;
-
- fsdefaults = [FileSettings getFactorySettingsForFileType: filetype];
- self = [self initWithFileSettings: fsdefaults];
- if (!self) return self;
- interpreters = [fsdefaults->interpreters retain];
- scriptargs = [@"" retain];
- [self applyUserDefaults: filetype];
- prefskey = [filetype retain];
- return self;
-}
-
-- (void)reset
-{
- if (origsource) {
- [self updateFromSource: origsource];
- } else {
- FileSettings *fsdefaults;
- fsdefaults = [FileSettings getFactorySettingsForFileType: prefskey];
- [self updateFromSource: fsdefaults];
- }
-}
-
-- (void)updateFromSource: (id <FileSettingsSource>)source
-{
- interpreter = [[source interpreter] retain];
- honourhashbang = [source honourhashbang];
- debug = [source debug];
- verbose = [source verbose];
- inspect = [source inspect];
- optimize = [source optimize];
- nosite = [source nosite];
- tabs = [source tabs];
- others = [[source others] retain];
- scriptargs = [[source scriptargs] retain];
- with_terminal = [source with_terminal];
- // And if this is a user defaults object we also save the
- // values
- if (!origsource) {
- NSUserDefaults *defaults;
- NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
- interpreter, @"interpreter",
- [NSNumber numberWithBool: honourhashbang], @"honourhashbang",
- [NSNumber numberWithBool: debug], @"debug",
- [NSNumber numberWithBool: verbose], @"verbose",
- [NSNumber numberWithBool: inspect], @"inspect",
- [NSNumber numberWithBool: optimize], @"optimize",
- [NSNumber numberWithBool: nosite], @"nosite",
- [NSNumber numberWithBool: nosite], @"nosite",
- others, @"others",
- scriptargs, @"scriptargs",
- [NSNumber numberWithBool: with_terminal], @"with_terminal",
- nil];
- defaults = [NSUserDefaults standardUserDefaults];
- [defaults setObject: dict forKey: prefskey];
- }
-}
-
-- (void)applyValuesFromDict: (NSDictionary *)dict
-{
- id value;
-
- value = [dict objectForKey: @"interpreter"];
- if (value) interpreter = [value retain];
- value = [dict objectForKey: @"honourhashbang"];
- if (value) honourhashbang = [value boolValue];
- value = [dict objectForKey: @"debug"];
- if (value) debug = [value boolValue];
- value = [dict objectForKey: @"verbose"];
- if (value) verbose = [value boolValue];
- value = [dict objectForKey: @"inspect"];
- if (value) inspect = [value boolValue];
- value = [dict objectForKey: @"optimize"];
- if (value) optimize = [value boolValue];
- value = [dict objectForKey: @"nosite"];
- if (value) nosite = [value boolValue];
- value = [dict objectForKey: @"nosite"];
- if (value) tabs = [value boolValue];
- value = [dict objectForKey: @"others"];
- if (value) others = [value retain];
- value = [dict objectForKey: @"scriptargs"];
- if (value) scriptargs = [value retain];
- value = [dict objectForKey: @"with_terminal"];
- if (value) with_terminal = [value boolValue];
-}
-
-- (NSString *)commandLineForScript: (NSString *)script
-{
- NSString *cur_interp = NULL;
- char hashbangbuf[1024];
- FILE *fp;
- char *p;
-
- if (honourhashbang &&
- (fp=fopen([script cString], "r")) &&
- fgets(hashbangbuf, sizeof(hashbangbuf), fp) &&
- strncmp(hashbangbuf, "#!", 2) == 0 &&
- (p=strchr(hashbangbuf, '\n'))) {
- *p = '\0';
- p = hashbangbuf + 2;
- while (*p == ' ') p++;
- cur_interp = [NSString stringWithCString: p];
- }
- if (!cur_interp)
- cur_interp = interpreter;
-
- return [NSString stringWithFormat:
- @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %@ %s",
- cur_interp,
- debug?" -d":"",
- verbose?" -v":"",
- inspect?" -i":"",
- optimize?" -O":"",
- nosite?" -S":"",
- tabs?" -t":"",
- others,
- script,
- scriptargs,
- with_terminal? "&& echo Exit status: $? && exit 1" : " &"];
-}
-
-- (NSArray *) interpreters { return interpreters;};
-
-// FileSettingsSource protocol
-- (NSString *) interpreter { return interpreter;};
-- (BOOL) honourhashbang { return honourhashbang; };
-- (BOOL) debug { return debug;};
-- (BOOL) verbose { return verbose;};
-- (BOOL) inspect { return inspect;};
-- (BOOL) optimize { return optimize;};
-- (BOOL) nosite { return nosite;};
-- (BOOL) tabs { return tabs;};
-- (NSString *) others { return others;};
-- (NSString *) scriptargs { return scriptargs;};
-- (BOOL) with_terminal { return with_terminal;};
-
-@end
diff --git a/Mac/OSX/PythonLauncher/Info.plist b/Mac/OSX/PythonLauncher/Info.plist
deleted file mode 100644
index 1dd795f..0000000
--- a/Mac/OSX/PythonLauncher/Info.plist
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleDocumentTypes</key>
- <array>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>py</string>
- <string>pyw</string>
- </array>
- <key>CFBundleTypeIconFile</key>
- <string>PythonSource.icns</string>
- <key>CFBundleTypeName</key>
- <string>Python Script</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- <key>NSDocumentClass</key>
- <string>MyDocument</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>pyc</string>
- <string>pyo</string>
- </array>
- <key>CFBundleTypeIconFile</key>
- <string>PythonCompiled.icns</string>
- <key>CFBundleTypeName</key>
- <string>Python Bytecode Document</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- <key>NSDocumentClass</key>
- <string>MyDocument</string>
- </dict>
- </array>
- <key>CFBundleExecutable</key>
- <string>PythonLauncher</string>
- <key>CFBundleGetInfoString</key>
- <string>2.5, © 001-2006 Python Software Foundation</string>
- <key>CFBundleIconFile</key>
- <string>PythonLauncher.icns</string>
- <key>CFBundleIdentifier</key>
- <string>org.python.PythonLauncher</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>Python Launcher</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>2.5</string>
- <key>CFBundleSignature</key>
- <string>PytL</string>
- <key>CFBundleVersion</key>
- <string>2.5</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>
diff --git a/Mac/OSX/PythonLauncher/Makefile.in b/Mac/OSX/PythonLauncher/Makefile.in
deleted file mode 100644
index e6dacb3..0000000
--- a/Mac/OSX/PythonLauncher/Makefile.in
+++ /dev/null
@@ -1,78 +0,0 @@
-CC=@CC@
-LD=@CC@
-BASECFLAGS=@BASECFLAGS@
-OPT=@OPT@
-CFLAGS=$(BASECFLAGS) $(OPT)
-LDFLAGS=@LDFLAGS@
-srcdir= @srcdir@
-VERSION= @VERSION@
-UNIVERSALSDK=@UNIVERSALSDK@
-builddir= ../../..
-
-RUNSHARED= @RUNSHARED@
-BUILDEXE= @BUILDEXEEXT@
-BUILDPYTHON= ../../../python$(BUILDEXE)
-
-# Deployment target selected during configure, to be checked
-# by distutils
-MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
-@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
-
-BUNDLEBULDER=$(srcdir)/../../../Lib/plat-mac/bundlebuilder.py
-
-PYTHONAPPSDIR=/Applications/MacPython $(VERSION)
-OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o
-
-all: Python\ Launcher.app
-
-install: Python\ Launcher.app
- test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
- -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
- cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)"
- touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
-
-clean:
- rm -f *.o "Python Launcher"
- rm -rf "Python Launcher.app"
-
-Python\ Launcher.app: \
- Python\ Launcher $(srcdir)/../Icons/PythonLauncher.icns \
- $(srcdir)/../Icons/PythonSource.icns \
- $(srcdir)/../Icons/PythonCompiled.icns \
- $(srcdir)/factorySettings.plist
- rm -fr "Python Launcher.app"
- $(RUNSHARED) $(BUILDPYTHON) $(BUNDLEBULDER) \
- --builddir=. \
- --name="Python Launcher" \
- --executable="Python Launcher" \
- --iconfile=$(srcdir)/../Icons/PythonLauncher.icns \
- --bundle-id=org.python.PythonLauncher \
- --resource=$(srcdir)/../Icons/PythonSource.icns \
- --resource=$(srcdir)/../Icons/PythonCompiled.icns \
- --resource=$(srcdir)/English.lproj \
- --resource=$(srcdir)/factorySettings.plist \
- --plist=$(srcdir)/Info.plist \
- build
- find "Python Launcher.app" -name '.svn' -print0 | xargs -0 rm -r
-
-
-FileSettings.o: $(srcdir)/FileSettings.m
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/FileSettings.m
-
-MyAppDelegate.o: $(srcdir)/MyAppDelegate.m
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyAppDelegate.m
-
-MyDocument.o: $(srcdir)/MyDocument.m
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyDocument.m
-
-PreferencesWindowController.o: $(srcdir)/PreferencesWindowController.m
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/PreferencesWindowController.m
-
-doscript.o: $(srcdir)/doscript.m
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/doscript.m
-
-main.o: $(srcdir)/main.m
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/main.m
-
-Python\ Launcher: $(OBJECTS)
- $(CC) $(LDFLAGS) -o "Python Launcher" $(OBJECTS) -framework AppKit -framework Carbon
diff --git a/Mac/OSX/PythonLauncher/MyAppDelegate.h b/Mac/OSX/PythonLauncher/MyAppDelegate.h
deleted file mode 100644
index 097b541..0000000
--- a/Mac/OSX/PythonLauncher/MyAppDelegate.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* MyAppDelegate */
-
-#import <Cocoa/Cocoa.h>
-
-@interface MyAppDelegate : NSObject
-{
- BOOL initial_action_done;
- BOOL should_terminate;
-}
-- (id)init;
-- (IBAction)showPreferences:(id)sender;
-- (BOOL)shouldShowUI;
-- (BOOL)shouldTerminate;
-- (void)testFileTypeBinding;
-@end
diff --git a/Mac/OSX/PythonLauncher/MyAppDelegate.m b/Mac/OSX/PythonLauncher/MyAppDelegate.m
deleted file mode 100644
index a5ba751..0000000
--- a/Mac/OSX/PythonLauncher/MyAppDelegate.m
+++ /dev/null
@@ -1,96 +0,0 @@
-#import "MyAppDelegate.h"
-#import "PreferencesWindowController.h"
-#import <Carbon/Carbon.h>
-#import <ApplicationServices/ApplicationServices.h>
-
-@implementation MyAppDelegate
-
-- (id)init
-{
- self = [super init];
- initial_action_done = NO;
- should_terminate = NO;
- return self;
-}
-
-- (IBAction)showPreferences:(id)sender
-{
- [PreferencesWindowController getPreferencesWindow];
-}
-
-- (void)applicationDidFinishLaunching:(NSNotification *)notification
-{
- // Test that the file mappings are correct
- [self testFileTypeBinding];
- // If we were opened because of a file drag or doubleclick
- // we've set initial_action_done in shouldShowUI
- // Otherwise we open a preferences dialog.
- if (!initial_action_done) {
- initial_action_done = YES;
- [self showPreferences: self];
- }
-}
-
-- (BOOL)shouldShowUI
-{
- // if this call comes before applicationDidFinishLaunching: we
- // should terminate immedeately after starting the script.
- if (!initial_action_done)
- should_terminate = YES;
- initial_action_done = YES;
- if( GetCurrentKeyModifiers() & optionKey )
- return YES;
- return NO;
-}
-
-- (BOOL)shouldTerminate
-{
- return should_terminate;
-}
-
-- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
-{
- return NO;
-}
-
-- (void)testFileTypeBinding
-{
- NSURL *ourUrl;
- OSStatus err;
- FSRef appRef;
- NSURL *appUrl;
- static NSString *extensions[] = { @"py", @"pyw", @"pyc", NULL};
- NSString **ext_p;
- int i;
-
- if ([[NSUserDefaults standardUserDefaults] boolForKey: @"SkipFileBindingTest"])
- return;
- ourUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] bundlePath]];
- for( ext_p = extensions; *ext_p; ext_p++ ) {
- err = LSGetApplicationForInfo(
- kLSUnknownType,
- kLSUnknownCreator,
- (CFStringRef)*ext_p,
- kLSRolesViewer,
- &appRef,
- (CFURLRef *)&appUrl);
- if (err || ![appUrl isEqual: ourUrl] ) {
- i = NSRunAlertPanel(@"File type binding",
- @"PythonLauncher is not the default application for all " \
- @"Python script types. You should fix this with the " \
- @"Finder's \"Get Info\" command.\n\n" \
- @"See \"Changing the application that opens a file\" in " \
- @"Mac Help for details.",
- @"OK",
- @"Don't show this warning again",
- NULL);
- if ( i == 0 ) { // Don't show again
- [[NSUserDefaults standardUserDefaults]
- setObject:@"YES" forKey:@"SkipFileBindingTest"];
- }
- return;
- }
- }
-}
-
-@end
diff --git a/Mac/OSX/PythonLauncher/MyDocument.h b/Mac/OSX/PythonLauncher/MyDocument.h
deleted file mode 100755
index 00c1bae..0000000
--- a/Mac/OSX/PythonLauncher/MyDocument.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// MyDocument.h
-// PythonLauncher
-//
-// Created by Jack Jansen on Fri Jul 19 2002.
-// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
-//
-
-
-#import <Cocoa/Cocoa.h>
-
-#import "FileSettings.h"
-
-@interface MyDocument : NSDocument <FileSettingsSource>
-{
- IBOutlet NSTextField *interpreter;
- IBOutlet NSButton *honourhashbang;
- IBOutlet NSButton *debug;
- IBOutlet NSButton *verbose;
- IBOutlet NSButton *inspect;
- IBOutlet NSButton *optimize;
- IBOutlet NSButton *nosite;
- IBOutlet NSButton *tabs;
- IBOutlet NSTextField *others;
- IBOutlet NSButton *with_terminal;
- IBOutlet NSTextField *scriptargs;
- IBOutlet NSTextField *commandline;
-
- NSString *script;
- NSString *filetype;
- FileSettings *settings;
-}
-
-- (IBAction)do_run:(id)sender;
-- (IBAction)do_cancel:(id)sender;
-- (IBAction)do_reset:(id)sender;
-- (IBAction)do_apply:(id)sender;
-
-- (void)controlTextDidChange:(NSNotification *)aNotification;
-
-@end
diff --git a/Mac/OSX/PythonLauncher/MyDocument.m b/Mac/OSX/PythonLauncher/MyDocument.m
deleted file mode 100755
index 5acc2dc..0000000
--- a/Mac/OSX/PythonLauncher/MyDocument.m
+++ /dev/null
@@ -1,175 +0,0 @@
-//
-// MyDocument.m
-// PythonLauncher
-//
-// Created by Jack Jansen on Fri Jul 19 2002.
-// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
-//
-
-#import "MyDocument.h"
-#import "MyAppDelegate.h"
-#import "doscript.h"
-
-@implementation MyDocument
-
-- (id)init
-{
- self = [super init];
- if (self) {
-
- // Add your subclass-specific initialization here.
- // If an error occurs here, send a [self dealloc] message and return nil.
- script = [@"<no script>.py" retain];
- filetype = [@"Python Script" retain];
- settings = NULL;
- }
- return self;
-}
-
-- (NSString *)windowNibName
-{
- // Override returning the nib file name of the document
- // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead.
- return @"MyDocument";
-}
-
-- (void)close
-{
- NSApplication *app = [NSApplication sharedApplication];
- [super close];
- if ([[app delegate] shouldTerminate])
- [app terminate: self];
-}
-
-- (void)load_defaults
-{
-// if (settings) [settings release];
- settings = [FileSettings newSettingsForFileType: filetype];
-}
-
-- (void)update_display
-{
-// [[self window] setTitle: script];
-
- [interpreter setStringValue: [settings interpreter]];
- [honourhashbang setState: [settings honourhashbang]];
- [debug setState: [settings debug]];
- [verbose setState: [settings verbose]];
- [inspect setState: [settings inspect]];
- [optimize setState: [settings optimize]];
- [nosite setState: [settings nosite]];
- [tabs setState: [settings tabs]];
- [others setStringValue: [settings others]];
- [scriptargs setStringValue: [settings scriptargs]];
- [with_terminal setState: [settings with_terminal]];
-
- [commandline setStringValue: [settings commandLineForScript: script]];
-}
-
-- (void)update_settings
-{
- [settings updateFromSource: self];
-}
-
-- (BOOL)run
-{
- const char *cmdline;
- int sts;
-
- cmdline = [[settings commandLineForScript: script] cString];
- if ([settings with_terminal]) {
- sts = doscript(cmdline);
- } else {
- sts = system(cmdline);
- }
- if (sts) {
- NSLog(@"Exit status: %d\n", sts);
- return NO;
- }
- return YES;
-}
-
-- (void)windowControllerDidLoadNib:(NSWindowController *) aController
-{
- [super windowControllerDidLoadNib:aController];
- // Add any code here that need to be executed once the windowController has loaded the document's window.
- [self load_defaults];
- [self update_display];
-}
-
-- (NSData *)dataRepresentationOfType:(NSString *)aType
-{
- // Insert code here to write your document from the given data. You can also choose to override -fileWrapperRepresentationOfType: or -writeToFile:ofType: instead.
- return nil;
-}
-
-- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type;
-{
- // Insert code here to read your document from the given data. You can also choose to override -loadFileWrapperRepresentation:ofType: or -readFromFile:ofType: instead.
- BOOL show_ui;
-
- // ask the app delegate whether we should show the UI or not.
- show_ui = [[[NSApplication sharedApplication] delegate] shouldShowUI];
- [script release];
- script = [fileName retain];
- [filetype release];
- filetype = [type retain];
-// if (settings) [settings release];
- settings = [FileSettings newSettingsForFileType: filetype];
- if (show_ui) {
- [self update_display];
- return YES;
- } else {
- [self run];
- [self close];
- return NO;
- }
-}
-
-- (IBAction)do_run:(id)sender
-{
- [self update_settings];
- [self update_display];
- if ([self run])
- [self close];
-}
-
-- (IBAction)do_cancel:(id)sender
-{
- [self close];
-}
-
-
-- (IBAction)do_reset:(id)sender
-{
- [settings reset];
- [self update_display];
-}
-
-- (IBAction)do_apply:(id)sender
-{
- [self update_settings];
- [self update_display];
-}
-
-// FileSettingsSource protocol
-- (NSString *) interpreter { return [interpreter stringValue];};
-- (BOOL) honourhashbang { return [honourhashbang state];};
-- (BOOL) debug { return [debug state];};
-- (BOOL) verbose { return [verbose state];};
-- (BOOL) inspect { return [inspect state];};
-- (BOOL) optimize { return [optimize state];};
-- (BOOL) nosite { return [nosite state];};
-- (BOOL) tabs { return [tabs state];};
-- (NSString *) others { return [others stringValue];};
-- (NSString *) scriptargs { return [scriptargs stringValue];};
-- (BOOL) with_terminal { return [with_terminal state];};
-
-// Delegates
-- (void)controlTextDidChange:(NSNotification *)aNotification
-{
- [self update_settings];
- [self update_display];
-};
-
-@end
diff --git a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib
deleted file mode 100644
index 467aa8b..0000000
--- a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- IBClasses = (
- {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
- {
- ACTIONS = {"do_apply" = id; "do_filetype" = id; "do_reset" = id; };
- CLASS = PreferencesWindowController;
- LANGUAGE = ObjC;
- OUTLETS = {
- commandline = NSTextField;
- debug = NSButton;
- filetype = NSPopUpButton;
- honourhashbang = NSButton;
- inspect = NSButton;
- interpreter = NSTextField;
- nosite = NSButton;
- optimize = NSButton;
- others = NSTextField;
- tabs = NSButton;
- verbose = NSButton;
- "with_terminal" = NSButton;
- };
- SUPERCLASS = NSWindowController;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib
deleted file mode 100644
index bc558f7..0000000
--- a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBDocumentLocation</key>
- <string>565 235 519 534 0 0 1280 1002 </string>
- <key>IBFramework Version</key>
- <string>364.0</string>
- <key>IBOpenObjects</key>
- <array>
- <integer>5</integer>
- </array>
- <key>IBSystem Version</key>
- <string>7H63</string>
-</dict>
-</plist>
diff --git a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib
deleted file mode 100644
index 3dfed33..0000000
--- a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/Mac/OSX/PythonLauncher/PreferencesWindowController.h b/Mac/OSX/PythonLauncher/PreferencesWindowController.h
deleted file mode 100644
index 6346996..0000000
--- a/Mac/OSX/PythonLauncher/PreferencesWindowController.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* PreferencesWindowController */
-
-#import <Cocoa/Cocoa.h>
-
-#import "FileSettings.h"
-
-@interface PreferencesWindowController : NSWindowController <FileSettingsSource>
-{
- IBOutlet NSPopUpButton *filetype;
- IBOutlet NSComboBox *interpreter;
- IBOutlet NSButton *honourhashbang;
- IBOutlet NSButton *debug;
- IBOutlet NSButton *verbose;
- IBOutlet NSButton *inspect;
- IBOutlet NSButton *optimize;
- IBOutlet NSButton *nosite;
- IBOutlet NSButton *tabs;
- IBOutlet NSTextField *others;
- IBOutlet NSButton *with_terminal;
- IBOutlet NSTextField *commandline;
-
- FileSettings *settings;
-}
-
-+ getPreferencesWindow;
-
-- (IBAction)do_reset:(id)sender;
-- (IBAction)do_apply:(id)sender;
-- (IBAction)do_filetype:(id)sender;
-
-- (void)controlTextDidChange:(NSNotification *)aNotification;
-
-- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString;
-- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index;
-- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox;
-
-
-@end
diff --git a/Mac/OSX/PythonLauncher/PreferencesWindowController.m b/Mac/OSX/PythonLauncher/PreferencesWindowController.m
deleted file mode 100644
index 311c375..0000000
--- a/Mac/OSX/PythonLauncher/PreferencesWindowController.m
+++ /dev/null
@@ -1,121 +0,0 @@
-#import "PreferencesWindowController.h"
-
-@implementation PreferencesWindowController
-
-+ getPreferencesWindow
-{
- static PreferencesWindowController *_singleton;
-
- if (!_singleton)
- _singleton = [[PreferencesWindowController alloc] init];
- [_singleton showWindow: _singleton];
- return _singleton;
-}
-
-- (id) init
-{
- self = [self initWithWindowNibName: @"PreferenceWindow"];
- return self;
-}
-
-- (void)load_defaults
-{
- NSString *title = [filetype titleOfSelectedItem];
-
- settings = [FileSettings getDefaultsForFileType: title];
-}
-
-- (void)update_display
-{
-// [[self window] setTitle: script];
-
- [interpreter reloadData];
- [interpreter setStringValue: [settings interpreter]];
- [honourhashbang setState: [settings honourhashbang]];
- [debug setState: [settings debug]];
- [verbose setState: [settings verbose]];
- [inspect setState: [settings inspect]];
- [optimize setState: [settings optimize]];
- [nosite setState: [settings nosite]];
- [tabs setState: [settings tabs]];
- [others setStringValue: [settings others]];
- [with_terminal setState: [settings with_terminal]];
- // Not scriptargs, it isn't for preferences
-
- [commandline setStringValue: [settings commandLineForScript: @"<your script here>"]];
-}
-
-- (void) windowDidLoad
-{
- [super windowDidLoad];
- [self load_defaults];
- [self update_display];
-}
-
-- (void)update_settings
-{
- [settings updateFromSource: self];
-}
-
-- (IBAction)do_filetype:(id)sender
-{
- [self load_defaults];
- [self update_display];
-}
-
-- (IBAction)do_reset:(id)sender
-{
- [settings reset];
- [self update_display];
-}
-
-- (IBAction)do_apply:(id)sender
-{
- [self update_settings];
- [self update_display];
-}
-
-// FileSettingsSource protocol
-- (NSString *) interpreter { return [interpreter stringValue];};
-- (BOOL) honourhashbang { return [honourhashbang state]; };
-- (BOOL) debug { return [debug state];};
-- (BOOL) verbose { return [verbose state];};
-- (BOOL) inspect { return [inspect state];};
-- (BOOL) optimize { return [optimize state];};
-- (BOOL) nosite { return [nosite state];};
-- (BOOL) tabs { return [tabs state];};
-- (NSString *) others { return [others stringValue];};
-- (BOOL) with_terminal { return [with_terminal state];};
-- (NSString *) scriptargs { return @"";};
-
-// Delegates
-- (void)controlTextDidChange:(NSNotification *)aNotification
-{
- [self update_settings];
- [self update_display];
-};
-
-// NSComboBoxDataSource protocol
-- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString
-{
- NSArray *interp_list = [settings interpreters];
- unsigned int rv = [interp_list indexOfObjectIdenticalTo: aString];
- return rv;
-}
-
-- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index
-{
- NSArray *interp_list = [settings interpreters];
- id rv = [interp_list objectAtIndex: index];
- return rv;
-}
-
-- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox
-{
- NSArray *interp_list = [settings interpreters];
- int rv = [interp_list count];
- return rv;
-}
-
-
-@end
diff --git a/Mac/OSX/PythonLauncher/doscript.h b/Mac/OSX/PythonLauncher/doscript.h
deleted file mode 100644
index eef0b56..0000000
--- a/Mac/OSX/PythonLauncher/doscript.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * doscript.h
- * PythonLauncher
- *
- * Created by Jack Jansen on Wed Jul 31 2002.
- * Copyright (c) 2002 __MyCompanyName__. All rights reserved.
- *
- */
-
-#include <Carbon/Carbon.h>
-
-extern int doscript(const char *command); \ No newline at end of file
diff --git a/Mac/OSX/PythonLauncher/doscript.m b/Mac/OSX/PythonLauncher/doscript.m
deleted file mode 100644
index 3e4e223..0000000
--- a/Mac/OSX/PythonLauncher/doscript.m
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * doscript.c
- * PythonLauncher
- *
- * Created by Jack Jansen on Wed Jul 31 2002.
- * Copyright (c) 2002 __MyCompanyName__. All rights reserved.
- *
- */
-
-#import <Cocoa/Cocoa.h>
-#import <ApplicationServices/ApplicationServices.h>
-#import "doscript.h"
-
-/* I assume I could pick these up from somewhere, but where... */
-#define CREATOR 'trmx'
-
-#define ACTIVATE_CMD 'misc'
-#define ACTIVATE_SUITE 'actv'
-
-#define DOSCRIPT_CMD 'dosc'
-#define DOSCRIPT_SUITE 'core'
-#define WITHCOMMAND 'cmnd'
-
-/* ... and there's probably also a better way to do this... */
-#define START_TERMINAL "/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal &"
-
-extern int
-doscript(const char *command)
-{
- OSErr err;
- AppleEvent theAEvent, theReply;
- AEAddressDesc terminalAddress;
- AEDesc commandDesc;
- OSType terminalCreator = CREATOR;
-
- /* set up locals */
- AECreateDesc(typeNull, NULL, 0, &theAEvent);
- AECreateDesc(typeNull, NULL, 0, &terminalAddress);
- AECreateDesc(typeNull, NULL, 0, &theReply);
- AECreateDesc(typeNull, NULL, 0, &commandDesc);
-
- /* create the "activate" event for Terminal */
- err = AECreateDesc(typeApplSignature, (Ptr) &terminalCreator,
- sizeof(terminalCreator), &terminalAddress);
- if (err != noErr) {
- NSLog(@"doscript: AECreateDesc: error %d\n", err);
- goto bail;
- }
- err = AECreateAppleEvent(ACTIVATE_SUITE, ACTIVATE_CMD,
- &terminalAddress, kAutoGenerateReturnID,
- kAnyTransactionID, &theAEvent);
-
- if (err != noErr) {
- NSLog(@"doscript: AECreateAppleEvent(activate): error %d\n", err);
- goto bail;
- }
- /* send the event */
- err = AESend(&theAEvent, &theReply, kAEWaitReply,
- kAENormalPriority, kAEDefaultTimeout, NULL, NULL);
- if ( err == -600 ) {
- int count=10;
- /* If it failed with "no such process" try to start Terminal */
- err = system(START_TERMINAL);
- if ( err ) {
- NSLog(@"doscript: system(): %s\n", strerror(errno));
- goto bail;
- }
- do {
- sleep(1);
- /* send the event again */
- err = AESend(&theAEvent, &theReply, kAEWaitReply,
- kAENormalPriority, kAEDefaultTimeout, NULL, NULL);
- } while (err == -600 && --count > 0);
- if ( err == -600 )
- NSLog(@"doscript: Could not activate Terminal\n");
- }
- if (err != noErr) {
- NSLog(@"doscript: AESend(activate): error %d\n", err);
- goto bail;
- }
-
- /* create the "doscript with command" event for Terminal */
- err = AECreateAppleEvent(DOSCRIPT_SUITE, DOSCRIPT_CMD,
- &terminalAddress, kAutoGenerateReturnID,
- kAnyTransactionID, &theAEvent);
- if (err != noErr) {
- NSLog(@"doscript: AECreateAppleEvent(doscript): error %d\n", err);
- goto bail;
- }
-
- /* add the command to the apple event */
- err = AECreateDesc(typeChar, command, strlen(command), &commandDesc);
- if (err != noErr) {
- NSLog(@"doscript: AECreateDesc(command): error %d\n", err);
- goto bail;
- }
- err = AEPutParamDesc(&theAEvent, WITHCOMMAND, &commandDesc);
- if (err != noErr) {
- NSLog(@"doscript: AEPutParamDesc: error %d\n", err);
- goto bail;
- }
-
- /* send the command event to Terminal.app */
- err = AESend(&theAEvent, &theReply, kAEWaitReply,
- kAENormalPriority, kAEDefaultTimeout, NULL, NULL);
-
- if (err != noErr) {
- NSLog(@"doscript: AESend(docommand): error %d\n", err);
- goto bail;
- }
- /* clean up and leave */
-bail:
- AEDisposeDesc(&commandDesc);
- AEDisposeDesc(&theAEvent);
- AEDisposeDesc(&terminalAddress);
- AEDisposeDesc(&theReply);
- return err;
-}
diff --git a/Mac/OSX/PythonLauncher/factorySettings.plist b/Mac/OSX/PythonLauncher/factorySettings.plist
deleted file mode 100644
index 1202421..0000000
--- a/Mac/OSX/PythonLauncher/factorySettings.plist
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>Python GUI Script</key>
- <dict>
- <key>debug</key>
- <false/>
- <key>inspect</key>
- <false/>
- <key>interpreter_list</key>
- <array>
- <string>/usr/local/bin/pythonw</string>
- <string>/usr/bin/pythonw</string>
- <string>/sw/bin/pythonw</string>
- </array>
- <key>honourhashbang</key>
- <false/>
- <key>nosite</key>
- <false/>
- <key>optimize</key>
- <false/>
- <key>others</key>
- <string></string>
- <key>verbose</key>
- <false/>
- <key>with_terminal</key>
- <false/>
- </dict>
- <key>Python Script</key>
- <dict>
- <key>debug</key>
- <false/>
- <key>inspect</key>
- <false/>
- <key>interpreter_list</key>
- <array>
- <string>/usr/local/bin/pythonw</string>
- <string>/usr/local/bin/python</string>
- <string>/usr/bin/pythonw</string>
- <string>/usr/bin/python</string>
- <string>/sw/bin/pythonw</string>
- <string>/sw/bin/python</string>
- </array>
- <key>honourhashbang</key>
- <false/>
- <key>nosite</key>
- <false/>
- <key>optimize</key>
- <false/>
- <key>others</key>
- <string></string>
- <key>verbose</key>
- <false/>
- <key>with_terminal</key>
- <true/>
- </dict>
- <key>Python Bytecode Document</key>
- <dict>
- <key>debug</key>
- <false/>
- <key>inspect</key>
- <false/>
- <key>interpreter_list</key>
- <array>
- <string>/usr/local/bin/pythonw</string>
- <string>/usr/local/bin/python</string>
- <string>/usr/bin/pythonw</string>
- <string>/usr/bin/python</string>
- <string>/sw/bin/pythonw</string>
- <string>/sw/bin/python</string>
- </array>
- <key>honourhashbang</key>
- <false/>
- <key>nosite</key>
- <false/>
- <key>optimize</key>
- <false/>
- <key>others</key>
- <string></string>
- <key>verbose</key>
- <false/>
- <key>with_terminal</key>
- <true/>
- </dict>
-</dict>
-</plist>
diff --git a/Mac/OSX/PythonLauncher/main.m b/Mac/OSX/PythonLauncher/main.m
deleted file mode 100755
index 6841433..0000000
--- a/Mac/OSX/PythonLauncher/main.m
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// main.m
-// PythonLauncher
-//
-// Created by Jack Jansen on Fri Jul 19 2002.
-// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-#include <unistd.h>
-
-int main(int argc, const char *argv[])
-{
- char *home = getenv("HOME");
- if (home) chdir(home);
- return NSApplicationMain(argc, argv);
-}
diff --git a/Mac/OSX/README b/Mac/OSX/README
deleted file mode 100644
index 1e58b02..0000000
--- a/Mac/OSX/README
+++ /dev/null
@@ -1,167 +0,0 @@
-============
-MacOSX Notes
-============
-
-This document provides a quick overview of some Mac OS X specific features in
-the Python distribution.
-
-
-Building and using a universal binary of Python on Mac OS X
-===========================================================
-
-1. What is a universal binary
------------------------------
-
-A universal binary build of Python contains object code for both PPC and i386
-and can therefore run at native speed on both classic powerpc based macs and
-the newer intel based macs.
-
-2. How do I build a universal binary
-------------------------------------
-
-You can enable universal binaries by specifying the "--enable-universalsdk"
-flag to configure::
-
- $ ./configure --enable-universalsdk
- $ make
- $ make install
-
-This flag can be used a framework build of python, but also with a classic
-unix build. Either way you will have to build python on Mac OS X 10.4 (or later)
-with Xcode 2.1 (or later). You also have to install the 10.4u SDK when
-installing Xcode.
-
-
-Building and using a framework-based Python on Mac OS X.
-========================================================
-
-
-1. Why would I want a framework Python instead of a normal static Python?
---------------------------------------------------------------------------
-
-The main reason is because you want to create GUI programs in Python. With the
-exception of X11/XDarwin-based GUI toolkits all GUI programs need to be run
-from a fullblown MacOSX application (a ".app" bundle).
-
-While it is technically possible to create a .app without using frameworks you
-will have to do the work yourself if you really want this.
-
-A second reason for using frameworks is that they put Python-related items in
-only two places: "/Library/Framework/Python.framework" and
-"/Applications/MacPython 2.5". This simplifies matters for users installing
-Python from a binary distribution if they want to get rid of it again. Moreover,
-due to the way frameworks work a user without admin privileges can install a
-binary distribution in his or her home directory without recompilation.
-
-2. How does a framework Python differ from a normal static Python?
-------------------------------------------------------------------
-
-In everyday use there is no difference, except that things are stored in
-a different place. If you look in /Library/Frameworks/Python.framework
-you will see lots of relative symlinks, see the Apple documentation for
-details. If you are used to a normal unix Python file layout go down to
-Versions/Current and you will see the familiar bin and lib directories.
-
-3. Do I need extra packages?
-----------------------------
-
-Yes, probably. If you want Tkinter support you need to get the OSX AquaTk
-distribution, this is installed by default on Mac OS X 10.4 or later. If
-you want wxPython you need to get that. If you want Cocoa you need to get
-PyObjC.
-
-4. How do I build a framework Python?
--------------------------------------
-
-This directory contains a Makefile that will create a couple of python-related
-applications (fullblown OSX .app applications, that is) in
-"/Applications/MacPython 2.3", and a hidden helper application Python.app
-inside the Python.framework, and unix tools "python" and "pythonw" into
-/usr/local/bin. In addition it has a target "installmacsubtree" that installs
-the relevant portions of the Mac subtree into the Python.framework.
-
-It is normally invoked indirectly through the main Makefile, as the last step
-in the sequence
-
- 1. ./configure --enable-framework
-
- 2. make
-
- 3. make install
-
-This sequence will put the framework in /Library/Framework/Python.framework,
-the applications in /Applications/MacPython 2.5 and the unix tools in
-/usr/local/bin.
-
-Installing in another place, for instance $HOME/Library/Frameworks if you have
-no admin privileges on your machine, has only been tested very lightly. This
-can be done by configuring with --enable-framework=$HOME/Library/Frameworks.
-The other two directories, /Applications/MacPython-2.3 and /usr/local/bin, will
-then also be deposited in $HOME. This is sub-optimal for the unix tools, which
-you would want in $HOME/bin, but there is no easy way to fix this right now.
-
-Note that there are no references to the actual locations in the code or
-resource files, so you are free to move things around afterwards. For example,
-you could use --enable-framework=/tmp/newversion/Library/Frameworks and use
-/tmp/newversion as the basis for an installer or something.
-
-If you want to install some part, but not all, read the main Makefile. The
-frameworkinstall is composed of a couple of sub-targets that install the
-framework itself, the Mac subtree, the applications and the unix tools.
-
-There is an extra target frameworkinstallextras that is not part of the
-normal frameworkinstall which installs the Demo and Tools directories
-into /Applications/MacPython-2.3, this is useful for binary distributions.
-
-What do all these programs do?
-===============================
-
-"IDLE.app" is an integrated development environment for Python: editor,
-debugger, etc.
-
-"PythonLauncher.app" is a helper application that will handle things when you
-double-click a .py, .pyc or .pyw file. For the first two it creates a Terminal
-window and runs the scripts with the normal command-line Python. For the
-latter it runs the script in the Python.app interpreter so the script can do
-GUI-things. Keep the "alt" key depressed while dragging or double-clicking a
-script to set runtime options. These options can be set once and for all
-through PythonLauncher's preferences dialog.
-
-"BuildApplet.app" creates an applet from a Python script. Drop the script on it
-and out comes a full-featured MacOS application. There is much more to this,
-to be supplied later. Some useful (but outdated) info can be found in
-Mac/Demo.
-
-The commandline scripts /usr/local/bin/python and pythonw can be used to run
-non-GUI and GUI python scripts from the command line, respectively.
-
-How do I create a binary distribution?
-======================================
-
-Go to the directory "Mac/OSX/BuildScript". There you'll find a script
-"build-installer.py" that does all the work. This will download and build
-a number of 3th-party libaries, configures and builds a framework Python,
-installs it, creates the installer pacakge files and then packs this in a
-DMG image.
-
-The script will build a universal binary, you'll therefore have to run this
-script on Mac OS X 10.4 or later and with Xcode 2.1 or later installed.
-
-All of this is normally done completely isolated in /tmp/_py, so it does not
-use your normal build directory nor does it install into /.
-
-Because of the way the script locates the files it needs you have to run it
-from within the BuildScript directory. The script accepts a number of
-command-line arguments, run it with --help for more information.
-
-Odds and ends
-=============
-
-Something to take note of is that the ".rsrc" files in the distribution are
-not actually resource files, they're AppleSingle encoded resource files. The
-macresource module and the Mac/OSX/Makefile cater for this, and create
-".rsrc.df.rsrc" files on the fly that are normal datafork-based resource
-files.
-
- Jack Jansen, Jack.Jansen@cwi.nl, 15-Jul-2004.
- Ronald Oussoren, RonaldOussoren@mac.com, 26-May-2006
diff --git a/Mac/OSX/Tools/pythonw.c b/Mac/OSX/Tools/pythonw.c
deleted file mode 100644
index e70a76f..0000000
--- a/Mac/OSX/Tools/pythonw.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * This wrapper program executes a python executable hidden inside an
- * application bundle inside the Python framework. This is needed to run
- * GUI code: some GUI API's don't work unless the program is inside an
- * application bundle.
- */
-#include <unistd.h>
-#include <err.h>
-
-static char Python[] = PYTHONWEXECUTABLE;
-
-int main(int argc, char **argv) {
- argv[0] = Python;
- execv(Python, argv);
- err(1, "execv: %s", Python);
- /* NOTREACHED */
-}
diff --git a/Mac/OSX/fixapplepython23.py b/Mac/OSX/fixapplepython23.py
deleted file mode 100644
index 181181e..0000000
--- a/Mac/OSX/fixapplepython23.py
+++ /dev/null
@@ -1,118 +0,0 @@
-"""fixapplepython23 - Fix Apple-installed Python 2.3 (on Mac OS X 10.3)
-
-Python 2.3 (and 2.3.X for X<5) have the problem that building an extension
-for a framework installation may accidentally pick up the framework
-of a newer Python, in stead of the one that was used to build the extension.
-
-This script modifies the Makefile (in .../lib/python2.3/config) to use
-the newer method of linking extensions with "-undefined dynamic_lookup"
-which fixes this problem.
-
-The script will first check all prerequisites, and return a zero exit
-status also when nothing needs to be fixed.
-"""
-import sys
-import os
-import gestalt
-
-MAKEFILE='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/Makefile'
-CHANGES=((
- 'LDSHARED=\t$(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK)\n',
- 'LDSHARED=\t$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup\n'
- ),(
- 'BLDSHARED=\t$(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK)\n',
- 'BLDSHARED=\t$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup\n'
- ),(
- 'CC=\t\tgcc\n',
- 'CC=\t\t/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-gcc\n'
- ),(
- 'CXX=\t\tc++\n',
- 'CXX=\t\t/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-g++\n'
-))
-
-GCC_SCRIPT='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-gcc'
-GXX_SCRIPT='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-g++'
-SCRIPT="""#!/bin/sh
-export MACOSX_DEPLOYMENT_TARGET=10.3
-exec %s "${@}"
-"""
-
-def findline(lines, start):
- """return line starting with given string or -1"""
- for i in range(len(lines)):
- if lines[i][:len(start)] == start:
- return i
- return -1
-
-def fix(makefile, do_apply):
- """Fix the Makefile, if required."""
- fixed = False
- lines = open(makefile).readlines()
-
- for old, new in CHANGES:
- i = findline(lines, new)
- if i >= 0:
- # Already fixed
- continue
- i = findline(lines, old)
- if i < 0:
- print 'fixapplepython23: Python installation not fixed (appears broken)'
- print 'fixapplepython23: missing line:', old
- return 2
- lines[i] = new
- fixed = True
-
- if fixed:
- if do_apply:
- print 'fixapplepython23: Fix to Apple-installed Python 2.3 applied'
- os.rename(makefile, makefile + '~')
- open(makefile, 'w').writelines(lines)
- return 0
- else:
- print 'fixapplepython23: Fix to Apple-installed Python 2.3 should be applied'
- return 1
- else:
- print 'fixapplepython23: No fix needed, appears to have been applied before'
- return 0
-
-def makescript(filename, compiler):
- """Create a wrapper script for a compiler"""
- dirname = os.path.split(filename)[0]
- if not os.access(dirname, os.X_OK):
- os.mkdir(dirname, 0755)
- fp = open(filename, 'w')
- fp.write(SCRIPT % compiler)
- fp.close()
- os.chmod(filename, 0755)
- print 'fixapplepython23: Created', filename
-
-def main():
- # Check for -n option
- if len(sys.argv) > 1 and sys.argv[1] == '-n':
- do_apply = False
- else:
- do_apply = True
- # First check OS version
- if gestalt.gestalt('sysv') < 0x1030:
- print 'fixapplepython23: no fix needed on MacOSX < 10.3'
- sys.exit(0)
- # Test that a framework Python is indeed installed
- if not os.path.exists(MAKEFILE):
- print 'fixapplepython23: Python framework does not appear to be installed (?), nothing fixed'
- sys.exit(0)
- # Check that we can actually write the file
- if do_apply and not os.access(MAKEFILE, os.W_OK):
- print 'fixapplepython23: No write permission, please run with "sudo"'
- sys.exit(2)
- # Create the shell scripts
- if do_apply:
- if not os.access(GCC_SCRIPT, os.X_OK):
- makescript(GCC_SCRIPT, "gcc")
- if not os.access(GXX_SCRIPT, os.X_OK):
- makescript(GXX_SCRIPT, "g++")
- # Finally fix the makefile
- rv = fix(MAKEFILE, do_apply)
- sys.exit(rv)
-
-if __name__ == '__main__':
- main()