summaryrefslogtreecommitdiff
path: root/Mac/Tools
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-06-08 15:35:45 +0000
committerThomas Wouters <thomas@python.org>2006-06-08 15:35:45 +0000
commit73e5a5b65d66f4fba9c4f626bcd6400f4a7215e6 (patch)
tree206b2ca44cf23af41ac27cb7b3744f2e60a3341d /Mac/Tools
parent1ba5b3b425e970ec3e4a19165475aa68fa5ac893 (diff)
downloadcpython-git-73e5a5b65d66f4fba9c4f626bcd6400f4a7215e6.tar.gz
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/Tools')
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py110
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/Miscellaneous_Standards.py49
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/Required_Suite.py32
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py343
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/__init__.py78
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/odds_and_ends.py49
-rw-r--r--Mac/Tools/Doc/README35
-rw-r--r--Mac/Tools/Doc/setup.py214
-rw-r--r--Mac/Tools/fixapplepython23.py119
-rw-r--r--Mac/Tools/pythonw.c17
10 files changed, 1046 insertions, 0 deletions
diff --git a/Mac/Tools/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py b/Mac/Tools/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py
new file mode 100644
index 0000000000..58d73076df
--- /dev/null
+++ b/Mac/Tools/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py
@@ -0,0 +1,110 @@
+"""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/Tools/Doc/HelpIndexingTool/Miscellaneous_Standards.py b/Mac/Tools/Doc/HelpIndexingTool/Miscellaneous_Standards.py
new file mode 100644
index 0000000000..3cf745f986
--- /dev/null
+++ b/Mac/Tools/Doc/HelpIndexingTool/Miscellaneous_Standards.py
@@ -0,0 +1,49 @@
+"""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/Tools/Doc/HelpIndexingTool/Required_Suite.py b/Mac/Tools/Doc/HelpIndexingTool/Required_Suite.py
new file mode 100644
index 0000000000..eb9fee0017
--- /dev/null
+++ b/Mac/Tools/Doc/HelpIndexingTool/Required_Suite.py
@@ -0,0 +1,32 @@
+"""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/Tools/Doc/HelpIndexingTool/Standard_Suite.py b/Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py
new file mode 100644
index 0000000000..4f6604cfeb
--- /dev/null
+++ b/Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py
@@ -0,0 +1,343 @@
+"""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/Tools/Doc/HelpIndexingTool/__init__.py b/Mac/Tools/Doc/HelpIndexingTool/__init__.py
new file mode 100644
index 0000000000..5359df53c4
--- /dev/null
+++ b/Mac/Tools/Doc/HelpIndexingTool/__init__.py
@@ -0,0 +1,78 @@
+"""
+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/Tools/Doc/HelpIndexingTool/odds_and_ends.py b/Mac/Tools/Doc/HelpIndexingTool/odds_and_ends.py
new file mode 100644
index 0000000000..7ee46f35cc
--- /dev/null
+++ b/Mac/Tools/Doc/HelpIndexingTool/odds_and_ends.py
@@ -0,0 +1,49 @@
+"""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/Tools/Doc/README b/Mac/Tools/Doc/README
new file mode 100644
index 0000000000..4f4d53d01e
--- /dev/null
+++ b/Mac/Tools/Doc/README
@@ -0,0 +1,35 @@
+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/Tools/Doc/setup.py b/Mac/Tools/Doc/setup.py
new file mode 100644
index 0000000000..bd86a20a83
--- /dev/null
+++ b/Mac/Tools/Doc/setup.py
@@ -0,0 +1,214 @@
+# 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/Tools/fixapplepython23.py b/Mac/Tools/fixapplepython23.py
new file mode 100644
index 0000000000..ef352cedb1
--- /dev/null
+++ b/Mac/Tools/fixapplepython23.py
@@ -0,0 +1,119 @@
+#!/usr/bin/python
+"""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()
diff --git a/Mac/Tools/pythonw.c b/Mac/Tools/pythonw.c
new file mode 100644
index 0000000000..e70a76f846
--- /dev/null
+++ b/Mac/Tools/pythonw.c
@@ -0,0 +1,17 @@
+/*
+ * 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 */
+}