From tim_one@users.sourceforge.net Wed Aug 1 03:36:23 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 31 Jul 2001 19:36:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.60,1.61 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv32361 Modified Files: python20.wse Log Message: Remove useless Back button from Finished dialog. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** python20.wse 2001/07/31 03:24:55 1.60 --- python20.wse 2001/08/01 02:36:21 1.61 *************** *** 2245,2259 **** end item: Push Button - Rectangle=105 187 150 202 - Variable=DISABLED - Value=! - Create Flags=01010000000000010000000000000000 - Text=< &Back - Text French=< &Retour - Text German=< &Zurück - Text Spanish=< &Atrás - Text Italian=< &Indietro - end - item: Push Button Rectangle=211 187 256 202 Variable=DISABLED --- 2245,2248 ---- *************** *** 2268,2276 **** end item: Static - Rectangle=8 180 256 181 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static Rectangle=86 8 258 42 Create Flags=01010000000000000000000000000000 --- 2257,2260 ---- *************** *** 2302,2305 **** --- 2286,2294 ---- Text Italian= Text Italian=Premere il pulsante Fine per uscire dall'installazione. + end + item: Static + Rectangle=8 180 256 181 + Action=3 + Create Flags=01010000000000000000000000000111 end end From tim_one@users.sourceforge.net Wed Aug 1 04:30:01 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 31 Jul 2001 20:30:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.61,1.62 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv8599 Modified Files: python20.wse Log Message: The "Select Destination Directory" dialog didn't ask for confirmation about installing into a pre-existing directory *unless* you hit the Browse button first. At least while testing, this screwed me repeatedly. Plus I really liked the Inno Setup scheme of giving you a list box in its "select directory" dialog without needing a distinct browse button to ask for that. So I redid this dialog from scratch: now gives a list box at once, the browse button is gone, it asks for confirmation if the directory already exists, and, since this is the first dialog in the set now, also removed its "Back" button. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** python20.wse 2001/08/01 02:36:21 1.61 --- python20.wse 2001/08/01 03:29:59 1.62 *************** *** 312,327 **** end item: Push Button - Rectangle=105 187 150 202 - Variable=DIRECTION - Value=B - Create Flags=01010000000000010000000000000000 - Flags=0000000000000001 - Text=< &Back - Text French=< &Retour - Text German=< &Zurück - Text Spanish=< &Atrás - Text Italian=< &Indietro - end - item: Push Button Rectangle=211 187 256 202 Action=3 --- 312,315 ---- *************** *** 339,343 **** end item: Static ! Rectangle=86 8 258 42 Create Flags=01010000000000000000000000000000 Flags=0000000000000001 --- 327,331 ---- end item: Static ! Rectangle=85 1 257 26 Create Flags=01010000000000000000000000000000 Flags=0000000000000001 *************** *** 350,388 **** Text Italian=Selezionare Directory di destinazione end ! item: Static ! Rectangle=86 42 256 82 ! Create Flags=01010000000000000000000000000000 ! Text=Please select the directory where the %APPTITLE% files are to be installed. ! Text French=Veuillez sélectionner le répertoire dans lequel les fichiers %APPTITLE% doivent être installés. ! Text German=Geben Sie an, in welchem Verzeichnis die %APPTITLE%-Dateien installiert werden sollen. ! Text Spanish=Por favor seleccione el directorio donde desee instalar los archivos de %APPTITLE%. ! Text Italian=Selezionare la directory dove verranno installati i file %APPTITLE%. ! end ! item: Static ! Rectangle=86 98 256 125 ! Action=1 ! Create Flags=01010000000000000000000000000111 ! end ! item: Push Button ! Rectangle=208 106 253 121 ! Variable=MAINDIR_SAVE ! Value=%MAINDIR% ! Destination Dialog=1 ! Action=2 ! Create Flags=01010000000000010000000000000000 ! Text=Browse ! Text French=Parcourir ! Text German=Durchsuchen ! Text Spanish=Buscar ! Text Italian=Sfoglie end item: Static ! Rectangle=90 109 206 120 Create Flags=01010000000000000000000000000000 ! Text=%MAINDIR% ! Text French=%MAINDIR% ! Text German=%MAINDIR% ! Text Spanish=%MAINDIR% ! Text Italian=%MAINDIR% end end --- 338,355 ---- Text Italian=Selezionare Directory di destinazione end ! item: Listbox ! Rectangle=85 38 256 178 ! Variable=MAINDIR ! Enabled Color=00000000000000001111111111111111 ! Create Flags=01010000100000010000000101000001 ! Flags=0000110000001010 ! Text=%MAINDIR% ! Text= end item: Static ! Rectangle=95 22 259 37 ! Enabled Color=00000000000000001111111111111111 Create Flags=01010000000000000000000000000000 ! Text=Please select a directory for the %APPTITLE% files. end end From tim_one@users.sourceforge.net Wed Aug 1 04:36:22 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 31 Jul 2001 20:36:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.62,1.63 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv10030 Modified Files: python20.wse Log Message: Aha! Finally figured out something else that's been driving me nuts: turns out the canned new "backup directory" dialog put its "back" and "next" buttons at a different relative horizontal position than all the other canned dialogs. This explains why you had to keep moving the mouse around if you wanted to do a straight all-default install -- the Next button kept moving around. Now the back/next buttons are in exactly the same place on all dialogs, and you can click straight thru to the end. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** python20.wse 2001/08/01 03:29:59 1.62 --- python20.wse 2001/08/01 03:36:20 1.63 *************** *** 417,421 **** Font Size=8 item: Push Button ! Rectangle=172 185 214 199 Variable=DIRECTION Value=N --- 417,421 ---- Font Size=8 item: Push Button ! Rectangle=150 185 192 199 Variable=DIRECTION Value=N *************** *** 433,437 **** end item: Push Button ! Rectangle=130 185 172 199 Variable=DIRECTION Value=B --- 433,437 ---- end item: Push Button ! Rectangle=105 185 147 199 Variable=DIRECTION Value=B From tim_one@users.sourceforge.net Wed Aug 1 04:42:29 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 31 Jul 2001 20:42:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.63,1.64 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv11129 Modified Files: python20.wse Log Message: Hmm. The Backup/Replace dialog also had back/next buttons three pixels narrower than all the other Wise dialogs, and offset by a few pixels in the vertical direction too. Made these things consistent across dialogs too. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** python20.wse 2001/08/01 03:36:20 1.63 --- python20.wse 2001/08/01 03:42:27 1.64 *************** *** 417,421 **** Font Size=8 item: Push Button ! Rectangle=150 185 192 199 Variable=DIRECTION Value=N --- 417,421 ---- Font Size=8 item: Push Button ! Rectangle=150 187 195 201 Variable=DIRECTION Value=N *************** *** 433,437 **** end item: Push Button ! Rectangle=105 185 147 199 Variable=DIRECTION Value=B --- 433,437 ---- end item: Push Button ! Rectangle=105 187 150 201 Variable=DIRECTION Value=B *************** *** 449,453 **** end item: Push Button ! Rectangle=222 185 264 199 Action=3 Create Flags=01010000000000010000000000000000 --- 449,453 ---- end item: Push Button ! Rectangle=222 187 264 201 Action=3 Create Flags=01010000000000010000000000000000 *************** *** 534,538 **** item: Static Control Name=BACK2 ! Rectangle=90 134 260 162 Action=1 Create Flags=01010000000000000000000000000111 --- 534,538 ---- item: Static Control Name=BACK2 ! Rectangle=90 138 260 166 Action=1 Create Flags=01010000000000000000000000000111 *************** *** 569,573 **** item: Static Control Name=BACK4 ! Rectangle=95 146 211 157 Destination Dialog=2 Create Flags=01010000000000000000000000000000 --- 569,573 ---- item: Static Control Name=BACK4 ! Rectangle=95 150 211 161 Destination Dialog=2 Create Flags=01010000000000000000000000000000 From gvanrossum@users.sourceforge.net Wed Aug 1 04:56:42 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 31 Jul 2001 20:56:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.16.8.72,2.16.8.73 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13600 Modified Files: Tag: descr-branch typeobject.c Log Message: Rip out again the 'x in type' support. Further newsgroup discussion showed it was confusing. E.g. people tried "if x in [int, long]: ...". Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.16.8.72 retrieving revision 2.16.8.73 diff -C2 -d -r2.16.8.72 -r2.16.8.73 *** typeobject.c 2001/07/31 16:50:17 2.16.8.72 --- typeobject.c 2001/08/01 03:56:39 2.16.8.73 *************** *** 783,806 **** }; - static int - type_contains(PyObject *type, PyObject *obj) - { - assert(PyType_Check(type)); - return PyType_IsSubtype(obj->ob_type, (PyTypeObject *)type); - } - - static PySequenceMethods type_as_seq = { - 0, /* sq_length */ - 0, /* sq_concat */ - 0, /* sq_repeat */ - 0, /* sq_item */ - 0, /* sq_slice */ - 0, /* sq_ass_item */ - 0, /* sq_ass_slice */ - type_contains, /* sq_contains */ - 0, /* sq_inplace_concat */ - 0, /* sq_inplace_repeat */ - }; - static char type_doc[] = "type(object) -> the object's type\n" --- 783,786 ---- *************** *** 820,824 **** (reprfunc)type_repr, /* tp_repr */ 0, /* tp_as_number */ ! &type_as_seq, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)_Py_HashPointer, /* tp_hash */ --- 800,804 ---- (reprfunc)type_repr, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)_Py_HashPointer, /* tp_hash */ From tim_one@users.sourceforge.net Wed Aug 1 07:29:58 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 31 Jul 2001 23:29:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.64,1.65 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv5517 Modified Files: python20.wse Log Message: We always wrote a pair of lines to the Wise install.log telling it to delete the Tools and Lib directories at uninstall time. However, under the old version of Wise, they didn't actually do anything. Under the new version, they work as advertised, and even delete files users added. Got rid of those, and replaced them with similar uninstall cmds that get rid of all .pyc and .pyo files (whether or not the installer created them). This works nicely! It still tears down the directory structure, except for those directories needed to get to any non-.pyc/o file(s) the user may have added. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** python20.wse 2001/08/01 03:42:27 1.64 --- python20.wse 2001/08/01 06:29:56 1.65 *************** *** 1190,1193 **** --- 1190,1198 ---- item: End Block end + item: Remark + end + item: Remark + Text=Install the license even if they deselect everything . + end item: Install File Source=..\license *************** *** 1208,1211 **** --- 1213,1230 ---- end item: Remark + Text=These arrange to (recursively!) delete all .pyc and .pyo files at uninstall time. + end + item: Remark + Text=This "does the right thing": any directories left empty at the end are removed. + end + item: Add Text to INSTALL.LOG + Text=File Tree: %MAINDIR%\*.pyc + end + item: Add Text to INSTALL.LOG + Text=File Tree: %MAINDIR%\*.pyo + end + item: Remark + end + item: Remark Text=A: interpreter, libraries and Tcl/Tk end *************** *** 1430,1441 **** Text=Libraries (Lib/) end - item: Remark - Text=Remove entire Lib directory at uninstall time. - end - item: Add Text to INSTALL.LOG - Text=File Tree: %MAINDIR%\Lib\*.* - end - item: Remark - end item: Install File Source=..\lib\*.py --- 1449,1452 ---- *************** *** 1608,1619 **** Value=C Flags=00001010 - end - item: Remark - Text=Delete entire Tools directory at uninstall time. - end - item: Add Text to INSTALL.LOG - Text=File Tree: %MAINDIR%\Tools\*.* - end - item: Remark end item: Install File --- 1619,1622 ---- From gvanrossum@users.sourceforge.net Wed Aug 1 17:03:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 01 Aug 2001 09:03:17 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0238.txt,1.13,1.14 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv11317 Modified Files: pep-0238.txt Log Message: Add question about timing of 3.0. Index: pep-0238.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0238.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** pep-0238.txt 2001/07/29 23:05:12 1.13 --- pep-0238.txt 2001/08/01 16:03:14 1.14 *************** *** 376,379 **** --- 376,391 ---- FAQ + Q. When will Python 3.0 be released? + + A. We don't plan that long ahead, so we can't say for sure. We + want to allow at least two years for the transition. If Python + 3.0 comes out sooner, we'll keep the 2.x line alive for + backwards compatibility until at least two years from the + release of Python 2.2. In practice, you will be able to + continue to use the Python 2.x line for several years after + Python 3.0 is released, so you can take your time with the + transition. Sites are expected to have both Python 2.x and + Python 3.x installed simultaneously. + Q. Why isn't true division called float division? From gvanrossum@users.sourceforge.net Wed Aug 1 17:48:30 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 01 Aug 2001 09:48:30 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0237.txt,1.5,1.6 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv21608 Modified Files: pep-0237.txt Log Message: Lots of updates, more rationale, explicit transition plan. Index: pep-0237.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0237.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0237.txt 2001/07/29 09:48:51 1.5 --- pep-0237.txt 2001/08/01 16:48:28 1.6 *************** *** 28,69 **** Having the machine word size exposed to the language hinders portability. For examples Python source files and .pyc's are not ! portable because of this. Many programs find a need to deal with ! larger numbers after the fact, and changing the algorithms later ! is not only bothersome, but hinders performance in the normal ! case. ! Literals - A trailing 'L' at the end of an integer literal will stop having - any meaning, and will be eventually phased out. This will be done - using warnings when encountering such literals. The warning will - be off by default in Python 2.2, on for 12 months, which will - probably mean Python 2.3 and 2.4, and then will no longer be - supported. ! Builtin Functions ! The function long() will call the function int(), issuing a ! warning. The warning will be off in 2.2, and on for two revisions ! before removing the function. A FAQ will be added to explain that ! a solutions for old modules are: ! long=int ! at the top of the module, or: ! import __builtin__ ! __builtin__.long=int ! In site.py. C API ! All PyLong_As* will call PyInt_As*. If PyInt_As* does not exist, ! it will be added. Similarly for PyLong_From*. A similar path of ! warnings as for the Python builtins will be followed. --- 28,130 ---- Having the machine word size exposed to the language hinders portability. For examples Python source files and .pyc's are not ! portable between 32-bit and 64-bit machines because of this. Many ! programs find a need to deal with larger numbers after the fact, ! and changing the algorithms later is not only bothersome, but ! hinders performance in the normal case. + There is also the general desire to hide unnecessary details from + the Python user when they are irrelevant for most applications. + (Another example is memory allocation, which explicit in C but + automatic in Python, giving us the convenience of unlimited sizes + on strings, lists, etc.) ! It will give new Python programmers (whether they are new to ! programming in general or not) one less thing to learn before they ! can start using the language. + Transition ! There are three phases of the transition: ! 1. Ints and longs are treated the same, no warnings are issued for ! code that uses longs. Warnings for the use of longs (either ! long literals, ending in 'L' or 'l', or use of the long() ! function) may be enabled through a command line option. ! 2. Longs are treated the same as ints but their use triggers a ! warning (which may be turned off or turned into an error using ! the -W command line option). ! 3. Long literals and (if we choose implementation plan 1 below) ! the long() built-in are no longer legal. ! We propose the following timeline: ! 1. Python 2.2. + 2. The rest of the Python 2.x line. + + 3. Python 3.0 (at least two years in the future). + + Implementation + + There are two alternative implementations to choose from. + + 1. The PyInt type's slot for a C long will be turned into a + + union { + long i; + struct { + unsigned long length; + digit digits[1]; + } bignum; + }; + + Only the n-1 lower bits of the long have any meaning; the top bit + is always set. This distinguishes the union. All PyInt functions + will check this bit before deciding which types of operations to + use. + + 2. The existing short and long int types remain, but the short int + returns a long int instead of raising OverflowError when a + result cannot be represented as a short int. A new type, + integer, may be introduced that is an abstract base type of + which both the int and long implementation types are + subclassed. This is useful so that programs can check + integer-ness with a single test: + + if isinstance(i, integer): ... + + + Literals + + A trailing 'L' at the end of an integer literal will stop having + any meaning, and will be eventually phased out. + + + Built-in Functions + + The function long() will call the function int(). If + implementation plan 1 is chosen, it will eventually be phased out; + with implementation plan 2, it remains in the language to + represent the long implementation type -- but the int() function + is still recommended, since it will automatically return a long + when needed. + + C API ! If implementation plan 1 is chosen, all PyLong_As* will call ! PyInt_As*. If PyInt_As* does not exist, it will be added. ! Similarly for PyLong_From*. A similar path of warnings as for the ! Python built-ins will be followed. ! ! If implementation plan 2 is chosen, the C API remains unchanged. ! ! (The PyArg_Parse*() APIs already accept long ints, as long as they ! are within the range representable by C ints or longs. This will ! remain unchanged.) *************** *** 76,82 **** aid, and has no guaranteed semantics. ! Semantic Differences The following operations have (usually subtly) different semantics for short and for long integers, and one will have to change --- 137,152 ---- aid, and has no guaranteed semantics. + A command line option may be used to enable these warnings (the + regular warning framework supports warnings that are off by + default, but this is be too slow -- it makes a call to an + complex piece of Python code). ! This warning is not part of the transition plan; it will always be ! off by default, and the feature will probably disappear in Python ! 3.0. ! + Semantic Changes + The following operations have (usually subtly) different semantics for short and for long integers, and one will have to change *************** *** 92,96 **** - Currently, hex and oct literals for for short ints may specify negative values; for example 0xffffffff == -1 on a 32-bint ! machine. No more; this will equal 2**32-1. - Currently, repr() of a long int returns a string ending in 'L' --- 162,174 ---- - Currently, hex and oct literals for for short ints may specify negative values; for example 0xffffffff == -1 on a 32-bint ! machine. No more; this will equal 0xffffffffL which is 2**32-1. ! ! - Currently, the '%u', '%x' and '%o' string formatting operators ! and the hex() and oct() built-in functions behave differently ! for negative numbers: negative short ints are formatted as ! unsigned C long, while negative long ints are formatted with a ! minus sign. The long int semantics will rule (but without the ! trailing 'L' that currently distinguishes the output of hex() ! and oct() for long ints). - Currently, repr() of a long int returns a string ending in 'L' *************** *** 98,129 **** - Currently, an operation with long operands will never return a ! short int. This may change. - Currently, type(x) may reveal the difference between short and ! long ints. This may or may not change (see Implementation ! below). ! ! ! Implementation ! ! There are two alternative implementations to choose from. ! ! 1. The PyInt type's slot for a C long will be turned into a ! ! union { ! long i; ! struct { ! unsigned long length; ! digit digits[1]; ! } bignum; ! }; ! ! Only the n-1 lower bits of the long have any meaning; the top bit ! is always set. This distinguishes the union. All PyInt functions ! will check this bit before deciding which types of operations to ! use. ! ! 2. The existing short and long int types remain, but the short int ! returns a long int instead of raising OverflowError. --- 176,184 ---- - Currently, an operation with long operands will never return a ! short int. This may change (it allows an optimization). This ! is only relevant if implementation plan 2 is chosen. - Currently, type(x) may reveal the difference between short and ! long ints. This will change if implementation plan 1 is chosen. *************** *** 133,154 **** from PyFixNum and PyBigNum. Open Issues ! What to do about sys.maxint? ! What to do about PyInt_AS_LONG failures? ! What do do about %u, %o, %x formatting operators? ! How to warn about << not cutting integers? ! Should the overflow warning be on a portable maximum size? ! Will unification of types and classes help with a more straightforward ! implementations? ! Define an C API that can be used to find out what the representation of an ! int is. --- 188,225 ---- from PyFixNum and PyBigNum. + (Question for the Jython developers -- do you foresee any other + problems?) + Open Issues ! We expect that these issues will be resolved over time, as more ! feedback is received or we gather more experience with the initial ! implementation. ! - Which implementation plan to choose? Moshe is for plan 1, Guido ! is for plan 2. Plan 2 seems less work. Plan 1 probably breaks ! more at the C API level, e.g. PyInt_AS_LONG below. ! - What to do about sys.maxint? (If implementation plan 1 is ! chosen, it should probably be phased out; for plan 2, it is ! still meaningful.) ! - What to do about PyInt_AS_LONG failures? (Only relevant with ! implementation plan 1.) ! - What do do about %u, %o, %x formatting operators? ! - Should we warn about << not cutting integers? ! - Should the overflow warning be on a portable maximum size? ! ! - Will unification of types and classes help with a more ! straightforward implementation? (Yes, it allows a common base ! class.) ! ! - Define an C API that can be used to find out what the ! representation of an int is (only relevant for implementation ! plan 1). From fdrake@users.sourceforge.net Wed Aug 1 17:50:51 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 01 Aug 2001 09:50:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libarray.tex,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv22224/lib Modified Files: libarray.tex Log Message: Fix description of buffer_info(), and add a note that there is a better way... This closes SF bug #444842. Index: libarray.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libarray.tex,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** libarray.tex 2001/07/06 19:28:48 1.29 --- libarray.tex 2001/08/01 16:50:49 1.30 *************** *** 69,78 **** \begin{methoddesc}[array]{buffer_info}{} Return a tuple \code{(\var{address}, \var{length})} giving the current ! memory address and the length in bytes of the buffer used to hold ! array's contents. This is occasionally useful when working with low-level (and inherently unsafe) I/O interfaces that require memory ! addresses, such as certain \cfunction{ioctl()} operations. The returned ! numbers are valid as long as the array exists and no length-changing ! operations are applied to it. \end{methoddesc} --- 69,87 ---- \begin{methoddesc}[array]{buffer_info}{} Return a tuple \code{(\var{address}, \var{length})} giving the current ! memory address and the length in elements of the buffer used to hold ! array's contents. The size of the memory buffer in bytes can be ! computed as \code{\var{array}.buffer_info()[1] * ! \var{array}.itemsize}. This is occasionally useful when working with low-level (and inherently unsafe) I/O interfaces that require memory ! addresses, such as certain \cfunction{ioctl()} operations. The ! returned numbers are valid as long as the array exists and no ! length-changing operations are applied to it. ! ! \strong{Note:} When using array objects from code written in C or ! \Cpp{} (the only way to effectively make use of this information), it ! makes more sense to use the buffer interface supported by array ! objects. This method is maintained for backward compatibility and ! should be avoided in new code. The buffer interface is documented in ! the \citetitle[../api/newTypes.html]{Python/C API Reference Manual}. \end{methoddesc} *************** *** 175,179 **** an array with the same type and value using reverse quotes (\code{``}), so long as the \function{array()} function has been ! imported using \samp{from array import array}. Examples: \begin{verbatim} --- 184,188 ---- an array with the same type and value using reverse quotes (\code{``}), so long as the \function{array()} function has been ! imported using \code{from array import array}. Examples: \begin{verbatim} From fdrake@users.sourceforge.net Wed Aug 1 17:56:53 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 01 Aug 2001 09:56:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.64,1.65 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv23579/lib Modified Files: libre.tex Log Message: Added an example of a string value for the replacement parameter to re.sub(). This closes SF bug #446136. Fixed description of RE modifiers so that RE{#} and RE{#,} are more clearly described and disambiguated (plain RE{#} had not been described at all). Reported by Jeremy Craven via email. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** libre.tex 2001/07/23 21:14:59 1.64 --- libre.tex 2001/08/01 16:56:51 1.65 *************** *** 129,137 **** in the previous expression will match only \code{'

'}. \item[\code{\{\var{m},\var{n}\}}] Causes the resulting RE to match from \var{m} to \var{n} repetitions of the preceding RE, attempting to match as many repetitions as possible. For example, \regexp{a\{3,5\}} will match from 3 to 5 \character{a} characters. Omitting \var{n} ! specifies an infinite upper bound; you can't omit \var{m}. \item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to --- 129,145 ---- in the previous expression will match only \code{'

'}. + \item[\code{\{\var{m}\}}] + Specifies that exactly \var{m} copies of the previous RE should be + matched; fewer matches cause the entire RE not to match. For example, + \regexp{a\{6\}} will match exactly six \character{a} characters, but + not five. + \item[\code{\{\var{m},\var{n}\}}] Causes the resulting RE to match from \var{m} to \var{n} repetitions of the preceding RE, attempting to match as many repetitions as possible. For example, \regexp{a\{3,5\}} will match from 3 to 5 \character{a} characters. Omitting \var{n} ! specifies an infinite upper bound; you can't omit \var{m}. The comma ! may not be omitted or the modifier would be confused with the ! previously described form. \item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to *************** *** 498,516 **** \begin{funcdesc}{findall}{pattern, string} ! Return a list of all non-overlapping matches of \var{pattern} in ! \var{string}. If one or more groups are present in the pattern, ! return a list of groups; this will be a list of tuples if the pattern ! has more than one group. Empty matches are included in the result. ! \versionadded{1.5.2} \end{funcdesc} ! \begin{funcdesc}{sub}{pattern, repl, string\optional{, count\code{ = 0}}} ! Return the string obtained by replacing the leftmost non-overlapping ! occurrences of \var{pattern} in \var{string} by the replacement ! \var{repl}. If the pattern isn't found, \var{string} is returned ! unchanged. \var{repl} can be a string or a function; if a function, ! it is called for every non-overlapping occurrence of \var{pattern}. ! The function takes a single match object argument, and returns the ! replacement string. For example: \begin{verbatim} --- 506,539 ---- \begin{funcdesc}{findall}{pattern, string} ! Return a list of all non-overlapping matches of \var{pattern} in ! \var{string}. If one or more groups are present in the pattern, ! return a list of groups; this will be a list of tuples if the ! pattern has more than one group. Empty matches are included in the ! result. ! \versionadded{1.5.2} \end{funcdesc} ! \begin{funcdesc}{sub}{pattern, repl, string\optional{, count}} ! Return the string obtained by replacing the leftmost non-overlapping ! occurrences of \var{pattern} in \var{string} by the replacement ! \var{repl}. If the pattern isn't found, \var{string} is returned ! unchanged. \var{repl} can be a string or a function; if it is a ! string, any backslash escapes in it are processed. That is, ! \samp{\e n} is converted to a single newline character, \samp{\e r} ! is converted to a linefeed, and so forth. Unknown escapes such as ! \samp{\e j} are left alone. Backreferences, such as \samp{\e6}, are ! replaced with the substring matched by group 6 in the pattern. For ! example: ! ! \begin{verbatim} ! >>> re.sub(r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', ! ... r'static PyObject*\npy_\1(void)\n{', ! ... 'def myfunc():') ! 'static PyObject*\npy_myfunc(void)\n{' ! \end{verbatim} ! ! If \var{repl} is a function, it is called for every non-overlapping ! occurrence of \var{pattern}. The function takes a single match ! object argument, and returns the replacement string. For example: \begin{verbatim} *************** *** 522,557 **** \end{verbatim} ! The pattern may be a string or an RE object; if you need to specify ! regular expression flags, you must use a RE object, or use ! embedded modifiers in a pattern; for example, ! \samp{sub("(?i)b+", "x", "bbbb BBBB")} returns \code{'x x'}. ! ! The optional argument \var{count} is the maximum number of pattern ! occurrences to be replaced; \var{count} must be a non-negative ! integer, and the default value of 0 means to replace all occurrences. ! ! Empty matches for the pattern are replaced only when not adjacent to a ! previous match, so \samp{sub('x*', '-', 'abc')} returns ! \code{'-a-b-c-'}. ! If \var{repl} is a string, any backslash escapes in it are processed. ! That is, \samp{\e n} is converted to a single newline character, ! \samp{\e r} is converted to a linefeed, and so forth. Unknown escapes ! such as \samp{\e j} are left alone. Backreferences, such as \samp{\e ! 6}, are replaced with the substring matched by group 6 in the pattern. ! In addition to character escapes and backreferences as described ! above, \samp{\e g} will use the substring matched by the group ! named \samp{name}, as defined by the \regexp{(?P...)} syntax. ! \samp{\e g} uses the corresponding group number; \samp{\e ! g<2>} is therefore equivalent to \samp{\e 2}, but isn't ambiguous in a ! replacement such as \samp{\e g<2>0}. \samp{\e 20} would be ! interpreted as a reference to group 20, not a reference to group 2 ! followed by the literal character \character{0}. \end{funcdesc} ! \begin{funcdesc}{subn}{pattern, repl, string\optional{, count\code{ = 0}}} ! Perform the same operation as \function{sub()}, but return a tuple ! \code{(\var{new_string}, \var{number_of_subs_made})}. \end{funcdesc} --- 545,573 ---- \end{verbatim} ! The pattern may be a string or an RE object; if you need to specify ! regular expression flags, you must use a RE object, or use embedded ! modifiers in a pattern; for example, \samp{sub("(?i)b+", "x", "bbbb ! BBBB")} returns \code{'x x'}. ! The optional argument \var{count} is the maximum number of pattern ! occurrences to be replaced; \var{count} must be a non-negative ! integer. If omitted or zero, all occurrences will be replaced. ! Empty matches for the pattern are replaced only when not adjacent to ! a previous match, so \samp{sub('x*', '-', 'abc')} returns ! \code{'-a-b-c-'}. ! In addition to character escapes and backreferences as described ! above, \samp{\e g} will use the substring matched by the group ! named \samp{name}, as defined by the \regexp{(?P...)} syntax. ! \samp{\e g} uses the corresponding group number; ! \samp{\e g<2>} is therefore equivalent to \samp{\e 2}, but isn't ! ambiguous in a replacement such as \samp{\e g<2>0}. \samp{\e 20} ! would be interpreted as a reference to group 20, not a reference to ! group 2 followed by the literal character \character{0}. \end{funcdesc} ! \begin{funcdesc}{subn}{pattern, repl, string\optional{, count}} ! Perform the same operation as \function{sub()}, but return a tuple ! \code{(\var{new_string}, \var{number_of_subs_made})}. \end{funcdesc} From fdrake@users.sourceforge.net Wed Aug 1 18:17:16 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 01 Aug 2001 10:17:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/tut tut.tex,1.145,1.146 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv28224/tut Modified Files: tut.tex Log Message: Minor re-wording in the exaplantion of sequence comparisons. This closes SF bug #445749. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** tut.tex 2001/07/18 19:21:12 1.145 --- tut.tex 2001/08/01 17:17:13 1.146 *************** *** 2040,2046 **** items of two sequences compare equal, the sequences are considered equal. If one sequence is an initial sub-sequence of the other, the ! shorter sequence is the smaller one. Lexicographical ordering for ! strings uses the \ASCII{} ordering for individual characters. Some ! examples of comparisons between sequences with the same types: \begin{verbatim} --- 2040,2047 ---- items of two sequences compare equal, the sequences are considered equal. If one sequence is an initial sub-sequence of the other, the ! shorter sequence is the smaller (lesser) one. Lexicographical ! ordering for strings uses the \ASCII{} ordering for individual ! characters. Some examples of comparisons between sequences with the ! same types: \begin{verbatim} From fdrake@users.sourceforge.net Wed Aug 1 18:19:13 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 01 Aug 2001 10:19:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc ACKS,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv28754 Modified Files: ACKS Log Message: Added more names. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ACKS 2001/07/14 03:09:29 1.22 --- ACKS 2001/08/01 17:19:11 1.23 *************** *** 40,43 **** --- 40,44 ---- Steve Clift Matthew Cowles + Jeremy Craven Andrew Dalke Ben Darnell *************** *** 133,136 **** --- 134,138 ---- Sean Reifschneider Bernhard Reiter + Armin Rigo Wes Rishel Jim Roskind From gvanrossum@users.sourceforge.net Wed Aug 1 19:17:25 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 01 Aug 2001 11:17:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib binhex.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv9585 Modified Files: binhex.py Log Message: Turn an octal constant into a hex constant. Index: binhex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/binhex.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** binhex.py 2001/02/10 00:06:00 1.20 --- binhex.py 2001/08/01 18:17:23 1.21 *************** *** 93,97 **** data = open(name).read(256) for c in data: ! if not c.isspace() and (c<' ' or ord(c) > 0177): break else: --- 93,97 ---- data = open(name).read(256) for c in data: ! if not c.isspace() and (c<' ' or ord(c) > 0x7f): break else: From gvanrossum@users.sourceforge.net Wed Aug 1 19:25:53 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 01 Aug 2001 11:25:53 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0260.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv11477 Modified Files: pep-0260.txt Log Message: Add a Transition section. Index: pep-0260.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0260.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0260.txt 2001/07/05 14:50:56 1.2 --- pep-0260.txt 2001/08/01 18:25:51 1.3 *************** *** 66,69 **** --- 66,77 ---- + Transition + + For backwards compatibility, the existing functionality will still + be present in Python 2.2, but will trigger a warning. A year + after Python 2.2 final is released (probably in 2.4) the + functionality will be ripped out. + + Copyright From tim_one@users.sourceforge.net Wed Aug 1 19:33:35 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 11:33:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.65,1.66 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv13234 Modified Files: python20.wse Log Message: Repair more ways in which the "backup files" dialog differed from all the others (wrong title, inconsistent layout). Also tried to make the dialog text clearer, and spelled out what the "yes" and "no" buttons *mean*. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** python20.wse 2001/08/01 06:29:56 1.65 --- python20.wse 2001/08/01 18:33:33 1.66 *************** *** 327,331 **** end item: Static ! Rectangle=85 1 257 26 Create Flags=01010000000000000000000000000000 Flags=0000000000000001 --- 327,331 ---- end item: Static ! Rectangle=86 9 258 34 Create Flags=01010000000000000000000000000000 Flags=0000000000000001 *************** *** 339,343 **** end item: Listbox ! Rectangle=85 38 256 178 Variable=MAINDIR Enabled Color=00000000000000001111111111111111 --- 339,343 ---- end item: Listbox ! Rectangle=86 50 257 175 Variable=MAINDIR Enabled Color=00000000000000001111111111111111 *************** *** 348,352 **** end item: Static ! Rectangle=95 22 259 37 Enabled Color=00000000000000001111111111111111 Create Flags=01010000000000000000000000000000 --- 348,352 ---- end item: Static ! Rectangle=86 34 250 49 Enabled Color=00000000000000001111111111111111 Create Flags=01010000000000000000000000000000 *************** *** 402,406 **** Display Variable=DISPLAY item: Dialog ! Title=Backup Replaced Files Title French=Fichiers de Sauvegarde Remplacés Title German=Sicherungskopie von ersetzten Dateien erstellen --- 402,406 ---- Display Variable=DISPLAY item: Dialog ! Title=%APPTITLE% Installation Title French=Fichiers de Sauvegarde Remplacés Title German=Sicherungskopie von ersetzten Dateien erstellen *************** *** 469,475 **** end item: Static ! Rectangle=90 10 260 74 Create Flags=01010000000000000000000000000000 ! Text=This installation program can create backup copies of all files replaced during the installation. These files will be used when the software is uninstalled and a rollback is requested. If backup copies are not created, you will only be able to uninstall the software and not roll the system back to a previous state. Do you want to create backups of the replaced files? Text French=Le programme d'installation peut créer des copies de sauvegarde de tous les fichiers remplacés pendant l'installation. Ces fichiers sont utilisés au cas où le logiciel est désinstallé et que l'on procède à la reprise du système. Si les copies de sauvegarde ne sont pas créées, on ne pourra que désinstaller le logiciel sans reprendre le système à un état précédent. Voulez-vous créer une sauvegarde des fichiers remplacés ? Text German=Dieses Installationsprogramm kann Sicherungskopien von allen während der Installation ersetzten Dateien erstellen. Diese Dateien werden zur Rückgängigmachung der Installation und bei Anforderung eines Rollbacks verwendet. Ohne Sicherungskopien ist nur eine Rückgängigmachung der Installation möglich, nicht aber ein Rollback des Systems. Sicherungskopien der ersetzten Dateien erstellen? --- 469,477 ---- end item: Static ! Rectangle=86 37 256 101 Create Flags=01010000000000000000000000000000 ! Text=This installation program can create backup copies of all files replaced during the installation. These files will be used when the software is uninstalled and a rollback is requested. If backup copies are not created, you will only be able to uninstall the software and not roll the system back to a previous state. ! Text= ! Text=Do you want to create backups of replaced files? Text French=Le programme d'installation peut créer des copies de sauvegarde de tous les fichiers remplacés pendant l'installation. Ces fichiers sont utilisés au cas où le logiciel est désinstallé et que l'on procède à la reprise du système. Si les copies de sauvegarde ne sont pas créées, on ne pourra que désinstaller le logiciel sans reprendre le système à un état précédent. Voulez-vous créer une sauvegarde des fichiers remplacés ? Text German=Dieses Installationsprogramm kann Sicherungskopien von allen während der Installation ersetzten Dateien erstellen. Diese Dateien werden zur Rückgängigmachung der Installation und bei Anforderung eines Rollbacks verwendet. Ohne Sicherungskopien ist nur eine Rückgängigmachung der Installation möglich, nicht aber ein Rollback des Systems. Sicherungskopien der ersetzten Dateien erstellen? *************** *** 483,491 **** end item: Radio Button ! Rectangle=155 74 182 100 Variable=DOBACKUP Create Flags=01010000000000010000000000001001 ! Text=&Yes ! Text=N&o Text= Text French=&Oui --- 485,493 ---- end item: Radio Button ! Rectangle=113 100 212 126 Variable=DOBACKUP Create Flags=01010000000000010000000000001001 ! Text=&Yes (make backups) ! Text=N&o (do not make backups) Text= Text French=&Oui *************** *** 518,538 **** end item: Static - Control Name=BACK1 - Rectangle=90 106 260 132 - Create Flags=01010000000000000000000000000000 - Text=Please select the directory where the replaced files will be copied. - Text French=Veuillez sélectionner le répertoire où les fichiers remplacés doivent être copiés - Text German=Bitte wählen Sie das Verzeichnis, in das die ersetzten Dateien kopiert werden sollen. - Text Portuguese=É favor seleccionar o directório para onde os ficheiros substituídos serão copiados. - Text Spanish=Seleccione el directorio donde se copiarán los archivos reemplazados. - Text Italian=Seleziona la directory in cui saranno copiati i file sostituiti. - Text Danish=Vælg biblioteket, som de erstattede filer skal kopieres til. - Text Dutch=Selecteer de directory waarnaar de vervangen bestanden moeten worden gekopieerd. - Text Norwegian=Velg katalogen de erstattede filene skal kopieres til. - Text Swedish=Välj katalog dit du vill kopiera de ersatta filerna. - end - item: Static Control Name=BACK2 ! Rectangle=90 138 260 166 Action=1 Create Flags=01010000000000000000000000000111 --- 520,525 ---- end item: Static Control Name=BACK2 ! Rectangle=86 138 256 166 Action=1 Create Flags=01010000000000000000000000000111 *************** *** 550,554 **** item: Push Button Control Name=BACK3 ! Rectangle=213 143 255 157 Variable=BACKUP_SAVE Value=%BACKUP% --- 537,541 ---- item: Push Button Control Name=BACK3 ! Rectangle=212 148 254 162 Variable=BACKUP_SAVE Value=%BACKUP% *************** *** 569,573 **** item: Static Control Name=BACK4 ! Rectangle=95 150 211 161 Destination Dialog=2 Create Flags=01010000000000000000000000000000 --- 556,560 ---- item: Static Control Name=BACK4 ! Rectangle=103 150 203 160 Destination Dialog=2 Create Flags=01010000000000000000000000000000 *************** *** 583,586 **** --- 570,585 ---- Text Swedish=%BACKUP% end + item: Static + Rectangle=86 9 258 29 + Create Flags=01010000000000000000000000000000 + Flags=0000000000000001 + Name=Times New Roman + Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18 + Text=Backup Replaced Files + Text French=Sélectionner les composants + Text German=Komponenten auswählen + Text Spanish=Seleccione componentes + Text Italian=Selezionare i componenti + end item: If/While Statement Variable=DOBACKUP *************** *** 743,747 **** end item: Checkbox ! Rectangle=86 66 256 138 Variable=COMPONENTS Create Flags=01010000000000010000000000000011 --- 742,746 ---- end item: Checkbox ! Rectangle=86 62 256 134 Variable=COMPONENTS Create Flags=01010000000000010000000000000011 *************** *** 813,817 **** end item: Static ! Rectangle=86 42 256 61 Create Flags=01010000000000000000000000000000 Text=Choose which components to install by checking the boxes below. --- 812,816 ---- end item: Static ! Rectangle=86 38 256 57 Create Flags=01010000000000000000000000000000 Text=Choose which components to install by checking the boxes below. From gvanrossum@users.sourceforge.net Wed Aug 1 19:34:01 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 01 Aug 2001 11:34:01 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.111,1.112 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv13529 Modified Files: pep-0000.txt Log Message: Reorganized the classifications, splitting Active into Accepted and Open. There are now: Meta-PEPs (PEPs about PEPs or Process) Other Informational PEPs Accepted PEPs (accepted for Python 2.2; may not be implemented yet) Open PEPs (under consideration for Python 2.2) Py-in-the-sky PEPs (not considered for Python 2.2) Finished PEPs (done, implemented in CVS) Empty PEPs (or containing only an abstract) Deferred, Abandoned, and Rejected PEPs Moved some of the original Active to Finished, some to Py-in-the-sky. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** pep-0000.txt 2001/07/29 09:50:01 1.111 --- pep-0000.txt 2001/08/01 18:33:59 1.112 *************** *** 39,86 **** I 249 pep-0249.txt Python Database API Specification v2.0 Lemburg ! Active PEPs (under consideration for Python 2.2) - I 42 pep-0042.txt Small Feature Requests Hylton - S 211 pep-0211.txt Adding A New Outer Product Operator Wilson - S 218 pep-0218.txt Adding a Built-In Set Object Type Wilson - S 234 pep-0234.txt Iterators Yee, van Rossum - S 237 pep-0237.txt Unifying Long Integers and Integers Zadka, van Rossum S 238 pep-0238.txt Changing the Division Operator Zadka, van Rossum - S 239 pep-0239.txt Adding a Rational Type to Python Zadka - S 240 pep-0240.txt Adding a Rational Literal to Python Zadka - S 241 pep-0241.txt Metadata for Python Software Packages Kuchling - S 242 pep-0242.txt Numeric Kinds Dubois - S 243 pep-0243.txt Module Repository Upload Mechanism Reifschneider - S 244 pep-0244.txt The `directive' Statement von Loewis - S 245 pep-0245.txt Python Interface Syntax Pelletier - S 246 pep-0246.txt Object Adaptation Evans S 250 pep-0250.txt Using site-packages on All Platforms Moore I 251 pep-0251.txt Python 2.2 Release Schedule van Rossum S 252 pep-0252.txt Making Types Look More Like Classes van Rossum S 253 pep-0253.txt Subtyping Built-in Types van Rossum S 254 pep-0254.txt Making Classes Look More Like Types van Rossum - S 255 pep-0255.txt Simple Generators Schemenauer, et al S 256 pep-0256.txt Docstring Processing System Framework Goodger S 257 pep-0257.txt Docstring Conventions Goodger, van Rossum S 258 pep-0258.txt DPS Generic Implementation Details Goodger - S 260 pep-0260.txt Simplify xrange() van Rossum - S 261 pep-0261.txt Support for "wide" Unicode characters Prescod S 262 pep-0262.txt Database of Installed Python Packages Kuchling S 263 pep-0263.txt Defining Python Source Code Encodings Lemburg ! Py-in-the-sky PEPs (not ready; may become active yet) I 206 pep-0206.txt 2.0 Batteries Included Zadka S 209 pep-0209.txt Adding Multidimensional Arrays Barrett, Oliphant SD 212 pep-0212.txt Loop Counter Iteration Schneider-Kamp SD 213 pep-0213.txt Attribute Access Handlers Prescod S 215 pep-0215.txt String Interpolation Yee I 216 pep-0216.txt Docstring Format Zadka SD 219 pep-0219.txt Stackless Python McMillan S 222 pep-0222.txt Web Library Enhancements Kuchling SD 225 pep-0225.txt Elementwise/Objectwise Operators Zhu, Lielens S 228 pep-0228.txt Reworking Python's Numeric Model Zadka, van Rossum ! Finished PEPs (done, implemented) SF 100 pep-0100.txt Python Unicode Integration Lemburg --- 39,85 ---- I 249 pep-0249.txt Python Database API Specification v2.0 Lemburg ! Accepted PEPs (accepted for Python 2.2; may not be implemented yet) S 238 pep-0238.txt Changing the Division Operator Zadka, van Rossum S 250 pep-0250.txt Using site-packages on All Platforms Moore I 251 pep-0251.txt Python 2.2 Release Schedule van Rossum S 252 pep-0252.txt Making Types Look More Like Classes van Rossum S 253 pep-0253.txt Subtyping Built-in Types van Rossum + + Open PEPs (under consideration for Python 2.2) + + I 42 pep-0042.txt Small Feature Requests Hylton + S 237 pep-0237.txt Unifying Long Integers and Integers Zadka, van Rossum + S 241 pep-0241.txt Metadata for Python Software Packages Kuchling + S 243 pep-0243.txt Module Repository Upload Mechanism Reifschneider + S 244 pep-0244.txt The `directive' Statement von Loewis S 254 pep-0254.txt Making Classes Look More Like Types van Rossum S 256 pep-0256.txt Docstring Processing System Framework Goodger S 257 pep-0257.txt Docstring Conventions Goodger, van Rossum S 258 pep-0258.txt DPS Generic Implementation Details Goodger S 262 pep-0262.txt Database of Installed Python Packages Kuchling S 263 pep-0263.txt Defining Python Source Code Encodings Lemburg ! Py-in-the-sky PEPs (not considered for Python 2.2) I 206 pep-0206.txt 2.0 Batteries Included Zadka S 209 pep-0209.txt Adding Multidimensional Arrays Barrett, Oliphant + S 211 pep-0211.txt Adding A New Outer Product Operator Wilson SD 212 pep-0212.txt Loop Counter Iteration Schneider-Kamp SD 213 pep-0213.txt Attribute Access Handlers Prescod S 215 pep-0215.txt String Interpolation Yee I 216 pep-0216.txt Docstring Format Zadka + S 218 pep-0218.txt Adding a Built-In Set Object Type Wilson SD 219 pep-0219.txt Stackless Python McMillan S 222 pep-0222.txt Web Library Enhancements Kuchling SD 225 pep-0225.txt Elementwise/Objectwise Operators Zhu, Lielens S 228 pep-0228.txt Reworking Python's Numeric Model Zadka, van Rossum + S 239 pep-0239.txt Adding a Rational Type to Python Zadka + S 240 pep-0240.txt Adding a Rational Literal to Python Zadka + S 242 pep-0242.txt Numeric Kinds Dubois + S 245 pep-0245.txt Python Interface Syntax Pelletier + S 246 pep-0246.txt Object Adaptation Evans ! Finished PEPs (done, implemented in CVS) SF 100 pep-0100.txt Python Unicode Integration Lemburg *************** *** 102,107 **** --- 101,110 ---- SF 230 pep-0230.txt Warning Framework van Rossum SF 232 pep-0232.txt Function Attributes Warsaw + S 234 pep-0234.txt Iterators Yee, van Rossum SF 235 pep-0235.txt Import on Case-Insensitive Platforms Peters SF 236 pep-0236.txt Back to the __future__ Peters + S 255 pep-0255.txt Simple Generators Schemenauer, et al + S 260 pep-0260.txt Simplify xrange() van Rossum + S 261 pep-0261.txt Support for "wide" Unicode characters Prescod Empty PEPs (or containing only an abstract) From tim_one@users.sourceforge.net Wed Aug 1 19:42:56 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 11:42:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild Uninstal.wse,1.2,1.3 python20.wse,1.66,1.67 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv15523 Modified Files: Uninstal.wse python20.wse Log Message: Just changes to comments. Index: Uninstal.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/Uninstal.wse,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Uninstal.wse 2001/07/31 03:24:55 1.2 --- Uninstal.wse 2001/08/01 18:42:54 1.3 *************** *** 29,35 **** end item: Remark - Text=Hmm! Also changed it to use the 32-bit uninstaller! - end - item: Remark end item: Remark --- 29,32 ---- Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** python20.wse 2001/08/01 18:33:33 1.66 --- python20.wse 2001/08/01 18:42:54 1.67 *************** *** 73,76 **** --- 73,79 ---- end item: Remark + Text= The APPTITLE setting above. + end + item: Remark Text= The "Title:" in the upper left corner of the GUI. end From gvanrossum@users.sourceforge.net Wed Aug 1 19:43:37 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 01 Aug 2001 11:43:37 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0213.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv15699 Modified Files: pep-0213.txt Log Message: Add a note explaining how PEP 252 enables a different solution. Index: pep-0213.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0213.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pep-0213.txt 2000/08/23 05:47:12 1.4 --- pep-0213.txt 2001/08/01 18:43:34 1.5 *************** *** 26,30 **** Justification ! Scenario 1: You have a deployed class that works on an attribute named --- 26,30 ---- Justification ! cenario 1: You have a deployed class that works on an attribute named *************** *** 209,212 **** --- 209,229 ---- Once again, the solution is to use a special (typically private) variable such as __XXX. + + + Note + + The descriptor mechanism described in PEP 252 is powerful enough + to support this more directly. A 'getset' constructor may be + added to the language making this possible: + + class C: + def get_x(self): + return self.__x + def set_x(self, v): + self.__x = v + x = getset(get_x, set_x) + + Additional syntactic sugar might be added, or a naming convention + could be recognized. From tim_one@users.sourceforge.net Wed Aug 1 20:38:58 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 12:38:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_import.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv28319/python/dist/src/Lib/test Modified Files: test_import.py Log Message: Rewritten version of Finn Bock's SF patch #446907 (Allow jython to complete test_import). Index: test_import.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_import.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_import.py 2001/05/08 15:19:57 1.4 --- test_import.py 2001/08/01 19:38:56 1.5 *************** *** 20,25 **** source = TESTFN + ".py" - pyc = TESTFN + ".pyc" pyo = TESTFN + ".pyo" f = open(source, "w") --- 20,28 ---- source = TESTFN + ".py" pyo = TESTFN + ".pyo" + if sys.platform.endswith('java'): + pyc = TESTFN + "$py.class" + else: + pyc = TESTFN + ".pyc" f = open(source, "w") From jhylton@users.sourceforge.net Wed Aug 1 21:11:58 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 01 Aug 2001 13:11:58 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.112,1.113 pep-0001.txt,1.21,1.22 pep-0042.txt,1.51,1.52 pep-0200.txt,1.47,1.48 pep-0226.txt,1.11,1.12 pep-0236.txt,1.8,1.9 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv2996 Modified Files: pep-0000.txt pep-0001.txt pep-0042.txt pep-0200.txt pep-0226.txt pep-0236.txt Log Message: Update email address Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** pep-0000.txt 2001/08/01 18:33:59 1.112 --- pep-0000.txt 2001/08/01 20:11:56 1.113 *************** *** 228,232 **** Evans, Clark C. cce@clarkevans.com Goodger, David dgoodger@bigfoot.com ! Hylton, Jeremy jeremy@digicool.com Kuchling, Andrew akuchlin@mems-exchange.org Lemburg, Marc-Andre mal@lemburg.com --- 228,232 ---- Evans, Clark C. cce@clarkevans.com Goodger, David dgoodger@bigfoot.com ! Hylton, Jeremy jeremy@zope.com Kuchling, Andrew akuchlin@mems-exchange.org Lemburg, Marc-Andre mal@lemburg.com Index: pep-0001.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0001.txt,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** pep-0001.txt 2001/07/05 18:52:25 1.21 --- pep-0001.txt 2001/08/01 20:11:56 1.22 *************** *** 3,7 **** Version: $Revision$ Author: barry@digicool.com (Barry A. Warsaw), ! jeremy@digicool.com (Jeremy Hylton) Status: Active Type: Informational --- 3,7 ---- Version: $Revision$ Author: barry@digicool.com (Barry A. Warsaw), ! jeremy@zope.com (Jeremy Hylton) Status: Active Type: Informational Index: pep-0042.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0042.txt,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** pep-0042.txt 2001/06/04 18:50:40 1.51 --- pep-0042.txt 2001/08/01 20:11:56 1.52 *************** *** 2,6 **** Title: Feature Requests Version: $Revision$ ! Author: Jeremy Hylton Status: Active Type: Informational --- 2,6 ---- Title: Feature Requests Version: $Revision$ ! Author: Jeremy Hylton Status: Active Type: Informational Index: pep-0200.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0200.txt,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** pep-0200.txt 2000/11/28 22:23:25 1.47 --- pep-0200.txt 2001/08/01 20:11:56 1.48 *************** *** 2,6 **** Title: Python 2.0 Release Schedule Version: $Revision$ ! Author: Jeremy Hylton Python-Version: 2.0 Status: Final --- 2,6 ---- Title: Python 2.0 Release Schedule Version: $Revision$ ! Author: Jeremy Hylton Python-Version: 2.0 Status: Final Index: pep-0226.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0226.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pep-0226.txt 2001/04/18 08:23:01 1.11 --- pep-0226.txt 2001/08/01 20:11:56 1.12 *************** *** 2,6 **** Title: Python 2.1 Release Schedule Version: $Revision$ ! Author: Jeremy Hylton Status: Incomplete Type: Informational --- 2,6 ---- Title: Python 2.1 Release Schedule Version: $Revision$ ! Author: Jeremy Hylton Status: Incomplete Type: Informational Index: pep-0236.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0236.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pep-0236.txt 2001/07/05 19:08:50 1.8 --- pep-0236.txt 2001/08/01 20:11:56 1.9 *************** *** 270,273 **** --- 270,274 ---- own interactive shells to achieve the desired behavior. + XXX interactive shell and -i; interactive shell and -c Questions and Answers From tim_one@users.sourceforge.net Wed Aug 1 21:23:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 13:23:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_import.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv5985/python/dist/src/Lib/test Modified Files: test_import.py Log Message: s/endswith/startswith/ Index: test_import.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_import.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_import.py 2001/08/01 19:38:56 1.5 --- test_import.py 2001/08/01 20:23:18 1.6 *************** *** 21,25 **** source = TESTFN + ".py" pyo = TESTFN + ".pyo" ! if sys.platform.endswith('java'): pyc = TESTFN + "$py.class" else: --- 21,25 ---- source = TESTFN + ".py" pyo = TESTFN + ".pyo" ! if sys.platform.startswith('java'): pyc = TESTFN + "$py.class" else: From gvanrossum@users.sourceforge.net Wed Aug 1 21:30:56 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 01 Aug 2001 13:30:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects descrobject.c,1.1.2.15,1.1.2.16 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv7831 Modified Files: Tag: descr-branch descrobject.c Log Message: Support the __doc__ attribute of wrappers. SF bug ##446874. Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/Attic/descrobject.c,v retrieving revision 1.1.2.15 retrieving revision 1.1.2.16 diff -C2 -d -r1.1.2.15 -r1.1.2.16 *** descrobject.c 2001/07/09 18:47:12 1.1.2.15 --- descrobject.c 2001/08/01 20:30:53 1.1.2.16 *************** *** 312,315 **** --- 312,330 ---- }; + static PyObject * + wrapper_get_doc(PyWrapperDescrObject *descr, void *closure) + { + if (descr->d_base->doc == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + return PyString_FromString(descr->d_base->doc); + } + + static struct getsetlist wrapper_getset[] = { + {"__doc__", (getter)wrapper_get_doc}, + {0} + }; + static PyTypeObject PyMethodDescr_Type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 457,461 **** 0, /* tp_methods */ descr_members, /* tp_members */ ! 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ --- 472,476 ---- 0, /* tp_methods */ descr_members, /* tp_members */ ! wrapper_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ From gvanrossum@users.sourceforge.net Wed Aug 1 22:01:11 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 01 Aug 2001 14:01:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.16.8.73,2.16.8.74 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv15261 Modified Files: Tag: descr-branch typeobject.c Log Message: Clarify the wrapper doc strings for __init__() and next(). SF bug #446874. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.16.8.73 retrieving revision 2.16.8.74 diff -C2 -d -r2.16.8.73 -r2.16.8.74 *** typeobject.c 2001/08/01 03:56:39 2.16.8.73 --- typeobject.c 2001/08/01 21:01:09 2.16.8.74 *************** *** 1753,1757 **** static struct wrapperbase tab_next[] = { {"next", (wrapperfunc)wrap_next, ! "x.next() -> get the next value, or raise StopIteration"}, {0} }; --- 1753,1757 ---- static struct wrapperbase tab_next[] = { {"next", (wrapperfunc)wrap_next, ! "x.next() -> the next value, or raise StopIteration"}, {0} }; *************** *** 1813,1817 **** static struct wrapperbase tab_init[] = { {"__init__", (wrapperfunc)wrap_init, ! "x.__init__() -> initialize object"}, {0} }; --- 1813,1818 ---- static struct wrapperbase tab_init[] = { {"__init__", (wrapperfunc)wrap_init, ! "x.__init__(...) initializes x; " ! "see x.__type__.__doc__ for signature"}, {0} }; From fdrake@users.sourceforge.net Wed Aug 1 22:42:47 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 01 Aug 2001 14:42:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libreadline.tex,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv26396/lib Modified Files: libreadline.tex Log Message: Cleaned up the description of readline.set_completer(). Thanks to Nathaniel Gray for reporting the confusion. Index: libreadline.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libreadline.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** libreadline.tex 2000/10/10 17:03:45 1.5 --- libreadline.tex 2001/08/01 21:42:45 1.6 *************** *** 56,63 **** \begin{funcdesc}{set_completer}{\optional{function}} ! Set or remove the completer function. The completer function is ! called as \code{\var{function}(\var{text}, \var{state})}, ! \code{for i in [0, 1, 2, ...]} until it returns a non-string. ! It should return the next possible completion starting with \var{text}. \end{funcdesc} --- 56,66 ---- \begin{funcdesc}{set_completer}{\optional{function}} ! Set or remove the completer function. If \var{function} is specified, ! it will be used as the new completer function; if omitted or ! \code{None}, any completer function already installed is removed. The ! completer function is called as \code{\var{function}(\var{text}, ! \var{state})}, for \var{state} in \code{0}, \code{1}, \code{2}, ..., ! until it returns a non-string value. It should return the next ! possible completion starting with \var{text}. \end{funcdesc} From fdrake@users.sourceforge.net Wed Aug 1 22:44:16 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 01 Aug 2001 14:44:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules readline.c,2.36,2.37 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv26820/Modules Modified Files: readline.c Log Message: Cleaned up the docstring for readline.set_completer(). Thanks to Nathaniel Gray for reporting the confusion. Index: readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -d -r2.36 -r2.37 *** readline.c 2001/07/10 16:45:32 2.36 --- readline.c 2001/08/01 21:44:14 2.37 *************** *** 267,271 **** Set or remove the completer function.\n\ The function is called as function(text, state),\n\ ! for i in [0, 1, 2, ...] until it returns a non-string.\n\ It should return the next possible completion starting with 'text'.\ "; --- 267,271 ---- Set or remove the completer function.\n\ The function is called as function(text, state),\n\ ! for state in 0, 1, 2, ..., until it returns a non-string.\n\ It should return the next possible completion starting with 'text'.\ "; From tim_one@users.sourceforge.net Thu Aug 2 01:41:49 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 17:41:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_generators.py,1.17.2.5,1.17.2.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv31330/Lib/test Modified Files: Tag: descr-branch test_generators.py Log Message: Recover from change in next.__doc__. Index: test_generators.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_generators.py,v retrieving revision 1.17.2.5 retrieving revision 1.17.2.6 diff -C2 -d -r1.17.2.5 -r1.17.2.6 *** test_generators.py 2001/07/16 21:39:41 1.17.2.5 --- test_generators.py 2001/08/02 00:41:47 1.17.2.6 *************** *** 390,394 **** >>> print i.next.__doc__ ! x.next() -> get the next value, or raise StopIteration >>> iter(i) is i 1 --- 390,394 ---- >>> print i.next.__doc__ ! x.next() -> the next value, or raise StopIteration >>> iter(i) is i 1 From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-aix3 regen,1.1,1.1.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-aix3 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-aix3 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-aix3/regen,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -C2 -d -r1.1 -r1.1.12.1 *** regen 1996/08/08 18:24:48 1.1 --- regen 2001/08/02 02:40:42 1.1.12.1 *************** *** 6,11 **** esac set -v - h2py.py /usr/include/fcntl.h - h2py.py /usr/include/sys/socket.h h2py.py -i '(u_long)' /usr/include/netinet/in.h - h2py.py /usr/include/termios.h --- 6,8 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.37.2.4,1.37.2.5 PLAN.txt,1.1.2.38,1.1.2.39 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src Modified Files: Tag: descr-branch Makefile.pre.in PLAN.txt Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.37.2.4 retrieving revision 1.37.2.5 diff -C2 -d -r1.37.2.4 -r1.37.2.5 *** Makefile.pre.in 2001/07/28 05:02:57 1.37.2.4 --- Makefile.pre.in 2001/08/02 02:40:42 1.37.2.5 *************** *** 215,218 **** --- 215,219 ---- Python/modsupport.o \ Python/mystrtoul.o \ + Python/mysnprintf.o \ Python/pyfpe.o \ Python/pystate.o \ Index: PLAN.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Attic/PLAN.txt,v retrieving revision 1.1.2.38 retrieving revision 1.1.2.39 diff -C2 -d -r1.1.2.38 -r1.1.2.39 *** PLAN.txt 2001/07/30 04:08:14 1.1.2.38 --- PLAN.txt 2001/08/02 02:40:42 1.1.2.39 *************** *** 268,271 **** --- 268,285 ---- he dies of frustration while wrestling with CVS <0.9 wink>). ---------------------------------------------------------------------------- + 2001-08-01 Merging descr-branch back into trunk. + + Tagged trunk about 22:05: + cvs tag date2001-08-01 python + + Merged trunk delta into branch: + + cvs -q -z3 up -j date2001-07-30 -j date2001-08-01 descr + + No conflicts (! first time ever!) ... but problems with pythoncore.dsp. + Resolved. + + Rebuilt from scratch; ran all tests; checked into branch about 22:40. + ---------------------------------------------------------------------------- 2001-07-30 From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc ACKS,1.22,1.22.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Doc Modified Files: Tag: descr-branch ACKS Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.22 retrieving revision 1.22.2.1 diff -C2 -d -r1.22 -r1.22.2.1 *** ACKS 2001/07/14 03:09:29 1.22 --- ACKS 2001/08/02 02:40:42 1.22.2.1 *************** *** 40,43 **** --- 40,44 ---- Steve Clift Matthew Cowles + Jeremy Craven Andrew Dalke Ben Darnell *************** *** 133,136 **** --- 134,138 ---- Sean Reifschneider Bernhard Reiter + Armin Rigo Wes Rishel Jim Roskind From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-aix4 regen,1.1,1.1.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-aix4 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-aix4 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-aix4/regen,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -C2 -d -r1.1 -r1.1.12.1 *** regen 1996/08/08 18:24:58 1.1 --- regen 2001/08/02 02:40:42 1.1.12.1 *************** *** 6,11 **** esac set -v - h2py.py /usr/include/fcntl.h - h2py.py /usr/include/sys/socket.h h2py.py -i '(u_long)' /usr/include/netinet/in.h - h2py.py /usr/include/termios.h --- 6,8 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/tut tut.tex,1.144.2.1,1.144.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Doc/tut Modified Files: Tag: descr-branch tut.tex Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.144.2.1 retrieving revision 1.144.2.2 diff -C2 -d -r1.144.2.1 -r1.144.2.2 *** tut.tex 2001/07/21 06:07:12 1.144.2.1 --- tut.tex 2001/08/02 02:40:42 1.144.2.2 *************** *** 2040,2046 **** items of two sequences compare equal, the sequences are considered equal. If one sequence is an initial sub-sequence of the other, the ! shorter sequence is the smaller one. Lexicographical ordering for ! strings uses the \ASCII{} ordering for individual characters. Some ! examples of comparisons between sequences with the same types: \begin{verbatim} --- 2040,2047 ---- items of two sequences compare equal, the sequences are considered equal. If one sequence is an initial sub-sequence of the other, the ! shorter sequence is the smaller (lesser) one. Lexicographical ! ordering for strings uses the \ASCII{} ordering for individual ! characters. Some examples of comparisons between sequences with the ! same types: \begin{verbatim} From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-freebsd3 regen,1.1,1.1.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-freebsd3 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-freebsd3 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-freebsd3/regen,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -C2 -d -r1.1 -r1.1.12.1 *** regen 1998/05/06 15:14:36 1.1 --- regen 2001/08/02 02:40:42 1.1.12.1 *************** *** 1,6 **** #! /bin/sh set -v - h2py /usr/include/sys/fcntl.h - h2py /usr/include/sys/socket.h h2py -i '(u_long)' /usr/include/netinet/in.h ! h2py /usr/include/termios.h --- 1,4 ---- #! /bin/sh set -v h2py -i '(u_long)' /usr/include/netinet/in.h ! From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-freebsd2 regen,1.2,1.2.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-freebsd2 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-freebsd2 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-freebsd2/regen,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -C2 -d -r1.2 -r1.2.12.1 *** regen 1998/05/06 15:13:38 1.2 --- regen 2001/08/02 02:40:42 1.2.12.1 *************** *** 1,6 **** #! /bin/sh set -v - h2py /usr/include/sys/fcntl.h - h2py /usr/include/sys/socket.h h2py -i '(u_long)' /usr/include/netinet/in.h - h2py /usr/include/termios.h --- 1,3 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-freebsd4 regen,1.1,1.1.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-freebsd4 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-freebsd4 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-freebsd4/regen,v retrieving revision 1.1 retrieving revision 1.1.8.1 diff -C2 -d -r1.1 -r1.1.8.1 *** regen 2000/08/31 02:42:09 1.1 --- regen 2001/08/02 02:40:42 1.1.8.1 *************** *** 1,6 **** #! /bin/sh set -v - python ../../Tools/scripts/h2py.py /usr/include/fcntl.h - python ../../Tools/scripts/h2py.py /usr/include/sys/socket.h python ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h - python ../../Tools/scripts/h2py.py /usr/include/termios.h --- 1,3 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib binhex.py,1.20,1.20.6.1 codecs.py,1.16.6.1,1.16.6.2 ftplib.py,1.53.4.1,1.53.4.2 httplib.py,1.34.4.2,1.34.4.3 poplib.py,1.14.6.1,1.14.6.2 pstats.py,1.15.4.2,1.15.4.3 smtplib.py,1.36.6.1,1.36.6.2 sndhdr.py,1.6,1.6.6.1 telnetlib.py,1.11.6.1,1.11.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib Modified Files: Tag: descr-branch binhex.py codecs.py ftplib.py httplib.py poplib.py pstats.py smtplib.py sndhdr.py telnetlib.py Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: binhex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/binhex.py,v retrieving revision 1.20 retrieving revision 1.20.6.1 diff -C2 -d -r1.20 -r1.20.6.1 *** binhex.py 2001/02/10 00:06:00 1.20 --- binhex.py 2001/08/02 02:40:42 1.20.6.1 *************** *** 93,97 **** data = open(name).read(256) for c in data: ! if not c.isspace() and (c<' ' or ord(c) > 0177): break else: --- 93,97 ---- data = open(name).read(256) for c in data: ! if not c.isspace() and (c<' ' or ord(c) > 0x7f): break else: Index: codecs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/codecs.py,v retrieving revision 1.16.6.1 retrieving revision 1.16.6.2 diff -C2 -d -r1.16.6.1 -r1.16.6.2 *** codecs.py 2001/07/06 07:01:30 1.16.6.1 --- codecs.py 2001/08/02 02:40:42 1.16.6.2 *************** *** 576,579 **** --- 576,585 ---- return m + # Tell modulefinder that using codecs probably needs the encodings + # package + _false = 0 + if _false: + import encodings + ### Tests Index: ftplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ftplib.py,v retrieving revision 1.53.4.1 retrieving revision 1.53.4.2 diff -C2 -d -r1.53.4.1 -r1.53.4.2 *** ftplib.py 2001/07/28 05:02:58 1.53.4.1 --- ftplib.py 2001/08/02 02:40:42 1.53.4.2 *************** *** 116,119 **** --- 116,120 ---- if port: self.port = port self.passiveserver = 0 + msg = "getaddrinfo returns an empty list" for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res *************** *** 271,274 **** --- 272,276 ---- def makeport(self): '''Create a new socket and send a PORT command for it.''' + msg = "getaddrinfo returns an empty list" for res in socket.getaddrinfo(None, 0, self.af, socket.SOCK_STREAM, 0, socket.AI_PASSIVE): af, socktype, proto, canonname, sa = res Index: httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v retrieving revision 1.34.4.2 retrieving revision 1.34.4.3 diff -C2 -d -r1.34.4.2 -r1.34.4.3 *** httplib.py 2001/07/28 05:02:58 1.34.4.2 --- httplib.py 2001/08/02 02:40:42 1.34.4.3 *************** *** 358,361 **** --- 358,362 ---- def connect(self): """Connect to the host and port specified in __init__.""" + msg = "getaddrinfo returns an empty list" for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res Index: poplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/poplib.py,v retrieving revision 1.14.6.1 retrieving revision 1.14.6.2 diff -C2 -d -r1.14.6.1 -r1.14.6.2 *** poplib.py 2001/07/28 05:02:58 1.14.6.1 --- poplib.py 2001/08/02 02:40:42 1.14.6.2 *************** *** 76,79 **** --- 76,80 ---- self.host = host self.port = port + msg = "getaddrinfo returns an empty list" for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res Index: pstats.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pstats.py,v retrieving revision 1.15.4.2 retrieving revision 1.15.4.3 diff -C2 -d -r1.15.4.2 -r1.15.4.3 *** pstats.py 2001/07/30 04:08:14 1.15.4.2 --- pstats.py 2001/08/02 02:40:42 1.15.4.3 *************** *** 641,644 **** --- 641,646 ---- print "Sort profile data according to specified keys." print "(Typing `sort' without arguments lists valid keys.)" + def complete_sort(self, text, *args): + return [a for a in Stats.sort_arg_dict_default.keys() if a.startswith(text)] def do_stats(self, line): Index: smtplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v retrieving revision 1.36.6.1 retrieving revision 1.36.6.2 diff -C2 -d -r1.36.6.1 -r1.36.6.2 *** smtplib.py 2001/07/28 05:02:59 1.36.6.1 --- smtplib.py 2001/08/02 02:40:42 1.36.6.2 *************** *** 218,221 **** --- 218,222 ---- if not port: port = SMTP_PORT if self.debuglevel > 0: print 'connect:', (host, port) + msg = "getaddrinfo returns an empty list" for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res Index: sndhdr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sndhdr.py,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** sndhdr.py 2001/02/15 22:15:13 1.6 --- sndhdr.py 2001/08/02 02:40:42 1.6.6.1 *************** *** 41,45 **** def whathdr(filename): """Recognize sound headers""" ! f = open(filename, 'r') h = f.read(512) for tf in tests: --- 41,45 ---- def whathdr(filename): """Recognize sound headers""" ! f = open(filename, 'rb') h = f.read(512) for tf in tests: Index: telnetlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/telnetlib.py,v retrieving revision 1.11.6.1 retrieving revision 1.11.6.2 diff -C2 -d -r1.11.6.1 -r1.11.6.2 *** telnetlib.py 2001/07/28 05:02:59 1.11.6.1 --- telnetlib.py 2001/08/02 02:40:42 1.11.6.2 *************** *** 137,140 **** --- 137,141 ---- self.host = host self.port = port + msg = "getaddrinfo returns an empty list" for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include pyerrors.h,2.45,2.45.2.1 unicodeobject.h,2.20.2.1,2.20.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Include Modified Files: Tag: descr-branch pyerrors.h unicodeobject.h Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: pyerrors.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyerrors.h,v retrieving revision 2.45 retrieving revision 2.45.2.1 diff -C2 -d -r2.45 -r2.45.2.1 *** pyerrors.h 2001/04/20 19:13:01 2.45 --- pyerrors.h 2001/08/02 02:40:42 2.45.2.1 *************** *** 107,110 **** --- 107,134 ---- extern DL_IMPORT(PyObject *) PyErr_ProgramText(char *, int); + /* These APIs aren't really part of the error implementation, but + often needed to format error messages; the native C lib APIs are + not available on all platforms, which is why we provide emulations + for those platforms in Python/mysnprintf.c */ + #if defined(MS_WIN32) && !defined(HAVE_SNPRINTF) + # define HAVE_SNPRINTF + # define snprintf _snprintf + # define vsnprintf _vsnprintf + #endif + + /* Always enable the fallback solution during the 2.2.0 alpha cycle + for enhanced testing */ + #if PY_VERSION_HEX < 0x020200B0 + # undef HAVE_SNPRINTF + #endif + + #ifndef HAVE_SNPRINTF + #include + extern DL_IMPORT(int) PyOS_snprintf(char *str, size_t size, const char *format, ...); + extern DL_IMPORT(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va); + #else + # define PyOS_vsnprintf vsnprintf + # define PyOS_snprintf snprintf + #endif #ifdef __cplusplus Index: unicodeobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v retrieving revision 2.20.2.1 retrieving revision 2.20.2.2 diff -C2 -d -r2.20.2.1 -r2.20.2.2 *** unicodeobject.h 2001/07/07 22:55:27 2.20.2.1 --- unicodeobject.h 2001/08/02 02:40:42 2.20.2.2 *************** *** 130,133 **** --- 130,283 ---- typedef PY_UNICODE_TYPE Py_UNICODE; + /* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */ + + /* Unicode API names are mangled to assure that UCS-2 and UCS-4 builds + produce different external names and thus cause import errors in + case Python interpreters and extensions with mixed compiled in + Unicode width assumptions are combined. */ + + #ifndef Py_UNICODE_WIDE + + # define PyUnicode_AsASCIIString PyUnicodeUCS2_AsASCIIString + # define PyUnicode_AsCharmapString PyUnicodeUCS2_AsCharmapString + # define PyUnicode_AsEncodedString PyUnicodeUCS2_AsEncodedString + # define PyUnicode_AsLatin1String PyUnicodeUCS2_AsLatin1String + # define PyUnicode_AsRawUnicodeEscapeString PyUnicodeUCS2_AsRawUnicodeEscapeString + # define PyUnicode_AsUTF16String PyUnicodeUCS2_AsUTF16String + # define PyUnicode_AsUTF8String PyUnicodeUCS2_AsUTF8String + # define PyUnicode_AsUnicode PyUnicodeUCS2_AsUnicode + # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS2_AsUnicodeEscapeString + # define PyUnicode_AsWideChar PyUnicodeUCS2_AsWideChar + # define PyUnicode_Compare PyUnicodeUCS2_Compare + # define PyUnicode_Concat PyUnicodeUCS2_Concat + # define PyUnicode_Contains PyUnicodeUCS2_Contains + # define PyUnicode_Count PyUnicodeUCS2_Count + # define PyUnicode_Decode PyUnicodeUCS2_Decode + # define PyUnicode_DecodeASCII PyUnicodeUCS2_DecodeASCII + # define PyUnicode_DecodeCharmap PyUnicodeUCS2_DecodeCharmap + # define PyUnicode_DecodeLatin1 PyUnicodeUCS2_DecodeLatin1 + # define PyUnicode_DecodeRawUnicodeEscape PyUnicodeUCS2_DecodeRawUnicodeEscape + # define PyUnicode_DecodeUTF16 PyUnicodeUCS2_DecodeUTF16 + # define PyUnicode_DecodeUTF8 PyUnicodeUCS2_DecodeUTF8 + # define PyUnicode_DecodeUnicodeEscape PyUnicodeUCS2_DecodeUnicodeEscape + # define PyUnicode_Encode PyUnicodeUCS2_Encode + # define PyUnicode_EncodeASCII PyUnicodeUCS2_EncodeASCII + # define PyUnicode_EncodeCharmap PyUnicodeUCS2_EncodeCharmap + # define PyUnicode_EncodeDecimal PyUnicodeUCS2_EncodeDecimal + # define PyUnicode_EncodeLatin1 PyUnicodeUCS2_EncodeLatin1 + # define PyUnicode_EncodeRawUnicodeEscape PyUnicodeUCS2_EncodeRawUnicodeEscape + # define PyUnicode_EncodeUTF16 PyUnicodeUCS2_EncodeUTF16 + # define PyUnicode_EncodeUTF8 PyUnicodeUCS2_EncodeUTF8 + # define PyUnicode_EncodeUnicodeEscape PyUnicodeUCS2_EncodeUnicodeEscape + # define PyUnicode_Find PyUnicodeUCS2_Find + # define PyUnicode_Format PyUnicodeUCS2_Format + # define PyUnicode_FromEncodedObject PyUnicodeUCS2_FromEncodedObject + # define PyUnicode_FromObject PyUnicodeUCS2_FromObject + # define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode + # define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar + # define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding + # define PyUnicode_GetMax PyUnicodeUCS2_GetMax + # define PyUnicode_GetSize PyUnicodeUCS2_GetSize + # define PyUnicode_Join PyUnicodeUCS2_Join + # define PyUnicode_Replace PyUnicodeUCS2_Replace + # define PyUnicode_Resize PyUnicodeUCS2_Resize + # define PyUnicode_SetDefaultEncoding PyUnicodeUCS2_SetDefaultEncoding + # define PyUnicode_Split PyUnicodeUCS2_Split + # define PyUnicode_Splitlines PyUnicodeUCS2_Splitlines + # define PyUnicode_Tailmatch PyUnicodeUCS2_Tailmatch + # define PyUnicode_Translate PyUnicodeUCS2_Translate + # define PyUnicode_TranslateCharmap PyUnicodeUCS2_TranslateCharmap + # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString + # define _PyUnicode_Fini _PyUnicodeUCS2_Fini + # define _PyUnicode_Init _PyUnicodeUCS2_Init + # define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha + # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit + # define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit + # define _PyUnicode_IsLinebreak _PyUnicodeUCS2_IsLinebreak + # define _PyUnicode_IsLowercase _PyUnicodeUCS2_IsLowercase + # define _PyUnicode_IsNumeric _PyUnicodeUCS2_IsNumeric + # define _PyUnicode_IsTitlecase _PyUnicodeUCS2_IsTitlecase + # define _PyUnicode_IsUppercase _PyUnicodeUCS2_IsUppercase + # define _PyUnicode_IsWhitespace _PyUnicodeUCS2_IsWhitespace + # define _PyUnicode_ToDecimalDigit _PyUnicodeUCS2_ToDecimalDigit + # define _PyUnicode_ToDigit _PyUnicodeUCS2_ToDigit + # define _PyUnicode_ToLowercase _PyUnicodeUCS2_ToLowercase + # define _PyUnicode_ToNumeric _PyUnicodeUCS2_ToNumeric + # define _PyUnicode_ToTitlecase _PyUnicodeUCS2_ToTitlecase + # define _PyUnicode_ToUppercase _PyUnicodeUCS2_ToUppercase + + #else + + # define PyUnicode_AsASCIIString PyUnicodeUCS4_AsASCIIString + # define PyUnicode_AsCharmapString PyUnicodeUCS4_AsCharmapString + # define PyUnicode_AsEncodedString PyUnicodeUCS4_AsEncodedString + # define PyUnicode_AsLatin1String PyUnicodeUCS4_AsLatin1String + # define PyUnicode_AsRawUnicodeEscapeString PyUnicodeUCS4_AsRawUnicodeEscapeString + # define PyUnicode_AsUTF16String PyUnicodeUCS4_AsUTF16String + # define PyUnicode_AsUTF8String PyUnicodeUCS4_AsUTF8String + # define PyUnicode_AsUnicode PyUnicodeUCS4_AsUnicode + # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS4_AsUnicodeEscapeString + # define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar + # define PyUnicode_Compare PyUnicodeUCS4_Compare + # define PyUnicode_Concat PyUnicodeUCS4_Concat + # define PyUnicode_Contains PyUnicodeUCS4_Contains + # define PyUnicode_Count PyUnicodeUCS4_Count + # define PyUnicode_Decode PyUnicodeUCS4_Decode + # define PyUnicode_DecodeASCII PyUnicodeUCS4_DecodeASCII + # define PyUnicode_DecodeCharmap PyUnicodeUCS4_DecodeCharmap + # define PyUnicode_DecodeLatin1 PyUnicodeUCS4_DecodeLatin1 + # define PyUnicode_DecodeRawUnicodeEscape PyUnicodeUCS4_DecodeRawUnicodeEscape + # define PyUnicode_DecodeUTF16 PyUnicodeUCS4_DecodeUTF16 + # define PyUnicode_DecodeUTF8 PyUnicodeUCS4_DecodeUTF8 + # define PyUnicode_DecodeUnicodeEscape PyUnicodeUCS4_DecodeUnicodeEscape + # define PyUnicode_Encode PyUnicodeUCS4_Encode + # define PyUnicode_EncodeASCII PyUnicodeUCS4_EncodeASCII + # define PyUnicode_EncodeCharmap PyUnicodeUCS4_EncodeCharmap + # define PyUnicode_EncodeDecimal PyUnicodeUCS4_EncodeDecimal + # define PyUnicode_EncodeLatin1 PyUnicodeUCS4_EncodeLatin1 + # define PyUnicode_EncodeRawUnicodeEscape PyUnicodeUCS4_EncodeRawUnicodeEscape + # define PyUnicode_EncodeUTF16 PyUnicodeUCS4_EncodeUTF16 + # define PyUnicode_EncodeUTF8 PyUnicodeUCS4_EncodeUTF8 + # define PyUnicode_EncodeUnicodeEscape PyUnicodeUCS4_EncodeUnicodeEscape + # define PyUnicode_Find PyUnicodeUCS4_Find + # define PyUnicode_Format PyUnicodeUCS4_Format + # define PyUnicode_FromEncodedObject PyUnicodeUCS4_FromEncodedObject + # define PyUnicode_FromObject PyUnicodeUCS4_FromObject + # define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode + # define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar + # define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding + # define PyUnicode_GetMax PyUnicodeUCS4_GetMax + # define PyUnicode_GetSize PyUnicodeUCS4_GetSize + # define PyUnicode_Join PyUnicodeUCS4_Join + # define PyUnicode_Replace PyUnicodeUCS4_Replace + # define PyUnicode_Resize PyUnicodeUCS4_Resize + # define PyUnicode_SetDefaultEncoding PyUnicodeUCS4_SetDefaultEncoding + # define PyUnicode_Split PyUnicodeUCS4_Split + # define PyUnicode_Splitlines PyUnicodeUCS4_Splitlines + # define PyUnicode_Tailmatch PyUnicodeUCS4_Tailmatch + # define PyUnicode_Translate PyUnicodeUCS4_Translate + # define PyUnicode_TranslateCharmap PyUnicodeUCS4_TranslateCharmap + # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString + # define _PyUnicode_Fini _PyUnicodeUCS4_Fini + # define _PyUnicode_Init _PyUnicodeUCS4_Init + # define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha + # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit + # define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit + # define _PyUnicode_IsLinebreak _PyUnicodeUCS4_IsLinebreak + # define _PyUnicode_IsLowercase _PyUnicodeUCS4_IsLowercase + # define _PyUnicode_IsNumeric _PyUnicodeUCS4_IsNumeric + # define _PyUnicode_IsTitlecase _PyUnicodeUCS4_IsTitlecase + # define _PyUnicode_IsUppercase _PyUnicodeUCS4_IsUppercase + # define _PyUnicode_IsWhitespace _PyUnicodeUCS4_IsWhitespace + # define _PyUnicode_ToDecimalDigit _PyUnicodeUCS4_ToDecimalDigit + # define _PyUnicode_ToDigit _PyUnicodeUCS4_ToDigit + # define _PyUnicode_ToLowercase _PyUnicodeUCS4_ToLowercase + # define _PyUnicode_ToNumeric _PyUnicodeUCS4_ToNumeric + # define _PyUnicode_ToTitlecase _PyUnicodeUCS4_ToTitlecase + # define _PyUnicode_ToUppercase _PyUnicodeUCS4_ToUppercase + + + #endif + /* --- Internal Unicode Operations ---------------------------------------- */ *************** *** 386,389 **** --- 536,556 ---- /* --- Manage the default encoding ---------------------------------------- */ + + /* Return a Python string holding the default encoded value of the + Unicode object. + + The resulting string is cached in the Unicode object for subsequent + usage by this function. The cached version is needed to implement + the character buffer interface and will live (at least) as long as + the Unicode object itself. + + The refcount of the string is *not* incremented. + + *** Exported for internal use by the interpreter only !!! *** + + */ + + extern DL_IMPORT(PyObject *) _PyUnicode_AsDefaultEncodedString( + PyObject *, const char *); /* Returns the currently active default encoding. From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libarray.tex,1.29,1.29.2.1 libre.tex,1.63.2.1,1.63.2.2 libreadline.tex,1.5,1.5.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Doc/lib Modified Files: Tag: descr-branch libarray.tex libre.tex libreadline.tex Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: libarray.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libarray.tex,v retrieving revision 1.29 retrieving revision 1.29.2.1 diff -C2 -d -r1.29 -r1.29.2.1 *** libarray.tex 2001/07/06 19:28:48 1.29 --- libarray.tex 2001/08/02 02:40:42 1.29.2.1 *************** *** 69,78 **** \begin{methoddesc}[array]{buffer_info}{} Return a tuple \code{(\var{address}, \var{length})} giving the current ! memory address and the length in bytes of the buffer used to hold ! array's contents. This is occasionally useful when working with low-level (and inherently unsafe) I/O interfaces that require memory ! addresses, such as certain \cfunction{ioctl()} operations. The returned ! numbers are valid as long as the array exists and no length-changing ! operations are applied to it. \end{methoddesc} --- 69,87 ---- \begin{methoddesc}[array]{buffer_info}{} Return a tuple \code{(\var{address}, \var{length})} giving the current ! memory address and the length in elements of the buffer used to hold ! array's contents. The size of the memory buffer in bytes can be ! computed as \code{\var{array}.buffer_info()[1] * ! \var{array}.itemsize}. This is occasionally useful when working with low-level (and inherently unsafe) I/O interfaces that require memory ! addresses, such as certain \cfunction{ioctl()} operations. The ! returned numbers are valid as long as the array exists and no ! length-changing operations are applied to it. ! ! \strong{Note:} When using array objects from code written in C or ! \Cpp{} (the only way to effectively make use of this information), it ! makes more sense to use the buffer interface supported by array ! objects. This method is maintained for backward compatibility and ! should be avoided in new code. The buffer interface is documented in ! the \citetitle[../api/newTypes.html]{Python/C API Reference Manual}. \end{methoddesc} *************** *** 175,179 **** an array with the same type and value using reverse quotes (\code{``}), so long as the \function{array()} function has been ! imported using \samp{from array import array}. Examples: \begin{verbatim} --- 184,188 ---- an array with the same type and value using reverse quotes (\code{``}), so long as the \function{array()} function has been ! imported using \code{from array import array}. Examples: \begin{verbatim} Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.63.2.1 retrieving revision 1.63.2.2 diff -C2 -d -r1.63.2.1 -r1.63.2.2 *** libre.tex 2001/07/28 05:02:58 1.63.2.1 --- libre.tex 2001/08/02 02:40:42 1.63.2.2 *************** *** 129,137 **** in the previous expression will match only \code{'

'}. \item[\code{\{\var{m},\var{n}\}}] Causes the resulting RE to match from \var{m} to \var{n} repetitions of the preceding RE, attempting to match as many repetitions as possible. For example, \regexp{a\{3,5\}} will match from 3 to 5 \character{a} characters. Omitting \var{n} ! specifies an infinite upper bound; you can't omit \var{m}. \item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to --- 129,145 ---- in the previous expression will match only \code{'

'}. + \item[\code{\{\var{m}\}}] + Specifies that exactly \var{m} copies of the previous RE should be + matched; fewer matches cause the entire RE not to match. For example, + \regexp{a\{6\}} will match exactly six \character{a} characters, but + not five. + \item[\code{\{\var{m},\var{n}\}}] Causes the resulting RE to match from \var{m} to \var{n} repetitions of the preceding RE, attempting to match as many repetitions as possible. For example, \regexp{a\{3,5\}} will match from 3 to 5 \character{a} characters. Omitting \var{n} ! specifies an infinite upper bound; you can't omit \var{m}. The comma ! may not be omitted or the modifier would be confused with the ! previously described form. \item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to *************** *** 498,516 **** \begin{funcdesc}{findall}{pattern, string} ! Return a list of all non-overlapping matches of \var{pattern} in ! \var{string}. If one or more groups are present in the pattern, ! return a list of groups; this will be a list of tuples if the pattern ! has more than one group. Empty matches are included in the result. ! \versionadded{1.5.2} \end{funcdesc} ! \begin{funcdesc}{sub}{pattern, repl, string\optional{, count\code{ = 0}}} ! Return the string obtained by replacing the leftmost non-overlapping ! occurrences of \var{pattern} in \var{string} by the replacement ! \var{repl}. If the pattern isn't found, \var{string} is returned ! unchanged. \var{repl} can be a string or a function; if a function, ! it is called for every non-overlapping occurrence of \var{pattern}. ! The function takes a single match object argument, and returns the ! replacement string. For example: \begin{verbatim} --- 506,539 ---- \begin{funcdesc}{findall}{pattern, string} ! Return a list of all non-overlapping matches of \var{pattern} in ! \var{string}. If one or more groups are present in the pattern, ! return a list of groups; this will be a list of tuples if the ! pattern has more than one group. Empty matches are included in the ! result. ! \versionadded{1.5.2} \end{funcdesc} ! \begin{funcdesc}{sub}{pattern, repl, string\optional{, count}} ! Return the string obtained by replacing the leftmost non-overlapping ! occurrences of \var{pattern} in \var{string} by the replacement ! \var{repl}. If the pattern isn't found, \var{string} is returned ! unchanged. \var{repl} can be a string or a function; if it is a ! string, any backslash escapes in it are processed. That is, ! \samp{\e n} is converted to a single newline character, \samp{\e r} ! is converted to a linefeed, and so forth. Unknown escapes such as ! \samp{\e j} are left alone. Backreferences, such as \samp{\e6}, are ! replaced with the substring matched by group 6 in the pattern. For ! example: ! ! \begin{verbatim} ! >>> re.sub(r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', ! ... r'static PyObject*\npy_\1(void)\n{', ! ... 'def myfunc():') ! 'static PyObject*\npy_myfunc(void)\n{' ! \end{verbatim} ! ! If \var{repl} is a function, it is called for every non-overlapping ! occurrence of \var{pattern}. The function takes a single match ! object argument, and returns the replacement string. For example: \begin{verbatim} *************** *** 522,557 **** \end{verbatim} ! The pattern may be a string or an RE object; if you need to specify ! regular expression flags, you must use a RE object, or use ! embedded modifiers in a pattern; for example, ! \samp{sub("(?i)b+", "x", "bbbb BBBB")} returns \code{'x x'}. ! ! The optional argument \var{count} is the maximum number of pattern ! occurrences to be replaced; \var{count} must be a non-negative ! integer, and the default value of 0 means to replace all occurrences. ! ! Empty matches for the pattern are replaced only when not adjacent to a ! previous match, so \samp{sub('x*', '-', 'abc')} returns ! \code{'-a-b-c-'}. ! If \var{repl} is a string, any backslash escapes in it are processed. ! That is, \samp{\e n} is converted to a single newline character, ! \samp{\e r} is converted to a linefeed, and so forth. Unknown escapes ! such as \samp{\e j} are left alone. Backreferences, such as \samp{\e ! 6}, are replaced with the substring matched by group 6 in the pattern. ! In addition to character escapes and backreferences as described ! above, \samp{\e g} will use the substring matched by the group ! named \samp{name}, as defined by the \regexp{(?P...)} syntax. ! \samp{\e g} uses the corresponding group number; \samp{\e ! g<2>} is therefore equivalent to \samp{\e 2}, but isn't ambiguous in a ! replacement such as \samp{\e g<2>0}. \samp{\e 20} would be ! interpreted as a reference to group 20, not a reference to group 2 ! followed by the literal character \character{0}. \end{funcdesc} ! \begin{funcdesc}{subn}{pattern, repl, string\optional{, count\code{ = 0}}} ! Perform the same operation as \function{sub()}, but return a tuple ! \code{(\var{new_string}, \var{number_of_subs_made})}. \end{funcdesc} --- 545,573 ---- \end{verbatim} ! The pattern may be a string or an RE object; if you need to specify ! regular expression flags, you must use a RE object, or use embedded ! modifiers in a pattern; for example, \samp{sub("(?i)b+", "x", "bbbb ! BBBB")} returns \code{'x x'}. ! The optional argument \var{count} is the maximum number of pattern ! occurrences to be replaced; \var{count} must be a non-negative ! integer. If omitted or zero, all occurrences will be replaced. ! Empty matches for the pattern are replaced only when not adjacent to ! a previous match, so \samp{sub('x*', '-', 'abc')} returns ! \code{'-a-b-c-'}. ! In addition to character escapes and backreferences as described ! above, \samp{\e g} will use the substring matched by the group ! named \samp{name}, as defined by the \regexp{(?P...)} syntax. ! \samp{\e g} uses the corresponding group number; ! \samp{\e g<2>} is therefore equivalent to \samp{\e 2}, but isn't ! ambiguous in a replacement such as \samp{\e g<2>0}. \samp{\e 20} ! would be interpreted as a reference to group 20, not a reference to ! group 2 followed by the literal character \character{0}. \end{funcdesc} ! \begin{funcdesc}{subn}{pattern, repl, string\optional{, count}} ! Perform the same operation as \function{sub()}, but return a tuple ! \code{(\var{new_string}, \var{number_of_subs_made})}. \end{funcdesc} Index: libreadline.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libreadline.tex,v retrieving revision 1.5 retrieving revision 1.5.8.1 diff -C2 -d -r1.5 -r1.5.8.1 *** libreadline.tex 2000/10/10 17:03:45 1.5 --- libreadline.tex 2001/08/02 02:40:42 1.5.8.1 *************** *** 56,63 **** \begin{funcdesc}{set_completer}{\optional{function}} ! Set or remove the completer function. The completer function is ! called as \code{\var{function}(\var{text}, \var{state})}, ! \code{for i in [0, 1, 2, ...]} until it returns a non-string. ! It should return the next possible completion starting with \var{text}. \end{funcdesc} --- 56,66 ---- \begin{funcdesc}{set_completer}{\optional{function}} ! Set or remove the completer function. If \var{function} is specified, ! it will be used as the new completer function; if omitted or ! \code{None}, any completer function already installed is removed. The ! completer function is called as \code{\var{function}(\var{text}, ! \var{state})}, for \var{state} in \code{0}, \code{1}, \code{2}, ..., ! until it returns a non-string value. It should return the next ! possible completion starting with \var{text}. \end{funcdesc} From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-freebsd5 regen,1.1,1.1.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-freebsd5 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-freebsd5 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-freebsd5/regen,v retrieving revision 1.1 retrieving revision 1.1.8.1 diff -C2 -d -r1.1 -r1.1.8.1 *** regen 2000/08/31 02:42:11 1.1 --- regen 2001/08/02 02:40:42 1.1.8.1 *************** *** 1,6 **** #! /bin/sh set -v - python ../../Tools/scripts/h2py.py /usr/include/fcntl.h - python ../../Tools/scripts/h2py.py /usr/include/sys/socket.h python ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h - python ../../Tools/scripts/h2py.py /usr/include/termios.h --- 1,3 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-beos5 regen,1.1,1.1.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-beos5 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-beos5 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-beos5/regen,v retrieving revision 1.1 retrieving revision 1.1.8.1 diff -C2 -d -r1.1 -r1.1.8.1 *** regen 2000/10/06 16:11:21 1.1 --- regen 2001/08/02 02:40:42 1.1.8.1 *************** *** 5,10 **** set -v - python $H2PY $HEADERS/posix/fcntl.h - python $H2PY $HEADERS/be/net/socket.h python $H2PY -i '(u_long)' $HEADERS/be/net/netinet/in.h - python $H2PY $HEADERS/posix/termios.h --- 5,7 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-generic regen,1.3,1.3.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-generic In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-generic Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-generic/regen,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -C2 -d -r1.3 -r1.3.8.1 *** regen 2000/10/09 19:34:12 1.3 --- regen 2001/08/02 02:40:42 1.3.8.1 *************** *** 1,6 **** #! /bin/sh set -v - python$EXE ../../Tools/scripts/h2py.py /usr/include/fcntl.h - python$EXE ../../Tools/scripts/h2py.py /usr/include/sys/socket.h python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h - python$EXE ../../Tools/scripts/h2py.py /usr/include/termios.h --- 1,3 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-irix6 regen,1.1,1.1.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-irix6 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-irix6 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-irix6/regen,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -C2 -d -r1.1 -r1.1.12.1 *** regen 1997/01/15 19:19:18 1.1 --- regen 2001/08/02 02:40:43 1.1.12.1 *************** *** 6,13 **** esac set -v - h2py /usr/include/sys/fcntl.h h2py /usr/include/sys/file.h - h2py /usr/include/sys/socket.h h2py -i '(u_long)' /usr/include/netinet/in.h - h2py /usr/include/sys/termios.h h2py /usr/include/errno.h --- 6,10 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-linux2 regen,1.1,1.1.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-linux2 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-linux2 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-linux2/regen,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -C2 -d -r1.1 -r1.1.12.1 *** regen 1996/07/22 21:50:43 1.1 --- regen 2001/08/02 02:40:43 1.1.12.1 *************** *** 6,11 **** esac set -v - h2py /usr/include/sys/fcntl.h - h2py /usr/include/sys/socket.h h2py -i '(u_long)' /usr/include/netinet/in.h - h2py /usr/include/termios.h --- 6,8 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-irix5 regen,1.4,1.4.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-irix5 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-irix5 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-irix5/regen,v retrieving revision 1.4 retrieving revision 1.4.12.1 diff -C2 -d -r1.4 -r1.4.12.1 *** regen 1996/06/11 15:03:14 1.4 --- regen 2001/08/02 02:40:43 1.4.12.1 *************** *** 6,13 **** esac set -v - h2py /usr/include/sys/fcntl.h h2py /usr/include/sys/file.h - h2py /usr/include/sys/socket.h h2py -i '(u_long)' /usr/include/netinet/in.h - h2py /usr/include/sys/termios.h h2py /usr/include/errno.h --- 6,10 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-unixware7 regen,1.2,1.2.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-unixware7 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-unixware7 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-unixware7/regen,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** regen 2001/04/11 23:43:09 1.2 --- regen 2001/08/02 02:40:43 1.2.4.1 *************** *** 6,10 **** esac set -v - h2py /usr/include/sys/fcntl.h h2py -i '(u_long)' /usr/include/netinet/in.h h2py /usr/include/sys/stropts.h --- 6,9 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-netbsd1 regen,1.1,1.1.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-netbsd1 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-netbsd1 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-netbsd1/regen,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -C2 -d -r1.1 -r1.1.12.1 *** regen 1997/12/03 18:44:57 1.1 --- regen 2001/08/02 02:40:43 1.1.12.1 *************** *** 1,6 **** #! /bin/sh set -v - python ../../Tools/scripts/h2py.py /usr/include/fcntl.h - python ../../Tools/scripts/h2py.py /usr/include/sys/socket.h python ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h - python ../../Tools/scripts/h2py.py /usr/include/termios.h --- 1,3 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules readline.c,2.35.4.1,2.35.4.2 socketmodule.c,1.141.4.3,1.141.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Modules Modified Files: Tag: descr-branch readline.c socketmodule.c Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.35.4.1 retrieving revision 2.35.4.2 diff -C2 -d -r2.35.4.1 -r2.35.4.2 *** readline.c 2001/07/14 07:47:35 2.35.4.1 --- readline.c 2001/08/02 02:40:43 2.35.4.2 *************** *** 267,271 **** Set or remove the completer function.\n\ The function is called as function(text, state),\n\ ! for i in [0, 1, 2, ...] until it returns a non-string.\n\ It should return the next possible completion starting with 'text'.\ "; --- 267,271 ---- Set or remove the completer function.\n\ The function is called as function(text, state),\n\ ! for state in 0, 1, 2, ..., until it returns a non-string.\n\ It should return the next possible completion starting with 'text'.\ "; Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.141.4.3 retrieving revision 1.141.4.4 diff -C2 -d -r1.141.4.3 -r1.141.4.4 *** socketmodule.c 2001/07/28 05:02:59 1.141.4.3 --- socketmodule.c 2001/08/02 02:40:43 1.141.4.4 *************** *** 220,227 **** /* I know this is a bad practice, but it is the easiest... */ ! #ifndef HAVE_GETADDRINFO #include "getaddrinfo.c" #endif ! #ifndef HAVE_GETNAMEINFO #include "getnameinfo.c" #endif --- 220,231 ---- /* I know this is a bad practice, but it is the easiest... */ ! /* XXX Temporarily work around bug #445928: ! getaddrinfo on Darwin seems to return an empty result list, with ! no error, even if host lookup ought to work fine. So use the ! emulation code for now. */ ! #if !defined(HAVE_GETADDRINFO) || defined(__APPLE__) #include "getaddrinfo.c" #endif ! #if !defined(HAVE_GETNAMEINFO) || defined(__APPLE__) #include "getnameinfo.c" #endif *************** *** 2346,2354 **** } if (PyInt_Check(pobj)) { ! #ifndef HAVE_SNPRINTF ! sprintf(pbuf, "%ld", PyInt_AsLong(pobj)); ! #else ! snprintf(pbuf, sizeof(pbuf), "%ld", PyInt_AsLong(pobj)); ! #endif pptr = pbuf; } else if (PyString_Check(pobj)) { --- 2350,2354 ---- } if (PyInt_Check(pobj)) { ! PyOS_snprintf(pbuf, sizeof(pbuf), "%ld", PyInt_AsLong(pobj)); pptr = pbuf; } else if (PyString_Check(pobj)) { *************** *** 2421,2429 **** if (n == 0) goto fail; ! #ifdef HAVE_SNPRINTF ! snprintf(pbuf, sizeof(pbuf), "%d", port); ! #else ! sprintf(pbuf, "%d", port); ! #endif memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; --- 2421,2425 ---- if (n == 0) goto fail; ! PyOS_snprintf(pbuf, sizeof(pbuf), "%d", port); memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.98.2.1,1.98.2.2 NEWS,1.189.2.5,1.189.2.6 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Misc Modified Files: Tag: descr-branch ACKS NEWS Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.98.2.1 retrieving revision 1.98.2.2 diff -C2 -d -r1.98.2.1 -r1.98.2.2 *** ACKS 2001/07/28 05:02:59 1.98.2.1 --- ACKS 2001/08/02 02:40:43 1.98.2.2 *************** *** 311,314 **** --- 311,315 ---- Dan Pierson François Pinard + John Popplewell Amrit Prem Paul Prescod Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.189.2.5 retrieving revision 1.189.2.6 diff -C2 -d -r1.189.2.5 -r1.189.2.6 *** NEWS 2001/07/30 04:08:14 1.189.2.5 --- NEWS 2001/08/02 02:40:43 1.189.2.6 *************** *** 9,12 **** --- 9,16 ---- Core + - Warnings about a mismatch in the Python API during extension import + now use the Python warning framework (which makes it possible to + write filters for these warnings). + Library *************** *** 20,23 **** --- 24,41 ---- C API + + - Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added + which provide a cross-platform implementations for the + relatively new snprintf()/vsnprintf() C lib APIs. In contrast to + the standard sprintf() and vsprintf() C lib APIs, these versions + apply bounds checking on the used buffer which enhances protection + against buffer overruns. + + - Unicode APIs now use name mangling to assure that mixing interpreters + and extensions using different Unicode widths is rendered next to + impossible. Trying to import an incompatible Unicode-aware extension + will result in an ImportError. Unicode extensions writers must make + sure to check the Unicode width compatibility in their extensions by + using at least one of the mangled Unicode APIs in the extension. From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-linux1 regen,1.1,1.1.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-linux1 In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/plat-linux1 Modified Files: Tag: descr-branch regen Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-linux1/regen,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -C2 -d -r1.1 -r1.1.12.1 *** regen 1995/04/05 09:44:56 1.1 --- regen 2001/08/02 02:40:43 1.1.12.1 *************** *** 6,11 **** esac set -v - h2py /usr/include/sys/fcntl.h - h2py /usr/include/sys/socket.h h2py -i '(u_long)' /usr/include/netinet/in.h - h2py /usr/include/termios.h --- 6,8 ---- From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_codeop.py,NONE,1.1.2.1 test_b1.py,1.34.6.2,1.34.6.3 test_b2.py,1.24.6.1,1.24.6.2 test_import.py,1.3.4.1,1.3.4.2 test_pyexpat.py,1.7.6.1,1.7.6.2 test_scope.py,1.14.4.2,1.14.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/test Modified Files: Tag: descr-branch test_b1.py test_b2.py test_import.py test_pyexpat.py test_scope.py Added Files: Tag: descr-branch test_codeop.py Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. --- NEW FILE: test_codeop.py --- """ Test cases for codeop.py Nick Mathewson """ import unittest from test_support import run_unittest from codeop import compile_command class CodeopTests(unittest.TestCase): def assertValid(self, str, symbol='single'): '''succeed iff str is a valid piece of code''' expected = compile(str, "", symbol) self.assertEquals( compile_command(str, "", symbol), expected) def assertIncomplete(self, str, symbol='single'): '''succeed iff str is the start of a valid piece of code''' self.assertEquals( compile_command(str, symbol=symbol), None) def assertInvalid(self, str, symbol='single', is_syntax=1): '''succeed iff str is the start of an invalid piece of code''' try: compile_command(str,symbol=symbol) self.fail("No exception thrown for invalid code") except SyntaxError: self.assert_(is_syntax) except OverflowError: self.assert_(not is_syntax) def test_valid(self): av = self.assertValid av("a = 1\n") av("def x():\n pass\n") av("pass\n") av("3**3\n") av("if 9==3:\n pass\nelse:\n pass\n") av("#a\n#b\na = 3\n") av("#a\n\n \na=3\n") av("a=3\n\n") # special case self.assertEquals(compile_command(""), compile("pass", "", 'single')) av("3**3","eval") av("(lambda z: \n z**3)","eval") av("#a\n#b\na**3","eval") def test_incomplete(self): ai = self.assertIncomplete ai("(a **") ai("def x():\n") ai("(a,b,") ai("(a,b,(") ai("(a,b,(") ai("if 9==3:\n pass\nelse:\n") ai("if 9==3:\n pass\nelse:\n pass") ai("a = (") ai("a = 9+ \\") ai("(","eval") ai("(\n\n\n","eval") ai("(9+","eval") ai("9+ \\","eval") ai("lambda z: \\","eval") def test_invalid(self): ai = self.assertInvalid ai("a b") ai("a = ") ai("a = 9 +") ai("a = 1","eval") ai("a = (","eval") ai("]","eval") ai("())","eval") ai("[}","eval") ai("9+","eval") ai("lambda z:","eval") ai("a b","eval") def test_filename(self): self.assertEquals(compile_command("a = 1\n", "abc").co_filename, compile("a = 1\n", "abc", 'single').co_filename) self.assertNotEquals(compile_command("a = 1\n", "abc").co_filename, compile("a = 1\n", "def", 'single').co_filename) run_unittest(CodeopTests) Index: test_b1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b1.py,v retrieving revision 1.34.6.2 retrieving revision 1.34.6.3 diff -C2 -d -r1.34.6.2 -r1.34.6.3 *** test_b1.py 2001/07/28 05:02:59 1.34.6.2 --- test_b1.py 2001/08/02 02:40:43 1.34.6.3 *************** *** 257,264 **** --- 257,282 ---- import sys if getattr(sys, 'stdout') is not sys.stdout: raise TestFailed, 'getattr' + try: + getattr(sys, 1) + except TypeError: + pass + else: + raise TestFailed, "getattr(sys, 1) should raise an exception" + try: + getattr(sys, 1, "foo") + except TypeError: + pass + else: + raise TestFailed, 'getattr(sys, 1, "foo") should raise an exception' print 'hasattr' import sys if not hasattr(sys, 'stdout'): raise TestFailed, 'hasattr' + try: + hasattr(sys, 1) + except TypeError: + pass + else: + raise TestFailed, "hasattr(sys, 1) should raise an exception" print 'hash' Index: test_b2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b2.py,v retrieving revision 1.24.6.1 retrieving revision 1.24.6.2 diff -C2 -d -r1.24.6.1 -r1.24.6.2 *** test_b2.py 2001/07/07 22:55:28 1.24.6.1 --- test_b2.py 2001/08/02 02:40:43 1.24.6.2 *************** *** 206,209 **** --- 206,215 ---- setattr(sys, 'spam', 1) if sys.spam != 1: raise TestFailed, 'setattr(sys, \'spam\', 1)' + try: + setattr(sys, 1, 'spam') + except TypeError: + pass + else: + raise TestFailed, "setattr(sys, 1, 'spam') should raise exception" print 'str' Index: test_import.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_import.py,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** test_import.py 2001/07/07 22:55:28 1.3.4.1 --- test_import.py 2001/08/02 02:40:43 1.3.4.2 *************** *** 20,25 **** source = TESTFN + ".py" - pyc = TESTFN + ".pyc" pyo = TESTFN + ".pyo" f = open(source, "w") --- 20,28 ---- source = TESTFN + ".py" pyo = TESTFN + ".pyo" + if sys.platform.startswith('java'): + pyc = TESTFN + "$py.class" + else: + pyc = TESTFN + ".pyc" f = open(source, "w") Index: test_pyexpat.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pyexpat.py,v retrieving revision 1.7.6.1 retrieving revision 1.7.6.2 diff -C2 -d -r1.7.6.1 -r1.7.6.2 *** test_pyexpat.py 2001/07/07 22:55:29 1.7.6.1 --- test_pyexpat.py 2001/08/02 02:40:43 1.7.6.2 *************** *** 4,7 **** --- 4,8 ---- # handler, are obscure and unhelpful. + import pyexpat from xml.parsers import expat Index: test_scope.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_scope.py,v retrieving revision 1.14.4.2 retrieving revision 1.14.4.3 diff -C2 -d -r1.14.4.2 -r1.14.4.3 *** test_scope.py 2001/07/14 07:47:34 1.14.4.2 --- test_scope.py 2001/08/02 02:40:43 1.14.4.3 *************** *** 466,467 **** --- 466,480 ---- adaptgetter("foo", TestClass, (1, "")) sys.settrace(None) + + print "20. eval with free variables" + + def f(x): + return lambda: x + 1 + + g = f(3) + try: + eval(g.func_code) + except TypeError: + pass + else: + print "eval() should have failed, because code contained free vars" From tim_one@users.sourceforge.net Thu Aug 2 03:40:46 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python mysnprintf.c,NONE,2.2.2.1 bltinmodule.c,2.198.2.10,2.198.2.11 getargs.c,2.54.6.2,2.54.6.3 modsupport.c,2.55,2.55.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Python Modified Files: Tag: descr-branch bltinmodule.c getargs.c modsupport.c Added Files: Tag: descr-branch mysnprintf.c Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. --- NEW FILE: mysnprintf.c --- #include "Python.h" /* snprintf() emulation for platforms which don't have it (yet). Return value The number of characters printed (not including the trailing `\0' used to end output to strings) or a negative number in case of an error. PyOS_snprintf and PyOS_vsnprintf do not write more than size bytes (including the trailing '\0'). If the output would have been truncated, they return the number of characters (excluding the trailing '\0') which would have been written to the final string if enough space had been available. This is inline with the C99 standard. */ #include #ifndef HAVE_SNPRINTF static int myvsnprintf(char *str, size_t size, const char *format, va_list va) { char *buffer = PyMem_Malloc(size + 512); int len; if (buffer == NULL) return -1; len = vsprintf(buffer, format, va); if (len < 0) { PyMem_Free(buffer); return len; } len++; assert(len >= 0); if ((size_t)len > size + 512) Py_FatalError("Buffer overflow in PyOS_snprintf/PyOS_vsnprintf"); if ((size_t)len > size) { PyMem_Free(buffer); return len - 1; } memcpy(str, buffer, len); PyMem_Free(buffer); return len - 1; } int PyOS_snprintf(char *str, size_t size, const char *format, ...) { int rc; va_list va; va_start(va, format); rc = myvsnprintf(str, size, format, va); va_end(va); return rc; } int PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) { return myvsnprintf(str, size, format, va); } #else /* Make sure that a C API is included in the lib */ #ifdef PyOS_snprintf # undef PyOS_snprintf #endif int PyOS_snprintf(char *str, size_t size, const char *format, ...) { int rc; va_list va; va_start(va, format); rc = vsnprintf(str, size, format, va); va_end(va); return rc; } #ifdef PyOS_vsnprintf # undef PyOS_vsnprintf #endif int PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) { return vsnprintf(str, size, format, va); } #endif Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.198.2.10 retrieving revision 2.198.2.11 diff -C2 -d -r2.198.2.10 -r2.198.2.11 *** bltinmodule.c 2001/07/28 05:03:00 2.198.2.10 --- bltinmodule.c 2001/08/02 02:40:43 2.198.2.11 *************** *** 530,535 **** return NULL; } ! if (PyCode_Check(cmd)) return PyEval_EvalCode((PyCodeObject *) cmd, globals, locals); if (!PyString_Check(cmd) && !PyUnicode_Check(cmd)) { --- 530,541 ---- return NULL; } ! if (PyCode_Check(cmd)) { ! if (PyTuple_GET_SIZE(((PyCodeObject *)cmd)->co_freevars) > 0) { ! PyErr_SetString(PyExc_TypeError, ! "code object passed to eval() may not contain free variables"); ! return NULL; ! } return PyEval_EvalCode((PyCodeObject *) cmd, globals, locals); + } if (!PyString_Check(cmd) && !PyUnicode_Check(cmd)) { *************** *** 614,617 **** --- 620,634 ---- if (!PyArg_ParseTuple(args, "OO|O:getattr", &v, &name, &dflt)) return NULL; + if (PyUnicode_Check(name)) { + name = _PyUnicode_AsDefaultEncodedString(name, NULL); + if (name == NULL) + return NULL; + } + + if (!PyString_Check(name)) { + PyErr_SetString(PyExc_TypeError, + "attribute name must be string"); + return NULL; + } result = PyObject_GetAttr(v, name); if (result == NULL && dflt != NULL) { *************** *** 657,660 **** --- 674,688 ---- if (!PyArg_ParseTuple(args, "OO:hasattr", &v, &name)) return NULL; + if (PyUnicode_Check(name)) { + name = _PyUnicode_AsDefaultEncodedString(name, NULL); + if (name == NULL) + return NULL; + } + + if (!PyString_Check(name)) { + PyErr_SetString(PyExc_TypeError, + "attribute name must be string"); + return NULL; + } v = PyObject_GetAttr(v, name); if (v == NULL) { Index: getargs.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v retrieving revision 2.54.6.2 retrieving revision 2.54.6.3 diff -C2 -d -r2.54.6.2 -r2.54.6.3 *** getargs.c 2001/07/07 22:55:30 2.54.6.2 --- getargs.c 2001/08/02 02:40:43 2.54.6.3 *************** *** 360,368 **** - /* Internal API needed by convertsimple() and a helper macro. */ - extern - PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors); - #define UNICODE_DEFAULT_ENCODING(arg) \ _PyUnicode_AsDefaultEncodedString(arg, NULL) --- 360,363 ---- Index: modsupport.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/modsupport.c,v retrieving revision 2.55 retrieving revision 2.55.4.1 diff -C2 -d -r2.55 -r2.55.4.1 *** modsupport.c 2001/03/12 21:03:26 2.55 --- modsupport.c 2001/08/02 02:40:43 2.55.4.1 *************** *** 27,32 **** static char api_version_warning[] = ! "WARNING: Python C API version mismatch for module %s:\n\ ! This Python has API version %d, module %s has version %d.\n"; PyObject * --- 27,32 ---- static char api_version_warning[] = ! "Python C API version mismatch for module %.100s:\ ! This Python has API version %d, module %.100s has version %d."; PyObject * *************** *** 38,44 **** if (!Py_IsInitialized()) Py_FatalError("Interpreter not initialized (version mismatch?)"); ! if (module_api_version != PYTHON_API_VERSION) ! fprintf(stderr, api_version_warning, ! name, PYTHON_API_VERSION, name, module_api_version); if (_Py_PackageContext != NULL) { char *p = strrchr(_Py_PackageContext, '.'); --- 38,50 ---- if (!Py_IsInitialized()) Py_FatalError("Interpreter not initialized (version mismatch?)"); ! if (module_api_version != PYTHON_API_VERSION) { ! char message[512]; ! PyOS_snprintf(message, sizeof(message), ! api_version_warning, name, ! PYTHON_API_VERSION, name, ! module_api_version); ! if (PyErr_Warn(PyExc_RuntimeWarning, message)) ! return NULL; ! } if (_Py_PackageContext != NULL) { char *p = strrchr(_Py_PackageContext, '.'); From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/xml/sax __init__.py,1.14,1.14.6.1 expatreader.py,1.22.6.1,1.22.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/xml/sax In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/xml/sax Modified Files: Tag: descr-branch __init__.py expatreader.py Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/__init__.py,v retrieving revision 1.14 retrieving revision 1.14.6.1 diff -C2 -d -r1.14 -r1.14.6.1 *** __init__.py 2000/10/23 18:09:50 1.14 --- __init__.py 2001/08/02 02:40:43 1.14.6.1 *************** *** 54,57 **** --- 54,62 ---- default_parser_list = ["xml.sax.expatreader"] + # tell modulefinder that importing sax potentially imports expatreader + _false = 0 + if _false: + import xml.sax.expatreader + import os, string, sys if os.environ.has_key("PY_SAX_PARSER"): Index: expatreader.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/expatreader.py,v retrieving revision 1.22.6.1 retrieving revision 1.22.6.2 diff -C2 -d -r1.22.6.1 -r1.22.6.2 *** expatreader.py 2001/07/07 22:55:29 1.22.6.1 --- expatreader.py 2001/08/02 02:40:43 1.22.6.2 *************** *** 10,14 **** # xml.parsers.expat does not raise ImportError in Jython import sys ! if sys.platform[ : 4] == "java": raise SAXReaderNotAvailable("expat not available in Java", None) del sys --- 10,14 ---- # xml.parsers.expat does not raise ImportError in Jython import sys ! if sys.platform[:4] == "java": raise SAXReaderNotAvailable("expat not available in Java", None) del sys *************** *** 17,21 **** from xml.parsers import expat except ImportError: ! raise SAXReaderNotAvailable("expat not supported",None) from xml.sax import xmlreader, saxutils, handler --- 17,24 ---- from xml.parsers import expat except ImportError: ! raise SAXReaderNotAvailable("expat not supported", None) ! else: ! if not hasattr(expat, "ParserCreate"): ! raise SAXReaderNotAvailable("expat not supported", None) from xml.sax import xmlreader, saxutils, handler From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_scope,1.6.4.1,1.6.4.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Lib/test/output Modified Files: Tag: descr-branch test_scope Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: test_scope =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_scope,v retrieving revision 1.6.4.1 retrieving revision 1.6.4.2 diff -C2 -d -r1.6.4.1 -r1.6.4.2 *** test_scope 2001/07/07 22:55:29 1.6.4.1 --- test_scope 2001/08/02 02:40:43 1.6.4.2 *************** *** 20,21 **** --- 20,22 ---- 19. var is bound and free in class 20. interaction with trace function + 20. eval with free variables From tim_one@users.sourceforge.net Thu Aug 2 03:40:46 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild Uninstal.wse,NONE,1.3.2.1 python20.wse,1.40.2.6,1.40.2.7 pythoncore.dsp,1.15.2.6,1.15.2.7 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/PCbuild Modified Files: Tag: descr-branch python20.wse pythoncore.dsp Added Files: Tag: descr-branch Uninstal.wse Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. --- NEW FILE: Uninstal.wse --- Document Type: WSE item: Global Version=8.14 Flags=00000100 Split=1420 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Copy Default=1 Japanese Font Name=MS Gothic Japanese Font Size=10 Start Gradient=0 0 255 End Gradient=0 0 0 Windows Flags=00000000000000000000101000001000 Message Font=MS Sans Serif Font Size=8 Disk Label=GLBS Disk Filename=INSTALL Patch Flags=0000000000000001 Patch Threshold=200 Patch Memory=4096 Per-User Version ID=1 Crystal Format=10111100101100000010001001001001 Step View=&Properties end item: Remark Text=Note from Tim: This is a verbatim copy of Wise's Uninstal.wse, altered at the end to write end item: Remark Text=uninstall info under HKCU instead of HKLM if the user doesn't have Admin privs. end item: Remark end item: Remark Text= Install Support for uninstalling the application. end item: Remark end item: Set Variable Variable=UNINSTALL_PATH Value=%_LOGFILE_PATH_% Flags=00000010 end item: Set Variable Variable=UNINSTALL_PATH Value=%UNINSTALL_PATH%\UNWISE.EXE end item: Compiler Variable If Variable=_EXE_OS_TYPE_ Value=WIN32 end item: Install File Source=%_WISE_%\UNWISE32.EXE Destination=%UNINSTALL_PATH% Flags=0000000000000010 end item: Compiler Variable Else end item: Install File Source=%_WISE_%\UNWISE.EXE Destination=%UNINSTALL_PATH% Flags=0000000000000010 end item: Compiler Variable End end item: Remark end item: Remark Text= Install Support for multiple languages end item: Remark end item: Set Variable Variable=UNINSTALL_LANG Value=%UNINSTALL_PATH% Flags=00000010 end item: Set Variable Variable=UNINSTALL_LANG Value=%UNINSTALL_LANG%\UNWISE.INI end item: Compiler Variable If Variable=_LANG_LIST_ Value=C Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.FRA Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_C_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.FRA Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=D Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.FRA Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_D_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.FRA Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=E Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.DEU Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_E_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.DEU Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=F Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.PTG Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_F_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.PTG Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=G Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.ESP Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_G_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.ESP Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=H Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.ESP Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_H_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.ESP Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=I Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.ITA Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_I_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.ITA Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=J Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.DAN Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_J_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.DAN Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=K Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.FIN Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_K_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.FIN Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=L Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.ISL Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_L_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.ISL Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=M Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.NLD Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_M_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.NLD Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=N Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.NOR Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_N_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.NOR Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=O Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.SVE Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_O_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.SVE Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Compiler Variable If Variable=_LANG_LIST_ Value=P Flags=00000010 end item: Compiler Variable If Value=%_WISE_%\LANGUAGE\UNWISE.JPN Flags=00000011 end item: If/While Statement Variable=LANG Value=%_LANG_P_NAME_% end item: Install File Source=%_WISE_%\LANGUAGE\UNWISE.JPN Destination=%UNINSTALL_LANG% Flags=0000000000000010 end item: End Block end item: Compiler Variable End end item: Compiler Variable End end item: Remark end item: Remark Text= Install the add/remove or uninstall icon end item: Remark end item: Set Variable Variable=UNINSTALL_PATH Value=%UNINSTALL_PATH% Flags=00010100 end item: Set Variable Variable=INST_LOG_PATH Value=%_LOGFILE_PATH_% Flags=00010100 end item: Check Configuration Flags=10111011 end item: Check Configuration Flags=10111111 end item: Remark Text=Write uninstall info under HKLM. This if/else/end block added by Tim. end item: Edit Registry Total Keys=1 Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% New Value=%APPTITLE% Value Name=DisplayName Root=2 end item: Edit Registry Total Keys=1 Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% New Value=%UNINSTALL_PATH% %INST_LOG_PATH% New Value= Value Name=UninstallString Root=2 end item: Else Statement end item: Remark Text=The same, but write under HKCU instead. end item: Edit Registry Total Keys=1 Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% New Value=%APPTITLE% Value Name=DisplayName Root=1 end item: Edit Registry Total Keys=1 Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% New Value=%UNINSTALL_PATH% %INST_LOG_PATH% New Value= Value Name=UninstallString Root=1 end item: End Block end item: Else Statement end item: Add ProgMan Icon Group=%GROUP% Icon Name=Uninstall %APPTITLE% Command Line=%UNINSTALL_PATH% %INST_LOG_PATH% end item: End Block end item: Check Configuration Flags=11110010 end item: If/While Statement Variable=DOBRAND Value=1 end item: Edit Registry Total Keys=2 item: Key Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% New Value=%COMPANY% Value Name=RegCompany Root=2 end item: Key Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% New Value=%NAME% Value Name=RegOwner Root=2 end end item: End Block end item: End Block end Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.40.2.6 retrieving revision 1.40.2.7 diff -C2 -d -r1.40.2.6 -r1.40.2.7 *** python20.wse 2001/07/30 04:08:14 1.40.2.6 --- python20.wse 2001/08/02 02:40:43 1.40.2.7 *************** *** 13,17 **** Message Font=MS Sans Serif Font Size=8 ! Pages Modified=00010000001101000000000100000010 Extra Pages=00000000000000000000000010110010 Disk Filename=SETUP --- 13,17 ---- Message Font=MS Sans Serif Font Size=8 ! Pages Modified=00010000011101000000000100000010 Extra Pages=00000000000000000000000010110010 Disk Filename=SETUP *************** *** 20,23 **** --- 20,24 ---- Patch Memory=4000 EXE Filename=Python-2.2a1.exe + Dialogs Version=8 Version File=2.2a1 Version Description=Python Programming Language *************** *** 72,75 **** --- 73,79 ---- end item: Remark + Text= The APPTITLE setting above. + end + item: Remark Text= The "Title:" in the upper left corner of the GUI. end *************** *** 190,194 **** Variable=DOBACKUP Value=A - Flags=10000000 end item: Remark --- 194,197 ---- *************** *** 257,264 **** Text=D: test suite end item: Set Variable Variable=COMPONENTS ! Value=ABCD end item: Wizard Block Direction Variable=DIRECTION --- 260,284 ---- Text=D: test suite end + item: Remark + Text=E: register file extensions (requires Admin privs) + end + item: Check Configuration + Flags=10111111 + end item: Set Variable Variable=COMPONENTS ! Value=ABCDE ! end ! item: Else Statement end + item: Remark + Text=Lowercase E grays out the "register file extension" choice. + end + item: Set Variable + Variable=COMPONENTS + Value=ABCDe + end + item: End Block + end item: Wizard Block Direction Variable=DIRECTION *************** *** 295,310 **** end item: Push Button - Rectangle=105 187 150 202 - Variable=DIRECTION - Value=B - Create Flags=01010000000000010000000000000000 - Flags=0000000000000001 - Text=< &Back - Text French=< &Retour - Text German=< &Zurück - Text Spanish=< &Atrás - Text Italian=< &Indietro - end - item: Push Button Rectangle=211 187 256 202 Action=3 --- 315,318 ---- *************** *** 322,326 **** end item: Static ! Rectangle=86 8 258 42 Create Flags=01010000000000000000000000000000 Flags=0000000000000001 --- 330,334 ---- end item: Static ! Rectangle=86 9 258 34 Create Flags=01010000000000000000000000000000 Flags=0000000000000001 *************** *** 332,371 **** Text Spanish=Seleccione el directorio de destino Text Italian=Selezionare Directory di destinazione - end - item: Static - Rectangle=86 42 256 82 - Create Flags=01010000000000000000000000000000 - Text=Please select the directory where the %APPTITLE% files are to be installed. - Text French=Veuillez sélectionner le répertoire dans lequel les fichiers %APPTITLE% doivent être installés. - Text German=Geben Sie an, in welchem Verzeichnis die %APPTITLE%-Dateien installiert werden sollen. - Text Spanish=Por favor seleccione el directorio donde desee instalar los archivos de %APPTITLE%. - Text Italian=Selezionare la directory dove verranno installati i file %APPTITLE%. end ! item: Static ! Rectangle=86 98 256 125 ! Action=1 ! Create Flags=01010000000000000000000000000111 ! end ! item: Push Button ! Rectangle=208 106 253 121 ! Variable=MAINDIR_SAVE ! Value=%MAINDIR% ! Destination Dialog=1 ! Action=2 ! Create Flags=01010000000000010000000000000000 ! Text=Browse ! Text French=Parcourir ! Text German=Durchsuchen ! Text Spanish=Buscar ! Text Italian=Sfoglie end item: Static ! Rectangle=90 109 206 120 Create Flags=01010000000000000000000000000000 ! Text=%MAINDIR% ! Text French=%MAINDIR% ! Text German=%MAINDIR% ! Text Spanish=%MAINDIR% ! Text Italian=%MAINDIR% end end --- 340,358 ---- Text Spanish=Seleccione el directorio de destino Text Italian=Selezionare Directory di destinazione end ! item: Listbox ! Rectangle=86 50 257 175 ! Variable=MAINDIR ! Enabled Color=00000000000000001111111111111111 ! Create Flags=01010000100000010000000101000001 ! Flags=0000110000001010 ! Text=%MAINDIR% ! Text= end item: Static ! Rectangle=86 34 250 49 ! Enabled Color=00000000000000001111111111111111 Create Flags=01010000000000000000000000000000 ! Text=Please select a directory for the %APPTITLE% files. end end *************** *** 415,418 **** --- 402,686 ---- end item: Custom Dialog Set + Name=Backup Replaced Files + Display Variable=DISPLAY + item: Dialog + Title=%APPTITLE% Installation + Title French=Fichiers de Sauvegarde Remplacés + Title German=Sicherungskopie von ersetzten Dateien erstellen + Title Portuguese=Ficheiros substituídos de segurança + Title Spanish=Copias de seguridad de los archivos reemplazados + Title Italian=Backup file sostituiti + Title Danish=Sikkerhedskopiering af erstattede filer + Title Dutch=Vervangen bestanden kopiëren + Title Norwegian=Sikkerhetskopiere erstattede filer + Title Swedish=Säkerhetskopiera utbytta filer + Width=280 + Height=224 + Font Name=Helv + Font Size=8 + item: Push Button + Rectangle=150 187 195 201 + Variable=DIRECTION + Value=N + Create Flags=01010000000000010000000000000001 + Text=&Next > + Text French=&Suivant> + Text German=&Weiter> + Text Portuguese=&Próximo> + Text Spanish=&Siguiente > + Text Italian=&Avanti > + Text Danish=&Næste> + Text Dutch=&Volgende> + Text Norwegian=&Neste> + Text Swedish=&Nästa > + end + item: Push Button + Rectangle=105 187 150 201 + Variable=DIRECTION + Value=B + Create Flags=01010000000000010000000000000000 + Text=< &Back + Text French=<&Retour + Text German=<&Zurück + Text Portuguese=<&Retornar + Text Spanish=<&Retroceder + Text Italian=< &Indietro + Text Danish=<&Tilbage + Text Dutch=<&Terug + Text Norwegian=<&Tilbake + Text Swedish=< &Tillbaka + end + item: Push Button + Rectangle=222 187 264 201 + Action=3 + Create Flags=01010000000000010000000000000000 + Text=Cancel + Text French=Annuler + Text German=Abbrechen + Text Portuguese=Cancelar + Text Spanish=Cancelar + Text Italian=Annulla + Text Danish=Annuller + Text Dutch=Annuleren + Text Norwegian=Avbryt + Text Swedish=Avbryt + end + item: Static + Rectangle=9 177 263 178 + Action=3 + Create Flags=01010000000000000000000000000111 + end + item: Static + Rectangle=86 37 256 101 + Create Flags=01010000000000000000000000000000 + Text=This installation program can create backup copies of all files replaced during the installation. These files will be used when the software is uninstalled and a rollback is requested. If backup copies are not created, you will only be able to uninstall the software and not roll the system back to a previous state. + Text= + Text=Do you want to create backups of replaced files? + Text French=Le programme d'installation peut créer des copies de sauvegarde de tous les fichiers remplacés pendant l'installation. Ces fichiers sont utilisés au cas où le logiciel est désinstallé et que l'on procède à la reprise du système. Si les copies de sauvegarde ne sont pas créées, on ne pourra que désinstaller le logiciel sans reprendre le système à un état précédent. Voulez-vous créer une sauvegarde des fichiers remplacés ? + Text German=Dieses Installationsprogramm kann Sicherungskopien von allen während der Installation ersetzten Dateien erstellen. Diese Dateien werden zur Rückgängigmachung der Installation und bei Anforderung eines Rollbacks verwendet. Ohne Sicherungskopien ist nur eine Rückgängigmachung der Installation möglich, nicht aber ein Rollback des Systems. Sicherungskopien der ersetzten Dateien erstellen? + Text Portuguese=Este programa de instalação pode criar cópias de segurança de todos os ficheiros substituídos durante a instalação. Estes ficheiros serão utilizados quando o programa for desinstalado e for requisitada uma retomada. Se as cópias de segurança não forem criadas, só poderá desinstalar o programa e não pode retomar um estado anterior do sistema. Deseja criar cópias de segurança dos ficheiros substituídos? + Text Spanish=Este programa de instalación puede crear copias de seguridad de todos los archivos reemplazados durante la instalación. Estos archivos se utilizarán cuando se desinstale el software y se solicite volver al estado anterior. Si no se crean copias de seguridad, únicamente podrá desinstalar el software y no podrá devolver el sistema al estado anterior. ¿Desea crear archivos de seguridad de los archivos reemplazados? + Text Italian=Questo programma di installazione può creare copie di backup di tutti i file sostituiti durante l’installazione. Questi file saranno usati quando il software sarà disinstallato e sarà richiesto un ritorno allo stato precedente. Se non crei le copie di backup, potrai solo disinstallare il software, ma non potrai riportare il sistema allo stato precedente. Vuoi creare i file di backup dei file sostituiti? + Text Danish=Dette installationsprogram kan oprette sikkerhedskopier af alle filer, som erstattes under installationen. Disse filer benyttes, når softwaren fjernes, og den tidligere systemkonfiguration genetableres. Hvis der ikke oprettes sikkerhedskopier, kan du kun fjerne den installerede software og ikke genetablere den tidligere systemkonfiguration. Vil du oprette sikkerhedskopier af filer, som erstattes? + Text Dutch=Dit installatieprogramma kan kopieën maken van alle bestanden die tijdens de installatie worden vervangen. Deze worden dan gebruikt als de software-installatie ongedaan wordt gemaakt en u het systeem wilt laten terugkeren naar de oorspronkelijke staat. Als er geen back-up kopieën worden gemaakt, kunt u de software enkel verwijderen maar het systeem niet in de oorspronkelijke staat terugbrengen. Wilt u een back-up maken van de vervangen bestanden? + Text Norwegian=Dette installasjonsprogrammet kan lage sikkerhetskopier av alle filer som blir erstattet under installasjonen. Disse filene vil tas i bruk når programvaren er avinstallert og det er behov for tilbakestilling. Hvis det ikke er laget sikkerhetskopier, kan du kun avinstallere programvaren og ikke stille systemet tilbake til tidligere status. Ønsker du å lage sikkerhetskopier av de filene som blir erstattet nå? + Text Swedish=Installationsprogrammet kan skapa säkerhetskopior av alla filer som byts ut under installationen. Dessa filer kan sedan användas när programvaran avinstalleras och du begär rollback. Om du då inte har några säkerhetskopior kan du bara avinstallera programvaran, inte återskapa systemet i dess tidigare skick. Vill du göra säkerhetskopior av de ersatta filerna? + end + item: Radio Button + Rectangle=113 100 212 126 + Variable=DOBACKUP + Create Flags=01010000000000010000000000001001 + Text=&Yes (make backups) + Text=N&o (do not make backups) + Text= + Text French=&Oui + Text French=N&on + Text French= + Text German=&Ja + Text German=N&ein + Text German= + Text Portuguese=&Sim + Text Portuguese=Nã&o + Text Portuguese= + Text Spanish=&Sí + Text Spanish=N&o + Text Spanish= + Text Italian=&Sì + Text Italian=N&o + Text Italian= + Text Danish=&Ja + Text Danish=&Nej + Text Danish= + Text Dutch=&Ja + Text Dutch=N&ee + Text Dutch= + Text Norwegian=&Ja + Text Norwegian=&Nei + Text Norwegian= + Text Swedish=&Ja + Text Swedish=N&ej + Text Swedish= + end + item: Static + Control Name=BACK2 + Rectangle=86 138 256 166 + Action=1 + Create Flags=01010000000000000000000000000111 + Text=Backup File Destination Directory + Text French=Répertoire de destination des fichiers de sauvegarde + Text German=Zielverzeichnis für die Sicherungsdatei + Text Portuguese=Directório de destino de ficheiro de segurança + Text Spanish=Directorio de Destino de los Archivos de Seguridad + Text Italian=Directory di destinazione dei file di backup + Text Danish=Destinationsbibliotek til sikkerhedskopier + Text Dutch=Doeldirectory backup-bestand + Text Norwegian=Målkatalog for sikkerhetskopier + Text Swedish=Katalog för säkerhetskopierade filer + end + item: Push Button + Control Name=BACK3 + Rectangle=212 148 254 162 + Variable=BACKUP_SAVE + Value=%BACKUP% + Destination Dialog=1 + Action=2 + Create Flags=01010000000000010000000000000000 + Text=B&rowse... + Text French=P&arcourir + Text German=B&lättern... + Text Portuguese=P&rocurar + Text Spanish=V&isualizar... + Text Italian=Sfoglia... + Text Danish=&Gennemse... + Text Dutch=B&laderen... + Text Norwegian=Bla igjennom + Text Swedish=&Bläddra + end + item: Static + Control Name=BACK4 + Rectangle=103 150 203 160 + Destination Dialog=2 + Create Flags=01010000000000000000000000000000 + Text=%BACKUP% + Text French=%BACKUP% + Text German=%BACKUP% + Text Portuguese=%BACKUP% + Text Spanish=%BACKUP% + Text Italian=%BACKUP% + Text Danish=%BACKUP% + Text Dutch=%BACKUP% + Text Norwegian=%BACKUP% + Text Swedish=%BACKUP% + end + item: Static + Rectangle=86 9 258 29 + Create Flags=01010000000000000000000000000000 + Flags=0000000000000001 + Name=Times New Roman + Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18 + Text=Backup Replaced Files + Text French=Sélectionner les composants + Text German=Komponenten auswählen + Text Spanish=Seleccione componentes + Text Italian=Selezionare i componenti + end + item: If/While Statement + Variable=DOBACKUP + Value=B + end + item: Set Control Attribute + Control Name=BACK3 + Operation=1 + end + item: Set Control Attribute + Control Name=BACK4 + Operation=1 + end + item: Else Statement + end + item: Set Control Attribute + Control Name=BACK3 + end + item: Set Control Attribute + Control Name=BACK4 + end + item: End Block + end + end + item: Dialog + Title=Select Destination Directory + Title French=Choisissez le répertoire de destination + Title German=Zielverzeichnis wählen + Title Portuguese=Seleccionar Directório de Destino + Title Spanish=Seleccione el Directorio de Destino + Title Italian=Seleziona Directory di destinazione + Title Danish=Vælg Destinationsbibliotek + Title Dutch=Kies Doeldirectory + Title Norwegian=Velg målkatalog + Title Swedish=Välj destinationskalatog + Width=221 + Height=173 + Font Name=Helv + Font Size=8 + item: Listbox + Rectangle=5 2 160 149 + Variable=BACKUP + Create Flags=01010000100000010000000101000000 + Flags=0000110000100010 + Text=%BACKUP% + Text= + Text French=%BACKUP% + Text French= + Text German=%BACKUP% + Text German= + Text Portuguese=%BACKUP% + Text Portuguese= + Text Spanish=%BACKUP% + Text Spanish= + Text Italian=%BACKUP% + Text Italian= + Text Danish=%BACKUP% + Text Danish= + Text Dutch=%BACKUP% + Text Dutch= + Text Norwegian=%BACKUP% + Text Norwegian= + Text Swedish=%BACKUP% + Text Swedish= + end + item: Push Button + Rectangle=167 6 212 21 + Create Flags=01010000000000010000000000000001 + Text=OK + Text French=OK + Text German=OK + Text Portuguese=OK + Text Spanish=ACEPTAR + Text Italian=OK + Text Danish=OK + Text Dutch=OK + Text Norwegian=OK + Text Swedish=OK + end + item: Push Button + Rectangle=167 25 212 40 + Variable=BACKUP + Value=%BACKUP_SAVE% + Create Flags=01010000000000010000000000000000 + Flags=0000000000000001 + Text=Cancel + Text French=Annuler + Text German=Abbrechen + Text Portuguese=Cancelar + Text Spanish=Cancelar + Text Italian=Annulla + Text Danish=Slet + Text Dutch=Annuleren + Text Norwegian=Avbryt + Text Swedish=Avbryt + end + end + end + item: Custom Dialog Set Name=Select Components Display Variable=DISPLAY *************** *** 477,481 **** end item: Checkbox ! Rectangle=86 66 256 138 Variable=COMPONENTS Create Flags=01010000000000010000000000000011 --- 745,749 ---- end item: Checkbox ! Rectangle=86 62 256 134 Variable=COMPONENTS Create Flags=01010000000000010000000000000011 *************** *** 485,488 **** --- 753,757 ---- Text=Python utility scripts (Tools/) Text=Python test suite (Lib/test/) + Text=Register file extensons (requires Admin privs) Text= Text French=Python interpreter, library and Tcl/Tk *************** *** 490,493 **** --- 759,763 ---- Text French=Python utility scripts (Tools/) Text French=Python test suite (Lib/test/) + Text French=Register file extensons (requires Admin privs) Text French= Text German=Python interpreter, library and Tcl/Tk *************** *** 495,498 **** --- 765,769 ---- Text German=Python utility scripts (Tools/) Text German=Python test suite (Lib/test/) + Text German=Register file extensons (requires Admin privs) Text German= Text Spanish=Python interpreter, library and Tcl/Tk *************** *** 500,503 **** --- 771,775 ---- Text Spanish=Python utility scripts (Tools/) Text Spanish=Python test suite (Lib/test/) + Text Spanish=Register file extensons (requires Admin privs) Text Spanish= Text Italian=Python interpreter, library and Tcl/Tk *************** *** 505,508 **** --- 777,781 ---- Text Italian=Python utility scripts (Tools/) Text Italian=Python test suite (Lib/test/) + Text Italian=Register file extensons (requires Admin privs) Text Italian= end *************** *** 542,546 **** end item: Static ! Rectangle=86 42 256 61 Create Flags=01010000000000000000000000000000 Text=Choose which components to install by checking the boxes below. --- 815,819 ---- end item: Static ! Rectangle=86 38 256 57 Create Flags=01010000000000000000000000000000 Text=Choose which components to install by checking the boxes below. *************** *** 792,797 **** Text=This include script allows uninstall support end item: Include Script ! Pathname=%_WISE_%\INCLUDE\uninstal.wse end item: Remark --- 1065,1076 ---- Text=This include script allows uninstall support end + item: Remark + Text=Note from Tim: this is our own Uninstal.wse, a copy of Wise's except + end + item: Remark + Text=it writes to HKCU (instead of HKLM) if the user doesn't have admin privs. + end item: Include Script ! Pathname=.\Uninstal.wse end item: Remark *************** *** 898,905 **** --- 1177,1200 ---- item: Remark end + item: Check Configuration + Flags=10111111 + end item: Set Variable Variable=DLLDEST Value=%SYS32% end + item: Else Statement + end + item: Set Variable + Variable=DLLDEST + Value=%MAINDIR% + end + item: End Block + end + item: Remark + end + item: Remark + Text=Install the license even if they deselect everything . + end item: Install File Source=..\license *************** *** 920,923 **** --- 1215,1232 ---- end item: Remark + Text=These arrange to (recursively!) delete all .pyc and .pyo files at uninstall time. + end + item: Remark + Text=This "does the right thing": any directories left empty at the end are removed. + end + item: Add Text to INSTALL.LOG + Text=File Tree: %MAINDIR%\*.pyc + end + item: Add Text to INSTALL.LOG + Text=File Tree: %MAINDIR%\*.pyo + end + item: Remark + end + item: Remark Text=A: interpreter, libraries and Tcl/Tk end *************** *** 1142,1153 **** Text=Libraries (Lib/) end - item: Remark - Text=Remove entire Lib directory at uninstall time. - end - item: Add Text to INSTALL.LOG - Text=File Tree: %MAINDIR%\Lib\*.* - end - item: Remark - end item: Install File Source=..\lib\*.py --- 1451,1454 ---- *************** *** 1321,1332 **** Flags=00001010 end - item: Remark - Text=Delete entire Tools directory at uninstall time. - end - item: Add Text to INSTALL.LOG - Text=File Tree: %MAINDIR%\Tools\*.* - end - item: Remark - end item: Install File Source=..\tools\scripts\*.py --- 1622,1625 ---- *************** *** 1527,1530 **** --- 1820,1831 ---- end item: Remark + Text=Registering file extensions requires Admin privs. + end + item: If/While Statement + Variable=COMPONENTS + Value=E + Flags=00001010 + end + item: Remark Text=Register file extensions. end *************** *** 1606,1609 **** --- 1907,1912 ---- New Value=%MAINDIR%\pyc.ico end + item: End Block + end item: Remark end *************** *** 1732,1735 **** --- 2035,2044 ---- Text=Well, *this* is cryptic! It's setting up the app publisher and URL entries for Win2K add/remove. end + item: Remark + Text=Ack, and "Win2K" isn't enough either -- you can't actually do this without Admin privs too. + end + item: Check Configuration + Flags=10111111 + end item: Edit Registry Total Keys=3 *************** *** 1753,1759 **** --- 2062,2111 ---- end end + item: Else Statement + end + item: Remark + Text=Same thing, except write to HKCU instead. + end item: Remark + Text=Damn -- this "edit keys" cmd was created by the Installation Expert view, and I duplicated and + end + item: Remark + Text=edited it by hand. The info comes from the "Windows 2000" section of the Properties view, end item: Remark + Text=and if you change it there it will only show up in the "if" block above. + end + item: Remark + Text=Easiest to make corresponding changes in *this* block by editing this script in + end + item: Remark + Text=a plain text editor. + end + item: Edit Registry + Total Keys=3 + item: Key + Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% + New Value=http://www.python.org/ + Value Name=HelpLink + Root=1 + end + item: Key + Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% + New Value=PythonLabs at Zope Corporation + Value Name=Publisher + Root=1 + end + item: Key + Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% + New Value=http://www.python.org/ + Value Name=URLInfoAbout + Root=1 + end + end + item: End Block + end + item: Remark + end + item: Remark Text=Populate Start Menu end *************** *** 1834,1841 **** Direction Variable=DIRECTION Display Variable=DISPLAY ! Bitmap Pathname=%_WISE_%\Dialogs\Template\Wizard.bmp ! X Position=0 ! Y Position=0 ! Filler Color=0 end item: Custom Dialog Set --- 2186,2194 ---- Direction Variable=DIRECTION Display Variable=DISPLAY ! Bitmap Pathname=%_WISE_%\DIALOGS\TEMPLATE\WIZARD.BMP ! X Position=9 ! Y Position=10 ! Filler Color=8421440 ! Flags=00000011 end item: Custom Dialog Set *************** *** 1864,1878 **** end item: Push Button - Rectangle=105 187 150 202 - Variable=DISABLED - Value=! - Create Flags=01010000000000010000000000000000 - Text=< &Back - Text French=< &Retour - Text German=< &Zurück - Text Spanish=< &Atrás - Text Italian=< &Indietro - end - item: Push Button Rectangle=211 187 256 202 Variable=DISABLED --- 2217,2220 ---- *************** *** 1887,1895 **** end item: Static - Rectangle=8 180 256 181 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static Rectangle=86 8 258 42 Create Flags=01010000000000000000000000000000 --- 2229,2232 ---- *************** *** 1921,1924 **** --- 2258,2266 ---- Text Italian= Text Italian=Premere il pulsante Fine per uscire dall'installazione. + end + item: Static + Rectangle=8 180 256 181 + Action=3 + Create Flags=01010000000000000000000000000111 end end Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.dsp,v retrieving revision 1.15.2.6 retrieving revision 1.15.2.7 diff -C2 -d -r1.15.2.6 -r1.15.2.7 *** pythoncore.dsp 2001/07/17 04:51:54 1.15.2.6 --- pythoncore.dsp 2001/08/02 02:40:43 1.15.2.7 *************** *** 1179,1182 **** --- 1179,1197 ---- # Begin Source File + SOURCE=..\Python\mysnprintf.c + + !IF "$(CFG)" == "pythoncore - Win32 Release" + + !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" + + !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" + + !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Release" + + !ENDIF + + # End Source File + # Begin Source File + SOURCE=..\Python\mystrtoul.c From tim_one@users.sourceforge.net Thu Aug 2 03:40:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 19:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects object.c,2.124.4.24,2.124.4.25 stringobject.c,2.103.2.7,2.103.2.8 unicodeobject.c,2.87.2.7,2.87.2.8 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Objects Modified Files: Tag: descr-branch object.c stringobject.c unicodeobject.c Log Message: Mrege of trunk tag delta date2001-07-30 to date2001-08-01. Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.124.4.24 retrieving revision 2.124.4.25 diff -C2 -d -r2.124.4.24 -r2.124.4.25 *** object.c 2001/07/13 21:47:38 2.124.4.24 --- object.c 2001/08/02 02:40:43 2.124.4.25 *************** *** 1025,1033 **** } - /* Internal API needed by PyObject_GetAttr(): */ - extern - PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors); - PyObject * PyObject_GetAttr(PyObject *v, PyObject *name) --- 1025,1028 ---- Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.103.2.7 retrieving revision 2.103.2.8 diff -C2 -d -r2.103.2.7 -r2.103.2.8 *** stringobject.c 2001/07/07 22:55:30 2.103.2.7 --- stringobject.c 2001/08/02 02:40:43 2.103.2.8 *************** *** 334,342 **** } - /* Internal API needed by PyString_AsStringAndSize(): */ - extern - PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors); - int PyString_AsStringAndSize(register PyObject *obj, --- 334,337 ---- Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.87.2.7 retrieving revision 2.87.2.8 diff -C2 -d -r2.87.2.7 -r2.87.2.8 *** unicodeobject.c 2001/07/28 05:02:59 2.87.2.7 --- unicodeobject.c 2001/08/02 02:40:43 2.87.2.8 *************** *** 567,584 **** } - /* Return a Python string holding the default encoded value of the - Unicode object. - - The resulting string is cached in the Unicode object for subsequent - usage by this function. The cached version is needed to implement - the character buffer interface and will live (at least) as long as - the Unicode object itself. - - The refcount of the string is *not* incremented. - - *** Exported for internal use by the interpreter only !!! *** - - */ - PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, const char *errors) --- 567,570 ---- From tim_one@users.sourceforge.net Thu Aug 2 05:15:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src PLAN.txt,1.1,1.2 Makefile.pre.in,1.46,1.47 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv8810/python/dist/src Modified Files: Makefile.pre.in Added Files: PLAN.txt Log Message: Merge of descr-branch back into trunk. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Makefile.pre.in 2001/07/31 13:24:44 1.46 --- Makefile.pre.in 2001/08/02 04:15:00 1.47 *************** *** 238,241 **** --- 238,242 ---- Objects/cobject.o \ Objects/complexobject.o \ + Objects/descrobject.o \ Objects/fileobject.o \ Objects/floatobject.o \ *************** *** 439,442 **** --- 440,444 ---- Include/listobject.h \ Include/iterobject.h \ + Include/descrobject.h \ Include/dictobject.h \ Include/methodobject.h \ From tim_one@users.sourceforge.net Thu Aug 2 05:15:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.1,1.2 test_generators.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv8810/python/dist/src/Lib/test Modified Files: test_generators.py Added Files: test_descr.py Log Message: Merge of descr-branch back into trunk. Index: test_generators.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_generators.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** test_generators.py 2001/07/16 02:29:45 1.23 --- test_generators.py 2001/08/02 04:15:00 1.24 *************** *** 381,388 **** >>> type(i) >>> dir(i) ['gi_frame', 'gi_running', 'next'] >>> print i.next.__doc__ ! next() -- get the next value, or raise StopIteration >>> iter(i) is i 1 --- 381,394 ---- >>> type(i) + + XXX dir(object) *generally* doesn't return useful stuff in descr-branch. >>> dir(i) + [] + + Was hoping to see this instead: ['gi_frame', 'gi_running', 'next'] + >>> print i.next.__doc__ ! x.next() -> the next value, or raise StopIteration >>> iter(i) is i 1 *************** *** 400,404 **** Traceback (most recent call last): ... ! TypeError: object has read-only attributes >>> def g(): ... yield me.gi_running --- 406,410 ---- Traceback (most recent call last): ... ! TypeError: 'generator' object has only read-only attributes (assign to .gi_running) >>> def g(): ... yield me.gi_running From tim_one@users.sourceforge.net Thu Aug 2 05:15:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib pickle.py,1.48,1.49 repr.py,1.9,1.10 types.py,1.16,1.17 xmlrpclib.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv8810/python/dist/src/Lib Modified Files: pickle.py repr.py types.py xmlrpclib.py Log Message: Merge of descr-branch back into trunk. Index: pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** pickle.py 2001/04/10 05:02:52 1.48 --- pickle.py 2001/08/02 04:15:00 1.49 *************** *** 505,508 **** --- 505,509 ---- dispatch[FunctionType] = save_global dispatch[BuiltinFunctionType] = save_global + dispatch[TypeType] = save_global Index: repr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/repr.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** repr.py 2001/02/15 22:15:13 1.9 --- repr.py 2001/08/02 04:15:00 1.10 *************** *** 63,67 **** if n > self.maxdict: s = s + ', ...' return '{' + s + '}' ! def repr_string(self, x, level): s = `x[:self.maxstring]` if len(s) > self.maxstring: --- 63,67 ---- if n > self.maxdict: s = s + ', ...' return '{' + s + '}' ! def repr_str(self, x, level): s = `x[:self.maxstring]` if len(s) > self.maxstring: *************** *** 71,75 **** s = s[:i] + '...' + s[len(s)-j:] return s ! def repr_long_int(self, x, level): s = `x` # XXX Hope this isn't too slow... if len(s) > self.maxlong: --- 71,75 ---- s = s[:i] + '...' + s[len(s)-j:] return s ! def repr_long(self, x, level): s = `x` # XXX Hope this isn't too slow... if len(s) > self.maxlong: Index: types.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/types.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** types.py 2001/07/15 21:08:29 1.16 --- types.py 2001/08/02 04:15:00 1.17 *************** *** 8,12 **** NoneType = type(None) ! TypeType = type(NoneType) IntType = type(0) --- 8,13 ---- NoneType = type(None) ! TypeType = type ! ObjectType = object IntType = type(0) *************** *** 23,28 **** TupleType = type(()) ! ListType = type([]) ! DictType = DictionaryType = type({}) def _f(): pass --- 24,29 ---- TupleType = type(()) ! ListType = list ! DictType = DictionaryType = dictionary def _f(): pass *************** *** 71,74 **** --- 72,80 ---- SliceType = type(slice(0)) EllipsisType = type(Ellipsis) + + DictIterType = type(iter({})) + SequenceIterType = type(iter([])) + FunctionIterType = type(iter(lambda: 0, 0)) + DictProxyType = type(TypeType.__dict__) del sys, _f, _C, _x # Not for export Index: xmlrpclib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xmlrpclib.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 From tim_one@users.sourceforge.net Thu Aug 2 05:15:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.199,1.200 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv8810/python/dist/src/Misc Modified Files: NEWS Log Message: Merge of descr-branch back into trunk. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.199 retrieving revision 1.200 diff -C2 -d -r1.199 -r1.200 *** NEWS 2001/07/31 14:42:42 1.199 --- NEWS 2001/08/02 04:15:00 1.200 *************** *** 45,48 **** --- 45,59 ---- Core + - TENTATIVELY, a large amount of code implementing much of what's + described in PEP 252 (Making Types Look More Like Classes) and PEP + 253 (Subtyping Built-in Types) was added. This will be released + with Python 2.2a1. Documentation will be provided separately + through http://www.python.org/2.2/. The purpose of releasing this + with Python 2.2a1 is to test backwards compatibility. It is + possible, though not likely, that a decision is made not to release + this code as part of 2.2 final, if any serious backwards + incompapatibilities are found during alpha testing that cannot be + repaired. + - Generators were added; this is a new way to create an iterator (see below) using what looks like a simple function containing one or From tim_one@users.sourceforge.net Thu Aug 2 05:15:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules xxsubtype.c,1.1,2.1 Setup.dist,1.21,1.22 cPickle.c,2.60,2.61 config.c.in,1.73,1.74 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv8810/python/dist/src/Modules Modified Files: Setup.dist cPickle.c config.c.in Added Files: xxsubtype.c Log Message: Merge of descr-branch back into trunk. Index: Setup.dist =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/Setup.dist,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Setup.dist 2001/03/22 22:18:55 1.21 --- Setup.dist 2001/08/02 04:15:00 1.22 *************** *** 465,466 **** --- 465,468 ---- # xx xxmodule.c + # Another example -- the 'xxsubtype' module shows C-level subtyping in action + xxsubtype xxsubtype.c Index: cPickle.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v retrieving revision 2.60 retrieving revision 2.61 diff -C2 -d -r2.60 -r2.61 *** cPickle.c 2001/07/17 18:34:03 2.60 --- cPickle.c 2001/08/02 04:15:00 2.61 *************** *** 1870,1873 **** --- 1870,1877 ---- goto finally; } + if (type == &PyType_Type) { + res = save_global(self, args, NULL); + goto finally; + } break; Index: config.c.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/config.c.in,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** config.c.in 2001/01/23 21:46:57 1.73 --- config.c.in 2001/08/02 04:15:00 1.74 *************** *** 38,42 **** {"__builtin__", NULL}, {"sys", NULL}, ! {"exceptions", init_exceptions}, /* Sentinel */ --- 38,42 ---- {"__builtin__", NULL}, {"sys", NULL}, ! {"exceptions", NULL}, /* Sentinel */ From tim_one@users.sourceforge.net Thu Aug 2 05:15:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/PC config.c,1.31,1.32 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory usw-pr-cvs1:/tmp/cvs-serv8810/python/dist/src/PC Modified Files: config.c Log Message: Merge of descr-branch back into trunk. Index: config.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/config.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** config.c 2001/02/02 00:07:07 1.31 --- config.c 2001/08/02 04:15:00 1.32 *************** *** 45,48 **** --- 45,49 ---- extern void initxreadlines(void); extern void init_weakref(void); + extern void initxxsubtype(void); /* XXX tim: what's the purpose of ADDMODULE MARKER? */ *************** *** 98,101 **** --- 99,104 ---- {"xreadlines", initxreadlines}, {"_weakref", init_weakref}, + + {"xxsubtype", initxxsubtype}, /* XXX tim: what's the purpose of ADDMODULE MARKER? */ From tim_one@users.sourceforge.net Thu Aug 2 05:15:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include descrobject.h,1.1,2.1 Python.h,2.37,2.38 abstract.h,2.34,2.35 ceval.h,2.43,2.44 classobject.h,2.37,2.38 dictobject.h,2.20,2.21 eval.h,2.14,2.15 funcobject.h,2.23,2.24 listobject.h,2.21,2.22 modsupport.h,2.36,2.37 object.h,2.79,2.80 objimpl.h,2.34,2.35 patchlevel.h,2.50,2.51 pythonrun.h,2.43,2.44 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv8810/python/dist/src/Include Modified Files: Python.h abstract.h ceval.h classobject.h dictobject.h eval.h funcobject.h listobject.h modsupport.h object.h objimpl.h patchlevel.h pythonrun.h Added Files: descrobject.h Log Message: Merge of descr-branch back into trunk. Index: Python.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/Python.h,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -d -r2.37 -r2.38 *** Python.h 2001/07/26 21:34:59 2.37 --- Python.h 2001/08/02 04:15:00 2.38 *************** *** 90,93 **** --- 90,94 ---- #include "cellobject.h" #include "iterobject.h" + #include "descrobject.h" #include "codecs.h" Index: abstract.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/abstract.h,v retrieving revision 2.34 retrieving revision 2.35 diff -C2 -d -r2.34 -r2.35 *** abstract.h 2001/05/05 21:05:01 2.34 --- abstract.h 2001/08/02 04:15:00 2.35 *************** *** 295,298 **** --- 295,309 ---- + + DL_IMPORT(PyObject *) PyObject_Call(PyObject *callable_object, + PyObject *args, PyObject *kw); + + /* + + Call a callable Python object, callable_object, with + arguments and keywords arguments. The 'args' argument can not be + NULL, but the 'kw' argument can be NULL. + + */ DL_IMPORT(PyObject *) PyObject_CallObject(PyObject *callable_object, Index: ceval.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/ceval.h,v retrieving revision 2.43 retrieving revision 2.44 diff -C2 -d -r2.43 -r2.44 *** ceval.h 2001/07/16 02:29:45 2.43 --- ceval.h 2001/08/02 04:15:00 2.44 *************** *** 46,49 **** --- 46,52 ---- DL_IMPORT(int) Py_GetRecursionLimit(void); + DL_IMPORT(char *) PyEval_GetFuncName(PyObject *); + DL_IMPORT(char *) PyEval_GetFuncDesc(PyObject *); + /* Interface for threads. Index: classobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/classobject.h,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -d -r2.37 -r2.38 *** classobject.h 2001/03/23 04:17:58 2.37 --- classobject.h 2001/08/02 04:15:00 2.38 *************** *** 48,55 **** extern DL_IMPORT(PyObject *) PyMethod_New(PyObject *, PyObject *, PyObject *); - extern DL_IMPORT(PyObject *) PyMethod_Function(PyObject *); - extern DL_IMPORT(PyObject *) PyMethod_Self(PyObject *); - extern DL_IMPORT(PyObject *) PyMethod_Class(PyObject *); - /* Macros for direct access to these values. Type checks are *not* done, so use with care. */ --- 48,51 ---- Index: dictobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/dictobject.h,v retrieving revision 2.20 retrieving revision 2.21 diff -C2 -d -r2.20 -r2.21 *** dictobject.h 2000/09/01 23:29:26 2.20 --- dictobject.h 2001/08/02 04:15:00 2.21 *************** *** 8,14 **** /* Dictionary object type -- mapping from hashable object to object */ extern DL_IMPORT(PyTypeObject) PyDict_Type; ! #define PyDict_Check(op) ((op)->ob_type == &PyDict_Type) extern DL_IMPORT(PyObject *) PyDict_New(void); --- 8,88 ---- /* Dictionary object type -- mapping from hashable object to object */ + /* + There are three kinds of slots in the table: + + 1. Unused. me_key == me_value == NULL + Does not hold an active (key, value) pair now and never did. Unused can + transition to Active upon key insertion. This is the only case in which + me_key is NULL, and is each slot's initial state. + + 2. Active. me_key != NULL and me_key != dummy and me_value != NULL + Holds an active (key, value) pair. Active can transition to Dummy upon + key deletion. This is the only case in which me_value != NULL. + + 3. Dummy. me_key == dummy and me_value == NULL + Previously held an active (key, value) pair, but that was deleted and an + active pair has not yet overwritten the slot. Dummy can transition to + Active upon key insertion. Dummy slots cannot be made Unused again + (cannot have me_key set to NULL), else the probe sequence in case of + collision would have no way to know they were once active. + + Note: .popitem() abuses the me_hash field of an Unused or Dummy slot to + hold a search finger. The me_hash field of Unused or Dummy slots has no + meaning otherwise. + */ + + /* PyDict_MINSIZE is the minimum size of a dictionary. This many slots are + * allocated directly in the dict object (in the ma_smalltable member). + * It must be a power of 2, and at least 4. 8 allows dicts with no more + * than 5 active entries to live in ma_smalltable (and so avoid an + * additional malloc); instrumentation suggested this suffices for the + * majority of dicts (consisting mostly of usually-small instance dicts and + * usually-small dicts created to pass keyword arguments). + */ + #define PyDict_MINSIZE 8 + + typedef struct { + long me_hash; /* cached hash code of me_key */ + PyObject *me_key; + PyObject *me_value; + #ifdef USE_CACHE_ALIGNED + long aligner; + #endif + } PyDictEntry; + + /* + To ensure the lookup algorithm terminates, there must be at least one Unused + slot (NULL key) in the table. + The value ma_fill is the number of non-NULL keys (sum of Active and Dummy); + ma_used is the number of non-NULL, non-dummy keys (== the number of non-NULL + values == the number of Active items). + To avoid slowing down lookups on a near-full table, we resize the table when + it's two-thirds full. + */ + typedef struct _dictobject PyDictObject; + struct _dictobject { + PyObject_HEAD + int ma_fill; /* # Active + # Dummy */ + int ma_used; /* # Active */ + + /* The table contains ma_mask + 1 slots, and that's a power of 2. + * We store the mask instead of the size because the mask is more + * frequently needed. + */ + int ma_mask; + + /* ma_table points to ma_smalltable for small tables, else to + * additional malloc'ed memory. ma_table is never NULL! This rule + * saves repeated runtime null-tests in the workhorse getitem and + * setitem calls. + */ + PyDictEntry *ma_table; + PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, long hash); + PyDictEntry ma_smalltable[PyDict_MINSIZE]; + }; + extern DL_IMPORT(PyTypeObject) PyDict_Type; ! #define PyDict_Check(op) PyObject_TypeCheck(op, &PyDict_Type) extern DL_IMPORT(PyObject *) PyDict_New(void); *************** *** 24,27 **** --- 98,102 ---- extern DL_IMPORT(int) PyDict_Size(PyObject *mp); extern DL_IMPORT(PyObject *) PyDict_Copy(PyObject *mp); + extern DL_IMPORT(int) PyDict_Update(PyObject *mp, PyObject *other); Index: eval.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/eval.h,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -d -r2.14 -r2.15 *** eval.h 2000/09/01 23:29:26 2.14 --- eval.h 2001/08/02 04:15:00 2.15 *************** *** 10,13 **** --- 10,21 ---- DL_IMPORT(PyObject *) PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *); + DL_IMPORT(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co, + PyObject *globals, + PyObject *locals, + PyObject **args, int argc, + PyObject **kwds, int kwdc, + PyObject **defs, int defc, + PyObject *closure); + #ifdef __cplusplus } Index: funcobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/funcobject.h,v retrieving revision 2.23 retrieving revision 2.24 diff -C2 -d -r2.23 -r2.24 *** funcobject.h 2001/03/23 04:17:58 2.23 --- funcobject.h 2001/08/02 04:15:00 2.24 *************** *** 43,46 **** --- 43,53 ---- (((PyFunctionObject *)func) -> func_closure) + /* The classmethod and staticmethod types lives here, too */ + extern DL_IMPORT(PyTypeObject) PyClassMethod_Type; + extern DL_IMPORT(PyTypeObject) PyStaticMethod_Type; + + extern DL_IMPORT(PyObject *) PyClassMethod_New(PyObject *); + extern DL_IMPORT(PyObject *) PyStaticMethod_New(PyObject *); + #ifdef __cplusplus } Index: listobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/listobject.h,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** listobject.h 2000/09/01 23:29:26 2.21 --- listobject.h 2001/08/02 04:15:00 2.22 *************** *** 27,31 **** extern DL_IMPORT(PyTypeObject) PyList_Type; ! #define PyList_Check(op) ((op)->ob_type == &PyList_Type) extern DL_IMPORT(PyObject *) PyList_New(int size); --- 27,31 ---- extern DL_IMPORT(PyTypeObject) PyList_Type; ! #define PyList_Check(op) PyObject_TypeCheck(op, &PyList_Type) extern DL_IMPORT(PyObject *) PyList_New(int size); Index: modsupport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/modsupport.h,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -d -r2.36 -r2.37 *** modsupport.h 2001/01/25 22:13:34 2.36 --- modsupport.h 2001/08/02 04:15:00 2.37 *************** *** 23,28 **** extern DL_IMPORT(int) PyModule_AddStringConstant(PyObject *, char *, char *); ! #define PYTHON_API_VERSION 1010 ! #define PYTHON_API_STRING "1010" /* The API version is maintained (independently from the Python version) so we can detect mismatches between the interpreter and dynamically --- 23,28 ---- extern DL_IMPORT(int) PyModule_AddStringConstant(PyObject *, char *, char *); ! #define PYTHON_API_VERSION 1011 ! #define PYTHON_API_STRING "1011" /* The API version is maintained (independently from the Python version) so we can detect mismatches between the interpreter and dynamically *************** *** 37,40 **** --- 37,42 ---- Please add a line or two to the top of this log for each API version change: + + 17-Jul-2001 GvR 1011 Descr-branch, just to be on the safe side 25-Jan-2001 FLD 1010 Parameters added to PyCode_New() and Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.79 retrieving revision 2.80 diff -C2 -d -r2.79 -r2.80 *** object.h 2001/04/23 14:08:49 2.79 --- object.h 2001/08/02 04:15:00 2.80 *************** *** 203,206 **** --- 203,211 ---- typedef PyObject *(*getiterfunc) (PyObject *); typedef PyObject *(*iternextfunc) (PyObject *); + typedef PyObject *(*descrgetfunc) (PyObject *, PyObject *, PyObject *); + typedef int (*descrsetfunc) (PyObject *, PyObject *, PyObject *); + typedef int (*initproc)(PyObject *, PyObject *, PyObject *); + typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *); + typedef PyObject *(*allocfunc)(struct _typeobject *, int); typedef struct _typeobject { *************** *** 256,263 **** iternextfunc tp_iternext; #ifdef COUNT_ALLOCS /* these must be last and never explicitly initialized */ ! int tp_alloc; ! int tp_free; int tp_maxalloc; struct _typeobject *tp_next; --- 261,285 ---- iternextfunc tp_iternext; + /* Attribute descriptor and subclassing stuff */ + struct PyMethodDef *tp_methods; + struct memberlist *tp_members; + struct getsetlist *tp_getset; + struct _typeobject *tp_base; + PyObject *tp_dict; + descrgetfunc tp_descr_get; + descrsetfunc tp_descr_set; + long tp_dictoffset; + initproc tp_init; + allocfunc tp_alloc; + newfunc tp_new; + destructor tp_free; /* Low-level free-memory routine */ + PyObject *tp_bases; + PyObject *tp_mro; /* method resolution order */ + PyObject *tp_defined; + #ifdef COUNT_ALLOCS /* these must be last and never explicitly initialized */ ! int tp_allocs; ! int tp_frees; int tp_maxalloc; struct _typeobject *tp_next; *************** *** 265,272 **** } PyTypeObject; - extern DL_IMPORT(PyTypeObject) PyType_Type; /* The type of type objects */ ! #define PyType_Check(op) ((op)->ob_type == &PyType_Type) /* Generic operations on objects */ extern DL_IMPORT(int) PyObject_Print(PyObject *, FILE *, int); --- 287,307 ---- } PyTypeObject; ! /* Generic type check */ ! extern DL_IMPORT(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *); ! #define PyObject_TypeCheck(ob, tp) \ ! ((ob)->ob_type == (tp) || PyType_IsSubtype((ob)->ob_type, (tp))) + extern DL_IMPORT(PyTypeObject) PyType_Type; /* Metatype */ + extern DL_IMPORT(PyTypeObject) PyBaseObject_Type; /* Most base object type */ + + #define PyType_Check(op) PyObject_TypeCheck(op, &PyType_Type) + + extern DL_IMPORT(int) PyType_InitDict(PyTypeObject *); + extern DL_IMPORT(PyObject *) PyType_GenericAlloc(PyTypeObject *, int); + extern DL_IMPORT(PyObject *) PyType_GenericNew(PyTypeObject *, + PyObject *, PyObject *); + extern DL_IMPORT(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); + /* Generic operations on objects */ extern DL_IMPORT(int) PyObject_Print(PyObject *, FILE *, int); *************** *** 284,287 **** --- 319,326 ---- extern DL_IMPORT(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *); extern DL_IMPORT(int) PyObject_HasAttr(PyObject *, PyObject *); + extern DL_IMPORT(PyObject **) _PyObject_GetDictPtr(PyObject *); + extern DL_IMPORT(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *); + extern DL_IMPORT(int) PyObject_GenericSetAttr(PyObject *, + PyObject *, PyObject *); extern DL_IMPORT(long) PyObject_Hash(PyObject *); extern DL_IMPORT(int) PyObject_IsTrue(PyObject *); *************** *** 358,361 **** --- 397,412 ---- #define Py_TPFLAGS_HAVE_ITER (1L<<7) + /* Experimental stuff for healing the type/class split */ + #define Py_TPFLAGS_HAVE_CLASS (1L<<8) + + /* Set if the type object is dynamically allocated */ + #define Py_TPFLAGS_HEAPTYPE (1L<<9) + + /* Set if the type allows subclassing */ + #define Py_TPFLAGS_BASETYPE (1L<<10) + + /* Set if the type's __dict__ may change */ + #define Py_TPFLAGS_DYNAMICTYPE (1L<<11) + #define Py_TPFLAGS_DEFAULT ( \ Py_TPFLAGS_HAVE_GETCHARBUFFER | \ *************** *** 365,368 **** --- 416,420 ---- Py_TPFLAGS_HAVE_WEAKREFS | \ Py_TPFLAGS_HAVE_ITER | \ + Py_TPFLAGS_HAVE_CLASS | \ 0) *************** *** 413,418 **** #ifndef Py_TRACE_REFS #ifdef COUNT_ALLOCS ! #define _Py_Dealloc(op) ((op)->ob_type->tp_free++, (*(op)->ob_type->tp_dealloc)((PyObject *)(op))) ! #define _Py_ForgetReference(op) ((op)->ob_type->tp_free++) #else /* !COUNT_ALLOCS */ #define _Py_Dealloc(op) (*(op)->ob_type->tp_dealloc)((PyObject *)(op)) --- 465,470 ---- #ifndef Py_TRACE_REFS #ifdef COUNT_ALLOCS ! #define _Py_Dealloc(op) ((op)->ob_type->tp_frees++, (*(op)->ob_type->tp_dealloc)((PyObject *)(op))) ! #define _Py_ForgetReference(op) ((op)->ob_type->tp_frees++) #else /* !COUNT_ALLOCS */ #define _Py_Dealloc(op) (*(op)->ob_type->tp_dealloc)((PyObject *)(op)) Index: objimpl.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/objimpl.h,v retrieving revision 2.34 retrieving revision 2.35 diff -C2 -d -r2.34 -r2.35 *** objimpl.h 2001/03/22 18:26:47 2.34 --- objimpl.h 2001/08/02 04:15:00 2.35 *************** *** 237,241 **** #define PyObject_AS_GC(op) (op) #define PyObject_FROM_GC(op) (op) ! #else --- 237,247 ---- #define PyObject_AS_GC(op) (op) #define PyObject_FROM_GC(op) (op) ! #define PyType_IS_GC(t) 0 ! #define PyObject_IS_GC(o) 0 ! #define PyObject_AS_GC(o) (o) ! #define PyObject_FROM_GC(o) (o) ! #define PyType_BASICSIZE(t) ((t)->tp_basicsize) ! #define PyType_SET_BASICSIZE(t, s) ((t)->tp_basicsize = (s)) ! #else *************** *** 269,272 **** --- 275,285 ---- /* Get the object given the PyGC_Head */ #define PyObject_FROM_GC(g) ((PyObject *)(((PyGC_Head *)g)+1)) + + /* Calculate tp_basicsize excluding PyGC_HEAD_SIZE if applicable */ + #define PyType_BASICSIZE(t) (!PyType_IS_GC(t) ? (t)->tp_basicsize : \ + (t)->tp_basicsize - PyGC_HEAD_SIZE) + #define PyType_SET_BASICSIZE(t, s) (!PyType_IS_GC(t) ? \ + ((t)->tp_basicsize = (s)) : \ + ((t)->tp_basicsize = (s) + PyGC_HEAD_SIZE)) extern DL_IMPORT(void) _PyGC_Dump(PyGC_Head *); Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.50 retrieving revision 2.51 diff -C2 -d -r2.50 -r2.51 *** patchlevel.h 2001/04/18 04:31:01 2.50 --- patchlevel.h 2001/08/02 04:15:00 2.51 *************** *** 24,34 **** #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA ! #define PY_RELEASE_SERIAL 0 /* Version as a string */ ! #define PY_VERSION "2.2a0" /* Historic */ ! #define PATCHLEVEL "2.2a0" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 24,34 ---- #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA ! #define PY_RELEASE_SERIAL 1 /* Version as a string */ ! #define PY_VERSION "2.2a1" /* Historic */ ! #define PATCHLEVEL "2.2a1" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. Index: pythonrun.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v retrieving revision 2.43 retrieving revision 2.44 diff -C2 -d -r2.43 -r2.44 *** pythonrun.h 2001/07/16 05:37:24 2.43 --- pythonrun.h 2001/08/02 04:15:00 2.44 *************** *** 93,100 **** DL_IMPORT(PyObject *) _PySys_Init(void); DL_IMPORT(void) _PyImport_Init(void); ! DL_IMPORT(void) init_exceptions(void); /* Various internal finalizers */ ! DL_IMPORT(void) fini_exceptions(void); DL_IMPORT(void) _PyImport_Fini(void); DL_IMPORT(void) PyMethod_Fini(void); --- 93,100 ---- DL_IMPORT(PyObject *) _PySys_Init(void); DL_IMPORT(void) _PyImport_Init(void); ! DL_IMPORT(void) _PyExc_Init(void); /* Various internal finalizers */ ! DL_IMPORT(void) _PyExc_Fini(void); DL_IMPORT(void) _PyImport_Fini(void); DL_IMPORT(void) PyMethod_Fini(void); From tim_one@users.sourceforge.net Thu Aug 2 05:15:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild pythoncore.dsp,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv8810/python/dist/src/PCbuild Modified Files: pythoncore.dsp Log Message: Merge of descr-branch back into trunk. Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.dsp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pythoncore.dsp 2001/07/31 22:10:28 1.18 --- pythoncore.dsp 2001/08/02 04:15:00 1.19 *************** *** 496,499 **** --- 496,514 ---- # Begin Source File + SOURCE=..\Objects\descrobject.c + + !IF "$(CFG)" == "pythoncore - Win32 Release" + + !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" + + !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" + + !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Release" + + !ENDIF + + # End Source File + # Begin Source File + SOURCE=..\Objects\dictobject.c *************** *** 1724,1727 **** --- 1739,1757 ---- SOURCE=..\Modules\xreadlinesmodule.c + + !IF "$(CFG)" == "pythoncore - Win32 Release" + + !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" + + !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" + + !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Release" + + !ENDIF + + # End Source File + # Begin Source File + + SOURCE=..\Modules\xxsubtype.c !IF "$(CFG)" == "pythoncore - Win32 Release" From tim_one@users.sourceforge.net Thu Aug 2 05:15:03 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:15:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.221,2.222 ceval.c,2.262,2.263 exceptions.c,1.24,1.25 import.c,2.180,2.181 pythonrun.c,2.139,2.140 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv8810/python/dist/src/Python Modified Files: bltinmodule.c ceval.c exceptions.c import.c pythonrun.c Log Message: Merge of descr-branch back into trunk. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.221 retrieving revision 2.222 diff -C2 -d -r2.221 -r2.222 *** bltinmodule.c 2001/07/30 22:45:19 2.221 --- bltinmodule.c 2001/08/02 04:15:00 2.222 *************** *** 133,156 **** static PyObject * - builtin_unicode(PyObject *self, PyObject *args) - { - PyObject *v; - char *encoding = NULL; - char *errors = NULL; - - if ( !PyArg_ParseTuple(args, "O|ss:unicode", &v, &encoding, &errors) ) - return NULL; - return PyUnicode_FromEncodedObject(v, encoding, errors); - } - - static char unicode_doc[] = - "unicode(string [, encoding[, errors]]) -> object\n\ - \n\ - Create a new Unicode object from the given encoded string.\n\ - encoding defaults to the current default string encoding and \n\ - errors, defining the error handling, to 'strict'."; - - - static PyObject * builtin_callable(PyObject *self, PyObject *args) { --- 133,136 ---- *************** *** 436,691 **** - #ifndef WITHOUT_COMPLEX - - static PyObject * - complex_from_string(PyObject *v) - { - extern double strtod(const char *, char **); - const char *s, *start; - char *end; - double x=0.0, y=0.0, z; - int got_re=0, got_im=0, done=0; - int digit_or_dot; - int sw_error=0; - int sign; - char buffer[256]; /* For errors */ - char s_buffer[256]; - int len; - - if (PyString_Check(v)) { - s = PyString_AS_STRING(v); - len = PyString_GET_SIZE(v); - } - else if (PyUnicode_Check(v)) { - if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) { - PyErr_SetString(PyExc_ValueError, - "complex() literal too large to convert"); - return NULL; - } - if (PyUnicode_EncodeDecimal(PyUnicode_AS_UNICODE(v), - PyUnicode_GET_SIZE(v), - s_buffer, - NULL)) - return NULL; - s = s_buffer; - len = (int)strlen(s); - } - else if (PyObject_AsCharBuffer(v, &s, &len)) { - PyErr_SetString(PyExc_TypeError, - "complex() arg is not a string"); - return NULL; - } - - /* position on first nonblank */ - start = s; - while (*s && isspace(Py_CHARMASK(*s))) - s++; - if (s[0] == '\0') { - PyErr_SetString(PyExc_ValueError, - "complex() arg is an empty string"); - return NULL; - } - - z = -1.0; - sign = 1; - do { - - switch (*s) { - - case '\0': - if (s-start != len) { - PyErr_SetString( - PyExc_ValueError, - "complex() arg contains a null byte"); - return NULL; - } - if(!done) sw_error=1; - break; - - case '-': - sign = -1; - /* Fallthrough */ - case '+': - if (done) sw_error=1; - s++; - if ( *s=='\0'||*s=='+'||*s=='-' || - isspace(Py_CHARMASK(*s)) ) sw_error=1; - break; - - case 'J': - case 'j': - if (got_im || done) { - sw_error = 1; - break; - } - if (z<0.0) { - y=sign; - } - else{ - y=sign*z; - } - got_im=1; - s++; - if (*s!='+' && *s!='-' ) - done=1; - break; - - default: - if (isspace(Py_CHARMASK(*s))) { - while (*s && isspace(Py_CHARMASK(*s))) - s++; - if (s[0] != '\0') - sw_error=1; - else - done = 1; - break; - } - digit_or_dot = - (*s=='.' || isdigit(Py_CHARMASK(*s))); - if (done||!digit_or_dot) { - sw_error=1; - break; - } - errno = 0; - PyFPE_START_PROTECT("strtod", return 0) - z = strtod(s, &end) ; - PyFPE_END_PROTECT(z) - if (errno != 0) { - sprintf(buffer, - "float() out of range: %.150s", s); - PyErr_SetString( - PyExc_ValueError, - buffer); - return NULL; - } - s=end; - if (*s=='J' || *s=='j') { - - break; - } - if (got_re) { - sw_error=1; - break; - } - - /* accept a real part */ - x=sign*z; - got_re=1; - if (got_im) done=1; - z = -1.0; - sign = 1; - break; - - } /* end of switch */ - - } while (*s!='\0' && !sw_error); - - if (sw_error) { - PyErr_SetString(PyExc_ValueError, - "complex() arg is a malformed string"); - return NULL; - } - - return PyComplex_FromDoubles(x,y); - } - static PyObject * - builtin_complex(PyObject *self, PyObject *args) - { - PyObject *r, *i, *tmp; - PyNumberMethods *nbr, *nbi = NULL; - Py_complex cr, ci; - int own_r = 0; - - i = NULL; - if (!PyArg_ParseTuple(args, "O|O:complex", &r, &i)) - return NULL; - if (PyString_Check(r) || PyUnicode_Check(r)) - return complex_from_string(r); - if ((nbr = r->ob_type->tp_as_number) == NULL || - nbr->nb_float == NULL || - (i != NULL && - ((nbi = i->ob_type->tp_as_number) == NULL || - nbi->nb_float == NULL))) { - PyErr_SetString(PyExc_TypeError, - "complex() arg can't be converted to complex"); - return NULL; - } - /* XXX Hack to support classes with __complex__ method */ - if (PyInstance_Check(r)) { - static PyObject *complexstr; - PyObject *f; - if (complexstr == NULL) { - complexstr = PyString_InternFromString("__complex__"); - if (complexstr == NULL) - return NULL; - } - f = PyObject_GetAttr(r, complexstr); - if (f == NULL) - PyErr_Clear(); - else { - PyObject *args = Py_BuildValue("()"); - if (args == NULL) - return NULL; - r = PyEval_CallObject(f, args); - Py_DECREF(args); - Py_DECREF(f); - if (r == NULL) - return NULL; - own_r = 1; - } - } - if (PyComplex_Check(r)) { - cr = ((PyComplexObject*)r)->cval; - if (own_r) { - Py_DECREF(r); - } - } - else { - tmp = PyNumber_Float(r); - if (own_r) { - Py_DECREF(r); - } - if (tmp == NULL) - return NULL; - if (!PyFloat_Check(tmp)) { - PyErr_SetString(PyExc_TypeError, - "float(r) didn't return a float"); - Py_DECREF(tmp); - return NULL; - } - cr.real = PyFloat_AsDouble(tmp); - Py_DECREF(tmp); - cr.imag = 0.0; - } - if (i == NULL) { - ci.real = 0.0; - ci.imag = 0.0; - } - else if (PyComplex_Check(i)) - ci = ((PyComplexObject*)i)->cval; - else { - tmp = (*nbi->nb_float)(i); - if (tmp == NULL) - return NULL; - ci.real = PyFloat_AsDouble(tmp); - Py_DECREF(tmp); - ci.imag = 0.; - } - cr.real -= ci.imag; - cr.imag += ci.real; - return PyComplex_FromCComplex(cr); - } - - static char complex_doc[] = - "complex(real[, imag]) -> complex number\n\ - \n\ - Create a complex number from a real part and an optional imaginary part.\n\ - This is equivalent to (real + imag*1j) where imag defaults to 0."; - - - #endif - - static PyObject * builtin_dir(PyObject *self, PyObject *args) { --- 416,420 ---- *************** *** 1061,1066 **** if (curlen < 0) curlen = 8; /* arbitrary */ ! if (curlen > len) ! len = curlen; } --- 790,795 ---- if (curlen < 0) curlen = 8; /* arbitrary */ ! if (curlen > len) ! len = curlen; } *************** *** 1302,1390 **** static PyObject * - builtin_int(PyObject *self, PyObject *args) - { - PyObject *v; - int base = -909; /* unlikely! */ - - if (!PyArg_ParseTuple(args, "O|i:int", &v, &base)) - return NULL; - if (base == -909) - return PyNumber_Int(v); - else if (PyString_Check(v)) - return PyInt_FromString(PyString_AS_STRING(v), NULL, base); - else if (PyUnicode_Check(v)) - return PyInt_FromUnicode(PyUnicode_AS_UNICODE(v), - PyUnicode_GET_SIZE(v), - base); - else { - PyErr_SetString(PyExc_TypeError, - "int() can't convert non-string with explicit base"); - return NULL; - } - } - - static char int_doc[] = - "int(x[, base]) -> integer\n\ - \n\ - Convert a string or number to an integer, if possible. A floating point\n\ - argument will be truncated towards zero (this does not include a string\n\ - representation of a floating point number!) When converting a string, use\n\ - the optional base. It is an error to supply a base when converting a\n\ - non-string."; - - - static PyObject * - builtin_long(PyObject *self, PyObject *args) - { - PyObject *v; - int base = -909; /* unlikely! */ - - if (!PyArg_ParseTuple(args, "O|i:long", &v, &base)) - return NULL; - if (base == -909) - return PyNumber_Long(v); - else if (PyString_Check(v)) - return PyLong_FromString(PyString_AS_STRING(v), NULL, base); - else if (PyUnicode_Check(v)) - return PyLong_FromUnicode(PyUnicode_AS_UNICODE(v), - PyUnicode_GET_SIZE(v), - base); - else { - PyErr_SetString(PyExc_TypeError, - "long() can't convert non-string with explicit base"); - return NULL; - } - } - - static char long_doc[] = - "long(x) -> long integer\n\ - long(x, base) -> long integer\n\ - \n\ - Convert a string or number to a long integer, if possible. A floating\n\ - point argument will be truncated towards zero (this does not include a\n\ - string representation of a floating point number!) When converting a\n\ - string, use the given base. It is an error to supply a base when\n\ - converting a non-string."; - - - static PyObject * - builtin_float(PyObject *self, PyObject *args) - { - PyObject *v; - - if (!PyArg_ParseTuple(args, "O:float", &v)) - return NULL; - if (PyString_Check(v)) - return PyFloat_FromString(v, NULL); - return PyNumber_Float(v); - } - - static char float_doc[] = - "float(x) -> floating point number\n\ - \n\ - Convert a string or number to a floating point number, if possible."; - - - static PyObject * builtin_iter(PyObject *self, PyObject *args) { --- 1031,1034 ---- *************** *** 1433,1452 **** static PyObject * - builtin_list(PyObject *self, PyObject *args) - { - PyObject *v; - - if (!PyArg_ParseTuple(args, "O:list", &v)) - return NULL; - return PySequence_List(v); - } - - static char list_doc[] = - "list(sequence) -> list\n\ - \n\ - Return a new list whose items are the same as those of the argument sequence."; - - - static PyObject * builtin_slice(PyObject *self, PyObject *args) { --- 1077,1080 ---- *************** *** 2034,2089 **** static PyObject * - builtin_str(PyObject *self, PyObject *args) - { - PyObject *v; - - if (!PyArg_ParseTuple(args, "O:str", &v)) - return NULL; - return PyObject_Str(v); - } - - static char str_doc[] = - "str(object) -> string\n\ - \n\ - Return a nice string representation of the object.\n\ - If the argument is a string, the return value is the same object."; - - - static PyObject * - builtin_tuple(PyObject *self, PyObject *args) - { - PyObject *v; - - if (!PyArg_ParseTuple(args, "O:tuple", &v)) - return NULL; - return PySequence_Tuple(v); - } - - static char tuple_doc[] = - "tuple(sequence) -> list\n\ - \n\ - Return a tuple whose items are the same as those of the argument sequence.\n\ - If the argument is a tuple, the return value is the same object."; - - - static PyObject * - builtin_type(PyObject *self, PyObject *args) - { - PyObject *v; - - if (!PyArg_ParseTuple(args, "O:type", &v)) - return NULL; - v = (PyObject *)v->ob_type; - Py_INCREF(v); - return v; - } - - static char type_doc[] = - "type(object) -> type object\n\ - \n\ - Return the type of the object."; - - - static PyObject * builtin_vars(PyObject *self, PyObject *args) { --- 1662,1665 ---- *************** *** 2256,2262 **** {"coerce", builtin_coerce, 1, coerce_doc}, {"compile", builtin_compile, 1, compile_doc}, - #ifndef WITHOUT_COMPLEX - {"complex", builtin_complex, 1, complex_doc}, - #endif {"delattr", builtin_delattr, 1, delattr_doc}, {"dir", builtin_dir, 1, dir_doc}, --- 1832,1835 ---- *************** *** 2265,2269 **** {"execfile", builtin_execfile, 1, execfile_doc}, {"filter", builtin_filter, 1, filter_doc}, - {"float", builtin_float, 1, float_doc}, {"getattr", builtin_getattr, 1, getattr_doc}, {"globals", builtin_globals, 1, globals_doc}, --- 1838,1841 ---- *************** *** 2274,2285 **** {"input", builtin_input, 1, input_doc}, {"intern", builtin_intern, 1, intern_doc}, - {"int", builtin_int, 1, int_doc}, {"isinstance", builtin_isinstance, 1, isinstance_doc}, {"issubclass", builtin_issubclass, 1, issubclass_doc}, {"iter", builtin_iter, 1, iter_doc}, {"len", builtin_len, 1, len_doc}, - {"list", builtin_list, 1, list_doc}, {"locals", builtin_locals, 1, locals_doc}, - {"long", builtin_long, 1, long_doc}, {"map", builtin_map, 1, map_doc}, {"max", builtin_max, 1, max_doc}, --- 1846,1854 ---- *************** *** 2297,2304 **** {"setattr", builtin_setattr, 1, setattr_doc}, {"slice", builtin_slice, 1, slice_doc}, - {"str", builtin_str, 1, str_doc}, - {"tuple", builtin_tuple, 1, tuple_doc}, - {"type", builtin_type, 1, type_doc}, - {"unicode", builtin_unicode, 1, unicode_doc}, {"unichr", builtin_unichr, 1, unichr_doc}, {"vars", builtin_vars, 1, vars_doc}, --- 1866,1869 ---- *************** *** 2329,2332 **** --- 1894,1933 ---- if (PyDict_SetItemString(dict, "NotImplemented", Py_NotImplemented) < 0) + return NULL; + if (PyDict_SetItemString(dict, "classmethod", + (PyObject *) &PyClassMethod_Type) < 0) + return NULL; + #ifndef WITHOUT_COMPLEX + if (PyDict_SetItemString(dict, "complex", + (PyObject *) &PyComplex_Type) < 0) + return NULL; + #endif + if (PyDict_SetItemString(dict, "dictionary", + (PyObject *) &PyDict_Type) < 0) + return NULL; + if (PyDict_SetItemString(dict, "float", + (PyObject *) &PyFloat_Type) < 0) + return NULL; + if (PyDict_SetItemString(dict, "int", (PyObject *) &PyInt_Type) < 0) + return NULL; + if (PyDict_SetItemString(dict, "list", (PyObject *) &PyList_Type) < 0) + return NULL; + if (PyDict_SetItemString(dict, "long", (PyObject *) &PyLong_Type) < 0) + return NULL; + if (PyDict_SetItemString(dict, "object", + (PyObject *) &PyBaseObject_Type) < 0) + return NULL; + if (PyDict_SetItemString(dict, "staticmethod", + (PyObject *) &PyStaticMethod_Type) < 0) + return NULL; + if (PyDict_SetItemString(dict, "str", (PyObject *) &PyString_Type) < 0) + return NULL; + if (PyDict_SetItemString(dict, "tuple", + (PyObject *) &PyTuple_Type) < 0) + return NULL; + if (PyDict_SetItemString(dict, "type", (PyObject *) &PyType_Type) < 0) + return NULL; + if (PyDict_SetItemString(dict, "unicode", + (PyObject *) &PyUnicode_Type) < 0) return NULL; debug = PyInt_FromLong(Py_OptimizeFlag == 0); Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.262 retrieving revision 2.263 diff -C2 -d -r2.262 -r2.263 *** ceval.c 2001/07/16 02:29:45 2.262 --- ceval.c 2001/08/02 04:15:00 2.263 *************** *** 14,17 **** --- 14,18 ---- #include "eval.h" #include "opcode.h" + #include "structmember.h" #ifdef macintosh *************** *** 33,47 **** /* Forward declarations */ - - static PyObject *eval_code2(PyCodeObject *, - PyObject *, PyObject *, - PyObject **, int, - PyObject **, int, - PyObject **, int, - PyObject *); - static PyObject *eval_frame(PyFrameObject *); - static char *get_func_name(PyObject *); - static char *get_func_desc(PyObject *); static PyObject *call_object(PyObject *, PyObject *, PyObject *); static PyObject *call_cfunction(PyObject *, PyObject *, PyObject *); --- 34,38 ---- *************** *** 99,103 **** #endif - staticforward PyTypeObject gentype; --- 90,93 ---- *************** *** 211,233 **** {NULL, NULL} /* Sentinel */ }; - - static PyObject * - gen_getattr(genobject *gen, char *name) - { - PyObject *result; ! if (strcmp(name, "gi_frame") == 0) { ! result = (PyObject *)gen->gi_frame; ! assert(result != NULL); ! Py_INCREF(result); ! } ! else if (strcmp(name, "gi_running") == 0) ! result = (PyObject *)PyInt_FromLong((long)gen->gi_running); ! else if (strcmp(name, "__members__") == 0) ! result = Py_BuildValue("[ss]", "gi_frame", "gi_running"); ! else ! result = Py_FindMethod(gen_methods, (PyObject *)gen, name); ! return result; ! } statichere PyTypeObject gentype = { --- 201,210 ---- {NULL, NULL} /* Sentinel */ }; ! static struct memberlist gen_memberlist[] = { ! {"gi_frame", T_OBJECT, offsetof(genobject, gi_frame), RO}, ! {"gi_running", T_INT, offsetof(genobject, gi_running), RO}, ! {NULL} /* Sentinel */ ! }; statichere PyTypeObject gentype = { *************** *** 240,244 **** (destructor)gen_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! (getattrfunc)gen_getattr, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ --- 217,221 ---- (destructor)gen_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ *************** *** 250,254 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ --- 227,231 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ *************** *** 261,264 **** --- 238,246 ---- (getiterfunc)gen_getiter, /* tp_iter */ (iternextfunc)gen_iternext, /* tp_iternext */ + gen_methods, /* tp_methods */ + gen_memberlist, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ }; *************** *** 506,510 **** PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals) { ! return eval_code2(co, globals, locals, (PyObject **)NULL, 0, --- 488,492 ---- PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals) { ! return PyEval_EvalCodeEx(co, globals, locals, (PyObject **)NULL, 0, *************** *** 517,521 **** /* Interpreter main loop */ ! PyObject * eval_frame(PyFrameObject *f) { --- 499,503 ---- /* Interpreter main loop */ ! static PyObject * eval_frame(PyFrameObject *f) { *************** *** 966,970 **** w = POP(); v = POP(); ! if (PyList_Check(v) && PyInt_Check(w)) { /* INLINE: list[int] */ long i = PyInt_AsLong(w); --- 948,952 ---- w = POP(); v = POP(); ! if (v->ob_type == &PyList_Type && PyInt_Check(w)) { /* INLINE: list[int] */ long i = PyInt_AsLong(w); *************** *** 2274,2279 **** } ! static PyObject * ! eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals, PyObject **args, int argcount, PyObject **kws, int kwcount, PyObject **defs, int defcount, PyObject *closure) --- 2256,2261 ---- } ! PyObject * ! PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals, PyObject **args, int argcount, PyObject **kws, int kwcount, PyObject **defs, int defcount, PyObject *closure) *************** *** 2974,2978 **** } ! result = call_object(func, arg, kw); Py_DECREF(arg); return result; --- 2956,2960 ---- } ! result = PyObject_Call(func, arg, kw); Py_DECREF(arg); return result; *************** *** 2980,2984 **** /* How often is each kind of object called? The answer depends on the ! program. An instrumented call_object() was used to run the Python regression test suite. The results were: 4200000 PyCFunctions --- 2962,2966 ---- /* How often is each kind of object called? The answer depends on the ! program. An instrumented PyObject_Call() was used to run the Python regression test suite. The results were: 4200000 PyCFunctions *************** *** 2993,3001 **** */ ! static char * ! get_func_name(PyObject *func) { if (PyMethod_Check(func)) ! return get_func_name(PyMethod_GET_FUNCTION(func)); else if (PyFunction_Check(func)) return PyString_AsString(((PyFunctionObject*)func)->func_name); --- 2975,2983 ---- */ ! char * ! PyEval_GetFuncName(PyObject *func) { if (PyMethod_Check(func)) ! return PyEval_GetFuncName(PyMethod_GET_FUNCTION(func)); else if (PyFunction_Check(func)) return PyString_AsString(((PyFunctionObject*)func)->func_name); *************** *** 3012,3017 **** } ! static char * ! get_func_desc(PyObject *func) { if (PyMethod_Check(func)) --- 2994,2999 ---- } ! char * ! PyEval_GetFuncDesc(PyObject *func) { if (PyMethod_Check(func)) *************** *** 3137,3141 **** "unbound method %s%s must be " "called with instance as first argument", ! get_func_name(func), get_func_desc(func)); return NULL; } --- 3119,3124 ---- "unbound method %s%s must be " "called with instance as first argument", ! PyEval_GetFuncName(func), ! PyEval_GetFuncDesc(func)); return NULL; } *************** *** 3200,3204 **** } ! result = eval_code2( (PyCodeObject *)PyFunction_GET_CODE(func), PyFunction_GET_GLOBALS(func), (PyObject *)NULL, --- 3183,3187 ---- } ! result = PyEval_EvalCodeEx( (PyCodeObject *)PyFunction_GET_CODE(func), PyFunction_GET_GLOBALS(func), (PyObject *)NULL, *************** *** 3256,3260 **** nd = ((PyTupleObject *)argdefs)->ob_size; } ! return eval_code2((PyCodeObject *)co, globals, (PyObject *)NULL, (*pp_stack)-n, na, (*pp_stack)-2*nk, nk, d, nd, --- 3239,3243 ---- nd = ((PyTupleObject *)argdefs)->ob_size; } ! return PyEval_EvalCodeEx((PyCodeObject *)co, globals, (PyObject *)NULL, (*pp_stack)-n, na, (*pp_stack)-2*nk, nk, d, nd, *************** *** 3283,3288 **** "%.200s%s got multiple values " "for keyword argument '%.200s'", ! get_func_name(func), ! get_func_desc(func), PyString_AsString(key)); Py_DECREF(key); --- 3266,3271 ---- "%.200s%s got multiple values " "for keyword argument '%.200s'", ! PyEval_GetFuncName(func), ! PyEval_GetFuncDesc(func), PyString_AsString(key)); Py_DECREF(key); *************** *** 3357,3361 **** if (callargs == NULL) goto call_fail; ! result = call_object(func, callargs, kwdict); call_fail: Py_XDECREF(callargs); --- 3340,3344 ---- if (callargs == NULL) goto call_fail; ! result = PyObject_Call(func, callargs, kwdict); call_fail: Py_XDECREF(callargs); *************** *** 3379,3384 **** "%s%s argument after ** " "must be a dictionary", ! get_func_name(func), ! get_func_desc(func)); goto ext_call_fail; } --- 3362,3367 ---- "%s%s argument after ** " "must be a dictionary", ! PyEval_GetFuncName(func), ! PyEval_GetFuncDesc(func)); goto ext_call_fail; } *************** *** 3394,3399 **** "%s%s argument after * " "must be a sequence", ! get_func_name(func), ! get_func_desc(func)); } goto ext_call_fail; --- 3377,3382 ---- "%s%s argument after * " "must be a sequence", ! PyEval_GetFuncName(func), ! PyEval_GetFuncDesc(func)); } goto ext_call_fail; *************** *** 3412,3416 **** if (callargs == NULL) goto ext_call_fail; ! result = call_object(func, callargs, kwdict); ext_call_fail: Py_XDECREF(callargs); --- 3395,3399 ---- if (callargs == NULL) goto ext_call_fail; ! result = PyObject_Call(func, callargs, kwdict); ext_call_fail: Py_XDECREF(callargs); *************** *** 3633,3693 **** build_class(PyObject *methods, PyObject *bases, PyObject *name) { ! int i, n; ! if (!PyTuple_Check(bases)) { ! PyErr_SetString(PyExc_SystemError, ! "build_class with non-tuple bases"); ! return NULL; ! } ! if (!PyDict_Check(methods)) { ! PyErr_SetString(PyExc_SystemError, ! "build_class with non-dictionary"); ! return NULL; ! } ! if (!PyString_Check(name)) { ! PyErr_SetString(PyExc_SystemError, ! "build_class with non-string name"); ! return NULL; ! } ! n = PyTuple_Size(bases); ! for (i = 0; i < n; i++) { ! PyObject *base = PyTuple_GET_ITEM(bases, i); ! if (!PyClass_Check(base)) { ! /* Call the base's *type*, if it is callable. ! This code is a hook for Donald Beaudry's ! and Jim Fulton's type extensions. In ! unextended Python it will never be triggered ! since its types are not callable. ! Ditto: call the bases's *class*, if it has ! one. This makes the same thing possible ! without writing C code. A true meta-object ! protocol! */ ! PyObject *basetype = (PyObject *)base->ob_type; ! PyObject *callable = NULL; ! if (PyCallable_Check(basetype)) ! callable = basetype; ! else ! callable = PyObject_GetAttrString( ! base, "__class__"); ! if (callable) { ! PyObject *args; ! PyObject *newclass = NULL; ! args = Py_BuildValue( ! "(OOO)", name, bases, methods); ! if (args != NULL) { ! newclass = PyEval_CallObject( ! callable, args); ! Py_DECREF(args); ! } ! if (callable != basetype) { ! Py_DECREF(callable); ! } ! return newclass; ! } ! PyErr_SetString(PyExc_TypeError, ! "base is not a class object"); ! return NULL; } } ! return PyClass_New(bases, methods, name); } --- 3616,3638 ---- build_class(PyObject *methods, PyObject *bases, PyObject *name) { ! PyObject *metaclass = NULL; ! ! if (PyDict_Check(methods)) ! metaclass = PyDict_GetItemString(methods, "__metaclass__"); ! ! if (metaclass == NULL) { ! if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) ! metaclass = (PyObject *) ! PyTuple_GET_ITEM(bases, 0)->ob_type; ! else { ! PyObject *g = PyEval_GetGlobals(); ! if (g != NULL && PyDict_Check(g)) ! metaclass = PyDict_GetItemString( ! g, "__metaclass__"); ! if (metaclass == NULL) ! metaclass = (PyObject *) &PyClass_Type; } } ! return PyObject_CallFunction(metaclass, "OOO", name, bases, methods); } Index: exceptions.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** exceptions.c 2001/04/20 19:13:02 1.24 --- exceptions.c 2001/08/02 04:15:00 1.25 *************** *** 1057,1077 **** DL_EXPORT(void) ! init_exceptions(void) { char *modulename = "exceptions"; int modnamesz = strlen(modulename); int i; ! PyObject *me = Py_InitModule(modulename, functions); ! PyObject *mydict = PyModule_GetDict(me); ! PyObject *bltinmod = PyImport_ImportModule("__builtin__"); ! PyObject *bdict = PyModule_GetDict(bltinmod); ! PyObject *doc = PyString_FromString(module__doc__); ! PyObject *args; ! PyDict_SetItemString(mydict, "__doc__", doc); Py_DECREF(doc); ! if (PyErr_Occurred()) Py_FatalError("exceptions bootstrapping error."); /* This is the base class of all exceptions, so make it first. */ --- 1057,1090 ---- DL_EXPORT(void) ! _PyExc_Init(void) { char *modulename = "exceptions"; int modnamesz = strlen(modulename); int i; + PyObject *me, *mydict, *bltinmod, *bdict, *doc, *args; ! me = Py_InitModule(modulename, functions); ! if (me == NULL) ! goto err; ! mydict = PyModule_GetDict(me); ! if (mydict == NULL) ! goto err; ! bltinmod = PyImport_ImportModule("__builtin__"); ! if (bltinmod == NULL) ! goto err; ! bdict = PyModule_GetDict(bltinmod); ! if (bdict == NULL) ! goto err; ! doc = PyString_FromString(module__doc__); ! if (doc == NULL) ! goto err; ! i = PyDict_SetItemString(mydict, "__doc__", doc); Py_DECREF(doc); ! if (i < 0) { ! err: Py_FatalError("exceptions bootstrapping error."); + return; + } /* This is the base class of all exceptions, so make it first. */ *************** *** 1140,1144 **** DL_EXPORT(void) ! fini_exceptions(void) { int i; --- 1153,1157 ---- DL_EXPORT(void) ! _PyExc_Fini(void) { int i; Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.180 retrieving revision 2.181 diff -C2 -d -r2.180 -r2.181 *** import.c 2001/07/23 16:30:27 2.180 --- import.c 2001/08/02 04:15:00 2.181 *************** *** 44,48 **** added to the .pyc file header? */ /* New way to come up with the magic number: (YEAR-1995), MONTH, DAY */ ! #define MAGIC (60420 | ((long)'\r'<<16) | ((long)'\n'<<24)) /* Magic word as global; note that _PyImport_Init() can change the --- 44,48 ---- added to the .pyc file header? */ /* New way to come up with the magic number: (YEAR-1995), MONTH, DAY */ ! #define MAGIC (60717 | ((long)'\r'<<16) | ((long)'\n'<<24)) /* Magic word as global; note that _PyImport_Init() can change the *************** *** 1969,1974 **** /* Get the __import__ function from the builtins */ ! if (PyDict_Check(builtins)) import = PyObject_GetItem(builtins, import_str); else import = PyObject_GetAttr(builtins, import_str); --- 1969,1977 ---- /* Get the __import__ function from the builtins */ ! if (PyDict_Check(builtins)) { import = PyObject_GetItem(builtins, import_str); + if (import == NULL) + PyErr_SetObject(PyExc_KeyError, import_str); + } else import = PyObject_GetAttr(builtins, import_str); Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.139 retrieving revision 2.140 diff -C2 -d -r2.139 -r2.140 *** pythonrun.c 2001/07/23 16:30:27 2.139 --- pythonrun.c 2001/08/02 04:15:00 2.140 *************** *** 116,119 **** --- 116,122 ---- (void) PyThreadState_Swap(tstate); + if (PyType_InitDict(&PyType_Type) < 0) + Py_FatalError("Py_Initialize: can't initialize 'type'"); + interp->modules = PyDict_New(); if (interp->modules == NULL) *************** *** 145,149 **** /* initialize builtin exceptions */ ! init_exceptions(); /* phase 2 of builtins */ --- 148,152 ---- /* initialize builtin exceptions */ ! _PyExc_Init(); /* phase 2 of builtins */ *************** *** 239,243 **** raised. */ ! fini_exceptions(); /* Delete current thread */ --- 242,246 ---- raised. */ ! _PyExc_Fini(); /* Delete current thread */ *************** *** 1346,1350 **** char buf[256]; ! printf("%s [ny] ", prompt); if (fgets(buf, sizeof buf, stdin) == NULL) return 0; --- 1349,1353 ---- char buf[256]; ! fprintf(stderr, "%s [ny] ", prompt); if (fgets(buf, sizeof buf, stdin) == NULL) return 0; From tim_one@users.sourceforge.net Thu Aug 2 05:15:03 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:15:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects descrobject.c,1.1,2.1 abstract.c,2.69,2.70 bufferobject.c,2.13,2.14 cellobject.c,1.2,1.3 classobject.c,2.132,2.133 complexobject.c,2.35,2.36 dictobject.c,2.106,2.107 fileobject.c,2.114,2.115 floatobject.c,2.83,2.84 frameobject.c,2.53,2.54 funcobject.c,2.38,2.39 intobject.c,2.59,2.60 iterobject.c,1.5,1.6 listobject.c,2.97,2.98 longobject.c,1.89,1.90 methodobject.c,2.34,2.35 moduleobject.c,2.33,2.34 object.c,2.134,2.135 rangeobject.c,2.26,2.27 sliceobject.c,2.7,2.8 stringobject.c,2.121,2.122 tupleobject.c,2.53,2.54 typeobject.c,2.18,2.19 unicodeobject.c,2.105,2.106 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv8810/python/dist/src/Objects Modified Files: abstract.c bufferobject.c cellobject.c classobject.c complexobject.c dictobject.c fileobject.c floatobject.c frameobject.c funcobject.c intobject.c iterobject.c listobject.c longobject.c methodobject.c moduleobject.c object.c rangeobject.c sliceobject.c stringobject.c tupleobject.c typeobject.c unicodeobject.c Added Files: descrobject.c Log Message: Merge of descr-branch back into trunk. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.69 retrieving revision 2.70 diff -C2 -d -r2.69 -r2.70 *** abstract.c 2001/05/28 22:30:08 2.69 --- abstract.c 2001/08/02 04:15:00 2.70 *************** *** 1590,1593 **** --- 1590,1611 ---- PyObject * + PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) + { + ternaryfunc call; + + if ((call = func->ob_type->tp_call) != NULL) { + PyObject *result = (*call)(func, arg, kw); + if (result == NULL && !PyErr_Occurred()) + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + return result; + } + PyErr_Format(PyExc_TypeError, "object is not callable: %s", + PyString_AS_STRING(PyObject_Repr(func))); + return NULL; + } + + PyObject * PyObject_CallFunction(PyObject *callable, char *format, ...) { *************** *** 1747,1751 **** } else if (PyType_Check(cls)) { ! retval = ((PyObject *)(inst->ob_type) == cls); } else if (!PyInstance_Check(inst)) { --- 1765,1769 ---- } else if (PyType_Check(cls)) { ! retval = PyObject_TypeCheck(inst, (PyTypeObject *)cls); } else if (!PyInstance_Check(inst)) { Index: bufferobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/bufferobject.c,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -d -r2.13 -r2.14 *** bufferobject.c 2000/09/01 23:29:27 2.13 --- bufferobject.c 2001/08/02 04:15:00 2.14 *************** *** 538,557 **** sizeof(PyBufferObject), 0, ! (destructor)buffer_dealloc, /*tp_dealloc*/ ! 0, /*tp_print*/ ! 0, /*tp_getattr*/ ! 0, /*tp_setattr*/ ! (cmpfunc)buffer_compare, /*tp_compare*/ ! (reprfunc)buffer_repr, /*tp_repr*/ ! 0, /*tp_as_number*/ ! &buffer_as_sequence, /*tp_as_sequence*/ ! 0, /*tp_as_mapping*/ ! (hashfunc)buffer_hash, /*tp_hash*/ ! 0, /*tp_call*/ ! (reprfunc)buffer_str, /*tp_str*/ ! 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ ! &buffer_as_buffer, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT, /*tp_flags*/ ! 0, /*tp_doc*/ }; --- 538,557 ---- sizeof(PyBufferObject), 0, ! (destructor)buffer_dealloc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! (cmpfunc)buffer_compare, /* tp_compare */ ! (reprfunc)buffer_repr, /* tp_repr */ ! 0, /* tp_as_number */ ! &buffer_as_sequence, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! (hashfunc)buffer_hash, /* tp_hash */ ! 0, /* tp_call */ ! (reprfunc)buffer_str, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! 0, /* tp_setattro */ ! &buffer_as_buffer, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ ! 0, /* tp_doc */ }; Index: cellobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/cellobject.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cellobject.c 2001/03/13 01:58:21 1.2 --- cellobject.c 2001/08/02 04:15:00 1.3 *************** *** 107,111 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ --- 107,111 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.132 retrieving revision 2.133 diff -C2 -d -r2.132 -r2.133 *** classobject.c 2001/05/22 02:33:08 2.132 --- classobject.c 2001/08/02 04:15:00 2.133 *************** *** 37,46 **** } if (name == NULL || !PyString_Check(name)) { ! PyErr_SetString(PyExc_SystemError, "PyClass_New: name must be a string"); return NULL; } if (dict == NULL || !PyDict_Check(dict)) { ! PyErr_SetString(PyExc_SystemError, "PyClass_New: dict must be a dictionary"); return NULL; --- 37,46 ---- } if (name == NULL || !PyString_Check(name)) { ! PyErr_SetString(PyExc_TypeError, "PyClass_New: name must be a string"); return NULL; } if (dict == NULL || !PyDict_Check(dict)) { ! PyErr_SetString(PyExc_TypeError, "PyClass_New: dict must be a dictionary"); return NULL; *************** *** 68,72 **** int i; if (!PyTuple_Check(bases)) { ! PyErr_SetString(PyExc_SystemError, "PyClass_New: bases must be a tuple"); return NULL; --- 68,72 ---- int i; if (!PyTuple_Check(bases)) { ! PyErr_SetString(PyExc_TypeError, "PyClass_New: bases must be a tuple"); return NULL; *************** *** 75,79 **** while (--i >= 0) { if (!PyClass_Check(PyTuple_GetItem(bases, i))) { ! PyErr_SetString(PyExc_SystemError, "PyClass_New: base must be a class"); return NULL; --- 75,79 ---- while (--i >= 0) { if (!PyClass_Check(PyTuple_GetItem(bases, i))) { ! PyErr_SetString(PyExc_TypeError, "PyClass_New: base must be a class"); return NULL; *************** *** 107,110 **** --- 107,122 ---- } + static PyObject * + class_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *name, *bases, *dict; + static char *kwlist[] = {"name", "bases", "dict", 0}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "SOO", kwlist, + &name, &bases, &dict)) + return NULL; + return PyClass_New(bases, dict, name); + } + /* Class methods */ *************** *** 150,153 **** --- 162,167 ---- register char *sname = PyString_AsString(name); PyClassObject *class; + descrgetfunc f; + if (sname[0] == '_' && sname[1] == '_') { if (strcmp(sname, "__dict__") == 0) { *************** *** 187,190 **** --- 201,209 ---- v = w; } + f = v->ob_type->tp_descr_get; + if (f == NULL) + Py_INCREF(v); + else + v = f(v, (PyObject *)NULL, (PyObject *)op); return v; } *************** *** 397,401 **** 0, /* tp_as_mapping */ 0, /* tp_hash */ ! 0, /* tp_call */ (reprfunc)class_str, /* tp_str */ (getattrofunc)class_getattr, /* tp_getattro */ --- 416,420 ---- 0, /* tp_as_mapping */ 0, /* tp_hash */ ! PyInstance_New, /* tp_call */ (reprfunc)class_str, /* tp_str */ (getattrofunc)class_getattr, /* tp_getattro */ *************** *** 405,408 **** --- 424,443 ---- 0, /* tp_doc */ (traverseproc)class_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + class_new, /* tp_new */ }; *************** *** 532,536 **** * _Py_RefTotal was also boosted; we'll knock that down later. */ ! inst->ob_type->tp_alloc--; #endif #else /* !Py_TRACE_REFS */ --- 567,571 ---- * _Py_RefTotal was also boosted; we'll knock that down later. */ ! inst->ob_type->tp_allocs--; #endif #else /* !Py_TRACE_REFS */ *************** *** 565,569 **** if (--inst->ob_refcnt > 0) { #ifdef COUNT_ALLOCS ! inst->ob_type->tp_free--; #endif return; /* __del__ added a reference; don't delete now */ --- 600,604 ---- if (--inst->ob_refcnt > 0) { #ifdef COUNT_ALLOCS ! inst->ob_type->tp_frees--; #endif return; /* __del__ added a reference; don't delete now */ *************** *** 573,577 **** #ifdef COUNT_ALLOCS /* compensate for increment in _Py_ForgetReference */ ! inst->ob_type->tp_free--; #endif #ifndef WITH_CYCLE_GC --- 608,612 ---- #ifdef COUNT_ALLOCS /* compensate for increment in _Py_ForgetReference */ ! inst->ob_type->tp_frees--; #endif #ifndef WITH_CYCLE_GC *************** *** 620,623 **** --- 655,660 ---- register PyObject *v; PyClassObject *class; + descrgetfunc f; + class = NULL; v = PyDict_GetItem(inst->in_dict, name); *************** *** 629,643 **** Py_INCREF(v); if (class != NULL) { ! if (PyFunction_Check(v)) { ! PyObject *w = PyMethod_New(v, (PyObject *)inst, ! (PyObject *)class); Py_DECREF(v); v = w; } else if (PyMethod_Check(v)) { ! PyObject *im_class = PyMethod_Class(v); /* Only if classes are compatible */ if (PyClass_IsSubclass((PyObject *)class, im_class)) { ! PyObject *im_func = PyMethod_Function(v); PyObject *w = PyMethod_New(im_func, (PyObject *)inst, im_class); --- 666,683 ---- Py_INCREF(v); if (class != NULL) { ! f = v->ob_type->tp_descr_get; ! if (f != NULL) { ! PyObject *w = f(v, (PyObject *)inst, ! (PyObject *)(inst->in_class)); Py_DECREF(v); v = w; } else if (PyMethod_Check(v)) { ! /* XXX This should be a tp_descr_get slot of ! PyMethodObjects */ ! PyObject *im_class = PyMethod_GET_CLASS(v); /* Only if classes are compatible */ if (PyClass_IsSubclass((PyObject *)class, im_class)) { ! PyObject *im_func = PyMethod_GET_FUNCTION(v); PyObject *w = PyMethod_New(im_func, (PyObject *)inst, im_class); *************** *** 1815,1818 **** --- 1855,1875 ---- } + static PyObject * + instance_call(PyObject *func, PyObject *arg, PyObject *kw) + { + PyObject *res, *call = PyObject_GetAttrString(func, "__call__"); + if (call == NULL) { + PyInstanceObject *inst = (PyInstanceObject*) func; + PyErr_Clear(); + PyErr_Format(PyExc_AttributeError, + "%.200s instance has no __call__ method", + PyString_AsString(inst->in_class->cl_name)); + return NULL; + } + res = PyObject_Call(call, arg, kw); + Py_DECREF(call); + return res; + } + static PyNumberMethods instance_as_number = { *************** *** 1869,1873 **** &instance_as_mapping, /* tp_as_mapping */ (hashfunc)instance_hash, /* tp_hash */ ! 0, /* tp_call */ (reprfunc)instance_str, /* tp_str */ (getattrofunc)instance_getattr, /* tp_getattro */ --- 1926,1930 ---- &instance_as_mapping, /* tp_as_mapping */ (hashfunc)instance_hash, /* tp_hash */ ! instance_call, /* tp_call */ (reprfunc)instance_str, /* tp_str */ (getattrofunc)instance_getattr, /* tp_getattro */ *************** *** 1922,1955 **** } - PyObject * - PyMethod_Function(register PyObject *im) - { - if (!PyMethod_Check(im)) { - PyErr_BadInternalCall(); - return NULL; - } - return ((PyMethodObject *)im)->im_func; - } - - PyObject * - PyMethod_Self(register PyObject *im) - { - if (!PyMethod_Check(im)) { - PyErr_BadInternalCall(); - return NULL; - } - return ((PyMethodObject *)im)->im_self; - } - - PyObject * - PyMethod_Class(register PyObject *im) - { - if (!PyMethod_Check(im)) { - PyErr_BadInternalCall(); - return NULL; - } - return ((PyMethodObject *)im)->im_class; - } - /* Class method methods */ --- 1979,1982 ---- *************** *** 2029,2069 **** instancemethod_repr(PyMethodObject *a) { ! char buf[240]; ! PyInstanceObject *self = (PyInstanceObject *)(a->im_self); PyObject *func = a->im_func; ! PyClassObject *class = (PyClassObject *)(a->im_class); ! PyObject *fclassname, *iclassname, *funcname; ! char *fcname, *icname, *fname; ! fclassname = class->cl_name; ! if (PyFunction_Check(func)) { ! funcname = ((PyFunctionObject *)func)->func_name; ! Py_INCREF(funcname); ! } ! else { ! funcname = PyObject_GetAttrString(func,"__name__"); ! if (funcname == NULL) ! PyErr_Clear(); } - if (funcname != NULL && PyString_Check(funcname)) - fname = PyString_AS_STRING(funcname); else ! fname = "?"; ! if (fclassname != NULL && PyString_Check(fclassname)) ! fcname = PyString_AsString(fclassname); else ! fcname = "?"; if (self == NULL) ! sprintf(buf, "", fcname, fname); else { ! iclassname = self->in_class->cl_name; ! if (iclassname != NULL && PyString_Check(iclassname)) ! icname = PyString_AsString(iclassname); ! else ! icname = "?"; ! sprintf(buf, "", ! fcname, fname, icname, self); } Py_XDECREF(funcname); ! return PyString_FromString(buf); } --- 2056,2105 ---- instancemethod_repr(PyMethodObject *a) { ! char buffer[240]; ! PyObject *self = a->im_self; PyObject *func = a->im_func; ! PyObject *klass = a->im_class; ! PyObject *funcname = NULL, *klassname = NULL, *result = NULL; ! char *sfuncname = "?", *sklassname = "?"; ! ! funcname = PyObject_GetAttrString(func, "__name__"); ! if (funcname == NULL) ! PyErr_Clear(); ! else if (!PyString_Check(funcname)) { ! Py_DECREF(funcname); ! funcname = NULL; } else ! sfuncname = PyString_AS_STRING(funcname); ! klassname = PyObject_GetAttrString(klass, "__name__"); ! if (klassname == NULL) ! PyErr_Clear(); ! else if (!PyString_Check(klassname)) { ! Py_DECREF(klassname); ! klassname = NULL; ! } else ! sklassname = PyString_AS_STRING(klassname); if (self == NULL) ! sprintf(buffer, "", ! sklassname, sfuncname); else { ! /* XXX Shouldn't use repr() here! */ ! PyObject *selfrepr = PyObject_Repr(self); ! if (selfrepr == NULL) ! goto fail; ! if (!PyString_Check(selfrepr)) { ! Py_DECREF(selfrepr); ! goto fail; ! } ! sprintf(buffer, "", ! sklassname, sfuncname, PyString_AS_STRING(selfrepr)); ! Py_DECREF(selfrepr); } + result = PyString_FromString(buffer); + fail: Py_XDECREF(funcname); ! Py_XDECREF(klassname); ! return result; } *************** *** 2106,2109 **** --- 2142,2196 ---- } + static PyObject * + instancemethod_call(PyObject *func, PyObject *arg, PyObject *kw) + { + PyObject *self = PyMethod_GET_SELF(func); + PyObject *class = PyMethod_GET_CLASS(func); + PyObject *result; + + func = PyMethod_GET_FUNCTION(func); + if (self == NULL) { + /* Unbound methods must be called with an instance of + the class (or a derived class) as first argument */ + int ok; + if (PyTuple_Size(arg) >= 1) + self = PyTuple_GET_ITEM(arg, 0); + if (self == NULL) + ok = 0; + else { + ok = PyObject_IsInstance(self, class); + if (ok < 0) + return NULL; + } + if (!ok) { + PyErr_Format(PyExc_TypeError, + "unbound method %s%s must be " + "called with instance as first argument", + PyEval_GetFuncName(func), + PyEval_GetFuncDesc(func)); + return NULL; + } + Py_INCREF(arg); + } + else { + int argcount = PyTuple_Size(arg); + PyObject *newarg = PyTuple_New(argcount + 1); + int i; + if (newarg == NULL) + return NULL; + Py_INCREF(self); + PyTuple_SET_ITEM(newarg, 0, self); + for (i = 0; i < argcount; i++) { + PyObject *v = PyTuple_GET_ITEM(arg, i); + Py_XINCREF(v); + PyTuple_SET_ITEM(newarg, i+1, v); + } + arg = newarg; + } + result = PyObject_Call((PyObject *)func, arg, kw); + Py_DECREF(arg); + return result; + } + PyTypeObject PyMethod_Type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 2122,2126 **** 0, /* tp_as_mapping */ (hashfunc)instancemethod_hash, /* tp_hash */ ! 0, /* tp_call */ 0, /* tp_str */ (getattrofunc)instancemethod_getattro, /* tp_getattro */ --- 2209,2213 ---- 0, /* tp_as_mapping */ (hashfunc)instancemethod_hash, /* tp_hash */ ! instancemethod_call, /* tp_call */ 0, /* tp_str */ (getattrofunc)instancemethod_getattro, /* tp_getattro */ Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.35 retrieving revision 2.36 diff -C2 -d -r2.35 -r2.36 *** complexobject.c 2001/03/18 08:21:57 2.35 --- complexobject.c 2001/08/02 04:15:00 2.36 *************** *** 9,12 **** --- 9,13 ---- #include "Python.h" + #include "structmember.h" /* Precisions used by repr() and str(), respectively. *************** *** 183,186 **** --- 184,198 ---- } + static PyObject * + complex_subtype_from_c_complex(PyTypeObject *type, Py_complex cval) + { + PyObject *op; + + op = PyType_GenericAlloc(type, 0); + if (op != NULL) + ((PyComplexObject *)op)->cval = cval; + return op; + } + PyObject * PyComplex_FromCComplex(Py_complex cval) *************** *** 197,200 **** --- 209,221 ---- } + static PyObject * + complex_subtype_from_doubles(PyTypeObject *type, double real, double imag) + { + Py_complex c; + c.real = real; + c.imag = imag; + return complex_subtype_from_c_complex(type, c); + } + PyObject * PyComplex_FromDoubles(double real, double imag) *************** *** 560,576 **** }; static PyObject * ! complex_getattr(PyComplexObject *self, char *name) { ! if (strcmp(name, "real") == 0) ! return (PyObject *)PyFloat_FromDouble(self->cval.real); ! else if (strcmp(name, "imag") == 0) ! return (PyObject *)PyFloat_FromDouble(self->cval.imag); ! else if (strcmp(name, "__members__") == 0) ! return Py_BuildValue("[ss]", "imag", "real"); ! return Py_FindMethod(complex_methods, (PyObject *)self, name); } static PyNumberMethods complex_as_number = { (binaryfunc)complex_add, /* nb_add */ --- 581,839 ---- }; + static struct memberlist complex_members[] = { + {"real", T_DOUBLE, offsetof(PyComplexObject, cval.real), 0}, + {"imag", T_DOUBLE, offsetof(PyComplexObject, cval.imag), 0}, + {0}, + }; static PyObject * ! complex_subtype_from_string(PyTypeObject *type, PyObject *v) { ! extern double strtod(const char *, char **); ! const char *s, *start; ! char *end; ! double x=0.0, y=0.0, z; ! int got_re=0, got_im=0, done=0; ! int digit_or_dot; ! int sw_error=0; ! int sign; ! char buffer[256]; /* For errors */ ! char s_buffer[256]; ! int len; ! ! if (PyString_Check(v)) { ! s = PyString_AS_STRING(v); ! len = PyString_GET_SIZE(v); ! } ! else if (PyUnicode_Check(v)) { ! if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) { ! PyErr_SetString(PyExc_ValueError, ! "complex() literal too large to convert"); ! return NULL; ! } ! if (PyUnicode_EncodeDecimal(PyUnicode_AS_UNICODE(v), ! PyUnicode_GET_SIZE(v), ! s_buffer, ! NULL)) ! return NULL; ! s = s_buffer; ! len = (int)strlen(s); ! } ! else if (PyObject_AsCharBuffer(v, &s, &len)) { ! PyErr_SetString(PyExc_TypeError, ! "complex() arg is not a string"); ! return NULL; ! } ! ! /* position on first nonblank */ ! start = s; ! while (*s && isspace(Py_CHARMASK(*s))) ! s++; ! if (s[0] == '\0') { ! PyErr_SetString(PyExc_ValueError, ! "complex() arg is an empty string"); ! return NULL; ! } ! ! z = -1.0; ! sign = 1; ! do { ! ! switch (*s) { ! ! case '\0': ! if (s-start != len) { ! PyErr_SetString( ! PyExc_ValueError, ! "complex() arg contains a null byte"); ! return NULL; ! } ! if(!done) sw_error=1; ! break; ! ! case '-': ! sign = -1; ! /* Fallthrough */ ! case '+': ! if (done) sw_error=1; ! s++; ! if ( *s=='\0'||*s=='+'||*s=='-' || ! isspace(Py_CHARMASK(*s)) ) sw_error=1; ! break; ! ! case 'J': ! case 'j': ! if (got_im || done) { ! sw_error = 1; ! break; ! } ! if (z<0.0) { ! y=sign; ! } ! else{ ! y=sign*z; ! } ! got_im=1; ! s++; ! if (*s!='+' && *s!='-' ) ! done=1; ! break; ! ! default: ! if (isspace(Py_CHARMASK(*s))) { ! while (*s && isspace(Py_CHARMASK(*s))) ! s++; ! if (s[0] != '\0') ! sw_error=1; ! else ! done = 1; ! break; ! } ! digit_or_dot = ! (*s=='.' || isdigit(Py_CHARMASK(*s))); ! if (done||!digit_or_dot) { ! sw_error=1; ! break; ! } ! errno = 0; ! PyFPE_START_PROTECT("strtod", return 0) ! z = strtod(s, &end) ; ! PyFPE_END_PROTECT(z) ! if (errno != 0) { ! sprintf(buffer, ! "float() out of range: %.150s", s); ! PyErr_SetString( ! PyExc_ValueError, ! buffer); ! return NULL; ! } ! s=end; ! if (*s=='J' || *s=='j') { ! ! break; ! } ! if (got_re) { ! sw_error=1; ! break; ! } ! ! /* accept a real part */ ! x=sign*z; ! got_re=1; ! if (got_im) done=1; ! z = -1.0; ! sign = 1; ! break; ! ! } /* end of switch */ ! ! } while (*s!='\0' && !sw_error); ! ! if (sw_error) { ! PyErr_SetString(PyExc_ValueError, ! "complex() arg is a malformed string"); ! return NULL; ! } ! ! return complex_subtype_from_doubles(type, x, y); ! } ! ! static PyObject * ! complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ! { ! PyObject *r, *i, *tmp; ! PyNumberMethods *nbr, *nbi = NULL; ! Py_complex cr, ci; ! int own_r = 0; ! static char *kwlist[] = {"real", "imag", 0}; ! ! r = Py_False; ! i = NULL; ! if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO:complex", kwlist, ! &r, &i)) ! return NULL; ! if (PyString_Check(r) || PyUnicode_Check(r)) ! return complex_subtype_from_string(type, r); ! if ((nbr = r->ob_type->tp_as_number) == NULL || ! nbr->nb_float == NULL || ! (i != NULL && ! ((nbi = i->ob_type->tp_as_number) == NULL || ! nbi->nb_float == NULL))) { ! PyErr_SetString(PyExc_TypeError, ! "complex() arg can't be converted to complex"); ! return NULL; ! } ! /* XXX Hack to support classes with __complex__ method */ ! if (PyInstance_Check(r)) { ! static PyObject *complexstr; ! PyObject *f; ! if (complexstr == NULL) { ! complexstr = PyString_InternFromString("__complex__"); ! if (complexstr == NULL) ! return NULL; ! } ! f = PyObject_GetAttr(r, complexstr); ! if (f == NULL) ! PyErr_Clear(); ! else { ! PyObject *args = Py_BuildValue("()"); ! if (args == NULL) ! return NULL; ! r = PyEval_CallObject(f, args); ! Py_DECREF(args); ! Py_DECREF(f); ! if (r == NULL) ! return NULL; ! own_r = 1; ! } ! } ! if (PyComplex_Check(r)) { ! cr = ((PyComplexObject*)r)->cval; ! if (own_r) { ! Py_DECREF(r); ! } ! } ! else { ! tmp = PyNumber_Float(r); ! if (own_r) { ! Py_DECREF(r); ! } ! if (tmp == NULL) ! return NULL; ! if (!PyFloat_Check(tmp)) { ! PyErr_SetString(PyExc_TypeError, ! "float(r) didn't return a float"); ! Py_DECREF(tmp); ! return NULL; ! } ! cr.real = PyFloat_AsDouble(tmp); ! Py_DECREF(tmp); ! cr.imag = 0.0; ! } ! if (i == NULL) { ! ci.real = 0.0; ! ci.imag = 0.0; ! } ! else if (PyComplex_Check(i)) ! ci = ((PyComplexObject*)i)->cval; ! else { ! tmp = (*nbi->nb_float)(i); ! if (tmp == NULL) ! return NULL; ! ci.real = PyFloat_AsDouble(tmp); ! Py_DECREF(tmp); ! ci.imag = 0.; ! } ! cr.real -= ci.imag; ! cr.imag += ci.real; ! return complex_subtype_from_c_complex(type, cr); } + static char complex_doc[] = + "complex(real[, imag]) -> complex number\n\ + \n\ + Create a complex number from a real part and an optional imaginary part.\n\ + This is equivalent to (real + imag*1j) where imag defaults to 0."; + static PyNumberMethods complex_as_number = { (binaryfunc)complex_add, /* nb_add */ *************** *** 607,611 **** (destructor)complex_dealloc, /* tp_dealloc */ (printfunc)complex_print, /* tp_print */ ! (getattrfunc)complex_getattr, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ --- 870,874 ---- (destructor)complex_dealloc, /* tp_dealloc */ (printfunc)complex_print, /* tp_print */ ! 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ *************** *** 617,628 **** 0, /* tp_call */ (reprfunc)complex_str, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ ! 0, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ complex_richcompare, /* tp_richcompare */ }; --- 880,905 ---- 0, /* tp_call */ (reprfunc)complex_str, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ ! complex_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ complex_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + complex_methods, /* tp_methods */ + complex_members, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + complex_new, /* tp_new */ }; Index: dictobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v retrieving revision 2.106 retrieving revision 2.107 diff -C2 -d -r2.106 -r2.107 *** dictobject.c 2001/06/26 20:08:32 2.106 --- dictobject.c 2001/08/02 04:15:00 2.107 *************** *** 4,16 **** #include "Python.h" ! /* MINSIZE is the minimum size of a dictionary. This many slots are ! * allocated directly in the dict object (in the ma_smalltable member). ! * It must be a power of 2, and at least 4. 8 allows dicts with no more than ! * 5 active entries to live in ma_smalltable (and so avoid an additional ! * malloc); instrumentation suggested this suffices for the majority of ! * dicts (consisting mostly of usually-small instance dicts and usually-small ! * dicts created to pass keyword arguments). ! */ ! #define MINSIZE 8 /* Define this out if you don't want conversion statistics on exit. */ --- 4,9 ---- #include "Python.h" ! typedef PyDictEntry dictentry; ! typedef PyDictObject dictobject; /* Define this out if you don't want conversion statistics on exit. */ *************** *** 117,183 **** static PyObject *dummy; /* Initialized by first call to newdictobject() */ - /* - There are three kinds of slots in the table: - - 1. Unused. me_key == me_value == NULL - Does not hold an active (key, value) pair now and never did. Unused can - transition to Active upon key insertion. This is the only case in which - me_key is NULL, and is each slot's initial state. - - 2. Active. me_key != NULL and me_key != dummy and me_value != NULL - Holds an active (key, value) pair. Active can transition to Dummy upon - key deletion. This is the only case in which me_value != NULL. - - 3. Dummy. me_key == dummy and me_value == NULL - Previously held an active (key, value) pair, but that was deleted and an - active pair has not yet overwritten the slot. Dummy can transition to - Active upon key insertion. Dummy slots cannot be made Unused again - (cannot have me_key set to NULL), else the probe sequence in case of - collision would have no way to know they were once active. - - Note: .popitem() abuses the me_hash field of an Unused or Dummy slot to - hold a search finger. The me_hash field of Unused or Dummy slots has no - meaning otherwise. - */ - typedef struct { - long me_hash; /* cached hash code of me_key */ - PyObject *me_key; - PyObject *me_value; - #ifdef USE_CACHE_ALIGNED - long aligner; - #endif - } dictentry; - - /* - To ensure the lookup algorithm terminates, there must be at least one Unused - slot (NULL key) in the table. - The value ma_fill is the number of non-NULL keys (sum of Active and Dummy); - ma_used is the number of non-NULL, non-dummy keys (== the number of non-NULL - values == the number of Active items). - To avoid slowing down lookups on a near-full table, we resize the table when - it's two-thirds full. - */ - typedef struct dictobject dictobject; - struct dictobject { - PyObject_HEAD - int ma_fill; /* # Active + # Dummy */ - int ma_used; /* # Active */ - - /* The table contains ma_mask + 1 slots, and that's a power of 2. - * We store the mask instead of the size because the mask is more - * frequently needed. - */ - int ma_mask; - - /* ma_table points to ma_smalltable for small tables, else to - * additional malloc'ed memory. ma_table is never NULL! This rule - * saves repeated runtime null-tests in the workhorse getitem and - * setitem calls. - */ - dictentry *ma_table; - dictentry *(*ma_lookup)(dictobject *mp, PyObject *key, long hash); - dictentry ma_smalltable[MINSIZE]; - }; - /* forward declarations */ static dictentry * --- 110,113 ---- *************** *** 197,206 **** #endif ! /* Set dictobject* mp to empty but w/ MINSIZE slots, using ma_smalltable. */ ! #define empty_to_minsize(mp) do { \ ! memset((mp)->ma_smalltable, 0, sizeof((mp)->ma_smalltable)); \ (mp)->ma_table = (mp)->ma_smalltable; \ ! (mp)->ma_mask = MINSIZE - 1; \ (mp)->ma_used = (mp)->ma_fill = 0; \ } while(0) --- 127,148 ---- #endif ! /* Initialization macros. ! There are two ways to create a dict: PyDict_New() is the main C API ! function, and the tp_new slot maps to dict_new(). In the latter case we ! can save a little time over what PyDict_New does because it's guaranteed ! that the PyDictObject struct is already zeroed out. ! Everyone except dict_new() should use EMPTY_TO_MINSIZE (unless they have ! an excellent reason not to). ! */ ! ! #define INIT_NONZERO_DICT_SLOTS(mp) do { \ (mp)->ma_table = (mp)->ma_smalltable; \ ! (mp)->ma_mask = PyDict_MINSIZE - 1; \ ! } while(0) ! ! #define EMPTY_TO_MINSIZE(mp) do { \ ! memset((mp)->ma_smalltable, 0, sizeof((mp)->ma_smalltable)); \ (mp)->ma_used = (mp)->ma_fill = 0; \ + INIT_NONZERO_DICT_SLOTS(mp); \ } while(0) *************** *** 220,224 **** if (mp == NULL) return NULL; ! empty_to_minsize(mp); mp->ma_lookup = lookdict_string; #ifdef SHOW_CONVERSION_COUNTS --- 162,166 ---- if (mp == NULL) return NULL; ! EMPTY_TO_MINSIZE(mp); mp->ma_lookup = lookdict_string; #ifdef SHOW_CONVERSION_COUNTS *************** *** 419,423 **** PyObject *old_value; register dictentry *ep; ! ep = (mp->ma_lookup)(mp, key, hash); if (ep->me_value != NULL) { old_value = ep->me_value; --- 361,368 ---- PyObject *old_value; register dictentry *ep; ! typedef PyDictEntry *(*lookupfunc)(PyDictObject *, PyObject *, long); ! ! assert(mp->ma_lookup != NULL); ! ep = mp->ma_lookup(mp, key, hash); if (ep->me_value != NULL) { old_value = ep->me_value; *************** *** 450,459 **** int i; int is_oldtable_malloced; ! dictentry small_copy[MINSIZE]; assert(minused >= 0); /* Find the smallest table size > minused. */ ! for (newsize = MINSIZE; newsize <= minused && newsize > 0; newsize <<= 1) --- 395,404 ---- int i; int is_oldtable_malloced; ! dictentry small_copy[PyDict_MINSIZE]; assert(minused >= 0); /* Find the smallest table size > minused. */ ! for (newsize = PyDict_MINSIZE; newsize <= minused && newsize > 0; newsize <<= 1) *************** *** 469,473 **** is_oldtable_malloced = oldtable != mp->ma_smalltable; ! if (newsize == MINSIZE) { /* A large table is shrinking, or we can't get any smaller. */ newtable = mp->ma_smalltable; --- 414,418 ---- is_oldtable_malloced = oldtable != mp->ma_smalltable; ! if (newsize == PyDict_MINSIZE) { /* A large table is shrinking, or we can't get any smaller. */ newtable = mp->ma_smalltable; *************** *** 650,654 **** int table_is_malloced; int fill; ! dictentry small_copy[MINSIZE]; #ifdef Py_DEBUG int i, n; --- 595,599 ---- int table_is_malloced; int fill; ! dictentry small_copy[PyDict_MINSIZE]; #ifdef Py_DEBUG int i, n; *************** *** 675,679 **** fill = mp->ma_fill; if (table_is_malloced) ! empty_to_minsize(mp); else if (fill > 0) { --- 620,624 ---- fill = mp->ma_fill; if (table_is_malloced) ! EMPTY_TO_MINSIZE(mp); else if (fill > 0) { *************** *** 684,688 **** memcpy(small_copy, table, sizeof(small_copy)); table = small_copy; ! empty_to_minsize(mp); } /* else it's a small table that's already empty */ --- 629,633 ---- memcpy(small_copy, table, sizeof(small_copy)); table = small_copy; ! EMPTY_TO_MINSIZE(mp); } /* else it's a small table that's already empty */ *************** *** 1043,1052 **** static PyObject * ! dict_update(register dictobject *mp, PyObject *args) { register int i; - dictobject *other; dictentry *entry; ! PyObject *param; /* We accept for the argument either a concrete dictionary object, * or an abstract "mapping" object. For the former, we can do --- 988,1010 ---- static PyObject * ! dict_update(PyObject *mp, PyObject *args) { + PyObject *other; + + if (!PyArg_ParseTuple(args, "O:update", &other)) + return NULL; + if (PyDict_Update(mp, other) < 0) + return NULL; + Py_INCREF(Py_None); + return Py_None; + } + + int + PyDict_Update(PyObject *a, PyObject *b) + { + register PyDictObject *mp, *other; register int i; dictentry *entry; ! /* We accept for the argument either a concrete dictionary object, * or an abstract "mapping" object. For the former, we can do *************** *** 1054,1065 **** * PyMapping_Keys() and PyObject_GetItem() be supported. */ ! if (!PyArg_ParseTuple(args, "O:update", ¶m)) ! return NULL; ! ! if (PyDict_Check(param)) { ! other = (dictobject*)param; if (other == mp || other->ma_used == 0) /* a.update(a) or a.update({}); nothing to do */ ! goto done; /* Do one big resize at the start, rather than * incrementally resizing as we insert new items. Expect --- 1012,1025 ---- * PyMapping_Keys() and PyObject_GetItem() be supported. */ ! if (a == NULL || !PyDict_Check(a) || b == NULL) { ! PyErr_BadInternalCall(); ! return -1; ! } ! mp = (dictobject*)a; ! if (PyDict_Check(b)) { ! other = (dictobject*)b; if (other == mp || other->ma_used == 0) /* a.update(a) or a.update({}); nothing to do */ ! return 0; /* Do one big resize at the start, rather than * incrementally resizing as we insert new items. Expect *************** *** 1068,1072 **** if ((mp->ma_fill + other->ma_used)*3 >= (mp->ma_mask+1)*2) { if (dictresize(mp, (mp->ma_used + other->ma_used)*3/2) != 0) ! return NULL; } for (i = 0; i <= other->ma_mask; i++) { --- 1028,1032 ---- if ((mp->ma_fill + other->ma_used)*3 >= (mp->ma_mask+1)*2) { if (dictresize(mp, (mp->ma_used + other->ma_used)*3/2) != 0) ! return -1; } for (i = 0; i <= other->ma_mask; i++) { *************** *** 1082,1086 **** else { /* Do it the generic, slower way */ ! PyObject *keys = PyMapping_Keys(param); PyObject *iter; PyObject *key, *value; --- 1042,1046 ---- else { /* Do it the generic, slower way */ ! PyObject *keys = PyMapping_Keys(b); PyObject *iter; PyObject *key, *value; *************** *** 1093,1109 **** * do the same for any other error. */ ! return NULL; iter = PyObject_GetIter(keys); Py_DECREF(keys); if (iter == NULL) ! return NULL; for (key = PyIter_Next(iter); key; key = PyIter_Next(iter)) { ! value = PyObject_GetItem(param, key); if (value == NULL) { Py_DECREF(iter); Py_DECREF(key); ! return NULL; } status = PyDict_SetItem((PyObject*)mp, key, value); --- 1053,1069 ---- * do the same for any other error. */ ! return -1; iter = PyObject_GetIter(keys); Py_DECREF(keys); if (iter == NULL) ! return -1; for (key = PyIter_Next(iter); key; key = PyIter_Next(iter)) { ! value = PyObject_GetItem(b, key); if (value == NULL) { Py_DECREF(iter); Py_DECREF(key); ! return -1; } status = PyDict_SetItem((PyObject*)mp, key, value); *************** *** 1112,1116 **** if (status < 0) { Py_DECREF(iter); ! return NULL; } } --- 1072,1076 ---- if (status < 0) { Py_DECREF(iter); ! return -1; } } *************** *** 1118,1127 **** if (PyErr_Occurred()) /* Iterator completed, via error */ ! return NULL; } ! ! done: ! Py_INCREF(Py_None); ! return Py_None; } --- 1078,1084 ---- if (PyErr_Occurred()) /* Iterator completed, via error */ ! return -1; } ! return 0; } *************** *** 1695,1704 **** }; - static PyObject * - dict_getattr(dictobject *mp, char *name) - { - return Py_FindMethod(mapp_methods, (PyObject *)mp, name); - } - static int dict_contains(dictobject *mp, PyObject *key) --- 1652,1655 ---- *************** *** 1733,1736 **** --- 1684,1707 ---- static PyObject * + dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *self; + + assert(type != NULL && type->tp_alloc != NULL); + self = type->tp_alloc(type, 0); + if (self != NULL) { + PyDictObject *d = (PyDictObject *)self; + /* It's guaranteed that tp->alloc zeroed out the struct. */ + assert(d->ma_table == NULL && d->ma_fill == 0 && d->ma_used == 0); + INIT_NONZERO_DICT_SLOTS(d); + d->ma_lookup = lookdict_string; + #ifdef SHOW_CONVERSION_COUNTS + ++created; + #endif + } + return self; + } + + static PyObject * dict_iter(dictobject *dict) { *************** *** 1746,1750 **** (destructor)dict_dealloc, /* tp_dealloc */ (printfunc)dict_print, /* tp_print */ ! (getattrfunc)dict_getattr, /* tp_getattr */ 0, /* tp_setattr */ (cmpfunc)dict_compare, /* tp_compare */ --- 1717,1721 ---- (destructor)dict_dealloc, /* tp_dealloc */ (printfunc)dict_print, /* tp_print */ ! 0, /* tp_getattr */ 0, /* tp_setattr */ (cmpfunc)dict_compare, /* tp_compare */ *************** *** 1756,1764 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ ! 0, /* tp_doc */ (traverseproc)dict_traverse, /* tp_traverse */ (inquiry)dict_tp_clear, /* tp_clear */ --- 1727,1736 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC | ! Py_TPFLAGS_BASETYPE, /* tp_flags */ ! "dictionary type", /* tp_doc */ (traverseproc)dict_traverse, /* tp_traverse */ (inquiry)dict_tp_clear, /* tp_clear */ *************** *** 1767,1770 **** --- 1739,1753 ---- (getiterfunc)dict_iter, /* tp_iter */ 0, /* tp_iternext */ + mapp_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + PyType_GenericAlloc, /* tp_alloc */ + dict_new, /* tp_new */ }; *************** *** 1874,1883 **** }; - static PyObject * - dictiter_getattr(dictiterobject *di, char *name) - { - return Py_FindMethod(dictiter_methods, (PyObject *)di, name); - } - static PyObject *dictiter_iternext(dictiterobject *di) { --- 1857,1860 ---- *************** *** 1904,1908 **** (destructor)dictiter_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! (getattrfunc)dictiter_getattr, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ --- 1881,1885 ---- (destructor)dictiter_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ *************** *** 1914,1918 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ --- 1891,1895 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ *************** *** 1925,1927 **** --- 1902,1911 ---- (getiterfunc)dictiter_getiter, /* tp_iter */ (iternextfunc)dictiter_iternext, /* tp_iternext */ + dictiter_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ }; Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.114 retrieving revision 2.115 diff -C2 -d -r2.114 -r2.115 *** fileobject.c 2001/07/19 21:49:38 2.114 --- fileobject.c 2001/08/02 04:15:00 2.115 *************** *** 1274,1300 **** static PyObject * ! file_getattr(PyFileObject *f, char *name) { ! PyObject *res; ! ! res = Py_FindMethod(file_methods, (PyObject *)f, name); ! if (res != NULL) ! return res; ! PyErr_Clear(); ! if (strcmp(name, "closed") == 0) ! return PyInt_FromLong((long)(f->f_fp == 0)); ! return PyMember_Get((char *)f, file_memberlist, name); } ! static int ! file_setattr(PyFileObject *f, char *name, PyObject *v) ! { ! if (v == NULL) { ! PyErr_SetString(PyExc_AttributeError, ! "can't delete file attributes"); ! return -1; ! } ! return PyMember_Set((char *)f, file_memberlist, name, v); ! } static PyObject * --- 1274,1286 ---- static PyObject * ! get_closed(PyFileObject *f, void *closure) { ! return PyInt_FromLong((long)(f->f_fp == 0)); } ! static struct getsetlist file_getsetlist[] = { ! {"closed", (getter)get_closed, NULL, NULL}, ! {0}, ! }; static PyObject * *************** *** 1312,1319 **** (destructor)file_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! (getattrfunc)file_getattr, /* tp_getattr */ ! (setattrfunc)file_setattr, /* tp_setattr */ 0, /* tp_compare */ ! (reprfunc)file_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ --- 1298,1305 ---- (destructor)file_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ 0, /* tp_compare */ ! (reprfunc)file_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ *************** *** 1322,1336 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ ! 0, /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ file_getiter, /* tp_iter */ 0, /* tp_iternext */ }; --- 1308,1327 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ ! 0, /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ file_getiter, /* tp_iter */ 0, /* tp_iternext */ + file_methods, /* tp_methods */ + file_memberlist, /* tp_members */ + file_getsetlist, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ }; Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.83 retrieving revision 2.84 diff -C2 -d -r2.83 -r2.84 *** floatobject.c 2001/07/26 20:02:17 2.83 --- floatobject.c 2001/08/02 04:15:00 2.84 *************** *** 637,640 **** --- 637,660 ---- + static PyObject * + float_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *x = Py_False; /* Integer zero */ + static char *kwlist[] = {"x", 0}; + + assert(type == &PyFloat_Type); + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:float", kwlist, &x)) + return NULL; + if (PyString_Check(x)) + return PyFloat_FromString(x, NULL); + return PyNumber_Float(x); + } + + static char float_doc[] = + "float(x) -> floating point number\n\ + \n\ + Convert a string or number to a floating point number, if possible."; + + static PyNumberMethods float_as_number = { (binaryfunc)float_add, /*nb_add*/ *************** *** 680,699 **** sizeof(PyFloatObject), 0, ! (destructor)float_dealloc, /*tp_dealloc*/ ! (printfunc)float_print, /*tp_print*/ ! 0, /*tp_getattr*/ ! 0, /*tp_setattr*/ ! (cmpfunc)float_compare, /*tp_compare*/ ! (reprfunc)float_repr, /*tp_repr*/ ! &float_as_number, /*tp_as_number*/ ! 0, /*tp_as_sequence*/ ! 0, /*tp_as_mapping*/ ! (hashfunc)float_hash, /*tp_hash*/ ! 0, /*tp_call*/ ! (reprfunc)float_str, /*tp_str*/ ! 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ ! 0, /*tp_as_buffer*/ ! Py_TPFLAGS_CHECKTYPES /*tp_flags*/ }; --- 700,737 ---- sizeof(PyFloatObject), 0, ! (destructor)float_dealloc, /* tp_dealloc */ ! (printfunc)float_print, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! (cmpfunc)float_compare, /* tp_compare */ ! (reprfunc)float_repr, /* tp_repr */ ! &float_as_number, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! (hashfunc)float_hash, /* tp_hash */ ! 0, /* tp_call */ ! (reprfunc)float_str, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! 0, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /* tp_flags */ ! float_doc, /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! 0, /* tp_members */ ! 0, /* tp_getset */ ! 0, /* tp_base */ ! 0, /* tp_dict */ ! 0, /* tp_descr_get */ ! 0, /* tp_descr_set */ ! 0, /* tp_dictoffset */ ! 0, /* tp_init */ ! 0, /* tp_alloc */ ! float_new, /* tp_new */ }; Index: frameobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v retrieving revision 2.53 retrieving revision 2.54 diff -C2 -d -r2.53 -r2.54 *** frameobject.c 2001/07/12 13:27:11 2.53 --- frameobject.c 2001/08/02 04:15:00 2.54 *************** *** 16,20 **** {"f_builtins", T_OBJECT, OFF(f_builtins),RO}, {"f_globals", T_OBJECT, OFF(f_globals), RO}, - {"f_locals", T_OBJECT, OFF(f_locals), RO}, {"f_lasti", T_INT, OFF(f_lasti), RO}, {"f_lineno", T_INT, OFF(f_lineno), RO}, --- 16,19 ---- *************** *** 28,43 **** static PyObject * ! frame_getattr(PyFrameObject *f, char *name) { ! if (strcmp(name, "f_locals") == 0) ! PyFrame_FastToLocals(f); ! return PyMember_Get((char *)f, frame_memberlist, name); } ! static int ! frame_setattr(PyFrameObject *f, char *name, PyObject *value) ! { ! return PyMember_Set((char *)f, frame_memberlist, name, value); ! } /* Stack frames are allocated and deallocated at a considerable rate. --- 27,41 ---- static PyObject * ! frame_getlocals(PyFrameObject *f, void *closure) { ! PyFrame_FastToLocals(f); ! Py_INCREF(f->f_locals); ! return f->f_locals; } ! static struct getsetlist frame_getsetlist[] = { ! {"f_locals", (getter)frame_getlocals, NULL, NULL}, ! {0} ! }; /* Stack frames are allocated and deallocated at a considerable rate. *************** *** 178,183 **** (destructor)frame_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! (getattrfunc)frame_getattr, /* tp_getattr */ ! (setattrfunc)frame_setattr, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ --- 176,181 ---- (destructor)frame_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ *************** *** 188,193 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ ! 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ --- 186,191 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! PyObject_GenericSetAttr, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ *************** *** 195,198 **** --- 193,205 ---- (traverseproc)frame_traverse, /* tp_traverse */ (inquiry)frame_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + frame_memberlist, /* tp_members */ + frame_getsetlist, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ }; Index: funcobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/funcobject.c,v retrieving revision 2.38 retrieving revision 2.39 diff -C2 -d -r2.38 -r2.39 *** funcobject.c 2001/05/03 16:04:13 2.38 --- funcobject.c 2001/08/02 04:15:00 2.39 *************** *** 4,7 **** --- 4,8 ---- #include "Python.h" #include "compile.h" + #include "eval.h" #include "structmember.h" *************** *** 142,148 **** static PyObject * ! func_getattro(PyFunctionObject *op, PyObject *name) { - PyObject *rtn; char *sname = PyString_AsString(name); --- 143,148 ---- static PyObject * ! func_getattro(PyObject *op, PyObject *name) { char *sname = PyString_AsString(name); *************** *** 152,175 **** return NULL; } - - /* no API for PyMember_HasAttr() */ - rtn = PyMember_Get((char *)op, func_memberlist, sname); ! if (rtn == NULL && PyErr_ExceptionMatches(PyExc_AttributeError)) { ! PyErr_Clear(); ! if (op->func_dict != NULL) { ! rtn = PyDict_GetItem(op->func_dict, name); ! Py_XINCREF(rtn); ! } ! if (rtn == NULL) ! PyErr_SetObject(PyExc_AttributeError, name); ! } ! return rtn; } static int ! func_setattro(PyFunctionObject *op, PyObject *name, PyObject *value) { - int rtn; char *sname = PyString_AsString(name); --- 152,162 ---- return NULL; } ! return PyObject_GenericGetAttr(op, name); } static int ! func_setattro(PyObject *op, PyObject *name, PyObject *value) { char *sname = PyString_AsString(name); *************** *** 217,245 **** } ! rtn = PyMember_Set((char *)op, func_memberlist, sname, value); ! if (rtn < 0 && PyErr_ExceptionMatches(PyExc_AttributeError)) { ! PyErr_Clear(); ! if (op->func_dict == NULL) { ! /* don't create the dict if we're deleting an ! * attribute. In that case, we know we'll get an ! * AttributeError. ! */ ! if (value == NULL) { ! PyErr_SetString(PyExc_AttributeError, sname); ! return -1; ! } ! op->func_dict = PyDict_New(); ! if (op->func_dict == NULL) ! return -1; ! } ! if (value == NULL) ! rtn = PyDict_DelItem(op->func_dict, name); ! else ! rtn = PyDict_SetItem(op->func_dict, name, value); ! /* transform KeyError into AttributeError */ ! if (rtn < 0 && PyErr_ExceptionMatches(PyExc_KeyError)) ! PyErr_SetString(PyExc_AttributeError, sname); ! } ! return rtn; } --- 204,208 ---- } ! return PyObject_GenericSetAttr(op, name, value); } *************** *** 315,318 **** --- 278,341 ---- } + static PyObject * + function_call(PyObject *func, PyObject *arg, PyObject *kw) + { + PyObject *result; + PyObject *argdefs; + PyObject **d, **k; + int nk, nd; + + argdefs = PyFunction_GET_DEFAULTS(func); + if (argdefs != NULL && PyTuple_Check(argdefs)) { + d = &PyTuple_GET_ITEM((PyTupleObject *)argdefs, 0); + nd = PyTuple_Size(argdefs); + } + else { + d = NULL; + nd = 0; + } + + if (kw != NULL && PyDict_Check(kw)) { + int pos, i; + nk = PyDict_Size(kw); + k = PyMem_NEW(PyObject *, 2*nk); + if (k == NULL) { + PyErr_NoMemory(); + Py_DECREF(arg); + return NULL; + } + pos = i = 0; + while (PyDict_Next(kw, &pos, &k[i], &k[i+1])) + i += 2; + nk = i/2; + /* XXX This is broken if the caller deletes dict items! */ + } + else { + k = NULL; + nk = 0; + } + + result = PyEval_EvalCodeEx( + (PyCodeObject *)PyFunction_GET_CODE(func), + PyFunction_GET_GLOBALS(func), (PyObject *)NULL, + &PyTuple_GET_ITEM(arg, 0), PyTuple_Size(arg), + k, nk, d, nd, + PyFunction_GET_CLOSURE(func)); + + if (k != NULL) + PyMem_DEL(k); + + return result; + } + + /* Bind a function to an object */ + static PyObject * + func_descr_get(PyObject *func, PyObject *obj, PyObject *type) + { + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); + } + PyTypeObject PyFunction_Type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 321,344 **** sizeof(PyFunctionObject) + PyGC_HEAD_SIZE, 0, ! (destructor)func_dealloc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! (reprfunc)func_repr, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! (getattrofunc)func_getattro, /* tp_getattro */ ! (setattrofunc)func_setattro, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ ! 0, /* tp_doc */ ! (traverseproc)func_traverse, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ offsetof(PyFunctionObject, func_weakreflist), /* tp_weaklistoffset */ }; --- 344,600 ---- sizeof(PyFunctionObject) + PyGC_HEAD_SIZE, 0, ! (destructor)func_dealloc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! (reprfunc)func_repr, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! function_call, /* tp_call */ ! 0, /* tp_str */ ! func_getattro, /* tp_getattro */ ! func_setattro, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ ! 0, /* tp_doc */ ! (traverseproc)func_traverse, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ offsetof(PyFunctionObject, func_weakreflist), /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + func_memberlist, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + func_descr_get, /* tp_descr_get */ + 0, /* tp_descr_set */ + offsetof(PyFunctionObject, func_dict), /* tp_dictoffset */ + }; + + + /* Class method object */ + + /* A class method receives the class as implicit first argument, + just like an instance method receives the instance. + To declare a class method, use this idiom: + + class C: + def f(cls, arg1, arg2, ...): ... + f = classmethod(f) + + It can be called either on the class (e.g. C.f()) or on an instance + (e.g. C().f()); the instance is ignored except for its class. + If a class method is called for a derived class, the derived class + object is passed as the implied first argument. + + Class methods are different than C++ or Java static methods. + If you want those, see static methods below. + */ + + typedef struct { + PyObject_HEAD + PyObject *cm_callable; + } classmethod; + + static void + cm_dealloc(classmethod *cm) + { + Py_XDECREF(cm->cm_callable); + PyObject_DEL(cm); + } + + static PyObject * + cm_descr_get(PyObject *self, PyObject *obj, PyObject *type) + { + classmethod *cm = (classmethod *)self; + + if (cm->cm_callable == NULL) { + PyErr_SetString(PyExc_RuntimeError, + "uninitialized classmethod object"); + return NULL; + } + return PyMethod_New(cm->cm_callable, + type, (PyObject *)(type->ob_type)); + } + + static int + cm_init(PyObject *self, PyObject *args, PyObject *kwds) + { + classmethod *cm = (classmethod *)self; + PyObject *callable; + + if (!PyArg_ParseTuple(args, "O:callable", &callable)) + return -1; + Py_INCREF(callable); + cm->cm_callable = callable; + return 0; + } + + PyTypeObject PyClassMethod_Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "classmethod", + sizeof(classmethod), + 0, + (destructor)cm_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + cm_descr_get, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + cm_init, /* tp_init */ + PyType_GenericAlloc, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ + }; + + PyObject * + PyClassMethod_New(PyObject *callable) + { + classmethod *cm = (classmethod *) + PyType_GenericAlloc(&PyClassMethod_Type, 0); + if (cm != NULL) { + Py_INCREF(callable); + cm->cm_callable = callable; + } + return (PyObject *)cm; + } + + + /* Static method object */ + + /* A static method does not receive an implicit first argument. + To declare a static method, use this idiom: + + class C: + def f(arg1, arg2, ...): ... + f = staticmethod(f) + + It can be called either on the class (e.g. C.f()) or on an instance + (e.g. C().f()); the instance is ignored except for its class. + + Static methods in Python are similar to those found in Java or C++. + For a more advanced concept, see class methods above. + */ + + typedef struct { + PyObject_HEAD + PyObject *sm_callable; + } staticmethod; + + static void + sm_dealloc(staticmethod *sm) + { + Py_XDECREF(sm->sm_callable); + PyObject_DEL(sm); + } + + static PyObject * + sm_descr_get(PyObject *self, PyObject *obj, PyObject *type) + { + staticmethod *sm = (staticmethod *)self; + + if (sm->sm_callable == NULL) { + PyErr_SetString(PyExc_RuntimeError, + "uninitialized staticmethod object"); + return NULL; + } + Py_INCREF(sm->sm_callable); + return sm->sm_callable; + } + + static int + sm_init(PyObject *self, PyObject *args, PyObject *kwds) + { + staticmethod *sm = (staticmethod *)self; + PyObject *callable; + + if (!PyArg_ParseTuple(args, "O:callable", &callable)) + return -1; + Py_INCREF(callable); + sm->sm_callable = callable; + return 0; + } + + PyTypeObject PyStaticMethod_Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "staticmethod", + sizeof(staticmethod), + 0, + (destructor)sm_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + sm_descr_get, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + sm_init, /* tp_init */ + PyType_GenericAlloc, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ }; + + PyObject * + PyStaticMethod_New(PyObject *callable) + { + staticmethod *sm = (staticmethod *) + PyType_GenericAlloc(&PyStaticMethod_Type, 0); + if (sm != NULL) { + Py_INCREF(callable); + sm->sm_callable = callable; + } + return (PyObject *)sm; + } Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.59 retrieving revision 2.60 diff -C2 -d -r2.59 -r2.60 *** intobject.c 2001/07/19 21:49:38 2.59 --- intobject.c 2001/08/02 04:15:00 2.60 *************** *** 743,746 **** --- 743,781 ---- } + static PyObject * + int_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *x = NULL; + int base = -909; + static char *kwlist[] = {"x", "base", 0}; + + assert(type == &PyInt_Type); + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:int", kwlist, + &x, &base)) + return NULL; + if (x == NULL) + return PyInt_FromLong(0L); + if (base == -909) + return PyNumber_Int(x); + if (PyString_Check(x)) + return PyInt_FromString(PyString_AS_STRING(x), NULL, base); + if (PyUnicode_Check(x)) + return PyInt_FromUnicode(PyUnicode_AS_UNICODE(x), + PyUnicode_GET_SIZE(x), + base); + PyErr_SetString(PyExc_TypeError, + "int() can't convert non-string with explicit base"); + return NULL; + } + + static char int_doc[] = + "int(x[, base]) -> integer\n\ + \n\ + Convert a string or number to an integer, if possible. A floating point\n\ + argument will be truncated towards zero (this does not include a string\n\ + representation of a floating point number!) When converting a string, use\n\ + the optional base. It is an error to supply a base when converting a\n\ + non-string."; + static PyNumberMethods int_as_number = { (binaryfunc)int_add, /*nb_add*/ *************** *** 786,805 **** sizeof(PyIntObject), 0, ! (destructor)int_dealloc, /*tp_dealloc*/ ! (printfunc)int_print, /*tp_print*/ ! 0, /*tp_getattr*/ ! 0, /*tp_setattr*/ ! (cmpfunc)int_compare, /*tp_compare*/ ! (reprfunc)int_repr, /*tp_repr*/ ! &int_as_number, /*tp_as_number*/ ! 0, /*tp_as_sequence*/ ! 0, /*tp_as_mapping*/ ! (hashfunc)int_hash, /*tp_hash*/ ! 0, /*tp_call*/ ! 0, /*tp_str*/ ! 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ ! 0, /*tp_as_buffer*/ ! Py_TPFLAGS_CHECKTYPES /*tp_flags*/ }; --- 821,858 ---- sizeof(PyIntObject), 0, ! (destructor)int_dealloc, /* tp_dealloc */ ! (printfunc)int_print, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! (cmpfunc)int_compare, /* tp_compare */ ! (reprfunc)int_repr, /* tp_repr */ ! &int_as_number, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! (hashfunc)int_hash, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! 0, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /* tp_flags */ ! int_doc, /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! 0, /* tp_members */ ! 0, /* tp_getset */ ! 0, /* tp_base */ ! 0, /* tp_dict */ ! 0, /* tp_descr_get */ ! 0, /* tp_descr_set */ ! 0, /* tp_dictoffset */ ! 0, /* tp_init */ ! 0, /* tp_alloc */ ! int_new, /* tp_new */ }; Index: iterobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/iterobject.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** iterobject.c 2001/07/12 13:27:25 1.5 --- iterobject.c 2001/08/02 04:15:00 1.6 *************** *** 97,106 **** }; - static PyObject * - iter_getattr(seqiterobject *it, char *name) - { - return Py_FindMethod(iter_methods, (PyObject *)it, name); - } - PyTypeObject PySeqIter_Type = { PyObject_HEAD_INIT(&PyType_Type) --- 97,100 ---- *************** *** 112,116 **** (destructor)iter_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! (getattrfunc)iter_getattr, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ --- 106,110 ---- (destructor)iter_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ *************** *** 122,126 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ --- 116,120 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ *************** *** 133,136 **** --- 127,137 ---- (getiterfunc)iter_getiter, /* tp_iter */ (iternextfunc)iter_iternext, /* tp_iternext */ + iter_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ }; *************** *** 199,208 **** static PyObject * - calliter_getattr(calliterobject *it, char *name) - { - return Py_FindMethod(calliter_methods, (PyObject *)it, name); - } - - static PyObject * calliter_iternext(calliterobject *it) { --- 200,203 ---- *************** *** 229,233 **** (destructor)calliter_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! (getattrfunc)calliter_getattr, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ --- 224,228 ---- (destructor)calliter_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ *************** *** 239,243 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ --- 234,238 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ *************** *** 250,252 **** --- 245,254 ---- (getiterfunc)iter_getiter, /* tp_iter */ (iternextfunc)calliter_iternext, /* tp_iternext */ + calliter_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ }; Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.97 retrieving revision 2.98 diff -C2 -d -r2.97 -r2.98 *** listobject.c 2001/07/06 17:45:43 2.97 --- listobject.c 2001/08/02 04:15:00 2.98 *************** *** 524,527 **** --- 524,531 ---- PyMem_DEL(recycle); } + if (a->ob_size == 0 && a->ob_item != NULL) { + PyMem_FREE(a->ob_item); + a->ob_item = NULL; + } return 0; #undef b *************** *** 1290,1293 **** --- 1294,1298 ---- int err; PyObject *compare = NULL; + PyTypeObject *savetype; if (args != NULL) { *************** *** 1295,1303 **** return NULL; } self->ob_type = &immutable_list_type; err = samplesortslice(self->ob_item, self->ob_item + self->ob_size, compare); ! self->ob_type = &PyList_Type; if (err < 0) return NULL; --- 1300,1309 ---- return NULL; } + savetype = self->ob_type; self->ob_type = &immutable_list_type; err = samplesortslice(self->ob_item, self->ob_item + self->ob_size, compare); ! self->ob_type = savetype; if (err < 0) return NULL; *************** *** 1542,1545 **** --- 1548,1645 ---- } + /* Adapted from newer code by Tim */ + static int + list_fill(PyListObject *result, PyObject *v) + { + PyObject *it; /* iter(v) */ + int n; /* guess for result list size */ + int i; + + n = result->ob_size; + + /* Special-case list(a_list), for speed. */ + if (PyList_Check(v)) { + if (v == (PyObject *)result) + return 0; /* source is destination, we're done */ + return list_ass_slice(result, 0, n, v); + } + + /* Empty previous contents */ + if (n != 0) { + if (list_ass_slice(result, 0, n, (PyObject *)NULL) != 0) + return -1; + } + + /* Get iterator. There may be some low-level efficiency to be gained + * by caching the tp_iternext slot instead of using PyIter_Next() + * later, but premature optimization is the root etc. + */ + it = PyObject_GetIter(v); + if (it == NULL) + return -1; + + /* Guess a result list size. */ + n = -1; /* unknown */ + if (PySequence_Check(v) && + v->ob_type->tp_as_sequence->sq_length) { + n = PySequence_Size(v); + if (n < 0) + PyErr_Clear(); + } + if (n < 0) + n = 8; /* arbitrary */ + NRESIZE(result->ob_item, PyObject*, n); + if (result->ob_item == NULL) + goto error; + for (i = 0; i < n; i++) + result->ob_item[i] = NULL; + result->ob_size = n; + + /* Run iterator to exhaustion. */ + for (i = 0; ; i++) { + PyObject *item = PyIter_Next(it); + if (item == NULL) { + if (PyErr_Occurred()) + goto error; + break; + } + if (i < n) + PyList_SET_ITEM(result, i, item); /* steals ref */ + else { + int status = ins1(result, result->ob_size, item); + Py_DECREF(item); /* append creates a new ref */ + if (status < 0) + goto error; + } + } + + /* Cut back result list if initial guess was too large. */ + if (i < n && result != NULL) { + if (list_ass_slice(result, i, n, (PyObject *)NULL) != 0) + goto error; + } + Py_DECREF(it); + return 0; + + error: + Py_DECREF(it); + return -1; + } + + static int + list_init(PyListObject *self, PyObject *args, PyObject *kw) + { + PyObject *arg = NULL; + static char *kwlist[] = {"sequence", 0}; + + if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:list", kwlist, &arg)) + return -1; + if (arg != NULL) + return list_fill(self, arg); + if (self->ob_size > 0) + return list_ass_slice(self, 0, self->ob_size, (PyObject*)NULL); + return 0; + } + static char append_doc[] = "L.append(object) -- append object to end"; *************** *** 1574,1583 **** }; - static PyObject * - list_getattr(PyListObject *f, char *name) - { - return Py_FindMethod(list_methods, (PyObject *)f, name); - } - static PySequenceMethods list_as_sequence = { (inquiry)list_length, /* sq_length */ --- 1674,1677 ---- *************** *** 1593,1596 **** --- 1687,1694 ---- }; + static char list_doc[] = + "list() -> new list\n" + "list(sequence) -> new list initialized from sequence's items"; + PyTypeObject PyList_Type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 1601,1605 **** (destructor)list_dealloc, /* tp_dealloc */ (printfunc)list_print, /* tp_print */ ! (getattrfunc)list_getattr, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ --- 1699,1703 ---- (destructor)list_dealloc, /* tp_dealloc */ (printfunc)list_print, /* tp_print */ ! 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ *************** *** 1611,1622 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ ! 0, /* tp_doc */ (traverseproc)list_traverse, /* tp_traverse */ (inquiry)list_clear, /* tp_clear */ list_richcompare, /* tp_richcompare */ }; --- 1709,1735 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC | ! Py_TPFLAGS_BASETYPE, /* tp_flags */ ! list_doc, /* tp_doc */ (traverseproc)list_traverse, /* tp_traverse */ (inquiry)list_clear, /* tp_clear */ list_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + list_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)list_init, /* tp_init */ + PyType_GenericAlloc, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ }; *************** *** 1647,1656 **** }; - static PyObject * - immutable_list_getattr(PyListObject *f, char *name) - { - return Py_FindMethod(immutable_list_methods, (PyObject *)f, name); - } - static int immutable_list_ass(void) --- 1760,1763 ---- *************** *** 1679,1683 **** 0, /* Cannot happen */ /* tp_dealloc */ (printfunc)list_print, /* tp_print */ ! (getattrfunc)immutable_list_getattr, /* tp_getattr */ 0, /* tp_setattr */ 0, /* Won't be called */ /* tp_compare */ --- 1786,1790 ---- 0, /* Cannot happen */ /* tp_dealloc */ (printfunc)list_print, /* tp_print */ ! 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* Won't be called */ /* tp_compare */ *************** *** 1689,1700 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ ! 0, /* tp_doc */ (traverseproc)list_traverse, /* tp_traverse */ 0, /* tp_clear */ list_richcompare, /* tp_richcompare */ /* NOTE: This is *not* the standard list_type struct! */ }; --- 1796,1818 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ ! list_doc, /* tp_doc */ (traverseproc)list_traverse, /* tp_traverse */ 0, /* tp_clear */ list_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + immutable_list_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_init */ /* NOTE: This is *not* the standard list_type struct! */ }; Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** longobject.c 2001/07/15 18:38:47 1.89 --- longobject.c 2001/08/02 04:15:00 1.90 *************** *** 2032,2035 **** --- 2032,2072 ---- } + static PyObject * + long_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *x = NULL; + int base = -909; /* unlikely! */ + static char *kwlist[] = {"x", "base", 0}; + + assert(type == &PyLong_Type); + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:long", kwlist, + &x, &base)) + return NULL; + if (x == NULL) + return PyLong_FromLong(0L); + if (base == -909) + return PyNumber_Long(x); + else if (PyString_Check(x)) + return PyLong_FromString(PyString_AS_STRING(x), NULL, base); + else if (PyUnicode_Check(x)) + return PyLong_FromUnicode(PyUnicode_AS_UNICODE(x), + PyUnicode_GET_SIZE(x), + base); + else { + PyErr_SetString(PyExc_TypeError, + "long() can't convert non-string with explicit base"); + return NULL; + } + } + + static char long_doc[] = + "long(x[, base]) -> integer\n\ + \n\ + Convert a string or number to a long integer, if possible. A floating\n\ + point argument will be truncated towards zero (this does not include a\n\ + string representation of a floating point number!) When converting a\n\ + string, use the optional base. It is an error to supply a base when\n\ + converting a non-string."; + static PyNumberMethods long_as_number = { (binaryfunc) long_add, /*nb_add*/ *************** *** 2071,2093 **** PyTypeObject PyLong_Type = { PyObject_HEAD_INIT(&PyType_Type) ! 0, ! "long int", ! sizeof(PyLongObject) - sizeof(digit), ! sizeof(digit), ! (destructor)long_dealloc, /*tp_dealloc*/ ! 0, /*tp_print*/ ! 0, /*tp_getattr*/ ! 0, /*tp_setattr*/ ! (cmpfunc)long_compare, /*tp_compare*/ ! (reprfunc)long_repr, /*tp_repr*/ ! &long_as_number, /*tp_as_number*/ ! 0, /*tp_as_sequence*/ ! 0, /*tp_as_mapping*/ ! (hashfunc)long_hash, /*tp_hash*/ ! 0, /*tp_call*/ ! (reprfunc)long_str, /*tp_str*/ ! 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ ! 0, /*tp_as_buffer*/ ! Py_TPFLAGS_CHECKTYPES /*tp_flags*/ }; --- 2108,2148 ---- PyTypeObject PyLong_Type = { PyObject_HEAD_INIT(&PyType_Type) ! 0, /* ob_size */ ! "long", /* tp_name */ ! sizeof(PyLongObject) - sizeof(digit), /* tp_basicsize */ ! sizeof(digit), /* tp_itemsize */ ! (destructor)long_dealloc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! (cmpfunc)long_compare, /* tp_compare */ ! (reprfunc)long_repr, /* tp_repr */ ! &long_as_number, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! (hashfunc)long_hash, /* tp_hash */ ! 0, /* tp_call */ ! (reprfunc)long_str, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! 0, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /* tp_flags */ ! long_doc, /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! 0, /* tp_members */ ! 0, /* tp_getset */ ! 0, /* tp_base */ ! 0, /* tp_dict */ ! 0, /* tp_descr_get */ ! 0, /* tp_descr_set */ ! 0, /* tp_dictoffset */ ! 0, /* tp_init */ ! 0, /* tp_alloc */ ! long_new, /* tp_new */ }; Index: methodobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/methodobject.c,v retrieving revision 2.34 retrieving revision 2.35 diff -C2 -d -r2.34 -r2.35 *** methodobject.c 2001/07/12 13:27:35 2.34 --- methodobject.c 2001/08/02 04:15:00 2.35 *************** *** 4,9 **** #include "Python.h" - #include "token.h" - static PyCFunctionObject *free_list = NULL; --- 4,7 ---- *************** *** 70,73 **** --- 68,88 ---- } + static PyObject * + meth_get__doc__(PyCFunctionObject *m, void *closure) + { + char *doc = m->m_ml->ml_doc; + + if (doc != NULL) + return PyString_FromString(doc); + Py_INCREF(Py_None); + return Py_None; + } + + static PyObject * + meth_get__name__(PyCFunctionObject *m, void *closure) + { + return PyString_FromString(m->m_ml->ml_name); + } + static int meth_traverse(PyCFunctionObject *m, visitproc visit, void *arg) *************** *** 80,116 **** static PyObject * ! meth_getattr(PyCFunctionObject *m, char *name) { ! if (strcmp(name, "__name__") == 0) { ! return PyString_FromString(m->m_ml->ml_name); ! } ! if (strcmp(name, "__doc__") == 0) { ! char *doc = m->m_ml->ml_doc; ! if (doc != NULL) ! return PyString_FromString(doc); ! Py_INCREF(Py_None); ! return Py_None; ! } ! if (strcmp(name, "__self__") == 0) { ! PyObject *self; ! if (PyEval_GetRestricted()) { ! PyErr_SetString(PyExc_RuntimeError, ! "method.__self__ not accessible in restricted mode"); ! return NULL; ! } ! self = m->m_self; ! if (self == NULL) ! self = Py_None; ! Py_INCREF(self); ! return self; ! } ! if (strcmp(name, "__members__") == 0) { ! return Py_BuildValue("[sss]", ! "__doc__", "__name__", "__self__"); } ! PyErr_SetString(PyExc_AttributeError, name); ! return NULL; } static PyObject * meth_repr(PyCFunctionObject *m) --- 95,120 ---- static PyObject * ! meth_get__self__(PyCFunctionObject *m, void *closure) { ! PyObject *self; ! if (PyEval_GetRestricted()) { ! PyErr_SetString(PyExc_RuntimeError, ! "method.__self__ not accessible in restricted mode"); ! return NULL; } ! self = m->m_self; ! if (self == NULL) ! self = Py_None; ! Py_INCREF(self); ! return self; } + static struct getsetlist meth_getsets [] = { + {"__doc__", (getter)meth_get__doc__, NULL, NULL}, + {"__name__", (getter)meth_get__name__, NULL, NULL}, + {"__self__", (getter)meth_get__self__, NULL, NULL}, + {0} + }; + static PyObject * meth_repr(PyCFunctionObject *m) *************** *** 160,163 **** --- 164,202 ---- } + static PyObject * + meth_call(PyObject *func, PyObject *arg, PyObject *kw) + { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + + if (flags & METH_KEYWORDS) { + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + } + if (kw != NULL && PyDict_Size(kw) != 0) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; + } + if (flags & METH_VARARGS) { + return (*meth)(self, arg); + } + if (!(flags & METH_VARARGS)) { + /* the really old style */ + int size = PyTuple_GET_SIZE(arg); + if (size == 1) + arg = PyTuple_GET_ITEM(arg, 0); + else if (size == 0) + arg = NULL; + return (*meth)(self, arg); + } + /* should never get here ??? */ + PyErr_BadInternalCall(); + return NULL; + } + + PyTypeObject PyCFunction_Type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 168,172 **** (destructor)meth_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! (getattrfunc)meth_getattr, /* tp_getattr */ 0, /* tp_setattr */ (cmpfunc)meth_compare, /* tp_compare */ --- 207,211 ---- (destructor)meth_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! 0, /* tp_getattr */ 0, /* tp_setattr */ (cmpfunc)meth_compare, /* tp_compare */ *************** *** 176,182 **** 0, /* tp_as_mapping */ (hashfunc)meth_hash, /* tp_hash */ ! 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ --- 215,221 ---- 0, /* tp_as_mapping */ (hashfunc)meth_hash, /* tp_hash */ ! meth_call, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ *************** *** 184,187 **** --- 223,236 ---- 0, /* tp_doc */ (traverseproc)meth_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + meth_getsets, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ }; Index: moduleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/moduleobject.c,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -d -r2.33 -r2.34 *** moduleobject.c 2001/05/12 20:24:22 2.33 --- moduleobject.c 2001/08/02 04:15:00 2.34 *************** *** 3,6 **** --- 3,7 ---- #include "Python.h" + #include "structmember.h" typedef struct { *************** *** 9,12 **** --- 10,18 ---- } PyModuleObject; + struct memberlist module_members[] = { + {"__dict__", T_OBJECT, offsetof(PyModuleObject, md_dict), READONLY}, + {0} + }; + PyObject * PyModule_New(char *name) *************** *** 129,132 **** --- 135,147 ---- /* Methods */ + static int + module_init(PyModuleObject *m, PyObject *args, PyObject *kw) + { + m->md_dict = PyDict_New(); + if (m->md_dict == NULL) + return -1; + return 0; + } + static void module_dealloc(PyModuleObject *m) *************** *** 162,218 **** } - static PyObject * - module_getattro(PyModuleObject *m, PyObject *name) - { - PyObject *res; - char *sname = PyString_AsString(name); - - if (sname[0] == '_' && strcmp(sname, "__dict__") == 0) { - Py_INCREF(m->md_dict); - return m->md_dict; - } - res = PyDict_GetItem(m->md_dict, name); - if (res == NULL) { - char *modname = PyModule_GetName((PyObject *)m); - if (modname == NULL) { - PyErr_Clear(); - modname = "?"; - } - PyErr_Format(PyExc_AttributeError, - "'%.50s' module has no attribute '%.400s'", - modname, sname); - } - else - Py_INCREF(res); - return res; - } - - static int - module_setattro(PyModuleObject *m, PyObject *name, PyObject *v) - { - char *sname = PyString_AsString(name); - if (sname[0] == '_' && strcmp(sname, "__dict__") == 0) { - PyErr_SetString(PyExc_TypeError, - "read-only special attribute"); - return -1; - } - if (v == NULL) { - int rv = PyDict_DelItem(m->md_dict, name); - if (rv < 0) { - char *modname = PyModule_GetName((PyObject *)m); - if (modname == NULL) { - PyErr_Clear(); - modname = "?"; - } - PyErr_Format(PyExc_AttributeError, - "'%.50s' module has no attribute '%.400s'", - modname, sname); - } - return rv; - } - else - return PyDict_SetItem(m->md_dict, name, v); - } - /* We only need a traverse function, no clear function: If the module is in a cycle, md_dict will be cleared as well, which will break --- 177,180 ---- *************** *** 230,241 **** 0, /* ob_size */ "module", /* tp_name */ ! sizeof(PyModuleObject) + PyGC_HEAD_SIZE,/* tp_size */ 0, /* tp_itemsize */ ! (destructor)module_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ 0, /* tp_compare */ ! (reprfunc)module_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ --- 192,203 ---- 0, /* ob_size */ "module", /* tp_name */ ! sizeof(PyModuleObject) + PyGC_HEAD_SIZE, /* tp_size */ 0, /* tp_itemsize */ ! (destructor)module_dealloc, /* tp_dealloc */ 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ 0, /* tp_compare */ ! (reprfunc)module_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ *************** *** 244,252 **** 0, /* tp_call */ 0, /* tp_str */ ! (getattrofunc)module_getattro, /* tp_getattro */ ! (setattrofunc)module_setattro, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)module_traverse, /* tp_traverse */ }; --- 206,231 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! PyObject_GenericSetAttr, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC | ! Py_TPFLAGS_BASETYPE, /* tp_flags */ 0, /* tp_doc */ (traverseproc)module_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + module_members, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + offsetof(PyModuleObject, md_dict), /* tp_dictoffset */ + (initproc)module_init, /* tp_init */ + PyType_GenericAlloc, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ }; Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.134 retrieving revision 2.135 diff -C2 -d -r2.134 -r2.135 *** object.c 2001/07/30 22:34:24 2.134 --- object.c 2001/08/02 04:15:00 2.135 *************** *** 33,37 **** for (tp = type_list; tp; tp = tp->tp_next) fprintf(stderr, "%s alloc'd: %d, freed: %d, max in use: %d\n", ! tp->tp_name, tp->tp_alloc, tp->tp_free, tp->tp_maxalloc); fprintf(stderr, "fast tuple allocs: %d, empty: %d\n", --- 33,37 ---- for (tp = type_list; tp; tp = tp->tp_next) fprintf(stderr, "%s alloc'd: %d, freed: %d, max in use: %d\n", ! tp->tp_name, tp->tp_allocs, tp->tp_frees, tp->tp_maxalloc); fprintf(stderr, "fast tuple allocs: %d, empty: %d\n", *************** *** 54,59 **** return NULL; for (tp = type_list; tp; tp = tp->tp_next) { ! v = Py_BuildValue("(siii)", tp->tp_name, tp->tp_alloc, ! tp->tp_free, tp->tp_maxalloc); if (v == NULL) { Py_DECREF(result); --- 54,59 ---- return NULL; for (tp = type_list; tp; tp = tp->tp_next) { ! v = Py_BuildValue("(siii)", tp->tp_name, tp->tp_allocs, ! tp->tp_frees, tp->tp_maxalloc); if (v == NULL) { Py_DECREF(result); *************** *** 73,77 **** inc_count(PyTypeObject *tp) { ! if (tp->tp_alloc == 0) { /* first time; insert in linked list */ if (tp->tp_next != NULL) /* sanity check */ --- 73,77 ---- inc_count(PyTypeObject *tp) { ! if (tp->tp_allocs == 0) { /* first time; insert in linked list */ if (tp->tp_next != NULL) /* sanity check */ *************** *** 80,86 **** type_list = tp; } ! tp->tp_alloc++; ! if (tp->tp_alloc - tp->tp_free > tp->tp_maxalloc) ! tp->tp_maxalloc = tp->tp_alloc - tp->tp_free; } #endif --- 80,86 ---- type_list = tp; } ! tp->tp_allocs++; ! if (tp->tp_allocs - tp->tp_frees > tp->tp_maxalloc) ! tp->tp_maxalloc = tp->tp_allocs - tp->tp_frees; } #endif *************** *** 94,101 **** return op; } - #ifdef WITH_CYCLE_GC if (PyType_IS_GC(tp)) op = (PyObject *) PyObject_FROM_GC(op); - #endif /* Any changes should be reflected in PyObject_INIT (objimpl.h) */ op->ob_type = tp; --- 94,99 ---- *************** *** 112,119 **** return op; } - #ifdef WITH_CYCLE_GC if (PyType_IS_GC(tp)) op = (PyVarObject *) PyObject_FROM_GC(op); - #endif /* Any changes should be reflected in PyObject_INIT_VAR */ op->ob_size = size; --- 110,115 ---- *************** *** 130,137 **** if (op == NULL) return PyErr_NoMemory(); - #ifdef WITH_CYCLE_GC if (PyType_IS_GC(tp)) op = (PyObject *) PyObject_FROM_GC(op); - #endif return PyObject_INIT(op, tp); } --- 126,131 ---- *************** *** 144,151 **** if (op == NULL) return (PyVarObject *)PyErr_NoMemory(); - #ifdef WITH_CYCLE_GC if (PyType_IS_GC(tp)) op = (PyVarObject *) PyObject_FROM_GC(op); - #endif return PyObject_INIT_VAR(op, tp, size); } --- 138,143 ---- *************** *** 154,162 **** _PyObject_Del(PyObject *op) { - #ifdef WITH_CYCLE_GC if (op && PyType_IS_GC(op->ob_type)) { op = (PyObject *) PyObject_AS_GC(op); } - #endif PyObject_FREE(op); } --- 146,152 ---- *************** *** 995,1018 **** PyObject_GetAttrString(PyObject *v, char *name) { ! if (v->ob_type->tp_getattro != NULL) { ! PyObject *w, *res; ! w = PyString_InternFromString(name); ! if (w == NULL) ! return NULL; ! res = (*v->ob_type->tp_getattro)(v, w); ! Py_XDECREF(w); ! return res; ! } ! if (v->ob_type->tp_getattr == NULL) { ! PyErr_Format(PyExc_AttributeError, ! "'%.50s' object has no attribute '%.400s'", ! v->ob_type->tp_name, ! name); ! return NULL; ! } ! else { return (*v->ob_type->tp_getattr)(v, name); ! } } --- 985,998 ---- PyObject_GetAttrString(PyObject *v, char *name) { ! PyObject *w, *res; ! if (v->ob_type->tp_getattr != NULL) return (*v->ob_type->tp_getattr)(v, name); ! w = PyString_InternFromString(name); ! if (w == NULL) ! return NULL; ! res = PyObject_GetAttr(v, w); ! Py_XDECREF(w); ! return res; } *************** *** 1032,1058 **** PyObject_SetAttrString(PyObject *v, char *name, PyObject *w) { ! if (v->ob_type->tp_setattro != NULL) { ! PyObject *s; ! int res; ! s = PyString_InternFromString(name); ! if (s == NULL) ! return -1; ! res = (*v->ob_type->tp_setattro)(v, s, w); ! Py_XDECREF(s); ! return res; ! } ! if (v->ob_type->tp_setattr == NULL) { ! if (v->ob_type->tp_getattr == NULL) ! PyErr_SetString(PyExc_TypeError, ! "attribute-less object (assign or del)"); ! else ! PyErr_SetString(PyExc_TypeError, ! "object has read-only attributes"); ! return -1; ! } ! else { return (*v->ob_type->tp_setattr)(v, name, w); ! } } --- 1012,1026 ---- PyObject_SetAttrString(PyObject *v, char *name, PyObject *w) { ! PyObject *s; ! int res; ! if (v->ob_type->tp_setattr != NULL) return (*v->ob_type->tp_setattr)(v, name, w); ! s = PyString_InternFromString(name); ! if (s == NULL) ! return -1; ! res = PyObject_SetAttr(v, s, w); ! Py_XDECREF(s); ! return res; } *************** *** 1060,1063 **** --- 1028,1033 ---- PyObject_GetAttr(PyObject *v, PyObject *name) { + PyTypeObject *tp = v->ob_type; + /* The Unicode to string conversion is done here because the existing tp_getattro slots expect a string object as name *************** *** 1068,1072 **** return NULL; } - if (!PyString_Check(name)) { PyErr_SetString(PyExc_TypeError, --- 1038,1041 ---- *************** *** 1074,1081 **** return NULL; } ! if (v->ob_type->tp_getattro != NULL) ! return (*v->ob_type->tp_getattro)(v, name); ! else ! return PyObject_GetAttrString(v, PyString_AS_STRING(name)); } --- 1043,1054 ---- return NULL; } ! if (tp->tp_getattro != NULL) ! return (*tp->tp_getattro)(v, name); ! if (tp->tp_getattr != NULL) ! return (*tp->tp_getattr)(v, PyString_AS_STRING(name)); ! PyErr_Format(PyExc_AttributeError, ! "'%.50s' object has no attribute '%.400s'", ! tp->tp_name, PyString_AS_STRING(name)); ! return NULL; } *************** *** 1095,1098 **** --- 1068,1072 ---- PyObject_SetAttr(PyObject *v, PyObject *name, PyObject *value) { + PyTypeObject *tp = v->ob_type; int err; *************** *** 1105,1129 **** return -1; } ! else ! Py_INCREF(name); ! ! if (!PyString_Check(name)){ PyErr_SetString(PyExc_TypeError, "attribute name must be string"); ! err = -1; } ! else { ! PyString_InternInPlace(&name); ! if (v->ob_type->tp_setattro != NULL) ! err = (*v->ob_type->tp_setattro)(v, name, value); ! else ! err = PyObject_SetAttrString(v, ! PyString_AS_STRING(name), value); } ! Py_DECREF(name); ! return err; } /* Test a value used as condition, e.g., in a for or if statement. Return -1 if an error occurred */ --- 1079,1260 ---- return -1; } ! else if (!PyString_Check(name)){ PyErr_SetString(PyExc_TypeError, "attribute name must be string"); ! return -1; } ! else ! Py_INCREF(name); ! ! PyString_InternInPlace(&name); ! if (tp->tp_setattro != NULL) { ! err = (*tp->tp_setattro)(v, name, value); ! Py_DECREF(name); ! return err; } ! if (tp->tp_setattr != NULL) { ! err = (*tp->tp_setattr)(v, PyString_AS_STRING(name), value); ! Py_DECREF(name); ! return err; ! } Py_DECREF(name); ! if (tp->tp_getattr == NULL && tp->tp_getattro == NULL) ! PyErr_Format(PyExc_TypeError, ! "'%.100s' object has no attributes " ! "(%s .%.100s)", ! tp->tp_name, ! value==NULL ? "del" : "assign to", ! PyString_AS_STRING(name)); ! else ! PyErr_Format(PyExc_TypeError, ! "'%.100s' object has only read-only attributes " ! "(%s .%.100s)", ! tp->tp_name, ! value==NULL ? "del" : "assign to", ! PyString_AS_STRING(name)); ! return -1; } + /* Helper to get a pointer to an object's __dict__ slot, if any */ + + PyObject ** + _PyObject_GetDictPtr(PyObject *obj) + { + #define PTRSIZE (sizeof(PyObject *)) + + long dictoffset; + PyTypeObject *tp = obj->ob_type; + + if (!(tp->tp_flags & Py_TPFLAGS_HAVE_CLASS)) + return NULL; + dictoffset = tp->tp_dictoffset; + if (dictoffset == 0) + return NULL; + if (dictoffset < 0) { + dictoffset += PyType_BASICSIZE(tp); + assert(dictoffset > 0); /* Sanity check */ + if (tp->tp_itemsize > 0) { + int n = ((PyVarObject *)obj)->ob_size; + if (n > 0) { + dictoffset += tp->tp_itemsize * n; + /* Round up, if necessary */ + if (tp->tp_itemsize % PTRSIZE != 0) { + dictoffset += PTRSIZE - 1; + dictoffset /= PTRSIZE; + dictoffset *= PTRSIZE; + } + } + } + } + return (PyObject **) ((char *)obj + dictoffset); + } + + /* Generic GetAttr functions - put these in your tp_[gs]etattro slot */ + + PyObject * + PyObject_GenericGetAttr(PyObject *obj, PyObject *name) + { + PyTypeObject *tp = obj->ob_type; + PyObject *descr; + descrgetfunc f; + PyObject **dictptr; + + if (tp->tp_dict == NULL) { + if (PyType_InitDict(tp) < 0) + return NULL; + } + + descr = _PyType_Lookup(tp, name); + f = NULL; + if (descr != NULL) { + f = descr->ob_type->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) + return f(descr, obj, (PyObject *)obj->ob_type); + } + + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + if (dict != NULL) { + PyObject *res = PyDict_GetItem(dict, name); + if (res != NULL) { + Py_INCREF(res); + return res; + } + } + } + + if (f != NULL) + return f(descr, obj, (PyObject *)obj->ob_type); + + if (descr != NULL) { + Py_INCREF(descr); + return descr; + } + + PyErr_Format(PyExc_AttributeError, + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); + return NULL; + } + + int + PyObject_GenericSetAttr(PyObject *obj, PyObject *name, PyObject *value) + { + PyTypeObject *tp = obj->ob_type; + PyObject *descr; + descrsetfunc f; + PyObject **dictptr; + + if (tp->tp_dict == NULL) { + if (PyType_InitDict(tp) < 0) + return -1; + } + + descr = _PyType_Lookup(tp, name); + f = NULL; + if (descr != NULL) { + f = descr->ob_type->tp_descr_set; + if (f != NULL && PyDescr_IsData(descr)) + return f(descr, obj, value); + } + + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + if (dict == NULL && value != NULL) { + dict = PyDict_New(); + if (dict == NULL) + return -1; + *dictptr = dict; + } + if (dict != NULL) { + int res; + if (value == NULL) + res = PyDict_DelItem(dict, name); + else + res = PyDict_SetItem(dict, name, value); + if (res < 0 && PyErr_ExceptionMatches(PyExc_KeyError)) + PyErr_SetObject(PyExc_AttributeError, name); + return res; + } + } + + if (f != NULL) + return f(descr, obj, value); + + if (descr == NULL) { + PyErr_Format(PyExc_AttributeError, + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); + return -1; + } + + PyErr_Format(PyExc_AttributeError, + "'%.50s' object attribute '%.400s' is read-only", + tp->tp_name, PyString_AS_STRING(name)); + return -1; + } + /* Test a value used as condition, e.g., in a for or if statement. Return -1 if an error occurred */ *************** *** 1219,1228 **** if (x == NULL) return 0; - if (x->ob_type->tp_call != NULL || - PyFunction_Check(x) || - PyMethod_Check(x) || - PyCFunction_Check(x) || - PyClass_Check(x)) - return 1; if (PyInstance_Check(x)) { PyObject *call = PyObject_GetAttrString(x, "__call__"); --- 1350,1353 ---- *************** *** 1236,1240 **** return 1; } ! return 0; } --- 1361,1367 ---- return 1; } ! else { ! return x->ob_type->tp_call != NULL; ! } } *************** *** 1366,1370 **** op->_ob_next = op->_ob_prev = NULL; #ifdef COUNT_ALLOCS ! op->ob_type->tp_free++; #endif } --- 1493,1497 ---- op->_ob_next = op->_ob_prev = NULL; #ifdef COUNT_ALLOCS ! op->ob_type->tp_frees++; #endif } Index: rangeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/rangeobject.c,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -d -r2.26 -r2.27 *** rangeobject.c 2001/07/09 12:30:54 2.26 --- rangeobject.c 2001/08/02 04:15:00 2.27 *************** *** 311,330 **** sizeof(rangeobject), /* Basic object size */ 0, /* Item size for varobject */ ! (destructor)range_dealloc, /*tp_dealloc*/ ! 0, /*tp_print*/ ! (getattrfunc)range_getattr, /*tp_getattr*/ ! 0, /*tp_setattr*/ ! (cmpfunc)range_compare, /*tp_compare*/ ! (reprfunc)range_repr, /*tp_repr*/ ! 0, /*tp_as_number*/ ! &range_as_sequence, /*tp_as_sequence*/ ! 0, /*tp_as_mapping*/ ! 0, /*tp_hash*/ ! 0, /*tp_call*/ ! 0, /*tp_str*/ ! 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ ! 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT, /*tp_flags*/ }; --- 311,342 ---- sizeof(rangeobject), /* Basic object size */ 0, /* Item size for varobject */ ! (destructor)range_dealloc, /*tp_dealloc*/ ! 0, /*tp_print*/ ! (getattrfunc)range_getattr, /*tp_getattr*/ ! 0, /*tp_setattr*/ ! (cmpfunc)range_compare, /*tp_compare*/ ! (reprfunc)range_repr, /*tp_repr*/ ! 0, /*tp_as_number*/ ! &range_as_sequence, /*tp_as_sequence*/ ! 0, /*tp_as_mapping*/ ! 0, /*tp_hash*/ ! 0, /*tp_call*/ ! 0, /*tp_str*/ ! PyObject_GenericGetAttr, /*tp_getattro*/ ! 0, /*tp_setattro*/ ! 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT, /*tp_flags*/ ! 0, /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! 0, /* tp_members */ ! 0, /* tp_getset */ ! 0, /* tp_base */ ! 0, /* tp_dict */ }; Index: sliceobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/sliceobject.c,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** sliceobject.c 2001/03/20 12:41:34 2.7 --- sliceobject.c 2001/08/02 04:15:00 2.8 *************** *** 15,18 **** --- 15,19 ---- #include "Python.h" + #include "structmember.h" static PyObject * *************** *** 128,158 **** return s; } - ! static PyObject *slice_getattr(PySliceObject *self, char *name) ! { ! PyObject *ret; ! ! ret = NULL; ! if (strcmp(name, "start") == 0) { ! ret = self->start; ! } ! else if (strcmp(name, "stop") == 0) { ! ret = self->stop; ! } ! else if (strcmp(name, "step") == 0) { ! ret = self->step; ! } ! else if (strcmp(name, "__members__") == 0) { ! return Py_BuildValue("[sss]", ! "start", "stop", "step"); ! } ! else { ! PyErr_SetString(PyExc_AttributeError, name); ! return NULL; ! } ! Py_INCREF(ret); ! return ret; ! } static int --- 129,139 ---- return s; } ! static struct memberlist slice_members[] = { ! {"start", T_OBJECT, offsetof(PySliceObject, start), READONLY}, ! {"stop", T_OBJECT, offsetof(PySliceObject, stop), READONLY}, ! {"step", T_OBJECT, offsetof(PySliceObject, step), READONLY}, ! {0} ! }; static int *************** *** 183,194 **** sizeof(PySliceObject), /* Basic object size */ 0, /* Item size for varobject */ ! (destructor)slice_dealloc, /*tp_dealloc*/ ! 0, /*tp_print*/ ! (getattrfunc)slice_getattr, /*tp_getattr*/ ! 0, /*tp_setattr*/ ! (cmpfunc)slice_compare, /*tp_compare*/ ! (reprfunc)slice_repr, /*tp_repr*/ ! 0, /*tp_as_number*/ ! 0, /*tp_as_sequence*/ ! 0, /*tp_as_mapping*/ }; --- 164,194 ---- sizeof(PySliceObject), /* Basic object size */ 0, /* Item size for varobject */ ! (destructor)slice_dealloc, /* tp_dealloc */ ! 0, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! (cmpfunc)slice_compare, /* tp_compare */ ! (reprfunc)slice_repr, /* tp_repr */ ! 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! 0, /* tp_hash */ ! 0, /* tp_call */ ! 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! 0, /* tp_setattro */ ! 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ ! 0, /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! 0, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! slice_members, /* tp_members */ ! 0, /* tp_getset */ ! 0, /* tp_base */ ! 0, /* tp_dict */ }; Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.121 retrieving revision 2.122 diff -C2 -d -r2.121 -r2.122 *** stringobject.c 2001/07/30 22:34:24 2.121 --- stringobject.c 2001/08/02 04:15:00 2.122 *************** *** 2523,2561 **** static PyObject * ! string_getattr(PyStringObject *s, char *name) { ! return Py_FindMethod(string_methods, (PyObject*)s, name); } PyTypeObject PyString_Type = { PyObject_HEAD_INIT(&PyType_Type) 0, ! "string", sizeof(PyStringObject), sizeof(char), ! (destructor)string_dealloc, /*tp_dealloc*/ ! (printfunc)string_print, /*tp_print*/ ! (getattrfunc)string_getattr, /*tp_getattr*/ ! 0, /*tp_setattr*/ ! 0, /*tp_compare*/ ! (reprfunc)string_repr, /*tp_repr*/ ! 0, /*tp_as_number*/ ! &string_as_sequence, /*tp_as_sequence*/ ! 0, /*tp_as_mapping*/ ! (hashfunc)string_hash, /*tp_hash*/ ! 0, /*tp_call*/ ! (reprfunc)string_str, /*tp_str*/ ! 0, /*tp_getattro*/ ! 0, /*tp_setattro*/ ! &string_as_buffer, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT, /*tp_flags*/ ! 0, /*tp_doc*/ ! 0, /*tp_traverse*/ ! 0, /*tp_clear*/ ! (richcmpfunc)string_richcompare, /*tp_richcompare*/ ! 0, /*tp_weaklistoffset*/ ! 0, /*tp_iter*/ ! 0, /*tp_iternext*/ }; --- 2523,2585 ---- static PyObject * ! string_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { ! PyObject *x = NULL; ! static char *kwlist[] = {"object", 0}; ! ! assert(type == &PyString_Type); ! if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:str", kwlist, &x)) ! return NULL; ! if (x == NULL) ! return PyString_FromString(""); ! return PyObject_Str(x); } + static char string_doc[] = + "str(object) -> string\n\ + \n\ + Return a nice string representation of the object.\n\ + If the argument is a string, the return value is the same object."; PyTypeObject PyString_Type = { PyObject_HEAD_INIT(&PyType_Type) 0, ! "str", sizeof(PyStringObject), sizeof(char), ! (destructor)string_dealloc, /* tp_dealloc */ ! (printfunc)string_print, /* tp_print */ ! 0, /* tp_getattr */ ! 0, /* tp_setattr */ ! 0, /* tp_compare */ ! (reprfunc)string_repr, /* tp_repr */ ! 0, /* tp_as_number */ ! &string_as_sequence, /* tp_as_sequence */ ! 0, /* tp_as_mapping */ ! (hashfunc)string_hash, /* tp_hash */ ! 0, /* tp_call */ ! (reprfunc)string_str, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! 0, /* tp_setattro */ ! &string_as_buffer, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ ! string_doc, /* tp_doc */ ! 0, /* tp_traverse */ ! 0, /* tp_clear */ ! (richcmpfunc)string_richcompare, /* tp_richcompare */ ! 0, /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! string_methods, /* tp_methods */ ! 0, /* tp_members */ ! 0, /* tp_getset */ ! 0, /* tp_base */ ! 0, /* tp_dict */ ! 0, /* tp_descr_get */ ! 0, /* tp_descr_set */ ! 0, /* tp_dictoffset */ ! 0, /* tp_init */ ! 0, /* tp_alloc */ ! string_new, /* tp_new */ }; Index: tupleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v retrieving revision 2.53 retrieving revision 2.54 diff -C2 -d -r2.53 -r2.54 *** tupleobject.c 2001/06/16 05:11:17 2.53 --- tupleobject.c 2001/08/02 04:15:00 2.54 *************** *** 481,484 **** --- 481,506 ---- } + static PyObject * + tuple_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *arg = NULL; + static char *kwlist[] = {"sequence", 0}; + + assert(type == &PyTuple_Type); + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:tuple", kwlist, &arg)) + return NULL; + + if (arg == NULL) + return PyTuple_New(0); + else + return PySequence_Tuple(arg); + } + + static char tuple_doc[] = + "tuple(sequence) -> list\n\ + \n\ + Return a tuple whose items are the same as those of the argument sequence.\n\ + If the argument is a tuple, the return value is the same object."; + static PySequenceMethods tuple_as_sequence = { (inquiry)tuplelength, /* sq_length */ *************** *** 510,521 **** 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ ! 0, /* tp_doc */ (traverseproc)tupletraverse, /* tp_traverse */ 0, /* tp_clear */ tuplerichcompare, /* tp_richcompare */ }; --- 532,557 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ ! tuple_doc, /* tp_doc */ (traverseproc)tupletraverse, /* tp_traverse */ 0, /* tp_clear */ tuplerichcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + tuple_new, /* tp_new */ }; Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.18 retrieving revision 2.19 diff -C2 -d -r2.18 -r2.19 *** typeobject.c 2001/06/10 21:43:28 2.18 --- typeobject.c 2001/08/02 04:15:00 2.19 *************** *** 3,27 **** #include "Python.h" ! /* Type object implementation */ static PyObject * ! type_getattr(PyTypeObject *t, char *name) { ! if (strcmp(name, "__name__") == 0) ! return PyString_FromString(t->tp_name); [...2378 lines suppressed...] + TPSLOT("__cmp__", tp_compare); + TPSLOT("__repr__", tp_repr); + TPSLOT("__hash__", tp_hash); + TPSLOT("__call__", tp_call); + TPSLOT("__str__", tp_str); + TPSLOT("__getattr__", tp_getattro); + TPSLOT("__setattr__", tp_setattro); + TPSLOT("__lt__", tp_richcompare); + TPSLOT("__le__", tp_richcompare); + TPSLOT("__eq__", tp_richcompare); + TPSLOT("__ne__", tp_richcompare); + TPSLOT("__gt__", tp_richcompare); + TPSLOT("__ge__", tp_richcompare); + TPSLOT("__iter__", tp_iter); + TPSLOT("next", tp_iternext); + TPSLOT("__get__", tp_descr_get); + TPSLOT("__set__", tp_descr_set); + TPSLOT("__init__", tp_init); + TPSLOT("__new__", tp_new); + } Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.105 retrieving revision 2.106 diff -C2 -d -r2.105 -r2.106 *** unicodeobject.c 2001/07/30 22:34:24 2.105 --- unicodeobject.c 2001/08/02 04:15:00 2.106 *************** *** 4668,4677 **** }; - static PyObject * - unicode_getattr(PyUnicodeObject *self, char *name) - { - return Py_FindMethod(unicode_methods, (PyObject*) self, name); - } - static PySequenceMethods unicode_as_sequence = { (inquiry) unicode_length, /* sq_length */ --- 4668,4671 ---- *************** *** 5347,5350 **** --- 5341,5368 ---- }; + static PyObject * + unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *x = NULL; + static char *kwlist[] = {"string", "encoding", "errors", 0}; + char *encoding = NULL; + char *errors = NULL; + + assert(type == &PyUnicode_Type); + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:unicode", + kwlist, &x, &encoding, &errors)) + return NULL; + if (x == NULL) + return (PyObject *)_PyUnicode_New(0); + return PyUnicode_FromEncodedObject(x, encoding, errors); + } + + static char unicode_doc[] = + "unicode(string [, encoding[, errors]]) -> object\n\ + \n\ + Create a new Unicode object from the given encoded string.\n\ + encoding defaults to the current default string encoding and \n\ + errors, defining the error handling, to 'strict'."; + PyTypeObject PyUnicode_Type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 5356,5360 **** (destructor)_PyUnicode_Free, /* tp_dealloc */ 0, /* tp_print */ ! (getattrfunc)unicode_getattr, /* tp_getattr */ 0, /* tp_setattr */ (cmpfunc) unicode_compare, /* tp_compare */ --- 5374,5378 ---- (destructor)_PyUnicode_Free, /* tp_dealloc */ 0, /* tp_print */ ! 0, /* tp_getattr */ 0, /* tp_setattr */ (cmpfunc) unicode_compare, /* tp_compare */ *************** *** 5366,5373 **** 0, /* tp_call*/ (reprfunc) unicode_str, /* tp_str */ ! (getattrofunc) NULL, /* tp_getattro */ ! (setattrofunc) NULL, /* tp_setattro */ &unicode_as_buffer, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ }; --- 5384,5409 ---- 0, /* tp_call*/ (reprfunc) unicode_str, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! 0, /* tp_setattro */ &unicode_as_buffer, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ + unicode_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + unicode_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + unicode_new, /* tp_new */ }; From tim_one@users.sourceforge.net Thu Aug 2 05:45:23 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 01 Aug 2001 21:45:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects classobject.c,2.133,2.134 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13818/python/dist/src/Objects Modified Files: classobject.c Log Message: Fix the test_weakref.py failure. Introduced by resolving "a conflict" (which didn't actually exist!) incorrectly. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.133 retrieving revision 2.134 diff -C2 -d -r2.133 -r2.134 *** classobject.c 2001/08/02 04:15:00 2.133 --- classobject.c 2001/08/02 04:45:20 2.134 *************** *** 194,204 **** return NULL; } - Py_INCREF(v); - if (PyFunction_Check(v)) { - PyObject *w = PyMethod_New(v, (PyObject *)NULL, - (PyObject *)class); - Py_DECREF(v); - v = w; - } f = v->ob_type->tp_descr_get; if (f == NULL) --- 194,197 ---- From loewis@users.sourceforge.net Thu Aug 2 07:20:22 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 01 Aug 2001 23:20:22 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv352 Modified Files: Makefile.pre.in Log Message: Take MANDIR and INCLUDEDIR from configure. Fixes bug #446671. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Makefile.pre.in 2001/08/02 04:15:00 1.47 --- Makefile.pre.in 2001/08/02 06:20:20 1.48 *************** *** 81,86 **** BINDIR= $(exec_prefix)/bin LIBDIR= $(exec_prefix)/lib ! MANDIR= $(prefix)/man ! INCLUDEDIR= $(prefix)/include CONFINCLUDEDIR= $(exec_prefix)/include SCRIPTDIR= $(prefix)/lib --- 81,86 ---- BINDIR= $(exec_prefix)/bin LIBDIR= $(exec_prefix)/lib ! MANDIR= @mandir@ ! INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include SCRIPTDIR= $(prefix)/lib From loewis@users.sourceforge.net Thu Aug 2 08:15:31 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 02 Aug 2001 00:15:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib ConfigParser.py,1.33,1.34 Cookie.py,1.10,1.11 codecs.py,1.20,1.21 multifile.py,1.17,1.18 pipes.py,1.10,1.11 pyclbr.py,1.19,1.20 sgmllib.py,1.36,1.37 urllib2.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10971 Modified Files: ConfigParser.py Cookie.py codecs.py multifile.py pipes.py pyclbr.py sgmllib.py urllib2.py Log Message: Patch #444359: Remove unused imports. Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** ConfigParser.py 2001/07/06 17:22:48 1.33 --- ConfigParser.py 2001/08/02 07:15:29 1.34 *************** *** 86,90 **** """ - import sys import string import re --- 86,89 ---- Index: Cookie.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/Cookie.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Cookie.py 2001/07/20 18:54:44 1.10 --- Cookie.py 2001/08/02 07:15:29 1.11 *************** *** 216,220 **** # Import our required modules # ! import string, sys from UserDict import UserDict --- 216,220 ---- # Import our required modules # ! import string from UserDict import UserDict Index: codecs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/codecs.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** codecs.py 2001/07/31 08:54:55 1.20 --- codecs.py 2001/08/02 07:15:29 1.21 *************** *** 8,12 **** """#" ! import struct, types, __builtin__ ### Registry and builtin stateless codec functions --- 8,12 ---- """#" ! import struct, __builtin__ ### Registry and builtin stateless codec functions Index: multifile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/multifile.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** multifile.py 2001/03/12 02:56:15 1.17 --- multifile.py 2001/08/02 07:15:29 1.18 *************** *** 28,33 **** """ - import sys - __all__ = ["MultiFile","Error"] --- 28,31 ---- Index: pipes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pipes.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pipes.py 2001/07/20 18:53:34 1.10 --- pipes.py 2001/08/02 07:15:29 1.11 *************** *** 60,64 **** - import sys import re --- 60,63 ---- Index: pyclbr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pyclbr.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pyclbr.py 2001/02/12 02:00:42 1.19 --- pyclbr.py 2001/08/02 07:15:29 1.20 *************** *** 54,58 **** """ - import os import sys import imp --- 54,57 ---- Index: sgmllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sgmllib.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** sgmllib.py 2001/07/19 20:57:23 1.36 --- sgmllib.py 2001/08/02 07:15:29 1.37 *************** *** 11,15 **** import re - import string __all__ = ["SGMLParser"] --- 11,14 ---- Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** urllib2.py 2001/07/04 05:18:29 1.15 --- urllib2.py 2001/08/02 07:15:29 1.16 *************** *** 89,93 **** import socket - import UserDict import httplib import re --- 89,92 ---- From gvanrossum@users.sourceforge.net Thu Aug 2 15:14:23 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 02 Aug 2001 07:14:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_pkgimport.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv16296 Added Files: test_pkgimport.py Log Message: Unit test for improved package import semantics. Original by Alex Coventry (in SF patch #441791), adapted to the standard regression test framework. --- NEW FILE: test_pkgimport.py --- import os, sys, string, random, tempfile, unittest from test_support import run_unittest class TestImport(unittest.TestCase): def __init__(self, *args, **kw): self.package_name = 'PACKAGE_' while sys.modules.has_key(self.package_name): self.package_name += random.choose(string.letters) self.module_name = self.package_name + '.foo' unittest.TestCase.__init__(self, *args, **kw) def remove_modules(self): for module_name in (self.package_name, self.module_name): if sys.modules.has_key(module_name): del sys.modules[module_name] def setUp(self): self.test_dir = tempfile.mktemp() os.mkdir(self.test_dir) sys.path.append(self.test_dir) self.package_dir = os.path.join(self.test_dir, self.package_name) os.mkdir(self.package_dir) open(os.path.join(self.package_dir, '__init__.py'), 'w') self.module_path = os.path.join(self.package_dir, 'foo.py') def tearDown(self): for file in os.listdir(self.package_dir): os.remove(os.path.join(self.package_dir, file)) os.rmdir(self.package_dir) os.rmdir(self.test_dir) self.assertNotEqual(sys.path.count(self.test_dir), 0) sys.path.remove(self.test_dir) self.remove_modules() def rewrite_file(self, contents): compiled_path = self.module_path + 'c' if os.path.exists(compiled_path): os.remove(compiled_path) open(self.module_path, 'w').write(contents) def test_package_import__semantics(self): # Generate a couple of broken modules to try importing. # ...try loading the module when there's a SyntaxError self.rewrite_file('for') try: __import__(self.module_name) except SyntaxError: pass else: raise RuntimeError, 'Failed to induce SyntaxError' self.assert_(not sys.modules.has_key(self.module_name) and not hasattr(sys.modules[self.package_name], 'foo')) # ...make up a variable name that isn't bound in __builtins__ var = 'a' while var in dir(__builtins__): var += random.choose(string.letters) # ...make a module that just contains that self.rewrite_file(var) try: __import__(self.module_name) except NameError: pass else: raise RuntimeError, 'Failed to induce NameError.' module = __import__(self.module_name).foo # ...now change the module so that the NameError doesn't # happen self.rewrite_file('%s = 1' % var) reload(module) self.assertEqual(getattr(module, var), 1) run_unittest(TestImport) From fdrake@users.sourceforge.net Thu Aug 2 16:12:09 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 08:12:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/dist sysconfig.tex,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory usw-pr-cvs1:/tmp/cvs-serv30282 Added Files: sysconfig.tex Log Message: Documentation for the distutils.sysconfig module. --- NEW FILE: sysconfig.tex --- \section{\module{distutils.sysconfig} --- System configuration information} \declaremodule{standard}{distutils.sysconfig} \modulesynopsis{Low-level access to configuration information of the Python interpreter.} \moduleauthor{Fred L. Drake, Jr.}{fdrake@acm.org} \moduleauthor{Greg Ward}{gward@python.net} \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org} The \module{distutils.sysconfig} module provides access to Python's low-level configuration information. The specific configuration variables available depend heavily on the platform and configuration. The specific variables depend on the build process for the specific version of Python being run; the variables are those found in the \file{Makefile} and configuration header that are installed with Python on \UNIX{} systems. The configuration header is called \file{pyconfig.h} for Python versions starting with 2.2, and \file{config.h} for earlier versions of Python. Some additional functions are provided which perform some useful manipulations for other parts of the \module{distutils} package. \begin{datadesc}{PREFIX} The result of \code{os.path.normpath(sys.prefex)}. \end{datadesc} \begin{datadesc}{EXEC_PREFIX} The result of \code{os.path.normpath(sys.exec_prefex)}. \end{datadesc} \begin{funcdesc}{get_config_var}{name} Return the value of a single variable. This is equivalent to \code{get_config_vars().get(\var{name})}. \end{funcdesc} \begin{funcdesc}{get_config_vars}{\moreargs} Return a set of variable definitions. If there are no arguments, this returns a dictionary mapping names of configuration variables to values. If arguments are provided, they should be strings, and the return value will be a sequence giving the associated values. If a given name does not have a corresponding value, \code{None} will be included for that variable. \end{funcdesc} \begin{funcdesc}{get_config_h_filename}{} Return the full path name of the configuration header. For \UNIX, this will be the header generated by the \program{configure} script; for other platforms the header will have been supplied directly by the Python source distribution. The file is a platform-specific text file. \end{funcdesc} \begin{funcdesc}{get_makefile_filename}{} Return the full path name of the \file{Makefile} used to build Python. For \UNIX, this will be a file generated by the \program{configure} script; the meaning for other platforms will vary. The file is a platform-specific text file, if it exists. This function is only useful on \POSIX{} platforms. \end{funcdesc} \begin{funcdesc}{get_python_inc}{\optional{plat_specific\optional{, prefix}}} Return the directory for either the general or platform-dependent C include files. If \var{plat_specific} is true, the platform-dependent include directory is returned; if false or omitted, the platform-independent directory is returned. If \var{prefix} is given, it is used as either the prefix instead of \constant{PREFIX}, or as the exec-prefix instead of \constant{EXEC_PREFIX} if \var{plat_specific} is true. \end{funcdesc} \begin{funcdesc}{get_python_lib}{\optional{plat_specific\optional{, standard_lib\optional{, prefix}}}} Return the directory for either the general or platform-dependent library installation. If \var{plat_specific} is true, the platform-dependent include directory is returned; if false or omitted, the platform-independent directory is returned. If \var{prefix} is given, it is used as either the prefix instead of \constant{PREFIX}, or as the exec-prefix instead of \constant{EXEC_PREFIX} if \var{plat_specific} is true. If \var{standard_lib} is true, the directory for the standard library is returned rather than the directory for the installation of third-party extensions. \end{funcdesc} The following function is only intended for use within the \module{distutils} package. \begin{funcdesc}{customize_compiler}{compiler} Do any platform-specific customization of a \class{distutils.ccompiler.CCompiler} instance. This function is only needed on \UNIX{} at this time, but should be called consistently to support forward-compatibility. It inserts the information that varies across \UNIX{} flavors and is stored in Python's \file{Makefile}. This information includes the selected compiler, compiler and linker options, and the extension used by the linker for shared objects. \end{funcdesc} This function is even more special-purpose, and should only be used from Python's own build procedures. \begin{funcdesc}{set_python_build}{} Inform the \module{distutils.sysconfig} module that it is being used as part of the build process for Python. This changes a lot of relative locations for files, allowing them to be located in the build area rather than in an installed Python. \end{funcdesc} From fdrake@users.sourceforge.net Thu Aug 2 16:13:17 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 08:13:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/dist dist.tex,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory usw-pr-cvs1:/tmp/cvs-serv30597 Modified Files: dist.tex Log Message: Update some incorrect comments about the bdist commands that exist. Add an entry for the distutils.sysconfig module docs. Index: dist.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** dist.tex 2001/07/14 02:07:46 1.34 --- dist.tex 2001/08/02 15:13:15 1.35 *************** *** 1398,1408 **** ! %\subsubsection{\protect\command{blib}} ! %\subsubsection{\protect\command{blib\_dumb}} ! %\subsubsection{\protect\command{blib\_rpm}} ! %\subsubsection{\protect\command{blib\_wise}} --- 1398,1411 ---- ! %\subsubsection{\protect\command{bdist}} ! %\subsubsection{\protect\command{bdist\_dumb}} ! %\subsubsection{\protect\command{bdist\_rpm}} ! %\subsubsection{\protect\command{bdist\_wininst}} ! ! ! \input{sysconfig} From fdrake@users.sourceforge.net Thu Aug 2 16:14:00 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 08:14:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc Makefile.deps,1.70,1.71 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv30772 Modified Files: Makefile.deps Log Message: Add anentry for the distutils.sysconfig module docs. Index: Makefile.deps =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile.deps,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Makefile.deps 2001/07/24 16:20:13 1.70 --- Makefile.deps 2001/08/02 15:13:58 1.71 *************** *** 290,292 **** INSTFILES = $(HOWTOSTYLES) inst/inst.tex ! DISTFILES = $(HOWTOSTYLES) dist/dist.tex --- 290,294 ---- INSTFILES = $(HOWTOSTYLES) inst/inst.tex ! DISTFILES = $(HOWTOSTYLES) \ ! dist/dist.tex \ ! dist/sysconfig.tex From gvanrossum@users.sourceforge.net Thu Aug 2 16:32:00 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 02 Aug 2001 08:32:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.19,2.20 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3131 Modified Files: typeobject.c Log Message: Fix SF #442791 (revisited): No __delitem__ wrapper was defined. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.19 retrieving revision 2.20 diff -C2 -d -r2.19 -r2.20 *** typeobject.c 2001/08/02 04:15:00 2.19 --- typeobject.c 2001/08/02 15:31:58 2.20 *************** *** 1505,1511 **** --- 1505,1528 ---- } + static PyObject * + wrap_delitem_int(PyObject *self, PyObject *args, void *wrapped) + { + intobjargproc func = (intobjargproc)wrapped; + int i, res; + + if (!PyArg_ParseTuple(args, "i", &i)) + return NULL; + res = (*func)(self, i, NULL); + if (res == -1 && PyErr_Occurred()) + return NULL; + Py_INCREF(Py_None); + return Py_None; + } + static struct wrapperbase tab_setitem_int[] = { {"__setitem__", (wrapperfunc)wrap_intobjargproc, "x.__setitem__(i, y) <==> x[i]=y"}, + {"__delitem__", (wrapperfunc)wrap_delitem_int, + "x.__delitem__(y) <==> del x[y]"}, {0} }; *************** *** 1571,1577 **** --- 1588,1612 ---- } + static PyObject * + wrap_delitem(PyObject *self, PyObject *args, void *wrapped) + { + objobjargproc func = (objobjargproc)wrapped; + int res; + PyObject *key; + + if (!PyArg_ParseTuple(args, "O", &key)) + return NULL; + res = (*func)(self, key, NULL); + if (res == -1 && PyErr_Occurred()) + return NULL; + Py_INCREF(Py_None); + return Py_None; + } + static struct wrapperbase tab_setitem[] = { {"__setitem__", (wrapperfunc)wrap_objobjargproc, "x.__setitem__(y, z) <==> x[y]=z"}, + {"__delitem__", (wrapperfunc)wrap_delitem, + "x.__delitem__(y) <==> del x[y]"}, {0} }; From fdrake@users.sourceforge.net Thu Aug 2 16:53:07 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 08:53:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref3.tex,1.69,1.70 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv9145/ref Modified Files: ref3.tex Log Message: Explain that __init__() methods do not get to return values. Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** ref3.tex 2001/07/14 02:12:27 1.69 --- ref3.tex 2001/08/02 15:53:05 1.70 *************** *** 893,904 **** \subsection{Basic customization\label{customization}} ! \begin{methoddesc}[object]{__init__}{self\optional{, args...}} ! Called when the instance is created. The arguments are those passed ! to the class constructor expression. If a base class has an ! \method{__init__()} method the derived class's \method{__init__()} method must ! explicitly call it to ensure proper initialization of the base class ! part of the instance, e.g., \samp{BaseClass.__init__(\var{self}, ! [\var{args}...])}. ! \indexii{class}{constructor} \end{methoddesc} --- 893,905 ---- \subsection{Basic customization\label{customization}} ! \begin{methoddesc}[object]{__init__}{self\optional{, \moreargs}} ! Called\indexii{class}{constructor} when the instance is created. The ! arguments are those passed to the class constructor expression. If a ! base class has an \method{__init__()} method the derived class's ! \method{__init__()} method must explicitly call it to ensure proper ! initialization of the base class part of the instance; for example: ! \samp{BaseClass.__init__(\var{self}, [\var{args}...])}. As a special ! contraint on constructors, no value may be returned; doing so will ! cause a \exception{TypeError} to be raised at runtime. \end{methoddesc} From tim_one@users.sourceforge.net Thu Aug 2 18:23:13 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 02 Aug 2001 10:23:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_pkgimport.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv7568/python/dist/src/Lib/test Modified Files: test_pkgimport.py Log Message: This test failed under python -O. rewrite_file(): Delete both .pyc and .pyo leftovers, and explicitly close the new source file after writing to it. Index: test_pkgimport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pkgimport.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_pkgimport.py 2001/08/02 14:14:20 1.1 --- test_pkgimport.py 2001/08/02 17:23:11 1.2 *************** *** 37,43 **** def rewrite_file(self, contents): ! compiled_path = self.module_path + 'c' ! if os.path.exists(compiled_path): os.remove(compiled_path) ! open(self.module_path, 'w').write(contents) def test_package_import__semantics(self): --- 37,47 ---- def rewrite_file(self, contents): ! for extension in "co": ! compiled_path = self.module_path + extension ! if os.path.exists(compiled_path): ! os.remove(compiled_path) ! f = open(self.module_path, 'w') ! f.write(contents) ! f.close() def test_package_import__semantics(self): From fdrake@users.sourceforge.net Thu Aug 2 19:00:31 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 11:00:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.134,1.135 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv28489/api Modified Files: api.tex Log Message: Move away from apply() to using extended call syntax for some example fragments when discussing equivalence of thhe C API to what a Python programmer sees. Added descriptions of PyEval_SetProfile() and PyEval_SetTrace(). Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** api.tex 2001/07/20 20:56:11 1.134 --- api.tex 2001/08/02 18:00:28 1.135 *************** *** 1626,1630 **** needed, then \var{args} may be \NULL{}. Returns the result of the call on success, or \NULL{} on failure. This is the equivalent ! of the Python expression \samp{apply(\var{callable_object}, \var{args})}. \bifuncindex{apply} \end{cfuncdesc} --- 1626,1631 ---- needed, then \var{args} may be \NULL{}. Returns the result of the call on success, or \NULL{} on failure. This is the equivalent ! of the Python expression \samp{apply(\var{callable_object}, ! \var{args})} or \samp{\var{callable_object}(*\var{args})}. \bifuncindex{apply} \end{cfuncdesc} *************** *** 1637,1642 **** be \NULL{}, indicating that no arguments are provided. Returns the result of the call on success, or \NULL{} on failure. This is ! the equivalent of the Python expression \samp{apply(\var{callable_object}, ! \var{args})}.\bifuncindex{apply} \end{cfuncdesc} --- 1638,1645 ---- be \NULL{}, indicating that no arguments are provided. Returns the result of the call on success, or \NULL{} on failure. This is ! the equivalent of the Python expression ! \samp{apply(\var{callable_object}\var{args})} or ! \samp{\var{callable_object}(*\var{args})}. ! \bifuncindex{apply} \end{cfuncdesc} *************** *** 4783,4789 **** --- 4786,4801 ---- \begin{cfuncdesc}{void}{PyEval_SetProfile}{Py_tracefunc func, PyObject *obj} + Set the profiler function to \var{func}. The \var{obj} parameter is + passed to the function as its first parameter, and may be any Python + object, or \NULL. If the profile function needs to maintain state, + using a different value for \var{obj} for each thread provides a + convenient and thread-safe place to store it. The profile function + is called for all monitored events except the line-number events. \end{cfuncdesc} \begin{cfuncdesc}{void}{PyEval_SetTrace}{Py_tracefunc func, PyObject *obj} + Set the the tracing function to \var{func}. This is similar to + \cfunction{PyEval_SetProfile()}, except the tracing function does + receive line-number events. \end{cfuncdesc} *************** *** 5278,5281 **** --- 5290,5297 ---- (PyObject *self, int segment, const char **ptrptr)} \end{ctypedesc} + + + \section{Supporting the Iterator Protocol + \label{supporting-iteration}} From fdrake@users.sourceforge.net Thu Aug 2 21:03:14 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 13:03:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils sysconfig.py,1.39,1.40 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv11236 Modified Files: sysconfig.py Log Message: Miscellaneous minor cleanups. Index: sysconfig.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/sysconfig.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** sysconfig.py 2001/07/26 18:06:58 1.39 --- sysconfig.py 2001/08/02 20:03:12 1.40 *************** *** 30,41 **** def set_python_build(): ! """Set the python_build flag to true; this means that we're ! building Python itself. Only called from the setup.py script ! shipped with Python. """ - global python_build python_build = 1 def get_python_inc(plat_specific=0, prefix=None): """Return the directory containing installed Python header files. --- 30,42 ---- def set_python_build(): ! """Set the python_build flag to true. ! ! This means that we're building Python itself. Only called from ! the setup.py script shipped with Python. """ global python_build python_build = 1 + def get_python_inc(plat_specific=0, prefix=None): """Return the directory containing installed Python header files. *************** *** 56,60 **** return os.path.join(prefix, "include", "python" + sys.version[:3]) elif os.name == "nt": ! return os.path.join(prefix, "Include") # include or Include? elif os.name == "mac": return os.path.join(prefix, "Include") --- 57,61 ---- return os.path.join(prefix, "include", "python" + sys.version[:3]) elif os.name == "nt": ! return os.path.join(prefix, "include") elif os.name == "mac": return os.path.join(prefix, "Include") *************** *** 81,85 **** if prefix is None: prefix = plat_specific and EXEC_PREFIX or PREFIX ! if os.name == "posix": libpython = os.path.join(prefix, --- 82,86 ---- if prefix is None: prefix = plat_specific and EXEC_PREFIX or PREFIX ! if os.name == "posix": libpython = os.path.join(prefix, *************** *** 92,96 **** elif os.name == "nt": if standard_lib: ! return os.path.join(PREFIX, "Lib") else: return prefix --- 93,97 ---- elif os.name == "nt": if standard_lib: ! return os.path.join(prefix, "Lib") else: return prefix *************** *** 99,103 **** if plat_specific: if standard_lib: ! return os.path.join(EXEC_PREFIX, "Mac", "Plugins") else: raise DistutilsPlatformError( --- 100,104 ---- if plat_specific: if standard_lib: ! return os.path.join(prefix, "Mac", "Plugins") else: raise DistutilsPlatformError( *************** *** 105,109 **** else: if standard_lib: ! return os.path.join(PREFIX, "Lib") else: raise DistutilsPlatformError( --- 106,110 ---- else: if standard_lib: ! return os.path.join(prefix, "Lib") else: raise DistutilsPlatformError( *************** *** 114,124 **** "on platform '%s'" % os.name) - # get_python_lib() - def customize_compiler(compiler): ! """Do any platform-specific customization of the CCompiler instance ! 'compiler'. Mainly needed on Unix, so we can plug in the information ! that varies across Unices and is stored in Python's Makefile. """ if compiler.compiler_type == "unix": --- 115,124 ---- "on platform '%s'" % os.name) def customize_compiler(compiler): ! """Do any platform-specific customization of a CCompiler instance. ! ! Mainly needed on Unix, so we can plug in the information that ! varies across Unices and is stored in Python's Makefile. """ if compiler.compiler_type == "unix": *************** *** 139,144 **** def get_config_h_filename(): """Return full pathname of installed pyconfig.h file.""" ! if python_build: inc_dir = '.' ! else: inc_dir = get_python_inc(plat_specific=1) if sys.version < '2.2': config_h = 'config.h' --- 139,146 ---- def get_config_h_filename(): """Return full pathname of installed pyconfig.h file.""" ! if python_build: ! inc_dir = os.curdir ! else: ! inc_dir = get_python_inc(plat_specific=1) if sys.version < '2.2': config_h = 'config.h' *************** *** 198,202 **** optional dictionary is passed in as the second argument, it is used instead of a new dictionary. - """ from distutils.text_file import TextFile --- 200,203 ---- *************** *** 310,315 **** raise DistutilsPlatformError(my_msg) ! ! # On AIX, there are wrong paths to the linker scripts in the Makefile # -- these paths are relative to the Python source, but when installed --- 311,316 ---- raise DistutilsPlatformError(my_msg) ! ! # On AIX, there are wrong paths to the linker scripts in the Makefile # -- these paths are relative to the Python source, but when installed *************** *** 398,402 **** """Return the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to ! get_config_vars().get(name) """ return get_config_vars().get(name) --- 399,403 ---- """Return the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to ! get_config_vars().get(name) """ return get_config_vars().get(name) From fdrake@users.sourceforge.net Thu Aug 2 21:52:02 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 13:52:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.65,1.66 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv6672/lib Modified Files: libre.tex Log Message: Add a caveat about boundary conditions and RE concatenation, so that the documents do not make an overly-strong assertion about the properties of RE concatenation. Add an example of RE{m,} syntax and what it will and will not match. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** libre.tex 2001/08/01 16:56:51 1.65 --- libre.tex 2001/08/02 20:52:00 1.66 *************** *** 62,72 **** Regular expressions can be concatenated to form new regular expressions; if \emph{A} and \emph{B} are both regular expressions, ! then \emph{AB} is also an regular expression. If a string \emph{p} matches A and another string \emph{q} matches B, the string \emph{pq} ! will match AB. Thus, complex expressions can easily be constructed ! from simpler primitive expressions like the ones described here. For ! details of the theory and implementation of regular expressions, ! consult the Friedl book referenced below, or almost any textbook about ! compiler construction. A brief explanation of the format of regular expressions follows. For --- 62,73 ---- Regular expressions can be concatenated to form new regular expressions; if \emph{A} and \emph{B} are both regular expressions, ! then \emph{AB} is also a regular expression. If a string \emph{p} matches A and another string \emph{q} matches B, the string \emph{pq} ! will match AB if \emph{A} and \emph{B} do no specify boundary ! conditions that are no longer satisfied by \emph{pq}. Thus, complex ! expressions can easily be constructed from simpler primitive ! expressions like the ones described here. For details of the theory ! and implementation of regular expressions, consult the Friedl book ! referenced below, or almost any textbook about compiler construction. A brief explanation of the format of regular expressions follows. For *************** *** 139,145 **** match as many repetitions as possible. For example, \regexp{a\{3,5\}} will match from 3 to 5 \character{a} characters. Omitting \var{n} ! specifies an infinite upper bound; you can't omit \var{m}. The comma ! may not be omitted or the modifier would be confused with the ! previously described form. \item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to --- 140,148 ---- match as many repetitions as possible. For example, \regexp{a\{3,5\}} will match from 3 to 5 \character{a} characters. Omitting \var{n} ! specifies an infinite upper bound; you can't omit \var{m}. As an ! example, \regexp{a\{4,\}b} will match \code{aaaab}, a thousand ! \character{a} characters followed by a \code{b}, but not \code{aaab}. ! The comma may not be omitted or the modifier would be confused with ! the previously described form. \item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to From fdrake@users.sourceforge.net Thu Aug 2 22:34:55 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 14:34:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref3.tex,1.70,1.71 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv27858/ref Modified Files: ref3.tex Log Message: User-defined methods *can* contain things other than user-defined functions as the callable, so use more flexible language. Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** ref3.tex 2001/08/02 15:53:05 1.70 --- ref3.tex 2001/08/02 21:34:53 1.71 *************** *** 447,451 **** \item[User-defined methods] A user-defined method object combines a class, a class instance (or ! \code{None}) and a user-defined function. \obindex{method} \obindex{user-defined method} --- 447,452 ---- \item[User-defined methods] A user-defined method object combines a class, a class instance (or ! \code{None}) and any callable object (normally a user-defined ! function). \obindex{method} \obindex{user-defined method} From tim_one@users.sourceforge.net Thu Aug 2 23:06:37 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 02 Aug 2001 15:06:37 -0700 Subject: [Python-checkins] CVS: python/dist/src PLAN.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv8302/python/dist/src Modified Files: PLAN.txt Log Message: Finish my log of the final merge process. Mark the merge task complete. Index: PLAN.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PLAN.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PLAN.txt 2001/08/02 04:15:00 1.2 --- PLAN.txt 2001/08/02 22:06:35 1.3 *************** *** 185,189 **** ! Project: integration with main branch ************************************* --- 185,189 ---- ! Project: integration with main branch *** This is done - tim *** ************************************* *************** *** 218,222 **** way into the branch Unix and Windows builds (pythoncore.dsp and PC/config.c); also imported by test_descr.py. How about renaming to ! xxsubtype.c (whatever) now? --- 218,222 ---- way into the branch Unix and Windows builds (pythoncore.dsp and PC/config.c); also imported by test_descr.py. How about renaming to ! xxsubtype.c (whatever) now? *** this is done - tim *** *************** *** 281,285 **** Rebuilt from scratch; ran all tests; checked into branch about 22:40. ! Merged descr-branch back into trunk: cvs -q -z3 up -j descr-branch python --- 281,287 ---- Rebuilt from scratch; ran all tests; checked into branch about 22:40. ! Merged descr-branch back into trunk (SEE BELOW -- this specific way of ! doing it was a bad idea): ! cvs -q -z3 up -j descr-branch python *************** *** 288,295 **** conflicts in dictobject.c, sometimes enclosing identical(!) blobs of source code. And CVS remains utterly baffled by Python type object decls. ! Every line of ceval.c's generator code si in conflict blocks ... OK, there's no pattern or sense here, I'll just deal with it. ! Conflicts resolved; rebuilt from scratch; test_weakref fails. ---------------------------------------------------------------------------- 2001-07-30 --- 290,313 ---- conflicts in dictobject.c, sometimes enclosing identical(!) blobs of source code. And CVS remains utterly baffled by Python type object decls. ! Every line of ceval.c's generator code is in conflict blocks ... OK, there's no pattern or sense here, I'll just deal with it. ! Conflicts resolved; rebuilt from scratch; test_weakref fails. Didn't find ! an obvious reason and it was late, so committed it anyway. Tagged the ! trunk then with tag: ! ! after-descr-branch-merge ! ! Tracked the test_weakref failure to a botched conflict resolution in ! classobject.c; checked in a fix. ! ! LATER: The merge should have been done via: ! ! upd -j date2001-08-01 -j descr-branch python ! ! instead. This would have caused only one conflict, a baffler in ! bltinmodule.c. It would have avoided the classobject.c error I made. ! Luckily, except for that one, we got to the same place in the end anyway, ! apart from a few curious tabs-vs-spaces differences. ---------------------------------------------------------------------------- 2001-07-30 From jackjansen@users.sourceforge.net Thu Aug 2 23:25:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 02 Aug 2001 15:25:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib FrameWork.py,1.43,1.43.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv15699/Python/Mac/Lib Modified Files: Tag: release21-maint FrameWork.py Log Message: When closing a DialogWindow also clear out self.dlg. Index: FrameWork.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/FrameWork.py,v retrieving revision 1.43 retrieving revision 1.43.4.1 diff -C2 -d -r1.43 -r1.43.4.1 *** FrameWork.py 2001/03/15 14:39:03 1.43 --- FrameWork.py 2001/08/02 22:25:31 1.43.4.1 *************** *** 1011,1014 **** --- 1011,1018 ---- self.do_postclose() + def do_postclose(self): + self.dlg = None + Window.do_postclose(self) + def do_itemhit(self, item, event): print 'Dialog %s, item %d hit'%(self.dlg, item) From jackjansen@users.sourceforge.net Thu Aug 2 23:26:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 02 Aug 2001 15:26:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions/(vise) Python 2.1.vct,1.12.4.2,1.12.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory usw-pr-cvs1:/tmp/cvs-serv15911/Python/Mac/Distributions/(vise) Modified Files: Tag: release21-maint Python 2.1.vct Log Message: Files used for 2.1.1 distribution. Index: Python 2.1.vct =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/(vise)/Python 2.1.vct,v retrieving revision 1.12.4.2 retrieving revision 1.12.4.3 diff -C2 -d -r1.12.4.2 -r1.12.4.3 Binary files /tmp/cvsUNZIrg and /tmp/cvsnsimNi differ From jackjansen@users.sourceforge.net Thu Aug 2 23:26:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 02 Aug 2001 15:26:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include macbuildno.h,1.16.4.2,1.16.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv16219/Python/Mac/Include Modified Files: Tag: release21-maint macbuildno.h Log Message: Files used for 2.1.1 distribution. Index: macbuildno.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/macbuildno.h,v retrieving revision 1.16.4.2 retrieving revision 1.16.4.3 diff -C2 -d -r1.16.4.2 -r1.16.4.3 *** macbuildno.h 2001/07/26 21:12:41 1.16.4.2 --- macbuildno.h 2001/08/02 22:26:45 1.16.4.3 *************** *** 1 **** ! #define BUILD 96 --- 1 ---- ! #define BUILD 97 From jackjansen@users.sourceforge.net Thu Aug 2 23:26:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 02 Aug 2001 15:26:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac Relnotes,1.23.4.2,1.23.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv16253/Python/Mac Modified Files: Tag: release21-maint Relnotes Log Message: Files used for 2.1.1 distribution. Index: Relnotes =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Relnotes,v retrieving revision 1.23.4.2 retrieving revision 1.23.4.3 diff -C2 -d -r1.23.4.2 -r1.23.4.3 *** Relnotes 2001/07/26 21:12:45 1.23.4.2 --- Relnotes 2001/08/02 22:26:49 1.23.4.3 *************** *** 24,27 **** --- 24,28 ---- now, which may fix some crashes. - Ctl.SendControlMessage has gone. But it didn't work anyway. + - Various problems with the TextEdit and Waste demos have been fixed. - Embedding/extending only: in preparation to allowing the use of MacPython modules in unix-Python on OSX the xxx_New and xxx_Convert routines are now optionally vectored via *************** *** 64,65 **** --- 65,68 ---- PythonIDE for interactive work and PythonInterpreter for scripts only. This is especially true under OSX. + - AliasMenu 2.2 conflicts with the Carbon version of Python. This is most likely a problem + with AliasMenu (which is from 1999, and thus predates Carbon altogether). From jackjansen@users.sourceforge.net Thu Aug 2 23:26:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 02 Aug 2001 15:26:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac ReadMe,1.30.4.2,1.30.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv16280/Python/Mac Modified Files: Tag: release21-maint ReadMe Log Message: Files used for 2.1.1 distribution. Index: ReadMe =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/ReadMe,v retrieving revision 1.30.4.2 retrieving revision 1.30.4.3 diff -C2 -d -r1.30.4.2 -r1.30.4.3 *** ReadMe 2001/07/26 21:13:53 1.30.4.2 --- ReadMe 2001/08/02 22:26:53 1.30.4.3 *************** *** 27,31 **** Caveats ------- ! Aside from the general new Python 2.1 features compared to 2.0 the main feature of this release is Carbon support. --- 27,31 ---- Caveats ------- ! Aside from the general new Python 2.1.1 features compared to 2.0 the main feature of this release is Carbon support. *************** *** 188,193 **** Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn, ! Tom Bridgman Russel Owen and all the other people who provided feedback, ! code or both! MacPython includes waste, a TextEdit replacement which is (c) 1998 Marco Piovanelli. --- 188,193 ---- Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn, ! Tom Bridgman, Russel Owen, Pascal Oberndoerfer and all the other people ! who provided feedback, code or both! MacPython includes waste, a TextEdit replacement which is (c) 1998 Marco Piovanelli. From fdrake@users.sourceforge.net Fri Aug 3 04:50:30 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 20:50:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libweakref.tex,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv19160/lib Modified Files: libweakref.tex Log Message: Fix some of the example code; the reference objects do not support a get() method; just calling them is sufficient. (There was a get() method for this in an early version of the implementation.) Reported by Mats Wichmann. Index: libweakref.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libweakref.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** libweakref.tex 2001/06/29 16:25:07 1.10 --- libweakref.tex 2001/08/03 03:50:28 1.11 *************** *** 152,161 **** Testing that a weak reference object is still live should be done ! using the expression \code{\var{ref}.get() is not None}. Normally, application code that needs to use a reference object should follow this pattern: \begin{verbatim} ! o = ref.get() if o is None: # referent has been garbage collected --- 152,161 ---- Testing that a weak reference object is still live should be done ! using the expression \code{\var{ref}() is not None}. Normally, application code that needs to use a reference object should follow this pattern: \begin{verbatim} ! o = ref() if o is None: # referent has been garbage collected *************** *** 191,195 **** def id2obj(id): ! return _id2obj_dict.get(id) \end{verbatim} --- 191,195 ---- def id2obj(id): ! return _id2obj_dict(id) \end{verbatim} From fdrake@users.sourceforge.net Fri Aug 3 05:11:29 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 21:11:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib weakref.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv1950 Modified Files: weakref.py Log Message: Make sure that WeakValueDictionary[] raises KeyError instead of TypeError for keys that are not in the dictionary. Index: weakref.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/weakref.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** weakref.py 2001/05/02 05:43:09 1.10 --- weakref.py 2001/08/03 04:11:27 1.11 *************** *** 42,46 **** def __getitem__(self, key): ! o = self.data.get(key)() if o is None: raise KeyError, key --- 42,46 ---- def __getitem__(self, key): ! o = self.data[key]() if o is None: raise KeyError, key From fdrake@users.sourceforge.net Fri Aug 3 05:11:29 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 02 Aug 2001 21:11:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_weakref.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv1950/test Modified Files: test_weakref.py Log Message: Make sure that WeakValueDictionary[] raises KeyError instead of TypeError for keys that are not in the dictionary. Index: test_weakref.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_weakref.py 2001/05/10 17:16:38 1.9 --- test_weakref.py 2001/08/03 04:11:27 1.10 *************** *** 253,256 **** --- 253,261 ---- self.assert_(len(dict) == 0, "deleting the values did not clear the dictionary") + # regression on SF bug #447152: + dict = weakref.WeakValueDictionary() + self.assertRaises(KeyError, dict.__getitem__, 1) + dict[2] = C() + self.assertRaises(KeyError, dict.__getitem__, 2) def test_weak_keys(self): From loewis@users.sourceforge.net Fri Aug 3 11:02:31 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 03 Aug 2001 03:02:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.159,1.160 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv27868 Modified Files: socketmodule.c Log Message: Do not use the system getaddrinfo on Mac OS X. Fixes bug #445928. Since getnameinfo is not implemented, remove __APPLE__ check here. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.159 retrieving revision 1.160 diff -C2 -d -r1.159 -r1.160 *** socketmodule.c 2001/07/31 18:05:33 1.159 --- socketmodule.c 2001/08/03 10:02:29 1.160 *************** *** 219,231 **** #endif /* I know this is a bad practice, but it is the easiest... */ ! /* XXX Temporarily work around bug #445928: ! getaddrinfo on Darwin seems to return an empty result list, with ! no error, even if host lookup ought to work fine. So use the ! emulation code for now. */ ! #if !defined(HAVE_GETADDRINFO) || defined(__APPLE__) #include "getaddrinfo.c" #endif ! #if !defined(HAVE_GETNAMEINFO) || defined(__APPLE__) #include "getnameinfo.c" #endif --- 219,241 ---- #endif + #ifdef __APPLE__ + /* On OS X, getaddrinfo returns no error indication of lookup + failure, so we must use the emulation instead of the libinfo + implementation. Unfortunately, performing an autoconf test + for this bug would require DNS access for the machine performing + the configuration, which is not acceptable. Therefore, we + determine the bug just by checking for __APPLE__. If this bug + gets ever fixed, perhaps checking for sys/version.h would be + appropriate, which is 10/0 on the system with the bug. */ + #undef HAVE_GETADDRINFO + /* avoid clashes with the C library definition of the symbol. */ + #define getaddrinfo fake_getaddrinfo + #endif + /* I know this is a bad practice, but it is the easiest... */ ! #if !defined(HAVE_GETADDRINFO) #include "getaddrinfo.c" #endif ! #if !defined(HAVE_GETNAMEINFO) #include "getnameinfo.c" #endif From tim_one@users.sourceforge.net Fri Aug 3 12:11:37 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 03 Aug 2001 04:11:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.67,1.68 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv6608/python/dist/src/PCbuild Modified Files: python20.wse Log Message: No more Inno Envy: the "Start Installation" dialog now displays a nice summary of the preceding choices. No idea if this is "the right way" to do it, but it's exactly painful enough to make me suspect it's the only way . Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** python20.wse 2001/08/01 18:42:54 1.67 --- python20.wse 2001/08/03 11:11:35 1.68 *************** *** 281,284 **** --- 281,298 ---- item: End Block end + item: Remark + end + item: Remark + Text=Get a temp file, into which we'll write the summary for the "Start Installation" screen. + end + item: Get Temporary Filename + Variable=TEMPFILE + end + item: Set Variable + Variable=TEMPFILE + Value=%TEMP%\%TEMPFILE% + end + item: Remark + end item: Wizard Block Direction Variable=DIRECTION *************** *** 491,496 **** Variable=DOBACKUP Create Flags=01010000000000010000000000001001 ! Text=&Yes (make backups) ! Text=N&o (do not make backups) Text= Text French=&Oui --- 505,510 ---- Variable=DOBACKUP Create Flags=01010000000000010000000000001001 ! Text=&Yes, make backups ! Text=N&o, do not make backups Text= Text French=&Oui *************** *** 973,981 **** end item: Static ! Rectangle=86 42 256 102 Create Flags=01010000000000000000000000000000 ! Text=You are now ready to install %APPTITLE%. ! Text= ! Text=Click the Next button to begin the installation, or the Back button to change choices made previously. Text French=Vous êtes maintenant prêt à installer les fichiers %APPTITLE%. Text French= --- 987,993 ---- end item: Static ! Rectangle=86 34 256 54 Create Flags=01010000000000000000000000000000 ! Text=Click the Next button to install %APPTITLE%, or the Back button to change choices: Text French=Vous êtes maintenant prêt à installer les fichiers %APPTITLE%. Text French= *************** *** 991,998 **** Text Italian=Premere il pulsante Avanti per avviare l'installazione o il pulsante Indietro per reinserire le informazioni di installazione. end end end item: Remark ! Text=This reinitializes the BACKUP directory so that it reflects the change the user made to MAINDIR end item: If/While Statement --- 1003,1030 ---- Text Italian=Premere il pulsante Avanti per avviare l'installazione o il pulsante Indietro per reinserire le informazioni di installazione. end + item: Editbox + Rectangle=86 54 259 175 + Value=%TEMPFILE% + Help Context=16711681 + Enabled Color=00000000000000001111111111111111 + Create Flags=01010000101000000001100010000100 + end end end item: Remark ! end ! item: Remark ! Text=If we just finished "Select Destination Directory": ! end ! item: Remark ! Text= %MAINDIR% is set, so reinitialize %BACKUP% to match. ! end ! item: Remark ! Text=ElseIf we just finished "Select Program Manager Group": ! end ! item: Remark ! Text= "Start Installation" is next, so write out the choices to a file for "Start Installation" to display. ! end ! item: Remark end item: If/While Statement *************** *** 1003,1006 **** --- 1035,1151 ---- Variable=BACKUP Value=%MAINDIR%\BACKUP + end + item: Remark + end + item: ElseIf Statement + Variable=DISPLAY + Value=Select Program Manager Group + end + item: Delete File + Pathname=%TEMPFILE% + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text=Installation directory%CRLF% %MAINDIR% + Line Number=0 + end + item: Remark + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text=%CRLF%Make backups? + Line Number=0 + end + item: If/While Statement + Variable=DOBACKUP + Value=A + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text= Yes, into %BACKUP% + Line Number=0 + end + item: Else Statement + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text= No + Line Number=0 + end + item: End Block + end + item: Remark + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text=%CRLF%Components + Line Number=0 + end + item: If/While Statement + Variable=COMPONENTS + Value=A + Flags=00000010 + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text= Python interpreter, libraries, and Tcl/Tk + Line Number=0 + end + item: End Block + end + item: If/While Statement + Variable=COMPONENTS + Value=B + Flags=00000010 + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text= Python documentation + Line Number=0 + end + item: End Block + end + item: If/While Statement + Variable=COMPONENTS + Value=C + Flags=00000010 + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text= Tool and utility scripts + Line Number=0 + end + item: End Block + end + item: If/While Statement + Variable=COMPONENTS + Value=D + Flags=00000010 + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text= Python test suite + Line Number=0 + end + item: End Block + end + item: If/While Statement + Variable=COMPONENTS + Value=E + Flags=00000010 + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text= Register file extensions + Line Number=0 + end + item: End Block + end + item: Remark + end + item: Insert Line into Text File + Pathname=%TEMPFILE% + New Text=%CRLF%Start Menu group%CRLF% %GROUP% + Line Number=0 end item: End Block From jackjansen@users.sourceforge.net Fri Aug 3 14:03:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:03:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include objimpl.h,2.35,2.36 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv32520/python/Include Modified Files: objimpl.h Log Message: Removed duplicate definnitions of PyObject_AS_GC and PyObject_FROM_GC (occurred only if GC was off). Index: objimpl.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/objimpl.h,v retrieving revision 2.35 retrieving revision 2.36 diff -C2 -d -r2.35 -r2.36 *** objimpl.h 2001/08/02 04:15:00 2.35 --- objimpl.h 2001/08/03 13:03:24 2.36 *************** *** 239,244 **** #define PyType_IS_GC(t) 0 #define PyObject_IS_GC(o) 0 - #define PyObject_AS_GC(o) (o) - #define PyObject_FROM_GC(o) (o) #define PyType_BASICSIZE(t) ((t)->tp_basicsize) #define PyType_SET_BASICSIZE(t, s) ((t)->tp_basicsize = (s)) --- 239,242 ---- From jackjansen@users.sourceforge.net Fri Aug 3 14:04:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:04:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_uu.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv32617/python/Lib/test Modified Files: test_uu.py Log Message: The test opened the binary test data files in text mode! Fixed. Index: test_uu.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_uu.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_uu.py 2001/07/11 21:43:42 1.1 --- test_uu.py 2001/08/03 13:04:03 1.2 *************** *** 61,69 **** tmpOut = TESTFN + "o" try: ! fin = open(tmpIn, 'w') fin.write(teststr) fin.close() ! fin = open(tmpIn, 'r') fout = open(tmpOut, 'w') uu.encode(fin, fout, tmpIn, mode=0644) --- 61,69 ---- tmpOut = TESTFN + "o" try: ! fin = open(tmpIn, 'wb') fin.write(teststr) fin.close() ! fin = open(tmpIn, 'rb') fout = open(tmpOut, 'w') uu.encode(fin, fout, tmpIn, mode=0644) *************** *** 80,84 **** print '6. decode file-> file' uu.decode(tmpOut) ! fin = open(tmpIn, 'r') s = fin.read() fin.close() --- 80,84 ---- print '6. decode file-> file' uu.decode(tmpOut) ! fin = open(tmpIn, 'rb') s = fin.read() fin.close() From jackjansen@users.sourceforge.net Fri Aug 3 14:05:13 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:05:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.exp,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv336/python/Mac/Build Modified Files: PythonCore.exp Log Message: Regenerated for new description stuff. Index: PythonCore.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.exp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PythonCore.exp 2001/05/17 22:14:07 1.8 --- PythonCore.exp 2001/08/03 13:05:11 1.9 *************** *** 26,33 **** _PyBuiltin_Init _PyEval_SliceIndex PyEval_CallObjectWithKeywords PyEval_CallObject Py_FlushLine ! PyEval_GetNestedScopes PyEval_GetRestricted PyEval_GetFrame --- 26,35 ---- _PyBuiltin_Init _PyEval_SliceIndex + PyEval_GetFuncDesc + PyEval_GetFuncName PyEval_CallObjectWithKeywords PyEval_CallObject Py_FlushLine ! PyEval_MergeCompilerFlags PyEval_GetRestricted PyEval_GetFrame *************** *** 35,38 **** --- 37,43 ---- PyEval_GetLocals PyEval_GetBuiltins + PyEval_SetTrace + PyEval_SetProfile + PyEval_EvalCodeEx PyEval_EvalCode Py_SetRecursionLimit *************** *** 142,145 **** --- 147,151 ---- Py_NoSiteFlag Py_FrozenFlag + Py_IgnoreEnvironmentFlag _PyThread_Started Py_UnicodeFlag *************** *** 151,155 **** --- 157,163 ---- Py_FatalError PyParser_SimpleParseString + PyParser_SimpleParseStringFlags PyParser_SimpleParseFile + PyParser_SimpleParseFileFlags Py_SymtableString Py_CompileStringFlags *************** *** 186,189 **** --- 194,201 ---- Py_IsInitialized _PyThreadState_Current + PyThreadState_Next + PyInterpreterState_ThreadHead + PyInterpreterState_Next + PyInterpreterState_Head PyThreadState_GetDict PyThreadState_Swap *************** *** 225,228 **** --- 237,241 ---- PyObject_CallMethod PyObject_CallFunction + PyObject_Call PyObject_CallObject PyMapping_HasKey *************** *** 299,309 **** PyMethod_Type PyMethod_Fini - PyMethod_Class - PyMethod_Self - PyMethod_Function PyMethod_New - PyInstance_New PyInstance_NewRaw PyClass_IsSubclass PyClass_New PyCObject_Type --- 312,319 ---- PyMethod_Type PyMethod_Fini PyMethod_New PyInstance_NewRaw PyClass_IsSubclass + PyInstance_New PyClass_New PyCObject_Type *************** *** 335,338 **** --- 345,349 ---- PyDict_Size PyDict_Copy + PyDict_Update PyDict_Next PyDict_Clear *************** *** 368,371 **** --- 379,386 ---- PyFrame_New PyFunction_Type + PyClassMethod_Type + PyStaticMethod_Type + PyStaticMethod_New + PyClassMethod_New PyFunction_SetClosure PyFunction_GetClosure *************** *** 402,405 **** --- 417,422 ---- PyLong_FromVoidPtr PyLong_AsDouble + _PyLong_AsByteArray + _PyLong_FromByteArray PyLong_AsUnsignedLong PyLong_AsLong *************** *** 416,419 **** --- 433,437 ---- PyCFunction_GetFunction PyCFunction_New + module_members PyModule_Type _PyModule_Clear *************** *** 444,447 **** --- 462,468 ---- PyObject_Not PyObject_IsTrue + PyObject_GenericSetAttr + PyObject_GenericGetAttr + _PyObject_GetDictPtr PyObject_SetAttr PyObject_HasAttr *************** *** 484,487 **** --- 505,510 ---- PyString_ConcatAndDel PyString_Concat + _PyString_Join + _PyString_Eq PyString_AsStringAndSize PyString_AsString *************** *** 503,507 **** --- 526,537 ---- PyTuple_Size PyTuple_New + type_getsets PyType_Type + PyBaseObject_Type + PyType_InitDict + _PyType_Lookup + PyType_IsSubtype + PyType_GenericNew + PyType_GenericAlloc PyGrammar_RemoveAccelerators PyGrammar_AddAccelerators *************** *** 520,524 **** --- 550,556 ---- PyParser_New Py_TabcheckFlag + PyParser_ParseFileFlags PyParser_ParseFile + PyParser_ParseStringFlags PyParser_ParseString _PyParser_TokenNames *************** *** 560,564 **** --- 592,602 ---- initselect gethostbyname_lock + inet_ntop + inet_pton init_socket + getnameinfo + getaddrinfo + freeaddrinfo + gai_strerror initstrop initstruct *************** *** 571,575 **** not_upp PyMac_GetArgv - PyMac_GetFullPath PyMac_init_process_location strdup --- 609,612 ---- *************** *** 584,587 **** --- 621,716 ---- PyMac_AppearanceCompliant PyMac_OSErrException + PyMacGluePtr_AEDesc_New + PyMacGluePtr_AEDesc_Convert + PyMacGluePtr_CmpObj_New + PyMacGluePtr_CmpObj_Convert + PyMacGluePtr_CmpInstObj_New + PyMacGluePtr_CmpInstObj_Convert + PyMacGluePtr_CtlObj_New + PyMacGluePtr_CtlObj_Convert + PyMacGluePtr_DlgObj_New + PyMacGluePtr_DlgObj_Convert + PyMacGluePtr_DlgObj_WhichDialog + PyMacGluePtr_DragObj_New + PyMacGluePtr_DragObj_Convert + PyMacGluePtr_ListObj_New + PyMacGluePtr_ListObj_Convert + PyMacGluePtr_MenuObj_New + PyMacGluePtr_MenuObj_Convert + PyMacGluePtr_GrafObj_New + PyMacGluePtr_GrafObj_Convert + PyMacGluePtr_BMObj_New + PyMacGluePtr_BMObj_Convert + PyMacGluePtr_QdRGB_New + PyMacGluePtr_QdRGB_Convert + PyMacGluePtr_GWorldObj_New + PyMacGluePtr_GWorldObj_Convert + PyMacGluePtr_TrackObj_New + PyMacGluePtr_TrackObj_Convert + PyMacGluePtr_MovieObj_New + PyMacGluePtr_MovieObj_Convert + PyMacGluePtr_MovieCtlObj_New + PyMacGluePtr_MovieCtlObj_Convert + PyMacGluePtr_TimeBaseObj_New + PyMacGluePtr_TimeBaseObj_Convert + PyMacGluePtr_UserDataObj_New + PyMacGluePtr_UserDataObj_Convert + PyMacGluePtr_MediaObj_New + PyMacGluePtr_MediaObj_Convert + PyMacGluePtr_ResObj_New + PyMacGluePtr_ResObj_Convert + PyMacGluePtr_OptResObj_New + PyMacGluePtr_OptResObj_Convert + PyMacGluePtr_TEObj_New + PyMacGluePtr_TEObj_Convert + PyMacGluePtr_WinObj_New + PyMacGluePtr_WinObj_Convert + PyMacGluePtr_WinObj_WhichWindow + WinObj_WhichWindow + WinObj_Convert + WinObj_New + TEObj_Convert + TEObj_New + OptResObj_Convert + OptResObj_New + ResObj_Convert + ResObj_New + MediaObj_Convert + MediaObj_New + UserDataObj_Convert + UserDataObj_New + TimeBaseObj_Convert + TimeBaseObj_New + MovieCtlObj_Convert + MovieCtlObj_New + MovieObj_Convert + MovieObj_New + TrackObj_Convert + TrackObj_New + GWorldObj_Convert + GWorldObj_New + QdRGB_Convert + QdRGB_New + BMObj_Convert + BMObj_New + GrafObj_Convert + GrafObj_New + MenuObj_Convert + MenuObj_New + ListObj_Convert + ListObj_New + DragObj_Convert + DragObj_New + DlgObj_WhichDialog + DlgObj_Convert + DlgObj_New + CtlObj_Convert + CtlObj_New + CmpInstObj_Convert + CmpInstObj_New + CmpObj_Convert + CmpObj_New + AEDesc_Convert + AEDesc_New PyMac_Buildwide PyMac_Getwide *************** *** 593,598 **** PyMac_BuildRect PyMac_GetRect - PyMac_BuildFSSpec - PyMac_GetFSSpec PyMac_BuildOptStr255 PyMac_BuildStr255 --- 722,725 ---- *************** *** 631,634 **** --- 758,762 ---- RotateCursor SpinCursor + PyMac_GetFullPath PyMac_getscript PyMac_AppRefNum *************** *** 658,663 **** initgestalt initmacfs newmfssobject ! mfs_GetFSSpecFSSpec initmac initMacOS --- 786,795 ---- initgestalt initmacfs + PyMac_BuildFSSpec + PyMac_BuildFSRef + PyMac_GetFSRef + newmfsrobject newmfssobject ! PyMac_GetFSSpec initmac initMacOS *************** *** 693,699 **** Dialog_Type initDlg ! DlgObj_Convert ! DlgObj_New ! DlgObj_WhichDialog MenuObj_chain Menu_Type --- 825,831 ---- Dialog_Type initDlg ! _DlgObj_Convert ! _DlgObj_New ! _DlgObj_WhichDialog MenuObj_chain Menu_Type *************** *** 724,730 **** Window_Type initWin ! WinObj_WhichWindow ! WinObj_Convert ! WinObj_New PyBuffer_Type PyBuffer_New --- 856,862 ---- Window_Type initWin ! _WinObj_WhichWindow ! _WinObj_Convert ! _WinObj_New PyBuffer_Type PyBuffer_New *************** *** 751,821 **** PyCodec_Register _PyUnicode_TypeRecords ! _PyUnicode_IsAlpha ! _PyUnicode_ToLowercase ! _PyUnicode_ToUppercase ! _PyUnicode_IsUppercase ! _PyUnicode_IsLowercase ! _PyUnicode_IsWhitespace ! _PyUnicode_IsNumeric ! _PyUnicode_ToNumeric ! _PyUnicode_IsDigit ! _PyUnicode_ToDigit ! _PyUnicode_IsDecimalDigit ! _PyUnicode_ToDecimalDigit ! _PyUnicode_IsTitlecase ! _PyUnicode_ToTitlecase ! _PyUnicode_IsLinebreak PyUnicode_Type ! _PyUnicode_Fini ! _PyUnicode_Init ! PyUnicode_Format ! PyUnicode_Split ! PyUnicode_Replace ! PyUnicode_Concat ! PyUnicode_Contains ! PyUnicode_Compare ! PyUnicode_Splitlines ! PyUnicode_Join ! PyUnicode_Tailmatch ! PyUnicode_Find ! PyUnicode_Count ! PyUnicode_EncodeDecimal ! PyUnicode_Translate ! PyUnicode_TranslateCharmap ! PyUnicode_AsCharmapString ! PyUnicode_EncodeCharmap ! PyUnicode_DecodeCharmap ! PyUnicode_AsASCIIString ! PyUnicode_EncodeASCII ! PyUnicode_DecodeASCII ! PyUnicode_AsLatin1String ! PyUnicode_EncodeLatin1 ! PyUnicode_DecodeLatin1 ! PyUnicode_AsRawUnicodeEscapeString ! PyUnicode_EncodeRawUnicodeEscape ! PyUnicode_DecodeRawUnicodeEscape ! PyUnicode_AsUnicodeEscapeString ! PyUnicode_EncodeUnicodeEscape ! PyUnicode_DecodeUnicodeEscape ! PyUnicode_AsUTF16String ! PyUnicode_EncodeUTF16 ! PyUnicode_DecodeUTF16 ! PyUnicode_AsUTF8String ! PyUnicode_EncodeUTF8 ! PyUnicode_DecodeUTF8 ! PyUnicode_SetDefaultEncoding ! PyUnicode_GetDefaultEncoding ! PyUnicode_GetSize ! PyUnicode_AsUnicode ! _PyUnicode_AsDefaultEncodedString ! PyUnicode_AsEncodedString ! PyUnicode_Encode ! PyUnicode_Decode ! PyUnicode_FromEncodedObject ! PyUnicode_FromObject ! PyUnicode_AsWideChar ! PyUnicode_FromWideChar ! PyUnicode_FromUnicode ! PyUnicode_Resize initthread PyThread_up_sema --- 883,954 ---- PyCodec_Register _PyUnicode_TypeRecords ! _PyUnicodeUCS2_IsAlpha ! _PyUnicodeUCS2_ToLowercase ! _PyUnicodeUCS2_ToUppercase ! _PyUnicodeUCS2_IsUppercase ! _PyUnicodeUCS2_IsLowercase ! _PyUnicodeUCS2_IsWhitespace ! _PyUnicodeUCS2_IsNumeric ! _PyUnicodeUCS2_ToNumeric ! _PyUnicodeUCS2_IsDigit ! _PyUnicodeUCS2_ToDigit ! _PyUnicodeUCS2_IsDecimalDigit ! _PyUnicodeUCS2_ToDecimalDigit ! _PyUnicodeUCS2_IsTitlecase ! _PyUnicodeUCS2_ToTitlecase ! _PyUnicodeUCS2_IsLinebreak PyUnicode_Type ! _PyUnicodeUCS2_Fini ! _PyUnicodeUCS2_Init ! PyUnicodeUCS2_Format ! PyUnicodeUCS2_Split ! PyUnicodeUCS2_Replace ! PyUnicodeUCS2_Concat ! PyUnicodeUCS2_Contains ! PyUnicodeUCS2_Compare ! PyUnicodeUCS2_Splitlines ! PyUnicodeUCS2_Join ! PyUnicodeUCS2_Tailmatch ! PyUnicodeUCS2_Find ! PyUnicodeUCS2_Count ! PyUnicodeUCS2_EncodeDecimal ! PyUnicodeUCS2_Translate ! PyUnicodeUCS2_TranslateCharmap ! PyUnicodeUCS2_AsCharmapString ! PyUnicodeUCS2_EncodeCharmap ! PyUnicodeUCS2_DecodeCharmap ! PyUnicodeUCS2_AsASCIIString ! PyUnicodeUCS2_EncodeASCII ! PyUnicodeUCS2_DecodeASCII ! PyUnicodeUCS2_AsLatin1String ! PyUnicodeUCS2_EncodeLatin1 ! PyUnicodeUCS2_DecodeLatin1 ! PyUnicodeUCS2_AsRawUnicodeEscapeString ! PyUnicodeUCS2_EncodeRawUnicodeEscape ! PyUnicodeUCS2_DecodeRawUnicodeEscape ! PyUnicodeUCS2_AsUnicodeEscapeString ! PyUnicodeUCS2_EncodeUnicodeEscape ! PyUnicodeUCS2_DecodeUnicodeEscape ! PyUnicodeUCS2_AsUTF16String ! PyUnicodeUCS2_EncodeUTF16 ! PyUnicodeUCS2_DecodeUTF16 ! PyUnicodeUCS2_AsUTF8String ! PyUnicodeUCS2_EncodeUTF8 ! PyUnicodeUCS2_DecodeUTF8 ! PyUnicodeUCS2_SetDefaultEncoding ! PyUnicodeUCS2_GetDefaultEncoding ! PyUnicodeUCS2_GetSize ! PyUnicodeUCS2_AsUnicode ! _PyUnicodeUCS2_AsDefaultEncodedString ! PyUnicodeUCS2_AsEncodedString ! PyUnicodeUCS2_Encode ! PyUnicodeUCS2_Decode ! PyUnicodeUCS2_FromEncodedObject ! PyUnicodeUCS2_FromObject ! PyUnicodeUCS2_AsWideChar ! PyUnicodeUCS2_FromWideChar ! PyUnicodeUCS2_FromUnicode ! PyUnicodeUCS2_Resize ! PyUnicodeUCS2_GetMax initthread PyThread_up_sema *************** *** 869,874 **** PyExc_SyntaxWarning PyExc_RuntimeWarning ! fini_exceptions ! init_exceptions initNav AEDesc_chain --- 1002,1007 ---- PyExc_SyntaxWarning PyExc_RuntimeWarning ! _PyExc_Fini ! _PyExc_Init initNav AEDesc_chain *************** *** 903,986 **** PyCallIter_New PySeqIter_New ! PyMacGluePtr_AEDesc_New ! PyMacGluePtr_AEDesc_Convert ! PyMacGluePtr_CmpObj_New ! PyMacGluePtr_CmpObj_Convert ! PyMacGluePtr_CmpInstObj_New ! PyMacGluePtr_CmpInstObj_Convert ! PyMacGluePtr_CtlObj_New ! PyMacGluePtr_CtlObj_Convert ! PyMacGluePtr_DragObj_New ! PyMacGluePtr_DragObj_Convert ! PyMacGluePtr_ListObj_New ! PyMacGluePtr_ListObj_Convert ! PyMacGluePtr_MenuObj_New ! PyMacGluePtr_MenuObj_Convert ! PyMacGluePtr_GrafObj_New ! PyMacGluePtr_GrafObj_Convert ! PyMacGluePtr_BMObj_New ! PyMacGluePtr_BMObj_Convert ! PyMacGluePtr_QdRGB_New ! PyMacGluePtr_QdRGB_Convert ! PyMacGluePtr_GWorldObj_New ! PyMacGluePtr_GWorldObj_Convert ! PyMacGluePtr_TrackObj_New ! PyMacGluePtr_TrackObj_Convert ! PyMacGluePtr_MovieObj_New ! PyMacGluePtr_MovieObj_Convert ! PyMacGluePtr_MovieCtlObj_New ! PyMacGluePtr_MovieCtlObj_Convert ! PyMacGluePtr_TimeBaseObj_New ! PyMacGluePtr_TimeBaseObj_Convert ! PyMacGluePtr_UserDataObj_New ! PyMacGluePtr_UserDataObj_Convert ! PyMacGluePtr_MediaObj_New ! PyMacGluePtr_MediaObj_Convert ! PyMacGluePtr_ResObj_New ! PyMacGluePtr_ResObj_Convert ! PyMacGluePtr_OptResObj_New ! PyMacGluePtr_OptResObj_Convert ! PyMacGluePtr_TEObj_New ! PyMacGluePtr_TEObj_Convert ! TEObj_Convert ! TEObj_New ! OptResObj_Convert ! OptResObj_New ! ResObj_Convert ! ResObj_New ! MediaObj_Convert ! MediaObj_New ! UserDataObj_Convert ! UserDataObj_New ! TimeBaseObj_Convert ! TimeBaseObj_New ! MovieCtlObj_Convert ! MovieCtlObj_New ! MovieObj_Convert ! MovieObj_New ! TrackObj_Convert ! TrackObj_New ! GWorldObj_Convert ! GWorldObj_New ! QdRGB_Convert ! QdRGB_New ! BMObj_Convert ! BMObj_New ! GrafObj_Convert ! GrafObj_New ! MenuObj_Convert ! MenuObj_New ! ListObj_Convert ! ListObj_New ! DragObj_Convert ! DragObj_New ! CtlObj_Convert ! CtlObj_New ! CmpInstObj_Convert ! CmpInstObj_New ! CmpObj_Convert ! CmpObj_New ! AEDesc_Convert ! AEDesc_New GUSISetupConsoleStdio GUSIStdioFlush --- 1036,1051 ---- PyCallIter_New PySeqIter_New ! PyOS_vsnprintf ! PyOS_snprintf ! proxytype ! wrappertype ! PyWrapper_New ! PyDictProxy_New ! proxy_str ! PyDescr_IsData ! PyDescr_NewWrapper ! PyDescr_NewGetSet ! PyDescr_NewMember ! PyDescr_NewMethod GUSISetupConsoleStdio GUSIStdioFlush From jackjansen@users.sourceforge.net Fri Aug 3 14:05:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:05:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCoreCarbon.exp,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv367/python/Mac/Build Modified Files: PythonCoreCarbon.exp Log Message: Regenerated for new description stuff. Index: PythonCoreCarbon.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCoreCarbon.exp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PythonCoreCarbon.exp 2001/05/17 22:14:36 1.8 --- PythonCoreCarbon.exp 2001/08/03 13:05:18 1.9 *************** *** 26,33 **** _PyBuiltin_Init _PyEval_SliceIndex PyEval_CallObjectWithKeywords PyEval_CallObject Py_FlushLine ! PyEval_GetNestedScopes PyEval_GetRestricted PyEval_GetFrame --- 26,35 ---- _PyBuiltin_Init _PyEval_SliceIndex + PyEval_GetFuncDesc + PyEval_GetFuncName PyEval_CallObjectWithKeywords PyEval_CallObject Py_FlushLine ! PyEval_MergeCompilerFlags PyEval_GetRestricted PyEval_GetFrame *************** *** 35,38 **** --- 37,43 ---- PyEval_GetLocals PyEval_GetBuiltins + PyEval_SetTrace + PyEval_SetProfile + PyEval_EvalCodeEx PyEval_EvalCode Py_SetRecursionLimit *************** *** 142,145 **** --- 147,151 ---- Py_NoSiteFlag Py_FrozenFlag + Py_IgnoreEnvironmentFlag _PyThread_Started Py_UnicodeFlag *************** *** 151,155 **** --- 157,163 ---- Py_FatalError PyParser_SimpleParseString + PyParser_SimpleParseStringFlags PyParser_SimpleParseFile + PyParser_SimpleParseFileFlags Py_SymtableString Py_CompileStringFlags *************** *** 186,189 **** --- 194,201 ---- Py_IsInitialized _PyThreadState_Current + PyThreadState_Next + PyInterpreterState_ThreadHead + PyInterpreterState_Next + PyInterpreterState_Head PyThreadState_GetDict PyThreadState_Swap *************** *** 225,228 **** --- 237,241 ---- PyObject_CallMethod PyObject_CallFunction + PyObject_Call PyObject_CallObject PyMapping_HasKey *************** *** 299,309 **** PyMethod_Type PyMethod_Fini - PyMethod_Class - PyMethod_Self - PyMethod_Function PyMethod_New - PyInstance_New PyInstance_NewRaw PyClass_IsSubclass PyClass_New PyCObject_Type --- 312,319 ---- PyMethod_Type PyMethod_Fini PyMethod_New PyInstance_NewRaw PyClass_IsSubclass + PyInstance_New PyClass_New PyCObject_Type *************** *** 335,338 **** --- 345,349 ---- PyDict_Size PyDict_Copy + PyDict_Update PyDict_Next PyDict_Clear *************** *** 368,371 **** --- 379,386 ---- PyFrame_New PyFunction_Type + PyClassMethod_Type + PyStaticMethod_Type + PyStaticMethod_New + PyClassMethod_New PyFunction_SetClosure PyFunction_GetClosure *************** *** 402,405 **** --- 417,422 ---- PyLong_FromVoidPtr PyLong_AsDouble + _PyLong_AsByteArray + _PyLong_FromByteArray PyLong_AsUnsignedLong PyLong_AsLong *************** *** 416,419 **** --- 433,437 ---- PyCFunction_GetFunction PyCFunction_New + module_members PyModule_Type _PyModule_Clear *************** *** 444,447 **** --- 462,468 ---- PyObject_Not PyObject_IsTrue + PyObject_GenericSetAttr + PyObject_GenericGetAttr + _PyObject_GetDictPtr PyObject_SetAttr PyObject_HasAttr *************** *** 484,487 **** --- 505,510 ---- PyString_ConcatAndDel PyString_Concat + _PyString_Join + _PyString_Eq PyString_AsStringAndSize PyString_AsString *************** *** 503,507 **** --- 526,537 ---- PyTuple_Size PyTuple_New + type_getsets PyType_Type + PyBaseObject_Type + PyType_InitDict + _PyType_Lookup + PyType_IsSubtype + PyType_GenericNew + PyType_GenericAlloc PyGrammar_RemoveAccelerators PyGrammar_AddAccelerators *************** *** 520,524 **** --- 550,556 ---- PyParser_New Py_TabcheckFlag + PyParser_ParseFileFlags PyParser_ParseFile + PyParser_ParseStringFlags PyParser_ParseString _PyParser_TokenNames *************** *** 560,564 **** --- 592,602 ---- initselect gethostbyname_lock + inet_ntop + inet_pton init_socket + getnameinfo + getaddrinfo + freeaddrinfo + gai_strerror initstrop initstruct *************** *** 571,575 **** not_upp PyMac_GetArgv - PyMac_GetFullPath PyMac_init_process_location strdup --- 609,612 ---- *************** *** 584,587 **** --- 621,716 ---- PyMac_AppearanceCompliant PyMac_OSErrException + PyMacGluePtr_AEDesc_New + PyMacGluePtr_AEDesc_Convert + PyMacGluePtr_CmpObj_New + PyMacGluePtr_CmpObj_Convert + PyMacGluePtr_CmpInstObj_New + PyMacGluePtr_CmpInstObj_Convert + PyMacGluePtr_CtlObj_New + PyMacGluePtr_CtlObj_Convert + PyMacGluePtr_DlgObj_New + PyMacGluePtr_DlgObj_Convert + PyMacGluePtr_DlgObj_WhichDialog + PyMacGluePtr_DragObj_New + PyMacGluePtr_DragObj_Convert + PyMacGluePtr_ListObj_New + PyMacGluePtr_ListObj_Convert + PyMacGluePtr_MenuObj_New + PyMacGluePtr_MenuObj_Convert + PyMacGluePtr_GrafObj_New + PyMacGluePtr_GrafObj_Convert + PyMacGluePtr_BMObj_New + PyMacGluePtr_BMObj_Convert + PyMacGluePtr_QdRGB_New + PyMacGluePtr_QdRGB_Convert + PyMacGluePtr_GWorldObj_New + PyMacGluePtr_GWorldObj_Convert + PyMacGluePtr_TrackObj_New + PyMacGluePtr_TrackObj_Convert + PyMacGluePtr_MovieObj_New + PyMacGluePtr_MovieObj_Convert + PyMacGluePtr_MovieCtlObj_New + PyMacGluePtr_MovieCtlObj_Convert + PyMacGluePtr_TimeBaseObj_New + PyMacGluePtr_TimeBaseObj_Convert + PyMacGluePtr_UserDataObj_New + PyMacGluePtr_UserDataObj_Convert + PyMacGluePtr_MediaObj_New + PyMacGluePtr_MediaObj_Convert + PyMacGluePtr_ResObj_New + PyMacGluePtr_ResObj_Convert + PyMacGluePtr_OptResObj_New + PyMacGluePtr_OptResObj_Convert + PyMacGluePtr_TEObj_New + PyMacGluePtr_TEObj_Convert + PyMacGluePtr_WinObj_New + PyMacGluePtr_WinObj_Convert + PyMacGluePtr_WinObj_WhichWindow + WinObj_WhichWindow + WinObj_Convert + WinObj_New + TEObj_Convert + TEObj_New + OptResObj_Convert + OptResObj_New + ResObj_Convert + ResObj_New + MediaObj_Convert + MediaObj_New + UserDataObj_Convert + UserDataObj_New + TimeBaseObj_Convert + TimeBaseObj_New + MovieCtlObj_Convert + MovieCtlObj_New + MovieObj_Convert + MovieObj_New + TrackObj_Convert + TrackObj_New + GWorldObj_Convert + GWorldObj_New + QdRGB_Convert + QdRGB_New + BMObj_Convert + BMObj_New + GrafObj_Convert + GrafObj_New + MenuObj_Convert + MenuObj_New + ListObj_Convert + ListObj_New + DragObj_Convert + DragObj_New + DlgObj_WhichDialog + DlgObj_Convert + DlgObj_New + CtlObj_Convert + CtlObj_New + CmpInstObj_Convert + CmpInstObj_New + CmpObj_Convert + CmpObj_New + AEDesc_Convert + AEDesc_New PyMac_Buildwide PyMac_Getwide *************** *** 593,598 **** PyMac_BuildRect PyMac_GetRect - PyMac_BuildFSSpec - PyMac_GetFSSpec PyMac_BuildOptStr255 PyMac_BuildStr255 --- 722,725 ---- *************** *** 625,628 **** --- 752,756 ---- RotateCursor SpinCursor + PyMac_GetFullPath PyMac_getscript PyMac_AppRefNum *************** *** 651,656 **** initgestalt initmacfs newmfssobject ! mfs_GetFSSpecFSSpec initmac initMacOS --- 779,788 ---- initgestalt initmacfs + PyMac_BuildFSSpec + PyMac_BuildFSRef + PyMac_GetFSRef + newmfsrobject newmfssobject ! PyMac_GetFSSpec initmac initMacOS *************** *** 686,692 **** Dialog_Type initDlg ! DlgObj_Convert ! DlgObj_New ! DlgObj_WhichDialog MenuObj_chain Menu_Type --- 818,824 ---- Dialog_Type initDlg ! _DlgObj_Convert ! _DlgObj_New ! _DlgObj_WhichDialog MenuObj_chain Menu_Type *************** *** 717,723 **** Window_Type initWin ! WinObj_WhichWindow ! WinObj_Convert ! WinObj_New PyBuffer_Type PyBuffer_New --- 849,855 ---- Window_Type initWin ! _WinObj_WhichWindow ! _WinObj_Convert ! _WinObj_New PyBuffer_Type PyBuffer_New *************** *** 744,814 **** PyCodec_Register _PyUnicode_TypeRecords ! _PyUnicode_IsAlpha ! _PyUnicode_ToLowercase ! _PyUnicode_ToUppercase ! _PyUnicode_IsUppercase ! _PyUnicode_IsLowercase ! _PyUnicode_IsWhitespace ! _PyUnicode_IsNumeric ! _PyUnicode_ToNumeric ! _PyUnicode_IsDigit ! _PyUnicode_ToDigit ! _PyUnicode_IsDecimalDigit ! _PyUnicode_ToDecimalDigit ! _PyUnicode_IsTitlecase ! _PyUnicode_ToTitlecase ! _PyUnicode_IsLinebreak PyUnicode_Type ! _PyUnicode_Fini ! _PyUnicode_Init ! PyUnicode_Format ! PyUnicode_Split ! PyUnicode_Replace ! PyUnicode_Concat ! PyUnicode_Contains ! PyUnicode_Compare ! PyUnicode_Splitlines ! PyUnicode_Join ! PyUnicode_Tailmatch ! PyUnicode_Find ! PyUnicode_Count ! PyUnicode_EncodeDecimal ! PyUnicode_Translate ! PyUnicode_TranslateCharmap ! PyUnicode_AsCharmapString ! PyUnicode_EncodeCharmap ! PyUnicode_DecodeCharmap ! PyUnicode_AsASCIIString ! PyUnicode_EncodeASCII ! PyUnicode_DecodeASCII ! PyUnicode_AsLatin1String ! PyUnicode_EncodeLatin1 ! PyUnicode_DecodeLatin1 ! PyUnicode_AsRawUnicodeEscapeString ! PyUnicode_EncodeRawUnicodeEscape ! PyUnicode_DecodeRawUnicodeEscape ! PyUnicode_AsUnicodeEscapeString ! PyUnicode_EncodeUnicodeEscape ! PyUnicode_DecodeUnicodeEscape ! PyUnicode_AsUTF16String ! PyUnicode_EncodeUTF16 ! PyUnicode_DecodeUTF16 ! PyUnicode_AsUTF8String ! PyUnicode_EncodeUTF8 ! PyUnicode_DecodeUTF8 ! PyUnicode_SetDefaultEncoding ! PyUnicode_GetDefaultEncoding ! PyUnicode_GetSize ! PyUnicode_AsUnicode ! _PyUnicode_AsDefaultEncodedString ! PyUnicode_AsEncodedString ! PyUnicode_Encode ! PyUnicode_Decode ! PyUnicode_FromEncodedObject ! PyUnicode_FromObject ! PyUnicode_AsWideChar ! PyUnicode_FromWideChar ! PyUnicode_FromUnicode ! PyUnicode_Resize initthread PyThread_up_sema --- 876,947 ---- PyCodec_Register _PyUnicode_TypeRecords ! _PyUnicodeUCS2_IsAlpha ! _PyUnicodeUCS2_ToLowercase ! _PyUnicodeUCS2_ToUppercase ! _PyUnicodeUCS2_IsUppercase ! _PyUnicodeUCS2_IsLowercase ! _PyUnicodeUCS2_IsWhitespace ! _PyUnicodeUCS2_IsNumeric ! _PyUnicodeUCS2_ToNumeric ! _PyUnicodeUCS2_IsDigit ! _PyUnicodeUCS2_ToDigit ! _PyUnicodeUCS2_IsDecimalDigit ! _PyUnicodeUCS2_ToDecimalDigit ! _PyUnicodeUCS2_IsTitlecase ! _PyUnicodeUCS2_ToTitlecase ! _PyUnicodeUCS2_IsLinebreak PyUnicode_Type ! _PyUnicodeUCS2_Fini ! _PyUnicodeUCS2_Init ! PyUnicodeUCS2_Format ! PyUnicodeUCS2_Split ! PyUnicodeUCS2_Replace ! PyUnicodeUCS2_Concat ! PyUnicodeUCS2_Contains ! PyUnicodeUCS2_Compare ! PyUnicodeUCS2_Splitlines ! PyUnicodeUCS2_Join ! PyUnicodeUCS2_Tailmatch ! PyUnicodeUCS2_Find ! PyUnicodeUCS2_Count ! PyUnicodeUCS2_EncodeDecimal ! PyUnicodeUCS2_Translate ! PyUnicodeUCS2_TranslateCharmap ! PyUnicodeUCS2_AsCharmapString ! PyUnicodeUCS2_EncodeCharmap ! PyUnicodeUCS2_DecodeCharmap ! PyUnicodeUCS2_AsASCIIString ! PyUnicodeUCS2_EncodeASCII ! PyUnicodeUCS2_DecodeASCII ! PyUnicodeUCS2_AsLatin1String ! PyUnicodeUCS2_EncodeLatin1 ! PyUnicodeUCS2_DecodeLatin1 ! PyUnicodeUCS2_AsRawUnicodeEscapeString ! PyUnicodeUCS2_EncodeRawUnicodeEscape ! PyUnicodeUCS2_DecodeRawUnicodeEscape ! PyUnicodeUCS2_AsUnicodeEscapeString ! PyUnicodeUCS2_EncodeUnicodeEscape ! PyUnicodeUCS2_DecodeUnicodeEscape ! PyUnicodeUCS2_AsUTF16String ! PyUnicodeUCS2_EncodeUTF16 ! PyUnicodeUCS2_DecodeUTF16 ! PyUnicodeUCS2_AsUTF8String ! PyUnicodeUCS2_EncodeUTF8 ! PyUnicodeUCS2_DecodeUTF8 ! PyUnicodeUCS2_SetDefaultEncoding ! PyUnicodeUCS2_GetDefaultEncoding ! PyUnicodeUCS2_GetSize ! PyUnicodeUCS2_AsUnicode ! _PyUnicodeUCS2_AsDefaultEncodedString ! PyUnicodeUCS2_AsEncodedString ! PyUnicodeUCS2_Encode ! PyUnicodeUCS2_Decode ! PyUnicodeUCS2_FromEncodedObject ! PyUnicodeUCS2_FromObject ! PyUnicodeUCS2_AsWideChar ! PyUnicodeUCS2_FromWideChar ! PyUnicodeUCS2_FromUnicode ! PyUnicodeUCS2_Resize ! PyUnicodeUCS2_GetMax initthread PyThread_up_sema *************** *** 862,867 **** PyExc_SyntaxWarning PyExc_RuntimeWarning ! fini_exceptions ! init_exceptions initNav AEDesc_chain --- 995,1000 ---- PyExc_SyntaxWarning PyExc_RuntimeWarning ! _PyExc_Fini ! _PyExc_Init initNav AEDesc_chain *************** *** 896,979 **** PyCallIter_New PySeqIter_New ! PyMacGluePtr_AEDesc_New ! PyMacGluePtr_AEDesc_Convert ! PyMacGluePtr_CmpObj_New ! PyMacGluePtr_CmpObj_Convert ! PyMacGluePtr_CmpInstObj_New ! PyMacGluePtr_CmpInstObj_Convert ! PyMacGluePtr_CtlObj_New ! PyMacGluePtr_CtlObj_Convert ! PyMacGluePtr_DragObj_New ! PyMacGluePtr_DragObj_Convert ! PyMacGluePtr_ListObj_New ! PyMacGluePtr_ListObj_Convert ! PyMacGluePtr_MenuObj_New ! PyMacGluePtr_MenuObj_Convert ! PyMacGluePtr_GrafObj_New ! PyMacGluePtr_GrafObj_Convert ! PyMacGluePtr_BMObj_New ! PyMacGluePtr_BMObj_Convert ! PyMacGluePtr_QdRGB_New ! PyMacGluePtr_QdRGB_Convert ! PyMacGluePtr_GWorldObj_New ! PyMacGluePtr_GWorldObj_Convert ! PyMacGluePtr_TrackObj_New ! PyMacGluePtr_TrackObj_Convert ! PyMacGluePtr_MovieObj_New ! PyMacGluePtr_MovieObj_Convert ! PyMacGluePtr_MovieCtlObj_New ! PyMacGluePtr_MovieCtlObj_Convert ! PyMacGluePtr_TimeBaseObj_New ! PyMacGluePtr_TimeBaseObj_Convert ! PyMacGluePtr_UserDataObj_New ! PyMacGluePtr_UserDataObj_Convert ! PyMacGluePtr_MediaObj_New ! PyMacGluePtr_MediaObj_Convert ! PyMacGluePtr_ResObj_New ! PyMacGluePtr_ResObj_Convert ! PyMacGluePtr_OptResObj_New ! PyMacGluePtr_OptResObj_Convert ! PyMacGluePtr_TEObj_New ! PyMacGluePtr_TEObj_Convert ! TEObj_Convert ! TEObj_New ! OptResObj_Convert ! OptResObj_New ! ResObj_Convert ! ResObj_New ! MediaObj_Convert ! MediaObj_New ! UserDataObj_Convert ! UserDataObj_New ! TimeBaseObj_Convert ! TimeBaseObj_New ! MovieCtlObj_Convert ! MovieCtlObj_New ! MovieObj_Convert ! MovieObj_New ! TrackObj_Convert ! TrackObj_New ! GWorldObj_Convert ! GWorldObj_New ! QdRGB_Convert ! QdRGB_New ! BMObj_Convert ! BMObj_New ! GrafObj_Convert ! GrafObj_New ! MenuObj_Convert ! MenuObj_New ! ListObj_Convert ! ListObj_New ! DragObj_Convert ! DragObj_New ! CtlObj_Convert ! CtlObj_New ! CmpInstObj_Convert ! CmpInstObj_New ! CmpObj_Convert ! CmpObj_New ! AEDesc_Convert ! AEDesc_New GUSISetupConsoleStdio GUSIStdioFlush --- 1029,1044 ---- PyCallIter_New PySeqIter_New ! PyOS_vsnprintf ! PyOS_snprintf ! proxytype ! wrappertype ! PyWrapper_New ! PyDictProxy_New ! proxy_str ! PyDescr_IsData ! PyDescr_NewWrapper ! PyDescr_NewGetSet ! PyDescr_NewMember ! PyDescr_NewMethod GUSISetupConsoleStdio GUSIStdioFlush From jackjansen@users.sourceforge.net Fri Aug 3 14:05:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:05:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.mcp,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv447/python/Mac/Build Modified Files: PythonCore.mcp Log Message: Added descrobject.c and mysnprintf.c Index: PythonCore.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.mcp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 Binary files /tmp/cvsXtZiNd and /tmp/cvseBY50i differ From jackjansen@users.sourceforge.net Fri Aug 3 14:05:59 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:05:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonStandSmall.mcp,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv466/python/Mac/Build Modified Files: PythonStandSmall.mcp Log Message: Added descrobject.c and mysnprintf.c Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 Binary files /tmp/cvsFosUl1 and /tmp/cvsu3uimT differ From jackjansen@users.sourceforge.net Fri Aug 3 14:07:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:07:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macmodule.c,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv739/python/Mac/Modules Modified Files: macmodule.c Log Message: (Finally) converted to new-style args. Added an optional (and ignored) 3d parameter to open() to make the signature compatible with posixmodule. Added the various O_ constants (by stealing the code from posixmodule). test_fileinput now passes. Index: macmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macmodule.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** macmodule.c 2001/05/12 21:31:30 1.43 --- macmodule.c 2001/08/03 13:07:19 1.44 *************** *** 133,137 **** char *path1; int res; ! if (!PyArg_Parse(args, "s", &path1)) return NULL; Py_BEGIN_ALLOW_THREADS --- 133,137 ---- char *path1; int res; ! if (!PyArg_ParseTuple(args, "s", &path1)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 151,155 **** char *path1, *path2; int res; ! if (!PyArg_Parse(args, "(ss)", &path1, &path2)) return NULL; Py_BEGIN_ALLOW_THREADS --- 151,155 ---- char *path1, *path2; int res; ! if (!PyArg_ParseTuple(args, "ss", &path1, &path2)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 170,174 **** int i; int res; ! if (!PyArg_Parse(args, "(si)", &path, &i)) return NULL; Py_BEGIN_ALLOW_THREADS --- 170,174 ---- int i; int res; ! if (!PyArg_ParseTuple(args, "si", &path, &i)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 205,209 **** { int fd, res; ! if (!PyArg_Parse(args, "i", &fd)) return NULL; Py_BEGIN_ALLOW_THREADS --- 205,209 ---- { int fd, res; ! if (!PyArg_ParseTuple(args, "i", &fd)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 227,231 **** { int fd; ! if (!PyArg_Parse(args, "i", &fd)) return NULL; Py_BEGIN_ALLOW_THREADS --- 227,231 ---- { int fd; ! if (!PyArg_ParseTuple(args, "i", &fd)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 249,253 **** char *mode; FILE *fp; ! if (!PyArg_Parse(args, "(is)", &fd, &mode)) return NULL; Py_BEGIN_ALLOW_THREADS --- 249,253 ---- char *mode; FILE *fp; ! if (!PyArg_ParseTuple(args, "is", &fd, &mode)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 267,271 **** { char *res; ! if (!PyArg_NoArgs(args)) return NULL; Py_BEGIN_ALLOW_THREADS --- 267,271 ---- { char *res; ! if (!PyArg_ParseTuple(args, "")) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 285,289 **** char path[MAXPATHLEN]; char *res; ! if (!PyArg_NoArgs(args)) return NULL; Py_BEGIN_ALLOW_THREADS --- 285,289 ---- char path[MAXPATHLEN]; char *res; ! if (!PyArg_ParseTuple(args, "")) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 310,314 **** DIR *dirp; struct dirent *ep; ! if (!PyArg_Parse(args, "s", &name)) return NULL; Py_BEGIN_ALLOW_THREADS --- 310,314 ---- DIR *dirp; struct dirent *ep; ! if (!PyArg_ParseTuple(args, "s", &name)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 352,356 **** int how; long res; ! if (!PyArg_Parse(args, "(iii)", &fd, &where, &how)) return NULL; Py_BEGIN_ALLOW_THREADS --- 352,356 ---- int how; long res; ! if (!PyArg_ParseTuple(args, "iii", &fd, &where, &how)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 392,397 **** char *path; int mode; int fd; ! if (!PyArg_Parse(args, "(si)", &path, &mode)) return NULL; Py_BEGIN_ALLOW_THREADS --- 392,398 ---- char *path; int mode; + int perm; /* Accepted but ignored */ int fd; ! if (!PyArg_ParseTuple(args, "si|i", &path, &mode, &perm)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 410,414 **** int fd, size; PyObject *buffer; ! if (!PyArg_Parse(args, "(ii)", &fd, &size)) return NULL; buffer = PyString_FromStringAndSize((char *)NULL, size); --- 411,415 ---- int fd, size; PyObject *buffer; ! if (!PyArg_ParseTuple(args, "ii", &fd, &size)) return NULL; buffer = PyString_FromStringAndSize((char *)NULL, size); *************** *** 450,454 **** char *path; int res; ! if (!PyArg_Parse(args, "s", &path)) return NULL; Py_BEGIN_ALLOW_THREADS --- 451,455 ---- char *path; int res; ! if (!PyArg_ParseTuple(args, "s", &path)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 479,483 **** long fd; int res; ! if (!PyArg_Parse(args, "l", &fd)) return NULL; Py_BEGIN_ALLOW_THREADS --- 480,484 ---- long fd; int res; ! if (!PyArg_ParseTuple(args, "l", &fd)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 510,514 **** char *path; int res; ! if (!PyArg_Parse(args, "s", &path)) return NULL; /* --- 511,515 ---- char *path; int res; ! if (!PyArg_ParseTuple(args, "s", &path)) return NULL; /* *************** *** 550,554 **** { int res; ! if (!PyArg_NoArgs(args)) return NULL; Py_BEGIN_ALLOW_THREADS --- 551,555 ---- { int res; ! if (!PyArg_ParseTuple(args, "")) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 576,580 **** int fd, size; char *buffer; ! if (!PyArg_Parse(args, "(is#)", &fd, &buffer, &size)) return NULL; Py_BEGIN_ALLOW_THREADS --- 577,581 ---- int fd, size; char *buffer; ! if (!PyArg_ParseTuple(args, "is#", &fd, &buffer, &size)) return NULL; Py_BEGIN_ALLOW_THREADS *************** *** 601,636 **** static struct PyMethodDef mac_methods[] = { ! {"chdir", mac_chdir}, ! {"close", mac_close}, #ifdef WEHAVE_DUP ! {"dup", mac_dup}, #endif #ifdef WEHAVE_FDOPEN ! {"fdopen", mac_fdopen}, #endif #ifdef WEHAVE_FSTAT ! {"fstat", mac_fstat}, #endif #if TARGET_API_MAC_OS8 ! {"getbootvol", mac_getbootvol}, /* non-standard */ #endif ! {"getcwd", mac_getcwd}, ! {"listdir", mac_listdir, 0}, ! {"lseek", mac_lseek}, {"mkdir", mac_mkdir, 1}, ! {"open", mac_open}, ! {"read", mac_read}, ! {"rename", mac_rename}, ! {"rmdir", mac_rmdir}, ! {"stat", mac_stat}, #if TARGET_API_MAC_OS8 ! {"xstat", mac_xstat}, #endif ! {"sync", mac_sync}, ! {"remove", mac_unlink}, ! {"unlink", mac_unlink}, ! {"write", mac_write}, #ifdef USE_MALLOC_DEBUG ! {"mstats", mac_mstats}, #endif --- 602,637 ---- static struct PyMethodDef mac_methods[] = { ! {"chdir", mac_chdir, 1}, ! {"close", mac_close, 1}, #ifdef WEHAVE_DUP ! {"dup", mac_dup, 1}, #endif #ifdef WEHAVE_FDOPEN ! {"fdopen", mac_fdopen, 1}, #endif #ifdef WEHAVE_FSTAT ! {"fstat", mac_fstat, 1}, #endif #if TARGET_API_MAC_OS8 ! {"getbootvol", mac_getbootvol, 1}, /* non-standard */ #endif ! {"getcwd", mac_getcwd, 1}, ! {"listdir", mac_listdir, 1}, ! {"lseek", mac_lseek, 1}, {"mkdir", mac_mkdir, 1}, ! {"open", mac_open, 1}, ! {"read", mac_read, 1}, ! {"rename", mac_rename, 1}, ! {"rmdir", mac_rmdir, 1}, ! {"stat", mac_stat, 1}, #if TARGET_API_MAC_OS8 ! {"xstat", mac_xstat, 1}, #endif ! {"sync", mac_sync, 1}, ! {"remove", mac_unlink, 1}, ! {"unlink", mac_unlink, 1}, ! {"write", mac_write, 1}, #ifdef USE_MALLOC_DEBUG ! {"mstats", mac_mstats, 1}, #endif *************** *** 638,642 **** --- 639,738 ---- }; + static int + ins(PyObject *d, char *symbol, long value) + { + PyObject* v = PyInt_FromLong(value); + if (!v || PyDict_SetItemString(d, symbol, v) < 0) + return -1; /* triggers fatal error */ + + Py_DECREF(v); + return 0; + } + static int + all_ins(PyObject *d) + { + #ifdef F_OK + if (ins(d, "F_OK", (long)F_OK)) return -1; + #endif + #ifdef R_OK + if (ins(d, "R_OK", (long)R_OK)) return -1; + #endif + #ifdef W_OK + if (ins(d, "W_OK", (long)W_OK)) return -1; + #endif + #ifdef X_OK + if (ins(d, "X_OK", (long)X_OK)) return -1; + #endif + #ifdef NGROUPS_MAX + if (ins(d, "NGROUPS_MAX", (long)NGROUPS_MAX)) return -1; + #endif + #ifdef TMP_MAX + if (ins(d, "TMP_MAX", (long)TMP_MAX)) return -1; + #endif + #ifdef WNOHANG + if (ins(d, "WNOHANG", (long)WNOHANG)) return -1; + #endif + #ifdef O_RDONLY + if (ins(d, "O_RDONLY", (long)O_RDONLY)) return -1; + #endif + #ifdef O_WRONLY + if (ins(d, "O_WRONLY", (long)O_WRONLY)) return -1; + #endif + #ifdef O_RDWR + if (ins(d, "O_RDWR", (long)O_RDWR)) return -1; + #endif + #ifdef O_NDELAY + if (ins(d, "O_NDELAY", (long)O_NDELAY)) return -1; + #endif + #ifdef O_NONBLOCK + if (ins(d, "O_NONBLOCK", (long)O_NONBLOCK)) return -1; + #endif + #ifdef O_APPEND + if (ins(d, "O_APPEND", (long)O_APPEND)) return -1; + #endif + #ifdef O_DSYNC + if (ins(d, "O_DSYNC", (long)O_DSYNC)) return -1; + #endif + #ifdef O_RSYNC + if (ins(d, "O_RSYNC", (long)O_RSYNC)) return -1; + #endif + #ifdef O_SYNC + if (ins(d, "O_SYNC", (long)O_SYNC)) return -1; + #endif + #ifdef O_NOCTTY + if (ins(d, "O_NOCTTY", (long)O_NOCTTY)) return -1; + #endif + #ifdef O_CREAT + if (ins(d, "O_CREAT", (long)O_CREAT)) return -1; + #endif + #ifdef O_EXCL + if (ins(d, "O_EXCL", (long)O_EXCL)) return -1; + #endif + #ifdef O_TRUNC + if (ins(d, "O_TRUNC", (long)O_TRUNC)) return -1; + #endif + #ifdef O_BINARY + if (ins(d, "O_BINARY", (long)O_BINARY)) return -1; + #endif + #ifdef O_TEXT + if (ins(d, "O_TEXT", (long)O_TEXT)) return -1; + #endif + + #ifdef HAVE_SPAWNV + if (ins(d, "P_WAIT", (long)_P_WAIT)) return -1; + if (ins(d, "P_NOWAIT", (long)_P_NOWAIT)) return -1; + if (ins(d, "P_OVERLAY", (long)_OLD_P_OVERLAY)) return -1; + if (ins(d, "P_NOWAITO", (long)_P_NOWAITO)) return -1; + if (ins(d, "P_DETACH", (long)_P_DETACH)) return -1; + #endif + + #if defined(PYOS_OS2) + if (insertvalues(d)) return -1; + #endif + return 0; + } + + void initmac() *************** *** 647,650 **** --- 743,749 ---- d = PyModule_GetDict(m); + if (all_ins(d)) + return; + /* Initialize mac.error exception */ MacError = PyErr_NewException("mac.error", NULL, NULL); From jackjansen@users.sourceforge.net Fri Aug 3 14:19:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:19:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/mac libmacos.tex,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory usw-pr-cvs1:/tmp/cvs-serv3163/Doc/mac Modified Files: libmacos.tex Log Message: Documented the runtimemodel attribute. Index: libmacos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/libmacos.tex,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** libmacos.tex 2001/07/14 02:10:11 1.15 --- libmacos.tex 2001/08/03 13:19:56 1.16 *************** *** 13,16 **** --- 13,22 ---- Note the capitalisation of the module name, this is a historical artifact. + \begin{datadesc}{runtimemodel} + Either \code{"ppc"}, \code{"carbon"} or \code{"macho"}. This signifies + whether this Python uses the classic (InterfaceLib style) runtime + model, the MacOS X compatible CarbonLib style or the MacOS X-only + Mach-O style. + \end{datadesc} \begin{excdesc}{Error} From jackjansen@users.sourceforge.net Fri Aug 3 14:31:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include macbuildno.h,1.16,1.17 pythonresources.h,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv5116/Include Modified Files: macbuildno.h pythonresources.h Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: macbuildno.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/macbuildno.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** macbuildno.h 2001/04/25 22:07:42 1.16 --- macbuildno.h 2001/08/03 13:31:35 1.17 *************** *** 1 **** ! #define BUILD 92 --- 1 ---- ! #define BUILD 97 Index: pythonresources.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/pythonresources.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** pythonresources.h 2001/02/11 01:07:16 1.25 --- pythonresources.h 2001/08/03 13:31:36 1.26 *************** *** 96,99 **** --- 96,102 ---- #define NOPREFNAME_ID BASE_ID+9 + /* Not a script */ + #define NOTASCRIPT_ID BASE_ID+10 + /* EditPythonPrefs range. Needed here to forestall conflicts with applets */ #define EDITPYTHONPREFS_MIN 508 From jackjansen@users.sourceforge.net Fri Aug 3 14:31:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ae aescan.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ae In directory usw-pr-cvs1:/tmp/cvs-serv5116/Modules/ae Modified Files: aescan.py Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: aescan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ae/aescan.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** aescan.py 2001/01/02 22:02:45 1.11 --- aescan.py 2001/08/03 13:31:36 1.12 *************** *** 6,10 **** import os import string - import regsub import MacOS --- 6,9 ---- From jackjansen@users.sourceforge.net Fri Aug 3 14:31:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib FrameWork.py,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv5116/Lib Modified Files: FrameWork.py Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: FrameWork.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/FrameWork.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** FrameWork.py 2001/03/15 14:39:03 1.43 --- FrameWork.py 2001/08/03 13:31:36 1.44 *************** *** 1011,1014 **** --- 1011,1018 ---- self.do_postclose() + def do_postclose(self): + self.dlg = None + Window.do_postclose(self) + def do_itemhit(self, item, event): print 'Dialog %s, item %d hit'%(self.dlg, item) From jackjansen@users.sourceforge.net Fri Aug 3 14:31:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/res resscan.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/res In directory usw-pr-cvs1:/tmp/cvs-serv5116/Modules/res Modified Files: resscan.py Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: resscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/res/resscan.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** resscan.py 2001/05/22 21:55:08 1.12 --- resscan.py 2001/08/03 13:31:36 1.13 *************** *** 6,10 **** import os import string - import regsub import MacOS --- 6,9 ---- From jackjansen@users.sourceforge.net Fri Aug 3 14:31:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions/(vise) Python 2.1.vct,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory usw-pr-cvs1:/tmp/cvs-serv5116/Distributions/(vise) Modified Files: Python 2.1.vct Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: Python 2.1.vct =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/(vise)/Python 2.1.vct,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 Binary files /tmp/cvsjm0a6i and /tmp/cvs9tVSxn differ From jackjansen@users.sourceforge.net Fri Aug 3 14:31:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Resources dialogs.rsrc,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Resources In directory usw-pr-cvs1:/tmp/cvs-serv5116/Resources Modified Files: dialogs.rsrc Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: dialogs.rsrc =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Resources/dialogs.rsrc,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 Binary files /tmp/cvsdrpr4J and /tmp/cvsqdUpSj differ From jackjansen@users.sourceforge.net Fri Aug 3 14:31:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.97,1.98 macmain.c,1.65,1.66 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv5116/Python Modified Files: macglue.c macmain.c Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** macglue.c 2001/07/12 21:48:10 1.97 --- macglue.c 2001/08/03 13:31:36 1.98 *************** *** 228,232 **** return "mac-cyrillic"; default: ! return "mac-roman"; /* better than nothing */ } } --- 228,232 ---- return "mac-cyrillic"; default: ! return "ascii"; /* better than nothing */ } } Index: macmain.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macmain.c,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** macmain.c 2001/07/04 22:37:19 1.65 --- macmain.c 2001/08/03 13:31:36 1.66 *************** *** 487,490 **** --- 487,495 ---- #endif } + /* Check that the first argument is a text file */ + if ( PyMac_getfiletype(argv[1]) != 'TEXT' ) { + Alert(NOTASCRIPT_ID, NULL); + exit(0); + } } Py_Main(argc, argv); From jackjansen@users.sourceforge.net Fri Aug 3 14:31:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macfsmodule.c,1.37,1.38 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv5116/Modules Modified Files: macfsmodule.c Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: macfsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macfsmodule.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** macfsmodule.c 2001/07/08 22:07:13 1.37 --- macfsmodule.c 2001/08/03 13:31:36 1.38 *************** *** 368,371 **** --- 368,372 ---- _mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp) { + #if !TARGET_API_MAC_OS8 static FSRef *fsrp; *************** *** 375,378 **** --- 376,380 ---- return 1; } + #endif return 0; } *************** *** 382,389 **** --- 384,393 ---- _mfs_GetFSRefFromFSRef(PyObject *self, FSRef *fsrp) { + #if !TARGET_API_MAC_OS8 if ( is_mfsrobject(self) ) { *fsrp = ((mfsrobject *)self)->fsref; return 1; } + #endif return 0; } *************** *** 393,400 **** --- 397,406 ---- _mfs_GetFSRefFromFSSpec(PyObject *self, FSRef *fsrp) { + #if !TARGET_API_MAC_OS8 if ( is_mfssobject(self) ) { if ( FSpMakeFSRef(&((mfssobject *)self)->fsspec, fsrp) == noErr ) return 1; } + #endif return 0; } *************** *** 525,528 **** --- 531,538 ---- PyObject *args; { + #if TARGET_API_MAC_OS8 + PyErr_SetString(PyExc_NotImplementedError, "FSRef objects not supported on this platform"); + return 0; + #else OSErr err; FSRef fsref; *************** *** 536,539 **** --- 546,550 ---- } return (PyObject *)newmfsrobject(&fsref); + #endif } *************** *** 767,771 **** /* End of code for FSSpec objects */ /* -------------------------------------------------------- */ ! static PyObject * mfsr_as_fsspec(self, args) --- 778,782 ---- /* End of code for FSSpec objects */ /* -------------------------------------------------------- */ ! #if !TARGET_API_MAC_OS8 static PyObject * mfsr_as_fsspec(self, args) *************** *** 872,875 **** --- 883,887 ---- /* End of code for FSRef objects */ + #endif /* !TARGET_API_MAC_OS8 */ /* -------------------------------------------------------- */ *************** *** 1003,1006 **** --- 1015,1022 ---- PyObject *args; { + #if TARGET_API_MAC_OS8 + PyErr_SetString(PyExc_NotImplementedError, "FSRef objects not supported on this platform"); + return 0; + #else FSRef fsr; *************** *** 1008,1011 **** --- 1024,1028 ---- return NULL; return (PyObject *)newmfsrobject(&fsr); + #endif } *************** *** 1173,1176 **** --- 1190,1196 ---- PyMac_GetFSRef(PyObject *v, FSRef *fsr) { + #if TARGET_API_MAC_OS8 + return 0; + #else OSErr err; *************** *** 1187,1190 **** --- 1207,1211 ---- PyErr_SetString(PyExc_TypeError, "FSRef argument should be existing FSRef, FSSpec or (OSX only) pathname"); return 0; + #endif } *************** *** 1192,1196 **** --- 1213,1221 ---- PyObject *PyMac_BuildFSRef(FSRef *v) { + #if TARGET_API_MAC_OS8 + return NULL; + #else return (PyObject *)newmfsrobject(v); + #endif } From jackjansen@users.sourceforge.net Fri Aug 3 14:31:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/mlte mlted.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/mlte In directory usw-pr-cvs1:/tmp/cvs-serv5116/Demo/mlte Modified Files: mlted.py Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: mlted.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/mlte/mlted.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mlted.py 2001/07/16 21:57:50 1.2 --- mlted.py 2001/08/03 13:31:34 1.3 *************** *** 25,29 **** self.name = name r = windowbounds(400, 400) ! w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w flags = MacTextEditor.kTXNDrawGrowIconMask|MacTextEditor.kTXNWantHScrollBarMask| \ --- 25,29 ---- self.name = name r = windowbounds(400, 400) ! w = Win.NewWindow(r, name, 1, 0, -1, 1, 0) self.wid = w flags = MacTextEditor.kTXNDrawGrowIconMask|MacTextEditor.kTXNWantHScrollBarMask| \ *************** *** 362,365 **** --- 362,367 ---- if self.active: self.active.do_idle(event) + else: + Qd.SetCursor(Qd.qd.arrow) def main(): From jackjansen@users.sourceforge.net Fri Aug 3 14:31:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/textedit ped.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/textedit In directory usw-pr-cvs1:/tmp/cvs-serv5116/Demo/textedit Modified Files: ped.py Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: ped.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/textedit/ped.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ped.py 2001/04/25 22:05:36 1.6 --- ped.py 2001/08/03 13:31:34 1.7 *************** *** 20,24 **** self.name = name r = windowbounds(400, 400) ! w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w x0, y0, x1, y1 = self.wid.GetWindowPort().portRect --- 20,24 ---- self.name = name r = windowbounds(400, 400) ! w = Win.NewWindow(r, name, 1, 0, -1, 1, 0) self.wid = w x0, y0, x1, y1 = self.wid.GetWindowPort().portRect *************** *** 339,342 **** --- 339,344 ---- if self.active: self.active.do_idle() + else: + Qd.SetCursor(Qd.qd.arrow) def main(): From jackjansen@users.sourceforge.net Fri Aug 3 14:31:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac ReadMe,1.30,1.31 Relnotes,1.23,1.24 _checkversion.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv5116 Modified Files: ReadMe Relnotes _checkversion.py Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: ReadMe =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/ReadMe,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ReadMe 2001/05/10 12:20:30 1.30 --- ReadMe 2001/08/03 13:31:34 1.31 *************** *** 1,10 **** ! How to install Python 2.1 on your Macintosh ! ------------------------------------------- This is a MacPython that can run on classic MacOS (from 8.1 onwards) and natively on MacOSX. The installer tries to work out whether you can ! use the Carbon version or not. This is also the first MacPython distribution ! to be packaged as an active installer, which only downloads the parts you actually ! need. Let me hear about problems in these areas. You should definitely read the Relnotes file too. --- 1,8 ---- ! How to install Python 2.1.1 on your Macintosh ! --------------------------------------------- This is a MacPython that can run on classic MacOS (from 8.1 onwards) and natively on MacOSX. The installer tries to work out whether you can ! use the Carbon version or not. You should definitely read the Relnotes file too. *************** *** 14,19 **** are working on it. - If you installed a 2.1 beta on MacOSX you MUST read the uninstall section below. - ------ --- 12,15 ---- *************** *** 31,35 **** Caveats ------- ! Aside from the general new Python 2.1 features compared to 2.0 the main feature of this release is Carbon support. --- 27,31 ---- Caveats ------- ! Aside from the general new Python 2.1.1 features compared to 2.0 the main feature of this release is Carbon support. *************** *** 83,88 **** Python and "import test.autotest". ! Two tests will fail on MacOS9, both with MemoryErrors: ! test_longexp and test_zlib (on MacOSX nothing should fail). If you increase the PythonInterpreter memory --- 79,84 ---- Python and "import test.autotest". ! Three tests will fail on MacOS9, all with MemoryErrors: ! test_longexp, test_sha and test_zlib (on MacOSX nothing should fail). If you increase the PythonInterpreter memory *************** *** 109,113 **** Two items are installed in the system folder: the interpreter shared libraries PythonCore and PythonCoreCarbon lives in the Extensions folder and the ! "Python 2.1 Preferences" file in the Python subfolder in the Preferences folder. All the rest of Python lives in the folder you installed in. --- 105,109 ---- Two items are installed in the system folder: the interpreter shared libraries PythonCore and PythonCoreCarbon lives in the Extensions folder and the ! "Python 2.1.1 Preferences" file in the Python subfolder in the Preferences folder. All the rest of Python lives in the folder you installed in. *************** *** 118,122 **** beta installers triggered this problem if you simply threw away your Python folder, so if you installed a 2.1beta you should clean out the aliases in /Library/CFMSupport ! too. This final 2.1 installer always copies the shared libraries on OSX, so it does not have the problem anymore. --- 114,118 ---- beta installers triggered this problem if you simply threw away your Python folder, so if you installed a 2.1beta you should clean out the aliases in /Library/CFMSupport ! too. The final 2.1 installer always copied the shared libraries on OSX, so it does not have the problem anymore. *************** *** 158,164 **** are lost and you have to set them again. ! After you are satisfied that 2.1 works as expected you can trash anything in the system folder that has "python" in the name and not ! "2.1". As of 2.1 the ConfigurePython applets will try to detect incompatible preferences --- 154,160 ---- are lost and you have to set them again. ! After you are satisfied that 2.1.1 works as expected you can trash anything in the system folder that has "python" in the name and not ! "2.1.1". As of 2.1 the ConfigurePython applets will try to detect incompatible preferences *************** *** 192,197 **** Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn, ! Tom Bridgman Russel Owen and all the other people who provided feedback, ! code or both! MacPython includes waste, a TextEdit replacement which is (c) 1998 Marco Piovanelli. --- 188,193 ---- Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn, ! Tom Bridgman, Russel Owen, Pascal Oberndoerfer and all the other people ! who provided feedback, code or both! MacPython includes waste, a TextEdit replacement which is (c) 1998 Marco Piovanelli. Index: Relnotes =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Relnotes,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Relnotes 2001/04/25 22:11:19 1.23 --- Relnotes 2001/08/03 13:31:34 1.24 *************** *** 1,82 **** ! Changes in 2.1 since 2.0 -------------------------- These release notes refer to Mac-specific changes only. See NEWS (in the Misc folder) ! for machine-independent changes. Changes since 2.1b2 are ! marked with [*] and at the bottom of the list. ! ! - This release is optionally Carbon-based, so it runs natively on MacOS 8.1 or ! later and MacOSX. (Note that on MacOSX MacPython will run as a normal Mac application, ! if you want to run Python from the BSD commandline get a unix-Python distribution ! from www.python.org). ! - Alternatively there is a classic PPC interpreter as well. There are two reasons you ! might want to use this: (a) you have a pre-MacOS9 system and don't want to install ! CarbonLib, or (b) you need Tkinter, for which no Carbon version is available yet. ! - Distutils is included and seems to work. On 8.1 you may want to get Apple's ! CarbonLib installer even if you plan to run classic, it contains the newer Appearance ! Mgr which Python needs (according to rumour). ! - There's a new module (package, actually) mkcwproject which builds CodeWarrior ! projects from simple templates. See Distutils or :Mac:scripts:genpluginprojects.py ! for examples of use. ! - The Numerical extension has moved to :Lib:site-python from :Extensions. As Numerical ! is now distutils-based you can easily install newer versions when they become ! available. ! - The Help and ctb modules are not available under Carbon because that functionality is ! not in Carbon. ! - Windows and Dialogs can now be different beasts, so you may have to call ! dlg.GetDialogWindow() where you used to be able to call window methods straight ! on the dialog. This also has consequences for code using FrameWork.DialogWindow. ! THIS IS AN INCOMPATIBLE CHANGE. ! - ctl.GetControlDataHandle() has been renamed to GetControlData_Handle(), and similarly ! for the other variants of GetControlData and SetControlData. This was needed ! because Carbon defines a completely different routine with the name GetControlDataHandle. ! THIS IS AN INCOMPATIBLE CHANGE. ! - Method mac.xstat() has disappeared. THIS IS AN INCOMPATIBLE CHANGE. ! - Menu.SetPopupData() and GetPopupData() are gone. Use SetPopupMenuHandle() and ! SetPopupMenuID() (and the getters) in stead. THIS IS AN INCOMPATIBLE CHANGE. ! - Various methods have disappeared when running under Carbon. The script ! :Mac:scripts:missingcarbonmethods.py can check your sources, but you need unix to run ! it. Or use it as documentation and search by hand. THIS IS AN INCOMPATIBLE CHANGE. ! - The good news is that "direct access to toolbox structs" still works from Python, ! so Python programmers have a lot less to fix than C programmers. ! That's because the lowlevel code simply uses the accessors internally. The accessors ! are available both in Carbon and Classic MacPython. ! - Scrap under Carbon is, you guessed it, the Carbon Scrap Manager. Some workarounds are ! provided, though. THIS IS AN INCOMPATIBLE CHANGE. ! - The Internet Config routines that are missing from Carbon have been removed. This ! is no problem if you use the "ic" module, but may be if you use "icglue" directly. ! THIS IS AN INCOMPATIBLE CHANGE. ! - Various old toolbox names (CountMItems, EnableItem, etc) have disappeared. Use the ! new forms (CountMenuItems, EnableMenuItem, etc). THIS IS AN INCOMPATIBLE CHANGE. ! - Waste now uses Waste 2.0. ! - The default memory size for the interpreter has been upped again. ! - The MacOS error messages have been updated to reflect the current state of ! things. This was long overdue. ! - The crash in BuildApplication has been fixed. ! - struct.pack related problems (in Audio_Mac, for example) have been fixed. ! - (src/dev/cvs only): The project files now use the .mcp extension in stead of .prj. ! Projects for almost all plugins and the img modules are automatically generated ! with :Mac:scripts:genpluginprojects.py (also called by fullbuild). The .mcp files ! are not in the repository, if you don't want to use genpluginprojects you can import ! the .mcp.xml files in CodeWarrior. ! - ConfigurePython has been replace by two applets: ConfigurePythonClassic and ! ConfigurePythonCarbon. These will select either execution model for machines ! supporting both, and it will also build all the standard applets. ! - PythonInterpreterCarbon and PythonInterpreterClassic are now files of type "Atmp", not ! "APPL", so there should not be any confusion as to what the real application is ! (PythonInterpreter). ! - A BBEdit language module by Chris Stern is included in the :Mac:Contrib folder. ! - The ConfigurePython applets will now detect if the preference file refers to a different ! folder than where they live. They offer to remove the preference file in this case. ! - Import case-check was broken in 2.1b1, this is fixed. ! - A side-effect of the previous fix is that getpass works again. ! - BuildApplication was broken under Carbon. Fixed. ! - Morefindertools functionality integrated into findertools. [*] ! - ped.py from Mac:Demo crashed, this has been fixed by making Win.WhichWindow more robust. [*] ! - Tkinter mainloop is now a little less aggressive in eating events. [*] ! - The Python console window is raised to the front when input is read. This fixes a hang ! (for Carbon only) when crashing with a modal dialog open. [*] ! - The menu bar is (again) restored when Python is terminating. [*] What is not in this distribution --- 1,41 ---- ! Changes in 2.1.1 since 2.1 -------------------------- These release notes refer to Mac-specific changes only. See NEWS (in the Misc folder) ! for machine-independent changes. + - Handling non-ascii characters in sys.path on non-MacRoman systems should be fixed, + iff MacPython has a codec for the charset. Otherwise you should get an error, at least. + Pathnames in sys.path also retain their original case again. + - IDE could crash on corrupt preferences. Fixed. + - IDE will now work if you use either pre or sre as re. + - Evt.WaitNextEvent could give an error when bit 15 was set, which could cause a problem + with IDE in classic mode. Fixed. + - MacOS8.X users in classic mode had problems with Fm not loading, which also caused + IDE not working. Fixed. + - Fm.IsAntiAliasedTextEnabled and Fm.SetAntiAliasedTextEnabled have gone for now, to + fix the problem above. + - Disabled the Tkinter file I/O event handler, which was there but didn't work anyway. + - Problems with loading dynamic modules that are part of a package into BuildApplication- + generated programs were fixed. + - The order of the EasyDialogs yes/no/cancel buttons has been conformed to the Mac + standard. + - Handling of Dialogs and Windows that were not created by Python is a bit more graceful + now, which may fix some crashes. + - Ctl.SendControlMessage has gone. But it didn't work anyway. + - Various problems with the TextEdit and Waste demos have been fixed. + - Embedding/extending only: in preparation to allowing the use of MacPython modules in + unix-Python on OSX the xxx_New and xxx_Convert routines are now optionally vectored via + glue routines in macglue.c. The only change that may be needed for embedders/extenders is + that you may want to include pymactoolbox.h in your sources. + - Embedding/extending only: Most MacPython source is now much more Mach-O friendly, and + should work with Universal Headers 3.4. + - Experimental: an Mlte module has been added, an interface to the Multi Lingual Text + Engine. There is a minimal example in :Mac:Demos:mlte. + - Experimental: some support for FSRef objects has been added. You can do little more that + convert them to/from FSSpecs. Carbon only. + - Experimental: the CF module has some support for CoreFoundation types. CFString + and CFURL work, to a degree, and can be converted to/from Python strings and Unicode + objects. Carbon only. What is not in this distribution *************** *** 93,96 **** --- 52,58 ---- http://www.cwi.nl/~jack/macpython.html. + - MacPython 2.1.1 (and MacPython 2.1) will not run correctly on a multiprocessor MacOS X + machine, it will quickly deadlock during I/O operations. The GUSI I/O library is suspected, + hints/clues/workarounds are solicited. - Tkinter does not work under Carbon. - The IDE and Tkinter do not work together. Run tkinter programs under PythonInterpreter. *************** *** 103,104 **** --- 65,68 ---- PythonIDE for interactive work and PythonInterpreter for scripts only. This is especially true under OSX. + - AliasMenu 2.2 conflicts with the Carbon version of Python. This is most likely a problem + with AliasMenu (which is from 1999, and thus predates Carbon altogether). Index: _checkversion.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/_checkversion.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** _checkversion.py 2001/04/25 22:11:19 1.8 --- _checkversion.py 2001/08/03 13:31:34 1.9 *************** *** 6,10 **** _PACKAGE="MacPython" ! _VERSION="2.1" _URL="http://www.cwi.nl/~jack/macpythonversion.txt" --- 6,10 ---- _PACKAGE="MacPython" ! _VERSION="2.1.1" _URL="http://www.cwi.nl/~jack/macpythonversion.txt" From jackjansen@users.sourceforge.net Fri Aug 3 14:31:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/osam OSAm.prj,1.1,1.2 ScriptRunner.c,1.1.1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/osam In directory usw-pr-cvs1:/tmp/cvs-serv5116/Contrib/osam Modified Files: OSAm.prj ScriptRunner.c Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: OSAm.prj =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/osam/OSAm.prj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvstWyra5 and /tmp/cvsEwNBCZ differ Index: ScriptRunner.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/osam/ScriptRunner.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ScriptRunner.c 1998/08/18 14:56:35 1.1.1.1 --- ScriptRunner.c 2001/08/03 13:31:34 1.2 *************** *** 22,26 **** --- 22,45 ---- #include + #ifdef TARGET_API_MAC_CARBON + static + p2cstr(StringPtr p) + { + unsigned char *c = p; + int len = c[0]; + strncpy((char *)c+1, (char *)c, len); + c[len] = 0; + } + static c2pstr(const char *cc) + { + char *c = (char *)cc; /* Ouch */ + int len = strlen(c); + + if ( len > 255 ) len = 255; + strncpy(c, c+1, len); + c[0] = len; + } + #endif OSAError LoadScriptingComponent (ComponentInstance * scriptingComponent); From jackjansen@users.sourceforge.net Fri Aug 3 14:31:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse ICONbrowse.py,1.5,1.6 PICTbrowse.py,1.7,1.8 PICTbrowse2.py,1.7,1.8 oldPICTbrowse.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv5116/Demo/PICTbrowse Modified Files: ICONbrowse.py PICTbrowse.py PICTbrowse2.py oldPICTbrowse.py Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: ICONbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/ICONbrowse.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ICONbrowse.py 2001/01/09 22:22:58 1.5 --- ICONbrowse.py 2001/08/03 13:31:34 1.6 *************** *** 120,126 **** self.id = id FrameWork.DialogWindow.open(self, ID_MAIN) ! self.wid.SetDialogDefaultItem(MAIN_SHOW) self.contents = contents ! self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST) h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart, Controls.kControlListBoxListHandleTag) --- 120,126 ---- self.id = id FrameWork.DialogWindow.open(self, ID_MAIN) ! self.dlg.SetDialogDefaultItem(MAIN_SHOW) self.contents = contents ! self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST) h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart, Controls.kControlListBoxListHandleTag) Index: PICTbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/PICTbrowse.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PICTbrowse.py 2001/01/09 22:22:58 1.7 --- PICTbrowse.py 2001/08/03 13:31:34 1.8 *************** *** 98,104 **** self.id = id FrameWork.DialogWindow.open(self, ID_MAIN) ! self.wid.SetDialogDefaultItem(MAIN_SHOW) self.contents = contents ! self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST) h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart, Controls.kControlListBoxListHandleTag) --- 98,104 ---- self.id = id FrameWork.DialogWindow.open(self, ID_MAIN) ! self.dlg.SetDialogDefaultItem(MAIN_SHOW) self.contents = contents ! self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST) h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart, Controls.kControlListBoxListHandleTag) Index: PICTbrowse2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/PICTbrowse2.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PICTbrowse2.py 2001/01/09 22:22:58 1.7 --- PICTbrowse2.py 2001/08/03 13:31:34 1.8 *************** *** 99,103 **** def fitrect(self): """Return self.pictrect scaled to fit in window""" ! graf = self.wid.GetWindowPort() screenrect = graf.portRect picwidth = self.pictrect[2] - self.pictrect[0] --- 99,103 ---- def fitrect(self): """Return self.pictrect scaled to fit in window""" ! graf = self.dlg.GetWindowPort() screenrect = graf.portRect picwidth = self.pictrect[2] - self.pictrect[0] *************** *** 120,126 **** self.id = id FrameWork.DialogWindow.open(self, ID_MAIN) ! self.wid.SetDialogDefaultItem(MAIN_SHOW) self.contents = contents ! self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST) h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart, Controls.kControlListBoxListHandleTag) --- 120,126 ---- self.id = id FrameWork.DialogWindow.open(self, ID_MAIN) ! self.dlg.SetDialogDefaultItem(MAIN_SHOW) self.contents = contents ! self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST) h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart, Controls.kControlListBoxListHandleTag) Index: oldPICTbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/oldPICTbrowse.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** oldPICTbrowse.py 2001/01/23 14:32:10 1.3 --- oldPICTbrowse.py 2001/08/03 13:31:34 1.4 *************** *** 97,102 **** self.id = id FrameWork.DialogWindow.open(self, ID_MAIN) ! self.wid.SetDialogDefaultItem(MAIN_SHOW) ! tp, h, rect = self.wid.GetDialogItem(MAIN_LIST) rect2 = rect[0]+1, rect[1]+1, rect[2]-17, rect[3]-17 # Scroll bar space self.list = List.LNew(rect2, (0, 0, 1, len(contents)), (0,0), 0, self.wid, --- 97,102 ---- self.id = id FrameWork.DialogWindow.open(self, ID_MAIN) ! self.dlg.SetDialogDefaultItem(MAIN_SHOW) ! tp, h, rect = self.dlg.GetDialogItem(MAIN_LIST) rect2 = rect[0]+1, rect[1]+1, rect[2]-17, rect[3]-17 # Scroll bar space self.list = List.LNew(rect2, (0, 0, 1, len(contents)), (0,0), 0, self.wid, *************** *** 146,150 **** def do_rawupdate(self, window, event): ! tp, h, rect = self.wid.GetDialogItem(MAIN_LIST) Qd.SetPort(self.wid) Qd.FrameRect(rect) --- 146,150 ---- def do_rawupdate(self, window, event): ! tp, h, rect = self.dlg.GetDialogItem(MAIN_LIST) Qd.SetPort(self.wid) Qd.FrameRect(rect) From jackjansen@users.sourceforge.net Fri Aug 3 14:31:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/waste htmled.py,1.8,1.9 swed.py,1.9,1.10 wed.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/waste In directory usw-pr-cvs1:/tmp/cvs-serv5116/Demo/waste Modified Files: htmled.py swed.py wed.py Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: htmled.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/waste/htmled.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** htmled.py 2001/01/29 15:32:00 1.8 --- htmled.py 2001/08/03 13:31:34 1.9 *************** *** 16,20 **** import macfs import MACFS - import regsub import string import htmllib --- 16,19 ---- *************** *** 48,52 **** self.name = name r = windowbounds(400, 400) ! w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w vr = LEFTMARGIN, 0, r[2]-r[0]-15, r[3]-r[1]-15 --- 47,51 ---- self.name = name r = windowbounds(400, 400) ! w = Win.NewWindow(r, name, 1, 0, -1, 1, 0) self.wid = w vr = LEFTMARGIN, 0, r[2]-r[0]-15, r[3]-r[1]-15 *************** *** 446,450 **** def send_literal_data(self, data): ! data = regsub.gsub('\n', '\r', data) data = string.expandtabs(data) self.ted.WEInsert(data, None, None) --- 445,449 ---- def send_literal_data(self, data): ! data = string.replace(data, '\n', '\r') data = string.expandtabs(data) self.ted.WEInsert(data, None, None) *************** *** 776,779 **** --- 775,780 ---- if self.active: self.active.do_idle(event) + else: + Qd.SetCursor(Qd.qd.arrow) def newRuler(self, obj): Index: swed.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/waste/swed.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** swed.py 2001/01/29 15:32:00 1.9 --- swed.py 2001/08/03 13:31:34 1.10 *************** *** 35,39 **** self.name = name r = windowbounds(400, 400) ! w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 --- 35,39 ---- self.name = name r = windowbounds(400, 400) ! w = Win.NewWindow(r, name, 1, 0, -1, 1, 0) self.wid = w vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 *************** *** 604,607 **** --- 604,609 ---- if self.active: self.active.do_idle(event) + else: + Qd.SetCursor(Qd.qd.arrow) def getfontnames(): Index: wed.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/waste/wed.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wed.py 2001/01/23 14:57:41 1.5 --- wed.py 2001/08/03 13:31:34 1.6 *************** *** 26,30 **** self.name = name r = windowbounds(400, 400) ! w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 --- 26,30 ---- self.name = name r = windowbounds(400, 400) ! w = Win.NewWindow(r, name, 1, 0, -1, 1, 0) self.wid = w vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 *************** *** 412,415 **** --- 412,417 ---- if self.active: self.active.do_idle(event) + else: + Qd.SetCursor(Qd.qd.arrow) def main(): From jackjansen@users.sourceforge.net Fri Aug 3 14:31:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:31:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions binary.include,1.16,1.17 dev.include,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions In directory usw-pr-cvs1:/tmp/cvs-serv5116/Distributions Modified Files: binary.include dev.include Log Message: Merging appropriate 2.1.1 fixes back into the main trunk. Index: binary.include =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/binary.include,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** binary.include 2001/03/15 14:40:07 1.16 --- binary.include 2001/08/03 13:31:35 1.17 *************** *** 106,109 **** --- 106,113 ---- (':Mac:Compat:Icon', None) (':Mac:Contrib:AECaptureParser', '') + (':Mac:Contrib:BBPy.lm:BBpy.r', None) + (':Mac:Contrib:BBPy.lm:Python', '') + (':Mac:Contrib:BBPy.lm:Python Keywords.rsrc', None) + (':Mac:Contrib:BBPy.lm:PythonBBLM.txt', '') (':Mac:Contrib:BBPy:PythonSlave.py', '') (':Mac:Contrib:BBPy:README', '') *************** *** 209,214 **** (':setup.py', None) (':site-packages', None) ! (':Mac:Contrib:BBPy.lm:Python', '') ! (':Mac:Contrib:BBPy.lm:PythonBBLM.txt', '') ! (':Mac:Contrib:BBPy.lm:BBpy.r', None) ! (':Mac:Contrib:BBPy.lm:Python Keywords.rsrc', None) --- 213,218 ---- (':setup.py', None) (':site-packages', None) ! (':Extensions:example3:README', None) ! (':Extensions:example2:README', None) ! (':Extensions:example:README', None) ! (':Mac:Contrib:osam:OSAm.carbon.slb', '') Index: dev.include =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/dev.include,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** dev.include 2001/03/27 21:33:53 1.17 --- dev.include 2001/08/03 13:31:35 1.18 *************** *** 117,120 **** --- 117,123 ---- (':Mac:Build:TE.mcp.xml', None) (':Mac:Build:TE.mcp.xml.out', None) + (':Mac:Build:_dummy_tkinter.mcp', None) + (':Mac:Build:_dummy_tkinter.mcp.exp', None) + (':Mac:Build:_dummy_tkinter.old.mcp', None) (':Mac:Build:_symtable.carbon.mcp', None) (':Mac:Build:_symtable.carbon.mcp.exp', None) *************** *** 453,457 **** (':setup.py', None) (':site-packages', None) ! (':Mac:Build:_dummy_tkinter.old.mcp', None) ! (':Mac:Build:_dummy_tkinter.mcp.exp', None) ! (':Mac:Build:_dummy_tkinter.mcp', None) --- 456,470 ---- (':setup.py', None) (':site-packages', None) ! (':Extensions:example', None) ! (':Extensions:example2', None) ! (':Extensions:example3', None) ! (':Mac:Demo:mlte:mlted.py', None) ! (':Mac:Build:Mlte.mcp.xml', None) ! (':Mac:Build:Mlte.mcp.exp', None) ! (':Mac:Build:Mlte.mcp', None) ! (':Mac:Build:Mlte.carbon.mcp.xml', None) ! (':Mac:Build:Mlte.carbon.mcp.exp', None) ! (':Mac:Build:Mlte.carbon.mcp', None) ! (':Mac:Build:CF.carbon.mcp.xml', None) ! (':Mac:Build:CF.carbon.mcp.exp', None) ! (':Mac:Build:CF.carbon.mcp', None) From jackjansen@users.sourceforge.net Fri Aug 3 14:45:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:45:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions 68k-shared.exclude,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions In directory usw-pr-cvs1:/tmp/cvs-serv7595/python/Mac/Distributions Removed Files: 68k-shared.exclude Log Message: Obsolete, removed. --- 68k-shared.exclude DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:45:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:45:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions 68k-shared.include,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions In directory usw-pr-cvs1:/tmp/cvs-serv7618/python/Mac/Distributions Removed Files: 68k-shared.include Log Message: Obsolete, removed. --- 68k-shared.include DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:45:44 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:45:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions 68k-stand.exclude,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions In directory usw-pr-cvs1:/tmp/cvs-serv7638/python/Mac/Distributions Removed Files: 68k-stand.exclude Log Message: Obsolete, removed. --- 68k-stand.exclude DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:45:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:45:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions 68k-stand.include,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions In directory usw-pr-cvs1:/tmp/cvs-serv7651/python/Mac/Distributions Removed Files: 68k-stand.include Log Message: Obsolete, removed. --- 68k-stand.include DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:46:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:46:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions/(vise) Python 2.0.vct,1.5,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory usw-pr-cvs1:/tmp/cvs-serv7725/python/Mac/Distributions/(vise) Removed Files: Python 2.0.vct Log Message: Obsolete, removed. --- Python 2.0.vct DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:48:32 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:48:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting AppleScript_Suite.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8040/python/Mac/Lib/lib-scripting Removed Files: AppleScript_Suite.py Log Message: Obsolete, removed. --- AppleScript_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:48:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:48:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting CodeWarrior_Standard_Suite.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8063/python/Mac/Lib/lib-scripting Removed Files: CodeWarrior_Standard_Suite.py Log Message: Obsolete, removed. --- CodeWarrior_Standard_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:48:41 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:48:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting Finder_7_0_Suite.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8080/python/Mac/Lib/lib-scripting Removed Files: Finder_7_0_Suite.py Log Message: Obsolete, removed. --- Finder_7_0_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:48:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:48:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting Finder_Suite.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8096/python/Mac/Lib/lib-scripting Removed Files: Finder_Suite.py Log Message: Obsolete, removed. --- Finder_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:48:53 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:48:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting Metrowerks_Shell_Suite.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8113/python/Mac/Lib/lib-scripting Removed Files: Metrowerks_Shell_Suite.py Log Message: Obsolete, removed. --- Metrowerks_Shell_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:48:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:48:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting QuickDraw_Graphics_Suite.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8150/python/Mac/Lib/lib-scripting Removed Files: QuickDraw_Graphics_Suite.py Log Message: Obsolete, removed. --- QuickDraw_Graphics_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:49:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:49:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting QuickDraw_Graphics_Supplemental,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8166/python/Mac/Lib/lib-scripting Removed Files: QuickDraw_Graphics_Supplemental Log Message: Obsolete, removed. --- QuickDraw_Graphics_Supplemental DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:49:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:49:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting Required_Suite.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8211/python/Mac/Lib/lib-scripting Removed Files: Required_Suite.py Log Message: Obsolete, removed. --- Required_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:49:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:49:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting Standard_Suite.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8237/python/Mac/Lib/lib-scripting Removed Files: Standard_Suite.py Log Message: Obsolete, removed. --- Standard_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:49:31 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:49:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting Standard_URL_suite.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8334/python/Mac/Lib/lib-scripting Removed Files: Standard_URL_suite.py Log Message: Obsolete, removed. --- Standard_URL_suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:49:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:49:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting Table_Suite.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8349/python/Mac/Lib/lib-scripting Removed Files: Table_Suite.py Log Message: Obsolete, removed. --- Table_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:49:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:49:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting Text_Suite.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8378/python/Mac/Lib/lib-scripting Removed Files: Text_Suite.py Log Message: Obsolete, removed. --- Text_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:49:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:49:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting Type_Names_Suite.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8417/python/Mac/Lib/lib-scripting Removed Files: Type_Names_Suite.py Log Message: Obsolete, removed. --- Type_Names_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:49:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:49:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-scripting WWW_Suite.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-scripting In directory usw-pr-cvs1:/tmp/cvs-serv8445/python/Mac/Lib/lib-scripting Removed Files: WWW_Suite.py Log Message: Obsolete, removed. --- WWW_Suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:53:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:53:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test twedit.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv8953/python/Mac/Lib/test Removed Files: twedit.py Log Message: Obsolete, superseded by :Mac:Demo:waste --- twedit.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:53:52 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:53:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test ttedit.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv9060/python/Mac/Lib/test Removed Files: ttedit.py Log Message: Obsolete, superseded by :Mac:Demo:TE --- ttedit.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:56:14 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:56:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tscrollwin.py,1.3,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv9555/python/Mac/Lib/test Removed Files: tscrollwin.py Log Message: Obsolete, superseded by :Mac:Demo:imgbrowse and friends. --- tscrollwin.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 14:58:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 06:58:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tmenu.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv9949/python/Mac/Lib/test Removed Files: tmenu.py Log Message: Removed: it doesn't work anymore, and it wasn't all that useful anyway. The FrameWork testcode shows similar functionality. --- tmenu.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 15:02:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:02:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tlist_dialog.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv10746/python/Mac/Lib/test Modified Files: tlist_dialog.py Log Message: This "test" showed an obsolete way to get scrolled lists in dialogs. Removed. Index: tlist_dialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/tlist_dialog.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tlist_dialog.py 2000/06/20 21:59:25 1.4 --- tlist_dialog.py 2001/08/03 14:02:03 1.5 *************** *** 29,33 **** # list.LSetDrawingMode(1) ! list.LUpdate(self.wid.GetWindowPort().visRgn) # # Do the (modeless) dialog --- 29,33 ---- # list.LSetDrawingMode(1) ! list.LUpdate(d.GetDialogWindow().GetWindowPort().visRgn) # # Do the (modeless) dialog *************** *** 42,46 **** # XXXX We just always update our list (sigh...) SetPort(window) ! list.LUpdate(self.wid.GetWindowPort().visRgn) if IsDialogEvent(ev): # It is a dialog event. See if it's ours. --- 42,46 ---- # XXXX We just always update our list (sigh...) SetPort(window) ! list.LUpdate(d.GetDialogWindow().GetWindowPort().visRgn) if IsDialogEvent(ev): # It is a dialog event. See if it's ours. From jackjansen@users.sourceforge.net Fri Aug 3 15:02:09 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:02:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tlist_dialog.rsrc,1.4,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv10764/python/Mac/Lib/test Removed Files: tlist_dialog.rsrc Log Message: This "test" showed an obsolete way to get scrolled lists in dialogs. Removed. --- tlist_dialog.rsrc DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 15:05:31 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:05:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tlist_dialog.py,1.5,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11292/python/Mac/Lib/test Removed Files: tlist_dialog.py Log Message: This "test" showed an obsolete way to get scrolled lists in dialogs. Removed. --- tlist_dialog.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 15:06:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:06:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test test_suite.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11425/python/Mac/Lib/test Removed Files: test_suite.py Log Message: Obsolete, uses the old non-package-based applescript suite support. --- test_suite.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 15:07:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:07:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test testfinderopen.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11881/python/Mac/Lib/test Removed Files: testfinderopen.py Log Message: Obsolete: uses old applescript support. --- testfinderopen.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 15:09:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:09:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tdlg.py,1.4,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12270/python/Mac/Lib/test Removed Files: tdlg.py Log Message: Obsolete, EasyDialogs has the same code (but working:-). --- tdlg.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 15:09:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:09:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tdlg_modeless.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12293/python/Mac/Lib/test Removed Files: tdlg_modeless.py Log Message: Obsolete, EasyDialogs has the same code (but working:-). --- tdlg_modeless.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 15:10:24 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:10:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tae.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12468/python/Mac/Lib/test Removed Files: tae.py Log Message: These stopped working a long time ago, and they're not worth fixing. --- tae.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 15:10:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:10:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tctl.py,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12502/python/Mac/Lib/test Removed Files: tctl.py Log Message: These stopped working a long time ago, and they're not worth fixing. --- tctl.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 15:10:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:10:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test progressbar.py,1.3,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12574/python/Mac/Lib/test Removed Files: progressbar.py Log Message: EasyDialogs has a working version of this. --- progressbar.py DELETED --- From jackjansen@users.sourceforge.net Fri Aug 3 15:12:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 07:12:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test icgluetest.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12786/python/Mac/Lib/test Modified Files: icgluetest.py Log Message: ICFindConfigFile isn't needed, and it's gone under carbon. Index: icgluetest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/icgluetest.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** icgluetest.py 1997/01/09 16:26:23 1.2 --- icgluetest.py 2001/08/03 14:12:36 1.3 *************** *** 1,3 **** ! """Test icglue module by printing all preferences""" import icglue --- 1,4 ---- ! """Test icglue module by printing all preferences. Note that the ic module, ! not the icglue module, is what you should normally use.""" import icglue *************** *** 5,9 **** ici = icglue.ICStart('Pyth') ! ici.ICFindConfigFile() h = Res.Resource("") --- 6,10 ---- ici = icglue.ICStart('Pyth') ! #ici.ICFindConfigFile() h = Res.Resource("") From jackjansen@users.sourceforge.net Fri Aug 3 16:32:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 08:32:26 -0700 Subject: [Python-checkins] CVS: python/dist/src configure.in,1.236,1.237 configure,1.228,1.229 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv14103 Modified Files: configure.in configure Log Message: - On OSX add -no-cpp-precomp to OPT. The user still has to manually specify the --with-suffix=.exe, but it seems that that is also true for cygwin (or not? should I automatically set it?) - Got --with-next-framework to build on OSX. This is only the build bit, the install still has to be done manually. Moreover, the Python build order isn't really suited to frameworks (where you want to do 'build lib', 'install lib and framework', 'link executable against installed framework' in that order). Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.236 retrieving revision 1.237 diff -C2 -d -r1.236 -r1.237 *** configure.in 2001/07/26 13:41:05 1.236 --- configure.in 2001/08/03 15:32:23 1.237 *************** *** 249,252 **** --- 249,253 ---- then LDLIBRARY='libpython$(VERSION).dylib' + DLLLIBRARY=$LDLIBRARY fi *************** *** 328,331 **** --- 329,336 ---- esac esac + case $ac_sys_system in + Darwin*) + OPT="$OPT -no-cpp-precomp";; + esac fi *************** *** 676,680 **** Darwin/*) ns_undef_sym='_environ' ! LIBTOOL_CRUFT="-lcc_dynamic -arch_only ppc -U $ns_undef_sym" ;; next/4*) ns_undef_sym='__environ' --- 681,685 ---- Darwin/*) ns_undef_sym='_environ' ! LIBTOOL_CRUFT="-framework Foundation -framework Carbon -lcc_dynamic -arch_only ppc -U $ns_undef_sym" ;; next/4*) ns_undef_sym='__environ' *************** *** 688,692 **** if test "$with_next_framework" then ! OPT="$OPT -fno-common" # -U __environ is needed since bundles don't have access # to crt0 when built but will always be linked against it --- 693,697 ---- if test "$with_next_framework" then ! OPT="$OPT -fno-common -dynamic" # -U __environ is needed since bundles don't have access # to crt0 when built but will always be linked against it Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.228 retrieving revision 1.229 diff -C2 -d -r1.228 -r1.229 *** configure 2001/07/26 13:41:04 1.228 --- configure 2001/08/03 15:32:23 1.229 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.235 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.236 [...4276 lines suppressed...] if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 6998,7002 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7001: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7003,7007 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7006: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then From jackjansen@users.sourceforge.net Fri Aug 3 16:34:31 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 08:34:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/mlte Mltemodule.c,1.4,1.5 mltescan.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/mlte In directory usw-pr-cvs1:/tmp/cvs-serv18176 Modified Files: Mltemodule.c mltescan.py Log Message: TXNTSMCheck isn't available under Mach-O Carbon. Index: Mltemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/mlte/Mltemodule.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Mltemodule.c 2001/07/16 21:58:35 1.4 --- Mltemodule.c 2001/08/03 15:34:29 1.5 *************** *** 20,24 **** #include #else ! #include #endif --- 20,24 ---- #include #else ! #include #endif *************** *** 230,233 **** --- 230,234 ---- } + #if !TARGET_API_MAC_OSX static PyObject *TXNObj_TXNTSMCheck(TXNObjectObject *_self, PyObject *_args) { *************** *** 245,248 **** --- 246,250 ---- return _res; } + #endif static PyObject *TXNObj_TXNSelectAll(TXNObjectObject *_self, PyObject *_args) *************** *** 947,952 **** --- 949,956 ---- {"TXNClick", (PyCFunction)TXNObj_TXNClick, 1, "(EventRecord iEvent) -> None"}, + #if !TARGET_API_MAC_OSX {"TXNTSMCheck", (PyCFunction)TXNObj_TXNTSMCheck, 1, "(EventRecord iEvent) -> (Boolean _rv)"}, + #endif {"TXNSelectAll", (PyCFunction)TXNObj_TXNSelectAll, 1, "() -> None"}, Index: mltescan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/mlte/mltescan.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mltescan.py 2001/07/16 21:58:40 1.4 --- mltescan.py 2001/08/03 15:34:29 1.5 *************** *** 77,81 **** def makegreylist(self): ! return [] def makeblacklisttypes(self): --- 77,85 ---- def makegreylist(self): ! return [ ! ('#if !TARGET_API_MAC_OSX', [ ! 'TXNTSMCheck', ! ])] ! def makeblacklisttypes(self): From jackjansen@users.sourceforge.net Fri Aug 3 16:36:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 08:36:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cf CFmodule.c,1.5,1.6 cfsupport.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cf In directory usw-pr-cvs1:/tmp/cvs-serv18961 Modified Files: CFmodule.c cfsupport.py Log Message: If we use frameworks we should include CoreServices/CoreServices.h, not the old-style CoreFoundation.h. Index: CFmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/CFmodule.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CFmodule.c 2001/07/17 20:46:57 1.5 --- CFmodule.c 2001/08/03 15:36:23 1.6 *************** *** 25,29 **** #include #else ! #include #endif --- 25,29 ---- #include #else ! #include #endif Index: cfsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/cfsupport.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** cfsupport.py 2001/07/17 20:47:13 1.6 --- cfsupport.py 2001/08/03 15:36:23 1.7 *************** *** 51,55 **** #include #else ! #include #endif --- 51,55 ---- #include #else ! #include #endif From jackjansen@users.sourceforge.net Fri Aug 3 16:39:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 08:39:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macfsmodule.c,1.38,1.39 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv20528/Modules Modified Files: macfsmodule.c Log Message: PyMac_GetFSSpec must be called via the dylib glue code on OSX. Index: macfsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macfsmodule.c,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** macfsmodule.c 2001/08/03 13:31:36 1.38 --- macfsmodule.c 2001/08/03 15:39:27 1.39 *************** *** 25,28 **** --- 25,29 ---- #include "Python.h" #include "macglue.h" + #include "pymactoolbox.h" #ifdef WITHOUT_FRAMEWORKS *************** *** 38,43 **** #include "getapplbycreator.h" - static PyObject *ErrorObject; --- 39,47 ---- #include "getapplbycreator.h" + #ifdef USE_TOOLBOX_OBJECT_GLUE + extern int _PyMac_GetFSSpec(PyObject *, FSSpec *); + #define PyMac_GetFSSpec _PyMac_GetFSSpec + #endif static PyObject *ErrorObject; *************** *** 1202,1207 **** --- 1206,1220 ---- return 1; if ( PyString_Check(v) ) { + #if TARGET_API_MAC_OSX + OSStatus err; + if ( (err=FSPathMakeRef(PyString_AsString(v), fsr, NULL)) ) { + PyErr_Mac(ErrorObject, err); + return 0; + } + return 1; + #else PyErr_SetString(PyExc_NotImplementedError, "Cannot create an FSRef from a pathname on this platform"); return 0; + #endif } PyErr_SetString(PyExc_TypeError, "FSRef argument should be existing FSRef, FSSpec or (OSX only) pathname"); *************** *** 1270,1273 **** --- 1283,1288 ---- { PyObject *m, *d; + + PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Handle, PyMac_GetFSSpec); /* Create the module and add the functions */ From jackjansen@users.sourceforge.net Fri Aug 3 16:39:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 08:39:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.98,1.99 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv20528/Python Modified Files: macglue.c Log Message: PyMac_GetFSSpec must be called via the dylib glue code on OSX. Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** macglue.c 2001/08/03 13:31:36 1.98 --- macglue.c 2001/08/03 15:39:27 1.99 *************** *** 1195,1198 **** --- 1195,1199 ---- return (*PyMacGluePtr_##routinename)(pyobj, cobj); \ } + GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "macfs") GLUE_NEW(AppleEvent *, AEDesc_New, "AE") /* XXXX Why by address? */ From jackjansen@users.sourceforge.net Fri Aug 3 16:39:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 03 Aug 2001 08:39:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include pymactoolbox.h,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv20528/Include Modified Files: pymactoolbox.h Log Message: PyMac_GetFSSpec must be called via the dylib glue code on OSX. Index: pymactoolbox.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/pymactoolbox.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pymactoolbox.h 2001/05/22 22:34:56 1.7 --- pymactoolbox.h 2001/08/03 15:39:27 1.8 *************** *** 43,46 **** --- 43,49 ---- #endif /* USE_TOOLBOX_OBJECT_GLUE */ + /* macfs exports */ + extern int PyMac_GetFSSpec(PyObject *, FSSpec *); + /* AE exports */ extern PyObject *AEDesc_New(AppleEvent *); /* XXXX Why passed by address?? */ From fdrake@users.sourceforge.net Fri Aug 3 18:11:35 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 10:11:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/mac libmacos.tex,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory usw-pr-cvs1:/tmp/cvs-serv16777/mac Modified Files: libmacos.tex Log Message: Minor markup nits and slight style-guide conformance changes. Index: libmacos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/libmacos.tex,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** libmacos.tex 2001/08/03 13:19:56 1.16 --- libmacos.tex 2001/08/03 17:11:33 1.17 *************** *** 1,8 **** \section{\module{MacOS} --- ! Access to MacOS interpreter features} \declaremodule{builtin}{MacOS} \platform{Mac} ! \modulesynopsis{Access to MacOS specific interpreter features.} --- 1,8 ---- \section{\module{MacOS} --- ! Access to Mac OS interpreter features} \declaremodule{builtin}{MacOS} \platform{Mac} ! \modulesynopsis{Access to Mac OS-specific interpreter features.} *************** *** 11,21 **** and the like. Use with care. ! Note the capitalisation of the module name, this is a historical artifact. \begin{datadesc}{runtimemodel} ! Either \code{"ppc"}, \code{"carbon"} or \code{"macho"}. This signifies ! whether this Python uses the classic (InterfaceLib style) runtime ! model, the MacOS X compatible CarbonLib style or the MacOS X-only ! Mach-O style. \end{datadesc} --- 11,22 ---- and the like. Use with care. ! Note the capitalization of the module name; this is a historical artifact. + \begin{datadesc}{runtimemodel} ! Either \code{'ppc'}, \code{'carbon'} or \code{'macho'}. This ! signifies whether this Python uses the classic (InterfaceLib style) ! runtime model, the Mac OS X compatible CarbonLib style or the Mac OS ! X-only Mach-O style. \end{datadesc} *************** *** 26,30 **** \cdata{OSErr} value) and a textual description of the error code. Symbolic names for all known error codes are defined in the standard ! module \module{macerrors}\refstmodindex{macerrors}. \end{excdesc} --- 27,31 ---- \cdata{OSErr} value) and a textual description of the error code. Symbolic names for all known error codes are defined in the standard ! module \refmodule{macerrors}.\refstmodindex{macerrors} \end{excdesc} From fdrake@users.sourceforge.net Fri Aug 3 19:36:19 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 11:36:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/doc doc.tex,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory usw-pr-cvs1:/tmp/cvs-serv9689/doc Modified Files: doc.tex Log Message: Define the \mailheader macro and document conventions for using it. Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** doc.tex 2001/07/24 14:38:34 1.48 --- doc.tex 2001/08/03 18:36:17 1.49 *************** *** 835,838 **** --- 835,849 ---- \end{macrodesc} + \begin{macrodesc}{mailheader}{\p{name}} + The name of an \rfc{822}-style mail header. This markup does + not imply that the header is being used in an email message, but + can be used to refer to any header of the same ``style.'' This + is also used for headers defined by the various MIME + specifications. The header name should be entered in the same + way it would normally be found in practice, with the + camel-casing conventions being preferred where there is more + than one common usage. For example: \mailheader{Content-Type}. + \end{macrodesc} + \begin{macrodesc}{mimetype}{\p{name}} The name of a MIME type. From fdrake@users.sourceforge.net Fri Aug 3 19:36:19 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 11:36:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.106,1.107 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory usw-pr-cvs1:/tmp/cvs-serv9689/perl Modified Files: python.perl Log Message: Define the \mailheader macro and document conventions for using it. Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** python.perl 2001/07/17 23:05:57 1.106 --- python.perl 2001/08/03 18:36:17 1.107 *************** *** 213,216 **** --- 213,218 ---- sub do_cmd_email{ return use_wrappers(@_[0], ''); } + sub do_cmd_mailheader{ + return use_wrappers(@_[0], '', ''); } sub do_cmd_mimetype{ return use_wrappers(@_[0], '', ''); } From fdrake@users.sourceforge.net Fri Aug 3 19:36:19 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 11:36:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs python.sty,1.79,1.80 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv9689/texinputs Modified Files: python.sty Log Message: Define the \mailheader macro and document conventions for using it. Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** python.sty 2001/07/17 23:05:57 1.79 --- python.sty 2001/08/03 18:36:17 1.80 *************** *** 834,837 **** --- 834,838 ---- \newcommand{\cdata}[1]{\texttt{#1}} % C variable, typically global + \newcommand{\mailheader}[1]{\texttt{#1}} \newcommand{\mimetype}[1]{{\small\textsf{#1}}} % The \! is a "negative thin space" in math mode. From fdrake@users.sourceforge.net Fri Aug 3 19:39:38 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 11:39:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libmailbox.tex,1.20,1.21 libmimetools.tex,1.19,1.20 libmimetypes.tex,1.6,1.7 librfc822.tex,1.36,1.37 liburllib.tex,1.37,1.38 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv10635/lib Modified Files: libmailbox.tex libmimetools.tex libmimetypes.tex librfc822.tex liburllib.tex Log Message: Apply the new \mailheader macro where appropriate, and fix a few small markup inconsistencies. Index: libmailbox.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmailbox.tex,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** libmailbox.tex 2001/05/21 21:23:01 1.20 --- libmailbox.tex 2001/08/03 18:39:36 1.21 *************** *** 95,100 **** Netscape Mail on \UNIX: Why the Content-Length Format is Bad}{A description of problems with relying on the ! Content-Length header for messages stored in mailbox ! files.} \end{seealso} --- 95,100 ---- Netscape Mail on \UNIX: Why the Content-Length Format is Bad}{A description of problems with relying on the ! \mailheader{Content-Length} header for messages stored in ! mailbox files.} \end{seealso} Index: libmimetools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmimetools.tex,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** libmimetools.tex 2000/10/10 22:00:03 1.19 --- libmimetools.tex 2001/08/03 18:39:36 1.20 *************** *** 69,74 **** \begin{methoddesc}{getplist}{} ! Return the parameter list of the \code{content-type} header. This is ! a list of strings. For parameters of the form \samp{\var{key}=\var{value}}, \var{key} is converted to lower case but \var{value} is not. For example, if the message contains the header --- 69,74 ---- \begin{methoddesc}{getplist}{} ! Return the parameter list of the \mailheader{Content-Type} header. ! This is a list of strings. For parameters of the form \samp{\var{key}=\var{value}}, \var{key} is converted to lower case but \var{value} is not. For example, if the message contains the header *************** *** 86,110 **** \begin{methoddesc}{getencoding}{} ! Return the encoding specified in the \code{content-transfer-encoding} ! message header. If no such header exists, return \code{'7bit'}. The ! encoding is converted to lower case. \end{methoddesc} \begin{methoddesc}{gettype}{} Return the message type (of the form \samp{\var{type}/\var{subtype}}) ! as specified in the \code{content-type} header. If no such header ! exists, return \code{'text/plain'}. The type is converted to lower ! case. \end{methoddesc} \begin{methoddesc}{getmaintype}{} ! Return the main type as specified in the \code{content-type} header. ! If no such header exists, return \code{'text'}. The main type is ! converted to lower case. \end{methoddesc} \begin{methoddesc}{getsubtype}{} ! Return the subtype as specified in the \code{content-type} header. If ! no such header exists, return \code{'plain'}. The subtype is ! converted to lower case. \end{methoddesc} --- 86,111 ---- \begin{methoddesc}{getencoding}{} ! Return the encoding specified in the ! \mailheader{Content-Transfer-Encoding} message header. If no such ! header exists, return \code{'7bit'}. The encoding is converted to ! lower case. \end{methoddesc} \begin{methoddesc}{gettype}{} Return the message type (of the form \samp{\var{type}/\var{subtype}}) ! as specified in the \mailheader{Content-Type} header. If no such ! header exists, return \code{'text/plain'}. The type is converted to ! lower case. \end{methoddesc} \begin{methoddesc}{getmaintype}{} ! Return the main type as specified in the \mailheader{Content-Type} ! header. If no such header exists, return \code{'text'}. The main ! type is converted to lower case. \end{methoddesc} \begin{methoddesc}{getsubtype}{} ! Return the subtype as specified in the \mailheader{Content-Type} ! header. If no such header exists, return \code{'plain'}. The subtype ! is converted to lower case. \end{methoddesc} Index: libmimetypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmimetypes.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** libmimetypes.tex 2000/04/03 20:13:53 1.6 --- libmimetypes.tex 2001/08/03 18:39:36 1.7 *************** *** 21,35 **** \begin{funcdesc}{guess_type}{filename} Guess the type of a file based on its filename or URL, given by ! \var{filename}. ! The return value is a tuple \code{(\var{type}, \var{encoding})} where ! \var{type} is \code{None} if the type can't be guessed (no or unknown ! suffix) or a string of the form \code{'\var{type}/\var{subtype}'}, ! usable for a MIME \code{content-type} header\indexii{MIME}{headers}; and ! encoding is \code{None} for no encoding or the name of the program used ! to encode (e.g. \program{compress} or \program{gzip}). The encoding ! is suitable for use as a \code{content-encoding} header, ! \emph{not} as a \code{content-transfer-encoding} header. The mappings ! are table driven. Encoding suffixes are case sensitive; type suffixes ! are first tried case sensitive, then case insensitive. \end{funcdesc} --- 21,35 ---- \begin{funcdesc}{guess_type}{filename} Guess the type of a file based on its filename or URL, given by ! \var{filename}. The return value is a tuple \code{(\var{type}, ! \var{encoding})} where \var{type} is \code{None} if the type can't be ! guessed (no or unknown suffix) or a string of the form ! \code{'\var{type}/\var{subtype}'}, usable for a MIME ! \mailheader{content-type} header\indexii{MIME}{headers}; and encoding ! is \code{None} for no encoding or the name of the program used to ! encode (e.g. \program{compress} or \program{gzip}). The encoding is ! suitable for use as a \mailheader{Content-Encoding} header, \emph{not} ! as a \mailheader{Content-Transfer-Encoding} header. The mappings are ! table driven. Encoding suffixes are case sensitive; type suffixes are ! first tried case sensitive, then case insensitive. \end{funcdesc} *************** *** 53,58 **** be a sequence of file names which should be used to augment the default type map. If omitted, the file names to use are taken from ! \code{knownfiles}. Each file named in \var{files} or ! \code{knownfiles} takes precedence over those named before it. Calling \function{init()} repeatedly is allowed. \end{funcdesc} --- 53,58 ---- be a sequence of file names which should be used to augment the default type map. If omitted, the file names to use are taken from ! \constant{knownfiles}. Each file named in \var{files} or ! \constant{knownfiles} takes precedence over those named before it. Calling \function{init()} repeatedly is allowed. \end{funcdesc} Index: librfc822.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librfc822.tex,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** librfc822.tex 2001/07/17 05:17:58 1.36 --- librfc822.tex 2001/08/03 18:39:36 1.37 *************** *** 73,88 **** \begin{funcdesc}{parseaddr}{address} ! Parse \var{address}, which should be the value of some address-containing ! field such as \code{To:} or \code{Cc:}, into its constituent ! ``realname'' and ``email address'' parts. Returns a tuple of that ! information, unless the parse fails, in which case a 2-tuple of ! \code{(None, None)} is returned. \end{funcdesc} \begin{funcdesc}{dump_address_pair}{pair} The inverse of \method{parseaddr()}, this takes a 2-tuple of the form ! \code{(realname, email_address)} and returns the string value suitable ! for a \code{To:} or \code{Cc:} header. If the first element of ! \var{pair} is false, then the second element is returned unmodified. \end{funcdesc} --- 73,89 ---- \begin{funcdesc}{parseaddr}{address} ! Parse \var{address}, which should be the value of some ! address-containing field such as \mailheader{To} or \mailheader{Cc}, ! into its constituent ``realname'' and ``email address'' parts. ! Returns a tuple of that information, unless the parse fails, in which ! case a 2-tuple \code{(None, None)} is returned. \end{funcdesc} \begin{funcdesc}{dump_address_pair}{pair} The inverse of \method{parseaddr()}, this takes a 2-tuple of the form ! \code{(\var{realname}, \var{email_address})} and returns the string ! value suitable for a \mailheader{To} or \mailheader{Cc} header. If ! the first element of \var{pair} is false, then the second element is ! returned unmodified. \end{funcdesc} *************** *** 143,149 **** Returns a line's canonicalized fieldname (the dictionary key that will be used to index it) if the line is a legal \rfc{2822} header; otherwise ! returns None (implying that parsing should stop here and the line be ! pushed back on the input stream). It is sometimes useful to override ! this method in a subclass. \end{methoddesc} --- 144,150 ---- Returns a line's canonicalized fieldname (the dictionary key that will be used to index it) if the line is a legal \rfc{2822} header; otherwise ! returns \code{None} (implying that parsing should stop here and the ! line be pushed back on the input stream). It is sometimes useful to ! override this method in a subclass. \end{methoddesc} *************** *** 201,206 **** strings. ! Example: If \var{m}'s first \code{From} header contains the string ! \code{'jack@cwi.nl (Jack Jansen)'}, then \code{m.getaddr('From')} will yield the pair \code{('Jack Jansen', 'jack@cwi.nl')}. --- 202,207 ---- strings. ! Example: If \var{m}'s first \mailheader{From} header contains the ! string \code{'jack@cwi.nl (Jack Jansen)'}, then \code{m.getaddr('From')} will yield the pair \code{('Jack Jansen', 'jack@cwi.nl')}. *************** *** 212,216 **** \begin{methoddesc}{getaddrlist}{name} This is similar to \code{getaddr(\var{list})}, but parses a header ! containing a list of email addresses (e.g.\ a \code{To} header) and returns a list of \code{(\var{full name}, \var{email address})} pairs (even if there was only one address in the header). If there is no --- 213,217 ---- \begin{methoddesc}{getaddrlist}{name} This is similar to \code{getaddr(\var{list})}, but parses a header ! containing a list of email addresses (e.g.\ a \mailheader{To} header) and returns a list of \code{(\var{full name}, \var{email address})} pairs (even if there was only one address in the header). If there is no *************** *** 218,223 **** If multiple headers exist that match the named header (e.g. if there ! are several \code{Cc} headers), all are parsed for addresses. Any ! continuation lines the named headers contain are also parsed. \end{methoddesc} --- 219,224 ---- If multiple headers exist that match the named header (e.g. if there ! are several \mailheader{Cc} headers), all are parsed for addresses. ! Any continuation lines the named headers contain are also parsed. \end{methoddesc} Index: liburllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** liburllib.tex 2001/07/23 19:16:22 1.37 --- liburllib.tex 2001/08/03 18:39:36 1.38 *************** *** 169,174 **** \code{urllib._urlopener} variable before calling the desired function. For example, applications may want to specify a different ! \code{user-agent} header than \class{URLopener} defines. This can be ! accomplished with the following code: \begin{verbatim} --- 169,174 ---- \code{urllib._urlopener} variable before calling the desired function. For example, applications may want to specify a different ! \mailheader{User-Agent} header than \class{URLopener} defines. This ! can be accomplished with the following code: \begin{verbatim} *************** *** 188,194 **** By default, the \class{URLopener} class sends a ! \code{user-agent} header of \samp{urllib/\var{VVV}}, where \var{VVV} is the \module{urllib} version number. Applications can ! define their own \code{user-agent} header by subclassing \class{URLopener} or \class{FancyURLopener} and setting the instance attribute \member{version} to an appropriate string value before the --- 188,194 ---- By default, the \class{URLopener} class sends a ! \mailheader{User-Agent} header of \samp{urllib/\var{VVV}}, where \var{VVV} is the \module{urllib} version number. Applications can ! define their own \mailheader{User-Agent} header by subclassing \class{URLopener} or \class{FancyURLopener} and setting the instance attribute \member{version} to an appropriate string value before the *************** *** 204,208 **** \class{FancyURLopener} subclasses \class{URLopener} providing default handling for the following HTTP response codes: 301, 302 or 401. For ! 301 and 302 response codes, the \code{location} header is used to fetch the actual URL. For 401 response codes (authentication required), basic HTTP authentication is performed. For 301 and 302 response --- 204,208 ---- \class{FancyURLopener} subclasses \class{URLopener} providing default handling for the following HTTP response codes: 301, 302 or 401. For ! 301 and 302 response codes, the \mailheader{Location} header is used to fetch the actual URL. For 401 response codes (authentication required), basic HTTP authentication is performed. For 301 and 302 response *************** *** 258,265 **** HTTP\indexii{HTTP}{protocol} protocol provides type information in the reply header, which can be inspected by looking at the ! \code{content-type} header. For the Gopher\indexii{Gopher}{protocol} ! protocol, type information is encoded in the URL; there is currently ! no easy way to extract it. If the returned data is HTML, you can use ! the module \refmodule{htmllib}\refstmodindex{htmllib} to parse it. \item --- 258,266 ---- HTTP\indexii{HTTP}{protocol} protocol provides type information in the reply header, which can be inspected by looking at the ! \mailheader{Content-Type} header. For the ! Gopher\indexii{Gopher}{protocol} protocol, type information is encoded ! in the URL; there is currently no easy way to extract it. If the ! returned data is HTML, you can use the module ! \refmodule{htmllib}\refstmodindex{htmllib} to parse it. \item From tim_one@users.sourceforge.net Fri Aug 3 20:04:15 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 03 Aug 2001 12:04:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.68,1.69 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv16830 Modified Files: python20.wse Log Message: + Moved IDLE from the "tools" component to the main component. + Ditto pydoc. (IMO, both should have been done long ago -- simply didn't occur to me before) + Build the summary text into a vrbl instead of a temp file. Doh! Less fiddling, and should avoid another class of Win2K permission problems. Bug: the "auto vertical scrollbar" control on the summary page doesn't work (never creates a scrollbar, no matter how much text). So forced a vertical scrollbar there. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** python20.wse 2001/08/03 11:11:35 1.68 --- python20.wse 2001/08/03 19:04:13 1.69 *************** *** 249,253 **** end item: Remark ! Text=A: interpreter, libraries and Tcl/Tk end item: Remark --- 249,253 ---- end item: Remark ! Text=A: interpreter, libraries and IDLE end item: Remark *************** *** 281,298 **** item: End Block end - item: Remark - end - item: Remark - Text=Get a temp file, into which we'll write the summary for the "Start Installation" screen. - end - item: Get Temporary Filename - Variable=TEMPFILE - end - item: Set Variable - Variable=TEMPFILE - Value=%TEMP%\%TEMPFILE% - end - item: Remark - end item: Wizard Block Direction Variable=DIRECTION --- 281,284 ---- *************** *** 763,767 **** Create Flags=01010000000000010000000000000011 Flags=0000000000000110 ! Text=Python interpreter, library and Tcl/Tk Text=Python HTML docs Text=Python utility scripts (Tools/) --- 749,753 ---- Create Flags=01010000000000010000000000000011 Flags=0000000000000110 ! Text=Python interpreter, library and IDLE Text=Python HTML docs Text=Python utility scripts (Tools/) *************** *** 1005,1012 **** item: Editbox Rectangle=86 54 259 175 - Value=%TEMPFILE% Help Context=16711681 Enabled Color=00000000000000001111111111111111 Create Flags=01010000101000000001100010000100 end end --- 991,998 ---- item: Editbox Rectangle=86 54 259 175 Help Context=16711681 Enabled Color=00000000000000001111111111111111 Create Flags=01010000101000000001100010000100 + Text=%SUMMARY% end end *************** *** 1024,1028 **** end item: Remark ! Text= "Start Installation" is next, so write out the choices to a file for "Start Installation" to display. end item: Remark --- 1010,1014 ---- end item: Remark ! Text= "Start Installation" is next, so build a summary for "Start Installation" to display. end item: Remark *************** *** 1042,1059 **** Value=Select Program Manager Group end ! item: Delete File ! Pathname=%TEMPFILE% ! end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text=Installation directory%CRLF% %MAINDIR% ! Line Number=0 end item: Remark end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text=%CRLF%Make backups? ! Line Number=0 end item: If/While Statement --- 1028,1041 ---- Value=Select Program Manager Group end ! item: Set Variable ! Variable=SUMMARY ! Value=Installation directory%CRLF% %MAINDIR%%CRLF% end item: Remark end ! item: Set Variable ! Variable=SUMMARY ! Value=%CRLF%Make backups?%CRLF% ! Flags=00000001 end item: If/While Statement *************** *** 1061,1075 **** Value=A end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text= Yes, into %BACKUP% ! Line Number=0 end item: Else Statement end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text= No ! Line Number=0 end item: End Block --- 1043,1057 ---- Value=A end ! item: Set Variable ! Variable=SUMMARY ! Value= Yes, into %BACKUP%%CRLF% ! Flags=00000001 end item: Else Statement end ! item: Set Variable ! Variable=SUMMARY ! Value= No%CRLF% ! Flags=00000001 end item: End Block *************** *** 1077,1084 **** item: Remark end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text=%CRLF%Components ! Line Number=0 end item: If/While Statement --- 1059,1066 ---- item: Remark end ! item: Set Variable ! Variable=SUMMARY ! Value=%CRLF%Components%CRLF% ! Flags=00000001 end item: If/While Statement *************** *** 1087,1094 **** Flags=00000010 end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text= Python interpreter, libraries, and Tcl/Tk ! Line Number=0 end item: End Block --- 1069,1076 ---- Flags=00000010 end ! item: Set Variable ! Variable=SUMMARY ! Value= Python interpreter, libraries and IDLE%CRLF% ! Flags=00000001 end item: End Block *************** *** 1099,1106 **** Flags=00000010 end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text= Python documentation ! Line Number=0 end item: End Block --- 1081,1088 ---- Flags=00000010 end ! item: Set Variable ! Variable=SUMMARY ! Value= Python documentation%CRLF% ! Flags=00000001 end item: End Block *************** *** 1111,1118 **** Flags=00000010 end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text= Tool and utility scripts ! Line Number=0 end item: End Block --- 1093,1100 ---- Flags=00000010 end ! item: Set Variable ! Variable=SUMMARY ! Value= Tool and utility scripts%CRLF% ! Flags=00000001 end item: End Block *************** *** 1123,1130 **** Flags=00000010 end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text= Python test suite ! Line Number=0 end item: End Block --- 1105,1112 ---- Flags=00000010 end ! item: Set Variable ! Variable=SUMMARY ! Value= Python test suite%CRLF% ! Flags=00000001 end item: End Block *************** *** 1135,1142 **** Flags=00000010 end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text= Register file extensions ! Line Number=0 end item: End Block --- 1117,1124 ---- Flags=00000010 end ! item: Set Variable ! Variable=SUMMARY ! Value= Register file extensions%CRLF% ! Flags=00000001 end item: End Block *************** *** 1144,1151 **** item: Remark end ! item: Insert Line into Text File ! Pathname=%TEMPFILE% ! New Text=%CRLF%Start Menu group%CRLF% %GROUP% ! Line Number=0 end item: End Block --- 1126,1133 ---- item: Remark end ! item: Set Variable ! Variable=SUMMARY ! Value=%CRLF%Start Menu group%CRLF% %GROUP%%CRLF% ! Flags=00000001 end item: End Block *************** *** 1374,1378 **** end item: Remark ! Text=A: interpreter, libraries and Tcl/Tk end item: If/While Statement --- 1356,1360 ---- end item: Remark ! Text=A: interpreter, libraries and IDLE end item: If/While Statement *************** *** 1723,1726 **** --- 1705,1748 ---- end item: Remark + Text=IDLE + end + item: Install File + Source=..\tools\idle\*.py + Destination=%MAINDIR%\Tools\idle + Description=Integrated DeveLopment Environment for Python + Flags=0000000000000010 + end + item: Install File + Source=..\tools\idle\*.txt + Destination=%MAINDIR%\Tools\idle + Description=Integrated DeveLopment Environment for Python + Flags=0000000000000010 + end + item: Install File + Source=..\tools\idle\icons\* + Destination=%MAINDIR%\Tools\idle\Icons + Description=Integrated DeveLopment Environment for Python + Flags=0000000000000010 + end + item: Install File + Source=..\tools\idle\idle.pyw + Destination=%MAINDIR%\Tools\idle\idle.pyw + Description=IDLE bootstrap script + Flags=0000000000000010 + end + item: Remark + end + item: Remark + Text=Windows pydoc driver + end + item: Install File + Source=..\tools\scripts\pydoc.pyw + Destination=%MAINDIR%\Tools\Scripts\pydoc.pyw + Description=Windows pydoc driver + Flags=0000000000000010 + end + item: Remark + end + item: Remark Text=Microsoft C runtime libraries end *************** *** 1822,1851 **** end item: Install File - Source=..\tools\idle\*.py - Destination=%MAINDIR%\Tools\idle - Description=Integrated DeveLopment Environment for Python - Flags=0000000000000010 - end - item: Install File - Source=..\tools\idle\*.txt - Destination=%MAINDIR%\Tools\idle - Description=Integrated DeveLopment Environment for Python - Flags=0000000000000010 - end - item: Install File - Source=..\tools\idle\icons\* - Destination=%MAINDIR%\Tools\idle\Icons - Description=Integrated DeveLopment Environment for Python - Flags=0000000000000010 - end - item: Install File - Source=..\tools\idle\idle.pyw - Destination=%MAINDIR%\Tools\idle\idle.pyw - Description=IDLE bootstrap script - Flags=0000000000000010 - end - item: Remark - end - item: Install File Source=..\tools\compiler\*.py Destination=%MAINDIR%\Tools\compiler --- 1844,1847 ---- *************** *** 2284,2292 **** Flags=00000001 end - item: If/While Statement - Variable=COMPONENTS - Value=C - Flags=00001010 - end item: Create Shortcut Source=%MAINDIR%\pythonw.exe --- 2280,2283 ---- *************** *** 2304,2309 **** Key Type=1536 Flags=00000001 - end - item: End Block end item: End Block --- 2295,2298 ---- From fdrake@users.sourceforge.net Fri Aug 3 20:51:01 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 12:51:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib HTMLParser.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv30083 Modified Files: HTMLParser.py Log Message: Change some comments into docstrings. Fix handling of hexadecimal character references (legal in XHTML) so that they are properly interpreted as character references. This fixes SF bug #445196. Index: HTMLParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/HTMLParser.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HTMLParser.py 2001/05/23 04:53:44 1.3 --- HTMLParser.py 2001/08/03 19:50:59 1.4 *************** *** 1,3 **** ! """A parser for HTML.""" # This file is based on sgmllib.py, but the API is slightly different. --- 1,3 ---- ! """A parser for HTML and XHTML.""" # This file is based on sgmllib.py, but the API is slightly different. *************** *** 19,23 **** entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') ! charref = re.compile('&#([0-9]+)[^0-9]') starttagopen = re.compile('<[a-zA-Z]') --- 19,23 ---- entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') ! charref = re.compile('&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]') starttagopen = re.compile('<[a-zA-Z]') *************** *** 74,103 **** ! # HTML parser class -- find tags and call handler functions. ! # Usage: ! # ! # p = HTMLParser(); p.feed(data); ...; p.close() ! # Start tags are handled by calling self.handle_starttag() or ! # self.handle_startendtag(); end tags by self.handle_endtag(). The ! # data between tags is passed from the parser to the derived class by ! # calling self.handle_data() with the data as argument (the data may ! # be split up in arbitrary chunks). Entity references are passed by ! # calling self.handle_entityref() with the entity reference as the ! # argument. Numeric character references are passed to ! # self.handle_charref() with the string containing the reference as ! # the argument. ! class HTMLParser: CDATA_CONTENT_ELEMENTS = ("script", "style") - # Interface -- initialize and reset this instance def __init__(self): self.reset() - # Interface -- reset this instance. Loses all unprocessed data def reset(self): self.rawdata = '' self.stack = [] --- 74,106 ---- ! class HTMLParser: ! """Find tags and other markup and call handler functions. ! Usage: ! p = HTMLParser() ! p.feed(data) ! ... ! p.close() ! Start tags are handled by calling self.handle_starttag() or ! self.handle_startendtag(); end tags by self.handle_endtag(). The ! data between tags is passed from the parser to the derived class ! by calling self.handle_data() with the data as argument (the data ! may be split up in arbitrary chunks). Entity references are ! passed by calling self.handle_entityref() with the entity ! reference as the argument. Numeric character references are ! passed to self.handle_charref() with the string containing the ! reference as the argument. ! """ CDATA_CONTENT_ELEMENTS = ("script", "style") def __init__(self): + """Initialize and reset this instance.""" self.reset() def reset(self): + """Reset this instance. Loses all unprocessed data.""" self.rawdata = '' self.stack = [] *************** *** 107,120 **** self.interesting = interesting_normal - # Interface -- feed some data to the parser. Call this as - # often as you want, with as little or as much text as you - # want (may include '\n'). (This just saves the text, all the - # processing is done by goahead().) def feed(self, data): self.rawdata = self.rawdata + data self.goahead(0) - # Interface -- handle the remaining data def close(self): self.goahead(1) --- 110,124 ---- self.interesting = interesting_normal def feed(self, data): + """Feed data to the parser. + + Call this as often as you want, with as little or as much text + as you want (may include '\n'). + """ self.rawdata = self.rawdata + data self.goahead(0) def close(self): + """Handle any buffered data.""" self.goahead(1) *************** *** 136,147 **** return j - # Interface -- return current line number and offset. def getpos(self): return self.lineno, self.offset __starttag_text = None - # Interface -- return full source of start tag: "<...>" def get_starttag_text(self): return self.__starttag_text --- 140,151 ---- return j def getpos(self): + """Return current line number and offset.""" return self.lineno, self.offset __starttag_text = None def get_starttag_text(self): + """Return full source of start tag: '<...>'.""" return self.__starttag_text *************** *** 196,200 **** match = charref.match(rawdata, i) if match: ! name = match.group(1) self.handle_charref(name) k = match.end() --- 200,204 ---- match = charref.match(rawdata, i) if match: ! name = match.group()[2:-1] self.handle_charref(name) k = match.end() From fdrake@users.sourceforge.net Fri Aug 3 20:53:03 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 12:53:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_htmlparser.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv30974 Modified Files: test_htmlparser.py Log Message: Fix stupid bug: when migrating these tests from the Zope repository, the names of the test methods were not changed from the Zope-standard "check" names to the Python-standard "test_" names, so the tests were not actually being run. Added test of hexadecimal character references as a regression check for SF bug #445196. Index: test_htmlparser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_htmlparser.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_htmlparser.py 2001/07/16 18:50:29 1.2 --- test_htmlparser.py 2001/08/03 19:53:01 1.3 *************** *** 101,110 **** class HTMLParserTestCase(TestCaseBase): ! def check_processing_instruction_only(self): self._run_check("", [ ("pi", "processing instruction"), ]) ! def check_simple_html(self): self._run_check(""" --- 101,110 ---- class HTMLParserTestCase(TestCaseBase): ! def test_processing_instruction_only(self): self._run_check("", [ ("pi", "processing instruction"), ]) ! def test_simple_html(self): self._run_check(""" *************** *** 115,118 **** --- 115,119 ---- sample text + “ *************** *** 129,132 **** --- 130,135 ---- ("starttag", "img", [("src", "Bar"), ("ismap", None)]), ("data", "sample\ntext\n"), + ("charref", "x201C"), + ("data", "\n"), ("comment", "comment2a-- --comment2b"), ("data", "\n"), *************** *** 135,139 **** ]) ! def check_bad_nesting(self): self._run_check("", [ ("starttag", "a", []), --- 138,145 ---- ]) ! def test_bad_nesting(self): ! # Strangely, this *is* supposed to test that overlapping ! # elements are allowed. HTMLParser is more geared toward ! # lexing the input that parsing the structure. self._run_check("", [ ("starttag", "a", []), *************** *** 143,147 **** ]) ! def check_attr_syntax(self): output = [ ("starttag", "a", [("b", "v"), ("c", "v"), ("d", "v"), ("e", None)]) --- 149,153 ---- ]) ! def test_attr_syntax(self): output = [ ("starttag", "a", [("b", "v"), ("c", "v"), ("d", "v"), ("e", None)]) *************** *** 152,156 **** self._run_check("""""", output) ! def check_attr_values(self): self._run_check("""""", [("starttag", "a", [("b", "xxx\n\txxx"), --- 158,162 ---- self._run_check("""""", output) ! def test_attr_values(self): self._run_check("""""", [("starttag", "a", [("b", "xxx\n\txxx"), *************** *** 162,180 **** ]) ! def check_attr_entity_replacement(self): self._run_check("""""", [ ("starttag", "a", [("b", "&><\"'")]), ]) ! def check_attr_funky_names(self): self._run_check("""""", [ ("starttag", "a", [("a.b", "v"), ("c:d", "v"), ("e-f", "v")]), ]) ! def check_starttag_end_boundary(self): self._run_check("""""", [("starttag", "a", [("b", "<")])]) self._run_check("""""", [("starttag", "a", [("b", ">")])]) ! def check_buffer_artefacts(self): output = [("starttag", "a", [("b", "<")])] self._run_check([""], output) --- 168,186 ---- ]) ! def test_attr_entity_replacement(self): self._run_check("""""", [ ("starttag", "a", [("b", "&><\"'")]), ]) ! def test_attr_funky_names(self): self._run_check("""""", [ ("starttag", "a", [("a.b", "v"), ("c:d", "v"), ("e-f", "v")]), ]) ! def test_starttag_end_boundary(self): self._run_check("""""", [("starttag", "a", [("b", "<")])]) self._run_check("""""", [("starttag", "a", [("b", ">")])]) ! def test_buffer_artefacts(self): output = [("starttag", "a", [("b", "<")])] self._run_check([""], output) *************** *** 193,197 **** self._run_check([""], output) ! def check_starttag_junk_chars(self): self._parse_error("<") self._parse_error("<>") --- 199,203 ---- self._run_check([""], output) ! def test_starttag_junk_chars(self): self._parse_error("<") self._parse_error("<>") *************** *** 213,220 **** self._parse_error("") ! def check_declaration_junk_chars(self): self._parse_error("") ! def check_startendtag(self): self._run_check("

", [ ("startendtag", "p", []), --- 219,226 ---- self._parse_error("") ! def test_declaration_junk_chars(self): self._parse_error("") ! def test_startendtag(self): self._run_check("

", [ ("startendtag", "p", []), *************** *** 230,234 **** ]) ! def check_get_starttag_text(self): s = """""" self._run_check_extra(s, [ --- 236,240 ---- ]) ! def test_get_starttag_text(self): s = """""" self._run_check_extra(s, [ *************** *** 236,240 **** ("starttag_text", s)]) ! def check_cdata_content(self): s = """""" self._run_check(s, [ --- 242,246 ---- ("starttag_text", s)]) ! def test_cdata_content(self): s = """""" self._run_check(s, [ From tim_one@users.sourceforge.net Fri Aug 3 21:40:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 03 Aug 2001 13:40:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_quopri.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv15732/python/dist/src/Lib/test Modified Files: test_quopri.py Log Message: Don't use any characters C doesn't guarantee are safe for text-mode files. This should stop the bizarre translations Jack was getting from Mac CVS. Index: test_quopri.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_quopri.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_quopri.py 2001/07/21 01:41:30 1.3 --- test_quopri.py 2001/08/03 20:40:18 1.4 *************** *** 29,43 **** """\ ! ¡¢£¤¥¦§¨© ! ª«¬­®¯°±²³ ! ´µ¶·¸¹º»¼½¾ ! ¿ÀÁÂÃÄÅÆ ! ÇÈÉÊËÌÍÎÏ ! ÐÑÒÓÔÕÖ× ! ØÙÚÛÜÝÞß ! àáâãäåæç ! èéêëìíîï ! ðñòóôõö÷ ! øùúûüýþÿ characters... have fun! --- 29,43 ---- """\ ! \xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9 ! \xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3 ! \xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe ! \xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6 ! \xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf ! \xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7 ! \xd8\xd9\xda\xdb\xdc\xdd\xde\xdf ! \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7 ! \xe8\xe9\xea\xeb\xec\xed\xee\xef ! \xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7 ! \xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff characters... have fun! *************** *** 69,73 **** ('hello\t', 'hello=09'), # Some long lines. First, a single line of 108 characters ! ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxØÙÚÛÜÝÞßxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', '''xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=D8=D9=DA=DB=DC=DD=DE=DFx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'''), --- 69,73 ---- ('hello\t', 'hello=09'), # Some long lines. First, a single line of 108 characters ! ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', '''xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=D8=D9=DA=DB=DC=DD=DE=DFx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'''), From fdrake@users.sourceforge.net Fri Aug 3 22:01:46 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 14:01:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib mimetypes.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv21371 Modified Files: mimetypes.py Log Message: Refactor so that it is easier to work with alternate MIME types databases, and programmatically extend the database in different ways. This closes the SF bug (feature request) #439710. Index: mimetypes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mimetypes.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mimetypes.py 2001/06/05 05:17:00 1.14 --- mimetypes.py 2001/08/03 21:01:44 1.15 *************** *** 13,17 **** knownfiles -- list of files to parse inited -- flag set when init() has been called ! suffixes_map -- dictionary mapping suffixes to suffixes encodings_map -- dictionary mapping suffixes to encodings types_map -- dictionary mapping suffixes to types --- 13,17 ---- knownfiles -- list of files to parse inited -- flag set when init() has been called ! suffix_map -- dictionary mapping suffixes to suffixes encodings_map -- dictionary mapping suffixes to encodings types_map -- dictionary mapping suffixes to types *************** *** 24,27 **** --- 24,28 ---- """ + import os import posixpath import urllib *************** *** 38,41 **** --- 39,153 ---- inited = 0 + + class MimeTypes: + """MIME-types datastore. + + This datastore can handle information from mime.types-style files + and supports basic determination of MIME type from a filename or + URL, and can guess a reasonable extension given a MIME type. + """ + + def __init__(self, filenames=()): + if not inited: + init() + self.encodings_map = encodings_map.copy() + self.suffix_map = suffix_map.copy() + self.types_map = types_map.copy() + for name in filenames: + self.read(name) + + def guess_type(self, url): + """Guess the type of a file based on its URL. + + Return value is a tuple (type, encoding) where type is None if + the type can't be guessed (no or unknown suffix) or a string + of the form type/subtype, usable for a MIME Content-type + header; and encoding is None for no encoding or the name of + the program used to encode (e.g. compress or gzip). The + mappings are table driven. Encoding suffixes are case + sensitive; type suffixes are first tried case sensitive, then + case insensitive. + + The suffixes .tgz, .taz and .tz (case sensitive!) are all + mapped to '.tar.gz'. (This is table-driven too, using the + dictionary suffix_map.) + """ + scheme, url = urllib.splittype(url) + if scheme == 'data': + # syntax of data URLs: + # dataurl := "data:" [ mediatype ] [ ";base64" ] "," data + # mediatype := [ type "/" subtype ] *( ";" parameter ) + # data := *urlchar + # parameter := attribute "=" value + # type/subtype defaults to "text/plain" + comma = url.find(',') + if comma < 0: + # bad data URL + return None, None + semi = url.find(';', 0, comma) + if semi >= 0: + type = url[:semi] + else: + type = url[:comma] + if '=' in type or '/' not in type: + type = 'text/plain' + return type, None # never compressed, so encoding is None + base, ext = posixpath.splitext(url) + while self.suffix_map.has_key(ext): + base, ext = posixpath.splitext(base + self.suffix_map[ext]) + if self.encodings_map.has_key(ext): + encoding = self.encodings_map[ext] + base, ext = posixpath.splitext(base) + else: + encoding = None + types_map = self.types_map + if types_map.has_key(ext): + return types_map[ext], encoding + elif types_map.has_key(ext.lower()): + return types_map[ext.lower()], encoding + else: + return None, encoding + + def guess_extension(self, type): + """Guess the extension for a file based on its MIME type. + + Return value is a string giving a filename extension, + including the leading dot ('.'). The extension is not + guaranteed to have been associated with any particular data + stream, but would be mapped to the MIME type `type' by + guess_type(). If no extension can be guessed for `type', None + is returned. + """ + type = type.lower() + for ext, stype in self.types_map.items(): + if type == stype: + return ext + return None + + def read(self, filename): + """Read a single mime.types-format file, specified by pathname.""" + fp = open(filename) + self.readfp(fp) + fp.close() + + def readfp(self): + """Read a single mime.types-format file.""" + map = self.types_map + while 1: + line = f.readline() + if not line: + break + words = line.split() + for i in range(len(words)): + if words[i][0] == '#': + del words[i:] + break + if not words: + continue + type, suffixes = words[0], words[1:] + for suff in suffixes: + map['.' + suff] = type + + def guess_type(url): """Guess the type of a file based on its URL. *************** *** 52,93 **** to ".tar.gz". (This is table-driven too, using the dictionary suffix_map). - """ ! if not inited: ! init() ! scheme, url = urllib.splittype(url) ! if scheme == 'data': ! # syntax of data URLs: ! # dataurl := "data:" [ mediatype ] [ ";base64" ] "," data ! # mediatype := [ type "/" subtype ] *( ";" parameter ) ! # data := *urlchar ! # parameter := attribute "=" value ! # type/subtype defaults to "text/plain" ! comma = url.find(',') ! if comma < 0: ! # bad data URL ! return None, None ! semi = url.find(';', 0, comma) ! if semi >= 0: ! type = url[:semi] ! else: ! type = url[:comma] ! if '=' in type or '/' not in type: ! type = 'text/plain' ! return type, None # never compressed, so encoding is None ! base, ext = posixpath.splitext(url) ! while suffix_map.has_key(ext): ! base, ext = posixpath.splitext(base + suffix_map[ext]) ! if encodings_map.has_key(ext): ! encoding = encodings_map[ext] ! base, ext = posixpath.splitext(base) ! else: ! encoding = None ! if types_map.has_key(ext): ! return types_map[ext], encoding ! elif types_map.has_key(ext.lower()): ! return types_map[ext.lower()], encoding ! else: ! return None, encoding def guess_extension(type): --- 164,171 ---- to ".tar.gz". (This is table-driven too, using the dictionary suffix_map). """ ! init() ! return guess_type(url) ! def guess_extension(type): *************** *** 100,120 **** `type', None is returned. """ ! global inited ! if not inited: ! init() ! type = type.lower() ! for ext, stype in types_map.items(): ! if type == stype: ! return ext ! return None def init(files=None): global inited - for file in files or knownfiles: - s = read_mime_types(file) - if s: - for key, value in s.items(): - types_map[key] = value inited = 1 def read_mime_types(file): --- 178,202 ---- `type', None is returned. """ ! init() ! return guess_extension(type) + def init(files=None): + global guess_extension, guess_type + global suffix_map, types_map, encodings_map global inited inited = 1 + db = MimeTypes() + if files is None: + files = knownfiles + for file in files: + if os.path.isfile(file): + db.readfp(open(file)) + encodings_map = db.encodings_map + suffix_map = db.encodings_map + types_map = db.types_map + guess_extension = db.guess_extension + guess_type = db.guess_type + def read_mime_types(file): *************** *** 123,147 **** except IOError: return None ! map = {} ! while 1: ! line = f.readline() ! if not line: break ! words = line.split() ! for i in range(len(words)): ! if words[i][0] == '#': ! del words[i:] ! break ! if not words: continue ! type, suffixes = words[0], words[1:] ! for suff in suffixes: ! map['.'+suff] = type ! f.close() ! return map suffix_map = { '.tgz': '.tar.gz', '.taz': '.tar.gz', '.tz': '.tar.gz', ! } encodings_map = { --- 205,218 ---- except IOError: return None ! db = MimeTypes() ! db.readfp(f) ! return db.types_map + suffix_map = { '.tgz': '.tar.gz', '.taz': '.tar.gz', '.tz': '.tar.gz', ! } encodings_map = { From fdrake@users.sourceforge.net Fri Aug 3 22:03:16 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 14:03:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libmimetypes.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv21733 Modified Files: libmimetypes.tex Log Message: Add documentation for the new aspects of the mimetypes module. This closes the SF bug (feature request) #439710. Index: libmimetypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmimetypes.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** libmimetypes.tex 2001/08/03 18:39:36 1.7 --- libmimetypes.tex 2001/08/03 21:03:14 1.8 *************** *** 14,20 **** encodings are not supported for the later conversion. The functions described below provide the primary interface for this module. If the module has not been initialized, they will call ! \function{init()}. --- 14,25 ---- encodings are not supported for the later conversion. + The module provides one class and a number of convenience functions. + The functions are the normal interface to this module, but some + applications may be interested in the class as well. + The functions described below provide the primary interface for this module. If the module has not been initialized, they will call ! \function{init()} if they rely on the information \function{init()} ! sets up. *************** *** 93,94 **** --- 98,163 ---- Dictionary mapping filename extensions to MIME types. \end{datadesc} + + + The \class{MimeTypes} class may be useful for applications which may + want more than one MIME-type database: + + \begin{classdesc}{MimeTypes}{\optional{filenames}} + This class represents a MIME-types database. By default, it + provides access to the same database as the rest of this module. + The initial database is a copy of that provided by the module, and + may be extended by loading additional \file{mime.types}-style files + into the database using the \method{read()} or \method{readfp()} + methods. The mapping dictionaries may also be cleared before + loading additional data if the default data is not desired. + + The optional \var{filenames} parameter can be used to cause + additional files to be loaded ``on top'' of the default database. + \end{classdesc} + + + \subsection{MimeTypes Objects \label{mimetypes-objects}} + + \class{MimeTypes} instances provide an interface which is very like + that of the \refmodule{mimetypes} module. + + \begin{datadesc}{suffix_map} + Dictionary mapping suffixes to suffixes. This is used to allow + recognition of encoded files for which the encoding and the type are + indicated by the same extension. For example, the \file{.tgz} + extension is mapped to \file{.tar.gz} to allow the encoding and type + to be recognized separately. This is initially a copy of the global + \code{suffix_map} defined in the module. + \end{datadesc} + + \begin{datadesc}{encodings_map} + Dictionary mapping filename extensions to encoding types. This is + initially a copy of the global \code{encodings_map} defined in the + module. + \end{datadesc} + + \begin{datadesc}{types_map} + Dictionary mapping filename extensions to MIME types. This is + initially a copy of the global \code{types_map} defined in the + module. + \end{datadesc} + + \begin{methoddesc}{guess_extension}{type} + Similar to the \function{guess_extension()} function, using the + tables stored as part of the object. + \end{methoddesc} + + \begin{methoddesc}{guess_type}{url} + Similar to the \function{guess_type()} function, using the tables + stored as part of the object. + \end{methoddesc} + + \begin{methoddesc}{read}{path} + Load MIME information from a file named \var{path}. This uses + \method{readfp()} to parse the file. + \end{methoddesc} + + \begin{methoddesc}{readfp}{file} + Load MIME type information from an open file. The file must have + the format of the standard \file{mime.types} files. + \end{methoddesc} From fdrake@users.sourceforge.net Sat Aug 4 01:48:51 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 17:48:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libmimetypes.tex,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv19078/Doc/lib Modified Files: libmimetypes.tex Log Message: Note that the mimetypes.MimeTypes class was added in Python 2.2. Index: libmimetypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmimetypes.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** libmimetypes.tex 2001/08/03 21:03:14 1.8 --- libmimetypes.tex 2001/08/04 00:48:49 1.9 *************** *** 114,117 **** --- 114,119 ---- The optional \var{filenames} parameter can be used to cause additional files to be loaded ``on top'' of the default database. + + \versionadded{2.2} \end{classdesc} From fdrake@users.sourceforge.net Sat Aug 4 02:58:38 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 18:58:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ext run-func.c,NONE,1.1 ext.tex,1.101,1.102 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv4317/ext Modified Files: ext.tex Added Files: run-func.c Log Message: Lots of new text and example code on embedding Python in C, contributed by Albert Hofkamp. Some editing has been done for style and markup consistency. This also supplies an example of importing modules and calling a function defined in the module, so this closes SF bug #440037 as well. (The long example code was moved to a separate file so that it would format properly.) --- NEW FILE: run-func.c --- #include #include int main(int argc, char *argv[]) { PyObject *pName, *pModule, *pDict, *pFunc; PyObject *pArgs, *pValue; int i, result; if (argc < 3) { fprintf(stderr,"Usage: call pythonfile funcname [args]\n"); return 1; } Py_Initialize(); pName = PyString_FromString(argv[1]); /* Error checking of pName left out */ pModule = PyImport_Import(pName); if (pModule != NULL) { pDict = PyModule_GetDict(pModule); /* pDict is a borrowed reference */ pFunc = PyDict_GetItemString(pDict, argv[2]); /* pFun: Borrowed reference */ if (pFunc && PyCallable_Check(pFunc)) { pArgs = PyTuple_New(argc - 3); for (i = 0; i < argc - 3; ++i) { pValue = PyInt_FromLong(atoi(argv[i + 3])); if (!pValue) { fprintf(stderr, "Cannot convert argument\n"); return 1; } /* pValue reference stolen here: */ PyTuple_SetItem(pArgs, i, pValue); } pValue = PyObject_CallObject(pFunc, pArgs); if (pValue != NULL) { printf("Result of call: %ld\n", PyInt_AsLong(pValue)); Py_DECREF(pValue); } else { PyErr_Print(); fprintf(stderr,"Call failed\n"); return 1; } Py_DECREF(pArgs); /* pDict and pFunc are borrowed and must not be Py_DECREF-ed */ } else { PyErr_Print(); fprintf(stderr, "Cannot find function \"%s\"\n", argv[2]); } Py_DECREF(pModule); } else { PyErr_Print(); fprintf(stderr, "Failed to load \"%s\"\n", argv[1]); return 1; } Py_DECREF(pName); Py_Finalize(); return 0; } Index: ext.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/ext.tex,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** ext.tex 2001/07/26 13:41:05 1.101 --- ext.tex 2001/08/04 01:58:36 1.102 *************** *** 2516,2519 **** --- 2516,2530 ---- \label{embedding}} + The previous chapters discussed how to extend Python, that is, how to + extend the functionality of Python by attaching a library of C + functions to it. It is also possible to do it the other way around: + enrich your C/\Cpp{} application by embedding Python in it. Embedding + provides your application with the ability to implement some of the + functionality of your application in Python rather than C or \Cpp. + This can be used for many purposes; one example would be to allow + users to tailor the application to their needs by writing some scripts + in Python. You can also use it yourself if some of the functionality + can be written in Python more easily. + Embedding Python is similar to extending it, but not quite. The difference is that when you extend Python, the main program of the *************** *** 2526,2530 **** program. One of the things this main program has to do is initialize the Python interpreter. At the very least, you have to call the ! function \cfunction{Py_Initialize()} (on MacOS, call \cfunction{PyMac_Initialize()} instead). There are optional calls to pass command line arguments to Python. Then later you can call the --- 2537,2541 ---- program. One of the things this main program has to do is initialize the Python interpreter. At the very least, you have to call the ! function \cfunction{Py_Initialize()} (on Mac OS, call \cfunction{PyMac_Initialize()} instead). There are optional calls to pass command line arguments to Python. Then later you can call the *************** *** 2541,2544 **** --- 2552,2786 ---- A simple demo of embedding Python can be found in the directory \file{Demo/embed/} of the source distribution. + + + \begin{seealso} + \seetitle[../api/api.html]{Python/C API Reference Manual}{The + details of Python's C interface are given in this manual. + A great deal of necessary information can be found here.} + \end{seealso} + + + \section{Very High Level Embedding + \label{high-level-embedding}} + + The simplest form of embedding Python is the use of the very + high level interface. This interface is intended to execute a + Python script without needing to interact with the application + directly. This can for example be used to perform some operation + on a file. + + \begin{verbatim} + #include + + int main() + { + Py_Initialize(); + PyRun_SimpleString("from time import time,ctime\n" + "print 'Today is',ctime(time())\n"); + Py_Finalize(); + return 0; + } + \end{verbatim} + + The above code first initializes the Python interpreter with + \cfunction{Py_Initialize()}, followed by the execution of a hard-coded + Python script that print the date and time. Afterwards, the + \cfunction{Py_Finalize()} call shuts the interpreter down, followed by + the end of the program. In a real program, you may want to get the + Python script from another source, perhaps a text-editor routine, a + file, or a database. Getting the Python code from a file can better + be done by using the \cfunction{PyRun_SimpleFile()} function, which + saves you the trouble of allocating memory space and loading the file + contents. + + + \section{Beyond Very High Level Embedding: An overview + \label{lower-level-embedding}} + + The high level interface gives you the ability to execute + arbitrary pieces of Python code from your application, but + exchanging data values is quite cumbersome to say the least. If + you want that, you should use lower level calls. At the cost of + having to write more C code, you can achieve almost anything. + + It should be noted that extending Python and embedding Python + is quite the same activity, despite the different intent. Most + topics discussed in the previous chapters are still valid. To + show this, consider what the extension code from Python to C + really does: + + \begin{enumerate} + \item Convert data values from Python to C, + \item Perform a function call to a C routine using the + converted values, and + \item Convert the data values from the call from C to Python. + \end{enumerate} + + When embedding Python, the interface code does: + + \begin{enumerate} + \item Convert data values from C to Python, + \item Perform a function call to a Python interface routine + using the converted values, and + \item Convert the data values from the call from Python to C. + \end{enumerate} + + As you can see, the data conversion steps are simply swapped to + accomodate the different direction of the cross-language transfer. + The only difference is the routine that you call between both + data conversions. When extending, you call a C routine, when + embedding, you call a Python routine. + + This chapter will not discuss how to convert data from Python + to C and vice versa. Also, proper use of references and dealing + with errors is assumed to be understood. Since these aspects do not + differ from extending the interpreter, you can refer to earlier + chapters for the required information. + + + \section{Pure Embedding + \label{pure-embedding}} + + The first program aims to execute a function in a Python + script. Like in the section about the very high level interface, + the Python interpreter does not directly interact with the + application (but that will change in th next section). + + The code to run a function defined in a Python script is: + + \verbatiminput{run-func.c} + + This code loads a Python script using \code{argv[1]}, and calls the + function named in \code{argv[2]}. Its integer arguments are the other + values of the \code{argv} array. If you compile and link this + program (let's call the finished executable \program{call}), and use + it to execute a Python script, such as: + + \begin{verbatim} + def multiply(a,b): + print "Thy shall add", a, "times", b + c = 0 + for i in range(0, a): + c = c + b + return c + \end{verbatim} + + then the result should be: + + \begin{verbatim} + $ call multiply 3 2 + Thy shall add 3 times 2 + Result of call: 6 + \end{verbatim} % $ + + Although the program is quite large for its functionality, most of the + code is for data conversion between Python and C, and for error + reporting. The interesting part with respect to embedding Python + starts with + + \begin{verbatim} + Py_Initialize(); + pName = PyString_FromString(argv[1]); + /* Error checking of pName left out */ + pModule = PyImport_Import(pName); + \end{verbatim} + + After initializing the interpreter, the script is loaded using + \cfunction{PyImport_Import()}. This routine needs a Python string + as its argument, which is constructed using the + \cfunction{PyString_FromString()} data conversion routine. + + \begin{verbatim} + pDict = PyModule_GetDict(pModule); + /* pDict is a borrowed reference */ + + pFunc = PyDict_GetItemString(pDict, argv[2]); + /* pFun is a borrowed reference */ + + if (pFunc && PyCallable_Check(pFunc)) { + ... + } + \end{verbatim} + + Once the script is loaded, its dictionary is retrieved with + \cfunction{PyModule_GetDict()}. The dictionary is then searched using + the normal dictionary access routines for the function name. If the + name exists, and the object retunred is callable, you can safely + assume that it is a function. The program then proceeds by + constructing a tuple of arguments as normal. The call to the python + function is then made with: + + \begin{verbatim} + pValue = PyObject_CallObject(pFunc, pArgs); + \end{verbatim} + + Upon return of the function, \code{pValue} is either \NULL{} or it + contains a reference to the return value of the function. Be sure to + release the reference after examining the value. + + + \section{Extending Embedded Python + \label{extending-with-embedding}} + + Until now, the embedded Python interpreter had no access to + functionality from the application itself. The Python API allows this + by extending the embedded interpreter. That is, the embedded + interpreter gets extended with routines provided by the application. + While it sounds complex, it is not so bad. Simply forget for a while + that the application starts the Python interpreter. Instead, consider + the application to be a set of subroutines, and write some glue code + that gives Python access to those routines, just like you would write + a normal Python extension. For example: + + \begin{verbatim} + static int numargs=0; + + /* Return the number of arguments of the application command line */ + static PyObject* + emb_numargs(PyObject *self, PyObject *args) + { + if(!PyArg_ParseTuple(args, ":numargs")) + return NULL; + return Py_BuildValue("i", numargs); + } + + static PyMethodDef EmbMethods[]={ + {"numargs", emb_numargs, METH_VARARGS}, + {NULL, NULL} + }; + \end{verbatim} + + Insert the above code just above the \cfunction{main()} function. + Also, insert the following two statements directly after + \cfunction{Py_Initialize()}: + + \begin{verbatim} + numargs = argc; + Py_InitModule("emb", EmbMethods); + \end{verbatim} + + These two lines initialize the \code{numargs} variable, and make the + \function{emb.numargs()} function accessible to the embedded Python + interpreter. With these extensions, the Python script can do things + like + + \begin{verbatim} + import emb + print "Number of arguments", emb.numargs() + \end{verbatim} + + In a real application, the methods will expose an API of the + application to Python. + + + %\section{For the future} + % + %You don't happen to have a nice library to get textual + %equivalents of numeric values do you :-) ? + %Callbacks here ? (I may be using information from that section + %?!) + %threads + %code examples do not really behave well if errors happen + % (what to watch out for) From fdrake@users.sourceforge.net Sat Aug 4 04:11:27 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 03 Aug 2001 20:11:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python modsupport.c,2.56,2.57 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv18370 Modified Files: modsupport.c Log Message: Plug a memory leak in Py_InitModule4(): when PyDict_SetItemString() failed, the object being inserted was not being DECREFed. This closes SF bug #444486. Index: modsupport.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/modsupport.c,v retrieving revision 2.56 retrieving revision 2.57 diff -C2 -d -r2.56 -r2.57 *** modsupport.c 2001/07/31 13:24:44 2.56 --- modsupport.c 2001/08/04 03:11:25 2.57 *************** *** 61,72 **** if (v == NULL) return NULL; ! if (PyDict_SetItemString(d, ml->ml_name, v) != 0) return NULL; Py_DECREF(v); } if (doc != NULL) { v = PyString_FromString(doc); ! if (v == NULL || PyDict_SetItemString(d, "__doc__", v) != 0) return NULL; Py_DECREF(v); } --- 61,76 ---- if (v == NULL) return NULL; ! if (PyDict_SetItemString(d, ml->ml_name, v) != 0) { ! Py_DECREF(v); return NULL; + } Py_DECREF(v); } if (doc != NULL) { v = PyString_FromString(doc); ! if (v == NULL || PyDict_SetItemString(d, "__doc__", v) != 0) { ! Py_DECREF(v); return NULL; + } Py_DECREF(v); } From tim_one@users.sourceforge.net Sat Aug 4 09:12:38 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 04 Aug 2001 01:12:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python import.c,2.181,2.182 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv379/python/dist/src/Python Modified Files: import.c Log Message: Derived from SF patch #446899 Permit import of .pyw under Windows, from David Bolen. Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.181 retrieving revision 2.182 diff -C2 -d -r2.181 -r2.182 *** import.c 2001/08/02 04:15:00 2.181 --- import.c 2001/08/04 08:12:36 2.182 *************** *** 71,74 **** --- 71,77 ---- static const struct filedescr _PyImport_StandardFiletab[] = { {".py", "r", PY_SOURCE}, + #ifdef MS_WIN32 + {".pyw", "r", PY_SOURCE}, + #endif {".pyc", "rb", PY_COMPILED}, {0, 0} *************** *** 514,524 **** make_compiled_pathname(char *pathname, char *buf, size_t buflen) { ! size_t len; ! ! len = strlen(pathname); if (len+2 > buflen) return NULL; ! strcpy(buf, pathname); ! strcpy(buf+len, Py_OptimizeFlag ? "o" : "c"); return buf; --- 517,533 ---- make_compiled_pathname(char *pathname, char *buf, size_t buflen) { ! size_t len = strlen(pathname); if (len+2 > buflen) return NULL; ! ! #ifdef MS_WIN32 ! /* Treat .pyw as if it were .py. The case of ".pyw" must match ! that used in _PyImport_StandardFiletab. */ ! if (len >= 4 && strcmp(&pathname[len-4], ".pyw") == 0) ! --len; /* pretend 'w' isn't there */ ! #endif ! memcpy(buf, pathname, len); ! buf[len] = Py_OptimizeFlag ? 'o' : 'c'; ! buf[len+1] = '\0'; return buf; From tim_one@users.sourceforge.net Sat Aug 4 09:12:38 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 04 Aug 2001 01:12:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.100,1.101 NEWS,1.200,1.201 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv379/python/dist/src/Misc Modified Files: ACKS NEWS Log Message: Derived from SF patch #446899 Permit import of .pyw under Windows, from David Bolen. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** ACKS 2001/07/31 06:27:44 1.100 --- ACKS 2001/08/04 08:12:36 1.101 *************** *** 43,46 **** --- 43,47 ---- Finn Bock Paul Boddie + David Bolen Jurjen Bos Peter Bosch Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.200 retrieving revision 1.201 diff -C2 -d -r1.200 -r1.201 *** NEWS 2001/08/02 04:15:00 1.200 --- NEWS 2001/08/04 08:12:36 1.201 *************** *** 33,41 **** - Unicode APIs now use name mangling to assure that mixing interpreters ! and extensions using different Unicode widths is rendered next to ! impossible. Trying to import an incompatible Unicode-aware extension will result in an ImportError. Unicode extensions writers must make sure to check the Unicode width compatibility in their extensions by using at least one of the mangled Unicode APIs in the extension. --- 33,46 ---- - Unicode APIs now use name mangling to assure that mixing interpreters ! and extensions using different Unicode widths is rendered next to ! impossible. Trying to import an incompatible Unicode-aware extension will result in an ImportError. Unicode extensions writers must make sure to check the Unicode width compatibility in their extensions by using at least one of the mangled Unicode APIs in the extension. + + Windows + + - "import module" now compiles module.pyw if it exists and nothing else + relevant is found. From tim_one@users.sourceforge.net Sat Aug 4 09:12:38 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 04 Aug 2001 01:12:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_import.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv379/python/dist/src/Lib/test Modified Files: test_import.py Log Message: Derived from SF patch #446899 Permit import of .pyw under Windows, from David Bolen. Index: test_import.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_import.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_import.py 2001/08/01 20:23:18 1.6 --- test_import.py 2001/08/04 08:12:35 1.7 *************** *** 17,64 **** import double_const # don't blink -- that *was* the test ! sys.path.insert(0, os.curdir) ! ! source = TESTFN + ".py" ! pyo = TESTFN + ".pyo" ! if sys.platform.startswith('java'): ! pyc = TESTFN + "$py.class" ! else: ! pyc = TESTFN + ".pyc" ! f = open(source, "w") ! print >> f, "# This will test Python's ability to import a .py file" ! a = random.randrange(1000) ! b = random.randrange(1000) ! print >> f, "a =", a ! print >> f, "b =", b ! f.close() - try: try: ! mod = __import__(TESTFN) ! except ImportError, err: ! raise ValueError, "import from .py failed: %s" % err ! if mod.a != a or mod.b != b: ! print a, "!=", mod.a ! print b, "!=", mod.b ! raise ValueError, "module loaded (%s) but contents invalid" % mod ! finally: ! os.unlink(source) - try: try: ! reload(mod) ! except ImportError, err: ! raise ValueError, "import from .pyc/.pyo failed: %s" % err ! finally: ! try: ! os.unlink(pyc) ! except os.error: ! pass ! try: ! os.unlink(pyo) ! except os.error: ! pass ! del sys.path[0] --- 17,71 ---- import double_const # don't blink -- that *was* the test ! def test_with_extension(ext): # ext normally ".py"; perhaps ".pyw" ! source = TESTFN + ext ! pyo = TESTFN + ".pyo" ! if sys.platform.startswith('java'): ! pyc = TESTFN + "$py.class" ! else: ! pyc = TESTFN + ".pyc" ! f = open(source, "w") ! print >> f, "# This tests Python's ability to import a", ext, "file." ! a = random.randrange(1000) ! b = random.randrange(1000) ! print >> f, "a =", a ! print >> f, "b =", b ! f.close() try: ! try: ! mod = __import__(TESTFN) ! except ImportError, err: ! raise ValueError("import from %s failed: %s" % (ext, err)) ! if mod.a != a or mod.b != b: ! print a, "!=", mod.a ! print b, "!=", mod.b ! raise ValueError("module loaded (%s) but contents invalid" % mod) ! finally: ! os.unlink(source) try: ! try: ! reload(mod) ! except ImportError, err: ! raise ValueError("import from .pyc/.pyo failed: %s" % err) ! finally: ! try: ! os.unlink(pyc) ! except os.error: ! pass ! try: ! os.unlink(pyo) ! except os.error: ! pass ! del sys.modules[TESTFN] ! sys.path.insert(0, os.curdir) ! try: ! test_with_extension(".py") ! if sys.platform.startswith("win"): ! for ext in ".PY", ".Py", ".pY", ".pyw", ".PYW", ".pYw": ! test_with_extension(ext) ! finally: ! del sys.path[0] From gward@users.sourceforge.net Sat Aug 4 23:22:21 2001 From: gward@users.sourceforge.net (Greg Ward) Date: Sat, 04 Aug 2001 15:22:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test___all__.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv25231 Modified Files: test___all__.py Log Message: Hack to workaround bug #445984: attempt to import _socket before starting the test suite proper. If _socket fails to build, that will make this test fail with an ImportError -- handled by the test harness as "no such module _socket" -- instead of an AttributeError deep in CGIHTTPServer. Index: test___all__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test___all__.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test___all__.py 2001/03/01 04:27:19 1.17 --- test___all__.py 2001/08/04 22:22:19 1.18 *************** *** 39,42 **** --- 39,46 ---- verify(keys==all, "%s != %s" % (keys, all)) + # In case _socket fails to build, make this test fail more gracefully + # than an AttributeError somewhere deep in CGIHTTPServer. + import _socket + check_all("BaseHTTPServer") check_all("CGIHTTPServer") From loewis@users.sourceforge.net Sat Aug 4 23:22:47 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 04 Aug 2001 15:22:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libftplib.tex,1.32,1.33 libsocket.tex,1.51,1.52 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv25684 Modified Files: libftplib.tex libsocket.tex Log Message: Document IPv6 changes. Contributed by itojun. Index: libftplib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libftplib.tex,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** libftplib.tex 2001/07/06 19:28:48 1.32 --- libftplib.tex 2001/08/04 22:22:45 1.33 *************** *** 192,198 **** \begin{methoddesc}{transfercmd}{cmd\optional{, rest}} Initiate a transfer over the data connection. If the transfer is ! active, send a \samp{PORT} command and the transfer command specified by \var{cmd}, and accept the connection. If the server is passive, ! send a \samp{PASV} command, connect to it, and start the transfer command. Either way, return the socket for the connection. --- 192,198 ---- \begin{methoddesc}{transfercmd}{cmd\optional{, rest}} Initiate a transfer over the data connection. If the transfer is ! active, send a \samp{EPRT} or \samp{PORT} command and the transfer command specified by \var{cmd}, and accept the connection. If the server is passive, ! send a \samp{EPSV} or \samp{PASV} command, connect to it, and start the transfer command. Either way, return the socket for the connection. Index: libsocket.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsocket.tex,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** libsocket.tex 2001/01/10 19:34:52 1.51 --- libsocket.tex 2001/08/04 22:22:45 1.52 *************** *** 20,23 **** --- 20,25 ---- to the manual pages; for Windows, see the WinSock (or Winsock 2) specification. + For IPv6-ready APIs, readers may want to refer to RFC2553 titled + \cite{Basic Socket Interface Extensions for IPv6}. The Python interface is a straightforward transliteration of the *************** *** 31,48 **** operations. ! Socket addresses are represented as a single string for the ! \constant{AF_UNIX} address family and as a pair ! \code{(\var{host}, \var{port})} for the \constant{AF_INET} address ! family, where \var{host} is a string representing ! either a hostname in Internet domain notation like ! \code{'daring.cwi.nl'} or an IP address like \code{'100.50.200.5'}, ! and \var{port} is an integral port number. Other address families are ! currently not supported. The address format required by a particular ! socket object is automatically selected based on the address family ! specified when the socket object was created. ! For IP addresses, two special forms are accepted instead of a host address: the empty string represents \constant{INADDR_ANY}, and the string \code{''} represents \constant{INADDR_BROADCAST}. All errors raise exceptions. The normal exceptions for invalid --- 33,70 ---- operations. ! Socket addresses are represented as follows: ! A single string is used for the \constant{AF_UNIX} address family. ! A pair \code{(\var{host}, \var{port})} is used for the ! \constant{AF_INET} address family, where \var{host} is a string ! representing either a hostname in Internet domain notation like ! \code{'daring.cwi.nl'} or an IPv4 address like \code{'100.50.200.5'}, ! and \var{port} is an integral port number. ! For \constant{AF_INET6} address family, a four-tuple ! \code{(\var{host}, \var{port}, \var{flowinfo}, \var{scopeid})} is ! used, where \var{flowinfo} and \var{scopeid} represents ! \code{sin6_flowinfo} and \code{sin6_scope_id} member in ! \constant{struct sockaddr_in6} in C. ! For \module{socket} module methods, \var{flowinfo} and \var{scopeid} ! can be omitted just for backward compatibility. Note, however, ! omission of \var{scopeid} can cause problems in manipulating scoped ! IPv6 addresses. Other address families are currently not supported. ! The address format required by a particular socket object is ! automatically selected based on the address family specified when the ! socket object was created. ! For IPv4 addresses, two special forms are accepted instead of a host address: the empty string represents \constant{INADDR_ANY}, and the string \code{''} represents \constant{INADDR_BROADCAST}. + The behavior is not available for IPv6 for backward compatibility, + therefore, you may want to avoid these if you intend to support IPv6 with + your Python programs. + + If you use a hostname in the \var{host} portion of IPv4/v6 socket + address, the program may show a nondeterministic behavior, as Python + uses the first address returned from the DNS resolution. The socket + address will be resolved differently into an actual IPv4/v6 address, + depending on the results from DNS resolution and/or the host + configuration. For deterministic behavior use a numeric address in + \var{host} portion. All errors raise exceptions. The normal exceptions for invalid *************** *** 58,62 **** \begin{excdesc}{error} ! This exception is raised for socket- or address-related errors. The accompanying value is either a string telling what went wrong or a pair \code{(\var{errno}, \var{string})} --- 80,84 ---- \begin{excdesc}{error} ! This exception is raised for socket-related errors. The accompanying value is either a string telling what went wrong or a pair \code{(\var{errno}, \var{string})} *************** *** 67,72 **** --- 89,115 ---- \end{excdesc} + \begin{excdesc}{herror} + This exception is raised for address-related errors, i.e. for + functions that use \var{h_errno} in C API, including + \function{gethostbyname_ex} and \function{gethostbyaddr}. + + The accompanying value is a pair \code{(\var{h_errno}, \var{string})} + representing an error returned by a library call. \var{string} + represents the description of \var{h_errno}, as returned by + \cfunction{hstrerror} C API. + \end{excdesc} + + \begin{excdesc}{gaierror} + This exception is raised for address-related errors, for + \function{getaddrinfo} and \function{getnameinfo}. + The accompanying value is a pair \code{(\var{error}, \var{string})} + representing an error returned by a library call. + \var{string} represents the description of \var{error}, as returned + by \cfunction{gai_strerror} C API. + \end{excdesc} + \begin{datadesc}{AF_UNIX} \dataline{AF_INET} + \dataline{AF_INET6} These constants represent the address (and protocol) families, used for the first argument to \function{socket()}. If the *************** *** 94,97 **** --- 137,144 ---- \dataline{INADDR_*} \dataline{IP_*} + \dataline{IPV6_*} + \dataline{EAI_*} + \dataline{AI_*} + \dataline{NI_*} Many constants of these forms, documented in the \UNIX{} documentation on sockets and/or the IP protocol, are also defined in the socket module. *************** *** 102,105 **** --- 149,180 ---- \end{datadesc} + \begin{funcdesc}{getaddrinfo}{host, port\optional{, family, socktype, proto, flags}} + + Resolves the \var{host}/\var{port} argument, into a sequence of + 5-tuples that contain all the necessary argument for the sockets + manipulation. \var{host} is a domain name, a string representation of + IPv4/v6 address or \code{None}. + \var{port} is a string service name (like \code{``http''}), a numeric + port number or \code{None}. + + The rest of the arguments are optional and must be numeric if + specified. For \var{host} and \var{port}, by passing either an empty + string or \code{None}, you can pass \code{NULL} to the C API. The + \function{getaddrinfo()} function returns a list of 5-tuples with + the following structure: + + \code{(\var{family}, \var{socktype}, \var{proto}, \var{canonname}, \var{sockaddr})}. + + \var{family}, \var{socktype}, \var{proto} are all integer and are meant to + be passed to the \function{socket()} function. + \var{canonname} is a string representing the canonical name of the \var{host}. + It can be a numeric IPv4/v6 address when \code{AI_CANONNAME} is specified + for a numeric \var{host}. + \var{sockaddr} is a tuple describing a socket address, as described above. + See \code{Lib/httplib.py} and other library files + for a typical usage of the function. + \versionadded{2.2} + \end{funcdesc} + \begin{funcdesc}{getfqdn}{\optional{name}} Return a fully qualified domain name for \var{name}. *************** *** 114,137 **** \begin{funcdesc}{gethostbyname}{hostname} ! Translate a host name to IP address format. The IP address is returned as a string, e.g., \code{'100.50.200.5'}. If the host name ! is an IP address itself it is returned unchanged. See \function{gethostbyname_ex()} for a more complete interface. \end{funcdesc} \begin{funcdesc}{gethostbyname_ex}{hostname} ! Translate a host name to IP address format, extended interface. Return a triple \code{(hostname, aliaslist, ipaddrlist)} where \code{hostname} is the primary host name responding to the given \var{ip_address}, \code{aliaslist} is a (possibly empty) list of alternative host names for the same address, and \code{ipaddrlist} is ! a list of IP addresses for the same interface on the same host (often but not always a single address). \end{funcdesc} \begin{funcdesc}{gethostname}{} Return a string containing the hostname of the machine where ! the Python interpreter is currently executing. If you want to know the ! current machine's IP address, use \code{gethostbyname(gethostname())}. Note: \function{gethostname()} doesn't always return the fully qualified domain name; use \code{gethostbyaddr(gethostname())} --- 189,219 ---- \begin{funcdesc}{gethostbyname}{hostname} ! Translate a host name to IPv4 address format. The IPv4 address is returned as a string, e.g., \code{'100.50.200.5'}. If the host name ! is an IPv4 address itself it is returned unchanged. See \function{gethostbyname_ex()} for a more complete interface. + \function{gethostbyname()} does not support IPv6 name resolution, and + \function{getaddrinfo()} should be used instead for IPv4/v6 dual stack support. \end{funcdesc} \begin{funcdesc}{gethostbyname_ex}{hostname} ! Translate a host name to IPv4 address format, extended interface. Return a triple \code{(hostname, aliaslist, ipaddrlist)} where \code{hostname} is the primary host name responding to the given \var{ip_address}, \code{aliaslist} is a (possibly empty) list of alternative host names for the same address, and \code{ipaddrlist} is ! a list of IPv4 addresses for the same interface on the same host (often but not always a single address). + \function{gethostbyname_ex()} does not support IPv6 name resolution, and + \function{getaddrinfo()} should be used instead for IPv4/v6 dual stack support. \end{funcdesc} \begin{funcdesc}{gethostname}{} Return a string containing the hostname of the machine where ! the Python interpreter is currently executing. ! If you want to know the current machine's IP address, you may want to use ! \code{gethostbyname(gethostname())}. ! This operation assumes that there is a valid address-to-host mapping for ! the host, and the assumption does not always hold. Note: \function{gethostname()} doesn't always return the fully qualified domain name; use \code{gethostbyaddr(gethostname())} *************** *** 144,153 **** responding to the given \var{ip_address}, \var{aliaslist} is a (possibly empty) list of alternative host names for the same address, ! and \var{ipaddrlist} is a list of IP addresses for the same interface on the same host (most likely containing only a single address). To find the fully qualified domain name, use the function \function{getfqdn()}. \end{funcdesc} \begin{funcdesc}{getprotobyname}{protocolname} Translate an Internet protocol name (e.g.\ \code{'icmp'}) to a constant --- 226,246 ---- responding to the given \var{ip_address}, \var{aliaslist} is a (possibly empty) list of alternative host names for the same address, ! and \var{ipaddrlist} is a list of IPv4/v6 addresses for the same interface on the same host (most likely containing only a single address). To find the fully qualified domain name, use the function \function{getfqdn()}. + \function{gethostbyaddr} supports both IPv4 and IPv6. \end{funcdesc} + \begin{funcdesc}{getnameinfo}{sockaddr, flags} + Translate a socket address \var{sockaddr} into a 2-tuple + \code{(\var{host}, \var{port})}. + Depending on the settings of \var{flags}, the result can contain a + fully-qualified domain name or numeric address representation in + \var{host}. Similarly, \var{port} can contain a string port name or a + numeric port number. + \versionadded{2.2} + \end{funcdesc} + \begin{funcdesc}{getprotobyname}{protocolname} Translate an Internet protocol name (e.g.\ \code{'icmp'}) to a constant *************** *** 167,171 **** \begin{funcdesc}{socket}{family, type\optional{, proto}} Create a new socket using the given address family, socket type and ! protocol number. The address family should be \constant{AF_INET} or \constant{AF_UNIX}. The socket type should be \constant{SOCK_STREAM}, \constant{SOCK_DGRAM} or perhaps one of the other \samp{SOCK_} constants. --- 260,264 ---- \begin{funcdesc}{socket}{family, type\optional{, proto}} Create a new socket using the given address family, socket type and ! protocol number. The address family should be \constant{AF_INET}, \constant{AF_INET6} or \constant{AF_UNIX}. The socket type should be \constant{SOCK_STREAM}, \constant{SOCK_DGRAM} or perhaps one of the other \samp{SOCK_} constants. *************** *** 210,214 **** \begin{funcdesc}{inet_aton}{ip_string} ! Convert an IP address from dotted-quad string format (e.g.\ '123.45.67.89') to 32-bit packed binary format, as a string four characters in length. --- 303,307 ---- \begin{funcdesc}{inet_aton}{ip_string} ! Convert an IPv4 address from dotted-quad string format (e.g.\ '123.45.67.89') to 32-bit packed binary format, as a string four characters in length. *************** *** 218,229 **** for the 32-bit packed binary this function returns. ! If the IP address string passed to this function is invalid, \exception{socket.error} will be raised. Note that exactly what is valid depends on the underlying C implementation of \cfunction{inet_aton()}. \end{funcdesc} \begin{funcdesc}{inet_ntoa}{packed_ip} ! Convert a 32-bit packed IP address (a string four characters in length) to its standard dotted-quad string representation (e.g. '123.45.67.89'). --- 311,325 ---- for the 32-bit packed binary this function returns. ! If the IPv4 address string passed to this function is invalid, \exception{socket.error} will be raised. Note that exactly what is valid depends on the underlying C implementation of \cfunction{inet_aton()}. + + \function{inet_aton} does not support IPv6, and + \function{getnameinfo()} should be used instead for IPv4/v6 dual stack support. \end{funcdesc} \begin{funcdesc}{inet_ntoa}{packed_ip} ! Convert a 32-bit packed IPv4 address (a string four characters in length) to its standard dotted-quad string representation (e.g. '123.45.67.89'). *************** *** 235,238 **** --- 331,337 ---- If the string passed to this function is not exactly 4 bytes in length, \exception{socket.error} will be raised. + + \function{inet_ntoa} does not support IPv6, and + \function{getnameinfo()} should be used instead for IPv4/v6 dual stack support. \end{funcdesc} *************** *** 307,311 **** \begin{methoddesc}[socket]{getpeername}{} Return the remote address to which the socket is connected. This is ! useful to find out the port number of a remote IP socket, for instance. (The format of the address returned depends on the address family --- see above.) On some systems this function is not supported. --- 406,410 ---- \begin{methoddesc}[socket]{getpeername}{} Return the remote address to which the socket is connected. This is ! useful to find out the port number of a remote IPv4/v6 socket, for instance. (The format of the address returned depends on the address family --- see above.) On some systems this function is not supported. *************** *** 314,318 **** \begin{methoddesc}[socket]{getsockname}{} Return the socket's own address. This is useful to find out the port ! number of an IP socket, for instance. (The format of the address returned depends on the address family --- see above.) --- 413,417 ---- \begin{methoddesc}[socket]{getsockname}{} Return the socket's own address. This is useful to find out the port ! number of an IPv4/v6 socket, for instance. (The format of the address returned depends on the address family --- see above.) *************** *** 414,418 **** \subsection{Example \label{socket-example}} ! Here are two minimal example programs using the TCP/IP protocol:\ a server that echoes all data that it receives back (servicing only one client), and a client using it. Note that a server must perform the --- 513,517 ---- \subsection{Example \label{socket-example}} ! Here are four minimal example programs using the TCP/IP protocol:\ a server that echoes all data that it receives back (servicing only one client), and a client using it. Note that a server must perform the *************** *** 425,428 **** --- 524,529 ---- \method{accept()}. + The first two examples support IPv4 only. + \begin{verbatim} # Echo server program *************** *** 451,454 **** --- 552,631 ---- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) + s.send('Hello, world') + data = s.recv(1024) + s.close() + print 'Received', `data` + \end{verbatim} + + The next two examples are identical to the above two, but support both + IPv4 and IPv6. + The server side will listen to the first address family available + (it should listen to both instead). + On most of IPv6-ready systems, IPv6 will take precedence + and the server may not accept IPv4 traffic. + The client side will try to connect to the all addresses returned as a result + of the name resolution, and sends traffic to the first one connected + successfully. + + \begin{verbatim} + # Echo server program + import socket + import sys + + HOST = '' # Symbolic name meaning the local host + PORT = 50007 # Arbitrary non-privileged port + s = None + for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE): + af, socktype, proto, canonname, sa = res + try: + s = socket.socket(af, socktype, proto) + except socket.error, msg: + s = None + continue + try: + s.bind(sa) + s.listen(1) + except socket.error, msg: + s.close() + s = None + continue + break + if s is None: + print 'could not open socket' + sys.exit(1) + conn, addr = s.accept() + print 'Connected by', addr + while 1: + data = conn.recv(1024) + if not data: break + conn.send(data) + conn.close() + \end{verbatim} + + \begin{verbatim} + # Echo client program + import socket + import sys + + HOST = 'daring.cwi.nl' # The remote host + PORT = 50007 # The same port as used by the server + s = None + for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM): + af, socktype, proto, canonname, sa = res + try: + s = socket.socket(af, socktype, proto) + except socket.error, msg: + s = None + continue + try: + s.connect(sa) + except socket.error, msg: + s.close() + s = None + continue + break + if s is None: + print 'could not open socket' + sys.exit(1) s.send('Hello, world') data = s.recv(1024) From loewis@users.sourceforge.net Sat Aug 4 23:32:05 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 04 Aug 2001 15:32:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.160,1.161 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv26827/Modules Modified Files: socketmodule.c Log Message: Auto-detect hstrerror. Raise socket.herror in PyH_Error. Register the three exception classes in the module dictionary. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** socketmodule.c 2001/08/03 10:02:29 1.160 --- socketmodule.c 2001/08/04 22:32:03 1.161 *************** *** 432,436 **** #endif if (v != NULL) { ! PyErr_SetObject(PyGAI_Error, v); Py_DECREF(v); } --- 432,436 ---- #endif if (v != NULL) { ! PyErr_SetObject(PyH_Error, v); Py_DECREF(v); } *************** *** 2916,2926 **** --- 2916,2929 ---- if (PySocket_Error == NULL) return; + PyDict_SetItemString(d, "error", PySocket_Error); PyH_Error = PyErr_NewException("socket.herror", PySocket_Error, NULL); if (PyH_Error == NULL) return; + PyDict_SetItemString(d, "herror", PyH_Error); PyGAI_Error = PyErr_NewException("socket.gaierror", PySocket_Error, NULL); if (PyGAI_Error == NULL) return; + PyDict_SetItemString(d, "gaierror", PyGAI_Error); #ifdef USE_SSL SSL_load_error_strings(); *************** *** 2935,2939 **** return; #endif /* USE_SSL */ - PyDict_SetItemString(d, "error", PySocket_Error); PySocketSock_Type.ob_type = &PyType_Type; PySocketSock_Type.tp_doc = sockettype_doc; --- 2938,2941 ---- From loewis@users.sourceforge.net Sat Aug 4 23:32:05 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 04 Aug 2001 15:32:05 -0700 Subject: [Python-checkins] CVS: python/dist/src configure,1.229,1.230 configure.in,1.237,1.238 pyconfig.h.in,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv26827 Modified Files: configure configure.in pyconfig.h.in Log Message: Auto-detect hstrerror. Raise socket.herror in PyH_Error. Register the three exception classes in the module dictionary. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.229 retrieving revision 1.230 diff -C2 -d -r1.229 -r1.230 *** configure 2001/08/03 15:32:23 1.229 --- configure 2001/08/04 22:32:02 1.230 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.236 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.237 # Guess values for system-dependent variables and create Makefiles. *************** *** 4519,4523 **** flock fork fsync fdatasync fpathconf ftime ftruncate \ getgroups getlogin getpeername getpid getpwent getwd \ ! inet_pton kill link lstat mkfifo mktime mremap \ nice pathconf pause plock poll pthread_init \ putenv readlink \ --- 4519,4523 ---- flock fork fsync fdatasync fpathconf ftime ftruncate \ getgroups getlogin getpeername getpid getpwent getwd \ ! hstrerror inet_pton kill link lstat mkfifo mktime mremap \ nice pathconf pause plock poll pthread_init \ putenv readlink \ Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.237 retrieving revision 1.238 diff -C2 -d -r1.237 -r1.238 *** configure.in 2001/08/03 15:32:23 1.237 --- configure.in 2001/08/04 22:32:03 1.238 *************** *** 1179,1183 **** flock fork fsync fdatasync fpathconf ftime ftruncate \ getgroups getlogin getpeername getpid getpwent getwd \ ! inet_pton kill link lstat mkfifo mktime mremap \ nice pathconf pause plock poll pthread_init \ putenv readlink \ --- 1179,1183 ---- flock fork fsync fdatasync fpathconf ftime ftruncate \ getgroups getlogin getpeername getpid getpwent getwd \ ! hstrerror inet_pton kill link lstat mkfifo mktime mremap \ nice pathconf pause plock poll pthread_init \ putenv readlink \ Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pyconfig.h.in 2001/07/26 13:41:05 1.1 --- pyconfig.h.in 2001/08/04 22:32:03 1.2 *************** *** 411,414 **** --- 411,417 ---- #undef HAVE_GETWD + /* Define if you have the hstrerror function. */ + #undef HAVE_HSTRERROR + /* Define if you have the hypot function. */ #undef HAVE_HYPOT From loewis@users.sourceforge.net Sat Aug 4 23:37:26 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 04 Aug 2001 15:37:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.161,1.162 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv27483 Modified Files: socketmodule.c Log Message: Add more constants. Contributed by itojun. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.161 retrieving revision 1.162 diff -C2 -d -r1.161 -r1.162 *** socketmodule.c 2001/08/04 22:32:03 1.161 --- socketmodule.c 2001/08/04 22:37:23 1.162 *************** *** 2434,2437 **** --- 2434,2438 ---- memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; /* make numeric port happy */ error = getaddrinfo(hostp, pbuf, &hints, &res); if (error) { *************** *** 3138,3141 **** --- 3139,3145 ---- insint(d, "IPPROTO_IP", 0); #endif + #ifdef IPPROTO_HOPOPTS + insint(d, "IPPROTO_HOPOPTS", IPPROTO_HOPOPTS); + #endif #ifdef IPPROTO_ICMP insint(d, "IPPROTO_ICMP", IPPROTO_ICMP); *************** *** 3149,3152 **** --- 3153,3162 ---- insint(d, "IPPROTO_GGP", IPPROTO_GGP); #endif + #ifdef IPPROTO_IPV4 + insint(d, "IPPROTO_IPV4", IPPROTO_IPV4); + #endif + #ifdef IPPROTO_IPIP + insint(d, "IPPROTO_IPIP", IPPROTO_IPIP); + #endif #ifdef IPPROTO_TCP insint(d, "IPPROTO_TCP", IPPROTO_TCP); *************** *** 3177,3180 **** --- 3187,3223 ---- insint(d, "IPPROTO_TP", IPPROTO_TP); #endif + #ifdef IPPROTO_IPV6 + insint(d, "IPPROTO_IPV6", IPPROTO_IPV6); + #endif + #ifdef IPPROTO_ROUTING + insint(d, "IPPROTO_ROUTING", IPPROTO_ROUTING); + #endif + #ifdef IPPROTO_FRAGMENT + insint(d, "IPPROTO_FRAGMENT", IPPROTO_FRAGMENT); + #endif + #ifdef IPPROTO_RSVP + insint(d, "IPPROTO_RSVP", IPPROTO_RSVP); + #endif + #ifdef IPPROTO_GRE + insint(d, "IPPROTO_GRE", IPPROTO_GRE); + #endif + #ifdef IPPROTO_ESP + insint(d, "IPPROTO_ESP", IPPROTO_ESP); + #endif + #ifdef IPPROTO_AH + insint(d, "IPPROTO_AH", IPPROTO_AH); + #endif + #ifdef IPPROTO_MOBILE + insint(d, "IPPROTO_MOBILE", IPPROTO_MOBILE); + #endif + #ifdef IPPROTO_ICMPV6 + insint(d, "IPPROTO_ICMPV6", IPPROTO_ICMPV6); + #endif + #ifdef IPPROTO_NONE + insint(d, "IPPROTO_NONE", IPPROTO_NONE); + #endif + #ifdef IPPROTO_DSTOPTS + insint(d, "IPPROTO_DSTOPTS", IPPROTO_DSTOPTS); + #endif #ifdef IPPROTO_XTP insint(d, "IPPROTO_XTP", IPPROTO_XTP); *************** *** 3183,3186 **** --- 3226,3238 ---- insint(d, "IPPROTO_EON", IPPROTO_EON); #endif + #ifdef IPPROTO_PIM + insint(d, "IPPROTO_PIM", IPPROTO_PIM); + #endif + #ifdef IPPROTO_IPCOMP + insint(d, "IPPROTO_IPCOMP", IPPROTO_IPCOMP); + #endif + #ifdef IPPROTO_VRRP + insint(d, "IPPROTO_VRRP", IPPROTO_VRRP); + #endif #ifdef IPPROTO_BIP insint(d, "IPPROTO_BIP", IPPROTO_BIP); *************** *** 3245,3249 **** #endif ! /* IP [gs]etsockopt options */ #ifdef IP_OPTIONS insint(d, "IP_OPTIONS", IP_OPTIONS); --- 3297,3301 ---- #endif ! /* IPv4 [gs]etsockopt options */ #ifdef IP_OPTIONS insint(d, "IP_OPTIONS", IP_OPTIONS); *************** *** 3293,3296 **** --- 3345,3368 ---- #ifdef IP_MAX_MEMBERSHIPS insint(d, "IP_MAX_MEMBERSHIPS", IP_MAX_MEMBERSHIPS); + #endif + + /* IPv6 [gs]etsockopt options, defined in RFC2553 */ + #ifdef IPV6_JOIN_GROUP + insint(d, "IPV6_JOIN_GROUP", IPV6_JOIN_GROUP); + #endif + #ifdef IPV6_LEAVE_GROUP + insint(d, "IPV6_LEAVE_GROUP", IPV6_LEAVE_GROUP); + #endif + #ifdef IPV6_MULTICAST_HOPS + insint(d, "IPV6_MULTICAST_HOPS", IPV6_MULTICAST_HOPS); + #endif + #ifdef IPV6_MULTICAST_IF + insint(d, "IPV6_MULTICAST_IF", IPV6_MULTICAST_IF); + #endif + #ifdef IPV6_MULTICAST_LOOP + insint(d, "IPV6_MULTICAST_LOOP", IPV6_MULTICAST_LOOP); + #endif + #ifdef IPV6_UNICAST_HOPS + insint(d, "IPV6_UNICAST_HOPS", IPV6_UNICAST_HOPS); #endif From tim_one@users.sourceforge.net Sun Aug 5 00:23:29 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 04 Aug 2001 16:23:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.69,1.70 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv32574 Modified Files: python20.wse Log Message: + Add version info to Win2K add/remove. + Fiddle vrbls so Win2K add/remove can display version w/o future manual script fiddling. + Break apart the mysterious wizard-generated Win2K "Edit 3 Registry Keys" script items by hand into 3 separate items, so you can see what the heck they're doing in the script view. + pydoc.pyw was a problem: it's installed by both the Main and Tools components. So when both were selected, the second time it got installed Wise figured it was overwriting a pre-existing version, and made a backup copy in BACKUP. A rollback-uninstall then restored that, leaving the Tools/Scripts/ directory non-empty, and so Wise couldn't remove that directory (or any above it). Fixed by installing pydoc.pyw at most once. + Rearranged and commented the "register file extensions" section, because it was confusing and needs more work: turns out it's not true that Win2K requires Admin privs to register file extensions, BUT, if you don't have Admin privs, Win2K requires a new way to register file extensions, and a way that doesn't blow up but doesn't do any good either on earlier Windows flavors. I think I know how to get this done, but am too depressed to do it right now <0.7 wink>. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** python20.wse 2001/08/03 19:04:13 1.69 --- python20.wse 2001/08/04 23:23:27 1.70 *************** *** 13,17 **** Message Font=MS Sans Serif Font Size=8 ! Pages Modified=00010000011101000000000100000010 Extra Pages=00000000000000000000000010110010 Disk Filename=SETUP --- 13,17 ---- Message Font=MS Sans Serif Font Size=8 ! Pages Modified=00010000011101000000000100000011 Extra Pages=00000000000000000000000010110010 Disk Filename=SETUP *************** *** 55,60 **** end item: Set Variable ! Variable=APPTITLE ! Value=Python 2.2a1 end item: Remark --- 55,60 ---- end item: Set Variable ! Variable=PYVER_STRING ! Value=2.2a1 end item: Remark *************** *** 73,77 **** end item: Remark ! Text= The APPTITLE setting above. end item: Remark --- 73,77 ---- end item: Remark ! Text= PYVER_STRING above. end item: Remark *************** *** 86,89 **** --- 86,93 ---- item: Remark end + item: Set Variable + Variable=APPTITLE + Value=Python %PYVER_STRING% + end item: Remark Text=PY_VERSION should be major.minor only; used to create the registry key; must match MS_DLL_ID in python_nt.rc *************** *** 755,759 **** Text=Register file extensons (requires Admin privs) Text= ! Text French=Python interpreter, library and Tcl/Tk Text French=Python HTML docs Text French=Python utility scripts (Tools/) --- 759,763 ---- Text=Register file extensons (requires Admin privs) Text= ! Text French=Python interpreter, library and IDLE Text French=Python HTML docs Text French=Python utility scripts (Tools/) *************** *** 761,765 **** Text French=Register file extensons (requires Admin privs) Text French= ! Text German=Python interpreter, library and Tcl/Tk Text German=Python HTML docs Text German=Python utility scripts (Tools/) --- 765,769 ---- Text French=Register file extensons (requires Admin privs) Text French= ! Text German=Python interpreter, library and IDLE Text German=Python HTML docs Text German=Python utility scripts (Tools/) *************** *** 767,771 **** Text German=Register file extensons (requires Admin privs) Text German= ! Text Spanish=Python interpreter, library and Tcl/Tk Text Spanish=Python HTML docs Text Spanish=Python utility scripts (Tools/) --- 771,775 ---- Text German=Register file extensons (requires Admin privs) Text German= ! Text Spanish=Python interpreter, library and IDLE Text Spanish=Python HTML docs Text Spanish=Python utility scripts (Tools/) *************** *** 773,777 **** Text Spanish=Register file extensons (requires Admin privs) Text Spanish= ! Text Italian=Python interpreter, library and Tcl/Tk Text Italian=Python HTML docs Text Italian=Python utility scripts (Tools/) --- 777,781 ---- Text Spanish=Register file extensons (requires Admin privs) Text Spanish= ! Text Italian=Python interpreter, library and IDLE Text Italian=Python HTML docs Text Italian=Python utility scripts (Tools/) *************** *** 1737,1742 **** end item: Install File ! Source=..\tools\scripts\pydoc.pyw ! Destination=%MAINDIR%\Tools\Scripts\pydoc.pyw Description=Windows pydoc driver Flags=0000000000000010 --- 1741,1746 ---- end item: Install File ! Source=..\tools\scripts\*.pyw ! Destination=%MAINDIR%\Tools\Scripts Description=Windows pydoc driver Flags=0000000000000010 *************** *** 1796,1800 **** end item: Install File ! Source=..\tools\scripts\*.pyw Destination=%MAINDIR%\Tools\Scripts Description=Utility Scripts --- 1800,1804 ---- end item: Install File ! Source=..\tools\scripts\*.doc Destination=%MAINDIR%\Tools\Scripts Description=Utility Scripts *************** *** 1802,1816 **** end item: Install File ! Source=..\tools\scripts\*.doc ! Destination=%MAINDIR%\Tools\Scripts Description=Utility Scripts Flags=0000000000000010 end item: Install File ! Source=..\tools\scripts\readme ! Destination=%MAINDIR%\Tools\Scripts\README.txt Description=Utility Scripts Flags=0000000000000010 end item: Remark end --- 1806,1832 ---- end item: Install File ! Source=..\tools\scripts\readme ! Destination=%MAINDIR%\Tools\Scripts\README.txt Description=Utility Scripts Flags=0000000000000010 end + item: Remark + Text=*.pyw is installed by the main component; if we install it twice, a copy gets made + end + item: Remark + Text= in BACKUP, and then a rollback-uninstall will copy back the first one. + end + item: Check if File/Dir Exists + Pathname=%MAINDIR%\Tools\Scripts\pydoc.pyw + Flags=00000101 + end item: Install File ! Source=..\tools\scripts\*.pyw ! Destination=%MAINDIR%\Tools\Scripts Description=Utility Scripts Flags=0000000000000010 end + item: End Block + end item: Remark end *************** *** 1951,1955 **** end item: Remark ! Text=The rest is Start menu and registry fiddling. end item: Remark --- 1967,1971 ---- end item: Remark ! Text=The rest is registry and Start Menu fiddling. end item: Remark *************** *** 1961,1964 **** --- 1977,1983 ---- end item: Remark + Text=Register file extensions. + end + item: Remark Text=Registering file extensions requires Admin privs. end *************** *** 1969,1984 **** end item: Remark ! Text=Register file extensions. ! end ! item: Edit Registry ! Total Keys=1 ! Key=.py ! New Value=Python.File ! end ! item: Edit Registry ! Total Keys=1 ! Key=.py ! New Value=text/plain ! Value Name=Content Type end item: Edit Registry --- 1988,1992 ---- end item: Remark ! Text=File types. end item: Edit Registry *************** *** 1996,2010 **** Key=Python.File\DefaultIcon New Value=%MAINDIR%\Py.ico - end - item: Edit Registry - Total Keys=1 - Key=.pyw - New Value=Python.NoConFile end ! item: Edit Registry ! Total Keys=1 ! Key=.pyw ! New Value=text/plain ! Value Name=Content Type end item: Edit Registry --- 2004,2009 ---- Key=Python.File\DefaultIcon New Value=%MAINDIR%\Py.ico end ! item: Remark end item: Edit Registry *************** *** 2023,2035 **** New Value=%MAINDIR%\Py.ico end ! item: Edit Registry ! Total Keys=1 ! Key=.pyc ! New Value=Python.CompiledFile ! end ! item: Edit Registry ! Total Keys=1 ! Key=.pyo ! New Value=Python.CompiledFile end item: Edit Registry --- 2022,2026 ---- New Value=%MAINDIR%\Py.ico end ! item: Remark end item: Edit Registry *************** *** 2048,2051 **** --- 2039,2083 ---- New Value=%MAINDIR%\pyc.ico end + item: Remark + end + item: Remark + Text=File extensions. + end + item: Edit Registry + Total Keys=1 + Key=.py + New Value=Python.File + end + item: Edit Registry + Total Keys=1 + Key=.py + New Value=text/plain + Value Name=Content Type + end + item: Remark + end + item: Edit Registry + Total Keys=1 + Key=.pyw + New Value=Python.NoConFile + end + item: Edit Registry + Total Keys=1 + Key=.pyw + New Value=text/plain + Value Name=Content Type + end + item: Remark + end + item: Edit Registry + Total Keys=1 + Key=.pyc + New Value=Python.CompiledFile + end + item: Edit Registry + Total Keys=1 + Key=.pyo + New Value=Python.CompiledFile + end item: End Block end *************** *** 2142,2145 **** --- 2174,2180 ---- Text=Registry fiddling for docs. end + item: Remark + Text=Write to HKLM for admin, else HKCU. Keep these blocks otherwise identical! + end item: If/While Statement Variable=COMPONENTS *************** *** 2147,2153 **** Flags=00001010 end - item: Remark - Text=Write to HKLM for admin, else HKCU. Keep these blocks otherwise identical! - end item: Check Configuration Flags=10111111 --- 2182,2185 ---- *************** *** 2174,2246 **** end item: Remark ! Text=Well, *this* is cryptic! It's setting up the app publisher and URL entries for Win2K add/remove. end item: Remark ! Text=Ack, and "Win2K" isn't enough either -- you can't actually do this without Admin privs too. end item: Check Configuration Flags=10111111 end item: Edit Registry ! Total Keys=3 ! item: Key ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=http://www.python.org/ ! Value Name=HelpLink ! Root=2 ! end ! item: Key ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=PythonLabs at Zope Corporation ! Value Name=Publisher ! Root=2 ! end ! item: Key ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=http://www.python.org/ ! Value Name=URLInfoAbout ! Root=2 ! end end ! item: Else Statement end ! item: Remark ! Text=Same thing, except write to HKCU instead. end ! item: Remark ! Text=Damn -- this "edit keys" cmd was created by the Installation Expert view, and I duplicated and end ! item: Remark ! Text=edited it by hand. The info comes from the "Windows 2000" section of the Properties view, end ! item: Remark ! Text=and if you change it there it will only show up in the "if" block above. end ! item: Remark ! Text=Easiest to make corresponding changes in *this* block by editing this script in end ! item: Remark ! Text=a plain text editor. end item: Edit Registry ! Total Keys=3 ! item: Key ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=http://www.python.org/ ! Value Name=HelpLink ! Root=1 ! end ! item: Key ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=PythonLabs at Zope Corporation ! Value Name=Publisher ! Root=1 ! end ! item: Key ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=http://www.python.org/ ! Value Name=URLInfoAbout ! Root=1 ! end end item: End Block --- 2206,2283 ---- end item: Remark ! Text=Set the app publisher and URL entries for Win2K add/remove. end item: Remark ! Text=It doesn't hurt on other systems. ! end ! item: Remark ! Text=As usual, write to HKLM or HKCU depending on Admin privs. end + item: Remark + Text=CAUTION: If you set this info on the "Windows 2000" page (step 6) of the + end + item: Remark + Text=Installation Expert, it only shows up in the "If" block below. Keep in synch! + end item: Check Configuration Flags=10111111 end item: Edit Registry ! Total Keys=1 ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=http://www.python.org/ ! Value Name=HelpLink ! Root=2 end ! item: Edit Registry ! Total Keys=1 ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=PythonLabs at Zope Corporation ! Value Name=Publisher ! Root=2 end ! item: Edit Registry ! Total Keys=1 ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=http://www.python.org/ ! Value Name=URLInfoAbout ! Root=2 end ! item: Edit Registry ! Total Keys=1 ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=%PYVER_STRING% ! Value Name=DisplayVersion ! Root=2 end ! item: Else Statement end ! item: Edit Registry ! Total Keys=1 ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=http://www.python.org/ ! Value Name=HelpLink ! Root=1 end ! item: Edit Registry ! Total Keys=1 ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=PythonLabs at Zope Corporation ! Value Name=Publisher ! Root=1 end ! item: Edit Registry ! Total Keys=1 ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=http://www.python.org/ ! Value Name=URLInfoAbout ! Root=1 end item: Edit Registry ! Total Keys=1 ! Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% ! New Value=%PYVER_STRING% ! Value Name=DisplayVersion ! Root=1 end item: End Block *************** *** 2250,2253 **** --- 2287,2292 ---- item: Remark Text=Populate Start Menu + end + item: Remark end item: If/While Statement From tim_one@users.sourceforge.net Sun Aug 5 05:12:32 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 04 Aug 2001 21:12:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild Uninstal.wse,1.3,1.4 python20.wse,1.70,1.71 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv14318 Modified Files: Uninstal.wse python20.wse Log Message: New runtime vrbl DOADMIN. When false, we never try to write under HKLM, and install the Python and MS runtime DLLs into the Python dir instead of a system dir. Initial value is taken from new compiler vrbl _DOADMIN_ (default true), and forced to false if the user doesn't have admin privs. This makes it possible to *test* non-admin installs on machines where the distinction doesn't exist (like my home box), via just changing _DOADMIN_. It may also be useful for users who don't *want* an installer to scribble into their system dir (for example, me(! most days)), but that would require adding more GUI to let them get at it. Index: Uninstal.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/Uninstal.wse,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Uninstal.wse 2001/08/01 18:42:54 1.3 --- Uninstal.wse 2001/08/05 04:12:30 1.4 *************** *** 26,30 **** end item: Remark ! Text=uninstall info under HKCU instead of HKLM if the user doesn't have Admin privs. end item: Remark --- 26,30 ---- end item: Remark ! Text=uninstall info under HKCU instead of HKLM if our DOADMIN var is false. end item: Remark *************** *** 434,439 **** Flags=10111011 end ! item: Check Configuration ! Flags=10111111 end item: Remark --- 434,440 ---- Flags=10111011 end ! item: If/While Statement ! Variable=DOADMIN ! Value=1 end item: Remark Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** python20.wse 2001/08/04 23:23:27 1.70 --- python20.wse 2001/08/05 04:12:30 1.71 *************** *** 26,30 **** Version Company=PythonLabs at Zope Corporation Crystal Format=10111100101100000010001001001001 ! Step View=&All Variable Name1=_WISE_ Variable Description1=WISE root directory --- 26,30 ---- Version Company=PythonLabs at Zope Corporation Crystal Format=10111100101100000010001001001001 ! Step View=&Properties Variable Name1=_WISE_ Variable Description1=WISE root directory *************** *** 53,56 **** --- 53,65 ---- Variable Default6=2 Variable Flags6=00001000 + Variable Name7=_DOADMIN_ + Variable Description7=The initial value for %DOADMIN%. + Variable Description7=When 0, we never try to write under HKLM, + Variable Description7=and install the Python + MS runtime DLLs in + Variable Description7=the Python directory instead of the system dir. + Variable Default7=1 + Variable Values7=1 + Variable Values7=0 + Variable Flags7=00001010 end item: Set Variable *************** *** 114,117 **** --- 123,130 ---- item: Remark end + item: Set Variable + Variable=DOADMIN + Value=%_DOADMIN_% + end item: Remark Text=Give non-admin users a chance to abort. *************** *** 120,123 **** --- 133,140 ---- Flags=10011111 end + item: Set Variable + Variable=DOADMIN + Value=0 + end item: Display Message Title=Doing non-admin install *************** *** 267,272 **** Text=E: register file extensions (requires Admin privs) end ! item: Check Configuration ! Flags=10111111 end item: Set Variable --- 284,290 ---- Text=E: register file extensions (requires Admin privs) end ! item: If/While Statement ! Variable=DOADMIN ! Value=1 end item: Set Variable *************** *** 1308,1313 **** item: Remark end ! item: Check Configuration ! Flags=10111111 end item: Set Variable --- 1326,1332 ---- item: Remark end ! item: If/While Statement ! Variable=DOADMIN ! Value=1 end item: Set Variable *************** *** 2090,2095 **** Text=Write to HKLM for admin, else HKCU. Keep these blocks otherwise identical! end ! item: Check Configuration ! Flags=10111111 end item: Edit Registry --- 2109,2115 ---- Text=Write to HKLM for admin, else HKCU. Keep these blocks otherwise identical! end ! item: If/While Statement ! Variable=DOADMIN ! Value=1 end item: Edit Registry *************** *** 2182,2187 **** Flags=00001010 end ! item: Check Configuration ! Flags=10111111 end item: Edit Registry --- 2202,2208 ---- Flags=00001010 end ! item: If/While Statement ! Variable=DOADMIN ! Value=1 end item: Edit Registry *************** *** 2220,2225 **** Text=Installation Expert, it only shows up in the "If" block below. Keep in synch! end ! item: Check Configuration ! Flags=10111111 end item: Edit Registry --- 2241,2247 ---- Text=Installation Expert, it only shows up in the "If" block below. Keep in synch! end ! item: If/While Statement ! Variable=DOADMIN ! Value=1 end item: Edit Registry *************** *** 2286,2290 **** end item: Remark ! Text=Populate Start Menu end item: Remark --- 2308,2312 ---- end item: Remark ! Text=Populate Start Menu group end item: Remark From tim_one@users.sourceforge.net Sun Aug 5 06:19:17 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 04 Aug 2001 22:19:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.71,1.72 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv23786 Modified Files: python20.wse Log Message: + Redid file associations on Win2K in what I believe is "the right way". Can't test it until getting to a Win2K box, because the non-Admin way of setting file associations on Win2K doesn't work on any other flavor of Windows (and other flavors of Windows never need Admin privs to do it the old way). + Consequently got rid of the "Register file associations" Component and associated GUI. + Added a line to the summary saying whether or not this is an Admin-level install (I fear that will be an important clue someday). + Minor fiddling to the summary to reduce the # of lines. Added a horizontal scrollbar in case the install path is very long. + Reworked the way the Main and Tools components share pydoc.pyw; cleaner and simpler. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** python20.wse 2001/08/05 04:12:30 1.71 --- python20.wse 2001/08/05 05:19:15 1.72 *************** *** 26,30 **** Version Company=PythonLabs at Zope Corporation Crystal Format=10111100101100000010001001001001 ! Step View=&Properties Variable Name1=_WISE_ Variable Description1=WISE root directory --- 26,30 ---- Version Company=PythonLabs at Zope Corporation Crystal Format=10111100101100000010001001001001 ! Step View=&All Variable Name1=_WISE_ Variable Description1=WISE root directory *************** *** 281,286 **** Text=D: test suite end item: Remark - Text=E: register file extensions (requires Admin privs) end item: If/While Statement --- 281,306 ---- Text=D: test suite end + item: Set Variable + Variable=COMPONENTS + Value=ABCD + end + item: Wizard Block + Direction Variable=DIRECTION + Display Variable=DISPLAY + Bitmap Pathname=%_WISE_%\Dialogs\Template\Wizard.bmp + X Position=9 + Y Position=10 + Filler Color=8421440 + Flags=00000011 + end + item: If/While Statement + Variable=DISPLAY + Value=Start Installation + end + item: Set Variable + Variable=SUMMARY + Value=Install directory: %MAINDIR%%CRLF% + end item: Remark end item: If/While Statement *************** *** 289,315 **** end item: Set Variable ! Variable=COMPONENTS ! Value=ABCDE end item: Else Statement end item: Remark - Text=Lowercase E grays out the "register file extension" choice. end item: Set Variable Variable=COMPONENTS ! Value=ABCDe end item: End Block end ! item: Wizard Block ! Direction Variable=DIRECTION ! Display Variable=DISPLAY ! Bitmap Pathname=%_WISE_%\Dialogs\Template\Wizard.bmp ! X Position=9 ! Y Position=10 ! Filler Color=8421440 ! Flags=00000011 end item: Custom Dialog Set Name=Select Destination Directory --- 309,411 ---- end item: Set Variable ! Variable=SUMMARY ! Value=%CRLF%Doing admin install.%CRLF% ! Flags=00000001 end item: Else Statement end + item: Set Variable + Variable=SUMMARY + Value=%CRLF%Doing non-admin install.%CRLF% + Flags=00000001 + end + item: End Block + end item: Remark end + item: If/While Statement + Variable=DOBACKUP + Value=A + end + item: Set Variable + Variable=SUMMARY + Value=%CRLF%Make backups, into %BACKUP%%CRLF% + Flags=00000001 + end + item: Else Statement + end item: Set Variable + Variable=SUMMARY + Value=%CRLF%Don't make backups.%CRLF% + Flags=00000001 + end + item: End Block + end + item: Remark + end + item: Set Variable + Variable=SUMMARY + Value=%CRLF%Components:%CRLF% + Flags=00000001 + end + item: If/While Statement Variable=COMPONENTS ! Value=A ! Flags=00000010 ! end ! item: Set Variable ! Variable=SUMMARY ! Value= Python interpreter, libraries and IDLE%CRLF% ! Flags=00000001 end item: End Block end ! item: If/While Statement ! Variable=COMPONENTS ! Value=B ! Flags=00000010 ! end ! item: Set Variable ! Variable=SUMMARY ! Value= Python documentation%CRLF% ! Flags=00000001 ! end ! item: End Block ! end ! item: If/While Statement ! Variable=COMPONENTS ! Value=C ! Flags=00000010 ! end ! item: Set Variable ! Variable=SUMMARY ! Value= Tool and utility scripts%CRLF% ! Flags=00000001 ! end ! item: End Block ! end ! item: If/While Statement ! Variable=COMPONENTS ! Value=D ! Flags=00000010 ! end ! item: Set Variable ! Variable=SUMMARY ! Value= Python test suite%CRLF% ! Flags=00000001 end + item: End Block + end + item: Remark + end + item: Set Variable + Variable=SUMMARY + Value=%CRLF%Start Menu group: %GROUP%%CRLF% + Flags=00000001 + end + item: End Block + end + item: Remark + end item: Custom Dialog Set Name=Select Destination Directory *************** *** 775,779 **** Text=Python utility scripts (Tools/) Text=Python test suite (Lib/test/) - Text=Register file extensons (requires Admin privs) Text= Text French=Python interpreter, library and IDLE --- 871,874 ---- *************** *** 1015,1019 **** Help Context=16711681 Enabled Color=00000000000000001111111111111111 ! Create Flags=01010000101000000001100010000100 Text=%SUMMARY% end --- 1110,1114 ---- Help Context=16711681 Enabled Color=00000000000000001111111111111111 ! Create Flags=01010000101100000001100000000100 Text=%SUMMARY% end *************** *** 1022,1146 **** item: Remark end - item: Remark - Text=If we just finished "Select Destination Directory": - end - item: Remark - Text= %MAINDIR% is set, so reinitialize %BACKUP% to match. - end - item: Remark - Text=ElseIf we just finished "Select Program Manager Group": - end - item: Remark - Text= "Start Installation" is next, so build a summary for "Start Installation" to display. - end - item: Remark - end item: If/While Statement Variable=DISPLAY Value=Select Destination Directory end - item: Set Variable - Variable=BACKUP - Value=%MAINDIR%\BACKUP - end - item: Remark - end - item: ElseIf Statement - Variable=DISPLAY - Value=Select Program Manager Group - end - item: Set Variable - Variable=SUMMARY - Value=Installation directory%CRLF% %MAINDIR%%CRLF% - end - item: Remark - end - item: Set Variable - Variable=SUMMARY - Value=%CRLF%Make backups?%CRLF% - Flags=00000001 - end - item: If/While Statement - Variable=DOBACKUP - Value=A - end - item: Set Variable - Variable=SUMMARY - Value= Yes, into %BACKUP%%CRLF% - Flags=00000001 - end - item: Else Statement - end - item: Set Variable - Variable=SUMMARY - Value= No%CRLF% - Flags=00000001 - end - item: End Block - end item: Remark ! end ! item: Set Variable ! Variable=SUMMARY ! Value=%CRLF%Components%CRLF% ! Flags=00000001 ! end ! item: If/While Statement ! Variable=COMPONENTS ! Value=A ! Flags=00000010 ! end ! item: Set Variable ! Variable=SUMMARY ! Value= Python interpreter, libraries and IDLE%CRLF% ! Flags=00000001 ! end ! item: End Block ! end ! item: If/While Statement ! Variable=COMPONENTS ! Value=B ! Flags=00000010 ! end ! item: Set Variable ! Variable=SUMMARY ! Value= Python documentation%CRLF% ! Flags=00000001 ! end ! item: End Block ! end ! item: If/While Statement ! Variable=COMPONENTS ! Value=C ! Flags=00000010 ! end ! item: Set Variable ! Variable=SUMMARY ! Value= Tool and utility scripts%CRLF% ! Flags=00000001 ! end ! item: End Block ! end ! item: If/While Statement ! Variable=COMPONENTS ! Value=D ! Flags=00000010 ! end ! item: Set Variable ! Variable=SUMMARY ! Value= Python test suite%CRLF% ! Flags=00000001 ! end ! item: End Block ! end ! item: If/While Statement ! Variable=COMPONENTS ! Value=E ! Flags=00000010 end item: Set Variable ! Variable=SUMMARY ! Value= Register file extensions%CRLF% ! Flags=00000001 end item: End Block --- 1117,1130 ---- item: Remark end item: If/While Statement Variable=DISPLAY Value=Select Destination Directory end item: Remark ! Text=User may have changed MAINDIR, so reset BACKUP to match. end item: Set Variable ! Variable=BACKUP ! Value=%MAINDIR%\BACKUP end item: End Block *************** *** 1148,1160 **** item: Remark end - item: Set Variable - Variable=SUMMARY - Value=%CRLF%Start Menu group%CRLF% %GROUP%%CRLF% - Flags=00000001 - end item: End Block end - item: End Block - end item: Remark end --- 1132,1137 ---- *************** *** 1757,1771 **** end item: Remark - Text=Windows pydoc driver - end - item: Install File - Source=..\tools\scripts\*.pyw - Destination=%MAINDIR%\Tools\Scripts - Description=Windows pydoc driver - Flags=0000000000000010 - end - item: Remark - end - item: Remark Text=Microsoft C runtime libraries end --- 1734,1737 ---- *************** *** 1831,1854 **** end item: Remark - Text=*.pyw is installed by the main component; if we install it twice, a copy gets made - end - item: Remark - Text= in BACKUP, and then a rollback-uninstall will copy back the first one. - end - item: Check if File/Dir Exists - Pathname=%MAINDIR%\Tools\Scripts\pydoc.pyw - Flags=00000101 end item: Install File - Source=..\tools\scripts\*.pyw - Destination=%MAINDIR%\Tools\Scripts - Description=Utility Scripts - Flags=0000000000000010 - end - item: End Block - end - item: Remark - end - item: Install File Source=..\tools\webchecker\*.py Destination=%MAINDIR%\Tools\webchecker --- 1797,1802 ---- *************** *** 1983,1986 **** --- 1931,1952 ---- end item: Remark + Text=Windows pydoc driver + end + item: If/While Statement + Variable=COMPONENTS + Value=AC + Flags=00001010 + end + item: Install File + Source=..\tools\scripts\*.pyw + Destination=%MAINDIR%\Tools\Scripts + Description=Windows pydoc driver + Flags=0000000000000010 + end + item: End Block + end + item: Remark + end + item: Remark Text=DONE with file copying. end *************** *** 1996,2008 **** end item: Remark ! Text=Register file extensions. end item: Remark ! Text=Registering file extensions requires Admin privs. end item: If/While Statement ! Variable=COMPONENTS ! Value=E ! Flags=00001010 end item: Remark --- 1962,1998 ---- end item: Remark ! Text=Register file extensions. As usual, Admin privs get in the way, but with a twist: end item: Remark ! Text=You don't need admin privs to write to HKEY_CLASSES_ROOT *except* under Win2K. ! end ! item: Remark ! Text=On Win2K, a user without Admin privs has to register extensions under HKCU\Software\CLASSES instead. end + item: Remark + Text=But while you can *do* that under other flavors of Windows too, it has no useful effect except in Win2K. + end + item: Set Variable + Variable=USE_HKCR + Value=1 + end + item: Check Configuration + Flags=11110010 + end item: If/While Statement ! Variable=DOADMIN ! Value=0 ! end ! item: Set Variable ! Variable=USE_HKCR ! Value=0 ! end ! item: End Block ! end ! item: End Block ! end ! item: If/While Statement ! Variable=USE_HKCR ! Value=1 end item: Remark *************** *** 2098,2101 **** --- 2088,2201 ---- Key=.pyo New Value=Python.CompiledFile + end + item: Else Statement + end + item: Remark + Text=File types. + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\Python.File + New Value=Python File + Root=1 + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\Python.File\shell\open\command + New Value=%MAINDIR%\python.exe "%%1" %%* + Root=1 + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\Python.File\DefaultIcon + New Value=%MAINDIR%\Py.ico + Root=1 + end + item: Remark + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\Python.NoConFile + New Value=Python File (no console) + Root=1 + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\Python.NoConFile\shell\open\command + New Value=%MAINDIR%\pythonw.exe "%%1" %%* + Root=1 + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\Python.NoConFile\DefaultIcon + New Value=%MAINDIR%\Py.ico + Root=1 + end + item: Remark + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\Python.CompiledFile + New Value=Compiled Python File + Root=1 + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\Python.CompiledFile\shell\open\command + New Value=%MAINDIR%\python.exe "%%1" %%* + Root=1 + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\Python.CompiledFile\DefaultIcon + New Value=%MAINDIR%\pyc.ico + Root=1 + end + item: Remark + end + item: Remark + Text=File extensions. + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\.py + New Value=Python.File + Root=1 + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\.py + New Value=text/plain + Value Name=Content Type + Root=1 + end + item: Remark + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\.pyw + New Value=Python.NoConFile + Root=1 + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\.pyw + New Value=text/plain + Value Name=Content Type + Root=1 + end + item: Remark + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\.pyc + New Value=Python.CompiledFile + Root=1 + end + item: Edit Registry + Total Keys=1 + Key=Software\CLASSES\.pyo + New Value=Python.CompiledFile + Root=1 end item: End Block From tim_one@users.sourceforge.net Sun Aug 5 06:43:22 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 04 Aug 2001 22:43:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts pydocgui.pyw,NONE,1.1 pydoc.pyw,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory usw-pr-cvs1:/tmp/cvs-serv27770/python/dist/src/Tools/scripts Added Files: pydocgui.pyw Removed Files: pydoc.pyw Log Message: Rename pydoc.pyw to pydocgui.pyw: Since we changed Python to allow .pyw files to satisfy imports, pydoc.pyw was just importing itself! --- NEW FILE: pydocgui.pyw --- # Note: this file must not be named pydoc.pyw, lest it just end up # importing itself (Python began allowing import of .pyw files # between 2.2a1 and 2.2a2). import pydoc pydoc.gui() --- pydoc.pyw DELETED --- From tim_one@users.sourceforge.net Sun Aug 5 06:43:22 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 04 Aug 2001 22:43:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.72,1.73 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv27770/python/dist/src/PCbuild Modified Files: python20.wse Log Message: Rename pydoc.pyw to pydocgui.pyw: Since we changed Python to allow .pyw files to satisfy imports, pydoc.pyw was just importing itself! Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** python20.wse 2001/08/05 05:19:15 1.72 --- python20.wse 2001/08/05 05:43:20 1.73 *************** *** 2452,2456 **** Source=%MAINDIR%\pythonw.exe Destination=%GROUP%\Module Docs.lnk ! Command Options="%MAINDIR%\Tools\Scripts\pydoc.pyw" Working Directory=%MAINDIR% Key Type=1536 --- 2452,2456 ---- Source=%MAINDIR%\pythonw.exe Destination=%GROUP%\Module Docs.lnk ! Command Options="%MAINDIR%\Tools\Scripts\pydocgui.pyw" Working Directory=%MAINDIR% Key Type=1536 From pierslauder@users.sourceforge.net Sun Aug 5 11:43:05 2001 From: pierslauder@users.sourceforge.net (Piers Lauder) Date: Sun, 05 Aug 2001 03:43:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib imaplib.py,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv6502 Modified Files: imaplib.py Log Message: fix for Bug ID 448100 - "test code using NL instead of CRNL" Index: imaplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/imaplib.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** imaplib.py 2001/07/21 01:41:30 1.32 --- imaplib.py 2001/08/05 10:43:03 1.33 *************** *** 1137,1141 **** PASSWD = getpass.getpass("IMAP password for %s on %s: " % (USER, host or "localhost")) ! test_mesg = 'From: %s@localhost\nSubject: IMAP4 test\n\ndata...\n' % USER test_seq1 = ( ('login', (USER, PASSWD)), --- 1137,1141 ---- PASSWD = getpass.getpass("IMAP password for %s on %s: " % (USER, host or "localhost")) ! test_mesg = 'From: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s' % {'user':USER, 'lf':CRLF} test_seq1 = ( ('login', (USER, PASSWD)), From tim_one@users.sourceforge.net Sun Aug 5 14:58:51 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 05 Aug 2001 06:58:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.73,1.74 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv6871 Modified Files: python20.wse Log Message: + Made installer more reluctant to overwrite MS C runtime DLLs -- it's been overwriting them even if they have the same version, not just if they're an older version (and our installers have always done this). + Added an "Advanced Options" subdialog to "Select Components". Allows to do a non-admin install even if you have Administrator rights, and to skip registering file extensions and/or creating Start Menu shortcuts. Since so far these installers have been tested only by me, and Win2K has been full of surprises, I want those options available out in the field. Lots of web searching turned up what should have been obvious: Because Windows Installer is a native Win2K service, it can run at a higher privilege level than the user invoking it. So MSI installs don't bash into these permission gotchas on Win2K, but Wise 8.1 does (it's just another app to Win2K, and we're not alone in wrestling with this; but, like changing int division in Python, Win2K is doing a right thing ). Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** python20.wse 2001/08/05 05:43:20 1.73 --- python20.wse 2001/08/05 13:58:48 1.74 *************** *** 26,30 **** Version Company=PythonLabs at Zope Corporation Crystal Format=10111100101100000010001001001001 ! Step View=&All Variable Name1=_WISE_ Variable Description1=WISE root directory --- 26,30 ---- Version Company=PythonLabs at Zope Corporation Crystal Format=10111100101100000010001001001001 ! Step View=&Properties Variable Name1=_WISE_ Variable Description1=WISE root directory *************** *** 264,270 **** end item: Remark ! Text=March thru the user GUI. end item: Remark Text=COMPONENTS values: end --- 264,301 ---- end item: Remark ! Text=Set vrbls for the "Advanced Options" subdialog of Components. ! end ! item: Set Variable ! Variable=SELECT_ADMIN ! Value=A ! end ! item: If/While Statement ! Variable=DOADMIN ! Value=0 ! end ! item: Set Variable ! Variable=SELECT_ADMIN ! Value=B ! end ! item: End Block ! end ! item: Remark end item: Remark + Text=TASKS values: + end + item: Remark + Text=A: Register file extensions + end + item: Remark + Text=B: Create Start Menu shortcuts + end + item: Set Variable + Variable=TASKS + Value=AB + end + item: Remark + end + item: Remark Text=COMPONENTS values: end *************** *** 285,288 **** --- 316,324 ---- Value=ABCD end + item: Remark + end + item: Remark + Text=March thru the user GUI. + end item: Wizard Block Direction Variable=DIRECTION *************** *** 292,295 **** --- 328,347 ---- Y Position=10 Filler Color=8421440 + Dialog=Select Destination Directory + Dialog=Backup Replaced Files + Dialog=Select Components + Dialog=Select Program Manager Group + Variable= + Variable= + Variable= + Variable=TASKS + Value= + Value= + Value= + Value=B + Compare=0 + Compare=0 + Compare=0 + Compare=3 Flags=00000011 end *************** *** 305,310 **** end item: If/While Statement ! Variable=DOADMIN ! Value=1 end item: Set Variable --- 357,362 ---- end item: If/While Statement ! Variable=SELECT_ADMIN ! Value=A end item: Set Variable *************** *** 399,402 **** --- 451,480 ---- item: Remark end + item: If/While Statement + Variable=TASKS + Value=A + Flags=00000010 + end + item: Set Variable + Variable=SUMMARY + Value=%CRLF%Register file extensions.%CRLF% + Flags=00000001 + end + item: Else Statement + end + item: Set Variable + Variable=SUMMARY + Value=%CRLF%Don't register file extensions.%CRLF% + Flags=00000001 + end + item: End Block + end + item: Remark + end + item: If/While Statement + Variable=TASKS + Value=B + Flags=00000010 + end item: Set Variable Variable=SUMMARY *************** *** 404,407 **** --- 482,494 ---- Flags=00000001 end + item: Else Statement + end + item: Set Variable + Variable=SUMMARY + Value=%CRLF%No Start Menu shortcuts.%CRLF% + Flags=00000001 + end + item: End Block + end item: End Block end *************** *** 845,867 **** Text Italian=&Annulla end - item: Static - Rectangle=8 180 256 181 - Action=3 - Create Flags=01010000000000000000000000000111 - end - item: Static - Rectangle=86 8 258 42 - Create Flags=01010000000000000000000000000000 - Flags=0000000000000001 - Name=Times New Roman - Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18 - Text=Select Components - Text French=Sélectionner les composants - Text German=Komponenten auswählen - Text Spanish=Seleccione componentes - Text Italian=Selezionare i componenti - end item: Checkbox ! Rectangle=86 62 256 134 Variable=COMPONENTS Create Flags=01010000000000010000000000000011 --- 932,937 ---- Text Italian=&Annulla end item: Checkbox ! Rectangle=86 55 250 127 Variable=COMPONENTS Create Flags=01010000000000010000000000000011 *************** *** 898,902 **** end item: Static ! Rectangle=194 162 242 172 Variable=COMPONENTS Value=MAINDIR --- 968,1006 ---- end item: Static ! Rectangle=86 36 256 53 ! Create Flags=01010000000000000000000000000000 ! Text=Choose which components to install by checking the boxes below. ! Text French=Choisissez les composants que vous voulez installer en cochant les cases ci-dessous. ! Text German=Wählen Sie die zu installierenden Komponenten, indem Sie in die entsprechenden Kästchen klicken. ! Text Spanish=Elija los componentes que desee instalar marcando los cuadros de abajo. ! Text Italian=Scegliere quali componenti installare selezionando le caselle sottostanti. ! end ! item: Push Button ! Rectangle=150 162 215 176 ! Destination Dialog=1 ! Action=2 ! Enabled Color=00000000000000000000000011111111 ! Create Flags=01010000000000010000000000000000 ! Text=Advanced Options ... ! end ! item: Static ! Rectangle=8 180 256 181 ! Action=3 ! Create Flags=01010000000000000000000000000111 ! end ! item: Static ! Rectangle=86 8 258 34 ! Create Flags=01010000000000000000000000000000 ! Flags=0000000000000001 ! Name=Times New Roman ! Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18 ! Text=Select Components ! Text French=Sélectionner les composants ! Text German=Komponenten auswählen ! Text Spanish=Seleccione componentes ! Text Italian=Selezionare i componenti ! end ! item: Static ! Rectangle=201 144 249 154 Variable=COMPONENTS Value=MAINDIR *************** *** 904,913 **** end item: Static ! Rectangle=194 153 242 162 Variable=COMPONENTS Create Flags=01010000000000000000000000000010 end item: Static ! Rectangle=107 153 196 164 Create Flags=01010000000000000000000000000000 Text=Disk Space Required: --- 1008,1017 ---- end item: Static ! Rectangle=201 134 249 143 Variable=COMPONENTS Create Flags=01010000000000000000000000000010 end item: Static ! Rectangle=98 134 187 145 Create Flags=01010000000000000000000000000000 Text=Disk Space Required: *************** *** 918,922 **** end item: Static ! Rectangle=107 162 196 172 Create Flags=01010000000000000000000000000000 Text=Disk Space Remaining: --- 1022,1026 ---- end item: Static ! Rectangle=98 144 187 154 Create Flags=01010000000000000000000000000000 Text=Disk Space Remaining: *************** *** 927,943 **** end item: Static ! Rectangle=86 145 256 175 Action=1 Create Flags=01010000000000000000000000000111 end item: Static ! Rectangle=86 38 256 57 Create Flags=01010000000000000000000000000000 ! Text=Choose which components to install by checking the boxes below. ! Text French=Choisissez les composants que vous voulez installer en cochant les cases ci-dessous. ! Text German=Wählen Sie die zu installierenden Komponenten, indem Sie in die entsprechenden Kästchen klicken. ! Text Spanish=Elija los componentes que desee instalar marcando los cuadros de abajo. ! Text Italian=Scegliere quali componenti installare selezionando le caselle sottostanti. end end end --- 1031,1125 ---- end item: Static ! Rectangle=86 126 256 157 Action=1 Create Flags=01010000000000000000000000000111 end + end + item: Dialog + Title=Advanced Options + Width=271 + Height=186 + Font Name=Helv + Font Size=8 + item: Radio Button + Control Name=ADMIN2 + Rectangle=9 47 72 73 + Variable=SELECT_ADMIN + Enabled Color=00000000000000001111111111111111 + Create Flags=01010000000000010000000000001001 + Text=Admin install + Text=Non-Admin installl + Text= + end + item: Push Button + Rectangle=150 152 195 167 + Variable=DIRECTION + Value=N + Create Flags=01010000000000010000000000000001 + Text=OK + Text French=&Suite > + Text German=&Weiter > + Text Spanish=&Siguiente > + Text Italian=&Avanti > + end item: Static ! Rectangle=4 2 261 76 ! Action=1 ! Enabled Color=00000000000000001111111111111111 ! Create Flags=01010000000000000000000000000111 ! end ! item: Static ! Control Name=ADMIN1 ! Rectangle=9 9 257 42 ! Enabled Color=00000000000000001111111111111111 Create Flags=01010000000000000000000000000000 ! Text=By default, the install records settings in the per-machine area of the registry (HKLM), and installs the Python and C runtime DLLs to the system directory. Choose "Non-Admin install" if you would prefer settings made in the per-user registry (HKCU), and DLLs installed in %MAINDIR%. ! end ! item: Static ! Rectangle=4 82 261 144 ! Action=1 ! Enabled Color=00000000000000001111111111111111 ! Create Flags=01010000000000000000000000000111 end + item: Checkbox + Rectangle=9 105 194 134 + Variable=TASKS + Enabled Color=00000000000000001111111111111111 + Create Flags=01010000000000010000000000000011 + Text=Register file extensions (.py, .pyw, .pyo, .pyc) + Text=Create Start Menu shortcuts + Text= + end + item: Static + Rectangle=9 90 256 105 + Enabled Color=00000000000000001111111111111111 + Create Flags=01010000000000000000000000000000 + Text=Choose tasks to perform by checking the boxes below. + end + item: If/While Statement + Variable=DLG_EVENT_TYPE + Value=INIT + end + item: If/While Statement + Variable=DOADMIN + Value=1 + end + item: Set Control Attribute + Control Name=ADMIN2 + end + item: Else Statement + end + item: Set Control Text + Control Name=ADMIN1 + Control Text=This section is available only if logged in to an account with Administrator privileges. + end + item: Set Control Attribute + Control Name=ADMIN2 + Operation=1 + end + item: End Block + end + item: End Block + end end end *************** *** 1298,1301 **** --- 1480,1516 ---- item: Remark end + item: If/While Statement + Variable=SELECT_ADMIN + Value=B + end + item: Remark + Text=The user chose a non-admin install in "Advanced Options". + end + item: Remark + Text=This should come after the include of Uninstal.wse above, because + end + item: Remark + Text=writing uninstall info to HKCU is ineffective except under Win2K. + end + item: Set Variable + Variable=DOADMIN + Value=0 + end + item: End Block + end + item: Remark + end + item: If/While Statement + Variable=TASKS + Value=B + Flags=00000011 + end + item: Set Variable + Variable=GROUP + end + item: End Block + end + item: Remark + end item: Remark Text=Long section to install files. *************** *** 1361,1365 **** Variable=COMPONENTS Value=A ! Flags=00001010 end item: Remark --- 1576,1580 ---- Variable=COMPONENTS Value=A ! Flags=00000010 end item: Remark *************** *** 1740,1744 **** Destination=%DLLDEST%\MSVCIRT.DLL Description=Visual C++ Runtime DLLs ! Flags=0000001000000011 end item: Install File --- 1955,1959 ---- Destination=%DLLDEST%\MSVCIRT.DLL Description=Visual C++ Runtime DLLs ! Flags=0000011000010011 end item: Install File *************** *** 1746,1750 **** Destination=%DLLDEST%\MSVCRT.DLL Description=Visual C++ Runtime DLLs ! Flags=0000001000000011 end item: End Block --- 1961,1965 ---- Destination=%DLLDEST%\MSVCRT.DLL Description=Visual C++ Runtime DLLs ! Flags=0000011000010011 end item: End Block *************** *** 1758,1762 **** Variable=COMPONENTS Value=B ! Flags=00001010 end item: Install File --- 1973,1977 ---- Variable=COMPONENTS Value=B ! Flags=00000010 end item: Install File *************** *** 1776,1780 **** Variable=COMPONENTS Value=C ! Flags=00001010 end item: Install File --- 1991,1995 ---- Variable=COMPONENTS Value=C ! Flags=00000010 end item: Install File *************** *** 1886,1890 **** Variable=COMPONENTS Value=D ! Flags=00001010 end item: Install File --- 2101,2105 ---- Variable=COMPONENTS Value=D ! Flags=00000010 end item: Install File *************** *** 1959,1964 **** Variable=COMPONENTS Value=A ! Flags=00001010 end item: Remark Text=Register file extensions. As usual, Admin privs get in the way, but with a twist: --- 2174,2184 ---- Variable=COMPONENTS Value=A ! Flags=00000010 end + item: If/While Statement + Variable=TASKS + Value=A + Flags=00000010 + end item: Remark Text=Register file extensions. As usual, Admin privs get in the way, but with a twist: *************** *** 2201,2204 **** --- 2421,2426 ---- item: End Block end + item: End Block + end item: Remark end *************** *** 2300,2304 **** Variable=COMPONENTS Value=B ! Flags=00001010 end item: If/While Statement --- 2522,2526 ---- Variable=COMPONENTS Value=B ! Flags=00000010 end item: If/While Statement *************** *** 2410,2419 **** Text=Populate Start Menu group end ! item: Remark end item: If/While Statement Variable=COMPONENTS Value=B ! Flags=00001010 end item: Create Shortcut --- 2632,2644 ---- Text=Populate Start Menu group end ! item: If/While Statement ! Variable=TASKS ! Value=B ! Flags=00000010 end item: If/While Statement Variable=COMPONENTS Value=B ! Flags=00000010 end item: Create Shortcut *************** *** 2431,2435 **** Variable=COMPONENTS Value=A ! Flags=00001010 end item: Create Shortcut --- 2656,2660 ---- Variable=COMPONENTS Value=A ! Flags=00000010 end item: Create Shortcut *************** *** 2467,2470 **** --- 2692,2697 ---- Key Type=1536 Flags=00000001 + end + item: End Block end item: Remark From fdrake@users.sourceforge.net Sun Aug 5 16:43:06 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sun, 05 Aug 2001 08:43:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libtime.tex,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv30134/lib Modified Files: libtime.tex Log Message: Add a comment on time.time() returning non-decreasing values except when the clock is set back. This closes SF bug #447945. Index: libtime.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtime.tex,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** libtime.tex 2001/07/16 15:40:57 1.42 --- libtime.tex 2001/08/05 15:43:04 1.43 *************** *** 288,292 **** the epoch, in UTC. Note that even though the time is always returned as a floating point number, not all systems provide time with a better ! precision than 1 second. \end{funcdesc} --- 288,294 ---- the epoch, in UTC. Note that even though the time is always returned as a floating point number, not all systems provide time with a better ! precision than 1 second. While this function normally returns ! non-decreasing values, it can return a lower value than a previous ! call if the system clock has been set back between the two calls. \end{funcdesc} From loewis@users.sourceforge.net Sun Aug 5 22:23:05 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 05 Aug 2001 14:23:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include object.h,2.80,2.81 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv25839 Modified Files: object.h Log Message: Patch #448194: Debuging negative reference counts. Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.80 retrieving revision 2.81 diff -C2 -d -r2.80 -r2.81 *** object.h 2001/08/02 04:15:00 2.80 --- object.h 2001/08/05 21:23:03 2.81 *************** *** 490,498 **** #define Py_INCREF(op) (_Py_RefTotal++, (op)->ob_refcnt++) ! #define Py_DECREF(op) \ ! if (--_Py_RefTotal, (--((op)->ob_refcnt) != 0)) \ ! ; \ ! else \ ! _Py_Dealloc((PyObject *)(op)) #else /* !Py_REF_DEBUG */ --- 490,499 ---- #define Py_INCREF(op) (_Py_RefTotal++, (op)->ob_refcnt++) ! /* under Py_REF_DEBUG: also log negative ref counts after Py_DECREF() !! */ ! #define Py_DECREF(op) \ ! if (--_Py_RefTotal, 0 < (--((op)->ob_refcnt))) ; \ ! else if (0 == (op)->ob_refcnt) _Py_Dealloc( (PyObject*)(op)); \ ! else (void)fprintf( stderr, "%s:%i negative ref count %i\n", \ ! __FILE__, __LINE__, (op)->ob_refcnt) #else /* !Py_REF_DEBUG */ From jackjansen@users.sourceforge.net Sun Aug 5 23:31:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 05 Aug 2001 15:31:21 -0700 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv4506 Modified Files: setup.py Log Message: Replace moddir and incdir by moddirlist and incdirlist, lists of source and include directories that are searched for modules. This is needed because the Mac modules and include files live in the Mac subtree. In addition (and that's actually what the mod is all about) on OSX we build all the Mac extension modules. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** setup.py 2001/07/26 21:34:59 1.44 --- setup.py 2001/08/05 22:31:19 1.45 *************** *** 56,59 **** --- 56,69 ---- return len(extlist) + def find_module_file(module, dirlist): + """Find a module in a set of possible folders. If it is not found + return the unadorned filename""" + list = find_file(module, [], dirlist) + if not list: + return module + if len(list) > 1: + self.announce("WARNING: multiple copies of %s found"%module) + return os.path.join(list[0], module) + class PyBuildExt(build_ext): *************** *** 77,80 **** --- 87,101 ---- srcdir = os.path.normpath(srcdir) moddir = os.path.normpath(moddir) + + moddirlist = [moddir] + incdirlist = ['./Include'] + + # Platform-dependent module source and include directories + platform = self.get_platform() + if platform == 'darwin1': + # Mac OS X also includes some mac-specific modules + macmoddir = os.path.join(os.getcwd(), srcdir, 'Mac/Modules') + moddirlist.append(macmoddir) + incdirlist.append('./Mac/Include') # Fix up the paths for scripts, too *************** *** 83,90 **** for ext in self.extensions[:]: ! ext.sources = [ os.path.join(moddir, filename) for filename in ext.sources ] ! ext.include_dirs.append( '.' ) # to get pyconfig.h ! ext.include_dirs.append( os.path.join(srcdir, './Include') ) # If a module has already been built statically, --- 104,112 ---- for ext in self.extensions[:]: ! ext.sources = [ find_module_file(filename, moddirlist) for filename in ext.sources ] ! ext.include_dirs.append( '.' ) # to get config.h ! for incdir in incdirlist: ! ext.include_dirs.append( os.path.join(srcdir, incdir) ) # If a module has already been built statically, *************** *** 174,178 **** if platform in ['Darwin1.2', 'beos']: math_libs = [] ! # XXX Omitted modules: gl, pure, dl, SGI-specific modules --- 196,200 ---- if platform in ['Darwin1.2', 'beos']: math_libs = [] ! # XXX Omitted modules: gl, pure, dl, SGI-specific modules *************** *** 517,521 **** # SunOS specific modules exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) ) ! self.extensions.extend(exts) --- 539,578 ---- # SunOS specific modules exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) ) ! ! if platform == 'darwin1': ! # Mac OS X specific modules. These are ported over from MacPython ! # and still experimental. Some (such as gestalt or icglue) are ! # already generally useful, some (the GUI ones) really need to ! # be used from a framework. ! exts.append( Extension('gestalt', ['gestaltmodule.c']) ) ! exts.append( Extension('MacOS', ['macosmodule.c']) ) ! exts.append( Extension('icglue', ['icgluemodule.c']) ) ! exts.append( Extension('macfs', ['macfsmodule.c', '../Python/getapplbycreator.c']) ) ! exts.append( Extension('Nav', ['Nav.c']) ) ! exts.append( Extension('AE', ['ae/AEmodule.c']) ) ! exts.append( Extension('App', ['app/Appmodule.c']) ) ! exts.append( Extension('CF', ['cf/CFmodule.c'], ! extra_link_args=['-framework', 'CoreFoundation']) ) ! exts.append( Extension('Cm', ['cm/Cmmodule.c']) ) ! exts.append( Extension('Ctl', ['ctl/Ctlmodule.c']) ) ! exts.append( Extension('Dlg', ['dlg/Dlgmodule.c']) ) ! exts.append( Extension('Drag', ['drag/Dragmodule.c']) ) ! exts.append( Extension('Evt', ['evt/Evtmodule.c']) ) ! exts.append( Extension('Fm', ['fm/Fmmodule.c']) ) ! exts.append( Extension('Icn', ['icn/Icnmodule.c']) ) ! exts.append( Extension('List', ['list/Listmodule.c']) ) ! exts.append( Extension('Menu', ['menu/Menumodule.c']) ) ! exts.append( Extension('Mlte', ['mlte/Mltemodule.c']) ) ! exts.append( Extension('Qd', ['qd/Qdmodule.c']) ) ! exts.append( Extension('Qdoffs', ['qdoffs/Qdoffsmodule.c']) ) ! exts.append( Extension('Qt', ['qt/Qtmodule.c'], ! extra_link_args=['-framework', 'QuickTime']) ) ! exts.append( Extension('Res', ['res/Resmodule.c'] ) ) ! ## exts.append( Extension('Scrap', ['scrap/Scrapmodule.c']) ) ! exts.append( Extension('Snd', ['snd/Sndmodule.c']) ) ! exts.append( Extension('TE', ['te/TEmodule.c']) ) ! ## exts.append( Extension('waste', ['waste/wastemodule.c']) ) ! exts.append( Extension('Win', ['win/Winmodule.c']) ) ! self.extensions.extend(exts) From tim_one@users.sourceforge.net Mon Aug 6 00:05:23 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 05 Aug 2001 16:05:23 -0700 Subject: [Python-checkins] CVS: python/nondist/sf-html sf-faq.html,1.21,1.22 Message-ID: Update of /cvsroot/python/python/nondist/sf-html In directory usw-pr-cvs1:/tmp/cvs-serv10095 Modified Files: sf-faq.html Log Message: One place that mentions diff neglected to punch you in the face with -c. Index: sf-faq.html =================================================================== RCS file: /cvsroot/python/python/nondist/sf-html/sf-faq.html,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** sf-faq.html 2001/04/29 17:15:44 1.21 --- sf-faq.html 2001/08/05 23:05:21 1.22 *************** *** 419,423 ****

! cvs diff | tee ~/name_of_the_patch.diff
Else you can use the diff util which comes with most operating systems (a Windows version is available as part of the cygwin tools).
--- 419,423 ----
! cvs diff -c | tee ~/name_of_the_patch.diff
Else you can use the diff util which comes with most operating systems (a Windows version is available as part of the cygwin tools).
From jackjansen@users.sourceforge.net Mon Aug 6 11:08:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 06 Aug 2001 03:08:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/idle config-mac.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/idle In directory usw-pr-cvs1:/tmp/cvs-serv22618/python/Tools/idle Added Files: config-mac.txt Log Message: Oops, this file was apparently never added to the repository. Now it is. --- NEW FILE: config-mac.txt --- [EditorWindow] font-name= monaco font-size= 9 From jvr@users.sourceforge.net Mon Aug 6 12:12:20 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Mon, 06 Aug 2001 04:12:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyConsole.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv1906 Modified Files: PyConsole.py Log Message: Show the MacPython IDE version in the interactive banner. Index: PyConsole.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyConsole.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyConsole.py 2001/06/19 21:37:32 1.6 --- PyConsole.py 2001/08/06 11:12:18 1.7 *************** *** 48,53 **** def open(self): W.EditText.open(self) ! self.write('Python ' + sys.version + '\nType "copyright", "credits" or "license" for more information.\n') self.write(sys.ps1) self.flush() --- 48,56 ---- def open(self): + import __main__ W.EditText.open(self) ! self.write('Python %s\n' % sys.version) ! self.write('Type "copyright", "credits" or "license" for more information.\n') ! self.write('MacPython IDE %s\n' % __main__.__version__) self.write(sys.ps1) self.flush() From jackjansen@users.sourceforge.net Mon Aug 6 16:32:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 06 Aug 2001 08:32:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macfsmodule.c,1.39,1.40 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv4472/python/Mac/Modules Modified Files: macfsmodule.c Log Message: Oops, arg type for the glue routine was wrong. Index: macfsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macfsmodule.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** macfsmodule.c 2001/08/03 15:39:27 1.39 --- macfsmodule.c 2001/08/06 15:32:30 1.40 *************** *** 1284,1288 **** PyObject *m, *d; ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Handle, PyMac_GetFSSpec); /* Create the module and add the functions */ --- 1284,1288 ---- PyObject *m, *d; ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSSpec, PyMac_GetFSSpec); /* Create the module and add the functions */ From gvanrossum@users.sourceforge.net Mon Aug 6 17:50:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 06 Aug 2001 09:50:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.20,2.21 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv26268 Modified Files: typeobject.c Log Message: A totally new way to do the __new__ wrapper. This should address the problem brought up in SF bug #444229. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.20 retrieving revision 2.21 diff -C2 -d -r2.20 -r2.21 *** typeobject.c 2001/08/02 15:31:58 2.20 --- typeobject.c 2001/08/06 16:50:37 2.21 *************** *** 940,968 **** static int - add_staticmethodwrappers(PyTypeObject *type, struct wrapperbase *base, - void *wrapped) - { - PyObject *dict = type->tp_defined; - PyObject *sm; - - for (; base->name != NULL; base++) { - PyObject *descr; - if (PyDict_GetItemString(dict, base->name)) - continue; - descr = PyDescr_NewWrapper(type->ob_type, base, wrapped); - if (descr == NULL) - return -1; - sm = PyStaticMethod_New(descr); - Py_DECREF(descr); - if (sm == NULL) - return -1; - if (PyDict_SetItemString(dict, base->name, sm) < 0) - return -1; - Py_DECREF(sm); - } - return 0; - } - - static int add_members(PyTypeObject *type, struct memberlist *memb) { --- 940,943 ---- *************** *** 1198,1202 **** /* Initialize the base class */ ! if (base) { if (PyType_InitDict(base) < 0) return -1; --- 1173,1177 ---- /* Initialize the base class */ ! if (base && base->tp_dict == NULL) { if (PyType_InitDict(base) < 0) return -1; *************** *** 1854,1870 **** static PyObject * ! wrap_new(PyObject *type, PyObject *args, void *wrapped) { ! newfunc new = (newfunc)wrapped; ! return new((PyTypeObject *)type, args, NULL); } ! static struct wrapperbase tab_new[] = { ! {"__new__", (wrapperfunc)wrap_new, ! "T.__new__() -> an object with type T"}, {0} }; static int add_operators(PyTypeObject *type) { --- 1829,1882 ---- static PyObject * ! tp_new_wrapper(PyObject *self, PyObject *args, PyObject *kwds) { ! PyTypeObject *type, *subtype; ! PyObject *arg0, *res; ! ! if (self == NULL || !PyType_Check(self)) ! Py_FatalError("__new__() called with non-type 'self'"); ! type = (PyTypeObject *)self; ! if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 1) { ! PyErr_SetString(PyExc_TypeError, ! "T.__new__(): not enough arguments"); ! return NULL; ! } ! arg0 = PyTuple_GET_ITEM(args, 0); ! if (!PyType_Check(arg0)) { ! PyErr_SetString(PyExc_TypeError, ! "T.__new__(S): S is not a type object"); ! return NULL; ! } ! subtype = (PyTypeObject *)arg0; ! if (!PyType_IsSubtype(subtype, type)) { ! PyErr_SetString(PyExc_TypeError, ! "T.__new__(S): S is not a subtype of T"); ! return NULL; ! } ! args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); ! if (args == NULL) ! return NULL; ! res = type->tp_new(subtype, args, kwds); ! Py_DECREF(args); ! return res; } ! static struct PyMethodDef tp_new_methoddef[] = { ! {"__new__", (PyCFunction)tp_new_wrapper, METH_KEYWORDS, ! "T.__new__(S, ...) -> a new object with type S, a subtype of T"}, {0} }; static int + add_tp_new_wrapper(PyTypeObject *type) + { + PyObject *func = PyCFunction_New(tp_new_methoddef, (PyObject *)type); + + if (func == NULL) + return -1; + return PyDict_SetItemString(type->tp_defined, "__new__", func); + } + + static int add_operators(PyTypeObject *type) { *************** *** 1956,1961 **** if (type->tp_new != NULL) ! add_staticmethodwrappers(type, tab_new, ! (void *)(type->tp_new)); return 0; --- 1968,1972 ---- if (type->tp_new != NULL) ! add_tp_new_wrapper(type); return 0; From akuchling@users.sourceforge.net Mon Aug 6 18:42:55 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 06 Aug 2001 10:42:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc vgrindefs,3.3,3.4 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv8103 Modified Files: vgrindefs Log Message: Add 'yield' as a keyword Fix typo in comment Index: vgrindefs =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/vgrindefs,v retrieving revision 3.3 retrieving revision 3.4 diff -C2 -d -r3.3 -r3.4 *** vgrindefs 1997/11/11 16:36:14 3.3 --- vgrindefs 2001/08/06 17:42:53 3.4 *************** *** 1,3 **** ! # vgrind is a prety-printer that takes source code and outputs # eye-pleasing postscript. The entry below should be added to your # local vgrindefs file. Contributed by Neale Pickett . --- 1,3 ---- ! # vgrind is a pretty-printer that takes source code and outputs # eye-pleasing postscript. The entry below should be added to your # local vgrindefs file. Contributed by Neale Pickett . *************** *** 8,10 **** :kw=assert and break class continue def del elif else except\ exec finally for from global if import in is lambda not or\ ! pass print raise return try while: --- 8,10 ---- :kw=assert and break class continue def del elif else except\ exec finally for from global if import in is lambda not or\ ! pass print raise return try while yield: From akuchling@users.sourceforge.net Mon Aug 6 18:43:51 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 06 Aug 2001 10:43:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc cheatsheet,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv8463 Modified Files: cheatsheet Log Message: Update cheatsheet to 2.0 from Brunning/Gruet's quick reference Index: cheatsheet =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/cheatsheet,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cheatsheet 1994/08/05 15:57:31 1.1 --- cheatsheet 2001/08/06 17:43:49 1.2 *************** *** 1,541 **** ! A Python Bestiary ! Itemizing Python Objects and Nuances - $Revision$ $Date$ ken.manheimer@nist.gov - Notable lexical entities - ======================== ! Keywords [...2730 lines suppressed...] ! 4 def run(): ! 5 global r ! 6 r = 0 ! 7 x = div(3) ! 8 print x ! [EOF] ! (Pdb) print r ! 0 ! (Pdb) q ! >>> pdb.runcall(rm.run) ! etc. ! ! Quirks ! ! Breakpoints are stored as filename, line number tuples. If a module is reloaded ! after editing, any remembered breakpoints are likely to be wrong. ! ! Always single-steps through top-most stack frame. That is, "c" acts like "n". ! ! From akuchling@users.sourceforge.net Mon Aug 6 19:44:58 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 06 Aug 2001 11:44:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc BLURB,1.4,NONE BLURB.LUTZ,1.1,NONE BLURB.WINDOWS,3.1,NONE HYPE,1.1,NONE editline-fix,1.1,NONE fixfuncptrs.sh,1.1,NONE comparisons,3.1,NONE faq2html.py,1.4,NONE renumber.py,1.3,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv6758 Removed Files: BLURB BLURB.LUTZ BLURB.WINDOWS HYPE editline-fix fixfuncptrs.sh comparisons faq2html.py renumber.py Log Message: Remove various outdated files. (Leaving find_recursionlimit.py alone, as Neil pointed out it isn't the same as sys.getrecursionlimit) --- BLURB DELETED --- --- BLURB.LUTZ DELETED --- --- BLURB.WINDOWS DELETED --- --- HYPE DELETED --- --- editline-fix DELETED --- --- fixfuncptrs.sh DELETED --- --- comparisons DELETED --- --- faq2html.py DELETED --- --- renumber.py DELETED --- From gvanrossum@users.sourceforge.net Mon Aug 6 19:51:40 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 06 Aug 2001 11:51:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.115,2.116 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv10310 Modified Files: fileobject.c Log Message: Remove spurious "closed" attribute definition from the memberlist table. (reported as an aside in SF #446049). Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.115 retrieving revision 2.116 diff -C2 -d -r2.115 -r2.116 *** fileobject.c 2001/08/02 04:15:00 2.115 --- fileobject.c 2001/08/06 18:51:38 2.116 *************** *** 1269,1273 **** {"name", T_OBJECT, OFF(f_name), RO}, /* getattr(f, "closed") is implemented without this table */ - {"closed", T_INT, 0, RO}, {NULL} /* Sentinel */ }; --- 1269,1272 ---- From akuchling@users.sourceforge.net Mon Aug 6 19:55:24 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 06 Aug 2001 11:55:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools README,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Tools In directory usw-pr-cvs1:/tmp/cvs-serv12090 Modified Files: README Log Message: Update listing of subdirectories Update link to a running instance of the FAQwizard Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/README,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** README 2000/09/25 17:59:56 1.7 --- README 2001/08/06 18:55:22 1.8 *************** *** 2,5 **** --- 2,11 ---- while building or extending Python. + audiopy Audiopy is a program to control the Solaris audio + device, allowing you to choose both the input and + output devices, and to set the output volume, that can + be run either as a command-line script, or as a + Tkinter application. + bgen Generate complete extension modules from a description. Still under development! *************** *** 10,21 **** faqwiz FAQ Wizard. ! See http://grail.cnri.reston.va.us/cgi-bin/faqw.py for a live example. freeze Create a stand-alone executable from a Python program. modulator Interactively generate boiler plate for an extension module. Works easiest if you have Tk. scripts A number of useful single-file programs, e.g. tabnanny.py (by Tim Peters), which checks for inconsistent mixing --- 16,36 ---- faqwiz FAQ Wizard. ! See http://www.python.org/cgi-bin/faqw.py for a live example. freeze Create a stand-alone executable from a Python program. + i18n Tools for internationalization. pygettext.py + parses Python source code and generates .pot files, + and msgfmt.py generates a binary message catalog + from a catalog in text format. + + idle A Tkinter-based Python IDE. + modulator Interactively generate boiler plate for an extension module. Works easiest if you have Tk. + pynche A Tkinter-based color editor. + scripts A number of useful single-file programs, e.g. tabnanny.py (by Tim Peters), which checks for inconsistent mixing *************** *** 29,30 **** --- 44,50 ---- webchecker A link checker for web sites. + + world Script to take a list of Internet addresses and print + out where in the world those addresses originate from, + based on the top-level domain country code found in + the address. From akuchling@users.sourceforge.net Mon Aug 6 20:33:55 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 06 Aug 2001 12:33:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools README,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Tools In directory usw-pr-cvs1:/tmp/cvs-serv30111 Modified Files: README Log Message: Tabify the file (pointed out by Thomas Wouters) Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/README,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** README 2001/08/06 18:55:22 1.8 --- README 2001/08/06 19:33:52 1.9 *************** *** 2,17 **** while building or extending Python. ! audiopy Audiopy is a program to control the Solaris audio ! device, allowing you to choose both the input and ! output devices, and to set the output volume, that can ! be run either as a command-line script, or as a ! Tkinter application. bgen Generate complete extension modules from a description. Still under development! ! compiler A Python source to bytecode compiler written in ! Python, including an interface for manipulating ! abstract syntax trees. Still under development. faqwiz FAQ Wizard. --- 2,17 ---- while building or extending Python. ! audiopy Audiopy is a program to control the Solaris audio ! device, allowing you to choose both the input and ! output devices, and to set the output volume, that can ! be run either as a command-line script, or as a ! Tkinter application. bgen Generate complete extension modules from a description. Still under development! ! compiler A Python source to bytecode compiler written in ! Python, including an interface for manipulating ! abstract syntax trees. Still under development. faqwiz FAQ Wizard. *************** *** 21,35 **** freeze Create a stand-alone executable from a Python program. ! i18n Tools for internationalization. pygettext.py ! parses Python source code and generates .pot files, ! and msgfmt.py generates a binary message catalog ! from a catalog in text format. ! idle A Tkinter-based Python IDE. modulator Interactively generate boiler plate for an extension ! module. Works easiest if you have Tk. ! pynche A Tkinter-based color editor. scripts A number of useful single-file programs, e.g. tabnanny.py --- 21,35 ---- freeze Create a stand-alone executable from a Python program. ! i18n Tools for internationalization. pygettext.py ! parses Python source code and generates .pot files, ! and msgfmt.py generates a binary message catalog ! from a catalog in text format. ! idle A Tkinter-based Python IDE. modulator Interactively generate boiler plate for an extension ! module. Works easiest if you have Tk. ! pynche A Tkinter-based color editor. scripts A number of useful single-file programs, e.g. tabnanny.py *************** *** 45,50 **** webchecker A link checker for web sites. ! world Script to take a list of Internet addresses and print ! out where in the world those addresses originate from, ! based on the top-level domain country code found in ! the address. --- 45,50 ---- webchecker A link checker for web sites. ! world Script to take a list of Internet addresses and print ! out where in the world those addresses originate from, ! based on the top-level domain country code found in ! the address. From jhylton@users.sourceforge.net Mon Aug 6 20:45:42 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 06 Aug 2001 12:45:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.208,2.209 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv3254 Modified Files: compile.c Log Message: Fix SF bug [ #445474 ] warn about import * inside functions Reported by the Man himself. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.208 retrieving revision 2.209 diff -C2 -d -r2.208 -r2.209 *** compile.c 2001/07/16 16:53:08 2.208 --- compile.c 2001/08/06 19:45:40 2.209 *************** *** 5295,5298 **** --- 5295,5303 ---- } if (TYPE(CHILD(n, 3)) == STAR) { + if (st->st_cur->ste_type != TYPE_MODULE) { + symtable_warn(st, + "import * not allowed inside function"); + return; + } st->st_cur->ste_optimized |= OPT_IMPORT_STAR; st->st_cur->ste_opt_lineno = n->n_lineno; From jhylton@users.sourceforge.net Mon Aug 6 20:55:19 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 06 Aug 2001 12:55:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.209,2.210 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv7722 Modified Files: compile.c Log Message: Fix error message for import * in function/class scope Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.209 retrieving revision 2.210 diff -C2 -d -r2.209 -r2.210 *** compile.c 2001/08/06 19:45:40 2.209 --- compile.c 2001/08/06 19:55:17 2.210 *************** *** 5297,5301 **** if (st->st_cur->ste_type != TYPE_MODULE) { symtable_warn(st, ! "import * not allowed inside function"); return; } --- 5297,5301 ---- if (st->st_cur->ste_type != TYPE_MODULE) { symtable_warn(st, ! "import * only allowed at module level"); return; } From tim_one@users.sourceforge.net Mon Aug 6 21:01:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 06 Aug 2001 13:01:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.74,1.75 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv9063 Modified Files: python20.wse Log Message: + Turn off patch creation (this isn't a patch release! got turned on by mistake). + Arrange for Win2K Add/Remove to show a Python icon. I think this "does it" -- a full install/uninstall can now be done on a Win2K box from an ordinary (not Admin, not Power User) user acct, incl. file extension registration, Start Menu entries, and full Add/Remove. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** python20.wse 2001/08/05 13:58:48 1.74 --- python20.wse 2001/08/06 20:01:19 1.75 *************** *** 13,20 **** Message Font=MS Sans Serif Font Size=8 ! Pages Modified=00010000011101000000000100000011 Extra Pages=00000000000000000000000010110010 Disk Filename=SETUP ! Patch Flags=0000000000000001 Patch Threshold=85 Patch Memory=4000 --- 13,20 ---- Message Font=MS Sans Serif Font Size=8 ! Pages Modified=00010000011101000000000100000111 Extra Pages=00000000000000000000000010110010 Disk Filename=SETUP ! Patch Flags=0000000000001001 Patch Threshold=85 Patch Memory=4000 *************** *** 26,30 **** Version Company=PythonLabs at Zope Corporation Crystal Format=10111100101100000010001001001001 ! Step View=&Properties Variable Name1=_WISE_ Variable Description1=WISE root directory --- 26,30 ---- Version Company=PythonLabs at Zope Corporation Crystal Format=10111100101100000010001001001001 ! Step View=&All Variable Name1=_WISE_ Variable Description1=WISE root directory *************** *** 703,707 **** Text French= Text German=&Ja ! Text German=N&ein Text German= Text Portuguese=&Sim --- 703,707 ---- Text French= Text German=&Ja ! Text German=N&ein Text German= Text Portuguese=&Sim *************** *** 876,880 **** Text=Cancel Text French=Annuler ! Text German=Abbrechen Text Portuguese=Cancelar Text Spanish=Cancelar --- 876,880 ---- Text=Cancel Text French=Annuler ! Text German=Abbrechen Text Portuguese=Cancelar Text Spanish=Cancelar *************** *** 946,950 **** Text French=Python utility scripts (Tools/) Text French=Python test suite (Lib/test/) - Text French=Register file extensons (requires Admin privs) Text French= Text German=Python interpreter, library and IDLE --- 946,949 ---- *************** *** 952,956 **** Text German=Python utility scripts (Tools/) Text German=Python test suite (Lib/test/) - Text German=Register file extensons (requires Admin privs) Text German= Text Spanish=Python interpreter, library and IDLE --- 951,954 ---- *************** *** 958,962 **** Text Spanish=Python utility scripts (Tools/) Text Spanish=Python test suite (Lib/test/) - Text Spanish=Register file extensons (requires Admin privs) Text Spanish= Text Italian=Python interpreter, library and IDLE --- 956,959 ---- *************** *** 964,968 **** Text Italian=Python utility scripts (Tools/) Text Italian=Python test suite (Lib/test/) - Text Italian=Register file extensons (requires Admin privs) Text Italian= end --- 961,964 ---- *************** *** 1182,1189 **** Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18 Text=Select Start Menu Group ! Text French=Sélectionner le groupe du Gestionnaire de programme Text German=Bestimmung der Programm-Managergruppe Text Spanish=Seleccione grupo del Administrador de programas ! Text Italian=Selezionare il gruppo ProgMan end item: Static --- 1178,1185 ---- Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18 Text=Select Start Menu Group ! Text French=Sélectionner le groupe du Gestionnaire de programme Text German=Bestimmung der Programm-Managergruppe Text Spanish=Seleccione grupo del Administrador de programas ! Text Italian=Selezionare il gruppo ProgMan end item: Static *************** *** 1357,1361 **** end item: Remark ! Text=Begin writing to the INSTALL.LOG end item: Open/Close INSTALL.LOG --- 1353,1357 ---- end item: Remark ! Text=Begin writing to the INSTALL.LOG end item: Open/Close INSTALL.LOG *************** *** 1555,1558 **** --- 1551,1572 ---- end item: Remark + Text=Icons -- always install so that the uninstaller can use them for its own display. + end + item: Install File + Source=..\pc\pycon.ico + Destination=%MAINDIR%\pycon.ico + Flags=0000000010000010 + end + item: Install File + Source=..\pc\pyc.ico + Destination=%MAINDIR%\pyc.ico + Flags=0000000010000010 + end + item: Install File + Source=..\pc\py.ico + Destination=%MAINDIR%\py.ico + Flags=0000000010000010 + end + item: Remark end item: Remark *************** *** 1780,1794 **** end item: Remark - Text=Icons - end - item: Install File - Source=..\pc\*.ico - Destination=%MAINDIR% - Description=Icons - Flags=0000000000000010 - end - item: Remark - end - item: Remark Text=Libraries (Lib/) end --- 1794,1797 ---- *************** *** 2595,2598 **** --- 2598,2608 ---- Root=2 end + item: Edit Registry + Total Keys=1 + Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% + New Value=%MAINDIR%\py.ico,-0 + Value Name=DisplayIcon + Root=2 + end item: Else Statement end *************** *** 2625,2628 **** --- 2635,2645 ---- Root=1 end + item: Edit Registry + Total Keys=1 + Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\%APPTITLE% + New Value=%MAINDIR%\py.ico,-0 + Value Name=DisplayIcon + Root=1 + end item: End Block end *************** *** 2702,2705 **** --- 2719,2727 ---- item: Self-Register OCXs/DLLs Description=Updating System Configuration, Please Wait... + end + item: Remark + end + item: Add Text to INSTALL.LOG + Text=Delete in-use files: On end item: Remark From jhylton@users.sourceforge.net Mon Aug 6 21:34:27 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 06 Aug 2001 13:34:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.210,2.211 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv25663 Modified Files: compile.c Log Message: Another bug fix for recent import * warning (caught by Thomas Wouters) Only return if symtable_warn() returns -1, indicating that the warning was turned into an error. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.210 retrieving revision 2.211 diff -C2 -d -r2.210 -r2.211 *** compile.c 2001/08/06 19:55:17 2.210 --- compile.c 2001/08/06 20:34:25 2.211 *************** *** 5296,5302 **** if (TYPE(CHILD(n, 3)) == STAR) { if (st->st_cur->ste_type != TYPE_MODULE) { ! symtable_warn(st, ! "import * only allowed at module level"); ! return; } st->st_cur->ste_optimized |= OPT_IMPORT_STAR; --- 5296,5302 ---- if (TYPE(CHILD(n, 3)) == STAR) { if (st->st_cur->ste_type != TYPE_MODULE) { ! if (symtable_warn(st, ! "import * only allowed at module level") < 0) ! return; } st->st_cur->ste_optimized |= OPT_IMPORT_STAR; From gvanrossum@users.sourceforge.net Tue Aug 7 03:52:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 06 Aug 2001 19:52:39 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0238.txt,1.14,1.15 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv23368 Modified Files: pep-0238.txt Log Message: Discuss x \ y as rejected variation; reorganize the section on variations slightly to allow more easily adding new variations. Add more discussion of why I don't like version directives. Index: pep-0238.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0238.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pep-0238.txt 2001/08/01 16:03:14 1.14 --- pep-0238.txt 2001/08/07 02:52:37 1.15 *************** *** 125,135 **** Aesthetically, x//y doesn't please everyone, and hence several ! variations have been proposed: x div y, or div(x, y), sometimes in ! combination with x mod y or mod(x, y) as an alternative spelling ! for x%y. ! ! We consider these solutions inferior, on the following grounds. ! - Using x div y would introduce a new keyword. Since div is a popular identifier, this would break a fair amount of existing code, unless the new keyword was only recognized under a future --- 125,131 ---- Aesthetically, x//y doesn't please everyone, and hence several ! variations have been proposed. They are addressed here: ! - x div y. This would introduce a new keyword. Since div is a popular identifier, this would break a fair amount of existing code, unless the new keyword was only recognized under a future *************** *** 141,145 **** this. ! - Using div(x, y) makes the conversion of old code much harder. Replacing x/y with x//y or x div y can be done with a simple query replace; in most cases the programmer can easily verify --- 137,141 ---- this. ! - div(x, y). This makes the conversion of old code much harder. Replacing x/y with x//y or x div y can be done with a simple query replace; in most cases the programmer can easily verify *************** *** 152,155 **** --- 148,156 ---- placement of the "div(" and ")" part can be decided. + - x \ y. The backslash is already a token, meaning line + continuation, and in general it suggests an "escape" to Unix + eyes. In addition (this due to terry Reedy) this would make + things like eval("x\y") harder to get right. + Alternatives *************** *** 191,195 **** do so for multiple versions within the same interpreter. This is way too much work. A much simpler solution is to keep ! multiple interpreters installed. --- 192,201 ---- do so for multiple versions within the same interpreter. This is way too much work. A much simpler solution is to keep ! multiple interpreters installed. Another argument against this ! is that the version directive is almost always overspecified: ! most code written for Python X.Y, works for Python X.(Y-1) and ! X.(Y+1) as well, so specifying X.Y as a version is more ! constraining than it needs to be. At the same time, there's no ! way to know at which future or past version the code will break. From jackjansen@users.sourceforge.net Tue Aug 7 13:33:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 05:33:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.mcp,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv17894/python/Mac/Build Modified Files: PythonCore.mcp Log Message: Bit the bullet and enabled garbage collection (finally). Also updated pyconfig.h to the current state of pyconfig.h.in. Index: PythonCore.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.mcp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 Binary files /tmp/cvs6hcn9I and /tmp/cvsEhKrah differ From jackjansen@users.sourceforge.net Tue Aug 7 13:33:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 05:33:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCoreCarbon.exp,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv17965/python/Mac/Build Modified Files: PythonCoreCarbon.exp Log Message: Bit the bullet and enabled garbage collection (finally). Also updated pyconfig.h to the current state of pyconfig.h.in. Index: PythonCoreCarbon.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCoreCarbon.exp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PythonCoreCarbon.exp 2001/08/03 13:05:18 1.9 --- PythonCoreCarbon.exp 2001/08/07 12:33:15 1.10 *************** *** 480,487 **** PyObject_Str PyObject_Repr _PyObject_Dump PyObject_Print - _PyGC_Remove - _PyGC_Insert _PyObject_Del _PyObject_NewVar --- 480,486 ---- PyObject_Str PyObject_Repr + _PyGC_Dump _PyObject_Dump PyObject_Print _PyObject_Del _PyObject_NewVar *************** *** 621,624 **** --- 620,624 ---- PyMac_AppearanceCompliant PyMac_OSErrException + PyMacGluePtr_PyMac_GetFSSpec PyMacGluePtr_AEDesc_New PyMacGluePtr_AEDesc_Convert *************** *** 713,716 **** --- 713,717 ---- AEDesc_Convert AEDesc_New + PyMac_GetFSSpec PyMac_Buildwide PyMac_Getwide *************** *** 784,788 **** newmfsrobject newmfssobject ! PyMac_GetFSSpec initmac initMacOS --- 785,789 ---- newmfsrobject newmfssobject ! _PyMac_GetFSSpec initmac initMacOS *************** *** 1041,1044 **** --- 1042,1048 ---- PyDescr_NewMember PyDescr_NewMethod + initgc + _PyGC_Remove + _PyGC_Insert GUSISetupConsoleStdio GUSIStdioFlush From jackjansen@users.sourceforge.net Tue Aug 7 13:33:24 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 05:33:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.exp,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv18040/python/Mac/Build Modified Files: PythonCore.exp Log Message: Bit the bullet and enabled garbage collection (finally). Also updated pyconfig.h to the current state of pyconfig.h.in. Index: PythonCore.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.exp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PythonCore.exp 2001/08/03 13:05:11 1.9 --- PythonCore.exp 2001/08/07 12:33:22 1.10 *************** *** 480,487 **** PyObject_Str PyObject_Repr _PyObject_Dump PyObject_Print - _PyGC_Remove - _PyGC_Insert _PyObject_Del _PyObject_NewVar --- 480,486 ---- PyObject_Str PyObject_Repr + _PyGC_Dump _PyObject_Dump PyObject_Print _PyObject_Del _PyObject_NewVar *************** *** 621,624 **** --- 620,624 ---- PyMac_AppearanceCompliant PyMac_OSErrException + PyMacGluePtr_PyMac_GetFSSpec PyMacGluePtr_AEDesc_New PyMacGluePtr_AEDesc_Convert *************** *** 713,716 **** --- 713,717 ---- AEDesc_Convert AEDesc_New + PyMac_GetFSSpec PyMac_Buildwide PyMac_Getwide *************** *** 789,795 **** PyMac_BuildFSRef PyMac_GetFSRef - newmfsrobject newmfssobject ! PyMac_GetFSSpec initmac initMacOS --- 790,795 ---- PyMac_BuildFSRef PyMac_GetFSRef newmfssobject ! _PyMac_GetFSSpec initmac initMacOS *************** *** 1048,1051 **** --- 1048,1054 ---- PyDescr_NewMember PyDescr_NewMethod + initgc + _PyGC_Remove + _PyGC_Insert GUSISetupConsoleStdio GUSIStdioFlush From jackjansen@users.sourceforge.net Tue Aug 7 13:33:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 05:33:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macgetcompiler.c,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv18140/python/Mac/Python Modified Files: macgetcompiler.c Log Message: Bit the bullet and enabled garbage collection (finally). Also updated pyconfig.h to the current state of pyconfig.h.in. Index: macgetcompiler.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macgetcompiler.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** macgetcompiler.c 2001/07/27 09:22:03 1.15 --- macgetcompiler.c 2001/08/07 12:33:27 1.16 *************** *** 58,62 **** #endif ! #define COMPILER " [CW" TARGET_API HASGUSI HASTHREAD"]" #endif --- 58,68 ---- #endif ! #ifdef WITH_CYCLE_GC ! #define HASGC " GC" ! #else ! #define HASGC "" ! #endif ! ! #define COMPILER " [CW" TARGET_API HASGUSI HASTHREAD HASGC"]" #endif From jackjansen@users.sourceforge.net Tue Aug 7 13:33:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 05:33:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include pyconfig.h,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv18185/python/Mac/Include Modified Files: pyconfig.h Log Message: Bit the bullet and enabled garbage collection (finally). Also updated pyconfig.h to the current state of pyconfig.h.in. Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/pyconfig.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pyconfig.h 2001/07/27 09:20:34 1.1 --- pyconfig.h 2001/08/07 12:33:32 1.2 *************** *** 130,136 **** #undef C_THREADS - /* Defined when case of imported modules are checked against case of file. */ - #define CHECK_IMPORT_CASE - /* Define to `long' if doesn't define. */ #undef clock_t --- 130,133 ---- *************** *** 149,152 **** --- 146,161 ---- #undef HAVE_ALTZONE + /* Define if --enable-ipv6 is specified */ + #undef ENABLE_IPV6 + + /* Define if sockaddr has sa_len member */ + #undef HAVE_SOCKADDR_SA_LEN + + /* struct addrinfo (netdb.h) */ + #undef HAVE_ADDRINFO + + /* struct sockaddr_storage (sys/socket.h) */ + #undef HAVE_SOCKADDR_STORAGE + /* Defined when any dynamic module loading is enabled */ /* #undef HAVE_DYNAMIC_LOADING */ *************** *** 185,188 **** --- 194,200 ---- #undef HAVE_PTH + /* Define if you have readline 4.2 */ + #undef HAVE_RL_COMPLETION_MATCHES + /* Define if your compiler supports variable length function prototypes (e.g. void fprintf(FILE *, char *, ...);) *and* */ *************** *** 209,212 **** --- 221,227 ---- #define Py_UNICODE_SIZE 2 + /* Define if nice() returns success/failure instead of the new priority. */ + #undef HAVE_BROKEN_NICE + /* Define if malloc(0) returns a NULL pointer */ #ifdef USE_MSL_MALLOC *************** *** 270,274 **** /* Define if you want to compile in cycle garbage collection */ ! #undef WITH_CYCLE_GC /* Define if you want to emulate SGI (IRIX 4) dynamic linking. --- 285,289 ---- /* Define if you want to compile in cycle garbage collection */ ! #define WITH_CYCLE_GC 1 /* Define if you want to emulate SGI (IRIX 4) dynamic linking. *************** *** 295,298 **** --- 310,316 ---- #undef WITH_NEXT_FRAMEWORK + /* Define if you want to use MacPython modules on MacOSX in unix-Python */ + #define USE_TOOLBOX_OBJECT_GLUE + /* Define if you want to use SGI (IRIX 4) dynamic linking. This requires the "dl" library by Jack Jansen, *************** *** 420,423 **** --- 438,444 ---- #undef HAVE_GETLOGIN + /* Define if you have the getnameinfo function. */ + #undef HAVE_GETNAMEINFO + /* Define if you have the getpeername function. */ #ifdef USE_GUSI *************** *** 431,434 **** --- 452,458 ---- #undef HAVE_GETPID + /* Define if you have the getpriority function. */ + #undef HAVE_GETPRIORITY + /* Define if you have the getpwent function. */ #undef HAVE_GETPWENT *************** *** 442,445 **** --- 466,472 ---- #undef HAVE_GETWD + /* Define if you have the hstrerror function. */ + #undef HAVE_HSTRERROR + /* Define if you have the hypot function. */ #ifndef __MC68K__ *************** *** 450,453 **** --- 477,483 ---- #endif + /* Define if you have the inet_pton function. */ + #undef HAVE_INET_PTON + /* Define if you have the kill function. */ #undef HAVE_KILL *************** *** 545,548 **** --- 575,581 ---- #undef HAVE_SIGRELSE + /* Define if you have the snprintf function. */ + #define HAVE_SNPRINTF + /* Define if you have the statvfs function. */ #undef HAVE_STATVFS *************** *** 683,686 **** --- 716,725 ---- /* Define if you have the header file. */ #undef HAVE_SYS_PARAM_H + + /* Define if you have the header file. */ + #undef HAVE_SYS_POLL_H + + /* Define if you have the header file. */ + #undef HAVE_SYS_RESOURCE_H /* Define if you have the header file. */ From jackjansen@users.sourceforge.net Tue Aug 7 14:51:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 06:51:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.mcp,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv15591/python/Mac/Build Modified Files: PythonCore.mcp Log Message: Bit another bullet: all toolbox modules are now in dynamically loaded modules. Everything still seems to work, but the ConfigurePythonXXX on initial install may still need work. Index: PythonCore.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.mcp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 Binary files /tmp/cvsshRyYu and /tmp/cvsamwK8Q differ From jackjansen@users.sourceforge.net Tue Aug 7 14:52:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 06:52:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCoreCarbon.exp,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv15678/python/Mac/Build Modified Files: PythonCoreCarbon.exp Log Message: Bit another bullet: all toolbox modules are now in dynamically loaded modules. Everything still seems to work, but the ConfigurePythonXXX on initial install may still need work. Index: PythonCoreCarbon.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCoreCarbon.exp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PythonCoreCarbon.exp 2001/08/07 12:33:15 1.10 --- PythonCoreCarbon.exp 2001/08/07 13:52:05 1.11 *************** *** 811,856 **** PyMac_FindResourceModule _PyImport_Inittab - CtlObj_chain - Control_Type - initCtl - _CtlObj_Convert - _CtlObj_New - DlgObj_chain - Dialog_Type - initDlg - _DlgObj_Convert - _DlgObj_New - _DlgObj_WhichDialog - MenuObj_chain - Menu_Type - initMenu - _MenuObj_Convert - _MenuObj_New - GrafObj_chain - GrafPort_Type - BMObj_chain - BitMap_Type - QDGlobalsAccess_Type - initQd - BMObj_NewCopied - _BMObj_Convert - _BMObj_New - _GrafObj_Convert - _GrafObj_New - _QdRGB_Convert - _QdRGB_New - ResObj_chain - Resource_Type - initRes - _OptResObj_Convert - _OptResObj_New - _ResObj_Convert - _ResObj_New - WinObj_chain - Window_Type - initWin - _WinObj_WhichWindow - _WinObj_Convert - _WinObj_New PyBuffer_Type PyBuffer_New --- 811,814 ---- *************** *** 999,1021 **** _PyExc_Init initNav - AEDesc_chain - AEDesc_Type - upp_GenericEventHandler - upp_AEIdleProc - initAE - _AEDesc_Convert - _AEDesc_New init_locale - initEvt init_sre initsha - DragObj_chain - DragObj_Type - dragglue_TrackingHandlerUPP - dragglue_ReceiveHandlerUPP - dragglue_SendDataUPP - initDrag - _DragObj_Convert - _DragObj_New initxreadlines PyCell_Type --- 957,963 ---- From jackjansen@users.sourceforge.net Tue Aug 7 14:52:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 06:52:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include macbuildno.h,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv15847/python/Mac/Include Modified Files: macbuildno.h Log Message: Bit another bullet: all toolbox modules are now in dynamically loaded modules. Everything still seems to work, but the ConfigurePythonXXX on initial install may still need work. Index: macbuildno.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/macbuildno.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** macbuildno.h 2001/08/03 13:31:35 1.17 --- macbuildno.h 2001/08/07 13:52:18 1.18 *************** *** 1 **** ! #define BUILD 97 --- 1 ---- ! #define BUILD 101 From jackjansen@users.sourceforge.net Tue Aug 7 14:52:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 06:52:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macconfig.c,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv15960/python/Mac/Modules Modified Files: macconfig.c Log Message: Bit another bullet: all toolbox modules are now in dynamically loaded modules. Everything still seems to work, but the ConfigurePythonXXX on initial install may still need work. Index: macconfig.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macconfig.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** macconfig.c 2001/06/21 14:50:03 1.24 --- macconfig.c 2001/08/07 13:52:31 1.25 *************** *** 81,84 **** --- 81,85 ---- extern void initunicodedata(); extern void init_codecs(); + extern void initNav(); #ifdef USE_MACCTB extern void initctb(); *************** *** 121,125 **** extern void initRes(); extern void initWin(); - extern void initNav(); #endif #ifdef USE_QT --- 122,125 ---- *************** *** 208,211 **** --- 208,212 ---- {"_codecs", init_codecs}, {"sha", initsha}, + {"Nav", initNav}, #ifdef USE_MACCTB {"ctb", initctb}, *************** *** 229,233 **** {"Evt", initEvt}, {"Menu", initMenu}, - {"Nav", initNav}, {"Qd", initQd}, {"Win", initWin}, --- 230,233 ---- From jackjansen@users.sourceforge.net Tue Aug 7 14:52:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 06:52:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_shcarbon_config.h,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv16050/python/Mac/mwerks Modified Files: mwerks_shcarbon_config.h Log Message: Bit another bullet: all toolbox modules are now in dynamically loaded modules. Everything still seems to work, but the ConfigurePythonXXX on initial install may still need work. Index: mwerks_shcarbon_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_shcarbon_config.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mwerks_shcarbon_config.h 2001/05/22 22:21:45 1.3 --- mwerks_shcarbon_config.h 2001/08/07 13:52:35 1.4 *************** *** 16,20 **** #define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */ #define USE_MSL /* Use Mw Standard Library (as opposed to Plaugher C libraries) */ ! #define USE_CORE_TOOLBOX /* Include core toolbox modules (Dlg,Ctl,Menu,Win,Res,Qd) */ /* #define USE_TOOLBOX /* Include all toolbox modules in core Python */ /* #define USE_QT /* Include quicktime modules in core Python */ --- 16,20 ---- #define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */ #define USE_MSL /* Use Mw Standard Library (as opposed to Plaugher C libraries) */ ! /* #define USE_CORE_TOOLBOX /* Include core toolbox modules (Dlg,Ctl,Menu,Win,Res,Qd) */ /* #define USE_TOOLBOX /* Include all toolbox modules in core Python */ /* #define USE_QT /* Include quicktime modules in core Python */ From jackjansen@users.sourceforge.net Tue Aug 7 14:52:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 06:52:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.exp,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv16086/python/Mac/Build Modified Files: PythonCore.exp Log Message: Bit another bullet: all toolbox modules are now in dynamically loaded modules. Everything still seems to work, but the ConfigurePythonXXX on initial install may still need work. Index: PythonCore.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.exp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PythonCore.exp 2001/08/07 12:33:22 1.10 --- PythonCore.exp 2001/08/07 13:52:43 1.11 *************** *** 817,862 **** PyMac_FindResourceModule _PyImport_Inittab - CtlObj_chain - Control_Type - initCtl - _CtlObj_Convert - _CtlObj_New - DlgObj_chain - Dialog_Type - initDlg - _DlgObj_Convert - _DlgObj_New - _DlgObj_WhichDialog - MenuObj_chain - Menu_Type - initMenu - _MenuObj_Convert - _MenuObj_New - GrafObj_chain - GrafPort_Type - BMObj_chain - BitMap_Type - QDGlobalsAccess_Type - initQd - BMObj_NewCopied - _BMObj_Convert - _BMObj_New - _GrafObj_Convert - _GrafObj_New - _QdRGB_Convert - _QdRGB_New - ResObj_chain - Resource_Type - initRes - _OptResObj_Convert - _OptResObj_New - _ResObj_Convert - _ResObj_New - WinObj_chain - Window_Type - initWin - _WinObj_WhichWindow - _WinObj_Convert - _WinObj_New PyBuffer_Type PyBuffer_New --- 817,820 ---- *************** *** 1005,1027 **** _PyExc_Init initNav - AEDesc_chain - AEDesc_Type - upp_GenericEventHandler - upp_AEIdleProc - initAE - _AEDesc_Convert - _AEDesc_New init_locale - initEvt init_sre initsha - DragObj_chain - DragObj_Type - dragglue_TrackingHandlerUPP - dragglue_ReceiveHandlerUPP - dragglue_SendDataUPP - initDrag - _DragObj_Convert - _DragObj_New initxreadlines PyCell_Type --- 963,969 ---- From jackjansen@users.sourceforge.net Tue Aug 7 14:52:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 06:52:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_shared_config.h,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv16160/python/Mac/mwerks Modified Files: mwerks_shared_config.h Log Message: Bit another bullet: all toolbox modules are now in dynamically loaded modules. Everything still seems to work, but the ConfigurePythonXXX on initial install may still need work. Index: mwerks_shared_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_shared_config.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mwerks_shared_config.h 2001/05/22 22:21:41 1.18 --- mwerks_shared_config.h 2001/08/07 13:52:55 1.19 *************** *** 11,15 **** #define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */ #define USE_MSL /* Use Mw Standard Library (as opposed to Plaugher C libraries) */ ! #define USE_CORE_TOOLBOX /* Include core toolbox modules (Dlg,Ctl,Menu,Win,Res,Qd) */ /* #define USE_TOOLBOX /* Include all toolbox modules in core Python */ /* #define USE_QT /* Include quicktime modules in core Python */ --- 11,15 ---- #define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */ #define USE_MSL /* Use Mw Standard Library (as opposed to Plaugher C libraries) */ ! /* #define USE_CORE_TOOLBOX /* Include core toolbox modules (Dlg,Ctl,Menu,Win,Res,Qd) */ /* #define USE_TOOLBOX /* Include all toolbox modules in core Python */ /* #define USE_QT /* Include quicktime modules in core Python */ From jackjansen@users.sourceforge.net Tue Aug 7 14:53:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 06:53:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts genpluginprojects.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv16284/python/Mac/scripts Modified Files: genpluginprojects.py Log Message: Bit another bullet: all toolbox modules are now in dynamically loaded modules. Everything still seems to work, but the ConfigurePythonXXX on initial install may still need work. Index: genpluginprojects.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/genpluginprojects.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** genpluginprojects.py 2001/07/13 20:57:47 1.14 --- genpluginprojects.py 2001/08/07 13:53:10 1.15 *************** *** 106,128 **** # bgen-generated Toolbox modules genpluginproject("ppc", "App", libraries=["AppearanceLib"]) genpluginproject("carbon", "App") - ## genpluginproject("ppc", "Cm", - ## libraries=["QuickTimeLib"], - ## extraexportsymbols=[ - ## "CmpObj_New", - ## "CmpObj_Convert", - ## "CmpInstObj_New", - ## "CmpInstObj_Convert", - ## ]) - ## genpluginproject("carbon", "Cm", - ## extraexportsymbols=[ - ## "CmpObj_New", - ## "CmpObj_Convert", - ## "CmpInstObj_New", - ## "CmpInstObj_Convert", - ## ]) genpluginproject("ppc", "Cm", libraries=["QuickTimeLib"]) genpluginproject("carbon", "Cm") genpluginproject("all", "Fm") genpluginproject("ppc", "Help") --- 106,122 ---- # bgen-generated Toolbox modules + genpluginproject("carbon", "AE") + genpluginproject("ppc", "AE", libraries=["ObjectSupportLib"]) genpluginproject("ppc", "App", libraries=["AppearanceLib"]) genpluginproject("carbon", "App") genpluginproject("ppc", "Cm", libraries=["QuickTimeLib"]) genpluginproject("carbon", "Cm") + genpluginproject("carbon", "Ctl") + genpluginproject("ppc", "Ctl", libraries=["ControlsLib", "AppearanceLib"]) + genpluginproject("carbon", "Dlg") + genpluginproject("ppc", "Dlg", libraries=["DialogsLib", "AppearanceLib"]) + genpluginproject("carbon", "Drag") + genpluginproject("ppc", "Drag", libraries=["DragLib"]) + genpluginproject("all", "Evt") genpluginproject("all", "Fm") genpluginproject("ppc", "Help") *************** *** 130,142 **** genpluginproject("carbon", "Icn") genpluginproject("all", "List") ! ## genpluginproject("ppc", "Qt", libraries=["QuickTimeLib", "Cm.ppc.slb", "Qdoffs.ppc.slb"], ! ## extradirs=["::Plugins"]) genpluginproject("ppc", "Qt", libraries=["QuickTimeLib"]) - ## genpluginproject("carbon", "Qt", libraries=["Cm.carbon.slb", "Qdoffs.carbon.slb"], - ## extradirs=["::Plugins"]) genpluginproject("carbon", "Qt") - ## genpluginproject("all", "Qdoffs", - ## extraexportsymbols=["GWorldObj_New", "GWorldObj_Convert"]) genpluginproject("all", "Qdoffs") genpluginproject("all", "Scrap") genpluginproject("ppc", "Snd", libraries=["SoundLib"]) --- 124,134 ---- genpluginproject("carbon", "Icn") genpluginproject("all", "List") ! genpluginproject("carbon", "Menu") ! genpluginproject("ppc", "Menu", libraries=["MenusLib", "ContextualMenu", "AppearanceLib"]) ! genpluginproject("all", "Qd") genpluginproject("ppc", "Qt", libraries=["QuickTimeLib"]) genpluginproject("carbon", "Qt") genpluginproject("all", "Qdoffs") + genpluginproject("all", "Res") genpluginproject("all", "Scrap") genpluginproject("ppc", "Snd", libraries=["SoundLib"]) *************** *** 147,151 **** genpluginproject("ppc", "Mlte", libraries=["Textension"]) genpluginproject("carbon", "Mlte") ! # Carbon Only? genpluginproject("carbon", "CF") --- 139,144 ---- genpluginproject("ppc", "Mlte", libraries=["Textension"]) genpluginproject("carbon", "Mlte") ! genpluginproject("carbon", "Win") ! genpluginproject("ppc", "Win", libraries=["WindowsLib", "AppearanceLib"]) # Carbon Only? genpluginproject("carbon", "CF") From jackjansen@users.sourceforge.net Tue Aug 7 14:53:27 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 06:53:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts fullbuild.py,1.68,1.69 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv16380/python/Mac/scripts Modified Files: fullbuild.py Log Message: Bit another bullet: all toolbox modules are now in dynamically loaded modules. Everything still seems to work, but the ConfigurePythonXXX on initial install may still need work. Index: fullbuild.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/fullbuild.py,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** fullbuild.py 2001/07/16 22:04:08 1.68 --- fullbuild.py 2001/08/07 13:53:25 1.69 *************** *** 250,266 **** (":Mac:Build:ColorPicker.mcp", "ColorPicker.ppc"), (":Mac:Build:Printing.mcp", "Printing.ppc"), (":Mac:Build:App.mcp", "App.ppc"), (":Mac:Build:Cm.mcp", "Cm.ppc"), (":Mac:Build:Fm.mcp", "Fm.ppc"), (":Mac:Build:Help.mcp", "Help.ppc"), (":Mac:Build:Icn.mcp", "Icn.ppc"), (":Mac:Build:List.mcp", "List.ppc"), (":Mac:Build:Qdoffs.mcp", "Qdoffs.ppc"), (":Mac:Build:Qt.mcp", "Qt.ppc"), (":Mac:Build:Scrap.mcp", "Scrap.ppc"), (":Mac:Build:Snd.mcp", "Snd.ppc"), (":Mac:Build:Sndihooks.mcp", "Sndihooks.ppc"), (":Mac:Build:TE.mcp", "TE.ppc"), ! (":Mac:Build:Mlte.mcp", "Mlte.ppc"), ]), --- 250,275 ---- (":Mac:Build:ColorPicker.mcp", "ColorPicker.ppc"), (":Mac:Build:Printing.mcp", "Printing.ppc"), + (":Mac:Build:AE.mcp", "AE.ppc"), (":Mac:Build:App.mcp", "App.ppc"), (":Mac:Build:Cm.mcp", "Cm.ppc"), + (":Mac:Build:Ctl.mcp", "Ctl.ppc"), + (":Mac:Build:Dlg.mcp", "Dlg.ppc"), + (":Mac:Build:Drag.mcp", "Drag.ppc"), + (":Mac:Build:Evt.mcp", "Evt.ppc"), (":Mac:Build:Fm.mcp", "Fm.ppc"), (":Mac:Build:Help.mcp", "Help.ppc"), (":Mac:Build:Icn.mcp", "Icn.ppc"), (":Mac:Build:List.mcp", "List.ppc"), + (":Mac:Build:Menu.mcp", "Menu.ppc"), + (":Mac:Build:Mlte.mcp", "Mlte.ppc"), + (":Mac:Build:Qd.mcp", "Qd.ppc"), (":Mac:Build:Qdoffs.mcp", "Qdoffs.ppc"), (":Mac:Build:Qt.mcp", "Qt.ppc"), + (":Mac:Build:Res.mcp", "Res.ppc"), (":Mac:Build:Scrap.mcp", "Scrap.ppc"), (":Mac:Build:Snd.mcp", "Snd.ppc"), (":Mac:Build:Sndihooks.mcp", "Sndihooks.ppc"), (":Mac:Build:TE.mcp", "TE.ppc"), ! (":Mac:Build:Win.mcp", "Win.ppc"), ]), *************** *** 278,295 **** ## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), (":Mac:Build:App.carbon.mcp", "App.carbon"), (":Mac:Build:Cm.carbon.mcp", "Cm.carbon"), (":Mac:Build:Fm.carbon.mcp", "Fm.carbon"), (":Mac:Build:Icn.carbon.mcp", "Icn.carbon"), (":Mac:Build:List.carbon.mcp", "List.carbon"), (":Mac:Build:Qdoffs.carbon.mcp", "Qdoffs.carbon"), (":Mac:Build:Qt.carbon.mcp", "Qt.carbon"), (":Mac:Build:Scrap.carbon.mcp", "Scrap.carbon"), (":Mac:Build:Snd.carbon.mcp", "Snd.carbon"), (":Mac:Build:Sndihooks.carbon.mcp", "Sndihooks.carbon"), (":Mac:Build:TE.carbon.mcp", "TE.carbon"), - (":Mac:Build:CF.carbon.mcp", "CF.carbon"), - (":Mac:Build:Mlte.carbon.mcp", "Mlte.carbon"), ]), --- 287,313 ---- ## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), + (":Mac:Build:AE.carbon.mcp", "AE.carbon"), (":Mac:Build:App.carbon.mcp", "App.carbon"), + (":Mac:Build:CF.carbon.mcp", "CF.carbon"), (":Mac:Build:Cm.carbon.mcp", "Cm.carbon"), + (":Mac:Build:Ctl.carbon.mcp", "Ctl.carbon"), + (":Mac:Build:Dlg.carbon.mcp", "Dlg.carbon"), + (":Mac:Build:Drag.carbon.mcp", "Drag.carbon"), + (":Mac:Build:Evt.carbon.mcp", "Evt.carbon"), (":Mac:Build:Fm.carbon.mcp", "Fm.carbon"), (":Mac:Build:Icn.carbon.mcp", "Icn.carbon"), (":Mac:Build:List.carbon.mcp", "List.carbon"), + (":Mac:Build:Menu.carbon.mcp", "Menu.carbon"), + (":Mac:Build:Mlte.carbon.mcp", "Mlte.carbon"), + (":Mac:Build:Qd.carbon.mcp", "Qd.carbon"), (":Mac:Build:Qdoffs.carbon.mcp", "Qdoffs.carbon"), (":Mac:Build:Qt.carbon.mcp", "Qt.carbon"), + (":Mac:Build:Res.carbon.mcp", "Res.carbon"), (":Mac:Build:Scrap.carbon.mcp", "Scrap.carbon"), (":Mac:Build:Snd.carbon.mcp", "Snd.carbon"), (":Mac:Build:Sndihooks.carbon.mcp", "Sndihooks.carbon"), (":Mac:Build:TE.carbon.mcp", "TE.carbon"), + (":Mac:Build:Win.carbon.mcp", "Win.carbon"), ]), From jackjansen@users.sourceforge.net Tue Aug 7 15:13:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:13:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build CF.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv25182/python/Mac/Build Added Files: CF.carbon.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: CF.carbon.mcp.exp --- initCF From jackjansen@users.sourceforge.net Tue Aug 7 15:13:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:13:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build CF.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv25285/python/Mac/Build Added Files: CF.carbon.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: CF.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS CF.carbon Name PythonCoreCarbon MacOS CF.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:14:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:14:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Ctl.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv25522/python/Mac/Build Added Files: Ctl.carbon.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Ctl.carbon.mcp.exp --- initCtl From jackjansen@users.sourceforge.net Tue Aug 7 15:14:23 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:14:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Ctl.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv25640/python/Mac/Build Added Files: Ctl.carbon.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Ctl.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS Ctl.carbon Name PythonCoreCarbon MacOS Ctl.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:14:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:14:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Ctl.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv25790/python/Mac/Build Added Files: Ctl.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Ctl.mcp.exp --- initCtl From jackjansen@users.sourceforge.net Tue Aug 7 15:14:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:14:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Ctl.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv25849/python/Mac/Build Added Files: Ctl.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Ctl.mcp.xml --- ]> Ctl.ppc UserSourceTrees CustomColor1 Red0 Green39321 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path::Modules:Ctl PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:::Mac: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path:::Include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SystemSearchPaths SearchPath Path::::GUSI2:include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll LinkerMacOS PPC Linker PreLinker PostLinker TargetnameCtl.ppc OutputDirectory Path::Plugins PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.p CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerMW Rez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue ActivateBrowserfalse DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse DebuggerCommandLine Debugger Runtime 0002000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPTypefalse MWCodeGen_68K_codesizeSmart MWCodeGen_68K_structalignmentMC68K MWCodeGen_68K_fp_modeSANE MWCodeGen_68K_code680200 MWCodeGen_68K_profiler0 MWCodeGen_68K_mpwc0 MWCodeGen_68K_fourbyteints0 MWCodeGen_68K_IEEEdoubles0 MWCodeGen_68K_fardata0 MWCodeGen_68K_farvtables0 MWCodeGen_68K_farstrings0 MWCodeGen_68K_pcrelstrings0 MWCodeGen_68K_macsbugNew MWCodeGen_68K_a6frames1 MWDisassembler_68K_showcode1 MWDisassembler_68K_mix0 MWDisassembler_68K_nohex0 MWDisassembler_68K_showdata1 MWDisassembler_68K_showexceptions1 MWDisassembler_68K_showsym0 MWDisassembler_68K_shownames1 GlobalOptimizer_68K_optimizationlevelLevel0 GlobalOptimizer_68K_optforSpeed MWLinker_68K_linksym1 MWLinker_68K_symfullpath1 MWLinker_68K_linksingle0 MWLinker_68K_fastlink1 MWLinker_68K_generateMap0 MWLinker_68K_nolinkwarnings0 MWLinker_68K_glueintosegone1 MWLinker_68K_dontdeadstripinitcode0 MWProject_68K_typeApplication MWProject_68K_outfile MWProject_68K_symfilename MWProject_68K_filecreator1061109567 MWProject_68K_filetype1095782476 MWProject_68K_size384 MWProject_68K_flags22656 MWProject_68K_rsrcheaderStandard MWProject_68K_rsrcname MWProject_68K_rsrctype1061109567 MWProject_68K_rsrcid0 MWProject_68K_rsrcmulti0 MWProject_68K_rsrcstore0 MWProject_68K_rsrcmerge0 MWProject_68K_rsrcflags0 MWProject_68K_a40 MWProject_68K_minsize384 MWProject_68K_rsrcsegtype0 MWProject_68K_cfm68kcodegen0 MWProject_68K_stacksize0 MWProject_68K_thedebugger0 MWProject_68K_rsrc_custom0 MWProject_68K_is_rseg_app0 MWProject_68K_is_pilot_lib0 MWProject_68K_pilot_main_entry MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint0 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnamemwerks_plugin_config.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions1 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_direct_to_som0 MWFrontEnd_C_som_env_check0 MWFrontEnd_C_alwaysinline0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen0 MWWarning_C_warn_illpragma0 MWWarning_C_warn_emptydecl0 MWWarning_C_warn_possunwant0 MWWarning_C_warn_unusedvar0 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic0 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWCFM68K_exportsNone MWCFM68K_olddefversion0 MWCFM68K_oldimpversion0 MWCFM68K_currentversion0 MWCFM68K_farthreshold256 PCFM68K_sharedata0 MWCFM68K_fragmentname MWCFM68K_initname MWCFM68K_mainname__start MWCFM68K_termname MWCFM68K_libfolder0 MWCFM68K_alignmentAlign_2 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator1061109567 MWMerge_MacOS_outputType1095782476 MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_skipResources ª¿° ß^h ѧ0 MWCodeGen_PPC_structalignmentPPC MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorP601 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_processorspecific0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_vrsave0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname__initialize MWLinker_PPC_mainname MWLinker_PPC_termname__terminate MWPEF_exportsFile MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeSharedLibrary MWProject_PPC_outfileCtl.ppc.slb MWProject_PPC_filecreator1350136936 MWProject_PPC_filetype1936223330 MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype1061109567 MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' Name Ctlmodule.c MacOS Text Name MSL ShLibRuntime.Lib MacOS Library Debug Name Ctl.mcp.exp MacOS Text Debug Name ControlsLib MacOS Library Debug Name AppearanceLib MacOS Library Debug Name PythonCore MacOS Library Debug Name MathLib MacOS Library Debug Name InterfaceLib MacOS Library Debug Name Ctlmodule.c MacOS Name MSL ShLibRuntime.Lib MacOS Name Ctl.mcp.exp MacOS Name ControlsLib MacOS Name AppearanceLib MacOS Name PythonCore MacOS Name MathLib MacOS Name InterfaceLib MacOS Ctl.ppc Sources Ctl.ppc Name Ctlmodule.c MacOS Ctl.ppc Name Ctl.mcp.exp MacOS Libraries Ctl.ppc Name MSL ShLibRuntime.Lib MacOS Ctl.ppc Name ControlsLib MacOS Ctl.ppc Name AppearanceLib MacOS Ctl.ppc Name PythonCore MacOS Ctl.ppc Name MathLib MacOS Ctl.ppc Name InterfaceLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:14:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:14:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Dlg.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv25915/python/Mac/Build Added Files: Dlg.carbon.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Dlg.carbon.mcp.exp --- initDlg From jackjansen@users.sourceforge.net Tue Aug 7 15:15:08 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:15:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Dlg.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv25966/python/Mac/Build Added Files: Dlg.carbon.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Dlg.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS Dlg.carbon Name PythonCoreCarbon MacOS Dlg.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:15:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:15:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Dlg.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26138/python/Mac/Build Added Files: Dlg.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Dlg.mcp.exp --- initDlg From jackjansen@users.sourceforge.net Tue Aug 7 15:15:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:15:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Dlg.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26165/python/Mac/Build Added Files: Dlg.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Dlg.mcp.xml --- ]> Dlg.ppc UserSourceTrees CustomColor1 Red0 Green39321 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path::Modules:Dlg PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:::Mac: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path:::Include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SystemSearchPaths SearchPath Path::::GUSI2:include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll LinkerMacOS PPC Linker PreLinker PostLinker TargetnameDlg.ppc OutputDirectory Path::Plugins PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.p CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerMW Rez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue ActivateBrowserfalse DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse DebuggerCommandLine Debugger Runtime 0002000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPTypefalse MWCodeGen_68K_codesizeSmart MWCodeGen_68K_structalignmentMC68K MWCodeGen_68K_fp_modeSANE MWCodeGen_68K_code680200 MWCodeGen_68K_profiler0 MWCodeGen_68K_mpwc0 MWCodeGen_68K_fourbyteints0 MWCodeGen_68K_IEEEdoubles0 MWCodeGen_68K_fardata0 MWCodeGen_68K_farvtables0 MWCodeGen_68K_farstrings0 MWCodeGen_68K_pcrelstrings0 MWCodeGen_68K_macsbugNew MWCodeGen_68K_a6frames1 MWDisassembler_68K_showcode1 MWDisassembler_68K_mix0 MWDisassembler_68K_nohex0 MWDisassembler_68K_showdata1 MWDisassembler_68K_showexceptions1 MWDisassembler_68K_showsym0 MWDisassembler_68K_shownames1 GlobalOptimizer_68K_optimizationlevelLevel0 GlobalOptimizer_68K_optforSpeed MWLinker_68K_linksym1 MWLinker_68K_symfullpath1 MWLinker_68K_linksingle0 MWLinker_68K_fastlink1 MWLinker_68K_generateMap0 MWLinker_68K_nolinkwarnings0 MWLinker_68K_glueintosegone1 MWLinker_68K_dontdeadstripinitcode0 MWProject_68K_typeApplication MWProject_68K_outfile MWProject_68K_symfilename MWProject_68K_filecreator1061109567 MWProject_68K_filetype1095782476 MWProject_68K_size384 MWProject_68K_flags22656 MWProject_68K_rsrcheaderStandard MWProject_68K_rsrcname MWProject_68K_rsrctype1061109567 MWProject_68K_rsrcid0 MWProject_68K_rsrcmulti0 MWProject_68K_rsrcstore0 MWProject_68K_rsrcmerge0 MWProject_68K_rsrcflags0 MWProject_68K_a40 MWProject_68K_minsize384 MWProject_68K_rsrcsegtype0 MWProject_68K_cfm68kcodegen0 MWProject_68K_stacksize0 MWProject_68K_thedebugger0 MWProject_68K_rsrc_custom0 MWProject_68K_is_rseg_app0 MWProject_68K_is_pilot_lib0 MWProject_68K_pilot_main_entry MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint0 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnamemwerks_plugin_config.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions1 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_direct_to_som0 MWFrontEnd_C_som_env_check0 MWFrontEnd_C_alwaysinline0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen0 MWWarning_C_warn_illpragma0 MWWarning_C_warn_emptydecl0 MWWarning_C_warn_possunwant0 MWWarning_C_warn_unusedvar0 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic0 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWCFM68K_exportsNone MWCFM68K_olddefversion0 MWCFM68K_oldimpversion0 MWCFM68K_currentversion0 MWCFM68K_farthreshold256 PCFM68K_sharedata0 MWCFM68K_fragmentname MWCFM68K_initname MWCFM68K_mainname__start MWCFM68K_termname MWCFM68K_libfolder0 MWCFM68K_alignmentAlign_2 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator1061109567 MWMerge_MacOS_outputType1095782476 MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_skipResources ª¿° ß^h ѧ0 MWCodeGen_PPC_structalignmentPPC MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorP601 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_processorspecific0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_vrsave0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname__initialize MWLinker_PPC_mainname MWLinker_PPC_termname__terminate MWPEF_exportsFile MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeSharedLibrary MWProject_PPC_outfileDlg.ppc.slb MWProject_PPC_filecreator1350136936 MWProject_PPC_filetype1936223330 MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype1061109567 MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' Name Dlgmodule.c MacOS Text Name MSL ShLibRuntime.Lib MacOS Library Debug Name Dlg.mcp.exp MacOS Text Debug Name DialogsLib MacOS Library Debug Name AppearanceLib MacOS Library Debug Name PythonCore MacOS Library Debug Name MathLib MacOS Library Debug Name InterfaceLib MacOS Library Debug Name Dlgmodule.c MacOS Name MSL ShLibRuntime.Lib MacOS Name Dlg.mcp.exp MacOS Name DialogsLib MacOS Name AppearanceLib MacOS Name PythonCore MacOS Name MathLib MacOS Name InterfaceLib MacOS Dlg.ppc Sources Dlg.ppc Name Dlgmodule.c MacOS Dlg.ppc Name Dlg.mcp.exp MacOS Libraries Dlg.ppc Name MSL ShLibRuntime.Lib MacOS Dlg.ppc Name DialogsLib MacOS Dlg.ppc Name AppearanceLib MacOS Dlg.ppc Name PythonCore MacOS Dlg.ppc Name MathLib MacOS Dlg.ppc Name InterfaceLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:15:39 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:15:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Drag.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26226/python/Mac/Build Added Files: Drag.carbon.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Drag.carbon.mcp.exp --- initDrag From jackjansen@users.sourceforge.net Tue Aug 7 15:15:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:15:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Drag.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26304/python/Mac/Build Added Files: Drag.carbon.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Drag.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS Drag.carbon Name PythonCoreCarbon MacOS Drag.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:16:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:16:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Drag.mcp.exp,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26398/python/Mac/Build Added Files: Drag.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. From jackjansen@users.sourceforge.net Tue Aug 7 15:16:24 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:16:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Drag.mcp.xml,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26484/python/Mac/Build Added Files: Drag.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. From jackjansen@users.sourceforge.net Tue Aug 7 15:16:34 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:16:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Evt.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26603/python/Mac/Build Added Files: Evt.carbon.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Evt.carbon.mcp.exp --- initEvt From jackjansen@users.sourceforge.net Tue Aug 7 15:16:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:16:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Evt.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26650/python/Mac/Build Added Files: Evt.carbon.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Evt.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS Evt.carbon Name PythonCoreCarbon MacOS Evt.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:16:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:16:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Evt.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26723/python/Mac/Build Added Files: Evt.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Evt.mcp.exp --- initEvt From jackjansen@users.sourceforge.net Tue Aug 7 15:17:08 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:17:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Evt.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26806/python/Mac/Build Added Files: Evt.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Evt.mcp.xml --- ]> Evt.ppc UserSourceTrees CustomColor1 Red0 Green39321 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path::Modules:Evt PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:::Mac: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path:::Include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SystemSearchPaths SearchPath Path::::GUSI2:include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll LinkerMacOS PPC Linker PreLinker PostLinker TargetnameEvt.ppc OutputDirectory Path::Plugins PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.p CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerMW Rez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue ActivateBrowserfalse DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse DebuggerCommandLine Debugger Runtime 0002000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPTypefalse MWCodeGen_68K_codesizeSmart MWCodeGen_68K_structalignmentMC68K MWCodeGen_68K_fp_modeSANE MWCodeGen_68K_code680200 MWCodeGen_68K_profiler0 MWCodeGen_68K_mpwc0 MWCodeGen_68K_fourbyteints0 MWCodeGen_68K_IEEEdoubles0 MWCodeGen_68K_fardata0 MWCodeGen_68K_farvtables0 MWCodeGen_68K_farstrings0 MWCodeGen_68K_pcrelstrings0 MWCodeGen_68K_macsbugNew MWCodeGen_68K_a6frames1 MWDisassembler_68K_showcode1 MWDisassembler_68K_mix0 MWDisassembler_68K_nohex0 MWDisassembler_68K_showdata1 MWDisassembler_68K_showexceptions1 MWDisassembler_68K_showsym0 MWDisassembler_68K_shownames1 GlobalOptimizer_68K_optimizationlevelLevel0 GlobalOptimizer_68K_optforSpeed MWLinker_68K_linksym1 MWLinker_68K_symfullpath1 MWLinker_68K_linksingle0 MWLinker_68K_fastlink1 MWLinker_68K_generateMap0 MWLinker_68K_nolinkwarnings0 MWLinker_68K_glueintosegone1 MWLinker_68K_dontdeadstripinitcode0 MWProject_68K_typeApplication MWProject_68K_outfile MWProject_68K_symfilename MWProject_68K_filecreator1061109567 MWProject_68K_filetype1095782476 MWProject_68K_size384 MWProject_68K_flags22656 MWProject_68K_rsrcheaderStandard MWProject_68K_rsrcname MWProject_68K_rsrctype1061109567 MWProject_68K_rsrcid0 MWProject_68K_rsrcmulti0 MWProject_68K_rsrcstore0 MWProject_68K_rsrcmerge0 MWProject_68K_rsrcflags0 MWProject_68K_a40 MWProject_68K_minsize384 MWProject_68K_rsrcsegtype0 MWProject_68K_cfm68kcodegen0 MWProject_68K_stacksize0 MWProject_68K_thedebugger0 MWProject_68K_rsrc_custom0 MWProject_68K_is_rseg_app0 MWProject_68K_is_pilot_lib0 MWProject_68K_pilot_main_entry MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint0 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnamemwerks_plugin_config.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions1 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_direct_to_som0 MWFrontEnd_C_som_env_check0 MWFrontEnd_C_alwaysinline0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen0 MWWarning_C_warn_illpragma0 MWWarning_C_warn_emptydecl0 MWWarning_C_warn_possunwant0 MWWarning_C_warn_unusedvar0 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic0 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWCFM68K_exportsNone MWCFM68K_olddefversion0 MWCFM68K_oldimpversion0 MWCFM68K_currentversion0 MWCFM68K_farthreshold256 PCFM68K_sharedata0 MWCFM68K_fragmentname MWCFM68K_initname MWCFM68K_mainname__start MWCFM68K_termname MWCFM68K_libfolder0 MWCFM68K_alignmentAlign_2 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator1061109567 MWMerge_MacOS_outputType1095782476 MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_skipResources ª¿° ß^h ѧ0 MWCodeGen_PPC_structalignmentPPC MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorP601 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_processorspecific0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_vrsave0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname__initialize MWLinker_PPC_mainname MWLinker_PPC_termname__terminate MWPEF_exportsFile MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeSharedLibrary MWProject_PPC_outfileEvt.ppc.slb MWProject_PPC_filecreator1350136936 MWProject_PPC_filetype1936223330 MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype1061109567 MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' Name Evtmodule.c MacOS Text Name MSL ShLibRuntime.Lib MacOS Library Debug Name Evt.mcp.exp MacOS Text Debug Name PythonCore MacOS Library Debug Name MathLib MacOS Library Debug Name InterfaceLib MacOS Library Debug Name Evtmodule.c MacOS Name MSL ShLibRuntime.Lib MacOS Name Evt.mcp.exp MacOS Name PythonCore MacOS Name MathLib MacOS Name InterfaceLib MacOS Evt.ppc Sources Evt.ppc Name Evtmodule.c MacOS Evt.ppc Name Evt.mcp.exp MacOS Libraries Evt.ppc Name MSL ShLibRuntime.Lib MacOS Evt.ppc Name PythonCore MacOS Evt.ppc Name MathLib MacOS Evt.ppc Name InterfaceLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:17:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:17:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Menu.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv26911/python/Mac/Build Added Files: Menu.carbon.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Menu.carbon.mcp.exp --- initMenu From jackjansen@users.sourceforge.net Tue Aug 7 15:17:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:17:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Menu.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27001/python/Mac/Build Added Files: Menu.carbon.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Menu.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS Menu.carbon Name PythonCoreCarbon MacOS Menu.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:17:53 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:17:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Menu.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27082/python/Mac/Build Added Files: Menu.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Menu.mcp.exp --- initMenu From jackjansen@users.sourceforge.net Tue Aug 7 15:18:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:18:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Menu.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27146/python/Mac/Build Added Files: Menu.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Menu.mcp.xml --- ]> Menu.ppc UserSourceTrees CustomColor1 Red0 Green39321 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path::Modules:Menu PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:::Mac: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path:::Include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SystemSearchPaths SearchPath Path::::GUSI2:include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll LinkerMacOS PPC Linker PreLinker PostLinker TargetnameMenu.ppc OutputDirectory Path::Plugins PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.p CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerMW Rez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue ActivateBrowserfalse DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse DebuggerCommandLine Debugger Runtime 0002000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPTypefalse MWCodeGen_68K_codesizeSmart MWCodeGen_68K_structalignmentMC68K MWCodeGen_68K_fp_modeSANE MWCodeGen_68K_code680200 MWCodeGen_68K_profiler0 MWCodeGen_68K_mpwc0 MWCodeGen_68K_fourbyteints0 MWCodeGen_68K_IEEEdoubles0 MWCodeGen_68K_fardata0 MWCodeGen_68K_farvtables0 MWCodeGen_68K_farstrings0 MWCodeGen_68K_pcrelstrings0 MWCodeGen_68K_macsbugNew MWCodeGen_68K_a6frames1 MWDisassembler_68K_showcode1 MWDisassembler_68K_mix0 MWDisassembler_68K_nohex0 MWDisassembler_68K_showdata1 MWDisassembler_68K_showexceptions1 MWDisassembler_68K_showsym0 MWDisassembler_68K_shownames1 GlobalOptimizer_68K_optimizationlevelLevel0 GlobalOptimizer_68K_optforSpeed MWLinker_68K_linksym1 MWLinker_68K_symfullpath1 MWLinker_68K_linksingle0 MWLinker_68K_fastlink1 MWLinker_68K_generateMap0 MWLinker_68K_nolinkwarnings0 MWLinker_68K_glueintosegone1 MWLinker_68K_dontdeadstripinitcode0 MWProject_68K_typeApplication MWProject_68K_outfile MWProject_68K_symfilename MWProject_68K_filecreator1061109567 MWProject_68K_filetype1095782476 MWProject_68K_size384 MWProject_68K_flags22656 MWProject_68K_rsrcheaderStandard MWProject_68K_rsrcname MWProject_68K_rsrctype1061109567 MWProject_68K_rsrcid0 MWProject_68K_rsrcmulti0 MWProject_68K_rsrcstore0 MWProject_68K_rsrcmerge0 MWProject_68K_rsrcflags0 MWProject_68K_a40 MWProject_68K_minsize384 MWProject_68K_rsrcsegtype0 MWProject_68K_cfm68kcodegen0 MWProject_68K_stacksize0 MWProject_68K_thedebugger0 MWProject_68K_rsrc_custom0 MWProject_68K_is_rseg_app0 MWProject_68K_is_pilot_lib0 MWProject_68K_pilot_main_entry MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint0 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnamemwerks_plugin_config.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions1 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_direct_to_som0 MWFrontEnd_C_som_env_check0 MWFrontEnd_C_alwaysinline0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen0 MWWarning_C_warn_illpragma0 MWWarning_C_warn_emptydecl0 MWWarning_C_warn_possunwant0 MWWarning_C_warn_unusedvar0 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic0 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWCFM68K_exportsNone MWCFM68K_olddefversion0 MWCFM68K_oldimpversion0 MWCFM68K_currentversion0 MWCFM68K_farthreshold256 PCFM68K_sharedata0 MWCFM68K_fragmentname MWCFM68K_initname MWCFM68K_mainname__start MWCFM68K_termname MWCFM68K_libfolder0 MWCFM68K_alignmentAlign_2 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator1061109567 MWMerge_MacOS_outputType1095782476 MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_skipResources ª¿° ß^h ѧ0 MWCodeGen_PPC_structalignmentPPC MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorP601 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_processorspecific0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_vrsave0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname__initialize MWLinker_PPC_mainname MWLinker_PPC_termname__terminate MWPEF_exportsFile MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeSharedLibrary MWProject_PPC_outfileMenu.ppc.slb MWProject_PPC_filecreator1350136936 MWProject_PPC_filetype1936223330 MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype1061109567 MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' Name Menumodule.c MacOS Text Name MSL ShLibRuntime.Lib MacOS Library Debug Name Menu.mcp.exp MacOS Text Debug Name MenusLib MacOS Library Debug Name ContextualMenu MacOS Library Debug Name AppearanceLib MacOS Library Debug Name PythonCore MacOS Library Debug Name MathLib MacOS Library Debug Name InterfaceLib MacOS Library Debug Name Menumodule.c MacOS Name MSL ShLibRuntime.Lib MacOS Name Menu.mcp.exp MacOS Name MenusLib MacOS Name ContextualMenu MacOS Name AppearanceLib MacOS Name PythonCore MacOS Name MathLib MacOS Name InterfaceLib MacOS Menu.ppc Sources Menu.ppc Name Menumodule.c MacOS Menu.ppc Name Menu.mcp.exp MacOS Libraries Menu.ppc Name MSL ShLibRuntime.Lib MacOS Menu.ppc Name MenusLib MacOS Menu.ppc Name ContextualMenu MacOS Menu.ppc Name AppearanceLib MacOS Menu.ppc Name PythonCore MacOS Menu.ppc Name MathLib MacOS Menu.ppc Name InterfaceLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:18:22 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:18:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Mlte.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27282/python/Mac/Build Added Files: Mlte.carbon.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Mlte.carbon.mcp.exp --- initMlte From jackjansen@users.sourceforge.net Tue Aug 7 15:18:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:18:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Mlte.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27309/python/Mac/Build Added Files: Mlte.carbon.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Mlte.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS Mlte.carbon Name PythonCoreCarbon MacOS Mlte.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:18:52 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:18:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Mlte.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27424/python/Mac/Build Added Files: Mlte.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Mlte.mcp.exp --- initMlte From jackjansen@users.sourceforge.net Tue Aug 7 15:19:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:19:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Mlte.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27481/python/Mac/Build Added Files: Mlte.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Mlte.mcp.xml --- ]> Mlte.ppc UserSourceTrees CustomColor1 Red0 Green39321 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path::Modules:Mlte PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:::Mac: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path:::Include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SystemSearchPaths SearchPath Path::::GUSI2:include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll LinkerMacOS PPC Linker PreLinker PostLinker TargetnameMlte.ppc OutputDirectory Path::Plugins PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.p CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerMW Rez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue ActivateBrowserfalse DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse DebuggerCommandLine Debugger Runtime 0002000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPTypefalse MWCodeGen_68K_codesizeSmart MWCodeGen_68K_structalignmentMC68K MWCodeGen_68K_fp_modeSANE MWCodeGen_68K_code680200 MWCodeGen_68K_profiler0 MWCodeGen_68K_mpwc0 MWCodeGen_68K_fourbyteints0 MWCodeGen_68K_IEEEdoubles0 MWCodeGen_68K_fardata0 MWCodeGen_68K_farvtables0 MWCodeGen_68K_farstrings0 MWCodeGen_68K_pcrelstrings0 MWCodeGen_68K_macsbugNew MWCodeGen_68K_a6frames1 MWDisassembler_68K_showcode1 MWDisassembler_68K_mix0 MWDisassembler_68K_nohex0 MWDisassembler_68K_showdata1 MWDisassembler_68K_showexceptions1 MWDisassembler_68K_showsym0 MWDisassembler_68K_shownames1 GlobalOptimizer_68K_optimizationlevelLevel0 GlobalOptimizer_68K_optforSpeed MWLinker_68K_linksym1 MWLinker_68K_symfullpath1 MWLinker_68K_linksingle0 MWLinker_68K_fastlink1 MWLinker_68K_generateMap0 MWLinker_68K_nolinkwarnings0 MWLinker_68K_glueintosegone1 MWLinker_68K_dontdeadstripinitcode0 MWProject_68K_typeApplication MWProject_68K_outfile MWProject_68K_symfilename MWProject_68K_filecreator1061109567 MWProject_68K_filetype1095782476 MWProject_68K_size384 MWProject_68K_flags22656 MWProject_68K_rsrcheaderStandard MWProject_68K_rsrcname MWProject_68K_rsrctype1061109567 MWProject_68K_rsrcid0 MWProject_68K_rsrcmulti0 MWProject_68K_rsrcstore0 MWProject_68K_rsrcmerge0 MWProject_68K_rsrcflags0 MWProject_68K_a40 MWProject_68K_minsize384 MWProject_68K_rsrcsegtype0 MWProject_68K_cfm68kcodegen0 MWProject_68K_stacksize0 MWProject_68K_thedebugger0 MWProject_68K_rsrc_custom0 MWProject_68K_is_rseg_app0 MWProject_68K_is_pilot_lib0 MWProject_68K_pilot_main_entry MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint0 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnamemwerks_plugin_config.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions1 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_direct_to_som0 MWFrontEnd_C_som_env_check0 MWFrontEnd_C_alwaysinline0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen0 MWWarning_C_warn_illpragma0 MWWarning_C_warn_emptydecl0 MWWarning_C_warn_possunwant0 MWWarning_C_warn_unusedvar0 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic0 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWCFM68K_exportsNone MWCFM68K_olddefversion0 MWCFM68K_oldimpversion0 MWCFM68K_currentversion0 MWCFM68K_farthreshold256 PCFM68K_sharedata0 MWCFM68K_fragmentname MWCFM68K_initname MWCFM68K_mainname__start MWCFM68K_termname MWCFM68K_libfolder0 MWCFM68K_alignmentAlign_2 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator1061109567 MWMerge_MacOS_outputType1095782476 MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_skipResources ª¿° ß^h ѧ0 MWCodeGen_PPC_structalignmentPPC MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorP601 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_processorspecific0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_vrsave0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname__initialize MWLinker_PPC_mainname MWLinker_PPC_termname__terminate MWPEF_exportsFile MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeSharedLibrary MWProject_PPC_outfileMlte.ppc.slb MWProject_PPC_filecreator1350136936 MWProject_PPC_filetype1936223330 MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype1061109567 MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' Name Mltemodule.c MacOS Text Name MSL ShLibRuntime.Lib MacOS Library Debug Name Mlte.mcp.exp MacOS Text Debug Name Textension MacOS Library Debug Name PythonCore MacOS Library Debug Name MathLib MacOS Library Debug Name InterfaceLib MacOS Library Debug Name Mltemodule.c MacOS Name MSL ShLibRuntime.Lib MacOS Name Mlte.mcp.exp MacOS Name Textension MacOS Name PythonCore MacOS Name MathLib MacOS Name InterfaceLib MacOS Mlte.ppc Sources Mlte.ppc Name Mltemodule.c MacOS Mlte.ppc Name Mlte.mcp.exp MacOS Libraries Mlte.ppc Name MSL ShLibRuntime.Lib MacOS Mlte.ppc Name Textension MacOS Mlte.ppc Name PythonCore MacOS Mlte.ppc Name MathLib MacOS Mlte.ppc Name InterfaceLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:19:23 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:19:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Qd.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27569/python/Mac/Build Added Files: Qd.carbon.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Qd.carbon.mcp.exp --- initQd From jackjansen@users.sourceforge.net Tue Aug 7 15:19:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:19:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Qd.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27624/python/Mac/Build Added Files: Qd.carbon.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Qd.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS Qd.carbon Name PythonCoreCarbon MacOS Qd.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:19:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:19:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Qd.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27699/python/Mac/Build Added Files: Qd.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Qd.mcp.exp --- initQd From jackjansen@users.sourceforge.net Tue Aug 7 15:20:16 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:20:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Res.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27911/python/Mac/Build Added Files: Res.carbon.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Res.carbon.mcp.exp --- initRes From jackjansen@users.sourceforge.net Tue Aug 7 15:20:34 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:20:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Res.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27976/python/Mac/Build Added Files: Res.carbon.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Res.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS Res.carbon Name PythonCoreCarbon MacOS Res.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:20:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:20:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Qd.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv27769/python/Mac/Build Added Files: Qd.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Qd.mcp.xml --- ]> Qd.ppc UserSourceTrees CustomColor1 Red0 Green39321 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path::Modules:Qd PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:::Mac: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path:::Include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SystemSearchPaths SearchPath Path::::GUSI2:include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll LinkerMacOS PPC Linker PreLinker PostLinker TargetnameQd.ppc OutputDirectory Path::Plugins PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.p CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerMW Rez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue ActivateBrowserfalse DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse DebuggerCommandLine Debugger Runtime 0002000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPTypefalse MWCodeGen_68K_codesizeSmart MWCodeGen_68K_structalignmentMC68K MWCodeGen_68K_fp_modeSANE MWCodeGen_68K_code680200 MWCodeGen_68K_profiler0 MWCodeGen_68K_mpwc0 MWCodeGen_68K_fourbyteints0 MWCodeGen_68K_IEEEdoubles0 MWCodeGen_68K_fardata0 MWCodeGen_68K_farvtables0 MWCodeGen_68K_farstrings0 MWCodeGen_68K_pcrelstrings0 MWCodeGen_68K_macsbugNew MWCodeGen_68K_a6frames1 MWDisassembler_68K_showcode1 MWDisassembler_68K_mix0 MWDisassembler_68K_nohex0 MWDisassembler_68K_showdata1 MWDisassembler_68K_showexceptions1 MWDisassembler_68K_showsym0 MWDisassembler_68K_shownames1 GlobalOptimizer_68K_optimizationlevelLevel0 GlobalOptimizer_68K_optforSpeed MWLinker_68K_linksym1 MWLinker_68K_symfullpath1 MWLinker_68K_linksingle0 MWLinker_68K_fastlink1 MWLinker_68K_generateMap0 MWLinker_68K_nolinkwarnings0 MWLinker_68K_glueintosegone1 MWLinker_68K_dontdeadstripinitcode0 MWProject_68K_typeApplication MWProject_68K_outfile MWProject_68K_symfilename MWProject_68K_filecreator1061109567 MWProject_68K_filetype1095782476 MWProject_68K_size384 MWProject_68K_flags22656 MWProject_68K_rsrcheaderStandard MWProject_68K_rsrcname MWProject_68K_rsrctype1061109567 MWProject_68K_rsrcid0 MWProject_68K_rsrcmulti0 MWProject_68K_rsrcstore0 MWProject_68K_rsrcmerge0 MWProject_68K_rsrcflags0 MWProject_68K_a40 MWProject_68K_minsize384 MWProject_68K_rsrcsegtype0 MWProject_68K_cfm68kcodegen0 MWProject_68K_stacksize0 MWProject_68K_thedebugger0 MWProject_68K_rsrc_custom0 MWProject_68K_is_rseg_app0 MWProject_68K_is_pilot_lib0 MWProject_68K_pilot_main_entry MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint0 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnamemwerks_plugin_config.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions1 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_direct_to_som0 MWFrontEnd_C_som_env_check0 MWFrontEnd_C_alwaysinline0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen0 MWWarning_C_warn_illpragma0 MWWarning_C_warn_emptydecl0 MWWarning_C_warn_possunwant0 MWWarning_C_warn_unusedvar0 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic0 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWCFM68K_exportsNone MWCFM68K_olddefversion0 MWCFM68K_oldimpversion0 MWCFM68K_currentversion0 MWCFM68K_farthreshold256 PCFM68K_sharedata0 MWCFM68K_fragmentname MWCFM68K_initname MWCFM68K_mainname__start MWCFM68K_termname MWCFM68K_libfolder0 MWCFM68K_alignmentAlign_2 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator1061109567 MWMerge_MacOS_outputType1095782476 MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_skipResources ª¿° ß^h ѧ0 MWCodeGen_PPC_structalignmentPPC MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorP601 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_processorspecific0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_vrsave0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname__initialize MWLinker_PPC_mainname MWLinker_PPC_termname__terminate MWPEF_exportsFile MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeSharedLibrary MWProject_PPC_outfileQd.ppc.slb MWProject_PPC_filecreator1350136936 MWProject_PPC_filetype1936223330 MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype1061109567 MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' Name Qdmodule.c MacOS Text Name MSL ShLibRuntime.Lib MacOS Library Debug Name Qd.mcp.exp MacOS Text Debug Name PythonCore MacOS Library Debug Name MathLib MacOS Library Debug Name InterfaceLib MacOS Library Debug Name Qdmodule.c MacOS Name MSL ShLibRuntime.Lib MacOS Name Qd.mcp.exp MacOS Name PythonCore MacOS Name MathLib MacOS Name InterfaceLib MacOS Qd.ppc Sources Qd.ppc Name Qdmodule.c MacOS Qd.ppc Name Qd.mcp.exp MacOS Libraries Qd.ppc Name MSL ShLibRuntime.Lib MacOS Qd.ppc Name PythonCore MacOS Qd.ppc Name MathLib MacOS Qd.ppc Name InterfaceLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:20:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:20:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Res.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv28058/python/Mac/Build Added Files: Res.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Res.mcp.exp --- initRes From jackjansen@users.sourceforge.net Tue Aug 7 15:21:14 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:21:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Win.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv28260/python/Mac/Build Added Files: Win.carbon.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Win.carbon.mcp.exp --- initWin From jackjansen@users.sourceforge.net Tue Aug 7 15:21:32 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:21:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Win.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv28330/python/Mac/Build Added Files: Win.carbon.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Win.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS Win.carbon Name PythonCoreCarbon MacOS Win.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:21:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:21:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Win.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv28459/python/Mac/Build Added Files: Win.mcp.exp Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Win.mcp.exp --- initWin From jackjansen@users.sourceforge.net Tue Aug 7 15:21:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:21:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Win.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv28549/python/Mac/Build Added Files: Win.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Win.mcp.xml --- ]> Win.ppc UserSourceTrees CustomColor1 Red0 Green39321 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path::Modules:Win PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:::Mac: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path:::Include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SystemSearchPaths SearchPath Path::::GUSI2:include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll LinkerMacOS PPC Linker PreLinker PostLinker TargetnameWin.ppc OutputDirectory Path::Plugins PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.p CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerMW Rez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue ActivateBrowserfalse DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse DebuggerCommandLine Debugger Runtime 0002000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPTypefalse MWCodeGen_68K_codesizeSmart MWCodeGen_68K_structalignmentMC68K MWCodeGen_68K_fp_modeSANE MWCodeGen_68K_code680200 MWCodeGen_68K_profiler0 MWCodeGen_68K_mpwc0 MWCodeGen_68K_fourbyteints0 MWCodeGen_68K_IEEEdoubles0 MWCodeGen_68K_fardata0 MWCodeGen_68K_farvtables0 MWCodeGen_68K_farstrings0 MWCodeGen_68K_pcrelstrings0 MWCodeGen_68K_macsbugNew MWCodeGen_68K_a6frames1 MWDisassembler_68K_showcode1 MWDisassembler_68K_mix0 MWDisassembler_68K_nohex0 MWDisassembler_68K_showdata1 MWDisassembler_68K_showexceptions1 MWDisassembler_68K_showsym0 MWDisassembler_68K_shownames1 GlobalOptimizer_68K_optimizationlevelLevel0 GlobalOptimizer_68K_optforSpeed MWLinker_68K_linksym1 MWLinker_68K_symfullpath1 MWLinker_68K_linksingle0 MWLinker_68K_fastlink1 MWLinker_68K_generateMap0 MWLinker_68K_nolinkwarnings0 MWLinker_68K_glueintosegone1 MWLinker_68K_dontdeadstripinitcode0 MWProject_68K_typeApplication MWProject_68K_outfile MWProject_68K_symfilename MWProject_68K_filecreator1061109567 MWProject_68K_filetype1095782476 MWProject_68K_size384 MWProject_68K_flags22656 MWProject_68K_rsrcheaderStandard MWProject_68K_rsrcname MWProject_68K_rsrctype1061109567 MWProject_68K_rsrcid0 MWProject_68K_rsrcmulti0 MWProject_68K_rsrcstore0 MWProject_68K_rsrcmerge0 MWProject_68K_rsrcflags0 MWProject_68K_a40 MWProject_68K_minsize384 MWProject_68K_rsrcsegtype0 MWProject_68K_cfm68kcodegen0 MWProject_68K_stacksize0 MWProject_68K_thedebugger0 MWProject_68K_rsrc_custom0 MWProject_68K_is_rseg_app0 MWProject_68K_is_pilot_lib0 MWProject_68K_pilot_main_entry MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint0 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnamemwerks_plugin_config.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions1 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_direct_to_som0 MWFrontEnd_C_som_env_check0 MWFrontEnd_C_alwaysinline0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen0 MWWarning_C_warn_illpragma0 MWWarning_C_warn_emptydecl0 MWWarning_C_warn_possunwant0 MWWarning_C_warn_unusedvar0 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic0 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWCFM68K_exportsNone MWCFM68K_olddefversion0 MWCFM68K_oldimpversion0 MWCFM68K_currentversion0 MWCFM68K_farthreshold256 PCFM68K_sharedata0 MWCFM68K_fragmentname MWCFM68K_initname MWCFM68K_mainname__start MWCFM68K_termname MWCFM68K_libfolder0 MWCFM68K_alignmentAlign_2 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator1061109567 MWMerge_MacOS_outputType1095782476 MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_skipResources ª¿° ß^h ѧ0 MWCodeGen_PPC_structalignmentPPC MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorP601 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_processorspecific0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_vrsave0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname__initialize MWLinker_PPC_mainname MWLinker_PPC_termname__terminate MWPEF_exportsFile MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeSharedLibrary MWProject_PPC_outfileWin.ppc.slb MWProject_PPC_filecreator1350136936 MWProject_PPC_filetype1936223330 MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype1061109567 MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' Name Winmodule.c MacOS Text Name MSL ShLibRuntime.Lib MacOS Library Debug Name Win.mcp.exp MacOS Text Debug Name WindowsLib MacOS Library Debug Name AppearanceLib MacOS Library Debug Name PythonCore MacOS Library Debug Name MathLib MacOS Library Debug Name InterfaceLib MacOS Library Debug Name Winmodule.c MacOS Name MSL ShLibRuntime.Lib MacOS Name Win.mcp.exp MacOS Name WindowsLib MacOS Name AppearanceLib MacOS Name PythonCore MacOS Name MathLib MacOS Name InterfaceLib MacOS Win.ppc Sources Win.ppc Name Winmodule.c MacOS Win.ppc Name Win.mcp.exp MacOS Libraries Win.ppc Name MSL ShLibRuntime.Lib MacOS Win.ppc Name WindowsLib MacOS Win.ppc Name AppearanceLib MacOS Win.ppc Name PythonCore MacOS Win.ppc Name MathLib MacOS Win.ppc Name InterfaceLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 15:21:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 07:21:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build Res.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv28120/python/Mac/Build Added Files: Res.mcp.xml Log Message: Project files for the new plugin modules, plus a few that hadn't been added yet but should have been. --- NEW FILE: Res.mcp.xml --- ]> Res.ppc UserSourceTrees CustomColor1 Red0 Green39321 Blue0 CustomColor2 Red0 Green32767 Blue0 CustomColor3 Red0 Green32767 Blue0 CustomColor4 Red0 Green32767 Blue0 AlwaysSearchUserPathstrue InterpretDOSAndUnixPathstrue UserSearchPaths SearchPath Path: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path::Modules:Res PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:::Mac: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SearchPath Path:::Include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path::: PathFormatMacOS PathRootProject Recursivetrue HostFlagsAll SystemSearchPaths SearchPath Path::::GUSI2:include: PathFormatMacOS PathRootProject Recursivefalse HostFlagsAll SearchPath Path:MSL: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll SearchPath Path:MacOS Support: PathFormatMacOS PathRootCodeWarrior Recursivetrue HostFlagsAll LinkerMacOS PPC Linker PreLinker PostLinker TargetnameRes.ppc OutputDirectory Path::Plugins PathFormatMacOS PathRootProject SaveEntriesUsingRelativePathsfalse FileMappings FileTypeAPPL FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeAppl FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeMMLB FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMPLF FileExtension CompilerLib Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeMWCD FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeRSRC FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeTEXT FileExtension.bh CompilerBalloon Help Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.c++ CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cc CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.cpp CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.exp Compiler Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.h CompilerMW C/C++ PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMaketrue FileTypeTEXT FileExtension.p CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pas CompilerMW Pascal PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.pch++ CompilerMW C/C++ PPC Precompiletrue Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.r CompilerMW Rez Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeTEXT FileExtension.s CompilerPPCAsm Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypeXCOF FileExtension CompilerXCOFF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypedocu FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypersrc FileExtension Compiler Precompilefalse Launchabletrue ResourceFiletrue IgnoredByMakefalse FileTypeshlb FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileTypestub FileExtension CompilerPEF Import PPC Precompilefalse Launchablefalse ResourceFilefalse IgnoredByMakefalse FileExtension.doc Compiler Precompilefalse Launchabletrue ResourceFilefalse IgnoredByMaketrue CacheModDatestrue ActivateBrowserfalse DumpBrowserInfofalse CacheSubprojectstrue UseThirdPartyDebuggerfalse DebuggerCommandLine Debugger Runtime 0002000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 LogSystemMessagestrue AutoTargetDLLsfalse StopAtWatchpointstrue PauseWhileRunningfalse PauseInterval5 PauseUIFlags0 AltExePath Path PathFormatGeneric PathRootAbsolute StopAtTempBPOnLaunchtrue CacheSymbolicstrue TempBPFunctionNamemain TempBPTypefalse MWCodeGen_68K_codesizeSmart MWCodeGen_68K_structalignmentMC68K MWCodeGen_68K_fp_modeSANE MWCodeGen_68K_code680200 MWCodeGen_68K_profiler0 MWCodeGen_68K_mpwc0 MWCodeGen_68K_fourbyteints0 MWCodeGen_68K_IEEEdoubles0 MWCodeGen_68K_fardata0 MWCodeGen_68K_farvtables0 MWCodeGen_68K_farstrings0 MWCodeGen_68K_pcrelstrings0 MWCodeGen_68K_macsbugNew MWCodeGen_68K_a6frames1 MWDisassembler_68K_showcode1 MWDisassembler_68K_mix0 MWDisassembler_68K_nohex0 MWDisassembler_68K_showdata1 MWDisassembler_68K_showexceptions1 MWDisassembler_68K_showsym0 MWDisassembler_68K_shownames1 GlobalOptimizer_68K_optimizationlevelLevel0 GlobalOptimizer_68K_optforSpeed MWLinker_68K_linksym1 MWLinker_68K_symfullpath1 MWLinker_68K_linksingle0 MWLinker_68K_fastlink1 MWLinker_68K_generateMap0 MWLinker_68K_nolinkwarnings0 MWLinker_68K_glueintosegone1 MWLinker_68K_dontdeadstripinitcode0 MWProject_68K_typeApplication MWProject_68K_outfile MWProject_68K_symfilename MWProject_68K_filecreator1061109567 MWProject_68K_filetype1095782476 MWProject_68K_size384 MWProject_68K_flags22656 MWProject_68K_rsrcheaderStandard MWProject_68K_rsrcname MWProject_68K_rsrctype1061109567 MWProject_68K_rsrcid0 MWProject_68K_rsrcmulti0 MWProject_68K_rsrcstore0 MWProject_68K_rsrcmerge0 MWProject_68K_rsrcflags0 MWProject_68K_a40 MWProject_68K_minsize384 MWProject_68K_rsrcsegtype0 MWProject_68K_cfm68kcodegen0 MWProject_68K_stacksize0 MWProject_68K_thedebugger0 MWProject_68K_rsrc_custom0 MWProject_68K_is_rseg_app0 MWProject_68K_is_pilot_lib0 MWProject_68K_pilot_main_entry MWFrontEnd_C_cplusplus0 MWFrontEnd_C_checkprotos0 MWFrontEnd_C_arm0 MWFrontEnd_C_trigraphs0 MWFrontEnd_C_onlystdkeywords0 MWFrontEnd_C_enumsalwaysint0 MWFrontEnd_C_mpwpointerstyle0 MWFrontEnd_C_prefixnamemwerks_plugin_config.h MWFrontEnd_C_ansistrict0 MWFrontEnd_C_mpwcnewline0 MWFrontEnd_C_wchar_type1 MWFrontEnd_C_enableexceptions1 MWFrontEnd_C_dontreusestrings0 MWFrontEnd_C_poolstrings1 MWFrontEnd_C_dontinline0 MWFrontEnd_C_useRTTI0 MWFrontEnd_C_multibyteaware0 MWFrontEnd_C_unsignedchars0 MWFrontEnd_C_autoinline0 MWFrontEnd_C_booltruefalse0 MWFrontEnd_C_direct_to_som0 MWFrontEnd_C_som_env_check0 MWFrontEnd_C_alwaysinline0 MWFrontEnd_C_inlinelevel0 MWFrontEnd_C_ecplusplus0 MWFrontEnd_C_objective_c0 MWFrontEnd_C_defer_codegen0 MWWarning_C_warn_illpragma0 MWWarning_C_warn_emptydecl0 MWWarning_C_warn_possunwant0 MWWarning_C_warn_unusedvar0 MWWarning_C_warn_unusedarg0 MWWarning_C_warn_extracomma0 MWWarning_C_pedantic0 MWWarning_C_warningerrors0 MWWarning_C_warn_hidevirtual0 MWWarning_C_warn_implicitconv0 MWWarning_C_warn_notinlined0 MWWarning_C_warn_structclass0 MWCFM68K_exportsNone MWCFM68K_olddefversion0 MWCFM68K_oldimpversion0 MWCFM68K_currentversion0 MWCFM68K_farthreshold256 PCFM68K_sharedata0 MWCFM68K_fragmentname MWCFM68K_initname MWCFM68K_mainname__start MWCFM68K_termname MWCFM68K_libfolder0 MWCFM68K_alignmentAlign_2 MWMerge_MacOS_projectTypeApplication MWMerge_MacOS_outputNameMerge Out MWMerge_MacOS_outputCreator1061109567 MWMerge_MacOS_outputType1095782476 MWMerge_MacOS_suppressWarning0 MWMerge_MacOS_copyFragments1 MWMerge_MacOS_copyResources1 MWMerge_MacOS_skipResources ª¿° ß^h ѧ0 MWCodeGen_PPC_structalignmentPPC MWCodeGen_PPC_tracebacktablesNone MWCodeGen_PPC_processorP601 MWCodeGen_PPC_readonlystrings1 MWCodeGen_PPC_tocdata1 MWCodeGen_PPC_profiler0 MWCodeGen_PPC_fpcontract1 MWCodeGen_PPC_schedule1 MWCodeGen_PPC_peephole1 MWCodeGen_PPC_processorspecific0 MWCodeGen_PPC_altivec0 MWCodeGen_PPC_vectortocdata0 MWCodeGen_PPC_vrsave0 MWDisassembler_PPC_showcode1 MWDisassembler_PPC_extended1 MWDisassembler_PPC_mix0 MWDisassembler_PPC_nohex0 MWDisassembler_PPC_showdata1 MWDisassembler_PPC_showexceptions1 MWDisassembler_PPC_showsym0 MWDisassembler_PPC_shownames1 GlobalOptimizer_PPC_optimizationlevelLevel0 GlobalOptimizer_PPC_optforSpeed MWLinker_PPC_linksym0 MWLinker_PPC_symfullpath1 MWLinker_PPC_linkmap0 MWLinker_PPC_nolinkwarnings0 MWLinker_PPC_dontdeadstripinitcode0 MWLinker_PPC_permitmultdefs0 MWLinker_PPC_linkmodeFast MWLinker_PPC_initname__initialize MWLinker_PPC_mainname MWLinker_PPC_termname__terminate MWPEF_exportsFile MWPEF_libfolder0 MWPEF_sortcodeNone MWPEF_expandbss0 MWPEF_sharedata0 MWPEF_olddefversion0 MWPEF_oldimpversion0 MWPEF_currentversion0 MWPEF_fragmentname MWPEF_collapsereloads0 MWProject_PPC_typeSharedLibrary MWProject_PPC_outfileRes.ppc.slb MWProject_PPC_filecreator1350136936 MWProject_PPC_filetype1936223330 MWProject_PPC_size0 MWProject_PPC_minsize0 MWProject_PPC_stacksize0 MWProject_PPC_flags0 MWProject_PPC_symfilename MWProject_PPC_rsrcname MWProject_PPC_rsrcheaderNative MWProject_PPC_rsrctype1061109567 MWProject_PPC_rsrcid0 MWProject_PPC_rsrcflags0 MWProject_PPC_rsrcstore0 MWProject_PPC_rsrcmerge0 MWAssembler_PPC_auxheader0 MWAssembler_PPC_symmodeMac MWAssembler_PPC_dialectPPC MWAssembler_PPC_prefixfile MWAssembler_PPC_typecheck0 MWAssembler_PPC_warnings0 MWAssembler_PPC_casesensitive0 MWRez_Language_maxwidth80 MWRez_Language_scriptRoman MWRez_Language_alignmentAlign1 MWRez_Language_filtermodeFilterSkip MWRez_Language_suppresswarnings0 MWRez_Language_escapecontrolchars1 MWRez_Language_prefixname MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' Name Resmodule.c MacOS Text Name MSL ShLibRuntime.Lib MacOS Library Debug Name Res.mcp.exp MacOS Text Debug Name PythonCore MacOS Library Debug Name MathLib MacOS Library Debug Name InterfaceLib MacOS Library Debug Name Resmodule.c MacOS Name MSL ShLibRuntime.Lib MacOS Name Res.mcp.exp MacOS Name PythonCore MacOS Name MathLib MacOS Name InterfaceLib MacOS Res.ppc Sources Res.ppc Name Resmodule.c MacOS Res.ppc Name Res.mcp.exp MacOS Libraries Res.ppc Name MSL ShLibRuntime.Lib MacOS Res.ppc Name PythonCore MacOS Res.ppc Name MathLib MacOS Res.ppc Name InterfaceLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 16:11:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:11:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_applet_config.h,1.6,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv9703/python/Mac/mwerks Removed Files: mwerks_applet_config.h Log Message: Removed outdated stuff. --- mwerks_applet_config.h DELETED --- From jackjansen@users.sourceforge.net Tue Aug 7 16:11:52 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:11:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_carbongusi_config.h,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv9744/python/Mac/mwerks Removed Files: mwerks_carbongusi_config.h Log Message: Removed outdated stuff. --- mwerks_carbongusi_config.h DELETED --- From jackjansen@users.sourceforge.net Tue Aug 7 16:12:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:12:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_carbonNOGUSI_config.h,1.3,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv9790/python/Mac/mwerks Removed Files: mwerks_carbonNOGUSI_config.h Log Message: Removed outdated stuff. --- mwerks_carbonNOGUSI_config.h DELETED --- From jackjansen@users.sourceforge.net Tue Aug 7 16:13:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:13:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_carbon_config.h,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv10015/python/Mac/mwerks Modified Files: mwerks_carbon_config.h Log Message: Got rid of (hopefully) the last 68k Mac-related ifdefs and various other cruft. Index: mwerks_carbon_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_carbon_config.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mwerks_carbon_config.h 2001/05/14 14:59:25 1.7 --- mwerks_carbon_config.h 2001/08/07 15:13:16 1.8 *************** *** 8,12 **** #define OPAQUE_TOOLBOX_STRUCTS 1 #define TARGET_API_MAC_CARBON 1 - #define TARGET_API_MAC_CARBON_NOTYET 1 /* Things we should do eventually, but not now */ #define USE_ARGV0_CHDIR /* Workaround for OSXDP4: change dir to argv[0] dir */ --- 8,11 ---- *************** *** 35,41 **** #ifndef USE_MSL_MALLOC /* #define USE_MALLOC_DEBUG /* Enable range checking and other malloc debugging */ - #ifdef __powerc #define USE_CACHE_ALIGNED 8 /* Align on 32-byte boundaries for 604 */ - #endif #endif #define WITHOUT_FRAMEWORKS /* Use old-style Universal Header includes, not Carbon/Carbon.h */ --- 34,38 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:13:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:13:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_carbonplugin_config.h,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv10103/python/Mac/mwerks Modified Files: mwerks_carbonplugin_config.h Log Message: Got rid of (hopefully) the last 68k Mac-related ifdefs and various other cruft. Index: mwerks_carbonplugin_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_carbonplugin_config.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mwerks_carbonplugin_config.h 2001/05/22 22:21:32 1.3 --- mwerks_carbonplugin_config.h 2001/08/07 15:13:27 1.4 *************** *** 5,9 **** #define OPAQUE_TOOLBOX_STRUCTS 1 #define TARGET_API_MAC_CARBON 1 - #define TARGET_API_MAC_CARBON_NOTYET 1 /* Things we should do eventually, but not now */ #define WITHOUT_FRAMEWORKS /* Use old-style Universal Header includes, not Carbon/Carbon.h */ #define USE_TOOLBOX_OBJECT_GLUE /* Use glue routines for accessing PyArg_Parse/Py_BuildValue helpers */ --- 5,8 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:13:41 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:13:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_nonshared_config.h,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv10157/python/Mac/mwerks Modified Files: mwerks_nonshared_config.h Log Message: Got rid of (hopefully) the last 68k Mac-related ifdefs and various other cruft. Index: mwerks_nonshared_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_nonshared_config.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** mwerks_nonshared_config.h 2001/05/14 14:59:49 1.24 --- mwerks_nonshared_config.h 2001/08/07 15:13:39 1.25 *************** *** 31,37 **** #ifndef USE_MSL_MALLOC /* #define USE_MALLOC_DEBUG /* Enable range checking and other malloc debugging */ - #ifdef __powerc #define USE_CACHE_ALIGNED 8 /* Align on 32-byte boundaries for 604 */ - #endif #endif #define WITHOUT_FRAMEWORKS /* Use old-style Universal Header includes, not Carbon/Carbon.h */ --- 31,35 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:13:53 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:13:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_nscarbon_config.h,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv10203/python/Mac/mwerks Modified Files: mwerks_nscarbon_config.h Log Message: Got rid of (hopefully) the last 68k Mac-related ifdefs and various other cruft. Index: mwerks_nscarbon_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_nscarbon_config.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mwerks_nscarbon_config.h 2001/05/14 14:59:54 1.5 --- mwerks_nscarbon_config.h 2001/08/07 15:13:51 1.6 *************** *** 8,12 **** #define OPAQUE_TOOLBOX_STRUCTS 1 #define TARGET_API_MAC_CARBON 1 - #define TARGET_API_MAC_CARBON_NOTYET 1 /* Things we should do eventually, but not now */ #define USE_ARGV0_CHDIR /* Workaround for OSXDP4: change dir to argv[0] dir */ --- 8,11 ---- *************** *** 36,42 **** #ifndef USE_MSL_MALLOC /* #define USE_MALLOC_DEBUG /* Enable range checking and other malloc debugging */ - #ifdef __powerc #define USE_CACHE_ALIGNED 8 /* Align on 32-byte boundaries for 604 */ - #endif #endif #define WITHOUT_FRAMEWORKS /* Use old-style Universal Header includes, not Carbon/Carbon.h */ --- 35,39 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:14:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:14:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_shared_config.h,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv10274/python/Mac/mwerks Modified Files: mwerks_shared_config.h Log Message: Got rid of (hopefully) the last 68k Mac-related ifdefs and various other cruft. Index: mwerks_shared_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_shared_config.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** mwerks_shared_config.h 2001/08/07 13:52:55 1.19 --- mwerks_shared_config.h 2001/08/07 15:14:03 1.20 *************** *** 34,40 **** #ifndef USE_MSL_MALLOC /* #define USE_MALLOC_DEBUG /* Enable range checking and other malloc debugging */ - #ifdef __powerc #define USE_CACHE_ALIGNED 8 /* Align on 32-byte boundaries for 604 */ - #endif #endif --- 34,38 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:14:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:14:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_shcarbon_config.h,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv10343/python/Mac/mwerks Modified Files: mwerks_shcarbon_config.h Log Message: Got rid of (hopefully) the last 68k Mac-related ifdefs and various other cruft. Index: mwerks_shcarbon_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_shcarbon_config.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mwerks_shcarbon_config.h 2001/08/07 13:52:35 1.4 --- mwerks_shcarbon_config.h 2001/08/07 15:14:16 1.5 *************** *** 9,13 **** #define OPAQUE_TOOLBOX_STRUCTS 1 #define TARGET_API_MAC_CARBON 1 - #define TARGET_API_MAC_CARBON_NOTYET 1 /* Things we should do eventually, but not now */ #define USE_ARGV0_CHDIR /* Workaround for OSXDP4: change dir to argv[0] dir */ --- 9,12 ---- *************** *** 39,45 **** #ifndef USE_MSL_MALLOC /* #define USE_MALLOC_DEBUG /* Enable range checking and other malloc debugging */ - #ifdef __powerc #define USE_CACHE_ALIGNED 8 /* Align on 32-byte boundaries for 604 */ - #endif #endif --- 38,42 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:14:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:14:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_small_config.h,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv10404/python/Mac/mwerks Modified Files: mwerks_small_config.h Log Message: Got rid of (hopefully) the last 68k Mac-related ifdefs and various other cruft. Index: mwerks_small_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_small_config.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mwerks_small_config.h 2001/05/14 15:00:18 1.13 --- mwerks_small_config.h 2001/08/07 15:14:28 1.14 *************** *** 30,36 **** #ifndef USE_MSL_MALLOC /* #define USE_MALLOC_DEBUG /* Enable range checking and other malloc debugging */ - #ifdef __powerc #define USE_CACHE_ALIGNED 8 /* Align on 32-byte boundaries for 604 */ - #endif #endif --- 30,34 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:14:42 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:14:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_thrcarbonsm_config.h,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv10447/python/Mac/mwerks Modified Files: mwerks_thrcarbonsm_config.h Log Message: Got rid of (hopefully) the last 68k Mac-related ifdefs and various other cruft. Index: mwerks_thrcarbonsm_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_thrcarbonsm_config.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mwerks_thrcarbonsm_config.h 2001/05/14 15:00:24 1.3 --- mwerks_thrcarbonsm_config.h 2001/08/07 15:14:40 1.4 *************** *** 8,12 **** #define OPAQUE_TOOLBOX_STRUCTS 1 #define TARGET_API_MAC_CARBON 1 - #define TARGET_API_MAC_CARBON_NOTYET 1 /* Things we should do eventually, but not now */ #define USE_ARGV0_CHDIR /* Workaround for OSXDP4: change dir to argv[0] dir */ --- 8,11 ---- *************** *** 37,43 **** #ifndef USE_MSL_MALLOC /* #define USE_MALLOC_DEBUG /* Enable range checking and other malloc debugging */ - #ifdef __powerc #define USE_CACHE_ALIGNED 8 /* Align on 32-byte boundaries for 604 */ - #endif #endif --- 36,40 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:14:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:14:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_threadsmall_config.h,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv10498/python/Mac/mwerks Modified Files: mwerks_threadsmall_config.h Log Message: Got rid of (hopefully) the last 68k Mac-related ifdefs and various other cruft. Index: mwerks_threadsmall_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_threadsmall_config.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mwerks_threadsmall_config.h 2001/05/14 15:00:30 1.3 --- mwerks_threadsmall_config.h 2001/08/07 15:14:53 1.4 *************** *** 31,37 **** #ifndef USE_MSL_MALLOC /* #define USE_MALLOC_DEBUG /* Enable range checking and other malloc debugging */ - #ifdef __powerc #define USE_CACHE_ALIGNED 8 /* Align on 32-byte boundaries for 604 */ - #endif #endif --- 31,35 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:26:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:26:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build AE.carbon.mcp.exp,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv13941/python/Mac/Build Added Files: AE.carbon.mcp.exp Log Message: Yet another project. --- NEW FILE: AE.carbon.mcp.exp --- initAE From jackjansen@users.sourceforge.net Tue Aug 7 16:26:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:26:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build AE.carbon.mcp.xml,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv13962/python/Mac/Build Added Files: AE.carbon.mcp.xml Log Message: Yet another project. --- NEW FILE: AE.carbon.mcp.xml --- [...1038 lines suppressed...] MSL ShLibRuntime.Lib MacOS AE.carbon Name PythonCoreCarbon MacOS AE.carbon Name CarbonLib MacOS From jackjansen@users.sourceforge.net Tue Aug 7 16:28:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:28:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macfsmodule.c,1.40,1.41 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv14848/python/Mac/Modules Modified Files: macfsmodule.c Log Message: Removed unused variable. Index: macfsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macfsmodule.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** macfsmodule.c 2001/08/06 15:32:30 1.40 --- macfsmodule.c 2001/08/07 15:28:52 1.41 *************** *** 1197,1202 **** return 0; #else - OSErr err; - /* If it's an FSRef we're also okay. */ if (_mfs_GetFSRefFromFSRef(v, fsr)) --- 1197,1200 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:29:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:29:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macconfig.c,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv15034/python/Mac/Modules Modified Files: macconfig.c Log Message: Got rid of mactcp cruft, added Mlte and CF modules. Index: macconfig.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macconfig.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** macconfig.c 2001/08/07 13:52:31 1.25 --- macconfig.c 2001/08/07 15:29:17 1.26 *************** *** 88,95 **** extern void initmacspeech(); #endif - #ifdef USE_MACTCP - extern void initmacdnr(); - extern void initmactcp(); - #endif #ifdef USE_IC extern void initicglue(); --- 88,91 ---- *************** *** 104,107 **** --- 100,104 ---- extern void initIcn(); extern void initList(); + extern void initMlte(); extern void initQdoffs(); extern void initSnd(); *************** *** 111,114 **** --- 108,112 ---- extern void initColorPicker(); extern void initPrinting(); + extern void initCF(); #endif #ifdef USE_CORE_TOOLBOX *************** *** 216,223 **** {"macspeech", initmacspeech}, #endif - #ifdef USE_MACTCP - {"macdnr", initmacdnr}, - {"mactcp", initmactcp}, - #endif #ifdef USE_IC {"icglue", initicglue}, --- 214,217 ---- *************** *** 239,242 **** --- 233,237 ---- {"Icn", initIcn}, {"List", initList}, + {"Mlte", initMlte}, {"Qdoffs", initQdoffs}, {"Snd", initSnd}, *************** *** 249,252 **** --- 244,250 ---- {"Help", initHelp}, {"Printing", initPrinting}, + #endif + #if TARGET_API_MAC_CARBON + {"CF", initCF}, #endif #endif From jackjansen@users.sourceforge.net Tue Aug 7 16:30:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:30:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macspeechmodule.c,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv15301/python/Mac/Modules Modified Files: macspeechmodule.c Log Message: Got rid of 68k-Mac and other outdated ifdefs. Index: macspeechmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macspeechmodule.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** macspeechmodule.c 2000/07/11 21:15:50 1.11 --- macspeechmodule.c 2001/08/07 15:30:01 1.12 *************** *** 43,50 **** #endif /* __MWERKS__ */ - #ifdef __powerc #include int lib_available; - #endif /* __powerc */ /* Somehow the Apple Fix2X and X2Fix don't do what I expect */ --- 43,48 ---- *************** *** 61,67 **** long result; - #ifdef __powerc lib_available = ((ProcPtr)SpeakString != (ProcPtr)0); - #endif err = Gestalt(gestaltSpeechAttr, &result); if ( err == noErr && (result & (1< Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv15378/python/Mac/Python Modified Files: macglue.c Log Message: Got rid of 68k-Mac and other outdated ifdefs. Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** macglue.c 2001/08/03 15:39:27 1.99 --- macglue.c 2001/08/07 15:30:07 1.100 *************** *** 47,63 **** #include #include - #ifdef __CFM68K__ - /* cfm68k InterfaceLib exports GetEventQueue, but Events.h doesn't know this - ** and defines it as GetEvQHdr (which is correct for PPC). This fix is for - ** CW9, check that the workaround is still needed for the next release. - */ - #define GetEvQHdr GetEventQueue - #endif /* __CFM68K__ */ - #include - - #ifdef __CFM68K__ - #undef GetEventQueue - #endif /* __CFM68K__ */ #else #include --- 47,51 ---- *************** *** 100,108 **** */ #ifndef MINIMUM_STACK_SIZE - #ifdef __powerc #define MINIMUM_STACK_SIZE 8192 - #else - #define MINIMUM_STACK_SIZE 4096 - #endif #endif --- 88,92 ---- From akuchling@users.sourceforge.net Tue Aug 7 16:30:13 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Tue, 07 Aug 2001 08:30:13 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0238.txt,1.15,1.16 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv15403 Modified Files: pep-0238.txt Log Message: Fix typo Index: pep-0238.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0238.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pep-0238.txt 2001/08/07 02:52:37 1.15 --- pep-0238.txt 2001/08/07 15:30:11 1.16 *************** *** 150,154 **** - x \ y. The backslash is already a token, meaning line continuation, and in general it suggests an "escape" to Unix ! eyes. In addition (this due to terry Reedy) this would make things like eval("x\y") harder to get right. --- 150,154 ---- - x \ y. The backslash is already a token, meaning line continuation, and in general it suggests an "escape" to Unix ! eyes. In addition (this due to Terry Reedy) this would make things like eval("x\y") harder to get right. From jackjansen@users.sourceforge.net Tue Aug 7 16:30:15 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:30:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include pyconfig.h,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv15445/python/Mac/Include Modified Files: pyconfig.h Log Message: Got rid of 68k-Mac and other outdated ifdefs. Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/pyconfig.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pyconfig.h 2001/08/07 12:33:32 1.2 --- pyconfig.h 2001/08/07 15:30:13 1.3 *************** *** 470,479 **** /* Define if you have the hypot function. */ - #ifndef __MC68K__ - /* 68K hypot definition (and implementation) are unuseable - ** because they use 10-byte floats. - */ #define HAVE_HYPOT - #endif /* Define if you have the inet_pton function. */ --- 470,474 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:30:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:30:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macimport.c,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv15519/python/Mac/Python Modified Files: macimport.c Log Message: Got rid of 68k-Mac and other outdated ifdefs. Index: macimport.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macimport.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** macimport.c 2001/06/26 06:54:33 1.11 --- macimport.c 2001/08/07 15:30:18 1.12 *************** *** 146,158 **** HLock(h); /* XXXX Unsafe if resource not correctly formatted! */ - #ifdef __CFM68K__ - /* for cfm68k we take the second pstring */ - *dataptr = *((*h)+(**h)+1); - memcpy(dataptr+1, (*h)+(**h)+2, (int)*dataptr); - #else /* for ppc we take the first pstring */ *dataptr = **h; memcpy(dataptr+1, (*h)+1, (int)*dataptr); - #endif HUnlock(h); } --- 146,152 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:30:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:30:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macapplication.c,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv15551/python/Mac/Python Modified Files: macapplication.c Log Message: Got rid of 68k-Mac and other outdated ifdefs. Index: macapplication.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macapplication.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** macapplication.c 2000/07/11 21:16:01 1.11 --- macapplication.c 2001/08/07 15:30:23 1.12 *************** *** 28,35 **** #include - #ifdef __CFM68K__ - #pragma lib_export on - #endif - extern void PyMac_InitApplication(void); #ifdef USE_MAC_APPLET_SUPPORT --- 28,31 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:32:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:32:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include pyport.h,2.29,2.30 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv16461/python/Include Modified Files: pyport.h Log Message: Got rid of (hopefully) the last 68k-mac related ifdefs. Index: pyport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -d -r2.29 -r2.30 *** pyport.h 2001/07/26 21:34:59 2.29 --- pyport.h 2001/08/07 15:32:30 2.30 *************** *** 274,341 **** ************************/ - /* On the 68K Mac, when using CFM (Code Fragment Manager), - requires special treatment -- we need to surround it with - #pragma lib_export off / on... - This is because MathLib.o is a static library, and exporting its - symbols doesn't quite work... - XXX Not sure now... Seems to be something else going on as well... */ - #ifndef HAVE_HYPOT extern double hypot(double, double); - #ifdef MWERKS_BEFORE_PRO4 - #define hypot we_dont_want_faulty_hypot_decl - #endif - #endif - - #ifndef HAVE_HYPOT - #ifdef __MWERKS__ - #undef hypot - #endif - #endif - - #if defined(USE_MSL) && defined(__MC68K__) - /* CodeWarrior MSL 2.1.1 has weird define overrides that don't work - ** when you take the address of math functions. If I interpret the - ** ANSI C standard correctly this is illegal, but I haven't been able - ** to convince the MetroWerks folks of this... - */ - #undef acos - #undef asin - #undef atan - #undef atan2 - #undef ceil - #undef cos - #undef cosh - #undef exp - #undef fabs - #undef floor - #undef fmod - #undef log - #undef log10 - #undef pow - #undef sin - #undef sinh - #undef sqrt - #undef tan - #undef tanh - #define acos acosd - #define asin asind - #define atan atand - #define atan2 atan2d - #define ceil ceild - #define cos cosd - #define cosh coshd - #define exp expd - #define fabs fabsd - #define floor floord - #define fmod fmodd - #define log logd - #define log10 log10d - #define pow powd - #define sin sind - #define sinh sinhd - #define sqrt sqrtd - #define tan tand - #define tanh tanhd #endif --- 274,279 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:32:39 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:32:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _tkinter.c,1.117,1.118 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv16491/python/Modules Modified Files: _tkinter.c Log Message: Got rid of (hopefully) the last 68k-mac related ifdefs. Index: _tkinter.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** _tkinter.c 2001/07/16 19:32:52 1.117 --- _tkinter.c 2001/08/07 15:32:37 1.118 *************** *** 184,197 **** staticforward int PyMacConvertEvent(EventRecord *eventPtr); - #if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__) - #pragma import on - #endif - #include extern int SIOUXIsAppWindow(WindowPtr); - #if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__) - #pragma import reset - #endif #endif /* macintosh */ --- 184,190 ---- From jackjansen@users.sourceforge.net Tue Aug 7 16:34:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 08:34:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonStandalone.mcp,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv17180/python/Mac/Build Modified Files: PythonStandalone.mcp Log Message: Brought up-to-date. Index: PythonStandalone.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandalone.mcp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 Binary files /tmp/cvsa0y9Nw and /tmp/cvs0YO8JU differ From gvanrossum@users.sourceforge.net Tue Aug 7 16:44:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 08:44:17 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0252.txt,1.16,1.17 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv20220 Modified Files: pep-0252.txt Log Message: Add note about similarity between class methods and Delphi's virtual class methods. Index: pep-0252.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0252.txt,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pep-0252.txt 2001/07/29 23:25:00 1.16 --- pep-0252.txt 2001/08/07 15:44:15 1.17 *************** *** 382,389 **** they are invoked. This has no C++ or Java equivalent, and is not quite the same as what class methods are in Smalltalk, but may ! serve a similar purpose. (Python also has real metaclasses, and ! perhaps methods defined in a metaclass have more right to the name ! "class method"; but I expect that most programmers won't be using ! metaclasses.) Here's an example: class C: --- 382,391 ---- they are invoked. This has no C++ or Java equivalent, and is not quite the same as what class methods are in Smalltalk, but may ! serve a similar purpose. According to Armin Rigo, they are ! similar to "virtual class methods" in Borland Pascal dialect ! Delphi. (Python also has real metaclasses, and perhaps methods ! defined in a metaclass have more right to the name "class method"; ! but I expect that most programmers won't be using metaclasses.) ! Here's an example: class C: From jhylton@users.sourceforge.net Tue Aug 7 17:38:21 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 07 Aug 2001 09:38:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_scope.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv379 Modified Files: test_scope.py Log Message: silence warnings about import * Index: test_scope.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_scope.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test_scope.py 2001/07/30 21:55:29 1.18 --- test_scope.py 2001/08/07 16:38:19 1.19 *************** *** 1,4 **** --- 1,7 ---- from test.test_support import verify, TestFailed, check_syntax + import warnings + warnings.filterwarnings("ignore", "import *") + print "1. simple nesting" *************** *** 228,231 **** --- 231,235 ---- # and verify a few cases that should work + exec """ def noproblem1(): from string import * *************** *** 242,245 **** --- 246,250 ---- global y y = x + """ print "12. lambdas" *************** *** 479,480 **** --- 484,487 ---- else: print "eval() should have failed, because code contained free vars" + + warnings.resetwarnings() From gvanrossum@users.sourceforge.net Tue Aug 7 17:40:59 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 09:40:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.21,2.22 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv899 Modified Files: typeobject.c Log Message: Cosmetics: - Add comment blocks explaining add_operators() and override_slots(). (This file could use some more explaining, but this is all I had breath for today. :) - Renamed the argument 'base' of add_wrappers() to 'wraps' because it's not a base class (which is what the 'base' identifier is used for elsewhere). Small nits: - Fix add_tp_new_wrapper() to avoid overwriting an existing __new__ descriptor in tp_defined. - In add_operators(), check the return value of add_tp_new_wrapper(). Functional change: - Remove the tp_new functionality from PyBaseObject_Type; this means you can no longer instantiate the 'object' type. It's only useful as a base class. - To make up for the above loss, add tp_new to dynamic types. This has to be done in a hackish way (after override_slots() has been called, with an explicit call to add_tp_new_wrapper() at the very end) because otherwise I ran into recursive calls of slot_tp_new(). Sigh. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** typeobject.c 2001/08/06 16:50:37 2.21 --- typeobject.c 2001/08/07 16:40:56 2.22 *************** *** 448,451 **** --- 448,452 ---- staticforward void object_dealloc(PyObject *); staticforward int object_init(PyObject *, PyObject *, PyObject *); + staticforward int add_tp_new_wrapper(PyTypeObject *); static PyObject * *************** *** 663,666 **** --- 664,678 ---- /* Override slots that deserve it */ override_slots(type, type->tp_defined); + + /* Special hack for __new__ */ + if (type->tp_new == NULL) { + /* Can't do this earlier, or some nasty recursion happens. */ + type->tp_new = PyType_GenericNew; + if (add_tp_new_wrapper(type) < 0) { + Py_DECREF(type); + return NULL; + } + } + return (PyObject *)type; } *************** *** 894,898 **** object_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ ! PyType_GenericNew, /* tp_new */ object_free, /* tp_free */ }; --- 906,910 ---- object_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ ! 0, /* tp_new */ object_free, /* tp_free */ }; *************** *** 921,936 **** static int ! add_wrappers(PyTypeObject *type, struct wrapperbase *base, void *wrapped) { PyObject *dict = type->tp_defined; ! for (; base->name != NULL; base++) { PyObject *descr; ! if (PyDict_GetItemString(dict, base->name)) continue; ! descr = PyDescr_NewWrapper(type, base, wrapped); if (descr == NULL) return -1; ! if (PyDict_SetItemString(dict, base->name, descr) < 0) return -1; Py_DECREF(descr); --- 933,948 ---- static int ! add_wrappers(PyTypeObject *type, struct wrapperbase *wraps, void *wrapped) { PyObject *dict = type->tp_defined; ! for (; wraps->name != NULL; wraps++) { PyObject *descr; ! if (PyDict_GetItemString(dict, wraps->name)) continue; ! descr = PyDescr_NewWrapper(type, wraps, wrapped); if (descr == NULL) return -1; ! if (PyDict_SetItemString(dict, wraps->name, descr) < 0) return -1; Py_DECREF(descr); *************** *** 1871,1876 **** add_tp_new_wrapper(PyTypeObject *type) { ! PyObject *func = PyCFunction_New(tp_new_methoddef, (PyObject *)type); if (func == NULL) return -1; --- 1883,1891 ---- add_tp_new_wrapper(PyTypeObject *type) { ! PyObject *func; + if (PyDict_GetItemString(type->tp_defined, "__new__") != NULL) + return 0; + func = PyCFunction_New(tp_new_methoddef, (PyObject *)type); if (func == NULL) return -1; *************** *** 1878,1881 **** --- 1893,1917 ---- } + /* This function is called by PyType_InitDict() to populate the type's + dictionary with method descriptors for function slots. For each + function slot (like tp_repr) that's defined in the type, one or + more corresponding descriptors are added in the type's tp_defined + dictionary under the appropriate name (like __repr__). Some + function slots cause more than one descriptor to be added (for + example, the nb_add slot adds both __add__ and __radd__ + descriptors) and some function slots compete for the same + descriptor (for example both sq_item and mp_subscript generate a + __getitem__ descriptor). This only adds new descriptors and + doesn't overwrite entries in tp_defined that were previously + defined. The descriptors contain a reference to the C function + they must call, so that it's safe if they are copied into a + subtype's __dict__ and the subtype has a different C function in + its slot -- calling the method defined by the descriptor will call + the C function that was used to create it, rather than the C + function present in the slot when it is called. (This is important + because a subtype may have a C function in the slot that calls the + method from the dictionary, and we want to avoid infinite recursion + here.) */ + static int add_operators(PyTypeObject *type) *************** *** 1967,1977 **** ADD(type->tp_init, tab_init); ! if (type->tp_new != NULL) ! add_tp_new_wrapper(type); return 0; } ! /* Slot wrappers that call the corresponding __foo__ slot */ #define SLOT0(SLOTNAME, OPNAME) \ --- 2003,2016 ---- ADD(type->tp_init, tab_init); ! if (type->tp_new != NULL) { ! if (add_tp_new_wrapper(type) < 0) ! return -1; ! } return 0; } ! /* Slot wrappers that call the corresponding __foo__ slot. See comments ! below at override_slots() for more explanation. */ #define SLOT0(SLOTNAME, OPNAME) \ *************** *** 2295,2298 **** --- 2334,2353 ---- return x; } + + /* This is called at the very end of type_new() (even after + PyType_InitDict()) to complete the initialization of dynamic types. + The dict argument is the dictionary argument passed to type_new(), + which is the local namespace of the class statement, in other + words, it contains the methods. For each special method (like + __repr__) defined in the dictionary, the corresponding function + slot in the type object (like tp_repr) is set to a special function + whose name is 'slot_' followed by the slot name and whose signature + is whatever is required for that slot. These slot functions look + up the corresponding method in the type's dictionary and call it. + The slot functions have to take care of the various peculiarities + of the mapping between slots and special methods, such as mapping + one slot to multiple methods (tp_richcompare <--> __le__, __lt__ + etc.) or mapping multiple slots to a single method (sq_item, + mp_subscript <--> __getitem__). */ static void From gvanrossum@users.sourceforge.net Tue Aug 7 17:53:44 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 09:53:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv3920 Modified Files: test_descr.py Log Message: Remove the test for the 'object' type -- it can no longer be instantiated. (Its use as a base class is adequately tested by other tests.) Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_descr.py 2001/08/02 04:15:00 1.2 --- test_descr.py 2001/08/07 16:53:42 1.3 *************** *** 473,499 **** verify(G.__mro__ == (G, E, D, C, B, A, object)) - def objects(): - if verbose: print "Testing object class..." - a = object() - verify(a.__class__ == object == type(a)) - b = object() - verify(a is not b) - verify(not hasattr(a, "foo")) - try: - a.foo = 12 - except TypeError: - pass - else: - verify(0, "object() should not allow setting a foo attribute") - verify(not hasattr(object(), "__dict__")) - - class Cdict(object): - pass - x = Cdict() - verify(x.__dict__ is None) - x.foo = 1 - verify(x.foo == 1) - verify(x.__dict__ == {'foo': 1}) - def slots(): if verbose: print "Testing __slots__..." --- 473,476 ---- *************** *** 813,817 **** multi() diamond() - objects() slots() dynamics() --- 790,793 ---- From gvanrossum@users.sourceforge.net Tue Aug 7 18:15:38 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 10:15:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/idle ScriptBinding.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/idle In directory usw-pr-cvs1:/tmp/cvs-serv10010 Modified Files: ScriptBinding.py Log Message: Fix for SF bug #448835. Fix this to work with the new (still undocumented) tabnanny API. I'm afraid Stephen will have to add this fix to the IDLE fork code base as well. Index: ScriptBinding.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/idle/ScriptBinding.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ScriptBinding.py 2001/01/17 08:48:39 1.10 --- ScriptBinding.py 2001/08/07 17:15:36 1.11 *************** *** 70,77 **** import tabnanny import tokenize - tabnanny.reset_globals() f = open(filename, 'r') try: ! tokenize.tokenize(f.readline, tabnanny.tokeneater) except tokenize.TokenError, msg: self.errorbox("Token error", --- 70,76 ---- import tabnanny import tokenize f = open(filename, 'r') try: ! tabnanny.process_tokens(tokenize.generate_tokens(f.readline)) except tokenize.TokenError, msg: self.errorbox("Token error", From gvanrossum@users.sourceforge.net Tue Aug 7 18:19:27 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 10:19:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib tabnanny.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11061 Modified Files: tabnanny.py Log Message: Add the NannyNag exception class and the process_tokens() function to __all__, to indicate these are implied as part of the public API. IDLE's "Check Module" command uses this, and it broke once already because the reset_globals() and tokeneater() functions were deleted when Neil converted this to using the generator API of tokenizer. (See SF bug #448835.) Index: tabnanny.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/tabnanny.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tabnanny.py 2001/06/29 23:51:08 1.15 --- tabnanny.py 2001/08/07 17:19:25 1.16 *************** *** 18,22 **** raise ValueError("tokenize.NL doesn't exist -- tokenize module too old") ! __all__ = ["check"] verbose = 0 --- 18,22 ---- raise ValueError("tokenize.NL doesn't exist -- tokenize module too old") ! __all__ = ["check", "NannyNag", "process_tokens"] verbose = 0 From gvanrossum@users.sourceforge.net Tue Aug 7 18:24:30 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 10:24:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include object.h,2.81,2.82 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv12129/Include Modified Files: object.h Log Message: - Rename PyType_InitDict() to PyType_Ready(). - Add an explicit call to PyType_Ready(&PyList_Type) to pythonrun.c (just for the heck of it, really -- we should either explicitly ready all types, or none). Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.81 retrieving revision 2.82 diff -C2 -d -r2.81 -r2.82 *** object.h 2001/08/05 21:23:03 2.81 --- object.h 2001/08/07 17:24:28 2.82 *************** *** 298,302 **** #define PyType_Check(op) PyObject_TypeCheck(op, &PyType_Type) ! extern DL_IMPORT(int) PyType_InitDict(PyTypeObject *); extern DL_IMPORT(PyObject *) PyType_GenericAlloc(PyTypeObject *, int); extern DL_IMPORT(PyObject *) PyType_GenericNew(PyTypeObject *, --- 298,302 ---- #define PyType_Check(op) PyObject_TypeCheck(op, &PyType_Type) ! extern DL_IMPORT(int) PyType_Ready(PyTypeObject *); extern DL_IMPORT(PyObject *) PyType_GenericAlloc(PyTypeObject *, int); extern DL_IMPORT(PyObject *) PyType_GenericNew(PyTypeObject *, From gvanrossum@users.sourceforge.net Tue Aug 7 18:24:30 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 10:24:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules xxsubtype.c,2.1,2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12129/Modules Modified Files: xxsubtype.c Log Message: - Rename PyType_InitDict() to PyType_Ready(). - Add an explicit call to PyType_Ready(&PyList_Type) to pythonrun.c (just for the heck of it, really -- we should either explicitly ready all types, or none). Index: xxsubtype.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/xxsubtype.c,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -d -r2.1 -r2.2 *** xxsubtype.c 2001/08/02 04:15:00 2.1 --- xxsubtype.c 2001/08/07 17:24:28 2.2 *************** *** 213,219 **** return; ! if (PyType_InitDict(&spamlist_type) < 0) return; ! if (PyType_InitDict(&spamdict_type) < 0) return; --- 213,219 ---- return; ! if (PyType_Ready(&spamlist_type) < 0) return; ! if (PyType_Ready(&spamdict_type) < 0) return; From gvanrossum@users.sourceforge.net Tue Aug 7 18:24:30 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 10:24:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects object.c,2.135,2.136 typeobject.c,2.22,2.23 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv12129/Objects Modified Files: object.c typeobject.c Log Message: - Rename PyType_InitDict() to PyType_Ready(). - Add an explicit call to PyType_Ready(&PyList_Type) to pythonrun.c (just for the heck of it, really -- we should either explicitly ready all types, or none). Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.135 retrieving revision 2.136 diff -C2 -d -r2.135 -r2.136 *** object.c 2001/08/02 04:15:00 2.135 --- object.c 2001/08/07 17:24:28 2.136 *************** *** 1161,1165 **** if (tp->tp_dict == NULL) { ! if (PyType_InitDict(tp) < 0) return NULL; } --- 1161,1165 ---- if (tp->tp_dict == NULL) { ! if (PyType_Ready(tp) < 0) return NULL; } *************** *** 1208,1212 **** if (tp->tp_dict == NULL) { ! if (PyType_InitDict(tp) < 0) return -1; } --- 1208,1212 ---- if (tp->tp_dict == NULL) { ! if (PyType_Ready(tp) < 0) return -1; } Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.22 retrieving revision 2.23 diff -C2 -d -r2.22 -r2.23 *** typeobject.c 2001/08/07 16:40:56 2.22 --- typeobject.c 2001/08/07 17:24:28 2.23 *************** *** 388,392 **** } if (base_i->tp_dict == NULL) { ! if (PyType_InitDict(base_i) < 0) return NULL; } --- 388,392 ---- } if (base_i->tp_dict == NULL) { ! if (PyType_Ready(base_i) < 0) return NULL; } *************** *** 657,661 **** /* Initialize the rest */ ! if (PyType_InitDict(type) < 0) { Py_DECREF(type); return NULL; --- 657,661 ---- /* Initialize the rest */ ! if (PyType_Ready(type) < 0) { Py_DECREF(type); return NULL; *************** *** 720,724 **** /* Initialize this type (we'll assume the metatype is initialized) */ if (type->tp_dict == NULL) { ! if (PyType_InitDict(type) < 0) return NULL; } --- 720,724 ---- /* Initialize this type (we'll assume the metatype is initialized) */ if (type->tp_dict == NULL) { ! if (PyType_Ready(type) < 0) return NULL; } *************** *** 1158,1162 **** int ! PyType_InitDict(PyTypeObject *type) { PyObject *dict, *bases, *x; --- 1158,1162 ---- int ! PyType_Ready(PyTypeObject *type) { PyObject *dict, *bases, *x; *************** *** 1186,1190 **** /* Initialize the base class */ if (base && base->tp_dict == NULL) { ! if (PyType_InitDict(base) < 0) return -1; } --- 1186,1190 ---- /* Initialize the base class */ if (base && base->tp_dict == NULL) { ! if (PyType_Ready(base) < 0) return -1; } *************** *** 1893,1897 **** } ! /* This function is called by PyType_InitDict() to populate the type's dictionary with method descriptors for function slots. For each function slot (like tp_repr) that's defined in the type, one or --- 1893,1897 ---- } ! /* This function is called by PyType_Ready() to populate the type's dictionary with method descriptors for function slots. For each function slot (like tp_repr) that's defined in the type, one or *************** *** 2336,2340 **** /* This is called at the very end of type_new() (even after ! PyType_InitDict()) to complete the initialization of dynamic types. The dict argument is the dictionary argument passed to type_new(), which is the local namespace of the class statement, in other --- 2336,2340 ---- /* This is called at the very end of type_new() (even after ! PyType_Ready()) to complete the initialization of dynamic types. The dict argument is the dictionary argument passed to type_new(), which is the local namespace of the class statement, in other From gvanrossum@users.sourceforge.net Tue Aug 7 18:24:31 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 10:24:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python pythonrun.c,2.140,2.141 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv12129/Python Modified Files: pythonrun.c Log Message: - Rename PyType_InitDict() to PyType_Ready(). - Add an explicit call to PyType_Ready(&PyList_Type) to pythonrun.c (just for the heck of it, really -- we should either explicitly ready all types, or none). Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.140 retrieving revision 2.141 diff -C2 -d -r2.140 -r2.141 *** pythonrun.c 2001/08/02 04:15:00 2.140 --- pythonrun.c 2001/08/07 17:24:28 2.141 *************** *** 116,121 **** (void) PyThreadState_Swap(tstate); ! if (PyType_InitDict(&PyType_Type) < 0) Py_FatalError("Py_Initialize: can't initialize 'type'"); interp->modules = PyDict_New(); --- 116,124 ---- (void) PyThreadState_Swap(tstate); ! if (PyType_Ready(&PyType_Type) < 0) Py_FatalError("Py_Initialize: can't initialize 'type'"); + + if (PyType_Ready(&PyList_Type) < 0) + Py_FatalError("Py_Initialize: can't initialize 'list'"); interp->modules = PyDict_New(); From gvanrossum@users.sourceforge.net Tue Aug 7 18:40:44 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 10:40:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib UserDict.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv16710 Modified Files: UserDict.py Log Message: Remove the __iter__ method from the UserDict class -- it can silently break old code (in extreme cases). See SF bug #448153. Add a new subclass IterableUserDict that has the __iter__ method. Note that for new projects, unless backwards compatibility with pre-2.2 Python is required, subclassing 'dictionary' is recommended; UserDict might become deprecated. Index: UserDict.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/UserDict.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** UserDict.py 2001/06/18 01:09:41 1.14 --- UserDict.py 2001/08/07 17:40:42 1.15 *************** *** 48,51 **** --- 48,53 ---- def __contains__(self, key): return key in self.data + + class IterableUserDict(UserDict): def __iter__(self): return iter(self.data) From gvanrossum@users.sourceforge.net Tue Aug 7 18:50:08 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 10:50:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_userdict.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18694 Modified Files: test_userdict.py Log Message: Fix the test so it uses IterableUserDict for the "for x in dict" test. Index: test_userdict.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_userdict.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_userdict.py 2001/04/21 09:13:15 1.3 --- test_userdict.py 2001/08/07 17:50:06 1.4 *************** *** 2,6 **** from test_support import verify, verbose ! from UserDict import UserDict d0 = {} --- 2,6 ---- from test_support import verify, verbose ! from UserDict import UserDict, IterableUserDict d0 = {} *************** *** 13,17 **** u0 = UserDict(d0) u1 = UserDict(d1) ! u2 = UserDict(d2) uu = UserDict(u) --- 13,17 ---- u0 = UserDict(d0) u1 = UserDict(d1) ! u2 = IterableUserDict(d2) uu = UserDict(u) From fdrake@users.sourceforge.net Tue Aug 7 20:14:48 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 07 Aug 2001 12:14:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/xml/sax saxutils.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/xml/sax In directory usw-pr-cvs1:/tmp/cvs-serv6947/xml/sax Modified Files: saxutils.py Log Message: Make sure XMLGenerator uses quoteattr() instead of escape() to quote attribute values. Just using escape() can (and always has) led to broken XML being generated. This makes sure it always produces the right thing. This actually closes SF bug #440351. Index: saxutils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/saxutils.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** saxutils.py 2001/07/19 16:10:15 1.15 --- saxutils.py 2001/08/07 19:14:46 1.16 *************** *** 81,85 **** self._out.write('<' + name) for (name, value) in attrs.items(): ! self._out.write(' %s="%s"' % (name, escape(value))) self._out.write('>') --- 81,85 ---- self._out.write('<' + name) for (name, value) in attrs.items(): ! self._out.write(' %s=%s' % (name, quoteattr(value))) self._out.write('>') *************** *** 102,106 **** for (name, value) in attrs.items(): name = self._current_context[name[0]] + ":" + name[1] ! self._out.write(' %s="%s"' % (name, escape(value))) self._out.write('>') --- 102,106 ---- for (name, value) in attrs.items(): name = self._current_context[name[0]] + ":" + name[1] ! self._out.write(' %s=%s' % (name, quoteattr(value))) self._out.write('>') From fdrake@users.sourceforge.net Tue Aug 7 20:17:08 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 07 Aug 2001 12:17:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_sax.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv7522/test Modified Files: test_sax.py Log Message: Add a test that xml.sax.saxutils.XMLGenerator does the right thing when quoting attribute values that contain single & double quotes. This provides the rest of the regression test for SF bug #440351. Index: test_sax.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sax.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test_sax.py 2001/07/19 16:10:15 1.17 --- test_sax.py 2001/08/07 19:17:05 1.18 *************** *** 150,153 **** --- 150,169 ---- return result.getvalue() == start + "<huhei&" + def test_xmlgen_attr_escape(): + result = StringIO() + gen = XMLGenerator(result) + + gen.startDocument() + gen.startElement("doc", {"a": '"'}) + gen.startElement("e", {"a": "'"}) + gen.endElement("e") + gen.startElement("e", {"a": "'\""}) + gen.endElement("e") + gen.endElement("doc") + gen.endDocument() + + return result.getvalue() == start \ + + "" + def test_xmlgen_ignorable(): result = StringIO() From fdrake@users.sourceforge.net Tue Aug 7 20:17:08 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 07 Aug 2001 12:17:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_sax,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv7522/test/output Modified Files: test_sax Log Message: Add a test that xml.sax.saxutils.XMLGenerator does the right thing when quoting attribute values that contain single & double quotes. This provides the rest of the regression test for SF bug #440351. Index: test_sax =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_sax,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_sax 2001/07/19 16:10:15 1.9 --- test_sax 2001/08/07 19:17:06 1.10 *************** *** 30,33 **** --- 30,34 ---- Passed test_single_double_quoteattr Passed test_single_quoteattr + Passed test_xmlgen_attr_escape Passed test_xmlgen_basic Passed test_xmlgen_content *************** *** 36,38 **** Passed test_xmlgen_ns Passed test_xmlgen_pi ! 36 tests, 0 failures --- 37,39 ---- Passed test_xmlgen_ns Passed test_xmlgen_pi ! 37 tests, 0 failures From fdrake@users.sourceforge.net Tue Aug 7 20:49:17 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 07 Aug 2001 12:49:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib rexec.py,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14971 Modified Files: rexec.py Log Message: Remove make_re() function; this is no longer needed since _sre and pcre are now allowed by ok_builtin_modules. This effectively backs out revision 1.26. This closes SF bug #448546. Index: rexec.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/rexec.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** rexec.py 2001/06/22 18:19:16 1.30 --- rexec.py 2001/08/07 19:49:15 1.31 *************** *** 155,161 **** self.loader = RModuleLoader(self.hooks, verbose) self.importer = RModuleImporter(self.loader, verbose) - # but since re isn't normally built-in, we can add it at the end; - # we need the imported to be set before this can be imported. - self.make_re() def set_trusted_path(self): --- 155,158 ---- *************** *** 202,212 **** for key, value in os.environ.items(): e[key] = value - - def make_re(self): - dst = self.add_module("re") - src = self.r_import("pre") - for name in dir(src): - if name != "__name__": - setattr(dst, name, getattr(src, name)) def make_sys(self): --- 199,202 ---- From gvanrossum@users.sourceforge.net Tue Aug 7 20:55:12 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 12:55:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib CGIHTTPServer.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv16654 Modified Files: CGIHTTPServer.py Log Message: Apply two small changes to the Windows code, according to SF bug #427345. These are supposed to support binary data and avoid buffering problems on Windows. Index: CGIHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/CGIHTTPServer.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CGIHTTPServer.py 2001/02/09 12:10:26 1.17 --- CGIHTTPServer.py 2001/08/07 19:55:10 1.18 *************** *** 224,228 **** # On Windows, use python.exe, not python.exe interp = interp[:-5] = interp[-4:] ! cmdline = "%s %s" % (interp, cmdline) if '=' not in query and '"' not in query: cmdline = '%s "%s"' % (cmdline, query) --- 224,228 ---- # On Windows, use python.exe, not python.exe interp = interp[:-5] = interp[-4:] ! cmdline = "%s -u %s" % (interp, cmdline) if '=' not in query and '"' not in query: cmdline = '%s "%s"' % (cmdline, query) *************** *** 232,236 **** except: nbytes = 0 ! fi, fo = os.popen2(cmdline) if self.command.lower() == "post" and nbytes > 0: data = self.rfile.read(nbytes) --- 232,236 ---- except: nbytes = 0 ! fi, fo = os.popen2(cmdline, 'b') if self.command.lower() == "post" and nbytes > 0: data = self.rfile.read(nbytes) From jhylton@users.sourceforge.net Tue Aug 7 22:12:27 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 07 Aug 2001 14:12:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib urllib2.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3491 Modified Files: urllib2.py Log Message: Fix SF bug [ #447370 ] typo in urllib2.py Also fix another bug caught by pychecker-- HTTPError() raised when redirect limit exceed did not pass an fp object. Had to change method to keep fp object around until it's certain that the error won't be raised. Remove useless line in do_proxy(). Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** urllib2.py 2001/08/02 07:15:29 1.16 --- urllib2.py 2001/08/07 21:12:25 1.17 *************** *** 437,443 **** else: return - nil = fp.read() - fp.close() - newurl = urlparse.urljoin(req.get_full_url(), newurl) --- 437,440 ---- *************** *** 451,457 **** req.error_302_dict.has_key(newurl): raise HTTPError(req.get_full_url(), code, ! self.inf_msg + msg, headers) new.error_302_dict.update(req.error_302_dict) new.error_302_dict[newurl] = newurl return self.parent.open(new) --- 448,460 ---- req.error_302_dict.has_key(newurl): raise HTTPError(req.get_full_url(), code, ! self.inf_msg + msg, headers, fp) new.error_302_dict.update(req.error_302_dict) new.error_302_dict[newurl] = newurl + + # Don't close the fp until we are sure that we won't use it + # with HTTPError. + fp.read() + fp.close() + return self.parent.open(new) *************** *** 526,530 **** def do_proxy(self, p, req): - p return self.parent.open(req) --- 529,532 ---- *************** *** 660,664 **** def __init__(self, passwd=None): if passwd is None: ! passwd = HTTPPassowrdMgr() self.passwd = passwd self.add_password = self.passwd.add_password --- 662,666 ---- def __init__(self, passwd=None): if passwd is None: ! passwd = HTTPPasswordMgr() self.passwd = passwd self.add_password = self.passwd.add_password *************** *** 1052,1056 **** def build_opener(self): ! opener = OpenerDirectory() for ph in self.proxy_handlers: if type(ph) == types.ClassType: --- 1054,1058 ---- def build_opener(self): ! opener = OpenerDirector() for ph in self.proxy_handlers: if type(ph) == types.ClassType: From tim_one@users.sourceforge.net Tue Aug 7 23:10:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 07 Aug 2001 15:10:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules mathmodule.c,2.59,2.60 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17751/python/dist/src/Modules Modified Files: mathmodule.c Log Message: Part of SF patch [#431848] mathmodule.c: doc strings & conversion, from Peter Schneider-Kamp. Clarified some docstrings in the spirit of the patch; left out the degrees() and radians() functions (see the patch comments on SF). Index: mathmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mathmodule.c,v retrieving revision 2.59 retrieving revision 2.60 diff -C2 -d -r2.59 -r2.60 *** mathmodule.c 2001/06/10 16:45:08 2.59 --- mathmodule.c 2001/08/07 22:10:00 2.60 *************** *** 52,56 **** */ if (x) ! PyErr_SetString(PyExc_OverflowError, "math range error"); else --- 52,56 ---- */ if (x) ! PyErr_SetString(PyExc_OverflowError, "math range error"); else *************** *** 110,124 **** FUNC1(acos, acos, ! "acos(x)\n\nReturn the arc cosine of x.") FUNC1(asin, asin, ! "asin(x)\n\nReturn the arc sine of x.") FUNC1(atan, atan, ! "atan(x)\n\nReturn the arc tangent of x.") FUNC2(atan2, atan2, ! "atan2(y, x)\n\nReturn atan(y/x).") FUNC1(ceil, ceil, ! "ceil(x)\n\nReturn the ceiling of x as a real.") FUNC1(cos, cos, ! "cos(x)\n\nReturn the cosine of x.") FUNC1(cosh, cosh, "cosh(x)\n\nReturn the hyperbolic cosine of x.") --- 110,126 ---- FUNC1(acos, acos, ! "acos(x)\n\nReturn the arc cosine (measured in radians) of x.") FUNC1(asin, asin, ! "asin(x)\n\nReturn the arc sine (measured in radians) of x.") FUNC1(atan, atan, ! "atan(x)\n\nReturn the arc tangent (measured in radians) of x.") FUNC2(atan2, atan2, ! "atan2(y, x)\n\nReturn the arc tangent (measured in radians) of y/x.\n" ! "Unlike atan(y/x), the signs of both x and y are considered.") FUNC1(ceil, ceil, ! "ceil(x)\n\nReturn the ceiling of x as a float.\n" ! "This is the smallest integral value >= x.") FUNC1(cos, cos, ! "cos(x)\n\nReturn the cosine of x (measured in radians).") FUNC1(cosh, cosh, "cosh(x)\n\nReturn the hyperbolic cosine of x.") *************** *** 126,132 **** "exp(x)\n\nReturn e raised to the power of x.") FUNC1(fabs, fabs, ! "fabs(x)\n\nReturn the absolute value of the real x.") FUNC1(floor, floor, ! "floor(x)\n\nReturn the floor of x as a real.") FUNC2(fmod, fmod, "fmod(x,y)\n\nReturn fmod(x, y), according to platform C." --- 128,135 ---- "exp(x)\n\nReturn e raised to the power of x.") FUNC1(fabs, fabs, ! "fabs(x)\n\nReturn the absolute value of the float x.") FUNC1(floor, floor, ! "floor(x)\n\nReturn the floor of x as a float.\n" ! "This is the largest integral value <= x.") FUNC2(fmod, fmod, "fmod(x,y)\n\nReturn fmod(x, y), according to platform C." *************** *** 140,150 **** #ifdef MPW_3_1 /* This hack is needed for MPW 3.1 but not for 3.2 ... */ FUNC2(pow, power, ! "pow(x,y)\n\nReturn x**y.") #else FUNC2(pow, pow, ! "pow(x,y)\n\nReturn x**y.") #endif FUNC1(sin, sin, ! "sin(x)\n\nReturn the sine of x.") FUNC1(sinh, sinh, "sinh(x)\n\nReturn the hyperbolic sine of x.") --- 143,153 ---- #ifdef MPW_3_1 /* This hack is needed for MPW 3.1 but not for 3.2 ... */ FUNC2(pow, power, ! "pow(x,y)\n\nReturn x**y (x to the power of y).") #else FUNC2(pow, pow, ! "pow(x,y)\n\nReturn x**y (x to the power of y).") #endif FUNC1(sin, sin, ! "sin(x)\n\nReturn the sine of x (measured in radians).") FUNC1(sinh, sinh, "sinh(x)\n\nReturn the hyperbolic sine of x.") *************** *** 152,156 **** "sqrt(x)\n\nReturn the square root of x.") FUNC1(tan, tan, ! "tan(x)\n\nReturn the tangent of x.") FUNC1(tanh, tanh, "tanh(x)\n\nReturn the hyperbolic tangent of x.") --- 155,159 ---- "sqrt(x)\n\nReturn the square root of x.") FUNC1(tan, tan, ! "tan(x)\n\nReturn the tangent of x (measured in radians).") FUNC1(tanh, tanh, "tanh(x)\n\nReturn the hyperbolic tangent of x.") *************** *** 199,203 **** } ! static char math_ldexp_doc [] = "ldexp_doc(x, i)\n\ \n\ --- 202,206 ---- } ! static char math_ldexp_doc [] = "ldexp_doc(x, i)\n\ \n\ *************** *** 271,275 **** { PyObject *m, *d, *v; ! m = Py_InitModule3("math", math_methods, module_doc); d = PyModule_GetDict(m); --- 274,278 ---- { PyObject *m, *d, *v; ! m = Py_InitModule3("math", math_methods, module_doc); d = PyModule_GetDict(m); From jackjansen@users.sourceforge.net Wed Aug 8 01:36:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 07 Aug 2001 17:36:55 -0700 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.45,1.46 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv13356 Modified Files: setup.py Log Message: Commented out most of the MacPython modules. There is a discussion on the pythonmac-sig about turning this all into a package, so in the mean time there is no reason to scribble all over people's disks. Interested parties can uncomment them. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** setup.py 2001/08/05 22:31:19 1.45 --- setup.py 2001/08/08 00:36:53 1.46 *************** *** 549,577 **** exts.append( Extension('icglue', ['icgluemodule.c']) ) exts.append( Extension('macfs', ['macfsmodule.c', '../Python/getapplbycreator.c']) ) ! exts.append( Extension('Nav', ['Nav.c']) ) ! exts.append( Extension('AE', ['ae/AEmodule.c']) ) ! exts.append( Extension('App', ['app/Appmodule.c']) ) ! exts.append( Extension('CF', ['cf/CFmodule.c'], ! extra_link_args=['-framework', 'CoreFoundation']) ) ! exts.append( Extension('Cm', ['cm/Cmmodule.c']) ) ! exts.append( Extension('Ctl', ['ctl/Ctlmodule.c']) ) ! exts.append( Extension('Dlg', ['dlg/Dlgmodule.c']) ) ! exts.append( Extension('Drag', ['drag/Dragmodule.c']) ) ! exts.append( Extension('Evt', ['evt/Evtmodule.c']) ) ! exts.append( Extension('Fm', ['fm/Fmmodule.c']) ) ! exts.append( Extension('Icn', ['icn/Icnmodule.c']) ) ! exts.append( Extension('List', ['list/Listmodule.c']) ) ! exts.append( Extension('Menu', ['menu/Menumodule.c']) ) ! exts.append( Extension('Mlte', ['mlte/Mltemodule.c']) ) ! exts.append( Extension('Qd', ['qd/Qdmodule.c']) ) ! exts.append( Extension('Qdoffs', ['qdoffs/Qdoffsmodule.c']) ) ! exts.append( Extension('Qt', ['qt/Qtmodule.c'], ! extra_link_args=['-framework', 'QuickTime']) ) ! exts.append( Extension('Res', ['res/Resmodule.c'] ) ) ! ## exts.append( Extension('Scrap', ['scrap/Scrapmodule.c']) ) ! exts.append( Extension('Snd', ['snd/Sndmodule.c']) ) ! exts.append( Extension('TE', ['te/TEmodule.c']) ) ! ## exts.append( Extension('waste', ['waste/wastemodule.c']) ) ! exts.append( Extension('Win', ['win/Winmodule.c']) ) self.extensions.extend(exts) --- 549,577 ---- exts.append( Extension('icglue', ['icgluemodule.c']) ) exts.append( Extension('macfs', ['macfsmodule.c', '../Python/getapplbycreator.c']) ) ! ## exts.append( Extension('Nav', ['Nav.c']) ) ! ## exts.append( Extension('AE', ['ae/AEmodule.c']) ) ! ## exts.append( Extension('App', ['app/Appmodule.c']) ) ! ## exts.append( Extension('CF', ['cf/CFmodule.c'], ! ## extra_link_args=['-framework', 'CoreFoundation']) ) ! ## exts.append( Extension('Cm', ['cm/Cmmodule.c']) ) ! ## exts.append( Extension('Ctl', ['ctl/Ctlmodule.c']) ) ! ## exts.append( Extension('Dlg', ['dlg/Dlgmodule.c']) ) ! ## exts.append( Extension('Drag', ['drag/Dragmodule.c']) ) ! ## exts.append( Extension('Evt', ['evt/Evtmodule.c']) ) ! ## exts.append( Extension('Fm', ['fm/Fmmodule.c']) ) ! ## exts.append( Extension('Icn', ['icn/Icnmodule.c']) ) ! ## exts.append( Extension('List', ['list/Listmodule.c']) ) ! ## exts.append( Extension('Menu', ['menu/Menumodule.c']) ) ! ## exts.append( Extension('Mlte', ['mlte/Mltemodule.c']) ) ! ## exts.append( Extension('Qd', ['qd/Qdmodule.c']) ) ! ## exts.append( Extension('Qdoffs', ['qdoffs/Qdoffsmodule.c']) ) ! ## exts.append( Extension('Qt', ['qt/Qtmodule.c'], ! ## extra_link_args=['-framework', 'QuickTime']) ) ! ## exts.append( Extension('Res', ['res/Resmodule.c'] ) ) ! #### exts.append( Extension('Scrap', ['scrap/Scrapmodule.c']) ) ! ## exts.append( Extension('Snd', ['snd/Sndmodule.c']) ) ! ## exts.append( Extension('TE', ['te/TEmodule.c']) ) ! #### exts.append( Extension('waste', ['waste/wastemodule.c']) ) ! ## exts.append( Extension('Win', ['win/Winmodule.c']) ) self.extensions.extend(exts) From gvanrossum@users.sourceforge.net Wed Aug 8 06:00:20 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 22:00:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib __future__.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23513/Lib Modified Files: __future__.py Log Message: Implement PEP 238 in its (almost) full glory. This introduces: - A new operator // that means floor division (the kind of division where 1/2 is 0). - The "future division" statement ("from __future__ import division) which changes the meaning of the / operator to implement "true division" (where 1/2 is 0.5). - New overloadable operators __truediv__ and __floordiv__. - New slots in the PyNumberMethods struct for true and floor division, new abstract APIs for them, new opcodes, and so on. I emphasize that without the future division statement, the semantics of / will remain unchanged until Python 3.0. Not yet implemented are warnings (default off) when / is used with int or long arguments. This has been on display since 7/31 as SF patch #443474. Flames to /dev/null. Index: __future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/__future__.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** __future__.py 2001/07/15 21:08:29 1.7 --- __future__.py 2001/08/08 05:00:17 1.8 *************** *** 69,70 **** --- 69,71 ---- nested_scopes = _Feature((2, 1, 0, "beta", 1), (2, 2, 0, "alpha", 0)) generators = _Feature((2, 2, 0, "alpha", 1), (2, 3, 0, "final", 0)) + division = _Feature((2, 2, 0, "alpha", 2), (3, 0, 0, "alpha", 0)) From gvanrossum@users.sourceforge.net Wed Aug 8 06:00:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 22:00:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Grammar Grammar,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Grammar In directory usw-pr-cvs1:/tmp/cvs-serv23513/Grammar Modified Files: Grammar Log Message: Implement PEP 238 in its (almost) full glory. This introduces: - A new operator // that means floor division (the kind of division where 1/2 is 0). - The "future division" statement ("from __future__ import division) which changes the meaning of the / operator to implement "true division" (where 1/2 is 0.5). - New overloadable operators __truediv__ and __floordiv__. - New slots in the PyNumberMethods struct for true and floor division, new abstract APIs for them, new opcodes, and so on. I emphasize that without the future division statement, the semantics of / will remain unchanged until Python 3.0. Not yet implemented are warnings (default off) when / is used with int or long arguments. This has been on display since 7/31 as SF patch #443474. Flames to /dev/null. Index: Grammar =================================================================== RCS file: /cvsroot/python/python/dist/src/Grammar/Grammar,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Grammar 2001/06/18 22:08:13 1.43 --- Grammar 2001/08/08 05:00:17 1.44 *************** *** 39,43 **** small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt expr_stmt: testlist (augassign testlist | ('=' testlist)*) ! augassign: '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' # For normal assignments, additional restrictions enforced by the interpreter print_stmt: 'print' ( [ test (',' test)* [','] ] | '>>' test [ (',' test)+ [','] ] ) --- 39,43 ---- small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt expr_stmt: testlist (augassign testlist | ('=' testlist)*) ! augassign: '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' | '//=' # For normal assignments, additional restrictions enforced by the interpreter print_stmt: 'print' ( [ test (',' test)* [','] ] | '>>' test [ (',' test)+ [','] ] ) *************** *** 78,82 **** shift_expr: arith_expr (('<<'|'>>') arith_expr)* arith_expr: term (('+'|'-') term)* ! term: factor (('*'|'/'|'%') factor)* factor: ('+'|'-'|'~') factor | power power: atom trailer* ('**' factor)* --- 78,82 ---- shift_expr: arith_expr (('<<'|'>>') arith_expr)* arith_expr: term (('+'|'-') term)* ! term: factor (('*'|'/'|'%'|'//') factor)* factor: ('+'|'-'|'~') factor | power power: atom trailer* ('**' factor)* From gvanrossum@users.sourceforge.net Wed Aug 8 06:00:20 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 22:00:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Parser tokenizer.c,2.50,2.51 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory usw-pr-cvs1:/tmp/cvs-serv23513/Parser Modified Files: tokenizer.c Log Message: Implement PEP 238 in its (almost) full glory. This introduces: - A new operator // that means floor division (the kind of division where 1/2 is 0). - The "future division" statement ("from __future__ import division) which changes the meaning of the / operator to implement "true division" (where 1/2 is 0.5). - New overloadable operators __truediv__ and __floordiv__. - New slots in the PyNumberMethods struct for true and floor division, new abstract APIs for them, new opcodes, and so on. I emphasize that without the future division statement, the semantics of / will remain unchanged until Python 3.0. Not yet implemented are warnings (default off) when / is used with int or long arguments. This has been on display since 7/31 as SF patch #443474. Flames to /dev/null. Index: tokenizer.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/tokenizer.c,v retrieving revision 2.50 retrieving revision 2.51 diff -C2 -d -r2.50 -r2.51 *** tokenizer.c 2001/04/21 02:46:11 2.50 --- tokenizer.c 2001/08/08 05:00:18 2.51 *************** *** 81,84 **** --- 81,86 ---- "RIGHTSHIFTEQUAL", "DOUBLESTAREQUAL", + "DOUBLESLASH", + "DOUBLESLASHEQUAL", /* This table must match the #defines in token.h! */ "OP", *************** *** 409,412 **** --- 411,415 ---- case '/': switch (c2) { + case '/': return DOUBLESLASH; case '=': return SLASHEQUAL; } *************** *** 466,469 **** --- 469,482 ---- case '=': return DOUBLESTAREQUAL; + } + break; + } + break; + case '/': + switch (c2) { + case '/': + switch (c3) { + case '=': + return DOUBLESLASHEQUAL; } break; From gvanrossum@users.sourceforge.net Wed Aug 8 06:00:20 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 22:00:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects abstract.c,2.70,2.71 classobject.c,2.134,2.135 complexobject.c,2.36,2.37 floatobject.c,2.84,2.85 intobject.c,2.60,2.61 longobject.c,1.90,1.91 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv23513/Objects Modified Files: abstract.c classobject.c complexobject.c floatobject.c intobject.c longobject.c Log Message: Implement PEP 238 in its (almost) full glory. This introduces: - A new operator // that means floor division (the kind of division where 1/2 is 0). - The "future division" statement ("from __future__ import division) which changes the meaning of the / operator to implement "true division" (where 1/2 is 0.5). - New overloadable operators __truediv__ and __floordiv__. - New slots in the PyNumberMethods struct for true and floor division, new abstract APIs for them, new opcodes, and so on. I emphasize that without the future division statement, the semantics of / will remain unchanged until Python 3.0. Not yet implemented are warnings (default off) when / is used with int or long arguments. This has been on display since 7/31 as SF patch #443474. Flames to /dev/null. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.70 retrieving revision 2.71 diff -C2 -d -r2.70 -r2.71 *** abstract.c 2001/08/02 04:15:00 2.70 --- abstract.c 2001/08/08 05:00:18 2.71 *************** *** 566,569 **** --- 566,583 ---- PyObject * + PyNumber_FloorDivide(PyObject *v, PyObject *w) + { + /* XXX tp_flags test */ + return binary_op(v, w, NB_SLOT(nb_floor_divide), "//"); + } + + PyObject * + PyNumber_TrueDivide(PyObject *v, PyObject *w) + { + /* XXX tp_flags test */ + return binary_op(v, w, NB_SLOT(nb_true_divide), "/"); + } + + PyObject * PyNumber_Remainder(PyObject *v, PyObject *w) { *************** *** 630,633 **** --- 644,663 ---- INPLACE_BINOP(PyNumber_InPlaceSubtract, nb_inplace_subtract, nb_subtract, "-=") INPLACE_BINOP(PyNumber_InPlaceDivide, nb_inplace_divide, nb_divide, "/=") + + PyObject * + PyNumber_InPlaceFloorDivide(PyObject *v, PyObject *w) + { + /* XXX tp_flags test */ + return binary_iop(v, w, NB_SLOT(nb_inplace_floor_divide), + NB_SLOT(nb_floor_divide), "//="); + } + + PyObject * + PyNumber_InPlaceTrueDivide(PyObject *v, PyObject *w) + { + /* XXX tp_flags test */ + return binary_iop(v, w, NB_SLOT(nb_inplace_true_divide), + NB_SLOT(nb_true_divide), "/="); + } PyObject * Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.134 retrieving revision 2.135 diff -C2 -d -r2.134 -r2.135 *** classobject.c 2001/08/02 04:45:20 2.134 --- classobject.c 2001/08/08 05:00:18 2.135 *************** *** 1436,1439 **** --- 1436,1441 ---- BINARY(instance_mod, "mod", PyNumber_Remainder) BINARY(instance_divmod, "divmod", PyNumber_Divmod) + BINARY(instance_floordiv, "floordiv", PyNumber_FloorDivide) + BINARY(instance_truediv, "truediv", PyNumber_TrueDivide) BINARY_INPLACE(instance_ior, "or", PyNumber_InPlaceOr) *************** *** 1447,1450 **** --- 1449,1454 ---- BINARY_INPLACE(instance_idiv, "div", PyNumber_InPlaceDivide) BINARY_INPLACE(instance_imod, "mod", PyNumber_InPlaceRemainder) + BINARY_INPLACE(instance_ifloordiv, "floordiv", PyNumber_InPlaceFloorDivide) + BINARY_INPLACE(instance_itruediv, "truediv", PyNumber_InPlaceTrueDivide) /* Try a 3-way comparison, returning an int; v is an instance. Return: *************** *** 1901,1904 **** --- 1905,1912 ---- (binaryfunc)instance_ixor, /* nb_inplace_xor */ (binaryfunc)instance_ior, /* nb_inplace_or */ + (binaryfunc)instance_floordiv, /* nb_floor_divide */ + (binaryfunc)instance_truediv, /* nb_true_divide */ + (binaryfunc)instance_ifloordiv, /* nb_inplace_floor_divide */ + (binaryfunc)instance_itruediv, /* nb_inplace_true_divide */ }; Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -d -r2.36 -r2.37 *** complexobject.c 2001/08/02 04:15:00 2.36 --- complexobject.c 2001/08/08 05:00:18 2.37 *************** *** 443,446 **** --- 443,461 ---- static PyObject * + complex_int_div(PyComplexObject *v, PyComplexObject *w) + { + PyObject *t, *r; + + t = complex_divmod(v, w); + if (t != NULL) { + r = PyTuple_GET_ITEM(t, 0); + Py_INCREF(r); + Py_DECREF(t); + return r; + } + return NULL; + } + + static PyObject * complex_neg(PyComplexObject *v) { *************** *** 860,863 **** --- 875,893 ---- 0, /* nb_oct */ 0, /* nb_hex */ + 0, /* nb_inplace_add */ + 0, /* nb_inplace_subtract */ + 0, /* nb_inplace_multiply*/ + 0, /* nb_inplace_divide */ + 0, /* nb_inplace_remainder */ + 0, /* nb_inplace_power */ + 0, /* nb_inplace_lshift */ + 0, /* nb_inplace_rshift */ + 0, /* nb_inplace_and */ + 0, /* nb_inplace_xor */ + 0, /* nb_inplace_or */ + (binaryfunc)complex_int_div, /* nb_floor_divide */ + (binaryfunc)complex_div, /* nb_true_divide */ + 0, /* nb_inplace_floor_divide */ + 0, /* nb_inplace_true_divide */ }; Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.84 retrieving revision 2.85 diff -C2 -d -r2.84 -r2.85 *** floatobject.c 2001/08/02 04:15:00 2.84 --- floatobject.c 2001/08/08 05:00:18 2.85 *************** *** 559,562 **** --- 559,577 ---- static PyObject * + float_int_div(PyObject *v, PyObject *w) + { + PyObject *t, *r; + + t = float_divmod(v, w); + if (t != NULL) { + r = PyTuple_GET_ITEM(t, 0); + Py_INCREF(r); + Py_DECREF(t); + return r; + } + return NULL; + } + + static PyObject * float_neg(PyFloatObject *v) { *************** *** 679,695 **** (unaryfunc)float_long, /*nb_long*/ (unaryfunc)float_float, /*nb_float*/ ! 0, /*nb_oct*/ ! 0, /*nb_hex*/ ! 0, /*nb_inplace_add*/ ! 0, /*nb_inplace_subtract*/ ! 0, /*nb_inplace_multiply*/ ! 0, /*nb_inplace_divide*/ ! 0, /*nb_inplace_remainder*/ ! 0, /*nb_inplace_power*/ ! 0, /*nb_inplace_lshift*/ ! 0, /*nb_inplace_rshift*/ ! 0, /*nb_inplace_and*/ ! 0, /*nb_inplace_xor*/ ! 0, /*nb_inplace_or*/ }; --- 694,714 ---- (unaryfunc)float_long, /*nb_long*/ (unaryfunc)float_float, /*nb_float*/ ! 0, /* nb_oct */ ! 0, /* nb_hex */ ! 0, /* nb_inplace_add */ ! 0, /* nb_inplace_subtract */ ! 0, /* nb_inplace_multiply */ ! 0, /* nb_inplace_divide */ ! 0, /* nb_inplace_remainder */ ! 0, /* nb_inplace_power */ ! 0, /* nb_inplace_lshift */ ! 0, /* nb_inplace_rshift */ ! 0, /* nb_inplace_and */ ! 0, /* nb_inplace_xor */ ! 0, /* nb_inplace_or */ ! float_int_div, /* nb_floor_divide */ ! float_div, /* nb_true_divide */ ! 0, /* nb_inplace_floor_divide */ ! 0, /* nb_inplace_true_divide */ }; Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.60 retrieving revision 2.61 diff -C2 -d -r2.60 -r2.61 *** intobject.c 2001/08/02 04:15:00 2.60 --- intobject.c 2001/08/08 05:00:18 2.61 *************** *** 704,707 **** --- 704,713 ---- static PyObject * + int_true_divide(PyObject *v, PyObject *w) + { + return PyFloat_Type.tp_as_number->nb_divide(v, w); + } + + static PyObject * int_int(PyIntObject *v) { *************** *** 813,816 **** --- 819,826 ---- 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ + (binaryfunc)int_div, /* nb_floor_divide */ + int_true_divide, /* nb_true_divide */ + 0, /* nb_inplace_floor_divide */ + 0, /* nb_inplace_true_divide */ }; Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** longobject.c 2001/08/02 04:15:00 1.90 --- longobject.c 2001/08/08 05:00:18 1.91 *************** *** 1982,1985 **** --- 1982,1991 ---- } + static PyObject * + long_true_divide(PyObject *v, PyObject *w) + { + return PyFloat_Type.tp_as_number->nb_divide(v, w); + } + static int long_coerce(PyObject **pv, PyObject **pw) *************** *** 2093,2107 **** (unaryfunc) long_oct, /*nb_oct*/ (unaryfunc) long_hex, /*nb_hex*/ ! 0, /*nb_inplace_add*/ ! 0, /*nb_inplace_subtract*/ ! 0, /*nb_inplace_multiply*/ ! 0, /*nb_inplace_divide*/ ! 0, /*nb_inplace_remainder*/ ! 0, /*nb_inplace_power*/ ! 0, /*nb_inplace_lshift*/ ! 0, /*nb_inplace_rshift*/ ! 0, /*nb_inplace_and*/ ! 0, /*nb_inplace_xor*/ ! 0, /*nb_inplace_or*/ }; --- 2099,2117 ---- (unaryfunc) long_oct, /*nb_oct*/ (unaryfunc) long_hex, /*nb_hex*/ ! 0, /* nb_inplace_add */ ! 0, /* nb_inplace_subtract */ ! 0, /* nb_inplace_multiply */ ! 0, /* nb_inplace_divide */ ! 0, /* nb_inplace_remainder */ ! 0, /* nb_inplace_power */ ! 0, /* nb_inplace_lshift */ ! 0, /* nb_inplace_rshift */ ! 0, /* nb_inplace_and */ ! 0, /* nb_inplace_xor */ ! 0, /* nb_inplace_or */ ! (binaryfunc)long_div, /* nb_floor_divide */ ! long_true_divide, /* nb_true_divide */ ! 0, /* nb_inplace_floor_divide */ ! 0, /* nb_inplace_true_divide */ }; From gvanrossum@users.sourceforge.net Wed Aug 8 06:00:20 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 22:00:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include abstract.h,2.35,2.36 compile.h,2.33,2.34 object.h,2.82,2.83 opcode.h,2.36,2.37 pythonrun.h,2.44,2.45 token.h,2.18,2.19 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv23513/Include Modified Files: abstract.h compile.h object.h opcode.h pythonrun.h token.h Log Message: Implement PEP 238 in its (almost) full glory. This introduces: - A new operator // that means floor division (the kind of division where 1/2 is 0). - The "future division" statement ("from __future__ import division) which changes the meaning of the / operator to implement "true division" (where 1/2 is 0.5). - New overloadable operators __truediv__ and __floordiv__. - New slots in the PyNumberMethods struct for true and floor division, new abstract APIs for them, new opcodes, and so on. I emphasize that without the future division statement, the semantics of / will remain unchanged until Python 3.0. Not yet implemented are warnings (default off) when / is used with int or long arguments. This has been on display since 7/31 as SF patch #443474. Flames to /dev/null. Index: abstract.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/abstract.h,v retrieving revision 2.35 retrieving revision 2.36 diff -C2 -d -r2.35 -r2.36 *** abstract.h 2001/08/02 04:15:00 2.35 --- abstract.h 2001/08/08 05:00:17 2.36 *************** *** 548,551 **** --- 548,571 ---- */ + DL_IMPORT(PyObject *) PyNumber_FloorDivide(PyObject *o1, PyObject *o2); + + /* + Returns the result of dividing o1 by o2 giving an integral result, + or null on failure. + This is the equivalent of the Python expression: o1//o2. + + + */ + + DL_IMPORT(PyObject *) PyNumber_TrueDivide(PyObject *o1, PyObject *o2); + + /* + Returns the result of dividing o1 by o2 giving a float result, + or null on failure. + This is the equivalent of the Python expression: o1/o2. + + + */ + DL_IMPORT(PyObject *) PyNumber_Remainder(PyObject *o1, PyObject *o2); *************** *** 739,742 **** --- 759,784 ---- Returns the result of dividing o1 by o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: + o1 /= o2. + + */ + + DL_IMPORT(PyObject *) PyNumber_InPlaceFloorDivide(PyObject *o1, + PyObject *o2); + + /* + Returns the result of dividing o1 by o2 giving an integral result, + possibly in-place, or null on failure. + This is the equivalent of the Python expression: + o1 /= o2. + + */ + + DL_IMPORT(PyObject *) PyNumber_InPlaceTrueDivide(PyObject *o1, + PyObject *o2); + + /* + Returns the result of dividing o1 by o2 giving a float result, + possibly in-place, or null on failure. + This is the equivalent of the Python expression: o1 /= o2. Index: compile.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -d -r2.33 -r2.34 *** compile.h 2001/07/16 02:29:45 2.33 --- compile.h 2001/08/08 05:00:17 2.34 *************** *** 42,45 **** --- 42,47 ---- in effect when the code block was compiled. */ #define CO_GENERATOR_ALLOWED 0x1000 + /* XXX Ditto for future division */ + #define CO_FUTURE_DIVISION 0x2000 extern DL_IMPORT(PyTypeObject) PyCode_Type; *************** *** 65,68 **** --- 67,71 ---- int ff_nested_scopes; int ff_generators; + int ff_division; } PyFutureFeatures; *************** *** 76,79 **** --- 79,85 ---- #define GENERATORS_DEFAULT 0 #define FUTURE_GENERATORS "generators" + + #define DIVISION_DEFAULT 0 + #define FUTURE_DIVISION "division" /* for internal use only */ Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.82 retrieving revision 2.83 diff -C2 -d -r2.82 -r2.83 *** object.h 2001/08/07 17:24:28 2.82 --- object.h 2001/08/08 05:00:17 2.83 *************** *** 162,165 **** --- 162,171 ---- binaryfunc nb_inplace_xor; binaryfunc nb_inplace_or; + + /* The following require the Py_TPFLAGS_HAVE_CLASS flag */ + binaryfunc nb_floor_divide; + binaryfunc nb_true_divide; + binaryfunc nb_inplace_floor_divide; + binaryfunc nb_inplace_true_divide; } PyNumberMethods; *************** *** 397,401 **** #define Py_TPFLAGS_HAVE_ITER (1L<<7) ! /* Experimental stuff for healing the type/class split */ #define Py_TPFLAGS_HAVE_CLASS (1L<<8) --- 403,407 ---- #define Py_TPFLAGS_HAVE_ITER (1L<<7) ! /* New members introduced by Python 2.2 exist */ #define Py_TPFLAGS_HAVE_CLASS (1L<<8) Index: opcode.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/opcode.h,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -d -r2.36 -r2.37 *** opcode.h 2001/06/18 22:08:13 2.36 --- opcode.h 2001/08/08 05:00:17 2.37 *************** *** 30,33 **** --- 30,37 ---- #define BINARY_SUBTRACT 24 #define BINARY_SUBSCR 25 + #define BINARY_FLOOR_DIVIDE 26 + #define BINARY_TRUE_DIVIDE 27 + #define INPLACE_FLOOR_DIVIDE 28 + #define INPLACE_TRUE_DIVIDE 29 #define SLICE 30 Index: pythonrun.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v retrieving revision 2.44 retrieving revision 2.45 diff -C2 -d -r2.44 -r2.45 *** pythonrun.h 2001/08/02 04:15:00 2.44 --- pythonrun.h 2001/08/08 05:00:17 2.45 *************** *** 13,16 **** --- 13,17 ---- #define PyCF_NESTED_SCOPES (0x00000001UL) #define PyCF_GENERATORS (0x00000002UL) + #define PyCF_DIVISION (0x00000004UL) typedef struct { unsigned long cf_flags; /* bitmask of PyCF_xxx flags */ Index: token.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/token.h,v retrieving revision 2.18 retrieving revision 2.19 diff -C2 -d -r2.18 -r2.19 *** token.h 2000/09/01 23:29:26 2.18 --- token.h 2001/08/08 05:00:17 2.19 *************** *** 56,63 **** #define RIGHTSHIFTEQUAL 46 #define DOUBLESTAREQUAL 47 /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */ ! #define OP 48 ! #define ERRORTOKEN 49 ! #define N_TOKENS 50 /* Special definitions for cooperation with parser */ --- 56,65 ---- #define RIGHTSHIFTEQUAL 46 #define DOUBLESTAREQUAL 47 + #define DOUBLESLASH 48 + #define DOUBLESLASHEQUAL 49 /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */ ! #define OP 50 ! #define ERRORTOKEN 51 ! #define N_TOKENS 52 /* Special definitions for cooperation with parser */ From gvanrossum@users.sourceforge.net Wed Aug 8 06:00:21 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 22:00:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.263,2.264 compile.c,2.211,2.212 future.c,2.8,2.9 graminit.c,2.29,2.30 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv23513/Python Modified Files: ceval.c compile.c future.c graminit.c Log Message: Implement PEP 238 in its (almost) full glory. This introduces: - A new operator // that means floor division (the kind of division where 1/2 is 0). - The "future division" statement ("from __future__ import division) which changes the meaning of the / operator to implement "true division" (where 1/2 is 0.5). - New overloadable operators __truediv__ and __floordiv__. - New slots in the PyNumberMethods struct for true and floor division, new abstract APIs for them, new opcodes, and so on. I emphasize that without the future division statement, the semantics of / will remain unchanged until Python 3.0. Not yet implemented are warnings (default off) when / is used with int or long arguments. This has been on display since 7/31 as SF patch #443474. Flames to /dev/null. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.263 retrieving revision 2.264 diff -C2 -d -r2.263 -r2.264 *** ceval.c 2001/08/02 04:15:00 2.263 --- ceval.c 2001/08/08 05:00:18 2.264 *************** *** 885,888 **** --- 885,908 ---- break; + case BINARY_FLOOR_DIVIDE: + w = POP(); + v = POP(); + x = PyNumber_FloorDivide(v, w); + Py_DECREF(v); + Py_DECREF(w); + PUSH(x); + if (x != NULL) continue; + break; + + case BINARY_TRUE_DIVIDE: + w = POP(); + v = POP(); + x = PyNumber_TrueDivide(v, w); + Py_DECREF(v); + Py_DECREF(w); + PUSH(x); + if (x != NULL) continue; + break; + case BINARY_MODULO: w = POP(); *************** *** 1046,1049 **** --- 1066,1089 ---- v = POP(); x = PyNumber_InPlaceDivide(v, w); + Py_DECREF(v); + Py_DECREF(w); + PUSH(x); + if (x != NULL) continue; + break; + + case INPLACE_FLOOR_DIVIDE: + w = POP(); + v = POP(); + x = PyNumber_InPlaceFloorDivide(v, w); + Py_DECREF(v); + Py_DECREF(w); + PUSH(x); + if (x != NULL) continue; + break; + + case INPLACE_TRUE_DIVIDE: + w = POP(); + v = POP(); + x = PyNumber_InPlaceTrueDivide(v, w); Py_DECREF(v); Py_DECREF(w); Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.211 retrieving revision 2.212 diff -C2 -d -r2.211 -r2.212 *** compile.c 2001/08/06 20:34:25 2.211 --- compile.c 2001/08/08 05:00:18 2.212 *************** *** 1875,1886 **** break; case SLASH: ! op = BINARY_DIVIDE; break; case PERCENT: op = BINARY_MODULO; break; default: com_error(c, PyExc_SystemError, ! "com_term: operator not *, / or %"); op = 255; } --- 1875,1892 ---- break; case SLASH: ! if (c->c_flags & CO_FUTURE_DIVISION) ! op = BINARY_TRUE_DIVIDE; ! else ! op = BINARY_DIVIDE; break; case PERCENT: op = BINARY_MODULO; break; + case DOUBLESLASH: + op = BINARY_FLOOR_DIVIDE; + break; default: com_error(c, PyExc_SystemError, ! "com_term: operator not *, /, // or %"); op = 255; } *************** *** 2476,2480 **** case '+': opcode = INPLACE_ADD; break; case '-': opcode = INPLACE_SUBTRACT; break; ! case '/': opcode = INPLACE_DIVIDE; break; case '%': opcode = INPLACE_MODULO; break; case '<': opcode = INPLACE_LSHIFT; break; --- 2482,2493 ---- case '+': opcode = INPLACE_ADD; break; case '-': opcode = INPLACE_SUBTRACT; break; ! case '/': ! if (STR(CHILD(CHILD(n, 1), 0))[1] == '/') ! opcode = INPLACE_FLOOR_DIVIDE; ! else if (c->c_flags & CO_FUTURE_DIVISION) ! opcode = INPLACE_TRUE_DIVIDE; ! else ! opcode = INPLACE_DIVIDE; ! break; case '%': opcode = INPLACE_MODULO; break; case '<': opcode = INPLACE_LSHIFT; break; *************** *** 3946,3950 **** || (sc.c_symtable->st_cur->ste_type == TYPE_FUNCTION)) sc.c_nested = 1; ! sc.c_flags |= base->c_flags & CO_GENERATOR_ALLOWED; } else { sc.c_private = NULL; --- 3959,3964 ---- || (sc.c_symtable->st_cur->ste_type == TYPE_FUNCTION)) sc.c_nested = 1; ! sc.c_flags |= base->c_flags & (CO_GENERATOR_ALLOWED | ! CO_FUTURE_DIVISION); } else { sc.c_private = NULL; *************** *** 3964,3967 **** --- 3978,3986 ---- else if (sc.c_future->ff_generators) flags->cf_flags |= PyCF_GENERATORS; + + if (flags->cf_flags & PyCF_DIVISION) + sc.c_future->ff_division = 1; + else if (sc.c_future->ff_division) + flags->cf_flags |= PyCF_DIVISION; } if (symtable_build(&sc, n) < 0) { *************** *** 4438,4441 **** --- 4457,4462 ---- if (c->c_future->ff_generators) c->c_flags |= CO_GENERATOR_ALLOWED; + if (c->c_future->ff_division) + c->c_flags |= CO_FUTURE_DIVISION; } if (ste->ste_generator) Index: future.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/future.c,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** future.c 2001/07/16 03:11:48 2.8 --- future.c 2001/08/08 05:00:18 2.9 *************** *** 34,37 **** --- 34,39 ---- } else if (strcmp(feature, FUTURE_GENERATORS) == 0) { ff->ff_generators = 1; + } else if (strcmp(feature, FUTURE_DIVISION) == 0) { + ff->ff_division = 1; } else if (strcmp(feature, "braces") == 0) { PyErr_SetString(PyExc_SyntaxError, *************** *** 235,238 **** --- 237,241 ---- ff->ff_nested_scopes = 0; ff->ff_generators = 0; + ff->ff_division = 0; if (future_parse(ff, n, filename) < 0) { Index: graminit.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/graminit.c,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -d -r2.29 -r2.30 *** graminit.c 2001/06/18 22:08:13 2.29 --- graminit.c 2001/08/08 05:00:18 2.30 *************** *** 253,257 **** {2, arcs_11_5}, }; ! static arc arcs_12_0[11] = { {38, 1}, {39, 1}, --- 253,257 ---- {2, arcs_11_5}, }; ! static arc arcs_12_0[12] = { {38, 1}, [...1463 lines suppressed...] *** 1681,1684 **** --- 1684,1688 ---- {17, 0}, {24, 0}, + {48, 0}, {32, 0}, {304, 0}, *************** *** 1708,1712 **** 65, dfas, ! {144, labels}, 256 }; --- 1712,1716 ---- 65, dfas, ! {146, labels}, 256 }; From gvanrossum@users.sourceforge.net Wed Aug 8 06:04:09 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 07 Aug 2001 22:04:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib tokenize.py,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25515 Modified Files: tokenize.py Log Message: Add new tokens // and //=, in support of PEP 238. Index: tokenize.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/tokenize.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tokenize.py 2001/07/20 18:54:44 1.26 --- tokenize.py 2001/08/08 05:04:07 1.27 *************** *** 79,82 **** --- 79,83 ---- # recognized as two instances of =). Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"<>", r"!=", + r"//=?", r"[+\-*/%&|^=<>]=?", r"~") From loewis@users.sourceforge.net Wed Aug 8 06:30:38 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Tue, 07 Aug 2001 22:30:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.222,2.223 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv29148 Modified Files: bltinmodule.c Log Message: Patch #448227: Raise an exception when a directory is passed to execfile. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.222 retrieving revision 2.223 diff -C2 -d -r2.222 -r2.223 *** bltinmodule.c 2001/08/02 04:15:00 2.222 --- bltinmodule.c 2001/08/08 05:30:36 2.223 *************** *** 569,572 **** --- 569,574 ---- FILE* fp; PyCompilerFlags cf; + int exists; + struct stat s; if (!PyArg_ParseTuple(args, "s|O!O!:execfile", *************** *** 587,594 **** return NULL; } ! Py_BEGIN_ALLOW_THREADS ! fp = fopen(filename, "r"); ! Py_END_ALLOW_THREADS ! if (fp == NULL) { PyErr_SetFromErrno(PyExc_IOError); return NULL; --- 589,613 ---- return NULL; } ! ! exists = 0; ! /* Test for existence or directory. */ ! if (!stat(filename, &s)) { ! if (S_ISDIR(s.st_mode)) ! errno = EISDIR; ! else ! exists = 1; ! } ! ! if (exists) { ! Py_BEGIN_ALLOW_THREADS ! fp = fopen(filename, "r"); ! Py_END_ALLOW_THREADS ! ! if (fp == NULL) { ! exists = 0; ! } ! } ! ! if (!exists) { PyErr_SetFromErrno(PyExc_IOError); return NULL; From fdrake@users.sourceforge.net Wed Aug 8 06:37:23 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 07 Aug 2001 22:37:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref2.tex,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv30125/ref Modified Files: ref2.tex Log Message: "Thin" version of floor division docs: add // to the list of operators and //= to the list of other delimiter tokens. I'll work on it again when it's not so late... Index: ref2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ref2.tex 2001/07/20 15:33:23 1.28 --- ref2.tex 2001/08/08 05:37:21 1.29 *************** *** 564,568 **** \begin{verbatim} ! + - * ** / % << >> & | ^ ~ < > <= >= == != <> --- 564,568 ---- \begin{verbatim} ! + - * ** / // % << >> & | ^ ~ < > <= >= == != <> *************** *** 582,587 **** ( ) [ ] { } , : . ` = ; ! += -= *= /= %= **= ! &= |= ^= >>= <<= \end{verbatim} --- 582,587 ---- ( ) [ ] { } , : . ` = ; ! += -= *= /= //= %= ! &= |= ^= >>= <<= **= \end{verbatim} From fdrake@users.sourceforge.net Wed Aug 8 06:39:31 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 07 Aug 2001 22:39:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libmailcap.tex,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv30393/lib Modified Files: libmailcap.tex Log Message: Clean up some of the markup here -- be more consistent in the use of semantic labels instead of presentational markup. Index: libmailcap.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmailcap.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** libmailcap.tex 1998/08/10 19:41:57 1.13 --- libmailcap.tex 2001/08/08 05:39:29 1.14 *************** *** 26,30 **** Return a 2-tuple; the first element is a string containing the command line to be executed ! (which can be passed to \code{os.system()}), and the second element is the mailcap entry for a given MIME type. If no matching MIME type can be found, \code{(None, None)} is returned. --- 26,30 ---- Return a 2-tuple; the first element is a string containing the command line to be executed ! (which can be passed to \function{os.system()}), and the second element is the mailcap entry for a given MIME type. If no matching MIME type can be found, \code{(None, None)} is returned. *************** *** 45,50 **** \var{plist} can be a list containing named parameters; the default value is simply an empty list. Each entry in the list must be a ! string containing the parameter name, an equals sign (\code{=}), and the ! parameter's value. Mailcap entries can contain named parameters like \code{\%\{foo\}}, which will be replaced by the value of the parameter named 'foo'. For example, if the command line --- 45,50 ---- \var{plist} can be a list containing named parameters; the default value is simply an empty list. Each entry in the list must be a ! string containing the parameter name, an equals sign (\character{=}), ! and the parameter's value. Mailcap entries can contain named parameters like \code{\%\{foo\}}, which will be replaced by the value of the parameter named 'foo'. For example, if the command line *************** *** 52,67 **** was in a mailcap file, and \var{plist} was set to \code{['id=1', 'number=2', 'total=3']}, the resulting command line would be ! \code{"showpartial 1 2 3"}. ! In a mailcap file, the "test" field can optionally be specified to ! test some external condition (e.g., the machine architecture, or the window system in use) to determine whether or not the mailcap line ! applies. \code{findmatch()} will automatically check such conditions ! and skip the entry if the check fails. \end{funcdesc} \begin{funcdesc}{getcaps}{} Returns a dictionary mapping MIME types to a list of mailcap file ! entries. This dictionary must be passed to the \code{findmatch()} function. An entry is stored as a list of dictionaries, but it shouldn't be necessary to know the details of this representation. --- 52,67 ---- was in a mailcap file, and \var{plist} was set to \code{['id=1', 'number=2', 'total=3']}, the resulting command line would be ! \code{'showpartial 1 2 3'}. ! In a mailcap file, the ``test'' field can optionally be specified to ! test some external condition (such as the machine architecture, or the window system in use) to determine whether or not the mailcap line ! applies. \function{findmatch()} will automatically check such ! conditions and skip the entry if the check fails. \end{funcdesc} \begin{funcdesc}{getcaps}{} Returns a dictionary mapping MIME types to a list of mailcap file ! entries. This dictionary must be passed to the \function{findmatch()} function. An entry is stored as a list of dictionaries, but it shouldn't be necessary to know the details of this representation. From fdrake@users.sourceforge.net Wed Aug 8 06:39:54 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 07 Aug 2001 22:39:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc ACKS,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv30438 Modified Files: ACKS Log Message: More names.... Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ACKS 2001/08/01 17:19:11 1.23 --- ACKS 2001/08/08 05:39:52 1.24 *************** *** 60,63 **** --- 60,64 ---- Nadim Ghaznavi Jonathan Giddy + Nathaniel Gray Grant Griffin Anders Hammarquist *************** *** 170,173 **** --- 171,175 ---- Bob Weiner Eddy Welbourne + Mats Wichmann Gerry Wiener Timothy Wild From fdrake@users.sourceforge.net Wed Aug 8 06:41:04 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 07 Aug 2001 22:41:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools push-docs.sh,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv30618/tools Modified Files: push-docs.sh Log Message: Add option to push the development docs to SF without announcing, for when the changes are just too small. Index: push-docs.sh =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/push-docs.sh,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** push-docs.sh 2001/07/12 21:50:10 1.11 --- push-docs.sh 2001/08/08 05:41:01 1.12 *************** *** 19,22 **** --- 19,23 ---- EXPLANATION='' + ANNOUNCE=true while [ "$#" -gt 0 ] ; do *************** *** 26,29 **** --- 27,34 ---- shift 2 ;; + -q) + ANNOUNCE=false + shift 1 + ;; -t) DOCTYPE="$2" *************** *** 67,71 **** ssh python.sourceforge.net tmp/update-docs.sh $DOCTYPE $PACKAGE '&&' rm tmp/update-docs.sh || exit $? ! sendmail $ADDRESSES < --- 72,77 ---- ssh python.sourceforge.net tmp/update-docs.sh $DOCTYPE $PACKAGE '&&' rm tmp/update-docs.sh || exit $? ! if $ANNOUNCE ; then ! sendmail $ADDRESSES < *************** *** 78,80 **** $EXPLANATION EOF ! exit $? --- 84,87 ---- $EXPLANATION EOF ! exit $? ! fi From tim_one@users.sourceforge.net Wed Aug 8 07:24:50 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 07 Aug 2001 23:24:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.223,2.224 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv5018/python/dist/src/Python Modified Files: bltinmodule.c Log Message: Repair the Windows build (S_ISDIR() macro doesn't exist). Somebody else should feel free to repair this a different way; see Python- Dev for discussion. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.223 retrieving revision 2.224 diff -C2 -d -r2.223 -r2.224 *** bltinmodule.c 2001/08/08 05:30:36 2.223 --- bltinmodule.c 2001/08/08 06:24:48 2.224 *************** *** 593,597 **** /* Test for existence or directory. */ if (!stat(filename, &s)) { ! if (S_ISDIR(s.st_mode)) errno = EISDIR; else --- 593,597 ---- /* Test for existence or directory. */ if (!stat(filename, &s)) { ! if ((s.st_mode & S_IFMT) == S_IFDIR) errno = EISDIR; else From tim_one@users.sourceforge.net Wed Aug 8 07:35:58 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 07 Aug 2001 23:35:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib token.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv7043/python/dist/src/Lib Modified Files: token.py Log Message: Regenerated token.py to account for new DOUBLESLASH and DOUBLESLASHEQUAL. Index: token.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/token.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** token.py 2001/02/10 00:20:16 1.10 --- token.py 2001/08/08 06:35:56 1.11 *************** *** 59,65 **** RIGHTSHIFTEQUAL = 46 DOUBLESTAREQUAL = 47 ! OP = 48 ! ERRORTOKEN = 49 ! N_TOKENS = 50 NT_OFFSET = 256 #--end constants-- --- 59,67 ---- RIGHTSHIFTEQUAL = 46 DOUBLESTAREQUAL = 47 ! DOUBLESLASH = 48 ! DOUBLESLASHEQUAL = 49 ! OP = 50 ! ERRORTOKEN = 51 ! N_TOKENS = 52 NT_OFFSET = 256 #--end constants-- From purcell@users.sourceforge.net Wed Aug 8 08:57:28 2001 From: purcell@users.sourceforge.net (Steve Purcell) Date: Wed, 08 Aug 2001 00:57:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib unittest.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv21572 Modified Files: unittest.py Log Message: Merged in bugfix from PyUnit CVS for problem reported by Gary Todd. If 'unittest.py' was run from the command line with the name of a test case class as a parameter, it failed with an ugly error. (Which was a shame, because the documentation says you can do that.) The problem was the old 'is the class X that you imported from me the same as my class X?' gotcha. Index: unittest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/unittest.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** unittest.py 2001/05/10 01:28:40 1.8 --- unittest.py 2001/08/08 07:57:26 1.9 *************** *** 433,439 **** obj = getattr(obj, part) if type(obj) == types.ModuleType: return self.loadTestsFromModule(obj) ! elif type(obj) == types.ClassType and issubclass(obj, TestCase): return self.loadTestsFromTestCase(obj) elif type(obj) == types.UnboundMethodType: --- 433,440 ---- obj = getattr(obj, part) + import unittest if type(obj) == types.ModuleType: return self.loadTestsFromModule(obj) ! elif type(obj) == types.ClassType and issubclass(obj, unittest.TestCase): return self.loadTestsFromTestCase(obj) elif type(obj) == types.UnboundMethodType: *************** *** 441,446 **** elif callable(obj): test = obj() ! if not isinstance(test, TestCase) and \ ! not isinstance(test, TestSuite): raise ValueError, \ "calling %s returned %s, not a test" % (obj,test) --- 442,447 ---- elif callable(obj): test = obj() ! if not isinstance(test, unittest.TestCase) and \ ! not isinstance(test, unittest.TestSuite): raise ValueError, \ "calling %s returned %s, not a test" % (obj,test) From lemburg@users.sourceforge.net Wed Aug 8 09:38:08 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 08 Aug 2001 01:38:08 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0249.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv31207 Modified Files: pep-0249.txt Log Message: Added clarification about use of .executemany() with stored procedures. Patch by Bob Kline. Index: pep-0249.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0249.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pep-0249.txt 2001/07/14 16:21:44 1.4 --- pep-0249.txt 2001/08/08 08:38:06 1.5 *************** *** 338,341 **** --- 338,347 ---- one call. + Use of this method for an operation which produces one or + more result sets constitutes undefined behavior, and the + implementation is permitted (but not required) to raise + an exception when it detects that a result set has been + created by an invocation of the operation. + The same comments as for execute() also apply accordingly to this method. From loewis@users.sourceforge.net Wed Aug 8 11:28:08 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 08 Aug 2001 03:28:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include pyport.h,2.30,2.31 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv31287/Include Modified Files: pyport.h Log Message: Put conditional S_ISDIR definition(s) into pyport.h. Index: pyport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v retrieving revision 2.30 retrieving revision 2.31 diff -C2 -d -r2.30 -r2.31 *** pyport.h 2001/08/07 15:32:30 2.30 --- pyport.h 2001/08/08 10:28:06 2.31 *************** *** 151,154 **** --- 151,167 ---- #endif + #if defined(PYCC_VACPP) + /* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */ + #define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG) + #endif + + #ifndef S_ISREG + #define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) + #endif + + #ifndef S_ISDIR + #define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR) + #endif + #ifdef __cplusplus From loewis@users.sourceforge.net Wed Aug 8 11:28:08 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 08 Aug 2001 03:28:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules getpath.c,1.36,1.37 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv31287/Modules Modified Files: getpath.c Log Message: Put conditional S_ISDIR definition(s) into pyport.h. Index: getpath.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/getpath.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** getpath.c 2001/07/23 16:30:27 1.36 --- getpath.c 2001/08/08 10:28:06 1.37 *************** *** 6,10 **** #include - #include #include --- 6,9 ---- *************** *** 138,149 **** } - - #ifndef S_ISREG - #define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) - #endif - - #ifndef S_ISDIR - #define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR) - #endif static int --- 137,140 ---- From loewis@users.sourceforge.net Wed Aug 8 11:28:08 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 08 Aug 2001 03:28:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.224,2.225 import.c,2.182,2.183 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv31287/Python Modified Files: bltinmodule.c import.c Log Message: Put conditional S_ISDIR definition(s) into pyport.h. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.224 retrieving revision 2.225 diff -C2 -d -r2.224 -r2.225 *** bltinmodule.c 2001/08/08 06:24:48 2.224 --- bltinmodule.c 2001/08/08 10:28:06 2.225 *************** *** 593,597 **** /* Test for existence or directory. */ if (!stat(filename, &s)) { ! if ((s.st_mode & S_IFMT) == S_IFDIR) errno = EISDIR; else --- 593,597 ---- /* Test for existence or directory. */ if (!stat(filename, &s)) { ! if (S_ISDIR(s.st_mode)) errno = EISDIR; else Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.182 retrieving revision 2.183 diff -C2 -d -r2.182 -r2.183 *** import.c 2001/08/04 08:12:36 2.182 --- import.c 2001/08/08 10:28:06 2.183 *************** *** 29,36 **** #endif - #ifndef S_ISDIR - #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) - #endif - extern time_t PyOS_GetLastModificationTime(char *, FILE *); /* In getmtime.c */ --- 29,32 ---- From twouters@users.sourceforge.net Wed Aug 8 11:39:05 2001 From: twouters@users.sourceforge.net (Thomas Wouters) Date: Wed, 08 Aug 2001 03:39:05 -0700 Subject: [Python-checkins] CVS: python/dist/src configure.in,1.238,1.239 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv564 Modified Files: configure.in Log Message: Remove redundant check for 'getaddrinfo' (it's already checked the block before.) Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.238 retrieving revision 1.239 diff -C2 -d -r1.238 -r1.239 *** configure.in 2001/08/04 22:32:03 1.238 --- configure.in 2001/08/08 10:39:03 1.239 *************** *** 1303,1307 **** fi fi ! AC_CHECK_FUNCS(getaddrinfo getnameinfo) # checks for structures --- 1303,1307 ---- fi fi ! AC_CHECK_FUNCS(getnameinfo) # checks for structures From loewis@users.sourceforge.net Wed Aug 8 13:54:30 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 08 Aug 2001 05:54:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python import.c,2.183,2.184 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv5244 Modified Files: import.c Log Message: Put conditional S_IFMT definition into pyport.h. Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.183 retrieving revision 2.184 diff -C2 -d -r2.183 -r2.184 *** import.c 2001/08/08 10:28:06 2.183 --- import.c 2001/08/08 12:54:28 2.184 *************** *** 24,32 **** #endif - #if defined(PYCC_VACPP) - /* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */ - #define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG) - #endif - extern time_t PyOS_GetLastModificationTime(char *, FILE *); /* In getmtime.c */ --- 24,27 ---- From jackjansen@users.sourceforge.net Wed Aug 8 14:17:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 06:17:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include macglue.h,1.55,1.56 pymactoolbox.h,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv11197/Mac/Include Modified Files: macglue.h Removed Files: pymactoolbox.h Log Message: Split macglue.c into two: a new mactoolboxglue.c (in ./Python) with functionality needed for both unix-Python and MacPython and a new smaller ./Mac/Python/macglue.c which contains MacPython stuff only. pymactoolbox.h has moved to ./Include from ./Mac/Include and now also contains the relevant stuff from macglue.h. The net effect of this is that the ./Mac subdirectory is not needed anymore for building the unix-Python core on MacOSX (it is needed for building the extension modules). Index: macglue.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/macglue.h,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** macglue.h 2001/07/08 22:07:18 1.55 --- macglue.h 2001/08/08 13:17:31 1.56 *************** *** 32,35 **** --- 32,37 ---- #endif + #include "pymactoolbox.h" + #ifdef __cplusplus extern "C" { *************** *** 45,49 **** } PyMacSchedParams; - char *PyMac_getscript(void); /* Get the default encoding for our 8bit character set */ #ifdef USE_GUSI1 void PyMac_FixGUSIcd(void); /* Workaround for GUSI chdir() call */ --- 47,50 ---- *************** *** 51,57 **** #endif - char *PyMac_StrError(int); /* strerror with mac errors */ - PyObject *PyErr_Mac(PyObject *, int); /* Exception with a mac error */ - PyObject *PyMac_Error(OSErr); /* Uses PyMac_GetOSErrException */ unsigned char *Pstring(char *str); /* Convert c-string to pascal-string in static buffer */ --- 52,55 ---- *************** *** 98,123 **** #endif /* TARGET_API_MAC_OS8 */ - int PyMac_GetOSType(PyObject *, OSType *); /* argument parser for OSType */ - PyObject *PyMac_BuildOSType(OSType); /* Convert OSType to PyObject */ - - PyObject *PyMac_BuildNumVersion(NumVersion); /* Convert NumVersion to PyObject */ - - int PyMac_GetStr255(PyObject *, Str255); /* argument parser for Str255 */ - PyObject *PyMac_BuildStr255(Str255); /* Convert Str255 to PyObject */ - PyObject *PyMac_BuildOptStr255(Str255); /* Convert Str255 to PyObject, NULL to None */ - - int PyMac_GetRect(PyObject *, Rect *); /* argument parser for Rect */ - PyObject *PyMac_BuildRect(Rect *); /* Convert Rect to PyObject */ - - int PyMac_GetPoint(PyObject *, Point *); /* argument parser for Point */ - PyObject *PyMac_BuildPoint(Point); /* Convert Point to PyObject */ - - int PyMac_GetEventRecord(PyObject *, EventRecord *); /* argument parser for EventRecord */ - PyObject *PyMac_BuildEventRecord(EventRecord *); /* Convert EventRecord to PyObject */ - - int PyMac_GetFixed(PyObject *, Fixed *); /* argument parser for Fixed */ - PyObject *PyMac_BuildFixed(Fixed); /* Convert Fixed to PyObject */ - int PyMac_Getwide(PyObject *, wide *); /* argument parser for wide */ - PyObject *PyMac_Buildwide(wide *); /* Convert wide to PyObject */ void PyMac_InitApplet(void); /* Initialize and run an Applet */ void PyMac_Initialize(void); /* Initialize function for embedding Python */ --- 96,99 ---- --- pymactoolbox.h DELETED --- From jackjansen@users.sourceforge.net Wed Aug 8 14:17:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 06:17:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python mactoolboxglue.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv11197/Python Added Files: mactoolboxglue.c Log Message: Split macglue.c into two: a new mactoolboxglue.c (in ./Python) with functionality needed for both unix-Python and MacPython and a new smaller ./Mac/Python/macglue.c which contains MacPython stuff only. pymactoolbox.h has moved to ./Include from ./Mac/Include and now also contains the relevant stuff from macglue.h. The net effect of this is that the ./Mac subdirectory is not needed anymore for building the unix-Python core on MacOSX (it is needed for building the extension modules). --- NEW FILE: mactoolboxglue.c --- /*********************************************************** Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Stichting Mathematisch Centrum or CWI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #include "Python.h" //#include "macglue.h" //#include "marshal.h" //#include "import.h" //#include "importdl.h" #include "pymactoolbox.h" //#include "pythonresources.h" #ifdef WITHOUT_FRAMEWORKS //#include /* for Set(Current)A5 */ //#include //#include //#include //#include //#include //#include //#include //#include //#include //#include //#include //#include #else //#include #endif /* ** Find out what the current script is. ** Donated by Fredrik Lund. */ char *PyMac_getscript() { int font, script, lang; font = 0; font = GetSysFont(); script = FontToScript(font); switch (script) { case smRoman: lang = GetScriptVariable(script, smScriptLang); if (lang == langIcelandic) return "mac-iceland"; else if (lang == langTurkish) return "mac-turkish"; else if (lang == langGreek) return "mac-greek"; else return "mac-roman"; break; #if 0 /* We don't have a codec for this, so don't return it */ case smJapanese: return "mac-japan"; #endif case smGreek: return "mac-greek"; case smCyrillic: return "mac-cyrillic"; default: return "ascii"; /* better than nothing */ } } /* Like strerror() but for Mac OS error numbers */ char *PyMac_StrError(int err) { static char buf[256]; Handle h; char *str; h = GetResource('Estr', err); if ( h ) { HLock(h); str = (char *)*h; memcpy(buf, str+1, (unsigned char)str[0]); buf[(unsigned char)str[0]] = '\0'; HUnlock(h); ReleaseResource(h); } else { sprintf(buf, "Mac OS error code %d", err); } return buf; } /* Exception object shared by all Mac specific modules for Mac OS errors */ PyObject *PyMac_OSErrException; /* Initialize and return PyMac_OSErrException */ PyObject * PyMac_GetOSErrException() { if (PyMac_OSErrException == NULL) PyMac_OSErrException = PyString_FromString("MacOS.Error"); return PyMac_OSErrException; } /* Set a MAC-specific error from errno, and return NULL; return None if no error */ PyObject * PyErr_Mac(PyObject *eobj, int err) { char *msg; PyObject *v; if (err == 0 && !PyErr_Occurred()) { Py_INCREF(Py_None); return Py_None; } if (err == -1 && PyErr_Occurred()) return NULL; msg = PyMac_StrError(err); v = Py_BuildValue("(is)", err, msg); PyErr_SetObject(eobj, v); Py_DECREF(v); return NULL; } /* Call PyErr_Mac with PyMac_OSErrException */ PyObject * PyMac_Error(OSErr err) { return PyErr_Mac(PyMac_GetOSErrException(), err); } /* Convert a 4-char string object argument to an OSType value */ int PyMac_GetOSType(PyObject *v, OSType *pr) { if (!PyString_Check(v) || PyString_Size(v) != 4) { PyErr_SetString(PyExc_TypeError, "OSType arg must be string of 4 chars"); return 0; } memcpy((char *)pr, PyString_AsString(v), 4); return 1; } /* Convert an OSType value to a 4-char string object */ PyObject * PyMac_BuildOSType(OSType t) { return PyString_FromStringAndSize((char *)&t, 4); } /* Convert an NumVersion value to a 4-element tuple */ PyObject * PyMac_BuildNumVersion(NumVersion t) { return Py_BuildValue("(hhhh)", t.majorRev, t.minorAndBugRev, t.stage, t.nonRelRev); } /* Convert a Python string object to a Str255 */ int PyMac_GetStr255(PyObject *v, Str255 pbuf) { int len; if (!PyString_Check(v) || (len = PyString_Size(v)) > 255) { PyErr_SetString(PyExc_TypeError, "Str255 arg must be string of at most 255 chars"); return 0; } pbuf[0] = len; memcpy((char *)(pbuf+1), PyString_AsString(v), len); return 1; } /* Convert a Str255 to a Python string object */ PyObject * PyMac_BuildStr255(Str255 s) { if ( s == NULL ) { PyErr_SetString(PyExc_SystemError, "Str255 pointer is NULL"); return NULL; } return PyString_FromStringAndSize((char *)&s[1], (int)s[0]); } PyObject * PyMac_BuildOptStr255(Str255 s) { if ( s == NULL ) { Py_INCREF(Py_None); return Py_None; } return PyString_FromStringAndSize((char *)&s[1], (int)s[0]); } /* Convert a Python object to a Rect. The object must be a (left, top, right, bottom) tuple. (This differs from the order in the struct but is consistent with the arguments to SetRect(), and also with STDWIN). */ int PyMac_GetRect(PyObject *v, Rect *r) { return PyArg_Parse(v, "(hhhh)", &r->left, &r->top, &r->right, &r->bottom); } /* Convert a Rect to a Python object */ PyObject * PyMac_BuildRect(Rect *r) { return Py_BuildValue("(hhhh)", r->left, r->top, r->right, r->bottom); } /* Convert a Python object to a Point. The object must be a (h, v) tuple. (This differs from the order in the struct but is consistent with the arguments to SetPoint(), and also with STDWIN). */ int PyMac_GetPoint(PyObject *v, Point *p) { return PyArg_Parse(v, "(hh)", &p->h, &p->v); } /* Convert a Point to a Python object */ PyObject * PyMac_BuildPoint(Point p) { return Py_BuildValue("(hh)", p.h, p.v); } /* Convert a Python object to an EventRecord. The object must be a (what, message, when, (v, h), modifiers) tuple. */ int PyMac_GetEventRecord(PyObject *v, EventRecord *e) { return PyArg_Parse(v, "(Hll(hh)H)", &e->what, &e->message, &e->when, &e->where.h, &e->where.v, &e->modifiers); } /* Convert a Rect to an EventRecord object */ PyObject * PyMac_BuildEventRecord(EventRecord *e) { return Py_BuildValue("(hll(hh)h)", e->what, e->message, e->when, e->where.h, e->where.v, e->modifiers); } /* Convert Python object to Fixed */ int PyMac_GetFixed(PyObject *v, Fixed *f) { double d; if( !PyArg_Parse(v, "d", &d)) return 0; *f = (Fixed)(d * 0x10000); return 1; } /* Convert a Point to a Python object */ PyObject * PyMac_BuildFixed(Fixed f) { double d; d = f; d = d / 0x10000; return Py_BuildValue("d", d); } /* Convert wide to/from Python int or (hi, lo) tuple. XXXX Should use Python longs */ int PyMac_Getwide(PyObject *v, wide *rv) { if (PyInt_Check(v)) { rv->hi = 0; rv->lo = PyInt_AsLong(v); if( rv->lo & 0x80000000 ) rv->hi = -1; return 1; } return PyArg_Parse(v, "(ll)", &rv->hi, &rv->lo); } PyObject * PyMac_Buildwide(wide *w) { if ( (w->hi == 0 && (w->lo & 0x80000000) == 0) || (w->hi == -1 && (w->lo & 0x80000000) ) ) return PyInt_FromLong(w->lo); return Py_BuildValue("(ll)", w->hi, w->lo); } #ifdef USE_TOOLBOX_OBJECT_GLUE /* ** Glue together the toolbox objects. ** ** Because toolbox modules interdepend on each other, they use each others ** object types, on MacOSX/MachO this leads to the situation that they ** cannot be dynamically loaded (or they would all have to be lumped into ** a single .so, but this would be bad for extensibility). ** ** This file defines wrappers for all the _New and _Convert functions, ** which are the Py_BuildValue and PyArg_ParseTuple helpers. The wrappers ** check an indirection function pointer, and if it isn't filled in yet ** they import the appropriate module, whose init routine should fill in ** the pointer. */ #define GLUE_NEW(object, routinename, module) \ PyObject *(*PyMacGluePtr_##routinename)(object); \ \ PyObject *routinename(object cobj) { \ if (!PyMacGluePtr_##routinename) { \ if (!PyImport_ImportModule(module)) return NULL; \ if (!PyMacGluePtr_##routinename) { \ PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \ return NULL; \ } \ } \ return (*PyMacGluePtr_##routinename)(cobj); \ } #define GLUE_CONVERT(object, routinename, module) \ int (*PyMacGluePtr_##routinename)(PyObject *, object *); \ \ int routinename(PyObject *pyobj, object *cobj) { \ if (!PyMacGluePtr_##routinename) { \ if (!PyImport_ImportModule(module)) return NULL; \ if (!PyMacGluePtr_##routinename) { \ PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \ return NULL; \ } \ } \ return (*PyMacGluePtr_##routinename)(pyobj, cobj); \ } GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "macfs") GLUE_NEW(AppleEvent *, AEDesc_New, "AE") /* XXXX Why by address? */ GLUE_CONVERT(AppleEvent, AEDesc_Convert, "AE") GLUE_NEW(Component, CmpObj_New, "Cm") GLUE_CONVERT(Component, CmpObj_Convert, "Cm") GLUE_NEW(ComponentInstance, CmpInstObj_New, "Cm") GLUE_CONVERT(ComponentInstance, CmpInstObj_Convert, "Cm") GLUE_NEW(ControlHandle, CtlObj_New, "Ctl") GLUE_CONVERT(ControlHandle, CtlObj_Convert, "Ctl") GLUE_NEW(DialogPtr, DlgObj_New, "Dlg") GLUE_CONVERT(DialogPtr, DlgObj_Convert, "Dlg") GLUE_NEW(DialogPtr, DlgObj_WhichDialog, "Dlg") GLUE_NEW(DragReference, DragObj_New, "Drag") GLUE_CONVERT(DragReference, DragObj_Convert, "Drag") GLUE_NEW(ListHandle, ListObj_New, "List") GLUE_CONVERT(ListHandle, ListObj_Convert, "List") GLUE_NEW(MenuHandle, MenuObj_New, "Menu") GLUE_CONVERT(MenuHandle, MenuObj_Convert, "Menu") GLUE_NEW(GrafPtr, GrafObj_New, "Qd") GLUE_CONVERT(GrafPtr, GrafObj_Convert, "Qd") GLUE_NEW(BitMapPtr, BMObj_New, "Qd") GLUE_CONVERT(BitMapPtr, BMObj_Convert, "Qd") GLUE_NEW(RGBColor *, QdRGB_New, "Qd") /* XXXX Why? */ GLUE_CONVERT(RGBColor, QdRGB_Convert, "Qd") GLUE_NEW(GWorldPtr, GWorldObj_New, "Qdoffs") GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Qdoffs") GLUE_NEW(Track, TrackObj_New, "Qt") GLUE_CONVERT(Track, TrackObj_Convert, "Qt") GLUE_NEW(Movie, MovieObj_New, "Qt") GLUE_CONVERT(Movie, MovieObj_Convert, "Qt") GLUE_NEW(MovieController, MovieCtlObj_New, "Qt") GLUE_CONVERT(MovieController, MovieCtlObj_Convert, "Qt") GLUE_NEW(TimeBase, TimeBaseObj_New, "Qt") GLUE_CONVERT(TimeBase, TimeBaseObj_Convert, "Qt") GLUE_NEW(UserData, UserDataObj_New, "Qt") GLUE_CONVERT(UserData, UserDataObj_Convert, "Qt") GLUE_NEW(Media, MediaObj_New, "Qt") GLUE_CONVERT(Media, MediaObj_Convert, "Qt") GLUE_NEW(Handle, ResObj_New, "Res") GLUE_CONVERT(Handle, ResObj_Convert, "Res") GLUE_NEW(Handle, OptResObj_New, "Res") GLUE_CONVERT(Handle, OptResObj_Convert, "Res") GLUE_NEW(TEHandle, TEObj_New, "TE") GLUE_CONVERT(TEHandle, TEObj_Convert, "TE") GLUE_NEW(WindowPtr, WinObj_New, "Win") GLUE_CONVERT(WindowPtr, WinObj_Convert, "Win") GLUE_NEW(WindowPtr, WinObj_WhichWindow, "Win") #endif /* USE_TOOLBOX_OBJECT_GLUE */ From jackjansen@users.sourceforge.net Wed Aug 8 14:17:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 06:17:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.100,1.101 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv11197/Mac/Python Modified Files: macglue.c Log Message: Split macglue.c into two: a new mactoolboxglue.c (in ./Python) with functionality needed for both unix-Python and MacPython and a new smaller ./Mac/Python/macglue.c which contains MacPython stuff only. pymactoolbox.h has moved to ./Include from ./Mac/Include and now also contains the relevant stuff from macglue.h. The net effect of this is that the ./Mac subdirectory is not needed anymore for building the unix-Python core on MacOSX (it is needed for building the extension modules). Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** macglue.c 2001/08/07 15:30:07 1.100 --- macglue.c 2001/08/08 13:17:31 1.101 *************** *** 180,219 **** int PyMac_AppearanceCompliant; - /* - ** Find out what the current script is. - ** Donated by Fredrik Lund. - */ - char *PyMac_getscript() - { - int font, script, lang; - font = 0; - font = GetSysFont(); - script = FontToScript(font); - switch (script) { - case smRoman: - lang = GetScriptVariable(script, smScriptLang); - if (lang == langIcelandic) - return "mac-iceland"; - else if (lang == langTurkish) - return "mac-turkish"; - else if (lang == langGreek) - return "mac-greek"; - else - return "mac-roman"; - break; - #if 0 - /* We don't have a codec for this, so don't return it */ - case smJapanese: - return "mac-japan"; - #endif - case smGreek: - return "mac-greek"; - case smCyrillic: - return "mac-cyrillic"; - default: - return "ascii"; /* better than nothing */ - } - } - /* Given an FSSpec, return the FSSpec of the parent folder */ --- 180,183 ---- *************** *** 422,485 **** #endif /* TARGET_API_MAC_OS8 */ - /* Like strerror() but for Mac OS error numbers */ - char *PyMac_StrError(int err) - { - static char buf[256]; - Handle h; - char *str; - - h = GetResource('Estr', err); - if ( h ) { - HLock(h); - str = (char *)*h; - memcpy(buf, str+1, (unsigned char)str[0]); - buf[(unsigned char)str[0]] = '\0'; - HUnlock(h); - ReleaseResource(h); - } else { - sprintf(buf, "Mac OS error code %d", err); - } - return buf; - } - - /* Exception object shared by all Mac specific modules for Mac OS errors */ - PyObject *PyMac_OSErrException; - - /* Initialize and return PyMac_OSErrException */ - PyObject * - PyMac_GetOSErrException() - { - if (PyMac_OSErrException == NULL) - PyMac_OSErrException = PyString_FromString("MacOS.Error"); - return PyMac_OSErrException; - } - - /* Set a MAC-specific error from errno, and return NULL; return None if no error */ - PyObject * - PyErr_Mac(PyObject *eobj, int err) - { - char *msg; - PyObject *v; - - if (err == 0 && !PyErr_Occurred()) { - Py_INCREF(Py_None); - return Py_None; - } - if (err == -1 && PyErr_Occurred()) - return NULL; - msg = PyMac_StrError(err); - v = Py_BuildValue("(is)", err, msg); - PyErr_SetObject(eobj, v); - Py_DECREF(v); - return NULL; - } - - /* Call PyErr_Mac with PyMac_OSErrException */ - PyObject * - PyMac_Error(OSErr err) - { - return PyErr_Mac(PyMac_GetOSErrException(), err); - } - #ifdef USE_STACKCHECK /* Check for stack overflow */ --- 386,389 ---- *************** *** 960,1242 **** #endif /* TARGET_API_MAC_OS8 */ - /* Convert a 4-char string object argument to an OSType value */ - int - PyMac_GetOSType(PyObject *v, OSType *pr) - { - if (!PyString_Check(v) || PyString_Size(v) != 4) { - PyErr_SetString(PyExc_TypeError, - "OSType arg must be string of 4 chars"); - return 0; - } - memcpy((char *)pr, PyString_AsString(v), 4); - return 1; - } - - /* Convert an OSType value to a 4-char string object */ - PyObject * - PyMac_BuildOSType(OSType t) - { - return PyString_FromStringAndSize((char *)&t, 4); - } - - /* Convert an NumVersion value to a 4-element tuple */ - PyObject * - PyMac_BuildNumVersion(NumVersion t) - { - return Py_BuildValue("(hhhh)", t.majorRev, t.minorAndBugRev, t.stage, t.nonRelRev); - } - - - /* Convert a Python string object to a Str255 */ - int - PyMac_GetStr255(PyObject *v, Str255 pbuf) - { - int len; - if (!PyString_Check(v) || (len = PyString_Size(v)) > 255) { - PyErr_SetString(PyExc_TypeError, - "Str255 arg must be string of at most 255 chars"); - return 0; - } - pbuf[0] = len; - memcpy((char *)(pbuf+1), PyString_AsString(v), len); - return 1; - } - - /* Convert a Str255 to a Python string object */ - PyObject * - PyMac_BuildStr255(Str255 s) - { - if ( s == NULL ) { - PyErr_SetString(PyExc_SystemError, "Str255 pointer is NULL"); - return NULL; - } - return PyString_FromStringAndSize((char *)&s[1], (int)s[0]); - } - - PyObject * - PyMac_BuildOptStr255(Str255 s) - { - if ( s == NULL ) { - Py_INCREF(Py_None); - return Py_None; - } - return PyString_FromStringAndSize((char *)&s[1], (int)s[0]); - } - - - - /* Convert a Python object to a Rect. - The object must be a (left, top, right, bottom) tuple. - (This differs from the order in the struct but is consistent with - the arguments to SetRect(), and also with STDWIN). */ - int - PyMac_GetRect(PyObject *v, Rect *r) - { - return PyArg_Parse(v, "(hhhh)", &r->left, &r->top, &r->right, &r->bottom); - } - - /* Convert a Rect to a Python object */ - PyObject * - PyMac_BuildRect(Rect *r) - { - return Py_BuildValue("(hhhh)", r->left, r->top, r->right, r->bottom); - } - - - /* Convert a Python object to a Point. - The object must be a (h, v) tuple. - (This differs from the order in the struct but is consistent with - the arguments to SetPoint(), and also with STDWIN). */ - int - PyMac_GetPoint(PyObject *v, Point *p) - { - return PyArg_Parse(v, "(hh)", &p->h, &p->v); - } - - /* Convert a Point to a Python object */ - PyObject * - PyMac_BuildPoint(Point p) - { - return Py_BuildValue("(hh)", p.h, p.v); - } - - - /* Convert a Python object to an EventRecord. - The object must be a (what, message, when, (v, h), modifiers) tuple. */ - int - PyMac_GetEventRecord(PyObject *v, EventRecord *e) - { - return PyArg_Parse(v, "(Hll(hh)H)", - &e->what, - &e->message, - &e->when, - &e->where.h, - &e->where.v, - &e->modifiers); - } - - /* Convert a Rect to an EventRecord object */ - PyObject * - PyMac_BuildEventRecord(EventRecord *e) - { - return Py_BuildValue("(hll(hh)h)", - e->what, - e->message, - e->when, - e->where.h, - e->where.v, - e->modifiers); - } - - /* Convert Python object to Fixed */ - int - PyMac_GetFixed(PyObject *v, Fixed *f) - { - double d; - - if( !PyArg_Parse(v, "d", &d)) - return 0; - *f = (Fixed)(d * 0x10000); - return 1; - } - - /* Convert a Point to a Python object */ - PyObject * - PyMac_BuildFixed(Fixed f) - { - double d; - - d = f; - d = d / 0x10000; - return Py_BuildValue("d", d); - } - - /* Convert wide to/from Python int or (hi, lo) tuple. XXXX Should use Python longs */ - int - PyMac_Getwide(PyObject *v, wide *rv) - { - if (PyInt_Check(v)) { - rv->hi = 0; - rv->lo = PyInt_AsLong(v); - if( rv->lo & 0x80000000 ) - rv->hi = -1; - return 1; - } - return PyArg_Parse(v, "(ll)", &rv->hi, &rv->lo); - } - - - PyObject * - PyMac_Buildwide(wide *w) - { - if ( (w->hi == 0 && (w->lo & 0x80000000) == 0) || - (w->hi == -1 && (w->lo & 0x80000000) ) ) - return PyInt_FromLong(w->lo); - return Py_BuildValue("(ll)", w->hi, w->lo); - } - - #ifdef USE_TOOLBOX_OBJECT_GLUE - /* - ** Glue together the toolbox objects. - ** - ** Because toolbox modules interdepend on each other, they use each others - ** object types, on MacOSX/MachO this leads to the situation that they - ** cannot be dynamically loaded (or they would all have to be lumped into - ** a single .so, but this would be bad for extensibility). - ** - ** This file defines wrappers for all the _New and _Convert functions, - ** which are the Py_BuildValue and PyArg_ParseTuple helpers. The wrappers - ** check an indirection function pointer, and if it isn't filled in yet - ** they import the appropriate module, whose init routine should fill in - ** the pointer. - */ - - #define GLUE_NEW(object, routinename, module) \ - PyObject *(*PyMacGluePtr_##routinename)(object); \ - \ - PyObject *routinename(object cobj) { \ - if (!PyMacGluePtr_##routinename) { \ - if (!PyImport_ImportModule(module)) return NULL; \ - if (!PyMacGluePtr_##routinename) { \ - PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \ - return NULL; \ - } \ - } \ - return (*PyMacGluePtr_##routinename)(cobj); \ - } - - #define GLUE_CONVERT(object, routinename, module) \ - int (*PyMacGluePtr_##routinename)(PyObject *, object *); \ - \ - int routinename(PyObject *pyobj, object *cobj) { \ - if (!PyMacGluePtr_##routinename) { \ - if (!PyImport_ImportModule(module)) return NULL; \ - if (!PyMacGluePtr_##routinename) { \ - PyErr_SetString(PyExc_ImportError, "Module did not provide routine: " module ": " #routinename); \ - return NULL; \ - } \ - } \ - return (*PyMacGluePtr_##routinename)(pyobj, cobj); \ - } - GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "macfs") - - GLUE_NEW(AppleEvent *, AEDesc_New, "AE") /* XXXX Why by address? */ - GLUE_CONVERT(AppleEvent, AEDesc_Convert, "AE") - - GLUE_NEW(Component, CmpObj_New, "Cm") - GLUE_CONVERT(Component, CmpObj_Convert, "Cm") - GLUE_NEW(ComponentInstance, CmpInstObj_New, "Cm") - GLUE_CONVERT(ComponentInstance, CmpInstObj_Convert, "Cm") - - GLUE_NEW(ControlHandle, CtlObj_New, "Ctl") - GLUE_CONVERT(ControlHandle, CtlObj_Convert, "Ctl") - - GLUE_NEW(DialogPtr, DlgObj_New, "Dlg") - GLUE_CONVERT(DialogPtr, DlgObj_Convert, "Dlg") - GLUE_NEW(DialogPtr, DlgObj_WhichDialog, "Dlg") - - GLUE_NEW(DragReference, DragObj_New, "Drag") - GLUE_CONVERT(DragReference, DragObj_Convert, "Drag") - - GLUE_NEW(ListHandle, ListObj_New, "List") - GLUE_CONVERT(ListHandle, ListObj_Convert, "List") - - GLUE_NEW(MenuHandle, MenuObj_New, "Menu") - GLUE_CONVERT(MenuHandle, MenuObj_Convert, "Menu") - - GLUE_NEW(GrafPtr, GrafObj_New, "Qd") - GLUE_CONVERT(GrafPtr, GrafObj_Convert, "Qd") - GLUE_NEW(BitMapPtr, BMObj_New, "Qd") - GLUE_CONVERT(BitMapPtr, BMObj_Convert, "Qd") - GLUE_NEW(RGBColor *, QdRGB_New, "Qd") /* XXXX Why? */ - GLUE_CONVERT(RGBColor, QdRGB_Convert, "Qd") - GLUE_NEW(GWorldPtr, GWorldObj_New, "Qdoffs") - GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Qdoffs") - - GLUE_NEW(Track, TrackObj_New, "Qt") - GLUE_CONVERT(Track, TrackObj_Convert, "Qt") - GLUE_NEW(Movie, MovieObj_New, "Qt") - GLUE_CONVERT(Movie, MovieObj_Convert, "Qt") - GLUE_NEW(MovieController, MovieCtlObj_New, "Qt") - GLUE_CONVERT(MovieController, MovieCtlObj_Convert, "Qt") - GLUE_NEW(TimeBase, TimeBaseObj_New, "Qt") - GLUE_CONVERT(TimeBase, TimeBaseObj_Convert, "Qt") - GLUE_NEW(UserData, UserDataObj_New, "Qt") - GLUE_CONVERT(UserData, UserDataObj_Convert, "Qt") - GLUE_NEW(Media, MediaObj_New, "Qt") - GLUE_CONVERT(Media, MediaObj_Convert, "Qt") - - GLUE_NEW(Handle, ResObj_New, "Res") - GLUE_CONVERT(Handle, ResObj_Convert, "Res") - GLUE_NEW(Handle, OptResObj_New, "Res") - GLUE_CONVERT(Handle, OptResObj_Convert, "Res") - - GLUE_NEW(TEHandle, TEObj_New, "TE") - GLUE_CONVERT(TEHandle, TEObj_Convert, "TE") - - GLUE_NEW(WindowPtr, WinObj_New, "Win") - GLUE_CONVERT(WindowPtr, WinObj_Convert, "Win") - GLUE_NEW(WindowPtr, WinObj_WhichWindow, "Win") - - #endif /* USE_TOOLBOX_OBJECT_GLUE */ \ No newline at end of file --- 864,866 ---- From jackjansen@users.sourceforge.net Wed Aug 8 14:17:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 06:17:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include pymactoolbox.h,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv11197/Include Added Files: pymactoolbox.h Log Message: Split macglue.c into two: a new mactoolboxglue.c (in ./Python) with functionality needed for both unix-Python and MacPython and a new smaller ./Mac/Python/macglue.c which contains MacPython stuff only. pymactoolbox.h has moved to ./Include from ./Mac/Include and now also contains the relevant stuff from macglue.h. The net effect of this is that the ./Mac subdirectory is not needed anymore for building the unix-Python core on MacOSX (it is needed for building the extension modules). --- NEW FILE: pymactoolbox.h --- /* ** pymactoolbox.h - globals defined in mactoolboxglue.c */ #ifdef __cplusplus extern "C" { #endif #ifdef WITHOUT_FRAMEWORKS #include #include #include #include #include #include #include #include #else #include #include #endif /* ** Helper routines for error codes and such. */ char *PyMac_getscript(void); /* Get the default encoding for our 8bit character set */ char *PyMac_StrError(int); /* strerror with mac errors */ PyObject *PyErr_Mac(PyObject *, int); /* Exception with a mac error */ PyObject *PyMac_Error(OSErr); /* Uses PyMac_GetOSErrException */ /* ** These conversion routines are defined in mactoolboxglue.c itself. */ int PyMac_GetOSType(PyObject *, OSType *); /* argument parser for OSType */ PyObject *PyMac_BuildOSType(OSType); /* Convert OSType to PyObject */ PyObject *PyMac_BuildNumVersion(NumVersion);/* Convert NumVersion to PyObject */ int PyMac_GetStr255(PyObject *, Str255); /* argument parser for Str255 */ PyObject *PyMac_BuildStr255(Str255); /* Convert Str255 to PyObject */ PyObject *PyMac_BuildOptStr255(Str255); /* Convert Str255 to PyObject, NULL to None */ int PyMac_GetRect(PyObject *, Rect *); /* argument parser for Rect */ PyObject *PyMac_BuildRect(Rect *); /* Convert Rect to PyObject */ int PyMac_GetPoint(PyObject *, Point *); /* argument parser for Point */ PyObject *PyMac_BuildPoint(Point); /* Convert Point to PyObject */ int PyMac_GetEventRecord(PyObject *, EventRecord *); /* argument parser for EventRecord */ PyObject *PyMac_BuildEventRecord(EventRecord *); /* Convert EventRecord to PyObject */ int PyMac_GetFixed(PyObject *, Fixed *); /* argument parser for Fixed */ PyObject *PyMac_BuildFixed(Fixed); /* Convert Fixed to PyObject */ int PyMac_Getwide(PyObject *, wide *); /* argument parser for wide */ PyObject *PyMac_Buildwide(wide *); /* Convert wide to PyObject */ /* ** The rest of the routines are implemented by extension modules. If they are ** dynamically loaded mactoolboxglue will contain a stub implementation of the ** routine, which imports the module, whereupon the module's init routine will ** communicate the routine pointer back to the stub. ** If USE_TOOLBOX_OBJECT_GLUE is not defined there is no glue code, and the ** extension modules simply declare the routine. This is the case for static ** builds (and could be the case for MacPython CFM builds, because CFM extension ** modules can reference each other without problems). */ #ifdef USE_TOOLBOX_OBJECT_GLUE /* ** These macros are used in the module init code. If we use toolbox object glue ** it sets the function pointer to point to the real function. */ #define PyMac_INIT_TOOLBOX_OBJECT_NEW(object, rtn) { \ extern PyObject *(*PyMacGluePtr_##rtn)(object); \ PyMacGluePtr_##rtn = _##rtn; \ } #define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(object, rtn) { \ extern int (*PyMacGluePtr_##rtn)(PyObject *, object *); \ PyMacGluePtr_##rtn = _##rtn; \ } #else /* ** If we don't use toolbox object glue the init macros are empty. Moreover, we define ** _xxx_New to be the same as xxx_New, and the code in mactoolboxglue isn't included. */ #define PyMac_INIT_TOOLBOX_OBJECT_NEW(object, rtn) #define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(object, rtn) #endif /* USE_TOOLBOX_OBJECT_GLUE */ /* macfs exports */ extern int PyMac_GetFSSpec(PyObject *, FSSpec *); /* AE exports */ extern PyObject *AEDesc_New(AppleEvent *); /* XXXX Why passed by address?? */ extern int AEDesc_Convert(PyObject *, AppleEvent *); /* Cm exports */ extern PyObject *CmpObj_New(Component); extern int CmpObj_Convert(PyObject *, Component *); extern PyObject *CmpInstObj_New(ComponentInstance); extern int CmpInstObj_Convert(PyObject *, ComponentInstance *); /* Ctl exports */ extern PyObject *CtlObj_New(ControlHandle); extern int CtlObj_Convert(PyObject *, ControlHandle *); /* Dlg exports */ extern PyObject *DlgObj_New(DialogPtr); extern int DlgObj_Convert(PyObject *, DialogPtr *); extern PyObject *DlgObj_WhichDialog(DialogPtr); /* Drag exports */ extern PyObject *DragObj_New(DragReference); extern int DragObj_Convert(PyObject *, DragReference *); /* List exports */ extern PyObject *ListObj_New(ListHandle); extern int ListObj_Convert(PyObject *, ListHandle *); /* Menu exports */ extern PyObject *MenuObj_New(MenuHandle); extern int MenuObj_Convert(PyObject *, MenuHandle *); /* Qd exports */ extern PyObject *GrafObj_New(GrafPtr); extern int GrafObj_Convert(PyObject *, GrafPtr *); extern PyObject *BMObj_New(BitMapPtr); extern int BMObj_Convert(PyObject *, BitMapPtr *); extern PyObject *QdRGB_New(RGBColor *); extern int QdRGB_Convert(PyObject *, RGBColor *); /* Qdoffs exports */ extern PyObject *GWorldObj_New(GWorldPtr); extern int GWorldObj_Convert(PyObject *, GWorldPtr *); /* Qt exports */ extern PyObject *TrackObj_New(Track); extern int TrackObj_Convert(PyObject *, Track *); extern PyObject *MovieObj_New(Movie); extern int MovieObj_Convert(PyObject *, Movie *); extern PyObject *MovieCtlObj_New(MovieController); extern int MovieCtlObj_Convert(PyObject *, MovieController *); extern PyObject *TimeBaseObj_New(TimeBase); extern int TimeBaseObj_Convert(PyObject *, TimeBase *); extern PyObject *UserDataObj_New(UserData); extern int UserDataObj_Convert(PyObject *, UserData *); extern PyObject *MediaObj_New(Media); extern int MediaObj_Convert(PyObject *, Media *); /* Res exports */ extern PyObject *ResObj_New(Handle); extern int ResObj_Convert(PyObject *, Handle *); extern PyObject *OptResObj_New(Handle); extern int OptResObj_Convert(PyObject *, Handle *); /* TE exports */ extern PyObject *TEObj_New(TEHandle); extern int TEObj_Convert(PyObject *, TEHandle *); /* Win exports */ extern PyObject *WinObj_New(WindowPtr); extern int WinObj_Convert(PyObject *, WindowPtr *); extern PyObject *WinObj_WhichWindow(WindowPtr); #ifdef __cplusplus } #endif From jackjansen@users.sourceforge.net Wed Aug 8 14:18:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 06:18:38 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv13455 Modified Files: Makefile.pre.in Log Message: Removed special rule for Mac/Python/macglue.o, it is not needed anymore. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Makefile.pre.in 2001/08/02 06:20:20 1.48 --- Makefile.pre.in 2001/08/08 13:18:36 1.49 *************** *** 412,418 **** $(srcdir)/Objects/unicodetype_db.h - Mac/Python/macglue.o: $(srcdir)/Mac/Python/macglue.c - $(CC) -c $(CFLAGS) $(CPPFLAGS) -I$(srcdir)/Mac/Include -I$(srcdir)/Python -o $@ $(srcdir)/Mac/Python/macglue.c - ############################################################################ # Header files --- 412,415 ---- From jackjansen@users.sourceforge.net Wed Aug 8 14:46:52 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 06:46:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macosmodule.c,1.55,1.56 macfsmodule.c,1.41,1.42 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv26235 Modified Files: macosmodule.c macfsmodule.c Log Message: - Don't return mac-style pathnames in unix-Python. - Fixed up a lot more prototypes (gcc also wants them on static routines) - Fixed various other gcc warnings. Index: macosmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macosmodule.c,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** macosmodule.c 2001/05/19 12:50:05 1.55 --- macosmodule.c 2001/08/08 13:46:49 1.56 *************** *** 45,50 **** #endif - static PyObject *ErrorObject; - /* ----------------------------------------------------- */ --- 45,48 ---- *************** *** 64,69 **** static void ! do_close(self) ! rfobject *self; { if (self->isclosed ) return; --- 62,66 ---- static void ! do_close(rfobject *self) { if (self->isclosed ) return; *************** *** 77,83 **** static PyObject * ! rf_read(self, args) ! rfobject *self; ! PyObject *args; { long n; --- 74,78 ---- static PyObject * ! rf_read(rfobject *self, PyObject *args) { long n; *************** *** 113,119 **** static PyObject * ! rf_write(self, args) ! rfobject *self; ! PyObject *args; { char *buffer; --- 108,112 ---- static PyObject * ! rf_write(rfobject *self, PyObject *args) { char *buffer; *************** *** 142,148 **** static PyObject * ! rf_seek(self, args) ! rfobject *self; ! PyObject *args; { long amount, pos; --- 135,139 ---- static PyObject * ! rf_seek(rfobject *self, PyObject *args) { long amount, pos; *************** *** 158,167 **** return NULL; ! if ( err = GetEOF(self->fRefNum, &eof)) goto ioerr; switch (whence) { case SEEK_CUR: ! if (err = GetFPos(self->fRefNum, &pos)) goto ioerr; break; --- 149,158 ---- return NULL; ! if ((err = GetEOF(self->fRefNum, &eof))) goto ioerr; switch (whence) { case SEEK_CUR: ! if ((err = GetFPos(self->fRefNum, &pos))) goto ioerr; break; *************** *** 185,189 **** } ! if ( err = SetFPos(self->fRefNum, fsFromStart, pos) ) { ioerr: PyMac_Error(err); --- 176,180 ---- } ! if ((err = SetFPos(self->fRefNum, fsFromStart, pos)) ) { ioerr: PyMac_Error(err); *************** *** 200,206 **** static PyObject * ! rf_tell(self, args) ! rfobject *self; ! PyObject *args; { long where; --- 191,195 ---- static PyObject * ! rf_tell(rfobject *self, PyObject *args) { long where; *************** *** 213,217 **** if (!PyArg_ParseTuple(args, "")) return NULL; ! if ( err = GetFPos(self->fRefNum, &where) ) { PyMac_Error(err); return NULL; --- 202,206 ---- if (!PyArg_ParseTuple(args, "")) return NULL; ! if ((err = GetFPos(self->fRefNum, &where)) ) { PyMac_Error(err); return NULL; *************** *** 225,231 **** static PyObject * ! rf_close(self, args) ! rfobject *self; ! PyObject *args; { if (!PyArg_ParseTuple(args, "")) --- 214,218 ---- static PyObject * ! rf_close(rfobject *self, PyObject *args) { if (!PyArg_ParseTuple(args, "")) *************** *** 238,246 **** static struct PyMethodDef rf_methods[] = { ! {"read", rf_read, 1, rf_read__doc__}, ! {"write", rf_write, 1, rf_write__doc__}, ! {"seek", rf_seek, 1, rf_seek__doc__}, ! {"tell", rf_tell, 1, rf_tell__doc__}, ! {"close", rf_close, 1, rf_close__doc__}, {NULL, NULL} /* sentinel */ --- 225,233 ---- static struct PyMethodDef rf_methods[] = { ! {"read", (PyCFunction)rf_read, 1, rf_read__doc__}, ! {"write", (PyCFunction)rf_write, 1, rf_write__doc__}, ! {"seek", (PyCFunction)rf_seek, 1, rf_seek__doc__}, ! {"tell", (PyCFunction)rf_tell, 1, rf_tell__doc__}, ! {"close", (PyCFunction)rf_close, 1, rf_close__doc__}, {NULL, NULL} /* sentinel */ *************** *** 251,255 **** static rfobject * ! newrfobject() { rfobject *self; --- 238,242 ---- static rfobject * ! newrfobject(void) { rfobject *self; *************** *** 264,269 **** static void ! rf_dealloc(self) ! rfobject *self; { do_close(self); --- 251,255 ---- static void ! rf_dealloc(rfobject *self) { do_close(self); *************** *** 272,278 **** static PyObject * ! rf_getattr(self, name) ! rfobject *self; ! char *name; { return Py_FindMethod(rf_methods, (PyObject *)self, name); --- 258,262 ---- static PyObject * ! rf_getattr(rfobject *self, char *name) { return Py_FindMethod(rf_methods, (PyObject *)self, name); *************** *** 458,464 **** static PyObject * ! MacOS_SetEventHandler(self, args) ! PyObject *self; ! PyObject *args; { PyObject *evh = NULL; --- 442,446 ---- static PyObject * ! MacOS_SetEventHandler(PyObject *self, PyObject *args) { PyObject *evh = NULL; *************** *** 615,618 **** --- 597,601 ---- err = HOpenRF(fss.vRefNum, fss.parID, fss.name, permission, &fp->fRefNum); + #if !TARGET_API_MAC_OSX if ( err == fnfErr ) { /* In stead of doing complicated things here to get creator/type *************** *** 636,639 **** --- 619,623 ---- err = HOpenRF(fss.vRefNum, fss.parID, fss.name, permission, &fp->fRefNum); } + #endif if ( err ) { Py_DECREF(fp); *************** *** 743,747 **** void ! initMacOS() { PyObject *m, *d; --- 727,731 ---- void ! initMacOS(void) { PyObject *m, *d; *************** *** 770,776 **** --- 754,762 ---- return; } + #if !TARGET_API_MAC_OSX if (PyDict_SetItemString(d, "AppearanceCompliant", Py_BuildValue("i", PyMac_AppearanceCompliant)) != 0) return; + #endif #if TARGET_API_MAC_OSX #define PY_RUNTIMEMODEL "macho" Index: macfsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macfsmodule.c,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** macfsmodule.c 2001/08/07 15:28:52 1.41 --- macfsmodule.c 2001/08/08 13:46:49 1.42 *************** *** 102,108 **** static PyObject * ! mfsa_Resolve(self, args) ! mfsaobject *self; ! PyObject *args; { FSSpec from, *fromp, result; --- 102,106 ---- static PyObject * ! mfsa_Resolve(mfsaobject *self, PyObject *args) { FSSpec from, *fromp, result; *************** *** 126,132 **** static PyObject * ! mfsa_GetInfo(self, args) ! mfsaobject *self; ! PyObject *args; { Str63 value; --- 124,128 ---- static PyObject * ! mfsa_GetInfo(mfsaobject *self, PyObject *args) { Str63 value; *************** *** 145,151 **** static PyObject * ! mfsa_Update(self, args) ! mfsaobject *self; ! PyObject *args; { FSSpec target, fromfile, *fromfilep; --- 141,145 ---- static PyObject * ! mfsa_Update(mfsaobject *self, PyObject *args) { FSSpec target, fromfile, *fromfilep; *************** *** 180,186 **** static PyObject * ! mfsa_getattr(self, name) ! mfsaobject *self; ! char *name; { if ( strcmp(name, "data") == 0 ) { --- 174,178 ---- static PyObject * ! mfsa_getattr(mfsaobject *self, char *name) { if ( strcmp(name, "data") == 0 ) { *************** *** 211,216 **** static void ! mfsa_dealloc(self) ! mfsaobject *self; { #if 0 --- 203,207 ---- static void ! mfsa_dealloc(mfsaobject *self) { #if 0 *************** *** 255,259 **** static mfsiobject * ! newmfsiobject() { mfsiobject *self; --- 246,250 ---- static mfsiobject * ! newmfsiobject(void) { mfsiobject *self; *************** *** 267,272 **** static void ! mfsi_dealloc(self) ! mfsiobject *self; { PyMem_DEL(self); --- 258,262 ---- static void ! mfsi_dealloc(mfsiobject *self) { PyMem_DEL(self); *************** *** 274,280 **** static PyObject * ! mfsi_getattr(self, name) ! mfsiobject *self; ! char *name; { if ( strcmp(name, "Type") == 0 ) --- 264,268 ---- static PyObject * ! mfsi_getattr(mfsiobject *self, char *name) { if ( strcmp(name, "Type") == 0 ) *************** *** 294,301 **** static int ! mfsi_setattr(self, name, v) ! mfsiobject *self; ! char *name; ! PyObject *v; { int rv; --- 282,286 ---- static int ! mfsi_setattr(mfsiobject *self, char *name, PyObject *v) { int rv; *************** *** 414,420 **** */ static OSErr ! PyMac_GetFileDates(fss, crdat, mddat, bkdat) ! FSSpec *fss; ! unsigned long *crdat, *mddat, *bkdat; { CInfoPBRec pb; --- 399,404 ---- */ static OSErr ! PyMac_GetFileDates(FSSpec *fss, unsigned long *crdat, unsigned long *mddat, ! unsigned long *bkdat) { CInfoPBRec pb; *************** *** 434,440 **** static OSErr ! PyMac_SetFileDates(fss, crdat, mddat, bkdat) ! FSSpec *fss; ! unsigned long crdat, mddat, bkdat; { CInfoPBRec pb; --- 418,423 ---- static OSErr ! PyMac_SetFileDates(FSSpec *fss, unsigned long crdat, unsigned long mddat, ! unsigned long bkdat) { CInfoPBRec pb; *************** *** 459,466 **** static PyObject * ! mfss_as_pathname(self, args) ! mfssobject *self; ! PyObject *args; { char strbuf[257]; OSErr err; --- 442,451 ---- static PyObject * ! mfss_as_pathname(mfssobject *self, PyObject *args) { + #if TARGET_API_MAC_OSX + PyErr_SetString(PyExc_NotImplementedError, "FSSpec.as_pathname not supported on this platform"); + return 0; + #else char strbuf[257]; OSErr err; *************** *** 474,483 **** } return PyString_FromString(strbuf); } static PyObject * ! mfss_as_tuple(self, args) ! mfssobject *self; ! PyObject *args; { if (!PyArg_ParseTuple(args, "")) --- 459,467 ---- } return PyString_FromString(strbuf); + #endif } static PyObject * ! mfss_as_tuple(mfssobject *self, PyObject *args) { if (!PyArg_ParseTuple(args, "")) *************** *** 488,494 **** static PyObject * ! mfss_NewAlias(self, args) ! mfssobject *self; ! PyObject *args; { FSSpec src, *srcp; --- 472,476 ---- static PyObject * ! mfss_NewAlias(mfssobject *self, PyObject *args) { FSSpec src, *srcp; *************** *** 513,519 **** static PyObject * ! mfss_NewAliasMinimal(self, args) ! mfssobject *self; ! PyObject *args; { OSErr err; --- 495,499 ---- static PyObject * ! mfss_NewAliasMinimal(mfssobject *self, PyObject *args) { OSErr err; *************** *** 531,537 **** static PyObject * ! mfss_FSpMakeFSRef(self, args) ! mfssobject *self; ! PyObject *args; { #if TARGET_API_MAC_OS8 --- 511,515 ---- static PyObject * ! mfss_FSpMakeFSRef(mfssobject *self, PyObject *args) { #if TARGET_API_MAC_OS8 *************** *** 555,561 **** /* XXXX These routines should be replaced by a wrapper to the *FInfo routines */ static PyObject * ! mfss_GetCreatorType(self, args) ! mfssobject *self; ! PyObject *args; { OSErr err; --- 533,537 ---- /* XXXX These routines should be replaced by a wrapper to the *FInfo routines */ static PyObject * ! mfss_GetCreatorType(mfssobject *self, PyObject *args) { OSErr err; *************** *** 574,580 **** static PyObject * ! mfss_SetCreatorType(self, args) ! mfssobject *self; ! PyObject *args; { OSErr err; --- 550,554 ---- static PyObject * ! mfss_SetCreatorType(mfssobject *self, PyObject *args) { OSErr err; *************** *** 601,607 **** static PyObject * ! mfss_GetFInfo(self, args) ! mfssobject *self; ! PyObject *args; { OSErr err; --- 575,579 ---- static PyObject * ! mfss_GetFInfo(mfssobject *self, PyObject *args) { OSErr err; *************** *** 623,629 **** static PyObject * ! mfss_SetFInfo(self, args) ! mfssobject *self; ! PyObject *args; { OSErr err; --- 595,599 ---- static PyObject * ! mfss_SetFInfo(mfssobject *self, PyObject *args) { OSErr err; *************** *** 642,648 **** static PyObject * ! mfss_GetDates(self, args) ! mfssobject *self; ! PyObject *args; { OSErr err; --- 612,616 ---- static PyObject * ! mfss_GetDates(mfssobject *self, PyObject *args) { OSErr err; *************** *** 660,666 **** static PyObject * ! mfss_SetDates(self, args) ! mfssobject *self; ! PyObject *args; { OSErr err; --- 628,632 ---- static PyObject * ! mfss_SetDates(mfssobject *self, PyObject *args) { OSErr err; *************** *** 699,705 **** static PyObject * ! mfss_getattr(self, name) ! mfssobject *self; ! char *name; { if ( strcmp(name, "data") == 0) --- 665,669 ---- static PyObject * ! mfss_getattr(mfssobject *self, char *name) { if ( strcmp(name, "data") == 0) *************** *** 709,714 **** mfssobject * ! newmfssobject(fss) ! FSSpec *fss; { mfssobject *self; --- 673,677 ---- mfssobject * ! newmfssobject(FSSpec *fss) { mfssobject *self; *************** *** 722,727 **** static void ! mfss_dealloc(self) ! mfssobject *self; { PyMem_DEL(self); --- 685,689 ---- static void ! mfss_dealloc(mfssobject *self) { PyMem_DEL(self); *************** *** 729,738 **** static PyObject * ! mfss_repr(self) ! mfssobject *self; { char buf[512]; ! sprintf(buf, "FSSpec((%d, %d, '%.*s'))", self->fsspec.vRefNum, self->fsspec.parID, --- 691,699 ---- static PyObject * ! mfss_repr(mfssobject *self) { char buf[512]; ! sprintf(buf, "FSSpec((%d, %ld, '%.*s'))", self->fsspec.vRefNum, self->fsspec.parID, *************** *** 742,747 **** static int ! mfss_compare(v, w) ! mfssobject *v, *w; { int minlen; --- 703,707 ---- static int ! mfss_compare(mfssobject *v, mfssobject *w) { int minlen; *************** *** 784,790 **** #if !TARGET_API_MAC_OS8 static PyObject * ! mfsr_as_fsspec(self, args) ! mfsrobject *self; ! PyObject *args; { OSErr err; --- 744,748 ---- #if !TARGET_API_MAC_OS8 static PyObject * ! mfsr_as_fsspec(mfsrobject *self, PyObject *args) { OSErr err; *************** *** 823,829 **** static PyObject * ! mfsr_getattr(self, name) ! mfsrobject *self; ! char *name; { if ( strcmp(name, "data") == 0) --- 781,785 ---- static PyObject * ! mfsr_getattr(mfsrobject *self, char *name) { if ( strcmp(name, "data") == 0) *************** *** 833,838 **** mfsrobject * ! newmfsrobject(fsr) ! FSRef *fsr; { mfsrobject *self; --- 789,793 ---- mfsrobject * ! newmfsrobject(FSRef *fsr) { mfsrobject *self; *************** *** 846,851 **** static int ! mfsr_compare(v, w) ! mfsrobject *v, *w; { OSErr err; --- 801,805 ---- static int ! mfsr_compare(mfsrobject *v, mfsrobject *w) { OSErr err; *************** *** 861,866 **** static void ! mfsr_dealloc(self) ! mfsrobject *self; { PyMem_DEL(self); --- 815,819 ---- static void ! mfsr_dealloc(mfsrobject *self) { PyMem_DEL(self); *************** *** 891,897 **** static PyObject * ! mfs_ResolveAliasFile(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { FSSpec fss; --- 844,848 ---- static PyObject * ! mfs_ResolveAliasFile(PyObject *self, PyObject *args) { FSSpec fss; *************** *** 911,917 **** #if !TARGET_API_MAC_CARBON static PyObject * ! mfs_StandardGetFile(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { SFTypeList list; --- 862,866 ---- #if !TARGET_API_MAC_CARBON static PyObject * ! mfs_StandardGetFile(PyObject *self, PyObject *args) { SFTypeList list; *************** *** 935,941 **** static PyObject * ! mfs_PromptGetFile(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { SFTypeList list; --- 884,888 ---- static PyObject * ! mfs_PromptGetFile(PyObject *self, PyObject *args) { SFTypeList list; *************** *** 960,966 **** static PyObject * ! mfs_StandardPutFile(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { Str255 prompt, dft; --- 907,911 ---- static PyObject * ! mfs_StandardPutFile(PyObject *self, PyObject *args) { Str255 prompt, dft; *************** *** 977,983 **** ** Set initial directory for file dialogs */ static PyObject * ! mfs_SetFolder(self, args) ! PyObject *self; ! PyObject *args; { FSSpec spec; --- 922,926 ---- ** Set initial directory for file dialogs */ static PyObject * ! mfs_SetFolder(PyObject *self, PyObject *args) { FSSpec spec; *************** *** 1003,1009 **** static PyObject * ! mfs_FSSpec(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { FSSpec fss; --- 946,950 ---- static PyObject * ! mfs_FSSpec(PyObject *self, PyObject *args) { FSSpec fss; *************** *** 1015,1021 **** static PyObject * ! mfs_FSRef(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { #if TARGET_API_MAC_OS8 --- 956,960 ---- static PyObject * ! mfs_FSRef(PyObject *self, PyObject *args) { #if TARGET_API_MAC_OS8 *************** *** 1032,1038 **** static PyObject * ! mfs_RawFSSpec(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { FSSpec *fssp; --- 971,975 ---- static PyObject * ! mfs_RawFSSpec(PyObject *self, PyObject *args) { FSSpec *fssp; *************** *** 1049,1055 **** static PyObject * ! mfs_RawAlias(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { char *dataptr; --- 986,990 ---- static PyObject * ! mfs_RawAlias(PyObject *self, PyObject *args) { char *dataptr; *************** *** 1072,1078 **** #if !TARGET_API_MAC_CARBON static PyObject * ! mfs_GetDirectory(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { FSSpec fsdir; --- 1007,1011 ---- #if !TARGET_API_MAC_CARBON static PyObject * ! mfs_GetDirectory(PyObject *self, PyObject *args) { FSSpec fsdir; *************** *** 1089,1095 **** static PyObject * ! mfs_FindFolder(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { OSErr err; --- 1022,1026 ---- static PyObject * ! mfs_FindFolder(PyObject *self, PyObject *args) { OSErr err; *************** *** 1111,1117 **** static PyObject * ! mfs_FindApplication(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { OSErr err; --- 1042,1046 ---- static PyObject * ! mfs_FindApplication(PyObject *self, PyObject *args) { OSErr err; *************** *** 1130,1136 **** static PyObject * ! mfs_FInfo(self, args) ! PyObject *self; ! PyObject *args; { return (PyObject *)newmfsiobject(); --- 1059,1063 ---- static PyObject * ! mfs_FInfo(PyObject *self, PyObject *args) { return (PyObject *)newmfsiobject(); *************** *** 1138,1144 **** static PyObject * ! mfs_NewAliasMinimalFromFullPath(self, args) ! PyObject *self; /* Not used */ ! PyObject *args; { OSErr err; --- 1065,1069 ---- static PyObject * ! mfs_NewAliasMinimalFromFullPath(PyObject *self, PyObject *args) { OSErr err; *************** *** 1278,1282 **** void ! initmacfs() { PyObject *m, *d; --- 1203,1207 ---- void ! initmacfs(void) { PyObject *m, *d; From jackjansen@users.sourceforge.net Wed Aug 8 14:56:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 06:56:17 -0700 Subject: [Python-checkins] CVS: python/dist/src configure.in,1.239,1.240 configure,1.230,1.231 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv29990 Modified Files: configure.in configure Log Message: Various fixes to streamline build process on Mac OS X: - Give a warning if you're on a case-insensitive filesystem and have not specified --with-suffix. - Don't require --with-dyld, it is now default for OSX/Darwin (suggested by Martin v. Loewis) - Don't define _POSIX_THREADS on Darwin, it's done by standard headers already (fix by Tony Lownds) - Don't use the Mac subtree anymore, the routines relevant to OSX/Darwin have moved to a new file Python/mactoolboxglue.c. Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.239 retrieving revision 1.240 diff -C2 -d -r1.239 -r1.240 *** configure.in 2001/08/08 10:39:03 1.239 --- configure.in 2001/08/08 13:56:14 1.240 *************** *** 45,49 **** [ --with-next-framework Build (OpenStep|Rhapsody|MacOSX|Darwin) framework],,) AC_ARG_WITH(dyld, ! [ --with-dyld Use (OpenStep|Rhapsody|MacOSX|Darwin) dynamic linker],,) # Set name for machine-dependent library files --- 45,49 ---- [ --with-next-framework Build (OpenStep|Rhapsody|MacOSX|Darwin) framework],,) AC_ARG_WITH(dyld, ! [ --with-dyld Use (OpenStep|Rhapsody) dynamic linker],,) # Set name for machine-dependent library files *************** *** 181,184 **** --- 181,190 ---- esac]) AC_MSG_RESULT($EXEEXT) + # Test whether we're running on a non-case-sensitive system, in which + # case we give a warning if no ext is given + if test -d "python" -a -z "$EXEEXT" + then + AC_MSG_WARN(This filesystem is not case-sensitive so you should probably use --with-suffix) + fi case $MACHDEP in *************** *** 704,720 **** AC_MSG_CHECKING(for --with-dyld) ! if test "$with_next_framework" -o "$with_dyld" ! then ! if test "$with_dyld" then ! AC_MSG_RESULT(yes) else ! AC_MSG_RESULT(required for framework build) ! fi ! AC_DEFINE(WITH_DYLD) ! ns_dyld='set' ! else ! AC_MSG_RESULT(no) ! fi # Set info about shared libraries. --- 710,733 ---- AC_MSG_CHECKING(for --with-dyld) ! case $ac_sys_system/$ac_sys_release in ! Darwin/*) ! AC_DEFINE(WITH_DYLD) ! AC_MSG_RESULT(always on for Darwin) ! ;; ! *) ! if test "$with_next_framework" -o "$with_dyld" then ! if test "$with_dyld" ! then ! AC_MSG_RESULT(yes) ! else ! AC_MSG_RESULT(required for framework build) ! fi ! AC_DEFINE(WITH_DYLD) ! ns_dyld='set' else ! AC_MSG_RESULT(no) ! fi ;; ! esac # Set info about shared libraries. *************** *** 763,767 **** OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; DYNIX/ptx*) LDSHARED="ld -G";; ! Darwin/*|next/*) if test "$ns_dyld" then LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress' --- 776,785 ---- OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; DYNIX/ptx*) LDSHARED="ld -G";; ! Darwin/*) ! LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress' ! if test "$with_next_framework" ; then ! LDSHARED="$LDSHARED \$(LDLIBRARY)" ! fi ;; ! next/*) if test "$ns_dyld" then LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress' *************** *** 1004,1008 **** AC_MSG_RESULT(no) AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD) ! AC_DEFINE(_POSIX_THREADS) LIBS="-lpthread $LIBS" LIBOBJS="$LIBOBJS thread.o"],[ --- 1022,1029 ---- AC_MSG_RESULT(no) AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD) ! case $ac_sys_system in ! Darwin*) ;; ! *) AC_DEFINE(_POSIX_THREADS);; ! esac LIBS="-lpthread $LIBS" LIBOBJS="$LIBOBJS thread.o"],[ *************** *** 1167,1171 **** case $ac_sys_system/$ac_sys_release in Darwin/*) ! MACHDEP_OBJS="Mac/Python/macglue.o" AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE) ;; --- 1188,1192 ---- case $ac_sys_system/$ac_sys_release in Darwin/*) ! MACHDEP_OBJS="Python/mactoolboxglue.o" AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE) ;; Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.230 retrieving revision 1.231 diff -C2 -d -r1.230 -r1.231 *** configure 2001/08/04 22:32:02 1.230 --- configure 2001/08/08 13:56:14 1.231 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.237 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.239 [...4401 lines suppressed...] if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7003,7007 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7006: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7027,7031 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7030: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then From jackjansen@users.sourceforge.net Wed Aug 8 16:28:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 08:28:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python mactoolboxglue.c,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv4898/python/Python Modified Files: mactoolboxglue.c Log Message: Got rid of unused includes. Index: mactoolboxglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/mactoolboxglue.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mactoolboxglue.c 2001/08/08 13:17:31 1.1 --- mactoolboxglue.c 2001/08/08 15:28:03 1.2 *************** *** 25,53 **** #include "Python.h" - - //#include "macglue.h" - //#include "marshal.h" - //#include "import.h" - //#include "importdl.h" #include "pymactoolbox.h" - //#include "pythonresources.h" - #ifdef WITHOUT_FRAMEWORKS ! //#include /* for Set(Current)A5 */ ! //#include ! //#include ! //#include ! //#include ! //#include ! //#include ! //#include ! //#include ! //#include ! //#include ! //#include ! //#include ! #else ! //#include #endif --- 25,33 ---- #include "Python.h" #include "pymactoolbox.h" #ifdef WITHOUT_FRAMEWORKS ! #include ! #include #endif From jackjansen@users.sourceforge.net Wed Aug 8 16:28:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 08:28:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.mcp,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv5233/python/Mac/Build Modified Files: PythonCore.mcp Log Message: Adapted for pymactoolbox.c and changed externals elsewhere. Index: PythonCore.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.mcp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 Binary files /tmp/cvshF2je6 and /tmp/cvsEUwBv5 differ From jackjansen@users.sourceforge.net Wed Aug 8 16:29:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 08:29:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCoreCarbon.exp,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv5386/python/Mac/Build Modified Files: PythonCoreCarbon.exp Log Message: Adapted for pymactoolbox.c and changed externals elsewhere. Index: PythonCoreCarbon.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCoreCarbon.exp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PythonCoreCarbon.exp 2001/08/07 13:52:05 1.11 --- PythonCoreCarbon.exp 2001/08/08 15:29:09 1.12 *************** *** 528,532 **** PyType_Type PyBaseObject_Type - PyType_InitDict _PyType_Lookup PyType_IsSubtype --- 528,531 ---- From jackjansen@users.sourceforge.net Wed Aug 8 16:29:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 08:29:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonStandSmall.mcp,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv5448/python/Mac/Build Modified Files: PythonStandSmall.mcp Log Message: Adapted for pymactoolbox.c and changed externals elsewhere. Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 Binary files /tmp/cvsHdZ9Qx and /tmp/cvsudamnY differ From jackjansen@users.sourceforge.net Wed Aug 8 16:29:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 08:29:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.23,2.24 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv5676/python/Objects Modified Files: typeobject.c Log Message: Removed extraneous semicolons that caused a gazzilion "empty declaration" warnings in the MetroWerks compiler. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.23 retrieving revision 2.24 diff -C2 -d -r2.23 -r2.24 *** typeobject.c 2001/08/07 17:24:28 2.23 --- typeobject.c 2001/08/08 15:29:49 2.24 *************** *** 1732,1741 **** } ! RICHCMP_WRAPPER(lt, Py_LT); ! RICHCMP_WRAPPER(le, Py_LE); ! RICHCMP_WRAPPER(eq, Py_EQ); ! RICHCMP_WRAPPER(ne, Py_NE); ! RICHCMP_WRAPPER(gt, Py_GT); ! RICHCMP_WRAPPER(ge, Py_GE); #undef RICHCMP_ENTRY --- 1732,1741 ---- } ! RICHCMP_WRAPPER(lt, Py_LT) ! RICHCMP_WRAPPER(le, Py_LE) ! RICHCMP_WRAPPER(eq, Py_EQ) ! RICHCMP_WRAPPER(ne, Py_NE) ! RICHCMP_WRAPPER(gt, Py_GT) ! RICHCMP_WRAPPER(ge, Py_GE) #undef RICHCMP_ENTRY *************** *** 2046,2053 **** } ! SLOT1(sq_concat, add, PyObject *, O); ! SLOT1(sq_repeat, mul, int, i); ! SLOT1(sq_item, getitem, int, i); ! SLOT2(sq_slice, getslice, int, int, ii); static int --- 2046,2053 ---- } ! SLOT1(sq_concat, add, PyObject *, O) ! SLOT1(sq_repeat, mul, int, i) ! SLOT1(sq_item, getitem, int, i) ! SLOT2(sq_slice, getslice, int, int, ii) static int *************** *** 2096,2105 **** } ! SLOT1(sq_inplace_concat, iadd, PyObject *, O); ! SLOT1(sq_inplace_repeat, imul, int, i); #define slot_mp_length slot_sq_length ! SLOT1(mp_subscript, getitem, PyObject *, O); static int --- 2096,2105 ---- } ! SLOT1(sq_inplace_concat, iadd, PyObject *, O) ! SLOT1(sq_inplace_repeat, imul, int, i) #define slot_mp_length slot_sq_length ! SLOT1(mp_subscript, getitem, PyObject *, O) static int *************** *** 2121,2134 **** /* XXX the numerical slots should call the reverse operators too; but how do they know their type? */ ! SLOT1(nb_add, add, PyObject *, O); ! SLOT1(nb_subtract, sub, PyObject *, O); ! SLOT1(nb_multiply, mul, PyObject *, O); ! SLOT1(nb_divide, div, PyObject *, O); ! SLOT1(nb_remainder, mod, PyObject *, O); ! SLOT1(nb_divmod, divmod, PyObject *, O); ! SLOT2(nb_power, pow, PyObject *, PyObject *, OO); ! SLOT0(nb_negative, neg); ! SLOT0(nb_positive, pos); ! SLOT0(nb_absolute, abs); static int --- 2121,2134 ---- /* XXX the numerical slots should call the reverse operators too; but how do they know their type? */ ! SLOT1(nb_add, add, PyObject *, O) ! SLOT1(nb_subtract, sub, PyObject *, O) ! SLOT1(nb_multiply, mul, PyObject *, O) ! SLOT1(nb_divide, div, PyObject *, O) ! SLOT1(nb_remainder, mod, PyObject *, O) ! SLOT1(nb_divmod, divmod, PyObject *, O) ! SLOT2(nb_power, pow, PyObject *, PyObject *, OO) ! SLOT0(nb_negative, neg) ! SLOT0(nb_positive, pos) ! SLOT0(nb_absolute, abs) static int *************** *** 2142,2168 **** } ! SLOT0(nb_invert, invert); ! SLOT1(nb_lshift, lshift, PyObject *, O); ! SLOT1(nb_rshift, rshift, PyObject *, O); ! SLOT1(nb_and, and, PyObject *, O); ! SLOT1(nb_xor, xor, PyObject *, O); ! SLOT1(nb_or, or, PyObject *, O); /* Not coerce() */ ! SLOT0(nb_int, int); ! SLOT0(nb_long, long); ! SLOT0(nb_float, float); ! SLOT0(nb_oct, oct); ! SLOT0(nb_hex, hex); ! SLOT1(nb_inplace_add, iadd, PyObject *, O); ! SLOT1(nb_inplace_subtract, isub, PyObject *, O); ! SLOT1(nb_inplace_multiply, imul, PyObject *, O); ! SLOT1(nb_inplace_divide, idiv, PyObject *, O); ! SLOT1(nb_inplace_remainder, imod, PyObject *, O); ! SLOT2(nb_inplace_power, ipow, PyObject *, PyObject *, OO); ! SLOT1(nb_inplace_lshift, ilshift, PyObject *, O); ! SLOT1(nb_inplace_rshift, irshift, PyObject *, O); ! SLOT1(nb_inplace_and, iand, PyObject *, O); ! SLOT1(nb_inplace_xor, ixor, PyObject *, O); ! SLOT1(nb_inplace_or, ior, PyObject *, O); static int --- 2142,2168 ---- } ! SLOT0(nb_invert, invert) ! SLOT1(nb_lshift, lshift, PyObject *, O) ! SLOT1(nb_rshift, rshift, PyObject *, O) ! SLOT1(nb_and, and, PyObject *, O) ! SLOT1(nb_xor, xor, PyObject *, O) ! SLOT1(nb_or, or, PyObject *, O) /* Not coerce() */ ! SLOT0(nb_int, int) ! SLOT0(nb_long, long) ! SLOT0(nb_float, float) ! SLOT0(nb_oct, oct) ! SLOT0(nb_hex, hex) ! SLOT1(nb_inplace_add, iadd, PyObject *, O) ! SLOT1(nb_inplace_subtract, isub, PyObject *, O) ! SLOT1(nb_inplace_multiply, imul, PyObject *, O) ! SLOT1(nb_inplace_divide, idiv, PyObject *, O) ! SLOT1(nb_inplace_remainder, imod, PyObject *, O) ! SLOT2(nb_inplace_power, ipow, PyObject *, PyObject *, OO) ! SLOT1(nb_inplace_lshift, ilshift, PyObject *, O) ! SLOT1(nb_inplace_rshift, irshift, PyObject *, O) ! SLOT1(nb_inplace_and, iand, PyObject *, O) ! SLOT1(nb_inplace_xor, ixor, PyObject *, O) ! SLOT1(nb_inplace_or, ior, PyObject *, O) static int *************** *** 2179,2183 **** } ! SLOT0(tp_repr, repr); static long --- 2179,2183 ---- } ! SLOT0(tp_repr, repr) static long *************** *** 2208,2212 **** } ! SLOT0(tp_str, str); static PyObject * --- 2208,2212 ---- } ! SLOT0(tp_str, str) static PyObject * *************** *** 2272,2276 **** } ! SLOT0(tp_iter, iter); static PyObject * --- 2272,2276 ---- } ! SLOT0(tp_iter, iter) static PyObject * *************** *** 2280,2284 **** } ! SLOT2(tp_descr_get, get, PyObject *, PyObject *, OO); static int --- 2280,2284 ---- } ! SLOT2(tp_descr_get, get, PyObject *, PyObject *, OO) static int From jackjansen@users.sourceforge.net Wed Aug 8 16:29:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 08:29:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.exp,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv5301/python/Mac/Build Modified Files: PythonCore.exp Log Message: Adapted for pymactoolbox.c and changed externals elsewhere. Index: PythonCore.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.exp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PythonCore.exp 2001/08/07 13:52:43 1.11 --- PythonCore.exp 2001/08/08 15:29:01 1.12 *************** *** 528,532 **** PyType_Type PyBaseObject_Type - PyType_InitDict _PyType_Lookup PyType_IsSubtype --- 528,531 ---- From gvanrossum@users.sourceforge.net Wed Aug 8 16:30:15 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 08 Aug 2001 08:30:15 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0264.txt,NONE,1.1 pep-0000.txt,1.113,1.114 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv5695 Modified Files: pep-0000.txt Added Files: pep-0264.txt Log Message: Add Michael Hudson's "Future statements in simulated shells". --- NEW FILE: pep-0264.txt --- PEP: 264 Title: Future statements in simulated shells Version: 2 Author: Michael Hudson Status: Draft Type: Standards Track Requires: 236 Created: 30-Jul-2001 Python-Version: 2.2 Post-History: 30-Jul-2001 Abstract As noted in PEP 263, there is no clear way for "simulated interactive shells" to simulate the behaviour of __future__ statements in "real" interactive shells, i.e. have __future__ statements' effects last the life of the shell. This short PEP proposes to make this possible by adding an optional fourth argument to the builtin function "compile" and adding machinery to the standard library modules "codeop" and "code" to make the construction of such shells easy. Specification I propose adding a fourth, optional, "flags" argument to the builtin "compile" function. If this argument is omitted, there will be no change in behaviour from that of Python 2.1. If it is present it is expected to be an integer, representing various possible compile time options as a bitfield. The bitfields will have the same values as the PyCF_* flags #defined in Include/pythonrun.h (at the time of writing there are three - PyCF_NESTED_SCOPES, PyCF_GENERATORS and PyCF_DIVISION). These are currently not exposed to Python, so I propose adding them to codeop.py (because it's already here, basically). XXX Should the supplied flags be or-ed with the flags of the calling frame, or do we override them? I'm for the former, slightly. I also propose adding a pair of classes to the standard library module codeop. One - probably called Compile - will sport a __call__ method which will act much like the builtin "compile" of 2.1 with the difference that after it has compiled a __future__ statement, it "remembers" it and compiles all subsequent code with the __future__ options in effect. It will do this by examining the co_flags field of any code object it returns, which in turn means writing and maintaining a Python version of the function PyEval_MergeCompilerFlags found in Python/ceval.c. Objects of the other class added to codeop - probably called CommandCompiler or somesuch - will do the job of the existing codeop.compile_command function, but in a __future__-aware way. Finally, I propose to modify the class InteractiveInterpreter in the standard library module code to use a CommandCompiler to emulate still more closely the behaviour of the default Python shell. Backward Compatibility Should be very few or none; the changes to compile will make no difference to existing code, nor will adding new functions or classes to codeop. Exisiting code using code.InteractiveInterpreter may change in behaviour, but only for the better in that the "real" Python shell will be being better impersonated. Forward Compatibility codeop will require very mild tweaking as each new __future__ statement is added. Such events will hopefully be very rare, so such a burden is unlikely to cause significant pain. Issues Paul Prescod has reasonably complained about the choice of a bitfield as the fourth argument to compile(), claiming it is obscure and unpythonic. There is also the thought of Jython compatibility; because Jython has the ability to access any Java object without the PyObject cruft needed in CPython, Jython already has a Python-visible CompilerFlags object which has a boolean attribute "compiler_flags", and will presumably have one fairly soon called "generators". This would be doable in CPython, but it would require more hacking of deep magical bits of the interpreter and require bumping the PYTHON_API_VERSION (OTOH, the division patch just went in, so there can't be a freeze on the C API just yet...). Implementation I've uploaded a preliminary implementation as: http://sourceforge.net/tracker/?func=detail&atid=305470&aid=449043&group_id=5470 I need to add docs and possibly implment a friendlier interface to compile(). Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil End: Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** pep-0000.txt 2001/08/01 20:11:56 1.113 --- pep-0000.txt 2001/08/08 15:30:13 1.114 *************** *** 60,63 **** --- 60,64 ---- S 262 pep-0262.txt Database of Installed Python Packages Kuchling S 263 pep-0263.txt Defining Python Source Code Encodings Lemburg + S 264 pep-0264.txt Future statements in simulated shells Hudson Py-in-the-sky PEPs (not considered for Python 2.2) *************** *** 205,208 **** --- 206,210 ---- S 262 pep-0262.txt Database of Installed Python Packages Kuchling S 263 pep-0263.txt Defining Python Source Code Encodings Lemburg + S 264 pep-0264.txt Future statements in simulated shells Hudson *************** *** 228,231 **** --- 230,234 ---- Evans, Clark C. cce@clarkevans.com Goodger, David dgoodger@bigfoot.com + Hudson, Michael mwh@python.net Hylton, Jeremy jeremy@zope.com Kuchling, Andrew akuchlin@mems-exchange.org From gvanrossum@users.sourceforge.net Wed Aug 8 16:36:43 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 08 Aug 2001 08:36:43 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0239.txt,1.5,1.6 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv8456 Modified Files: pep-0239.txt Log Message: Add nice summary by Marcin 'Qrczak' Kowalczyk from c.l.py for and against unifying ints and rats. Index: pep-0239.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0239.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0239.txt 2001/07/29 09:49:26 1.5 --- pep-0239.txt 2001/08/08 15:36:41 1.6 *************** *** 72,75 **** --- 72,106 ---- For rational numbers with integer values? + - Marcin 'Qrczak' Kowalczyk summarized the arguments for and + against unifying ints with rationals nicely on c.l.py: + + Arguments for unifying ints with rationals: + + - Since 2 == 2/1 and maybe str(2/1) == '2', it reduces surprises + where objects seem equal but behave differently. + + - / can be freely used for integer division when I *know* that + there is no remainder (if I am wrong and there is a remainder, + there will probably be some exception later). + + Arguments against: + + - When I use the result of / as a sequence index, it's usually + an error which should not be hidden by making the program + working for some data, since it will break for other data. + + - (this assumes that after unification int and rational would be + different types:) Types should rarely depend on values. It's + easier to reason when the type of a variable is known: I know + how I can use it. I can determine that something is an int and + expect that other objects used in this place will be ints too. + + - (this assumes the same type for them:) Int is a good type in + itself, not to be mixed with rationals. The fact that + something is an integer should be expressible as a statement + about its type. Many operations require ints and don't accept + rationals. It's natural to think about them as about different + types. + References From loewis@users.sourceforge.net Wed Aug 8 17:02:03 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 08 Aug 2001 09:02:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib types.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv15883 Modified Files: types.py Log Message: Patch #449083: Use builtins to initalize the module. Index: types.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/types.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** types.py 2001/08/02 04:15:00 1.17 --- types.py 2001/08/08 16:02:01 1.18 *************** *** 11,27 **** ObjectType = object ! IntType = type(0) ! LongType = type(0L) ! FloatType = type(0.0) try: ! ComplexType = type(complex(0,1)) except NameError: pass ! StringType = type('') ! UnicodeType = type(u'') BufferType = type(buffer('')) ! TupleType = type(()) ListType = list DictType = DictionaryType = dictionary --- 11,27 ---- ObjectType = object ! IntType = int ! LongType = long ! FloatType = float try: ! ComplexType = complex except NameError: pass ! StringType = str ! UnicodeType = unicode BufferType = type(buffer('')) ! TupleType = tuple ListType = list DictType = DictionaryType = dictionary From gvanrossum@users.sourceforge.net Wed Aug 8 17:57:45 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 08 Aug 2001 09:57:45 -0700 Subject: [Python-checkins] CVS: python/dist/src PLAN.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv30310 Modified Files: PLAN.txt Log Message: Added note to self about __new__ issue. Index: PLAN.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PLAN.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PLAN.txt 2001/08/02 22:06:35 1.3 --- PLAN.txt 2001/08/08 16:57:43 1.4 *************** *** 90,93 **** --- 90,102 ---- we try to use this for some, eh, interesting types such as tuples. *** + There was a sequel to the __new__ story (see checkins). There + still is a problem: object.__new__ now no longer exists, because + it was inherited by certain extension types that could break. But + now when I write + + class C(object): + def __new__(cls, *args): + "How do I call the default __new__ implementation???" + More -- I'm sure new issues will crop up as we go. From tim_one@users.sourceforge.net Wed Aug 8 19:24:47 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 08 Aug 2001 11:24:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include pyport.h,2.31,2.32 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv22359/Include Modified Files: pyport.h Log Message: Remove 6-year old hack to worm around a bug in "NextSpec/Sparc 3.3 pre-release limits.h". Index: pyport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v retrieving revision 2.31 retrieving revision 2.32 diff -C2 -d -r2.31 -r2.32 *** pyport.h 2001/08/08 10:28:06 2.31 --- pyport.h 2001/08/08 18:24:45 2.32 *************** *** 374,389 **** #endif - #ifdef __NeXT__ - #ifdef __sparc__ - /* - * This works around a bug in the NS/Sparc 3.3 pre-release - * limits.h header file. - * 10-Feb-1995 bwarsaw@cnri.reston.va.us - */ - #undef LONG_MIN - #define LONG_MIN (-LONG_MAX-1) - #endif - #endif - /* * Rename some functions for the Borland compiler --- 374,377 ---- From fdrake@users.sourceforge.net Wed Aug 8 19:50:20 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 08 Aug 2001 11:50:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api refcounts.dat,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv28387/api Modified Files: refcounts.dat Log Message: Reference counting information for PyNumber_*FloorDivide() and PyNumber_*TrueDivide(). Index: refcounts.dat =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounts.dat,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** refcounts.dat 2001/07/20 20:55:31 1.27 --- refcounts.dat 2001/08/08 18:50:18 1.28 *************** *** 535,538 **** --- 535,542 ---- PyNumber_Float:PyObject*:o:0: + PyNumber_FloorDivide:PyObject*::+1: + PyNumber_FloorDivide:PyObject*:v:0: + PyNumber_FloorDivide:PyObject*:w:0: + PyNumber_InPlaceAdd:PyObject*::+1: PyNumber_InPlaceAdd:PyObject*:v:0: *************** *** 547,550 **** --- 551,558 ---- PyNumber_InPlaceDivide:PyObject*:w:0: + PyNumber_InPlaceFloorDivide:PyObject*::+1: + PyNumber_InPlaceFloorDivide:PyObject*:v:0: + PyNumber_InPlaceFloorDivide:PyObject*:w:0: + PyNumber_InPlaceLshift:PyObject*::+1: PyNumber_InPlaceLshift:PyObject*:v:0: *************** *** 576,579 **** --- 584,591 ---- PyNumber_InPlaceSubtract:PyObject*:w:0: + PyNumber_InPlaceTrueDivide:PyObject*::+1: + PyNumber_InPlaceTrueDivide:PyObject*:v:0: + PyNumber_InPlaceTrueDivide:PyObject*:w:0: + PyNumber_InPlaceXor:PyObject*::+1: PyNumber_InPlaceXor:PyObject*:v:0: *************** *** 623,626 **** --- 635,642 ---- PyNumber_Subtract:PyObject*:o1:0: PyNumber_Subtract:PyObject*:o2:0: + + PyNumber_TrueDivide:PyObject*::+1: + PyNumber_TrueDivide:PyObject*:v:0: + PyNumber_TrueDivide:PyObject*:w:0: PyNumber_Xor:PyObject*::+1: From akuchling@users.sourceforge.net Wed Aug 8 20:10:13 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Wed, 08 Aug 2001 12:10:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler README,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler In directory usw-pr-cvs1:/tmp/cvs-serv912 Added Files: README Log Message: Added README to this directory --- NEW FILE: README --- This directory contains modules for a a Python source to bytecode compiler written in pure Python. To install the compiler modules so they're available for use by third-party Python software, run 'python setup.py install'. compile.py Demo that compiles a Python module into a .pyc file using the pure-Python compiler code. demo.py Prints the names of all the methods defined in a module, as a demonstration of walking through the abstract syntax tree produced by the parser. dumppyc.py Dumps the contents of a .pyc file, printing the attributes of the code object followed by a code disassembly. regrtest.py Runs the Python test suite using bytecode generated by the pure-Python compiler code instead of the builtin compiler. setup.py Setup file for installing the compiler code as a package. From fdrake@users.sourceforge.net Wed Aug 8 20:14:56 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 08 Aug 2001 12:14:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.135,1.136 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv1898/api Modified Files: api.tex Log Message: Added documentation for PyNumber_*FloorDivide(), PyNumber_*TrueDivide(), PyInterpreterState_*Head(), PyInterpreterState_Next(), and PyThreadState_Next(). Wrapped some long lines, added some others. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** api.tex 2001/08/02 18:00:28 1.135 --- api.tex 2001/08/08 19:14:53 1.136 *************** *** 1242,1246 **** \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyImport_ImportModuleEx}{char *name, PyObject *globals, PyObject *locals, PyObject *fromlist} Import a module. This is best described by referring to the built-in Python function \function{__import__()}\bifuncindex{__import__}, as --- 1242,1247 ---- \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyImport_ImportModuleEx}{char *name, ! PyObject *globals, PyObject *locals, PyObject *fromlist} Import a module. This is best described by referring to the built-in Python function \function{__import__()}\bifuncindex{__import__}, as *************** *** 1501,1505 **** ! \begin{cfuncdesc}{int}{PyObject_SetAttrString}{PyObject *o, char *attr_name, PyObject *v} Set the value of the attribute named \var{attr_name}, for object \var{o}, to the value \var{v}. Returns \code{-1} on failure. This is --- 1502,1507 ---- ! \begin{cfuncdesc}{int}{PyObject_SetAttrString}{PyObject *o, ! char *attr_name, PyObject *v} Set the value of the attribute named \var{attr_name}, for object \var{o}, to the value \var{v}. Returns \code{-1} on failure. This is *************** *** 1509,1513 **** ! \begin{cfuncdesc}{int}{PyObject_SetAttr}{PyObject *o, PyObject *attr_name, PyObject *v} Set the value of the attribute named \var{attr_name}, for object \var{o}, --- 1511,1516 ---- ! \begin{cfuncdesc}{int}{PyObject_SetAttr}{PyObject *o, ! PyObject *attr_name, PyObject *v} Set the value of the attribute named \var{attr_name}, for object \var{o}, *************** *** 1696,1700 **** ! \begin{cfuncdesc}{int}{PyObject_SetItem}{PyObject *o, PyObject *key, PyObject *v} Map the object \var{key} to the value \var{v}. Returns \code{-1} on failure. This is the equivalent --- 1699,1704 ---- ! \begin{cfuncdesc}{int}{PyObject_SetItem}{PyObject *o, ! PyObject *key, PyObject *v} Map the object \var{key} to the value \var{v}. Returns \code{-1} on failure. This is the equivalent *************** *** 1717,1720 **** --- 1721,1725 ---- \end{cfuncdesc} + \section{Number Protocol \label{number}} *************** *** 1755,1758 **** --- 1760,1781 ---- + \begin{cfuncdesc}{PyObject*}{PyNumber_FloorDivide}{PyObject *o1, PyObject *o2} + Return the floor of \var{o1} divided by \var{o2}, or \NULL{} on + failure. This is equivalent to the ``classic'' division of integers. + \versionadded{2.2} + \end{cfuncdesc} + + + \begin{cfuncdesc}{PyObject*}{PyNumber_TrueDivide}{PyObject *o1, PyObject *o2} + Return a reasonable approximation for the mathematical value of + \var{o1} divided by \var{o2}, or \NULL{} on failure. The return value + is ``approximate'' because binary floating point numbers are + approximate; it is not possible to represent all real numbers in base + two. This function can return a floating point value when passed two + integers. + \versionadded{2.2} + \end{cfuncdesc} + + \begin{cfuncdesc}{PyObject*}{PyNumber_Remainder}{PyObject *o1, PyObject *o2} Returns the remainder of dividing \var{o1} by \var{o2}, or \NULL{} on *************** *** 1769,1773 **** ! \begin{cfuncdesc}{PyObject*}{PyNumber_Power}{PyObject *o1, PyObject *o2, PyObject *o3} See the built-in function \function{pow()}\bifuncindex{pow}. Returns \NULL{} on failure. This is the equivalent of the Python expression --- 1792,1797 ---- ! \begin{cfuncdesc}{PyObject*}{PyNumber_Power}{PyObject *o1, ! PyObject *o2, PyObject *o3} See the built-in function \function{pow()}\bifuncindex{pow}. Returns \NULL{} on failure. This is the equivalent of the Python expression *************** *** 1839,1900 **** \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceAdd}{PyObject *o1, PyObject *o2} ! Returns the result of adding \var{o1} and \var{o2}, or \NULL{} on failure. ! The operation is done \emph{in-place} when \var{o1} supports it. This is the ! equivalent of the Python expression \samp{\var{o1} += \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceSubtract}{PyObject *o1, PyObject *o2} Returns the result of subtracting \var{o2} from \var{o1}, or ! \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} ! supports it. This is the equivalent of the Python expression \samp{\var{o1} ! -= \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceMultiply}{PyObject *o1, PyObject *o2} Returns the result of multiplying \var{o1} and \var{o2}, or \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} supports it. ! This is the equivalent of the Python expression \samp{\var{o1} *= \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceDivide}{PyObject *o1, PyObject *o2} ! Returns the result of dividing \var{o1} by \var{o2}, or \NULL{} on failure. ! The operation is done \emph{in-place} when \var{o1} supports it. This is the ! equivalent of the Python expression \samp{\var{o1} /= \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceRemainder}{PyObject *o1, PyObject *o2} Returns the remainder of dividing \var{o1} by \var{o2}, or \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} supports it. ! This is the equivalent of the Python expression \samp{\var{o1} \%= \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlacePower}{PyObject *o1, PyObject *o2, PyObject *o3} ! See the built-in function \function{pow()}\bifuncindex{pow}. Returns ! \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} ! supports it. This is the equivalent of the Python expression \samp{\var{o1} ! **= \var{o2}} when o3 is \cdata{Py_None}, or an in-place variant of ! \samp{pow(\var{o1}, \var{o2}, \var{o3})} otherwise. If \var{o3} is to be ! ignored, pass \cdata{Py_None} in its place (passing \NULL{} for \var{o3} ! would cause an illegal memory access). \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceLshift}{PyObject *o1, PyObject *o2} ! Returns the result of left shifting \var{o1} by \var{o2} on success, or ! \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} ! supports it. This is the equivalent of the Python expression \samp{\var{o1} ! <\code{<=} \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceRshift}{PyObject *o1, PyObject *o2} ! Returns the result of right shifting \var{o1} by \var{o2} on success, or ! \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} ! supports it. This is the equivalent of the Python expression \samp{\var{o1} ! >\code{>=} \var{o2}}. \end{cfuncdesc} --- 1863,1957 ---- \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceAdd}{PyObject *o1, PyObject *o2} ! Returns the result of adding \var{o1} and \var{o2}, or \NULL{} on ! failure. The operation is done \emph{in-place} when \var{o1} supports ! it. This is the equivalent of the Python statement \samp{\var{o1} += ! \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceSubtract}{PyObject *o1, ! PyObject *o2} Returns the result of subtracting \var{o2} from \var{o1}, or ! \NULL{} on failure. The operation is done \emph{in-place} when ! \var{o1} supports it. This is the equivalent of the Python statement ! \samp{\var{o1} -= \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceMultiply}{PyObject *o1, ! PyObject *o2} Returns the result of multiplying \var{o1} and \var{o2}, or \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} supports it. ! This is the equivalent of the Python statement \samp{\var{o1} *= \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceDivide}{PyObject *o1, ! PyObject *o2} ! Returns the result of dividing \var{o1} by \var{o2}, or \NULL{} on ! failure. The operation is done \emph{in-place} when \var{o1} supports ! it. This is the equivalent of the Python statement \samp{\var{o1} /= ! \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceFloorDivide}{PyObject *o1, ! PyObject *o2} ! Returns the mathematical of dividing \var{o1} by \var{o2}, or \NULL{} ! on failure. The operation is done \emph{in-place} when \var{o1} ! supports it. This is the equivalent of the Python statement ! \samp{\var{o1} //= \var{o2}}. ! \versionadded{2.2} ! \end{cfuncdesc} ! ! ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceTrueDivide}{PyObject *o1, ! PyObject *o2} ! Return a reasonable approximation for the mathematical value of ! \var{o1} divided by \var{o2}, or \NULL{} on failure. The return value ! is ``approximate'' because binary floating point numbers are ! approximate; it is not possible to represent all real numbers in base ! two. This function can return a floating point value when passed two ! integers. The operation is done \emph{in-place} when \var{o1} ! supports it. ! \versionadded{2.2} ! \end{cfuncdesc} ! ! ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceRemainder}{PyObject *o1, ! PyObject *o2} Returns the remainder of dividing \var{o1} by \var{o2}, or \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} supports it. ! This is the equivalent of the Python statement \samp{\var{o1} \%= \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlacePower}{PyObject *o1, ! PyObject *o2, PyObject *o3} ! See the built-in function \function{pow()}.\bifuncindex{pow} Returns ! \NULL{} on failure. The operation is done \emph{in-place} when ! \var{o1} supports it. This is the equivalent of the Python statement ! \samp{\var{o1} **= \var{o2}} when o3 is \cdata{Py_None}, or an ! in-place variant of \samp{pow(\var{o1}, \var{o2}, \var{o3})} ! otherwise. If \var{o3} is to be ignored, pass \cdata{Py_None} in its ! place (passing \NULL{} for \var{o3} would cause an illegal memory ! access). \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceLshift}{PyObject *o1, ! PyObject *o2} ! Returns the result of left shifting \var{o1} by \var{o2} on success, ! or \NULL{} on failure. The operation is done \emph{in-place} when ! \var{o1} supports it. This is the equivalent of the Python statement ! \samp{\var{o1} <\code{<=} \var{o2}}. \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceRshift}{PyObject *o1, ! PyObject *o2} ! Returns the result of right shifting \var{o1} by \var{o2} on success, ! or \NULL{} on failure. The operation is done \emph{in-place} when ! \var{o1} supports it. This is the equivalent of the Python statement ! \samp{\var{o1} >\code{>=} \var{o2}}. \end{cfuncdesc} *************** *** 1903,1907 **** Returns the ``bitwise and'' of \var{o1} and \var{o2} on success and \NULL{} on failure. The operation is done \emph{in-place} when ! \var{o1} supports it. This is the equivalent of the Python expression \samp{\var{o1} \&= \var{o2}}. \end{cfuncdesc} --- 1960,1964 ---- Returns the ``bitwise and'' of \var{o1} and \var{o2} on success and \NULL{} on failure. The operation is done \emph{in-place} when ! \var{o1} supports it. This is the equivalent of the Python statement \samp{\var{o1} \&= \var{o2}}. \end{cfuncdesc} *************** *** 1909,1923 **** \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceXor}{PyObject *o1, PyObject *o2} ! Returns the ``bitwise exclusive or'' of \var{o1} by \var{o2} on success, or ! \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} ! supports it. This is the equivalent of the Python expression \samp{\var{o1} ! \textasciicircum= \var{o2}}. \end{cfuncdesc} \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceOr}{PyObject *o1, PyObject *o2} ! Returns the ``bitwise or'' of \var{o1} and \var{o2} on success, or \NULL{} ! on failure. The operation is done \emph{in-place} when \var{o1} supports ! it. This is the equivalent of the Python expression \samp{\var{o1} |= ! \var{o2}}. \end{cfuncdesc} --- 1966,1980 ---- \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceXor}{PyObject *o1, PyObject *o2} ! Returns the ``bitwise exclusive or'' of \var{o1} by \var{o2} on ! success, or \NULL{} on failure. The operation is done \emph{in-place} ! when \var{o1} supports it. This is the equivalent of the Python ! statement \samp{\var{o1} \textasciicircum= \var{o2}}. \end{cfuncdesc} \begin{cfuncdesc}{PyObject*}{PyNumber_InPlaceOr}{PyObject *o1, PyObject *o2} ! Returns the ``bitwise or'' of \var{o1} and \var{o2} on success, or ! \NULL{} on failure. The operation is done \emph{in-place} when ! \var{o1} supports it. This is the equivalent of the Python statement ! \samp{\var{o1} |= \var{o2}}. \end{cfuncdesc} *************** *** 1986,1990 **** \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PySequence_InPlaceConcat}{PyObject *o1, PyObject *o2} Return the concatenation of \var{o1} and \var{o2} on success, and \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} supports it. --- 2043,2048 ---- \end{cfuncdesc} ! \begin{cfuncdesc}{PyObject*}{PySequence_InPlaceConcat}{PyObject *o1, ! PyObject *o2} Return the concatenation of \var{o1} and \var{o2} on success, and \NULL{} on failure. The operation is done \emph{in-place} when \var{o1} supports it. *************** *** 4798,4801 **** --- 4856,4891 ---- \cfunction{PyEval_SetProfile()}, except the tracing function does receive line-number events. + \end{cfuncdesc} + + + \section{Advanced Debugger Support \label{advanced-debugging}} + \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org} + + These functions are only intended to be used by advanced debugging + tools. + + \begin{cfuncdesc}{PyInterpreterState*}{PyInterpreterState_Head}{} + Return the interpreter state object at the head of the list of all + such objects. + \versionadded{2.2} + \end{cfuncdesc} + + \begin{cfuncdesc}{PyInterpreterState*}{PyInterpreterState_Next}{PyInterpreterState *interp} + Return the next interpreter state object after \var{interp} from the + list of all such objects. + \versionadded{2.2} + \end{cfuncdesc} + + \begin{cfuncdesc}{PyThreadState *}{PyInterpreterState_ThreadHead}{PyInterpreterState *interp} + Return the a pointer to the first \ctype{PyThreadState} object in the + list of threads associated with the interpreter \var{interp}. + \versionadded{2.2} + \end{cfuncdesc} + + \begin{cfuncdesc}{PyThreadState*}{PyThreadState_Next}{PyThreadState *tstate} + Return the next thread state object after \var{tstate} from the list + of all such objects belonging to the same \ctype{PyInterpreterState} + object. + \versionadded{2.2} \end{cfuncdesc} From tim_one@users.sourceforge.net Wed Aug 8 20:32:27 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 08 Aug 2001 12:32:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python.iss,1.4,1.5 python20.wse,1.75,1.76 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv5976/PCbuild Modified Files: python.iss python20.wse Log Message: Add the new Tools/compiler/README to the WIndows install, as README.txt. In the Wise installer's "Advanced Options" dialog, substitute in the actual name of "the system directory" -- this is clearer, and especially for people reading this dialog who aren't me . Index: python.iss =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python.iss,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** python.iss 2001/07/28 07:56:38 1.4 --- python.iss 2001/08/08 19:32:25 1.5 *************** *** 190,196 **** Source: Tools\idle\Icons\*.*; DestDir: "{app}\Tools\idle\Icons"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\*.py; DestDir: "{app}\Tools\compiler"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\compiler\*.py; DestDir: "{app}\Tools\compiler\compiler"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\compiler\*.txt; DestDir: "{app}\Tools\compiler\compiler"; CopyMode: alwaysoverwrite; Components: tools Source: Tools\pynche\*.py; DestDir: "{app}\Tools\pynche"; CopyMode: alwaysoverwrite; Components: tools --- 190,197 ---- Source: Tools\idle\Icons\*.*; DestDir: "{app}\Tools\idle\Icons"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\*.py; DestDir: "{app}\Tools\compiler"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\README; DestDir: "{app}\Tools\compiler"; DestName: README.txt; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\compiler\*.py; DestDir: "{app}\Tools\compiler\compiler"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\compiler\*.txt; DestDir: "{app}\Tools\compiler\compiler"; CopyMode: alwaysoverwrite; Components: tools Source: Tools\pynche\*.py; DestDir: "{app}\Tools\pynche"; CopyMode: alwaysoverwrite; Components: tools Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** python20.wse 2001/08/06 20:01:19 1.75 --- python20.wse 2001/08/08 19:32:25 1.76 *************** *** 1070,1074 **** Enabled Color=00000000000000001111111111111111 Create Flags=01010000000000000000000000000000 ! Text=By default, the install records settings in the per-machine area of the registry (HKLM), and installs the Python and C runtime DLLs to the system directory. Choose "Non-Admin install" if you would prefer settings made in the per-user registry (HKCU), and DLLs installed in %MAINDIR%. end item: Static --- 1070,1074 ---- Enabled Color=00000000000000001111111111111111 Create Flags=01010000000000000000000000000000 ! Text=By default, the install records settings in the per-machine area of the registry (HKLM), and installs the Python and C runtime DLLs to %SYS32%. Choose "Non-Admin install" if you would prefer settings made in the per-user registry (HKCU), and DLLs installed in %MAINDIR%. end item: Static *************** *** 2047,2050 **** --- 2047,2056 ---- Source=..\tools\compiler\*.py Destination=%MAINDIR%\Tools\compiler + Description=Python compiler written in Python + Flags=0000000000000010 + end + item: Install File + Source=..\tools\compiler\README + Destination=%MAINDIR%\Tools\compiler\README.txt Description=Python compiler written in Python Flags=0000000000000010 From loewis@users.sourceforge.net Wed Aug 8 21:26:16 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 08 Aug 2001 13:26:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/idle setup.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/idle In directory usw-pr-cvs1:/tmp/cvs-serv19250 Modified Files: setup.py Log Message: Patch #422471: Install IDLE Help File Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/idle/setup.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** setup.py 2001/02/09 21:23:21 1.2 --- setup.py 2001/08/08 20:26:14 1.3 *************** *** 9,13 **** # the normal build_py would not incorporate the .txt files ! txt_files = ['config-unix.txt','config-win.txt','config.txt'] Icons = glob.glob1("Icons","*.gif") class idle_build_py(build_py): --- 9,13 ---- # the normal build_py would not incorporate the .txt files ! txt_files = ['config-unix.txt','config-win.txt','config.txt', 'help.txt'] Icons = glob.glob1("Icons","*.gif") class idle_build_py(build_py): From tim_one@users.sourceforge.net Wed Aug 8 21:50:09 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 08 Aug 2001 13:50:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.101,1.102 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv24262/python/dist/src/Misc Modified Files: ACKS Log Message: Thanks to LettError, Erik van Blokland, http://www.letterror.com/ the Python Windows installer finally has an attractive Pythonic bitmap to delight the senses and dampen the fears of the millions and millions of eager new Windows users anticipating their first Python programming joy. Always knew Mac users secretly wanted to switch to Windows . Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** ACKS 2001/08/04 08:12:36 1.101 --- ACKS 2001/08/08 20:50:07 1.102 *************** *** 335,338 **** --- 335,339 ---- Craig Rowland Jim Roskind + Erik van Blokland Just van Rossum Hugo van Rossum From tim_one@users.sourceforge.net Wed Aug 8 21:50:09 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 08 Aug 2001 13:50:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild installer.bmp,NONE,1.1 python20.wse,1.76,1.77 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv24262/python/dist/src/PCbuild Modified Files: python20.wse Added Files: installer.bmp Log Message: Thanks to LettError, Erik van Blokland, http://www.letterror.com/ the Python Windows installer finally has an attractive Pythonic bitmap to delight the senses and dampen the fears of the millions and millions of eager new Windows users anticipating their first Python programming joy. Always knew Mac users secretly wanted to switch to Windows . --- NEW FILE: installer.bmp --- BM ƒ U-ð ‰8 ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ....................2ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** python20.wse 2001/08/08 19:32:25 1.76 --- python20.wse 2001/08/08 20:50:07 1.77 *************** *** 324,331 **** Direction Variable=DIRECTION Display Variable=DISPLAY ! Bitmap Pathname=%_WISE_%\Dialogs\Template\Wizard.bmp X Position=9 Y Position=10 ! Filler Color=8421440 Dialog=Select Destination Directory Dialog=Backup Replaced Files --- 324,331 ---- Direction Variable=DIRECTION Display Variable=DISPLAY ! Bitmap Pathname=.\installer.bmp X Position=9 Y Position=10 ! Filler Color=11173759 Dialog=Select Destination Directory Dialog=Backup Replaced Files *************** *** 2736,2743 **** Direction Variable=DIRECTION Display Variable=DISPLAY ! Bitmap Pathname=%_WISE_%\DIALOGS\TEMPLATE\WIZARD.BMP X Position=9 Y Position=10 ! Filler Color=8421440 Flags=00000011 end --- 2736,2743 ---- Direction Variable=DIRECTION Display Variable=DISPLAY ! Bitmap Pathname=.\installer.bmp X Position=9 Y Position=10 ! Filler Color=11173759 Flags=00000011 end From gward@users.sourceforge.net Wed Aug 8 21:55:12 2001 From: gward@users.sourceforge.net (Greg Ward) Date: Wed, 08 Aug 2001 13:55:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib macpath.py,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25373 Modified Files: macpath.py Log Message: Typo fix (spelling mistake in error message). Index: macpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/macpath.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** macpath.py 2001/01/24 06:27:27 1.28 --- macpath.py 2001/08/08 20:55:10 1.29 *************** *** 189,193 **** else: # best way to handle this is to raise an exception ! raise norm_error, 'Cannot use :: immedeately after volume name' else: i = i + 1 --- 189,193 ---- else: # best way to handle this is to raise an exception ! raise norm_error, 'Cannot use :: immediately after volume name' else: i = i + 1 From thomas@xs4all.net Wed Aug 8 22:24:22 2001 From: thomas@xs4all.net (Thomas Wouters) Date: Wed, 8 Aug 2001 23:24:22 +0200 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.101,1.102 In-Reply-To: References: Message-ID: <20010808232422.C874@xs4all.nl> On Wed, Aug 08, 2001 at 01:50:09PM -0700, Tim Peters wrote: > Always knew Mac users secretly wanted to switch to Windows . Ah, but if you look closely (or indeed 'at all') at the logo, you'll see that the laptop is actually a iBook... all those curvey lines :) -- Thomas Wouters Hi! I'm a .signature virus! copy me into your .signature file to help me spread! From tim.one@home.com Wed Aug 8 22:39:03 2001 From: tim.one@home.com (Tim Peters) Date: Wed, 8 Aug 2001 17:39:03 -0400 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.101,1.102 In-Reply-To: <20010808232422.C874@xs4all.nl> Message-ID: > Ah, but if you look closely (or indeed 'at all') at the logo, you'll see > that the laptop is actually a iBook... all those curvey lines :) Hmm. According to Erik's graphical partner Just: Erik actually when through great lengths to make that laptop *not* look like a PowerBook! It's all art to me . From jackjansen@users.sourceforge.net Wed Aug 8 22:57:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 14:57:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/OSXResources - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSXResources In directory usw-pr-cvs1:/tmp/cvs-serv7717/OSXResources Log Message: Directory /cvsroot/python/python/dist/src/Mac/OSXResources added to the repository From jackjansen@users.sourceforge.net Wed Aug 8 22:58:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 14:58:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/OSXResources/app - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSXResources/app In directory usw-pr-cvs1:/tmp/cvs-serv8011/app Log Message: Directory /cvsroot/python/python/dist/src/Mac/OSXResources/app added to the repository From jackjansen@users.sourceforge.net Wed Aug 8 22:58:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 14:58:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/OSXResources/framework - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSXResources/framework In directory usw-pr-cvs1:/tmp/cvs-serv8011/framework Log Message: Directory /cvsroot/python/python/dist/src/Mac/OSXResources/framework added to the repository From jackjansen@users.sourceforge.net Wed Aug 8 22:58:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 14:58:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/OSXResources/framework/English.lproj - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSXResources/framework/English.lproj In directory usw-pr-cvs1:/tmp/cvs-serv8116/English.lproj Log Message: Directory /cvsroot/python/python/dist/src/Mac/OSXResources/framework/English.lproj added to the repository From jackjansen@users.sourceforge.net Wed Aug 8 23:00:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 15:00:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/OSXResources/framework Info.plist,NONE,1.1 version.plist,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSXResources/framework In directory usw-pr-cvs1:/tmp/cvs-serv8262/framework Added Files: Info.plist version.plist Log Message: Resource files for OSX Python.framework. Incomplete, and they should probably eventually be generated so version numbers and such are automatically correct, but they do the job for now. --- NEW FILE: Info.plist --- CFBundleDevelopmentRegion English CFBundleExecutable Python CFBundleGetInfoString Python Runtime and Library CFBundleIdentifier org.python.python CFBundleInfoDictionaryVersion 6.0 CFBundleName Python CFBundlePackageType FMWK CFBundleShortVersionString 2.2a1 CFBundleSignature ???? CFBundleVersion vecLib 1.1-4 --- NEW FILE: version.plist --- BuildVersion 1 CFBundleShortVersionString 2.2a1 CFBundleVersion Python 2.2a1 ProjectName Python ReleaseStatus alfa SourceVersion 2.2a1 From jackjansen@users.sourceforge.net Wed Aug 8 23:00:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 08 Aug 2001 15:00:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/OSXResources/framework/English.lproj InfoPlist.strings,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSXResources/framework/English.lproj In directory usw-pr-cvs1:/tmp/cvs-serv8262/framework/English.lproj Added Files: InfoPlist.strings Log Message: Resource files for OSX Python.framework. Incomplete, and they should probably eventually be generated so version numbers and such are automatically correct, but they do the job for now. --- NEW FILE: InfoPlist.strings --- /* Localized versions of Info.plist keys */ CFBundleName = "Python"; CFBundleShortVersionString = "2.2a1"; CFBundleGetInfoString = "Python Runtime and Library"; From gvanrossum@users.sourceforge.net Wed Aug 8 23:26:24 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 08 Aug 2001 15:26:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.24,2.25 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv14159 Modified Files: typeobject.c Log Message: Proper support for binary operators, including true division and floor division. The basic binary operators now all correctly call the __rxxx__ variant when they should. In type_new(), I now make the new type a new-style number unless it inherits from an old-style number that has numeric methods. By way of cosmetics, I've changed the signatures of the SLOT macros to take actual function names and operator names as strings, rather than rely on C preprocessor symbol manipulations. This makes the calls slightly more verbose, but greatly helps simple searches through the file: you can now find out where "__radd__" is used or where the function slot_nb_power() is defined and where it is used. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -d -r2.24 -r2.25 *** typeobject.c 2001/08/08 15:29:49 2.24 --- typeobject.c 2001/08/08 22:26:22 2.25 *************** *** 584,592 **** et->slots = slots; ! /* Initialize essential fields */ type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE | Py_TPFLAGS_BASETYPE; if (dynamic) type->tp_flags |= Py_TPFLAGS_DYNAMICTYPE; type->tp_as_number = &et->as_number; type->tp_as_sequence = &et->as_sequence; --- 584,600 ---- et->slots = slots; ! /* Initialize tp_flags */ type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE | Py_TPFLAGS_BASETYPE; if (dynamic) type->tp_flags |= Py_TPFLAGS_DYNAMICTYPE; + + /* It's a new-style number unless it specifically inherits any + old-style numeric behavior */ + if ((base->tp_flags & Py_TPFLAGS_CHECKTYPES) || + (base->tp_as_number == NULL)) + type->tp_flags |= Py_TPFLAGS_CHECKTYPES; + + /* Initialize essential fields */ type->tp_as_number = &et->as_number; type->tp_as_sequence = &et->as_sequence; *************** *** 1045,1048 **** --- 1053,1062 ---- COPYNUM(nb_inplace_xor); COPYNUM(nb_inplace_or); + if (base->tp_flags & Py_TPFLAGS_CHECKTYPES) { + COPYNUM(nb_true_divide); + COPYNUM(nb_floor_divide); + COPYNUM(nb_inplace_true_divide); + COPYNUM(nb_inplace_floor_divide); + } } *************** *** 2014,2037 **** below at override_slots() for more explanation. */ ! #define SLOT0(SLOTNAME, OPNAME) \ static PyObject * \ ! slot_##SLOTNAME(PyObject *self) \ { \ ! return PyObject_CallMethod(self, "__" #OPNAME "__", ""); \ } ! #define SLOT1(SLOTNAME, OPNAME, ARG1TYPE, ARGCODES) \ static PyObject * \ ! slot_##SLOTNAME(PyObject *self, ARG1TYPE arg1) \ { \ ! return PyObject_CallMethod(self, "__" #OPNAME "__", #ARGCODES, arg1); \ } ! #define SLOT2(SLOTNAME, OPNAME, ARG1TYPE, ARG2TYPE, ARGCODES) \ static PyObject * \ ! slot_##SLOTNAME(PyObject *self, ARG1TYPE arg1, ARG2TYPE arg2) \ { \ ! return PyObject_CallMethod(self, "__" #OPNAME "__", \ ! #ARGCODES, arg1, arg2); \ } --- 2028,2077 ---- below at override_slots() for more explanation. */ ! #define SLOT0(FUNCNAME, OPSTR) \ static PyObject * \ ! FUNCNAME(PyObject *self) \ { \ ! return PyObject_CallMethod(self, OPSTR, ""); \ } ! #define SLOT1(FUNCNAME, OPSTR, ARG1TYPE, ARGCODES) \ static PyObject * \ ! FUNCNAME(PyObject *self, ARG1TYPE arg1) \ { \ ! return PyObject_CallMethod(self, OPSTR, ARGCODES, arg1); \ } ! ! #define SLOT1BINFULL(FUNCNAME, TESTFUNC, SLOTNAME, OPSTR, ROPSTR) \ static PyObject * \ ! FUNCNAME(PyObject *self, PyObject *other) \ { \ ! if (self->ob_type->tp_as_number != NULL && \ ! self->ob_type->tp_as_number->SLOTNAME == TESTFUNC) { \ ! PyObject *r; \ ! r = PyObject_CallMethod( \ ! self, OPSTR, "O", other); \ ! if (r != Py_NotImplemented || \ ! other->ob_type == self->ob_type) \ ! return r; \ ! Py_DECREF(r); \ ! } \ ! if (other->ob_type->tp_as_number != NULL && \ ! other->ob_type->tp_as_number->SLOTNAME == TESTFUNC) { \ ! return PyObject_CallMethod( \ ! other, ROPSTR, "O", self); \ ! } \ ! Py_INCREF(Py_NotImplemented); \ ! return Py_NotImplemented; \ ! } ! ! #define SLOT1BIN(FUNCNAME, SLOTNAME, OPSTR, ROPSTR) \ ! SLOT1BINFULL(FUNCNAME, FUNCNAME, SLOTNAME, OPSTR, ROPSTR) ! ! #define SLOT2(FUNCNAME, OPSTR, ARG1TYPE, ARG2TYPE, ARGCODES) \ ! static PyObject * \ ! FUNCNAME(PyObject *self, ARG1TYPE arg1, ARG2TYPE arg2) \ ! { \ ! return PyObject_CallMethod(self, OPSTR, ARGCODES, arg1, arg2); \ } *************** *** 2046,2053 **** } ! SLOT1(sq_concat, add, PyObject *, O) ! SLOT1(sq_repeat, mul, int, i) ! SLOT1(sq_item, getitem, int, i) ! SLOT2(sq_slice, getslice, int, int, ii) static int --- 2086,2093 ---- } ! SLOT1(slot_sq_concat, "__add__", PyObject *, "O") ! SLOT1(slot_sq_repeat, "__mul__", int, "i") ! SLOT1(slot_sq_item, "__getitem__", int, "i") ! SLOT2(slot_sq_slice, "__getslice__", int, int, "ii") static int *************** *** 2096,2105 **** } ! SLOT1(sq_inplace_concat, iadd, PyObject *, O) ! SLOT1(sq_inplace_repeat, imul, int, i) #define slot_mp_length slot_sq_length ! SLOT1(mp_subscript, getitem, PyObject *, O) static int --- 2136,2145 ---- } ! SLOT1(slot_sq_inplace_concat, "__iadd__", PyObject *, "O") ! SLOT1(slot_sq_inplace_repeat, "__imul__", int, "i") #define slot_mp_length slot_sq_length ! SLOT1(slot_mp_subscript, "__getitem__", PyObject *, "O") static int *************** *** 2119,2135 **** } ! /* XXX the numerical slots should call the reverse operators too; ! but how do they know their type? */ ! SLOT1(nb_add, add, PyObject *, O) ! SLOT1(nb_subtract, sub, PyObject *, O) ! SLOT1(nb_multiply, mul, PyObject *, O) ! SLOT1(nb_divide, div, PyObject *, O) ! SLOT1(nb_remainder, mod, PyObject *, O) ! SLOT1(nb_divmod, divmod, PyObject *, O) ! SLOT2(nb_power, pow, PyObject *, PyObject *, OO) ! SLOT0(nb_negative, neg) ! SLOT0(nb_positive, pos) ! SLOT0(nb_absolute, abs) static int slot_nb_nonzero(PyObject *self) --- 2159,2187 ---- } ! SLOT1BIN(slot_nb_add, nb_add, "__add__", "__radd__") ! SLOT1BIN(slot_nb_subtract, nb_subtract, "__sub__", "__rsub__") ! SLOT1BIN(slot_nb_multiply, nb_multiply, "__mul__", "__rmul__") ! SLOT1BIN(slot_nb_divide, nb_divide, "__div__", "__rdiv__") ! SLOT1BIN(slot_nb_remainder, nb_remainder, "__mod__", "__rmod__") ! SLOT1BIN(slot_nb_divmod, nb_divmod, "__divmod__", "__rdivmod__") ! ! staticforward PyObject *slot_nb_power(PyObject *, PyObject *, PyObject *); ! ! SLOT1BINFULL(slot_nb_power_binary, slot_nb_power, ! nb_power, "__pow__", "__rpow__") + static PyObject * + slot_nb_power(PyObject *self, PyObject *other, PyObject *modulus) + { + if (modulus == Py_None) + return slot_nb_power_binary(self, other); + /* Three-arg power doesn't use __rpow__ */ + return PyObject_CallMethod(self, "__pow__", "OO", other, modulus); + } + + SLOT0(slot_nb_negative, "__neg__") + SLOT0(slot_nb_positive, "__pos__") + SLOT0(slot_nb_absolute, "__abs__") + static int slot_nb_nonzero(PyObject *self) *************** *** 2142,2168 **** } ! SLOT0(nb_invert, invert) ! SLOT1(nb_lshift, lshift, PyObject *, O) ! SLOT1(nb_rshift, rshift, PyObject *, O) ! SLOT1(nb_and, and, PyObject *, O) ! SLOT1(nb_xor, xor, PyObject *, O) ! SLOT1(nb_or, or, PyObject *, O) /* Not coerce() */ ! SLOT0(nb_int, int) ! SLOT0(nb_long, long) ! SLOT0(nb_float, float) ! SLOT0(nb_oct, oct) ! SLOT0(nb_hex, hex) ! SLOT1(nb_inplace_add, iadd, PyObject *, O) ! SLOT1(nb_inplace_subtract, isub, PyObject *, O) ! SLOT1(nb_inplace_multiply, imul, PyObject *, O) ! SLOT1(nb_inplace_divide, idiv, PyObject *, O) ! SLOT1(nb_inplace_remainder, imod, PyObject *, O) ! SLOT2(nb_inplace_power, ipow, PyObject *, PyObject *, OO) ! SLOT1(nb_inplace_lshift, ilshift, PyObject *, O) ! SLOT1(nb_inplace_rshift, irshift, PyObject *, O) ! SLOT1(nb_inplace_and, iand, PyObject *, O) ! SLOT1(nb_inplace_xor, ixor, PyObject *, O) ! SLOT1(nb_inplace_or, ior, PyObject *, O) static int --- 2194,2225 ---- } ! SLOT0(slot_nb_invert, "__invert__") ! SLOT1BIN(slot_nb_lshift, nb_lshift, "__lshift__", "__rlshift__") ! SLOT1BIN(slot_nb_rshift, nb_rshift, "__rshift__", "__rrshift__") ! SLOT1BIN(slot_nb_and, nb_and, "__and__", "__rand__") ! SLOT1BIN(slot_nb_xor, nb_xor, "__xor__", "__rxor__") ! SLOT1BIN(slot_nb_or, nb_or, "__or__", "__ror__") /* Not coerce() */ ! SLOT0(slot_nb_int, "__int__") ! SLOT0(slot_nb_long, "__long__") ! SLOT0(slot_nb_float, "__float__") ! SLOT0(slot_nb_oct, "__oct__") ! SLOT0(slot_nb_hex, "__hex__") ! SLOT1(slot_nb_inplace_add, "__iadd__", PyObject *, "O") ! SLOT1(slot_nb_inplace_subtract, "__isub__", PyObject *, "O") ! SLOT1(slot_nb_inplace_multiply, "__imul__", PyObject *, "O") ! SLOT1(slot_nb_inplace_divide, "__idiv__", PyObject *, "O") ! SLOT1(slot_nb_inplace_remainder, "__imod__", PyObject *, "O") ! SLOT2(slot_nb_inplace_power, "__ipow__", PyObject *, PyObject *, "OO") ! SLOT1(slot_nb_inplace_lshift, "__ilshift__", PyObject *, "O") ! SLOT1(slot_nb_inplace_rshift, "__irshift__", PyObject *, "O") ! SLOT1(slot_nb_inplace_and, "__iand__", PyObject *, "O") ! SLOT1(slot_nb_inplace_xor, "__ixor__", PyObject *, "O") ! SLOT1(slot_nb_inplace_or, "__ior__", PyObject *, "O") ! SLOT1BIN(slot_nb_floor_divide, nb_floor_divide, ! "__floordiv__", "__rfloordiv__") ! SLOT1BIN(slot_nb_true_divide, nb_true_divide, "__truediv__", "__rtruediv__") ! SLOT1(slot_nb_inplace_floor_divide, "__ifloordiv__", PyObject *, "O") ! SLOT1(slot_nb_inplace_true_divide, "__itruediv__", PyObject *, "O") static int *************** *** 2179,2183 **** } ! SLOT0(tp_repr, repr) static long --- 2236,2240 ---- } ! SLOT0(slot_tp_repr, "__repr__") static long *************** *** 2208,2212 **** } ! SLOT0(tp_str, str) static PyObject * --- 2265,2269 ---- } ! SLOT0(slot_tp_str, "__str__") static PyObject * *************** *** 2272,2276 **** } ! SLOT0(tp_iter, iter) static PyObject * --- 2329,2333 ---- } ! SLOT0(slot_tp_iter, "__iter__") static PyObject * *************** *** 2280,2284 **** } ! SLOT2(tp_descr_get, get, PyObject *, PyObject *, OO) static int --- 2337,2341 ---- } ! SLOT2(slot_tp_descr_get, "__get__", PyObject *, PyObject *, "OO") static int *************** *** 2358,2433 **** PyNumberMethods *nb = type->tp_as_number; ! #define SQSLOT(OPNAME, SLOTNAME) \ if (PyDict_GetItemString(dict, OPNAME)) { \ ! sq->SLOTNAME = slot_##SLOTNAME; \ } ! #define MPSLOT(OPNAME, SLOTNAME) \ if (PyDict_GetItemString(dict, OPNAME)) { \ ! mp->SLOTNAME = slot_##SLOTNAME; \ } ! #define NBSLOT(OPNAME, SLOTNAME) \ if (PyDict_GetItemString(dict, OPNAME)) { \ ! nb->SLOTNAME = slot_##SLOTNAME; \ } ! #define TPSLOT(OPNAME, SLOTNAME) \ if (PyDict_GetItemString(dict, OPNAME)) { \ ! type->SLOTNAME = slot_##SLOTNAME; \ } ! SQSLOT("__len__", sq_length); ! SQSLOT("__add__", sq_concat); ! SQSLOT("__mul__", sq_repeat); ! SQSLOT("__getitem__", sq_item); ! SQSLOT("__getslice__", sq_slice); ! SQSLOT("__setitem__", sq_ass_item); ! SQSLOT("__delitem__", sq_ass_item); ! SQSLOT("__setslice__", sq_ass_slice); ! SQSLOT("__delslice__", sq_ass_slice); ! SQSLOT("__contains__", sq_contains); ! SQSLOT("__iadd__", sq_inplace_concat); ! SQSLOT("__imul__", sq_inplace_repeat); ! MPSLOT("__len__", mp_length); ! MPSLOT("__getitem__", mp_subscript); ! MPSLOT("__setitem__", mp_ass_subscript); ! MPSLOT("__delitem__", mp_ass_subscript); ! NBSLOT("__add__", nb_add); ! NBSLOT("__sub__", nb_subtract); ! NBSLOT("__mul__", nb_multiply); ! NBSLOT("__div__", nb_divide); ! NBSLOT("__mod__", nb_remainder); ! NBSLOT("__divmod__", nb_divmod); ! NBSLOT("__pow__", nb_power); ! NBSLOT("__neg__", nb_negative); ! NBSLOT("__pos__", nb_positive); ! NBSLOT("__abs__", nb_absolute); ! NBSLOT("__nonzero__", nb_nonzero); ! NBSLOT("__invert__", nb_invert); ! NBSLOT("__lshift__", nb_lshift); ! NBSLOT("__rshift__", nb_rshift); ! NBSLOT("__and__", nb_and); ! NBSLOT("__xor__", nb_xor); ! NBSLOT("__or__", nb_or); /* Not coerce() */ ! NBSLOT("__int__", nb_int); ! NBSLOT("__long__", nb_long); ! NBSLOT("__float__", nb_float); ! NBSLOT("__oct__", nb_oct); ! NBSLOT("__hex__", nb_hex); ! NBSLOT("__iadd__", nb_inplace_add); ! NBSLOT("__isub__", nb_inplace_subtract); ! NBSLOT("__imul__", nb_inplace_multiply); ! NBSLOT("__idiv__", nb_inplace_divide); ! NBSLOT("__imod__", nb_inplace_remainder); ! NBSLOT("__ipow__", nb_inplace_power); ! NBSLOT("__ilshift__", nb_inplace_lshift); ! NBSLOT("__irshift__", nb_inplace_rshift); ! NBSLOT("__iand__", nb_inplace_and); ! NBSLOT("__ixor__", nb_inplace_xor); ! NBSLOT("__ior__", nb_inplace_or); if (PyDict_GetItemString(dict, "__str__") || --- 2415,2496 ---- PyNumberMethods *nb = type->tp_as_number; ! #define SQSLOT(OPNAME, SLOTNAME, FUNCNAME) \ if (PyDict_GetItemString(dict, OPNAME)) { \ ! sq->SLOTNAME = FUNCNAME; \ } ! #define MPSLOT(OPNAME, SLOTNAME, FUNCNAME) \ if (PyDict_GetItemString(dict, OPNAME)) { \ ! mp->SLOTNAME = FUNCNAME; \ } ! #define NBSLOT(OPNAME, SLOTNAME, FUNCNAME) \ if (PyDict_GetItemString(dict, OPNAME)) { \ ! nb->SLOTNAME = FUNCNAME; \ } ! #define TPSLOT(OPNAME, SLOTNAME, FUNCNAME) \ if (PyDict_GetItemString(dict, OPNAME)) { \ ! type->SLOTNAME = FUNCNAME; \ } ! SQSLOT("__len__", sq_length, slot_sq_length); ! SQSLOT("__add__", sq_concat, slot_sq_concat); ! SQSLOT("__mul__", sq_repeat, slot_sq_repeat); ! SQSLOT("__getitem__", sq_item, slot_sq_item); ! SQSLOT("__getslice__", sq_slice, slot_sq_slice); ! SQSLOT("__setitem__", sq_ass_item, slot_sq_ass_item); ! SQSLOT("__delitem__", sq_ass_item, slot_sq_ass_item); ! SQSLOT("__setslice__", sq_ass_slice, slot_sq_ass_slice); ! SQSLOT("__delslice__", sq_ass_slice, slot_sq_ass_slice); ! SQSLOT("__contains__", sq_contains, slot_sq_contains); ! SQSLOT("__iadd__", sq_inplace_concat, slot_sq_inplace_concat); ! SQSLOT("__imul__", sq_inplace_repeat, slot_sq_inplace_repeat); ! MPSLOT("__len__", mp_length, slot_mp_length); ! MPSLOT("__getitem__", mp_subscript, slot_mp_subscript); ! MPSLOT("__setitem__", mp_ass_subscript, slot_mp_ass_subscript); ! MPSLOT("__delitem__", mp_ass_subscript, slot_mp_ass_subscript); ! NBSLOT("__add__", nb_add, slot_nb_add); ! NBSLOT("__sub__", nb_subtract, slot_nb_subtract); ! NBSLOT("__mul__", nb_multiply, slot_nb_multiply); ! NBSLOT("__div__", nb_divide, slot_nb_divide); ! NBSLOT("__mod__", nb_remainder, slot_nb_remainder); ! NBSLOT("__divmod__", nb_divmod, slot_nb_divmod); ! NBSLOT("__pow__", nb_power, slot_nb_power); ! NBSLOT("__neg__", nb_negative, slot_nb_negative); ! NBSLOT("__pos__", nb_positive, slot_nb_positive); ! NBSLOT("__abs__", nb_absolute, slot_nb_absolute); ! NBSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero); ! NBSLOT("__invert__", nb_invert, slot_nb_invert); ! NBSLOT("__lshift__", nb_lshift, slot_nb_lshift); ! NBSLOT("__rshift__", nb_rshift, slot_nb_rshift); ! NBSLOT("__and__", nb_and, slot_nb_and); ! NBSLOT("__xor__", nb_xor, slot_nb_xor); ! NBSLOT("__or__", nb_or, slot_nb_or); /* Not coerce() */ ! NBSLOT("__int__", nb_int, slot_nb_int); ! NBSLOT("__long__", nb_long, slot_nb_long); ! NBSLOT("__float__", nb_float, slot_nb_float); ! NBSLOT("__oct__", nb_oct, slot_nb_oct); ! NBSLOT("__hex__", nb_hex, slot_nb_hex); ! NBSLOT("__iadd__", nb_inplace_add, slot_nb_inplace_add); ! NBSLOT("__isub__", nb_inplace_subtract, slot_nb_inplace_subtract); ! NBSLOT("__imul__", nb_inplace_multiply, slot_nb_inplace_multiply); ! NBSLOT("__idiv__", nb_inplace_divide, slot_nb_inplace_divide); ! NBSLOT("__imod__", nb_inplace_remainder, slot_nb_inplace_remainder); ! NBSLOT("__ipow__", nb_inplace_power, slot_nb_inplace_power); ! NBSLOT("__ilshift__", nb_inplace_lshift, slot_nb_inplace_lshift); ! NBSLOT("__irshift__", nb_inplace_rshift, slot_nb_inplace_rshift); ! NBSLOT("__iand__", nb_inplace_and, slot_nb_inplace_and); ! NBSLOT("__ixor__", nb_inplace_xor, slot_nb_inplace_xor); ! NBSLOT("__ior__", nb_inplace_or, slot_nb_inplace_or); ! NBSLOT("__floordiv__", nb_floor_divide, slot_nb_floor_divide); ! NBSLOT("__truediv__", nb_true_divide, slot_nb_true_divide); ! NBSLOT("__ifloordiv__", nb_inplace_floor_divide, ! slot_nb_inplace_floor_divide); ! NBSLOT("__itruediv__", nb_inplace_true_divide, ! slot_nb_inplace_true_divide); if (PyDict_GetItemString(dict, "__str__") || *************** *** 2435,2456 **** type->tp_print = NULL; ! TPSLOT("__cmp__", tp_compare); ! TPSLOT("__repr__", tp_repr); ! TPSLOT("__hash__", tp_hash); ! TPSLOT("__call__", tp_call); ! TPSLOT("__str__", tp_str); ! TPSLOT("__getattr__", tp_getattro); ! TPSLOT("__setattr__", tp_setattro); ! TPSLOT("__lt__", tp_richcompare); ! TPSLOT("__le__", tp_richcompare); ! TPSLOT("__eq__", tp_richcompare); ! TPSLOT("__ne__", tp_richcompare); ! TPSLOT("__gt__", tp_richcompare); ! TPSLOT("__ge__", tp_richcompare); ! TPSLOT("__iter__", tp_iter); ! TPSLOT("next", tp_iternext); ! TPSLOT("__get__", tp_descr_get); ! TPSLOT("__set__", tp_descr_set); ! TPSLOT("__init__", tp_init); ! TPSLOT("__new__", tp_new); } --- 2498,2519 ---- type->tp_print = NULL; ! TPSLOT("__cmp__", tp_compare, slot_tp_compare); ! TPSLOT("__repr__", tp_repr, slot_tp_repr); ! TPSLOT("__hash__", tp_hash, slot_tp_hash); ! TPSLOT("__call__", tp_call, slot_tp_call); ! TPSLOT("__str__", tp_str, slot_tp_str); ! TPSLOT("__getattr__", tp_getattro, slot_tp_getattro); ! TPSLOT("__setattr__", tp_setattro, slot_tp_setattro); ! TPSLOT("__lt__", tp_richcompare, slot_tp_richcompare); ! TPSLOT("__le__", tp_richcompare, slot_tp_richcompare); ! TPSLOT("__eq__", tp_richcompare, slot_tp_richcompare); ! TPSLOT("__ne__", tp_richcompare, slot_tp_richcompare); ! TPSLOT("__gt__", tp_richcompare, slot_tp_richcompare); ! TPSLOT("__ge__", tp_richcompare, slot_tp_richcompare); ! TPSLOT("__iter__", tp_iter, slot_tp_iter); ! TPSLOT("next", tp_iternext, slot_tp_iternext); ! TPSLOT("__get__", tp_descr_get, slot_tp_descr_get); ! TPSLOT("__set__", tp_descr_set, slot_tp_descr_set); ! TPSLOT("__init__", tp_init, slot_tp_init); ! TPSLOT("__new__", tp_new, slot_tp_new); } From gvanrossum@users.sourceforge.net Wed Aug 8 23:27:22 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 08 Aug 2001 15:27:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_binop.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14378 Added Files: test_binop.py Log Message: A test suite for binary operators, disguised as a rational number class. --- NEW FILE: test_binop.py --- """Tests for binary operators on subtypes of built-in types.""" import test_support import unittest class getset(object): """Define a get/set attribute descriptor. This will eventually become a built-in.""" def __init__(self, get, set=None): self.__get = get self.__set = set def __get__(self, inst, type=None): return self.__get(inst) def __set__(self, inst, value): if self.__set is None: raise AttributeError, "this attribute is read-only" return self.__set(inst, value) def gcd(a, b): """Greatest common divisor using Euclid's algorithm.""" while a: a, b = b%a, a return b def isint(x): """Test whether an object is an instance of int or long.""" return isinstance(x, int) or isinstance(x, long) def isnum(x): """Test whether an object is an instance of a built-in numeric type.""" for T in int, long, float, complex: if isinstance(x, T): return 1 return 0 def isRat(x): """Test wheter an object is an instance of the Rat class.""" return isinstance(x, Rat) class Rat(object): """Rational number implemented as a normalized pair of longs.""" __slots__ = ['_Rat__num', '_Rat__den'] def __init__(self, num=0L, den=1L): """Constructor: Rat([num[, den]]). The arguments must be ints or longs, and default to (0, 1).""" if not isint(num): raise TypeError, "Rat numerator must be int or long (%r)" % num if not isint(den): raise TypeError, "Rat denominator must be int or long (%r)" % den # But the zero is always on if den == 0: raise ZeroDivisionError, "zero denominator" g = gcd(den, num) self.__num = long(num/g) self.__den = long(den/g) def _get_num(self): """Accessor function for read-only 'num' attribute of Rat.""" return self.__num num = getset(_get_num, None) def _get_den(self): """Accessor function for read-only 'den' attribute of Rat.""" return self.__den den = getset(_get_den, None) def __repr__(self): """Convert a Rat to an string resembling a Rat constructor call.""" return "Rat(%d, %d)" % (self.__num, self.__den) def __str__(self): """Convert a Rat to a string resembling a decimal numeric value.""" return str(float(self)) def __float__(self): """Convert a Rat to a float.""" return self.__num*1.0/self.__den def __int__(self): """Convert a Rat to an int; self.den must be 1.""" if self.__den == 1: try: return int(self.__num) except OverflowError: raise OverflowError, ("%s too large to convert to int" % repr(self)) raise ValueError, "can't convert %s to int" % repr(self) def __long__(self): """Convert a Rat to an long; self.den must be 1.""" if self.__den == 1: return long(self.__num) raise ValueError, "can't convert %s to long" % repr(self) def __add__(self, other): """Add two Rats, or a Rat and a number.""" if isint(other): other = Rat(other) if isRat(other): return Rat(self.__num*other.__den + other.__num*self.__den, self.__den*other.__den) if isnum(other): return float(self) + other return NotImplemented __radd__ = __add__ def __sub__(self, other): """Subtract two Rats, or a Rat and a number.""" if isint(other): other = Rat(other) if isRat(other): return Rat(self.__num*other.__den - other.__num*self.__den, self.__den*other.__den) if isnum(other): return float(self) - other return NotImplemented def __rsub__(self, other): """Subtract two Rats, or a Rat and a number (reversed args).""" if isint(other): other = Rat(other) if isRat(other): return Rat(other.__num*self.__den - self.__num*other.__den, self.__den*other.__den) if isnum(other): return other - float(self) return NotImplemented def __mul__(self, other): """Multiply two Rats, or a Rat and a number.""" if isRat(other): return Rat(self.__num*other.__num, self.__den*other.__den) if isint(other): return Rat(self.__num*other, self.__den) if isnum(other): return float(self)*other return NotImplemented __rmul__ = __mul__ def __truediv__(self, other): """Divide two Rats, or a Rat and a number.""" if isRat(other): return Rat(self.__num*other.__den, self.__den*other.__num) if isint(other): return Rat(self.__num, self.__den*other) if isnum(other): return float(self) / other return NotImplemented __div__ = __truediv__ def __rtruediv__(self, other): """Divide two Rats, or a Rat and a number (reversed args).""" if isRat(other): return Rat(other.__num*self.__den, other.__den*self.__num) if isint(other): return Rat(other*self.__den, self.__num) if isnum(other): return other / float(self) return NotImplemented __rdiv__ = __rtruediv__ def __floordiv__(self, other): """Divide two Rats, returning the floored result.""" if isint(other): other = Rat(other) elif not isRat(other): return NotImplemented x = self/other return x.__num // x.__den def __rfloordiv__(self, other): """Divide two Rats, returning the floored result (reversed args).""" x = other/self return x.__num // x.__den def __divmod__(self, other): """Divide two Rats, returning quotient and remainder.""" if isint(other): other = Rat(other) elif not isRat(other): return NotImplemented x = self//other return (x, self - other * x) def __rdivmod__(self, other): "Divide two Rats, returning quotient and remainder (reversed args).""" if isint(other): other = Rat(other) elif not isRat(other): return NotImplemented return divmod(other, self) def __mod__(self, other): """Take one Rat modulo another.""" return divmod(self, other)[1] def __rmod__(self, other): """Take one Rat modulo another (reversed args).""" return divmod(other, self)[1] def __eq__(self, other): """Compare two Rats for equality.""" if isint(other): return self.__den == 1 and self.__num == other if isRat(other): return self.__num == other.__num and self.__den == other.__den if isnum(other): return float(self) == other return NotImplemented def __ne__(self, other): """Compare two Rats for inequality.""" return not self == other class RatTestCase(unittest.TestCase): """Unit tests for Rat class and its support utilities.""" def test_gcd(self): self.assertEqual(gcd(10, 12), 2) self.assertEqual(gcd(10, 15), 5) self.assertEqual(gcd(10, 11), 1) self.assertEqual(gcd(100, 15), 5) self.assertEqual(gcd(-10, 2), -2) self.assertEqual(gcd(10, -2), 2) self.assertEqual(gcd(-10, -2), -2) for i in range(1, 20): for j in range(1, 20): self.assert_(gcd(i, j) > 0) self.assert_(gcd(-i, j) < 0) self.assert_(gcd(i, -j) > 0) self.assert_(gcd(-i, -j) < 0) def test_constructor(self): a = Rat(10, 15) self.assertEqual(a.num, 2) self.assertEqual(a.den, 3) a = Rat(10L, 15L) self.assertEqual(a.num, 2) self.assertEqual(a.den, 3) a = Rat(10, -15) self.assertEqual(a.num, -2) self.assertEqual(a.den, 3) a = Rat(-10, 15) self.assertEqual(a.num, -2) self.assertEqual(a.den, 3) a = Rat(-10, -15) self.assertEqual(a.num, 2) self.assertEqual(a.den, 3) a = Rat(7) self.assertEqual(a.num, 7) self.assertEqual(a.den, 1) try: a = Rat(1, 0) except ZeroDivisionError: pass else: self.fail("Rat(1, 0) didn't raise ZeroDivisionError") for bad in "0", 0.0, 0j, (), [], {}, None, Rat, unittest: try: a = Rat(bad) except TypeError: pass else: self.fail("Rat(%r) didn't raise TypeError" % bad) try: a = Rat(1, bad) except TypeError: pass else: self.fail("Rat(1, %r) didn't raise TypeError" % bad) def test_add(self): self.assertEqual(Rat(2, 3) + Rat(1, 3), 1) self.assertEqual(Rat(2, 3) + 1, Rat(5, 3)) self.assertEqual(1 + Rat(2, 3), Rat(5, 3)) self.assertEqual(1.0 + Rat(1, 2), 1.5) self.assertEqual(Rat(1, 2) + 1.0, 1.5) def test_sub(self): self.assertEqual(Rat(7, 2) - Rat(7, 5), Rat(21, 10)) self.assertEqual(Rat(7, 5) - 1, Rat(2, 5)) self.assertEqual(1 - Rat(3, 5), Rat(2, 5)) self.assertEqual(Rat(3, 2) - 1.0, 0.5) self.assertEqual(1.0 - Rat(1, 2), 0.5) def test_mul(self): self.assertEqual(Rat(2, 3) * Rat(5, 7), Rat(10, 21)) self.assertEqual(Rat(10, 3) * 3, 10) self.assertEqual(3 * Rat(10, 3), 10) self.assertEqual(Rat(10, 5) * 0.5, 1.0) self.assertEqual(0.5 * Rat(10, 5), 1.0) def test_div(self): self.assertEqual(Rat(10, 3) / Rat(5, 7), Rat(14, 3)) self.assertEqual(Rat(10, 3) / 3, Rat(10, 9)) self.assertEqual(2 / Rat(5), Rat(2, 5)) self.assertEqual(3.0 * Rat(1, 2), 1.5) self.assertEqual(Rat(1, 2) * 3.0, 1.5) def test_floordiv(self): self.assertEqual(Rat(10) // Rat(4), 2) self.assertEqual(Rat(10, 3) // Rat(4, 3), 2) self.assertEqual(Rat(10) // 4, 2) self.assertEqual(10 // Rat(4), 2) def test_eq(self): self.assertEqual(Rat(10), Rat(20, 2)) self.assertEqual(Rat(10), 10) self.assertEqual(10, Rat(10)) self.assertEqual(Rat(10), 10.0) self.assertEqual(10.0, Rat(10)) def test_future_div(self): exec future_test # XXX Ran out of steam; TO DO: divmod, div, future division future_test = """ from __future__ import division self.assertEqual(Rat(10, 3) / Rat(5, 7), Rat(14, 3)) self.assertEqual(Rat(10, 3) / 3, Rat(10, 9)) self.assertEqual(2 / Rat(5), Rat(2, 5)) self.assertEqual(3.0 * Rat(1, 2), 1.5) self.assertEqual(Rat(1, 2) * 3.0, 1.5) """ test_support.run_unittest(RatTestCase) From tim_one@users.sourceforge.net Wed Aug 8 23:50:37 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 08 Aug 2001 15:50:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.77,1.78 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv18712 Modified Files: python20.wse Log Message: Give some special thanks on the final "Installation Completed!" screen. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** python20.wse 2001/08/08 20:50:07 1.77 --- python20.wse 2001/08/08 22:50:35 1.78 *************** *** 2791,2795 **** end item: Static ! Rectangle=86 42 256 102 Create Flags=01010000000000000000000000000000 Text=%APPTITLE% has been successfully installed. --- 2791,2795 ---- end item: Static ! Rectangle=86 32 256 62 Create Flags=01010000000000000000000000000000 Text=%APPTITLE% has been successfully installed. *************** *** 2813,2816 **** --- 2813,2836 ---- Action=3 Create Flags=01010000000000000000000000000111 + end + item: Static + Rectangle=85 74 246 174 + Enabled Color=00000000000000001111111111111111 + Create Flags=01010000000000000000000000000000 + Text=Special Windows thanks to: + Text= + Text=Wise Solutions, for the use of Installmaster 8.1. + Text= http://www.wisesolutions.com/ + Text= + Text=LettError, Erik van Blokland, for the Python for Windows graphic. + Text= http://www.letterror.com/ + Text= + Text=Mark Hammond, without whose years of freely shared Windows expertise Python for Windows would still be Python for DOS. + end + item: Static + Rectangle=86 66 239 67 + Action=3 + Enabled Color=00000000000000001111111111111111 + Create Flags=01010000000000000000000000001001 end end From gvanrossum@users.sourceforge.net Wed Aug 8 23:51:15 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 08 Aug 2001 15:51:15 -0700 Subject: [Python-checkins] CVS: python/dist/src PLAN.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv18900 Modified Files: PLAN.txt Log Message: Mark binary operators as done. (This file could stand some reorganization -- it's hard to tell the open items apart from those that are done or nearly done.) Index: PLAN.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PLAN.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PLAN.txt 2001/08/08 16:57:43 1.4 --- PLAN.txt 2001/08/08 22:51:13 1.5 *************** *** 6,10 **** Do binary operators properly. nb_add should try to call self.__add__ and other.__radd__. I think I'll exclude base types that define any ! binary operator without setting the CHECKTYPES flag. Fix comparisons. There's some nasty stuff here: when two types are --- 6,11 ---- Do binary operators properly. nb_add should try to call self.__add__ and other.__radd__. I think I'll exclude base types that define any ! binary operator without setting the CHECKTYPES flag. *** This is ! done, AFAICT. Even supports __truediv__ and __floordiv__. *** Fix comparisons. There's some nasty stuff here: when two types are From tim_one@users.sourceforge.net Wed Aug 8 23:58:54 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 08 Aug 2001 15:58:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.78,1.79 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv20454 Modified Files: python20.wse Log Message: Add a comma. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** python20.wse 2001/08/08 22:50:35 1.78 --- python20.wse 2001/08/08 22:58:52 1.79 *************** *** 2826,2830 **** Text= http://www.letterror.com/ Text= ! Text=Mark Hammond, without whose years of freely shared Windows expertise Python for Windows would still be Python for DOS. end item: Static --- 2826,2830 ---- Text= http://www.letterror.com/ Text= ! Text=Mark Hammond, without whose years of freely shared Windows expertise, Python for Windows would still be Python for DOS. end item: Static From jack@oratrix.nl Thu Aug 9 01:43:56 2001 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 09 Aug 2001 02:43:56 +0200 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.101,1.102 In-Reply-To: Message by "Tim Peters" , Wed, 8 Aug 2001 17:39:03 -0400 , Message-ID: <20010809004401.6A86A162E06@oratrix.oratrix.nl> Ahh... But all you Windows Weenies think you can take a graphic produced by a Macateer, pass it through umpteen layers of Microsoft code, and "nothing bad will happen, it was only an image":-) -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From tim.one@home.com Thu Aug 9 03:47:34 2001 From: tim.one@home.com (Tim Peters) Date: Wed, 8 Aug 2001 22:47:34 -0400 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.101,1.102 In-Reply-To: <20010809004401.6A86A162E06@oratrix.oratrix.nl> Message-ID: [Jack "Mean Streak" Jansen] > Ahh... But all you Windows Weenies think you can take a graphic > produced by a Macateer, pass it through umpteen layers of Microsoft > code, and "nothing bad will happen, it was only an image":-) Now that you mention it, my Win98 has crashed at least 6 times since I got that file! But less than 12 -- so it's actually much healthier than it was before. a-good-thing-can-do-no-evli-nor-an-evil-thing-good-ly y'rs - tim From tim_one@users.sourceforge.net Thu Aug 9 06:16:03 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 08 Aug 2001 22:16:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.79,1.80 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv14134/PCbuild Modified Files: python20.wse Log Message: In the acks, CamelCase InstallMaster the same way Wise does it. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** python20.wse 2001/08/08 22:58:52 1.79 --- python20.wse 2001/08/09 05:16:00 1.80 *************** *** 2820,2824 **** Text=Special Windows thanks to: Text= ! Text=Wise Solutions, for the use of Installmaster 8.1. Text= http://www.wisesolutions.com/ Text= --- 2820,2824 ---- Text=Special Windows thanks to: Text= ! Text=Wise Solutions, for the use of InstallMaster 8.1. Text= http://www.wisesolutions.com/ Text= From loewis@users.sourceforge.net Thu Aug 9 08:21:58 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 09 Aug 2001 00:21:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_gzip.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv912/Lib/test Modified Files: test_gzip.py Log Message: Patch #448474: Add support for tell() and seek() to gzip.GzipFile. Index: test_gzip.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gzip.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_gzip.py 2001/01/17 21:43:06 1.6 --- test_gzip.py 2001/08/09 07:21:56 1.7 *************** *** 51,54 **** --- 51,78 ---- f.close() + # Try seek, read test + + f = gzip.GzipFile(filename) + while 1: + oldpos = f.tell() + line1 = f.readline() + if not line1: break + newpos = f.tell() + f.seek(oldpos) # negative seek + if len(line1)>10: + amount = 10 + else: + amount = len(line1) + line2 = f.read(amount) + verify(line1[:amount] == line2) + f.seek(newpos) # positive seek + f.close() + + # Try seek, write test + f = gzip.GzipFile(filename, 'w') + for pos in range(0, 256, 16): + f.seek(pos) + f.write('GZ\n') + f.close() os.unlink(filename) From loewis@users.sourceforge.net Thu Aug 9 08:21:58 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 09 Aug 2001 00:21:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib gzip.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv912/Lib Modified Files: gzip.py Log Message: Patch #448474: Add support for tell() and seek() to gzip.GzipFile. Index: gzip.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gzip.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** gzip.py 2001/03/20 15:51:14 1.24 --- gzip.py 2001/08/09 07:21:56 1.25 *************** *** 65,68 **** --- 65,69 ---- self.fileobj = fileobj + self.offset = 0 if self.mode == WRITE: *************** *** 139,142 **** --- 140,144 ---- self.crc = zlib.crc32(data, self.crc) self.fileobj.write( self.compress.compress(data) ) + self.offset += len(data) def writelines(self,lines): *************** *** 168,171 **** --- 170,174 ---- self.extrasize = self.extrasize - size + self.offset += size return chunk *************** *** 173,176 **** --- 176,180 ---- self.extrabuf = buf + self.extrabuf self.extrasize = len(buf) + self.extrasize + self.offset -= len(buf) def _read(self, size=1024): *************** *** 186,190 **** self.fileobj.seek(0, 2) # Seek to end of file if pos == self.fileobj.tell(): - self.fileobj = None raise EOFError, "Reached EOF" else: --- 190,193 ---- *************** *** 205,209 **** uncompress = self.decompress.flush() self._read_eof() - self.fileobj = None self._add_read_data( uncompress ) raise EOFError, 'Reached EOF' --- 208,211 ---- *************** *** 270,273 **** --- 272,305 ---- def isatty(self): return 0 + + def tell(self): + return self.offset + + def rewind(self): + '''Return the uncompressed stream file position indicator to the + beginning of the file''' + if self.mode != READ: + raise IOError("Can't rewind in write mode") + self.fileobj.seek(0) + self._new_member = 1 + self.extrabuf = "" + self.extrasize = 0 + self.offset = 0 + + def seek(self, offset): + if self.mode == WRITE: + if offset < self.offset: + raise IOError('Negative seek in write mode') + count = offset - self.offset + for i in range(count/1024): + f.write(1024*'\0') + self.write((count%1024)*'\0') + elif self.mode == READ: + if offset < self.offset: + # for negative seek, rewind and do positive seek + self.rewind() + count = offset - self.offset + for i in range(count/1024): self.read(1024) + self.read(count % 1024) def readline(self, size=-1): From loewis@users.sourceforge.net Thu Aug 9 08:21:58 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 09 Aug 2001 00:21:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libgzip.tex,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv912/Doc/lib Modified Files: libgzip.tex Log Message: Patch #448474: Add support for tell() and seek() to gzip.GzipFile. Index: libgzip.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgzip.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** libgzip.tex 2000/10/18 17:43:06 1.13 --- libgzip.tex 2001/08/09 07:21:56 1.14 *************** *** 22,27 **** compresslevel\optional{, fileobj}}}}} Constructor for the \class{GzipFile} class, which simulates most of ! the methods of a file object, with the exception of the ! \method{seek()} and \method{tell()} methods. At least one of \var{fileobj} and \var{filename} must be given a non-trivial value. --- 22,27 ---- compresslevel\optional{, fileobj}}}}} Constructor for the \class{GzipFile} class, which simulates most of ! the methods of a file object, with the exception of the \method{readinto()}, ! \method{truncate()}, and \method{xreadlines()} methods. At least one of \var{fileobj} and \var{filename} must be given a non-trivial value. From twouters@users.sourceforge.net Thu Aug 9 10:53:03 2001 From: twouters@users.sourceforge.net (Thomas Wouters) Date: Thu, 09 Aug 2001 02:53:03 -0700 Subject: [Python-checkins] CVS: python/dist/src .cvsignore,2.3,2.4 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv1065 Modified Files: .cvsignore Log Message: Michael Hudson correctly pointed out we should cvsignore pyconfig.h, not config.h (anymore). People will still have to delete config.h from their source trees manually :) Index: .cvsignore =================================================================== RCS file: /cvsroot/python/python/dist/src/.cvsignore,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -d -r2.3 -r2.4 *** .cvsignore 2001/06/06 17:51:57 2.3 --- .cvsignore 2001/08/09 09:53:00 2.4 *************** *** 1,5 **** .purify config.log - config.h config.cache config.status --- 1,4 ---- *************** *** 10,11 **** --- 9,11 ---- Makefile.pre platform + pyconfig.h From loewis@users.sourceforge.net Thu Aug 9 11:29:47 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 09 Aug 2001 03:29:47 -0700 Subject: [Python-checkins] CVS: python/dist/src configure.in,1.240,1.241 configure,1.231,1.232 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv7683 Modified Files: configure.in configure Log Message: Patch #433537: Cache ac_cv_bad_static_forward. Also move up AC_AIX and AC_MINIX further up. Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.240 retrieving revision 1.241 diff -C2 -d -r1.240 -r1.241 *** configure.in 2001/08/08 13:56:14 1.240 --- configure.in 2001/08/09 10:29:44 1.241 *************** *** 172,175 **** --- 172,180 ---- AC_PROG_CC + + # checks for UNIX variants that set C preprocessor variables + AC_AIX + AC_MINIX + AC_EXEEXT AC_MSG_CHECKING(for --with-suffix) *************** *** 350,356 **** OPT="$OPT $ac_arch_flags" fi - # checks for UNIX variants that set C preprocessor variables - AC_AIX - AC_MINIX AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0) --- 355,358 ---- *************** *** 1430,1436 **** AC_MSG_RESULT(no)) - bad_forward=no AC_MSG_CHECKING(for bad static forward) ! AC_TRY_RUN([ struct s { int a; int b; }; static struct s foo; --- 1432,1438 ---- AC_MSG_RESULT(no)) AC_MSG_CHECKING(for bad static forward) ! AC_CACHE_VAL(ac_cv_bad_static_forward, ! [AC_TRY_RUN([ struct s { int a; int b; }; static struct s foo; *************** *** 1443,1449 **** main() { exit(!((int)&foo == foobar())); ! } ! ], , AC_DEFINE(BAD_STATIC_FORWARD) bad_forward=yes) ! AC_MSG_RESULT($bad_forward) va_list_is_array=no --- 1445,1454 ---- main() { exit(!((int)&foo == foobar())); ! }], ac_cv_bad_static_forward=no, ac_cv_bad_static_forward=yes)]) ! AC_MSG_RESULT($ac_cv_bad_static_forward) ! if test "$ac_cv_bad_static_forward" = yes ! then ! AC_DEFINE(BAD_STATIC_FORWARD) ! fi va_list_is_array=no Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.231 retrieving revision 1.232 diff -C2 -d -r1.231 -r1.232 *** configure 2001/08/08 13:56:14 1.231 --- configure 2001/08/09 10:29:44 1.232 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.239 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.240 [...4619 lines suppressed...] echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7039: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then *************** *** 7176,7179 **** --- 7185,7189 ---- s%@MAINOBJ@%$MAINOBJ%g s%@CC@%$CC%g + s%@CPP@%$CPP%g s%@EXEEXT@%$EXEEXT%g s%@LIBRARY@%$LIBRARY%g *************** *** 7188,7192 **** s%@LN@%$LN%g s%@OPT@%$OPT%g - s%@CPP@%$CPP%g s%@LIBTOOL_CRUFT@%$LIBTOOL_CRUFT%g s%@SO@%$SO%g --- 7198,7201 ---- From loewis@users.sourceforge.net Thu Aug 9 12:40:17 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 09 Aug 2001 04:40:17 -0700 Subject: [Python-checkins] CVS: python/dist/src configure.in,1.241,1.242 configure,1.232,1.233 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv25978 Modified Files: configure.in configure Log Message: Move IPv6 test further down so that usage of -lnsl has been tested. Recognize Solaris IPv6 by checking /etc/netconfig. Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.241 retrieving revision 1.242 diff -C2 -d -r1.241 -r1.242 *** configure.in 2001/08/09 10:29:44 1.241 --- configure.in 2001/08/09 11:40:14 1.242 *************** *** 385,532 **** fi - # Check for enable-ipv6 - AC_MSG_CHECKING([whether to enable ipv6]) - AC_ARG_ENABLE(ipv6, - [ --enable-ipv6 Enable ipv6 (with ipv4) support - --disable-ipv6 Disable ipv6 support], - [ case "$enableval" in - no) - AC_MSG_RESULT(no) - ipv6=no - ;; - *) AC_MSG_RESULT(yes) - AC_DEFINE(ENABLE_IPV6) - ipv6=yes - ;; - esac ], - - AC_TRY_RUN([ /* AF_INET6 available check */ - #include - #include - main() - { - if (socket(AF_INET6, SOCK_STREAM, 0) < 0) - exit(1); - else - exit(0); - } - ], - AC_MSG_RESULT(yes) - AC_DEFINE(ENABLE_IPV6) - ipv6=yes, - AC_MSG_RESULT(no) - ipv6=no, - AC_MSG_RESULT(no) - ipv6=no - )) - - ipv6type=unknown - ipv6lib=none - ipv6trylibc=no - - if test "$ipv6" = "yes"; then - AC_MSG_CHECKING([ipv6 stack type]) - for i in inria kame linux-glibc linux-inet6 toshiba v6d zeta; do - case $i in - inria) - dnl http://www.kame.net/ - AC_EGREP_CPP(yes, [dnl - #include - #ifdef IPV6_INRIA_VERSION - yes - #endif], - [ipv6type=$i; - OPT="-DINET6 $OPT"]) - ;; - kame) - dnl http://www.kame.net/ - AC_EGREP_CPP(yes, [dnl - #include - #ifdef __KAME__ - yes - #endif], - [ipv6type=$i; - ipv6lib=inet6 - ipv6libdir=/usr/local/v6/lib - ipv6trylibc=yes - OPT="-DINET6 $OPT"]) - ;; - linux-glibc) - dnl http://www.v6.linux.or.jp/ - AC_EGREP_CPP(yes, [dnl - #include - #if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)) - yes - #endif], - [ipv6type=$i; - ipv6trylibc=yes - OPT="-DINET6 $OPT"]) - ;; - linux-inet6) - dnl http://www.v6.linux.or.jp/ - if test -d /usr/inet6; then - ipv6type=$i - ipv6lib=inet6 - ipv6libdir=/usr/inet6/lib - OPT="-DINET6 -I/usr/inet6/include $OPT" - fi - ;; - toshiba) - AC_EGREP_CPP(yes, [dnl - #include - #ifdef _TOSHIBA_INET6 - yes - #endif], - [ipv6type=$i; - ipv6lib=inet6; - ipv6libdir=/usr/local/v6/lib; - OPT="-DINET6 $OPT"]) - ;; - v6d) - AC_EGREP_CPP(yes, [dnl - #include - #ifdef __V6D__ - yes - #endif], - [ipv6type=$i; - ipv6lib=v6; - ipv6libdir=/usr/local/v6/lib; - OPT="-I/usr/local/v6/include $OPT"]) - ;; - zeta) - AC_EGREP_CPP(yes, [dnl - #include - #ifdef _ZETA_MINAMI_INET6 - yes - #endif], - [ipv6type=$i; - ipv6lib=inet6; - ipv6libdir=/usr/local/v6/lib; - OPT="-DINET6 $OPT"]) - ;; - esac - if test "$ipv6type" != "unknown"; then - break - fi - done - AC_MSG_RESULT($ipv6type) - fi - - if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then - if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then - LIBS="-L$ipv6libdir -l$ipv6lib $LIBS" - echo "using lib$ipv6lib" - else - if test $ipv6trylibc = "yes"; then - echo "using libc" - else - echo 'Fatal: no $ipv6lib library found. cannot continue.' - echo "You need to fetch lib$ipv6lib.a from appropriate" - echo 'ipv6 kit and compile beforehand.' - exit 1 - fi - fi - fi - # -Kpthread, if available, provides the right #defines # and linker options to make pthread_create available --- 385,388 ---- *************** *** 1079,1082 **** --- 935,1091 ---- esac fi + fi + + # Check for enable-ipv6 + AC_MSG_CHECKING([whether to enable ipv6]) + AC_ARG_ENABLE(ipv6, + [ --enable-ipv6 Enable ipv6 (with ipv4) support + --disable-ipv6 Disable ipv6 support], + [ case "$enableval" in + no) + AC_MSG_RESULT(no) + ipv6=no + ;; + *) AC_MSG_RESULT(yes) + AC_DEFINE(ENABLE_IPV6) + ipv6=yes + ;; + esac ], + + AC_TRY_RUN([ /* AF_INET6 available check */ + #include + #include + main() + { + if (socket(AF_INET6, SOCK_STREAM, 0) < 0) + exit(1); + else + exit(0); + } + ], + AC_MSG_RESULT(yes) + AC_DEFINE(ENABLE_IPV6) + ipv6=yes, + AC_MSG_RESULT(no) + ipv6=no, + AC_MSG_RESULT(no) + ipv6=no + )) + + ipv6type=unknown + ipv6lib=none + ipv6trylibc=no + + if test "$ipv6" = "yes"; then + AC_MSG_CHECKING([ipv6 stack type]) + for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; do + case $i in + inria) + dnl http://www.kame.net/ + AC_EGREP_CPP(yes, [dnl + #include + #ifdef IPV6_INRIA_VERSION + yes + #endif], + [ipv6type=$i; + OPT="-DINET6 $OPT"]) + ;; + kame) + dnl http://www.kame.net/ + AC_EGREP_CPP(yes, [dnl + #include + #ifdef __KAME__ + yes + #endif], + [ipv6type=$i; + ipv6lib=inet6 + ipv6libdir=/usr/local/v6/lib + ipv6trylibc=yes + OPT="-DINET6 $OPT"]) + ;; + linux-glibc) + dnl http://www.v6.linux.or.jp/ + AC_EGREP_CPP(yes, [dnl + #include + #if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)) + yes + #endif], + [ipv6type=$i; + ipv6trylibc=yes + OPT="-DINET6 $OPT"]) + ;; + linux-inet6) + dnl http://www.v6.linux.or.jp/ + if test -d /usr/inet6; then + ipv6type=$i + ipv6lib=inet6 + ipv6libdir=/usr/inet6/lib + OPT="-DINET6 -I/usr/inet6/include $OPT" + fi + ;; + solaris) + if test -f /etc/netconfig; then + if /usr/xpg4/bin/grep -q tcp6 /etc/netconfig; then + ipv6type=$i + ipv6trylibc=yes + OPT="-DINET6 $OPT" + fi + fi + ;; + toshiba) + AC_EGREP_CPP(yes, [dnl + #include + #ifdef _TOSHIBA_INET6 + yes + #endif], + [ipv6type=$i; + ipv6lib=inet6; + ipv6libdir=/usr/local/v6/lib; + OPT="-DINET6 $OPT"]) + ;; + v6d) + AC_EGREP_CPP(yes, [dnl + #include + #ifdef __V6D__ + yes + #endif], + [ipv6type=$i; + ipv6lib=v6; + ipv6libdir=/usr/local/v6/lib; + OPT="-I/usr/local/v6/include $OPT"]) + ;; + zeta) + AC_EGREP_CPP(yes, [dnl + #include + #ifdef _ZETA_MINAMI_INET6 + yes + #endif], + [ipv6type=$i; + ipv6lib=inet6; + ipv6libdir=/usr/local/v6/lib; + OPT="-DINET6 $OPT"]) + ;; + esac + if test "$ipv6type" != "unknown"; then + break + fi + done + AC_MSG_RESULT($ipv6type) + fi + + if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then + if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then + LIBS="-L$ipv6libdir -l$ipv6lib $LIBS" + echo "using lib$ipv6lib" + else + if test $ipv6trylibc = "yes"; then + echo "using libc" + else + echo 'Fatal: no $ipv6lib library found. cannot continue.' + echo "You need to fetch lib$ipv6lib.a from appropriate" + echo 'ipv6 kit and compile beforehand.' + exit 1 + fi + fi fi Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.232 retrieving revision 1.233 diff -C2 -d -r1.232 -r1.233 *** configure 2001/08/09 10:29:44 1.232 --- configure 2001/08/09 11:40:14 1.233 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.240 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.241 [...4348 lines suppressed...] if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7036,7040 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7039: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7045,7049 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7048: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then From loewis@users.sourceforge.net Thu Aug 9 13:24:40 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 09 Aug 2001 05:24:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts h2py.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory usw-pr-cvs1:/tmp/cvs-serv6829 Modified Files: h2py.py Log Message: Patch #437683: Use re instead of regex. If multiple header files are processed simultaneously which include each other, the corresponding modules mport each other. Specifically, if h2py is invoked with sys/types.h first, later header files won't contain the complete contents of TYPES.py. Index: h2py.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/h2py.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** h2py.py 2001/01/17 08:48:39 1.12 --- h2py.py 2001/08/09 12:24:38 1.13 *************** *** 22,53 **** # - what to do about macros with multiple parameters? ! import sys, regex, regsub, string, getopt, os ! p_define = regex.compile('^[\t ]*#[\t ]*define[\t ]+\([a-zA-Z0-9_]+\)[\t ]+') ! p_macro = regex.compile( '^[\t ]*#[\t ]*define[\t ]+' ! '\([a-zA-Z0-9_]+\)(\([_a-zA-Z][_a-zA-Z0-9]*\))[\t ]+') ! p_include = regex.compile('^[\t ]*#[\t ]*include[\t ]+<\([a-zA-Z0-9_/\.]+\)') ! p_comment = regex.compile('/\*\([^*]+\|\*+[^/]\)*\(\*+/\)?') ! p_cpp_comment = regex.compile('//.*') ignores = [p_comment, p_cpp_comment] ! p_char = regex.compile("'\(\\\\.[^\\\\]*\|[^\\\\]\)'") filedict = {} try: ! searchdirs=string.splitfields(os.environ['include'],';') except KeyError: try: ! searchdirs=string.splitfields(os.environ['INCLUDE'],';') except KeyError: try: ! if string.find( sys.platform, "beos" ) == 0: ! searchdirs=string.splitfields(os.environ['BEINCLUDES'],';') else: raise KeyError --- 22,54 ---- # - what to do about macros with multiple parameters? ! import sys, re, getopt, os ! p_define = re.compile('^[\t ]*#[\t ]*define[\t ]+([a-zA-Z0-9_]+)[\t ]+') ! p_macro = re.compile( '^[\t ]*#[\t ]*define[\t ]+' ! '([a-zA-Z0-9_]+)\(([_a-zA-Z][_a-zA-Z0-9]*)\)[\t ]+') ! p_include = re.compile('^[\t ]*#[\t ]*include[\t ]+<([a-zA-Z0-9_/\.]+)') ! p_comment = re.compile(r'/\*([^*]+|\*+[^/])*(\*+/)?') ! p_cpp_comment = re.compile('//.*') ignores = [p_comment, p_cpp_comment] ! p_char = re.compile(r"'(\\.[^\\]*|[^\\])'") filedict = {} + importable = {} try: ! searchdirs=os.environ['include'].splitfields(';') except KeyError: try: ! searchdirs=os.environ['INCLUDE'].splitfields(';') except KeyError: try: ! if sys.platform.find("beos") == 0: ! searchdirs=os.environ['BEINCLUDES'].splitfields(';') else: raise KeyError *************** *** 60,64 **** for o, a in opts: if o == '-i': ! ignores.append(regex.compile(a)) if not args: args = ['-'] --- 61,65 ---- for o, a in opts: if o == '-i': ! ignores.append(re.compile(a)) if not args: args = ['-'] *************** *** 70,77 **** fp = open(filename, 'r') outfile = os.path.basename(filename) ! i = string.rfind(outfile, '.') if i > 0: outfile = outfile[:i] ! outfile = string.upper(outfile) ! outfile = outfile + '.py' outfp = open(outfile, 'w') outfp.write('# Generated by h2py from %s\n' % filename) --- 71,78 ---- fp = open(filename, 'r') outfile = os.path.basename(filename) ! i = outfile.rfind('.') if i > 0: outfile = outfile[:i] ! modname = outfile.upper() ! outfile = modname + '.py' outfp = open(outfile, 'w') outfp.write('# Generated by h2py from %s\n' % filename) *************** *** 80,83 **** --- 81,85 ---- if filename[:len(dir)] == dir: filedict[filename[len(dir)+1:]] = None # no '/' trailing + importable[filename[len(dir)+1:]] = modname break process(fp, outfp) *************** *** 91,96 **** if not line: break lineno = lineno + 1 ! n = p_define.match(line) ! if n >= 0: # gobble up continuation lines while line[-2:] == '\\\n': --- 93,98 ---- if not line: break lineno = lineno + 1 ! match = p_define.match(line) ! if match: # gobble up continuation lines while line[-2:] == '\\\n': *************** *** 99,110 **** lineno = lineno + 1 line = line + nextline ! name = p_define.group(1) ! body = line[n:] # replace ignored patterns by spaces for p in ignores: ! body = regsub.gsub(p, ' ', body) # replace char literals by ord(...) ! body = regsub.gsub(p_char, 'ord(\\0)', body) ! stmt = '%s = %s\n' % (name, string.strip(body)) ok = 0 try: --- 101,112 ---- lineno = lineno + 1 line = line + nextline ! name = match.group(1) ! body = line[match.end():] # replace ignored patterns by spaces for p in ignores: ! body = p.sub(' ', body) # replace char literals by ord(...) ! body = p_char.sub('ord(\\0)', body) ! stmt = '%s = %s\n' % (name, body.strip()) ok = 0 try: *************** *** 114,124 **** else: outfp.write(stmt) ! n =p_macro.match(line) ! if n >= 0: ! macro, arg = p_macro.group(1, 2) ! body = line[n:] for p in ignores: ! body = regsub.gsub(p, ' ', body) ! body = regsub.gsub(p_char, 'ord(\\0)', body) stmt = 'def %s(%s): return %s\n' % (macro, arg, body) try: --- 116,126 ---- else: outfp.write(stmt) ! match = p_macro.match(line) ! if match: ! macro, arg = match.group(1, 2) ! body = line[match.end():] for p in ignores: ! body = p.sub(' ', body) ! body = p_char.sub('ord(\\0)', body) stmt = 'def %s(%s): return %s\n' % (macro, arg, body) try: *************** *** 128,141 **** else: outfp.write(stmt) ! if p_include.match(line) >= 0: ! regs = p_include.regs a, b = regs[1] filename = line[a:b] ! if not filedict.has_key(filename): filedict[filename] = None inclfp = None for dir in searchdirs: try: ! inclfp = open(dir + '/' + filename, 'r') break except IOError: --- 130,146 ---- else: outfp.write(stmt) ! match = p_include.match(line) ! if match: ! regs = match.regs a, b = regs[1] filename = line[a:b] ! if importable.has_key(filename): ! outfp.write('import %s\n' % importable[filename]) ! elif not filedict.has_key(filename): filedict[filename] = None inclfp = None for dir in searchdirs: try: ! inclfp = open(dir + '/' + filename) break except IOError: From loewis@users.sourceforge.net Thu Aug 9 13:32:12 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 09 Aug 2001 05:32:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts h2py.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory usw-pr-cvs1:/tmp/cvs-serv9246 Modified Files: h2py.py Log Message: When representing #includes as imports, do from MOD import *. Index: h2py.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/h2py.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** h2py.py 2001/08/09 12:24:38 1.13 --- h2py.py 2001/08/09 12:32:10 1.14 *************** *** 136,140 **** filename = line[a:b] if importable.has_key(filename): ! outfp.write('import %s\n' % importable[filename]) elif not filedict.has_key(filename): filedict[filename] = None --- 136,140 ---- filename = line[a:b] if importable.has_key(filename): ! outfp.write('from %s import *\n' % importable[filename]) elif not filedict.has_key(filename): filedict[filename] = None From loewis@users.sourceforge.net Thu Aug 9 13:33:34 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 09 Aug 2001 05:33:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-sunos5 DLFCN.py,NONE,1.1 TYPES.py,NONE,1.1 IN.py,1.2,1.3 STROPTS.py,1.1,1.2 regen,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-sunos5 In directory usw-pr-cvs1:/tmp/cvs-serv9577 Modified Files: IN.py STROPTS.py regen Added Files: DLFCN.py TYPES.py Log Message: Regenerate for Solaris 8. --- NEW FILE: DLFCN.py --- # Generated by h2py from /usr/include/dlfcn.h from TYPES import * RTLD_LAZY = 0x00001 RTLD_NOW = 0x00002 RTLD_NOLOAD = 0x00004 RTLD_GLOBAL = 0x00100 RTLD_LOCAL = 0x00000 RTLD_PARENT = 0x00200 RTLD_GROUP = 0x00400 RTLD_WORLD = 0x00800 RTLD_NODELETE = 0x01000 RTLD_CONFGEN = 0x10000 RTLD_REL_RELATIVE = 0x00001 RTLD_REL_EXEC = 0x00002 RTLD_REL_DEPENDS = 0x00004 RTLD_REL_PRELOAD = 0x00008 RTLD_REL_SELF = 0x00010 RTLD_REL_WEAK = 0x00020 RTLD_REL_ALL = 0x00fff RTLD_MEMORY = 0x01000 RTLD_STRIP = 0x02000 RTLD_NOHEAP = 0x04000 RTLD_CONFSET = 0x10000 RTLD_DI_LMID = 1 RTLD_DI_LINKMAP = 2 RTLD_DI_CONFIGADDR = 3 RTLD_DI_MAX = 3 --- NEW FILE: TYPES.py --- # Generated by h2py from /usr/include/sys/types.h # Included from sys/isa_defs.h _CHAR_ALIGNMENT = 1 _SHORT_ALIGNMENT = 2 _INT_ALIGNMENT = 4 _LONG_ALIGNMENT = 8 _LONG_LONG_ALIGNMENT = 8 _DOUBLE_ALIGNMENT = 8 _LONG_DOUBLE_ALIGNMENT = 16 _POINTER_ALIGNMENT = 8 _MAX_ALIGNMENT = 16 _ALIGNMENT_REQUIRED = 1 _CHAR_ALIGNMENT = 1 _SHORT_ALIGNMENT = 2 _INT_ALIGNMENT = 4 _LONG_ALIGNMENT = 4 _LONG_LONG_ALIGNMENT = 4 _DOUBLE_ALIGNMENT = 4 _LONG_DOUBLE_ALIGNMENT = 4 _POINTER_ALIGNMENT = 4 _MAX_ALIGNMENT = 4 _ALIGNMENT_REQUIRED = 0 _CHAR_ALIGNMENT = 1 _SHORT_ALIGNMENT = 2 _INT_ALIGNMENT = 4 _LONG_LONG_ALIGNMENT = 8 _DOUBLE_ALIGNMENT = 8 _ALIGNMENT_REQUIRED = 1 _LONG_ALIGNMENT = 4 _LONG_DOUBLE_ALIGNMENT = 8 _POINTER_ALIGNMENT = 4 _MAX_ALIGNMENT = 8 _LONG_ALIGNMENT = 8 _LONG_DOUBLE_ALIGNMENT = 16 _POINTER_ALIGNMENT = 8 _MAX_ALIGNMENT = 16 # Included from sys/feature_tests.h _POSIX_C_SOURCE = 1 _LARGEFILE64_SOURCE = 1 _LARGEFILE_SOURCE = 1 _FILE_OFFSET_BITS = 64 _FILE_OFFSET_BITS = 32 _POSIX_C_SOURCE = 199506L _POSIX_PTHREAD_SEMANTICS = 1 _XOPEN_VERSION = 500 _XOPEN_VERSION = 4 _XOPEN_VERSION = 3 # Included from sys/machtypes.h # Included from sys/inttypes.h # Included from sys/int_types.h # Included from sys/int_limits.h INT8_MAX = (127) INT16_MAX = (32767) INT32_MAX = (2147483647) INTMAX_MAX = INT32_MAX INT_LEAST8_MAX = INT8_MAX INT_LEAST16_MAX = INT16_MAX INT_LEAST32_MAX = INT32_MAX INT8_MIN = (-128) INT16_MIN = (-32767-1) INT32_MIN = (-2147483647-1) INTMAX_MIN = INT32_MIN INT_LEAST8_MIN = INT8_MIN INT_LEAST16_MIN = INT16_MIN INT_LEAST32_MIN = INT32_MIN # Included from sys/int_const.h def INT8_C(c): return (c) def INT16_C(c): return (c) def INT32_C(c): return (c) def INT64_C(c): return __CONCAT__(c,l) def INT64_C(c): return __CONCAT__(c,ll) def UINT8_C(c): return __CONCAT__(c,u) def UINT16_C(c): return __CONCAT__(c,u) def UINT32_C(c): return __CONCAT__(c,u) def UINT64_C(c): return __CONCAT__(c,ul) def UINT64_C(c): return __CONCAT__(c,ull) def INTMAX_C(c): return __CONCAT__(c,l) def UINTMAX_C(c): return __CONCAT__(c,ul) def INTMAX_C(c): return __CONCAT__(c,ll) def UINTMAX_C(c): return __CONCAT__(c,ull) def INTMAX_C(c): return (c) def UINTMAX_C(c): return (c) # Included from sys/int_fmtio.h PRId8 = "d" PRId16 = "d" PRId32 = "d" PRId64 = "ld" PRId64 = "lld" PRIdLEAST8 = "d" PRIdLEAST16 = "d" PRIdLEAST32 = "d" PRIdLEAST64 = "ld" PRIdLEAST64 = "lld" PRIi8 = "i" PRIi16 = "i" PRIi32 = "i" PRIi64 = "li" PRIi64 = "lli" PRIiLEAST8 = "i" PRIiLEAST16 = "i" PRIiLEAST32 = "i" PRIiLEAST64 = "li" PRIiLEAST64 = "lli" PRIo8 = "o" PRIo16 = "o" PRIo32 = "o" PRIo64 = "lo" PRIo64 = "llo" PRIoLEAST8 = "o" PRIoLEAST16 = "o" PRIoLEAST32 = "o" PRIoLEAST64 = "lo" PRIoLEAST64 = "llo" PRIx8 = "x" PRIx16 = "x" PRIx32 = "x" PRIx64 = "lx" PRIx64 = "llx" PRIxLEAST8 = "x" PRIxLEAST16 = "x" PRIxLEAST32 = "x" PRIxLEAST64 = "lx" PRIxLEAST64 = "llx" PRIX8 = "X" PRIX16 = "X" PRIX32 = "X" PRIX64 = "lX" PRIX64 = "llX" PRIXLEAST8 = "X" PRIXLEAST16 = "X" PRIXLEAST32 = "X" PRIXLEAST64 = "lX" PRIXLEAST64 = "llX" PRIu8 = "u" PRIu16 = "u" PRIu32 = "u" PRIu64 = "lu" PRIu64 = "llu" PRIuLEAST8 = "u" PRIuLEAST16 = "u" PRIuLEAST32 = "u" PRIuLEAST64 = "lu" PRIuLEAST64 = "llu" SCNd16 = "hd" SCNd32 = "d" SCNd64 = "ld" SCNd64 = "lld" SCNi16 = "hi" SCNi32 = "i" SCNi64 = "li" SCNi64 = "lli" SCNo16 = "ho" SCNo32 = "o" SCNo64 = "lo" SCNo64 = "llo" SCNu16 = "hu" SCNu32 = "u" SCNu64 = "lu" SCNu64 = "llu" SCNx16 = "hx" SCNx32 = "x" SCNx64 = "lx" SCNx64 = "llx" PRIdMAX = "ld" PRIoMAX = "lo" PRIxMAX = "lx" PRIuMAX = "lu" PRIdMAX = "lld" PRIoMAX = "llo" PRIxMAX = "llx" PRIuMAX = "llu" PRIdMAX = "d" PRIoMAX = "o" PRIxMAX = "x" PRIuMAX = "u" SCNiMAX = "li" SCNdMAX = "ld" SCNoMAX = "lo" SCNxMAX = "lx" SCNiMAX = "lli" SCNdMAX = "lld" SCNoMAX = "llo" SCNxMAX = "llx" SCNiMAX = "i" SCNdMAX = "d" SCNoMAX = "o" SCNxMAX = "x" # Included from sys/types32.h SHRT_MIN = (-32768) SHRT_MAX = 32767 USHRT_MAX = 65535 INT_MIN = (-2147483647-1) INT_MAX = 2147483647 LONG_MIN = (-9223372036854775807L-1L) LONG_MAX = 9223372036854775807L LONG_MIN = (-2147483647L-1L) LONG_MAX = 2147483647L P_MYID = (-1) # Included from sys/select.h # Included from sys/time.h TIME32_MAX = INT32_MAX TIME32_MIN = INT32_MIN def TIMEVAL_OVERFLOW(tv): return \ from TYPES import * DST_NONE = 0 DST_USA = 1 DST_AUST = 2 DST_WET = 3 DST_MET = 4 DST_EET = 5 DST_CAN = 6 DST_GB = 7 DST_RUM = 8 DST_TUR = 9 DST_AUSTALT = 10 ITIMER_REAL = 0 ITIMER_VIRTUAL = 1 ITIMER_PROF = 2 ITIMER_REALPROF = 3 def ITIMERVAL_OVERFLOW(itv): return \ SEC = 1 MILLISEC = 1000 MICROSEC = 1000000 NANOSEC = 1000000000 # Included from sys/time_impl.h def TIMESPEC_OVERFLOW(ts): return \ def ITIMERSPEC_OVERFLOW(it): return \ __CLOCK_REALTIME0 = 0 CLOCK_VIRTUAL = 1 CLOCK_PROF = 2 __CLOCK_REALTIME3 = 3 CLOCK_HIGHRES = 4 CLOCK_MAX = 5 CLOCK_REALTIME = __CLOCK_REALTIME3 CLOCK_REALTIME = __CLOCK_REALTIME0 TIMER_RELTIME = 0x0 TIMER_ABSTIME = 0x1 # Included from sys/mutex.h from TYPES import * def MUTEX_HELD(x): return (mutex_owned(x)) def TICK_TO_SEC(tick): return ((tick) / hz) def SEC_TO_TICK(sec): return ((sec) * hz) def TICK_TO_MSEC(tick): return \ def MSEC_TO_TICK(msec): return \ def MSEC_TO_TICK_ROUNDUP(msec): return \ def TICK_TO_USEC(tick): return ((tick) * usec_per_tick) def USEC_TO_TICK(usec): return ((usec) / usec_per_tick) def USEC_TO_TICK_ROUNDUP(usec): return \ def TICK_TO_NSEC(tick): return ((tick) * nsec_per_tick) def NSEC_TO_TICK(nsec): return ((nsec) / nsec_per_tick) def NSEC_TO_TICK_ROUNDUP(nsec): return \ def TIMEVAL_TO_TICK(tvp): return \ def TIMESTRUC_TO_TICK(tsp): return \ # Included from time.h from TYPES import * # Included from iso/time_iso.h NULL = 0L NULL = 0 CLOCKS_PER_SEC = 1000000 FD_SETSIZE = 65536 FD_SETSIZE = 1024 _NBBY = 8 NBBY = _NBBY def FD_ZERO(p): return bzero((p), sizeof (*(p))) Index: IN.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-sunos5/IN.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IN.py 1997/05/13 17:45:49 1.2 --- IN.py 2001/08/09 12:33:32 1.3 *************** *** 1,12 **** # Generated by h2py from /usr/include/netinet/in.h - # Included from sys/stream.h - - # Included from sys/vnode.h - - # Included from sys/types.h - # Included from sys/feature_tests.h - _POSIX_C_SOURCE = 1 [...1522 lines suppressed...] + IPV6_DROP_MEMBERSHIP = 0xa + IPV6_PKTINFO = 0xb + IPV6_HOPLIMIT = 0xc + IPV6_NEXTHOP = 0xd + IPV6_HOPOPTS = 0xe + IPV6_DSTOPTS = 0xf + IPV6_RTHDR = 0x10 + IPV6_RTHDRDSTOPTS = 0x11 + IPV6_RECVPKTINFO = 0x12 + IPV6_RECVHOPLIMIT = 0x13 + IPV6_RECVHOPOPTS = 0x14 + IPV6_RECVDSTOPTS = 0x15 + IPV6_RECVRTHDR = 0x16 + IPV6_RECVRTHDRDSTOPTS = 0x17 + IPV6_CHECKSUM = 0x18 + IPV6_BOUND_IF = 0x41 + IPV6_UNSPEC_SRC = 0x42 + INET_ADDRSTRLEN = 16 + INET6_ADDRSTRLEN = 46 + IPV6_PAD1_OPT = 0 Index: STROPTS.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-sunos5/STROPTS.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** STROPTS.py 1997/12/02 04:49:09 1.1 --- STROPTS.py 2001/08/09 12:33:32 1.2 *************** *** 2,13 **** # Included from sys/feature_tests.h - _POSIX_C_SOURCE = 1 - _LARGEFILE64_SOURCE = 1 - _LARGEFILE_SOURCE = 1 - _FILE_OFFSET_BITS = 32 - _XOPEN_VERSION = 4 - _XOPEN_VERSION = 3 - - # Included from sys/types.h [...1812 lines suppressed...] - I_SWROPT = (STR|023) - I_GWROPT = (STR|024) - I_LIST = (STR|025) - I_PLINK = (STR|026) - I_PUNLINK = (STR|027) - I_FLUSHBAND = (STR|034) - I_CKBAND = (STR|035) - I_GETBAND = (STR|036) - I_ATMARK = (STR|037) - I_SETCLTIME = (STR|040) - I_GETCLTIME = (STR|041) - I_CANPUT = (STR|042) - I_SERROPT = (STR|043) - I_GERROPT = (STR|044) - I_ESETSIG = (STR|045) - I_EGETSIG = (STR|046) - __I_PUSH_NOCTTY = (STR|047) _INFTIM = -1 INFTIM = _INFTIM --- 1810,1813 ---- Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-sunos5/regen,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** regen 2001/05/10 15:52:47 1.4 --- regen 2001/08/09 12:33:32 1.5 *************** *** 6,9 **** esac set -v ! h2py -i '(u_long)' /usr/include/netinet/in.h ! h2py /usr/include/sys/stropts.h --- 6,9 ---- esac set -v ! h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/sys/stropts.h /usr/include/dlfcn.h ! From loewis@users.sourceforge.net Thu Aug 9 13:48:20 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 09 Aug 2001 05:48:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-linux2 DLFCN.py,NONE,1.1 TYPES.py,NONE,1.1 IN.py,1.3,1.4 regen,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-linux2 In directory usw-pr-cvs1:/tmp/cvs-serv12660 Modified Files: IN.py regen Added Files: DLFCN.py TYPES.py Log Message: Regenerate for glibc 2.2.3. --- NEW FILE: DLFCN.py --- # Generated by h2py from /usr/include/dlfcn.h _DLFCN_H = 1 # Included from features.h _FEATURES_H = 1 __USE_ANSI = 1 __FAVOR_BSD = 1 _ISOC99_SOURCE = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 199506L _XOPEN_SOURCE = 600 _XOPEN_SOURCE_EXTENDED = 1 _LARGEFILE64_SOURCE = 1 _BSD_SOURCE = 1 _SVID_SOURCE = 1 _BSD_SOURCE = 1 _SVID_SOURCE = 1 __USE_ISOC99 = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 2 _POSIX_C_SOURCE = 199506L __USE_POSIX = 1 __USE_POSIX2 = 1 __USE_POSIX199309 = 1 __USE_POSIX199506 = 1 __USE_XOPEN = 1 __USE_XOPEN_EXTENDED = 1 __USE_UNIX98 = 1 _LARGEFILE_SOURCE = 1 __USE_XOPEN2K = 1 __USE_ISOC99 = 1 __USE_XOPEN_EXTENDED = 1 __USE_LARGEFILE = 1 __USE_LARGEFILE64 = 1 __USE_FILE_OFFSET64 = 1 __USE_MISC = 1 __USE_BSD = 1 __USE_SVID = 1 __USE_GNU = 1 __USE_REENTRANT = 1 __STDC_IEC_559__ = 1 __STDC_IEC_559_COMPLEX__ = 1 __STDC_ISO_10646__ = 200009L __GNU_LIBRARY__ = 6 __GLIBC__ = 2 __GLIBC_MINOR__ = 2 # Included from sys/cdefs.h _SYS_CDEFS_H = 1 def __PMT(args): return args def __P(args): return args def __PMT(args): return args def __STRING(x): return #x __flexarr = [] __flexarr = [0] __flexarr = [] __flexarr = [1] def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) def __attribute__(xyz): return def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) def __attribute_format_arg__(x): return __USE_LARGEFILE = 1 __USE_LARGEFILE64 = 1 __USE_EXTERN_INLINES = 1 # Included from gnu/stubs.h # Included from bits/dlfcn.h RTLD_LAZY = 0x00001 RTLD_NOW = 0x00002 RTLD_BINDING_MASK = 0x3 RTLD_NOLOAD = 0x00004 RTLD_GLOBAL = 0x00100 RTLD_LOCAL = 0 RTLD_NODELETE = 0x01000 --- NEW FILE: TYPES.py --- # Generated by h2py from /usr/include/sys/types.h _SYS_TYPES_H = 1 # Included from features.h _FEATURES_H = 1 __USE_ANSI = 1 __FAVOR_BSD = 1 _ISOC99_SOURCE = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 199506L _XOPEN_SOURCE = 600 _XOPEN_SOURCE_EXTENDED = 1 _LARGEFILE64_SOURCE = 1 _BSD_SOURCE = 1 _SVID_SOURCE = 1 _BSD_SOURCE = 1 _SVID_SOURCE = 1 __USE_ISOC99 = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 2 _POSIX_C_SOURCE = 199506L __USE_POSIX = 1 __USE_POSIX2 = 1 __USE_POSIX199309 = 1 __USE_POSIX199506 = 1 __USE_XOPEN = 1 __USE_XOPEN_EXTENDED = 1 __USE_UNIX98 = 1 _LARGEFILE_SOURCE = 1 __USE_XOPEN2K = 1 __USE_ISOC99 = 1 __USE_XOPEN_EXTENDED = 1 __USE_LARGEFILE = 1 __USE_LARGEFILE64 = 1 __USE_FILE_OFFSET64 = 1 __USE_MISC = 1 __USE_BSD = 1 __USE_SVID = 1 __USE_GNU = 1 __USE_REENTRANT = 1 __STDC_IEC_559__ = 1 __STDC_IEC_559_COMPLEX__ = 1 __STDC_ISO_10646__ = 200009L __GNU_LIBRARY__ = 6 __GLIBC__ = 2 __GLIBC_MINOR__ = 2 # Included from sys/cdefs.h _SYS_CDEFS_H = 1 def __PMT(args): return args def __P(args): return args def __PMT(args): return args def __STRING(x): return #x __flexarr = [] __flexarr = [0] __flexarr = [] __flexarr = [1] def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) def __attribute__(xyz): return def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) def __attribute_format_arg__(x): return __USE_LARGEFILE = 1 __USE_LARGEFILE64 = 1 __USE_EXTERN_INLINES = 1 # Included from gnu/stubs.h # Included from bits/types.h _BITS_TYPES_H = 1 __FD_SETSIZE = 1024 # Included from bits/pthreadtypes.h _BITS_PTHREADTYPES_H = 1 # Included from bits/sched.h SCHED_OTHER = 0 SCHED_FIFO = 1 SCHED_RR = 2 CSIGNAL = 0x000000ff CLONE_VM = 0x00000100 CLONE_FS = 0x00000200 CLONE_FILES = 0x00000400 CLONE_SIGHAND = 0x00000800 CLONE_PID = 0x00001000 CLONE_PTRACE = 0x00002000 CLONE_VFORK = 0x00004000 __defined_schedparam = 1 # Included from time.h _TIME_H = 1 # Included from bits/time.h _BITS_TIME_H = 1 CLOCKS_PER_SEC = 1000000l CLOCK_REALTIME = 0 CLOCK_PROCESS_CPUTIME_ID = 2 CLOCK_THREAD_CPUTIME_ID = 3 TIMER_ABSTIME = 1 _STRUCT_TIMEVAL = 1 CLK_TCK = CLOCKS_PER_SEC __clock_t_defined = 1 __time_t_defined = 1 __clockid_t_defined = 1 __timer_t_defined = 1 __timespec_defined = 1 def __isleap(year): return \ __BIT_TYPES_DEFINED__ = 1 # Included from endian.h _ENDIAN_H = 1 __LITTLE_ENDIAN = 1234 __BIG_ENDIAN = 4321 __PDP_ENDIAN = 3412 # Included from bits/endian.h __BYTE_ORDER = __LITTLE_ENDIAN __FLOAT_WORD_ORDER = __BYTE_ORDER LITTLE_ENDIAN = __LITTLE_ENDIAN BIG_ENDIAN = __BIG_ENDIAN PDP_ENDIAN = __PDP_ENDIAN BYTE_ORDER = __BYTE_ORDER # Included from sys/select.h _SYS_SELECT_H = 1 # Included from bits/select.h def __FD_ZERO(fdsp): return \ def __FD_ZERO(set): return \ # Included from bits/sigset.h _SIGSET_H_types = 1 _SIGSET_H_fns = 1 def __sigmask(sig): return \ def __sigemptyset(set): return \ def __sigfillset(set): return \ def __sigisemptyset(set): return \ def __FDELT(d): return ((d) / __NFDBITS) FD_SETSIZE = __FD_SETSIZE def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp) # Included from sys/sysmacros.h _SYS_SYSMACROS_H = 1 def major(dev): return ((int)(((dev) >> 8) & 0xff)) def minor(dev): return ((int)((dev) & 0xff)) def major(dev): return (((dev).__val[1] >> 8) & 0xff) def minor(dev): return ((dev).__val[1] & 0xff) def major(dev): return (((dev).__val[0] >> 8) & 0xff) def minor(dev): return ((dev).__val[0] & 0xff) Index: IN.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-linux2/IN.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IN.py 1997/05/09 02:21:06 1.3 --- IN.py 2001/08/09 12:48:17 1.4 *************** *** 4,39 **** # Included from features.h _FEATURES_H = 1 - _GNU_SOURCE = 1 __USE_ANSI = 1 __FAVOR_BSD = 1 _BSD_SOURCE = 1 _SVID_SOURCE = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 2 __USE_POSIX = 1 [...961 lines suppressed...] ! def IN6_IS_ADDR_LOOPBACK(a): return \ ! def IN6_IS_ADDR_LINKLOCAL(a): return \ ! def IN6_IS_ADDR_SITELOCAL(a): return \ ! def IN6_IS_ADDR_V4MAPPED(a): return \ ! def IN6_IS_ADDR_V4COMPAT(a): return \ ! def IN6_IS_ADDR_MC_NODELOCAL(a): return \ ! def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ ! def IN6_IS_ADDR_MC_SITELOCAL(a): return \ ! ! def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ ! ! def IN6_IS_ADDR_MC_GLOBAL(a): return \ Index: regen =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/plat-linux2/regen,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** regen 2001/07/31 08:47:55 1.2 --- regen 2001/08/09 12:48:17 1.3 *************** *** 6,8 **** esac set -v ! h2py -i '(u_long)' /usr/include/netinet/in.h --- 6,8 ---- esac set -v ! h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h From nascheme@users.sourceforge.net Thu Aug 9 16:38:34 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Thu, 09 Aug 2001 08:38:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.15,2.16 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv21292/Modules Modified Files: gcmodule.c Log Message: Add get_referents function. Closes SF patch #402925. Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -d -r2.15 -r2.16 *** gcmodule.c 2000/10/04 16:34:09 2.15 --- gcmodule.c 2001/08/09 15:38:31 2.16 *************** *** 678,682 **** --- 678,729 ---- } + struct referents{ + PyObject *objs; + int seen; + }; + + static int + referentsvisit(PyObject* obj, struct referents* refs) + { + if (PySequence_Contains (refs->objs, obj)) { + refs->seen = 1; + return 1; + } + return 0; + } + + static void + gc_referents_for(PyObject *objs, PyGC_Head *list, PyObject *resultlist) + { + PyGC_Head *gc; + PyObject *obj; + traverseproc traverse; + struct referents refs = {objs, 0}; + for (gc = list->gc_next; gc != list; gc = gc->gc_next){ + obj = PyObject_FROM_GC(gc); + traverse = obj->ob_type->tp_traverse; + if (obj == objs || obj == resultlist) + continue; + if (traverse(obj, (visitproc)referentsvisit, &refs)) { + PyList_Append(resultlist, obj); + refs.seen = 0; + } + } + } + + static char gc_get_referents__doc__[]= + "get_referents(*objs) -> list\n\ + Return the list of objects that directly refer to any of objs."; + static PyObject* + gc_get_referents(PyObject *self, PyObject* args) + { + PyObject *result = PyList_New(0); + gc_referents_for(args, &generation0, result); + gc_referents_for(args, &generation1, result); + gc_referents_for(args, &generation2, result); + return result; + } + static char gc__doc__ [] = "This module provides access to the garbage collector for reference cycles.\n" *************** *** 690,693 **** --- 737,741 ---- "set_threshold() -- Set the collection thresholds.\n" "get_threshold() -- Return the current the collection thresholds.\n" + "get_referents() -- Return the list of objects that refer to an object.\n" ; *************** *** 701,704 **** --- 749,754 ---- {"get_threshold", gc_get_thresh, METH_VARARGS, gc_get_thresh__doc__}, {"collect", gc_collect, METH_VARARGS, gc_collect__doc__}, + {"get_referents", gc_get_referents, METH_VARARGS, + gc_get_referents__doc__}, {NULL, NULL} /* Sentinel */ }; From gvanrossum@users.sourceforge.net Thu Aug 9 16:42:13 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 08:42:13 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0042.txt,1.52,1.53 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv22261 Modified Files: pep-0042.txt Log Message: The getopt wish is fulfilled! Add wish about building a shared lib. Index: pep-0042.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0042.txt,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** pep-0042.txt 2001/08/01 20:11:56 1.52 --- pep-0042.txt 2001/08/09 15:42:11 1.53 *************** *** 272,281 **** http://sourceforge.net/bugs/?func=detailbug&bug_id=116326&group_id=5470 - - We should rename and rationalize the API getopt.c provides, and - always use this, instead of trying to rely on the platform - getopt and fighting with its prototype. - - http://www.python.org/pipermail/python-dev/2000-October/016620.html - - There's a name conflict on case insensitive filesystems (in particular Mac OSX) between the directory "Python" and the key --- 272,275 ---- *************** *** 294,297 **** --- 288,296 ---- http://sourceforge.net/bugs/?func=detailbug&bug_id=119221&group_id=5470 + + - There should be at least an option to build Python as a shared + library. + + http://sf.net/tracker/index.php?func=detail&aid=400938&group_id=5470&atid=305470 From nascheme@users.sourceforge.net Thu Aug 9 16:59:01 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Thu, 09 Aug 2001 08:59:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.16,2.17 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv28223/Modules Modified Files: gcmodule.c Log Message: Add get_objects function. This is a low level function (like get_referents, and is not yet documented in the library manual). Suggestions for a better name welcome. Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -d -r2.16 -r2.17 *** gcmodule.c 2001/08/09 15:38:31 2.16 --- gcmodule.c 2001/08/09 15:58:59 2.17 *************** *** 726,729 **** --- 726,765 ---- } + static char gc_get_objects__doc__[] = + "get_objects() -> [...]\n" + "\n" + "Return a list of objects tracked by the collector (excluding the list\n" + "returned).\n" + ; + + /* appending objects in a GC list to a Python list */ + static void + append_objects(PyObject *py_list, PyGC_Head *gc_list) + { + PyGC_Head *gc; + for (gc = gc_list->gc_next; gc != gc_list; gc = gc->gc_next) { + PyObject *op = PyObject_FROM_GC(gc); + if (op != py_list) { + Py_INCREF(op); + PyList_Append(py_list, op); + } + } + } + + static PyObject * + gc_get_objects(PyObject *self, PyObject *args) + { + PyObject* result; + + if (!PyArg_ParseTuple(args, ":get_objects")) /* check no args */ + return NULL; + result = PyList_New(0); + append_objects(result, &generation0); + append_objects(result, &generation1); + append_objects(result, &generation2); + return result; + } + + static char gc__doc__ [] = "This module provides access to the garbage collector for reference cycles.\n" *************** *** 737,740 **** --- 773,777 ---- "set_threshold() -- Set the collection thresholds.\n" "get_threshold() -- Return the current the collection thresholds.\n" + "get_objects() -- Return a list of all objects tracked by the collector.\n" "get_referents() -- Return the list of objects that refer to an object.\n" ; *************** *** 749,752 **** --- 786,790 ---- {"get_threshold", gc_get_thresh, METH_VARARGS, gc_get_thresh__doc__}, {"collect", gc_collect, METH_VARARGS, gc_collect__doc__}, + {"get_objects", gc_get_objects,METH_VARARGS, gc_get_objects__doc__}, {"get_referents", gc_get_referents, METH_VARARGS, gc_get_referents__doc__}, From nascheme@users.sourceforge.net Thu Aug 9 17:04:31 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Thu, 09 Aug 2001 09:04:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.102,1.103 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv29854/Misc Modified Files: ACKS Log Message: One more. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** ACKS 2001/08/08 20:50:07 1.102 --- ACKS 2001/08/09 16:04:28 1.103 *************** *** 370,373 **** --- 370,374 ---- George Sipe Kragen Sitaker + Gregory P. Smith Rafal Smotrzyk Dirk Soede From gvanrossum@users.sourceforge.net Thu Aug 9 17:37:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 09:37:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python pythonrun.c,2.141,2.142 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv5040 Modified Files: pythonrun.c Log Message: Apply SF patch #424554: check for PYTHONDUMPREFS to be set instead of asking to print the references. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.141 retrieving revision 2.142 diff -C2 -d -r2.141 -r2.142 *** pythonrun.c 2001/08/07 17:24:28 2.141 --- pythonrun.c 2001/08/09 16:37:16 2.142 *************** *** 231,239 **** #ifdef Py_TRACE_REFS ! if ( ! #ifdef MS_WINDOWS /* Only ask on Windows if env var set */ ! Py_GETENV("PYTHONDUMPREFS") && ! #endif /* MS_WINDOWS */ ! _Py_AskYesNo("Print left references?")) { _Py_PrintReferences(stderr); } --- 231,235 ---- #ifdef Py_TRACE_REFS ! if (Py_GETENV("PYTHONDUMPREFS")) { _Py_PrintReferences(stderr); } From gvanrossum@users.sourceforge.net Thu Aug 9 17:42:10 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 09:42:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk turtle.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv6263 Modified Files: turtle.py Log Message: Applied SF patch #438424 by Josh Cogliati: Python's logolike module turtle.py did not display the turtle except when actually drawing lines. This patch changes the turtle.py module so that it displays the turtle at all times when tracing is on. This is similar to the the way that logo works. When tracing is off the turtle will not be displayed. Index: turtle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/turtle.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** turtle.py 2001/01/01 19:11:07 1.4 --- turtle.py 2001/08/09 16:42:07 1.5 *************** *** 12,15 **** --- 12,16 ---- self._items = [] self._tracing = 1 + self._arrow = 0 self.degrees() self.reset() *************** *** 49,55 **** --- 50,62 ---- for item in items: canvas.delete(item) + self._delete_turtle() + self._draw_turtle() + def tracer(self, flag): self._tracing = flag + if not self._tracing: + self._delete_turtle() + self._draw_turtle() def forward(self, distance): *************** *** 64,67 **** --- 71,75 ---- def left(self, angle): self._angle = (self._angle + angle) % self._fullcircle + self._draw_turtle() def right(self, angle): *************** *** 88,92 **** except Tkinter.TclError: raise Error, "bad color string: %s" % `color` ! self._color = color return try: --- 96,100 ---- except Tkinter.TclError: raise Error, "bad color string: %s" % `color` ! self._set_color(color) return try: *************** *** 104,109 **** x = 255.0 y = 0.5 ! self._color = "#%02x%02x%02x" % (int(r*x+y), int(g*x+y), int(b*x+y)) def write(self, arg, move=0): x, y = start = self._position --- 112,122 ---- x = 255.0 y = 0.5 ! self._set_color("#%02x%02x%02x" % (int(r*x+y), int(g*x+y), int(b*x+y))) + def _set_color(self,color): + self._color = color + self._draw_turtle() + + def write(self, arg, move=0): x, y = start = self._position *************** *** 116,119 **** --- 129,133 ---- x0, y0, x1, y1 = self._canvas.bbox(item) self._goto(x1, y1) + self._draw_turtle() def fill(self, flag): *************** *** 206,210 **** self._path.append(self._position) if self._drawing: ! if self._tracing: dx = float(x1 - x0) dy = float(y1 - y0) --- 220,224 ---- self._path.append(self._position) if self._drawing: ! if self._tracing: dx = float(x1 - x0) dy = float(y1 - y0) *************** *** 213,217 **** item = self._canvas.create_line(x0, y0, x0, y0, width=self._width, - arrow="last", capstyle="round", fill=self._color) --- 227,230 ---- *************** *** 220,223 **** --- 233,237 ---- x, y = x0 + dx*i/nhops, y0 + dy*i/nhops self._canvas.coords(item, x0, y0, x, y) + self._draw_turtle((x,y)) self._canvas.update() self._canvas.after(10) *************** *** 234,237 **** --- 248,275 ---- fill=self._color) self._items.append(item) + self._draw_turtle() + + def _draw_turtle(self,position=[]): + if not self._tracing: + return + if position == []: + position = self._position + x,y = position + distance = 8 + dx = distance * cos(self._angle*self._invradian) + dy = distance * sin(self._angle*self._invradian) + self._delete_turtle() + self._arrow = _canvas.create_line(x-dx,y+dy,x,y, + width=self._width, + arrow="last", + capstyle="round", + fill=self._color) + self._canvas.update() + + def _delete_turtle(self): + if self._arrow != 0: + self._canvas.delete(self._arrow) + self._arrow = 0 + From gvanrossum@users.sourceforge.net Thu Aug 9 17:43:54 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 09:43:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.103,1.104 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv6957 Modified Files: ACKS Log Message: Added Josh Cogliati (turtle.py contributor). Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** ACKS 2001/08/09 16:04:28 1.103 --- ACKS 2001/08/09 16:43:52 1.104 *************** *** 79,82 **** --- 79,83 ---- Mike Clarkson Steve Clift + Josh Cogliati Dave Cole Benjamin Collar From gvanrossum@users.sourceforge.net Thu Aug 9 17:53:51 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 09:53:51 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0042.txt,1.53,1.54 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv9144 Modified Files: pep-0042.txt Log Message: Add some more feature requests from SF. Index: pep-0042.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0042.txt,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** pep-0042.txt 2001/08/09 15:42:11 1.53 --- pep-0042.txt 2001/08/09 16:53:49 1.54 *************** *** 34,38 **** returns the size of the object struct itself. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110835&group_id=5470 - Add C API functions to help Windows users who are building --- 34,38 ---- returns the size of the object struct itself. ! http://sf.net/bugs/?func=detailbug&bug_id=110835&group_id=5470 - Add C API functions to help Windows users who are building *************** *** 40,44 **** the FILE * the interpreter was compiled with. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110821&group_id=5470 See this bug report for a specific suggestion that will allow a --- 40,44 ---- the FILE * the interpreter was compiled with. ! http://sf.net/bugs/?func=detailbug&bug_id=110821&group_id=5470 See this bug report for a specific suggestion that will allow a *************** *** 54,58 **** deep. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=115555&group_id=5470 - The buffer interface could be smarter when a buffer object is --- 54,58 ---- deep. ! http://sf.net/bugs/?func=detailbug&bug_id=115555&group_id=5470 - The buffer interface could be smarter when a buffer object is *************** *** 62,66 **** object should have the original object as a base. Or not. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=116405&group_id=5470 --- 62,66 ---- object should have the original object as a base. Or not. ! http://sf.net/bugs/?func=detailbug&bug_id=116405&group_id=5470 *************** *** 71,80 **** needed. ! http://sourceforge.net/bugs/?func=detailbug&group_id=5470&bug_id=110819 - The urllib module should support proxies which require authenication. See SourceForge bug #110619 for information: ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110619&group_id=5470 - Use objects with attributes in place of tuples of values for --- 71,80 ---- needed. ! http://sf.net/bugs/?func=detailbug&group_id=5470&bug_id=110819 - The urllib module should support proxies which require authenication. See SourceForge bug #110619 for information: ! http://sf.net/bugs/?func=detailbug&bug_id=110619&group_id=5470 - Use objects with attributes in place of tuples of values for *************** *** 83,87 **** os.statvfs(); see SourceForge bug #111481: ! http://sourceforge.net/bugs/?func=detailbug&bug_id=111481&group_id=5470 which shows very specifically why this approach is better than --- 83,87 ---- os.statvfs(); see SourceForge bug #111481: ! http://sf.net/bugs/?func=detailbug&bug_id=111481&group_id=5470 which shows very specifically why this approach is better than *************** *** 94,98 **** Linux is one system that requires this treatment. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=112317&group_id=5470 - signal handling doesn't always work as expected. E.g. if --- 94,98 ---- Linux is one system that requires this treatment. ! http://sf.net/bugs/?func=detailbug&bug_id=112317&group_id=5470 - signal handling doesn't always work as expected. E.g. if *************** *** 103,107 **** interruptable I/O. So it's a big project. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110599&group_id=5470 - Ensure that all .py files in the std library use 4-space indents and --- 103,107 ---- interruptable I/O. So it's a big project. ! http://sf.net/bugs/?func=detailbug&bug_id=110599&group_id=5470 - Ensure that all .py files in the std library use 4-space indents and *************** *** 111,141 **** 250 files are affected, will wait until after 2.0final is released. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=114557&group_id=5470 - Port the Python SSL code to Windows. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110683&group_id=5470 - Extend Windows utime to accept directory paths. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=114245&group_id=5470 - Extend copy.py to class, module & function types. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=114553&group_id=5470 - Better checking for bad input to marshal.load*(). ! http://sourceforge.net/bugs/?func=detailbug&bug_id=114754&group_id=5470 - Generalize eval to accept any mapping objects for locals and globals. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=115126&group_id=5470 - Add a portable implementation of time.strptime() that works in clearly defined ways on all platforms. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=115146&group_id=5470 ! http://sourceforge.net/bugs/?func=detailbug&bug_id=112244&group_id=5470 - rfc822.py should be more lenient than the spec in the types of --- 111,141 ---- 250 files are affected, will wait until after 2.0final is released. ! http://sf.net/bugs/?func=detailbug&bug_id=114557&group_id=5470 - Port the Python SSL code to Windows. ! http://sf.net/bugs/?func=detailbug&bug_id=110683&group_id=5470 - Extend Windows utime to accept directory paths. ! http://sf.net/bugs/?func=detailbug&bug_id=114245&group_id=5470 - Extend copy.py to class, module & function types. ! http://sf.net/bugs/?func=detailbug&bug_id=114553&group_id=5470 - Better checking for bad input to marshal.load*(). ! http://sf.net/bugs/?func=detailbug&bug_id=114754&group_id=5470 - Generalize eval to accept any mapping objects for locals and globals. ! http://sf.net/bugs/?func=detailbug&bug_id=115126&group_id=5470 - Add a portable implementation of time.strptime() that works in clearly defined ways on all platforms. ! http://sf.net/bugs/?func=detailbug&bug_id=115146&group_id=5470 ! http://sf.net/bugs/?func=detailbug&bug_id=112244&group_id=5470 - rfc822.py should be more lenient than the spec in the types of *************** *** 144,153 **** be parsed correctly. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110678&group_id=5470 - cgi.py's FieldStorage class should be more conservative with memory in the face of large binary file uploads. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110674&group_id=5470 There are two issues here: first, because --- 144,153 ---- be parsed correctly. ! http://sf.net/bugs/?func=detailbug&bug_id=110678&group_id=5470 - cgi.py's FieldStorage class should be more conservative with memory in the face of large binary file uploads. ! http://sf.net/bugs/?func=detailbug&bug_id=110674&group_id=5470 There are two issues here: first, because *************** *** 161,175 **** was removed in revision 1.56 of cgi.py (see also): ! http://sourceforge.net/bugs/?func=detailbug&bug_id=119806&group_id=5470 - urllib should support proxy definitions that contain just the host and port ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110849&group_id=5470 - urlparse should be updated to comply with RFC 2396, which defines optional parameters for each segment of the page. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110834&group_id=5470 - The exceptions raised by pickle and cPickle are currently --- 161,175 ---- was removed in revision 1.56 of cgi.py (see also): ! http://sf.net/bugs/?func=detailbug&bug_id=119806&group_id=5470 - urllib should support proxy definitions that contain just the host and port ! http://sf.net/bugs/?func=detailbug&bug_id=110849&group_id=5470 - urlparse should be updated to comply with RFC 2396, which defines optional parameters for each segment of the page. ! http://sf.net/bugs/?func=detailbug&bug_id=110834&group_id=5470 - The exceptions raised by pickle and cPickle are currently *************** *** 183,187 **** one! ! http://sourceforge.net/bugs/?func=detailbug&bug_id=116716&group_id=5470 - There should be a way to say that you don't mind if str() or --- 183,187 ---- one! ! http://sf.net/bugs/?func=detailbug&bug_id=116716&group_id=5470 - There should be a way to say that you don't mind if str() or *************** *** 189,193 **** function -- ustr() has been proposed. Or something... ! http://sourceforge.net/patch/?func=detailpatch&patch_id=101527&group_id=5470 - A UTF-7 codec. It's not a great encoding, but it's required in --- 189,193 ---- function -- ustr() has been proposed. Or something... ! http://sf.net/patch/?func=detailpatch&patch_id=101527&group_id=5470 - A UTF-7 codec. It's not a great encoding, but it's required in *************** *** 199,216 **** signal. Or maybe raising an asynchronous exception. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=121115&group_id=5470 - The debugger (pdb) should understand packages. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110631&group_id=5470 - The cmath library should be rewritten in Python. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110838&group_id=5470 - Could use a more comprehensive email module. (But then again, that may be better done as a 3rd party project.) ! http://sourceforge.net/bugs/?func=detailbug&bug_id=121208&group_id=5470 - every built-in function or method (including all core --- 199,216 ---- signal. Or maybe raising an asynchronous exception. ! http://sf.net/bugs/?func=detailbug&bug_id=121115&group_id=5470 - The debugger (pdb) should understand packages. ! http://sf.net/bugs/?func=detailbug&bug_id=110631&group_id=5470 - The cmath library should be rewritten in Python. ! http://sf.net/bugs/?func=detailbug&bug_id=110838&group_id=5470 - Could use a more comprehensive email module. (But then again, that may be better done as a 3rd party project.) ! http://sf.net/bugs/?func=detailbug&bug_id=121208&group_id=5470 - every built-in function or method (including all core *************** *** 219,223 **** should more generally accept all mappings, all sequences.) ! http://sourceforge.net/bugs/?func=detailbug&bug_id=132493&group_id=5470 - Fatter math module docs and docstrings. --- 219,223 ---- should more generally accept all mappings, all sequences.) ! http://sf.net/bugs/?func=detailbug&bug_id=132493&group_id=5470 - Fatter math module docs and docstrings. *************** *** 229,232 **** --- 229,264 ---- http://sf.net/tracker/?func=detail&aid=426539&group_id=5470&atid=105470 + - Jim Fulton suggested the following: + + I wonder if it would be a good idea to have a new kind of + temporary file that stored data in memory unless: + + - The data exceeds some size, or + + - Somebody asks for a fileno. + + Then the cgi module (and other apps) could use this thing in a + uniform way. + + http://sf.net/tracker/?func=detail&aid=415692&group_id=5470&atid=355470 + + - Jim Fulton pointed out that binascii's b2a_base64() function + restricts the length of its input to 57 characters for no good + reason: the code would work for any input size but for this + check. Also, there are situations where it makes sense not to + append a newline, or to append something else than a newline. + + Proposal: + + - get rid of the input size check + + - add an optional argument giving the delimiter string to be + appended, defaulting to "\n" + + - possibly special-case None as the delimiter string to avoid + adding the pad bytes too??? + + http://sf.net/tracker/?func=detail&aid=415694&group_id=5470&atid=355470 + Tools *************** *** 236,253 **** process. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110841&group_id=5470 - Python could use a GUI builder. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110820&group_id=5470 - IDLE's key bindings should be revised. Some of the advertised bindings don't even work! ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110659&group_id=5470 - IDLE has deep problems running threaded programs. Re-architect. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=121963&group_id=5470 - Would be nice if IDLE showed which structure was being closed upon --- 268,285 ---- process. ! http://sf.net/bugs/?func=detailbug&bug_id=110841&group_id=5470 - Python could use a GUI builder. ! http://sf.net/bugs/?func=detailbug&bug_id=110820&group_id=5470 - IDLE's key bindings should be revised. Some of the advertised bindings don't even work! ! http://sf.net/bugs/?func=detailbug&bug_id=110659&group_id=5470 - IDLE has deep problems running threaded programs. Re-architect. ! http://sf.net/bugs/?func=detailbug&bug_id=121963&group_id=5470 - Would be nice if IDLE showed which structure was being closed upon *************** *** 255,259 **** The bug report also says something about TAB I didn't grok. ! http://sourceforge.net/tracker/?func=detail&aid=404444&group_id=5470&atid=105470 --- 287,291 ---- The bug report also says something about TAB I didn't grok. ! http://sf.net/tracker/?func=detail&aid=404444&group_id=5470&atid=105470 *************** *** 263,267 **** cross-compiler. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=110836&group_id=5470 - Modules/makesetup should make sure the 'config.c' file it --- 295,299 ---- cross-compiler. ! http://sf.net/bugs/?func=detailbug&bug_id=110836&group_id=5470 - Modules/makesetup should make sure the 'config.c' file it *************** *** 270,274 **** Python or C identifiers. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=116326&group_id=5470 - There's a name conflict on case insensitive filesystems (in --- 302,306 ---- Python or C identifiers. ! http://sf.net/bugs/?func=detailbug&bug_id=116326&group_id=5470 - There's a name conflict on case insensitive filesystems (in *************** *** 279,283 **** be the solution? ! http://sourceforge.net/bugs/?func=detailbug&bug_id=122215&group_id=5470 - Building from source should not attempt to overwrite the --- 311,315 ---- be the solution? ! http://sf.net/bugs/?func=detailbug&bug_id=122215&group_id=5470 - Building from source should not attempt to overwrite the *************** *** 287,291 **** environments. ! http://sourceforge.net/bugs/?func=detailbug&bug_id=119221&group_id=5470 - There should be at least an option to build Python as a shared --- 319,323 ---- environments. ! http://sf.net/bugs/?func=detailbug&bug_id=119221&group_id=5470 - There should be at least an option to build Python as a shared From loewis@users.sourceforge.net Thu Aug 9 17:57:36 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 09 Aug 2001 09:57:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk Tkinter.py,1.152,1.153 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv9842 Modified Files: Tkinter.py Log Message: Patch #403514: precompute _subst_format_str to avoid a call to string.join() on each invocation of _bind. Index: Tkinter.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkinter.py,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** Tkinter.py 2001/02/09 11:22:27 1.152 --- Tkinter.py 2001/08/09 16:57:33 1.153 *************** *** 849,854 **** % (add and '+' or '', ! funcid, ! " ".join(self._subst_format))) self.tk.call(what + (sequence, cmd)) return funcid --- 849,853 ---- % (add and '+' or '', ! funcid, self._subst_format_str)) self.tk.call(what + (sequence, cmd)) return funcid *************** *** 1013,1016 **** --- 1012,1016 ---- '%s', '%t', '%w', '%x', '%y', '%A', '%E', '%K', '%N', '%W', '%T', '%X', '%Y', '%D') + _subst_format_str = " ".join(_subst_format) def _substitute(self, *args): """Internal function.""" From gvanrossum@users.sourceforge.net Thu Aug 9 18:43:37 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 10:43:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib urllib.py,1.127,1.128 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv20420 Modified Files: urllib.py Log Message: SF Patch #420725 by Walter Doerwald: For local files urllib.py doesn't return the MIME headers that the documentation says it does: http://www.python.org/doc/current/lib/module- urllib.html#l2h-2187 states that "When the method is local-file, returned headers will include a Date representing the file's last-modified time, a Content- Length giving file size, and a Content-Type containing a guess at the file's type" But in Python 2.1 the only header that gets returned is the Content-Type: >>> import urllib >>> f = urllib.urlopen("gurk.txt") >>> f.info().headers ['Content-Type: text/plain\n'] Index: urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** urllib.py 2001/07/04 05:18:29 1.127 --- urllib.py 2001/08/09 17:43:35 1.128 *************** *** 26,29 **** --- 26,31 ---- import socket import os + import stat + import time import sys import types *************** *** 403,415 **** """Use local file.""" import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( ! 'Content-Type: %s\n' % (mtype or 'text/plain'))) ! host, file = splithost(url) if not host: urlfile = file if file[:1] == '/': urlfile = 'file://' + file ! return addinfourl(open(url2pathname(file), 'rb'), headers, urlfile) host, port = splitport(host) --- 405,428 ---- """Use local file.""" import mimetypes, mimetools, StringIO + host, file = splithost(url) + localname = url2pathname(file) + stats = os.stat(localname) + size = stats[stat.ST_SIZE] + modified = time.gmtime(stats[stat.ST_MTIME]) + modified = "%s, %02d %s %04d %02d:%02d:%02d GMT" % ( + ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][modified[6]], + modified[2], + ["Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][modified[1]-1], + modified[0], modified[3], modified[4], modified[5]) mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( ! 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % ! (mtype or 'text/plain', size, modified))) if not host: urlfile = file if file[:1] == '/': urlfile = 'file://' + file ! return addinfourl(open(localname, 'rb'), headers, urlfile) host, port = splitport(host) *************** *** 419,423 **** if file[:1] == '/': urlfile = 'file://' + file ! return addinfourl(open(url2pathname(file), 'rb'), headers, urlfile) raise IOError, ('local file error', 'not on local host') --- 432,436 ---- if file[:1] == '/': urlfile = 'file://' + file ! return addinfourl(open(localname, 'rb'), headers, urlfile) raise IOError, ('local file error', 'not on local host') From tim_one@users.sourceforge.net Thu Aug 9 19:04:16 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 09 Aug 2001 11:04:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib urllib.py,1.128,1.129 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv24938/Lib Modified Files: urllib.py Log Message: SF patch #403640: incomplete proxy handling in URLLIB Look specific to Windows. Don't know whether it works. Index: urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** urllib.py 2001/08/09 17:43:35 1.128 --- urllib.py 2001/08/09 18:04:14 1.129 *************** *** 270,273 **** --- 270,276 ---- if user_passwd: selector = "%s://%s%s" % (urltype, realhost, rest) + if proxy_bypass(realhost): + host = realhost + #print "proxy via http:", host, selector if not host: raise IOError, ('http error', 'no host given') *************** *** 1253,1256 **** --- 1256,1262 ---- return proxies + def proxy_bypass(x): + return 0 + elif os.name == 'nt': def getproxies_registry(): *************** *** 1303,1310 **** --- 1309,1372 ---- """ return getproxies_environment() or getproxies_registry() + + def proxy_bypass(host): + try: + import _winreg + import re + import socket + except ImportError: + # Std modules, so should be around - but you never know! + return 0 + try: + internetSettings = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, + r'Software\Microsoft\Windows\CurrentVersion\Internet Settings') + proxyEnable = _winreg.QueryValueEx(internetSettings, + 'ProxyEnable')[0] + proxyOverride = str(_winreg.QueryValueEx(internetSettings, + 'ProxyOverride')[0]) + # ^^^^ Returned as Unicode but problems if not converted to ASCII + except WindowsError: + return 0 + if not proxyEnable or not proxyOverride: + return 0 + # try to make a host list from name and IP address. + host = [host] + try: + addr = socket.gethostbyname(host[0]) + if addr != host: + host.append(addr) + except socket.error: + pass + # make a check value list from the registry entry: replace the + # '' string by the localhost entry and the corresponding + # canonical entry. + proxyOverride = proxyOverride.split(';') + i = 0 + while i < len(proxyOverride): + if proxyOverride[i] == '': + proxyOverride[i:i+1] = ['localhost', + '127.0.0.1', + socket.gethostname(), + socket.gethostbyname( + socket.gethostname())] + i += 1 + # print proxyOverride + # now check if we match one of the registry values. + for test in proxyOverride: + test = test.replace(".", r"\.") # mask dots + test = test.replace("*", r".*") # change glob sequence + test = test.replace("?", r".") # change glob char + for val in host: + # print "%s <--> %s" %( test, val ) + if re.match(test, val, re.I): + return 1 + return 0 + else: # By default use environment variables getproxies = getproxies_environment + def proxy_bypass(host): + return 0 # Test and time quote() and unquote() From gvanrossum@users.sourceforge.net Thu Aug 9 19:15:01 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 11:15:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.116,2.117 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv27522 Modified Files: fileobject.c Log Message: Apply anonymous SF patch #441229. Previously, f.read() and f.readlines() checked for errors on their file object and possibly raised an IOError, but f.readline() didn't. This patch makes f.readline() behave like the others. Note that I've added a call to clearerr() since the other calls to ferror() include that too. I have no way to test this code. :-) Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.116 retrieving revision 2.117 diff -C2 -d -r2.116 -r2.117 *** fileobject.c 2001/08/06 18:51:38 2.116 --- fileobject.c 2001/08/09 18:14:59 2.117 *************** *** 848,851 **** --- 848,857 ---- break; if (c == EOF) { + if (ferror(fp)) { + PyErr_SetFromErrno(PyExc_IOError); + clearerr(fp); + Py_DECREF(v); + return NULL; + } clearerr(fp); if (PyErr_CheckSignals()) { From gvanrossum@users.sourceforge.net Thu Aug 9 19:18:10 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 11:18:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_mhlib.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv28205 Added Files: test_mhlib.py Log Message: Unittests for mhlib, by Nick Mathewson. --- NEW FILE: test_mhlib.py --- """ Tests for the mhlib module Nick Mathewson """ ### BUG: This suite doesn't currently test the mime functionality of ### mhlib. It should. import unittest from test_support import run_unittest, TESTFN import os, StringIO import mhlib _mhroot = TESTFN+"_MH" _mhpath = os.path.join(_mhroot, "MH") _mhprofile = os.path.join(_mhroot, ".mh_profile") def normF(f): return os.path.join(*f.split('/')) def writeFile(fname, contents): dir = os.path.split(fname)[0] if dir and not os.path.exists(dir): mkdirs(dir) f = open(fname, 'w') f.write(contents) f.close() def readFile(fname): f = open(fname) r = f.read() f.close() return r def writeProfile(dict): contents = [ "%s: %s\n" % (k, v) for k, v in dict.iteritems() ] writeFile(_mhprofile, "".join(contents)) def writeContext(folder): folder = normF(folder) writeFile(os.path.join(_mhpath, "context"), "Current-Folder: %s\n" % folder) def writeCurMessage(folder, cur): folder = normF(folder) writeFile(os.path.join(_mhpath, folder, ".mh_sequences"), "cur: %s\n"%cur) def writeMessage(folder, n, headers, body): folder = normF(folder) headers = "".join([ "%s: %s\n" % (k, v) for k, v in headers.iteritems() ]) contents = "%s\n%s\n" % (headers,body) mkdirs(os.path.join(_mhpath, folder)) writeFile(os.path.join(_mhpath, folder, str(n)), contents) def getMH(): return mhlib.MH(os.path.abspath(_mhpath), _mhprofile) def sortLines(s): lines = s.split("\n") lines = [ line.strip() for line in lines if len(line) >= 2 ] lines.sort() return lines # These next 2 functions are copied from test_glob.py. def mkdirs(fname): if os.path.exists(fname) or fname == '': return base, file = os.path.split(fname) mkdirs(base) os.mkdir(fname) def deltree(fname): if not os.path.exists(fname): return for f in os.listdir(fname): fullname = os.path.join(fname, f) if os.path.isdir(fullname): deltree(fullname) else: try: os.unlink(fullname) except: pass try: os.rmdir(fname) except: pass class MhlibTests(unittest.TestCase): def setUp(self): deltree(_mhroot) mkdirs(_mhpath) writeProfile({'Path' : os.path.abspath(_mhpath), 'Editor': 'emacs', 'ignored-attribute': 'camping holiday'}) # Note: These headers aren't really conformant to RFC822, but # mhlib shouldn't care about that. # An inbox with a couple of messages. writeMessage('inbox', 1, {'From': 'Mrs. Premise', 'To': 'Mrs. Conclusion', 'Date': '18 July 2001'}, "Hullo, Mrs. Conclusion!\n") writeMessage('inbox', 2, {'From': 'Mrs. Conclusion', 'To': 'Mrs. Premise', 'Date': '29 July 2001'}, "Hullo, Mrs. Premise!\n") # A folder with many messages for i in range(5, 101)+range(101, 201, 2): writeMessage('wide', i, {'From': 'nowhere', 'Subject': 'message #%s' % i}, "This is message number %s\n" % i) # A deeply nested folder def deep(folder, n): writeMessage(folder, n, {'Subject': 'Message %s/%s' % (folder, n) }, "This is message number %s in %s\n" % (n, folder) ) deep('deep/f1', 1) deep('deep/f1', 2) deep('deep/f1', 3) deep('deep/f2', 4) deep('deep/f2', 6) deep('deep', 3) deep('deep/f2/f3', 1) deep('deep/f2/f3', 2) def tearDown(self): deltree(_mhroot) def test_basic(self): writeContext('inbox') writeCurMessage('inbox', 2) mh = getMH() eq = self.assertEquals eq(mh.getprofile('Editor'), 'emacs') eq(mh.getprofile('not-set'), None) eq(mh.getpath(), os.path.abspath(_mhpath)) eq(mh.getcontext(), 'inbox') mh.setcontext('wide') eq(mh.getcontext(), 'wide') eq(readFile(os.path.join(_mhpath, 'context')), "Current-Folder: wide\n") mh.setcontext('inbox') inbox = mh.openfolder('inbox') eq(inbox.getfullname(), os.path.join(os.path.abspath(_mhpath), 'inbox')) eq(inbox.getsequencesfilename(), os.path.join(os.path.abspath(_mhpath), 'inbox', '.mh_sequences')) eq(inbox.getmessagefilename(1), os.path.join(os.path.abspath(_mhpath), 'inbox', '1')) def test_listfolders(self): mh = getMH() eq = self.assertEquals folders = mh.listfolders() folders.sort() eq(folders, ['deep', 'inbox', 'wide']) folders = mh.listallfolders() folders.sort() eq(folders, map(normF, ['deep', 'deep/f1', 'deep/f2', 'deep/f2/f3', 'inbox', 'wide'])) folders = mh.listsubfolders('deep') folders.sort() eq(folders, map(normF, ['deep/f1', 'deep/f2'])) folders = mh.listallsubfolders('deep') folders.sort() eq(folders, map(normF, ['deep/f1', 'deep/f2', 'deep/f2/f3'])) eq(mh.listsubfolders(normF('deep/f2')), [normF('deep/f2/f3')]) eq(mh.listsubfolders('inbox'), []) eq(mh.listallsubfolders('inbox'), []) def test_sequence(self): mh = getMH() eq = self.assertEquals writeCurMessage('wide', 55) f = mh.openfolder('wide') all = f.listmessages() eq(all, range(5, 101)+range(101, 201, 2)) eq(f.getcurrent(), 55) f.setcurrent(99) eq(readFile(os.path.join(_mhpath, 'wide', '.mh_sequences')), 'cur: 99\n') def seqeq(seq, val): eq(f.parsesequence(seq), val) seqeq('5-55', range(5, 56)) seqeq('90-108', range(90, 101)+range(101, 109, 2)) seqeq('90-108', range(90, 101)+range(101, 109, 2)) seqeq('10:10', range(10, 20)) seqeq('10:+10', range(10, 20)) seqeq('101:10', range(101, 121, 2)) seqeq('cur', [99]) seqeq('.', [99]) seqeq('prev', [98]) seqeq('next', [100]) seqeq('cur:-3', [97, 98, 99]) seqeq('first-cur', range(5, 100)) seqeq('150-last', range(151, 201, 2)) seqeq('prev-next', [98, 99, 100]) lowprimes = [5, 7, 11, 13, 17, 19, 23, 29] lowcompos = [x for x in range(5, 31) if not x in lowprimes ] f.putsequences({'cur': [5], 'lowprime': lowprimes, 'lowcompos': lowcompos}) seqs = readFile(os.path.join(_mhpath, 'wide', '.mh_sequences')) seqs = sortLines(seqs) eq(seqs, ["cur: 5", "lowcompos: 6 8-10 12 14-16 18 20-22 24-28 30", "lowprime: 5 7 11 13 17 19 23 29"]) seqeq('lowprime', lowprimes) seqeq('lowprime:1', [5]) seqeq('lowprime:2', [5, 7]) seqeq('lowprime:-2', [23, 29]) ## Not supported #seqeq('lowprime:first', [5]) #seqeq('lowprime:last', [29]) #seqeq('lowprime:prev', [29]) #seqeq('lowprime:next', [29]) def test_modify(self): mh = getMH() eq = self.assertEquals mh.makefolder("dummy1") self.assert_("dummy1" in mh.listfolders()) path = os.path.join(_mhpath, "dummy1") self.assert_(os.path.exists(path)) f = mh.openfolder('dummy1') def create(n): msg = "From: foo\nSubject: %s\n\nDummy Message %s\n" % (n,n) f.createmessage(n, StringIO.StringIO(msg)) create(7) create(8) create(9) eq(readFile(f.getmessagefilename(9)), "From: foo\nSubject: 9\n\nDummy Message 9\n") eq(f.listmessages(), [7, 8, 9]) files = os.listdir(path) files.sort() eq(files, ['7', '8', '9']) f.removemessages(['7', '8']) files = os.listdir(path) files.sort() eq(files, [',7', ',8', '9']) eq(f.listmessages(), [9]) create(10) create(11) create(12) mh.makefolder("dummy2") f2 = mh.openfolder("dummy2") eq(f2.listmessages(), []) f.movemessage(10, f2, 3) f.movemessage(11, f2, 5) eq(f.listmessages(), [9, 12]) eq(f2.listmessages(), [3, 5]) eq(readFile(f2.getmessagefilename(3)), "From: foo\nSubject: 10\n\nDummy Message 10\n") f.copymessage(9, f2, 4) eq(f.listmessages(), [9, 12]) eq(readFile(f2.getmessagefilename(4)), "From: foo\nSubject: 9\n\nDummy Message 9\n") f.refilemessages([9, 12], f2) eq(f.listmessages(), []) eq(f2.listmessages(), [3, 4, 5, 6, 7]) eq(readFile(f2.getmessagefilename(7)), "From: foo\nSubject: 12\n\nDummy Message 12\n") # XXX This should check that _copysequences does the right thing. mh.deletefolder('dummy1') mh.deletefolder('dummy2') self.assert_('dummy1' not in mh.listfolders()) self.assert_(not os.path.exists(path)) def test_read(self): mh = getMH() eq = self.assertEquals f = mh.openfolder('inbox') msg = f.openmessage(1) # Check some basic stuff from rfc822 eq(msg.getheader('From'), "Mrs. Premise") eq(msg.getheader('To'), "Mrs. Conclusion") # Okay, we have the right message. Let's check the stuff from # mhlib. lines = sortLines(msg.getheadertext()) eq(lines, ["Date: 18 July 2001", "From: Mrs. Premise", "To: Mrs. Conclusion"]) lines = sortLines(msg.getheadertext(lambda h: len(h)==4)) eq(lines, ["Date: 18 July 2001", "From: Mrs. Premise"]) eq(msg.getbodytext(), "Hullo, Mrs. Conclusion!\n\n") eq(msg.getbodytext(0), "Hullo, Mrs. Conclusion!\n\n") # XXXX there should be a better way to reclaim the file handle msg.fp.close() del msg run_unittest(MhlibTests) From gvanrossum@users.sourceforge.net Thu Aug 9 19:56:29 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 11:56:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib repr.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv4661 Modified Files: repr.py Log Message: Use type(x).__name__ to get the name of the type instead of parsing repr(type(x)). Index: repr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/repr.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** repr.py 2001/08/02 04:15:00 1.10 --- repr.py 2001/08/09 18:56:27 1.11 *************** *** 15,19 **** return self.repr1(x, self.maxlevel) def repr1(self, x, level): ! typename = `type(x)`[7:-2] # "" if ' ' in typename: parts = typename.split() --- 15,19 ---- return self.repr1(x, self.maxlevel) def repr1(self, x, level): ! typename = type(x).__name__ if ' ' in typename: parts = typename.split() From gvanrossum@users.sourceforge.net Thu Aug 9 20:38:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 12:38:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.25,2.26 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv17425 Modified Files: typeobject.c Log Message: Thinking back to the 2.22 revision, I didn't like what I did there one bit. For one, this class: class C(object): def __new__(myclass, ...): ... would have no way to call the __new__ method of its base class, and the workaround (to create an intermediate base class whose __new__ you can call) is ugly. So, I've come up with a better solution that restores object.__new__, but still solves the original problem, which is that built-in and extension types shouldn't inherit object.__new__. The solution is simple: only "heap types" inherit tp_new. Simpler, less code, perfect! Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.25 retrieving revision 2.26 diff -C2 -d -r2.25 -r2.26 *** typeobject.c 2001/08/08 22:26:22 2.25 --- typeobject.c 2001/08/09 19:38:15 2.26 *************** *** 448,452 **** staticforward void object_dealloc(PyObject *); staticforward int object_init(PyObject *, PyObject *, PyObject *); - staticforward int add_tp_new_wrapper(PyTypeObject *); static PyObject * --- 448,451 ---- *************** *** 673,686 **** override_slots(type, type->tp_defined); - /* Special hack for __new__ */ - if (type->tp_new == NULL) { - /* Can't do this earlier, or some nasty recursion happens. */ - type->tp_new = PyType_GenericNew; - if (add_tp_new_wrapper(type) < 0) { - Py_DECREF(type); - return NULL; - } - } - return (PyObject *)type; } --- 672,675 ---- *************** *** 914,918 **** object_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ ! 0, /* tp_new */ object_free, /* tp_free */ }; --- 903,907 ---- object_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ ! PyType_GenericNew, /* tp_new */ object_free, /* tp_free */ }; *************** *** 1164,1168 **** COPYSLOT(tp_init); COPYSLOT(tp_alloc); ! COPYSLOT(tp_new); COPYSLOT(tp_free); } --- 1153,1159 ---- COPYSLOT(tp_init); COPYSLOT(tp_alloc); ! if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) { ! COPYSLOT(tp_new); ! } COPYSLOT(tp_free); } From gvanrossum@users.sourceforge.net Thu Aug 9 20:43:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 12:43:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.26,2.27 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv18874 Modified Files: typeobject.c Log Message: Sigh. Strengthen the resriction of the previous checkin: tp_new is inherited unless *both*: (a) the base type is 'object', and (b) the subtype is not a "heap" type. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -d -r2.26 -r2.27 *** typeobject.c 2001/08/09 19:38:15 2.26 --- typeobject.c 2001/08/09 19:43:37 2.27 *************** *** 1153,1157 **** COPYSLOT(tp_init); COPYSLOT(tp_alloc); ! if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) { COPYSLOT(tp_new); } --- 1153,1158 ---- COPYSLOT(tp_init); COPYSLOT(tp_alloc); ! if (base != &PyBaseObject_Type || ! (type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { COPYSLOT(tp_new); } From gvanrossum@users.sourceforge.net Thu Aug 9 20:45:23 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 12:45:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv19380 Modified Files: test_descr.py Log Message: Restore the test for 'object' that I removed when object was uninstantiable. All is well now. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_descr.py 2001/08/07 16:53:42 1.3 --- test_descr.py 2001/08/09 19:45:21 1.4 *************** *** 473,476 **** --- 473,499 ---- verify(G.__mro__ == (G, E, D, C, B, A, object)) + def objects(): + if verbose: print "Testing object class..." + a = object() + verify(a.__class__ == object == type(a)) + b = object() + verify(a is not b) + verify(not hasattr(a, "foo")) + try: + a.foo = 12 + except TypeError: + pass + else: + verify(0, "object() should not allow setting a foo attribute") + verify(not hasattr(object(), "__dict__")) + + class Cdict(object): + pass + x = Cdict() + verify(x.__dict__ is None) + x.foo = 1 + verify(x.foo == 1) + verify(x.__dict__ == {'foo': 1}) + def slots(): if verbose: print "Testing __slots__..." *************** *** 790,793 **** --- 813,817 ---- multi() diamond() + objects() slots() dynamics() From fdrake@users.sourceforge.net Thu Aug 9 21:14:37 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 09 Aug 2001 13:14:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules operator.c,2.17,2.18 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv25902/Modules Modified Files: operator.c Log Message: Add wrappers around the rich-comparison operations. This closes SF patch #428320. Add wrappers to expose "floor" and "true" division. This closes SF feature request #449093. Index: operator.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/operator.c,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -d -r2.17 -r2.18 *** operator.c 2000/09/17 16:09:27 2.17 --- operator.c 2001/08/09 20:14:34 2.18 *************** *** 111,114 **** --- 111,119 ---- return PyInt_FromLong(r); } + #define spamrc(OP,A) static PyObject *OP(PyObject *s, PyObject *a) { \ + PyObject *a1, *a2; \ + if(! PyArg_ParseTuple(a,"OO:" #OP,&a1,&a2)) return NULL; \ + return PyObject_RichCompare(a1,a2,A); } + spami(isCallable , PyCallable_Check) spami(isNumberType , PyNumber_Check) *************** *** 118,121 **** --- 123,128 ---- spam2(op_mul , PyNumber_Multiply) spam2(op_div , PyNumber_Divide) + spam2(op_floordiv , PyNumber_FloorDivide) + spam2(op_truediv , PyNumber_TrueDivide) spam2(op_mod , PyNumber_Remainder) spam1(op_neg , PyNumber_Negative) *************** *** 141,144 **** --- 148,157 ---- spam2n(op_delitem , PyObject_DelItem) spam3n(op_setitem , PyObject_SetItem) + spamrc(op_lt , Py_LT) + spamrc(op_le , Py_LE) + spamrc(op_eq , Py_EQ) + spamrc(op_ne , Py_NE) + spamrc(op_gt , Py_GT) + spamrc(op_ge , Py_GE) static PyObject* *************** *** 215,219 **** spam2(sub,__sub__, "sub(a, b) -- Same as a - b.") spam2(mul,__mul__, "mul(a, b) -- Same as a * b.") ! spam2(div,__div__, "div(a, b) -- Same as a / b.") spam2(mod,__mod__, "mod(a, b) -- Same as a % b.") spam2(neg,__neg__, "neg(a) -- Same as -a.") --- 228,234 ---- spam2(sub,__sub__, "sub(a, b) -- Same as a - b.") spam2(mul,__mul__, "mul(a, b) -- Same as a * b.") ! spam2(div,__div__, "div(a, b) -- Same as a / b when __future__.division is not in effect.") ! spam2(floordiv,__floordiv__, "floordiv(a, b) -- Same as a // b.") ! spam2(truediv,__truediv__, "truediv(a, b) -- Same as a / b when __future__.division is in effect.") spam2(mod,__mod__, "mod(a, b) -- Same as a % b.") spam2(neg,__neg__, "neg(a) -- Same as -a.") *************** *** 244,247 **** --- 259,268 ---- spam2(delslice,__delslice__, "delslice(a, b, c) -- Same as del a[b:c].") + spam2(lt,__lt__, "lt(a, b) -- Same as ab.") + spam2(ge,__ge__, "ge(a, b) -- Same as a>=b.") {NULL, NULL} /* sentinel */ From fdrake@users.sourceforge.net Thu Aug 9 21:23:10 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 09 Aug 2001 13:23:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_operator.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv27536/Lib/test Modified Files: test_operator.py Log Message: Added tests for operator.floordiv() and operator.truediv(). Index: test_operator.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_operator.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_operator.py 2000/12/12 23:11:42 1.4 --- test_operator.py 2001/08/09 20:23:08 1.5 *************** *** 32,35 **** --- 32,37 ---- a = range(10) test('div', 5, 2, 2) + test('floordiv', 5, 2, 2) + test('truediv', 5, 2.5, 2) test('getitem', a, 2, 2) test('getslice', a, [4, 5], 4, 6) From fdrake@users.sourceforge.net Thu Aug 9 21:23:10 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 09 Aug 2001 13:23:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_operator,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv27536/Lib/test/output Modified Files: test_operator Log Message: Added tests for operator.floordiv() and operator.truediv(). Index: test_operator =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_operator,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_operator 1996/12/23 23:40:03 1.2 --- test_operator 2001/08/09 20:23:08 1.3 *************** *** 8,11 **** --- 8,13 ---- testing: delslice testing: div + testing: floordiv + testing: truediv testing: getitem testing: getslice From gvanrossum@users.sourceforge.net Thu Aug 9 21:26:00 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 13:26:00 -0700 Subject: [Python-checkins] CVS: python/dist/src PLAN.txt,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv28192 Modified Files: PLAN.txt Log Message: Add resolution of __new__ story sequel. Index: PLAN.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PLAN.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PLAN.txt 2001/08/08 22:51:13 1.5 --- PLAN.txt 2001/08/09 20:25:58 1.6 *************** *** 100,103 **** --- 100,107 ---- "How do I call the default __new__ implementation???" + This was resolved nicely by putting object.__new__ back but not + inheriting __new__ from object when the subtype is a built-in or + extension type. + More -- I'm sure new issues will crop up as we go. From akuchling@users.sourceforge.net Thu Aug 9 21:57:49 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Thu, 09 Aug 2001 13:57:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils fancy_getopt.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv6163 Modified Files: fancy_getopt.py Log Message: Use correct variable name Index: fancy_getopt.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/fancy_getopt.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** fancy_getopt.py 2000/09/26 02:06:03 1.18 --- fancy_getopt.py 2001/08/09 20:57:46 1.19 *************** *** 276,280 **** if val != '': # shouldn't have a value! raise DistutilsInternalError, \ ! "this can't happen: bad option value '%s'" % value alias = self.negative_alias.get(opt) --- 276,280 ---- if val != '': # shouldn't have a value! raise DistutilsInternalError, \ ! "this can't happen: bad option value '%s'" % val alias = self.negative_alias.get(opt) From akuchling@users.sourceforge.net Thu Aug 9 21:59:55 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Thu, 09 Aug 2001 13:59:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils file_util.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv7003 Modified Files: file_util.py Log Message: Import the errno module Index: file_util.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/file_util.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** file_util.py 2001/07/25 19:48:03 1.9 --- file_util.py 2001/08/09 20:59:53 1.10 *************** *** 189,193 **** """ from os.path import exists, isfile, isdir, basename, dirname ! if verbose: print "moving %s -> %s" % (src, dst) --- 189,194 ---- """ from os.path import exists, isfile, isdir, basename, dirname ! import errno ! if verbose: print "moving %s -> %s" % (src, dst) From akuchling@users.sourceforge.net Thu Aug 9 22:02:36 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Thu, 09 Aug 2001 14:02:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils bcppcompiler.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv7727 Modified Files: bcppcompiler.py Log Message: Import UnknownFileError Index: bcppcompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/bcppcompiler.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** bcppcompiler.py 2001/02/09 11:14:08 1.8 --- bcppcompiler.py 2001/08/09 21:02:34 1.9 *************** *** 18,22 **** from distutils.errors import \ DistutilsExecError, DistutilsPlatformError, \ ! CompileError, LibError, LinkError from distutils.ccompiler import \ CCompiler, gen_preprocess_options, gen_lib_options --- 18,22 ---- from distutils.errors import \ DistutilsExecError, DistutilsPlatformError, \ ! CompileError, LibError, LinkError, UnknownFileError from distutils.ccompiler import \ CCompiler, gen_preprocess_options, gen_lib_options From gvanrossum@users.sourceforge.net Thu Aug 9 22:22:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 09 Aug 2001 14:22:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib profile.py,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv12795 Modified Files: profile.py Log Message: Fix two bugs detected by PyChecker: there's no need for redundant "import MacOS", and there *is* a need for "import operator". Index: profile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/profile.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** profile.py 2001/06/19 20:11:36 1.29 --- profile.py 2001/08/09 21:22:15 1.30 *************** *** 146,150 **** if not timer: if os.name == 'mac': - import MacOS self.timer = MacOS.GetTicks self.dispatcher = self.trace_dispatch_mac --- 146,149 ---- *************** *** 178,181 **** --- 177,181 ---- # the timer() result contains two values in all # cases. + import operator def get_time_timer(timer=timer, reduce=reduce, reducer=operator.add): From tim_one@users.sourceforge.net Thu Aug 9 22:34:56 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 09 Aug 2001 14:34:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_mhlib.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv15758/Lib/test Modified Files: test_mhlib.py Log Message: Skip test_mhlib on Windows -- too many Unix assumptions. Index: test_mhlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mhlib.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_mhlib.py 2001/08/09 18:18:08 1.1 --- test_mhlib.py 2001/08/09 21:34:54 1.2 *************** *** 8,15 **** import unittest ! from test_support import run_unittest, TESTFN import os, StringIO ! import mhlib _mhroot = TESTFN+"_MH" --- 8,19 ---- import unittest ! from test_support import run_unittest, TESTFN, TestSkipped import os, StringIO ! import sys import mhlib + + if sys.platform.startswith("win"): + raise TestSkipped("test_mhlib skipped on Windows -- " + "too many Unix assumptions") _mhroot = TESTFN+"_MH" From tim_one@users.sourceforge.net Thu Aug 9 22:40:32 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 09 Aug 2001 14:40:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib cgi.py,1.65,1.66 cmd.py,1.25,1.26 gzip.py,1.25,1.26 urllib.py,1.129,1.130 urllib2.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17028/python/dist/src/Lib Modified Files: cgi.py cmd.py gzip.py urllib.py urllib2.py Log Message: Whitespace normalization. Index: cgi.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/cgi.py,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** cgi.py 2001/07/25 21:00:19 1.65 --- cgi.py 2001/08/09 21:40:30 1.66 *************** *** 248,254 **** boundary = pdict['boundary'] if not valid_boundary(boundary): ! raise ValueError, ('Invalid boundary in multipart form: %s' % `ib`) ! nextpart = "--" + boundary lastpart = "--" + boundary + "--" --- 248,254 ---- boundary = pdict['boundary'] if not valid_boundary(boundary): ! raise ValueError, ('Invalid boundary in multipart form: %s' % `ib`) ! nextpart = "--" + boundary lastpart = "--" + boundary + "--" *************** *** 601,605 **** ib = self.innerboundary if not valid_boundary(ib): ! raise ValueError, ('Invalid boundary in multipart form: %s' % `ib`) self.list = [] --- 601,605 ---- ib = self.innerboundary if not valid_boundary(ib): ! raise ValueError, ('Invalid boundary in multipart form: %s' % `ib`) self.list = [] Index: cmd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/cmd.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** cmd.py 2001/07/28 14:44:03 1.25 --- cmd.py 2001/08/09 21:40:30 1.26 *************** *** 21,25 **** against, all returned matches must begin with it. line is the current input line (lstripped), begidx and endidx are the beginning and end ! indexes of the text being matched, which could be used to provide different completion depending upon which position the argument is in. --- 21,25 ---- against, all returned matches must begin with it. line is the current input line (lstripped), begidx and endidx are the beginning and end ! indexes of the text being matched, which could be used to provide different completion depending upon which position the argument is in. *************** *** 28,32 **** The `completedefault' method may be overridden to intercept completions for ! commands that have no complete_ method. The data member `self.ruler' sets the character used to draw separator lines --- 28,32 ---- The `completedefault' method may be overridden to intercept completions for ! commands that have no complete_ method. The data member `self.ruler' sets the character used to draw separator lines *************** *** 67,71 **** use_rawinput = 1 ! def __init__(self, completekey='tab'): if completekey: try: --- 67,71 ---- use_rawinput = 1 ! def __init__(self, completekey='tab'): if completekey: try: *************** *** 132,136 **** cmd, arg = line[:i], line[i:].strip() return cmd, arg, line ! def onecmd(self, line): cmd, arg, line = self.parseline(line) --- 132,136 ---- cmd, arg = line[:i], line[i:].strip() return cmd, arg, line ! def onecmd(self, line): cmd, arg, line = self.parseline(line) *************** *** 192,196 **** except IndexError: return None ! def get_names(self): # Inheritance says we have to look in class and --- 192,196 ---- except IndexError: return None ! def get_names(self): # Inheritance says we have to look in class and Index: gzip.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gzip.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** gzip.py 2001/08/09 07:21:56 1.25 --- gzip.py 2001/08/09 21:40:30 1.26 *************** *** 278,282 **** def rewind(self): '''Return the uncompressed stream file position indicator to the ! beginning of the file''' if self.mode != READ: raise IOError("Can't rewind in write mode") --- 278,282 ---- def rewind(self): '''Return the uncompressed stream file position indicator to the ! beginning of the file''' if self.mode != READ: raise IOError("Can't rewind in write mode") *************** *** 292,296 **** raise IOError('Negative seek in write mode') count = offset - self.offset ! for i in range(count/1024): f.write(1024*'\0') self.write((count%1024)*'\0') --- 292,296 ---- raise IOError('Negative seek in write mode') count = offset - self.offset ! for i in range(count/1024): f.write(1024*'\0') self.write((count%1024)*'\0') Index: urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** urllib.py 2001/08/09 18:04:14 1.129 --- urllib.py 2001/08/09 21:40:30 1.130 *************** *** 1354,1360 **** # now check if we match one of the registry values. for test in proxyOverride: ! test = test.replace(".", r"\.") # mask dots ! test = test.replace("*", r".*") # change glob sequence ! test = test.replace("?", r".") # change glob char for val in host: # print "%s <--> %s" %( test, val ) --- 1354,1360 ---- # now check if we match one of the registry values. for test in proxyOverride: ! test = test.replace(".", r"\.") # mask dots ! test = test.replace("*", r".*") # change glob sequence ! test = test.replace("?", r".") # change glob char for val in host: # print "%s <--> %s" %( test, val ) Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** urllib2.py 2001/08/07 21:12:25 1.17 --- urllib2.py 2001/08/09 21:40:30 1.18 *************** *** 453,457 **** # Don't close the fp until we are sure that we won't use it ! # with HTTPError. fp.read() fp.close() --- 453,457 ---- # Don't close the fp until we are sure that we won't use it ! # with HTTPError. fp.read() fp.close() From tim_one@users.sourceforge.net Thu Aug 9 22:40:32 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 09 Aug 2001 14:40:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test___all__.py,1.18,1.19 test_codeop.py,1.1,1.2 test_glob.py,1.1,1.2 test_gzip.py,1.7,1.8 test_mhlib.py,1.2,1.3 test_pkgimport.py,1.2,1.3 test_repr.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv17028/python/dist/src/Lib/test Modified Files: test___all__.py test_codeop.py test_glob.py test_gzip.py test_mhlib.py test_pkgimport.py test_repr.py Log Message: Whitespace normalization. Index: test___all__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test___all__.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test___all__.py 2001/08/04 22:22:19 1.18 --- test___all__.py 2001/08/09 21:40:30 1.19 *************** *** 42,46 **** # than an AttributeError somewhere deep in CGIHTTPServer. import _socket ! check_all("BaseHTTPServer") check_all("CGIHTTPServer") --- 42,46 ---- # than an AttributeError somewhere deep in CGIHTTPServer. import _socket ! check_all("BaseHTTPServer") check_all("CGIHTTPServer") Index: test_codeop.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codeop.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_codeop.py 2001/07/30 12:30:08 1.1 --- test_codeop.py 2001/08/09 21:40:30 1.2 *************** *** 14,18 **** expected = compile(str, "", symbol) self.assertEquals( compile_command(str, "", symbol), expected) ! def assertIncomplete(self, str, symbol='single'): --- 14,18 ---- expected = compile(str, "", symbol) self.assertEquals( compile_command(str, "", symbol), expected) ! def assertIncomplete(self, str, symbol='single'): *************** *** 42,46 **** # special case ! self.assertEquals(compile_command(""), compile("pass", "", 'single')) --- 42,46 ---- # special case ! self.assertEquals(compile_command(""), compile("pass", "", 'single')) *************** *** 48,52 **** av("(lambda z: \n z**3)","eval") av("#a\n#b\na**3","eval") ! def test_incomplete(self): ai = self.assertIncomplete --- 48,52 ---- av("(lambda z: \n z**3)","eval") av("#a\n#b\na**3","eval") ! def test_incomplete(self): ai = self.assertIncomplete *************** *** 60,64 **** ai("a = (") ai("a = 9+ \\") ! ai("(","eval") ai("(\n\n\n","eval") --- 60,64 ---- ai("a = (") ai("a = 9+ \\") ! ai("(","eval") ai("(\n\n\n","eval") Index: test_glob.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_glob.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_glob.py 2001/07/23 16:08:36 1.1 --- test_glob.py 2001/08/09 21:40:30 1.2 *************** *** 108,110 **** run_unittest(GlobTests) - --- 108,109 ---- Index: test_gzip.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gzip.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_gzip.py 2001/08/09 07:21:56 1.7 --- test_gzip.py 2001/08/09 21:40:30 1.8 *************** *** 72,76 **** f = gzip.GzipFile(filename, 'w') for pos in range(0, 256, 16): ! f.seek(pos) f.write('GZ\n') f.close() --- 72,76 ---- f = gzip.GzipFile(filename, 'w') for pos in range(0, 256, 16): ! f.seek(pos) f.write('GZ\n') f.close() Index: test_mhlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mhlib.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_mhlib.py 2001/08/09 21:34:54 1.2 --- test_mhlib.py 2001/08/09 21:40:30 1.3 *************** *** 44,48 **** def writeContext(folder): folder = normF(folder) ! writeFile(os.path.join(_mhpath, "context"), "Current-Folder: %s\n" % folder) --- 44,48 ---- def writeContext(folder): folder = normF(folder) ! writeFile(os.path.join(_mhpath, "context"), "Current-Folder: %s\n" % folder) *************** *** 97,101 **** deltree(_mhroot) mkdirs(_mhpath) ! writeProfile({'Path' : os.path.abspath(_mhpath), 'Editor': 'emacs', 'ignored-attribute': 'camping holiday'}) --- 97,101 ---- deltree(_mhroot) mkdirs(_mhpath) ! writeProfile({'Path' : os.path.abspath(_mhpath), 'Editor': 'emacs', 'ignored-attribute': 'camping holiday'}) *************** *** 104,125 **** # An inbox with a couple of messages. ! writeMessage('inbox', 1, {'From': 'Mrs. Premise', 'To': 'Mrs. Conclusion', 'Date': '18 July 2001'}, "Hullo, Mrs. Conclusion!\n") ! writeMessage('inbox', 2, {'From': 'Mrs. Conclusion', 'To': 'Mrs. Premise', 'Date': '29 July 2001'}, "Hullo, Mrs. Premise!\n") ! # A folder with many messages for i in range(5, 101)+range(101, 201, 2): ! writeMessage('wide', i, {'From': 'nowhere', 'Subject': 'message #%s' % i}, "This is message number %s\n" % i) ! # A deeply nested folder def deep(folder, n): ! writeMessage(folder, n, {'Subject': 'Message %s/%s' % (folder, n) }, "This is message number %s in %s\n" % (n, folder) ) --- 104,125 ---- # An inbox with a couple of messages. ! writeMessage('inbox', 1, {'From': 'Mrs. Premise', 'To': 'Mrs. Conclusion', 'Date': '18 July 2001'}, "Hullo, Mrs. Conclusion!\n") ! writeMessage('inbox', 2, {'From': 'Mrs. Conclusion', 'To': 'Mrs. Premise', 'Date': '29 July 2001'}, "Hullo, Mrs. Premise!\n") ! # A folder with many messages for i in range(5, 101)+range(101, 201, 2): ! writeMessage('wide', i, {'From': 'nowhere', 'Subject': 'message #%s' % i}, "This is message number %s\n" % i) ! # A deeply nested folder def deep(folder, n): ! writeMessage(folder, n, {'Subject': 'Message %s/%s' % (folder, n) }, "This is message number %s in %s\n" % (n, folder) ) *************** *** 132,139 **** deep('deep/f2/f3', 1) deep('deep/f2/f3', 2) ! def tearDown(self): deltree(_mhroot) ! def test_basic(self): writeContext('inbox') --- 132,139 ---- deep('deep/f2/f3', 1) deep('deep/f2/f3', 2) ! def tearDown(self): deltree(_mhroot) ! def test_basic(self): writeContext('inbox') *************** *** 155,165 **** inbox = mh.openfolder('inbox') ! eq(inbox.getfullname(), os.path.join(os.path.abspath(_mhpath), 'inbox')) ! eq(inbox.getsequencesfilename(), os.path.join(os.path.abspath(_mhpath), 'inbox', '.mh_sequences')) ! eq(inbox.getmessagefilename(1), os.path.join(os.path.abspath(_mhpath), 'inbox', '1')) ! def test_listfolders(self): mh = getMH() --- 155,165 ---- inbox = mh.openfolder('inbox') ! eq(inbox.getfullname(), os.path.join(os.path.abspath(_mhpath), 'inbox')) ! eq(inbox.getsequencesfilename(), os.path.join(os.path.abspath(_mhpath), 'inbox', '.mh_sequences')) ! eq(inbox.getmessagefilename(1), os.path.join(os.path.abspath(_mhpath), 'inbox', '1')) ! def test_listfolders(self): mh = getMH() *************** *** 169,173 **** folders.sort() eq(folders, ['deep', 'inbox', 'wide']) ! folders = mh.listallfolders() folders.sort() --- 169,173 ---- folders.sort() eq(folders, ['deep', 'inbox', 'wide']) ! folders = mh.listallfolders() folders.sort() *************** *** 178,182 **** folders.sort() eq(folders, map(normF, ['deep/f1', 'deep/f2'])) ! folders = mh.listallsubfolders('deep') folders.sort() --- 178,182 ---- folders.sort() eq(folders, map(normF, ['deep/f1', 'deep/f2'])) ! folders = mh.listallsubfolders('deep') folders.sort() *************** *** 191,195 **** eq = self.assertEquals writeCurMessage('wide', 55) ! f = mh.openfolder('wide') all = f.listmessages() --- 191,195 ---- eq = self.assertEquals writeCurMessage('wide', 55) ! f = mh.openfolder('wide') all = f.listmessages() *************** *** 197,210 **** eq(f.getcurrent(), 55) f.setcurrent(99) ! eq(readFile(os.path.join(_mhpath, 'wide', '.mh_sequences')), 'cur: 99\n') def seqeq(seq, val): eq(f.parsesequence(seq), val) ! seqeq('5-55', range(5, 56)) seqeq('90-108', range(90, 101)+range(101, 109, 2)) seqeq('90-108', range(90, 101)+range(101, 109, 2)) ! seqeq('10:10', range(10, 20)) seqeq('10:+10', range(10, 20)) --- 197,210 ---- eq(f.getcurrent(), 55) f.setcurrent(99) ! eq(readFile(os.path.join(_mhpath, 'wide', '.mh_sequences')), 'cur: 99\n') def seqeq(seq, val): eq(f.parsesequence(seq), val) ! seqeq('5-55', range(5, 56)) seqeq('90-108', range(90, 101)+range(101, 109, 2)) seqeq('90-108', range(90, 101)+range(101, 109, 2)) ! seqeq('10:10', range(10, 20)) seqeq('10:+10', range(10, 20)) *************** *** 250,254 **** path = os.path.join(_mhpath, "dummy1") self.assert_(os.path.exists(path)) ! f = mh.openfolder('dummy1') def create(n): --- 250,254 ---- path = os.path.join(_mhpath, "dummy1") self.assert_(os.path.exists(path)) ! f = mh.openfolder('dummy1') def create(n): *************** *** 259,263 **** create(8) create(9) ! eq(readFile(f.getmessagefilename(9)), "From: foo\nSubject: 9\n\nDummy Message 9\n") --- 259,263 ---- create(8) create(9) ! eq(readFile(f.getmessagefilename(9)), "From: foo\nSubject: 9\n\nDummy Message 9\n") *************** *** 266,270 **** files = os.listdir(path) files.sort() ! eq(files, ['7', '8', '9']) f.removemessages(['7', '8']) --- 266,270 ---- files = os.listdir(path) files.sort() ! eq(files, ['7', '8', '9']) f.removemessages(['7', '8']) *************** *** 276,280 **** create(11) create(12) ! mh.makefolder("dummy2") f2 = mh.openfolder("dummy2") --- 276,280 ---- create(11) create(12) ! mh.makefolder("dummy2") f2 = mh.openfolder("dummy2") *************** *** 286,295 **** eq(readFile(f2.getmessagefilename(3)), "From: foo\nSubject: 10\n\nDummy Message 10\n") ! f.copymessage(9, f2, 4) eq(f.listmessages(), [9, 12]) eq(readFile(f2.getmessagefilename(4)), "From: foo\nSubject: 9\n\nDummy Message 9\n") ! f.refilemessages([9, 12], f2) eq(f.listmessages(), []) --- 286,295 ---- eq(readFile(f2.getmessagefilename(3)), "From: foo\nSubject: 10\n\nDummy Message 10\n") ! f.copymessage(9, f2, 4) eq(f.listmessages(), [9, 12]) eq(readFile(f2.getmessagefilename(4)), "From: foo\nSubject: 9\n\nDummy Message 9\n") ! f.refilemessages([9, 12], f2) eq(f.listmessages(), []) *************** *** 307,311 **** mh = getMH() eq = self.assertEquals ! f = mh.openfolder('inbox') msg = f.openmessage(1) --- 307,311 ---- mh = getMH() eq = self.assertEquals ! f = mh.openfolder('inbox') msg = f.openmessage(1) *************** *** 317,329 **** # mhlib. lines = sortLines(msg.getheadertext()) ! eq(lines, ["Date: 18 July 2001", "From: Mrs. Premise", "To: Mrs. Conclusion"]) lines = sortLines(msg.getheadertext(lambda h: len(h)==4)) ! eq(lines, ["Date: 18 July 2001", "From: Mrs. Premise"]) eq(msg.getbodytext(), "Hullo, Mrs. Conclusion!\n\n") eq(msg.getbodytext(0), "Hullo, Mrs. Conclusion!\n\n") ! # XXXX there should be a better way to reclaim the file handle msg.fp.close() --- 317,329 ---- # mhlib. lines = sortLines(msg.getheadertext()) ! eq(lines, ["Date: 18 July 2001", "From: Mrs. Premise", "To: Mrs. Conclusion"]) lines = sortLines(msg.getheadertext(lambda h: len(h)==4)) ! eq(lines, ["Date: 18 July 2001", "From: Mrs. Premise"]) eq(msg.getbodytext(), "Hullo, Mrs. Conclusion!\n\n") eq(msg.getbodytext(0), "Hullo, Mrs. Conclusion!\n\n") ! # XXXX there should be a better way to reclaim the file handle msg.fp.close() Index: test_pkgimport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pkgimport.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_pkgimport.py 2001/08/02 17:23:11 1.2 --- test_pkgimport.py 2001/08/09 21:40:30 1.3 *************** *** 44,48 **** f.write(contents) f.close() ! def test_package_import__semantics(self): --- 44,48 ---- f.write(contents) f.close() ! def test_package_import__semantics(self): Index: test_repr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_repr.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_repr.py 2001/07/19 22:27:56 1.1 --- test_repr.py 2001/08/09 21:40:30 1.2 *************** *** 6,10 **** import unittest from test_support import run_unittest ! from repr import repr as r # Don't shadow builtin repr --- 6,10 ---- import unittest from test_support import run_unittest ! from repr import repr as r # Don't shadow builtin repr *************** *** 25,29 **** expected = `s`[:13] + "..." + `s`[-14:] eq(r(s), expected) ! eq(r("\"'"), repr("\"'")) s = "\""*30+"'"*100 --- 25,29 ---- expected = `s`[:13] + "..." + `s`[-14:] eq(r(s), expected) ! eq(r("\"'"), repr("\"'")) s = "\""*30+"'"*100 *************** *** 68,72 **** i1 = ClassWithRepr("a") eq(r(i1), repr(i1)) ! i2 = ClassWithRepr("x"*1000) expected = `i2`[:13] + "..." + `i2`[-14:] --- 68,72 ---- i1 = ClassWithRepr("a") eq(r(i1), repr(i1)) ! i2 = ClassWithRepr("x"*1000) expected = `i2`[:13] + "..." + `i2`[-14:] From fdrake@users.sourceforge.net Thu Aug 9 23:00:34 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 09 Aug 2001 15:00:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libstdtypes.tex,1.52.4.2,1.52.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv22615 Modified Files: Tag: release21-maint libstdtypes.tex Log Message: Remove lines that should never have been checked into this release21-maint branch; I checked them in erroneously in revision 1.52.4.1 of this file; it looks like that entire revision was operator error. This reverts that checkin and closes SF bug #449613. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.52.4.2 retrieving revision 1.52.4.3 diff -C2 -d -r1.52.4.2 -r1.52.4.3 *** libstdtypes.tex 2001/04/22 01:58:00 1.52.4.2 --- libstdtypes.tex 2001/08/09 22:00:32 1.52.4.3 *************** *** 868,879 **** \lineiii{\var{a}.clear()}{remove all items from \code{a}}{} \lineiii{\var{a}.copy()}{a (shallow) copy of \code{a}}{} - \lineiii{\var{k} \code{in} \var{a}} - {\code{1} if \var{a} has a key \var{k}, else \code{0}} - {} - \lineiii{\var{k} not in \var{a}} - {\code{0} if \var{a} has a key \var{k}, else \code{1}} - {} \lineiii{\var{a}.has_key(\var{k})} ! {Equivalent to \var{k} \code{in} \var{a}} {} \lineiii{\var{a}.items()} --- 868,873 ---- \lineiii{\var{a}.clear()}{remove all items from \code{a}}{} \lineiii{\var{a}.copy()}{a (shallow) copy of \code{a}}{} \lineiii{\var{a}.has_key(\var{k})} ! {\code{1} if \var{a} has a key \var{k}, else \code{0}} {} \lineiii{\var{a}.items()} *************** *** 886,894 **** \lineiii{\var{a}.values()}{a copy of \var{a}'s list of values}{(2)} \lineiii{\var{a}.get(\var{k}\optional{, \var{x}})} ! {\code{\var{a}[\var{k}]} if \code{\var{k} in \var{a}}, else \var{x}} {(4)} \lineiii{\var{a}.setdefault(\var{k}\optional{, \var{x}})} ! {\code{\var{a}[\var{k}]} if \code{\var{k} in \var{a}}, else \var{x} (also setting it)} {(5)} --- 880,888 ---- \lineiii{\var{a}.values()}{a copy of \var{a}'s list of values}{(2)} \lineiii{\var{a}.get(\var{k}\optional{, \var{x}})} ! {\code{\var{a}[\var{k}]} if \code{\var{a}.has_key(\var{k})}, else \var{x}} {(4)} \lineiii{\var{a}.setdefault(\var{k}\optional{, \var{x}})} ! {\code{\var{a}[\var{k}]} if \code{\var{a}.has_key(\var{k})}, else \var{x} (also setting it)} {(5)} From tim_one@users.sourceforge.net Thu Aug 9 23:21:57 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 09 Aug 2001 15:21:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include unicodeobject.h,2.29,2.30 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv28410/python/dist/src/Include Modified Files: unicodeobject.h Log Message: SF patch #438013 Remove 2-byte Py_UCS2 assumptions Removed all instances of Py_UCS2 from the codebase, and so also (I hope) the last remaining reliance on the platform having an integral type with exactly 16 bits. PyUnicode_DecodeUTF16() and PyUnicode_EncodeUTF16() now read and write one byte at a time. Index: unicodeobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -d -r2.29 -r2.30 *** unicodeobject.h 2001/07/31 14:30:16 2.29 --- unicodeobject.h 2001/08/09 22:21:55 2.30 *************** *** 122,131 **** #endif - #if SIZEOF_SHORT == 2 - typedef unsigned short Py_UCS2; - #else - #error Cannot find a two-byte type - #endif - typedef PY_UNICODE_TYPE Py_UNICODE; --- 122,125 ---- From tim_one@users.sourceforge.net Thu Aug 9 23:21:58 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 09 Aug 2001 15:21:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.106,2.107 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv28410/python/dist/src/Objects Modified Files: unicodeobject.c Log Message: SF patch #438013 Remove 2-byte Py_UCS2 assumptions Removed all instances of Py_UCS2 from the codebase, and so also (I hope) the last remaining reliance on the platform having an integral type with exactly 16 bits. PyUnicode_DecodeUTF16() and PyUnicode_EncodeUTF16() now read and write one byte at a time. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.106 retrieving revision 2.107 diff -C2 -d -r2.106 -r2.107 *** unicodeobject.c 2001/08/02 04:15:00 2.106 --- unicodeobject.c 2001/08/09 22:21:55 2.107 *************** *** 945,950 **** static ! int utf16_decoding_error(const Py_UCS2 **source, ! Py_UNICODE **dest, const char *errors, const char *details) --- 945,949 ---- static ! int utf16_decoding_error(Py_UNICODE **dest, const char *errors, const char *details) *************** *** 976,996 **** } ! PyObject *PyUnicode_DecodeUTF16(const char *s, ! int size, ! const char *errors, ! int *byteorder) { PyUnicodeObject *unicode; Py_UNICODE *p; ! const Py_UCS2 *q, *e; ! int bo = 0; const char *errmsg = ""; /* size should be an even number */ ! if (size % sizeof(Py_UCS2) != 0) { ! if (utf16_decoding_error(NULL, NULL, errors, "truncated data")) ! return NULL; ! /* The remaining input chars are ignored if we fall through ! here... */ } --- 975,1001 ---- } ! PyObject * ! PyUnicode_DecodeUTF16(const char *s, ! int size, ! const char *errors, ! int *byteorder) { PyUnicodeObject *unicode; Py_UNICODE *p; ! const unsigned char *q, *e; ! int bo = 0; /* assume native ordering by default */ const char *errmsg = ""; + /* Offsets from q for retrieving byte pairs in the right order. */ + #ifdef BYTEORDER_IS_LITTLE_ENDIAN + int ihi = 1, ilo = 0; + #else + int ihi = 0, ilo = 1; + #endif /* size should be an even number */ ! if (size & 1) { ! if (utf16_decoding_error(NULL, errors, "truncated data")) ! return NULL; ! --size; /* else ignore the oddball byte */ } *************** *** 1005,1013 **** /* Unpack UTF-16 encoded data */ p = unicode->str; ! q = (Py_UCS2 *)s; ! e = q + (size / sizeof(Py_UCS2)); if (byteorder) ! bo = *byteorder; /* Check for BOM marks (U+FEFF) in the input and adjust current --- 1010,1018 ---- /* Unpack UTF-16 encoded data */ p = unicode->str; ! q = (unsigned char *)s; ! e = q + size; if (byteorder) ! bo = *byteorder; /* Check for BOM marks (U+FEFF) in the input and adjust current *************** *** 1016,1050 **** stream as-is (giving a ZWNBSP character). */ if (bo == 0) { #ifdef BYTEORDER_IS_LITTLE_ENDIAN ! if (*q == 0xFEFF) { ! q++; bo = -1; ! } else if (*q == 0xFFFE) { ! q++; bo = 1; } #else ! if (*q == 0xFEFF) { ! q++; bo = 1; ! } else if (*q == 0xFFFE) { ! q++; bo = -1; } #endif } ! while (q < e) { ! register Py_UCS2 ch = *q++; - /* Swap input bytes if needed. (This assumes - sizeof(Py_UNICODE) == 2 !) */ - #ifdef BYTEORDER_IS_LITTLE_ENDIAN - if (bo == 1) - ch = (ch >> 8) | (ch << 8); - #else - if (bo == -1) - ch = (ch >> 8) | (ch << 8); - #endif if (ch < 0xD800 || ch > 0xDFFF) { *p++ = ch; --- 1021,1061 ---- stream as-is (giving a ZWNBSP character). */ if (bo == 0) { + const Py_UNICODE bom = (q[ihi] << 8) | q[ilo]; #ifdef BYTEORDER_IS_LITTLE_ENDIAN ! if (bom == 0xFEFF) { ! q += 2; bo = -1; ! } ! else if (bom == 0xFFFE) { ! q += 2; bo = 1; } #else ! if (bom == 0xFEFF) { ! q += 2; bo = 1; ! } ! else if (bom == 0xFFFE) { ! q += 2; bo = -1; } #endif } ! ! if (bo == -1) { ! /* force LE */ ! ihi = 1; ! ilo = 0; ! } ! else if (bo == 1) { ! /* force BE */ ! ihi = 0; ! ilo = 1; ! } ! while (q < e) { ! Py_UNICODE ch = (q[ihi] << 8) | q[ilo]; ! q += 2; if (ch < 0xD800 || ch > 0xDFFF) { *p++ = ch; *************** *** 1058,1069 **** } if (0xD800 <= ch && ch <= 0xDBFF) { ! Py_UCS2 ch2 = *q++; ! #ifdef BYTEORDER_IS_LITTLE_ENDIAN ! if (bo == 1) ! ch2 = (ch2 >> 8) | (ch2 << 8); ! #else ! if (bo == -1) ! ch2 = (ch2 >> 8) | (ch2 << 8); ! #endif if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { #ifndef Py_UNICODE_WIDE --- 1069,1074 ---- } if (0xD800 <= ch && ch <= 0xDBFF) { ! Py_UNICODE ch2 = (q[ihi] << 8) | q[ilo]; ! q += 2; if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { #ifndef Py_UNICODE_WIDE *************** *** 1085,1089 **** utf16Error: ! if (utf16_decoding_error(&q, &p, errors, errmsg)) goto onError; } --- 1090,1094 ---- utf16Error: ! if (utf16_decoding_error(&p, errors, errmsg)) goto onError; } *************** *** 1103,1158 **** } ! #undef UTF16_ERROR ! ! PyObject *PyUnicode_EncodeUTF16(const Py_UNICODE *s, ! int size, ! const char *errors, ! int byteorder) { PyObject *v; ! Py_UCS2 *p; ! char *q; ! int i, pairs, doswap = 1; for (i = pairs = 0; i < size; i++) if (s[i] >= 0x10000) pairs++; v = PyString_FromStringAndSize(NULL, ! sizeof(Py_UCS2) * (size + pairs + (byteorder == 0))); if (v == NULL) return NULL; ! q = PyString_AS_STRING(v); ! p = (Py_UCS2 *)q; if (byteorder == 0) ! *p++ = 0xFEFF; if (size == 0) return v; ! if (byteorder == 0 || ! #ifdef BYTEORDER_IS_LITTLE_ENDIAN ! byteorder == -1 ! #else ! byteorder == 1 ! #endif ! ) ! doswap = 0; while (size-- > 0) { Py_UNICODE ch = *s++; Py_UNICODE ch2 = 0; if (ch >= 0x10000) { ! ch2 = 0xDC00|((ch-0x10000) & 0x3FF); ! ch = 0xD800|((ch-0x10000)>>10); ! } ! if (doswap){ ! *p++ = (ch >> 8) | (ch << 8); ! if (ch2) ! *p++ = (ch2 >> 8) | (ch2 << 8); ! }else{ ! *p++ = ch; ! if(ch2) ! *p++ = ch2; } } return v; } --- 1108,1172 ---- } ! PyObject * ! PyUnicode_EncodeUTF16(const Py_UNICODE *s, ! int size, ! const char *errors, ! int byteorder) { PyObject *v; ! unsigned char *p; ! int i, pairs; ! /* Offsets from p for storing byte pairs in the right order. */ ! #ifdef BYTEORDER_IS_LITTLE_ENDIAN ! int ihi = 1, ilo = 0; ! #else ! int ihi = 0, ilo = 1; ! #endif + #define STORECHAR(CH) \ + do { \ + p[ihi] = ((CH) >> 8) & 0xff; \ + p[ilo] = (CH) & 0xff; \ + p += 2; \ + } while(0) + for (i = pairs = 0; i < size; i++) if (s[i] >= 0x10000) pairs++; v = PyString_FromStringAndSize(NULL, ! 2 * (size + pairs + (byteorder == 0))); if (v == NULL) return NULL; ! p = (unsigned char *)PyString_AS_STRING(v); if (byteorder == 0) ! STORECHAR(0xFEFF); if (size == 0) return v; ! ! if (byteorder == -1) { ! /* force LE */ ! ihi = 1; ! ilo = 0; ! } ! else if (byteorder == 1) { ! /* force BE */ ! ihi = 0; ! ilo = 1; ! } ! while (size-- > 0) { Py_UNICODE ch = *s++; Py_UNICODE ch2 = 0; if (ch >= 0x10000) { ! ch2 = 0xDC00 | ((ch-0x10000) & 0x3FF); ! ch = 0xD800 | ((ch-0x10000) >> 10); } + STORECHAR(ch); + if (ch2) + STORECHAR(ch2); } return v; + #undef STORECHAR } From loewis@users.sourceforge.net Fri Aug 10 09:56:19 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 10 Aug 2001 01:56:19 -0700 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.46,1.47 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv15983 Modified Files: setup.py Log Message: Get OPT from the environment to build the CCSHARED command. Fixes the problem reported in bug #438786. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** setup.py 2001/08/08 00:36:53 1.46 --- setup.py 2001/08/10 08:56:17 1.47 *************** *** 139,144 **** # compilers if compiler is not None: ! (ccshared,) = sysconfig.get_config_vars('CCSHARED') ! args['compiler_so'] = compiler + ' ' + ccshared if linker_so is not None: args['linker_so'] = linker_so + ' -shared' --- 139,144 ---- # compilers if compiler is not None: ! (ccshared,opt) = sysconfig.get_config_vars('CCSHARED','OPT') ! args['compiler_so'] = compiler + ' ' + opt + ' ' + ccshared if linker_so is not None: args['linker_so'] = linker_so + ' -shared' From jackjansen@users.sourceforge.net Fri Aug 10 11:01:08 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 10 Aug 2001 03:01:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonStandSmall.mcp,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv4102/python/Mac/Build Modified Files: PythonStandSmall.mcp Log Message: Changed reference to config.h to pyconfig.h. Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 Binary files /tmp/cvsmhrdFC and /tmp/cvsMZlZW7 differ From jackjansen@users.sourceforge.net Fri Aug 10 13:16:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 10 Aug 2001 05:16:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.exp,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv6309/python/Mac/Build Modified Files: PythonCore.exp Log Message: Regenerated. Index: PythonCore.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.exp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PythonCore.exp 2001/08/08 15:29:01 1.12 --- PythonCore.exp 2001/08/10 12:16:55 1.13 *************** *** 278,281 **** --- 278,283 ---- PyNumber_InPlaceMultiply PyNumber_InPlaceAdd + PyNumber_InPlaceTrueDivide + PyNumber_InPlaceFloorDivide PyNumber_InPlaceDivide PyNumber_InPlaceSubtract *************** *** 287,290 **** --- 289,294 ---- PyNumber_Power PyNumber_Remainder + PyNumber_TrueDivide + PyNumber_FloorDivide PyNumber_Add PyNumber_Divmod *************** *** 528,531 **** --- 532,536 ---- PyType_Type PyBaseObject_Type + PyType_Ready _PyType_Lookup PyType_IsSubtype *************** *** 618,731 **** PyMac_ConsoleIsDead PyMac_AppearanceCompliant - PyMac_OSErrException - PyMacGluePtr_PyMac_GetFSSpec - PyMacGluePtr_AEDesc_New - PyMacGluePtr_AEDesc_Convert - PyMacGluePtr_CmpObj_New - PyMacGluePtr_CmpObj_Convert - PyMacGluePtr_CmpInstObj_New - PyMacGluePtr_CmpInstObj_Convert - PyMacGluePtr_CtlObj_New - PyMacGluePtr_CtlObj_Convert - PyMacGluePtr_DlgObj_New - PyMacGluePtr_DlgObj_Convert - PyMacGluePtr_DlgObj_WhichDialog - PyMacGluePtr_DragObj_New - PyMacGluePtr_DragObj_Convert - PyMacGluePtr_ListObj_New - PyMacGluePtr_ListObj_Convert - PyMacGluePtr_MenuObj_New - PyMacGluePtr_MenuObj_Convert - PyMacGluePtr_GrafObj_New - PyMacGluePtr_GrafObj_Convert - PyMacGluePtr_BMObj_New - PyMacGluePtr_BMObj_Convert - PyMacGluePtr_QdRGB_New - PyMacGluePtr_QdRGB_Convert - PyMacGluePtr_GWorldObj_New - PyMacGluePtr_GWorldObj_Convert - PyMacGluePtr_TrackObj_New - PyMacGluePtr_TrackObj_Convert - PyMacGluePtr_MovieObj_New - PyMacGluePtr_MovieObj_Convert - PyMacGluePtr_MovieCtlObj_New - PyMacGluePtr_MovieCtlObj_Convert - PyMacGluePtr_TimeBaseObj_New - PyMacGluePtr_TimeBaseObj_Convert - PyMacGluePtr_UserDataObj_New - PyMacGluePtr_UserDataObj_Convert - PyMacGluePtr_MediaObj_New - PyMacGluePtr_MediaObj_Convert - PyMacGluePtr_ResObj_New - PyMacGluePtr_ResObj_Convert - PyMacGluePtr_OptResObj_New - PyMacGluePtr_OptResObj_Convert - PyMacGluePtr_TEObj_New - PyMacGluePtr_TEObj_Convert - PyMacGluePtr_WinObj_New - PyMacGluePtr_WinObj_Convert - PyMacGluePtr_WinObj_WhichWindow - WinObj_WhichWindow - WinObj_Convert - WinObj_New - TEObj_Convert - TEObj_New - OptResObj_Convert - OptResObj_New - ResObj_Convert - ResObj_New - MediaObj_Convert - MediaObj_New - UserDataObj_Convert - UserDataObj_New - TimeBaseObj_Convert - TimeBaseObj_New - MovieCtlObj_Convert - MovieCtlObj_New - MovieObj_Convert - MovieObj_New - TrackObj_Convert - TrackObj_New - GWorldObj_Convert - GWorldObj_New - QdRGB_Convert - QdRGB_New - BMObj_Convert - BMObj_New - GrafObj_Convert - GrafObj_New - MenuObj_Convert - MenuObj_New - ListObj_Convert - ListObj_New - DragObj_Convert - DragObj_New - DlgObj_WhichDialog - DlgObj_Convert - DlgObj_New - CtlObj_Convert - CtlObj_New - CmpInstObj_Convert - CmpInstObj_New - CmpObj_Convert - CmpObj_New - AEDesc_Convert - AEDesc_New - PyMac_GetFSSpec - PyMac_Buildwide - PyMac_Getwide - PyMac_BuildFixed - PyMac_GetFixed - PyMac_GetEventRecord - PyMac_BuildPoint - PyMac_GetPoint - PyMac_BuildRect - PyMac_GetRect - PyMac_BuildOptStr255 - PyMac_BuildStr255 - PyMac_GetStr255 - PyMac_BuildNumVersion - PyMac_BuildOSType - PyMac_GetOSType PyMac_PromptGetFile PyMac_GetDirectory --- 623,626 ---- *************** *** 738,742 **** PyMac_DoYield PyMac_HandleEvent - PyMac_BuildEventRecord PyMac_HandleEventIntern PyMac_SetEventHandler --- 633,636 ---- *************** *** 746,753 **** PyOS_InitInterrupts PyOS_CheckStack - PyMac_Error - PyErr_Mac - PyMac_GetOSErrException - PyMac_StrError c2pstrcpy Pstring --- 640,643 ---- *************** *** 759,763 **** SpinCursor PyMac_GetFullPath - PyMac_getscript PyMac_AppRefNum PyMac_options --- 649,652 ---- *************** *** 992,995 **** --- 881,1000 ---- _PyGC_Remove _PyGC_Insert + PyMac_OSErrException + PyMacGluePtr_PyMac_GetFSSpec + PyMacGluePtr_AEDesc_New + PyMacGluePtr_AEDesc_Convert + PyMacGluePtr_CmpObj_New + PyMacGluePtr_CmpObj_Convert + PyMacGluePtr_CmpInstObj_New + PyMacGluePtr_CmpInstObj_Convert + PyMacGluePtr_CtlObj_New + PyMacGluePtr_CtlObj_Convert + PyMacGluePtr_DlgObj_New + PyMacGluePtr_DlgObj_Convert + PyMacGluePtr_DlgObj_WhichDialog + PyMacGluePtr_DragObj_New + PyMacGluePtr_DragObj_Convert + PyMacGluePtr_ListObj_New + PyMacGluePtr_ListObj_Convert + PyMacGluePtr_MenuObj_New + PyMacGluePtr_MenuObj_Convert + PyMacGluePtr_GrafObj_New + PyMacGluePtr_GrafObj_Convert + PyMacGluePtr_BMObj_New + PyMacGluePtr_BMObj_Convert + PyMacGluePtr_QdRGB_New + PyMacGluePtr_QdRGB_Convert + PyMacGluePtr_GWorldObj_New + PyMacGluePtr_GWorldObj_Convert + PyMacGluePtr_TrackObj_New + PyMacGluePtr_TrackObj_Convert + PyMacGluePtr_MovieObj_New + PyMacGluePtr_MovieObj_Convert + PyMacGluePtr_MovieCtlObj_New + PyMacGluePtr_MovieCtlObj_Convert + PyMacGluePtr_TimeBaseObj_New + PyMacGluePtr_TimeBaseObj_Convert + PyMacGluePtr_UserDataObj_New + PyMacGluePtr_UserDataObj_Convert + PyMacGluePtr_MediaObj_New + PyMacGluePtr_MediaObj_Convert + PyMacGluePtr_ResObj_New + PyMacGluePtr_ResObj_Convert + PyMacGluePtr_OptResObj_New + PyMacGluePtr_OptResObj_Convert + PyMacGluePtr_TEObj_New + PyMacGluePtr_TEObj_Convert + PyMacGluePtr_WinObj_New + PyMacGluePtr_WinObj_Convert + PyMacGluePtr_WinObj_WhichWindow + WinObj_WhichWindow + WinObj_Convert + WinObj_New + TEObj_Convert + TEObj_New + OptResObj_Convert + OptResObj_New + ResObj_Convert + ResObj_New + MediaObj_Convert + MediaObj_New + UserDataObj_Convert + UserDataObj_New + TimeBaseObj_Convert + TimeBaseObj_New + MovieCtlObj_Convert + MovieCtlObj_New + MovieObj_Convert + MovieObj_New + TrackObj_Convert + TrackObj_New + GWorldObj_Convert + GWorldObj_New + QdRGB_Convert + QdRGB_New + BMObj_Convert + BMObj_New + GrafObj_Convert + GrafObj_New + MenuObj_Convert + MenuObj_New + ListObj_Convert + ListObj_New + DragObj_Convert + DragObj_New + DlgObj_WhichDialog + DlgObj_Convert + DlgObj_New + CtlObj_Convert + CtlObj_New + CmpInstObj_Convert + CmpInstObj_New + CmpObj_Convert + CmpObj_New + AEDesc_Convert + AEDesc_New + PyMac_GetFSSpec + PyMac_Buildwide + PyMac_Getwide + PyMac_BuildFixed + PyMac_GetFixed + PyMac_BuildEventRecord + PyMac_GetEventRecord + PyMac_BuildPoint + PyMac_GetPoint + PyMac_BuildRect + PyMac_GetRect + PyMac_BuildOptStr255 + PyMac_BuildStr255 + PyMac_GetStr255 + PyMac_BuildNumVersion + PyMac_BuildOSType + PyMac_GetOSType + PyMac_Error + PyErr_Mac + PyMac_GetOSErrException + PyMac_StrError + PyMac_getscript GUSISetupConsoleStdio GUSIStdioFlush *************** *** 2632,2635 **** --- 2637,2642 ---- SetTSMTEDialogDocumentID SetTSMTEDialogTSMTERecHandle + EnableMenuItem + DisableMenuItem GetMenuID GetMenuWidth *************** *** 2675,2678 **** --- 2682,2689 ---- p2cstrcpy GetQDGlobals + InvalWindowRgn + InvalWindowRect + ValidWindowRgn + ValidWindowRect GetWindowList GetNextWindow From jackjansen@users.sourceforge.net Fri Aug 10 13:17:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 10 Aug 2001 05:17:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCoreCarbon.exp,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv6344/python/Mac/Build Modified Files: PythonCoreCarbon.exp Log Message: Regenerated. Index: PythonCoreCarbon.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCoreCarbon.exp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PythonCoreCarbon.exp 2001/08/08 15:29:09 1.12 --- PythonCoreCarbon.exp 2001/08/10 12:17:04 1.13 *************** *** 278,281 **** --- 278,283 ---- PyNumber_InPlaceMultiply PyNumber_InPlaceAdd + PyNumber_InPlaceTrueDivide + PyNumber_InPlaceFloorDivide PyNumber_InPlaceDivide PyNumber_InPlaceSubtract *************** *** 287,290 **** --- 289,294 ---- PyNumber_Power PyNumber_Remainder + PyNumber_TrueDivide + PyNumber_FloorDivide PyNumber_Add PyNumber_Divmod *************** *** 528,531 **** --- 532,536 ---- PyType_Type PyBaseObject_Type + PyType_Ready _PyType_Lookup PyType_IsSubtype *************** *** 618,731 **** PyMac_ConsoleIsDead PyMac_AppearanceCompliant - PyMac_OSErrException - PyMacGluePtr_PyMac_GetFSSpec - PyMacGluePtr_AEDesc_New - PyMacGluePtr_AEDesc_Convert - PyMacGluePtr_CmpObj_New - PyMacGluePtr_CmpObj_Convert - PyMacGluePtr_CmpInstObj_New - PyMacGluePtr_CmpInstObj_Convert - PyMacGluePtr_CtlObj_New - PyMacGluePtr_CtlObj_Convert - PyMacGluePtr_DlgObj_New - PyMacGluePtr_DlgObj_Convert - PyMacGluePtr_DlgObj_WhichDialog - PyMacGluePtr_DragObj_New - PyMacGluePtr_DragObj_Convert - PyMacGluePtr_ListObj_New - PyMacGluePtr_ListObj_Convert - PyMacGluePtr_MenuObj_New - PyMacGluePtr_MenuObj_Convert - PyMacGluePtr_GrafObj_New - PyMacGluePtr_GrafObj_Convert - PyMacGluePtr_BMObj_New - PyMacGluePtr_BMObj_Convert - PyMacGluePtr_QdRGB_New - PyMacGluePtr_QdRGB_Convert - PyMacGluePtr_GWorldObj_New - PyMacGluePtr_GWorldObj_Convert - PyMacGluePtr_TrackObj_New - PyMacGluePtr_TrackObj_Convert - PyMacGluePtr_MovieObj_New - PyMacGluePtr_MovieObj_Convert - PyMacGluePtr_MovieCtlObj_New - PyMacGluePtr_MovieCtlObj_Convert - PyMacGluePtr_TimeBaseObj_New - PyMacGluePtr_TimeBaseObj_Convert - PyMacGluePtr_UserDataObj_New - PyMacGluePtr_UserDataObj_Convert - PyMacGluePtr_MediaObj_New - PyMacGluePtr_MediaObj_Convert - PyMacGluePtr_ResObj_New - PyMacGluePtr_ResObj_Convert - PyMacGluePtr_OptResObj_New - PyMacGluePtr_OptResObj_Convert - PyMacGluePtr_TEObj_New - PyMacGluePtr_TEObj_Convert - PyMacGluePtr_WinObj_New - PyMacGluePtr_WinObj_Convert - PyMacGluePtr_WinObj_WhichWindow - WinObj_WhichWindow - WinObj_Convert - WinObj_New - TEObj_Convert - TEObj_New - OptResObj_Convert - OptResObj_New - ResObj_Convert - ResObj_New - MediaObj_Convert - MediaObj_New - UserDataObj_Convert - UserDataObj_New - TimeBaseObj_Convert - TimeBaseObj_New - MovieCtlObj_Convert - MovieCtlObj_New - MovieObj_Convert - MovieObj_New - TrackObj_Convert - TrackObj_New - GWorldObj_Convert - GWorldObj_New - QdRGB_Convert - QdRGB_New - BMObj_Convert - BMObj_New - GrafObj_Convert - GrafObj_New - MenuObj_Convert - MenuObj_New - ListObj_Convert - ListObj_New - DragObj_Convert - DragObj_New - DlgObj_WhichDialog - DlgObj_Convert - DlgObj_New - CtlObj_Convert - CtlObj_New - CmpInstObj_Convert - CmpInstObj_New - CmpObj_Convert - CmpObj_New - AEDesc_Convert - AEDesc_New - PyMac_GetFSSpec - PyMac_Buildwide - PyMac_Getwide - PyMac_BuildFixed - PyMac_GetFixed - PyMac_GetEventRecord - PyMac_BuildPoint - PyMac_GetPoint - PyMac_BuildRect - PyMac_GetRect - PyMac_BuildOptStr255 - PyMac_BuildStr255 - PyMac_GetStr255 - PyMac_BuildNumVersion - PyMac_BuildOSType - PyMac_GetOSType SIOUXDoAboutBox PyMac_RaiseConsoleWindow --- 623,626 ---- *************** *** 736,740 **** PyMac_DoYield PyMac_HandleEvent - PyMac_BuildEventRecord PyMac_HandleEventIntern PyMac_SetEventHandler --- 631,634 ---- *************** *** 744,751 **** PyOS_InitInterrupts PyOS_CheckStack - PyMac_Error - PyErr_Mac - PyMac_GetOSErrException - PyMac_StrError Pstring PyMac_StopGUSISpin --- 638,641 ---- *************** *** 753,757 **** SpinCursor PyMac_GetFullPath - PyMac_getscript PyMac_AppRefNum PyMac_options --- 643,646 ---- *************** *** 986,989 **** --- 875,994 ---- _PyGC_Remove _PyGC_Insert + PyMac_OSErrException + PyMacGluePtr_PyMac_GetFSSpec + PyMacGluePtr_AEDesc_New + PyMacGluePtr_AEDesc_Convert + PyMacGluePtr_CmpObj_New + PyMacGluePtr_CmpObj_Convert + PyMacGluePtr_CmpInstObj_New + PyMacGluePtr_CmpInstObj_Convert + PyMacGluePtr_CtlObj_New + PyMacGluePtr_CtlObj_Convert + PyMacGluePtr_DlgObj_New + PyMacGluePtr_DlgObj_Convert + PyMacGluePtr_DlgObj_WhichDialog + PyMacGluePtr_DragObj_New + PyMacGluePtr_DragObj_Convert + PyMacGluePtr_ListObj_New + PyMacGluePtr_ListObj_Convert + PyMacGluePtr_MenuObj_New + PyMacGluePtr_MenuObj_Convert + PyMacGluePtr_GrafObj_New + PyMacGluePtr_GrafObj_Convert + PyMacGluePtr_BMObj_New + PyMacGluePtr_BMObj_Convert + PyMacGluePtr_QdRGB_New + PyMacGluePtr_QdRGB_Convert + PyMacGluePtr_GWorldObj_New + PyMacGluePtr_GWorldObj_Convert + PyMacGluePtr_TrackObj_New + PyMacGluePtr_TrackObj_Convert + PyMacGluePtr_MovieObj_New + PyMacGluePtr_MovieObj_Convert + PyMacGluePtr_MovieCtlObj_New + PyMacGluePtr_MovieCtlObj_Convert + PyMacGluePtr_TimeBaseObj_New + PyMacGluePtr_TimeBaseObj_Convert + PyMacGluePtr_UserDataObj_New + PyMacGluePtr_UserDataObj_Convert + PyMacGluePtr_MediaObj_New + PyMacGluePtr_MediaObj_Convert + PyMacGluePtr_ResObj_New + PyMacGluePtr_ResObj_Convert + PyMacGluePtr_OptResObj_New + PyMacGluePtr_OptResObj_Convert + PyMacGluePtr_TEObj_New + PyMacGluePtr_TEObj_Convert + PyMacGluePtr_WinObj_New + PyMacGluePtr_WinObj_Convert + PyMacGluePtr_WinObj_WhichWindow + WinObj_WhichWindow + WinObj_Convert + WinObj_New + TEObj_Convert + TEObj_New + OptResObj_Convert + OptResObj_New + ResObj_Convert + ResObj_New + MediaObj_Convert + MediaObj_New + UserDataObj_Convert + UserDataObj_New + TimeBaseObj_Convert + TimeBaseObj_New + MovieCtlObj_Convert + MovieCtlObj_New + MovieObj_Convert + MovieObj_New + TrackObj_Convert + TrackObj_New + GWorldObj_Convert + GWorldObj_New + QdRGB_Convert + QdRGB_New + BMObj_Convert + BMObj_New + GrafObj_Convert + GrafObj_New + MenuObj_Convert + MenuObj_New + ListObj_Convert + ListObj_New + DragObj_Convert + DragObj_New + DlgObj_WhichDialog + DlgObj_Convert + DlgObj_New + CtlObj_Convert + CtlObj_New + CmpInstObj_Convert + CmpInstObj_New + CmpObj_Convert + CmpObj_New + AEDesc_Convert + AEDesc_New + PyMac_GetFSSpec + PyMac_Buildwide + PyMac_Getwide + PyMac_BuildFixed + PyMac_GetFixed + PyMac_BuildEventRecord + PyMac_GetEventRecord + PyMac_BuildPoint + PyMac_GetPoint + PyMac_BuildRect + PyMac_GetRect + PyMac_BuildOptStr255 + PyMac_BuildStr255 + PyMac_GetStr255 + PyMac_BuildNumVersion + PyMac_BuildOSType + PyMac_GetOSType + PyMac_Error + PyErr_Mac + PyMac_GetOSErrException + PyMac_StrError + PyMac_getscript GUSISetupConsoleStdio GUSIStdioFlush From loewis@users.sourceforge.net Fri Aug 10 14:58:52 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 10 Aug 2001 06:58:52 -0700 Subject: [Python-checkins] CVS: python/dist/src configure,1.233,1.234 configure.in,1.242,1.243 pyconfig.h.in,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv26513 Modified Files: configure configure.in pyconfig.h.in Log Message: Expose nl_langinfo through locale where available. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.233 retrieving revision 1.234 diff -C2 -d -r1.233 -r1.234 *** configure 2001/08/09 11:40:14 1.233 --- configure 2001/08/10 13:58:49 1.234 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.241 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.242 [...3867 lines suppressed...] if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7045,7049 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7048: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7046,7050 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7049: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.242 retrieving revision 1.243 diff -C2 -d -r1.242 -r1.243 *** configure.in 2001/08/09 11:40:14 1.242 --- configure.in 2001/08/10 13:58:50 1.243 *************** *** 414,418 **** # checks for header files AC_HEADER_STDC ! AC_CHECK_HEADERS(dlfcn.h fcntl.h limits.h locale.h ncurses.h poll.h pthread.h \ signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h termios.h \ sys/audioio.h sys/file.h sys/lock.h sys/modem.h db_185.h db.h \ --- 414,419 ---- # checks for header files AC_HEADER_STDC ! AC_CHECK_HEADERS(dlfcn.h fcntl.h limits.h langinfo.h locale.h \ ! ncurses.h poll.h pthread.h \ signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h termios.h \ sys/audioio.h sys/file.h sys/lock.h sys/modem.h db_185.h db.h \ Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pyconfig.h.in 2001/08/04 22:32:03 1.2 --- pyconfig.h.in 2001/08/10 13:58:50 1.3 *************** *** 591,594 **** --- 591,597 ---- #undef HAVE_GDBM_NDBM_H + /* Define if you have the header file. */ + #undef HAVE_LANGINFO_H + /* Define if you have the header file. */ #undef HAVE_LIBUTIL_H From loewis@users.sourceforge.net Fri Aug 10 14:58:52 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 10 Aug 2001 06:58:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/encodings aliases.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv26513/Lib/encodings Modified Files: aliases.py Log Message: Expose nl_langinfo through locale where available. Index: aliases.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/aliases.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** aliases.py 2001/06/07 19:39:25 1.8 --- aliases.py 2001/08/10 13:58:50 1.9 *************** *** 32,35 **** --- 32,37 ---- # ASCII 'us_ascii': 'ascii', + 'ansi_x3.4_1968': 'ascii', # used on Linux + '646': 'ascii', # used on Solaris # EBCDIC From loewis@users.sourceforge.net Fri Aug 10 14:58:52 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 10 Aug 2001 06:58:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _localemodule.c,2.19,2.20 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv26513/Modules Modified Files: _localemodule.c Log Message: Expose nl_langinfo through locale where available. Index: _localemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_localemodule.c,v retrieving revision 2.19 retrieving revision 2.20 diff -C2 -d -r2.19 -r2.20 *** _localemodule.c 2001/03/02 06:28:17 2.19 --- _localemodule.c 2001/08/10 13:58:50 2.20 *************** *** 18,21 **** --- 18,25 ---- #include + #ifdef HAVE_LANGINFO_H + #include + #endif + #if defined(MS_WIN32) #define WINDOWS_LEAN_AND_MEAN *************** *** 392,395 **** --- 396,416 ---- #endif + #ifdef HAVE_LANGINFO_H + static char nl_langinfo__doc__[] = + "nl_langinfo(key) -> string\n" + "Return the value for the locale information associated with key." + ; + + static PyObject* + PyLocale_nl_langinfo(PyObject* self, PyObject* args) + { + int item; + if (!PyArg_ParseTuple(args, "i:nl_langinfo", &item)) + return NULL; + return PyString_FromString(nl_langinfo(item)); + } + #endif + + static struct PyMethodDef PyLocale_Methods[] = { {"setlocale", (PyCFunction) PyLocale_setlocale, *************** *** 404,407 **** --- 425,433 ---- {"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, 0}, #endif + #ifdef HAVE_LANGINFO_H + {"nl_langinfo", (PyCFunction) PyLocale_nl_langinfo, + METH_VARARGS, nl_langinfo__doc__}, + #endif + {NULL, NULL} }; *************** *** 456,458 **** --- 482,561 ---- PyDict_SetItemString(d, "__doc__", x); Py_XDECREF(x); + + #define ADDINT(X) PyModule_AddIntConstant(m, #X, X) + #ifdef HAVE_LANGINFO_H + /* These constants should exist on any langinfo implementation */ + ADDINT(DAY_1); + ADDINT(DAY_2); + ADDINT(DAY_3); + ADDINT(DAY_4); + ADDINT(DAY_5); + ADDINT(DAY_6); + ADDINT(DAY_7); + + ADDINT(ABDAY_1); + ADDINT(ABDAY_2); + ADDINT(ABDAY_3); + ADDINT(ABDAY_4); + ADDINT(ABDAY_5); + ADDINT(ABDAY_6); + ADDINT(ABDAY_7); + + ADDINT(MON_1); + ADDINT(MON_2); + ADDINT(MON_3); + ADDINT(MON_4); + ADDINT(MON_5); + ADDINT(MON_6); + ADDINT(MON_7); + ADDINT(MON_8); + ADDINT(MON_9); + ADDINT(MON_10); + ADDINT(MON_11); + ADDINT(MON_12); + + ADDINT(ABMON_1); + ADDINT(ABMON_2); + ADDINT(ABMON_3); + ADDINT(ABMON_4); + ADDINT(ABMON_5); + ADDINT(ABMON_6); + ADDINT(ABMON_7); + ADDINT(ABMON_8); + ADDINT(ABMON_9); + ADDINT(ABMON_10); + ADDINT(ABMON_11); + ADDINT(ABMON_12); + + ADDINT(RADIXCHAR); + ADDINT(THOUSEP); + /* YESSTR and NOSTR are deprecated in glibc, since they are + a special case of message translation, which should be rather + done using gettext. So we don't expose it to Python in the + first place. + ADDINT(YESSTR); + ADDINT(NOSTR); + */ + ADDINT(CRNCYSTR); + + ADDINT(D_T_FMT); + ADDINT(D_FMT); + ADDINT(T_FMT); + ADDINT(AM_STR); + ADDINT(PM_STR); + + #ifdef CODESET + /* The following constants are available only with XPG4. */ + ADDINT(CODESET); + ADDINT(T_FMT_AMPM); + ADDINT(ERA); + ADDINT(ERA_D_FMT); + ADDINT(ERA_D_T_FMT); + ADDINT(ERA_T_FMT); + ADDINT(ALT_DIGITS); + ADDINT(YESEXPR); + ADDINT(NOEXPR); + ADDINT(_DATE_FMT); + #endif + #endif /* HAVE_LANGINFO_H */ } From loewis@users.sourceforge.net Fri Aug 10 14:58:52 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 10 Aug 2001 06:58:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib liblocale.tex,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv26513/Doc/lib Modified Files: liblocale.tex Log Message: Expose nl_langinfo through locale where available. Index: liblocale.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblocale.tex,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** liblocale.tex 2001/07/20 19:03:44 1.24 --- liblocale.tex 2001/08/10 13:58:50 1.25 *************** *** 109,112 **** --- 109,121 ---- \end{funcdesc} + \begin{funcdesc}{nl_langinfo}{option} + + Return some locale-specific information as a string. This function is + not available on all systems, and the set of possible options might + also vary across platforms. The possible argument values are numbers, + for which symbolic constants are available in the locale module. + + \end{funcdesc} + \begin{funcdesc}{getdefaultlocale}{\optional{envvars}} Tries to determine the default locale settings and returns *************** *** 258,261 **** --- 267,380 ---- This is a symbolic constant used for different values returned by \function{localeconv()}. + \end{datadesc} + + The \function{nl_langinfo} function accepts one of the following keys. + Most descriptions are taken from the corresponding description in the + GNU C library. + + \begin{datadesc}{CODESET} + Return a string with the name of the character encoding used in the + selected locale. + \end{datadesc} + + \begin{datadesc}{D_T_FMT} + Return a string that can be used as a format string for strftime(3) to + represent time and date in a locale-specific way. + \end{datadesc} + + \begin{datadesc}{D_FMT} + Return a string that can be used as a format string for strftime(3) to + represent a date in a locale-specific way. + \end{datadesc} + + \begin{datadesc}{T_FMT} + Return a string that can be used as a format string for strftime(3) to + represent a time in a locale-specific way. + \end{datadesc} + + \begin{datadesc}{T_FMT_AMPM} + The return value can be used as a format string for `strftime' to + represent time in the am/pm format. + \end{datadesc} + + \begin{datadesc}{DAY_1 ... DAY_7} + Return name of the n-th day of the week. \[Warning: this follows the US + convention DAY_1 = Sunday, not the international convention (ISO 8601) + that Monday is the first day of the week.\] + \end{datadesc} + + \begin{datadesc}{ABDAY_1 ... ABDAY_7} + Return abbreviated name of the n-th day of the week. + \end{datadesc} + + \begin{datadesc}{MON_1 ... MON_12} + Return name of the n-th month. + \end{datadesc} + + \begin{datadesc}{ABMON_1 ... ABMON_12} + Return abbreviated name of the n-th month. + \end{datadesc} + + \begin{datadesc}{RADIXCHAR} + Return radix character (decimal dot, decimal comma, etc.) + \end{datadesc} + + \begin{datadesc}{THOUSEP} + Return separator character for thousands (groups of three digits). + \end{datadesc} + + \begin{datadesc}{YESEXPR} + Return a regular expression that can be used with the regex + function to recognize a positive response to a yes/no question. + \[Warning: the expression is in the syntax suitable for the + regex C library function, which might differ from the syntax + used in \module{re}\] + \end{datadesc} + + \begin{datadesc}{NOEXPR} + Return a regular expression that can be used with the regex(3) + function to recognize a negative response to a yes/no question. + \end{datadesc} + + \begin{datadesc}{CRNCYSTR} + Return the currency symbol, preceded by "-" if the symbol should + appear before the value, "+" if the symbol should appear after the + value, or "." if the symbol should replace the radix character. + \end{datadesc} + + \begin{datadesc}{ERA} + The return value represents the era used in the current locale. + + Most locales do not define this value. An example of a locale which + does define this value is the Japanese one. In Japan, the traditional + representation of dates includes the name of the era corresponding to + the then-emperor's reign. + + Normally it should not be necessary to use this value directly. + Specifying the \code{E} modifier in their format strings causes the + \function{strftime} function to use this information. The format of the + returned string is not specified, and therefore you should not assume + knowledge of it on different systems. + \end{datadesc} + + \begin{datadesc}{ERA_YEAR} + The return value gives the year in the relevant era of the locale. + \end{datadesc} + + \begin{datadesc}{ERA_D_T_FMT} + This return value can be used as a format string for + \function{strftime} to represent dates and times in a locale-specific + era-based way. + \end{datadesc} + + \begin{datadesc}{ERA_D_FMT} + This return value can be used as a format string for + \function{strftime} to represent time in a locale-specific era-based + way. + \end{datadesc} + + \begin{datadesc}{ALT_DIGITS} + The return value is a representation of up to 100 values used to + represent the values 0 to 99. \end{datadesc} From fdrake@users.sourceforge.net Fri Aug 10 15:27:41 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 10 Aug 2001 07:27:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.136,1.137 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv308/api Modified Files: api.tex Log Message: Remove the bogus flags parameter from the PyFile_WriteString() signature; it has no such parameter. This closes SF bug #449761. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** api.tex 2001/08/08 19:14:53 1.136 --- api.tex 2001/08/10 14:27:38 1.137 *************** *** 3985,3990 **** \end{cfuncdesc} ! \begin{cfuncdesc}{int}{PyFile_WriteString}{char *s, PyFileObject *p, ! int flags} Writes string \var{s} to file object \var{p}. Returns \code{0} on success or \code{-1} on failure; the appropriate exception will be --- 3985,3989 ---- \end{cfuncdesc} ! \begin{cfuncdesc}{int}{PyFile_WriteString}{char *s, PyFileObject *p} Writes string \var{s} to file object \var{p}. Returns \code{0} on success or \code{-1} on failure; the appropriate exception will be From jhylton@users.sourceforge.net Fri Aug 10 15:30:38 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 10 Aug 2001 07:30:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib asyncore.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv1075 Modified Files: asyncore.py Log Message: Remove hard-coded NT constants that are already defined in errno on NT. Wrap some long lines. Remove unnecessary tuple unpack. Index: asyncore.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** asyncore.py 2001/05/11 18:28:54 1.14 --- asyncore.py 2001/08/10 14:30:35 1.15 *************** *** 54,66 **** import os ! if os.name == 'nt': ! EWOULDBLOCK = 10035 ! EINPROGRESS = 10036 ! EALREADY = 10037 ! ECONNRESET = 10054 ! ENOTCONN = 10057 ! ESHUTDOWN = 10058 ! else: ! from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, ENOTCONN, ESHUTDOWN try: --- 54,59 ---- import os ! from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ ! ENOTCONN, ESHUTDOWN try: *************** *** 265,269 **** self.socket.setsockopt ( socket.SOL_SOCKET, socket.SO_REUSEADDR, ! self.socket.getsockopt (socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1 ) except socket.error: --- 258,263 ---- self.socket.setsockopt ( socket.SOL_SOCKET, socket.SO_REUSEADDR, ! self.socket.getsockopt (socket.SOL_SOCKET, ! socket.SO_REUSEADDR) | 1 ) except socket.error: *************** *** 399,403 **** def handle_error (self): ! (file,fun,line), t, v, tbinfo = compact_traceback() # sometimes a user repr method will crash. --- 393,397 ---- def handle_error (self): ! nil, t, v, tbinfo = compact_traceback() # sometimes a user repr method will crash. From nascheme@users.sourceforge.net Fri Aug 10 15:46:50 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Fri, 10 Aug 2001 07:46:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.17,2.18 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv5235 Modified Files: gcmodule.c Log Message: Remove "referents" structure (it's not needed). Check return value of PyList_Append. Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -d -r2.17 -r2.18 *** gcmodule.c 2001/08/09 15:58:59 2.17 --- gcmodule.c 2001/08/10 14:46:47 2.18 *************** *** 678,691 **** } - struct referents{ - PyObject *objs; - int seen; - }; - static int ! referentsvisit(PyObject* obj, struct referents* refs) { ! if (PySequence_Contains (refs->objs, obj)) { ! refs->seen = 1; return 1; } --- 678,685 ---- } static int ! referentsvisit(PyObject* obj, PyObject *objs) { ! if (PySequence_Contains(objs, obj)) { return 1; } *************** *** 693,697 **** } ! static void gc_referents_for(PyObject *objs, PyGC_Head *list, PyObject *resultlist) { --- 687,691 ---- } ! static int gc_referents_for(PyObject *objs, PyGC_Head *list, PyObject *resultlist) { *************** *** 699,713 **** PyObject *obj; traverseproc traverse; ! struct referents refs = {objs, 0}; ! for (gc = list->gc_next; gc != list; gc = gc->gc_next){ ! obj = PyObject_FROM_GC(gc); traverse = obj->ob_type->tp_traverse; if (obj == objs || obj == resultlist) continue; ! if (traverse(obj, (visitproc)referentsvisit, &refs)) { ! PyList_Append(resultlist, obj); ! refs.seen = 0; } } } --- 693,707 ---- PyObject *obj; traverseproc traverse; ! for (gc = list->gc_next; gc != list; gc = gc->gc_next) { ! obj = PyObject_FROM_GC(gc); traverse = obj->ob_type->tp_traverse; if (obj == objs || obj == resultlist) continue; ! if (traverse(obj, (visitproc)referentsvisit, objs)) { ! if (PyList_Append(resultlist, obj) < 0) ! return 0; /* error */ } } + return 1; /* no error */ } *************** *** 716,726 **** Return the list of objects that directly refer to any of objs."; ! static PyObject* ! gc_get_referents(PyObject *self, PyObject* args) { PyObject *result = PyList_New(0); ! gc_referents_for(args, &generation0, result); ! gc_referents_for(args, &generation1, result); ! gc_referents_for(args, &generation2, result); return result; } --- 710,723 ---- Return the list of objects that directly refer to any of objs."; ! static PyObject * ! gc_get_referents(PyObject *self, PyObject *args) { PyObject *result = PyList_New(0); ! if (!(gc_referents_for(args, &generation0, result) && ! gc_referents_for(args, &generation1, result) && ! gc_referents_for(args, &generation2, result))) { ! Py_DECREF(result); ! return NULL; ! } return result; } From gvanrossum@users.sourceforge.net Fri Aug 10 15:50:00 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 07:50:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_re.py,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv6238 Modified Files: test_re.py Log Message: Check in a testcase for SF bug #449000: re.sub(r'\n', ...) broke. Index: test_re.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_re.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** test_re.py 2001/03/22 15:51:28 1.30 --- test_re.py 2001/08/10 14:49:58 1.31 *************** *** 60,63 **** --- 60,69 ---- verify(re.sub('^\s*', 'X', 'test') == 'Xtest') + + # Test for sub() on escaped characters, see SF bug #449000 + verify(re.sub(r'\r\n', r'\n', 'abc\r\ndef\r\n') == 'abc\ndef\n') + verify(re.sub('\r\n', r'\n', 'abc\r\ndef\r\n') == 'abc\ndef\n') + verify(re.sub(r'\r\n', '\n', 'abc\r\ndef\r\n') == 'abc\ndef\n') + verify(re.sub('\r\n', '\n', 'abc\r\ndef\r\n') == 'abc\ndef\n') except AssertionError: raise TestFailed, "re.sub" From gvanrossum@users.sourceforge.net Fri Aug 10 15:52:51 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 07:52:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_sre.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv6901 Modified Files: test_sre.py Log Message: Check in a testcase for SF bug #449000: re.sub(r'\n', ...) broke. Index: test_sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test_sre.py 2001/07/02 19:54:28 1.25 --- test_sre.py 2001/08/10 14:52:48 1.26 *************** *** 118,121 **** --- 118,127 ---- test(r"""sre.sub(r'(\S)\s+(\S)', r'\1 \2', 'hello there')""", 'hello there') + # Test for sub() on escaped characters, see SF bug #449000 + test(r"""sre.sub(r'\r\n', r'\n', 'abc\r\ndef\r\n')""", 'abc\ndef\n') + test(r"""sre.sub('\r\n', r'\n', 'abc\r\ndef\r\n')""", 'abc\ndef\n') + test(r"""sre.sub(r'\r\n', '\n', 'abc\r\ndef\r\n')""", 'abc\ndef\n') + test(r"""sre.sub('\r\n', '\n', 'abc\r\ndef\r\n')""", 'abc\ndef\n') + if verbose: print 'Running tests on symbolic references' From gvanrossum@users.sourceforge.net Fri Aug 10 15:56:56 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 07:56:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib sre.py,1.33,1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv7950 Modified Files: sre.py Log Message: Disable the sub() optimization until Fredrik has time to look into SF bug #449000, "re.sub(r'\n', ...) broke". This was Fredrik's suggestion -- he's on vacation and said he wouldn't be able to work on this until next week. Index: sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** sre.py 2001/07/08 13:26:57 1.33 --- sre.py 2001/08/10 14:56:54 1.34 *************** *** 171,174 **** --- 171,175 ---- template = _compile_repl(template, pattern) literals = template[1] + sub = 0 # temporarly disabled, see bug #449000 if (sub and not count and pattern._isliteral() and len(literals) == 1 and literals[0]): From akuchling@users.sourceforge.net Fri Aug 10 16:50:13 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 10 Aug 2001 08:50:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_zlib.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv20851 Modified Files: test_zlib.py Log Message: Patch #441091 from Finn Bock: the more advanced flush options are not available in java, so only use the advanced flush options if they are defined in the zlib module. Index: test_zlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_zlib.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_zlib.py 2001/02/21 07:29:48 1.13 --- test_zlib.py 2001/08/10 15:50:11 1.14 *************** *** 79,83 **** # Test flush() with the various options, using all the different levels # in order to provide more variations. ! for sync in [zlib.Z_NO_FLUSH, zlib.Z_SYNC_FLUSH, zlib.Z_FULL_FLUSH]: for level in range(10): obj = zlib.compressobj( level ) --- 79,86 ---- # Test flush() with the various options, using all the different levels # in order to provide more variations. ! sync_opt = ['Z_NO_FLUSH', 'Z_SYNC_FLUSH', 'Z_FULL_FLUSH'] ! sync_opt = [getattr(zlib, opt) for opt in sync_opt if hasattr(zlib, opt)] ! ! for sync in sync_opt: for level in range(10): obj = zlib.compressobj( level ) *************** *** 97,117 **** print 'Testing on 17K of random data' ! # Create compressor and decompressor objects ! c=zlib.compressobj(9) ! d=zlib.decompressobj() ! # Try 17K of data ! # generate random data stream ! a="" ! for i in range(17*1024): ! a=a+chr(random.randint(0,255)) ! # compress, sync-flush, and decompress ! t = d.decompress( c.compress(a)+c.flush(zlib.Z_SYNC_FLUSH) ) ! # if decompressed data is different from the input data, choke. ! if len(t) != len(a): ! print len(a),len(t),len(d.unused_data) ! raise TestFailed, "output of 17K doesn't match" def ignore(): --- 100,122 ---- print 'Testing on 17K of random data' ! if hasattr(zlib, 'Z_SYNC_FLUSH'): ! # Create compressor and decompressor objects ! c=zlib.compressobj(9) ! d=zlib.decompressobj() ! # Try 17K of data ! # generate random data stream ! a="" ! for i in range(17*1024): ! a=a+chr(random.randint(0,255)) ! # compress, sync-flush, and decompress ! t = d.decompress( c.compress(a)+c.flush(zlib.Z_SYNC_FLUSH) ) ! ! # if decompressed data is different from the input data, choke. ! if len(t) != len(a): ! print len(a),len(t),len(d.unused_data) ! raise TestFailed, "output of 17K doesn't match" def ignore(): From fdrake@users.sourceforge.net Fri Aug 10 16:55:12 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 10 Aug 2001 08:55:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib liboperator.tex,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv22135/lib Modified Files: liboperator.tex Log Message: Added documentation for the new rich comparison support. This closes SF patch #428320. Added documentation for the new floordiv() and truediv() functions. This is part of SF bug #449093. Re-organized the listing of functions to get better logical grouping. Index: liboperator.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liboperator.tex,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** liboperator.tex 2000/12/15 05:41:49 1.19 --- liboperator.tex 2001/08/10 15:55:09 1.20 *************** *** 13,56 **** leading and trailing \samp{__} are also provided for convenience. ! The \module{operator} module defines the following functions: ! \begin{funcdesc}{add}{a, b} ! \funcline{__add__}{a, b} ! Return \var{a} \code{+} \var{b}, for \var{a} and \var{b} numbers. \end{funcdesc} ! \begin{funcdesc}{sub}{a, b} ! \funcline{__sub__}{a, b} ! Return \var{a} \code{-} \var{b}. \end{funcdesc} ! \begin{funcdesc}{mul}{a, b} ! \funcline{__mul__}{a, b} ! Return \var{a} \code{*} \var{b}, for \var{a} and \var{b} numbers. \end{funcdesc} ! \begin{funcdesc}{div}{a, b} ! \funcline{__div__}{a, b} ! Return \var{a} \code{/} \var{b}. \end{funcdesc} ! \begin{funcdesc}{mod}{a, b} ! \funcline{__mod__}{a, b} ! Return \var{a} \code{\%} \var{b}. \end{funcdesc} ! \begin{funcdesc}{neg}{o} ! \funcline{__neg__}{o} ! Return \var{o} negated. \end{funcdesc} ! \begin{funcdesc}{pos}{o} ! \funcline{__pos__}{o} ! Return \var{o} positive. \end{funcdesc} ! \begin{funcdesc}{abs}{o} ! \funcline{__abs__}{o} ! Return the absolute value of \var{o}. \end{funcdesc} --- 13,94 ---- leading and trailing \samp{__} are also provided for convenience. ! The functions fall into categories that perform object comparisons, ! logical operations, mathematical operations, sequence operations, and ! abstract type tests. ! The object comparison functions are useful for all objects, and are ! named after the rich comparison operators they support: ! ! \begin{funcdesc}{lt}{a, b} ! \funcline{le}{a, b} ! \funcline{eq}{a, b} ! \funcline{ne}{a, b} ! \funcline{ge}{a, b} ! \funcline{gt}{a, b} ! \funcline{__lt__}{a, b} ! \funcline{__le__}{a, b} ! \funcline{__eq__}{a, b} ! \funcline{__ne__}{a, b} ! \funcline{__ge__}{a, b} ! \funcline{__gt__}{a, b} ! Perform ``rich comparisons'' between \var{a} and \var{b}. Specifically, ! \code{lt(\var{a}, \var{b})} is equivalent to \code{\var{a} < \var{b}}, ! \code{le(\var{a}, \var{b})} is equivalent to \code{\var{a} <= \var{b}}, ! \code{eq(\var{a}, \var{b})} is equivalent to \code{\var{a} == \var{b}}, ! \code{ne(\var{a}, \var{b})} is equivalent to \code{\var{a} != \var{b}}, ! \code{gt(\var{a}, \var{b})} is equivalent to \code{\var{a} > \var{b}} ! and ! \code{ge(\var{a}, \var{b})} is equivalent to \code{\var{a} >= \var{b}}. ! Note that unlike the built-in \function{cmp()}, these functions can ! return any value, which may or may not be interpretable as a Boolean ! value. See the \citetitle[../ref/ref.html]{Python Reference Manual} ! for more informations about rich comparisons. ! \versionadded{2.2} \end{funcdesc} ! ! The logical operations are also generally applicable to all objects, ! and support truth tests and Boolean operations: ! ! \begin{funcdesc}{not_}{o} ! \funcline{__not__}{o} ! Return the outcome of \keyword{not} \var{o}. (Note that there is no ! \method{__not__()} method for object instances; only the interpreter ! core defines this operation. The result is affected by the ! \method{__nonzero__()} and \method{__len__()} methods.) \end{funcdesc} ! \begin{funcdesc}{truth}{o} ! Return \code{1} if \var{o} is true, and 0 otherwise. \end{funcdesc} ! ! The mathematical and bitwise operations are the most numerous: ! ! \begin{funcdesc}{abs}{o} ! \funcline{__abs__}{o} ! Return the absolute value of \var{o}. \end{funcdesc} ! \begin{funcdesc}{add}{a, b} ! \funcline{__add__}{a, b} ! Return \var{a} \code{+} \var{b}, for \var{a} and \var{b} numbers. \end{funcdesc} ! \begin{funcdesc}{and_}{a, b} ! \funcline{__and__}{a, b} ! Return the bitwise and of \var{a} and \var{b}. \end{funcdesc} ! \begin{funcdesc}{div}{a, b} ! \funcline{__div__}{a, b} ! Return \var{a} \code{/} \var{b} when \code{__future__.division} is not ! in effect. This is also known as ``classic'' division. \end{funcdesc} ! \begin{funcdesc}{floordiv}{a, b} ! \funcline{__floordiv__}{a, b} ! Return \var{a} \code{//} \var{b}. ! \versionadded{2.2} \end{funcdesc} *************** *** 59,65 **** \funcline{__inv__}{o} \funcline{__invert__}{o} ! Return the bitwise inverse of the number \var{o}. The names ! \function{invert()} and \function{__invert__()} were added in Python ! 2.0. \end{funcdesc} --- 97,103 ---- \funcline{__inv__}{o} \funcline{__invert__}{o} ! Return the bitwise inverse of the number \var{o}. This is equivalent ! to \code{\textasciitilde}\var{o}. The names \function{invert()} and ! \function{__invert__()} were added in Python 2.0. \end{funcdesc} *************** *** 69,80 **** \end{funcdesc} ! \begin{funcdesc}{rshift}{a, b} ! \funcline{__rshift__}{a, b} ! Return \var{a} shifted right by \var{b}. \end{funcdesc} ! \begin{funcdesc}{and_}{a, b} ! \funcline{__and__}{a, b} ! Return the bitwise and of \var{a} and \var{b}. \end{funcdesc} --- 107,123 ---- \end{funcdesc} ! \begin{funcdesc}{mod}{a, b} ! \funcline{__mod__}{a, b} ! Return \var{a} \code{\%} \var{b}. \end{funcdesc} ! \begin{funcdesc}{mul}{a, b} ! \funcline{__mul__}{a, b} ! Return \var{a} \code{*} \var{b}, for \var{a} and \var{b} numbers. ! \end{funcdesc} ! ! \begin{funcdesc}{neg}{o} ! \funcline{__neg__}{o} ! Return \var{o} negated. \end{funcdesc} *************** *** 84,87 **** --- 127,152 ---- \end{funcdesc} + \begin{funcdesc}{pos}{o} + \funcline{__pos__}{o} + Return \var{o} positive. + \end{funcdesc} + + \begin{funcdesc}{rshift}{a, b} + \funcline{__rshift__}{a, b} + Return \var{a} shifted right by \var{b}. + \end{funcdesc} + + \begin{funcdesc}{sub}{a, b} + \funcline{__sub__}{a, b} + Return \var{a} \code{-} \var{b}. + \end{funcdesc} + + \begin{funcdesc}{truediv}{a, b} + \funcline{__truediv__}{a, b} + Return \var{a} \code{/} \var{b} when \code{__future__.division} is in + effect. This is also known as division. + \versionadded{2.2} + \end{funcdesc} + \begin{funcdesc}{xor}{a, b} \funcline{__xor__}{a, b} *************** *** 89,102 **** \end{funcdesc} - \begin{funcdesc}{not_}{o} - \funcline{__not__}{o} - Return the outcome of \keyword{not} \var{o}. (Note that there is no - \method{__not__()} method for object instances; only the interpreter - core defines this operation.) - \end{funcdesc} ! \begin{funcdesc}{truth}{o} ! Return \code{1} if \var{o} is true, and 0 otherwise. ! \end{funcdesc} \begin{funcdesc}{concat}{a, b} --- 154,159 ---- \end{funcdesc} ! Operations which work with sequences include: \begin{funcdesc}{concat}{a, b} *************** *** 105,114 **** \end{funcdesc} - \begin{funcdesc}{repeat}{a, b} - \funcline{__repeat__}{a, b} - Return \var{a} \code{*} \var{b} where \var{a} is a sequence and - \var{b} is an integer. - \end{funcdesc} - \begin{funcdesc}{contains}{a, b} \funcline{__contains__}{a, b} --- 162,165 ---- *************** *** 118,132 **** \end{funcdesc} - \begin{funcdesc}{sequenceIncludes}{\unspecified} - \deprecated{2.0}{Use \function{contains()} instead.} - Alias for \function{contains()}. - \end{funcdesc} - \begin{funcdesc}{countOf}{a, b} Return the number of occurrences of \var{b} in \var{a}. \end{funcdesc} ! \begin{funcdesc}{indexOf}{a, b} ! Return the index of the first of occurrence of \var{b} in \var{a}. \end{funcdesc} --- 169,184 ---- \end{funcdesc} \begin{funcdesc}{countOf}{a, b} Return the number of occurrences of \var{b} in \var{a}. \end{funcdesc} ! \begin{funcdesc}{delitem}{a, b} ! \funcline{__delitem__}{a, b} ! Remove the value of \var{a} at index \var{b}. ! \end{funcdesc} ! ! \begin{funcdesc}{delslice}{a, b, c} ! \funcline{__delslice__}{a, b, c} ! Delete the slice of \var{a} from index \var{b} to index \var{c}\code{-1}. \end{funcdesc} *************** *** 136,152 **** \end{funcdesc} ! \begin{funcdesc}{setitem}{a, b, c} ! \funcline{__setitem__}{a, b, c} ! Set the value of \var{a} at index \var{b} to \var{c}. \end{funcdesc} ! \begin{funcdesc}{delitem}{a, b} ! \funcline{__delitem__}{a, b} ! Remove the value of \var{a} at index \var{b}. \end{funcdesc} ! \begin{funcdesc}{getslice}{a, b, c} ! \funcline{__getslice__}{a, b, c} ! Return the slice of \var{a} from index \var{b} to index \var{c}\code{-1}. \end{funcdesc} --- 188,214 ---- \end{funcdesc} ! \begin{funcdesc}{getslice}{a, b, c} ! \funcline{__getslice__}{a, b, c} ! Return the slice of \var{a} from index \var{b} to index \var{c}\code{-1}. \end{funcdesc} ! \begin{funcdesc}{indexOf}{a, b} ! Return the index of the first of occurrence of \var{b} in \var{a}. \end{funcdesc} ! \begin{funcdesc}{repeat}{a, b} ! \funcline{__repeat__}{a, b} ! Return \var{a} \code{*} \var{b} where \var{a} is a sequence and ! \var{b} is an integer. ! \end{funcdesc} ! ! \begin{funcdesc}{sequenceIncludes}{\unspecified} ! \deprecated{2.0}{Use \function{contains()} instead.} ! Alias for \function{contains()}. ! \end{funcdesc} ! ! \begin{funcdesc}{setitem}{a, b, c} ! \funcline{__setitem__}{a, b, c} ! Set the value of \var{a} at index \var{b} to \var{c}. \end{funcdesc} *************** *** 157,167 **** \end{funcdesc} - \begin{funcdesc}{delslice}{a, b, c} - \funcline{__delslice__}{a, b, c} - Delete the slice of \var{a} from index \var{b} to index \var{c}\code{-1}. - \end{funcdesc} ! The \module{operator} also defines a few predicates to test the type ! of objects. \strong{Note:} Be careful not to misinterpret the results of these functions; only \function{isCallable()} has any measure of reliability with instance objects. For example: --- 219,225 ---- \end{funcdesc} ! The \module{operator} module also defines a few predicates to test the ! type of objects. \strong{Note:} Be careful not to misinterpret the results of these functions; only \function{isCallable()} has any measure of reliability with instance objects. For example: *************** *** 240,244 **** {\code{contains(\var{seq}, \var{o})}} \lineiii{Division}{\code{\var{a} / \var{b}}} ! {\code{div(\var{a}, \var{b})}} \lineiii{Bitwise And}{\code{\var{a} \&\ \var{b}}} {\code{and_(\var{a}, \var{b})}} --- 298,306 ---- {\code{contains(\var{seq}, \var{o})}} \lineiii{Division}{\code{\var{a} / \var{b}}} ! {\code{div(\var{a}, \var{b}) \#} without \code{__future__.division}} ! \lineiii{Division}{\code{\var{a} / \var{b}}} ! {\code{truediv(\var{a}, \var{b}) \#} with \code{__future__.division}} ! \lineiii{Division}{\code{\var{a} // \var{b}}} ! {\code{floordiv(\var{a}, \var{b})}} \lineiii{Bitwise And}{\code{\var{a} \&\ \var{b}}} {\code{and_(\var{a}, \var{b})}} *************** *** 281,283 **** --- 343,357 ---- \lineiii{Truth Test}{\code{\var{o}}} {\code{truth(\var{o})}} + \lineiii{Ordering}{\code{\var{a} < \var{b}}} + {\code{lt(\var{a}, \var{b})}} + \lineiii{Ordering}{\code{\var{a} <= \var{b}}} + {\code{le(\var{a}, \var{b})}} + \lineiii{Equality}{\code{\var{a} == \var{b}}} + {\code{eq(\var{a}, \var{b})}} + \lineiii{Difference}{\code{\var{a} != \var{b}}} + {\code{ne(\var{a}, \var{b})}} + \lineiii{Ordering}{\code{\var{a} >= \var{b}}} + {\code{ge(\var{a}, \var{b})}} + \lineiii{Ordering}{\code{\var{a} > \var{b}}} + {\code{gt(\var{a}, \var{b})}} \end{tableiii} From fdrake@users.sourceforge.net Fri Aug 10 17:15:10 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 10 Aug 2001 09:15:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib librlcompleter.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv26282/lib Modified Files: librlcompleter.tex Log Message: Usage fix, problem reported by Keith Briggs. Index: librlcompleter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librlcompleter.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** librlcompleter.tex 2001/07/06 20:30:11 1.6 --- librlcompleter.tex 2001/08/10 16:15:08 1.7 *************** *** 11,15 **** and keywords. ! This module is \UNIX-specific due to it's dependence on the \refmodule{readline} module. --- 11,15 ---- and keywords. ! This module is \UNIX-specific due to its dependence on the \refmodule{readline} module. From gvanrossum@users.sourceforge.net Fri Aug 10 18:37:04 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 10:37:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include object.h,2.83,2.84 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv15213 Modified Files: object.h Log Message: Add new flags for PyType_Ready(): READY to explicitly indicate the type is ready, and READYING to indicate that it is busy with the type. A recursive call is a fatal error. Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.83 retrieving revision 2.84 diff -C2 -d -r2.83 -r2.84 *** object.h 2001/08/08 05:00:17 2.83 --- object.h 2001/08/10 17:37:02 2.84 *************** *** 415,418 **** --- 415,424 ---- #define Py_TPFLAGS_DYNAMICTYPE (1L<<11) + /* Set if the type is 'ready' -- fully initialized */ + #define Py_TPFLAGS_READY (1L<<12) + + /* Set while the type is being 'readied', to prevent recursive ready calls */ + #define Py_TPFLAGS_READYING (1L<<13) + #define Py_TPFLAGS_DEFAULT ( \ Py_TPFLAGS_HAVE_GETCHARBUFFER | \ From fdrake@users.sourceforge.net Fri Aug 10 18:37:35 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 10 Aug 2001 10:37:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libinspect.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv15567/lib Modified Files: libinspect.tex Log Message: Added a warning about reference cycles and memory consumption to the section on functions which return stack frames. This closes SF bug #449258. Index: libinspect.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libinspect.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libinspect.tex 2001/04/10 15:12:34 1.3 --- libinspect.tex 2001/08/10 17:37:33 1.4 *************** *** 265,268 **** --- 265,278 ---- context to return, which are centered around the current line. + \strong{Warning:} Keeping references to frame objects, as found in + the first element of the frame records these functions return, can + cause your program to create reference cycles. Once a reference cycle + has been created, the lifespan of all objects which can be accessed + from the objects which form the cycle can become much longer even if + Python's optional cycle detector is enabled. If such cycles must be + created, it is important to ensure they are explicitly broken to avoid + the delayed destruction of objects and increased memory consumption + which occurs. + \begin{funcdesc}{getouterframes}{frame\optional{, context}} Get a list of frame records for a frame and all higher (calling) From gvanrossum@users.sourceforge.net Fri Aug 10 18:39:51 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 10:39:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.27,2.28 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv16034 Modified Files: typeobject.c Log Message: Change PyType_Ready() to use the READY and READYING flags. This makes it possible to detect recursive calls early (as opposed to when the stack overflows :-). Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -d -r2.27 -r2.28 *** typeobject.c 2001/08/09 19:43:37 2.27 --- typeobject.c 2001/08/10 17:39:49 2.28 *************** *** 1170,1175 **** int i, n; ! if (type->tp_dict != NULL) ! return 0; /* Already initialized */ /* Initialize tp_base (defaults to BaseObject unless that's us) */ --- 1170,1181 ---- int i, n; ! if (type->tp_flags & Py_TPFLAGS_READY) { ! assert(type->tp_dict != NULL); ! return 0; ! } ! assert((type->tp_flags & Py_TPFLAGS_READYING) == 0); ! assert(type->tp_dict == NULL); ! ! type->tp_flags |= Py_TPFLAGS_READYING; /* Initialize tp_base (defaults to BaseObject unless that's us) */ *************** *** 1186,1190 **** bases = Py_BuildValue("(O)", base); if (bases == NULL) ! return -1; type->tp_bases = bases; } --- 1192,1196 ---- bases = Py_BuildValue("(O)", base); if (bases == NULL) ! goto error; type->tp_bases = bases; } *************** *** 1193,1197 **** if (base && base->tp_dict == NULL) { if (PyType_Ready(base) < 0) ! return -1; } --- 1199,1203 ---- if (base && base->tp_dict == NULL) { if (PyType_Ready(base) < 0) ! goto error; } *************** *** 1201,1205 **** dict = PyDict_New(); if (dict == NULL) ! return -1; type->tp_defined = dict; } --- 1207,1211 ---- dict = PyDict_New(); if (dict == NULL) ! goto error; type->tp_defined = dict; } *************** *** 1207,1222 **** /* Add type-specific descriptors to tp_defined */ if (add_operators(type) < 0) ! return -1; if (type->tp_methods != NULL) { if (add_methods(type, type->tp_methods) < 0) ! return -1; } if (type->tp_members != NULL) { if (add_members(type, type->tp_members) < 0) ! return -1; } if (type->tp_getset != NULL) { if (add_getset(type, type->tp_getset) < 0) ! return -1; } --- 1213,1228 ---- /* Add type-specific descriptors to tp_defined */ if (add_operators(type) < 0) ! goto error; if (type->tp_methods != NULL) { if (add_methods(type, type->tp_methods) < 0) ! goto error; } if (type->tp_members != NULL) { if (add_members(type, type->tp_members) < 0) ! goto error; } if (type->tp_getset != NULL) { if (add_getset(type, type->tp_getset) < 0) ! goto error; } *************** *** 1229,1233 **** /* Calculate method resolution order */ if (mro_internal(type) < 0) { ! return -1; } --- 1235,1239 ---- /* Calculate method resolution order */ if (mro_internal(type) < 0) { ! goto error; } *************** *** 1241,1245 **** type->tp_dict = PyDict_New(); if (type->tp_dict == NULL) ! return -1; bases = type->tp_mro; assert(bases != NULL); --- 1247,1251 ---- type->tp_dict = PyDict_New(); if (type->tp_dict == NULL) ! goto error; bases = type->tp_mro; assert(bases != NULL); *************** *** 1251,1255 **** x = base->tp_defined; if (x != NULL && PyDict_Update(type->tp_dict, x) < 0) ! return -1; } } --- 1257,1261 ---- x = base->tp_defined; if (x != NULL && PyDict_Update(type->tp_dict, x) < 0) ! goto error; } } *************** *** 1258,1264 **** if (type->tp_base != NULL) if (inherit_slots(type, type->tp_base) < 0) ! return -1; return 0; } --- 1264,1277 ---- if (type->tp_base != NULL) if (inherit_slots(type, type->tp_base) < 0) ! goto error; + assert(type->tp_dict != NULL); + type->tp_flags = + (type->tp_flags & ~Py_TPFLAGS_READYING) | Py_TPFLAGS_READY; return 0; + + error: + type->tp_flags &= ~Py_TPFLAGS_READYING; + return -1; } From akuchling@users.sourceforge.net Fri Aug 10 19:34:45 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 10 Aug 2001 11:34:45 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0241.txt,1.9,1.10 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv30535 Modified Files: pep-0241.txt Log Message: Refer to just the MIT license, not the MIT/X11 license Index: pep-0241.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0241.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pep-0241.txt 2001/07/09 03:57:09 1.9 --- pep-0241.txt 2001/08/10 18:34:43 1.10 *************** *** 174,178 **** The choices are: ! Artistic, BSD, DFSG, GNU GPL, GNU LGPL, "MIT/X11", Mozilla PL, "public domain", Python, Qt PL, Zope PL, unknown, nocommercial, nosell, nosource, shareware, other --- 174,178 ---- The choices are: ! Artistic, BSD, DFSG, GNU GPL, GNU LGPL, "MIT", Mozilla PL, "public domain", Python, Qt PL, Zope PL, unknown, nocommercial, nosell, nosource, shareware, other *************** *** 187,191 **** Python Python 1.6 or higher license. Version 1.5.2 and ! earlier are under the MIT/X11 license. public domain Software is public domain, not copyrighted. --- 187,191 ---- Python Python 1.6 or higher license. Version 1.5.2 and ! earlier are under the MIT license. public domain Software is public domain, not copyrighted. *************** *** 200,204 **** freely redistributable. The list of redistributable licenses is: ! Artistic, BSD, DFSG, GNU GPL, GNU LGPL, "MIT/X11", Mozilla PL, "public domain", Python, Qt PL, Zope PL, nosource, shareware --- 200,204 ---- freely redistributable. The list of redistributable licenses is: ! Artistic, BSD, DFSG, GNU GPL, GNU LGPL, "MIT", Mozilla PL, "public domain", Python, Qt PL, Zope PL, nosource, shareware *************** *** 210,214 **** Example: ! License: MIT/X11 --- 210,214 ---- Example: ! License: MIT From akuchling@users.sourceforge.net Fri Aug 10 19:49:25 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 10 Aug 2001 11:49:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils dist.py,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv1945 Modified Files: dist.py Log Message: [Bug #412271, bug #449009] Use 'license' as the attribute name, though 'licence' is still supported for backward-compatibility (Should I add a warning to get_licence(), or not bother?) Index: dist.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/dist.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** dist.py 2001/03/31 02:41:01 1.47 --- dist.py 2001/08/10 18:49:23 1.48 *************** *** 14,18 **** from copy import copy from distutils.errors import * - from distutils import sysconfig from distutils.fancy_getopt import FancyGetopt, translate_longopt from distutils.util import check_environ, strtobool, rfc822_escape --- 14,17 ---- *************** *** 78,85 **** ('url', None, "print the URL for this package"), - ('licence', None, - "print the licence of the package"), ('license', None, ! "alias for --licence"), ('description', None, "print the package description"), --- 77,84 ---- ('url', None, "print the URL for this package"), ('license', None, ! "print the license of the package"), ! ('licence', None, ! "alias for --license"), ('description', None, "print the package description"), *************** *** 396,400 **** parser = FancyGetopt(self.global_options + self.display_options) parser.set_negative_aliases(self.negative_opt) ! parser.set_aliases({'license': 'licence'}) args = parser.getopt(args=self.script_args, object=self) option_order = parser.get_option_order() --- 395,399 ---- parser = FancyGetopt(self.global_options + self.display_options) parser.set_negative_aliases(self.negative_opt) ! parser.set_aliases({'licence': 'license'}) args = parser.getopt(args=self.script_args, object=self) option_order = parser.get_option_order() *************** *** 581,585 **** for command in self.commands: ! if type(command) is ClassType and issubclass(klass, Command): klass = command else: --- 580,584 ---- for command in self.commands: ! if type(command) is ClassType and issubclass(command, Command): klass = command else: *************** *** 972,976 **** self.maintainer_email = None self.url = None ! self.licence = None self.description = None self.long_description = None --- 971,975 ---- self.maintainer_email = None self.url = None ! self.license = None self.description = None self.long_description = None *************** *** 991,995 **** pkg_info.write('Author: %s\n' % self.get_contact() ) pkg_info.write('Author-email: %s\n' % self.get_contact_email() ) ! pkg_info.write('License: %s\n' % self.get_licence() ) long_desc = rfc822_escape( self.get_long_description() ) --- 990,994 ---- pkg_info.write('Author: %s\n' % self.get_contact() ) pkg_info.write('Author-email: %s\n' % self.get_contact_email() ) ! pkg_info.write('License: %s\n' % self.get_license() ) long_desc = rfc822_escape( self.get_long_description() ) *************** *** 1043,1049 **** return self.url or "UNKNOWN" ! def get_licence(self): ! return self.licence or "UNKNOWN" ! def get_description(self): return self.description or "UNKNOWN" --- 1042,1049 ---- return self.url or "UNKNOWN" ! def get_license(self): ! return self.license or "UNKNOWN" ! get_licence = get_license ! def get_description(self): return self.description or "UNKNOWN" From akuchling@users.sourceforge.net Fri Aug 10 19:50:14 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 10 Aug 2001 11:50:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils/command bdist_rpm.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv2621 Modified Files: bdist_rpm.py Log Message: Use .get_license() Index: bdist_rpm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_rpm.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** bdist_rpm.py 2001/05/21 20:34:38 1.24 --- bdist_rpm.py 2001/08/10 18:50:11 1.25 *************** *** 348,352 **** spec_file.extend([ ! 'Copyright: ' + self.distribution.get_licence(), 'Group: ' + self.group, 'BuildRoot: %{_tmppath}/%{name}-buildroot', --- 348,352 ---- spec_file.extend([ ! 'Copyright: ' + self.distribution.get_license(), 'Group: ' + self.group, 'BuildRoot: %{_tmppath}/%{name}-buildroot', From fdrake@users.sourceforge.net Fri Aug 10 19:59:32 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 10 Aug 2001 11:59:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils dist.py,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv4835/Lib/distutils Modified Files: dist.py Log Message: Wrap a comment to fit in 80 columns. Use construction-syntax for an exception to make the argument easier to read. Index: dist.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/dist.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** dist.py 2001/08/10 18:49:23 1.48 --- dist.py 2001/08/10 18:59:30 1.49 *************** *** 376,381 **** """ # ! # We now have enough information to show the Macintosh dialog that allows ! # the user to interactively specify the "command line". # if sys.platform == 'mac': --- 376,381 ---- """ # ! # We now have enough information to show the Macintosh dialog ! # that allows the user to interactively specify the "command line". # if sys.platform == 'mac': *************** *** 509,516 **** func() else: ! raise DistutilsClassError, \ ! ("invalid help function %s for help option '%s': " ! "must be a callable object (function, etc.)") % \ ! (`func`, help_option) if help_option_found: --- 509,516 ---- func() else: ! raise DistutilsClassError( ! "invalid help function %s for help option '%s': " ! "must be a callable object (function, etc.)" ! % (`func`, help_option)) if help_option_found: From akuchling@users.sourceforge.net Fri Aug 10 20:00:02 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 10 Aug 2001 12:00:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils/command install.py,1.56,1.57 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv5003 Modified Files: install.py Log Message: Add forgotten import Index: install.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/install.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** install.py 2001/01/16 16:16:03 1.56 --- install.py 2001/08/10 18:59:59 1.57 *************** *** 11,14 **** --- 11,15 ---- from distutils.core import Command, DEBUG from distutils.sysconfig import get_config_vars + from distutils.errors import DistutilsPlatformError from distutils.file_util import write_file from distutils.util import convert_path, subst_vars, change_root From akuchling@users.sourceforge.net Fri Aug 10 20:00:17 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 10 Aug 2001 12:00:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils/command bdist_rpm.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv5110 Modified Files: bdist_rpm.py Log Message: Fix typo caught by PyChecker Index: bdist_rpm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_rpm.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** bdist_rpm.py 2001/08/10 18:50:11 1.25 --- bdist_rpm.py 2001/08/10 19:00:15 1.26 *************** *** 168,172 **** "distributions on platform %s" % os.name) if self.binary_only and self.source_only: ! raise DistutilsOptionsError, \ "cannot supply both '--source-only' and '--binary-only'" --- 168,172 ---- "distributions on platform %s" % os.name) if self.binary_only and self.source_only: ! raise DistutilsOptionError, \ "cannot supply both '--source-only' and '--binary-only'" From akuchling@users.sourceforge.net Fri Aug 10 20:00:43 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 10 Aug 2001 12:00:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils/command build_scripts.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv5235 Modified Files: build_scripts.py Log Message: Remove unused variable Index: build_scripts.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_scripts.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** build_scripts.py 2001/07/29 21:39:18 1.10 --- build_scripts.py 2001/08/10 19:00:41 1.11 *************** *** 52,56 **** line to refer to the current Python interpreter as we copy. """ - outfiles = [] self.mkpath(self.build_dir) for script in self.scripts: --- 52,55 ---- From loewis@users.sourceforge.net Fri Aug 10 20:41:47 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 10 Aug 2001 12:41:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _localemodule.c,2.20,2.21 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17943 Modified Files: _localemodule.c Log Message: _DATE_FMT does not always accompany CODESET. Index: _localemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_localemodule.c,v retrieving revision 2.20 retrieving revision 2.21 diff -C2 -d -r2.20 -r2.21 *** _localemodule.c 2001/08/10 13:58:50 2.20 --- _localemodule.c 2001/08/10 19:41:45 2.21 *************** *** 556,559 **** --- 556,562 ---- ADDINT(YESEXPR); ADDINT(NOEXPR); + #endif + #ifdef _DATE_FMT + /* This is not available in all glibc versions that have CODESET. */ ADDINT(_DATE_FMT); #endif From gvanrossum@users.sourceforge.net Fri Aug 10 20:42:40 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 12:42:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18211 Modified Files: test_descr.py Log Message: Allow AttributeError as well as TypeError for attribute-less objects. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_descr.py 2001/08/09 19:45:21 1.4 --- test_descr.py 2001/08/10 19:42:38 1.5 *************** *** 482,486 **** try: a.foo = 12 ! except TypeError: pass else: --- 482,486 ---- try: a.foo = 12 ! except (AttributeError, TypeError): pass else: From fdrake@users.sourceforge.net Fri Aug 10 20:47:44 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 10 Aug 2001 12:47:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs fancyhdr.sty,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv19337 Added Files: fancyhdr.sty Log Message: Added this LaTeX style file to the package since not all LaTeX installations have it, especially on non-Unix platforms. (MikTeX in particular does not have it.) This is part of the response to SF patch #429611. --- NEW FILE: fancyhdr.sty --- % fancyhdr.sty version 1.99d % Fancy headers and footers for LaTeX. % Piet van Oostrum, Dept of Computer Science, University of Utrecht % Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands % Telephone: +31 30 2532180. Email: piet@cs.ruu.nl % ======================================================================== % LICENCE: This is free software. You are allowed to use and distribute % this software in any way you like. You are also allowed to make modified % versions of it, but you can distribute a modified version only if you % clearly indicate that it is a modified version and the person(s) who % modified it. This indication should be in a prominent place, e.g. in the % top of the file. If possible a contact address, preferably by email, % should be given for these persons. If that is feasible the modifications % should be indicated in the source code. % ======================================================================== % MODIFICATION HISTORY: % Sep 16, 1994 % version 1.4: Correction for use with \reversemargin % Sep 29, 1994: % version 1.5: Added the \iftopfloat, \ifbotfloat and \iffloatpage commands % Oct 4, 1994: % version 1.6: Reset single spacing in headers/footers for use with % setspace.sty or doublespace.sty % Oct 4, 1994: % version 1.7: changed \let\@mkboth\markboth to % \def\@mkboth{\protect\markboth} to make it more robust % Dec 5, 1994: % version 1.8: corrections for amsbook/amsart: define \@chapapp and (more % importantly) use the \chapter/sectionmark definitions from ps@headings if % they exist (which should be true for all standard classes). % May 31, 1995: % version 1.9: The proposed \renewcommand{\headrulewidth}{\iffloatpage... % construction in the doc did not work properly with the fancyplain style. % June 1, 1995: % version 1.91: The definition of \@mkboth wasn't restored on subsequent % \pagestyle{fancy}'s. % June 1, 1995: % version 1.92: The sequence \pagestyle{fancyplain} \pagestyle{plain} % \pagestyle{fancy} would erroneously select the plain version. % June 1, 1995: % version 1.93: \fancypagestyle command added. % Dec 11, 1995: % version 1.94: suggested by Conrad Hughes % CJCH, Dec 11, 1995: added \footruleskip to allow control over footrule % position (old hardcoded value of .3\normalbaselineskip is far too high % when used with very small footer fonts). % Jan 31, 1996: % version 1.95: call \@normalsize in the reset code if that is defined, % otherwise \normalsize. % this is to solve a problem with ucthesis.cls, as this doesn't % define \@currsize. Unfortunately for latex209 calling \normalsize doesn't % work as this is optimized to do very little, so there \@normalsize should % be called. Hopefully this code works for all versions of LaTeX known to % mankind. % April 25, 1996: % version 1.96: initialize \headwidth to a magic (negative) value to catch % most common cases that people change it before calling \pagestyle{fancy}. % Note it can't be initialized when reading in this file, because % \textwidth could be changed afterwards. This is quite probable. % We also switch to \MakeUppercase rather than \uppercase and introduce a % \nouppercase command for use in headers. and footers. % May 3, 1996: % version 1.97: Two changes: % 1. Undo the change in version 1.8 (using the pagestyle{headings} defaults % for the chapter and section marks. The current version of amsbook and % amsart classes don't seem to need them anymore. Moreover the standard % latex classes don't use \markboth if twoside isn't selected, and this is % confusing as \leftmark doesn't work as expected. % 2. include a call to \ps@empty in ps@@fancy. This is to solve a problem % in the amsbook and amsart classes, that make global changes to \topskip, % which are reset in \ps@empty. Hopefully this doesn't break other things. % May 7, 1996: % version 1.98: % Added % after the line \def\nouppercase % May 7, 1996: % version 1.99: This is the alpha version of fancyhdr 2.0 % Introduced the new commands \fancyhead, \fancyfoot, and \fancyhf. % Changed \headrulewidth, \footrulewidth, \footruleskip to % macros rather than length parameters, In this way they can be % conditionalized and they don't consume length registers. There is no need % to have them as length registers unless you want to do calculations with % them, which is unlikely. Note that this may make some uses of them % incompatible (i.e. if you have a file that uses \setlength or \xxxx=) % May 10, 1996: % version 1.99a: % Added a few more % signs % May 10, 1996: % version 1.99b: % Changed the syntax of \f@nfor to be resistent to catcode changes of := % Removed the [1] from the defs of \lhead etc. because the parameter is % consumed by the \@[xy]lhead etc. macros. % June 24, 1997: % version 1.99c: % corrected \nouppercase to also include the protected form of \MakeUppercase % \global added to manipulation of \headwidth. % \iffootnote command added. % Some comments added about \@fancyhead and \@fancyfoot. % Aug 24, 1998 % version 1.99d % Changed the default \ps@empty to \ps@@empty in order to allow % \fancypagestyle{empty} redefinition. \let\fancy@def\gdef \def\if@mpty#1#2#3{\def\temp@ty{#1}\ifx\@empty\temp@ty #2\else#3\fi} % Usage: \@forc \var{charstring}{command to be executed for each char} % This is similar to LaTeX's \@tfor, but expands the charstring. \def\@forc#1#2#3{\expandafter\f@rc\expandafter#1\expandafter{#2}{#3}} \def\f@rc#1#2#3{\def\temp@ty{#2}\ifx\@empty\temp@ty\else \f@@rc#1#2\f@@rc{#3}\fi} \def\f@@rc#1#2#3\f@@rc#4{\def#1{#2}#4\f@rc#1{#3}{#4}} % Usage: \f@nfor\name:=list\do{body} % Like LaTeX's \@for but an empty list is treated as a list with an empty % element \newcommand{\f@nfor}[3]{\edef\@fortmp{#2}% \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}} % Usage: \def@ult \cs{defaults}{argument} % sets \cs to the characters from defaults appearing in argument % or defaults if it would be empty. All characters are lowercased. \newcommand\def@ult[3]{% \edef\temp@a{\lowercase{\edef\noexpand\temp@a{#3}}}\temp@a \def#1{}% \@forc\tmpf@ra{#2}% {\expandafter\if@in\tmpf@ra\temp@a{\edef#1{#1\tmpf@ra}}{}}% \ifx\@empty#1\def#1{#2}\fi} % % \if@in % \newcommand{\if@in}[4]{% \edef\temp@a{#2}\def\temp@b##1#1##2\temp@b{\def\temp@b{##1}}% \expandafter\temp@b#2#1\temp@b\ifx\temp@a\temp@b #4\else #3\fi} \newcommand{\fancyhead}{\@ifnextchar[{\f@ncyhf h}{\f@ncyhf h[]}} \newcommand{\fancyfoot}{\@ifnextchar[{\f@ncyhf f}{\f@ncyhf f[]}} \newcommand{\fancyhf}{\@ifnextchar[{\f@ncyhf {}}{\f@ncyhf {}[]}} % The header and footer fields are stored in command sequences with % names of the form: \f@ncy with for [eo], form [lcr] % and from [hf]. \def\f@ncyhf#1[#2]#3{% \def\temp@c{}% \@forc\tmpf@ra{#2}% {\expandafter\if@in\tmpf@ra{eolcrhf,EOLCRHF}% {}{\edef\temp@c{\temp@c\tmpf@ra}}}% \ifx\@empty\temp@c\else \ifx\PackageError\undefined \errmessage{Illegal char `\temp@c' in fancyhdr argument: [#2]}\else \PackageError{Fancyhdr}{Illegal char `\temp@c' in fancyhdr argument: [#2]}{}\fi \fi \f@nfor\temp@c{#2}% {\def@ult\f@@@eo{eo}\temp@c \def@ult\f@@@lcr{lcr}\temp@c \def@ult\f@@@hf{hf}{#1\temp@c}% \@forc\f@@eo\f@@@eo {\@forc\f@@lcr\f@@@lcr {\@forc\f@@hf\f@@@hf {\expandafter\fancy@def\csname f@ncy\f@@eo\f@@lcr\f@@hf\endcsname {#3}}}}}} % Fancyheadings version 1 commands. These are more or less deprecated, % but they continue to work. \newcommand{\lhead}{\@ifnextchar[{\@xlhead}{\@ylhead}} \def\@xlhead[#1]#2{\fancy@def\f@ncyelh{#1}\fancy@def\f@ncyolh{#2}} \def\@ylhead#1{\fancy@def\f@ncyelh{#1}\fancy@def\f@ncyolh{#1}} \newcommand{\chead}{\@ifnextchar[{\@xchead}{\@ychead}} \def\@xchead[#1]#2{\fancy@def\f@ncyech{#1}\fancy@def\f@ncyoch{#2}} \def\@ychead#1{\fancy@def\f@ncyech{#1}\fancy@def\f@ncyoch{#1}} \newcommand{\rhead}{\@ifnextchar[{\@xrhead}{\@yrhead}} \def\@xrhead[#1]#2{\fancy@def\f@ncyerh{#1}\fancy@def\f@ncyorh{#2}} \def\@yrhead#1{\fancy@def\f@ncyerh{#1}\fancy@def\f@ncyorh{#1}} \newcommand{\lfoot}{\@ifnextchar[{\@xlfoot}{\@ylfoot}} \def\@xlfoot[#1]#2{\fancy@def\f@ncyelf{#1}\fancy@def\f@ncyolf{#2}} \def\@ylfoot#1{\fancy@def\f@ncyelf{#1}\fancy@def\f@ncyolf{#1}} \newcommand{\cfoot}{\@ifnextchar[{\@xcfoot}{\@ycfoot}} \def\@xcfoot[#1]#2{\fancy@def\f@ncyecf{#1}\fancy@def\f@ncyocf{#2}} \def\@ycfoot#1{\fancy@def\f@ncyecf{#1}\fancy@def\f@ncyocf{#1}} \newcommand{\rfoot}{\@ifnextchar[{\@xrfoot}{\@yrfoot}} \def\@xrfoot[#1]#2{\fancy@def\f@ncyerf{#1}\fancy@def\f@ncyorf{#2}} \def\@yrfoot#1{\fancy@def\f@ncyerf{#1}\fancy@def\f@ncyorf{#1}} \newdimen\headwidth \newcommand{\headrulewidth}{0.4pt} \newcommand{\footrulewidth}{\z@skip} \newcommand{\footruleskip}{.3\normalbaselineskip} % Fancyplain stuff shouldn't be used anymore (rather % \fancypagestyle{plain} should be used), but it must be present for % compatibility reasons. \newcommand{\plainheadrulewidth}{\z@skip} \newcommand{\plainfootrulewidth}{\z@skip} \newif\if@fancyplain \@fancyplainfalse \def\fancyplain#1#2{\if@fancyplain#1\else#2\fi} \headwidth=-123456789sp %magic constant % Command to reset various things in the headers: % a.o. single spacing (taken from setspace.sty) % and the catcode of ^^M (so that epsf files in the header work if a % verbatim crosses a page boundary) % It also defines a \nouppercase command that disables \uppercase and % \Makeuppercase. It can only be used in the headers and footers. \def\fancy@reset{\restorecr \def\baselinestretch{1}% \def\nouppercase##1{{\let\uppercase\relax\let\MakeUppercase\relax \expandafter\let\csname MakeUppercase \endcsname\relax##1}}% \ifx\undefined\@newbaseline% NFSS not present; 2.09 or 2e \ifx\@normalsize\undefined \normalsize % for ucthesis.cls \else \@normalsize \fi \else% NFSS (2.09) present \@newbaseline% \fi} % Initialization of the head and foot text. % The default values still contain \fancyplain for compatibility. \fancyhf{} % clear all % lefthead empty on ``plain'' pages, \rightmark on even, \leftmark on odd pages % evenhead empty on ``plain'' pages, \leftmark on even, \rightmark on odd pages \fancyhead[el,or]{\fancyplain{}{\sl\rightmark}} \fancyhead[er,ol]{\fancyplain{}{\sl\leftmark}} \fancyfoot[c]{\rm\thepage} % page number % Put together a header or footer given the left, center and % right text, fillers at left and right and a rule. % The \lap commands put the text into an hbox of zero size, % so overlapping text does not generate an errormessage. % These macros have 5 parameters: % 1. \@lodd or \@rodd % This determines at which side the header will stick % out. % 2. \f@ncyolh, \f@ncyelh, \f@ncyolf or \f@ncyelf. This is the left component. % 3. \f@ncyoch, \f@ncyech, \f@ncyocf or \f@ncyecf. This is the middle comp. % 4. \f@ncyorh, \f@ncyerh, \f@ncyorf or \f@ncyerf. This is the right component. % 5. \@lodd or \@rodd % This determines at which side the header will stick % out. This is the reverse of parameter nr. 1. One of them is always % \relax and the other one is \hss (after expansion). \def\@fancyhead#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset\vbox{\hbox {\rlap{\parbox[b]{\headwidth}{\raggedright#2\strut}}\hfill \parbox[b]{\headwidth}{\centering#3\strut}\hfill \llap{\parbox[b]{\headwidth}{\raggedleft#4\strut}}}\headrule}}#5} \def\@fancyfoot#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset\vbox{\footrule \hbox{\rlap{\parbox[t]{\headwidth}{\raggedright#2\strut}}\hfill \parbox[t]{\headwidth}{\centering#3\strut}\hfill \llap{\parbox[t]{\headwidth}{\raggedleft#4\strut}}}}}#5} \def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi \hrule\@height\headrulewidth\@width\headwidth \vskip-\headrulewidth}} \def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi \vskip-\footruleskip\vskip-\footrulewidth \hrule\@width\headwidth\@height\footrulewidth\vskip\footruleskip}} \def\ps@fancy{% \@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%for amsbook % % Define \MakeUppercase for old LaTeXen. % Note: we used \def rather than \let, so that \let\uppercase\relax (from % the version 1 documentation) will still work. % \@ifundefined{MakeUppercase}{\def\MakeUppercase{\uppercase}}{}% \@ifundefined{chapter}{\def\sectionmark##1{\markboth {\MakeUppercase{\ifnum \c@secnumdepth>\z@ \thesection\hskip 1em\relax \fi ##1}}{}}% \def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne \thesubsection\hskip 1em\relax \fi ##1}}}% {\def\chaptermark##1{\markboth {\MakeUppercase{\ifnum \c@secnumdepth>\m@ne \@chapapp\ \thechapter. \ \fi ##1}}{}}% \def\sectionmark##1{\markright{\MakeUppercase{\ifnum \c@secnumdepth >\z@ \thesection. \ \fi ##1}}}}% %\csname ps@headings\endcsname % use \ps@headings defaults if they exist \ps@@fancy \gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}% % Initialize \headwidth if the user didn't % \ifdim\headwidth<0sp % % This catches the case that \headwidth hasn't been initialized and the % case that the user added something to \headwidth in the expectation that % it was initialized to \textwidth. We compensate this now. This loses if % the user intended to multiply it by a factor. But that case is more % likely done by saying something like \headwidth=1.2\textwidth. % The doc says you have to change \headwidth after the first call to % \pagestyle{fancy}. This code is just to catch the most common cases were % that requirement is violated. % \global\advance\headwidth123456789sp\global\advance\headwidth\textwidth \fi} \def\ps@fancyplain{\ps@fancy \let\ps@plain\ps@plain@fancy} \def\ps@plain@fancy{\@fancyplaintrue\ps@@fancy} \let\ps@@empty\ps@empty \def\ps@@fancy{% \ps@@empty % This is for amsbook/amsart, which do strange things with \topskip \def\@mkboth{\protect\markboth}% \def\@oddhead{\@fancyhead\@lodd\f@ncyolh\f@ncyoch\f@ncyorh\@rodd}% \def\@oddfoot{\@fancyfoot\@lodd\f@ncyolf\f@ncyocf\f@ncyorf\@rodd}% \def\@evenhead{\@fancyhead\@rodd\f@ncyelh\f@ncyech\f@ncyerh\@lodd}% \def\@evenfoot{\@fancyfoot\@rodd\f@ncyelf\f@ncyecf\f@ncyerf\@lodd}% } \def\@lodd{\if@reversemargin\hss\else\relax\fi} \def\@rodd{\if@reversemargin\relax\else\hss\fi} \newif\iffootnote \let\latex@makecol\@makecol \def\@makecol{\ifvoid\footins\footnotetrue\else\footnotefalse\fi \let\topfloat\@toplist\let\botfloat\@botlist\latex@makecol} \def\iftopfloat#1#2{\ifx\topfloat\empty #2\else #1\fi} \def\ifbotfloat#1#2{\ifx\botfloat\empty #2\else #1\fi} \def\iffloatpage#1#2{\if@fcolmade #1\else #2\fi} \newcommand{\fancypagestyle}[2]{% \@namedef{ps@#1}{\let\fancy@def\def#2\relax\ps@fancy}} From fdrake@users.sourceforge.net Fri Aug 10 21:12:12 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 10 Aug 2001 13:12:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/perl l2hinit.perl,1.54,1.55 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory usw-pr-cvs1:/tmp/cvs-serv24293/perl Modified Files: l2hinit.perl Log Message: Remove the use of the "cat" program. This improves portability to non-Unix platforms. This is part the response to SF patch #429611. Index: l2hinit.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/l2hinit.perl,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** l2hinit.perl 2001/06/20 21:31:36 1.54 --- l2hinit.perl 2001/08/10 20:12:09 1.55 *************** *** 419,427 **** } } $_ = (($INFO == 1) ? join('', $close_all, "$t_title$the_version\n", ! `cat $ABOUT_FILE`, $open_all, $_) : join('', $close_all, $INFO,"\n", $open_all, $_)); --- 419,431 ---- } } + my $about; + open(ABOUT, "<$ABOUT_FILE") || die "\n$!\n"; + sysread(ABOUT, $about, 1024*1024); + close(ABOUT); $_ = (($INFO == 1) ? join('', $close_all, "$t_title$the_version\n", ! $about, $open_all, $_) : join('', $close_all, $INFO,"\n", $open_all, $_)); From fdrake@users.sourceforge.net Fri Aug 10 21:17:11 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 10 Aug 2001 13:17:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools mkhowto,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv25333/tools Modified Files: mkhowto Log Message: Do more to be compatible with Windows/CygWin. Make error messages more informative when a child process dies with an error. This is a variation of parts of SF patch #429611. Index: mkhowto =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** mkhowto 2001/07/17 14:46:09 1.28 --- mkhowto 2001/08/10 20:17:09 1.29 *************** *** 181,184 **** --- 181,186 ---- self.global_module_index = arg elif opt == "--dir": + if os.sep == "\\": + arg = re.sub("/", "\\", arg) self.builddir = arg elif opt == "--paper": *************** *** 476,485 **** def run(self, command): self.message(command) ! rc = os.system("(%s) >%s 2>&1" ! % (command, self.log_filename)) if rc: self.warning( "Session transcript and error messages are in %s." % self.log_filename) sys.stderr.write("The relevant lines from the transcript are:\n") sys.stderr.write("-" * 72 + "\n") --- 478,497 ---- def run(self, command): self.message(command) ! if sys.platform.startswith("win"): ! rc = os.system(command) ! else: ! rc = os.system("(%s) >%s 2>&1" ! % (command, self.log_filename)) if rc: self.warning( "Session transcript and error messages are in %s." % self.log_filename) + if hasattr(os, "WIFEXITED"): + if os.WIFEXITED(rc): + self.warning("Exited with status %s." % os.WEXITSTATUS(rc)) + else: + self.warning("Killed by signal %s." % os.WSTOPSIG(rc)) + else: + self.warning("Return code: %s" % rc) sys.stderr.write("The relevant lines from the transcript are:\n") sys.stderr.write("-" * 72 + "\n") From loewis@users.sourceforge.net Fri Aug 10 21:18:28 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 10 Aug 2001 13:18:28 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.49,1.50 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv25270 Modified Files: Makefile.pre.in Log Message: Pass the Makefile's value of CC and LDSHARED to the environment of setup.py. This fixes the problem reported in bug report #438786. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Makefile.pre.in 2001/08/08 13:18:36 1.49 --- Makefile.pre.in 2001/08/10 20:18:26 1.50 *************** *** 289,293 **** # Build the shared modules sharedmods: $(PYTHON) ! ./$(PYTHON) -E $(srcdir)/setup.py build # buildno should really depend on something like LIBRARY_SRC --- 289,293 ---- # Build the shared modules sharedmods: $(PYTHON) ! CC='$(CC)' LDSHARED='$(LDSHARED)' ./$(PYTHON) -E $(srcdir)/setup.py build # buildno should really depend on something like LIBRARY_SRC From akuchling@users.sourceforge.net Fri Aug 10 21:24:35 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 10 Aug 2001 13:24:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils/command build_clib.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv26656 Modified Files: build_clib.py Log Message: [Bug #414032] Make the 'sdist' command work when the distribution contains libraries. This is done by adding a .get_source_files() method, contributed by Rene Liebscher and slightly modified. Remove an unused local variable spotted by PyChecker Index: build_clib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_clib.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** build_clib.py 2000/10/14 04:06:40 1.22 --- build_clib.py 2001/08/10 20:24:33 1.23 *************** *** 185,191 **** ! def build_libraries (self, libraries): ! compiler = self.compiler for (lib_name, build_info) in libraries: --- 185,207 ---- ! def get_source_files (self): ! self.check_library_list(self.libraries) ! filenames = [] ! for (lib_name, build_info) in self.libraries: ! sources = build_info.get('sources') ! if (sources is None or ! type(sources) not in (ListType, TupleType) ): ! raise DistutilsSetupError, \ ! ("in 'libraries' option (library '%s'), " ! "'sources' must be present and must be " ! "a list of source filenames") % lib_name ! ! filenames.extend(sources) ! return filenames ! # get_source_files () ! ! ! def build_libraries (self, libraries): for (lib_name, build_info) in libraries: From gvanrossum@users.sourceforge.net Fri Aug 10 21:28:30 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 13:28:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include dictobject.h,2.21,2.22 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv27392/Include Modified Files: dictobject.h Log Message: Add PyDict_Merge(a, b, override): PyDict_Merge(a, b, 1) is the same as PyDict_Update(a, b). PyDict_Merge(a, b, 0) does something similar but leaves existing items unchanged. Index: dictobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/dictobject.h,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** dictobject.h 2001/08/02 04:15:00 2.21 --- dictobject.h 2001/08/10 20:28:28 2.22 *************** *** 99,102 **** --- 99,103 ---- extern DL_IMPORT(PyObject *) PyDict_Copy(PyObject *mp); extern DL_IMPORT(int) PyDict_Update(PyObject *mp, PyObject *other); + extern DL_IMPORT(int) PyDict_Merge(PyObject *mp, PyObject *other, int override); From gvanrossum@users.sourceforge.net Fri Aug 10 21:28:30 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 13:28:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects dictobject.c,2.107,2.108 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv27392/Objects Modified Files: dictobject.c Log Message: Add PyDict_Merge(a, b, override): PyDict_Merge(a, b, 1) is the same as PyDict_Update(a, b). PyDict_Merge(a, b, 0) does something similar but leaves existing items unchanged. Index: dictobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v retrieving revision 2.107 retrieving revision 2.108 diff -C2 -d -r2.107 -r2.108 *** dictobject.c 2001/08/02 04:15:00 2.107 --- dictobject.c 2001/08/10 20:28:28 2.108 *************** *** 1000,1006 **** --- 1000,1016 ---- } + /* Update unconditionally replaces existing items. + Merge has a 3rd argument 'override'; if set, it acts like Update, + otherwise it leaves existing items unchanged. */ + int PyDict_Update(PyObject *a, PyObject *b) { + return PyDict_Merge(a, b, 1); + } + + int + PyDict_Merge(PyObject *a, PyObject *b, int override) + { register PyDictObject *mp, *other; register int i; *************** *** 1032,1036 **** for (i = 0; i <= other->ma_mask; i++) { entry = &other->ma_table[i]; ! if (entry->me_value != NULL) { Py_INCREF(entry->me_key); Py_INCREF(entry->me_value); --- 1042,1048 ---- for (i = 0; i <= other->ma_mask; i++) { entry = &other->ma_table[i]; ! if (entry->me_value != NULL && ! (override || ! PyDict_GetItem(a, entry->me_key) == NULL)) { Py_INCREF(entry->me_key); Py_INCREF(entry->me_value); *************** *** 1061,1064 **** --- 1073,1080 ---- for (key = PyIter_Next(iter); key; key = PyIter_Next(iter)) { + if (!override && PyDict_GetItem(a, key) != NULL) { + Py_DECREF(key); + continue; + } value = PyObject_GetItem(b, key); if (value == NULL) { *************** *** 1067,1071 **** return -1; } ! status = PyDict_SetItem((PyObject*)mp, key, value); Py_DECREF(key); Py_DECREF(value); --- 1083,1087 ---- return -1; } ! status = PyDict_SetItem(a, key, value); Py_DECREF(key); Py_DECREF(value); From loewis@users.sourceforge.net Fri Aug 10 21:29:42 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 10 Aug 2001 13:29:42 -0700 Subject: [Python-checkins] CVS: python/dist/src configure,1.234,1.235 configure.in,1.243,1.244 pyconfig.h.in,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv27366 Modified Files: configure configure.in pyconfig.h.in Log Message: Autotest for netpacket/packet.h, as it is not available on all Linux versions. Depend AF_PACKET on HAVE_NETPACKET_PACKET_H. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.234 retrieving revision 1.235 diff -C2 -d -r1.234 -r1.235 *** configure 2001/08/10 13:58:49 1.234 --- configure 2001/08/10 20:29:40 1.235 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.242 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.243 # Guess values for system-dependent variables and create Makefiles. *************** *** 1887,1891 **** sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ ! ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` --- 1887,1891 ---- sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ ! ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h netpacket/packet.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.243 retrieving revision 1.244 diff -C2 -d -r1.243 -r1.244 *** configure.in 2001/08/10 13:58:50 1.243 --- configure.in 2001/08/10 20:29:40 1.244 *************** *** 420,424 **** sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ ! ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h) AC_HEADER_DIRENT --- 420,424 ---- sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ ! ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h netpacket/packet.h) AC_HEADER_DIRENT Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pyconfig.h.in 2001/08/10 13:58:50 1.3 --- pyconfig.h.in 2001/08/10 20:29:40 1.4 *************** *** 612,615 **** --- 612,618 ---- #undef HAVE_NDIR_H + /* Define if you have the header file. */ + #undef HAVE_NETPACKET_PACKET_H + /* Define if you have the header file. */ #undef HAVE_POLL_H From loewis@users.sourceforge.net Fri Aug 10 21:29:42 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 10 Aug 2001 13:29:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.162,1.163 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv27366/Modules Modified Files: socketmodule.c Log Message: Autotest for netpacket/packet.h, as it is not available on all Linux versions. Depend AF_PACKET on HAVE_NETPACKET_PACKET_H. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** socketmodule.c 2001/08/04 22:37:23 1.162 --- socketmodule.c 2001/08/10 20:29:40 1.163 *************** *** 180,184 **** #endif ! #if defined(linux) && defined(AF_PACKET) #include #include --- 180,184 ---- #endif ! #ifdef HAVE_NETPACKET_PACKET_H #include #include *************** *** 477,481 **** struct sockaddr_storage storage; #endif ! #if defined(linux) && defined(AF_PACKET) struct sockaddr_ll ll; #endif --- 477,481 ---- struct sockaddr_storage storage; #endif ! #ifdef HAVE_NETPACKET_PACKET_H struct sockaddr_ll ll; #endif *************** *** 716,720 **** #endif ! #if defined(linux) && defined(AF_PACKET) case AF_PACKET: { --- 716,720 ---- #endif ! #ifdef HAVE_NETPACKET_PACKET_H case AF_PACKET: { *************** *** 829,833 **** #endif ! #if defined(linux) && defined(AF_PACKET) case AF_PACKET: { --- 829,833 ---- #endif ! #ifdef HAVE_NETPACKET_PACKET_H case AF_PACKET: { *************** *** 902,906 **** #endif ! #if defined(linux) && defined(AF_PACKET) case AF_PACKET: { --- 902,906 ---- #endif ! #ifdef HAVE_NETPACKET_PACKET_H case AF_PACKET: { *************** *** 2984,2988 **** insint(d, "AF_ROSE", AF_ROSE); /* Amateur Radio X.25 PLP */ #endif ! #if defined(linux) && defined(AF_PACKET) insint(d, "AF_PACKET", AF_PACKET); insint(d, "PF_PACKET", PF_PACKET); --- 2984,2988 ---- insint(d, "AF_ROSE", AF_ROSE); /* Amateur Radio X.25 PLP */ #endif ! #ifdef HAVE_NETPACKET_PACKET_H insint(d, "AF_PACKET", AF_PACKET); insint(d, "PF_PACKET", PF_PACKET); From gvanrossum@users.sourceforge.net Fri Aug 10 22:24:10 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 14:24:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.28,2.29 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv12100 Modified Files: typeobject.c Log Message: - Big changes to fix SF bug #442833 (a nasty multiple inheritance problem). inherit_slots() is split in two parts: inherit_special() which inherits the flags and a few very special members from the dominant base; inherit_slots() which inherits only regular slots, and is now called for each base in the MRO in turn. These are now both void functions since they don't have error returns. - Added object.__setitem__() back -- for the same reason as object.__new__(): a subclass of object should be able to call object.__new__(). - add_wrappers() was moved around to be closer to where it is used (it was defined together with add_methods() etc., but has nothing to do with these). Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.28 retrieving revision 2.29 diff -C2 -d -r2.28 -r2.29 *** typeobject.c 2001/08/10 17:39:49 2.28 --- typeobject.c 2001/08/10 21:24:08 2.29 *************** *** 5,10 **** #include "structmember.h" - staticforward int add_members(PyTypeObject *, struct memberlist *); - static struct memberlist type_members[] = { {"__name__", T_STRING, offsetof(PyTypeObject, tp_name), READONLY}, --- 5,8 ---- *************** *** 648,652 **** } type->tp_basicsize = slotoffset; ! add_members(type, et->members); /* Special case some slots */ --- 646,650 ---- } type->tp_basicsize = slotoffset; ! type->tp_members = et->members; /* Special case some slots */ *************** *** 883,887 **** 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ ! 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ --- 881,885 ---- 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ ! PyObject_GenericSetAttr, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ *************** *** 930,952 **** static int - add_wrappers(PyTypeObject *type, struct wrapperbase *wraps, void *wrapped) - { - PyObject *dict = type->tp_defined; - - for (; wraps->name != NULL; wraps++) { - PyObject *descr; - if (PyDict_GetItemString(dict, wraps->name)) - continue; - descr = PyDescr_NewWrapper(type, wraps, wrapped); - if (descr == NULL) - return -1; - if (PyDict_SetItemString(dict, wraps->name, descr) < 0) - return -1; - Py_DECREF(descr); - } - return 0; - } - - static int add_members(PyTypeObject *type, struct memberlist *memb) { --- 928,931 ---- *************** *** 987,1003 **** } ! staticforward int add_operators(PyTypeObject *); ! static int inherit_slots(PyTypeObject *type, PyTypeObject *base) { ! int oldsize, newsize; #undef COPYSLOT #undef COPYNUM #undef COPYSEQ #undef COPYMAP #define COPYSLOT(SLOT) \ ! if (!type->SLOT) type->SLOT = base->SLOT #define COPYNUM(SLOT) COPYSLOT(tp_as_number->SLOT) --- 966,1041 ---- } ! static void ! inherit_special(PyTypeObject *type, PyTypeObject *base) ! { ! int oldsize, newsize; ! /* Special flag magic */ ! if (!type->tp_as_buffer && base->tp_as_buffer) { ! type->tp_flags &= ~Py_TPFLAGS_HAVE_GETCHARBUFFER; ! type->tp_flags |= ! base->tp_flags & Py_TPFLAGS_HAVE_GETCHARBUFFER; ! } ! if (!type->tp_as_sequence && base->tp_as_sequence) { ! type->tp_flags &= ~Py_TPFLAGS_HAVE_SEQUENCE_IN; ! type->tp_flags |= base->tp_flags & Py_TPFLAGS_HAVE_SEQUENCE_IN; ! } ! if ((type->tp_flags & Py_TPFLAGS_HAVE_INPLACEOPS) != ! (base->tp_flags & Py_TPFLAGS_HAVE_INPLACEOPS)) { ! if ((!type->tp_as_number && base->tp_as_number) || ! (!type->tp_as_sequence && base->tp_as_sequence)) { ! type->tp_flags &= ~Py_TPFLAGS_HAVE_INPLACEOPS; ! if (!type->tp_as_number && !type->tp_as_sequence) { ! type->tp_flags |= base->tp_flags & ! Py_TPFLAGS_HAVE_INPLACEOPS; ! } ! } ! /* Wow */ ! } ! if (!type->tp_as_number && base->tp_as_number) { ! type->tp_flags &= ~Py_TPFLAGS_CHECKTYPES; ! type->tp_flags |= base->tp_flags & Py_TPFLAGS_CHECKTYPES; ! } ! ! /* Copying basicsize is connected to the GC flags */ ! oldsize = PyType_BASICSIZE(base); ! newsize = type->tp_basicsize ? PyType_BASICSIZE(type) : oldsize; ! if (!(type->tp_flags & Py_TPFLAGS_GC) && ! (base->tp_flags & Py_TPFLAGS_GC) && ! (type->tp_flags & Py_TPFLAGS_HAVE_RICHCOMPARE/*GC slots exist*/) && ! (!type->tp_traverse && !type->tp_clear)) { ! type->tp_flags |= Py_TPFLAGS_GC; ! if (type->tp_traverse == NULL) ! type->tp_traverse = base->tp_traverse; ! if (type->tp_clear == NULL) ! type->tp_clear = base->tp_clear; ! } ! if (type->tp_flags & base->tp_flags & Py_TPFLAGS_HAVE_CLASS) { ! if (base != &PyBaseObject_Type || ! (type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { ! if (type->tp_new == NULL) ! type->tp_new = base->tp_new; ! } ! } ! PyType_SET_BASICSIZE(type, newsize); ! } ! ! static void inherit_slots(PyTypeObject *type, PyTypeObject *base) { ! PyTypeObject *basebase; + #undef SLOTDEFINED #undef COPYSLOT #undef COPYNUM #undef COPYSEQ #undef COPYMAP + + #define SLOTDEFINED(SLOT) \ + (base->SLOT != 0 && \ + (basebase == NULL || base->SLOT != basebase->SLOT)) + #define COPYSLOT(SLOT) \ ! if (!type->SLOT && SLOTDEFINED(SLOT)) type->SLOT = base->SLOT #define COPYNUM(SLOT) COPYSLOT(tp_as_number->SLOT) *************** *** 1005,1011 **** #define COPYMAP(SLOT) COPYSLOT(tp_as_mapping->SLOT) ! if (type->tp_as_number == NULL) ! type->tp_as_number = base->tp_as_number; ! else if (base->tp_as_number) { COPYNUM(nb_add); COPYNUM(nb_subtract); --- 1043,1053 ---- #define COPYMAP(SLOT) COPYSLOT(tp_as_mapping->SLOT) ! /* This won't inherit indirect slots (from tp_as_number etc.) ! if type doesn't provide the space. */ ! ! if (type->tp_as_number != NULL && base->tp_as_number != NULL) { ! basebase = base->tp_base; ! if (basebase->tp_as_number == NULL) ! basebase = NULL; COPYNUM(nb_add); COPYNUM(nb_subtract); *************** *** 1050,1056 **** } ! if (type->tp_as_sequence == NULL) ! type->tp_as_sequence = base->tp_as_sequence; ! else if (base->tp_as_sequence) { COPYSEQ(sq_length); COPYSEQ(sq_concat); --- 1092,1099 ---- } ! if (type->tp_as_sequence != NULL && base->tp_as_sequence != NULL) { ! basebase = base->tp_base; ! if (basebase->tp_as_sequence == NULL) ! basebase = NULL; COPYSEQ(sq_length); COPYSEQ(sq_concat); *************** *** 1065,1071 **** } ! if (type->tp_as_mapping == NULL) ! type->tp_as_mapping = base->tp_as_mapping; ! else if (base->tp_as_mapping) { COPYMAP(mp_length); COPYMAP(mp_subscript); --- 1108,1115 ---- } ! if (type->tp_as_mapping != NULL && base->tp_as_mapping != NULL) { ! basebase = base->tp_base; ! if (basebase->tp_as_mapping == NULL) ! basebase = NULL; COPYMAP(mp_length); COPYMAP(mp_subscript); *************** *** 1073,1115 **** } ! /* Special flag magic */ ! if (!type->tp_as_buffer && base->tp_as_buffer) { ! type->tp_flags &= ~Py_TPFLAGS_HAVE_GETCHARBUFFER; ! type->tp_flags |= ! base->tp_flags & Py_TPFLAGS_HAVE_GETCHARBUFFER; ! } ! if (!type->tp_as_sequence && base->tp_as_sequence) { ! type->tp_flags &= ~Py_TPFLAGS_HAVE_SEQUENCE_IN; ! type->tp_flags |= base->tp_flags & Py_TPFLAGS_HAVE_SEQUENCE_IN; ! } ! if ((type->tp_flags & Py_TPFLAGS_HAVE_INPLACEOPS) != ! (base->tp_flags & Py_TPFLAGS_HAVE_INPLACEOPS)) { ! if ((!type->tp_as_number && base->tp_as_number) || ! (!type->tp_as_sequence && base->tp_as_sequence)) { ! type->tp_flags &= ~Py_TPFLAGS_HAVE_INPLACEOPS; ! if (!type->tp_as_number && !type->tp_as_sequence) { ! type->tp_flags |= base->tp_flags & ! Py_TPFLAGS_HAVE_INPLACEOPS; ! } ! } ! /* Wow */ ! } ! if (!type->tp_as_number && base->tp_as_number) { ! type->tp_flags &= ~Py_TPFLAGS_CHECKTYPES; ! type->tp_flags |= base->tp_flags & Py_TPFLAGS_CHECKTYPES; ! } ! ! /* Copying basicsize is connected to the GC flags */ ! oldsize = PyType_BASICSIZE(base); ! newsize = type->tp_basicsize ? PyType_BASICSIZE(type) : oldsize; ! if (!(type->tp_flags & Py_TPFLAGS_GC) && ! (base->tp_flags & Py_TPFLAGS_GC) && ! (type->tp_flags & Py_TPFLAGS_HAVE_RICHCOMPARE/*GC slots exist*/) && ! (!type->tp_traverse && !type->tp_clear)) { ! type->tp_flags |= Py_TPFLAGS_GC; ! COPYSLOT(tp_traverse); ! COPYSLOT(tp_clear); ! } ! PyType_SET_BASICSIZE(type, newsize); COPYSLOT(tp_itemsize); --- 1117,1121 ---- } ! basebase = base->tp_base; COPYSLOT(tp_itemsize); *************** *** 1153,1166 **** COPYSLOT(tp_init); COPYSLOT(tp_alloc); - if (base != &PyBaseObject_Type || - (type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { - COPYSLOT(tp_new); - } COPYSLOT(tp_free); } - - return 0; } int PyType_Ready(PyTypeObject *type) --- 1159,1168 ---- COPYSLOT(tp_init); COPYSLOT(tp_alloc); COPYSLOT(tp_free); } } + staticforward int add_operators(PyTypeObject *); + int PyType_Ready(PyTypeObject *type) *************** *** 1238,1249 **** } /* Initialize tp_dict properly */ if (!PyType_HasFeature(type, Py_TPFLAGS_DYNAMICTYPE)) { /* For a static type, tp_dict is the consolidation ! of the tp_defined of its bases in MRO. Earlier ! bases override later bases; since d.update() works ! the other way, we walk the MRO sequence backwards. */ Py_DECREF(type->tp_dict); ! type->tp_dict = PyDict_New(); if (type->tp_dict == NULL) goto error; --- 1240,1253 ---- } + /* Inherit special flags from dominant base */ + if (type->tp_base != NULL) + inherit_special(type, type->tp_base); + /* Initialize tp_dict properly */ if (!PyType_HasFeature(type, Py_TPFLAGS_DYNAMICTYPE)) { /* For a static type, tp_dict is the consolidation ! of the tp_defined of its bases in MRO. */ Py_DECREF(type->tp_dict); ! type->tp_dict = PyDict_Copy(type->tp_defined); if (type->tp_dict == NULL) goto error; *************** *** 1252,1269 **** assert(PyTuple_Check(bases)); n = PyTuple_GET_SIZE(bases); ! for (i = n; --i >= 0; ) { base = (PyTypeObject *)PyTuple_GET_ITEM(bases, i); assert(PyType_Check(base)); x = base->tp_defined; ! if (x != NULL && PyDict_Update(type->tp_dict, x) < 0) goto error; } } ! /* Inherit slots from direct base */ ! if (type->tp_base != NULL) ! if (inherit_slots(type, type->tp_base) < 0) ! goto error; assert(type->tp_dict != NULL); type->tp_flags = --- 1256,1281 ---- assert(PyTuple_Check(bases)); n = PyTuple_GET_SIZE(bases); ! for (i = 1; i < n; i++) { base = (PyTypeObject *)PyTuple_GET_ITEM(bases, i); assert(PyType_Check(base)); x = base->tp_defined; ! if (x != NULL && PyDict_Merge(type->tp_dict, x, 0) < 0) goto error; + inherit_slots(type, base); } } ! /* Some more special stuff */ ! base = type->tp_base; ! if (base != NULL) { ! if (type->tp_as_number == NULL) ! type->tp_as_number = base->tp_as_number; ! if (type->tp_as_sequence == NULL) ! type->tp_as_sequence = base->tp_as_sequence; ! if (type->tp_as_mapping == NULL) ! type->tp_as_mapping = base->tp_as_mapping; ! } + /* All done -- set the ready flag */ assert(type->tp_dict != NULL); type->tp_flags = *************** *** 1910,1913 **** --- 1922,1944 ---- return -1; return PyDict_SetItemString(type->tp_defined, "__new__", func); + } + + static int + add_wrappers(PyTypeObject *type, struct wrapperbase *wraps, void *wrapped) + { + PyObject *dict = type->tp_defined; + + for (; wraps->name != NULL; wraps++) { + PyObject *descr; + if (PyDict_GetItemString(dict, wraps->name)) + continue; + descr = PyDescr_NewWrapper(type, wraps, wrapped); + if (descr == NULL) + return -1; + if (PyDict_SetItemString(dict, wraps->name, descr) < 0) + return -1; + Py_DECREF(descr); + } + return 0; } From gvanrossum@users.sourceforge.net Fri Aug 10 22:25:26 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 14:25:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_generators.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12459 Modified Files: test_generators.py Log Message: The message accompanying the TypeError exception on a readonly attribute changed again. Index: test_generators.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_generators.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** test_generators.py 2001/08/02 04:15:00 1.24 --- test_generators.py 2001/08/10 21:25:24 1.25 *************** *** 406,410 **** Traceback (most recent call last): ... ! TypeError: 'generator' object has only read-only attributes (assign to .gi_running) >>> def g(): ... yield me.gi_running --- 406,410 ---- Traceback (most recent call last): ... ! TypeError: readonly attribute >>> def g(): ... yield me.gi_running From gvanrossum@users.sourceforge.net Fri Aug 10 22:28:48 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 10 Aug 2001 14:28:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv13078 Modified Files: test_descr.py Log Message: Add test for SF bug #442833 (multiple inheritance). Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_descr.py 2001/08/10 19:42:38 1.5 --- test_descr.py 2001/08/10 21:28:46 1.6 *************** *** 442,445 **** --- 442,459 ---- verify(D.__mro__ == (D, dictionary, C, object)) + # SF bug #442833 + class Node(object): + def __int__(self): + return int(self.foo()) + def foo(self): + return "23" + class Frag(Node, list): + def foo(self): + return "42" + verify(Node().__int__() == 23) + verify(int(Node()) == 23) + verify(Frag().__int__() == 42) + verify(int(Frag()) == 42) + def diamond(): if verbose: print "Testing multiple inheritance special cases..." From fdrake@users.sourceforge.net Fri Aug 10 22:31:15 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 10 Aug 2001 14:31:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.137,1.138 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv13622/api Modified Files: api.tex Log Message: Added documentation for PyDict_Update() and PyDict_Merge(). Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** api.tex 2001/08/10 14:27:38 1.137 --- api.tex 2001/08/10 21:31:12 1.138 *************** *** 3783,3786 **** --- 3783,3787 ---- Returns a new dictionary that contains the same key-value pairs as p. Empties an existing dictionary of all key-value pairs. + \versionadded{1.6} \end{cfuncdesc} *************** *** 3875,3879 **** The dictionary \var{p} should not be mutated during iteration. It is safe (since Python 2.1) to modify the values of the keys as you ! iterate over the dictionary, for example: \begin{verbatim} --- 3876,3881 ---- The dictionary \var{p} should not be mutated during iteration. It is safe (since Python 2.1) to modify the values of the keys as you ! iterate over the dictionary, but only so long as the set of keys does ! not change. For example: \begin{verbatim} *************** *** 3893,3896 **** --- 3895,3914 ---- } \end{verbatim} + \end{cfuncdesc} + + \begin{cfuncdesc}{int}{PyDict_Merge}{PyObject *a, PyObject *b, int override} + Iterate over dictionary \var{b} adding key-value pairs to dictionary + \var{a}. If \var{override} is true, existing pairs in \var{a} will be + replaced if a matching key is found in \var{b}, otherwise pairs will + only be added if there is not a matching key in \var{a}. Returns + \code{0} on success or \code{-1} if an exception was raised. + \versionadded{2.2} + \end{cfuncdesc} + + \begin{cfuncdesc}{int}{PyDict_Update}{PyObject *a, PyObject *b} + This is the same as \code{PyDict_Merge(\var{a}, \var{b}, 1)} in C, or + \code{\var{a}.update(\var{b})} in Python. Returns \code{0} on success + or \code{-1} if an exception was raised. + \versionadded{2.2} \end{cfuncdesc} From jhylton@users.sourceforge.net Fri Aug 10 22:38:07 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 10 Aug 2001 14:38:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include compile.h,2.34,2.35 pythonrun.h,2.45,2.46 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv15547 Modified Files: compile.h pythonrun.h Log Message: Refactor future feature handling Replace individual slots in PyFutureFeatures with a single bitmask with one field per feature. The flags for this bitmask are the same as the flags used in the co_flags slot of a code object. XXX This means we waste several bits, because they are used for co_flags but have no meaning for future statements. Don't think this is an issue. Remove the NESTED_SCOPES_DEFAULT define and others. Not sure what they were for anyway. Remove all the PyCF_xxx flags, but define PyCF_MASK in terms of the CO_xxx flags that are relevant for this release. Change definition of PyCompilerFlags so that cf_flags matches co_flags. Index: compile.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v retrieving revision 2.34 retrieving revision 2.35 diff -C2 -d -r2.34 -r2.35 *** compile.h 2001/08/08 05:00:17 2.34 --- compile.h 2001/08/10 21:38:04 2.35 *************** *** 42,46 **** in effect when the code block was compiled. */ #define CO_GENERATOR_ALLOWED 0x1000 - /* XXX Ditto for future division */ #define CO_FUTURE_DIVISION 0x2000 --- 42,45 ---- *************** *** 65,71 **** int ff_found_docstring; int ff_last_lineno; ! int ff_nested_scopes; ! int ff_generators; ! int ff_division; } PyFutureFeatures; --- 64,68 ---- int ff_found_docstring; int ff_last_lineno; ! int ff_features; } PyFutureFeatures; *************** *** 74,84 **** PyCompilerFlags *); - #define NESTED_SCOPES_DEFAULT 1 #define FUTURE_NESTED_SCOPES "nested_scopes" - - #define GENERATORS_DEFAULT 0 #define FUTURE_GENERATORS "generators" - - #define DIVISION_DEFAULT 0 #define FUTURE_DIVISION "division" --- 71,76 ---- Index: pythonrun.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v retrieving revision 2.45 retrieving revision 2.46 diff -C2 -d -r2.45 -r2.46 *** pythonrun.h 2001/08/08 05:00:17 2.45 --- pythonrun.h 2001/08/10 21:38:04 2.46 *************** *** 8,19 **** #endif ! /* These flags are named after the __future__ statements that introduced ! them. May not remain true for later additions, so fiddle this comment ! accordingly then. */ ! #define PyCF_NESTED_SCOPES (0x00000001UL) ! #define PyCF_GENERATORS (0x00000002UL) ! #define PyCF_DIVISION (0x00000004UL) typedef struct { ! unsigned long cf_flags; /* bitmask of PyCF_xxx flags */ } PyCompilerFlags; --- 8,14 ---- #endif ! #define PyCF_MASK (CO_GENERATOR_ALLOWED | CO_FUTURE_DIVISION) typedef struct { ! int cf_flags; /* bitmask of CO_xxx flags relevant to future */ } PyCompilerFlags; From jhylton@users.sourceforge.net Fri Aug 10 22:41:35 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 10 Aug 2001 14:41:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.264,2.265 compile.c,2.212,2.213 future.c,2.9,2.10 pythonrun.c,2.142,2.143 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv16520 Modified Files: ceval.c compile.c future.c pythonrun.c Log Message: Refactor future feature handling Replace uses of PyCF_xxx with CO_xxx. Replace individual feature slots in PyFutureFeatures with single bitmask ff_features. When flags must be transfered among the three parts of the interpreter that care about them -- the pythonrun layer, the compiler, and the future feature parser -- can simply or (|) the definitions. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.264 retrieving revision 2.265 diff -C2 -d -r2.264 -r2.265 *** ceval.c 2001/08/08 05:00:18 2.264 --- ceval.c 2001/08/10 21:41:33 2.265 *************** *** 2938,2946 **** if (codeflags & CO_NESTED) { result = 1; ! cf->cf_flags |= PyCF_NESTED_SCOPES; } if (codeflags & CO_GENERATOR_ALLOWED) { result = 1; ! cf->cf_flags |= PyCF_GENERATORS; } } --- 2938,2946 ---- if (codeflags & CO_NESTED) { result = 1; ! cf->cf_flags |= CO_NESTED; } if (codeflags & CO_GENERATOR_ALLOWED) { result = 1; ! cf->cf_flags |= CO_GENERATOR_ALLOWED; } } Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.212 retrieving revision 2.213 diff -C2 -d -r2.212 -r2.213 *** compile.c 2001/08/08 05:00:18 2.212 --- compile.c 2001/08/10 21:41:33 2.213 *************** *** 3968,3987 **** return NULL; } ! if (flags) { ! if (flags->cf_flags & PyCF_NESTED_SCOPES) ! sc.c_future->ff_nested_scopes = 1; ! else if (sc.c_future->ff_nested_scopes) ! flags->cf_flags |= PyCF_NESTED_SCOPES; ! ! if (flags->cf_flags & PyCF_GENERATORS) ! sc.c_future->ff_generators = 1; ! else if (sc.c_future->ff_generators) ! flags->cf_flags |= PyCF_GENERATORS; ! ! if (flags->cf_flags & PyCF_DIVISION) ! sc.c_future->ff_division = 1; ! else if (sc.c_future->ff_division) ! flags->cf_flags |= PyCF_DIVISION; ! } if (symtable_build(&sc, n) < 0) { com_free(&sc); --- 3968,3973 ---- return NULL; } ! if (flags) ! sc.c_future->ff_features |= flags->cf_flags; if (symtable_build(&sc, n) < 0) { com_free(&sc); *************** *** 4151,4156 **** return -1; c->c_symtable->st_future = c->c_future; - if (c->c_future->ff_nested_scopes) - c->c_symtable->st_nested_scopes = 1; c->c_symtable->st_filename = c->c_filename; symtable_enter_scope(c->c_symtable, TOP, TYPE(n), n->n_lineno); --- 4137,4140 ---- *************** *** 4452,4463 **** struct symbol_info *si) { ! if (c->c_future) { ! if (c->c_future->ff_nested_scopes) ! c->c_flags |= CO_NESTED; ! if (c->c_future->ff_generators) ! c->c_flags |= CO_GENERATOR_ALLOWED; ! if (c->c_future->ff_division) ! c->c_flags |= CO_FUTURE_DIVISION; ! } if (ste->ste_generator) c->c_flags |= CO_GENERATOR; --- 4436,4441 ---- struct symbol_info *si) { ! if (c->c_future) ! c->c_flags |= c->c_future->ff_features; if (ste->ste_generator) c->c_flags |= CO_GENERATOR; *************** *** 4618,4622 **** return NULL; st->st_pass = 1; - st->st_nested_scopes = NESTED_SCOPES_DEFAULT; st->st_filename = NULL; if ((st->st_stack = PyList_New(0)) == NULL) --- 4596,4599 ---- Index: future.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/future.c,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** future.c 2001/08/08 05:00:18 2.9 --- future.c 2001/08/10 21:41:33 2.10 *************** *** 31,39 **** feature = STR(CHILD(ch, 0)); if (strcmp(feature, FUTURE_NESTED_SCOPES) == 0) { ! ff->ff_nested_scopes = 1; } else if (strcmp(feature, FUTURE_GENERATORS) == 0) { ! ff->ff_generators = 1; } else if (strcmp(feature, FUTURE_DIVISION) == 0) { ! ff->ff_division = 1; } else if (strcmp(feature, "braces") == 0) { PyErr_SetString(PyExc_SyntaxError, --- 31,39 ---- feature = STR(CHILD(ch, 0)); if (strcmp(feature, FUTURE_NESTED_SCOPES) == 0) { ! continue; } else if (strcmp(feature, FUTURE_GENERATORS) == 0) { ! ff->ff_features |= CO_GENERATOR_ALLOWED; } else if (strcmp(feature, FUTURE_DIVISION) == 0) { ! ff->ff_features |= CO_FUTURE_DIVISION; } else if (strcmp(feature, "braces") == 0) { PyErr_SetString(PyExc_SyntaxError, *************** *** 235,241 **** ff->ff_found_docstring = 0; ff->ff_last_lineno = -1; ! ff->ff_nested_scopes = 0; ! ff->ff_generators = 0; ! ff->ff_division = 0; if (future_parse(ff, n, filename) < 0) { --- 235,239 ---- ff->ff_found_docstring = 0; ff->ff_last_lineno = -1; ! ff->ff_features = 0; if (future_parse(ff, n, filename) < 0) { Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.142 retrieving revision 2.143 diff -C2 -d -r2.142 -r2.143 *** pythonrun.c 2001/08/09 16:37:16 2.142 --- pythonrun.c 2001/08/10 21:41:33 2.143 *************** *** 557,561 **** Py_single_input, ps1, ps2, &err, (flags && ! flags->cf_flags & PyCF_GENERATORS) ? PyPARSE_YIELD_IS_KEYWORD : 0); Py_XDECREF(v); --- 557,561 ---- Py_single_input, ps1, ps2, &err, (flags && ! flags->cf_flags & CO_GENERATOR_ALLOWED) ? PyPARSE_YIELD_IS_KEYWORD : 0); Py_XDECREF(v); *************** *** 1010,1015 **** { return run_err_node(PyParser_SimpleParseStringFlags( ! str, start, ! (flags && flags->cf_flags & PyCF_GENERATORS) ? PyPARSE_YIELD_IS_KEYWORD : 0), "", globals, locals, flags); --- 1010,1015 ---- { return run_err_node(PyParser_SimpleParseStringFlags( ! str, start, ! (flags && flags->cf_flags & CO_GENERATOR_ALLOWED) ? PyPARSE_YIELD_IS_KEYWORD : 0), "", globals, locals, flags); *************** *** 1029,1033 **** { node *n = PyParser_SimpleParseFileFlags(fp, filename, start, ! (flags && flags->cf_flags & PyCF_GENERATORS) ? PyPARSE_YIELD_IS_KEYWORD : 0); if (closeit) --- 1029,1033 ---- { node *n = PyParser_SimpleParseFileFlags(fp, filename, start, ! (flags && flags->cf_flags & CO_GENERATOR_ALLOWED) ? PyPARSE_YIELD_IS_KEYWORD : 0); if (closeit) *************** *** 1086,1101 **** co = (PyCodeObject *)v; v = PyEval_EvalCode(co, globals, locals); ! if (v && flags) { ! if (co->co_flags & CO_NESTED) ! flags->cf_flags |= PyCF_NESTED_SCOPES; ! if (co->co_flags & CO_GENERATOR_ALLOWED) ! flags->cf_flags |= PyCF_GENERATORS; ! #if 0 ! fprintf(stderr, "run_pyc_file: nested_scopes: %d\n", ! flags->cf_flags & PyCF_NESTED_SCOPES); ! fprintf(stderr, "run_pyc_file: generators: %d\n", ! flags->cf_flags & PyCF_GENERATORS); ! #endif ! } Py_DECREF(co); return v; --- 1086,1091 ---- co = (PyCodeObject *)v; v = PyEval_EvalCode(co, globals, locals); ! if (v && flags) ! flags->cf_flags |= (co->co_flags & PyCF_MASK); Py_DECREF(co); return v; *************** *** 1115,1119 **** PyCodeObject *co; n = PyParser_SimpleParseStringFlags(str, start, ! (flags && flags->cf_flags & PyCF_GENERATORS) ? PyPARSE_YIELD_IS_KEYWORD : 0); if (n == NULL) --- 1105,1109 ---- PyCodeObject *co; n = PyParser_SimpleParseStringFlags(str, start, ! (flags && flags->cf_flags & CO_GENERATOR_ALLOWED) ? PyPARSE_YIELD_IS_KEYWORD : 0); if (n == NULL) From fdrake@users.sourceforge.net Fri Aug 10 23:14:19 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 10 Aug 2001 15:14:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib xmlsaxutils.tex,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv25756/lib Modified Files: xmlsaxutils.tex Log Message: Add a note that the quoteattr() function is useful for HTML and SGML attributes as well. Index: xmlsaxutils.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/xmlsaxutils.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xmlsaxutils.tex 2001/07/19 16:10:14 1.2 --- xmlsaxutils.tex 2001/08/10 22:14:17 1.3 *************** *** 39,42 **** --- 39,44 ---- \end{verbatim} + This function is useful when generating attribute values for HTML or + any SGML using the reference concrete syntax. \versionadded{2.2} \end{funcdesc} From mwh@users.sourceforge.net Fri Aug 10 23:45:21 2001 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 10 Aug 2001 15:45:21 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0264.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv32012 Modified Files: pep-0264.txt Log Message: New version. I think this might finally be getting there. Index: pep-0264.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0264.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0264.txt 2001/08/08 15:30:13 1.1 --- pep-0264.txt 2001/08/10 22:45:19 1.2 *************** *** 1,5 **** PEP: 264 Title: Future statements in simulated shells ! Version: 2 Author: Michael Hudson Status: Draft --- 1,5 ---- PEP: 264 Title: Future statements in simulated shells ! Version: 3 Author: Michael Hudson Status: Draft *************** *** 17,25 **** statements' effects last the life of the shell. ! This short PEP proposes to make this possible by adding an ! optional fourth argument to the builtin function "compile" and adding machinery to the standard library modules "codeop" and "code" to make the construction of such shells easy. Specification --- 17,35 ---- statements' effects last the life of the shell. ! The PEP also takes the oppourtunity to clean up the other ! unresolved issue mentioned in PEP 236, the inability to stop ! compile() inheriting the effect of future statements affecting the ! code calling compile(). ! ! This PEP proposes to address the first problem by adding an ! optional fourth argument to the builtin function "compile", adding ! information to the _Feature instances defined in __future__.py and adding machinery to the standard library modules "codeop" and "code" to make the construction of such shells easy. + The second problem is dealt with by simply adding *another* + optional argument to compile(), which if non-zero suppresses the + inheriting of future statements' effects. + Specification *************** *** 33,44 **** bitfields will have the same values as the PyCF_* flags #defined in Include/pythonrun.h (at the time of writing there are three - ! PyCF_NESTED_SCOPES, PyCF_GENERATORS and PyCF_DIVISION). These are ! currently not exposed to Python, so I propose adding them to ! codeop.py (because it's already here, basically). ! XXX Should the supplied flags be or-ed with the flags of the ! calling frame, or do we override them? I'm for the former, ! slightly. I also propose adding a pair of classes to the standard library module codeop. --- 43,76 ---- bitfields will have the same values as the PyCF_* flags #defined in Include/pythonrun.h (at the time of writing there are three - ! PyCF_NESTED_SCOPES, PyCF_GENERATORS and PyCF_DIVISION). ! compile() shall raise a ValueError exception if it does not ! recognize any of the bits set in the supplied flags. ! ! The flags supplied will be bitwise-"or"ed with the flags that ! would be set anyway. ! ! The above-mentioned flags are not currently exposed to Python. I ! propose adding .compiler_flag attributes to the _Feature objects ! in __future__.py that contain the necessary bits, so one might ! write code such as: ! ! import __future__ ! def compile_generator(func_def): ! return compile(func_def, "", "suite", ! __future__.generators.compiler_flag) ! ! A recent change means that these same bits can be used to tell if ! a code object was compiled with a given feature; for instance ! ! codeob.co_flags & __future__.generators.compiler_flag + will be non-zero if and only if the code object "codeob" was + compiled in an environment where generators were allowed. + + I will also add a .__all__ attribute to the __future__ module, + giving a low-effort way of enumerating all the __future__ options + supported by the running interpreter. + I also propose adding a pair of classes to the standard library module codeop. *************** *** 48,57 **** difference that after it has compiled a __future__ statement, it "remembers" it and compiles all subsequent code with the ! __future__ options in effect. ! It will do this by examining the co_flags field of any code object ! it returns, which in turn means writing and maintaining a Python ! version of the function PyEval_MergeCompilerFlags found in ! Python/ceval.c. Objects of the other class added to codeop - probably called --- 80,87 ---- difference that after it has compiled a __future__ statement, it "remembers" it and compiles all subsequent code with the ! __future__ option in effect. ! It will do this by using the new features of the __future__ module ! mentioned above. Objects of the other class added to codeop - probably called *************** *** 69,73 **** Should be very few or none; the changes to compile will make no difference to existing code, nor will adding new functions or ! classes to codeop. Exisiting code using code.InteractiveInterpreter may change in behaviour, but only for the better in that the "real" Python shell will be being better --- 99,103 ---- Should be very few or none; the changes to compile will make no difference to existing code, nor will adding new functions or ! classes to codeop. Existing code using code.InteractiveInterpreter may change in behaviour, but only for the better in that the "real" Python shell will be being better *************** *** 77,111 **** Forward Compatibility ! codeop will require very mild tweaking as each new __future__ ! statement is added. Such events will hopefully be very rare, so ! such a burden is unlikely to cause significant pain. Issues ! Paul Prescod has reasonably complained about the choice of a ! bitfield as the fourth argument to compile(), claiming it is ! obscure and unpythonic. ! ! There is also the thought of Jython compatibility; because Jython ! has the ability to access any Java object without the PyObject ! cruft needed in CPython, Jython already has a Python-visible ! CompilerFlags object which has a boolean attribute ! "compiler_flags", and will presumably have one fairly soon called ! "generators". This would be doable in CPython, but it would ! require more hacking of deep magical bits of the interpreter and ! require bumping the PYTHON_API_VERSION (OTOH, the division patch ! just went in, so there can't be a freeze on the C API just ! yet...). Implementation ! I've uploaded a preliminary implementation as: http://sourceforge.net/tracker/?func=detail&atid=305470&aid=449043&group_id=5470 ! I need to add docs and possibly implment a friendlier interface to ! compile(). --- 107,127 ---- Forward Compatibility ! The check for unrecognised bits in compile() will need updating as ! and when more bits are recognised. Issues ! I hope the above interface is not too disruptive to implement for ! Jython. Implementation ! I've uploaded a series of (still) preliminary implementations at: http://sourceforge.net/tracker/?func=detail&atid=305470&aid=449043&group_id=5470 ! I still need to do docs (I've done docstrings) and tests. From mwh@users.sourceforge.net Fri Aug 10 23:47:53 2001 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 10 Aug 2001 15:47:53 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0264.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv32745 Modified Files: pep-0264.txt Log Message: Oops. Index: pep-0264.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0264.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0264.txt 2001/08/10 22:45:19 1.2 --- pep-0264.txt 2001/08/10 22:47:51 1.3 *************** *** 12,16 **** Abstract ! As noted in PEP 263, there is no clear way for "simulated interactive shells" to simulate the behaviour of __future__ statements in "real" interactive shells, i.e. have __future__ --- 12,16 ---- Abstract ! As noted in PEP 236, there is no clear way for "simulated interactive shells" to simulate the behaviour of __future__ statements in "real" interactive shells, i.e. have __future__ From guido@python.org Sun Aug 12 02:56:44 2001 From: guido@python.org (Guido van Rossum) Date: Sat, 11 Aug 2001 21:56:44 -0400 Subject: [Python-checkins] testing Message-ID: <200108120156.VAA06262@cj20424-a.reston1.va.home.com> warning: somehow the python checkin mail is dropped on the floor. --Guido van Rossum (home page: http://www.python.org/~guido/) From mwh@python.net Sun Aug 12 10:22:40 2001 From: mwh@python.net (Michael Hudson) Date: 12 Aug 2001 05:22:40 -0400 Subject: [Python-checkins] testing In-Reply-To: Guido van Rossum's message of "Sat, 11 Aug 2001 21:56:44 -0400" References: <200108120156.VAA06262@cj20424-a.reston1.va.home.com> Message-ID: <2mu1zd8wf3.fsf@starship.python.net> Guido van Rossum writes: > warning: somehow the python checkin mail is dropped on the floor. And bugs email, and a message I just sent myself from sf.net's web form all seem to be disappearing too. Mail sent to @users.sourceforge.net still seems to work, so at least *something* still works over there... Cheers, M. From fdrake@users.sourceforge.net Mon Aug 13 20:32:01 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 13 Aug 2001 12:32:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libdifflib.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv30267/lib Modified Files: libdifflib.tex Log Message: David Goodger : Documentation for difflib/ndiff refactoring: more of the ndiff functionality has been moved to the underlying library (difflib). This closes SF patch #445413. Index: libdifflib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdifflib.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** libdifflib.tex 2001/05/11 15:49:19 1.7 --- libdifflib.tex 2001/08/13 19:31:59 1.8 *************** *** 11,14 **** --- 11,56 ---- + \begin{classdesc*}{SequenceMatcher} + This is a flexible class for comparing pairs of sequences of any + type, so long as the sequence elements are hashable. The basic + algorithm predates, and is a little fancier than, an algorithm + published in the late 1980's by Ratcliff and Obershelp under the + hyperbolic name ``gestalt pattern matching.'' The idea is to find + the longest contiguous matching subsequence that contains no + ``junk'' elements (the Ratcliff and Obershelp algorithm doesn't + address junk). The same idea is then applied recursively to the + pieces of the sequences to the left and to the right of the matching + subsequence. This does not yield minimal edit sequences, but does + tend to yield matches that ``look right'' to people. + + \strong{Timing:} The basic Ratcliff-Obershelp algorithm is cubic + time in the worst case and quadratic time in the expected case. + \class{SequenceMatcher} is quadratic time for the worst case and has + expected-case behavior dependent in a complicated way on how many + elements the sequences have in common; best case time is linear. + \end{classdesc*} + + \begin{classdesc*}{Differ} + This is a class for comparing sequences of lines of text, and + producing human-readable differences or deltas. Differ uses + \class{SequenceMatcher} both to compare sequences of lines, and to + compare sequences of characters within similar (near-matching) + lines. + + Each line of a \class{Differ} delta begins with a two-letter code: + + \begin{tableii}{l|l}{code}{Code}{Meaning} + \lineii{'- '}{line unique to sequence 1} + \lineii{'+ '}{line unique to sequence 2} + \lineii{' '}{line common to both sequences} + \lineii{'? '}{line not present in either input sequence} + \end{tableii} + + Lines beginning with `\code{?~}' attempt to guide the eye to + intraline differences, and were not present in either input + sequence. These lines can be confusing if the sequences contain tab + characters. + \end{classdesc*} + \begin{funcdesc}{get_close_matches}{word, possibilities\optional{, n\optional{, cutoff}}} *************** *** 41,65 **** \end{funcdesc} ! \begin{classdesc*}{SequenceMatcher} ! This is a flexible class for comparing pairs of sequences of any ! type, so long as the sequence elements are hashable. The basic ! algorithm predates, and is a little fancier than, an algorithm ! published in the late 1980's by Ratcliff and Obershelp under the ! hyperbolic name ``gestalt pattern matching.'' The idea is to find ! the longest contiguous matching subsequence that contains no ! ``junk'' elements (the Ratcliff and Obershelp algorithm doesn't ! address junk). The same idea is then applied recursively to the ! pieces of the sequences to the left and to the right of the matching ! subsequence. This does not yield minimal edit sequences, but does ! tend to yield matches that ``look right'' to people. ! \strong{Timing:} The basic Ratcliff-Obershelp algorithm is cubic ! time in the worst case and quadratic time in the expected case. ! \class{SequenceMatcher} is quadratic time for the worst case and has ! expected-case behavior dependent in a complicated way on how many ! elements the sequences have in common; best case time is linear. ! \end{classdesc*} \begin{seealso} \seetitle{Pattern Matching: The Gestalt Approach}{Discussion of a --- 83,167 ---- \end{funcdesc} ! \begin{funcdesc}{ndiff}{a, b\optional{, linejunk\optional{, ! charjunk}}} ! Compare \var{a} and \var{b} (lists of strings); return a ! \class{Differ}-style delta. ! Optional keyword parameters \var{linejunk} and \var{charjunk} are ! for filter functions (or \code{None}): ! ! \var{linejunk}: A function that should accept a single string ! argument, and return true if the string is junk (or false if it is ! not). The default is module-level function ! \function{IS_LINE_JUNK()}, which filters out lines without visible ! characters, except for at most one pound character (\character{\#}). ! ! \var{charjunk}: A function that should accept a string of length 1. ! The default is module-level function \function{IS_CHARACTER_JUNK()}, ! which filters out whitespace characters (a blank or tab; note: bad ! idea to include newline in this!). ! ! \file{Tools/scripts/ndiff.py} is a command-line front-end to this ! function. ! ! \begin{verbatim} ! >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1), ! ... 'ore\ntree\nemu\n'.splitlines(1))) ! >>> print ''.join(diff), ! - one ! ? ^ ! + ore ! ? ^ ! - two ! - three ! ? - ! + tree ! + emu ! \end{verbatim} ! \end{funcdesc} + \begin{funcdesc}{restore}{sequence, which} + Return one of the two sequences that generated a delta. + Given a \var{sequence} produced by \method{Differ.compare()} or + \function{ndiff()}, extract lines originating from file 1 or 2 + (parameter \var{which}), stripping off line prefixes. + + Example: + + \begin{verbatim} + >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1), + ... 'ore\ntree\nemu\n'.splitlines(1)) + >>> print ''.join(restore(diff, 1)), + one + two + three + >>> print ''.join(restore(diff, 2)), + ore + tree + emu + \end{verbatim} + + \end{funcdesc} + + + \begin{funcdesc}{IS_LINE_JUNK}{line}: + + Return 1 for ignorable line: iff \var{line} is blank or contains a + single \character{\#}. Used as a default for parameter + \var{linejunk} in \function{ndiff()}. + + \end{funcdesc} + + + \begin{funcdesc}{IS_CHARACTER_JUNK}{ch}: + + Return 1 for ignorable character: iff \var{ch} is a space or tab. + Used as a default for parameter \var{charjunk} in + \function{ndiff()}. + + \end{funcdesc} + + \begin{seealso} \seetitle{Pattern Matching: The Gestalt Approach}{Discussion of a *************** *** 232,238 **** Where T is the total number of elements in both sequences, and M is ! the number of matches, this is 2.0*M / T. Note that this is \code{1.} ! if the sequences are identical, and \code{0.} if they have nothing in ! common. This is expensive to compute if \method{get_matching_blocks()} or --- 334,340 ---- Where T is the total number of elements in both sequences, and M is ! the number of matches, this is 2.0*M / T. Note that this is ! \code{1.0} if the sequences are identical, and \code{0.0} if they ! have nothing in common. This is expensive to compute if \method{get_matching_blocks()} or *************** *** 273,277 **** ! \subsection{Examples \label{difflib-examples}} --- 375,379 ---- ! \subsection{SequenceMatcher Examples \label{sequencematcher-examples}} *************** *** 322,331 **** \end{verbatim} - See \file{Tools/scripts/ndiff.py} from the Python source distribution - for a fancy human-friendly file differencer, which uses - \class{SequenceMatcher} both to view files as sequences of lines, and - lines as sequences of characters. - See also the function \function{get_close_matches()} in this module, which shows how simple code building on \class{SequenceMatcher} can be used to do useful work. --- 424,544 ---- \end{verbatim} See also the function \function{get_close_matches()} in this module, which shows how simple code building on \class{SequenceMatcher} can be used to do useful work. + + + \subsection{Differ Objects \label{differ-objects}} + + Note that \class{Differ}-generated deltas make no claim to be + \strong{minimal} diffs. To the contrary, minimal diffs are often + counter-intuitive, because they synch up anywhere possible, sometimes + accidental matches 100 pages apart. Restricting synch points to + contiguous matches preserves some notion of locality, at the + occasional cost of producing a longer diff. + + The \class{Differ} class has this constructor: + + \begin{classdesc}{Differ}{\optional{linejunk\optional{, charjunk}}} + Optional keyword parameters \var{linejunk} and \var{charjunk} are + for filter functions (or \code{None}): + + \var{linejunk}: A function that should accept a single string + argument, and return true iff the string is junk. The default is + module-level function \function{IS_LINE_JUNK()}, which filters out + lines without visible characters, except for at most one pound + character (\character{\#}). + + \var{charjunk}: A function that should accept a string of length 1. + The default is module-level function \function{IS_CHARACTER_JUNK()}, + which filters out whitespace characters (a blank or tab; note: bad + idea to include newline in this!). + \end{classdesc} + + \class{Differ} objects are used (deltas generated) via a single + method: + + \begin{methoddesc}{compare}{a, b} + Compare two sequences of lines; return the resulting delta (list). + + Each sequence must contain individual single-line strings ending + with newlines. Such sequences can be obtained from the + \method{readlines()} method of file-like objects. The list returned + is also made up of newline-terminated strings, and ready to be used + with the \method{writelines()} method of a file-like object. + \end{methoddesc} + + + \subsection{Differ Example \label{differ-examples}} + + This example compares two texts. First we set up the texts, sequences + of individual single-line strings ending with newlines (such sequences + can also be obtained from the \method{readlines()} method of file-like + objects): + + \begin{verbatim} + >>> text1 = ''' 1. Beautiful is better than ugly. + ... 2. Explicit is better than implicit. + ... 3. Simple is better than complex. + ... 4. Complex is better than complicated. + ... '''.splitlines(1) + >>> len(text1) + 4 + >>> text1[0][-1] + '\n' + >>> text2 = ''' 1. Beautiful is better than ugly. + ... 3. Simple is better than complex. + ... 4. Complicated is better than complex. + ... 5. Flat is better than nested. + ... '''.splitlines(1) + \end{verbatim} + + Next we instantiate a Differ object: + + \begin{verbatim} + >>> d = Differ() + \end{verbatim} + + Note that when instantiating a \class{Differ} object we may pass + functions to filter out line and character ``junk.'' See the + \method{Differ()} constructor for details. + + Finally, we compare the two: + + \begin{verbatim} + >>> result = d.compare(text1, text2) + \end{verbatim} + + \code{result} is a list of strings, so let's pretty-print it: + + \begin{verbatim} + >>> from pprint import pprint + >>> pprint(result) + [' 1. Beautiful is better than ugly.\n', + '- 2. Explicit is better than implicit.\n', + '- 3. Simple is better than complex.\n', + '+ 3. Simple is better than complex.\n', + '? ++ \n', + '- 4. Complex is better than complicated.\n', + '? ^ ---- ^ \n', + '+ 4. Complicated is better than complex.\n', + '? ++++ ^ ^ \n', + '+ 5. Flat is better than nested.\n'] + \end{verbatim} + + As a single multi-line string it looks like this: + + \begin{verbatim} + >>> import sys + >>> sys.stdout.writelines(result) + 1. Beautiful is better than ugly. + - 2. Explicit is better than implicit. + - 3. Simple is better than complex. + + 3. Simple is better than complex. + ? ++ + - 4. Complex is better than complicated. + ? ^ ---- ^ + + 4. Complicated is better than complex. + ? ++++ ^ ^ + + 5. Flat is better than nested. + \end{verbatim} From fdrake@users.sourceforge.net Mon Aug 13 21:20:53 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 13 Aug 2001 13:20:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib pyclbr.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv9756/Lib Modified Files: pyclbr.py Log Message: Nick Mathewson: Make sure the recursion is handled properly. This is part of SF patch #440292. Index: pyclbr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pyclbr.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** pyclbr.py 2001/08/13 15:55:19 1.21 --- pyclbr.py 2001/08/13 20:20:51 1.22 *************** *** 167,172 **** package = module[:i].strip() submodule = module[i+1:].strip() ! parent = readmodule(package, path, inpackage) ! child = readmodule(submodule, parent['__path__'], 1) return child --- 167,172 ---- package = module[:i].strip() submodule = module[i+1:].strip() ! parent = readmodule_ex(package, path, inpackage) ! child = readmodule_ex(submodule, parent['__path__'], 1) return child *************** *** 296,300 **** try: # recursively read the imported module ! d = readmodule(n, path, inpackage) except: ##print 'module', n, 'not found' --- 296,300 ---- try: # recursively read the imported module ! d = readmodule_ex(n, path, inpackage) except: ##print 'module', n, 'not found' *************** *** 307,311 **** try: # recursively read the imported module ! d = readmodule(mod, path, inpackage) except: ##print 'module', mod, 'not found' --- 307,311 ---- try: # recursively read the imported module ! d = readmodule_ex(mod, path, inpackage) except: ##print 'module', mod, 'not found' From fdrake@users.sourceforge.net Mon Aug 13 21:26:21 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 13 Aug 2001 13:26:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_pyclbr.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11161 Added Files: test_pyclbr.py Log Message: Nick Mathewson: test suite for the class browser support module. --- NEW FILE: test_pyclbr.py --- ''' Test cases for pyclbr.py Nick Mathewson ''' from test_support import run_unittest import unittest, sys from types import ClassType, FunctionType, MethodType import pyclbr # This next line triggers an error on old versions of pyclbr. from commands import getstatus # Here we test the python class browser code. # # The main function in this suite, 'testModule', compares the output # of pyclbr with the introspected members of a module. Because pyclbr # is imperfect (as designed), testModule is called with a set of # members to ignore. class PyclbrTest(unittest.TestCase): def assertListEq(self, l1, l2, ignore): ''' succeed iff {l1} - {ignore} == {l2} - {ignore} ''' for p1, p2 in (l1, l2), (l2, l1): for item in p1: ok = (item in p2) or (item in ignore) if not ok: self.fail("%r missing" % item) def assertHasattr(self, obj, attr, ignore): ''' succeed iff hasattr(obj,attr) or attr in ignore. ''' if attr in ignore: return if not hasattr(obj, attr): print "???",attr self.failUnless(hasattr(obj, attr)) def assertHaskey(self, obj, key, ignore): ''' succeed iff obj.has_key(key) or key in ignore. ''' if key in ignore: return if not obj.has_key(key): print "***",key self.failUnless(obj.has_key(key)) def assertEquals(self, a, b, ignore=None): ''' succeed iff a == b or a in ignore or b in ignore ''' if (ignore == None) or (a in ignore) or (b in ignore): return unittest.TestCase.assertEquals(self, a, b) def checkModule(self, moduleName, module=None, ignore=()): ''' succeed iff pyclbr.readmodule_ex(modulename) corresponds to the actual module object, module. Any identifiers in ignore are ignored. If no module is provided, the appropriate module is loaded with __import__.''' if module == None: module = __import__(moduleName, globals(), {}, []) dict = pyclbr.readmodule_ex(moduleName) # Make sure the toplevel functions and classes are the same. for name, value in dict.items(): if name in ignore: continue self.assertHasattr(module, name, ignore) py_item = getattr(module, name) if isinstance(value, pyclbr.Function): self.assertEquals(type(py_item), FunctionType) else: self.assertEquals(type(py_item), ClassType) real_bases = [base.__name__ for base in py_item.__bases__] pyclbr_bases = [ getattr(base, 'name', base) for base in value.super ] self.assertListEq(real_bases, pyclbr_bases, ignore) actualMethods = [] for m in dir(py_item): if type(getattr(py_item, m)) == MethodType: actualMethods.append(m) foundMethods = [] for m in value.methods.keys(): if m[:2] == '__' and m[-2:] != '__': foundMethods.append('_'+name+m) else: foundMethods.append(m) self.assertListEq(foundMethods, actualMethods, ignore) self.assertEquals(py_item.__module__, value.module) self.assertEquals(py_item.__name__, value.name, ignore) # can't check file or lineno # Now check for missing stuff. for name in dir(module): item = getattr(module, name) if type(item) in (ClassType, FunctionType): self.assertHaskey(dict, name, ignore) def test_easy(self): self.checkModule('pyclbr') self.checkModule('doctest') self.checkModule('rfc822') self.checkModule('xmllib') self.checkModule('difflib') def test_others(self): cm = self.checkModule # these are about the 20 longest modules. cm('random', ignore=('_verify',)) # deleted cm('cgi', ignore=('f', 'g', # nested declarations 'log')) # set with =, not def cm('mhlib', ignore=('do', # nested declaration 'bisect')) # imported method, set with = cm('urllib', ignore=('getproxies_environment', # set with = 'getproxies_registry')) # set with = #XXXX bad example #cm('urllib2', ignore=('at_cnri', # defined inside __main__ # '__super_init', # set with =. # '_HTTPError__super_init', # set with =. # 'http_error_301', # set with =. # )) cm('pickle', ignore=('g',)) # deleted declaration cm('aifc', ignore=('openfp',)) # set with = cm('httplib', ignore=('error',)) # set with = cm('Cookie', ignore=('__str__', 'Cookie')) # set with = cm('sre_parse', ignore=('literal', # nested def 'makedict', 'dump' # from sre_constants )) cm('test.test_pyclbr', module=sys.modules[__name__]) # pydoc doesn't work because of string issues # cm('pydoc', pydoc) # pdb plays too many dynamic games # cm('pdb', pdb) run_unittest(PyclbrTest) From gvanrossum@users.sourceforge.net Mon Aug 13 22:03:14 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 13 Aug 2001 14:03:14 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0251.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv20670 Modified Files: pep-0251.txt Log Message: Make Barry co-author; slip the schedule (including a new a3 release); tighten list of planned features. Index: pep-0251.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0251.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0251.txt 2001/06/22 15:36:31 1.2 --- pep-0251.txt 2001/08/13 21:03:12 1.3 *************** *** 2,6 **** Title: Python 2.2 Release Schedule Version: $Revision$ ! Author: Guido van Rossum Status: Incomplete Type: Informational --- 2,6 ---- Title: Python 2.2 Release Schedule Version: $Revision$ ! Author: guido@python.org (Guido van Rossum), barry@zope.com (Barry A. Warsaw) Status: Incomplete Type: Informational *************** *** 24,45 **** Release Schedule ! Tentative future release dates (compare pep-0226) ! 17-Oct-2001: 2.2 (final release) ! 10-Oct-2001: 2.2c1 (release candidate) ! 19-Sep-2001: 2.2b2 ! 29-Aug-2001: 2.2b1 ! 8-Aug-2001: 2.2a2 18-Jul-2001: 2.2a1 Release Mechanics ! I'd like to experiment with a new mechanism for releases: a week ! before every alpha, beta or other release, I'll fork off a branch which will become the release; changes to the branch will have to be approved before they can be checked in. This is how some other ! large projects (e.g. Mozilla) work, and I hope it will help reduce ! the number of bugs introduced in releases at the last minute. --- 24,55 ---- Release Schedule ! Tentative future release dates. Note that we've slipped this ! compared to the schedule posted around the release of 2.2a1. ! 19-Dec-2001: 2.2 (final release) ! 12-Dec-2001: 2.2c1 (release candidate) ! 14-Nov-2001: 2.2b2 ! 10-Oct-2001: 2.2b1 ! 19-Sep-2001: 2.2a3 (new! a third alpha) ! 22-Aug-2001: 2.2a2 18-Jul-2001: 2.2a1 + Release Manager + + Barry Warsaw will take over as the release manager. Guido and + Barry will release 2.2a2 together, after that Barry will be + responsible for releases. + + Release Mechanics ! We'd like to experiment with a new mechanism for releases: a week ! before every alpha, beta or other release, we'll fork off a branch which will become the release; changes to the branch will have to be approved before they can be checked in. This is how some other ! large projects (e.g. Mozilla) work, and we hope it will help ! reduce the number of bugs introduced in releases at the last ! minute. *************** *** 48,65 **** The following features are already checked in on the head revision (for a more detailed account, see Misc/NEWS): - - - iterators (pep-0234) ! The following features are scheduled to go in; work is still ! ongoing in defining the exact appearance of the features: ! - generators (pep-0255) ! - unification of types and classes (pep-0252, pep-0253, pep-0254) The following features are under consideration: ! - a standard set API (implemented in Python for now) (pep-0218) ! - a 'directive' statement (pep-0244) ! - unifying long ints and plain ints (pep-0237) There needs to be more discussion of each of these before we can --- 58,72 ---- The following features are already checked in on the head revision (for a more detailed account, see Misc/NEWS): ! - iterators (PEP 234) ! - generators (PEP 255) ! - division (PEP 238) ! - unification of types and classes (PEP 252, PEP 253) ! Work on the class/type unification is still ongoing. The following features are under consideration: ! - unifying long ints and plain ints (PEP 237) There needs to be more discussion of each of these before we can From bwarsaw@users.sourceforge.net Mon Aug 13 22:18:03 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 13 Aug 2001 14:18:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib smtpd.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25752 Modified Files: smtpd.py Log Message: found_terminator(): Add a debug print showing the data. Index: smtpd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtpd.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** smtpd.py 2001/08/13 14:43:43 1.6 --- smtpd.py 2001/08/13 21:18:01 1.7 *************** *** 1,4 **** #! /usr/bin/env python ! """An RFC 821 smtp proxy. Usage: %(program)s [options] localhost:port remotehost:port --- 1,4 ---- #! /usr/bin/env python ! """An RFC 2821 smtp proxy. Usage: %(program)s [options] localhost:port remotehost:port *************** *** 134,137 **** --- 134,138 ---- def found_terminator(self): line = EMPTYSTRING.join(self.__line) + print >> DEBUGSTREAM, 'Data:', repr(line) self.__line = [] if self.__state == self.COMMAND: From tim_one@users.sourceforge.net Mon Aug 13 23:25:26 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 13 Aug 2001 15:25:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_pyclbr.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv15259 Modified Files: test_pyclbr.py Log Message: Repair Unix-specific assumptions that caused this to fail on Windows. Index: test_pyclbr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pyclbr.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_pyclbr.py 2001/08/13 20:26:19 1.1 --- test_pyclbr.py 2001/08/13 22:25:24 1.2 *************** *** 10,16 **** # This next line triggers an error on old versions of pyclbr. ! from commands import getstatus ! # Here we test the python class browser code. # # The main function in this suite, 'testModule', compares the output --- 10,16 ---- # This next line triggers an error on old versions of pyclbr. ! from commands import getstatus ! # Here we test the python class browser code. # # The main function in this suite, 'testModule', compares the output *************** *** 28,33 **** if not ok: self.fail("%r missing" % item) ! ! def assertHasattr(self, obj, attr, ignore): ''' succeed iff hasattr(obj,attr) or attr in ignore. ''' --- 28,33 ---- if not ok: self.fail("%r missing" % item) ! ! def assertHasattr(self, obj, attr, ignore): ''' succeed iff hasattr(obj,attr) or attr in ignore. ''' *************** *** 56,60 **** if module == None: ! module = __import__(moduleName, globals(), {}, []) dict = pyclbr.readmodule_ex(moduleName) --- 56,60 ---- if module == None: ! module = __import__(moduleName, globals(), {}, []) dict = pyclbr.readmodule_ex(moduleName) *************** *** 62,66 **** # Make sure the toplevel functions and classes are the same. for name, value in dict.items(): ! if name in ignore: continue self.assertHasattr(module, name, ignore) --- 62,66 ---- # Make sure the toplevel functions and classes are the same. for name, value in dict.items(): ! if name in ignore: continue self.assertHasattr(module, name, ignore) *************** *** 71,77 **** self.assertEquals(type(py_item), ClassType) real_bases = [base.__name__ for base in py_item.__bases__] ! pyclbr_bases = [ getattr(base, 'name', base) for base in value.super ] ! self.assertListEq(real_bases, pyclbr_bases, ignore) --- 71,77 ---- self.assertEquals(type(py_item), ClassType) real_bases = [base.__name__ for base in py_item.__bases__] ! pyclbr_bases = [ getattr(base, 'name', base) for base in value.super ] ! self.assertListEq(real_bases, pyclbr_bases, ignore) *************** *** 120,124 **** cm('urllib', ignore=('getproxies_environment', # set with = ! 'getproxies_registry')) # set with = #XXXX bad example --- 120,125 ---- cm('urllib', ignore=('getproxies_environment', # set with = ! 'getproxies_registry', # set with = ! 'open_https')) # not on all platforms #XXXX bad example *************** *** 130,158 **** ! cm('pickle', ignore=('g',)) # deleted declaration ! cm('aifc', ignore=('openfp',)) # set with = - - cm('httplib', ignore=('error',)) # set with = cm('Cookie', ignore=('__str__', 'Cookie')) # set with = ! cm('sre_parse', ignore=('literal', # nested def 'makedict', 'dump' # from sre_constants )) ! cm('test.test_pyclbr', module=sys.modules[__name__]) # pydoc doesn't work because of string issues # cm('pydoc', pydoc) ! # pdb plays too many dynamic games ! # cm('pdb', pdb) run_unittest(PyclbrTest) - - - --- 131,156 ---- ! cm('pickle', ignore=('g',)) # deleted declaration ! cm('aifc', ignore=('openfp',)) # set with = + cm('httplib', ignore=('error', # set with = + 'HTTPS')) # not on all platforms cm('Cookie', ignore=('__str__', 'Cookie')) # set with = ! cm('sre_parse', ignore=('literal', # nested def 'makedict', 'dump' # from sre_constants )) ! cm('test.test_pyclbr', module=sys.modules[__name__]) # pydoc doesn't work because of string issues # cm('pydoc', pydoc) ! # pdb plays too many dynamic games ! # cm('pdb', pdb) run_unittest(PyclbrTest) From bwarsaw@users.sourceforge.net Tue Aug 14 00:04:59 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 13 Aug 2001 16:04:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python pythonrun.c,2.143,2.144 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv28529 Modified Files: pythonrun.c Log Message: Py_Initialize(): Apply patch by Jürgen Hermann to call _PyImport_FixupExtension() on the exceptions module. Now reload(exceptions) acts just like reload(sys) instead of raising an ImportError. This closes SF bug #422004. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.143 retrieving revision 2.144 diff -C2 -d -r2.143 -r2.144 *** pythonrun.c 2001/08/10 21:41:33 2.143 --- pythonrun.c 2001/08/13 23:04:56 2.144 *************** *** 152,155 **** --- 152,156 ---- /* initialize builtin exceptions */ _PyExc_Init(); + _PyImport_FixupExtension("exceptions", "exceptions"); /* phase 2 of builtins */ From bwarsaw@users.sourceforge.net Tue Aug 14 00:05:46 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 13 Aug 2001 16:05:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python import.c,2.184,2.185 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv28697 Modified Files: import.c Log Message: Fixed typo in comment leading up to _PyImport_FixupExtension(). Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.184 retrieving revision 2.185 diff -C2 -d -r2.184 -r2.185 *** import.c 2001/08/08 12:54:28 2.184 --- import.c 2001/08/13 23:05:44 2.185 *************** *** 356,360 **** once, we keep a static dictionary 'extensions' keyed by module name (for built-in modules) or by filename (for dynamically loaded ! modules), containing these modules. A copy od the module's dictionary is stored by calling _PyImport_FixupExtension() immediately after the module initialization function succeeds. A --- 356,360 ---- once, we keep a static dictionary 'extensions' keyed by module name (for built-in modules) or by filename (for dynamically loaded ! modules), containing these modules. A copy of the module's dictionary is stored by calling _PyImport_FixupExtension() immediately after the module initialization function succeeds. A From bwarsaw@users.sourceforge.net Tue Aug 14 00:07:02 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 13 Aug 2001 16:07:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_exceptions.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv28969 Modified Files: test_exceptions.py Log Message: reload(exceptions) should not raise an ImportError, but should act just like reload(sys). Test that this is so. Closes SF bug #422004. Index: test_exceptions.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_exceptions.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_exceptions.py 2001/02/01 22:48:12 1.12 --- test_exceptions.py 2001/08/13 23:07:00 1.13 *************** *** 7,10 **** --- 7,18 ---- # XXX This is not really enough, each *operation* should be tested! + # Reloading the built-in exceptions module failed prior to Py2.2, while it + # should act the same as reloading built-in sys. + try: + import exceptions + reload(exceptions) + except ImportError, e: + raise TestFailed, e + def test_raise_catch(exc): try: From fdrake@acm.org Tue Aug 14 12:13:57 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Tue, 14 Aug 2001 07:13:57 -0400 (EDT) Subject: [Python-checkins] CVS: python/dist/src/Lib smtpd.py,1.6,1.7 In-Reply-To: References: Message-ID: <15225.2037.873384.413365@cj42289-a.reston1.va.home.com> Barry Warsaw writes: > Modified Files: > smtpd.py Barry, Did you realize that this module still needs documentation? -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fdrake@users.sourceforge.net Tue Aug 14 12:38:37 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 14 Aug 2001 04:38:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libundoc.tex,1.79,1.80 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv27984/lib Modified Files: libundoc.tex Log Message: Add the smtpd module to the list of undocumented modules; Barry needs to write the documentation for this module. Index: libundoc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libundoc.tex,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** libundoc.tex 2001/03/20 23:13:53 1.79 --- libundoc.tex 2001/08/14 11:38:35 1.80 *************** *** 46,49 **** --- 46,53 ---- \item[\module{ihooks}] --- Import hook support (for \refmodule{rexec}; may become obsolete). + + \item[\module{smtpd}] + --- An SMTP daemon implementation which meets the minimum requirements + for \rfc{821} conformance. \end{description} From fdrake@users.sourceforge.net Tue Aug 14 12:42:15 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 14 Aug 2001 04:42:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libpoplib.tex,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv29536/lib Modified Files: libpoplib.tex Log Message: Insert omitted "the". Index: libpoplib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpoplib.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** libpoplib.tex 2001/05/09 03:49:48 1.12 --- libpoplib.tex 2001/08/14 11:42:13 1.13 *************** *** 14,18 **** This module defines a class, \class{POP3}, which encapsulates a ! connection to an POP3 server and implements protocol as defined in \rfc{1725}. The \class{POP3} class supports both the minimal and optional command sets. --- 14,18 ---- This module defines a class, \class{POP3}, which encapsulates a ! connection to an POP3 server and implements the protocol as defined in \rfc{1725}. The \class{POP3} class supports both the minimal and optional command sets. From fdrake@users.sourceforge.net Tue Aug 14 16:32:18 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 14 Aug 2001 08:32:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.138,1.139 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv21226 Modified Files: api.tex Log Message: Add "exceptions" to the list of fundamental modules created by Py_Initialize(). This closes SF bug #450621. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** api.tex 2001/08/10 21:31:12 1.138 --- api.tex 2001/08/14 15:32:16 1.139 *************** *** 540,546 **** This initializes the table of loaded modules, and creates the fundamental modules \module{__builtin__}\refbimodindex{__builtin__}, ! \module{__main__}\refbimodindex{__main__} and ! \module{sys}\refbimodindex{sys}. It also initializes the module ! search path (\code{sys.path}).% \indexiii{module}{search}{path} \withsubitem{(in module sys)}{\ttindex{path}} --- 540,546 ---- This initializes the table of loaded modules, and creates the fundamental modules \module{__builtin__}\refbimodindex{__builtin__}, ! \module{__main__}\refbimodindex{__main__}, \module{sys}\refbimodindex{sys}, ! and \module{exceptions}.\refbimodindex{exceptions} It also initializes ! the module search path (\code{sys.path}).% \indexiii{module}{search}{path} \withsubitem{(in module sys)}{\ttindex{path}} From bwarsaw@users.sourceforge.net Tue Aug 14 16:45:28 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 08:45:28 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.114,1.115 pep-0001.txt,1.22,1.23 pep-0008.txt,1.3,1.4 pep-0201.txt,1.18,1.19 pep-0214.txt,1.11,1.12 pep-0231.txt,1.5,1.6 pep-0232.txt,1.10,1.11 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv24636 Modified Files: pep-0000.txt pep-0001.txt pep-0008.txt pep-0201.txt pep-0214.txt pep-0231.txt pep-0232.txt Log Message: barry@digicool.com => barry@zope.com Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** pep-0000.txt 2001/08/08 15:30:13 1.114 --- pep-0000.txt 2001/08/14 15:45:26 1.115 *************** *** 2,6 **** Title: Index of Python Enhancement Proposals (PEPs) Version: $Revision$ ! Author: barry@digicool.com (Barry A. Warsaw) Status: Active Type: Informational --- 2,6 ---- Title: Index of Python Enhancement Proposals (PEPs) Version: $Revision$ ! Author: barry@zope.com (Barry A. Warsaw) Status: Active Type: Informational *************** *** 247,251 **** Schemenauer, Neil nas@arctrix.com Schneider-Kamp, Peter nowonder@nowonder.de ! Warsaw, Barry barry@digicool.com Wilson, Greg gvwilson@ddj.com Wouters, Thomas thomas@xs4all.net --- 247,251 ---- Schemenauer, Neil nas@arctrix.com Schneider-Kamp, Peter nowonder@nowonder.de ! Warsaw, Barry barry@zope.com Wilson, Greg gvwilson@ddj.com Wouters, Thomas thomas@xs4all.net Index: pep-0001.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0001.txt,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** pep-0001.txt 2001/08/01 20:11:56 1.22 --- pep-0001.txt 2001/08/14 15:45:26 1.23 *************** *** 2,6 **** Title: PEP Purpose and Guidelines Version: $Revision$ ! Author: barry@digicool.com (Barry A. Warsaw), jeremy@zope.com (Jeremy Hylton) Status: Active --- 2,6 ---- Title: PEP Purpose and Guidelines Version: $Revision$ ! Author: barry@zope.com (Barry A. Warsaw), jeremy@zope.com (Jeremy Hylton) Status: Active *************** *** 40,44 **** PEP Work Flow ! The PEP editor, Barry Warsaw , assigns numbers for each PEP and changes its status. --- 40,44 ---- PEP Work Flow ! The PEP editor, Barry Warsaw , assigns numbers for each PEP and changes its status. Index: pep-0008.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0008.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0008.txt 2001/07/05 20:38:11 1.3 --- pep-0008.txt 2001/08/14 15:45:26 1.4 *************** *** 3,7 **** Version: $Revision$ Author: guido@python.org (Guido van Rossum), ! barry@digicool.com (Barry Warsaw) Status: Active Type: Informational --- 3,7 ---- Version: $Revision$ Author: guido@python.org (Guido van Rossum), ! barry@zope.com (Barry Warsaw) Status: Active Type: Informational Index: pep-0201.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0201.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pep-0201.txt 2000/10/30 21:16:38 1.18 --- pep-0201.txt 2001/08/14 15:45:26 1.19 *************** *** 2,6 **** Title: Lockstep Iteration Version: $Revision$ ! Author: barry@digicool.com (Barry A. Warsaw) Status: Final Type: Standards Track --- 2,6 ---- Title: Lockstep Iteration Version: $Revision$ ! Author: barry@zope.com (Barry A. Warsaw) Status: Final Type: Standards Track Index: pep-0214.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0214.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pep-0214.txt 2000/10/30 21:16:38 1.11 --- pep-0214.txt 2001/08/14 15:45:26 1.12 *************** *** 2,6 **** Title: Extended Print Statement Version: $Revision$ ! Author: barry@digicool.com (Barry A. Warsaw) Python-Version: 2.0 Status: Final --- 2,6 ---- Title: Extended Print Statement Version: $Revision$ ! Author: barry@zope.com (Barry A. Warsaw) Python-Version: 2.0 Status: Final Index: pep-0231.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0231.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0231.txt 2001/07/05 19:07:57 1.5 --- pep-0231.txt 2001/08/14 15:45:26 1.6 *************** *** 2,6 **** Title: __findattr__() Version: $Revision$ ! Author: barry@digicool.com (Barry A. Warsaw) Python-Version: 2.1 Status: Draft --- 2,6 ---- Title: __findattr__() Version: $Revision$ ! Author: barry@zope.com (Barry A. Warsaw) Python-Version: 2.1 Status: Draft Index: pep-0232.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0232.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pep-0232.txt 2001/03/28 20:24:34 1.10 --- pep-0232.txt 2001/08/14 15:45:26 1.11 *************** *** 2,6 **** Title: Function Attributes Version: $Revision$ ! Author: barry@digicool.com (Barry A. Warsaw) Status: Final Type: Standards Track --- 2,6 ---- Title: Function Attributes Version: $Revision$ ! Author: barry@zope.com (Barry A. Warsaw) Status: Final Type: Standards Track From bwarsaw@users.sourceforge.net Tue Aug 14 16:48:24 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 08:48:24 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.115,1.116 pep-0244.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv25337 Modified Files: pep-0000.txt pep-0244.txt Log Message: After yesterday's Pythonlabs meeting, the status of PEP 244 is changed to 'rejected'. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** pep-0000.txt 2001/08/14 15:45:26 1.115 --- pep-0000.txt 2001/08/14 15:48:22 1.116 *************** *** 53,57 **** S 241 pep-0241.txt Metadata for Python Software Packages Kuchling S 243 pep-0243.txt Module Repository Upload Mechanism Reifschneider - S 244 pep-0244.txt The `directive' Statement von Loewis S 254 pep-0254.txt Making Classes Look More Like Types van Rossum S 256 pep-0256.txt Docstring Processing System Framework Goodger --- 53,56 ---- *************** *** 121,124 **** --- 120,124 ---- SR 231 pep-0231.txt __findattr__() Warsaw SD 233 pep-0233.txt Python Online Help Prescod + SR 244 pep-0244.txt The `directive' Statement von Loewis SR 259 pep-0259.txt Omit printing newline after newline van Rossum *************** *** 186,190 **** S 242 pep-0242.txt Numeric Kinds Dubois S 243 pep-0243.txt Module Repository Upload Mechanism Reifschneider ! S 244 pep-0244.txt The `directive' Statement von Loewis S 245 pep-0245.txt Python Interface Syntax Pelletier S 246 pep-0246.txt Object Adaptation Evans --- 186,190 ---- S 242 pep-0242.txt Numeric Kinds Dubois S 243 pep-0243.txt Module Repository Upload Mechanism Reifschneider ! SR 244 pep-0244.txt The `directive' Statement von Loewis S 245 pep-0245.txt Python Interface Syntax Pelletier S 246 pep-0246.txt Object Adaptation Evans Index: pep-0244.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0244.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0244.txt 2001/07/05 19:20:16 1.2 --- pep-0244.txt 2001/08/14 15:48:22 1.3 *************** *** 3,7 **** Version: $Revision$ Author: loewis@informatik.hu-berlin.de (Martin von Loewis) ! Status: Active Type: Standards Track Created: 20-Mar-2001 --- 3,7 ---- Version: $Revision$ Author: loewis@informatik.hu-berlin.de (Martin von Loewis) ! Status: Rejected Type: Standards Track Created: 20-Mar-2001 From bwarsaw@users.sourceforge.net Tue Aug 14 16:49:34 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 08:49:34 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.116,1.117 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv25597 Modified Files: pep-0000.txt Log Message: Guido says PEP 254 won't be part of Python 2.2. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** pep-0000.txt 2001/08/14 15:48:22 1.116 --- pep-0000.txt 2001/08/14 15:49:32 1.117 *************** *** 53,57 **** S 241 pep-0241.txt Metadata for Python Software Packages Kuchling S 243 pep-0243.txt Module Repository Upload Mechanism Reifschneider - S 254 pep-0254.txt Making Classes Look More Like Types van Rossum S 256 pep-0256.txt Docstring Processing System Framework Goodger S 257 pep-0257.txt Docstring Conventions Goodger, van Rossum --- 53,56 ---- *************** *** 80,83 **** --- 79,83 ---- S 245 pep-0245.txt Python Interface Syntax Pelletier S 246 pep-0246.txt Object Adaptation Evans + S 254 pep-0254.txt Making Classes Look More Like Types van Rossum Finished PEPs (done, implemented in CVS) From bwarsaw@users.sourceforge.net Tue Aug 14 17:45:21 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 09:45:21 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep2html.py,1.26,1.27 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv6221 Modified Files: pep2html.py Log Message: fixfile(): Added special casing to handle the new PEP 0 format, which eliminates the "filename" field in favor of just the unadorned PEP number. Index: pep2html.py =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** pep2html.py 2001/07/05 18:44:20 1.26 --- pep2html.py 2001/08/14 16:45:19 1.27 *************** *** 58,67 **** def usage(code, msg=''): ! sys.stderr.write(__doc__ % globals() + '\n') if msg: ! msg = str(msg) ! if msg[-1] <> '\n': ! msg = msg + '\n' ! sys.stderr.write(msg) sys.exit(code) --- 58,64 ---- def usage(code, msg=''): ! print >> sys.stderr, __docs__ % globals() if msg: ! print >> sys.stderr, msg sys.exit(code) *************** *** 82,86 **** link = RFCURL % rfcnum if link: ! return "
%s" % (link, cgi.escape(text)) return cgi.escape(match.group(0)) # really slow, but it works... --- 79,83 ---- link = RFCURL % rfcnum if link: ! return '%s' % (link, cgi.escape(text)) return cgi.escape(match.group(0)) # really slow, but it works... *************** *** 88,91 **** --- 85,89 ---- def fixfile(infile, outfile): + basename = os.path.basename(infile) # convert plain text pep to minimal XHTML markup try: *************** *** 96,100 **** return fo = open(outfile, "w") ! fo.write(DTD + "\n\n\n") # head header = [] --- 94,100 ---- return fo = open(outfile, "w") ! print >> fo, DTD ! print >> fo, '' ! print >> fo, '' # head header = [] *************** *** 123,139 **** title = "PEP " + pep + " -- " + title if title: ! fo.write(" %s\n" ! ' \n' ! % cgi.escape(title)) ! fo.write("\n") # body ! fo.write('\n' ! '\n' ! '
\n\n') for k, v in header: if k.lower() in ('author', 'discussions-to'): --- 123,138 ---- title = "PEP " + pep + " -- " + title if title: ! print >> fo, ' %s' % cgi.escape(title) ! print >> fo, ' ' ! print >> fo, '' # body ! print >> fo, '' ! print >> fo, '' ! print >> fo, '
\n
' for k, v in header: if k.lower() in ('author', 'discussions-to'): *************** *** 158,185 **** else: v = cgi.escape(v) ! fo.write(" \n" ! % (cgi.escape(k), v)) ! title = 0 ! fo.write("
%s:%s
\n
\n
\n" ! "
")
      while 1:
          line = fi.readline()
          if not line:
              break
!         if line[0] != "\f":
!             if line[0].strip():
!                 if line.strip() == LOCALVARS:
!                     break
!                 fo.write("
\n

%s

\n
" % line.strip())
!                 title = 0
!             else:
!                 line = fixpat.sub(lambda x, c=infile: fixanchor(c, x), line)
!                 fo.write(line)
!     fo.write("
\n" ! "\n" ! "\n") fo.close() os.chmod(outfile, 0664) def find_pep(pep_str): --- 157,207 ---- else: v = cgi.escape(v) ! print >> fo, ' %s:%s' % ( ! cgi.escape(k), v) ! print >> fo, '' ! print >> fo, '' ! print >> fo, '
' ! print >> fo, '
'
      while 1:
          line = fi.readline()
          if not line:
              break
!         if line[0] == '\f':
!             continue
!         if line.strip() == LOCALVARS:
!             break
!         if line[0].strip():
!             if line.strip() == LOCALVARS:
!                 break
!             print >> fo, '
' ! print >> fo, '

%s

' % line.strip() ! print >> fo, '
',
!         else:
!             # PEP 0 has some special treatment
!             if basename == 'pep-0000.txt':
!                 parts = line.split()
!                 if len(parts) > 1 and re.match(r'\s*\d{1,4}', parts[1]):
!                     # This is a PEP summary line, which we need to hyperlink
!                     url = PEPURL % int(parts[1])
!                     print >> fo, re.sub(
!                         parts[1],
!                         '%s' % (url, parts[1]),
!                         line, 1),
!                     continue
!                 elif parts and '@' in parts[-1]:
!                     # This is a pep email address line, so hyperlink it
!                     url = '%s' % (parts[-1], parts[-1])
!                     print >> fo, re.sub(
!                         parts[-1], url, line, 1),
!                     continue
!             line = fixpat.sub(lambda x, c=infile: fixanchor(c, x), line)
!             fo.write(line)
!     print >> fo, '
' ! print >> fo, '' ! print >> fo, '' fo.close() os.chmod(outfile, 0664) + def find_pep(pep_str): *************** *** 257,260 **** --- 279,283 ---- if update: push_pep(html, peptxt, username, verbose) + From bwarsaw@users.sourceforge.net Tue Aug 14 17:46:59 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 09:46:59 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.117,1.118 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv6652 Modified Files: pep-0000.txt Log Message: New format which eliminates the "filename" field in favor of just the unadorned PEP number. This gives more space to the title field and lets us make the owner field more consistent. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** pep-0000.txt 2001/08/14 15:49:32 1.117 --- pep-0000.txt 2001/08/14 16:46:57 1.118 *************** *** 19,210 **** Index by Category ! num filename title owner ! --- ------------ ----- ----- Meta-PEPs (PEPs about PEPs or Process) ! I 0 pep-0000.txt Index of Python Enhancement Proposals Warsaw ! I 1 pep-0001.txt PEP Guidelines Warsaw, Hylton ! I 3 pep-0003.txt Guidelines for Handling Bug Reports Hylton ! I 4 pep-0004.txt Deprecation of Standard Modules von Loewis ! I 5 pep-0005.txt Guidelines for Language Evolution Prescod ! I 6 pep-0006.txt Bug Fix Releases Aahz ! I 7 pep-0007.txt Style Guide for C Code van Rossum ! I 8 pep-0008.txt Style Guide for Python Code van Rossum, Warsaw Other Informational PEPs ! I 247 pep-0247.txt API for Cryptographic Hash Functions Kuchling ! I 248 pep-0248.txt Python Database API Specification v1.0 Lemburg ! I 249 pep-0249.txt Python Database API Specification v2.0 Lemburg Accepted PEPs (accepted for Python 2.2; may not be implemented yet) ! S 238 pep-0238.txt Changing the Division Operator Zadka, van Rossum ! S 250 pep-0250.txt Using site-packages on All Platforms Moore ! I 251 pep-0251.txt Python 2.2 Release Schedule van Rossum ! S 252 pep-0252.txt Making Types Look More Like Classes van Rossum ! S 253 pep-0253.txt Subtyping Built-in Types van Rossum Open PEPs (under consideration for Python 2.2) ! I 42 pep-0042.txt Small Feature Requests Hylton ! S 237 pep-0237.txt Unifying Long Integers and Integers Zadka, van Rossum ! S 241 pep-0241.txt Metadata for Python Software Packages Kuchling ! S 243 pep-0243.txt Module Repository Upload Mechanism Reifschneider ! S 256 pep-0256.txt Docstring Processing System Framework Goodger ! S 257 pep-0257.txt Docstring Conventions Goodger, van Rossum ! S 258 pep-0258.txt DPS Generic Implementation Details Goodger ! S 262 pep-0262.txt Database of Installed Python Packages Kuchling ! S 263 pep-0263.txt Defining Python Source Code Encodings Lemburg ! S 264 pep-0264.txt Future statements in simulated shells Hudson Py-in-the-sky PEPs (not considered for Python 2.2) ! I 206 pep-0206.txt 2.0 Batteries Included Zadka ! S 209 pep-0209.txt Adding Multidimensional Arrays Barrett, Oliphant ! S 211 pep-0211.txt Adding A New Outer Product Operator Wilson ! SD 212 pep-0212.txt Loop Counter Iteration Schneider-Kamp ! SD 213 pep-0213.txt Attribute Access Handlers Prescod ! S 215 pep-0215.txt String Interpolation Yee ! I 216 pep-0216.txt Docstring Format Zadka ! S 218 pep-0218.txt Adding a Built-In Set Object Type Wilson ! SD 219 pep-0219.txt Stackless Python McMillan ! S 222 pep-0222.txt Web Library Enhancements Kuchling ! SD 225 pep-0225.txt Elementwise/Objectwise Operators Zhu, Lielens ! S 228 pep-0228.txt Reworking Python's Numeric Model Zadka, van Rossum ! S 239 pep-0239.txt Adding a Rational Type to Python Zadka ! S 240 pep-0240.txt Adding a Rational Literal to Python Zadka ! S 242 pep-0242.txt Numeric Kinds Dubois ! S 245 pep-0245.txt Python Interface Syntax Pelletier ! S 246 pep-0246.txt Object Adaptation Evans ! S 254 pep-0254.txt Making Classes Look More Like Types van Rossum Finished PEPs (done, implemented in CVS) ! SF 100 pep-0100.txt Python Unicode Integration Lemburg ! IF 160 pep-0160.txt Python 1.6 Release Schedule Drake ! IF 200 pep-0200.txt Python 2.0 Release Schedule Hylton ! SF 201 pep-0201.txt Lockstep Iteration Warsaw ! S 202 pep-0202.txt List Comprehensions Peters ! SF 203 pep-0203.txt Augmented Assignments Wouters ! S 205 pep-0205.txt Weak References Drake ! SF 207 pep-0207.txt Rich Comparisons van Rossum, Ascher ! SF 208 pep-0208.txt Reworking the Coercion Model Schemenauer, Lemburg ! SF 214 pep-0214.txt Extended Print Statement Warsaw ! SF 217 pep-0217.txt Display Hook for Interactive Use Zadka ! SF 221 pep-0221.txt Import As Wouters ! SF 223 pep-0223.txt Change the Meaning of \x Escapes Peters ! I 226 pep-0226.txt Python 2.1 Release Schedule Hylton ! S 227 pep-0227.txt Statically Nested Scopes Hylton ! S 229 pep-0229.txt Using Distutils to Build Python Kuchling ! SF 230 pep-0230.txt Warning Framework van Rossum ! SF 232 pep-0232.txt Function Attributes Warsaw ! S 234 pep-0234.txt Iterators Yee, van Rossum ! SF 235 pep-0235.txt Import on Case-Insensitive Platforms Peters ! SF 236 pep-0236.txt Back to the __future__ Peters ! S 255 pep-0255.txt Simple Generators Schemenauer, et al ! S 260 pep-0260.txt Simplify xrange() van Rossum ! S 261 pep-0261.txt Support for "wide" Unicode characters Prescod Empty PEPs (or containing only an abstract) ! ID 2 pep-0002.txt Procedure for Adding New Modules Raymond ! SD 210 pep-0210.txt Decoupling the Interpreter Loop Ascher ! ID 220 pep-0220.txt Coroutines, Generators, Continuations McMillan Deferred, Abandoned, and Rejected PEPs ! SR 204 pep-0204.txt Range Literals Wouters ! SR 224 pep-0224.txt Attribute Docstrings Lemburg ! SR 231 pep-0231.txt __findattr__() Warsaw ! SD 233 pep-0233.txt Python Online Help Prescod ! SR 244 pep-0244.txt The `directive' Statement von Loewis ! SR 259 pep-0259.txt Omit printing newline after newline van Rossum Numerical Index ! num filename title owner ! --- ------------ ----- ----- ! I 0 pep-0000.txt Index of Python Enhancement Proposals Warsaw ! I 1 pep-0001.txt PEP Guidelines Warsaw, Hylton ! I 2 pep-0002.txt Procedure for Adding New Modules Raymond ! I 3 pep-0003.txt Guidelines for Handling Bug Reports Hylton ! I 4 pep-0004.txt Deprecation of Standard Modules von Loewis ! I 5 pep-0005.txt Guidelines for Language Evolution Prescod ! I 6 pep-0006.txt Bug Fix Releases Aahz ! I 7 pep-0007.txt Style Guide for C Code van Rossum ! I 8 pep-0008.txt Style Guide for Python Code van Rossum, Warsaw ! I 42 pep-0042.txt Small Feature Requests Hylton ! SF 100 pep-0100.txt Python Unicode Integration Lemburg ! IF 160 pep-0160.txt Python 1.6 Release Schedule Drake ! IF 200 pep-0200.txt Python 2.0 Release Schedule Hylton ! SF 201 pep-0201.txt Lockstep Iteration Warsaw ! S 202 pep-0202.txt List Comprehensions Peters ! SF 203 pep-0203.txt Augmented Assignments Wouters ! SR 204 pep-0204.txt Range Literals Wouters ! S 205 pep-0205.txt Weak References Drake ! I 206 pep-0206.txt 2.0 Batteries Included Zadka ! SF 207 pep-0207.txt Rich Comparisons van Rossum, Ascher ! SF 208 pep-0208.txt Reworking the Coercion Model Schemenauer, Lemburg ! S 209 pep-0209.txt Adding Multidimensional Arrays Barrett, Oliphant ! SD 210 pep-0210.txt Decoupling the Interpreter Loop Ascher ! SD 211 pep-0211.txt Adding A New Outer Product Operator Wilson ! SD 212 pep-0212.txt Loop Counter Iteration Schneider-Kamp ! SD 213 pep-0213.txt Attribute Access Handlers Prescod ! SF 214 pep-0214.txt Extended Print Statement Warsaw ! SD 215 pep-0215.txt String Interpolation Yee ! I 216 pep-0216.txt Docstring Format Zadka ! SF 217 pep-0217.txt Display Hook for Interactive Use Zadka ! SD 218 pep-0218.txt Adding a Built-In Set Object Type Wilson ! SD 219 pep-0219.txt Stackless Python McMillan ! I 220 pep-0220.txt Coroutines, Generators, Continuations McMillan ! SF 221 pep-0221.txt Import As Wouters ! S 222 pep-0222.txt Web Library Enhancements Kuchling ! SF 223 pep-0223.txt Change the Meaning of \x Escapes Peters ! SD 224 pep-0224.txt Attribute Docstrings Lemburg ! SD 225 pep-0225.txt Elementwise/Objectwise Operators Zhu, Lielens ! I 226 pep-0226.txt Python 2.1 Release Schedule Hylton ! S 227 pep-0227.txt Statically Nested Scopes Hylton ! S 228 pep-0228.txt Reworking Python's Numeric Model Zadka, van Rossum ! S 229 pep-0229.txt Using Distutils to Build Python Kuchling ! S 230 pep-0230.txt Warning Framework van Rossum ! SR 231 pep-0231.txt __findattr__() Warsaw ! SF 232 pep-0232.txt Function Attributes Warsaw ! SD 233 pep-0233.txt Python Online Help Prescod ! S 234 pep-0234.txt Iterators Yee, van Rossum ! SF 235 pep-0235.txt Import on Case-Insensitive Platforms Peters ! SF 236 pep-0236.txt Back to the __future__ Peters ! S 237 pep-0237.txt Unifying Long Integers and Integers Zadka, van Rossum ! S 238 pep-0238.txt Changing the Division Operator Zadka, van Rossum ! S 239 pep-0239.txt Adding a Rational Type to Python Zadka ! S 240 pep-0240.txt Adding a Rational Literal to Python Zadka ! S 241 pep-0241.txt Metadata for Python Software Packages Kuchling ! S 242 pep-0242.txt Numeric Kinds Dubois ! S 243 pep-0243.txt Module Repository Upload Mechanism Reifschneider ! SR 244 pep-0244.txt The `directive' Statement von Loewis ! S 245 pep-0245.txt Python Interface Syntax Pelletier ! S 246 pep-0246.txt Object Adaptation Evans ! I 247 pep-0247.txt API for Cryptographic Hash Functions Kuchling ! I 248 pep-0248.txt Python Database API Specification v1.0 Lemburg ! I 249 pep-0249.txt Python Database API Specification v2.0 Lemburg ! S 250 pep-0250.txt Using site-packages on All Platforms Moore ! I 251 pep-0251.txt Python 2.2 Release Schedule van Rossum ! S 252 pep-0252.txt Making Types Look More Like Classes van Rossum ! S 253 pep-0253.txt Subtyping Built-in Types van Rossum ! S 254 pep-0254.txt Making Classes Look More Like Types van Rossum ! S 255 pep-0255.txt Simple Generators Schemenauer, et al ! S 256 pep-0256.txt Docstring Processing System Framework Goodger ! S 257 pep-0257.txt Docstring Conventions Goodger, van Rossum ! S 258 pep-0258.txt DPS Generic Implementation Details Goodger ! SR 259 pep-0259.txt Omit printing newline after newline van Rossum ! S 260 pep-0260.txt Simplify xrange() van Rossum ! S 261 pep-0261.txt Support for "wide" Unicode characters Prescod ! S 262 pep-0262.txt Database of Installed Python Packages Kuchling ! S 263 pep-0263.txt Defining Python Source Code Encodings Lemburg ! S 264 pep-0264.txt Future statements in simulated shells Hudson --- 19,210 ---- Index by Category ! num title owner ! --- ----- ----- Meta-PEPs (PEPs about PEPs or Process) ! I 0 Index of Python Enhancement Proposals Warsaw ! I 1 PEP Guidelines Warsaw, Hylton ! I 3 Guidelines for Handling Bug Reports Hylton ! I 4 Deprecation of Standard Modules von Loewis ! I 5 Guidelines for Language Evolution Prescod ! I 6 Bug Fix Releases Aahz ! I 7 Style Guide for C Code van Rossum ! I 8 Style Guide for Python Code van Rossum, Warsaw Other Informational PEPs ! I 247 API for Cryptographic Hash Functions Kuchling ! I 248 Python Database API Specification v1.0 Lemburg ! I 249 Python Database API Specification v2.0 Lemburg Accepted PEPs (accepted for Python 2.2; may not be implemented yet) ! S 238 Changing the Division Operator Zadka, van Rossum ! S 250 Using site-packages on All Platforms Moore ! I 251 Python 2.2 Release Schedule van Rossum, Warsaw ! S 252 Making Types Look More Like Classes van Rossum ! S 253 Subtyping Built-in Types van Rossum Open PEPs (under consideration for Python 2.2) ! I 42 Small Feature Requests Hylton ! S 237 Unifying Long Integers and Integers Zadka, van Rossum ! S 241 Metadata for Python Software Packages Kuchling ! S 243 Module Repository Upload Mechanism Reifschneider ! S 256 Docstring Processing System Framework Goodger ! S 257 Docstring Conventions Goodger, van Rossum ! S 258 DPS Generic Implementation Details Goodger ! S 262 Database of Installed Python Packages Kuchling ! S 263 Defining Python Source Code Encodings Lemburg ! S 264 Future statements in simulated shells Hudson Py-in-the-sky PEPs (not considered for Python 2.2) ! I 206 2.0 Batteries Included Zadka ! S 209 Adding Multidimensional Arrays Barrett, Oliphant ! S 211 Adding A New Outer Product Operator Wilson ! SD 212 Loop Counter Iteration Schneider-Kamp ! SD 213 Attribute Access Handlers Prescod ! S 215 String Interpolation Yee ! I 216 Docstring Format Zadka ! S 218 Adding a Built-In Set Object Type Wilson ! SD 219 Stackless Python McMillan ! S 222 Web Library Enhancements Kuchling ! SD 225 Elementwise/Objectwise Operators Zhu, Lielens ! S 228 Reworking Python's Numeric Model Zadka, van Rossum ! S 239 Adding a Rational Type to Python Zadka ! S 240 Adding a Rational Literal to Python Zadka ! S 242 Numeric Kinds Dubois ! S 245 Python Interface Syntax Pelletier ! S 246 Object Adaptation Evans ! S 254 Making Classes Look More Like Types van Rossum Finished PEPs (done, implemented in CVS) ! SF 100 Python Unicode Integration Lemburg ! IF 160 Python 1.6 Release Schedule Drake ! IF 200 Python 2.0 Release Schedule Hylton ! SF 201 Lockstep Iteration Warsaw ! S 202 List Comprehensions Peters ! SF 203 Augmented Assignments Wouters ! S 205 Weak References Drake ! SF 207 Rich Comparisons van Rossum, Ascher ! SF 208 Reworking the Coercion Model Schemenauer, Lemburg ! SF 214 Extended Print Statement Warsaw ! SF 217 Display Hook for Interactive Use Zadka ! SF 221 Import As Wouters ! SF 223 Change the Meaning of \x Escapes Peters ! I 226 Python 2.1 Release Schedule Hylton ! S 227 Statically Nested Scopes Hylton ! S 229 Using Distutils to Build Python Kuchling ! SF 230 Warning Framework van Rossum ! SF 232 Function Attributes Warsaw ! S 234 Iterators Yee, van Rossum ! SF 235 Import on Case-Insensitive Platforms Peters ! SF 236 Back to the __future__ Peters ! S 255 Simple Generators Schemenauer, et al ! S 260 Simplify xrange() van Rossum ! S 261 Support for "wide" Unicode characters Prescod Empty PEPs (or containing only an abstract) ! ID 2 Procedure for Adding New Modules Raymond ! SD 210 Decoupling the Interpreter Loop Ascher ! ID 220 Coroutines, Generators, Continuations McMillan Deferred, Abandoned, and Rejected PEPs ! SR 204 Range Literals Wouters ! SR 224 Attribute Docstrings Lemburg ! SR 231 __findattr__() Warsaw ! SD 233 Python Online Help Prescod ! SR 244 The `directive' Statement von Loewis ! SR 259 Omit printing newline after newline van Rossum Numerical Index ! num title owner ! --- ----- ----- ! I 0 Index of Python Enhancement Proposals Warsaw ! I 1 PEP Guidelines Warsaw, Hylton ! I 2 Procedure for Adding New Modules Raymond ! I 3 Guidelines for Handling Bug Reports Hylton ! I 4 Deprecation of Standard Modules von Loewis ! I 5 Guidelines for Language Evolution Prescod ! I 6 Bug Fix Releases Aahz ! I 7 Style Guide for C Code van Rossum ! I 8 Style Guide for Python Code van Rossum, Warsaw ! I 42 Small Feature Requests Hylton ! SF 100 Python Unicode Integration Lemburg ! IF 160 Python 1.6 Release Schedule Drake ! IF 200 Python 2.0 Release Schedule Hylton ! SF 201 Lockstep Iteration Warsaw ! S 202 List Comprehensions Peters ! SF 203 Augmented Assignments Wouters ! SR 204 Range Literals Wouters ! S 205 Weak References Drake ! I 206 2.0 Batteries Included Zadka ! SF 207 Rich Comparisons van Rossum, Ascher ! SF 208 Reworking the Coercion Model Schemenauer, Lemburg ! S 209 Adding Multidimensional Arrays Barrett, Oliphant ! SD 210 Decoupling the Interpreter Loop Ascher ! SD 211 Adding A New Outer Product Operator Wilson ! SD 212 Loop Counter Iteration Schneider-Kamp ! SD 213 Attribute Access Handlers Prescod ! SF 214 Extended Print Statement Warsaw ! SD 215 String Interpolation Yee ! I 216 Docstring Format Zadka ! SF 217 Display Hook for Interactive Use Zadka ! SD 218 Adding a Built-In Set Object Type Wilson ! SD 219 Stackless Python McMillan ! I 220 Coroutines, Generators, Continuations McMillan ! SF 221 Import As Wouters ! S 222 Web Library Enhancements Kuchling ! SF 223 Change the Meaning of \x Escapes Peters ! SD 224 Attribute Docstrings Lemburg ! SD 225 Elementwise/Objectwise Operators Zhu, Lielens ! I 226 Python 2.1 Release Schedule Hylton ! S 227 Statically Nested Scopes Hylton ! S 228 Reworking Python's Numeric Model Zadka, van Rossum ! S 229 Using Distutils to Build Python Kuchling ! S 230 Warning Framework van Rossum ! SR 231 __findattr__() Warsaw ! SF 232 Function Attributes Warsaw ! SD 233 Python Online Help Prescod ! S 234 Iterators Yee, van Rossum ! SF 235 Import on Case-Insensitive Platforms Peters ! SF 236 Back to the __future__ Peters ! S 237 Unifying Long Integers and Integers Zadka, van Rossum ! S 238 Changing the Division Operator Zadka, van Rossum ! S 239 Adding a Rational Type to Python Zadka ! S 240 Adding a Rational Literal to Python Zadka ! S 241 Metadata for Python Software Packages Kuchling ! S 242 Numeric Kinds Dubois ! S 243 Module Repository Upload Mechanism Reifschneider ! SR 244 The `directive' Statement von Loewis ! S 245 Python Interface Syntax Pelletier ! S 246 Object Adaptation Evans ! I 247 API for Cryptographic Hash Functions Kuchling ! I 248 Python Database API Specification v1.0 Lemburg ! I 249 Python Database API Specification v2.0 Lemburg ! S 250 Using site-packages on All Platforms Moore ! I 251 Python 2.2 Release Schedule van Rossum, Warsaw ! S 252 Making Types Look More Like Classes van Rossum ! S 253 Subtyping Built-in Types van Rossum ! S 254 Making Classes Look More Like Types van Rossum ! S 255 Simple Generators Schemenauer, et al ! S 256 Docstring Processing System Framework Goodger ! S 257 Docstring Conventions Goodger, van Rossum ! S 258 DPS Generic Implementation Details Goodger ! SR 259 Omit printing newline after newline van Rossum ! S 260 Simplify xrange() van Rossum ! S 261 Support for "wide" Unicode characters Prescod ! S 262 Database of Installed Python Packages Kuchling ! S 263 Defining Python Source Code Encodings Lemburg ! S 264 Future statements in simulated shells Hudson From bwarsaw@users.sourceforge.net Tue Aug 14 17:49:00 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 09:49:00 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0001.txt,1.23,1.24 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv7265 Modified Files: pep-0001.txt Log Message: Because of the redesign of PEP 0, titles can now be of a maximum 44 characters in length (up from the previous 38). I think this still gives us plenty of room for the owner fields. Index: pep-0001.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0001.txt,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** pep-0001.txt 2001/08/14 15:45:26 1.23 --- pep-0001.txt 2001/08/14 16:48:57 1.24 *************** *** 130,134 **** 1. Preamble -- RFC822 style headers containing meta-data about the PEP, including the PEP number, a short descriptive title ! (limited to a maximum of 38 characters), the names contact info for each author, etc. --- 130,134 ---- 1. Preamble -- RFC822 style headers containing meta-data about the PEP, including the PEP number, a short descriptive title ! (limited to a maximum of 44 characters), the names contact info for each author, etc. From bwarsaw@users.sourceforge.net Tue Aug 14 18:00:00 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 10:00:00 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0251.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv10365 Modified Files: pep-0251.txt Log Message: update Post-History: Index: pep-0251.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0251.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0251.txt 2001/08/13 21:03:12 1.3 --- pep-0251.txt 2001/08/14 16:59:58 1.4 *************** *** 7,11 **** Created: 17-Apr-2001 Python-Version: 2.2 ! Post-History: Abstract --- 7,11 ---- Created: 17-Apr-2001 Python-Version: 2.2 ! Post-History: 14-Aug-2001 Abstract From lemburg@users.sourceforge.net Tue Aug 14 18:39:07 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Tue, 14 Aug 2001 10:39:07 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0263.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv19937 Modified Files: pep-0263.txt Log Message: Remove references to PEP 244. Index: pep-0263.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0263.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0263.txt 2001/07/18 20:27:09 1.1 --- pep-0263.txt 2001/08/14 17:39:05 1.2 *************** *** 8,12 **** Created: 06-Jun-2001 Post-History: - Requires: 244 Abstract --- 8,11 ---- *************** *** 110,117 **** #!/usr/bin/python #?python encoding = 'utf-8' - - Usage of a new keyword "directive" (see PEP 244) for this purpose - has been proposed, but was put aside due to PEP 244 not being - widely accepted (yet). Scope --- 109,112 ---- From bwarsaw@users.sourceforge.net Tue Aug 14 18:52:08 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 10:52:08 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0232.txt,1.11,1.12 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv23092 Modified Files: pep-0232.txt Log Message: Resolution of SF bug # 446645 changes the semantics for __dict__ when deleting it or getting an attribute before any have been set. Previously, __dict__ could be None or {}, but now it must be a dictionary (can never be None), and del'ing it is illegal. Code changes to be made soon. Index: pep-0232.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0232.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pep-0232.txt 2001/08/14 15:45:26 1.11 --- pep-0232.txt 2001/08/14 17:52:06 1.12 *************** *** 56,63 **** A function object's __dict__ can also be set, but only to a ! dictionary object or None (e.g. setting __dict__ to UserDict ! raises a TypeError). Deleting a function's __dict__ attribute is ! equivalent to setting it to None. If no function attributes have ! ever been set, the function's __dict__ will be None. --- 56,63 ---- A function object's __dict__ can also be set, but only to a ! dictionary object. Deleting a function's __dict__, or setting it ! to anything other than a concrete dictionary object results in a ! TypeError. If no function attributes have ever been set, the ! function's __dict__ will be empty. From gvanrossum@users.sourceforge.net Tue Aug 14 19:12:50 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 14 Aug 2001 11:12:50 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0237.txt,1.6,1.7 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv27605 Modified Files: pep-0237.txt Log Message: Completely revamped. Pick implementation plan 2. Propose to do the easy bit in 2.2, the rest (introducing incompatibilities) in following releases. Index: pep-0237.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0237.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pep-0237.txt 2001/08/01 16:48:28 1.6 --- pep-0237.txt 2001/08/14 18:12:48 1.7 *************** *** 12,41 **** Abstract ! Python has both integers (machine word size integral) types, and ! long integers (unbounded integral) types. When integers ! operations overflow the machine registers, they raise an error. ! This PEP proposes to do away with the distinction, and unify the ! types from the perspective of both the Python interpreter and the ! C API. ! ! Note from second author: this PEP requires more thought about ! implementation details. I've started to make a list of semantic ! differences but I doubt it's complete. Rationale Having the machine word size exposed to the language hinders portability. For examples Python source files and .pyc's are not ! portable between 32-bit and 64-bit machines because of this. Many ! programs find a need to deal with larger numbers after the fact, ! and changing the algorithms later is not only bothersome, but ! hinders performance in the normal case. There is also the general desire to hide unnecessary details from the Python user when they are irrelevant for most applications. ! (Another example is memory allocation, which explicit in C but ! automatic in Python, giving us the convenience of unlimited sizes ! on strings, lists, etc.) It will give new Python programmers (whether they are new to --- 12,42 ---- Abstract ! Python currently distinguishes between two kinds of integers ! (ints): regular or short ints, limited by the size of a C long ! (typically 32 or 64 bits), and long ints, which are limited only ! by available memory. When operations on short ints yield results ! that don't fit in a C long, they raise an error. There are some ! other distinctions too. This PEP proposes to do away with most of ! the differences in semantics, unifying the two types from the ! perspective of the Python user. Rationale + Many programs find a need to deal with larger numbers after the + fact, and changing the algorithms later is bothersome. It can + hinder performance in the normal case, when all arithmetic is + performed using long ints whether or not they are needed. + Having the machine word size exposed to the language hinders portability. For examples Python source files and .pyc's are not ! portable between 32-bit and 64-bit machines because of this. There is also the general desire to hide unnecessary details from the Python user when they are irrelevant for most applications. ! An example is memory allocation, which explicit in C but automatic ! in Python, giving us the convenience of unlimited sizes on ! strings, lists, etc. It makes sense to extend this convenience to ! numbers. It will give new Python programmers (whether they are new to *************** *** 44,75 **** - Transition - - There are three phases of the transition: - - 1. Ints and longs are treated the same, no warnings are issued for - code that uses longs. Warnings for the use of longs (either - long literals, ending in 'L' or 'l', or use of the long() - function) may be enabled through a command line option. - - 2. Longs are treated the same as ints but their use triggers a - warning (which may be turned off or turned into an error using - the -W command line option). - - 3. Long literals and (if we choose implementation plan 1 below) - the long() built-in are no longer legal. - - We propose the following timeline: - - 1. Python 2.2. - - 2. The rest of the Python 2.x line. - - 3. Python 3.0 (at least two years in the future). - - Implementation ! There are two alternative implementations to choose from. 1. The PyInt type's slot for a C long will be turned into a --- 45,52 ---- Implementation ! Initially, two alternative implementations were proposed (one by ! each autor): 1. The PyInt type's slot for a C long will be turned into a *************** *** 83,90 **** }; ! Only the n-1 lower bits of the long have any meaning; the top bit ! is always set. This distinguishes the union. All PyInt functions ! will check this bit before deciding which types of operations to ! use. 2. The existing short and long int types remain, but the short int --- 60,67 ---- }; ! Only the n-1 lower bits of the long have any meaning; the top ! bit is always set. This distinguishes the union. All PyInt ! functions will check this bit before deciding which types of ! operations to use. 2. The existing short and long int types remain, but the short int *************** *** 98,225 **** if isinstance(i, integer): ... - Literals ! A trailing 'L' at the end of an integer literal will stop having ! any meaning, and will be eventually phased out. ! Built-in Functions ! The function long() will call the function int(). If ! implementation plan 1 is chosen, it will eventually be phased out; ! with implementation plan 2, it remains in the language to ! represent the long implementation type -- but the int() function ! is still recommended, since it will automatically return a long ! when needed. ! C API ! If implementation plan 1 is chosen, all PyLong_As* will call ! PyInt_As*. If PyInt_As* does not exist, it will be added. ! Similarly for PyLong_From*. A similar path of warnings as for the ! Python built-ins will be followed. ! If implementation plan 2 is chosen, the C API remains unchanged. - (The PyArg_Parse*() APIs already accept long ints, as long as they - are within the range representable by C ints or longs. This will - remain unchanged.) ! Overflows - When an arithmetic operation on two numbers whose internal - representation is as machine-level integers returns something - whose internal representation is a bignum, a warning which is - turned off by default will be issued. This is only a debugging - aid, and has no guaranteed semantics. ! A command line option may be used to enable these warnings (the ! regular warning framework supports warnings that are off by ! default, but this is be too slow -- it makes a call to an ! complex piece of Python code). ! This warning is not part of the transition plan; it will always be ! off by default, and the feature will probably disappear in Python ! 3.0. ! Semantic Changes ! The following operations have (usually subtly) different semantics ! for short and for long integers, and one will have to change ! somehow. This is intended to be an exhaustive list; if you know ! of anything else that might change, please write the author. ! - Currently, all arithmetic operators on short ints except << ! raise OverflowError if the result cannot be represented as a ! short int. This will change (of course). - - Currently x< Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv27911 Modified Files: pep-0237.txt Log Message: Update post history. Index: pep-0237.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0237.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pep-0237.txt 2001/08/14 18:12:48 1.7 --- pep-0237.txt 2001/08/14 18:13:50 1.8 *************** *** 7,11 **** Created: 11-Mar-2001 Python-Version: 2.2 ! Post-History: 16-Mar-2001 --- 7,11 ---- Created: 11-Mar-2001 Python-Version: 2.2 ! Post-History: 16-Mar-2001, 14-Aug-2001 From bwarsaw@users.sourceforge.net Tue Aug 14 19:22:26 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 11:22:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libstdtypes.tex,1.66,1.67 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv30178 Modified Files: libstdtypes.tex Log Message: Describe the new semantics for setting and deleting a function's __dict__ attribute. Deleting it, or setting it to a non-dictionary result in a TypeError. Note that getting it the first time magically initializes it to an empty dict so that func.__dict__ will always appear to be a dictionary (never None). Closes SF bug #446645. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** libstdtypes.tex 2001/07/26 21:01:21 1.66 --- libstdtypes.tex 2001/08/14 18:22:24 1.67 *************** *** 1048,1064 **** Regular attribute dot-notation is used to get and set such attributes. \emph{Note that the current implementation only supports ! function attributes on functions written in Python. Function ! attributes on built-ins may be supported in the future.} Functions have another special attribute \code{\var{f}.__dict__} (a.k.a. \code{\var{f}.func_dict}) which contains the namespace used to ! support function attributes. \code{__dict__} can be accessed ! directly, set to a dictionary object, or \code{None}. It can also be ! deleted (but the following two lines are equivalent): ! ! \begin{verbatim} ! del func.__dict__ ! func.__dict__ = None ! \end{verbatim} \subsubsection{Methods \label{typesmethods}} --- 1048,1059 ---- Regular attribute dot-notation is used to get and set such attributes. \emph{Note that the current implementation only supports ! function attributes on user-defined functions. Function attributes on ! built-in functions may be supported in the future.} Functions have another special attribute \code{\var{f}.__dict__} (a.k.a. \code{\var{f}.func_dict}) which contains the namespace used to ! support function attributes. \code{__dict__} and \code{func_dict} can ! be accessed directly or set to a dictionary object. A function's ! dictionary cannot be deleted. \subsubsection{Methods \label{typesmethods}} From bwarsaw@users.sourceforge.net Tue Aug 14 19:24:00 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 11:24:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects funcobject.c,2.39,2.40 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv30602 Modified Files: funcobject.c Log Message: func_getattro(), func_setattro(): Implement the new semantics for setting and deleting a function's __dict__ attribute. Deleting it, or setting it to a non-dictionary result in a TypeError. Note that getting it the first time magically initializes it to an empty dict so that func.__dict__ will always appear to be a dictionary (never None). Closes SF bug #446645. Index: funcobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/funcobject.c,v retrieving revision 2.39 retrieving revision 2.40 diff -C2 -d -r2.39 -r2.40 *** funcobject.c 2001/08/02 04:15:00 2.39 --- funcobject.c 2001/08/14 18:23:58 2.40 *************** *** 152,156 **** return NULL; } ! return PyObject_GenericGetAttr(op, name); } --- 152,167 ---- return NULL; } ! /* If func_dict is being accessed but no attribute has been set ! * yet, then initialize it to the empty dictionary. ! */ ! if ((!strcmp(sname, "func_dict") || !strcmp(sname, "__dict__")) ! && ((PyFunctionObject*)op)->func_dict == NULL) ! { ! PyFunctionObject* funcop = (PyFunctionObject*)op; ! ! funcop->func_dict = PyDict_New(); ! if (funcop->func_dict == NULL) ! return NULL; ! } return PyObject_GenericGetAttr(op, name); } *************** *** 191,207 **** } else if (!strcmp(sname, "func_dict") || !strcmp(sname, "__dict__")) { ! /* legal to del f.func_dict. Can only set func_dict to ! * NULL or a dictionary. */ ! if (value == Py_None) ! value = NULL; ! if (value != NULL && !PyDict_Check(value)) { PyErr_SetString( PyExc_TypeError, ! "func_dict must be set to a dict object"); return -1; } } - return PyObject_GenericSetAttr(op, name, value); } --- 202,221 ---- } else if (!strcmp(sname, "func_dict") || !strcmp(sname, "__dict__")) { ! /* It is illegal to del f.func_dict. Can only set ! * func_dict to a dictionary. */ ! if (value == NULL) { PyErr_SetString( PyExc_TypeError, ! "function's dictionary may not be deleted"); return -1; } + if (!PyDict_Check(value)) { + PyErr_SetString( + PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } } return PyObject_GenericSetAttr(op, name, value); } From bwarsaw@users.sourceforge.net Tue Aug 14 19:28:30 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 11:28:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_funcattrs.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv31505 Modified Files: test_funcattrs.py Log Message: Test the new semantics for setting and deleting a function's __dict__ attribute. Deleting it, or setting it to a non-dictionary result in a TypeError. Note that getting it the first time magically initializes it to an empty dict so that func.__dict__ will always appear to be a dictionary (never None). Closes SF bug #446645. Index: test_funcattrs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_funcattrs.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_funcattrs.py 2001/02/26 18:07:26 1.6 --- test_funcattrs.py 2001/08/14 18:28:28 1.7 *************** *** 12,22 **** try: b.publish ! except AttributeError: ! pass ! else: ! raise TestFailed, 'expected AttributeError' ! if b.__dict__ <> None: ! raise TestFailed, 'expected unassigned func.__dict__ to be None' b.publish = 1 --- 12,20 ---- try: b.publish ! except AttributeError: pass ! else: raise TestFailed, 'expected AttributeError' ! if b.__dict__ <> {}: ! raise TestFailed, 'expected unassigned func.__dict__ to be {}' b.publish = 1 *************** *** 32,44 **** raise TestFailed, 'attribute not in dir()' ! del b.__dict__ ! if b.__dict__ <> None: ! raise TestFailed, 'del func.__dict__ did not result in __dict__ == None' b.publish = 1 ! b.__dict__ = None ! if b.__dict__ <> None: ! raise TestFailed, 'func.__dict__ = None did not result in __dict__ == None' f1 = F() --- 30,50 ---- raise TestFailed, 'attribute not in dir()' ! try: ! del b.__dict__ ! except TypeError: pass ! else: raise TestFailed, 'del func.__dict__ expected TypeError' b.publish = 1 ! try: ! b.__dict__ = None ! except TypeError: pass ! else: raise TestFailed, 'func.__dict__ = None expected TypeError' + d = {'hello': 'world'} + b.__dict__ = d + if b.func_dict is not d: + raise TestFailed, 'func.__dict__ assignment to dictionary failed' + if b.hello <> 'world': + raise TestFailed, 'attribute after func.__dict__ assignment failed' f1 = F() *************** *** 47,61 **** try: F.a.publish ! except AttributeError: ! pass ! else: ! raise TestFailed, 'expected AttributeError' try: f1.a.publish ! except AttributeError: ! pass ! else: ! raise TestFailed, 'expected AttributeError' # In Python 2.1 beta 1, we disallowed setting attributes on unbound methods --- 53,63 ---- try: F.a.publish ! except AttributeError: pass ! else: raise TestFailed, 'expected AttributeError' try: f1.a.publish ! except AttributeError: pass ! else: raise TestFailed, 'expected AttributeError' # In Python 2.1 beta 1, we disallowed setting attributes on unbound methods *************** *** 63,70 **** try: F.a.publish = 1 ! except TypeError: ! pass ! else: ! raise TestFailed, 'expected TypeError' # But setting it explicitly on the underlying function object is okay. --- 65,70 ---- try: F.a.publish = 1 ! except TypeError: pass ! else: raise TestFailed, 'expected TypeError' # But setting it explicitly on the underlying function object is okay. *************** *** 85,100 **** try: f1.a.publish = 0 ! except TypeError: ! pass ! else: ! raise TestFailed, 'expected TypeError' # See the comment above about the change in semantics for Python 2.1b1 try: F.a.myclass = F ! except TypeError: ! pass ! else: ! raise TestFailed, 'expected TypeError' F.a.im_func.myclass = F --- 85,96 ---- try: f1.a.publish = 0 ! except TypeError: pass ! else: raise TestFailed, 'expected TypeError' # See the comment above about the change in semantics for Python 2.1b1 try: F.a.myclass = F ! except TypeError: pass ! else: raise TestFailed, 'expected TypeError' F.a.im_func.myclass = F *************** *** 106,110 **** if f1.a.myclass is not f2.a.myclass or \ ! f1.a.myclass is not F.a.myclass: raise TestFailed, 'attributes were not the same' --- 102,106 ---- if f1.a.myclass is not f2.a.myclass or \ ! f1.a.myclass is not F.a.myclass: raise TestFailed, 'attributes were not the same' *************** *** 112,119 **** try: F.a.__dict__ = (1, 2, 3) ! except TypeError: ! pass ! else: ! raise TestFailed, 'expected TypeError' F.a.im_func.__dict__ = {'one': 11, 'two': 22, 'three': 33} --- 108,113 ---- try: F.a.__dict__ = (1, 2, 3) ! except TypeError: pass ! else: raise TestFailed, 'expected TypeError' F.a.im_func.__dict__ = {'one': 11, 'two': 22, 'three': 33} *************** *** 127,134 **** try: F.a.__dict__ = d ! except TypeError: ! pass ! else: ! raise TestFailed if f2.a.one <> f1.a.one <> F.a.one <> 11: --- 121,126 ---- try: F.a.__dict__ = d ! except TypeError: pass ! else: raise TestFailed if f2.a.one <> f1.a.one <> F.a.one <> 11: *************** *** 176,184 **** def another(): pass - del another.__dict__ - del another.func_dict - another.func_dict = None try: del another.bar except AttributeError: pass --- 168,188 ---- def another(): pass try: + del another.__dict__ + except TypeError: pass + else: raise TestFailed + + try: + del another.func_dict + except TypeError: pass + else: raise TestFailed + + try: + another.func_dict = None + except TypeError: pass + else: raise TestFailed + + try: del another.bar except AttributeError: pass *************** *** 198,202 **** print 1 ! if foo==bar: raise TestFailed d={} --- 202,207 ---- print 1 ! if foo==bar: ! raise TestFailed d={} From bwarsaw@users.sourceforge.net Tue Aug 14 19:35:04 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 11:35:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.202,1.203 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv706 Modified Files: NEWS Log Message: Document the new semantics for setting and deleting a function's __dict__ attribute. Deleting it, or setting it to a non-dictionary result in a TypeError. Note that getting it the first time magically initializes it to an empty dict so that func.__dict__ will always appear to be a dictionary (never None). Closes SF bug #446645. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.202 retrieving revision 1.203 diff -C2 -d -r1.202 -r1.203 *** NEWS 2001/08/12 22:25:01 1.202 --- NEWS 2001/08/14 18:35:02 1.203 *************** *** 16,19 **** --- 16,25 ---- write filters for these warnings). + - A function's __dict__ (aka func_dict) will now always be a + dictionary. It used to be possible to delete it or set it to None, + but now both actions raise TypeErrors. It is still legal to set it + to a dictionary object. Getting func.__dict__ before any attributes + have been assigned now returns an empty dictionary instead of None. + Library From gvanrossum@users.sourceforge.net Tue Aug 14 19:37:47 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 14 Aug 2001 11:37:47 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0237.txt,1.8,1.9 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv1363 Modified Files: pep-0237.txt Log Message: Add an example. Index: pep-0237.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0237.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pep-0237.txt 2001/08/14 18:13:50 1.8 --- pep-0237.txt 2001/08/14 18:37:44 1.9 *************** *** 206,209 **** --- 206,233 ---- + Example + + If you pass a long int to a C function or built-in operation that + takes an integer, it will be treated the same as as a short int as + long as the value fits (by virtue of how PyArg_ParseTuple() is + implemented). If the long value doesn't fit, it will still raise + an OverflowError. For example: + + def fact(n): + if n <= 1: + return 1 + return n*fact(n-1) + + A = "ABCDEFGHIJKLMNOPQ" + n = input("Gimme an int: ") + print A[fact(n)%17] + + For n >= 13, this currently raises OverflowError (unless the user + enters a trailing 'L' as part of their input), even though the + calculated index would always be in range(17). With the new + approach this code will do the right thing: the index will be + calculated as a long int, but its value will be in range. + + Open Issues From bwarsaw@users.sourceforge.net Tue Aug 14 19:43:08 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 11:43:08 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0202.txt,1.6,1.7 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv2465 Modified Files: pep-0202.txt Log Message: We have assumed control, we have assumed control, we have assumed control. Clean this PEP up to reflect current reality, and mark it Final. Index: pep-0202.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0202.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pep-0202.txt 2000/10/30 20:48:44 1.6 --- pep-0202.txt 2001/08/14 18:43:06 1.7 *************** *** 2,7 **** Title: List Comprehensions Version: $Revision$ ! Author: tim@digicool.com (Tim Peters) ! Status: Draft Type: Standards Track Python-Version: 2.0 --- 2,7 ---- Title: List Comprehensions Version: $Revision$ ! Author: barry@zope.com (Barry Warsaw) ! Status: Final Type: Standards Track Python-Version: 2.0 *************** *** 52,58 **** >>> print [(i,f) for i in nums for f in fruit if f[0] == "P" if i%2 == 1] [(1, 'Peaches'), (1, 'Pears'), (3, 'Peaches'), (3, 'Pears')] - >>> def zip(*args): - ... return apply(map, (None,)+args) - ... >>> print [i for i in zip(nums,fruit) if i[0]%2==0] [(2, 'Peaches'), (4, 'Bananas')] --- 52,55 ---- *************** *** 61,76 **** Reference Implementation ! SourceForge contains a patch that adds list comprehensions to Python[1]. BDFL Pronouncements - Note: the BDFL refers to Guido van Rossum, Python's Benevolent - Dictator For Life. - - The syntax proposed above is the Right One. ! - The form [x, y for ...] should be disallowed; one should be ! required to write [(x, y) for ...]. - The form [... for x... for y...] nests, with the last index --- 58,71 ---- Reference Implementation ! List comprehensions become part of the Python language with ! release 2.0, documented in [1]. BDFL Pronouncements - The syntax proposed above is the Right One. ! - The form [x, y for ...] is disallowed; one is required to write ! [(x, y) for ...]. - The form [... for x... for y...] nests, with the last index *************** *** 78,135 **** - Open Issues - - Syntax - - Several people proposed connecting or separating syntax - between the various clauses, for example, requiring a - semicolon between them to set them apart: - - [i,f; for i in nums; for f in fruit; if f[0]=="P"; if i%2==1] - - To minimize strain on the Python parser, Guido has suggested - requiring parentheses around the initial tuple: - - [(i,f) for i in nums for f in fruit if f[0]=="P" if i%2==1] - - Semantics - - The semantics of multiple for clauses is not obvious to many - people. Currently, it nests, so that - - [i,f for i in nums for f in fruit] - - is functionally equivalent to - - tmp = [] - for i in nums: - for f in fruit: - tmp.append((i,f)) - - Other people would read it as if it executed - - map(None, nums, fruit) - - It's not clear that this is necessary. The newly proposed - zip() builtin[2] takes care of that case. - - Stability of the Implementation - - The current reference implementation is simply an adaptation - of Greg Ewing's original demonstration of the concept. Other - than tracking changes to the source code to keep it a valid - patch, reindenting the code and switching to function - prototypes, nothing has been done to it. This obviously - raises some questions about how stable the code is. It has - not had a lot of exercise, though the patch does include a few - test cases. - - References ! [1] https://sourceforge.net/patch/?func=detailpatch&patch_id=100654&group_id=5470 ! [2] Lockstep Iteration, pep-0201.txt Local Variables: mode: indented-text --- 73,82 ---- References ! [1] http://www.python.org/doc/current/ref/lists.html#l2h-238 + Local Variables: mode: indented-text From bwarsaw@users.sourceforge.net Tue Aug 14 19:43:50 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 11:43:50 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.118,1.119 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv2631 Modified Files: pep-0000.txt Log Message: PEP 202, List comprehensions is now marked complete. Change the owner to Barry. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** pep-0000.txt 2001/08/14 16:46:57 1.118 --- pep-0000.txt 2001/08/14 18:43:47 1.119 *************** *** 87,91 **** IF 200 Python 2.0 Release Schedule Hylton SF 201 Lockstep Iteration Warsaw ! S 202 List Comprehensions Peters SF 203 Augmented Assignments Wouters S 205 Weak References Drake --- 87,91 ---- IF 200 Python 2.0 Release Schedule Hylton SF 201 Lockstep Iteration Warsaw ! SF 202 List Comprehensions Warsaw SF 203 Augmented Assignments Wouters S 205 Weak References Drake *************** *** 144,148 **** IF 200 Python 2.0 Release Schedule Hylton SF 201 Lockstep Iteration Warsaw ! S 202 List Comprehensions Peters SF 203 Augmented Assignments Wouters SR 204 Range Literals Wouters --- 144,148 ---- IF 200 Python 2.0 Release Schedule Hylton SF 201 Lockstep Iteration Warsaw ! SF 202 List Comprehensions Warsaw SF 203 Augmented Assignments Wouters SR 204 Range Literals Wouters From jhylton@users.sourceforge.net Tue Aug 14 19:57:45 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 14 Aug 2001 11:57:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler ast.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv5902/compiler Modified Files: ast.txt Log Message: Add Yield node Index: ast.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/ast.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ast.txt 2000/10/25 17:59:17 1.1 --- ast.txt 2001/08/14 18:57:43 1.2 *************** *** 17,20 **** --- 17,21 ---- TryExcept: body, handlers, else_ Return: value + Yield: value Const: value Print: nodes, dest From jhylton@users.sourceforge.net Tue Aug 14 19:58:03 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 14 Aug 2001 11:58:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler astgen.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv5992/compiler Modified Files: astgen.py Log Message: Add getChildNodes() method to Node Index: astgen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/astgen.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** astgen.py 2000/10/25 17:59:17 1.1 --- astgen.py 2001/08/14 18:58:00 1.2 *************** *** 172,175 **** --- 172,177 ---- def asList(self): return tuple(asList(self.getChildren())) + def getChildNodes(self): + return [n for n in self.getChildnre() if isinstance(n, Node)] class EmptyNode(Node): From jhylton@users.sourceforge.net Tue Aug 14 19:59:03 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 14 Aug 2001 11:59:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler ast.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv6196/compiler Modified Files: ast.py Log Message: Regenerated from new ast.txt and new astgen.py Index: ast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/ast.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ast.py 2000/10/25 18:02:59 1.11 --- ast.py 2001/08/14 18:59:01 1.12 *************** *** 41,44 **** --- 41,46 ---- def asList(self): return tuple(asList(self.getChildren())) + def getChildNodes(self): + return [n for n in self.getChildnre() if isinstance(n, Node)] class EmptyNode(Node): *************** *** 288,291 **** --- 290,302 ---- return "Mul(%s, %s)" % (repr(self.left), repr(self.right)) + class Yield(Node): + nodes["yield"] = "Yield" + def __init__(self, value): + self.value = value + def _getChildren(self): + return self.value, + def __repr__(self): + return "Yield(%s)" % (repr(self.value),) + class List(Node): nodes["list"] = "List" *************** *** 455,466 **** return "Power(%s, %s)" % (repr(self.left), repr(self.right)) ! class Import(Node): ! nodes["import"] = "Import" ! def __init__(self, names): ! self.names = names def _getChildren(self): ! return self.names, def __repr__(self): ! return "Import(%s)" % (repr(self.names),) class Return(Node): --- 466,477 ---- return "Power(%s, %s)" % (repr(self.left), repr(self.right)) ! class Ellipsis(Node): ! nodes["ellipsis"] = "Ellipsis" ! def __init__(self, ): ! pass def _getChildren(self): ! return () def __repr__(self): ! return "Ellipsis()" class Return(Node): *************** *** 526,537 **** return "Subscript(%s, %s, %s)" % (repr(self.expr), repr(self.flags), repr(self.subs)) ! class Ellipsis(Node): ! nodes["ellipsis"] = "Ellipsis" ! def __init__(self, ): ! pass def _getChildren(self): ! return () def __repr__(self): ! return "Ellipsis()" class Print(Node): --- 537,548 ---- return "Subscript(%s, %s, %s)" % (repr(self.expr), repr(self.flags), repr(self.subs)) ! class Import(Node): ! nodes["import"] = "Import" ! def __init__(self, names): ! self.names = names def _getChildren(self): ! return self.names, def __repr__(self): ! return "Import(%s)" % (repr(self.names),) class Print(Node): From bwarsaw@users.sourceforge.net Tue Aug 14 20:16:33 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 12:16:33 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0260.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv10954 Modified Files: pep-0260.txt Log Message: Guido says this PEP is Final. Index: pep-0260.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0260.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0260.txt 2001/08/01 18:25:51 1.3 --- pep-0260.txt 2001/08/14 19:16:31 1.4 *************** *** 3,7 **** Version: $Revision$ Author: guido@python.org (Guido van Rossum) ! Status: Draft Type: Standards Track Python-Version: 2.2 --- 3,7 ---- Version: $Revision$ Author: guido@python.org (Guido van Rossum) ! Status: Final Type: Standards Track Python-Version: 2.2 From bwarsaw@users.sourceforge.net Tue Aug 14 20:16:51 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 12:16:51 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.119,1.120 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv11034 Modified Files: pep-0000.txt Log Message: Mark PEP 260 as Final. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** pep-0000.txt 2001/08/14 18:43:47 1.119 --- pep-0000.txt 2001/08/14 19:16:49 1.120 *************** *** 105,109 **** SF 236 Back to the __future__ Peters S 255 Simple Generators Schemenauer, et al ! S 260 Simplify xrange() van Rossum S 261 Support for "wide" Unicode characters Prescod --- 105,109 ---- SF 236 Back to the __future__ Peters S 255 Simple Generators Schemenauer, et al ! SF 260 Simplify xrange() van Rossum S 261 Support for "wide" Unicode characters Prescod *************** *** 202,206 **** S 258 DPS Generic Implementation Details Goodger SR 259 Omit printing newline after newline van Rossum ! S 260 Simplify xrange() van Rossum S 261 Support for "wide" Unicode characters Prescod S 262 Database of Installed Python Packages Kuchling --- 202,206 ---- S 258 DPS Generic Implementation Details Goodger SR 259 Omit printing newline after newline van Rossum ! SF 260 Simplify xrange() van Rossum S 261 Support for "wide" Unicode characters Prescod S 262 Database of Installed Python Packages Kuchling From bwarsaw@users.sourceforge.net Tue Aug 14 20:30:18 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 12:30:18 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0237.txt,1.9,1.10 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv15027 Modified Files: pep-0237.txt Log Message: Fix some minor typos. Index: pep-0237.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0237.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pep-0237.txt 2001/08/14 18:37:44 1.9 --- pep-0237.txt 2001/08/14 19:30:15 1.10 *************** *** 35,42 **** There is also the general desire to hide unnecessary details from the Python user when they are irrelevant for most applications. ! An example is memory allocation, which explicit in C but automatic ! in Python, giving us the convenience of unlimited sizes on ! strings, lists, etc. It makes sense to extend this convenience to ! numbers. It will give new Python programmers (whether they are new to --- 35,42 ---- There is also the general desire to hide unnecessary details from the Python user when they are irrelevant for most applications. ! An example is memory allocation, which is explicit in C but ! automatic in Python, giving us the convenience of unlimited sizes ! on strings, lists, etc. It makes sense to extend this convenience ! to numbers. It will give new Python programmers (whether they are new to *************** *** 48,52 **** Initially, two alternative implementations were proposed (one by ! each autor): 1. The PyInt type's slot for a C long will be turned into a --- 48,52 ---- Initially, two alternative implementations were proposed (one by ! each author): 1. The PyInt type's slot for a C long will be turned into a *************** *** 65,70 **** operations to use. ! 2. The existing short and long int types remain, but the short int ! returns a long int instead of raising OverflowError when a result cannot be represented as a short int. A new type, integer, may be introduced that is an abstract base type of --- 65,70 ---- operations to use. ! 2. The existing short and long int types remain, but operations ! return a long int instead of raising OverflowError when a result cannot be represented as a short int. A new type, integer, may be introduced that is an abstract base type of *************** *** 240,244 **** still relevant (e.g. when inspecting the type of a value). ! - Should be remove '%u' completely? Remove it. - Should we warn about << not truncating integers? Yes. --- 240,244 ---- still relevant (e.g. when inspecting the type of a value). ! - Should we remove '%u' completely? Remove it. - Should we warn about << not truncating integers? Yes. From fdrake@users.sourceforge.net Tue Aug 14 20:55:44 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 14 Aug 2001 12:55:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/tut tut.tex,1.146,1.147 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv22537/tut Modified Files: tut.tex Log Message: Clarify the prompt in an example. This closes SF bug #450633. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** tut.tex 2001/08/01 17:17:13 1.146 --- tut.tex 2001/08/14 19:55:42 1.147 *************** *** 1043,1047 **** \begin{verbatim} ! >>> x = int(raw_input("Please enter a number: ")) >>> if x < 0: ... x = 0 --- 1043,1047 ---- \begin{verbatim} ! >>> x = int(raw_input("Please enter an integer: ")) >>> if x < 0: ... x = 0 From gvanrossum@users.sourceforge.net Tue Aug 14 21:00:35 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 14 Aug 2001 13:00:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv23792 Modified Files: test_descr.py Log Message: Add a test for a weird bug I just discovered: a dynamic subclass doesn't have a __dict__! Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_descr.py 2001/08/12 05:24:18 1.8 --- test_descr.py 2001/08/14 20:00:33 1.9 *************** *** 614,617 **** --- 614,622 ---- verify(0, "expected AttributeError") verify(a.spam == "spam") + class D(C): + pass + d = D() + d.foo = 1 + verify(d.foo == 1) def errors(): From jhylton@users.sourceforge.net Tue Aug 14 21:02:01 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 14 Aug 2001 13:02:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.216,2.217 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv24143 Modified Files: compile.c Log Message: Fix SF bug [ #450909 ] __future__.division fails at prompt When code is compiled and compiler flags are passed in, be sure to update cf_flags with any features defined by future statements in the compiled code. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.216 retrieving revision 2.217 diff -C2 -d -r2.216 -r2.217 *** compile.c 2001/08/12 01:54:38 2.216 --- compile.c 2001/08/14 20:01:59 2.217 *************** *** 4028,4033 **** return NULL; } ! if (flags) ! sc.c_future->ff_features |= flags->cf_flags; if (symtable_build(&sc, n) < 0) { com_free(&sc); --- 4028,4037 ---- return NULL; } ! if (flags) { ! int merged = sc.c_future->ff_features | ! flags->cf_flags; ! sc.c_future->ff_features = merged; ! flags->cf_flags = merged; ! } if (symtable_build(&sc, n) < 0) { com_free(&sc); From gvanrossum@users.sourceforge.net Tue Aug 14 21:04:51 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 14 Aug 2001 13:04:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.31,2.32 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv25069 Modified Files: typeobject.c Log Message: Non-function fields, like tp_dictoffset and tp_weaklistoffset, should be inherited in inherit_special(), otherwise dynamic types don't inherit these. Also added some XXX comments about open ends. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.31 retrieving revision 2.32 diff -C2 -d -r2.31 -r2.32 *** typeobject.c 2001/08/12 05:17:56 2.31 --- typeobject.c 2001/08/14 20:04:48 2.32 *************** *** 853,856 **** --- 853,857 ---- #if 0 + /* XXX These should be made smarter before they can be used */ static PyObject * object_repr(PyObject *self) *************** *** 1037,1040 **** --- 1038,1055 ---- } PyType_SET_BASICSIZE(type, newsize); + + /* Copy other non-function slots */ + + #undef COPYVAL + #define COPYVAL(SLOT) \ + if (type->SLOT == 0) type->SLOT = base->SLOT + + COPYVAL(tp_itemsize); + if (type->tp_flags & base->tp_flags & Py_TPFLAGS_HAVE_WEAKREFS) { + COPYVAL(tp_weaklistoffset); + } + if (type->tp_flags & base->tp_flags & Py_TPFLAGS_HAVE_CLASS) { + COPYVAL(tp_dictoffset); + } } *************** *** 1137,1141 **** basebase = base->tp_base; - COPYSLOT(tp_itemsize); COPYSLOT(tp_dealloc); COPYSLOT(tp_print); --- 1152,1155 ---- *************** *** 1154,1158 **** COPYSLOT(tp_str); COPYSLOT(tp_as_buffer); - COPYSLOT(tp_flags); if (type->tp_flags & base->tp_flags & Py_TPFLAGS_HAVE_RICHCOMPARE) { if (type->tp_compare == NULL && type->tp_richcompare == NULL) { --- 1168,1171 ---- *************** *** 1164,1170 **** COPYSLOT(tp_compare); } - if (type->tp_flags & base->tp_flags & Py_TPFLAGS_HAVE_WEAKREFS) { - COPYSLOT(tp_weaklistoffset); - } if (type->tp_flags & base->tp_flags & Py_TPFLAGS_HAVE_ITER) { COPYSLOT(tp_iter); --- 1177,1180 ---- *************** *** 2245,2248 **** --- 2255,2260 ---- slot_nb_nonzero(PyObject *self) { + /* XXX This should cope with a missing __nonzero__ */ + /* XXX Should it also look for __len__? */ PyObject *res = PyObject_CallMethod(self, "__nonzero__", ""); *************** *** 2284,2287 **** --- 2296,2300 ---- slot_tp_compare(PyObject *self, PyObject *other) { + /* XXX Should this cope with a missing __cmp__? */ PyObject *res = PyObject_CallMethod(self, "__cmp__", "O", other); long r; *************** *** 2294,2297 **** --- 2307,2311 ---- } + /* XXX This should cope with a missing __repr__, and also look for __str__ */ SLOT0(slot_tp_repr, "__repr__") *************** *** 2299,2302 **** --- 2313,2317 ---- slot_tp_hash(PyObject *self) { + /* XXX This should cope with a missing __hash__ */ PyObject *res = PyObject_CallMethod(self, "__hash__", ""); long h; *************** *** 2323,2326 **** --- 2338,2342 ---- } + /* XXX This should cope with a missing __str__, and also look for __repr__ */ SLOT0(slot_tp_str, "__str__") *************** *** 2372,2375 **** --- 2388,2392 ---- slot_tp_richcompare(PyObject *self, PyObject *other, int op) { + /* XXX How should this cope with missing __xx__? */ PyObject *meth = PyObject_GetAttrString(self, name_op[op]); PyObject *res; From fdrake@users.sourceforge.net Tue Aug 14 21:28:10 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 14 Aug 2001 13:28:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref3.tex,1.71,1.72 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv31630/ref Modified Files: ref3.tex Log Message: Add information about __floordiv__() and __truediv__() methods for implementing numeric objects in Python. Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** ref3.tex 2001/08/02 21:34:53 1.71 --- ref3.tex 2001/08/14 20:28:08 1.72 *************** *** 1331,1335 **** \methodline[numeric object]{__sub__}{self, other} \methodline[numeric object]{__mul__}{self, other} ! \methodline[numeric object]{__div__}{self, other} \methodline[numeric object]{__mod__}{self, other} \methodline[numeric object]{__divmod__}{self, other} --- 1331,1335 ---- \methodline[numeric object]{__sub__}{self, other} \methodline[numeric object]{__mul__}{self, other} ! \methodline[numeric object]{__floordiv__}{self, other} \methodline[numeric object]{__mod__}{self, other} \methodline[numeric object]{__divmod__}{self, other} *************** *** 1340,1346 **** \methodline[numeric object]{__xor__}{self, other} \methodline[numeric object]{__or__}{self, other} ! These functions are called to implement the binary arithmetic operations (\code{+}, ! \code{-}, \code{*}, \code{/}, \code{\%}, \function{divmod()}\bifuncindex{divmod}, \function{pow()}\bifuncindex{pow}, \code{**}, \code{<}\code{<}, --- 1340,1346 ---- \methodline[numeric object]{__xor__}{self, other} \methodline[numeric object]{__or__}{self, other} ! These methods are called to implement the binary arithmetic operations (\code{+}, ! \code{-}, \code{*}, \code{//}, \code{\%}, \function{divmod()}\bifuncindex{divmod}, \function{pow()}\bifuncindex{pow}, \code{**}, \code{<}\code{<}, *************** *** 1348,1352 **** evaluate the expression \var{x}\code{+}\var{y}, where \var{x} is an instance of a class that has an \method{__add__()} method, ! \code{\var{x}.__add__(\var{y})} is called. Note that \method{__pow__()} should be defined to accept an optional third argument if the ternary version of the built-in --- 1348,1355 ---- evaluate the expression \var{x}\code{+}\var{y}, where \var{x} is an instance of a class that has an \method{__add__()} method, ! \code{\var{x}.__add__(\var{y})} is called. The \method{__divmod__()} ! method should be the equivalent to using \method{__floordiv__()} and ! \method{__mod__()}; it should not be related to \method{__truediv__()} ! (described below). Note that \method{__pow__()} should be defined to accept an optional third argument if the ternary version of the built-in *************** *** 1354,1357 **** --- 1357,1369 ---- \end{methoddesc} + \begin{methoddesc}[numeric object]{__div__}{self, other} + \methodline[numeric object]{__truediv__}{self, other} + The division operator (\code{/}) is implemented by these methods. The + \method{__truediv__()} method is used when \code{__future__.division} + is in effect, otherwise \method{__div__()} is used. If only one of + these two methods is defined, the object will not support division in + the alternate context; \exception{TypeError} will be raised instead. + \end{methoddesc} + \begin{methoddesc}[numeric object]{__radd__}{self, other} \methodline[numeric object]{__rsub__}{self, other} *************** *** 1366,1370 **** \methodline[numeric object]{__rxor__}{self, other} \methodline[numeric object]{__ror__}{self, other} ! These functions are called to implement the binary arithmetic operations (\code{+}, \code{-}, \code{*}, \code{/}, \code{\%}, --- 1378,1382 ---- \methodline[numeric object]{__rxor__}{self, other} \methodline[numeric object]{__ror__}{self, other} ! These methods are called to implement the binary arithmetic operations (\code{+}, \code{-}, \code{*}, \code{/}, \code{\%}, From jhylton@users.sourceforge.net Tue Aug 14 22:18:33 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 14 Aug 2001 14:18:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler ast.py,1.12,1.13 astgen.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv13535 Modified Files: ast.py astgen.py Log Message: Fix typo in astgen script Index: ast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/ast.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ast.py 2001/08/14 18:59:01 1.12 --- ast.py 2001/08/14 21:18:30 1.13 *************** *** 42,46 **** return tuple(asList(self.getChildren())) def getChildNodes(self): ! return [n for n in self.getChildnre() if isinstance(n, Node)] class EmptyNode(Node): --- 42,46 ---- return tuple(asList(self.getChildren())) def getChildNodes(self): ! return [n for n in self.getChildren() if isinstance(n, Node)] class EmptyNode(Node): Index: astgen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/astgen.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** astgen.py 2001/08/14 18:58:00 1.2 --- astgen.py 2001/08/14 21:18:30 1.3 *************** *** 173,177 **** return tuple(asList(self.getChildren())) def getChildNodes(self): ! return [n for n in self.getChildnre() if isinstance(n, Node)] class EmptyNode(Node): --- 173,177 ---- return tuple(asList(self.getChildren())) def getChildNodes(self): ! return [n for n in self.getChildren() if isinstance(n, Node)] class EmptyNode(Node): From fdrake@users.sourceforge.net Tue Aug 14 22:36:21 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 14 Aug 2001 14:36:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/doc doc.tex,1.49,1.50 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory usw-pr-cvs1:/tmp/cvs-serv20727/doc Modified Files: doc.tex Log Message: Added some examples of table markup. Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** doc.tex 2001/08/03 18:36:17 1.49 --- doc.tex 2001/08/14 21:36:19 1.50 *************** *** 1206,1209 **** --- 1206,1280 ---- authors, but is created by the \macro{localmoduletable} macro. + Here is a small example of a table given in the documentation for + the \module{warnings} module; markup inside the table cells is + minimal so the markup for the table itself is readily discernable. + Here is the markup for the table: + + \begin{verbatim} + \begin{tableii}{l|l}{exception}{Class}{Description} + \lineii{Warning} + {This is the base class of all warning category classes. It + is a subclass of \exception{Exception}.} + \lineii{UserWarning} + {The default category for \function{warn()}.} + \lineii{DeprecationWarning} + {Base category for warnings about deprecated features.} + \lineii{SyntaxWarning} + {Base category for warnings about dubious syntactic + features.} + \lineii{RuntimeWarning} + {Base category for warnings about dubious runtime features.} + \end{tableii} + \end{verbatim} + + Here is the resulting table: + + \begin{tableii}{l|l}{exception}{Class}{Description} + \lineii{Warning} + {This is the base class of all warning category classes. It + is a subclass of \exception{Exception}.} + \lineii{UserWarning} + {The default category for \function{warn()}.} + \lineii{DeprecationWarning} + {Base category for warnings about deprecated features.} + \lineii{SyntaxWarning} + {Base category for warnings about dubious syntactic + features.} + \lineii{RuntimeWarning} + {Base category for warnings about dubious runtime features.} + \end{tableii} + + Note that the class names are implicitly marked using the + \macro{exception} macro, since that is given as the \var{col1font} + value for the \env{tableii} environment. To create a table using + different markup for the first column, use \code{textrm} for the + \var{col1font} value and mark each entry individually. + + To add a horizontal line between vertical sections of a table, use + the standard \macro{hline} macro between the rows which should be + separated: + + \begin{verbatim} + \begin{tableii}{l|l}{constant}{Language}{Audience} + \lineii{APL}{Masochists.} + \lineii{BASIC}{First-time programmers on PC hardware.} + \lineii{C}{\UNIX{} \&\ Linux kernel developers.} + \hline + \lineii{Python}{Everyone!} + \end{tableii} + \end{verbatim} + + Note that not all presentation formats are capable of displaying a + horizontal rule in this position. This is how the table looks in + the format you're reading now: + + \begin{tableii}{l|l}{constant}{Language}{Audience} + \lineii{APL}{Masochists.} + \lineii{C}{\UNIX{} \&\ Linux kernel developers.} + \lineii{JavaScript}{Web developers.} + \hline + \lineii{Python}{Everyone!} + \end{tableii} + \subsection{Reference List Markup \label{references}} From bwarsaw@users.sourceforge.net Tue Aug 14 22:42:41 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 14:42:41 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep2html.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv24175 Modified Files: pep2html.py Log Message: fixpat: Add , to the list of punctuation allowable in a url. fixanchor(): Adopt the algorithm for url recognition from faqwiz after suggestion by Guido. Strip any trailing punctuation from the end of the url. Also, use .startswith() where appropriate. Index: pep2html.py =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** pep2html.py 2001/08/14 16:45:19 1.27 --- pep2html.py 2001/08/14 21:42:39 1.28 *************** *** 50,59 **** ' "http://www.w3.org/TR/REC-html40/loose.dtd">') ! fixpat = re.compile("((http|ftp):[-_a-zA-Z0-9/.+~:?#$=&]+)|(pep-\d+(.txt)?)|" "(RFC[- ]?(?P\d+))|" "(PEP\s+(?P\d+))|" ".") def usage(code, msg=''): --- 50,62 ---- ' "http://www.w3.org/TR/REC-html40/loose.dtd">') ! fixpat = re.compile("((http|ftp):[-_a-zA-Z0-9/.+~:?#$=&,]+)|(pep-\d+(.txt)?)|" "(RFC[- ]?(?P\d+))|" "(PEP\s+(?P\d+))|" ".") + EMPTYSTRING = '' + SPACE = ' ' + def usage(code, msg=''): *************** *** 68,79 **** text = match.group(0) link = None ! if text[:5] == "http:" or text[:4] == "ftp:": ! link = text ! elif text[:4] == "pep-" and text != current: link = os.path.splitext(text)[0] + ".html" ! elif text[:3] == 'PEP': pepnum = int(match.group('pepnum')) link = PEPURL % pepnum ! elif text[:3] == 'RFC': rfcnum = int(match.group('rfcnum')) link = RFCURL % rfcnum --- 71,89 ---- text = match.group(0) link = None ! if text.startswith('http:') or text.startswith('ftp:'): ! # Strip off trailing punctuation. Pattern taken from faqwiz. ! ltext = list(text) ! while ltext: ! c = ltext.pop() ! if c not in '();:,.?\'"<>': ! ltext.append(c) ! break ! link = EMPTYSTRING.join(ltext) ! elif text.startswith('pep-') and text <> current: link = os.path.splitext(text)[0] + ".html" ! elif text.startswith('PEP'): pepnum = int(match.group('pepnum')) link = PEPURL % pepnum ! elif text.startswith('RFC'): rfcnum = int(match.group('rfcnum')) link = RFCURL % rfcnum *************** *** 148,152 **** else: mailtos.append(addr) ! v = ' '.join(mailtos) elif k.lower() in ('replaces', 'replaced-by'): peps = '' --- 158,162 ---- else: mailtos.append(addr) ! v = SPACE.join(mailtos) elif k.lower() in ('replaces', 'replaced-by'): peps = '' *************** *** 219,223 **** return newfile - SPACE = ' ' def push_pep(htmlfiles, txtfiles, username, verbose): if verbose: --- 229,232 ---- From fdrake@users.sourceforge.net Tue Aug 14 22:43:33 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 14 Aug 2001 14:43:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref2.tex,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv24617/ref Modified Files: ref2.tex Log Message: Add material about the "r" and "u" prefixes for string literals; should be reviewed for clarity. Work around a bogosity in the HTML version of the escape sequences table conversion. Index: ref2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ref2.tex 2001/08/08 05:37:21 1.29 --- ref2.tex 2001/08/14 21:43:31 1.30 *************** *** 312,316 **** \begin{productionlist} \production{stringliteral} ! {\token{shortstring} | \token{longstring}} \production{shortstring} {"'" \token{shortstringitem}* "'" --- 312,318 ---- \begin{productionlist} \production{stringliteral} ! {[\token{stringprefix}](\token{shortstring} | \token{longstring})} ! \production{stringprefix} ! {"r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"} \production{shortstring} {"'" \token{shortstringitem}* "'" *************** *** 326,334 **** {} \production{longstringchar} ! {} \production{escapeseq} {"\e" } \end{productionlist} \index{triple-quoted string} \index{Unicode Consortium} --- 328,340 ---- {} \production{longstringchar} ! {} \production{escapeseq} {"\e" } \end{productionlist} + One syntactic restriction not indicated by these productions is that + whitespace is not allowed between the \grammartoken{stringprefix} and + the rest of the string literal. + \index{triple-quoted string} \index{Unicode Consortium} *************** *** 341,350 **** otherwise have a special meaning, such as newline, backslash itself, or the quote character. String literals may optionally be prefixed ! with a letter `r' or `R'; such strings are called ! \dfn{raw strings}\index{raw string} and use different rules for backslash escape sequences. A prefix of 'u' or 'U' makes the string a Unicode string. Unicode strings use the Unicode character set as defined by the Unicode Consortium and ISO~10646. Some additional escape sequences, described below, are available in Unicode strings. In triple-quoted strings, --- 347,358 ---- otherwise have a special meaning, such as newline, backslash itself, or the quote character. String literals may optionally be prefixed ! with a letter `r' or `R'; such strings are called \dfn{raw ! strings}\index{raw string} and use different rules for interpreting backslash escape sequences. A prefix of 'u' or 'U' makes the string a Unicode string. Unicode strings use the Unicode character set as defined by the Unicode Consortium and ISO~10646. Some additional escape sequences, described below, are available in Unicode strings. + The two prefix characters may be combined; in this case, `u' must + appear before `r'. In triple-quoted strings, *************** *** 375,382 **** \lineii{\e r} {\ASCII{} Carriage Return (CR)} \lineii{\e t} {\ASCII{} Horizontal Tab (TAB)} ! \lineii{\e u\var{xxxx}} ! {Character with 16-bit hex value \var{xxxx} (Unicode only)} ! \lineii{\e U\var{xxxxxxxx}} ! {Character with 32-bit hex value \var{xxxxxxxx} (Unicode only)} \lineii{\e v} {\ASCII{} Vertical Tab (VT)} \lineii{\e\var{ooo}} {\ASCII{} character with octal value \var{ooo}} --- 383,388 ---- \lineii{\e r} {\ASCII{} Carriage Return (CR)} \lineii{\e t} {\ASCII{} Horizontal Tab (TAB)} ! \lineii{\e u\var{xxxx}} {Character with 16-bit hex value \var{xxxx} (Unicode only)} ! \lineii{\e U\var{xxxxxxxx}}{Character with 32-bit hex value \var{xxxxxxxx} (Unicode only)} \lineii{\e v} {\ASCII{} Vertical Tab (VT)} \lineii{\e\var{ooo}} {\ASCII{} character with octal value \var{ooo}} From fdrake@users.sourceforge.net Tue Aug 14 22:51:52 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 14 Aug 2001 14:51:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libwarnings.tex,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv28526/lib Modified Files: libwarnings.tex Log Message: Fix a minor typo and mark an exception name that was missed. Index: libwarnings.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libwarnings.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** libwarnings.tex 2001/02/28 23:34:21 1.5 --- libwarnings.tex 2001/08/14 21:51:50 1.6 *************** *** 56,60 **** \lineii{Warning}{This is the base class of all warning category ! classes. It itself a subclass of Exception.} \lineii{UserWarning}{The default category for \function{warn()}.} --- 56,60 ---- \lineii{Warning}{This is the base class of all warning category ! classes. It is a subclass of \exception{Exception}.} \lineii{UserWarning}{The default category for \function{warn()}.} From bwarsaw@users.sourceforge.net Tue Aug 14 22:58:45 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 14:58:45 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0205.txt,1.12,1.13 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv31922 Modified Files: pep-0205.txt Log Message: Fixed the format of both the Author: field and the Post-History: field. (These formats will now be described in PEP 1). Index: pep-0205.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0205.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** pep-0205.txt 2001/02/26 19:04:00 1.12 --- pep-0205.txt 2001/08/14 21:58:43 1.13 *************** *** 2,10 **** Title: Weak References Version: $Revision$ ! Author: Fred L. Drake, Jr. Python-Version: 2.1 Status: Incomplete Type: Standards Track ! Post-History: 11 January 2001 Motivation --- 2,10 ---- Title: Weak References Version: $Revision$ ! Author: fdrake@acm.org (Fred L. Drake, Jr.) Python-Version: 2.1 Status: Incomplete Type: Standards Track ! Post-History: 11-Jan-2001 Motivation From jhylton@users.sourceforge.net Tue Aug 14 23:03:05 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 14 Aug 2001 15:03:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/doc - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/doc In directory usw-pr-cvs1:/tmp/cvs-serv1682/doc Log Message: Directory /cvsroot/python/python/dist/src/Tools/compiler/doc added to the repository From bwarsaw@users.sourceforge.net Tue Aug 14 23:03:45 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 15:03:45 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.120,1.121 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv2078 Modified Files: pep-0000.txt Log Message: Add a Last-Modified: header Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** pep-0000.txt 2001/08/14 19:16:49 1.120 --- pep-0000.txt 2001/08/14 22:03:43 1.121 *************** *** 2,5 **** --- 2,6 ---- Title: Index of Python Enhancement Proposals (PEPs) Version: $Revision$ + Last-Modified: $Date$ Author: barry@zope.com (Barry A. Warsaw) Status: Active From jhylton@users.sourceforge.net Tue Aug 14 23:04:46 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 14 Aug 2001 15:04:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/doc astdocgen.py,NONE,1.1 asttable.tex,NONE,1.1 compiler.tex,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/doc In directory usw-pr-cvs1:/tmp/cvs-serv2637/doc Added Files: astdocgen.py asttable.tex compiler.tex Log Message: First day's progress on documentation --- NEW FILE: astdocgen.py --- # Lame substitute for a fine script to generate the table from ast.txt from compiler import astgen AST_DEF = '../compiler/ast.txt' def sort(l): l = l[:] l.sort(lambda a, b: cmp(a.name, b.name)) return l def main(): nodes = astgen.parse_spec(AST_DEF) print "\\begin{longtableiii}{lll}{class}{Node type}{Attribute}{Value}" print for node in sort(nodes): if node.argnames: print "\\lineiii{%s}{%s}{}" % (node.name, node.argnames[0]) else: print "\\lineiii{%s}{}{}" % node.name for arg in node.argnames[1:]: print "\\lineiii{}{%s}{}" % arg print "\\hline", "\n" print "\\end{longtableiii}" if __name__ == "__main__": main() --- NEW FILE: asttable.tex --- \begin{longtableiii}{lll}{class}{Node type}{Attribute}{Value} \lineiii{Add}{left}{left operand} \lineiii{}{right}{right operand} \hline \lineiii{And}{nodes}{list of operands} \hline \lineiii{AssAttr}{}{\emph{attribute as target of assignment}} \lineiii{}{expr}{expression on the left-hand side of the dot} \lineiii{}{attrname}{the attribute name, a string} \lineiii{}{flags}{XXX} \hline \lineiii{AssList}{nodes}{list of list elements being assigned to} \hline \lineiii{AssName}{name}{name being assigned to} \lineiii{}{flags}{XXX} \hline \lineiii{AssTuple}{nodes}{list of tuple elements being assigned to} \hline \lineiii{Assert}{test}{the expression to be tested} \lineiii{}{fail}{the value of the \exception{AssertionError}} \hline \lineiii{Assign}{nodes}{a list of assignment targets, one per equal sign} \lineiii{}{expr}{the value being assigned} \hline \lineiii{AugAssign}{node}{} \lineiii{}{op}{} \lineiii{}{expr}{} \hline \lineiii{Backquote}{expr}{} \hline \lineiii{Bitand}{nodes}{} \hline \lineiii{Bitor}{nodes}{} \hline \lineiii{Bitxor}{nodes}{} \hline \lineiii{Break}{}{} \hline \lineiii{CallFunc}{node}{expression for the callee} \lineiii{}{args}{a list of arguments} \lineiii{}{star_args}{the extended *-arg value} \lineiii{}{dstar_args}{the extended **-arg value} \hline \lineiii{Class}{name}{the name of the class, a string} \lineiii{}{bases}{a list of base classes} \lineiii{}{doc}{doc string, a string or \code{None}} \lineiii{}{code}{the body of the class statement} \hline \lineiii{Compare}{expr}{} \lineiii{}{ops}{} \hline \lineiii{Const}{value}{} \hline \lineiii{Continue}{}{} \hline \lineiii{Dict}{items}{} \hline \lineiii{Discard}{expr}{} \hline \lineiii{Div}{left}{} \lineiii{}{right}{} \hline \lineiii{Ellipsis}{}{} \hline \lineiii{Exec}{expr}{} \lineiii{}{locals}{} \lineiii{}{globals}{} \hline \lineiii{For}{assign}{} \lineiii{}{list}{} \lineiii{}{body}{} \lineiii{}{else_}{} \hline \lineiii{From}{modname}{} \lineiii{}{names}{} \hline \lineiii{Function}{name}{name used in def, a string} \lineiii{}{argnames}{list of argument names, as strings} \lineiii{}{defaults}{list of default values} \lineiii{}{flags}{xxx} \lineiii{}{doc}{doc string, a string or \code{None}} \lineiii{}{code}{the body of the function} \hline \lineiii{Getattr}{expr}{} \lineiii{}{attrname}{} \hline \lineiii{Global}{names}{} \hline \lineiii{If}{tests}{} \lineiii{}{else_}{} \hline \lineiii{Import}{names}{} \hline \lineiii{Invert}{expr}{} \hline \lineiii{Keyword}{name}{} \lineiii{}{expr}{} \hline \lineiii{Lambda}{argnames}{} \lineiii{}{defaults}{} \lineiii{}{flags}{} \lineiii{}{code}{} \hline \lineiii{LeftShift}{left}{} \lineiii{}{right}{} \hline \lineiii{List}{nodes}{} \hline \lineiii{ListComp}{expr}{} \lineiii{}{quals}{} \hline \lineiii{ListCompFor}{assign}{} \lineiii{}{list}{} \lineiii{}{ifs}{} \hline \lineiii{ListCompIf}{test}{} \hline \lineiii{Mod}{left}{} \lineiii{}{right}{} \hline \lineiii{Module}{doc}{doc string, a string or \code{None}} \lineiii{}{node}{body of the module, a \class{Stmt}} \hline \lineiii{Mul}{left}{} \lineiii{}{right}{} \hline \lineiii{Name}{name}{} \hline \lineiii{Not}{expr}{} \hline \lineiii{Or}{nodes}{} \hline \lineiii{Pass}{}{} \hline \lineiii{Power}{left}{} \lineiii{}{right}{} \hline \lineiii{Print}{nodes}{} \lineiii{}{dest}{} \hline \lineiii{Printnl}{nodes}{} \lineiii{}{dest}{} \hline \lineiii{Raise}{expr1}{} \lineiii{}{expr2}{} \lineiii{}{expr3}{} \hline \lineiii{Return}{value}{} \hline \lineiii{RightShift}{left}{} \lineiii{}{right}{} \hline \lineiii{Slice}{expr}{} \lineiii{}{flags}{} \lineiii{}{lower}{} \lineiii{}{upper}{} \hline \lineiii{Sliceobj}{nodes}{list of statements} \hline \lineiii{Stmt}{nodes}{} \hline \lineiii{Sub}{left}{} \lineiii{}{right}{} \hline \lineiii{Subscript}{expr}{} \lineiii{}{flags}{} \lineiii{}{subs}{} \hline \lineiii{TryExcept}{body}{} \lineiii{}{handlers}{} \lineiii{}{else_}{} \hline \lineiii{TryFinally}{body}{} \lineiii{}{final}{} \hline \lineiii{Tuple}{nodes}{} \hline \lineiii{UnaryAdd}{expr}{} \hline \lineiii{UnarySub}{expr}{} \hline \lineiii{While}{test}{} \lineiii{}{body}{} \lineiii{}{else_}{} \hline \lineiii{Yield}{value}{} \hline \end{longtableiii} --- NEW FILE: compiler.tex --- % Complete documentation on the extended LaTeX markup used for Python % documentation is available in ``Documenting Python'', which is part % of the standard documentation for Python. It may be found online % at: % % http://www.python.org/doc/current/doc/doc.html \documentclass{manual} \title{Python compiler package} \author{Jeremy Hylton} % Please at least include a long-lived email address; % the rest is at your discretion. \authoraddress{ PythonLabs \\ Zope Corp. \\ Email: \email{jeremy@zope.com} } \date{August 15, 2001} % update before release! % Use an explicit date so that reformatting % doesn't cause a new date to be used. Setting % the date to \today can be used during draft % stages to make it easier to handle versions. \release{2.2} % release version; this is used to define the % \version macro \makeindex % tell \index to actually write the .idx file \makemodindex % If this contains a lot of module sections. \begin{document} \maketitle % This makes the contents more accessible from the front page of the HTML. \ifhtml \chapter*{Front Matter\label{front}} \fi %\input{copyright} \begin{abstract} \noindent The Python compiler package is a tool for analyzing Python source code and generating Python bytecode. The compiler contains libraries to generate an abstract syntax tree from Python source code and to generate Python bytecode from the tree. \end{abstract} \tableofcontents \chapter{Introduction\label{Introduction}} XXX Need basic intro XXX what are the major advantages... the abstract syntax is much closer to the python source... \section{The basic interface} The top-level of the package defines four functions. \begin{funcdesc}{parse}{buf} Returns an abstract syntax tree for the Python source code in \var{buf}. The function raises SyntaxError if there is an error in the source code. The return value is a \class{compiler.ast.Module} instance that contains the tree. \end{funcdesc} \begin{funcdesc}{parseFile}{path} Return an abstract syntax tree for the Python source code in the file specified by \var{path}. It is equivalent to \code{parse(open(path))}. \end{funcdesc} \begin{funcdesc}{walk}{ast, visitor, \optional{verbose=None}} Do a pre-order walk over the abstract syntax tree \var{ast}. Call the appropriate method on the \var{visitor} instance for each node encountered. \end{funcdesc} \begin{funcdesc}{compile}{filename} Compile the file \var{filename} and generated \var{filename}.pyc. \end{funcdesc} The \module{compiler} package contains the following modules: \module{ast}, \module{consts}, \module{future}, \module{misc}, \module{pyassem}, \module{pycodegen}, \module{symbols}, \module{transformer}, and \module{visitor}. \section{Limitations} There are some problems with the error checking of the compiler package. The interpreter detects syntax errors in two distinct phases. One set of errors is detected by the interpreter's parser, the other set by the compiler. The compiler package relies on the interpreter's parser, so it get the first phases of error checking for free. It implements the second phase itself, and that implement is incomplete. For example, the compiler package does not raise an error if a name appears more than once in an argument list: \code{def f(x, x): ...} \chapter{Python Abstract Syntax} \section{Introduction} The \module{compiler.ast} module defines an abstract syntax for Python. In the abstract syntax tree, each node represents a syntactic construct. The root of the tree is \class{Module} object. The abstract syntax offers a higher level interface to parsed Python source code. The \module{parser} module and the compiler written in C for the Python interpreter use a concrete syntax tree. The concrete syntax is tied closely to the grammar description used for the Python parser. Instead of a single node for a construct, there are often several levels of nested nodes that are introduced by Python's precedence rules. The abstract syntax tree is created by the \module{compiler.transformer} module. The transformer relies on the builtin Python parser to generate a concrete syntax tree. It generates an abstract syntax tree from the concrete tree. The \module{transformer} module was created by Greg Stein and Bill Tutt for the Python-to-C compiler. The current version contains a number of modifications and improvements, but the basic form of the abstract syntax and of the transformer are due to Stein and Tutt. \section{AST Nodes} The \module{ast} module is generated from a text file that describes each node type and its elements. Each node type is represented as a class that inherits from the abstract base class \class{ast.Node} and defines a set of named attributes for child nodes. \begin{classdesc}{Node}{} The \class{Node} instances are created automatically by the parser generator. The recommended interface for specific \class{Node} instances is to use the public attributes to access child nodes. A public attribute may be bound to a single node or to a sequence of nodes, depending on the \class{Node} type. For example, the \member{bases} attribute of the \class{Class} node, is bound to a list of base class nodes, and the \member{doc} attribute is bound to a single node. Each \class{Node} instance has a \member{lineno} attribute which may be \code{None}. XXX Not sure what the rules are for which nodes will have a useful lineno. \begin{methoddesc}{getChildren}{} Returns a flattened list of the child nodes and objects in the order they occur. Specifically, the order of the nodes is the order in which they appear in the Python grammar. Not all of the children are \class{Node} instances. The names of functions and classes, for example, are plain strings. \end{methoddesc} \begin{methoddesc}{getChildNodes}{} Returns a flattened list of the child nodes in the order they occur. This method is like \method{getChildNodes}, except that it only returns those children that are \class{Node} instances. \end{methoddesc} \end{classdesc} Two examples illustrate the general structure of \class{Node} classes. The while statement is defined by the following grammar production: \begin{verbatim} while_stmt: "while" expression ":" suite ["else" ":" suite] \end{verbatim} The \class{While} node has three attributes: \member{test}, \member{body}, and \member{else_}. (If the natural name for an attribute is also a Python reserved word, it can't be used as an attribute name. An underscore is appended to the word to make it legal, hence \code{else_} instead of \code{else}.) The if statement is more complicated because it can include several tests. \begin{verbatim} if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] \end{verbatim} The \class{If} node only defines two attributes: \member{tests} and \member{else_}. The \member{tests} attribute is a sequence of test expression, consequent body pairs. There is one pair of each if/elif clause. The first element of the pair is the test expression. The second elements is a \class{Stmt} node that contains the code to execute if the test is true. The \method{getChildren()} method of \class{If} returns a flat list of child nodes. If there are three if/elif clauses and no else clause, then \method{getChildren()} will return a list of six elements: the first test expression, the first \class{Stmt}, the second text expression, etc. The following table lists each of the \class{Node} subclasses defined in \module{compiler.ast} and each of the public attributes available on their instances. The values of most of the attributes are themselves \class{Node} instances or sequences of instances. When the value is something other than an instance, the type is noted in the comment. The attributes are listed in the order in which they are returned by \method{getChildren} and \method{getChildNodes}. \input{asttable} \section{Assignment nodes} There is a collection of nodes used to represent assignments. Each assignment statement in the source code becomes a single \class{Assign} node in the AST. The \member{nodes} attribute is a list that contains a node for each assignment target. This is necessary because assignment can be chained, e.g. \code{a = b = 2}. Each \class{Node} in the list will be one of the following classes: \class{AssAttr}, \class{AssList}, \class{AssName}, or \class{AssTuple}. XXX Explain what the AssXXX nodes are for. Mention \code{a.b.c = 2} as an example. Explain what the flags are for. \chapter{Using Visitors to Walk ASTs} The visitor pattern is ... The \module{compiler} package uses a variant on the visitor pattern that takes advantage of Python's introspection features to elminiate the need for much of the visitor's infrastructure. The classes being visited do not need to be programmed to accept visitors. The visitor need only define visit methods for classes it is specifically interested in; a default visit method can handle the rest. XXX The magic \method{visit()} method for visitors. \begin{classdesc}{ASTVisitor}{} The \class{ASTVisitor} is responsible for walking over the tree in the correct order. A walk begins with a call to \method{preorder()}. For each node, it checks the \var{visitor} argument to \method{preorder{}} for a method named `visitNodeType,' where NodeType is the name of the node's class, e.g. for a \class{While} node a \method{visitWhile} would be called . If the method exists, it is called with the node as its first argument. The visitor method for a particular node type can control how child nodes are visited during the walk. The \class{ASTVisitor} modifies the visitor argument by adding a visit method to the visitor; this method can be used to visit a particular child node. If no visitor is found for a particular node type, the \method{default} method is called. XXX describe extra arguments \begin{methoddesc}{default}{node\optional{, *args}} \end{methoddesc} \begin{methoddesc}{dispatch}{node\optional{, *args}} \end{methoddesc} \begin{methoddesc}{preorder}{tree, visitor} \end{methoddesc} \end{classdesc} \begin{funcdesc}{walk}{tree, visitor\optional{, verbose=None}} \end{funcdesc} \chapter{Bytecode Generation} The code generator is a visit that emits bytecodes. Each visit method can call the \method{emit} method to emit a new bytecode. The basic code generator is specialized for modules, classes, and functions. An assembler converts that emitted instructions to the low-level bytecode format. It handles things like generator of constant lists of code objects and calculation of jump offsets. % % The ugly "%begin{latexonly}" pseudo-environments are really just to % keep LaTeX2HTML quiet during the \renewcommand{} macros; they're % not really valuable. % % If you don't want the Module Index, you can remove all of this up % until the second \input line. % %begin{latexonly} \renewcommand{\indexname}{Module Index} %end{latexonly} \input{mod\jobname.ind} % Module Index %begin{latexonly} \renewcommand{\indexname}{Index} %end{latexonly} \input{\jobname.ind} % Index \end{document} From bwarsaw@users.sourceforge.net Tue Aug 14 23:04:54 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 15:04:54 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0001.txt,1.24,1.25 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv2727 Modified Files: pep-0001.txt Log Message: Add a Last-Modified: header. Add a short description of the format for both the Author: and Post-History: headers. Elaborate a bit about how and where PEP discussions should be held. Index: pep-0001.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0001.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** pep-0001.txt 2001/08/14 16:48:57 1.24 --- pep-0001.txt 2001/08/14 22:04:52 1.25 *************** *** 2,5 **** --- 2,6 ---- Title: PEP Purpose and Guidelines Version: $Revision$ + Last-Modified: $Date$ Author: barry@zope.com (Barry A. Warsaw), jeremy@zope.com (Jeremy Hylton) *************** *** 86,92 **** will not be accepted. However, wherever possible, long open-ended discussions on public mailing lists should be avoided. A better ! strategy is to encourage public feedback directly to the PEP ! author, who collects and integrates the comments back into the ! PEP. Once the authors have completed a PEP, they must inform the PEP --- 87,95 ---- will not be accepted. However, wherever possible, long open-ended discussions on public mailing lists should be avoided. A better ! strategy is to encourage public feedback be sent directly to the ! PEP author during the early draft phases, who collects and ! integrates the comments back into the PEP. Before code is ! committed to CVS in a non-experimental way though, discussion must ! be moved back to the python-dev and/or python-list mailing lists. Once the authors have completed a PEP, they must inform the PEP *************** *** 193,196 **** --- 196,208 ---- * Replaced-By: + The Author: header lists the email addresses and names of all the + authors/owners of the PEP. The format of the author entry should + be + + address@dom.ain (Random J. User) + + and if there are multiple authors, each should be on a separate + line following RFC 822 continuation line conventions. + Standards track PEPs must have a Python-Version: header which indicates the version of Python that the feature will be released *************** *** 203,206 **** --- 215,222 ---- the author, or on the python-list or python-dev email mailing lists. + + Post-History: is used to record the dates of when new versions of + the PEP are posted to python-list and/or python-dev. The should + be in dd-mmm-yyyy format, e.g. 14-Aug-2001. PEPs may have a Requires: header, indicating the PEP numbers that From bwarsaw@users.sourceforge.net Tue Aug 14 23:23:20 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 15:23:20 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0250.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv12840 Modified Files: pep-0250.txt Log Message: Paul's latest revision, marked Finish, with minor formatting fixes. Paul changed the name of the PEP so this will be reflected in PEP 0. Index: pep-0250.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0250.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0250.txt 2001/06/05 17:01:55 1.2 --- pep-0250.txt 2001/08/14 22:23:18 1.3 *************** *** 1,9 **** PEP: 250 ! Title: Using site-packages on All Platforms Version $Revision$ Author: gustav@morpheus.demon.co.uk (Paul Moore) ! Status: Draft Type: Standards Track ! Created: 2001-03-30 Python-Version: 2.2 Post-History: 30-Mar-2001 --- 1,9 ---- PEP: 250 ! Title: Using site-packages on Windows Version $Revision$ Author: gustav@morpheus.demon.co.uk (Paul Moore) ! Status: Final Type: Standards Track ! Created: 30-Mar-2001 Python-Version: 2.2 Post-History: 30-Mar-2001 *************** *** 19,23 **** This PEP proposes that the site-packages directory should be used ! uniformly across all platforms for locally installed modules. --- 19,23 ---- This PEP proposes that the site-packages directory should be used ! on the Windows platform in a similar manner. *************** *** 27,33 **** include a directory suitable for users to install locally developed modules. The "expected" location appears to be the ! directory containing the Python executable itself. Including ! locally developed code in the same directory as installed ! executables is not good practice. Clearly, users can manipulate sys.path, either in a locally --- 27,34 ---- include a directory suitable for users to install locally developed modules. The "expected" location appears to be the ! directory containing the Python executable itself. This is also ! the location where distutils (and distutils-generated installers) ! installs packages. Including locally developed code in the same ! directory as installed executables is not good practice. Clearly, users can manipulate sys.path, either in a locally *************** *** 72,79 **** sitedirs == [prefix, makepath(prefix, "lib", "site-packages")] ! Changes would also be required to distutils, in the sysconfig.py ! file. It is worth noting that this file does not seem to have ! been updated in line with the change of policy on the Macintosh, ! as of this writing. --- 73,87 ---- sitedirs == [prefix, makepath(prefix, "lib", "site-packages")] ! Changes would also be required to distutils, to reflect this change ! in policy. A patch is available on Sourceforge, patch ID 445744, ! which implements this change. Note that the patch checks the Python ! version and only invokes the new behaviour for Python versions from ! 2.2 onwards. This is to ensure that distutils remains compatible ! with earlier versions of Python. ! ! Finally, the executable code which implements the Windows installer ! used by the bdist_wininst command will need changing to use the new ! location. A separate patch is available for this, currently ! maintained by Thomas Heller. *************** *** 86,90 **** - Both the current location (sys.prefix) and the new directory (site-packages) are included in sitedirs, so that .pth files ! will be recognized in either location. - This proposal adds a single additional site-packages directory --- 94,98 ---- - Both the current location (sys.prefix) and the new directory (site-packages) are included in sitedirs, so that .pth files ! will be recognised in either location. - This proposal adds a single additional site-packages directory *************** *** 97,119 **** having two separate package directories. ! - If users want to keep DLLs in a single location on Windows, ! rather than keeping them in the package directory, the DLLs ! subdirectory of the Python install directory is available for ! that purpose. Adding an extra directory solely for DLLs should ! not be necessary. Open Issues ! - There have been no comments on this proposal from non-Windows ! users. In the absence of such comments, it is assumed that there ! will be no adverse effects on such platforms caused by the ! proposed change. (The author knows of no reason why there should ! be). ! - There could be issues with applications which embed Python. To ! the author's knowledge, there should be no problem as a result ! of this change. Again, there have been no comments (supportive ! or otherwise) from users who embed Python. --- 105,127 ---- having two separate package directories. ! - If users want to keep DLLs in a single location on Windows, rather ! than keeping them in the package directory, the DLLs subdirectory ! of the Python install directory is already available for that ! purpose. Adding an extra directory solely for DLLs should not be ! necessary. Open Issues ! - Comments from Unix users indicate that there may be issues with ! the current setup on the Unix platform. Rather than become ! involved in cross-platform issues, this PEP specifically limits ! itself to the Windows platform, leaving changes for other platforms ! to be covered inother PEPs. ! - There could be issues with applications which embed Python. To the ! author's knowledge, there should be no problem as a result of this ! change. There have been no comments (supportive or otherwise) from ! users who embed Python. From bwarsaw@users.sourceforge.net Tue Aug 14 23:24:08 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 15:24:08 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.121,1.122 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv13320 Modified Files: pep-0000.txt Log Message: PEP 250 name change to Using site-packages on Windows. Paul's latest revision is Final, but I'm not yet sure if everything's checked into CVS. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** pep-0000.txt 2001/08/14 22:03:43 1.121 --- pep-0000.txt 2001/08/14 22:24:06 1.122 *************** *** 43,47 **** S 238 Changing the Division Operator Zadka, van Rossum ! S 250 Using site-packages on All Platforms Moore I 251 Python 2.2 Release Schedule van Rossum, Warsaw S 252 Making Types Look More Like Classes van Rossum --- 43,47 ---- S 238 Changing the Division Operator Zadka, van Rossum ! SF 250 Using site-packages on Windows Moore I 251 Python 2.2 Release Schedule van Rossum, Warsaw S 252 Making Types Look More Like Classes van Rossum *************** *** 193,197 **** I 248 Python Database API Specification v1.0 Lemburg I 249 Python Database API Specification v2.0 Lemburg ! S 250 Using site-packages on All Platforms Moore I 251 Python 2.2 Release Schedule van Rossum, Warsaw S 252 Making Types Look More Like Classes van Rossum --- 193,197 ---- I 248 Python Database API Specification v1.0 Lemburg I 249 Python Database API Specification v2.0 Lemburg ! SF 250 Using site-packages on All Platforms Moore I 251 Python 2.2 Release Schedule van Rossum, Warsaw S 252 Making Types Look More Like Classes van Rossum From bwarsaw@users.sourceforge.net Tue Aug 14 23:48:17 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 15:48:17 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0001.txt,1.25,1.26 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv25217 Modified Files: pep-0001.txt Log Message: Clarification on when and how to report PEP bugs and updates. Index: pep-0001.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0001.txt,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** pep-0001.txt 2001/08/14 22:04:52 1.25 --- pep-0001.txt 2001/08/14 22:48:14 1.26 *************** *** 280,286 **** Reporting PEP Bugs, or Submitting PEP Updates ! Please use the SourceForge bug manager[6] if you want to report ! problems with PEPs, or better yet, the SourceForge patch ! manager[2] for submitting patches to PEPs. --- 280,296 ---- Reporting PEP Bugs, or Submitting PEP Updates ! How you report a bug, or submit a PEP update depends on several ! factors, such as the maturity of the PEP, the preferences of the ! PEP author, and the nature of your comments. For the early draft ! stages of the PEP, it's probably best to send your comments and ! changes directly to the PEP author. For more mature, or finished ! PEPs you may want to submit corrections to the SourceForge bug ! manager[6] or better yet, the SourceForge patch manager[2] so that ! your changes don't get lost. If the PEP author is a SF developer, ! assign the bug/patch to him, otherwise assign it to the PEP ! editor. ! ! When in doubt about where to send your changes, please check first ! with the PEP author and/or PEP editor. From jhylton@users.sourceforge.net Tue Aug 14 23:38:05 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 14 Aug 2001 15:38:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/doc compiler.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/doc In directory usw-pr-cvs1:/tmp/cvs-serv19766 Modified Files: compiler.tex Log Message: update simple explanation of parseFile() Index: compiler.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/doc/compiler.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** compiler.tex 2001/08/14 22:04:44 1.1 --- compiler.tex 2001/08/14 22:38:03 1.2 *************** *** 76,80 **** \begin{funcdesc}{parseFile}{path} Return an abstract syntax tree for the Python source code in the file ! specified by \var{path}. It is equivalent to \code{parse(open(path))}. \end{funcdesc} --- 76,80 ---- \begin{funcdesc}{parseFile}{path} Return an abstract syntax tree for the Python source code in the file ! specified by \var{path}. It is equivalent to \code{parse(open(path).read())}. \end{funcdesc} From bwarsaw@users.sourceforge.net Wed Aug 15 00:07:19 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 16:07:19 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0265.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv889 Added Files: pep-0265.txt Log Message: PEP 265, Sorting Dictionaries by Value, Grant Griffin Editorial pass, formatting, spell checking by Barry. --- NEW FILE: pep-0265.txt --- PEP: 265 Title: Sorting Dictionaries by Value Version: $Revision: 1.1 $ Author: g2@iowegian.com (Grant Griffin) Status: Draft Type: Standards Track Created: 8-Aug-2001 Python-Version: 2.2 Post-History: Abstract This PEP suggests a "sort by value" operation for dictionaries. The primary benefit would be in terms of "batteries included" support for a common Python idiom which, in its current form, is both difficult for beginners to understand and cumbersome for all to implement. Motivation A common use of dictionaries is to count occurrences by setting the value of d[key] to 1 on its first occurrence, then increment the value on each subsequent occurrence. This can be done several different ways, but the get() method is the most succinct: d[key] = d.get(key, 0) + 1 Once all occurrences have been counted, a common use of the resulting dictionary is to print the occurrences in occurrence-sorted order, often with the largest value first. This leads to a need to sort a dictionary's items by value. The canonical method of doing so in Python is to first use d.items() to get a list of the dictionary's items, then invert the ordering of each item's tuple from (key, value) into (value, key), then sort the list; since Python sorts the list based on the first item of the tuple, the list of (inverted) items is therefore sorted by value. If desired, the list can then be reversed, and the tuples can be re-inverted back to (key, value). (However, in my experience, the inverted tuple ordering is fine for most purposes, e.g. printing out the list.) For example, given an occurrence count of: >>> d = {'a':2, 'b':23, 'c':5, 'd':17, 'e':1} we might do: >>> items = [(v, k) for k, v in d.items()] >>> items.sort() >>> items.reverse() # so largest is first >>> items = [(k, v) for v, k in items] resulting in: >>> items [('b', 23), ('d', 17), ('c', 5), ('a', 2), ('e', 1)] which shows the list in by-value order, largest first. (In this case, 'b' was found to have the most occurrences.) This works fine, but is "hard to use" in two aspects. First, although this idiom is known to veteran Pythoneers, it is not at all obvious to newbies -- either in terms of its algorithm (inverting the ordering of item tuples) or its implementation (using list comprehensions -- which are an advanced Python feature.) Second, it requires having to repeatedly type a lot of "grunge", resulting in both tedium and mistakes. We therefore would rather Python provide a method of sorting dictionaries by value which would be both easy for newbies to understand (or, better yet, not to _have to_ understand) and easier for all to use. Rationale As Tim Peters has pointed out, this sort of thing brings on the problem of trying to be all things to all people. Therefore, we will limit its scope to try to hit "the sweet spot". Unusual cases (e.g. sorting via a custom comparison function) can, of course, be handled "manually" using present methods. Here are some simple possibilities: The items() method of dictionaries can be augmented with new parameters having default values that provide for full backwards-compatibility: (1) items(sort_by_values=0, reversed=0) or maybe just: (2) items(sort_by_values=0) since reversing a list is easy enough. Alternatively, items() could simply let us control the (key, value) order: (3) items(values_first=0) Again, this is fully backwards-compatible. It does less work than the others, but it at least eases the most complicated/tricky part of the sort-by-value problem: inverting the order of item tuples. Using this is very simple: items = d.items(1) items.sort() items.reverse() # (if desired) The primary drawback of the preceding three approaches is the additional overhead for the parameter-less "items()" case, due to having to process default parameters. (However, if one assumes that items() gets used primarily for creating sort-by-value lists, this is not really a drawback in practice.) Alternatively, we might add a new dictionary method which somehow embodies "sorting". This approach offers two advantages. First, it avoids adding overhead to the items() method. Second, it is perhaps more accessible to newbies: when they go looking for a method for sorting dictionaries, they hopefully run into this one, and they will not have to understand the finer points of tuple inversion and list sorting to achieve sort-by-value. To allow the four basic possibilities of sorting by key/value and in forward/reverse order, we could add this method: (4) sorted_items(by_value=0, reversed=0) I believe the most common case would actually be "by_value=1, reversed=1", but the defaults values given here might lead to fewer surprises by users: sorted_items() would be the same as items() followed by sort(). Finally (as a last resort), we could use: (5) items_sorted_by_value(reversed=0) Implementation The proposed dictionary methods would necessarily be implemented in C. Presumably, the implementation would be fairly simple since it involves just adding a few calls to Python's existing machinery. Concerns Aside from the run-time overhead already addressed in possibilities 1 through 3, concerns with this proposal probably will fall into the categories of "feature bloat" and/or "code bloat". However, I believe that several of the suggestions made here will result in quite minimal bloat, resulting in a good tradeoff between bloat and "value added". Tim Peters has noted that implementing this in C might not be significantly faster than implementing it in Python today. However, the major benefits intended here are "accessibility" and "ease of use", not "speed". Therefore, as long as it is not noticeably slower (in the case of plain items(), speed need not be a consideration. References A related thread called "counting occurrences" appeared on comp.lang.python in August, 2001. This included examples of approaches to systematizing the sort-by-value problem by implementing it as reusable Python functions and classes. Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil End: From bwarsaw@users.sourceforge.net Wed Aug 15 00:07:52 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 16:07:52 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.122,1.123 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv1135 Modified Files: pep-0000.txt Log Message: PEP 265, Sorting Dictionaries by Value, Grant Griffin Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** pep-0000.txt 2001/08/14 22:24:06 1.122 --- pep-0000.txt 2001/08/14 23:07:50 1.123 *************** *** 60,63 **** --- 60,64 ---- S 263 Defining Python Source Code Encodings Lemburg S 264 Future statements in simulated shells Hudson + S 265 Sorting Dictionaries by Value Griffin Py-in-the-sky PEPs (not considered for Python 2.2) *************** *** 208,212 **** S 263 Defining Python Source Code Encodings Lemburg S 264 Future statements in simulated shells Hudson ! Key --- 209,213 ---- S 263 Defining Python Source Code Encodings Lemburg S 264 Future statements in simulated shells Hudson ! S 265 Sorting Dictionaries by Value Griffin Key *************** *** 231,234 **** --- 232,236 ---- Evans, Clark C. cce@clarkevans.com Goodger, David dgoodger@bigfoot.com + Griffin, Grant g2@iowegian.com Hudson, Michael mwh@python.net Hylton, Jeremy jeremy@zope.com From bwarsaw@users.sourceforge.net Wed Aug 15 00:58:11 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 16:58:11 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0001.txt,1.26,1.27 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv17924 Modified Files: pep-0001.txt Log Message: Clarify some style points, such as fill column, double-spacing at the end of sentences, etc. Add a reference to PEP 9, a new sample PEP template. Index: pep-0001.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0001.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** pep-0001.txt 2001/08/14 22:48:14 1.26 --- pep-0001.txt 2001/08/14 23:58:09 1.27 *************** *** 170,178 **** ! PEP Style PEPs are written in plain ASCII text, and should adhere to a rigid style. There is a Python script that parses this style and converts the plain text PEP to HTML for viewing on the web[5]. Each PEP must begin with an RFC822 style header preamble. The --- 170,180 ---- ! PEP Template PEPs are written in plain ASCII text, and should adhere to a rigid style. There is a Python script that parses this style and converts the plain text PEP to HTML for viewing on the web[5]. + PEP 9 contains a boilerplate[7] template you can use to get + started writing your PEP. Each PEP must begin with an RFC822 style header preamble. The *************** *** 216,222 **** lists. ! Post-History: is used to record the dates of when new versions of ! the PEP are posted to python-list and/or python-dev. The should ! be in dd-mmm-yyyy format, e.g. 14-Aug-2001. PEPs may have a Requires: header, indicating the PEP numbers that --- 218,225 ---- lists. ! Created: records the date that the PEP was assigned a number, ! while Post-History: is used to record the dates of when new ! versions of the PEP are posted to python-list and/or python-dev. ! Both headers should be in dd-mmm-yyyy format, e.g. 14-Aug-2001. PEPs may have a Requires: header, indicating the PEP numbers that *************** *** 229,232 **** --- 232,238 ---- that it rendered obsolete. + + PEP Formatting Requirements + PEP headings must begin in column zero and the initial letter of each word must be capitalized as in book titles. Acronyms should *************** *** 237,242 **** last line of a section's body and the next section heading. Tab characters must never appear in the document at all. A PEP ! should include the Emacs stanza included by example in this PEP. A PEP must contain a Copyright section, and it is strongly --- 243,255 ---- last line of a section's body and the next section heading. + You must adhere to the Emacs convention of adding two spaces at + the end of every sentence. You should fill your paragraphs to + column 70, but under no circumstances should your lines extend + past column 79. If your code samples spill over column 79, you + should rewrite them. + Tab characters must never appear in the document at all. A PEP ! should include the standard Emacs stanza included by example at ! the bottom of this PEP. A PEP must contain a Copyright section, and it is strongly *************** *** 311,321 **** [5] The script referred to here is pep2html.py, which lives in ! the same directory in the CVS tree as the PEPs themselves. Try ! "pep2html.py --help" for details. ! The URL for viewing PEPs on the web is ! http://python.sourceforge.net/peps/ [6] http://sourceforge.net/tracker/?group_id=5470&atid=305470 --- 324,337 ---- [5] The script referred to here is pep2html.py, which lives in ! the same directory in the CVS tree as the PEPs themselves. ! Try "pep2html.py --help" for details. ! The URL for viewing PEPs on the web is ! http://python.sourceforge.net/peps/ [6] http://sourceforge.net/tracker/?group_id=5470&atid=305470 + + [7] PEP 9, Sample PEP Template + http://www.python.org/peps/pep-0009.html From bwarsaw@users.sourceforge.net Wed Aug 15 00:58:56 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 16:58:56 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0009.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv18048 Added Files: pep-0009.txt Log Message: PEP 9, Sample PEP Template, Barry Warsaw --- NEW FILE: pep-0009.txt --- PEP: 9 Title: Sample PEP Template Version: $Revision: 1.1 $ Last-Modified: $Date: 2001/08/14 23:58:54 $ Author: barry@zope.com (Barry A. Warsaw) Status: Active Type: Informational Created: 14-Aug-2001 Post-History: Abstract This PEP provides a boilerplate or sample template for creating your own PEPs. This should make it easy for you to conform your own PEPs to the style outlined in PEP 1, PEP Guidelines[1]. Rationale PEP submissions come in a wide variety of forms, not all adhering to the style guidelines set forth in PEP 1. Use this template, in conjunction with the prose guidelines in PEP 1, to ensure that your PEP submission won't get automatically rejected because of form. How to Use This Template for Standard Track PEPs First, decide if your PEP is going to be Informational or Standards Track. Most PEPs are Standards Track; if yours is, then make a copy of this file and perform the following edits: - replace the "PEP: 9" header with "PEP: XXX" since you don't yet have a PEP number assignment. - Change the Title: header to the title of your PEP. - Leave the Version: and Last-Modified: headers alone; we'll take care of those when we check your PEP into CVS. - Change the Author: header to include your email address and name. Be sure to follow the format carefully: your email address must appear first, and it should not be contained in angle brackets. Your full name should appear second and it should appear in parentheses. - If there is a mailing list for discussion of your new feature, add a Discussions-To: header right after the Author: header. You should not add a Discussions-To: header if the mailing list to be used is either python-list@python.org or python-dev@python.org, or if discussions should be sent to you directly. - Change the Status: header to "Draft". - Change the Type: header to "Standards Track". - If your feature depends on the acceptance of some other currently in-development PEP, add a Requires: header right after the Type: header. The value should be the PEP number of the PEP yours depends on. Don't add this header if your dependent feature is described in a Final PEP. - Change the Created: header to today's date. Be sure to follow the format carefully: it must be in dd-mmm-yyyy format, where the mmm is the 3 letter month abbreviation. - After the Created: header, add a Python-Version: header and set the value to the next planned version of Python, i.e. the one your new feature will hopefully make its first appearance in. Do not use an alpha or beta release designation here. Thus, if the last version of Python was 2.2 alpha 1 and you're hoping to get your new feature into Python 2.2, set the header to: Python-Version: 2.2 - Leave Post-History: alone for now; you'll add dates to this header after your PEP has been assigned a number and you've posted your PEP to python-list@python.org or python-dev@python.org. - Add a Replaces: header if your PEP describes a feature that will replace a feature described in some Final PEP. Usually you won't need to add this header. It's also unlikely that you'll ever add a Replaced-By: header. - Now write your abstract, rationale, and other content for your PEP, replacing all this gobbledygook with your own text. Be sure to adhere to the PEP 1 style guidelines, specifically on the prohibition of tab characters and the indentation requirements. - Update your References and Copyright section. Usually you'll place your PEP into the public domain, in which case just leave the Copyright section alone. Alternatively, you can use the Open Publication License[2], but public domain is still strongly preferred. - Leave the little Emacs turd at the end of this file alone, including the formfeed character (^L, or \f). - Send your PEP submission to the PEP editor, along with $100k in unmarked pennies. (Just kidding, I wanted to see if you were still awake. :) How to Use This Template for Informational PEPs If your PEP is an Information PEP, make a copy of this file and perform the following edits: - replace the "PEP: 9" header with "PEP: XXX" since you don't yet have a PEP number assignment. - Change the Title: header to the title of your PEP. - Leave the Version: and Last-Modified: headers alone; we'll take care of those when we check your PEP into CVS. - Change the Author: header to include your email address and name. Be sure to follow the format carefully: your email address must appear first, and it should not be contained in angle brackets. Your full name should appear second and it should appear in parentheses. - If there is a mailing list for discussion of your new feature, add a Discussions-To: header right after the Author: header. You should not add a Discussions-To: header if the mailing list to be used is either python-list@python.org or python-dev@python.org, or if discussions should be sent to you directly. Most Information PEPs don't have a Discussions-To: header. - Change the Status: header to "Active". - Change the Type: header to "Informational". - Change the Created: header to today's date. Be sure to follow the format carefully: it must be in dd-mmm-yyyy format, where the mmm is the 3 letter month abbreviation. - Leave Post-History: alone for now; you'll add dates to this header after your PEP has been assigned a number and you've posted your PEP to python-list@python.org or python-dev@python.org. - Now write your abstract, rationale, and other content for your PEP, replacing all this gobbledygook with your own text. Be sure to adhere to the PEP 1 style guidelines, specifically on the prohibition of tab characters and the indentation requirements. - Update your References and Copyright section. Usually you'll place your PEP into the public domain, in which case just leave the Copyright section alone. Alternatively, you can use the Open Publication License[2], but public domain is still strongly preferred. - Leave the little Emacs turd at the end of this file alone, including the formfeed character (^L, or \f). - Send your PEP submission to the PEP editor, along with $100k in unmarked pennies. (Just kidding, I wanted to see if you were still awake. :) References [1] PEP 1, PEP Purpose and Guidelines http://www.python.org/peps/pep-0001.html [2] http://www.opencontent.org/openpub/ Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil End: From bwarsaw@users.sourceforge.net Wed Aug 15 00:59:24 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 16:59:24 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.123,1.124 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv18169 Modified Files: pep-0000.txt Log Message: PEP 9, Sample PEP Template, Barry Warsaw Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** pep-0000.txt 2001/08/14 23:07:50 1.123 --- pep-0000.txt 2001/08/14 23:59:22 1.124 *************** *** 33,36 **** --- 33,37 ---- I 7 Style Guide for C Code van Rossum I 8 Style Guide for Python Code van Rossum, Warsaw + I 9 Sample PEP Template Warsaw Other Informational PEPs *************** *** 139,142 **** --- 140,144 ---- I 7 Style Guide for C Code van Rossum I 8 Style Guide for Python Code van Rossum, Warsaw + I 9 Sample PEP Template Warsaw I 42 Small Feature Requests Hylton From bwarsaw@users.sourceforge.net Wed Aug 15 01:05:36 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 17:05:36 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0266.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv21824 Added Files: pep-0266.txt Log Message: PEP 266, Optimizing Global Variable/Attribute Access, Skip Montanaro Minor editorial pass, spell checking, formatting. I also had to shorten the title, hope Skip doesn't mind! --- NEW FILE: pep-0266.txt --- PEP: 266 Title: Optimizing Global Variable/Attribute Access Version: $Revision: 1.1 $ Author: skip@pobox.com (Skip Montanaro) Status: Draft Type: Standards Track Python-Version: 2.3 Created: 13-Aug-2001 Post-History: Abstract The bindings for most global variables and attributes of other modules typically never change during the execution of a Python program, but because of Python's dynamic nature, code which accesses such global objects must run through a full lookup each time the object is needed. This PEP proposes a mechanism that allows code that accesses most global objects to treat them as local objects and places the burden of updating references on the code that changes the name bindings of such objects. Introduction Consider the workhorse function sre_compile._compile. It is the internal compilation function for the sre module. It consists almost entirely of a loop over the elements of the pattern being compiled, comparing opcodes with known constant values and appending tokens to an output list. Most of the comparisons are with constants imported from the sre_constants module. This means there are lots of LOAD_GLOBAL bytecodes in the compiled output of this module. Just by reading the code it's apparent that the author intended LITERAL, NOT_LITERAL, OPCODES and many other symbols to be constants. Still, each time they are involved in an expression, they must be looked up anew. Most global accesses are actually to objects that are "almost constants". This includes global variables in the current module as well as the attributes of other imported modules. Since they rarely change, it seems reasonable to place the burden of updating references to such objects on the code that changes the name bindings. If sre_constants.LITERAL is changed to refer to another object, perhaps it would be worthwhile for the code that modifies the sre_constants module dict to correct any active references to that object. By doing so, in many cases global variables and the attributes of many objects could be cached as local variables. If the bindings between the names given to the objects and the objects themselves changes rarely, the cost of keeping track of such objects should be low and the potential payoff fairly large. Proposed Change I propose that the Python virtual machine be modified to include TRACK_OBJECT and UNTRACK_OBJECT opcodes. TRACK_OBJECT would associate a global name or attribute of a global name with a slot in the local variable array and perform an initial lookup of the associated object to fill in the slot with a valid value. The association it creates would be noted by the code responsible for changing the name-to-object binding to cause the associated local variable to be updated. The UNTRACK_OBJECT opcode would delete any association between the name and the local variable slot. Rationale Global variables and attributes rarely change. For example, once a function imports the math module, the binding between the name "math" and the module it refers to aren't likely to change. Similarly, if the function that uses the math module refers to its "sin" attribute, it's unlikely to change. Still, every time the module wants to call the math.sin function, it must first execute a pair of instructions: LOAD_GLOBAL math LOAD_ATTR sin If the client module always assumed that math.sin was a local constant and it was the responsibility of "external forces" outside the function to keep the reference correct, we might have code like this: TRACK_OBJECT math.sin ... LOAD_FAST math.sin ... UNTRACK_OBJECT math.sin If the LOAD_FAST was in a loop the payoff in reduced global loads and attribute lookups could be significant. This technique could, in theory, be applied to any global variable access or attribute lookup. Consider this code: l = [] for i in range(10): l.append(math.sin(i)) return l Even though l is a local variable, you still pay the cost of loading l.append ten times in the loop. The compiler (or an optimizer) could recognize that both math.sin and l.append are being called in the loop and decide to generate the tracked local code, avoiding it for the builtin range() function because it's only called once during loop setup. According to a post to python-dev by Marc-Andre Lemburg [1], LOAD_GLOBAL opcodes account for over 7% of all instructions executed by the Python virtual machine. This can be a very expensive instruction, at least relative to a LOAD_FAST instruction, which is a simple array index and requires no extra function calls by the virtual machine. I believe many LOAD_GLOBAL instructions and LOAD_GLOBAL/ LOAD_ATTR pairs could be converted to LOAD_FAST instructions. Code that uses global variables heavily often resorts to various tricks to avoid global variable and attribute lookup. The aforementioned sre_compile._compile function caches the append method of the growing output list. Many people commonly abuse functions' default argument feature to cache global variable lookups. Both of these schemes are hackish and rarely address all the available opportunities for optimization. (For example, sre_compile._compile does not cache the two globals that it uses most frequently: the builtin len function and the global OPCODES array that it imports from sre_constants.py. Discussion Jeremy Hylton has an alternate proposal on the table [2]. His proposal seeks to create a hybrid dictionary/list object for use in global name lookups that would make global variable access look more like local variable access. While there is no C code available to examine, the Python implementation given in his proposal still appears to require dictionary key lookup. It doesn't appear that his proposal could speed local variable attribute lookup, which might be worthwhile in some situations. Backwards Compatibility I don't believe there will be any serious issues of backward compatibility. Obviously, Python bytecode that contains TRACK_OBJECT opcodes could not be executed by earlier versions of the interpreter, but breakage at the bytecode level is often assumed between versions. Implementation TBD. This is where I need help. I believe there should be either a central name/location registry or the code that modifies object attributes should be modified, but I'm not sure the best way to go about this. If you look at the code that implements the STORE_GLOBAL and STORE_ATTR opcodes, it seems likely that some changes will be required to PyDict_SetItem and PyObject_SetAttr or their String variants. Ideally, there'd be a fairly central place to localize these changes. If you begin considering tracking attributes of local variables you get into issues of modifying STORE_FAST as well, which could be a problem, since the name bindings for local variables are changed much more frequently. (I think an optimizer could avoid inserting the tracking code for the attributes for any local variables where the variable's name binding changes.) Performance I believe (though I have no code to prove it at this point), that implementing TRACK_OBJECT will generally not be much more expensive than a single LOAD_GLOBAL instruction or a LOAD_GLOBAL/LOAD_ATTR pair. An optimizer should be able to avoid converting LOAD_GLOBAL and LOAD_GLOBAL/LOAD_ATTR to the new scheme unless the object access occurred within a loop. Further down the line, a register-oriented replacement for the current Python virtual machine [3] could conceivably eliminate most of the LOAD_FAST instructions as well. The number of tracked objects should be relatively small. All active frames of all active threads could conceivably be tracking objects, but this seems small compared to the number of functions defined in a given application. References [1] http://mail.python.org/pipermail/python-dev/2000-July/007609.html [2] http://www.zope.org/Members/jeremy/CurrentAndFutureProjects/FastGlobalsPEP [3] http://www.musi-cal.com/~skip/python/rattlesnake20010813.tar.gz Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil End: From bwarsaw@users.sourceforge.net Wed Aug 15 01:06:04 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 17:06:04 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.124,1.125 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv21943 Modified Files: pep-0000.txt Log Message: PEP 266, Optimizing Global Variable/Attribute Access, Skip Montanaro Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** pep-0000.txt 2001/08/14 23:59:22 1.124 --- pep-0000.txt 2001/08/15 00:06:02 1.125 *************** *** 83,86 **** --- 83,87 ---- S 246 Object Adaptation Evans S 254 Making Classes Look More Like Types van Rossum + S 266 Optimizing Global Variable/Attribute Access Montanaro Finished PEPs (done, implemented in CVS) *************** *** 212,215 **** --- 213,217 ---- S 264 Future statements in simulated shells Hudson S 265 Sorting Dictionaries by Value Griffin + S 266 Optimizing Global Variable/Attribute Access Montanaro Key *************** *** 242,245 **** --- 244,248 ---- von Loewis, Martin loewis@informatik.hu-berlin.de McMillan, Gordon gmcm@hypernet.com + Montanaro, Skip skip@pobox.com Moore, Paul gustav@morpheus.demon.co.uk Oliphant, Travis oliphant@ee.byu.edu From jackjansen@users.sourceforge.net Wed Aug 15 02:14:42 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 14 Aug 2001 18:14:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules getpath.c,1.37,1.38 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv2929 Modified Files: getpath.c Log Message: With WITH_NEXT_FRAMEWORK defined we now also expect a normal Python installation. If there is no LANDMARK we assume we're a bare framework in the install directory (again WITH_NEXT_FRAMEWORK only). Index: getpath.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/getpath.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** getpath.c 2001/08/08 10:28:06 1.37 --- getpath.c 2001/08/15 01:14:40 1.38 *************** *** 1,3 **** - /* Return the initial module search path. */ --- 1,2 ---- *************** *** 372,376 **** #ifdef WITH_NEXT_FRAMEWORK - /* XXX Need to check this code for buffer overflows */ pythonModule = NSModuleForSymbol(NSLookupAndBindSymbol("_Py_Initialize")); /* Use dylib functions to find out where the framework was loaded from */ --- 371,374 ---- *************** *** 378,385 **** if (buf != NULL) { /* We're in a framework. */ ! strcpy(progpath, buf); ! ! /* Frameworks have support for versioning */ ! strcpy(lib_python, "lib"); } else { --- 376,399 ---- if (buf != NULL) { /* We're in a framework. */ ! /* See if we might be in the build directory. The framework in the ! ** build directory is incomplete, it only has the .dylib and a few ! ** needed symlinks, it doesn't have the Lib directories and such. ! ** If we're running with the framework from the build directory we must ! ** be running the interpreter in the build directory, so we use the ! ** build-directory-specific logic to find Lib and such. ! */ ! strncpy(argv0_path, buf, MAXPATHLEN); ! reduce(argv0_path); ! joinpath(argv0_path, lib_python); ! joinpath(argv0_path, LANDMARK); ! if (!ismodule(argv0_path)) { ! /* We are in the build directory so use the name of the ! executable - we know that the absolute path is passed */ ! strncpy(progpath, prog, MAXPATHLEN); ! } ! else { ! /* Use the location of the library as the progpath */ ! strncpy(progpath, buf, MAXPATHLEN); ! } } else { From jackjansen@users.sourceforge.net Wed Aug 15 02:26:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 14 Aug 2001 18:26:30 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.50,1.51 configure.in,1.244,1.245 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv3805 Modified Files: Makefile.pre.in configure.in Log Message: Lots of changes in the framework support: - Made framework builds work for MacOSX. The configure arg is now "--enable-framework". - Added an install target frameworkinstall which installs the framework. - Ripped out Next/OpenStep support, which was broken anyway. - Made the MacOSX toolbox glue dependant on a --enable-toolbox-glue configure arg. This should make naked darwin build work again (untested). A few targets have been added to Makefile.pre.in, and on inspection they look harmless to non-MacOSX machines, but it is worth checking. Closes bug #420601 and patch #450350. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Makefile.pre.in 2001/08/10 20:18:26 1.50 --- Makefile.pre.in 2001/08/15 01:26:28 1.51 *************** *** 102,105 **** --- 102,111 ---- EXE= @EXEEXT@ + # Short name and location for Mac OS X Python framework + PYTHONFRAMEWORK= @PYTHONFRAMEWORK@ + PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@ + PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@ + PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@ + # Modes for directories, executables and data files created by the # install process. Default to user-only-writable for all file types. *************** *** 127,131 **** --- 133,139 ---- LIBRARY= @LIBRARY@ LDLIBRARY= @LDLIBRARY@ + BLDLIBRARY= @BLDLIBRARY@ DLLLIBRARY= @DLLLIBRARY@ + LDLIBRARYDIR= @LDLIBRARYDIR@ *************** *** 281,285 **** $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ Modules/$(MAINOBJ) \ ! $(LDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(PYTHON) --- 289,293 ---- $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ Modules/$(MAINOBJ) \ ! $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(PYTHON) *************** *** 330,334 **** # This rule is here for OPENSTEP/Rhapsody/MacOSX ! libpython$(VERSION).dylib: $(LIBRARY) libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \ -framework System @LIBTOOL_CRUFT@ --- 338,342 ---- # This rule is here for OPENSTEP/Rhapsody/MacOSX ! $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): $(LIBRARY) $(PYTHONFRAMEWORKDIR) libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \ -framework System @LIBTOOL_CRUFT@ *************** *** 632,635 **** --- 640,644 ---- export PATH; PATH="`pwd`:$$PATH"; \ export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ + export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ export EXE; EXE="$(EXE)"; \ cd $(srcdir)/Lib/$(PLATDIR); ./regen *************** *** 666,671 **** done @if test -d $(LDLIBRARY); then :; else \ ! $(INSTALL_DATA) $(LDLIBRARY) $(LIBPL)/$(LDLIBRARY) ; \ ! $(RANLIB) $(LIBPL)/$(LDLIBRARY) ; \ fi $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c --- 675,684 ---- done @if test -d $(LDLIBRARY); then :; else \ ! if test -z "$(PYTHONFRAMEWORKDIR)"; then \ ! $(INSTALL_DATA) $(LDLIBRARY) $(LIBPL)/$(LDLIBRARY) ; \ ! $(RANLIB) $(LIBPL)/$(LDLIBRARY) ; \ ! else \ ! echo Skip install of $(LDLIBRARY) - use make frameworkinstall; \ ! fi; \ fi $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c *************** *** 712,715 **** --- 725,786 ---- --install-platlib=$(DESTSHARED) + # Install a MacOSX framework During build (before + # setup.py), make a minimal Python.framework directory structure in the build + # directory. This framework is minimal, it doesn't contain the Lib directory + # and such, but together with some magic in Modules/getpath.c it is good enough + # to run python from the install dir. + + FRAMEWORKDEST=$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION) + RESSRCDIR=$(srcdir)/Mac/OSXResources/framework + $(PYTHONFRAMEWORKDIR): $(RESSRCDIR)/Info.plist \ + $(RESSRCDIR)/version.plist \ + $(RESSRCDIR)/English.lproj/InfoPlist.strings + @if test -z "$(PYTHONFRAMEWORKDIR)"; then \ + echo Not configured with --enable-framework; \ + exit; \ + else true; \ + fi + $(INSTALL) -d -m $(DIRMODE) $(FRAMEWORKDEST)/Resources/English.lproj + $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKDEST)/Resources/Info.plist + $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKDEST)/Resources/version.plist + $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ + $(FRAMEWORKDEST)/Resources/English.lproj/InfoPlist.strings + $(LN) -fs $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current + $(LN) -fs Versions/Current/Python $(PYTHONFRAMEWORKDIR)/Python + $(LN) -fs Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers + $(LN) -fs Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources + + # On install, we re-make the framework + # structure in the install location, /Library/Frameworks/ or the argument to + # --enable-framework. If --enable-framework has been specified then we have + # automatically set prefix to the location deep down in the framework, so we + # only have to cater for the structural bits of the framework. + + frameworkinstall: install frameworkinfrastructureinstall + FRAMEWORKFINALDEST=$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION) + frameworkinfrastructureinstall: $(LDLIBRARY) + @if test -z "$(PYTHONFRAMEWORKDIR)"; then \ + echo Not configured with --enable-framework; \ + exit; \ + else true; \ + fi + @for i in $(FRAMEWORKFINALDEST)/Resources/English.lproj $(FRAMEWORKFINALDEST)/lib; do\ + if test ! -d $$i; then \ + echo "Creating directory $$i"; \ + $(INSTALL) -d -m $(DIRMODE) $$i; \ + else true; \ + fi; \ + done + $(LN) -sf $(FRAMEWORKFINALDEST)/Headers $(INCLUDEPY) + $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKFINALDEST)/Resources/Info.plist + $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKFINALDEST)/Resources/version.plist + $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ + $(FRAMEWORKFINALDEST)/Resources/English.lproj/InfoPlist.strings + $(LN) -fs $(VERSION) $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current + $(LN) -fs Versions/Current/Python $(PYTHONFRAMEWORKINSTALLDIR)/Python + $(LN) -fs Versions/Current/Headers $(PYTHONFRAMEWORKINSTALLDIR)/Headers + $(LN) -fs Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources + $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) + # Build the toplevel Makefile Makefile.pre: Makefile.pre.in config.status Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.244 retrieving revision 1.245 diff -C2 -d -r1.244 -r1.245 *** configure.in 2001/08/10 20:29:40 1.244 --- configure.in 2001/08/15 01:26:28 1.245 *************** *** 13,50 **** CONFIG_ARGS="$ac_configure_args" - # NEXTSTEP|MacOSX|Darwin stuff - if test -f /usr/lib/NextStep/software_version -o -f /System/Library/CoreServices/software_version ; then - - AC_MSG_CHECKING(for --with-next-archs) - AC_ARG_WITH(next-archs, - [ --with-next-archs='arch1 arch2 ..' build MAB binary], [ - if test -n "$withval"; then - ac_arch_flags=`/usr/lib/arch_tool -archify_list $withval` - # GCC does not currently support multi archs on the NeXT - with_gcc=no - fi - AC_MSG_RESULT($with_next_archs) - ], [AC_MSG_RESULT(none: using `arch`)]) - - if test -z "$MACHDEP" - then - ac_sys_system=`uname -s` - if test "$ac_sys_system" = "Darwin" ; then - ac_sys_release=`uname -r` - else - set X `hostinfo | egrep '(NeXT Mach|Kernel Release).*:' | \ - sed -e 's/://' -e 's/\./_/'` && \ - ac_sys_system=next && ac_sys_release=$4 - fi - - MACHDEP="$ac_sys_system$ac_sys_release" - fi - fi ! AC_ARG_WITH(next-framework, ! [ --with-next-framework Build (OpenStep|Rhapsody|MacOSX|Darwin) framework],,) ! AC_ARG_WITH(dyld, ! [ --with-dyld Use (OpenStep|Rhapsody) dynamic linker],,) # Set name for machine-dependent library files AC_SUBST(MACHDEP) --- 13,46 ---- CONFIG_ARGS="$ac_configure_args" ! AC_ARG_ENABLE(framework, ! [ --enable-framework[=INSTALLDIR] Build (MacOSX|Darwin) framework],[ ! PYTHONFRAMEWORK=Python ! PYTHONFRAMEWORKDIR=Python.framework ! case $enableval in ! yes) ! enableval=/Library/Frameworks ! PYTHONFRAMEWORKPREFIX=$enableval ! ;; ! *) ! PYTHONFRAMEWORKPREFIX=$enableval ! esac ! PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR ! prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION ! ],[ ! PYTHONFRAMEWORK= ! PYTHONFRAMEWORKDIR= ! PYTHONFRAMEWORKPREFIX= ! PYTHONFRAMEWORKINSTALLDIR= ! enable_framework= ! ]) ! AC_SUBST(PYTHONFRAMEWORK) ! AC_SUBST(PYTHONFRAMEWORKDIR) ! AC_SUBST(PYTHONFRAMEWORKPREFIX) ! AC_SUBST(PYTHONFRAMEWORKINSTALLDIR) + ##AC_ARG_WITH(dyld, + ##[ --with-dyld Use (OpenStep|Rhapsody) dynamic linker],,) + ## # Set name for machine-dependent library files AC_SUBST(MACHDEP) *************** *** 225,236 **** # LDLIBRARY is the name of the library to link against (as opposed to the ! # name of the library into which to insert object files). On systems ! # without shared libraries, LDLIBRARY is the same as LIBRARY (defined in ! # the Makefiles). On Cygwin LDLIBRARY is the import library, DLLLIBRARY is the ! # shared (i.e., DLL) library. AC_SUBST(LDLIBRARY) AC_SUBST(DLLLIBRARY) LDLIBRARY="$LIBRARY" DLLLIBRARY='' # LINKCC is the command that links the python executable -- default is $(CC). --- 221,240 ---- # LDLIBRARY is the name of the library to link against (as opposed to the ! # name of the library into which to insert object files). BLDLIBRARY is also ! # the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY ! # is blank as the main program is not linked directly against LDLIBRARY. ! # LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On ! # systems without shared libraries, LDLIBRARY is the same as LIBRARY ! # (defined in the Makefiles). On Cygwin LDLIBRARY is the import library, ! # DLLLIBRARY is the shared (i.e., DLL) library. ! # AC_SUBST(LDLIBRARY) AC_SUBST(DLLLIBRARY) + AC_SUBST(BLDLIBRARY) + AC_SUBST(LDLIBRARYDIR) LDLIBRARY="$LIBRARY" + BLDLIBRARY='$(LDLIBRARY)' DLLLIBRARY='' + LDLIBRARYDIR='' # LINKCC is the command that links the python executable -- default is $(CC). *************** *** 255,266 **** AC_MSG_CHECKING(LDLIBRARY) - # NeXT framework builds require that the 'ar' library be converted into - # a bundle using libtool. - if test "$with_next_framework" - then - LDLIBRARY='libpython$(VERSION).dylib' - DLLLIBRARY=$LDLIBRARY - fi - # DG/UX requires some fancy ld contortions to produce a .so from an .a case $MACHDEP in --- 259,262 ---- *************** *** 277,280 **** --- 273,291 ---- ;; esac + + # MacOSX framework builds need more magic. LDLIBRARY is the dynamic library that + # we build, but we do not want to link against it (we will find it with a -framework + # option). For this reason there is an extra variable BLDLIBRARY against which Python + # and the extension modules are linked, BLDLIBRARY. This is normally the same + # as LDLIBRARY, but empty for MacOSX framework builds. + if test "$enable_framework" + then + LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' + LDLIBRARYDIR='$(PYTHONFRAMEWORKDIR)' + BLDLIBRARY='' + else + BLDLIBRARY='$(LDLIBRARY)' + fi + AC_MSG_RESULT($LDLIBRARY) *************** *** 541,565 **** CC="$ac_save_cc" ! # Minor variations in building a framework between NextStep versions 4 and 5 AC_SUBST(LIBTOOL_CRUFT) case $ac_sys_system/$ac_sys_release in Darwin/*) - ns_undef_sym='_environ' - LIBTOOL_CRUFT="-framework Foundation -framework Carbon -lcc_dynamic -arch_only ppc -U $ns_undef_sym" ;; - next/4*) - ns_undef_sym='__environ' - LIBTOOL_CRUFT="-U $ns_undef_sym" ;; - next/5*) ns_undef_sym='_environ' ! LIBTOOL_CRUFT="-lcc_dynamic -U $ns_undef_sym" ;; esac ! AC_MSG_CHECKING(for --with-next-framework) ! if test "$with_next_framework" then OPT="$OPT -fno-common -dynamic" # -U __environ is needed since bundles don't have access # to crt0 when built but will always be linked against it ! LDFLAGS="$LDFLAGS -Wl,-U,$ns_undef_sym" AC_DEFINE(WITH_NEXT_FRAMEWORK) AC_MSG_RESULT(yes) --- 552,601 ---- CC="$ac_save_cc" ! AC_MSG_CHECKING(for --enable-toolbox-glue) ! AC_ARG_ENABLE(toolbox-glue, ! [ --enable-toolbox-glue disable/enable MacOSX glue code for extensions]) ! ! if test -z "$enable_toolbox_glue" ! then ! case $ac_sys_system/$ac_sys_release in ! Darwin/*) ! enable_toolbox_glue="yes";; ! *) ! enable_toolbox_glue="no";; ! esac ! fi ! case "$enable_toolbox_glue" in ! yes) ! extra_frameworks="-framework Carbon -framework Foundation" ! extra_machdep_objs="Python/mactoolboxglue.o" ! AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE) ! ;; ! *) ! extra_frameworks="" ! extra_machdep_objs="" ! ;; ! esac ! AC_MSG_RESULT($enable_toolbox_glue) ! AC_SUBST(LIBTOOL_CRUFT) case $ac_sys_system/$ac_sys_release in Darwin/*) ns_undef_sym='_environ' ! LIBTOOL_CRUFT="-lcc_dynamic -arch_only ppc -U $ns_undef_sym" ! LIBTOOL_CRUFT="$LIBTOOL_CRUFT $extra_frameworks" ! LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Python' ! LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; esac ! AC_MSG_CHECKING(for --enable-framework) ! if test "$enable_framework" then OPT="$OPT -fno-common -dynamic" # -U __environ is needed since bundles don't have access # to crt0 when built but will always be linked against it ! # -F. is needed to allow linking to the framework while ! # in the build location. ! ! LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-U,$ns_undef_sym" AC_DEFINE(WITH_NEXT_FRAMEWORK) AC_MSG_RESULT(yes) *************** *** 568,572 **** fi ! AC_MSG_CHECKING(for --with-dyld) case $ac_sys_system/$ac_sys_release in Darwin/*) --- 604,608 ---- fi ! AC_MSG_CHECKING(for dyld) case $ac_sys_system/$ac_sys_release in Darwin/*) *************** *** 575,591 **** ;; *) ! if test "$with_next_framework" -o "$with_dyld" ! then ! if test "$with_dyld" ! then ! AC_MSG_RESULT(yes) ! else ! AC_MSG_RESULT(required for framework build) ! fi ! AC_DEFINE(WITH_DYLD) ! ns_dyld='set' ! else ! AC_MSG_RESULT(no) ! fi ;; esac --- 611,616 ---- ;; *) ! AC_MSG_RESULT(no) ! ;; esac *************** *** 635,650 **** OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; DYNIX/ptx*) LDSHARED="ld -G";; ! Darwin/*) ! LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress' ! if test "$with_next_framework" ; then ! LDSHARED="$LDSHARED \$(LDLIBRARY)" ! fi ;; ! next/*) ! if test "$ns_dyld" ! then LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress' ! else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r'; ! fi ! if test "$with_next_framework" ; then ! LDSHARED="$LDSHARED \$(LDLIBRARY)" fi ;; Linux*) LDSHARED="gcc -shared";; --- 660,671 ---- OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; DYNIX/ptx*) LDSHARED="ld -G";; ! Darwin/*) ! LDSHARED='$(CC) $(LDFLAGS) -bundle' ! if test "$enable_framework" ; then ! # Link against the framework. All externals should be defined. ! LDSHARED="$LDSHARED "'-framework $(PYTHONFRAMEWORK)' ! else ! # No framework. Ignore undefined symbols, assuming they come from Python ! LDSHARED="$LDSHARED -undefined suppress" fi ;; Linux*) LDSHARED="gcc -shared";; *************** *** 723,733 **** Linux*) LINKFORSHARED="-Xlinker -export-dynamic";; # -u libsys_s pulls in all symbols in libsys ! next/2*|next/3*) LINKFORSHARED="-u libsys_s";; ! # -u __dummy makes the linker aware of the objc runtime ! # in System.framework; otherwise, __objcInit (referenced in ! # crt1.o) gets erroneously defined as common, which breaks dynamic ! # loading of any modules which reference it in System.framework ! next/4*|next/5*) LINKFORSHARED="-u __dummy -framework System" ;; ! Darwin/*) LINKFORSHARED="-u __dummy -u _PyMac_Error -framework System -framework Foundation -framework Carbon" ;; UnixWare*) LINKFORSHARED="-Wl,-Bexport";; SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; --- 744,761 ---- Linux*) LINKFORSHARED="-Xlinker -export-dynamic";; # -u libsys_s pulls in all symbols in libsys ! Darwin/*) ! # -u __dummy makes the linker aware of the objc runtime ! # in System.framework; otherwise, __objcInit (referenced in ! # crt1.o) gets erroneously defined as common, which breaks dynamic ! # loading of any modules which reference it in System.framework. ! # -u _PyMac_Error is needed to pull in the mac toolbox glue, which is ! # not used by the core itself but which needs to be in the core so ! # that dynamically loaded extension modules have access to it. ! LINKFORSHARED="-u __dummy -u _PyMac_Error -framework System" ! if test "$enable_framework" ! then ! LINKFORSHARED="$LINKFORSHARED -framework Python" ! fi ! LINKFORSHARED="$LINKFORSHARED $extra_frameworks";; UnixWare*) LINKFORSHARED="-Wl,-Bexport";; SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; *************** *** 1175,1179 **** BeOS*) DYNLOADFILE="dynload_beos.o";; hp*|HP*) DYNLOADFILE="dynload_hpux.o";; ! Darwin/*|next/*) DYNLOADFILE="dynload_next.o";; *) # use dynload_shlib.c and dlopen() if we have it; otherwise stub --- 1203,1207 ---- BeOS*) DYNLOADFILE="dynload_beos.o";; hp*|HP*) DYNLOADFILE="dynload_hpux.o";; ! Darwin/*) DYNLOADFILE="dynload_next.o";; *) # use dynload_shlib.c and dlopen() if we have it; otherwise stub *************** *** 1198,1210 **** if test -z "$MACHDEP_OBJS" then ! case $ac_sys_system/$ac_sys_release in ! Darwin/*) ! MACHDEP_OBJS="Python/mactoolboxglue.o" ! AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE) ! ;; ! *) MACHDEP_OBJS="";; ! esac fi ! AC_MSG_RESULT($DYNLOADFILE) # checks for library functions --- 1226,1234 ---- if test -z "$MACHDEP_OBJS" then ! MACHDEP_OBJS=$extra_machdep_objs ! else ! MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs" fi ! AC_MSG_RESULT(MACHDEP_OBJS) # checks for library functions *************** *** 1564,1568 **** case $ac_sys_system in Darwin) ;; - next) ;; BeOS) ;; *) LIBM=-lm --- 1588,1591 ---- From jackjansen@users.sourceforge.net Wed Aug 15 02:27:16 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 14 Aug 2001 18:27:16 -0700 Subject: [Python-checkins] CVS: python/dist/src configure,1.235,1.236 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv5800 Modified Files: configure Log Message: Oops, forgot to check in configure. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.235 retrieving revision 1.236 diff -C2 -d -r1.235 -r1.236 *** configure 2001/08/10 20:29:40 1.235 --- configure 2001/08/15 01:27:14 1.236 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.243 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.244 [...3854 lines suppressed...] *************** *** 7190,7193 **** --- 7204,7211 ---- s%@VERSION@%$VERSION%g s%@CONFIG_ARGS@%$CONFIG_ARGS%g + s%@PYTHONFRAMEWORK@%$PYTHONFRAMEWORK%g + s%@PYTHONFRAMEWORKDIR@%$PYTHONFRAMEWORKDIR%g + s%@PYTHONFRAMEWORKPREFIX@%$PYTHONFRAMEWORKPREFIX%g + s%@PYTHONFRAMEWORKINSTALLDIR@%$PYTHONFRAMEWORKINSTALLDIR%g s%@MACHDEP@%$MACHDEP%g s%@SGI_ABI@%$SGI_ABI%g *************** *** 7200,7203 **** --- 7218,7223 ---- s%@LDLIBRARY@%$LDLIBRARY%g s%@DLLLIBRARY@%$DLLLIBRARY%g + s%@BLDLIBRARY@%$BLDLIBRARY%g + s%@LDLIBRARYDIR@%$LDLIBRARYDIR%g s%@LINKCC@%$LINKCC%g s%@RANLIB@%$RANLIB%g From tim_one@users.sourceforge.net Wed Aug 15 05:40:25 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 14 Aug 2001 21:40:25 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0255.txt,1.15,1.16 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv9866 Modified Files: pep-0255.txt Log Message: Tie a couple loose ends so Barry can put this to bed. Index: pep-0255.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0255.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pep-0255.txt 2001/07/17 04:28:28 1.15 --- pep-0255.txt 2001/08/15 04:40:23 1.16 *************** *** 170,173 **** --- 170,186 ---- purpose to bear. + Restriction: A generator cannot be resumed while it is actively + running: + + >>> def g(): + ... i = me.next() + ... yield i + >>> me = g() + >>> me.next() + Traceback (most recent call last): + ... + File "", line 2, in g + ValueError: generator already executing + Specification: Return *************** *** 383,388 **** >> 3 << 3 ! A: Did I miss one ? Out of hundreds of messages, I counted two suggesting such an alternative, and extracted the above from them. It would be nice not to need a new keyword, but nicer to make yield --- 396,402 ---- >> 3 << 3 + * 3 ! A: Did I miss one ? Out of hundreds of messages, I counted three suggesting such an alternative, and extracted the above from them. It would be nice not to need a new keyword, but nicer to make yield *************** *** 448,454 **** Reference Implementation ! The current implementation, in a preliminary state (no docs), is part ! of Python's CVS development tree[9]. Using this requires that you ! build Python from source. This was derived from an earlier patch by Neil Schemenauer[7]. --- 462,468 ---- Reference Implementation ! The current implementation, in a preliminary state (no docs, but well ! tested and solid), is part of Python's CVS development tree[9]. Using ! this requires that you build Python from source. This was derived from an earlier patch by Neil Schemenauer[7]. From tim_one@users.sourceforge.net Wed Aug 15 05:41:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 14 Aug 2001 21:41:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_generators.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv9992/python/Lib/test Modified Files: test_generators.py Log Message: Move one of the tests into the "PEP 255" section, to reflect a change in the PEP. Index: test_generators.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_generators.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test_generators.py 2001/08/10 21:25:24 1.25 --- test_generators.py 2001/08/15 04:41:19 1.26 *************** *** 138,141 **** --- 138,156 ---- pep_tests = """ + Specification: Yield + + Restriction: A generator cannot be resumed while it is actively + running: + + >>> def g(): + ... i = me.next() + ... yield i + >>> me = g() + >>> me.next() + Traceback (most recent call last): + ... + File "", line 2, in g + ValueError: generator already executing + Specification: Return *************** *** 310,325 **** >>> list(g()) [1, 2, 3] - - A generator can't be resumed while it's already running. - - >>> def g(): - ... i = me.next() - ... yield i - >>> me = g() - >>> me.next() - Traceback (most recent call last): - ... - File "", line 2, in g - ValueError: generator already executing Next one was posted to c.l.py. --- 325,328 ---- From bwarsaw@users.sourceforge.net Wed Aug 15 06:46:42 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 14 Aug 2001 22:46:42 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.125,1.126 pep-0255.txt,1.16,1.17 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv18944 Modified Files: pep-0000.txt pep-0255.txt Log Message: After Tim's last cleanup, this baby's Final. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** pep-0000.txt 2001/08/15 00:06:02 1.125 --- pep-0000.txt 2001/08/15 05:46:40 1.126 *************** *** 108,112 **** SF 235 Import on Case-Insensitive Platforms Peters SF 236 Back to the __future__ Peters ! S 255 Simple Generators Schemenauer, et al SF 260 Simplify xrange() van Rossum S 261 Support for "wide" Unicode characters Prescod --- 108,112 ---- SF 235 Import on Case-Insensitive Platforms Peters SF 236 Back to the __future__ Peters ! SF 255 Simple Generators Schemenauer, et al SF 260 Simplify xrange() van Rossum S 261 Support for "wide" Unicode characters Prescod *************** *** 202,206 **** S 253 Subtyping Built-in Types van Rossum S 254 Making Classes Look More Like Types van Rossum ! S 255 Simple Generators Schemenauer, et al S 256 Docstring Processing System Framework Goodger S 257 Docstring Conventions Goodger, van Rossum --- 202,206 ---- S 253 Subtyping Built-in Types van Rossum S 254 Making Classes Look More Like Types van Rossum ! SF 255 Simple Generators Schemenauer, et al S 256 Docstring Processing System Framework Goodger S 257 Docstring Conventions Goodger, van Rossum Index: pep-0255.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0255.txt,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pep-0255.txt 2001/08/15 04:40:23 1.16 --- pep-0255.txt 2001/08/15 05:46:40 1.17 *************** *** 6,10 **** magnus@hetland.org (Magnus Lie Hetland) Discussion-To: python-iterators@lists.sourceforge.net ! Status: Draft Type: Standards Track Requires: 234 --- 6,10 ---- magnus@hetland.org (Magnus Lie Hetland) Discussion-To: python-iterators@lists.sourceforge.net ! Status: Final Type: Standards Track Requires: 234 From tim_one@users.sourceforge.net Wed Aug 15 07:06:46 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 14 Aug 2001 23:06:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.203,1.204 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv21438/misc Modified Files: NEWS Log Message: Add blurb about cleanfuture.py. Fix misspelling in an older item. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.203 retrieving revision 1.204 diff -C2 -d -r1.203 -r1.204 *** NEWS 2001/08/14 18:35:02 1.203 --- NEWS 2001/08/15 06:06:44 1.204 *************** *** 2,5 **** --- 2,11 ---- =========================== + Tools + + - The new Tools/scripts/cleanfuture.py can be used to automatically + edit out obsolute future statements from Python source code. See + the module docstring for details. + Tests *************** *** 26,30 **** - New class Differ and new functions ndiff() and restore() in difflib.py. These package the algorithms used by the popular Tools/scripts/ndiff.py, ! for progammatic reuse. - New function xml.sax.saxutils.quoteattr(): Quote an XML attribute --- 32,36 ---- - New class Differ and new functions ndiff() and restore() in difflib.py. These package the algorithms used by the popular Tools/scripts/ndiff.py, ! for programmatic reuse. - New function xml.sax.saxutils.quoteattr(): Quote an XML attribute From tim_one@users.sourceforge.net Wed Aug 15 07:07:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 14 Aug 2001 23:07:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts cleanfuture.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory usw-pr-cvs1:/tmp/cvs-serv21538/scripts Modified Files: cleanfuture.py Log Message: Fix typo in module docstring. Index: cleanfuture.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/cleanfuture.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cleanfuture.py 2001/08/13 05:33:53 1.2 --- cleanfuture.py 2001/08/15 06:07:42 1.3 *************** *** 19,23 **** does change a file, the changed file is a fixed-point (i.e., running cleanfuture on the resulting .py file won't change it again, at least not ! until you try it again with a m later Python release). Limitations: You can do these things, but this tool won't help you then: --- 19,23 ---- does change a file, the changed file is a fixed-point (i.e., running cleanfuture on the resulting .py file won't change it again, at least not ! until you try it again with a later Python release). Limitations: You can do these things, but this tool won't help you then: From tim_one@users.sourceforge.net Wed Aug 15 07:10:19 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 14 Aug 2001 23:10:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild installer.bmp,1.1,1.2 python20.wse,1.82,1.83 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv21590/pcbuild Modified Files: installer.bmp python20.wse Log Message: New, larger installer bitmap from Erik van Blokland. Added more vertical whitespace to the acknowledgements portion of the "Installation Completed!" screen for easier reading. Index: installer.bmp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/installer.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsnHgBHd and /tmp/cvsgYtzxj differ Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** python20.wse 2001/08/11 04:01:31 1.82 --- python20.wse 2001/08/15 06:10:16 1.83 *************** *** 2854,2858 **** end item: Static ! Rectangle=108 10 323 40 Create Flags=01010000000000000000000000000000 Flags=0000000000000001 --- 2854,2858 ---- end item: Static ! Rectangle=108 10 323 48 Create Flags=01010000000000000000000000000000 Flags=0000000000000001 *************** *** 2866,2870 **** end item: Static ! Rectangle=108 48 320 86 Create Flags=01010000000000000000000000000000 Text=%APPTITLE% has been successfully installed. --- 2866,2870 ---- end item: Static ! Rectangle=108 44 320 82 Create Flags=01010000000000000000000000000000 Text=%APPTITLE% has been successfully installed. *************** *** 2890,2894 **** end item: Static ! Rectangle=106 123 308 213 Enabled Color=00000000000000001111111111111111 Create Flags=01010000000000000000000000000000 --- 2890,2894 ---- end item: Static ! Rectangle=106 105 312 210 Enabled Color=00000000000000001111111111111111 Create Flags=01010000000000000000000000000000 *************** *** 2898,2908 **** Text= http://www.wisesolutions.com/ Text= Text=LettError, Erik van Blokland, for the Python for Windows graphic. Text= http://www.letterror.com/ Text= Text=Mark Hammond, without whose years of freely shared Windows expertise, Python for Windows would still be Python for DOS. end item: Static ! Rectangle=106 114 312 115 Action=3 Enabled Color=00000000000000001111111111111111 --- 2898,2910 ---- Text= http://www.wisesolutions.com/ Text= + Text= Text=LettError, Erik van Blokland, for the Python for Windows graphic. Text= http://www.letterror.com/ Text= + Text= Text=Mark Hammond, without whose years of freely shared Windows expertise, Python for Windows would still be Python for DOS. end item: Static ! Rectangle=106 95 312 96 Action=3 Enabled Color=00000000000000001111111111111111 From jackjansen@users.sourceforge.net Wed Aug 15 13:07:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 15 Aug 2001 05:07:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib site.py,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22500/python/Lib Modified Files: site.py Log Message: Don't remove non-directories from sys.path on the mac: files can be on sys.path too. Index: site.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** site.py 2001/07/20 20:06:17 1.32 --- site.py 2001/08/15 12:07:46 1.33 *************** *** 81,86 **** for dir in sys.path: # Filter out paths that don't exist, but leave in the empty string ! # since it's a special case. ! if dir and not os.path.isdir(dir): continue dir, dircase = makepath(dir) --- 81,87 ---- for dir in sys.path: # Filter out paths that don't exist, but leave in the empty string ! # since it's a special case. Except on the mac, where files are legal ! # in sys.path. ! if dir and not os.path.isdir(dir) and sys.platform != 'mac': continue dir, dircase = makepath(dir) From jackjansen@users.sourceforge.net Wed Aug 15 14:17:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 15 Aug 2001 06:17:48 -0700 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv3170 Modified Files: setup.py Log Message: On OSX we should not pass the -shared option to ld: it make the build of audioop and cmath fail. Removing it seems to have no adverse consequences. Closes bug #450510. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** setup.py 2001/08/10 08:56:17 1.47 --- setup.py 2001/08/15 13:17:45 1.48 *************** *** 142,146 **** args['compiler_so'] = compiler + ' ' + opt + ' ' + ccshared if linker_so is not None: ! args['linker_so'] = linker_so + ' -shared' self.compiler.set_executables(**args) --- 142,149 ---- args['compiler_so'] = compiler + ' ' + opt + ' ' + ccshared if linker_so is not None: ! if platform == 'darwin1': ! args['linker_so'] = linker_so ! else: ! args['linker_so'] = linker_so + ' -shared' self.compiler.set_executables(**args) From jackjansen@users.sourceforge.net Wed Aug 15 14:55:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 15 Aug 2001 06:55:18 -0700 Subject: [Python-checkins] CVS: python/dist/src configure.in,1.245,1.246 configure,1.236,1.237 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv11002 Modified Files: configure.in configure Log Message: MacOSX: if we're building without --enable-toolbox-glue don't attempt to include _PyMac_Error. Also don't try to include __dummy: it needs Foundation and I think (not 100% sure) that this isn't part of naked Darwin. Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.245 retrieving revision 1.246 diff -C2 -d -r1.245 -r1.246 *** configure.in 2001/08/15 01:26:28 1.245 --- configure.in 2001/08/15 13:55:15 1.246 *************** *** 569,572 **** --- 569,573 ---- extra_frameworks="-framework Carbon -framework Foundation" extra_machdep_objs="Python/mactoolboxglue.o" + extra_undefs="-u __dummy -u _PyMac_Error" AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE) ;; *************** *** 574,577 **** --- 575,579 ---- extra_frameworks="" extra_machdep_objs="" + extra_undefs="" ;; esac *************** *** 752,756 **** # not used by the core itself but which needs to be in the core so # that dynamically loaded extension modules have access to it. ! LINKFORSHARED="-u __dummy -u _PyMac_Error -framework System" if test "$enable_framework" then --- 754,758 ---- # not used by the core itself but which needs to be in the core so # that dynamically loaded extension modules have access to it. ! LINKFORSHARED="$extra_undefs -framework System" if test "$enable_framework" then Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.236 retrieving revision 1.237 diff -C2 -d -r1.236 -r1.237 *** configure 2001/08/15 01:27:14 1.236 --- configure 2001/08/15 13:55:15 1.237 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.244 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.245 [...2951 lines suppressed...] if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7060,7064 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7063: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7062,7066 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7065: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then From fdrake@users.sourceforge.net Wed Aug 15 15:35:15 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 15 Aug 2001 07:35:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/doc compiler.tex,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/doc In directory usw-pr-cvs1:/tmp/cvs-serv21237 Modified Files: compiler.tex Log Message: Fix small markup consistency nits. Index: compiler.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/doc/compiler.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** compiler.tex 2001/08/14 22:38:03 1.2 --- compiler.tex 2001/08/15 14:35:13 1.3 *************** *** 76,80 **** \begin{funcdesc}{parseFile}{path} Return an abstract syntax tree for the Python source code in the file ! specified by \var{path}. It is equivalent to \code{parse(open(path).read())}. \end{funcdesc} --- 76,81 ---- \begin{funcdesc}{parseFile}{path} Return an abstract syntax tree for the Python source code in the file ! specified by \var{path}. It is equivalent to ! \code{parse(open(\var{path}).read())}. \end{funcdesc} *************** *** 164,168 **** \begin{methoddesc}{getChildNodes}{} Returns a flattened list of the child nodes in the order they ! occur. This method is like \method{getChildNodes}, except that it only returns those children that are \class{Node} instances. \end{methoddesc} --- 165,169 ---- \begin{methoddesc}{getChildNodes}{} Returns a flattened list of the child nodes in the order they ! occur. This method is like \method{getChildNodes()}, except that it only returns those children that are \class{Node} instances. \end{methoddesc} *************** *** 211,215 **** value is something other than an instance, the type is noted in the comment. The attributes are listed in the order in which they are ! returned by \method{getChildren} and \method{getChildNodes}. \input{asttable} --- 212,216 ---- value is something other than an instance, the type is noted in the comment. The attributes are listed in the order in which they are ! returned by \method{getChildren()} and \method{getChildNodes()}. \input{asttable} *************** *** 247,253 **** The \class{ASTVisitor} is responsible for walking over the tree in the correct order. A walk begins with a call to \method{preorder()}. For ! each node, it checks the \var{visitor} argument to \method{preorder{}} for a method named `visitNodeType,' where NodeType is the name of the ! node's class, e.g. for a \class{While} node a \method{visitWhile} would be called . If the method exists, it is called with the node as its first argument. --- 248,254 ---- The \class{ASTVisitor} is responsible for walking over the tree in the correct order. A walk begins with a call to \method{preorder()}. For ! each node, it checks the \var{visitor} argument to \method{preorder()} for a method named `visitNodeType,' where NodeType is the name of the ! node's class, e.g. for a \class{While} node a \method{visitWhile()} would be called . If the method exists, it is called with the node as its first argument. *************** *** 257,261 **** the visitor argument by adding a visit method to the visitor; this method can be used to visit a particular child node. If no visitor is ! found for a particular node type, the \method{default} method is called. --- 258,262 ---- the visitor argument by adding a visit method to the visitor; this method can be used to visit a particular child node. If no visitor is ! found for a particular node type, the \method{default()} method is called. *************** *** 279,283 **** The code generator is a visit that emits bytecodes. Each visit method ! can call the \method{emit} method to emit a new bytecode. The basic code generator is specialized for modules, classes, and functions. An assembler converts that emitted instructions to the low-level bytecode --- 280,284 ---- The code generator is a visit that emits bytecodes. Each visit method ! can call the \method{emit()} method to emit a new bytecode. The basic code generator is specialized for modules, classes, and functions. An assembler converts that emitted instructions to the low-level bytecode From bwarsaw@users.sourceforge.net Wed Aug 15 16:28:59 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 15 Aug 2001 08:28:59 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0009.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv2843 Modified Files: pep-0009.txt Log Message: A little bit of clarity and reorg. Index: pep-0009.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0009.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0009.txt 2001/08/14 23:58:54 1.1 --- pep-0009.txt 2001/08/15 15:28:57 1.2 *************** *** 25,34 **** form. How to Use This Template for Standard Track PEPs ! First, decide if your PEP is going to be Informational or ! Standards Track. Most PEPs are Standards Track; if yours is, then ! make a copy of this file and perform the following edits: - replace the "PEP: 9" header with "PEP: XXX" since you don't yet --- 25,41 ---- form. + To use this template you must first decide whether your PEP is + going to be Informational or Standards Track. Most PEPs are + Standards Track because they propose a new feature for the Python + language or standard library. When in doubt, read PEP 1 for + details. + + Once you've decided which type of PEP yours is going to be, follow + the directions in the appropriate section below. + How to Use This Template for Standard Track PEPs ! - Make a copy of this file and perform the following edits. - replace the "PEP: 9" header with "PEP: XXX" since you don't yet *************** *** 108,113 **** How to Use This Template for Informational PEPs ! If your PEP is an Information PEP, make a copy of this file and ! perform the following edits: - replace the "PEP: 9" header with "PEP: XXX" since you don't yet --- 115,119 ---- How to Use This Template for Informational PEPs ! - Make a copy of this file and perform the following edits. - replace the "PEP: 9" header with "PEP: XXX" since you don't yet From akuchling@users.sourceforge.net Wed Aug 15 16:54:58 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Wed, 15 Aug 2001 08:54:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.204,1.205 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv8805 Modified Files: NEWS Log Message: Fix typo Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.204 retrieving revision 1.205 diff -C2 -d -r1.204 -r1.205 *** NEWS 2001/08/15 06:06:44 1.204 --- NEWS 2001/08/15 15:54:56 1.205 *************** *** 5,9 **** - The new Tools/scripts/cleanfuture.py can be used to automatically ! edit out obsolute future statements from Python source code. See the module docstring for details. --- 5,9 ---- - The new Tools/scripts/cleanfuture.py can be used to automatically ! edit out obsolete future statements from Python source code. See the module docstring for details. From fdrake@users.sourceforge.net Wed Aug 15 17:44:58 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 15 Aug 2001 09:44:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules parsermodule.c,2.64,2.65 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv18771 Modified Files: parsermodule.c Log Message: Use the abstract object interfaces when digging around in module objects instead of directly manipulating the underlying dictionary. Index: parsermodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/parsermodule.c,v retrieving revision 2.64 retrieving revision 2.65 diff -C2 -d -r2.64 -r2.65 *** parsermodule.c 2001/07/19 20:17:15 2.64 --- parsermodule.c 2001/08/15 16:44:56 2.65 *************** *** 2817,2821 **** /* private stuff: support pickle module */ ! {"_pickler", (PyCFunction)parser__pickler, METH_VARARGS, "Returns the pickle magic to allow ST objects to be pickled."}, --- 2817,2821 ---- /* private stuff: support pickle module */ ! {"_pickler", (PyCFunction)parser__pickler, METH_VARARGS, "Returns the pickle magic to allow ST objects to be pickled."}, *************** *** 2829,2838 **** initparser(void) { ! PyObject* module; ! PyObject* dict; PyST_Type.ob_type = &PyType_Type; module = Py_InitModule("parser", parser_functions); - dict = PyModule_GetDict(module); if (parser_error == 0) --- 2829,2836 ---- initparser(void) { ! PyObject *module, *copyreg; PyST_Type.ob_type = &PyType_Type; module = Py_InitModule("parser", parser_functions); if (parser_error == 0) *************** *** 2840,2858 **** if ((parser_error == 0) ! || (PyDict_SetItemString(dict, "ParserError", parser_error) != 0)) { /* caller will check PyErr_Occurred() */ return; } Py_INCREF(&PyST_Type); ! PyDict_SetItemString(dict, "ASTType", (PyObject*)&PyST_Type); Py_INCREF(&PyST_Type); ! PyDict_SetItemString(dict, "STType", (PyObject*)&PyST_Type); ! PyDict_SetItemString(dict, "__copyright__", ! PyString_FromString(parser_copyright_string)); ! PyDict_SetItemString(dict, "__doc__", ! PyString_FromString(parser_doc_string)); ! PyDict_SetItemString(dict, "__version__", ! PyString_FromString(parser_version_string)); /* Register to support pickling. --- 2838,2856 ---- if ((parser_error == 0) ! || (PyModule_AddObject(module, "ParserError", parser_error) != 0)) { /* caller will check PyErr_Occurred() */ return; } Py_INCREF(&PyST_Type); ! PyModule_AddObject(module, "ASTType", (PyObject*)&PyST_Type); Py_INCREF(&PyST_Type); ! PyModule_AddObject(module, "STType", (PyObject*)&PyST_Type); ! PyModule_AddStringConstant(module, "__copyright__", ! parser_copyright_string); ! PyModule_AddStringConstant(module, "__doc__", ! parser_doc_string); ! PyModule_AddStringConstant(module, "__version__", ! parser_version_string); /* Register to support pickling. *************** *** 2860,2870 **** * exception will be raised here; should we clear the exception? */ ! module = PyImport_ImportModule("copy_reg"); ! if (module != NULL) { PyObject *func, *pickler; ! func = PyObject_GetAttrString(module, "pickle"); ! pickle_constructor = PyDict_GetItemString(dict, "sequence2st"); ! pickler = PyDict_GetItemString(dict, "_pickler"); Py_XINCREF(pickle_constructor); if ((func != NULL) && (pickle_constructor != NULL) --- 2858,2868 ---- * exception will be raised here; should we clear the exception? */ ! copyreg = PyImport_ImportModule("copy_reg"); ! if (copyreg != NULL) { PyObject *func, *pickler; ! func = PyObject_GetAttrString(copyreg, "pickle"); ! pickle_constructor = PyObject_GetAttrString(module, "sequence2st"); ! pickler = PyObject_GetAttrString(module, "_pickler"); Py_XINCREF(pickle_constructor); if ((func != NULL) && (pickle_constructor != NULL) *************** *** 2877,2881 **** } Py_XDECREF(func); ! Py_DECREF(module); } } --- 2875,2881 ---- } Py_XDECREF(func); ! Py_XDECREF(pickle_constructor); ! Py_XDECREF(pickler); ! Py_DECREF(copyreg); } } From fdrake@users.sourceforge.net Wed Aug 15 17:46:24 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 15 Aug 2001 09:46:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/doc astdocgen.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/doc In directory usw-pr-cvs1:/tmp/cvs-serv19150 Modified Files: astdocgen.py Log Message: Change the generated markup so that attribute names are properly marked. Index: astdocgen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/doc/astdocgen.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** astdocgen.py 2001/08/14 22:04:44 1.1 --- astdocgen.py 2001/08/15 16:46:22 1.2 *************** *** 21,25 **** for arg in node.argnames[1:]: ! print "\\lineiii{}{%s}{}" % arg print "\\hline", "\n" print "\\end{longtableiii}" --- 21,25 ---- for arg in node.argnames[1:]: ! print "\\lineiii{}{\\member{%s}}{}" % arg print "\\hline", "\n" print "\\end{longtableiii}" From fdrake@users.sourceforge.net Wed Aug 15 17:47:12 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 15 Aug 2001 09:47:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/doc asttable.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/doc In directory usw-pr-cvs1:/tmp/cvs-serv19336 Modified Files: asttable.tex Log Message: Properly mark attribute names in the table. Index: asttable.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/doc/asttable.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** asttable.tex 2001/08/14 22:04:44 1.1 --- asttable.tex 2001/08/15 16:47:10 1.2 *************** *** 1,50 **** \begin{longtableiii}{lll}{class}{Node type}{Attribute}{Value} ! \lineiii{Add}{left}{left operand} ! \lineiii{}{right}{right operand} \hline ! \lineiii{And}{nodes}{list of operands} \hline \lineiii{AssAttr}{}{\emph{attribute as target of assignment}} ! \lineiii{}{expr}{expression on the left-hand side of the dot} ! \lineiii{}{attrname}{the attribute name, a string} ! \lineiii{}{flags}{XXX} \hline ! \lineiii{AssList}{nodes}{list of list elements being assigned to} \hline ! \lineiii{AssName}{name}{name being assigned to} ! \lineiii{}{flags}{XXX} \hline ! \lineiii{AssTuple}{nodes}{list of tuple elements being assigned to} \hline ! \lineiii{Assert}{test}{the expression to be tested} ! \lineiii{}{fail}{the value of the \exception{AssertionError}} \hline ! \lineiii{Assign}{nodes}{a list of assignment targets, one per equal sign} ! \lineiii{}{expr}{the value being assigned} \hline ! \lineiii{AugAssign}{node}{} ! \lineiii{}{op}{} ! \lineiii{}{expr}{} \hline ! \lineiii{Backquote}{expr}{} \hline ! \lineiii{Bitand}{nodes}{} \hline ! \lineiii{Bitor}{nodes}{} \hline ! \lineiii{Bitxor}{nodes}{} \hline --- 1,50 ---- \begin{longtableiii}{lll}{class}{Node type}{Attribute}{Value} ! \lineiii{Add}{\member{left}}{left operand} ! \lineiii{}{\member{right}}{right operand} \hline ! \lineiii{And}{\member{nodes}}{list of operands} \hline \lineiii{AssAttr}{}{\emph{attribute as target of assignment}} ! \lineiii{}{\member{expr}}{expression on the left-hand side of the dot} ! \lineiii{}{\member{attrname}}{the attribute name, a string} ! \lineiii{}{\member{flags}}{XXX} \hline ! \lineiii{AssList}{\member{nodes}}{list of list elements being assigned to} \hline ! \lineiii{AssName}{\member{name}}{name being assigned to} ! \lineiii{}{\member{flags}}{XXX} \hline ! \lineiii{AssTuple}{\member{nodes}}{list of tuple elements being assigned to} \hline ! \lineiii{Assert}{\member{test}}{the expression to be tested} ! \lineiii{}{\member{fail}}{the value of the \exception{AssertionError}} \hline ! \lineiii{Assign}{\member{nodes}}{a list of assignment targets, one per equal sign} ! \lineiii{}{\member{expr}}{the value being assigned} \hline ! \lineiii{AugAssign}{\member{node}}{} ! \lineiii{}{\member{op}}{} ! \lineiii{}{\member{expr}}{} \hline ! \lineiii{Backquote}{\member{expr}}{} \hline ! \lineiii{Bitand}{\member{nodes}}{} \hline ! \lineiii{Bitor}{\member{nodes}}{} \hline ! \lineiii{Bitxor}{\member{nodes}}{} \hline *************** *** 52,72 **** \hline ! \lineiii{CallFunc}{node}{expression for the callee} ! \lineiii{}{args}{a list of arguments} ! \lineiii{}{star_args}{the extended *-arg value} ! \lineiii{}{dstar_args}{the extended **-arg value} \hline ! \lineiii{Class}{name}{the name of the class, a string} ! \lineiii{}{bases}{a list of base classes} ! \lineiii{}{doc}{doc string, a string or \code{None}} ! \lineiii{}{code}{the body of the class statement} \hline ! \lineiii{Compare}{expr}{} ! \lineiii{}{ops}{} \hline ! \lineiii{Const}{value}{} \hline --- 52,72 ---- \hline ! \lineiii{CallFunc}{\member{node}}{expression for the callee} ! \lineiii{}{\member{args}}{a list of arguments} ! \lineiii{}{\member{star_args}}{the extended *-arg value} ! \lineiii{}{\member{dstar_args}}{the extended **-arg value} \hline ! \lineiii{Class}{\member{name}}{the name of the class, a string} ! \lineiii{}{\member{bases}}{a list of base classes} ! \lineiii{}{\member{doc}}{doc string, a string or \code{None}} ! \lineiii{}{\member{code}}{the body of the class statement} \hline ! \lineiii{Compare}{\member{expr}}{} ! \lineiii{}{\member{ops}}{} \hline ! \lineiii{Const}{\member{value}}{} \hline *************** *** 74,85 **** \hline ! \lineiii{Dict}{items}{} \hline ! \lineiii{Discard}{expr}{} \hline ! \lineiii{Div}{left}{} ! \lineiii{}{right}{} \hline --- 74,85 ---- \hline ! \lineiii{Dict}{\member{items}}{} \hline ! \lineiii{Discard}{\member{expr}}{} \hline ! \lineiii{Div}{\member{left}}{} ! \lineiii{}{\member{right}}{} \hline *************** *** 87,178 **** \hline ! \lineiii{Exec}{expr}{} ! \lineiii{}{locals}{} ! \lineiii{}{globals}{} \hline ! \lineiii{For}{assign}{} ! \lineiii{}{list}{} ! \lineiii{}{body}{} ! \lineiii{}{else_}{} \hline ! \lineiii{From}{modname}{} ! \lineiii{}{names}{} \hline ! \lineiii{Function}{name}{name used in def, a string} ! \lineiii{}{argnames}{list of argument names, as strings} ! \lineiii{}{defaults}{list of default values} ! \lineiii{}{flags}{xxx} ! \lineiii{}{doc}{doc string, a string or \code{None}} ! \lineiii{}{code}{the body of the function} \hline ! \lineiii{Getattr}{expr}{} ! \lineiii{}{attrname}{} \hline ! \lineiii{Global}{names}{} \hline ! \lineiii{If}{tests}{} ! \lineiii{}{else_}{} \hline ! \lineiii{Import}{names}{} \hline ! \lineiii{Invert}{expr}{} \hline ! \lineiii{Keyword}{name}{} ! \lineiii{}{expr}{} \hline ! \lineiii{Lambda}{argnames}{} ! \lineiii{}{defaults}{} ! \lineiii{}{flags}{} ! \lineiii{}{code}{} \hline ! \lineiii{LeftShift}{left}{} ! \lineiii{}{right}{} \hline ! \lineiii{List}{nodes}{} \hline ! \lineiii{ListComp}{expr}{} ! \lineiii{}{quals}{} \hline ! \lineiii{ListCompFor}{assign}{} ! \lineiii{}{list}{} ! \lineiii{}{ifs}{} \hline ! \lineiii{ListCompIf}{test}{} \hline ! \lineiii{Mod}{left}{} ! \lineiii{}{right}{} \hline ! \lineiii{Module}{doc}{doc string, a string or \code{None}} ! \lineiii{}{node}{body of the module, a \class{Stmt}} \hline ! \lineiii{Mul}{left}{} ! \lineiii{}{right}{} \hline ! \lineiii{Name}{name}{} \hline ! \lineiii{Not}{expr}{} \hline ! \lineiii{Or}{nodes}{} \hline --- 87,178 ---- \hline ! \lineiii{Exec}{\member{expr}}{} ! \lineiii{}{\member{locals}}{} ! \lineiii{}{\member{globals}}{} \hline ! \lineiii{For}{\member{assign}}{} ! \lineiii{}{\member{list}}{} ! \lineiii{}{\member{body}}{} ! \lineiii{}{\member{else_}}{} \hline ! \lineiii{From}{\member{modname}}{} ! \lineiii{}{\member{names}}{} \hline ! \lineiii{Function}{\member{name}}{name used in def, a string} ! \lineiii{}{\member{argnames}}{list of argument names, as strings} ! \lineiii{}{\member{defaults}}{list of default values} ! \lineiii{}{\member{flags}}{xxx} ! \lineiii{}{\member{doc}}{doc string, a string or \code{None}} ! \lineiii{}{\member{code}}{the body of the function} \hline ! \lineiii{Getattr}{\member{expr}}{} ! \lineiii{}{\member{attrname}}{} \hline ! \lineiii{Global}{\member{names}}{} \hline ! \lineiii{If}{\member{tests}}{} ! \lineiii{}{\member{else_}}{} \hline ! \lineiii{Import}{\member{names}}{} \hline ! \lineiii{Invert}{\member{expr}}{} \hline ! \lineiii{Keyword}{\member{name}}{} ! \lineiii{}{\member{expr}}{} \hline ! \lineiii{Lambda}{\member{argnames}}{} ! \lineiii{}{\member{defaults}}{} ! \lineiii{}{\member{flags}}{} ! \lineiii{}{\member{code}}{} \hline ! \lineiii{LeftShift}{\member{left}}{} ! \lineiii{}{\member{right}}{} \hline ! \lineiii{List}{\member{nodes}}{} \hline ! \lineiii{ListComp}{\member{expr}}{} ! \lineiii{}{\member{quals}}{} \hline ! \lineiii{ListCompFor}{\member{assign}}{} ! \lineiii{}{\member{list}}{} ! \lineiii{}{\member{ifs}}{} \hline ! \lineiii{ListCompIf}{\member{test}}{} \hline ! \lineiii{Mod}{\member{left}}{} ! \lineiii{}{\member{right}}{} \hline ! \lineiii{Module}{\member{doc}}{doc string, a string or \code{None}} ! \lineiii{}{\member{node}}{body of the module, a \class{Stmt}} \hline ! \lineiii{Mul}{\member{left}}{} ! \lineiii{}{\member{right}}{} \hline ! \lineiii{Name}{\member{name}}{} \hline ! \lineiii{Not}{\member{expr}}{} \hline ! \lineiii{Or}{\member{nodes}}{} \hline *************** *** 180,252 **** \hline ! \lineiii{Power}{left}{} ! \lineiii{}{right}{} \hline ! \lineiii{Print}{nodes}{} ! \lineiii{}{dest}{} \hline ! \lineiii{Printnl}{nodes}{} ! \lineiii{}{dest}{} \hline ! \lineiii{Raise}{expr1}{} ! \lineiii{}{expr2}{} ! \lineiii{}{expr3}{} \hline ! \lineiii{Return}{value}{} \hline ! \lineiii{RightShift}{left}{} ! \lineiii{}{right}{} \hline ! \lineiii{Slice}{expr}{} ! \lineiii{}{flags}{} ! \lineiii{}{lower}{} ! \lineiii{}{upper}{} \hline ! \lineiii{Sliceobj}{nodes}{list of statements} \hline ! \lineiii{Stmt}{nodes}{} \hline ! \lineiii{Sub}{left}{} ! \lineiii{}{right}{} \hline ! \lineiii{Subscript}{expr}{} ! \lineiii{}{flags}{} ! \lineiii{}{subs}{} \hline ! \lineiii{TryExcept}{body}{} ! \lineiii{}{handlers}{} ! \lineiii{}{else_}{} \hline ! \lineiii{TryFinally}{body}{} ! \lineiii{}{final}{} \hline ! \lineiii{Tuple}{nodes}{} \hline ! \lineiii{UnaryAdd}{expr}{} \hline ! \lineiii{UnarySub}{expr}{} \hline ! \lineiii{While}{test}{} ! \lineiii{}{body}{} ! \lineiii{}{else_}{} \hline ! \lineiii{Yield}{value}{} \hline --- 180,252 ---- \hline ! \lineiii{Power}{\member{left}}{} ! \lineiii{}{\member{right}}{} \hline ! \lineiii{Print}{\member{nodes}}{} ! \lineiii{}{\member{dest}}{} \hline ! \lineiii{Printnl}{\member{nodes}}{} ! \lineiii{}{\member{dest}}{} \hline ! \lineiii{Raise}{\member{expr1}}{} ! \lineiii{}{\member{expr2}}{} ! \lineiii{}{\member{expr3}}{} \hline ! \lineiii{Return}{\member{value}}{} \hline ! \lineiii{RightShift}{\member{left}}{} ! \lineiii{}{\member{right}}{} \hline ! \lineiii{Slice}{\member{expr}}{} ! \lineiii{}{\member{flags}}{} ! \lineiii{}{\member{lower}}{} ! \lineiii{}{\member{upper}}{} \hline ! \lineiii{Sliceobj}{\member{nodes}}{list of statements} \hline ! \lineiii{Stmt}{\member{nodes}}{} \hline ! \lineiii{Sub}{\member{left}}{} ! \lineiii{}{\member{right}}{} \hline ! \lineiii{Subscript}{\member{expr}}{} ! \lineiii{}{\member{flags}}{} ! \lineiii{}{\member{subs}}{} \hline ! \lineiii{TryExcept}{\member{body}}{} ! \lineiii{}{\member{handlers}}{} ! \lineiii{}{\member{else_}}{} \hline ! \lineiii{TryFinally}{\member{body}}{} ! \lineiii{}{\member{final}}{} \hline ! \lineiii{Tuple}{\member{nodes}}{} \hline ! \lineiii{UnaryAdd}{\member{expr}}{} \hline ! \lineiii{UnarySub}{\member{expr}}{} \hline ! \lineiii{While}{\member{test}}{} ! \lineiii{}{\member{body}}{} ! \lineiii{}{\member{else_}}{} \hline ! \lineiii{Yield}{\member{value}}{} \hline From fdrake@users.sourceforge.net Wed Aug 15 18:01:36 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 15 Aug 2001 10:01:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/doc compiler.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/doc In directory usw-pr-cvs1:/tmp/cvs-serv22501 Modified Files: compiler.tex Log Message: Use the "howto" document class rather than the "manual" class. Remove the module index; there aren't enough modules documented yet for this to make sense. Add a couple more index entries, fixed a few typos, and adjusted a few more things for consistency. Index: compiler.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/doc/compiler.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** compiler.tex 2001/08/15 14:35:13 1.3 --- compiler.tex 2001/08/15 17:01:34 1.4 *************** *** 6,10 **** % http://www.python.org/doc/current/doc/doc.html ! \documentclass{manual} \title{Python compiler package} --- 6,10 ---- % http://www.python.org/doc/current/doc/doc.html ! \documentclass{howto} \title{Python compiler package} *************** *** 16,20 **** \authoraddress{ PythonLabs \\ ! Zope Corp. \\ Email: \email{jeremy@zope.com} } --- 16,20 ---- \authoraddress{ PythonLabs \\ ! Zope Corporation \\ Email: \email{jeremy@zope.com} } *************** *** 37,47 **** \maketitle - % This makes the contents more accessible from the front page of the HTML. - \ifhtml - \chapter*{Front Matter\label{front}} - \fi - - %\input{copyright} - \begin{abstract} --- 37,40 ---- *************** *** 56,60 **** \tableofcontents ! \chapter{Introduction\label{Introduction}} XXX Need basic intro --- 49,54 ---- \tableofcontents ! ! \section{Introduction\label{Introduction}} XXX Need basic intro *************** *** 63,68 **** --- 57,65 ---- closer to the python source... + \section{The basic interface} + \declaremodule{}{compiler} + The top-level of the package defines four functions. *************** *** 80,97 **** \end{funcdesc} ! \begin{funcdesc}{walk}{ast, visitor, \optional{verbose=None}} Do a pre-order walk over the abstract syntax tree \var{ast}. Call the appropriate method on the \var{visitor} instance for each node ! encountered. \end{funcdesc} ! \begin{funcdesc}{compile}{filename} ! Compile the file \var{filename} and generated \var{filename}.pyc. \end{funcdesc} The \module{compiler} package contains the following modules: ! \module{ast}, \module{consts}, \module{future}, \module{misc}, ! \module{pyassem}, \module{pycodegen}, \module{symbols}, ! \module{transformer}, and \module{visitor}. \section{Limitations} --- 77,96 ---- \end{funcdesc} ! \begin{funcdesc}{walk}{ast, visitor\optional{, verbose}} Do a pre-order walk over the abstract syntax tree \var{ast}. Call the appropriate method on the \var{visitor} instance for each node ! encountered. \end{funcdesc} ! \begin{funcdesc}{compile}{path} ! Compile the file \var{path} and generate the corresponding \file{.pyc} ! file. \end{funcdesc} The \module{compiler} package contains the following modules: ! \refmodule[compiler.ast]{ast}, \module{consts}, \module{future}, ! \module{misc}, \module{pyassem}, \module{pycodegen}, \module{symbols}, ! \module{transformer}, and \refmodule[compiler.visitor]{visitor}. ! \section{Limitations} *************** *** 107,113 **** \code{def f(x, x): ...} - \chapter{Python Abstract Syntax} ! \section{Introduction} The \module{compiler.ast} module defines an abstract syntax for --- 106,111 ---- \code{def f(x, x): ...} ! \section{Python Abstract Syntax} The \module{compiler.ast} module defines an abstract syntax for *************** *** 116,125 **** The abstract syntax offers a higher level interface to parsed Python ! source code. The \module{parser} module and the compiler written in C ! for the Python interpreter use a concrete syntax tree. The concrete ! syntax is tied closely to the grammar description used for the Python ! parser. Instead of a single node for a construct, there are often ! several levels of nested nodes that are introduced by Python's ! precedence rules. The abstract syntax tree is created by the --- 114,124 ---- The abstract syntax offers a higher level interface to parsed Python ! source code. The \ulink{\module{parser}} ! {http://www.python.org/doc/current/lib/module-parser.html} ! module and the compiler written in C for the Python interpreter use a ! concrete syntax tree. The concrete syntax is tied closely to the ! grammar description used for the Python parser. Instead of a single ! node for a construct, there are often several levels of nested nodes ! that are introduced by Python's precedence rules. The abstract syntax tree is created by the *************** *** 128,143 **** generates an abstract syntax tree from the concrete tree. ! The \module{transformer} module was created by Greg Stein and Bill ! Tutt for the Python-to-C compiler. The current version contains a number of modifications and improvements, but the basic form of the abstract syntax and of the transformer are due to Stein and Tutt. \section{AST Nodes} ! The \module{ast} module is generated from a text file that describes ! each node type and its elements. Each node type is represented as a ! class that inherits from the abstract base class \class{ast.Node} and ! defines a set of named attributes for child nodes. \begin{classdesc}{Node}{} --- 127,147 ---- generates an abstract syntax tree from the concrete tree. ! The \module{transformer} module was created by Greg ! Stein\index{Stein, Greg} and Bill Tutt\index{Tutt, Bill} for an ! experimental Python-to-C compiler. The current version contains a number of modifications and improvements, but the basic form of the abstract syntax and of the transformer are due to Stein and Tutt. + \section{AST Nodes} ! \declaremodule{}{compiler.ast} + The \module{compiler.ast} module is generated from a text file that + describes each node type and its elements. Each node type is + represented as a class that inherits from the abstract base class + \class{compiler.ast.Node} and defines a set of named attributes for + child nodes. + \begin{classdesc}{Node}{} *************** *** 154,177 **** be \code{None}. XXX Not sure what the rules are for which nodes will have a useful lineno. ! \begin{methoddesc}{getChildren}{} ! Returns a flattened list of the child nodes and objects in the ! order they occur. Specifically, the order of the nodes is the ! order in which they appear in the Python grammar. Not all of the ! children are \class{Node} instances. The names of functions and ! classes, for example, are plain strings. ! \end{methoddesc} ! \begin{methoddesc}{getChildNodes}{} ! Returns a flattened list of the child nodes in the order they ! occur. This method is like \method{getChildNodes()}, except that it ! only returns those children that are \class{Node} instances. ! \end{methoddesc} ! \end{classdesc} Two examples illustrate the general structure of \class{Node} ! classes. The while statement is defined by the following grammar ! production: \begin{verbatim} --- 158,182 ---- be \code{None}. XXX Not sure what the rules are for which nodes will have a useful lineno. + \end{classdesc} ! All \class{Node} objects offer the following methods: ! \begin{methoddesc}{getChildren}{} ! Returns a flattened list of the child nodes and objects in the ! order they occur. Specifically, the order of the nodes is the ! order in which they appear in the Python grammar. Not all of the ! children are \class{Node} instances. The names of functions and ! classes, for example, are plain strings. ! \end{methoddesc} ! \begin{methoddesc}{getChildNodes}{} ! Returns a flattened list of the child nodes in the order they ! occur. This method is like \method{getChildren()}, except that it ! only returns those children that are \class{Node} instances. ! \end{methoddesc} Two examples illustrate the general structure of \class{Node} ! classes. The \keyword{while} statement is defined by the following ! grammar production: \begin{verbatim} *************** *** 183,191 **** \member{body}, and \member{else_}. (If the natural name for an attribute is also a Python reserved word, it can't be used as an ! attribute name. An underscore is appended to the word to make it ! legal, hence \code{else_} instead of \code{else}.) ! The if statement is more complicated because it can include several ! tests. \begin{verbatim} --- 188,196 ---- \member{body}, and \member{else_}. (If the natural name for an attribute is also a Python reserved word, it can't be used as an ! attribute name. An underscore is appended to the word to make it a ! legal identifier, hence \member{else_} instead of \keyword{else}.) ! The \keyword{if} statement is more complicated because it can include ! several tests. \begin{verbatim} *************** *** 195,208 **** The \class{If} node only defines two attributes: \member{tests} and \member{else_}. The \member{tests} attribute is a sequence of test ! expression, consequent body pairs. There is one pair of each if/elif ! clause. The first element of the pair is the test expression. The ! second elements is a \class{Stmt} node that contains the code to ! execute if the test is true. The \method{getChildren()} method of \class{If} returns a flat list of ! child nodes. If there are three if/elif clauses and no else clause, ! then \method{getChildren()} will return a list of six elements: the ! first test expression, the first \class{Stmt}, the second text ! expression, etc. The following table lists each of the \class{Node} subclasses defined --- 200,213 ---- The \class{If} node only defines two attributes: \member{tests} and \member{else_}. The \member{tests} attribute is a sequence of test ! expression, consequent body pairs. There is one pair for each ! \keyword{if}/\keyword{elif} clause. The first element of the pair is ! the test expression. The second elements is a \class{Stmt} node that ! contains the code to execute if the test is true. The \method{getChildren()} method of \class{If} returns a flat list of ! child nodes. If there are three \keyword{if}/\keyword{elif} clauses ! and no \keyword{else} clause, then \method{getChildren()} will return ! a list of six elements: the first test expression, the first ! \class{Stmt}, the second text expression, etc. The following table lists each of the \class{Node} subclasses defined *************** *** 216,219 **** --- 221,225 ---- \input{asttable} + \section{Assignment nodes} *************** *** 230,236 **** as an example. Explain what the flags are for. - \chapter{Using Visitors to Walk ASTs} ! The visitor pattern is ... The \module{compiler} package uses a variant on the visitor pattern that takes advantage of Python's introspection features to elminiate the need for much of the visitor's --- 236,245 ---- as an example. Explain what the flags are for. ! \section{Using Visitors to Walk ASTs} ! ! \declaremodule{}{compiler.visitor} ! ! The visitor pattern is ... The \refmodule{compiler} package uses a variant on the visitor pattern that takes advantage of Python's introspection features to elminiate the need for much of the visitor's *************** *** 244,247 **** --- 253,259 ---- XXX The magic \method{visit()} method for visitors. + \begin{funcdesc}{walk}{tree, visitor\optional{, verbose}} + \end{funcdesc} + \begin{classdesc}{ASTVisitor}{} *************** *** 260,270 **** found for a particular node type, the \method{default()} method is called. XXX describe extra arguments ! \begin{methoddesc}{default}{node\optional{, *args}} \end{methoddesc} ! \begin{methoddesc}{dispatch}{node\optional{, *args}} \end{methoddesc} --- 272,285 ---- found for a particular node type, the \method{default()} method is called. + \end{classdesc} + \class{ASTVisitor} objects have the following methods: + XXX describe extra arguments ! \begin{methoddesc}{default}{node\optional{, \moreargs}} \end{methoddesc} ! \begin{methoddesc}{dispatch}{node\optional{, \moreargs}} \end{methoddesc} *************** *** 272,283 **** \end{methoddesc} - \end{classdesc} ! \begin{funcdesc}{walk}{tree, visitor\optional{, verbose=None}} ! \end{funcdesc} ! ! \chapter{Bytecode Generation} ! The code generator is a visit that emits bytecodes. Each visit method can call the \method{emit()} method to emit a new bytecode. The basic code generator is specialized for modules, classes, and functions. An --- 287,294 ---- \end{methoddesc} ! \section{Bytecode Generation} ! The code generator is a visitor that emits bytecodes. Each visit method can call the \method{emit()} method to emit a new bytecode. The basic code generator is specialized for modules, classes, and functions. An *************** *** 286,306 **** objects and calculation of jump offsets. - % - % The ugly "%begin{latexonly}" pseudo-environments are really just to - % keep LaTeX2HTML quiet during the \renewcommand{} macros; they're - % not really valuable. - % - % If you don't want the Module Index, you can remove all of this up - % until the second \input line. - % - %begin{latexonly} - \renewcommand{\indexname}{Module Index} - %end{latexonly} - \input{mod\jobname.ind} % Module Index ! %begin{latexonly} ! \renewcommand{\indexname}{Index} ! %end{latexonly} ! \input{\jobname.ind} % Index \end{document} --- 297,302 ---- objects and calculation of jump offsets. ! \input{compiler.ind} % Index \end{document} From loewis@users.sourceforge.net Wed Aug 15 18:14:35 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 15 Aug 2001 10:14:35 -0700 Subject: [Python-checkins] CVS: python/dist/src configure,1.237,1.238 configure.in,1.246,1.247 pyconfig.h.in,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv25237 Modified Files: configure configure.in pyconfig.h.in Log Message: Fix portability problems with glibc 2.0, as reported in #449157. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.237 retrieving revision 1.238 diff -C2 -d -r1.237 -r1.238 *** configure 2001/08/15 13:55:15 1.237 --- configure 2001/08/15 17:14:32 1.238 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.245 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.246 # Guess values for system-dependent variables and create Makefiles. *************** *** 4571,4575 **** for ac_func in alarm chown clock confstr ctermid ctermid_r execv \ flock fork fsync fdatasync fpathconf ftime ftruncate \ ! getgroups getlogin getpeername getpid getpwent getwd \ hstrerror inet_pton kill link lstat mkfifo mktime mremap \ nice pathconf pause plock poll pthread_init \ --- 4571,4575 ---- for ac_func in alarm chown clock confstr ctermid ctermid_r execv \ flock fork fsync fdatasync fpathconf ftime ftruncate \ ! gai_strerror getgroups getlogin getpeername getpid getpwent getwd \ hstrerror inet_pton kill link lstat mkfifo mktime mremap \ nice pathconf pause plock poll pthread_init \ Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.246 retrieving revision 1.247 diff -C2 -d -r1.246 -r1.247 *** configure.in 2001/08/15 13:55:15 1.246 --- configure.in 2001/08/15 17:14:32 1.247 *************** *** 1237,1241 **** AC_CHECK_FUNCS(alarm chown clock confstr ctermid ctermid_r execv \ flock fork fsync fdatasync fpathconf ftime ftruncate \ ! getgroups getlogin getpeername getpid getpwent getwd \ hstrerror inet_pton kill link lstat mkfifo mktime mremap \ nice pathconf pause plock poll pthread_init \ --- 1237,1241 ---- AC_CHECK_FUNCS(alarm chown clock confstr ctermid ctermid_r execv \ flock fork fsync fdatasync fpathconf ftime ftruncate \ ! gai_strerror getgroups getlogin getpeername getpid getpwent getwd \ hstrerror inet_pton kill link lstat mkfifo mktime mremap \ nice pathconf pause plock poll pthread_init \ Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pyconfig.h.in 2001/08/10 20:29:40 1.4 --- pyconfig.h.in 2001/08/15 17:14:33 1.5 *************** *** 372,375 **** --- 372,378 ---- #undef HAVE_FTRUNCATE + /* Define if you have the gai_strerror function. */ + #undef HAVE_GAI_STRERROR + /* Define if you have the getaddrinfo function. */ #undef HAVE_GETADDRINFO From loewis@users.sourceforge.net Wed Aug 15 18:14:35 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 15 Aug 2001 10:14:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _localemodule.c,2.21,2.22 addrinfo.h,1.2,1.3 getnameinfo.c,1.3,1.4 socketmodule.c,1.164,1.165 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv25237/Modules Modified Files: _localemodule.c addrinfo.h getnameinfo.c socketmodule.c Log Message: Fix portability problems with glibc 2.0, as reported in #449157. Index: _localemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_localemodule.c,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** _localemodule.c 2001/08/10 19:41:45 2.21 --- _localemodule.c 2001/08/15 17:14:33 2.22 *************** *** 528,531 **** --- 528,533 ---- ADDINT(ABMON_12); + #ifdef RADIXCHAR + /* The following are not available with glibc 2.0 */ ADDINT(RADIXCHAR); ADDINT(THOUSEP); *************** *** 538,541 **** --- 540,544 ---- */ ADDINT(CRNCYSTR); + #endif ADDINT(D_T_FMT); Index: addrinfo.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/addrinfo.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** addrinfo.h 2001/07/19 17:37:46 1.2 --- addrinfo.h 2001/08/15 17:14:33 1.3 *************** *** 68,71 **** --- 68,75 ---- #endif + #endif /* HAVE_GETADDRINFO */ + + #ifndef HAVE_GETNAMEINFO + /* * Constants for getnameinfo() *************** *** 87,90 **** --- 91,96 ---- #endif + #endif /* HAVE_GETNAMEINFO */ + #ifndef HAVE_ADDRINFO struct addrinfo { *************** *** 137,140 **** #ifdef __cplusplus } - #endif #endif --- 143,145 ---- Index: getnameinfo.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/getnameinfo.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** getnameinfo.c 2001/07/21 09:42:15 1.3 --- getnameinfo.c 2001/08/15 17:14:33 1.4 *************** *** 82,85 **** --- 82,89 ---- #define ENI_SALEN 6 + /* forward declaration to make gcc happy */ + int getnameinfo Py_PROTO((const struct sockaddr *, size_t, char *, size_t, + char *, size_t, int)); + int getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** socketmodule.c 2001/08/12 09:28:40 1.164 --- socketmodule.c 2001/08/15 17:14:33 1.165 *************** *** 448,452 **** --- 448,456 ---- return PySocket_Err(); + #ifdef HAVE_GAI_STRERROR v = Py_BuildValue("(is)", error, gai_strerror(error)); + #else + v = Py_BuildValue("(is)", error, "getaddrinfo failed"); + #endif if (v != NULL) { PyErr_SetObject(PyGAI_Error, v); From gvanrossum@users.sourceforge.net Wed Aug 15 18:51:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 15 Aug 2001 10:51:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv1522 Modified Files: test_descr.py Log Message: Add a test to verify that bound methods work correctly. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_descr.py 2001/08/14 20:00:33 1.9 --- test_descr.py 2001/08/15 17:51:17 1.10 *************** *** 848,851 **** --- 848,868 ---- verify(a.delslice == (0, 10)) + def methods(): + if verbose: print "testing methods..." + class C(object): + def __init__(self, x): + self.x = x + def foo(self): + return self.x + c1 = C(1) + verify(c1.foo() == 1) + class D(C): + boo = C.foo + goo = c1.foo + d2 = D(2) + verify(d2.foo() == 2) + verify(d2.boo() == 2) + verify(d2.goo() == 2) + def all(): lists() *************** *** 874,877 **** --- 891,895 ---- altmro() overloading() + methods() all() From gvanrossum@users.sourceforge.net Wed Aug 15 18:52:33 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 15 Aug 2001 10:52:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects classobject.c,2.135,2.136 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv1823 Modified Files: classobject.c Log Message: PyMethod_Type: add a tp_descr_get slot function to ensure proper binding of unbound methods. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.135 retrieving revision 2.136 diff -C2 -d -r2.135 -r2.136 *** classobject.c 2001/08/08 05:00:18 2.135 --- classobject.c 2001/08/15 17:52:31 2.136 *************** *** 2194,2197 **** --- 2194,2205 ---- } + static PyObject * + instancemethod_descr_get(PyObject *meth, PyObject *obj, PyObject *type) + { + if (obj == Py_None) + obj = NULL; + return PyMethod_New(PyMethod_GET_FUNCTION(meth), obj, type); + } + PyTypeObject PyMethod_Type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 2220,2224 **** 0, /* tp_clear */ 0, /* tp_richcompare */ ! offsetof(PyMethodObject, im_weakreflist) /* tp_weaklistoffset */ }; --- 2228,2242 ---- 0, /* tp_clear */ 0, /* tp_richcompare */ ! offsetof(PyMethodObject, im_weakreflist), /* tp_weaklistoffset */ ! 0, /* tp_iter */ ! 0, /* tp_iternext */ ! 0, /* tp_methods */ ! 0, /* tp_members */ ! 0, /* tp_getset */ ! 0, /* tp_base */ ! 0, /* tp_dict */ ! instancemethod_descr_get, /* tp_descr_get */ ! 0, /* tp_descr_set */ ! 0, /* tp_dictoffset */ }; From gvanrossum@users.sourceforge.net Wed Aug 15 19:09:13 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 15 Aug 2001 11:09:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules xxsubtype.c,2.2,2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv5529 Modified Files: xxsubtype.c Log Message: Add 'state' as a read-only attribute to spamdict. This serves as an example. Index: xxsubtype.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/xxsubtype.c,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -d -r2.2 -r2.3 *** xxsubtype.c 2001/08/07 17:24:28 2.2 --- xxsubtype.c 2001/08/15 18:09:11 2.3 *************** *** 1,3 **** --- 1,4 ---- #include "Python.h" + #include "structmember.h" /* Examples showing how to subtype the builtin list and dict types from C. */ *************** *** 137,140 **** --- 138,146 ---- } + static struct memberlist spamdict_members[] = { + {"state", T_INT, offsetof(spamdictobject, state), READONLY}, + {0} + }; + static PyTypeObject spamdict_type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 167,171 **** 0, /* tp_iternext */ spamdict_methods, /* tp_methods */ ! 0, /* tp_members */ 0, /* tp_getset */ &PyDict_Type, /* tp_base */ --- 173,177 ---- 0, /* tp_iternext */ spamdict_methods, /* tp_methods */ ! spamdict_members, /* tp_members */ 0, /* tp_getset */ &PyDict_Type, /* tp_base */ From gvanrossum@users.sourceforge.net Wed Aug 15 19:19:01 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 15 Aug 2001 11:19:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules xxsubtype.c,2.3,2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv7955 Modified Files: xxsubtype.c Log Message: Add 'state' as a get/set attribute to spamlist. This serves as an example. Index: xxsubtype.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/xxsubtype.c,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -d -r2.3 -r2.4 *** xxsubtype.c 2001/08/15 18:09:11 2.3 --- xxsubtype.c 2001/08/15 18:18:58 2.4 *************** *** 50,53 **** --- 50,64 ---- } + static PyObject * + spamlist_state_get(spamlistobject *self) + { + return PyInt_FromLong(self->state); + } + + static struct getsetlist spamlist_getsets[] = { + {"state", (getter)spamlist_state_get, NULL, NULL}, + {0} + }; + static PyTypeObject spamlist_type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 81,85 **** spamlist_methods, /* tp_methods */ 0, /* tp_members */ ! 0, /* tp_getset */ &PyList_Type, /* tp_base */ 0, /* tp_dict */ --- 92,96 ---- spamlist_methods, /* tp_methods */ 0, /* tp_members */ ! spamlist_getsets, /* tp_getset */ &PyList_Type, /* tp_base */ 0, /* tp_dict */ From fdrake@users.sourceforge.net Wed Aug 15 19:32:35 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 15 Aug 2001 11:32:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include object.h,2.84,2.85 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv11518 Modified Files: object.h Log Message: Added comments before recently added/assigned slots in the type object, so the backward compatibility issues will be easier to understand. I only added comments indicating additions and assignments back to Python 2.0. Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.84 retrieving revision 2.85 diff -C2 -d -r2.84 -r2.85 *** object.h 2001/08/10 17:37:02 2.84 --- object.h 2001/08/15 18:32:33 2.85 *************** *** 151,154 **** --- 151,155 ---- unaryfunc nb_oct; unaryfunc nb_hex; + /* Added in release 2.0 */ binaryfunc nb_inplace_add; binaryfunc nb_inplace_subtract; *************** *** 163,166 **** --- 164,168 ---- binaryfunc nb_inplace_or; + /* Added in release 2.2 */ /* The following require the Py_TPFLAGS_HAVE_CLASS flag */ binaryfunc nb_floor_divide; *************** *** 179,182 **** --- 181,185 ---- intintobjargproc sq_ass_slice; objobjproc sq_contains; + /* Added in release 2.0 */ binaryfunc sq_inplace_concat; intargfunc sq_inplace_repeat; *************** *** 251,254 **** --- 254,258 ---- char *tp_doc; /* Documentation string */ + /* Assigned meaning in release 2.0 */ /* call function for all accessible objects */ traverseproc tp_traverse; *************** *** 257,260 **** --- 261,265 ---- inquiry tp_clear; + /* Assigned meaning in release 2.1 */ /* rich comparisons */ richcmpfunc tp_richcompare; *************** *** 263,266 **** --- 268,272 ---- long tp_weaklistoffset; + /* Added in release 2.2 */ /* Iterators */ getiterfunc tp_iter; From fdrake@users.sourceforge.net Wed Aug 15 19:48:12 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 15 Aug 2001 11:48:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/doc compiler.tex,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/doc In directory usw-pr-cvs1:/tmp/cvs-serv14751 Modified Files: compiler.tex Log Message: Remove spurious space before a period. Index: compiler.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/doc/compiler.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** compiler.tex 2001/08/15 17:01:34 1.4 --- compiler.tex 2001/08/15 18:48:10 1.5 *************** *** 263,267 **** for a method named `visitNodeType,' where NodeType is the name of the node's class, e.g. for a \class{While} node a \method{visitWhile()} ! would be called . If the method exists, it is called with the node as its first argument. --- 263,267 ---- for a method named `visitNodeType,' where NodeType is the name of the node's class, e.g. for a \class{While} node a \method{visitWhile()} ! would be called. If the method exists, it is called with the node as its first argument. From fdrake@users.sourceforge.net Wed Aug 15 20:00:31 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 15 Aug 2001 12:00:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc ACKS,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv17900 Modified Files: ACKS Log Message: Dave Kuhlman has contributed a nice improvement to the "Defining New Types" section of the Extending & Embedding manual -- thanks! Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ACKS 2001/08/08 05:39:52 1.24 --- ACKS 2001/08/15 19:00:29 1.25 *************** *** 96,99 **** --- 96,100 ---- Daniel Kozan Andrew M. Kuchling + Dave Kuhlman Erno Kuusela Detlef Lannert From fdrake@users.sourceforge.net Wed Aug 15 20:07:20 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 15 Aug 2001 12:07:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ext ext.tex,1.102,1.103 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv19243/ext Modified Files: ext.tex Log Message: A large contribution from Dave Kuhlman describing what each of the slots in the type object is used for, for many of the more commonly used slots. Thanks! (But there is still a lot more to write on this topic.) Markup and organizational changes by your friendly neighborhood documentation czar. Index: ext.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/ext.tex,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** ext.tex 2001/08/04 01:58:36 1.102 --- ext.tex 2001/08/15 19:07:18 1.103 *************** *** 1751,1754 **** --- 1751,1755 ---- \label{defining-new-types}} \sectionauthor{Michael Hudson}{mwh21@cam.ac.uk} + \sectionauthor{Dave Kuhlman}{dkuhlman@rexx.com} As mentioned in the last chapter, Python allows the writer of an *************** *** 2066,2069 **** --- 2067,2071 ---- That wasn't so hard, was it? + \section{Type Methods \label{dnt-type-methods}} *************** *** 2112,2115 **** --- 2114,2118 ---- char *tp_doc; /* Documentation string */ + /* Assigned meaning in release 2.0 */ /* call function for all accessible objects */ traverseproc tp_traverse; *************** *** 2118,2121 **** --- 2121,2125 ---- inquiry tp_clear; + /* Assigned meaning in release 2.1 */ /* rich comparisons */ richcmpfunc tp_richcompare; *************** *** 2124,2127 **** --- 2128,2153 ---- long tp_weaklistoffset; + /* Added in release 2.2 */ + /* Iterators */ + getiterfunc tp_iter; + iternextfunc tp_iternext; + + /* Attribute descriptor and subclassing stuff */ + struct PyMethodDef *tp_methods; + struct memberlist *tp_members; + struct getsetlist *tp_getset; + struct _typeobject *tp_base; + PyObject *tp_dict; + descrgetfunc tp_descr_get; + descrsetfunc tp_descr_set; + long tp_dictoffset; + initproc tp_init; + allocfunc tp_alloc; + newfunc tp_new; + destructor tp_free; /* Low-level free-memory routine */ + PyObject *tp_bases; + PyObject *tp_mro; /* method resolution order */ + PyObject *tp_defined; + } PyTypeObject; \end{verbatim} *************** *** 2131,2136 **** will only implement a handful of these. ! As you probably expect by now, I'm going to go over this line-by-line, ! saying a word about each field as we get to it. \begin{verbatim} --- 2157,2168 ---- will only implement a handful of these. ! As you probably expect by now, we're going to go over this and give ! more information about the various handlers. We won't go in the order ! they are defined in the structure, because there is a lot of ! historical baggage that impacts the ordering of the fields; be sure ! your type initializaion keeps the fields in the right order! It's ! often easiest to find an example that includes all the fields you need ! (even if they're initialized to \code{0}) and then change the values ! to suit your new type. \begin{verbatim} *************** *** 2152,2170 **** later. ! Now we come to the basic type methods - the ones most extension types will implement. \begin{verbatim} destructor tp_dealloc; printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; cmpfunc tp_compare; - reprfunc tp_repr; \end{verbatim} ! %\section{Attributes \& Methods ! % \label{dnt-attrs-and-meths}} --- 2184,2549 ---- later. ! \begin{verbatim} ! char *tp_doc; ! \end{verbatim} ! ! Here you can put a string (or its address) that you want returned when ! the Python script references \code{obj.__doc__} to retrieve the ! docstring. ! ! Now we come to the basic type methods---the ones most extension types will implement. + + \subsection{Finalization and De-allocation} + \begin{verbatim} destructor tp_dealloc; + \end{verbatim} + + This function is called when the reference count of the instance of + your type is reduced to zero and the Python interpreter wants to + reclaim it. If your type has memory to free or other clean-up to + perform, put it here. The object itself needs to be freed here as + well. Here is an example of this function: + + \begin{verbatim} + static void + newdatatype_dealloc(newdatatypeobject * obj) + { + free(obj->obj_UnderlyingDatatypePtr); + PyObject_DEL(obj); + } + \end{verbatim} + + + \subsection{Object Representation} + + In Python, there are three ways to generate a textual representation + of an object: the \function{repr()}\bifuncindex{repr} function (or + equivalent backtick syntax), the \function{str()}\bifuncindex{str} + function, and the \keyword{print} statement. For most objects, the + \keyword{print} statement is equivalent to the \function{str()} + function, but it is possible to special-case printing to a + \ctype{FILE*} if necessary; this should only be done if efficiency is + identified as a problem and profiling suggests that creating a + temporary string object to be written to a file is too expensive. + + These handlers are all optional, and most types at most need to + implement the \member{tp_str} and \member{tp_repr} handlers. + + \begin{verbatim} + reprfunc tp_repr; + reprfunc tp_str; printfunc tp_print; + \end{verbatim} + + The \member{tp_repr} handler should return a string object containing + a representation of the instance for which it is called. Here is a + simple example: + + \begin{verbatim} + static PyObject * + newdatatype_repr(newdatatypeobject * obj) + { + char buf[4096]; + sprintf(buf, "Repr-ified_newdatatype{{size:%d}}", + obj->obj_UnderlyingDatatypePtr->size); + return PyString_FromString(buf); + } + \end{verbatim} + + If no \member{tp_repr} handler is specified, the interpreter will + supply a representation that uses the type's \member{tp_name} and a + uniquely-identifying value for the object. + + The \member{tp_str} handler is to \function{str()} what the + \member{tp_repr} handler described above is to \function{repr()}; that + is, it is called when Python code calls \function{str()} on an + instance of your object. It's implementation is very similar to the + \member{tp_repr} function, but the resulting string is intended to be + human consumption. It \member{tp_str} is not specified, the + \member{tp_repr} handler is used instead. + + Here is a simple example: + + \begin{verbatim} + static PyObject * + newdatatype_str(newdatatypeobject * obj) + { + PyObject *pyString; + char buf[4096]; + sprintf(buf, "Stringified_newdatatype{{size:%d}}", + obj->obj_UnderlyingDatatypePtr->size + ); + pyString = PyString_FromString(buf); + return pyString; + } + \end{verbatim} + + The print function will be called whenever Python needs to "print" an + instance of the type. For example, if 'node' is an instance of type + TreeNode, then the print function is called when Python code calls: + + \begin{verbatim} + print node + \end{verbatim} + + There is a flags argument and one flag, \constant{Py_PRINT_RAW}, and + it suggests that you print without string quotes and possibly without + interpreting escape sequences. + + The print function receives a file object as an argument. You will + likely want to write to that file object. + + Here is a sampe print function: + + \begin{verbatim} + static int + newdatatype_print(newdatatypeobject *obj, FILE *fp, int flags) + { + if (flags & Py_PRINT_RAW) { + fprintf(fp, "<{newdatatype object--size: %d}>", + obj->obj_UnderlyingDatatypePtr->size); + } + else { + fprintf(fp, "\"<{newdatatype object--size: %d}>\"", + obj->obj_UnderlyingDatatypePtr->size); + } + return 0; + } + \end{verbatim} + + + \subsection{Attribute Management Functions} + + \begin{verbatim} getattrfunc tp_getattr; setattrfunc tp_setattr; + \end{verbatim} + + The \member{tp_getattr} handle is called when the object requires an + attribute look-up. It is called in the same situations where the + \method{__getattr__()} method of a class would be called. + + A likely way to handle this is (1) to implement a set of functions + (such as \cfunction{newdatatype_getSize()} and + \cfunction{newdatatype_setSize()} in the example below), (2) provide a + method table listing these functions, and (3) provide a getattr + function that returns the result of a lookup in that table. + + Here is an example: + + \begin{verbatim} + static PyMethodDef newdatatype_methods[] = { + {"getSize", (PyCFunction)newdatatype_getSize, METH_VARARGS}, + {"setSize", (PyCFunction)newdatatype_setSize, METH_VARARGS}, + {NULL, NULL} /* sentinel */ + }; + + static PyObject * + newdatatype_getattr(newdatatypeobject *obj, char *name) + { + return Py_FindMethod(newdatatype_methods, (PyObject *)obj, name); + } + \end{verbatim} + + The \member{tp_setattr} handler is called when the + \method{__setattr__()} or \method{__delattr__()} method of a class + instance would be called. When an attribute should be deleted, the + third parameter will be \NULL. Here is an example that simply raises + an exception; if this were really all you wanted, the + \member{tp_setattr} handler should be set to \NULL. + + \begin{verbatim} + static int + newdatatype_setattr(newdatatypeobject *obj, char *name, PyObject *v) + { + char buf[1024]; + sprintf(buf, "Set attribute not supported for attribute %s", name); + PyErr_SetString(PyExc_RuntimeError, buf); + return -1; + } + \end{verbatim} + + + \subsection{Object Comparison} + + \begin{verbatim} cmpfunc tp_compare; \end{verbatim} + The \member{tp_compare} handler is called when comparisons are needed + are the object does not implement the specific rich comparison method + which matches the requested comparison. (It is always used if defined + and the \cfunction{PyObject_Compare()} or \cfunction{PyObject_Cmp()} + functions are used, or if \function{cmp()} is used from Python.) + It is analogous to the \method{__cmp__()} method. This function + should return a negative integer if \var{obj1} is less than + \var{obj2}, \code{0} if they are equal, and a positive integer if + \var{obj1} is greater than + \var{obj2}. ! Here is a sample implementation: ! ! \begin{verbatim} ! static int ! newdatatype_compare(newdatatypeobject * obj1, newdatatypeobject * obj2) ! { ! long result; ! ! if (obj1->obj_UnderlyingDatatypePtr->size < ! obj2->obj_UnderlyingDatatypePtr->size) { ! result = -1; ! } ! else if (obj1->obj_UnderlyingDatatypePtr->size > ! obj2->obj_UnderlyingDatatypePtr->size) { ! result = 1; ! } ! else { ! result = 0; ! } ! return result; ! } ! \end{verbatim} ! ! ! \subsection{Abstract Protocol Support} ! ! \begin{verbatim} ! tp_as_number; ! tp_as_sequence; ! tp_as_mapping; ! \end{verbatim} ! ! If you wish your object to be able to act like a number, a sequence, ! or a mapping object, then you place the address of a structure that ! implements the C type \ctype{PyNumberMethods}, ! \ctype{PySequenceMethods}, or \ctype{PyMappingMethods}, respectively. ! It is up to you to fill in this structure with appropriate values. You ! can find examples of the use of each of these in the \file{Objects} ! directory of the Python source distribution. ! ! ! \begin{verbatim} ! hashfunc tp_hash; ! \end{verbatim} ! ! This function, if you choose to provide it, should return a hash ! number for an instance of your datatype. Here is a moderately ! pointless example: ! ! \begin{verbatim} ! static long ! newdatatype_hash(newdatatypeobject *obj) ! { ! long result; ! result = obj->obj_UnderlyingDatatypePtr->size; ! result = result * 3; ! return result; ! } ! \end{verbatim} ! ! \begin{verbatim} ! ternaryfunc tp_call; ! \end{verbatim} ! ! This function is called when an instance of your datatype is "called", ! for example, if \code{obj1} is an instance of your datatype and the Python ! script contains \code{obj1('hello')}, the \member{tp_call} handler is ! invoked. ! ! This function takes three arguments: ! ! \begin{enumerate} ! \item ! \var{arg1} is the instance of the datatype which is the subject of ! the call. If the call is \code{obj1('hello')}, then \var{arg1} is ! \code{obj1}. ! ! \item ! \var{arg2} is a tuple containing the arguments to the call. You ! can use \cfunction{PyArg_ParseTuple()} to extract the arguments. ! ! \item ! \var{arg3} is a dictionary of keyword arguments that were passed. ! If this is non-\NULL{} and you support keyword arguments, use ! \cfunction{PyArg_ParseTupleAndKeywords()} to extract the ! arguments. If you do not want to support keyword arguments and ! this is non-\NULL, raise a \exception{TypeError} with a message ! saying that keyword arguments are not supported. ! \end{enumerate} ! ! Here is a desultory example of the implementation of call function. ! ! \begin{verbatim} ! /* Implement the call function. ! * obj1 is the instance receiving the call. ! * obj2 is a tuple containing the arguments to the call, in this ! * case 3 strings. ! */ ! static PyObject * ! newdatatype_call(newdatatypeobject *obj, PyObject *args, PyObject *other) ! { ! PyObject *result; ! char *arg1; ! char *arg2; ! char *arg3; ! char buf[4096]; ! if (!PyArg_ParseTuple(args, "sss:call", &arg1, &arg2, &arg3)) { ! return NULL; ! } ! sprintf(buf, ! "Returning -- value: [%d] arg1: [%s] arg2: [%s] arg3: [%s]\n", ! obj->obj_UnderlyingDatatypePtr->size, ! arg1, arg2, arg3); ! printf(buf); ! return PyString_FromString(buf); ! } ! \end{verbatim} ! ! ! \subsection{More Suggestions} ! ! Remember that you can omit most of these functions, in which case you ! provide \code{0} as a value. ! ! In the \file{Objects} directory of the Python source distribution, ! there is a file \file{xxobject.c}, which is intended to be used as a ! template for the implementation of new types. One useful strategy ! for implementing a new type is to copy and rename this file, then ! read the instructions at the top of it. ! ! There are type definitions for each of the functions you must ! provide. They are in \file{object.h} in the Python include ! directory that comes with the source distribution of Python. ! ! In order to learn how to implement any specific method for your new ! datatype, do the following: Download and unpack the Python source ! distribution. Go the the \file{Objects} directory, then search the ! C source files for \code{tp_} plus the function you want (for ! example, \code{tp_print} or \code{tp_compare}). You will find ! examples of the function you want to implement. ! ! When you need to verify that the type of an object is indeed the ! object you are implementing and if you use xxobject.c as an starting ! template for your implementation, then there is a macro defined for ! this purpose. The macro definition will look something like this: ! ! \begin{verbatim} ! #define is_newdatatypeobject(v) ((v)->ob_type == &Newdatatypetype) ! \end{verbatim} ! ! And, a sample of its use might be something like the following: ! ! \begin{verbatim} ! if (!is_newdatatypeobject(objp1) { ! PyErr_SetString(PyExc_TypeError, "arg #1 not a newdatatype"); ! return NULL; ! } ! \end{verbatim} ! ! %For a reasonably extensive example, from which most of the snippits ! %above were taken, see \file{newdatatype.c} and \file{newdatatype.h}. From gvanrossum@users.sourceforge.net Wed Aug 15 22:02:22 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 15 Aug 2001 14:02:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_compare.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18018 Modified Files: test_compare.py Log Message: Given a class without __cmp__ or __eq__, cmp() of two instances of that class should compare the id() of those instances. Add a test that verifies this. This test currently fails; I believe this is caused by object.c:2.132 (Patch #424475 by loewis). Index: test_compare.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compare.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_compare.py 2001/01/04 01:34:52 1.3 --- test_compare.py 2001/08/15 21:02:20 1.4 *************** *** 45,48 **** --- 45,56 ---- else: print "%s != %s" % (a, b) + # Ensure default comparison compares id() of args + L = [None] + for i in range(10): + L.insert(len(L)/2, Empty()) + for a in L: + for b in L: + if cmp(a, b) != cmp(id(a), id(b)): + print "ERROR:", cmp(a, b), cmp(id(a), id(b)), id(a), id(b) test() From jvr@users.sourceforge.net Wed Aug 15 22:20:45 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Wed, 15 Aug 2001 14:20:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib site.py,1.33,1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22286 Modified Files: site.py Log Message: Rewrote Jack's latest change so it does what it intended to do... Index: site.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** site.py 2001/08/15 12:07:46 1.33 --- site.py 2001/08/15 21:20:42 1.34 *************** *** 81,88 **** for dir in sys.path: # Filter out paths that don't exist, but leave in the empty string ! # since it's a special case. Except on the mac, where files are legal ! # in sys.path. ! if dir and not os.path.isdir(dir) and sys.platform != 'mac': ! continue dir, dircase = makepath(dir) if not _dirs_in_sys_path.has_key(dircase): --- 81,92 ---- for dir in sys.path: # Filter out paths that don't exist, but leave in the empty string ! # since it's a special case. We also need to special-case the Mac, ! # as file names are allowed on sys.path there. ! if sys.platform != 'mac': ! if dir and not os.path.isdir(dir): ! continue ! else: ! if dir and not os.path.exists(dir): ! continue dir, dircase = makepath(dir) if not _dirs_in_sys_path.has_key(dircase): From gvanrossum@users.sourceforge.net Thu Aug 16 00:57:05 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 15 Aug 2001 16:57:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.32,2.33 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv27196 Modified Files: typeobject.c Log Message: - Another big step in the right direction. All the overridable operators for which a default implementation exist now work, both in dynamic classes and in static classes, overridden or not. This affects __repr__, __str__, __hash__, __contains__, __nonzero__, __cmp__, and the rich comparisons (__lt__ etc.). For dynamic classes, this meant copying a lot of code from classobject! (XXX There are still some holes, because the comparison code in object.c uses PyInstance_Check(), meaning new-style classes don't get the same dispensation. This needs more thinking.) - Add object.__hash__, object.__repr__, object.__str__. The __str__ dispatcher now calls the __repr__ dispatcher, as it should. - For static classes, the tp_compare, tp_richcompare and tp_hash slots are now inherited together, or not at all. (XXX I fear there are still some situations where you can inherit __hash__ when you shouldn't, but mostly it's OK now, and I think there's no way we can get that 100% right.) Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.32 retrieving revision 2.33 diff -C2 -d -r2.32 -r2.33 *** typeobject.c 2001/08/14 20:04:48 2.32 --- typeobject.c 2001/08/15 23:57:02 2.33 *************** *** 852,857 **** } - #if 0 - /* XXX These should be made smarter before they can be used */ static PyObject * object_repr(PyObject *self) --- 852,855 ---- *************** *** 863,866 **** --- 861,875 ---- } + static PyObject * + object_str(PyObject *self) + { + unaryfunc f; + + f = self->ob_type->tp_repr; + if (f == NULL) + f = object_repr; + return f(self); + } + static long object_hash(PyObject *self) *************** *** 868,872 **** return _Py_HashPointer(self); } - #endif static void --- 877,880 ---- *************** *** 892,902 **** 0, /* tp_setattr */ 0, /* tp_compare */ ! 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ PyObject_GenericSetAttr, /* tp_setattro */ --- 900,910 ---- 0, /* tp_setattr */ 0, /* tp_compare */ ! object_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! object_hash, /* tp_hash */ 0, /* tp_call */ ! object_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ PyObject_GenericSetAttr, /* tp_setattro */ *************** *** 1164,1175 **** /* tp_compare see tp_richcompare */ COPYSLOT(tp_repr); ! COPYSLOT(tp_hash); COPYSLOT(tp_call); COPYSLOT(tp_str); COPYSLOT(tp_as_buffer); if (type->tp_flags & base->tp_flags & Py_TPFLAGS_HAVE_RICHCOMPARE) { ! if (type->tp_compare == NULL && type->tp_richcompare == NULL) { type->tp_compare = base->tp_compare; type->tp_richcompare = base->tp_richcompare; } } --- 1172,1187 ---- /* tp_compare see tp_richcompare */ COPYSLOT(tp_repr); ! /* tp_hash see tp_richcompare */ COPYSLOT(tp_call); COPYSLOT(tp_str); COPYSLOT(tp_as_buffer); if (type->tp_flags & base->tp_flags & Py_TPFLAGS_HAVE_RICHCOMPARE) { ! if (type->tp_compare == NULL && ! type->tp_richcompare == NULL && ! type->tp_hash == NULL) ! { type->tp_compare = base->tp_compare; type->tp_richcompare = base->tp_richcompare; + type->tp_hash = base->tp_hash; } } *************** *** 2194,2205 **** slot_sq_contains(PyObject *self, PyObject *value) { ! PyObject *res = PyObject_CallMethod(self, "__contains__", "O", value); ! int r; ! if (res == NULL) ! return -1; ! r = PyInt_AsLong(res); ! Py_DECREF(res); ! return r; } --- 2206,2230 ---- slot_sq_contains(PyObject *self, PyObject *value) { ! PyObject *func, *res, *args; ! func = PyObject_GetAttrString(self, "__contains__"); ! ! if (func != NULL) { ! args = Py_BuildValue("(O)", value); ! if (args == NULL) ! res = NULL; ! else { ! res = PyEval_CallObject(func, args); ! Py_DECREF(args); ! } ! Py_DECREF(func); ! if (res == NULL) ! return -1; ! return PyObject_IsTrue(res); ! } ! else { ! PyErr_Clear(); ! return _PySequence_IterContains(self, value); ! } } *************** *** 2255,2265 **** slot_nb_nonzero(PyObject *self) { ! /* XXX This should cope with a missing __nonzero__ */ ! /* XXX Should it also look for __len__? */ ! PyObject *res = PyObject_CallMethod(self, "__nonzero__", ""); ! if (res == NULL) ! return -1; ! return (int)PyInt_AsLong(res); } --- 2280,2302 ---- slot_nb_nonzero(PyObject *self) { ! PyObject *func, *res; ! func = PyObject_GetAttrString(self, "__nonzero__"); ! if (func == NULL) { ! PyErr_Clear(); ! func = PyObject_GetAttrString(self, "__len__"); ! } ! ! if (func != NULL) { ! res = PyEval_CallObject(func, NULL); ! Py_DECREF(func); ! if (res == NULL) ! return -1; ! return PyObject_IsTrue(res); ! } ! else { ! PyErr_Clear(); ! return 1; ! } } *************** *** 2294,2323 **** static int slot_tp_compare(PyObject *self, PyObject *other) { ! /* XXX Should this cope with a missing __cmp__? */ ! PyObject *res = PyObject_CallMethod(self, "__cmp__", "O", other); ! long r; ! if (res == NULL) ! return -1; ! r = PyInt_AsLong(res); ! Py_DECREF(res); ! return (int)r; } ! /* XXX This should cope with a missing __repr__, and also look for __str__ */ ! SLOT0(slot_tp_repr, "__repr__") static long slot_tp_hash(PyObject *self) { ! /* XXX This should cope with a missing __hash__ */ ! PyObject *res = PyObject_CallMethod(self, "__hash__", ""); long h; ! if (res == NULL) ! return -1; ! h = PyInt_AsLong(res); if (h == -1 && !PyErr_Occurred()) h = -2; --- 2331,2453 ---- static int + half_compare(PyObject *self, PyObject *other) + { + PyObject *func, *args, *res; + int c; + + func = PyObject_GetAttrString(self, "__cmp__"); + if (func == NULL) { + PyErr_Clear(); + } + else { + args = Py_BuildValue("(O)", other); + if (args == NULL) + res = NULL; + else { + res = PyObject_CallObject(func, args); + Py_DECREF(args); + } + if (res != Py_NotImplemented) { + if (res == NULL) + return -2; + c = PyInt_AsLong(res); + Py_DECREF(res); + if (c == -1 && PyErr_Occurred()) + return -2; + return (c < 0) ? -1 : (c > 0) ? 1 : 0; + } + Py_DECREF(res); + } + return 2; + } + + static int slot_tp_compare(PyObject *self, PyObject *other) { ! int c; ! if (self->ob_type->tp_compare == slot_tp_compare) { ! c = half_compare(self, other); ! if (c <= 1) ! return c; ! } ! if (other->ob_type->tp_compare == slot_tp_compare) { ! c = half_compare(other, self); ! if (c < -1) ! return -2; ! if (c <= 1) ! return -c; ! } ! return (void *)self < (void *)other ? -1 : ! (void *)self > (void *)other ? 1 : 0; } ! static PyObject * ! slot_tp_repr(PyObject *self) ! { ! PyObject *func, *res; ! ! func = PyObject_GetAttrString(self, "__repr__"); ! if (func != NULL) { ! res = PyEval_CallObject(func, NULL); ! Py_DECREF(func); ! return res; ! } ! else { ! char buf[120]; ! PyErr_Clear(); ! sprintf(buf, "<%.80s object at %p>", ! self->ob_type->tp_name, self); ! return PyString_FromString(buf); ! } ! } ! ! static PyObject * ! slot_tp_str(PyObject *self) ! { ! PyObject *func, *res; ! ! func = PyObject_GetAttrString(self, "__str__"); ! if (func != NULL) { ! res = PyEval_CallObject(func, NULL); ! Py_DECREF(func); ! return res; ! } ! else { ! PyErr_Clear(); ! return slot_tp_repr(self); ! } ! } static long slot_tp_hash(PyObject *self) { ! PyObject *func, *res; long h; ! func = PyObject_GetAttrString(self, "__hash__"); ! ! if (func != NULL) { ! res = PyEval_CallObject(func, NULL); ! Py_DECREF(func); ! if (res == NULL) ! return -1; ! h = PyInt_AsLong(res); ! } ! else { ! PyErr_Clear(); ! func = PyObject_GetAttrString(self, "__eq__"); ! if (func == NULL) { ! PyErr_Clear(); ! func = PyObject_GetAttrString(self, "__cmp__"); ! } ! if (func != NULL) { ! Py_DECREF(func); ! PyErr_SetString(PyExc_TypeError, "unhashable type"); ! return -1; ! } ! PyErr_Clear(); ! h = _Py_HashPointer((void *)self); ! } if (h == -1 && !PyErr_Occurred()) h = -2; *************** *** 2338,2344 **** } - /* XXX This should cope with a missing __str__, and also look for __repr__ */ - SLOT0(slot_tp_str, "__str__") - static PyObject * slot_tp_getattro(PyObject *self, PyObject *name) --- 2468,2471 ---- *************** *** 2386,2403 **** static PyObject * slot_tp_richcompare(PyObject *self, PyObject *other, int op) { - /* XXX How should this cope with missing __xx__? */ - PyObject *meth = PyObject_GetAttrString(self, name_op[op]); PyObject *res; ! if (meth == NULL) ! return NULL; ! res = PyObject_CallFunction(meth, "O", other); ! Py_DECREF(meth); ! return res; } ! SLOT0(slot_tp_iter, "__iter__") static PyObject * --- 2513,2582 ---- static PyObject * + half_richcompare(PyObject *self, PyObject *other, int op) + { + PyObject *func, *args, *res; + + func = PyObject_GetAttrString(self, name_op[op]); + if (func == NULL) { + PyErr_Clear(); + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + args = Py_BuildValue("(O)", other); + if (args == NULL) + res = NULL; + else { + res = PyObject_CallObject(func, args); + Py_DECREF(args); + } + Py_DECREF(func); + return res; + } + + /* Map rich comparison operators to their swapped version, e.g. LT --> GT */ + static int swapped_op[] = {Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE}; + + static PyObject * slot_tp_richcompare(PyObject *self, PyObject *other, int op) { PyObject *res; ! if (self->ob_type->tp_richcompare == slot_tp_richcompare) { ! res = half_richcompare(self, other, op); ! if (res != Py_NotImplemented) ! return res; ! Py_DECREF(res); ! } ! if (other->ob_type->tp_richcompare == slot_tp_richcompare) { ! res = half_richcompare(other, self, swapped_op[op]); ! if (res != Py_NotImplemented) { ! return res; ! } ! Py_DECREF(res); ! } ! Py_INCREF(Py_NotImplemented); ! return Py_NotImplemented; } ! static PyObject * ! slot_tp_iter(PyObject *self) ! { ! PyObject *func, *res; ! ! func = PyObject_GetAttrString(self, "__iter__"); ! if (func != NULL) { ! res = PyObject_CallObject(func, NULL); ! Py_DECREF(func); ! return res; ! } ! PyErr_Clear(); ! func = PyObject_GetAttrString(self, "__getitem__"); ! if (func == NULL) { ! PyErr_SetString(PyExc_TypeError, "iter() of non-sequence"); ! return NULL; ! } ! Py_DECREF(func); ! return PySeqIter_New(self); ! } static PyObject * From gvanrossum@users.sourceforge.net Thu Aug 16 00:58:02 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 15 Aug 2001 16:58:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv27447 Modified Files: test_descr.py Log Message: Add tests for overridable operators that have default interpretations (__hash__ etc.), in static and dynamic classes, overridden and default. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_descr.py 2001/08/15 17:51:17 1.10 --- test_descr.py 2001/08/15 23:57:59 1.11 *************** *** 865,868 **** --- 865,994 ---- verify(d2.goo() == 2) + def specials(): + # Test operators like __hash__ for which a built-in default exists + if verbose: print "testing special operators..." + # Test the default behavior for static classes + class C(object): + def __getitem__(self, i): + if 0 <= i < 10: return i + raise IndexError + c1 = C() + c2 = C() + verify(not not c1) + verify(hash(c1) == id(c1)) + verify(cmp(c1, c2) == cmp(id(c1), id(c2))) + verify(c1 == c1) + verify(c1 != c2) + verify(not c1 != c1) + verify(not c1 == c2) + verify(str(c1) == '' % id(c1)) + verify(repr(c1) == '' % id(c1)) + verify(-1 not in c1) + for i in range(10): + verify(i in c1) + verify(10 not in c1) + # Test the default behavior for dynamic classes + class D(object): + __dynamic__ = 1 + def __getitem__(self, i): + if 0 <= i < 10: return i + raise IndexError + d1 = D() + d2 = D() + verify(not not d1) + verify(hash(d1) == id(d1)) + verify(cmp(d1, d2) == cmp(id(d1), id(d2))) + verify(d1 == d1) + verify(d1 != d2) + verify(not d1 != d1) + verify(not d1 == d2) + verify(str(d1) == '' % id(d1)) + verify(repr(d1) == '' % id(d1)) + verify(-1 not in d1) + for i in range(10): + verify(i in d1) + verify(10 not in d1) + # Test overridden behavior for static classes + class Proxy(object): + def __init__(self, x): + self.x = x + def __nonzero__(self): + return not not self.x + def __hash__(self): + return hash(self.x) + def __eq__(self, other): + return self.x == other + def __ne__(self, other): + return self.x != other + def __cmp__(self, other): + return cmp(self.x, other.x) + def __str__(self): + return "Proxy:%s" % self.x + def __repr__(self): + return "Proxy(%r)" % self.x + def __contains__(self, value): + return value in self.x + p0 = Proxy(0) + p1 = Proxy(1) + p_1 = Proxy(-1) + verify(not p0) + verify(not not p1) + verify(hash(p0) == hash(0)) + verify(p0 == p0) + verify(p0 != p1) + verify(not p0 != p0) + verify(not p0 == p1) + verify(cmp(p0, p1) == -1) + verify(cmp(p0, p0) == 0) + verify(cmp(p0, p_1) == 1) + verify(str(p0) == "Proxy:0") + verify(repr(p0) == "Proxy(0)") + p10 = Proxy(range(10)) + verify(-1 not in p10) + for i in range(10): + verify(i in p10) + verify(10 not in p10) + # Test overridden behavior for dynamic classes + class DProxy(object): + __dynamic__ = 1 + def __init__(self, x): + self.x = x + def __nonzero__(self): + return not not self.x + def __hash__(self): + return hash(self.x) + def __eq__(self, other): + return self.x == other + def __ne__(self, other): + return self.x != other + def __cmp__(self, other): + return cmp(self.x, other.x) + def __str__(self): + return "DProxy:%s" % self.x + def __repr__(self): + return "DProxy(%r)" % self.x + def __contains__(self, value): + return value in self.x + p0 = DProxy(0) + p1 = DProxy(1) + p_1 = DProxy(-1) + verify(not p0) + verify(not not p1) + verify(hash(p0) == hash(0)) + verify(p0 == p0) + verify(p0 != p1) + verify(not p0 != p0) + verify(not p0 == p1) + verify(cmp(p0, p1) == -1) + verify(cmp(p0, p0) == 0) + verify(cmp(p0, p_1) == 1) + verify(str(p0) == "DProxy:0") + verify(repr(p0) == "DProxy(0)") + p10 = DProxy(range(10)) + verify(-1 not in p10) + for i in range(10): + verify(i in p10) + verify(10 not in p10) + def all(): lists() *************** *** 892,895 **** --- 1018,1022 ---- overloading() methods() + specials() all() From montanaro@users.sourceforge.net Thu Aug 16 02:04:57 2001 From: montanaro@users.sourceforge.net (Skip Montanaro) Date: Wed, 15 Aug 2001 18:04:57 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0266.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv10609 Modified Files: pep-0266.txt Log Message: added bit about caching functions in pystone added (very) short bit about threads added "Questions" and "Unresolved Issues" sections Index: pep-0266.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0266.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0266.txt 2001/08/15 00:05:34 1.1 --- pep-0266.txt 2001/08/16 01:04:55 1.2 *************** *** 50,53 **** --- 50,65 ---- such objects should be low and the potential payoff fairly large. + In an attempt to gauge the effect of this proposal, I modified the + Pystone benchmark program included in the Python distribution to + cache global functions. Its main function, Proc0, makes calls to + ten different functions inside its for loop. In addition, Func2 + calls Func1 repeatedly inside a loop. If local copies of these 11 + global idenfiers are made before the functions' loops are entered, + performance on this particular benchmark improves by about two per + cent (from 5561 pystones to 5685 on my laptop). It gives some + indication that performance would be improved by caching most + global variable access. Note also that the pystone benchmark + makes essentially no accesses of global module attributes, an + anticipated area of improvement for this PEP. Proposed Change *************** *** 64,67 **** --- 76,90 ---- + Threads + + Operation of this code in threaded programs will be no different + than in unthreaded programs. If you need to lock an object to + access it, you would have had to do that before TRACK_OBJECT would + have been executed and retain that lock until after you stop using + it. + + FIXME: I suspect I need more here. + + Rationale *************** *** 104,108 **** being called in the loop and decide to generate the tracked local code, avoiding it for the builtin range() function because it's ! only called once during loop setup. According to a post to python-dev by Marc-Andre Lemburg [1], --- 127,133 ---- being called in the loop and decide to generate the tracked local code, avoiding it for the builtin range() function because it's ! only called once during loop setup. Performance issues related to ! accessing local variables make tracking l.append less attractive ! than tracking globals such as math.sin. According to a post to python-dev by Marc-Andre Lemburg [1], *************** *** 112,117 **** instruction, which is a simple array index and requires no extra function calls by the virtual machine. I believe many LOAD_GLOBAL ! instructions and LOAD_GLOBAL/ LOAD_ATTR pairs could be converted ! to LOAD_FAST instructions. Code that uses global variables heavily often resorts to various --- 137,142 ---- instruction, which is a simple array index and requires no extra function calls by the virtual machine. I believe many LOAD_GLOBAL ! instructions and LOAD_GLOBAL/LOAD_ATTR pairs could be converted to ! LOAD_FAST instructions. Code that uses global variables heavily often resorts to various *************** *** 127,130 **** --- 152,377 ---- + Questions + + Q. What about threads? What if math.sin changes while in cache? + + A. I believe the global interpreter lock will protect values from + being corrupted. In any case, the situation would be no worse + than it is today. If one thread modified math.sin after another + thread had already executed "LOAD_GLOBAL math", but before it + executed "LOAD_ATTR sin", the client thread would see the old + value of math.sin. + + The idea is this. I use a multi-attribute load below as an + example, not because it would happen very often, but because by + demonstrating the recursive nature with an extra call hopefully + it will become clearer what I have in mind. Suppose a function + defined in module foo wants to access spam.eggs.ham and that + spam is a module imported at the module level in foo: + + import spam + ... + def somefunc(): + ... + x = spam.eggs.ham + + Upon entry to somefunc, a TRACK_GLOBAL instruction will be + executed: + + TRACK_GLOBAL spam.eggs.ham n + + "spam.eggs.ham" is a string literal stored in the function's + constants array. "n" is a fastlocals index. "&fastlocals[n]" + is a reference to slot "n" in the executing frame's fastlocals + array, the location in which the spam.eggs.ham reference will + be stored. Here's what I envision happening: + + 1. The TRACK_GLOBAL instruction locates the object referred to + by the name "spam" and finds it in its module scope. It + then executes a C function like + + _PyObject_TrackName(m, "spam.eggs.ham", &fastlocals[n]) + + where "m" is the module object with an attribute "spam". + + 2. The module object strips the leading "spam." stores the + necessary information ("eggs.ham" and &fastlocals[n]) in + case its binding for the name "eggs" changes. It then + locates the object referred to by the key "eggs" in its + dict and recursively calls + + _PyObject_TrackName(eggs, "eggs.ham", &fastlocals[n]) + + 3. The eggs object strips the leading "eggs.", stores the + ("ham", &fastlocals[n]) info, locates the object in its + namespace called "ham" and calls _PyObject_TrackName once + again: + + _PyObject_TrackName(ham, "ham", &fastlocals[n]) + + 4. The "ham" object strips the leading string (no "." this + time, but that's a minor point), sees that the result is + empty, then uses its own value (self, probably) to update + the location it was handed: + + Py_XDECREF(&fastlocals[n]); + &fastlocals[n] = self; + Py_INCREF(&fastlocals[n]); + + At this point, each object involved in resolving + "spam.eggs.ham" knows which entry in its namespace needs to be + tracked and what location to update if that name changes. + Furthermore, if the one name it is tracking in its local + storage changes, it can call _PyObject_TrackName using the new + object once the change has been made. At the bottom end of + the food chain, the last object will always strip a name, see + the empty string and know that its value should be stuffed + into the location it's been passed. + + When the object referred to by the dotted expression + "spam.eggs.ham" is going to go out of scope, an + "UNTRACK_GLOBAL spam.eggs.ham n" instruction is executed. It + has the effect of deleting all the tracking information that + TRACK_GLOBAL established. + + The tracking operation may seem expensive, but recall that the + objects being tracked are assumed to be "almost constant", so + the setup cost will be traded off against hopefully multiple + local instead of global loads. For globals with attributes + the tracking setup cost grows but is offset by avoiding the + extra LOAD_ATTR cost. The TRACK_GLOBAL instruction needs to + perform a PyDict_GetItemString for the first name in the chain + to determine where the top-level object resides. Each object + in the chain has to store a string and an address somewhere, + probably in a dict that uses storage locations as keys + (e.g. the &fastlocals[n]) and strings as values. (This dict + could possibly be a central dict of dicts whose keys are + object addresses instead of a per-object dict.) It shouldn't + be the other way around because multiple active frames may + want to track "spam.eggs.ham", but only one frame will want to + associate that name with one of its fast locals slots. + + + Unresolved Issues + + Threading - + + What about this (dumb) code? + + l = [] + lock = threading.Lock() + ... + def fill_l(): + for i in range(1000): + lock.acquire() + l.append(math.sin(i)) + lock.release() + ... + def consume_l(): + while 1: + lock.acquire() + if l: + elt = l.pop() + lock.release() + fiddle(elt) + + It's not clear from a static analysis of the code what the lock is + protecting. (You can't tell at compile-time that threads are even + involved can you?) Would or should it affect attempts to track + "l.append" or "math.sin" in the fill_l function? + + If we annotate the code with mythical track_object and untrack_object + builtins (I'm not proposing this, just illustrating where stuff would + go!), we get + + l = [] + lock = threading.Lock() + ... + def fill_l(): + track_object("l.append", append) + track_object("math.sin", sin) + for i in range(1000): + lock.acquire() + append(sin(i)) + lock.release() + untrack_object("math.sin", sin) + untrack_object("l.append", append) + ... + def consume_l(): + while 1: + lock.acquire() + if l: + elt = l.pop() + lock.release() + fiddle(elt) + + Is that correct both with and without threads (or at least equally + incorrect with and without threads)? + + Nested Scopes - + + The presence of nested scopes will affect where TRACK_GLOBAL finds + a global variable, but shouldn't affect anything after that. (I + think.) + + Missing Attributes - + + Suppose I am tracking the object referred to by "spam.eggs.ham" + and "spam.eggs" is rebound to an object that does not have a "ham" + attribute. It's clear this will be an AttributeError if the + programmer attempts to resolve "spam.eggs.ham" in the current + Python virtual machine, but suppose the programmer has anticipated + this case: + + if hasattr(spam.eggs, "ham"): + print spam.eggs.ham + elif hasattr(spam.eggs, "bacon"): + print spam.eggs.bacon + else: + print "what? no meat?" + + You can't raise an AttributeError when the tracking information is + recalculated. If it does not raise AttributeError and instead + lets the tracking stand, it may be setting the programmer up for a + very subtle error. + + One solution to this problem would be to track the shortest + possible root of each dotted expression the function refers to + directly. In the above example, "spam.eggs" would be tracked, but + "spam.eggs.ham" and "spam.eggs.bacon" would not. + + Who does the dirty work? - + + In the Questions section I postulated the existence of a + _PyObject_TrackName function. While the API is fairly easy to + specify, the implementation behind-the-scenes is not so obvious. + A central dictionary could be used to track the name/location + mappings, but it appears that all setattr functions might need to + be modified to accommodate this new functionality. + + If all types used the PyObject_GenericSetAttr function to set + attributes that would localize the update code somewhat. They + don't however (which is not too surprising), so it seems that all + getattrfunc and getattrofunc functions will have to be updated. + In addition, this would place an absolute requirement on C + extension module authors to call some function when an attribute + changes value (PyObject_TrackUpdate?). + + Finally, it's quite possible that some attributes will be set by + side effect and not by any direct call to a setattr method of some + sort. Consider a device interface module that has an interrupt + routine that copies the contents of a device register into a slot + in the object's struct whenever it changes. In these situations, + more extensive modifications would have to be made by the module + author. To identify such situations at compile time would be + impossible. I think an extra slot could be added to PyTypeObjects + to indicate if an object's code is safe for global tracking. It + would have a default value of 0 (Py_TRACKING_NOT_SAFE). If an + extension module author has implemented the necessary tracking + support, that field could be initialized to 1 (Py_TRACKING_SAFE). + _PyObject_TrackName could check that field and issue a warning if + it is asked to track an object that the author has not explicitly + said was safe for tracking. + Discussion *************** *** 136,140 **** proposal still appears to require dictionary key lookup. It doesn't appear that his proposal could speed local variable ! attribute lookup, which might be worthwhile in some situations. --- 383,388 ---- proposal still appears to require dictionary key lookup. It doesn't appear that his proposal could speed local variable ! attribute lookup, which might be worthwhile in some situations if ! potential performance burdens could be addressed. *************** *** 202,204 **** --- 450,453 ---- mode: indented-text indent-tabs-mode: nil + fill-column: 70 End: From tim_one@users.sourceforge.net Thu Aug 16 02:53:53 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 15 Aug 2001 18:53:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.83,1.84 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv22077 Modified Files: python20.wse Log Message: Wise uninstallers never delete the Python DLL from the system directory. They should. Added a line that's supposed to fix that -- it doesn't actually work on my box, but checking it in anyway. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** python20.wse 2001/08/15 06:10:16 1.83 --- python20.wse 2001/08/16 01:53:51 1.84 *************** *** 1846,1849 **** --- 1846,1858 ---- Text=Main Python DLL end + item: Remark + Text=Tell Wise it's OK to delete the Python DLL at uninstall time, + end + item: Remark + Text=despite that we (may) write it into a system directory. + end + item: Add Text to INSTALL.LOG + Text=Non-System File: + end item: Install File Source=.\python%_pymajor_%%_pyminor_%.dll From tim_one@users.sourceforge.net Thu Aug 16 03:23:06 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 15 Aug 2001 19:23:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.84,1.85 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv27398 Modified Files: python20.wse Log Message: No change, just wanted to record more info in the log: after the last checkin, the Wise uninstaller *will* delete the Python DLL from the system directory, but if and only if there wasn't a same-named Python DLL already in the system directory at the time the installer ran. That (no same-named DLL) should be the typical case for most most people (I'm different because I've run perhaps hundreds of 2.2 installs over the last several weeks). IOW, the change was worth making. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 From gvanrossum@users.sourceforge.net Thu Aug 16 09:02:47 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 01:02:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects object.c,2.136,2.137 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv29900 Modified Files: object.c Log Message: Update to MvL's patch #424475 to avoid returning 2 when tp_compare returns that. (This fix is also by MvL; checkin it in because I want to make more changes here. I'm still not 100% satisfied -- see comments attached to the patch.) Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.136 retrieving revision 2.137 diff -C2 -d -r2.136 -r2.137 *** object.c 2001/08/07 17:24:28 2.136 --- object.c 2001/08/16 08:02:45 2.137 *************** *** 581,586 **** if (v->ob_type == w->ob_type ! && (f = v->ob_type->tp_compare) != NULL) ! return (*f)(v, w); c = try_rich_to_3way_compare(v, w); if (c < 2) --- 581,589 ---- if (v->ob_type == w->ob_type ! && (f = v->ob_type->tp_compare) != NULL) { ! c = (*f)(v, w); ! if (c != 2 || !PyInstance_Check(v)) ! return c; ! } c = try_rich_to_3way_compare(v, w); if (c < 2) From gvanrossum@users.sourceforge.net Thu Aug 16 09:17:28 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 01:17:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects object.c,2.137,2.138 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv32685 Modified Files: object.c Log Message: Add a function _Py_ReadyTypes() which initializes various and sundry types -- currently Type, List, None and NotImplemented. To be called from Py_Initialize() instead of accumulating calls there. Also rename type(None) to NoneType and type(NotImplemented) to NotImplementedType -- naming the type identical to the object was confusing. Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.137 retrieving revision 2.138 diff -C2 -d -r2.137 -r2.138 *** object.c 2001/08/16 08:02:45 2.137 --- object.c 2001/08/16 08:17:26 2.138 *************** *** 1374,1377 **** --- 1374,1378 ---- There is (and should be!) no way to create other objects of this type, so there is exactly one (which is indestructible, by the way). + (XXX This type and the type of NotImplemented below should be unified.) */ *************** *** 1394,1401 **** ! static PyTypeObject PyNothing_Type = { PyObject_HEAD_INIT(&PyType_Type) 0, ! "None", 0, 0, --- 1395,1402 ---- ! static PyTypeObject PyNone_Type = { PyObject_HEAD_INIT(&PyType_Type) 0, ! "NoneType", 0, 0, *************** *** 1413,1417 **** PyObject _Py_NoneStruct = { ! PyObject_HEAD_INIT(&PyNothing_Type) }; --- 1414,1418 ---- PyObject _Py_NoneStruct = { ! PyObject_HEAD_INIT(&PyNone_Type) }; *************** *** 1428,1432 **** PyObject_HEAD_INIT(&PyType_Type) 0, ! "NotImplemented", 0, 0, --- 1429,1433 ---- PyObject_HEAD_INIT(&PyType_Type) 0, ! "NotImplementedType", 0, 0, *************** *** 1446,1449 **** --- 1447,1466 ---- PyObject_HEAD_INIT(&PyNotImplemented_Type) }; + + void + _Py_ReadyTypes(void) + { + if (PyType_Ready(&PyType_Type) < 0) + Py_FatalError("Can't initialize 'type'"); + + if (PyType_Ready(&PyList_Type) < 0) + Py_FatalError("Can't initialize 'list'"); + + if (PyType_Ready(&PyNone_Type) < 0) + Py_FatalError("Can't initialize type(None)"); + + if (PyType_Ready(&PyNotImplemented_Type) < 0) + Py_FatalError("Can't initialize type(NotImplemented)"); + } From gvanrossum@users.sourceforge.net Thu Aug 16 09:21:45 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 01:21:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python pythonrun.c,2.144,2.145 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv1011 Modified Files: pythonrun.c Log Message: Bunchathings: - initsigs(): Ignore SIGXFZ so writing files beyond the file system size limit won't kill us. - Py_Initialize(): call _Py_ReadyTypes() instead of readying types here. - Py_Initialize(): call _PyImport_FixupExtension() for module "extensions". (SF bug #422004.) Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.144 retrieving revision 2.145 diff -C2 -d -r2.144 -r2.145 *** pythonrun.c 2001/08/13 23:04:56 2.144 --- pythonrun.c 2001/08/16 08:21:42 2.145 *************** *** 95,98 **** --- 95,99 ---- PyObject *bimod, *sysmod; char *p; + extern void _Py_ReadyTypes(void); if (initialized) *************** *** 115,124 **** Py_FatalError("Py_Initialize: can't make first thread"); (void) PyThreadState_Swap(tstate); - - if (PyType_Ready(&PyType_Type) < 0) - Py_FatalError("Py_Initialize: can't initialize 'type'"); ! if (PyType_Ready(&PyList_Type) < 0) ! Py_FatalError("Py_Initialize: can't initialize 'list'"); interp->modules = PyDict_New(); --- 116,121 ---- Py_FatalError("Py_Initialize: can't make first thread"); (void) PyThreadState_Swap(tstate); ! _Py_ReadyTypes(); interp->modules = PyDict_New(); *************** *** 156,159 **** --- 153,157 ---- /* phase 2 of builtins */ _PyImport_FixupExtension("__builtin__", "__builtin__"); + _PyImport_FixupExtension("exceptions", "exceptions"); initsigs(); /* Signal handling stuff, including initintr() */ *************** *** 1326,1329 **** --- 1324,1330 ---- #ifdef SIGPIPE signal(SIGPIPE, SIG_IGN); + #endif + #ifdef SIGXFZ + signal(SIGXFZ, SIG_IGN); #endif #endif /* HAVE_SIGNAL_H */ From gvanrossum@users.sourceforge.net Thu Aug 16 09:24:03 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 01:24:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python pythonrun.c,2.145,2.146 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv1495 Modified Files: pythonrun.c Log Message: Oops. Two fixes for SF bug #422004 are not needed. :-) Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.145 retrieving revision 2.146 diff -C2 -d -r2.145 -r2.146 *** pythonrun.c 2001/08/16 08:21:42 2.145 --- pythonrun.c 2001/08/16 08:24:00 2.146 *************** *** 153,157 **** /* phase 2 of builtins */ _PyImport_FixupExtension("__builtin__", "__builtin__"); - _PyImport_FixupExtension("exceptions", "exceptions"); initsigs(); /* Signal handling stuff, including initintr() */ --- 153,156 ---- From gvanrossum@users.sourceforge.net Thu Aug 16 09:27:35 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 01:27:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects descrobject.c,2.1,2.2 typeobject.c,2.33,2.34 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv1636/Objects Modified Files: descrobject.c typeobject.c Log Message: Subtle change to make None.__class__ work: - descrobject.c:descr_check(): only believe None means the same as NULL if the type given is None's type. - typeobject.c:wrap_descr_get(): don't "conventiently" default an absent type to the type of the object argument. Let the called function figure it out. Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -d -r2.1 -r2.2 *** descrobject.c 2001/08/02 04:15:00 2.1 --- descrobject.c 2001/08/16 08:27:33 2.2 *************** *** 92,98 **** static int descr_check(PyDescrObject *descr, PyObject *obj, PyTypeObject *type, ! PyObject **pres) { ! if (obj == NULL || obj == Py_None) { Py_INCREF(descr); *pres = (PyObject *)descr; --- 92,98 ---- static int descr_check(PyDescrObject *descr, PyObject *obj, PyTypeObject *type, ! PyObject **pres) { ! if (obj == NULL || (obj == Py_None && type != Py_None->ob_type)) { Py_INCREF(descr); *pres = (PyObject *)descr; Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -d -r2.33 -r2.34 *** typeobject.c 2001/08/15 23:57:02 2.33 --- typeobject.c 2001/08/16 08:27:33 2.34 *************** *** 1863,1868 **** if (!PyArg_ParseTuple(args, "O|O", &obj, &type)) return NULL; - if (type == NULL) - type = (PyObject *)obj->ob_type; return (*func)(self, obj, type); } --- 1863,1866 ---- From gvanrossum@users.sourceforge.net Thu Aug 16 09:30:12 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 01:30:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_generators.py,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv2583 Modified Files: test_generators.py Log Message: The change of type(None).__name__ from 'None' to 'NoneType' broke this test in a trivial way. Fixed. Index: test_generators.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_generators.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** test_generators.py 2001/08/15 04:41:19 1.26 --- test_generators.py 2001/08/16 08:30:10 1.27 *************** *** 781,785 **** ... >>> type(f()) ! >>> def f(): --- 781,785 ---- ... >>> type(f()) ! >>> def f(): *************** *** 791,795 **** ... yield 2 >>> type(f()) ! >>> def f(): --- 791,795 ---- ... yield 2 >>> type(f()) ! >>> def f(): From gvanrossum@users.sourceforge.net Thu Aug 16 09:32:41 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 01:32:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_extcall,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv3109 Modified Files: test_extcall Log Message: The change of type(None).__name__ from 'None' to 'NoneType' broke this test in a trivial way. Fixed. Index: test_extcall =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_extcall,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_extcall 2001/05/13 00:19:31 1.9 --- test_extcall 2001/08/16 08:32:39 1.10 *************** *** 27,34 **** h() argument after * must be a sequence dir() argument after * must be a sequence ! None object argument after * must be a sequence h() argument after ** must be a dictionary dir() argument after ** must be a dictionary ! None object argument after ** must be a dictionary dir() got multiple values for keyword argument 'b' 3 512 1 --- 27,34 ---- h() argument after * must be a sequence dir() argument after * must be a sequence ! NoneType object argument after * must be a sequence h() argument after ** must be a dictionary dir() argument after ** must be a dictionary ! NoneType object argument after ** must be a dictionary dir() got multiple values for keyword argument 'b' 3 512 1 From gvanrossum@users.sourceforge.net Thu Aug 16 10:10:44 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 02:10:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules xxsubtype.c,2.4,2.5 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv11574 Modified Files: xxsubtype.c Log Message: Change the type names to xxsublist.. Index: xxsubtype.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/xxsubtype.c,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** xxsubtype.c 2001/08/15 18:18:58 2.4 --- xxsubtype.c 2001/08/16 09:10:42 2.5 *************** *** 64,68 **** PyObject_HEAD_INIT(&PyType_Type) 0, ! "spamlist", sizeof(spamlistobject), 0, --- 64,68 ---- PyObject_HEAD_INIT(&PyType_Type) 0, ! "xxsubtype.spamlist", sizeof(spamlistobject), 0, *************** *** 157,161 **** PyObject_HEAD_INIT(&PyType_Type) 0, ! "spamdict", sizeof(spamdictobject), 0, --- 157,161 ---- PyObject_HEAD_INIT(&PyType_Type) 0, ! "xxsubtype.spamdict", sizeof(spamdictobject), 0, From gvanrossum@users.sourceforge.net Thu Aug 16 10:18:58 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 02:18:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.34,2.35 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13504 Modified Files: typeobject.c Log Message: Fix SF bug #442501: calculate __module__ properly. - type_module(), type_name(): if tp_name contains one or more period, the part before the last period is __module__, the part after that is __name__. Otherwise, for non-heap types, __module__ is "__builtin__". For heap types, __module__ is looked up in tp_defined. - type_new(): heap types have their __module__ set from globals().__name__; a pre-existing __module__ in their dict is not overridden. This is not inherited. - type_repr(): if __module__ exists and is not "__builtin__", it is included in the string representation (just as it already is for classes). For example . Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.34 retrieving revision 2.35 diff -C2 -d -r2.34 -r2.35 *** typeobject.c 2001/08/16 08:27:33 2.34 --- typeobject.c 2001/08/16 09:18:56 2.35 *************** *** 6,10 **** static struct memberlist type_members[] = { - {"__name__", T_STRING, offsetof(PyTypeObject, tp_name), READONLY}, {"__basicsize__", T_INT, offsetof(PyTypeObject,tp_basicsize),READONLY}, {"__itemsize__", T_INT, offsetof(PyTypeObject, tp_itemsize), READONLY}, --- 6,9 ---- *************** *** 22,28 **** static PyObject * type_module(PyTypeObject *type, void *context) { ! return PyString_FromString("__builtin__"); } --- 21,55 ---- static PyObject * + type_name(PyTypeObject *type, void *context) + { + char *s; + + s = strrchr(type->tp_name, '.'); + if (s == NULL) + s = type->tp_name; + else + s++; + return PyString_FromString(s); + } + + static PyObject * type_module(PyTypeObject *type, void *context) { ! PyObject *mod; ! char *s; ! ! s = strrchr(type->tp_name, '.'); ! if (s != NULL) ! return PyString_FromStringAndSize(type->tp_name, ! (int)(s - type->tp_name)); ! if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) ! return PyString_FromString("__builtin__"); ! mod = PyDict_GetItemString(type->tp_defined, "__module__"); ! if (mod != NULL && PyString_Check(mod)) { ! Py_INCREF(mod); ! return mod; ! } ! PyErr_SetString(PyExc_AttributeError, "__module__"); ! return NULL; } *************** *** 66,69 **** --- 93,97 ---- struct getsetlist type_getsets[] = { + {"__name__", (getter)type_name, NULL, NULL}, {"__module__", (getter)type_module, NULL, NULL}, {"__dict__", (getter)type_dict, NULL, NULL}, *************** *** 86,91 **** type_repr(PyTypeObject *type) { ! char buf[100]; ! sprintf(buf, "", type->tp_name); return PyString_FromString(buf); } --- 114,138 ---- type_repr(PyTypeObject *type) { ! PyObject *mod, *name; ! char buf[200]; ! ! mod = type_module(type, NULL); ! if (mod == NULL) ! PyErr_Clear(); ! else if (!PyString_Check(mod)) { ! Py_DECREF(mod); ! mod = NULL; ! } ! name = type_name(type, NULL); ! if (name == NULL) ! return NULL; ! if (mod != NULL && strcmp(PyString_AS_STRING(mod), "__builtin__")) ! sprintf(buf, "", ! PyString_AS_STRING(mod), ! PyString_AS_STRING(name)); ! else ! sprintf(buf, "", type->tp_name); ! Py_XDECREF(mod); ! Py_DECREF(name); return PyString_FromString(buf); } *************** *** 612,615 **** --- 659,675 ---- } + /* Set __module__ in the dict */ + if (PyDict_GetItemString(dict, "__module__") == NULL) { + tmp = PyEval_GetGlobals(); + if (tmp != NULL) { + tmp = PyDict_GetItemString(tmp, "__name__"); + if (tmp != NULL) { + if (PyDict_SetItemString(dict, "__module__", + tmp) < 0) + return NULL; + } + } + } + /* Special-case __new__: if it's a plain function, make it a static function */ *************** *** 2479,2484 **** } getattr = _PyType_Lookup(tp, getattr_str); ! if (getattr == NULL) return PyObject_GenericGetAttr(self, name); return PyObject_CallFunction(getattr, "OO", self, name); } --- 2539,2550 ---- } getattr = _PyType_Lookup(tp, getattr_str); ! if (getattr == NULL) { ! /* Avoid further slowdowns */ ! if (tp->tp_getattro == slot_tp_getattro) ! tp->tp_getattro = PyObject_GenericGetAttr; ! else ! fprintf(stderr, "huh?\n"); return PyObject_GenericGetAttr(self, name); + } return PyObject_CallFunction(getattr, "OO", self, name); } From loewis@users.sourceforge.net Thu Aug 16 14:15:02 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 16 Aug 2001 06:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.205,1.206 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv23257/Misc Modified Files: NEWS Log Message: Patch #427190: Implement and use METH_NOARGS and METH_O. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.205 retrieving revision 1.206 diff -C2 -d -r1.205 -r1.206 *** NEWS 2001/08/15 15:54:56 1.205 --- NEWS 2001/08/16 13:14:59 1.206 *************** *** 91,94 **** --- 91,100 ---- PEP 230; we intend to fix this in 2.2a2.) + - Two new flags METH_NOARGS and METH_O are available in method definition + tables to simplify implementation of methods with no arguments and a + single untyped argument. Calling such methods is more efficient than + calling corresponding METH_VARARGS methods. METH_OLDARGS is now + deprecated. + - The UTF-16 codec was modified to be more RFC compliant. It will now only remove BOM characters at the start of the string and then From loewis@users.sourceforge.net Thu Aug 16 14:15:01 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 16 Aug 2001 06:15:01 -0700 Subject: [Python-checkins] CVS: python/dist/src configure,1.238,1.239 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv23257 Modified Files: configure Log Message: Patch #427190: Implement and use METH_NOARGS and METH_O. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.238 retrieving revision 1.239 diff -C2 -d -r1.238 -r1.239 *** configure 2001/08/15 17:14:32 1.238 --- configure 2001/08/16 13:14:59 1.239 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.246 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.247 # Guess values for system-dependent variables and create Makefiles. From loewis@users.sourceforge.net Thu Aug 16 14:15:01 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 16 Aug 2001 06:15:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.139,1.140 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv23257/Doc/api Modified Files: api.tex Log Message: Patch #427190: Implement and use METH_NOARGS and METH_O. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.139 retrieving revision 1.140 diff -C2 -d -r1.139 -r1.140 *** api.tex 2001/08/14 15:32:16 1.139 --- api.tex 2001/08/16 13:14:59 1.140 *************** *** 5258,5261 **** --- 5258,5323 ---- \end{ctypedesc} + The \var{ml_meth} is a C function pointer. The functions may be of + different types, but they always return \ctype{PyObject*}. If the + function is not of the \ctype{PyCFunction}, the compiler will require + a cast in the method table. Even though \ctype{PyCFunction} defines + the first parameter as \ctype{PyObject*}, it is common that the method + implementation uses a the specific C type of the \var{self} object. + + The flags can have the following values. Only METH_VARARGS and + METH_KEYWORDS can be combined; the others can't. + + \begin{datadesc}{METH_VARARGS} + + This is the typical calling convention, where the methods have the + type \ctype{PyMethodDef}. The function expects two \ctype{PyObject*}. + The first one is the \var{self} object for methods; for module + functions, it has the value given to \cfunction{PyInitModule4} (or + \NULL{} if \cfunction{PyInitModule} was used). The second parameter + (often called \var{args}) is a tuple object representing all + arguments. This parameter is typically processed using + \cfunction{PyArg_ParseTuple}. + + \end{datadesc} + + \begin{datadesc}{METH_KEYWORDS} + + Methods with these flags must be of type + \ctype{PyCFunctionWithKeywords}. The function expects three + parameters: \var{self}, \var{args}, and a dictionary of all the keyword + arguments. The flag is typically combined with METH_VARARGS, and the + parameters are typically processed using + \cfunction{PyArg_ParseTupleAndKeywords}. + + \end{datadesc} + + \begin{datadesc}{METH_NOARGS} + + Methods without parameters don't need to check whether arguments are + given if they are listed with the \code{METH_NOARGS} flag. They need + to be of type \ctype{PyNoArgsFunction}, i.e. they expect a single + \var{self} parameter. + + \end{datadesc} + + \begin{datadesc}{METH_O} + + Methods with a single object argument can be listed with the + \code{METH_O} flag, instead of invoking \cfunction{PyArg_ParseTuple} + with a \code{``O''} argument. They have the type \ctype{PyCFunction}, + with the \var{self} parameter, and a \ctype{PyObject*} parameter + representing the single argument. + + \end{datadesc} + + \begin{datadesc}{METH_OLDARGS} + + This calling convention is deprecated. The method must be of type + \ctype{PyCFunction}. The second argument is \NULL{} if no arguments + are given, a single object if exactly one argument is given, and a + tuple of objects if more than one argument is given. + + \end{datadesc} + \begin{cfuncdesc}{PyObject*}{Py_FindMethod}{PyMethodDef[] table, PyObject *ob, char *name} From loewis@users.sourceforge.net Thu Aug 16 14:15:02 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 16 Aug 2001 06:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.225,2.226 ceval.c,2.266,2.267 sysmodule.c,2.90,2.91 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv23257/Python Modified Files: bltinmodule.c ceval.c sysmodule.c Log Message: Patch #427190: Implement and use METH_NOARGS and METH_O. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.225 retrieving revision 2.226 diff -C2 -d -r2.225 -r2.226 *** bltinmodule.c 2001/08/08 10:28:06 2.225 --- bltinmodule.c 2001/08/16 13:15:00 2.226 *************** *** 54,63 **** static PyObject * ! builtin_abs(PyObject *self, PyObject *args) { - PyObject *v; - - if (!PyArg_ParseTuple(args, "O:abs", &v)) - return NULL; return PyNumber_Absolute(v); } --- 54,59 ---- static PyObject * ! builtin_abs(PyObject *self, PyObject *v) { return PyNumber_Absolute(v); } *************** *** 133,142 **** static PyObject * ! builtin_callable(PyObject *self, PyObject *args) { - PyObject *v; - - if (!PyArg_ParseTuple(args, "O:callable", &v)) - return NULL; return PyInt_FromLong((long)PyCallable_Check(v)); } --- 129,134 ---- static PyObject * ! builtin_callable(PyObject *self, PyObject *v) { return PyInt_FromLong((long)PyCallable_Check(v)); } *************** *** 668,677 **** static PyObject * ! builtin_globals(PyObject *self, PyObject *args) { PyObject *d; - if (!PyArg_ParseTuple(args, ":globals")) - return NULL; d = PyEval_GetGlobals(); Py_INCREF(d); --- 660,667 ---- static PyObject * ! builtin_globals(PyObject *self) { PyObject *d; d = PyEval_GetGlobals(); Py_INCREF(d); *************** *** 723,732 **** static PyObject * ! builtin_id(PyObject *self, PyObject *args) { - PyObject *v; - - if (!PyArg_ParseTuple(args, "O:id", &v)) - return NULL; return PyLong_FromVoidPtr(v); } --- 713,718 ---- static PyObject * ! builtin_id(PyObject *self, PyObject *v) { return PyLong_FromVoidPtr(v); } *************** *** 950,960 **** static PyObject * ! builtin_hash(PyObject *self, PyObject *args) { - PyObject *v; long x; - if (!PyArg_ParseTuple(args, "O:hash", &v)) - return NULL; x = PyObject_Hash(v); if (x == -1) --- 936,943 ---- static PyObject * ! builtin_hash(PyObject *self, PyObject *v) { long x; x = PyObject_Hash(v); if (x == -1) *************** *** 971,982 **** static PyObject * ! builtin_hex(PyObject *self, PyObject *args) { - PyObject *v; PyNumberMethods *nb; - if (!PyArg_ParseTuple(args, "O:hex", &v)) - return NULL; - if ((nb = v->ob_type->tp_as_number) == NULL || nb->nb_hex == NULL) { --- 954,961 ---- static PyObject * ! builtin_hex(PyObject *self, PyObject *v) { PyNumberMethods *nb; if ((nb = v->ob_type->tp_as_number) == NULL || nb->nb_hex == NULL) { *************** *** 1076,1086 **** static PyObject * ! builtin_len(PyObject *self, PyObject *args) { - PyObject *v; long res; - if (!PyArg_ParseTuple(args, "O:len", &v)) - return NULL; res = PyObject_Size(v); if (res < 0 && PyErr_Occurred()) --- 1055,1062 ---- static PyObject * ! builtin_len(PyObject *self, PyObject *v) { long res; res = PyObject_Size(v); if (res < 0 && PyErr_Occurred()) *************** *** 1121,1130 **** static PyObject * ! builtin_locals(PyObject *self, PyObject *args) { PyObject *d; - if (!PyArg_ParseTuple(args, ":locals")) - return NULL; d = PyEval_GetLocals(); Py_INCREF(d); --- 1097,1104 ---- static PyObject * ! builtin_locals(PyObject *self) { PyObject *d; d = PyEval_GetLocals(); Py_INCREF(d); *************** *** 1218,1228 **** static PyObject * ! builtin_oct(PyObject *self, PyObject *args) { - PyObject *v; PyNumberMethods *nb; - if (!PyArg_ParseTuple(args, "O:oct", &v)) - return NULL; if (v == NULL || (nb = v->ob_type->tp_as_number) == NULL || nb->nb_oct == NULL) { --- 1192,1199 ---- static PyObject * ! builtin_oct(PyObject *self, PyObject *v) { PyNumberMethods *nb; if (v == NULL || (nb = v->ob_type->tp_as_number) == NULL || nb->nb_oct == NULL) { *************** *** 1271,1283 **** static PyObject * ! builtin_ord(PyObject *self, PyObject *args) { - PyObject *obj; long ord; int size; - if (!PyArg_ParseTuple(args, "O:ord", &obj)) - return NULL; - if (PyString_Check(obj)) { size = PyString_GET_SIZE(obj); --- 1242,1250 ---- static PyObject * ! builtin_ord(PyObject *self, PyObject* obj) { long ord; int size; if (PyString_Check(obj)) { size = PyString_GET_SIZE(obj); *************** *** 1612,1621 **** static PyObject * ! builtin_reload(PyObject *self, PyObject *args) { - PyObject *v; - - if (!PyArg_ParseTuple(args, "O:reload", &v)) - return NULL; return PyImport_ReloadModule(v); } --- 1579,1584 ---- static PyObject * ! builtin_reload(PyObject *self, PyObject *v) { return PyImport_ReloadModule(v); } *************** *** 1628,1637 **** static PyObject * ! builtin_repr(PyObject *self, PyObject *args) { - PyObject *v; - - if (!PyArg_ParseTuple(args, "O:repr", &v)) - return NULL; return PyObject_Repr(v); } --- 1591,1596 ---- static PyObject * ! builtin_repr(PyObject *self, PyObject *v) { return PyObject_Repr(v); } *************** *** 1842,1892 **** static PyMethodDef builtin_methods[] = { ! {"__import__", builtin___import__, 1, import_doc}, ! {"abs", builtin_abs, 1, abs_doc}, ! {"apply", builtin_apply, 1, apply_doc}, ! {"buffer", builtin_buffer, 1, buffer_doc}, ! {"callable", builtin_callable, 1, callable_doc}, ! {"chr", builtin_chr, 1, chr_doc}, ! {"cmp", builtin_cmp, 1, cmp_doc}, ! {"coerce", builtin_coerce, 1, coerce_doc}, ! {"compile", builtin_compile, 1, compile_doc}, ! {"delattr", builtin_delattr, 1, delattr_doc}, ! {"dir", builtin_dir, 1, dir_doc}, ! {"divmod", builtin_divmod, 1, divmod_doc}, ! {"eval", builtin_eval, 1, eval_doc}, ! {"execfile", builtin_execfile, 1, execfile_doc}, ! {"filter", builtin_filter, 1, filter_doc}, ! {"getattr", builtin_getattr, 1, getattr_doc}, ! {"globals", builtin_globals, 1, globals_doc}, ! {"hasattr", builtin_hasattr, 1, hasattr_doc}, ! {"hash", builtin_hash, 1, hash_doc}, ! {"hex", builtin_hex, 1, hex_doc}, ! {"id", builtin_id, 1, id_doc}, ! {"input", builtin_input, 1, input_doc}, ! {"intern", builtin_intern, 1, intern_doc}, ! {"isinstance", builtin_isinstance, 1, isinstance_doc}, ! {"issubclass", builtin_issubclass, 1, issubclass_doc}, ! {"iter", builtin_iter, 1, iter_doc}, ! {"len", builtin_len, 1, len_doc}, ! {"locals", builtin_locals, 1, locals_doc}, ! {"map", builtin_map, 1, map_doc}, ! {"max", builtin_max, 1, max_doc}, ! {"min", builtin_min, 1, min_doc}, ! {"oct", builtin_oct, 1, oct_doc}, ! {"open", builtin_open, 1, open_doc}, ! {"ord", builtin_ord, 1, ord_doc}, ! {"pow", builtin_pow, 1, pow_doc}, ! {"range", builtin_range, 1, range_doc}, ! {"raw_input", builtin_raw_input, 1, raw_input_doc}, ! {"reduce", builtin_reduce, 1, reduce_doc}, ! {"reload", builtin_reload, 1, reload_doc}, ! {"repr", builtin_repr, 1, repr_doc}, ! {"round", builtin_round, 1, round_doc}, ! {"setattr", builtin_setattr, 1, setattr_doc}, ! {"slice", builtin_slice, 1, slice_doc}, ! {"unichr", builtin_unichr, 1, unichr_doc}, ! {"vars", builtin_vars, 1, vars_doc}, ! {"xrange", builtin_xrange, 1, xrange_doc}, ! {"zip", builtin_zip, 1, zip_doc}, {NULL, NULL}, }; --- 1801,1851 ---- static PyMethodDef builtin_methods[] = { ! {"__import__", builtin___import__, METH_VARARGS, import_doc}, ! {"abs", builtin_abs, METH_O, abs_doc}, ! {"apply", builtin_apply, METH_VARARGS, apply_doc}, ! {"buffer", builtin_buffer, METH_VARARGS, buffer_doc}, ! {"callable", builtin_callable, METH_O, callable_doc}, ! {"chr", builtin_chr, METH_VARARGS, chr_doc}, ! {"cmp", builtin_cmp, METH_VARARGS, cmp_doc}, ! {"coerce", builtin_coerce, METH_VARARGS, coerce_doc}, ! {"compile", builtin_compile, METH_VARARGS, compile_doc}, ! {"delattr", builtin_delattr, METH_VARARGS, delattr_doc}, ! {"dir", builtin_dir, METH_VARARGS, dir_doc}, ! {"divmod", builtin_divmod, METH_VARARGS, divmod_doc}, ! {"eval", builtin_eval, METH_VARARGS, eval_doc}, ! {"execfile", builtin_execfile, METH_VARARGS, execfile_doc}, ! {"filter", builtin_filter, METH_VARARGS, filter_doc}, ! {"getattr", builtin_getattr, METH_VARARGS, getattr_doc}, ! {"globals", (PyCFunction)builtin_globals, METH_NOARGS, globals_doc}, ! {"hasattr", builtin_hasattr, METH_VARARGS, hasattr_doc}, ! {"hash", builtin_hash, METH_O, hash_doc}, ! {"hex", builtin_hex, METH_O, hex_doc}, ! {"id", builtin_id, METH_O, id_doc}, ! {"input", builtin_input, METH_VARARGS, input_doc}, ! {"intern", builtin_intern, METH_VARARGS, intern_doc}, ! {"isinstance", builtin_isinstance, METH_VARARGS, isinstance_doc}, ! {"issubclass", builtin_issubclass, METH_VARARGS, issubclass_doc}, ! {"iter", builtin_iter, METH_VARARGS, iter_doc}, ! {"len", builtin_len, METH_O, len_doc}, ! {"locals", (PyCFunction)builtin_locals, METH_NOARGS, locals_doc}, ! {"map", builtin_map, METH_VARARGS, map_doc}, ! {"max", builtin_max, METH_VARARGS, max_doc}, ! {"min", builtin_min, METH_VARARGS, min_doc}, ! {"oct", builtin_oct, METH_O, oct_doc}, ! {"open", builtin_open, METH_VARARGS, open_doc}, ! {"ord", builtin_ord, METH_O, ord_doc}, ! {"pow", builtin_pow, METH_VARARGS, pow_doc}, ! {"range", builtin_range, METH_VARARGS, range_doc}, ! {"raw_input", builtin_raw_input, METH_VARARGS, raw_input_doc}, ! {"reduce", builtin_reduce, METH_VARARGS, reduce_doc}, ! {"reload", builtin_reload, METH_O, reload_doc}, ! {"repr", builtin_repr, METH_O, repr_doc}, ! {"round", builtin_round, METH_VARARGS, round_doc}, ! {"setattr", builtin_setattr, METH_VARARGS, setattr_doc}, ! {"slice", builtin_slice, METH_VARARGS, slice_doc}, ! {"unichr", builtin_unichr, METH_VARARGS, unichr_doc}, ! {"vars", builtin_vars, METH_VARARGS, vars_doc}, ! {"xrange", builtin_xrange, METH_VARARGS, xrange_doc}, ! {"zip", builtin_zip, METH_VARARGS, zip_doc}, {NULL, NULL}, }; Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.266 retrieving revision 2.267 diff -C2 -d -r2.266 -r2.267 *** ceval.c 2001/08/12 21:52:24 2.266 --- ceval.c 2001/08/16 13:15:00 2.267 *************** *** 167,177 **** static PyObject * ! gen_next(genobject *gen, PyObject *args) { PyObject *result; - if (!PyArg_ParseTuple(args, ":next")) - return NULL; - result = gen_iternext(gen); --- 167,174 ---- static PyObject * ! gen_next(genobject *gen) { PyObject *result; result = gen_iternext(gen); *************** *** 192,196 **** static struct PyMethodDef gen_methods[] = { ! {"next", (PyCFunction)gen_next, METH_VARARGS, "next() -- get the next value, or raise StopIteration"}, {NULL, NULL} /* Sentinel */ --- 189,193 ---- static struct PyMethodDef gen_methods[] = { ! {"next", (PyCFunction)gen_next, METH_NOARGS, "next() -- get the next value, or raise StopIteration"}, {NULL, NULL} /* Sentinel */ *************** *** 1939,1943 **** if (PyCFunction_Check(func)) { int flags = PyCFunction_GET_FLAGS(func); ! if (flags > 1 || nk != 0) x = do_call(func, &stack_pointer, na, nk); --- 1936,1940 ---- if (PyCFunction_Check(func)) { int flags = PyCFunction_GET_FLAGS(func); ! if (nk != 0 || (flags & METH_KEYWORDS)) x = do_call(func, &stack_pointer, na, nk); *************** *** 1947,1953 **** x = PyCFunction_Call(func, callargs, NULL); Py_XDECREF(callargs); ! } else if (!(flags & METH_KEYWORDS)) ! x = fast_cfunction(func, ! &stack_pointer, na); } else { if (PyMethod_Check(func) --- 1944,1950 ---- x = PyCFunction_Call(func, callargs, NULL); Py_XDECREF(callargs); ! } else ! x = fast_cfunction(func, ! &stack_pointer, na); } else { if (PyMethod_Check(func) *************** *** 3047,3064 **** PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); ! if (na == 0) ! return (*meth)(self, NULL); ! else if (na == 1) { ! PyObject *arg = EXT_POP(*pp_stack); ! PyObject *result = (*meth)(self, arg); ! Py_DECREF(arg); ! return result; ! } else { ! PyObject *args = load_args(pp_stack, na); ! PyObject *result = (*meth)(self, args); ! Py_DECREF(args); ! return result; ! } } --- 3044,3091 ---- PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); ! switch (flags) { ! case METH_OLDARGS: ! if (na == 0) ! return (*meth)(self, NULL); ! else if (na == 1) { ! PyObject *arg = EXT_POP(*pp_stack); ! PyObject *result = (*meth)(self, arg); ! Py_DECREF(arg); ! return result; ! } else { ! PyObject *args = load_args(pp_stack, na); ! PyObject *result = (*meth)(self, args); ! Py_DECREF(args); ! return result; ! } ! break; ! case METH_NOARGS: ! if (na == 0) ! return (*meth)(self, NULL); ! PyErr_Format(PyExc_TypeError, ! "%.200s() takes no arguments (%d given)", ! ((PyCFunctionObject*)func)->m_ml->ml_name, na); ! return NULL; ! break; ! case METH_O: ! if (na == 1) { ! PyObject *arg = EXT_POP(*pp_stack); ! PyObject *result = (*meth)(self, arg); ! Py_DECREF(arg); ! return result; ! } ! PyErr_Format(PyExc_TypeError, ! "%.200s() takes exactly one argument (%d given)", ! ((PyCFunctionObject*)func)->m_ml->ml_name, na); ! return NULL; ! break; ! default: ! fprintf(stderr, "%.200s() flags = %d\n", ! ((PyCFunctionObject*)func)->m_ml->ml_name, flags); ! PyErr_BadInternalCall(); ! return NULL; ! } } Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.90 retrieving revision 2.91 diff -C2 -d -r2.90 -r2.91 *** sysmodule.c 2001/07/23 13:32:43 2.90 --- sysmodule.c 2001/08/16 13:15:00 2.91 *************** *** 69,75 **** static PyObject * ! sys_displayhook(PyObject *self, PyObject *args) { ! PyObject *o, *outf; PyInterpreterState *interp = PyThreadState_Get()->interp; PyObject *modules = interp->modules; --- 69,75 ---- static PyObject * ! sys_displayhook(PyObject *self, PyObject *o) { ! PyObject *outf; PyInterpreterState *interp = PyThreadState_Get()->interp; PyObject *modules = interp->modules; *************** *** 81,88 **** } - /* parse arguments */ - if (!PyArg_ParseTuple(args, "O:displayhook", &o)) - return NULL; - /* Print value except if None */ /* After printing, also assign to '_' */ --- 81,84 ---- *************** *** 134,142 **** static PyObject * ! sys_exc_info(PyObject *self, PyObject *args) { PyThreadState *tstate; - if (!PyArg_ParseTuple(args, ":exc_info")) - return NULL; tstate = PyThreadState_Get(); return Py_BuildValue( --- 130,136 ---- static PyObject * ! sys_exc_info(PyObject *self) { PyThreadState *tstate; tstate = PyThreadState_Get(); return Py_BuildValue( *************** *** 172,179 **** static PyObject * ! sys_getdefaultencoding(PyObject *self, PyObject *args) { - if (!PyArg_ParseTuple(args, ":getdefaultencoding")) - return NULL; return PyString_FromString(PyUnicode_GetDefaultEncoding()); } --- 166,171 ---- static PyObject * ! sys_getdefaultencoding(PyObject *self) { return PyString_FromString(PyUnicode_GetDefaultEncoding()); } *************** *** 386,393 **** static PyObject * ! sys_getrecursionlimit(PyObject *self, PyObject *args) { - if (!PyArg_ParseTuple(args, ":getrecursionlimit")) - return NULL; return PyInt_FromLong(Py_GetRecursionLimit()); } --- 378,383 ---- static PyObject * ! sys_getrecursionlimit(PyObject *self) { return PyInt_FromLong(Py_GetRecursionLimit()); } *************** *** 428,433 **** { PyThreadState *tstate = PyThreadState_Get(); - if (!PyArg_ParseTuple(args, ":getdlopenflags")) - return NULL; if (!tstate) return NULL; --- 418,421 ---- *************** *** 469,477 **** #ifdef Py_TRACE_REFS static PyObject * ! sys_gettotalrefcount(PyObject *self, PyObject *args) { extern long _Py_RefTotal; - if (!PyArg_ParseTuple(args, ":gettotalrefcount")) - return NULL; return PyInt_FromLong(_Py_RefTotal); } --- 457,463 ---- #ifdef Py_TRACE_REFS static PyObject * ! sys_gettotalrefcount(PyObject *self) { extern long _Py_RefTotal; return PyInt_FromLong(_Py_RefTotal); } *************** *** 487,496 **** #ifdef COUNT_ALLOCS static PyObject * ! sys_getcounts(PyObject *self, PyObject *args) { extern PyObject *get_counts(void); - if (!PyArg_ParseTuple(args, ":getcounts")) - return NULL; return get_counts(); } --- 473,480 ---- #ifdef COUNT_ALLOCS static PyObject * ! sys_getcounts(PyObject *self) { extern PyObject *get_counts(void); return get_counts(); } *************** *** 543,585 **** static PyMethodDef sys_methods[] = { /* Might as well keep this in alphabetic order */ ! {"displayhook", sys_displayhook, 1, displayhook_doc}, ! {"exc_info", sys_exc_info, 1, exc_info_doc}, ! {"excepthook", sys_excepthook, 1, excepthook_doc}, ! {"exit", sys_exit, 0, exit_doc}, ! {"getdefaultencoding", sys_getdefaultencoding, 1, getdefaultencoding_doc}, #ifdef HAVE_DLOPEN ! {"getdlopenflags", sys_getdlopenflags, 1, ! getdlopenflags_doc}, #endif #ifdef COUNT_ALLOCS ! {"getcounts", sys_getcounts, 1}, #endif #ifdef DYNAMIC_EXECUTION_PROFILE ! {"getdxp", _Py_GetDXProfile, 1}, #endif #ifdef Py_TRACE_REFS ! {"getobjects", _Py_GetObjects, 1}, ! {"gettotalrefcount", sys_gettotalrefcount, 1}, #endif ! {"getrefcount", sys_getrefcount, 1, getrefcount_doc}, ! {"getrecursionlimit", sys_getrecursionlimit, 1, getrecursionlimit_doc}, ! {"_getframe", sys_getframe, 1, getframe_doc}, #ifdef USE_MALLOPT ! {"mdebug", sys_mdebug, 1}, #endif ! {"setdefaultencoding", sys_setdefaultencoding, 1, setdefaultencoding_doc}, ! {"setcheckinterval", sys_setcheckinterval, 1, setcheckinterval_doc}, #ifdef HAVE_DLOPEN ! {"setdlopenflags", sys_setdlopenflags, 1, ! setdlopenflags_doc}, #endif ! {"setprofile", sys_setprofile, 0, setprofile_doc}, ! {"setrecursionlimit", sys_setrecursionlimit, 1, setrecursionlimit_doc}, ! {"settrace", sys_settrace, 0, settrace_doc}, {NULL, NULL} /* sentinel */ }; --- 527,569 ---- static PyMethodDef sys_methods[] = { /* Might as well keep this in alphabetic order */ ! {"displayhook", sys_displayhook, METH_O, displayhook_doc}, ! {"exc_info", (PyCFunction)sys_exc_info, METH_NOARGS, exc_info_doc}, ! {"excepthook", sys_excepthook, METH_VARARGS, excepthook_doc}, ! {"exit", sys_exit, METH_OLDARGS, exit_doc}, ! {"getdefaultencoding", (PyCFunction)sys_getdefaultencoding, METH_NOARGS, getdefaultencoding_doc}, #ifdef HAVE_DLOPEN ! {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_NOARGS, ! getdlopenflags_doc}, #endif #ifdef COUNT_ALLOCS ! {"getcounts", (PyCFunction)sys_getcounts, METH_NOARGS}, #endif #ifdef DYNAMIC_EXECUTION_PROFILE ! {"getdxp", _Py_GetDXProfile, METH_VARARGS}, #endif #ifdef Py_TRACE_REFS ! {"getobjects", _Py_GetObjects, METH_VARARGS}, ! {"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS}, #endif ! {"getrefcount", sys_getrefcount, METH_VARARGS, getrefcount_doc}, ! {"getrecursionlimit", (PyCFunction)sys_getrecursionlimit, METH_NOARGS, getrecursionlimit_doc}, ! {"_getframe", sys_getframe, METH_VARARGS, getframe_doc}, #ifdef USE_MALLOPT ! {"mdebug", sys_mdebug, METH_VARARGS}, #endif ! {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS, setdefaultencoding_doc}, ! {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, setcheckinterval_doc}, #ifdef HAVE_DLOPEN ! {"setdlopenflags", sys_setdlopenflags, METH_VARARGS, ! setdlopenflags_doc}, #endif ! {"setprofile", sys_setprofile, METH_OLDARGS, setprofile_doc}, ! {"setrecursionlimit", sys_setrecursionlimit, METH_VARARGS, setrecursionlimit_doc}, ! {"settrace", sys_settrace, METH_OLDARGS, settrace_doc}, {NULL, NULL} /* sentinel */ }; From loewis@users.sourceforge.net Thu Aug 16 14:15:02 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 16 Aug 2001 06:15:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.37,2.38 descrobject.c,2.2,2.3 dictobject.c,2.108,2.109 fileobject.c,2.117,2.118 iterobject.c,1.6,1.7 listobject.c,2.98,2.99 methodobject.c,2.36,2.37 rangeobject.c,2.27,2.28 stringobject.c,2.122,2.123 typeobject.c,2.35,2.36 unicodeobject.c,2.107,2.108 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv23257/Objects Modified Files: complexobject.c descrobject.c dictobject.c fileobject.c iterobject.c listobject.c methodobject.c rangeobject.c stringobject.c typeobject.c unicodeobject.c Log Message: Patch #427190: Implement and use METH_NOARGS and METH_O. Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -d -r2.37 -r2.38 *** complexobject.c 2001/08/08 05:00:18 2.37 --- complexobject.c 2001/08/16 13:15:00 2.38 *************** *** 581,589 **** static PyObject * ! complex_conjugate(PyObject *self, PyObject *args) { Py_complex c; - if (!PyArg_ParseTuple(args, ":conjugate")) - return NULL; c = ((PyComplexObject *)self)->cval; c.imag = -c.imag; --- 581,587 ---- static PyObject * ! complex_conjugate(PyObject *self) { Py_complex c; c = ((PyComplexObject *)self)->cval; c.imag = -c.imag; *************** *** 592,596 **** static PyMethodDef complex_methods[] = { ! {"conjugate", complex_conjugate, 1}, {NULL, NULL} /* sentinel */ }; --- 590,594 ---- static PyMethodDef complex_methods[] = { ! {"conjugate", (PyCFunction)complex_conjugate, METH_NOARGS}, {NULL, NULL} /* sentinel */ }; Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -d -r2.2 -r2.3 *** descrobject.c 2001/08/16 08:27:33 2.2 --- descrobject.c 2001/08/16 13:15:00 2.3 *************** *** 602,611 **** static PyObject * ! proxy_has_key(proxyobject *pp, PyObject *args) { - PyObject *key; - - if (!PyArg_ParseTuple(args, "O:has_key", &key)) - return NULL; return PyInt_FromLong(PySequence_Contains(pp->dict, key)); } --- 602,607 ---- static PyObject * ! proxy_has_key(proxyobject *pp, PyObject *key) { return PyInt_FromLong(PySequence_Contains(pp->dict, key)); } *************** *** 622,663 **** static PyObject * ! proxy_keys(proxyobject *pp, PyObject *args) { - if (!PyArg_ParseTuple(args, ":keys")) - return NULL; return PyMapping_Keys(pp->dict); } static PyObject * ! proxy_values(proxyobject *pp, PyObject *args) { - if (!PyArg_ParseTuple(args, ":values")) - return NULL; return PyMapping_Values(pp->dict); } static PyObject * ! proxy_items(proxyobject *pp, PyObject *args) { - if (!PyArg_ParseTuple(args, ":items")) - return NULL; return PyMapping_Items(pp->dict); } static PyObject * ! proxy_copy(proxyobject *pp, PyObject *args) { - if (!PyArg_ParseTuple(args, ":copy")) - return NULL; return PyObject_CallMethod(pp->dict, "copy", NULL); } static PyMethodDef proxy_methods[] = { ! {"has_key", (PyCFunction)proxy_has_key, METH_VARARGS, "XXX"}, {"get", (PyCFunction)proxy_get, METH_VARARGS, "XXX"}, ! {"keys", (PyCFunction)proxy_keys, METH_VARARGS, "XXX"}, ! {"values", (PyCFunction)proxy_values, METH_VARARGS, "XXX"}, ! {"items", (PyCFunction)proxy_items, METH_VARARGS, "XXX"}, ! {"copy", (PyCFunction)proxy_copy, METH_VARARGS, "XXX"}, {0} }; --- 618,651 ---- static PyObject * ! proxy_keys(proxyobject *pp) { return PyMapping_Keys(pp->dict); } static PyObject * ! proxy_values(proxyobject *pp) { return PyMapping_Values(pp->dict); } static PyObject * ! proxy_items(proxyobject *pp) { return PyMapping_Items(pp->dict); } static PyObject * ! proxy_copy(proxyobject *pp) { return PyObject_CallMethod(pp->dict, "copy", NULL); } static PyMethodDef proxy_methods[] = { ! {"has_key", (PyCFunction)proxy_has_key, METH_O, "XXX"}, {"get", (PyCFunction)proxy_get, METH_VARARGS, "XXX"}, ! {"keys", (PyCFunction)proxy_keys, METH_NOARGS, "XXX"}, ! {"values", (PyCFunction)proxy_values, METH_NOARGS, "XXX"}, ! {"items", (PyCFunction)proxy_items, METH_NOARGS, "XXX"}, ! {"copy", (PyCFunction)proxy_copy, METH_NOARGS, "XXX"}, {0} }; Index: dictobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v retrieving revision 2.108 retrieving revision 2.109 diff -C2 -d -r2.108 -r2.109 *** dictobject.c 2001/08/10 20:28:28 2.108 --- dictobject.c 2001/08/16 13:15:00 2.109 *************** *** 876,886 **** static PyObject * ! dict_keys(register dictobject *mp, PyObject *args) { register PyObject *v; register int i, j, n; - if (!PyArg_NoArgs(args)) - return NULL; again: n = mp->ma_used; --- 876,884 ---- static PyObject * ! dict_keys(register dictobject *mp) { register PyObject *v; register int i, j, n; again: n = mp->ma_used; *************** *** 907,917 **** static PyObject * ! dict_values(register dictobject *mp, PyObject *args) { register PyObject *v; register int i, j, n; - if (!PyArg_NoArgs(args)) - return NULL; again: n = mp->ma_used; --- 905,913 ---- static PyObject * ! dict_values(register dictobject *mp) { register PyObject *v; register int i, j, n; again: n = mp->ma_used; *************** *** 938,942 **** static PyObject * ! dict_items(register dictobject *mp, PyObject *args) { register PyObject *v; --- 934,938 ---- static PyObject * ! dict_items(register dictobject *mp) { register PyObject *v; *************** *** 944,949 **** PyObject *item, *key, *value; - if (!PyArg_NoArgs(args)) - return NULL; /* Preallocate the list of tuples, to avoid allocations during * the loop over the items, which could trigger GC, which --- 940,943 ---- *************** *** 988,997 **** static PyObject * ! dict_update(PyObject *mp, PyObject *args) { - PyObject *other; - - if (!PyArg_ParseTuple(args, "O:update", &other)) - return NULL; if (PyDict_Update(mp, other) < 0) return NULL; --- 982,987 ---- static PyObject * ! dict_update(PyObject *mp, PyObject *other) { if (PyDict_Update(mp, other) < 0) return NULL; *************** *** 1100,1107 **** static PyObject * ! dict_copy(register dictobject *mp, PyObject *args) { - if (!PyArg_Parse(args, "")) - return NULL; return PyDict_Copy((PyObject*)mp); } --- 1090,1095 ---- static PyObject * ! dict_copy(register dictobject *mp) { return PyDict_Copy((PyObject*)mp); } *************** *** 1156,1160 **** return NULL; } ! return dict_keys((dictobject *)mp, (PyObject *)NULL); } --- 1144,1148 ---- return NULL; } ! return dict_keys((dictobject *)mp); } *************** *** 1166,1170 **** return NULL; } ! return dict_values((dictobject *)mp, (PyObject *)NULL); } --- 1154,1158 ---- return NULL; } ! return dict_values((dictobject *)mp); } *************** *** 1176,1180 **** return NULL; } ! return dict_items((dictobject *)mp, (PyObject *)NULL); } --- 1164,1168 ---- return NULL; } ! return dict_items((dictobject *)mp); } *************** *** 1367,1377 **** static PyObject * ! dict_has_key(register dictobject *mp, PyObject *args) { - PyObject *key; long hash; register long ok; - if (!PyArg_ParseTuple(args, "O:has_key", &key)) - return NULL; #ifdef CACHE_HASH if (!PyString_Check(key) || --- 1355,1362 ---- static PyObject * ! dict_has_key(register dictobject *mp, PyObject *key) { long hash; register long ok; #ifdef CACHE_HASH if (!PyString_Check(key) || *************** *** 1448,1455 **** static PyObject * ! dict_clear(register dictobject *mp, PyObject *args) { - if (!PyArg_NoArgs(args)) - return NULL; PyDict_Clear((PyObject *)mp); Py_INCREF(Py_None); --- 1433,1438 ---- static PyObject * ! dict_clear(register dictobject *mp) { PyDict_Clear((PyObject *)mp); Py_INCREF(Py_None); *************** *** 1458,1462 **** static PyObject * ! dict_popitem(dictobject *mp, PyObject *args) { int i = 0; --- 1441,1445 ---- static PyObject * ! dict_popitem(dictobject *mp) { int i = 0; *************** *** 1464,1469 **** PyObject *res; - if (!PyArg_NoArgs(args)) - return NULL; /* Allocate the result tuple before checking the size. Believe it * or not, this allocation could trigger a garbage collection which --- 1447,1450 ---- *************** *** 1574,1597 **** static PyObject * ! dict_iterkeys(dictobject *dict, PyObject *args) { - if (!PyArg_ParseTuple(args, "")) - return NULL; return dictiter_new(dict, select_key); } static PyObject * ! dict_itervalues(dictobject *dict, PyObject *args) { - if (!PyArg_ParseTuple(args, "")) - return NULL; return dictiter_new(dict, select_value); } static PyObject * ! dict_iteritems(dictobject *dict, PyObject *args) { - if (!PyArg_ParseTuple(args, "")) - return NULL; return dictiter_new(dict, select_item); } --- 1555,1572 ---- static PyObject * ! dict_iterkeys(dictobject *dict) { return dictiter_new(dict, select_key); } static PyObject * ! dict_itervalues(dictobject *dict) { return dictiter_new(dict, select_value); } static PyObject * ! dict_iteritems(dictobject *dict) { return dictiter_new(dict, select_item); } *************** *** 1639,1643 **** static PyMethodDef mapp_methods[] = { ! {"has_key", (PyCFunction)dict_has_key, METH_VARARGS, has_key__doc__}, {"get", (PyCFunction)dict_get, METH_VARARGS, --- 1614,1618 ---- static PyMethodDef mapp_methods[] = { ! {"has_key", (PyCFunction)dict_has_key, METH_O, has_key__doc__}, {"get", (PyCFunction)dict_get, METH_VARARGS, *************** *** 1645,1667 **** {"setdefault", (PyCFunction)dict_setdefault, METH_VARARGS, setdefault_doc__}, ! {"popitem", (PyCFunction)dict_popitem, METH_OLDARGS, popitem__doc__}, ! {"keys", (PyCFunction)dict_keys, METH_OLDARGS, keys__doc__}, ! {"items", (PyCFunction)dict_items, METH_OLDARGS, items__doc__}, ! {"values", (PyCFunction)dict_values, METH_OLDARGS, values__doc__}, ! {"update", (PyCFunction)dict_update, METH_VARARGS, update__doc__}, ! {"clear", (PyCFunction)dict_clear, METH_OLDARGS, clear__doc__}, ! {"copy", (PyCFunction)dict_copy, METH_OLDARGS, copy__doc__}, ! {"iterkeys", (PyCFunction)dict_iterkeys, METH_VARARGS, iterkeys__doc__}, ! {"itervalues", (PyCFunction)dict_itervalues, METH_VARARGS, itervalues__doc__}, ! {"iteritems", (PyCFunction)dict_iteritems, METH_VARARGS, iteritems__doc__}, {NULL, NULL} /* sentinel */ --- 1620,1642 ---- {"setdefault", (PyCFunction)dict_setdefault, METH_VARARGS, setdefault_doc__}, ! {"popitem", (PyCFunction)dict_popitem, METH_NOARGS, popitem__doc__}, ! {"keys", (PyCFunction)dict_keys, METH_NOARGS, keys__doc__}, ! {"items", (PyCFunction)dict_items, METH_NOARGS, items__doc__}, ! {"values", (PyCFunction)dict_values, METH_NOARGS, values__doc__}, ! {"update", (PyCFunction)dict_update, METH_O, update__doc__}, ! {"clear", (PyCFunction)dict_clear, METH_NOARGS, clear__doc__}, ! {"copy", (PyCFunction)dict_copy, METH_NOARGS, copy__doc__}, ! {"iterkeys", (PyCFunction)dict_iterkeys, METH_NOARGS, iterkeys__doc__}, ! {"itervalues", (PyCFunction)dict_itervalues, METH_NOARGS, itervalues__doc__}, ! {"iteritems", (PyCFunction)dict_iteritems, METH_NOARGS, iteritems__doc__}, {NULL, NULL} /* sentinel */ Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.117 retrieving revision 2.118 diff -C2 -d -r2.117 -r2.118 *** fileobject.c 2001/08/09 18:14:59 2.117 --- fileobject.c 2001/08/16 13:15:00 2.118 *************** *** 190,198 **** static PyObject * ! file_close(PyFileObject *f, PyObject *args) { int sts = 0; - if (!PyArg_NoArgs(args)) - return NULL; if (f->f_fp != NULL) { if (f->f_close != NULL) { --- 190,196 ---- static PyObject * ! file_close(PyFileObject *f) { int sts = 0; if (f->f_fp != NULL) { if (f->f_close != NULL) { *************** *** 387,391 **** static PyObject * ! file_tell(PyFileObject *f, PyObject *args) { Py_off_t pos; --- 385,389 ---- static PyObject * ! file_tell(PyFileObject *f) { Py_off_t pos; *************** *** 393,398 **** if (f->f_fp == NULL) return err_closed(); - if (!PyArg_NoArgs(args)) - return NULL; Py_BEGIN_ALLOW_THREADS errno = 0; --- 391,394 ---- *************** *** 412,426 **** static PyObject * ! file_fileno(PyFileObject *f, PyObject *args) { if (f->f_fp == NULL) return err_closed(); - if (!PyArg_NoArgs(args)) - return NULL; return PyInt_FromLong((long) fileno(f->f_fp)); } static PyObject * ! file_flush(PyFileObject *f, PyObject *args) { int res; --- 408,420 ---- static PyObject * ! file_fileno(PyFileObject *f) { if (f->f_fp == NULL) return err_closed(); return PyInt_FromLong((long) fileno(f->f_fp)); } static PyObject * ! file_flush(PyFileObject *f) { int res; *************** *** 428,433 **** if (f->f_fp == NULL) return err_closed(); - if (!PyArg_NoArgs(args)) - return NULL; Py_BEGIN_ALLOW_THREADS errno = 0; --- 422,425 ---- *************** *** 444,454 **** static PyObject * ! file_isatty(PyFileObject *f, PyObject *args) { long res; if (f->f_fp == NULL) return err_closed(); - if (!PyArg_NoArgs(args)) - return NULL; Py_BEGIN_ALLOW_THREADS res = isatty((int)fileno(f->f_fp)); --- 436,444 ---- static PyObject * ! file_isatty(PyFileObject *f) { long res; if (f->f_fp == NULL) return err_closed(); Py_BEGIN_ALLOW_THREADS res = isatty((int)fileno(f->f_fp)); *************** *** 969,979 **** static PyObject * ! file_xreadlines(PyFileObject *f, PyObject *args) { static PyObject* xreadlines_function = NULL; - if (!PyArg_ParseTuple(args, ":xreadlines")) - return NULL; - if (!xreadlines_function) { PyObject *xreadlines_module = --- 959,966 ---- static PyObject * ! file_xreadlines(PyFileObject *f) { static PyObject* xreadlines_function = NULL; if (!xreadlines_function) { PyObject *xreadlines_module = *************** *** 1249,1268 **** static PyMethodDef file_methods[] = { ! {"readline", (PyCFunction)file_readline, 1}, ! {"read", (PyCFunction)file_read, 1}, ! {"write", (PyCFunction)file_write, 0}, ! {"fileno", (PyCFunction)file_fileno, 0}, ! {"seek", (PyCFunction)file_seek, 1}, #ifdef HAVE_FTRUNCATE ! {"truncate", (PyCFunction)file_truncate, 1}, #endif ! {"tell", (PyCFunction)file_tell, 0}, ! {"readinto", (PyCFunction)file_readinto, 0}, ! {"readlines", (PyCFunction)file_readlines, 1}, ! {"xreadlines", (PyCFunction)file_xreadlines, 1}, ! {"writelines", (PyCFunction)file_writelines, 0}, ! {"flush", (PyCFunction)file_flush, 0}, ! {"close", (PyCFunction)file_close, 0}, ! {"isatty", (PyCFunction)file_isatty, 0}, {NULL, NULL} /* sentinel */ }; --- 1236,1255 ---- static PyMethodDef file_methods[] = { ! {"readline", (PyCFunction)file_readline, METH_VARARGS}, ! {"read", (PyCFunction)file_read, METH_VARARGS}, ! {"write", (PyCFunction)file_write, METH_OLDARGS}, ! {"fileno", (PyCFunction)file_fileno, METH_NOARGS}, ! {"seek", (PyCFunction)file_seek, METH_VARARGS}, #ifdef HAVE_FTRUNCATE ! {"truncate", (PyCFunction)file_truncate, METH_VARARGS}, #endif ! {"tell", (PyCFunction)file_tell, METH_NOARGS}, ! {"readinto", (PyCFunction)file_readinto, METH_OLDARGS}, ! {"readlines", (PyCFunction)file_readlines, METH_VARARGS}, ! {"xreadlines", (PyCFunction)file_xreadlines, METH_NOARGS}, ! {"writelines", (PyCFunction)file_writelines, METH_O}, ! {"flush", (PyCFunction)file_flush, METH_NOARGS}, ! {"close", (PyCFunction)file_close, METH_NOARGS}, ! {"isatty", (PyCFunction)file_isatty, METH_NOARGS}, {NULL, NULL} /* sentinel */ }; Index: iterobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/iterobject.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** iterobject.c 2001/08/02 04:15:00 1.6 --- iterobject.c 2001/08/16 13:15:00 1.7 *************** *** 38,42 **** static PyObject * ! iter_next(seqiterobject *it, PyObject *args) { PyObject *seq = it->it_seq; --- 38,42 ---- static PyObject * ! iter_next(seqiterobject *it) { PyObject *seq = it->it_seq; *************** *** 92,96 **** static PyMethodDef iter_methods[] = { ! {"next", (PyCFunction)iter_next, METH_VARARGS, "it.next() -- get the next value, or raise StopIteration"}, {NULL, NULL} /* sentinel */ --- 92,96 ---- static PyMethodDef iter_methods[] = { ! {"next", (PyCFunction)iter_next, METH_NOARGS, "it.next() -- get the next value, or raise StopIteration"}, {NULL, NULL} /* sentinel */ Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.98 retrieving revision 2.99 diff -C2 -d -r2.98 -r2.99 *** listobject.c 2001/08/02 04:15:00 2.98 --- listobject.c 2001/08/16 13:15:00 2.99 *************** *** 624,632 **** static PyObject * ! listappend(PyListObject *self, PyObject *args) { - PyObject *v; - if (!PyArg_ParseTuple(args, "O:append", &v)) - return NULL; return ins(self, (int) self->ob_size, v); } --- 624,629 ---- static PyObject * ! listappend(PyListObject *self, PyObject *v) { return ins(self, (int) self->ob_size, v); } *************** *** 703,714 **** static PyObject * ! listextend(PyListObject *self, PyObject *args) { - PyObject *b; - - if (!PyArg_ParseTuple(args, "O:extend", &b)) - return NULL; - b = PySequence_Fast(b, "list.extend() argument must be iterable"); if (!b) --- 700,706 ---- static PyObject * ! listextend(PyListObject *self, PyObject *b) { b = PySequence_Fast(b, "list.extend() argument must be iterable"); if (!b) *************** *** 1345,1352 **** static PyObject * ! listreverse(PyListObject *self, PyObject *args) { - if (!PyArg_ParseTuple(args, ":reverse")) - return NULL; _listreverse(self); Py_INCREF(Py_None); --- 1337,1342 ---- static PyObject * ! listreverse(PyListObject *self) { _listreverse(self); Py_INCREF(Py_None); *************** *** 1391,1401 **** static PyObject * ! listindex(PyListObject *self, PyObject *args) { int i; - PyObject *v; - if (!PyArg_ParseTuple(args, "O:index", &v)) - return NULL; for (i = 0; i < self->ob_size; i++) { int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); --- 1381,1388 ---- static PyObject * ! listindex(PyListObject *self, PyObject *v) { int i; for (i = 0; i < self->ob_size; i++) { int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); *************** *** 1410,1421 **** static PyObject * ! listcount(PyListObject *self, PyObject *args) { int count = 0; int i; - PyObject *v; - if (!PyArg_ParseTuple(args, "O:count", &v)) - return NULL; for (i = 0; i < self->ob_size; i++) { int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); --- 1397,1405 ---- static PyObject * ! listcount(PyListObject *self, PyObject *v) { int count = 0; int i; for (i = 0; i < self->ob_size; i++) { int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); *************** *** 1429,1439 **** static PyObject * ! listremove(PyListObject *self, PyObject *args) { int i; - PyObject *v; - if (!PyArg_ParseTuple(args, "O:remove", &v)) - return NULL; for (i = 0; i < self->ob_size; i++) { int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); --- 1413,1420 ---- static PyObject * ! listremove(PyListObject *self, PyObject *v) { int i; for (i = 0; i < self->ob_size; i++) { int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); *************** *** 1662,1673 **** static PyMethodDef list_methods[] = { ! {"append", (PyCFunction)listappend, METH_VARARGS, append_doc}, {"insert", (PyCFunction)listinsert, METH_VARARGS, insert_doc}, ! {"extend", (PyCFunction)listextend, METH_VARARGS, extend_doc}, {"pop", (PyCFunction)listpop, METH_VARARGS, pop_doc}, ! {"remove", (PyCFunction)listremove, METH_VARARGS, remove_doc}, ! {"index", (PyCFunction)listindex, METH_VARARGS, index_doc}, ! {"count", (PyCFunction)listcount, METH_VARARGS, count_doc}, ! {"reverse", (PyCFunction)listreverse, METH_VARARGS, reverse_doc}, {"sort", (PyCFunction)listsort, METH_VARARGS, sort_doc}, {NULL, NULL} /* sentinel */ --- 1643,1654 ---- static PyMethodDef list_methods[] = { ! {"append", (PyCFunction)listappend, METH_O, append_doc}, {"insert", (PyCFunction)listinsert, METH_VARARGS, insert_doc}, ! {"extend", (PyCFunction)listextend, METH_O, extend_doc}, {"pop", (PyCFunction)listpop, METH_VARARGS, pop_doc}, ! {"remove", (PyCFunction)listremove, METH_O, remove_doc}, ! {"index", (PyCFunction)listindex, METH_O, index_doc}, ! {"count", (PyCFunction)listcount, METH_O, count_doc}, ! {"reverse", (PyCFunction)listreverse, METH_NOARGS, reverse_doc}, {"sort", (PyCFunction)listsort, METH_VARARGS, sort_doc}, {NULL, NULL} /* sentinel */ *************** *** 1750,1760 **** static PyMethodDef immutable_list_methods[] = { ! {"append", (PyCFunction)immutable_list_op}, ! {"insert", (PyCFunction)immutable_list_op}, ! {"remove", (PyCFunction)immutable_list_op}, ! {"index", (PyCFunction)listindex}, ! {"count", (PyCFunction)listcount}, ! {"reverse", (PyCFunction)immutable_list_op}, ! {"sort", (PyCFunction)immutable_list_op}, {NULL, NULL} /* sentinel */ }; --- 1731,1741 ---- static PyMethodDef immutable_list_methods[] = { ! {"append", (PyCFunction)immutable_list_op, METH_VARARGS}, ! {"insert", (PyCFunction)immutable_list_op, METH_VARARGS}, ! {"remove", (PyCFunction)immutable_list_op, METH_VARARGS}, ! {"index", (PyCFunction)listindex, METH_O}, ! {"count", (PyCFunction)listcount, METH_O}, ! {"reverse", (PyCFunction)immutable_list_op, METH_VARARGS}, ! {"sort", (PyCFunction)immutable_list_op, METH_VARARGS}, {NULL, NULL} /* sentinel */ }; Index: methodobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/methodobject.c,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -d -r2.36 -r2.37 *** methodobject.c 2001/08/12 21:51:04 2.36 --- methodobject.c 2001/08/16 13:15:00 2.37 *************** *** 64,67 **** --- 64,68 ---- PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); + int size = PyTuple_GET_SIZE(arg); if (flags & METH_KEYWORDS) { *************** *** 74,83 **** return NULL; } ! if (flags & METH_VARARGS) { return (*meth)(self, arg); ! } ! if (!(flags & METH_VARARGS)) { /* the really old style */ - int size = PyTuple_GET_SIZE(arg); if (size == 1) arg = PyTuple_GET_ITEM(arg, 0); --- 75,101 ---- return NULL; } ! ! switch (flags) { ! case METH_VARARGS: return (*meth)(self, arg); ! break; ! case METH_NOARGS: ! if (size == 0) ! return (*meth)(self, NULL); ! PyErr_Format(PyExc_TypeError, ! "%.200s() takes no arguments (%d given)", ! f->m_ml->ml_name, size); ! return NULL; ! break; ! case METH_O: ! if (size == 1) ! return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); ! PyErr_Format(PyExc_TypeError, ! "%.200s() takes exactly one argument (%d given)", ! f->m_ml->ml_name, size); ! return NULL; ! break; ! case METH_OLDARGS: /* the really old style */ if (size == 1) arg = PyTuple_GET_ITEM(arg, 0); *************** *** 85,92 **** arg = NULL; return (*meth)(self, arg); } - /* should never get here ??? */ - PyErr_BadInternalCall(); - return NULL; } --- 103,111 ---- arg = NULL; return (*meth)(self, arg); + default: + /* should never get here ??? */ + PyErr_BadInternalCall(); + return NULL; } } Index: rangeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/rangeobject.c,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -d -r2.27 -r2.28 *** rangeobject.c 2001/08/02 04:15:00 2.27 --- rangeobject.c 2001/08/16 13:15:00 2.28 *************** *** 244,250 **** WARN("xrange.tolist() is deprecated; use list(xrange) instead"); - if (! PyArg_ParseTuple(args, ":tolist")) - return NULL; - if (self->totlen == -1) return PyErr_NoMemory(); --- 244,247 ---- *************** *** 267,271 **** static PyMethodDef range_methods[] = { ! {"tolist", (PyCFunction)range_tolist, METH_VARARGS, "tolist() -> list\n" "Return a list object with the same values.\n" --- 264,268 ---- static PyMethodDef range_methods[] = { ! {"tolist", (PyCFunction)range_tolist, METH_NOARGS, "tolist() -> list\n" "Return a list object with the same values.\n" Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.122 retrieving revision 2.123 diff -C2 -d -r2.122 -r2.123 *** stringobject.c 2001/08/02 04:15:00 2.122 --- stringobject.c 2001/08/16 13:15:00 2.123 *************** *** 922,926 **** static PyObject * ! string_join(PyStringObject *self, PyObject *args) { char *sep = PyString_AS_STRING(self); --- 922,926 ---- static PyObject * ! string_join(PyStringObject *self, PyObject *orig) { char *sep = PyString_AS_STRING(self); *************** *** 931,938 **** size_t sz = 0; int i; ! PyObject *orig, *seq, *item; ! ! if (!PyArg_ParseTuple(args, "O:join", &orig)) ! return NULL; seq = PySequence_Fast(orig, ""); --- 931,935 ---- size_t sz = 0; int i; ! PyObject *seq, *item; seq = PySequence_Fast(orig, ""); *************** *** 1030,1046 **** _PyString_Join(PyObject *sep, PyObject *x) { - PyObject* args; - PyObject* result = NULL; - assert(sep != NULL && PyString_Check(sep)); assert(x != NULL); ! args = PyTuple_New(1); ! if (args != NULL) { ! Py_INCREF(x); ! PyTuple_SET_ITEM(args, 0, x); ! result = string_join((PyStringObject *)sep, args); ! Py_DECREF(args); ! } ! return result; } --- 1027,1033 ---- _PyString_Join(PyObject *sep, PyObject *x) { assert(sep != NULL && PyString_Check(sep)); assert(x != NULL); ! return string_join((PyStringObject *)sep, x); } *************** *** 1177,1188 **** static PyObject * ! do_strip(PyStringObject *self, PyObject *args, int striptype) { char *s = PyString_AS_STRING(self); int len = PyString_GET_SIZE(self), i, j; - if (!PyArg_ParseTuple(args, ":strip")) - return NULL; - i = 0; if (striptype != RIGHTSTRIP) { --- 1164,1172 ---- static PyObject * ! do_strip(PyStringObject *self, int striptype) { char *s = PyString_AS_STRING(self); int len = PyString_GET_SIZE(self), i, j; i = 0; if (striptype != RIGHTSTRIP) { *************** *** 1216,1222 **** static PyObject * ! string_strip(PyStringObject *self, PyObject *args) { ! return do_strip(self, args, BOTHSTRIP); } --- 1200,1206 ---- static PyObject * ! string_strip(PyStringObject *self) { ! return do_strip(self, BOTHSTRIP); } *************** *** 1228,1234 **** static PyObject * ! string_lstrip(PyStringObject *self, PyObject *args) { ! return do_strip(self, args, LEFTSTRIP); } --- 1212,1218 ---- static PyObject * ! string_lstrip(PyStringObject *self) { ! return do_strip(self, LEFTSTRIP); } *************** *** 1240,1246 **** static PyObject * ! string_rstrip(PyStringObject *self, PyObject *args) { ! return do_strip(self, args, RIGHTSTRIP); } --- 1224,1230 ---- static PyObject * ! string_rstrip(PyStringObject *self) { ! return do_strip(self, RIGHTSTRIP); } *************** *** 1252,1256 **** static PyObject * ! string_lower(PyStringObject *self, PyObject *args) { char *s = PyString_AS_STRING(self), *s_new; --- 1236,1240 ---- static PyObject * ! string_lower(PyStringObject *self) { char *s = PyString_AS_STRING(self), *s_new; *************** *** 1258,1263 **** PyObject *new; - if (!PyArg_ParseTuple(args, ":lower")) - return NULL; new = PyString_FromStringAndSize(NULL, n); if (new == NULL) --- 1242,1245 ---- *************** *** 1282,1286 **** static PyObject * ! string_upper(PyStringObject *self, PyObject *args) { char *s = PyString_AS_STRING(self), *s_new; --- 1264,1268 ---- static PyObject * ! string_upper(PyStringObject *self) { char *s = PyString_AS_STRING(self), *s_new; *************** *** 1288,1293 **** PyObject *new; - if (!PyArg_ParseTuple(args, ":upper")) - return NULL; new = PyString_FromStringAndSize(NULL, n); if (new == NULL) --- 1270,1273 ---- *************** *** 1313,1317 **** static PyObject* ! string_title(PyStringObject *self, PyObject *args) { char *s = PyString_AS_STRING(self), *s_new; --- 1293,1297 ---- static PyObject* ! string_title(PyStringObject *self) { char *s = PyString_AS_STRING(self), *s_new; *************** *** 1320,1325 **** PyObject *new; - if (!PyArg_ParseTuple(args, ":title")) - return NULL; new = PyString_FromStringAndSize(NULL, n); if (new == NULL) --- 1300,1303 ---- *************** *** 1350,1354 **** static PyObject * ! string_capitalize(PyStringObject *self, PyObject *args) { char *s = PyString_AS_STRING(self), *s_new; --- 1328,1332 ---- static PyObject * ! string_capitalize(PyStringObject *self) { char *s = PyString_AS_STRING(self), *s_new; *************** *** 1356,1361 **** PyObject *new; - if (!PyArg_ParseTuple(args, ":capitalize")) - return NULL; new = PyString_FromStringAndSize(NULL, n); if (new == NULL) --- 1334,1337 ---- *************** *** 1451,1455 **** static PyObject * ! string_swapcase(PyStringObject *self, PyObject *args) { char *s = PyString_AS_STRING(self), *s_new; --- 1427,1431 ---- static PyObject * ! string_swapcase(PyStringObject *self) { char *s = PyString_AS_STRING(self), *s_new; *************** *** 1457,1462 **** PyObject *new; - if (!PyArg_ParseTuple(args, ":swapcase")) - return NULL; new = PyString_FromStringAndSize(NULL, n); if (new == NULL) --- 1433,1436 ---- *************** *** 2151,2155 **** static PyObject* ! string_isspace(PyStringObject *self, PyObject *args) { register const unsigned char *p --- 2125,2129 ---- static PyObject* ! string_isspace(PyStringObject *self) { register const unsigned char *p *************** *** 2157,2163 **** register const unsigned char *e; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyString_GET_SIZE(self) == 1 && --- 2131,2134 ---- *************** *** 2185,2189 **** static PyObject* ! string_isalpha(PyStringObject *self, PyObject *args) { register const unsigned char *p --- 2156,2160 ---- static PyObject* ! string_isalpha(PyStringObject *self) { register const unsigned char *p *************** *** 2191,2197 **** register const unsigned char *e; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyString_GET_SIZE(self) == 1 && --- 2162,2165 ---- *************** *** 2219,2223 **** static PyObject* ! string_isalnum(PyStringObject *self, PyObject *args) { register const unsigned char *p --- 2187,2191 ---- static PyObject* ! string_isalnum(PyStringObject *self) { register const unsigned char *p *************** *** 2225,2231 **** register const unsigned char *e; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyString_GET_SIZE(self) == 1 && --- 2193,2196 ---- *************** *** 2253,2257 **** static PyObject* ! string_isdigit(PyStringObject *self, PyObject *args) { register const unsigned char *p --- 2218,2222 ---- static PyObject* ! string_isdigit(PyStringObject *self) { register const unsigned char *p *************** *** 2259,2265 **** register const unsigned char *e; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyString_GET_SIZE(self) == 1 && --- 2224,2227 ---- *************** *** 2287,2291 **** static PyObject* ! string_islower(PyStringObject *self, PyObject *args) { register const unsigned char *p --- 2249,2253 ---- static PyObject* ! string_islower(PyStringObject *self) { register const unsigned char *p *************** *** 2294,2300 **** int cased; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyString_GET_SIZE(self) == 1) --- 2256,2259 ---- *************** *** 2324,2328 **** static PyObject* ! string_isupper(PyStringObject *self, PyObject *args) { register const unsigned char *p --- 2283,2287 ---- static PyObject* ! string_isupper(PyStringObject *self) { register const unsigned char *p *************** *** 2331,2337 **** int cased; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyString_GET_SIZE(self) == 1) --- 2290,2293 ---- *************** *** 2362,2366 **** static PyObject* ! string_istitle(PyStringObject *self, PyObject *args) { register const unsigned char *p --- 2318,2322 ---- static PyObject* ! string_istitle(PyStringObject *self, PyObject *uncased) { register const unsigned char *p *************** *** 2369,2375 **** int cased, previous_is_cased; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyString_GET_SIZE(self) == 1) --- 2325,2328 ---- *************** *** 2483,2521 **** /* Counterparts of the obsolete stropmodule functions; except string.maketrans(). */ ! {"join", (PyCFunction)string_join, 1, join__doc__}, ! {"split", (PyCFunction)string_split, 1, split__doc__}, ! {"lower", (PyCFunction)string_lower, 1, lower__doc__}, ! {"upper", (PyCFunction)string_upper, 1, upper__doc__}, ! {"islower", (PyCFunction)string_islower, 0, islower__doc__}, ! {"isupper", (PyCFunction)string_isupper, 0, isupper__doc__}, ! {"isspace", (PyCFunction)string_isspace, 0, isspace__doc__}, ! {"isdigit", (PyCFunction)string_isdigit, 0, isdigit__doc__}, ! {"istitle", (PyCFunction)string_istitle, 0, istitle__doc__}, ! {"isalpha", (PyCFunction)string_isalpha, 0, isalpha__doc__}, ! {"isalnum", (PyCFunction)string_isalnum, 0, isalnum__doc__}, ! {"capitalize", (PyCFunction)string_capitalize, 1, capitalize__doc__}, ! {"count", (PyCFunction)string_count, 1, count__doc__}, ! {"endswith", (PyCFunction)string_endswith, 1, endswith__doc__}, ! {"find", (PyCFunction)string_find, 1, find__doc__}, ! {"index", (PyCFunction)string_index, 1, index__doc__}, ! {"lstrip", (PyCFunction)string_lstrip, 1, lstrip__doc__}, ! {"replace", (PyCFunction)string_replace, 1, replace__doc__}, ! {"rfind", (PyCFunction)string_rfind, 1, rfind__doc__}, ! {"rindex", (PyCFunction)string_rindex, 1, rindex__doc__}, ! {"rstrip", (PyCFunction)string_rstrip, 1, rstrip__doc__}, ! {"startswith", (PyCFunction)string_startswith, 1, startswith__doc__}, ! {"strip", (PyCFunction)string_strip, 1, strip__doc__}, ! {"swapcase", (PyCFunction)string_swapcase, 1, swapcase__doc__}, ! {"translate", (PyCFunction)string_translate, 1, translate__doc__}, ! {"title", (PyCFunction)string_title, 1, title__doc__}, ! {"ljust", (PyCFunction)string_ljust, 1, ljust__doc__}, ! {"rjust", (PyCFunction)string_rjust, 1, rjust__doc__}, ! {"center", (PyCFunction)string_center, 1, center__doc__}, ! {"encode", (PyCFunction)string_encode, 1, encode__doc__}, ! {"decode", (PyCFunction)string_decode, 1, decode__doc__}, ! {"expandtabs", (PyCFunction)string_expandtabs, 1, expandtabs__doc__}, ! {"splitlines", (PyCFunction)string_splitlines, 1, splitlines__doc__}, #if 0 ! {"zfill", (PyCFunction)string_zfill, 1, zfill__doc__}, #endif {NULL, NULL} /* sentinel */ --- 2436,2474 ---- /* Counterparts of the obsolete stropmodule functions; except string.maketrans(). */ ! {"join", (PyCFunction)string_join, METH_O, join__doc__}, ! {"split", (PyCFunction)string_split, METH_VARARGS, split__doc__}, ! {"lower", (PyCFunction)string_lower, METH_NOARGS, lower__doc__}, ! {"upper", (PyCFunction)string_upper, METH_NOARGS, upper__doc__}, ! {"islower", (PyCFunction)string_islower, METH_NOARGS, islower__doc__}, ! {"isupper", (PyCFunction)string_isupper, METH_NOARGS, isupper__doc__}, ! {"isspace", (PyCFunction)string_isspace, METH_NOARGS, isspace__doc__}, ! {"isdigit", (PyCFunction)string_isdigit, METH_NOARGS, isdigit__doc__}, ! {"istitle", (PyCFunction)string_istitle, METH_NOARGS, istitle__doc__}, ! {"isalpha", (PyCFunction)string_isalpha, METH_NOARGS, isalpha__doc__}, ! {"isalnum", (PyCFunction)string_isalnum, METH_NOARGS, isalnum__doc__}, ! {"capitalize", (PyCFunction)string_capitalize, METH_NOARGS, capitalize__doc__}, ! {"count", (PyCFunction)string_count, METH_VARARGS, count__doc__}, ! {"endswith", (PyCFunction)string_endswith, METH_VARARGS, endswith__doc__}, ! {"find", (PyCFunction)string_find, METH_VARARGS, find__doc__}, ! {"index", (PyCFunction)string_index, METH_VARARGS, index__doc__}, ! {"lstrip", (PyCFunction)string_lstrip, METH_NOARGS, lstrip__doc__}, ! {"replace", (PyCFunction)string_replace, METH_VARARGS, replace__doc__}, ! {"rfind", (PyCFunction)string_rfind, METH_VARARGS, rfind__doc__}, ! {"rindex", (PyCFunction)string_rindex, METH_VARARGS, rindex__doc__}, ! {"rstrip", (PyCFunction)string_rstrip, METH_NOARGS, rstrip__doc__}, ! {"startswith", (PyCFunction)string_startswith, METH_VARARGS, startswith__doc__}, ! {"strip", (PyCFunction)string_strip, METH_NOARGS, strip__doc__}, ! {"swapcase", (PyCFunction)string_swapcase, METH_NOARGS, swapcase__doc__}, ! {"translate", (PyCFunction)string_translate, METH_VARARGS, translate__doc__}, ! {"title", (PyCFunction)string_title, METH_NOARGS, title__doc__}, ! {"ljust", (PyCFunction)string_ljust, METH_VARARGS, ljust__doc__}, ! {"rjust", (PyCFunction)string_rjust, METH_VARARGS, rjust__doc__}, ! {"center", (PyCFunction)string_center, METH_VARARGS, center__doc__}, ! {"encode", (PyCFunction)string_encode, METH_VARARGS, encode__doc__}, ! {"decode", (PyCFunction)string_decode, METH_VARARGS, decode__doc__}, ! {"expandtabs", (PyCFunction)string_expandtabs, METH_VARARGS, expandtabs__doc__}, ! {"splitlines", (PyCFunction)string_splitlines, METH_VARARGS, splitlines__doc__}, #if 0 ! {"zfill", (PyCFunction)string_zfill, METH_VARARGS, zfill__doc__}, #endif {NULL, NULL} /* sentinel */ Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.35 retrieving revision 2.36 diff -C2 -d -r2.35 -r2.36 *** typeobject.c 2001/08/16 09:18:56 2.35 --- typeobject.c 2001/08/16 13:15:00 2.36 *************** *** 377,386 **** static PyObject * ! mro_external(PyObject *self, PyObject *args) { PyTypeObject *type = (PyTypeObject *)self; - if (!PyArg_ParseTuple(args, "")) - return NULL; return mro_implementation(type); } --- 377,384 ---- static PyObject * ! mro_external(PyObject *self) { PyTypeObject *type = (PyTypeObject *)self; return mro_implementation(type); } *************** *** 846,850 **** static PyMethodDef type_methods[] = { ! {"mro", mro_external, METH_VARARGS, "mro() -> list\nreturn a type's method resolution order"}, {0} --- 844,848 ---- static PyMethodDef type_methods[] = { ! {"mro", (PyCFunction)mro_external, METH_NOARGS, "mro() -> list\nreturn a type's method resolution order"}, {0} Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.107 retrieving revision 2.108 diff -C2 -d -r2.107 -r2.108 *** unicodeobject.c 2001/08/09 22:21:55 2.107 --- unicodeobject.c 2001/08/16 13:15:00 2.108 *************** *** 3252,3259 **** static PyObject* ! unicode_title(PyUnicodeObject *self, PyObject *args) { - if (!PyArg_NoArgs(args)) - return NULL; return fixup(self, fixtitle); } --- 3252,3257 ---- static PyObject* ! unicode_title(PyUnicodeObject *self) { return fixup(self, fixtitle); } *************** *** 3266,3273 **** static PyObject* ! unicode_capitalize(PyUnicodeObject *self, PyObject *args) { - if (!PyArg_NoArgs(args)) - return NULL; return fixup(self, fixcapitalize); } --- 3264,3269 ---- static PyObject* ! unicode_capitalize(PyUnicodeObject *self) { return fixup(self, fixcapitalize); } *************** *** 3281,3285 **** static PyObject* ! unicode_capwords(PyUnicodeObject *self, PyObject *args) { PyObject *list; --- 3277,3281 ---- static PyObject* ! unicode_capwords(PyUnicodeObject *self) { PyObject *list; *************** *** 3287,3293 **** int i; - if (!PyArg_NoArgs(args)) - return NULL; - /* Split into words */ list = split(self, NULL, -1); --- 3283,3286 ---- *************** *** 3772,3776 **** static PyObject* ! unicode_islower(PyUnicodeObject *self, PyObject *args) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); --- 3765,3769 ---- static PyObject* ! unicode_islower(PyUnicodeObject *self) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); *************** *** 3778,3784 **** int cased; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) --- 3771,3774 ---- *************** *** 3809,3813 **** static PyObject* ! unicode_isupper(PyUnicodeObject *self, PyObject *args) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); --- 3799,3803 ---- static PyObject* ! unicode_isupper(PyUnicodeObject *self) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); *************** *** 3815,3821 **** int cased; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) --- 3805,3808 ---- *************** *** 3847,3851 **** static PyObject* ! unicode_istitle(PyUnicodeObject *self, PyObject *args) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); --- 3834,3838 ---- static PyObject* ! unicode_istitle(PyUnicodeObject *self) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); *************** *** 3853,3859 **** int cased, previous_is_cased; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) --- 3840,3843 ---- *************** *** 3896,3907 **** static PyObject* ! unicode_isspace(PyUnicodeObject *self, PyObject *args) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && --- 3880,3888 ---- static PyObject* ! unicode_isspace(PyUnicodeObject *self) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && *************** *** 3928,3939 **** static PyObject* ! unicode_isalpha(PyUnicodeObject *self, PyObject *args) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && --- 3909,3917 ---- static PyObject* ! unicode_isalpha(PyUnicodeObject *self) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && *************** *** 3960,3971 **** static PyObject* ! unicode_isalnum(PyUnicodeObject *self, PyObject *args) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && --- 3938,3946 ---- static PyObject* ! unicode_isalnum(PyUnicodeObject *self) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && *************** *** 3992,4003 **** static PyObject* ! unicode_isdecimal(PyUnicodeObject *self, PyObject *args) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && --- 3967,3975 ---- static PyObject* ! unicode_isdecimal(PyUnicodeObject *self) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && *************** *** 4024,4035 **** static PyObject* ! unicode_isdigit(PyUnicodeObject *self, PyObject *args) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && --- 3996,4004 ---- static PyObject* ! unicode_isdigit(PyUnicodeObject *self) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && *************** *** 4056,4067 **** static PyObject* ! unicode_isnumeric(PyUnicodeObject *self, PyObject *args) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; - if (!PyArg_NoArgs(args)) - return NULL; - /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && --- 4025,4033 ---- static PyObject* ! unicode_isnumeric(PyUnicodeObject *self) { register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self); register const Py_UNICODE *e; /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && *************** *** 4088,4098 **** static PyObject* ! unicode_join(PyUnicodeObject *self, PyObject *args) { ! PyObject *data; ! if (!PyArg_ParseTuple(args, "O:join", &data)) ! return NULL; ! ! return PyUnicode_Join((PyObject *)self, data); } --- 4054,4060 ---- static PyObject* ! unicode_join(PyObject *self, PyObject *data) { ! return PyUnicode_Join(self, data); } *************** *** 4130,4137 **** static PyObject* ! unicode_lower(PyUnicodeObject *self, PyObject *args) { - if (!PyArg_NoArgs(args)) - return NULL; return fixup(self, fixlower); } --- 4092,4097 ---- static PyObject* ! unicode_lower(PyUnicodeObject *self) { return fixup(self, fixlower); } *************** *** 4143,4150 **** static PyObject * ! unicode_lstrip(PyUnicodeObject *self, PyObject *args) { - if (!PyArg_NoArgs(args)) - return NULL; return strip(self, 1, 0); } --- 4103,4108 ---- static PyObject * ! unicode_lstrip(PyUnicodeObject *self) { return strip(self, 1, 0); } *************** *** 4358,4365 **** static PyObject * ! unicode_rstrip(PyUnicodeObject *self, PyObject *args) { - if (!PyArg_NoArgs(args)) - return NULL; return strip(self, 0, 1); } --- 4316,4321 ---- static PyObject * ! unicode_rstrip(PyUnicodeObject *self) { return strip(self, 0, 1); } *************** *** 4466,4473 **** static PyObject * ! unicode_strip(PyUnicodeObject *self, PyObject *args) { - if (!PyArg_NoArgs(args)) - return NULL; return strip(self, 1, 1); } --- 4422,4427 ---- static PyObject * ! unicode_strip(PyUnicodeObject *self) { return strip(self, 1, 1); } *************** *** 4480,4487 **** static PyObject* ! unicode_swapcase(PyUnicodeObject *self, PyObject *args) { - if (!PyArg_NoArgs(args)) - return NULL; return fixup(self, fixswapcase); } --- 4434,4439 ---- static PyObject* ! unicode_swapcase(PyUnicodeObject *self) { return fixup(self, fixswapcase); } *************** *** 4496,4505 **** static PyObject* ! unicode_translate(PyUnicodeObject *self, PyObject *args) { - PyObject *table; - - if (!PyArg_ParseTuple(args, "O:translate", &table)) - return NULL; return PyUnicode_TranslateCharmap(self->str, self->length, --- 4448,4453 ---- static PyObject* ! unicode_translate(PyUnicodeObject *self, PyObject *table) { return PyUnicode_TranslateCharmap(self->str, self->length, *************** *** 4514,4521 **** static PyObject* ! unicode_upper(PyUnicodeObject *self, PyObject *args) { - if (!PyArg_NoArgs(args)) - return NULL; return fixup(self, fixupper); } --- 4462,4467 ---- static PyObject* ! unicode_upper(PyUnicodeObject *self) { return fixup(self, fixupper); } *************** *** 4559,4566 **** #if 0 static PyObject* ! unicode_freelistsize(PyUnicodeObject *self, PyObject *args) { - if (!PyArg_NoArgs(args)) - return NULL; return PyInt_FromLong(unicode_freelist_size); } --- 4505,4510 ---- #if 0 static PyObject* ! unicode_freelistsize(PyUnicodeObject *self) { return PyInt_FromLong(unicode_freelist_size); } *************** *** 4634,4680 **** appear first, since lookup is done sequentially. */ ! {"encode", (PyCFunction) unicode_encode, 1, encode__doc__}, ! {"replace", (PyCFunction) unicode_replace, 1, replace__doc__}, ! {"split", (PyCFunction) unicode_split, 1, split__doc__}, ! {"join", (PyCFunction) unicode_join, 1, join__doc__}, ! {"capitalize", (PyCFunction) unicode_capitalize, 0, capitalize__doc__}, ! {"title", (PyCFunction) unicode_title, 0, title__doc__}, ! {"center", (PyCFunction) unicode_center, 1, center__doc__}, ! {"count", (PyCFunction) unicode_count, 1, count__doc__}, ! {"expandtabs", (PyCFunction) unicode_expandtabs, 1, expandtabs__doc__}, ! {"find", (PyCFunction) unicode_find, 1, find__doc__}, ! {"index", (PyCFunction) unicode_index, 1, index__doc__}, ! {"ljust", (PyCFunction) unicode_ljust, 1, ljust__doc__}, ! {"lower", (PyCFunction) unicode_lower, 0, lower__doc__}, ! {"lstrip", (PyCFunction) unicode_lstrip, 0, lstrip__doc__}, ! /* {"maketrans", (PyCFunction) unicode_maketrans, 1, maketrans__doc__}, */ ! {"rfind", (PyCFunction) unicode_rfind, 1, rfind__doc__}, ! {"rindex", (PyCFunction) unicode_rindex, 1, rindex__doc__}, ! {"rjust", (PyCFunction) unicode_rjust, 1, rjust__doc__}, ! {"rstrip", (PyCFunction) unicode_rstrip, 0, rstrip__doc__}, ! {"splitlines", (PyCFunction) unicode_splitlines, 1, splitlines__doc__}, ! {"strip", (PyCFunction) unicode_strip, 0, strip__doc__}, ! {"swapcase", (PyCFunction) unicode_swapcase, 0, swapcase__doc__}, ! {"translate", (PyCFunction) unicode_translate, 1, translate__doc__}, ! {"upper", (PyCFunction) unicode_upper, 0, upper__doc__}, ! {"startswith", (PyCFunction) unicode_startswith, 1, startswith__doc__}, ! {"endswith", (PyCFunction) unicode_endswith, 1, endswith__doc__}, ! {"islower", (PyCFunction) unicode_islower, 0, islower__doc__}, ! {"isupper", (PyCFunction) unicode_isupper, 0, isupper__doc__}, ! {"istitle", (PyCFunction) unicode_istitle, 0, istitle__doc__}, ! {"isspace", (PyCFunction) unicode_isspace, 0, isspace__doc__}, ! {"isdecimal", (PyCFunction) unicode_isdecimal, 0, isdecimal__doc__}, ! {"isdigit", (PyCFunction) unicode_isdigit, 0, isdigit__doc__}, ! {"isnumeric", (PyCFunction) unicode_isnumeric, 0, isnumeric__doc__}, ! {"isalpha", (PyCFunction) unicode_isalpha, 0, isalpha__doc__}, ! {"isalnum", (PyCFunction) unicode_isalnum, 0, isalnum__doc__}, #if 0 ! {"zfill", (PyCFunction) unicode_zfill, 1, zfill__doc__}, ! {"capwords", (PyCFunction) unicode_capwords, 0, capwords__doc__}, #endif #if 0 /* This one is just used for debugging the implementation. */ ! {"freelistsize", (PyCFunction) unicode_freelistsize, 0}, #endif --- 4578,4624 ---- appear first, since lookup is done sequentially. */ ! {"encode", (PyCFunction) unicode_encode, METH_VARARGS, encode__doc__}, ! {"replace", (PyCFunction) unicode_replace, METH_VARARGS, replace__doc__}, ! {"split", (PyCFunction) unicode_split, METH_VARARGS, split__doc__}, ! {"join", (PyCFunction) unicode_join, METH_O, join__doc__}, ! {"capitalize", (PyCFunction) unicode_capitalize, METH_NOARGS, capitalize__doc__}, ! {"title", (PyCFunction) unicode_title, METH_NOARGS, title__doc__}, ! {"center", (PyCFunction) unicode_center, METH_VARARGS, center__doc__}, ! {"count", (PyCFunction) unicode_count, METH_VARARGS, count__doc__}, ! {"expandtabs", (PyCFunction) unicode_expandtabs, METH_VARARGS, expandtabs__doc__}, ! {"find", (PyCFunction) unicode_find, METH_VARARGS, find__doc__}, ! {"index", (PyCFunction) unicode_index, METH_VARARGS, index__doc__}, ! {"ljust", (PyCFunction) unicode_ljust, METH_VARARGS, ljust__doc__}, ! {"lower", (PyCFunction) unicode_lower, METH_NOARGS, lower__doc__}, ! {"lstrip", (PyCFunction) unicode_lstrip, METH_NOARGS, lstrip__doc__}, ! /* {"maketrans", (PyCFunction) unicode_maketrans, METH_VARARGS, maketrans__doc__}, */ ! {"rfind", (PyCFunction) unicode_rfind, METH_VARARGS, rfind__doc__}, ! {"rindex", (PyCFunction) unicode_rindex, METH_VARARGS, rindex__doc__}, ! {"rjust", (PyCFunction) unicode_rjust, METH_VARARGS, rjust__doc__}, ! {"rstrip", (PyCFunction) unicode_rstrip, METH_NOARGS, rstrip__doc__}, ! {"splitlines", (PyCFunction) unicode_splitlines, METH_VARARGS, splitlines__doc__}, ! {"strip", (PyCFunction) unicode_strip, METH_NOARGS, strip__doc__}, ! {"swapcase", (PyCFunction) unicode_swapcase, METH_NOARGS, swapcase__doc__}, ! {"translate", (PyCFunction) unicode_translate, METH_O, translate__doc__}, ! {"upper", (PyCFunction) unicode_upper, METH_NOARGS, upper__doc__}, ! {"startswith", (PyCFunction) unicode_startswith, METH_VARARGS, startswith__doc__}, ! {"endswith", (PyCFunction) unicode_endswith, METH_VARARGS, endswith__doc__}, ! {"islower", (PyCFunction) unicode_islower, METH_NOARGS, islower__doc__}, ! {"isupper", (PyCFunction) unicode_isupper, METH_NOARGS, isupper__doc__}, ! {"istitle", (PyCFunction) unicode_istitle, METH_NOARGS, istitle__doc__}, ! {"isspace", (PyCFunction) unicode_isspace, METH_NOARGS, isspace__doc__}, ! {"isdecimal", (PyCFunction) unicode_isdecimal, METH_NOARGS, isdecimal__doc__}, ! {"isdigit", (PyCFunction) unicode_isdigit, METH_NOARGS, isdigit__doc__}, ! {"isnumeric", (PyCFunction) unicode_isnumeric, METH_NOARGS, isnumeric__doc__}, ! {"isalpha", (PyCFunction) unicode_isalpha, METH_NOARGS, isalpha__doc__}, ! {"isalnum", (PyCFunction) unicode_isalnum, METH_NOARGS, isalnum__doc__}, #if 0 ! {"zfill", (PyCFunction) unicode_zfill, METH_VARARGS, zfill__doc__}, ! {"capwords", (PyCFunction) unicode_capwords, METH_NOARGS, capwords__doc__}, #endif #if 0 /* This one is just used for debugging the implementation. */ ! {"freelistsize", (PyCFunction) unicode_freelistsize, METH_NOARGS}, #endif From akuchling@users.sourceforge.net Thu Aug 16 14:56:43 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Thu, 16 Aug 2001 06:56:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils/command config.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv1293 Modified Files: config.py Log Message: [Patch #442530 from twburton] Provide include_dirs argument to all calls to ._preprocess and ._compile Fix typo: pattern.search(pattern) should be pattern.search(line) Index: config.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/config.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** config.py 2001/08/13 13:56:24 1.7 --- config.py 2001/08/16 13:56:40 1.8 *************** *** 188,192 **** ok = 1 try: ! self._preprocess(body, headers, lang) except CompileError: ok = 0 --- 188,192 ---- ok = 1 try: ! self._preprocess(body, headers, include_dirs, lang) except CompileError: ok = 0 *************** *** 206,210 **** self._check_compiler() ! (src, out) = self._preprocess(body, headers, lang) if type(pattern) is StringType: --- 206,210 ---- self._check_compiler() ! (src, out) = self._preprocess(body, headers, include_dirs, lang) if type(pattern) is StringType: *************** *** 217,221 **** if line == '': break ! if pattern.search(pattern): match = 1 break --- 217,221 ---- if line == '': break ! if pattern.search(line): match = 1 break *************** *** 232,236 **** self._check_compiler() try: ! self._compile(body, headers, lang) ok = 1 except CompileError: --- 232,236 ---- self._check_compiler() try: ! self._compile(body, headers, include_dirs, lang) ok = 1 except CompileError: From akuchling@users.sourceforge.net Thu Aug 16 15:08:04 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Thu, 16 Aug 2001 07:08:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils/command config.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv4599 Modified Files: config.py Log Message: [Patch #444854 from twburton] Add executable extension, needed to get the program name right on Win32 Index: config.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/config.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** config.py 2001/08/16 13:56:40 1.8 --- config.py 2001/08/16 14:08:02 1.9 *************** *** 149,156 **** (src, obj) = self._compile(body, headers, include_dirs, lang) prog = os.path.splitext(os.path.basename(src))[0] - self.temp_files.append(prog) # XXX should be prog + exe_ext self.compiler.link_executable([obj], prog, libraries=libraries, library_dirs=library_dirs) return (src, obj, prog) --- 149,159 ---- (src, obj) = self._compile(body, headers, include_dirs, lang) prog = os.path.splitext(os.path.basename(src))[0] self.compiler.link_executable([obj], prog, libraries=libraries, library_dirs=library_dirs) + + prog = prog + self.compiler.exe_extension + self.temp_files.append(prog) + return (src, obj, prog) From jackjansen@users.sourceforge.net Thu Aug 16 15:10:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 16 Aug 2001 07:10:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonStandSmall.mcp,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv5221/Python/Mac/Build Modified Files: PythonStandSmall.mcp Log Message: Removed expat from the access paths, it isn't needed. Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 Binary files /tmp/cvsEgx9Sm and /tmp/cvssDzirM differ From jackjansen@users.sourceforge.net Thu Aug 16 15:10:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 16 Aug 2001 07:10:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo building.html,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo In directory usw-pr-cvs1:/tmp/cvs-serv5572/Python/Mac/Demo Modified Files: building.html Log Message: Updated to the current state of things (long overdue). Index: building.html =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/building.html,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** building.html 2001/04/25 22:11:21 1.29 --- building.html 2001/08/16 14:10:56 1.30 *************** *** 7,16 ****
- Note: This document is mostly still for Python 2.0, so - it is not correct. See the - MacPython homepage for an updated version, and if none is available - complain bitterly to me and work on it should progress faster. -

- This document explains how to build MacPython from source. This is necessary if you want to make modifications to the Python core. Building --- 7,10 ---- *************** *** 42,49 ****

  • You need a MacPython source distribution, of course. You can ! obtain one from ! ftp://ftp.cwi.nl/pub/jack/python/mac or from the companion webpage ! at ! http://www.cwi.nl/~jack/macpython.html (which has up-to-date links to the other packages needed too) and possibly also from the standard python.org ftp --- 36,41 ----
  • You need a MacPython source distribution, of course. You can ! obtain one via ! http://www.cwi.nl/~jack/macpython.html (which has up-to-date links to the other packages needed too) and possibly also from the standard python.org ftp *************** *** 58,63 **** been built with CodeWarrior Pro 6.1. Ordering information is available on the MetroWerks ! homepage. Building Python with MPW or Think/Symantec C is ! probably impossible without major surgery.
  • You need GUSI version 2, the Grand Unified Socket Interface, by --- 50,55 ---- been built with CodeWarrior Pro 6.1. Ordering information is available on the MetroWerks ! homepage. Building Python with MPW, Think/Symantec C or the OSX ! developer tools is impossible without major surgery.
  • You need GUSI version 2, the Grand Unified Socket Interface, by *************** *** 69,77 **** HREF="http://www.cwi.nl/~jack/macpython.html">MacPython homepage for a GUSI that is most easily used for building Python. -
    - If nothing is listed there (yet) you will have problems building a - Carbon Python. Complaining loudly on the pythonmac-sig@python.org mailing - list will make me work faster towards distributing Carbon-GUSI:-). --- 61,65 ---- *************** *** 97,101 **** was built using version 2.0, which is included in the CodeWarrior package. You can also obtain it from <http://www.boingo.com/waste> and various other places. --- 85,89 ---- was built using version 2.0, which is included in the CodeWarrior package. You can also obtain it from <http://www.merzwaren.com/waste> and various other places. *************** *** 103,114 **** http://www.cwi.nl/~jack/macsoftware.html and ! ftp://ftp.cwi.nl/pub/jack/mac. Also in the MacPython cvs repository at ! lib-src/gdbm.
  • JPEG library by the Independent JPEG Group. A version including Mac projects can be found at Jack's page mentioned above. The most recent JPEG library can always be obtained from ftp://ftp.uu.net/graphics/jpeg/. Again, ! also in the MacPython cvs repository at lib-src/jpeg.
  • The netpbm/pbmplus, libtiff, zlib and png libraries. The netpbm distribution --- 91,100 ---- http://www.cwi.nl/~jack/macsoftware.html and ! ftp://ftp.cwi.nl/pub/jack/mac.
  • JPEG library by the Independent JPEG Group. A version including Mac projects can be found at Jack's page mentioned above. The most recent JPEG library can always be obtained from ftp://ftp.uu.net/graphics/jpeg/.
  • The netpbm/pbmplus, libtiff, zlib and png libraries. The netpbm distribution *************** *** 118,124 **** and not the complete applications. A distribution with correct projects and library source only is available from, you guessed it, Jack's Mac software ! page mentioned above. And, guessed it again, in the MacPython cvs repository ! at lib-src/netpbm, etc. The only gotcha is that libtiff lives in ! lib-src/netpbm/libtiff, for historical reasons. --- 104,108 ---- and not the complete applications. A distribution with correct projects and library source only is available from, you guessed it, Jack's Mac software ! page mentioned above. *************** *** 280,284 ****
    Mac-specific builtin modules. Theoretically these are all optional, but some are rather essential (like ! macmodule). A lot of these modules are generated with bgen, in which case the bgen input files are included so you can attempt to regenerate them or extend them. --- 264,268 ----
    Mac-specific builtin modules. Theoretically these are all optional, but some are rather essential (like ! macosmodule). A lot of these modules are generated with bgen, in which case the bgen input files are included so you can attempt to regenerate them or extend them. *************** *** 328,365 **** -

    Building the 68K interpreter

    - - 68K Python is no longer supported, and the projects are not included in the - source distribution anymore. If you really want to build Python for the 68K - your best bet is to check the sources out of the CVS repository. The latest - projects (in :Mac:build:) that support 68K development are tagged as such, - and are dated around August 2000. If you plan on doing this announce it on - the SIG, please.

    -

    Building the PPC interpreter

    This is different under 2.1. You are best off using the fullbuild.py ! script.

    First you optionally build the external libraries with buildlibs.prj. Next, the projects for ! interpreter, core library and applet skeleton are all linked together, so ! building the PythonInterpreter target in PythonEngine.prj ! will result in everything being built. The ! resulting applications and fat shared library are deposited in the main ! Python folder. Finally, you build all the plugins with the plugins.prj project. For completeness sake here is a breakdown of the projects:

    !
    PythonCore (with subproject PythonCorePPC)
    The shared library that contains the bulk of the interpreter and ! its resources. It is a good idea to immedeately put an alias to this shared library in the Extensions folder of your system folder. Do exactly that: put an alias there, copying or moving the file will cause you grief later if you rebuild the library and ! forget to copy it to the extensions folder again. The InstallPython applet ! will also do this, along with creating the plugin aliases.
    ! Note that the subproject looks a bit silly nowadays (with no more CFM68K ! support) but you will have to live with that for this release.
    PythonInterpeter --- 312,345 ----

    Building the PPC interpreter

    This is different under 2.1. You are best off using the fullbuild.py ! script, see below.

    ! First you optionally build the external libraries with buildlibs.prj. Next, the projects for ! interpreter and core library are linked together, so ! building the PythonInterpreterClassic and/or PythonInterpreterCarbon target ! in PythonInterpreter.prj ! will result in everything being built. The result, however, is an "Application ! template", (filetype Atmp). If you don't use fullbuild you can manually ! turn either of these into an interpreter by copying it to PythonInterpreter ! and setting the filetype to APPL (with ResEdit or some such).

    + Fullbuild does this for you, and the Atmp files is also how ConfigurePythonCarbon + and ConfigurePythonClassic work their magic.

    + For completeness sake here is a breakdown of the projects:

    !
    PythonCore
    The shared library that contains the bulk of the interpreter and ! its resources. It has targets for PythonCore and PythonCoreCarbon. ! It is a good idea to immedeately put an alias to this shared library in the Extensions folder of your system folder. Do exactly that: put an alias there, copying or moving the file will cause you grief later if you rebuild the library and ! forget to copy it to the extensions folder again. The ConfigurePythonXXX applets ! will also do this.
    PythonInterpeter *************** *** 369,394 ****
    Plugin projects !
    Each plugin module has a separate project. The Plugins.prj ! project tries to build them all, but is known to be flakey. See fullbuild ! below for a better way to build everything.
    After creating the alias to PythonCore you remove any old ! Python 2.0b1 Preferences file from the Preferences folder (if you had python installed on your system before) and run the interpreter once to create the correct preferences file.

    Next, you have to build the extension modules. ! The PlugIns.ppc project has all the ! other projects as subprojects and builds everything (but see the gotcha above).

    Finally, you must build the standard applets: ! EditPythonPrefs, BuildApplet, etc. This is ! easiest done with the fullbuild script from ! Mac:scripts.

    ! Actually, the fullbuild script can be used to build everything, but you need a fully-functional interpreter before you can use it (and one that isn't rebuilt in the process: you cannot rebuild --- 349,374 ----
    Plugin projects !
    Each plugin module has a separate project, and these can be rebuilt on ! the fly. Fullbuild (or actually it's little helper genpluginprojects) takes ! care of this. After creating the alias to PythonCore you remove any old ! Python XXXX Preferences file from the Preferences folder (if you had python installed on your system before) and run the interpreter once to create the correct preferences file.

    Next, you have to build the extension modules. ! If you don't use fullbuild simply open each project and build it.

    Finally, you must build the standard applets: ! EditPythonPrefs, BuildApplet, etc. For the N-th time: ! fullbuild does this for you, but you can also manually drag/drop them onto ! BuildApplet.

    ! ! The fullbuild script can be used to build everything, but you need a fully-functional interpreter before you can use it (and one that isn't rebuilt in the process: you cannot rebuild *************** *** 410,422 **** are building a plugin module.

    ! Rebuilding the .exp file is done by first removing the file and removing the ! reference to it in the project (in the "config" section). Next, build PythonCore. ! This will create a new .exp file. Edit this file to remove the references to the symbols __initialize, __terminate, setjmp, ! longjmp, vec_longjmp, main and (for PPC) __ptmf_null or (for ! CFM68K) __start and dummy_init_routine. ! Next, add the .exp file to the project ! again and rebuild PythonCore.

    This rather convoluted procedure is needed to ensure that plugin modules don't accidentally link with those entrypoints from PythonCore, which will not work because --- 390,405 ---- are building a plugin module.

    ! Rebuilding the .exp file is done by first both removing the file and removing the ! reference to it in the project (in the "config" section). Next, build PythonCore or ! PythonCoreCarbon. ! This will create a new .exp file, with the name PythonCore.mcp.exp. ! Rename this file to either PythonCore.exp or PythonCoreCarbon.exp ! and add this file back to the project. Next, edit ot to remove the references to the symbols __initialize, __terminate, setjmp, ! longjmp, vec_longjmp, main and __ptmf_null. ! They are all close together about halfway the file. + Finally rebuild again.

    + This rather convoluted procedure is needed to ensure that plugin modules don't accidentally link with those entrypoints from PythonCore, which will not work because *************** *** 425,431 ****

    Using the CVS source archive

    - Please check the MacPython homepage to see whether this information is - still current: MacPython should move to sourceforge shortly.

    - It is possible (and probably best) to access the Python sources through remote CVS. The advantage of this is that you get the very latest sources, so any bug --- 408,411 ---- *************** *** 442,480 **** conversion".

    ! It is also a good idea to disable Quicktime Exchange in the Quicktime control panel. Quicktime Exchange will magically map some extensions to filetypes, and this can seriously hinder you if, for instance, .bmp is not a Windows bitmap file.

    ! The machine-independent Python sources are checked out from the main Python CVS archive on sourceforge.net, see the Source access via CVS page for details. When you check the sources out you will get something like Python:dist:src, and under that the ! Modules, Lib, etc hierarchy. The ! src folder should be renamed to Python, and is what this document refers to as the "toplevel Python folder".

    - - Next, in a separate folder, you check out the - mac-specific sources. You then move the Mac folder from this - checkout (the only folder with anything in it) to the Python source folder. - Note that the checking out in a separate folder and moving is necessary, - due to the way cvs works. - - The CVS path to use for the mac stuff can be found - at the MacPython - homepage. Finally, you check out the external libraries needed in - the parent of the toplevel Python folder. The CVS path for these libraries is - also mentioned at the MacPython homepage.

    ! ! You should end up with a folder structure as described at the top of this ! document.

    ! ! Note that while the Mac folder is now a subfolder of your toplevel Python ! folder this does not mean that they "act as one" as far as CVS is concerned. ! To update all your sources you have to do a "cvs update" in the toplevel ! Python folder and another one in the Mac folder. This is again a cvs problem: ! it cannot deal with subpackages coming from different repositories.

    Odds and ends

    --- 422,450 ---- conversion".

    !

    ! There is one group of people for whom MacCVS is not the best choice: people with ! checkin rights to the Python repository. You will have to use MacCVS Pro ! (completely unrelated) from www.maccvs.org, because it has working SSH support. !
    ! ! It is a good idea to disable Quicktime Exchange in the Quicktime control panel. Quicktime Exchange will magically map some extensions to filetypes, and this can seriously hinder you if, for instance, .bmp is not a Windows bitmap file.

    ! The Python sources are checked out from the main Python CVS archive on sourceforge.net, see the Source access via CVS page for details. When you check the sources out you will get something like Python:dist:src, and under that the ! Modules, Lib, Mac etc hierarchy. The ! src folder can be renamed to Python, and is what this document refers to as the "toplevel Python folder".

    ! The CVS repository does not contain all the projects for the plugin modules, ! these are built with fullbuild.py normally. For this reason ! it is probably a good idea to first build PythonStandSmall.prj, ! which builds a fairly minimal interpreter, and then follow the ! fullbuild instructions.

    Odds and ends

    From fdrake@users.sourceforge.net Thu Aug 16 15:11:32 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 16 Aug 2001 07:11:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _weakref.c,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv5764 Modified Files: _weakref.c Log Message: Use METH_O where possible (two functions). This does not lead to real performance changes since the affected functions are not expected to be used frequently, but reduces the volume of code. Index: _weakref.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_weakref.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** _weakref.c 2001/05/03 16:05:46 1.11 --- _weakref.c 2001/08/16 14:11:30 1.12 *************** *** 505,522 **** static PyObject * ! weakref_getweakrefcount(PyObject *self, PyObject *args) { PyObject *result = NULL; - PyObject *object; ! if (PyArg_ParseTuple(args, "O:getweakrefcount", &object)) { ! if (PyType_SUPPORTS_WEAKREFS(object->ob_type)) { ! PyWeakReference **list = GET_WEAKREFS_LISTPTR(object); ! result = PyInt_FromLong(getweakrefcount(*list)); ! } ! else ! result = PyInt_FromLong(0); } return result; } --- 505,520 ---- static PyObject * ! weakref_getweakrefcount(PyObject *self, PyObject *object) { PyObject *result = NULL; ! if (PyType_SUPPORTS_WEAKREFS(object->ob_type)) { ! PyWeakReference **list = GET_WEAKREFS_LISTPTR(object); ! result = PyInt_FromLong(getweakrefcount(*list)); } + else + result = PyInt_FromLong(0); + return result; } *************** *** 528,556 **** static PyObject * ! weakref_getweakrefs(PyObject *self, PyObject *args) { PyObject *result = NULL; - PyObject *object; ! if (PyArg_ParseTuple(args, "O:getweakrefs", &object)) { ! if (PyType_SUPPORTS_WEAKREFS(object->ob_type)) { ! PyWeakReference **list = GET_WEAKREFS_LISTPTR(object); ! long count = getweakrefcount(*list); ! result = PyList_New(count); ! if (result != NULL) { ! PyWeakReference *current = *list; ! long i; ! for (i = 0; i < count; ++i) { ! PyList_SET_ITEM(result, i, (PyObject *) current); ! Py_INCREF(current); ! current = current->wr_next; ! } } } - else { - result = PyList_New(0); - } } return result; } --- 526,551 ---- static PyObject * ! weakref_getweakrefs(PyObject *self, PyObject *object) { PyObject *result = NULL; ! if (PyType_SUPPORTS_WEAKREFS(object->ob_type)) { ! PyWeakReference **list = GET_WEAKREFS_LISTPTR(object); ! long count = getweakrefcount(*list); ! result = PyList_New(count); ! if (result != NULL) { ! PyWeakReference *current = *list; ! long i; ! for (i = 0; i < count; ++i) { ! PyList_SET_ITEM(result, i, (PyObject *) current); ! Py_INCREF(current); ! current = current->wr_next; } } } + else { + result = PyList_New(0); + } return result; } *************** *** 797,803 **** static PyMethodDef weakref_functions[] = { ! {"getweakrefcount", weakref_getweakrefcount, METH_VARARGS, weakref_getweakrefcount__doc__}, ! {"getweakrefs", weakref_getweakrefs, METH_VARARGS, weakref_getweakrefs__doc__}, {"proxy", weakref_proxy, METH_VARARGS, --- 792,798 ---- static PyMethodDef weakref_functions[] = { ! {"getweakrefcount", weakref_getweakrefcount, METH_O, weakref_getweakrefcount__doc__}, ! {"getweakrefs", weakref_getweakrefs, METH_O, weakref_getweakrefs__doc__}, {"proxy", weakref_proxy, METH_VARARGS, From jvr@users.sourceforge.net Thu Aug 16 16:16:22 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Thu, 16 Aug 2001 08:16:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Resources pythonpath.r,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Resources In directory usw-pr-cvs1:/tmp/cvs-serv24518 Modified Files: pythonpath.r Log Message: Long time overdue: change sys.path defaults so that people will have to do "from PIL import Image" instead of "import Image". Index: pythonpath.r =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Resources/pythonpath.r,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pythonpath.r 2001/03/01 23:16:51 1.11 --- pythonpath.r 2001/08/16 15:16:19 1.12 *************** *** 90,94 **** "$(PYTHON):Extensions:img:Mac", "$(PYTHON):Extensions:img:Lib", ! "$(PYTHON):Extensions:Imaging:PIL", "$(PYTHON):Lib:lib-tk", "$(PYTHON):Lib:site-packages", --- 90,94 ---- "$(PYTHON):Extensions:img:Mac", "$(PYTHON):Extensions:img:Lib", ! "$(PYTHON):Extensions:Imaging", "$(PYTHON):Lib:lib-tk", "$(PYTHON):Lib:site-packages", From gvanrossum@users.sourceforge.net Thu Aug 16 16:42:51 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 08:42:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.36,2.37 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv29137 Modified Files: typeobject.c Log Message: I should add that the previous checkin also added a slight optimization for dynamic classes. If __getattr__ is not found as an attribute on the type, slot_tp_getattro replaces itself with PyObject_GenericGetAttr. This means you can't add a __getattr__ method to a class after the fact -- but you can still *change* a __getattr__ method into a different one. (A similar restriction exists for classic classes.) Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -d -r2.36 -r2.37 From fdrake@users.sourceforge.net Thu Aug 16 16:54:30 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 16 Aug 2001 08:54:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib mimetypes.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv456 Modified Files: mimetypes.py Log Message: Bad bug: the MimeTypes.readfp() was supposed to take a file object as a parameter, but did not. This was found because it can create failures elsewhere based on the presence of mime.types files in some common locations the module searches by default. (I will be writing a test for this module shortly!) Index: mimetypes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mimetypes.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mimetypes.py 2001/08/03 21:01:44 1.15 --- mimetypes.py 2001/08/16 15:54:28 1.16 *************** *** 131,139 **** fp.close() ! def readfp(self): """Read a single mime.types-format file.""" map = self.types_map while 1: ! line = f.readline() if not line: break --- 131,139 ---- fp.close() ! def readfp(self, fp): """Read a single mime.types-format file.""" map = self.types_map while 1: ! line = fp.readline() if not line: break From bwarsaw@users.sourceforge.net Thu Aug 16 17:53:01 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 16 Aug 2001 09:53:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules selectmodule.c,2.53,2.54 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv14019 Modified Files: selectmodule.c Log Message: select_select(): Closing bug #448351 the easy way, i.e. by changing the "#ifdef MS_WINDOWS" to "#ifdef SELECT_USES_HEAP" and by setting SELECT_USES_HEAP when FD_SETSIZE > 1024. The indirection seems useful since this subtly changes the path that "normal" Windows programs take (where Timmie sez FD_SETSIZE = 512). If that's a problem for Windows, he has only one place to change. Index: selectmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/selectmodule.c,v retrieving revision 2.53 retrieving revision 2.54 diff -C2 -d -r2.53 -r2.54 *** selectmodule.c 2001/07/19 21:29:49 2.53 --- selectmodule.c 2001/08/16 16:52:59 2.54 *************** *** 182,197 **** } ! static PyObject * select_select(PyObject *self, PyObject *args) { ! #ifdef MS_WINDOWS /* This would be an awful lot of stack space on Windows! */ pylist *rfd2obj, *wfd2obj, *efd2obj; ! #else pylist rfd2obj[FD_SETSIZE + 3]; pylist wfd2obj[FD_SETSIZE + 3]; pylist efd2obj[FD_SETSIZE + 3]; ! #endif PyObject *ifdlist, *ofdlist, *efdlist; PyObject *ret = NULL; --- 182,210 ---- } ! #undef SELECT_USES_HEAP ! #if FD_SETSIZE > 1024 ! #define SELECT_USES_HEAP ! #endif /* FD_SETSIZE > 1024 */ ! static PyObject * select_select(PyObject *self, PyObject *args) { ! #ifdef SELECT_USES_HEAP /* This would be an awful lot of stack space on Windows! */ pylist *rfd2obj, *wfd2obj, *efd2obj; ! #else /* !SELECT_USES_HEAP */ ! /* XXX: Why, oh why does this add 3?! As far as anyone can tell, ! * it should only add 1 for the sentinel. ! * ! * XXX: All this should probably be implemented as follows: ! * - find the highest descriptor we're interested in ! * - add one ! * - that's the size ! * See: Stevens, APitUE, $12.5.1 ! */ pylist rfd2obj[FD_SETSIZE + 3]; pylist wfd2obj[FD_SETSIZE + 3]; pylist efd2obj[FD_SETSIZE + 3]; ! #endif /* SELECT_USES_HEAP */ PyObject *ifdlist, *ofdlist, *efdlist; PyObject *ret = NULL; *************** *** 238,242 **** } ! #ifdef MS_WINDOWS /* Allocate memory for the lists */ rfd2obj = PyMem_NEW(pylist, FD_SETSIZE + 3); --- 251,255 ---- } ! #ifdef SELECT_USES_HEAP /* Allocate memory for the lists */ rfd2obj = PyMem_NEW(pylist, FD_SETSIZE + 3); *************** *** 249,253 **** return NULL; } ! #endif /* Convert lists to fd_sets, and get maximum fd number * propagates the Python exception set in list2set() --- 262,266 ---- return NULL; } ! #endif /* SELECT_USES_HEAP */ /* Convert lists to fd_sets, and get maximum fd number * propagates the Python exception set in list2set() *************** *** 303,311 **** reap_obj(wfd2obj); reap_obj(efd2obj); ! #ifdef MS_WINDOWS PyMem_DEL(rfd2obj); PyMem_DEL(wfd2obj); PyMem_DEL(efd2obj); ! #endif return ret; } --- 316,324 ---- reap_obj(wfd2obj); reap_obj(efd2obj); ! #ifdef SELECT_USES_HEAP PyMem_DEL(rfd2obj); PyMem_DEL(wfd2obj); PyMem_DEL(efd2obj); ! #endif /* SELECT_USES_HEAP */ return ret; } From bwarsaw@users.sourceforge.net Thu Aug 16 17:55:12 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 16 Aug 2001 09:55:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules selectmodule.c,2.54,2.55 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv14493 Modified Files: selectmodule.c Log Message: Fixed a couple of minor formatting nits where lines were > 79 columns wide. Index: selectmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/selectmodule.c,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -d -r2.54 -r2.55 *** selectmodule.c 2001/08/16 16:52:59 2.54 --- selectmodule.c 2001/08/16 16:55:10 2.55 *************** *** 231,235 **** else { if (timeout > (double)LONG_MAX) { ! PyErr_SetString(PyExc_OverflowError, "timeout period too long"); return NULL; } --- 231,236 ---- else { if (timeout > (double)LONG_MAX) { ! PyErr_SetString(PyExc_OverflowError, ! "timeout period too long"); return NULL; } *************** *** 369,373 **** "register(fd [, eventmask] ) -> None\n\n\ Register a file descriptor with the polling object.\n\ ! fd -- either an integer, or an object with a fileno() method returning an int.\n\ events -- an optional bitmask describing the type of events to check for"; --- 370,375 ---- "register(fd [, eventmask] ) -> None\n\n\ Register a file descriptor with the polling object.\n\ ! fd -- either an integer, or an object with a fileno() method returning an\n\ ! int.\n\ events -- an optional bitmask describing the type of events to check for"; From tim_one@users.sourceforge.net Thu Aug 16 17:56:18 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 16 Aug 2001 09:56:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_compare.py,1.4,1.5 test_descr.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14276/Lib/test Modified Files: test_compare.py test_descr.py Log Message: Repair some accidents causing Windows failures: + test_compare. While None compares less than anything else, it's not always the case that None has the smallest id(). + test_descr. The output of %p (pointer) formats varies across platforms. In particular, on Windows it doesn't produce a leading "0x". Index: test_compare.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compare.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_compare.py 2001/08/15 21:02:20 1.4 --- test_compare.py 2001/08/16 16:56:16 1.5 *************** *** 46,50 **** print "%s != %s" % (a, b) # Ensure default comparison compares id() of args ! L = [None] for i in range(10): L.insert(len(L)/2, Empty()) --- 46,50 ---- print "%s != %s" % (a, b) # Ensure default comparison compares id() of args ! L = [] for i in range(10): L.insert(len(L)/2, Empty()) Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_descr.py 2001/08/15 23:57:59 1.11 --- test_descr.py 2001/08/16 16:56:16 1.12 *************** *** 882,887 **** verify(not c1 != c1) verify(not c1 == c2) ! verify(str(c1) == '' % id(c1)) ! verify(repr(c1) == '' % id(c1)) verify(-1 not in c1) for i in range(10): --- 882,887 ---- verify(not c1 != c1) verify(not c1 == c2) ! verify(str(c1).startswith('' % id(d1)) ! verify(repr(d1) == '' % id(d1)) verify(-1 not in d1) for i in range(10): --- 903,908 ---- verify(not d1 != d1) verify(not d1 == d2) ! verify(str(d1).startswith(' Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv16578 Modified Files: xdrlib.py Log Message: Use (c)StringIO for collecting bytes. Fixes bug #451622. Index: xdrlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xdrlib.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** xdrlib.py 2001/03/01 04:27:19 1.12 --- xdrlib.py 2001/08/16 17:06:44 1.13 *************** *** 6,9 **** --- 6,13 ---- import struct + try: + from cStringIO import StringIO as _StringIO + except ImportError: + from StringIO import StringIO as _StringIO __all__ = ["Error", "Packer", "Unpacker", "ConversionError"] *************** *** 40,52 **** def reset(self): ! self.__buf = '' def get_buffer(self): ! return self.__buf # backwards compatibility get_buf = get_buffer def pack_uint(self, x): ! self.__buf = self.__buf + struct.pack('>L', x) pack_int = pack_uint --- 44,56 ---- def reset(self): ! self.__buf = _StringIO() def get_buffer(self): ! return self.__buf.getvalue() # backwards compatibility get_buf = get_buffer def pack_uint(self, x): ! self.__buf.write(struct.pack('>L', x)) pack_int = pack_uint *************** *** 54,59 **** def pack_bool(self, x): ! if x: self.__buf = self.__buf + '\0\0\0\1' ! else: self.__buf = self.__buf + '\0\0\0\0' def pack_uhyper(self, x): --- 58,63 ---- def pack_bool(self, x): ! if x: self.__buf.write('\0\0\0\1') ! else: self.__buf.write('\0\0\0\0') def pack_uhyper(self, x): *************** *** 64,73 **** def pack_float(self, x): ! try: self.__buf = self.__buf + struct.pack('>f', x) except struct.error, msg: raise ConversionError, msg def pack_double(self, x): ! try: self.__buf = self.__buf + struct.pack('>d', x) except struct.error, msg: raise ConversionError, msg --- 68,77 ---- def pack_float(self, x): ! try: self.__buf.write(struct.pack('>f', x)) except struct.error, msg: raise ConversionError, msg def pack_double(self, x): ! try: self.__buf.write(struct.pack('>d', x)) except struct.error, msg: raise ConversionError, msg *************** *** 79,83 **** data = s[:n] data = data + (n - len(data)) * '\0' ! self.__buf = self.__buf + data pack_fopaque = pack_fstring --- 83,87 ---- data = s[:n] data = data + (n - len(data)) * '\0' ! self.__buf.write(data) pack_fopaque = pack_fstring From fdrake@users.sourceforge.net Thu Aug 16 19:14:40 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 16 Aug 2001 11:14:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib mimetypes.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10100 Modified Files: mimetypes.py Log Message: Another egregious error that copied the encodings info over the suffix info. Caught by the tests that I'm writing now. Index: mimetypes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mimetypes.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** mimetypes.py 2001/08/16 15:54:28 1.16 --- mimetypes.py 2001/08/16 18:14:38 1.17 *************** *** 194,198 **** db.readfp(open(file)) encodings_map = db.encodings_map ! suffix_map = db.encodings_map types_map = db.types_map guess_extension = db.guess_extension --- 194,198 ---- db.readfp(open(file)) encodings_map = db.encodings_map ! suffix_map = db.suffix_map types_map = db.types_map guess_extension = db.guess_extension From fdrake@users.sourceforge.net Thu Aug 16 19:37:01 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 16 Aug 2001 11:37:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_mimetypes.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv16639 Added Files: test_mimetypes.py Log Message: New unit test for the mimetypes module, to avoid future regressions. --- NEW FILE: test_mimetypes.py --- import mimetypes import StringIO import unittest import test_support # Tell it we don't know about external files: mimetypes.knownfiles = [] class MimeTypesTestCase(unittest.TestCase): def setUp(self): self.db = mimetypes.MimeTypes() def test_default_data(self): self.assertEqual(self.db.guess_type("foo.html"), ("text/html", None)) self.assertEqual(self.db.guess_type("foo.tgz"), ("application/x-tar", "gzip")) self.assertEqual(self.db.guess_type("foo.tar.gz"), ("application/x-tar", "gzip")) self.assertEqual(self.db.guess_type("foo.tar.Z"), ("application/x-tar", "compress")) def test_data_urls(self): self.assertEqual(self.db.guess_type("data:,thisIsTextPlain"), ("text/plain", None)) self.assertEqual(self.db.guess_type("data:;base64,thisIsTextPlain"), ("text/plain", None)) self.assertEqual(self.db.guess_type("data:text/x-foo,thisIsTextXFoo"), ("text/x-foo", None)) def test_file_parsing(self): sio = StringIO.StringIO("x-application/x-unittest pyunit\n") self.db.readfp(sio) self.assertEqual(self.db.guess_type("foo.pyunit"), ("x-application/x-unittest", None)) self.assertEqual(self.db.guess_extension("x-application/x-unittest"), ".pyunit") test_support.run_unittest(MimeTypesTestCase) From gvanrossum@users.sourceforge.net Thu Aug 16 19:52:46 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 11:52:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.37,2.38 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv20253 Modified Files: typeobject.c Log Message: Fix object_repr() to include the module (using the same rules as type_repr() for when to show or not to show it). Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -d -r2.37 -r2.38 *** typeobject.c 2001/08/16 15:42:49 2.37 --- typeobject.c 2001/08/16 18:52:43 2.38 *************** *** 913,919 **** object_repr(PyObject *self) { ! char buf[120]; ! sprintf(buf, "<%.80s object at %p>", self->ob_type->tp_name, self); return PyString_FromString(buf); } --- 913,940 ---- object_repr(PyObject *self) { ! PyTypeObject *type; ! PyObject *mod, *name; ! char buf[200]; ! type = self->ob_type; ! mod = type_module(type, NULL); ! if (mod == NULL) ! PyErr_Clear(); ! else if (!PyString_Check(mod)) { ! Py_DECREF(mod); ! mod = NULL; ! } ! name = type_name(type, NULL); ! if (name == NULL) ! return NULL; ! if (mod != NULL && strcmp(PyString_AS_STRING(mod), "__builtin__")) ! sprintf(buf, "<%.80s.%.80s instance at %p>", ! PyString_AS_STRING(mod), ! PyString_AS_STRING(name), ! self); ! else ! sprintf(buf, "<%.80s instance at %p>", type->tp_name, self); ! Py_XDECREF(mod); ! Py_DECREF(name); return PyString_FromString(buf); } From tim_one@users.sourceforge.net Thu Aug 16 20:50:54 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 16 Aug 2001 12:50:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv1580/lib/test Modified Files: test_descr.py Log Message: test_descr started breaking in yet another way in the same place. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_descr.py 2001/08/16 16:56:16 1.12 --- test_descr.py 2001/08/16 19:50:51 1.13 *************** *** 882,886 **** verify(not c1 != c1) verify(not c1 == c2) ! verify(str(c1).startswith('= 0) verify(str(c1) == repr(c1)) verify(-1 not in c1) *************** *** 903,907 **** verify(not d1 != d1) verify(not d1 == d2) ! verify(str(d1).startswith('= 0) verify(str(d1) == repr(d1)) verify(-1 not in d1) From akuchling@users.sourceforge.net Thu Aug 16 21:17:44 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Thu, 16 Aug 2001 13:17:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils bcppcompiler.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv8137 Modified Files: bcppcompiler.py Log Message: [Patch #441691] preprocess() method for Borland C compiler. I have no way of testing this. Index: bcppcompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/bcppcompiler.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** bcppcompiler.py 2001/08/09 21:02:34 1.9 --- bcppcompiler.py 2001/08/16 20:17:41 1.10 *************** *** 22,26 **** CCompiler, gen_preprocess_options, gen_lib_options from distutils.file_util import write_file ! class BCPPCompiler(CCompiler) : --- 22,26 ---- CCompiler, gen_preprocess_options, gen_lib_options from distutils.file_util import write_file ! from distutils.dep_util import newer class BCPPCompiler(CCompiler) : *************** *** 374,375 **** --- 374,409 ---- # object_filenames () + + def preprocess (self, + source, + output_file=None, + macros=None, + include_dirs=None, + extra_preargs=None, + extra_postargs=None): + + (_, macros, include_dirs) = \ + self._fix_compile_args(None, macros, include_dirs) + pp_opts = gen_preprocess_options(macros, include_dirs) + pp_args = ['cpp32.exe'] + pp_opts + if output_file is not None: + pp_args.append('-o' + output_file) + if extra_preargs: + pp_args[:0] = extra_preargs + if extra_postargs: + pp_args.extend(extra_postargs) + pp_args.append(source) + + # We need to preprocess: either we're being forced to, or the + # source file is newer than the target (or the target doesn't + # exist). + if self.force or output_file is None or newer(source, output_file): + if output_file: + self.mkpath(os.path.dirname(output_file)) + try: + self.spawn(pp_args) + except DistutilsExecError, msg: + print msg + raise CompileError, msg + + # preprocess() From akuchling@users.sourceforge.net Thu Aug 16 21:30:20 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Thu, 16 Aug 2001 13:30:20 -0700 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv11122 Modified Files: setup.py Log Message: Link readline module with ncurses in preference to termcap. [Bug ##441580] Remove pointless comment Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** setup.py 2001/08/15 13:17:45 1.48 --- setup.py 2001/08/16 20:30:18 1.49 *************** *** 311,315 **** if self.compiler.find_library_file(lib_dirs, 'readline'): readline_libs = ['readline'] ! if self.compiler.find_library_file(lib_dirs + ['/usr/lib/termcap'], 'termcap'): --- 311,318 ---- if self.compiler.find_library_file(lib_dirs, 'readline'): readline_libs = ['readline'] ! if self.compiler.find_library_file(lib_dirs, ! 'ncurses'): ! readline_libs.append('ncurses') ! elif self.compiler.find_library_file(lib_dirs + ['/usr/lib/termcap'], 'termcap'): *************** *** 319,324 **** libraries=readline_libs) ) ! # The crypt module is now disabled by default because it breaks builds ! # on many systems (where -lcrypt is needed), e.g. Linux (I believe). if self.compiler.find_library_file(lib_dirs, 'crypt'): --- 322,326 ---- libraries=readline_libs) ) ! # crypt module. if self.compiler.find_library_file(lib_dirs, 'crypt'): From bwarsaw@users.sourceforge.net Thu Aug 16 21:33:50 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 16 Aug 2001 13:33:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _sre.c,2.61,2.62 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12026 Modified Files: _sre.c Log Message: init_sre(): Plug a little leak reported by Insure. Index: _sre.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v retrieving revision 2.61 retrieving revision 2.62 diff -C2 -d -r2.61 -r2.62 *** _sre.c 2001/07/08 13:26:57 2.61 --- _sre.c 2001/08/16 20:33:48 2.62 *************** *** 2617,2620 **** --- 2617,2621 ---- PyObject* m; PyObject* d; + PyObject* x; /* Patch object types */ *************** *** 2626,2635 **** PyDict_SetItemString( ! d, "MAGIC", (PyObject*) PyInt_FromLong(SRE_MAGIC) ); PyDict_SetItemString( ! d, "copyright", (PyObject*) PyString_FromString(copyright) ); } --- 2627,2638 ---- PyDict_SetItemString( ! d, "MAGIC", (x = (PyObject*) PyInt_FromLong(SRE_MAGIC)) ); + Py_XDECREF(x); PyDict_SetItemString( ! d, "copyright", (x = (PyObject*)PyString_FromString(copyright)) ); + Py_XDECREF(x); } From jackjansen@users.sourceforge.net Thu Aug 16 21:39:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 16 Aug 2001 13:39:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts fullbuild.py,1.69,1.70 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv13643/Python/Mac/scripts Modified Files: fullbuild.py Log Message: If genpluginprojects is called from fullbuild we set the Python source directory to be the same as fullbuild uses (in stead of using the default sys.prefix). This fixes an issue Mark Day raised that you can't use fullbuild with one Python installation to build another one. Index: fullbuild.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/fullbuild.py,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** fullbuild.py 2001/08/07 13:53:25 1.69 --- fullbuild.py 2001/08/16 20:39:09 1.70 *************** *** 19,22 **** --- 19,23 ---- import re import string + import genpluginprojects import aetools *************** *** 378,381 **** --- 379,384 ---- sys.exit(0) dir = dir.as_pathname() + # Set genpluginprojects to use this folder (slight hack) + genpluginprojects.PYTHONDIR = dir todo = handle_dialog(os.path.join(dir, MACBUILDNO)) From jackjansen@users.sourceforge.net Thu Aug 16 21:39:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 16 Aug 2001 13:39:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts genpluginprojects.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv13690/Python/Mac/scripts Modified Files: genpluginprojects.py Log Message: If genpluginprojects is called from fullbuild we set the Python source directory to be the same as fullbuild uses (in stead of using the default sys.prefix). This fixes an issue Mark Day raised that you can't use fullbuild with one Python installation to build another one. Index: genpluginprojects.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/genpluginprojects.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** genpluginprojects.py 2001/08/07 13:53:10 1.15 --- genpluginprojects.py 2001/08/16 20:39:17 1.16 *************** *** 4,8 **** import string ! PROJECTDIR = os.path.join(sys.prefix, ":Mac:Build") MODULEDIRS = [ # Relative to projectdirs "::Modules:%s", --- 4,9 ---- import string ! PYTHONDIR = sys.prefix ! PROJECTDIR = os.path.join(PYTHONDIR, ":Mac:Build") MODULEDIRS = [ # Relative to projectdirs "::Modules:%s", From bwarsaw@users.sourceforge.net Thu Aug 16 21:39:26 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 16 Aug 2001 13:39:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects moduleobject.c,2.34,2.35 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13720 Modified Files: moduleobject.c Log Message: module_repr(): Instead of fixing the maximum buf size to 400, calculate it on the fly. This way even modules with long package names get an accurate repr instead of a truncated one. The extra malloc/free cost shouldn't be a problem in a repr function. Closes SF bug #437984 Index: moduleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/moduleobject.c,v retrieving revision 2.34 retrieving revision 2.35 diff -C2 -d -r2.34 -r2.35 *** moduleobject.c 2001/08/02 04:15:00 2.34 --- moduleobject.c 2001/08/16 20:39:24 2.35 *************** *** 158,164 **** module_repr(PyModuleObject *m) { ! char buf[400]; char *name; char *filename; name = PyModule_GetName((PyObject *)m); if (name == NULL) { --- 158,169 ---- module_repr(PyModuleObject *m) { ! static int template1len = sizeof("") + 1; ! static int template2len = sizeof("") + 1; ! ! char *buf; char *name; char *filename; + PyObject *rtn; + name = PyModule_GetName((PyObject *)m); if (name == NULL) { *************** *** 169,178 **** if (filename == NULL) { PyErr_Clear(); ! sprintf(buf, "", name); ! } else { ! sprintf(buf, "", name, filename); } ! ! return PyString_FromString(buf); } --- 174,190 ---- if (filename == NULL) { PyErr_Clear(); ! buf = PyObject_MALLOC( ! sizeof(char) * (strlen(name) + template1len)); ! sprintf(buf, "", name); } ! else { ! buf = PyObject_MALLOC( ! sizeof(char) * (strlen(name) + strlen(filename) + ! template2len)); ! sprintf(buf, "", name, filename); ! } ! rtn = PyString_FromString(buf); ! PyObject_FREE(buf); ! return rtn; } From gvanrossum@users.sourceforge.net Thu Aug 16 21:41:58 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 13:41:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14035/Lib/test Modified Files: test_descr.py Log Message: classobject.c:instancemethod_descr_get(): when a bound method is assigned to a class variable and then accessed via an instance, it should not be rebound. test_descr.py:methods(): test for the condition above. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_descr.py 2001/08/16 19:50:51 1.13 --- test_descr.py 2001/08/16 20:41:56 1.14 *************** *** 863,867 **** verify(d2.foo() == 2) verify(d2.boo() == 2) ! verify(d2.goo() == 2) def specials(): --- 863,867 ---- verify(d2.foo() == 2) verify(d2.boo() == 2) ! verify(d2.goo() == 1) def specials(): From gvanrossum@users.sourceforge.net Thu Aug 16 21:41:58 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 16 Aug 2001 13:41:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects classobject.c,2.136,2.137 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv14035/Objects Modified Files: classobject.c Log Message: classobject.c:instancemethod_descr_get(): when a bound method is assigned to a class variable and then accessed via an instance, it should not be rebound. test_descr.py:methods(): test for the condition above. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.136 retrieving revision 2.137 diff -C2 -d -r2.136 -r2.137 *** classobject.c 2001/08/15 17:52:31 2.136 --- classobject.c 2001/08/16 20:41:56 2.137 *************** *** 2197,2200 **** --- 2197,2205 ---- instancemethod_descr_get(PyObject *meth, PyObject *obj, PyObject *type) { + if (PyMethod_GET_SELF(meth) != NULL) { + /* Don't rebind an already bound method */ + Py_INCREF(meth); + return meth; + } if (obj == Py_None) obj = NULL; From bwarsaw@users.sourceforge.net Thu Aug 16 21:42:41 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 16 Aug 2001 13:42:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_import.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14474 Modified Files: test_import.py Log Message: Added a test for module repr truncation when the package name is really long. Closes SF bug #437984. Index: test_import.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_import.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_import.py 2001/08/04 08:12:35 1.7 --- test_import.py 2001/08/16 20:42:38 1.8 *************** *** 70,71 **** --- 70,106 ---- finally: del sys.path[0] + + def touch(path): + fp = open(path, 'w') + fp.close() + + # test imports of packages with really long names, but specifically that their + # reprs include the full name + try: + longname = 'areallylongpackageandmodulenametotestreprtruncation' + os.mkdir(longname) + touch(os.path.join(longname, '__init__.py')) + os.mkdir(os.path.join(longname, longname)) + touch(os.path.join(longname, longname, '__init__.py')) + touch(os.path.join(longname, longname, longname + '.py')) + sys.path.insert(0, os.getcwd()) + from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation + if `areallylongpackageandmodulenametotestreprtruncation` <> \ + "" % areallylongpackageandmodulenametotestreprtruncation.__file__: + raise TestFailed, 'module name truncation' + finally: + # Delete recursively + del sys.path[0] + def zap(actions, dirname, names): + for name in names: + actions.append(os.path.join(dirname, name)) + actions = [] + os.path.walk(longname, zap, actions) + actions.append(longname) + actions.sort() + actions.reverse() + for p in actions: + if os.path.isdir(p): + os.rmdir(p) + else: + os.remove(p) From fdrake@users.sourceforge.net Thu Aug 16 22:25:26 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 16 Aug 2001 14:25:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/dist dist.tex,1.35,1.36 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory usw-pr-cvs1:/tmp/cvs-serv32582/dist Modified Files: dist.tex Log Message: Fix typo reported by Joonas Paalasmaa: dada-->data Index: dist.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** dist.tex 2001/08/02 15:13:15 1.35 --- dist.tex 2001/08/16 21:25:24 1.36 *************** *** 1240,1244 **** distributions on Windows. They display a nice graphical user interface, display some information of the module distribution to be installed, taken ! from the meta-dada in the setup script, let the user select a few (currently maybe too few) options, and start or cancel the installation. --- 1240,1244 ---- distributions on Windows. They display a nice graphical user interface, display some information of the module distribution to be installed, taken ! from the meta-data in the setup script, let the user select a few (currently maybe too few) options, and start or cancel the installation. From fdrake@users.sourceforge.net Thu Aug 16 22:21:32 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 16 Aug 2001 14:21:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libos.tex,1.62,1.63 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv30356/lib Modified Files: libos.tex Log Message: Re-write the description of the os.spawn*() functions, and cover the whole family instead of just two. This closes SF bug #451630. Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** libos.tex 2001/07/23 19:20:56 1.62 --- libos.tex 2001/08/16 21:21:28 1.63 *************** *** 943,964 **** \end{funcdescni} ! \begin{funcdesc}{spawnv}{mode, path, args} ! Execute the program \var{path} in a new process, passing the arguments ! specified in \var{args} as command-line parameters. \var{args} may be ! a list or a tuple. \var{mode} is a magic operational constant. See ! the Visual \Cpp{} Runtime Library documentation for further ! information; the constants are exposed to the Python programmer as ! listed below. ! Availability: \UNIX{}, Windows. ! \versionadded{1.6} ! \end{funcdesc} ! \begin{funcdesc}{spawnve}{mode, path, args, env} ! Execute the program \var{path} in a new process, passing the arguments ! specified in \var{args} as command-line parameters and the contents of ! the mapping \var{env} as the environment. \var{args} may be a list or ! a tuple. \var{mode} is a magic operational constant. See the Visual ! \Cpp{} Runtime Library documentation for further information; the ! constants are exposed to the Python programmer as listed below. Availability: \UNIX{}, Windows. \versionadded{1.6} --- 943,998 ---- \end{funcdescni} ! \begin{funcdesc}{spawnl}{mode, path, \moreargs} ! \funcline{spawnle}{mode, path, \moreargs, env} ! \funcline{spawnlp}{mode, path, \moreargs} ! \funcline{spawnlpe}{mode, path, \moreargs, env} ! \funcline{spawnv}{mode, path, args} ! \funcline{spawnve}{mode, path, args, env} ! \funcline{spawnvp}{mode, path, args} ! \funcline{spawnvpe}{mode, path, args, env} ! Execute the program \var{path} in a new process. If \var{mode} is ! \constant{P_NOWAIT}, this function returns the process ID of the new ! process; it \var{mode} is \constant{P_WAIT}, returns the process's ! exit code if it exits normally, or \code{-\var{signal}}, where ! \var{signal} is the signal that killed the process. ! For \function{spawnle()}, \function{spawnlpe()}, \function{spawnve()}, ! and \function{spawnvpe()} (note that these all end in \character{e}), ! the \var{env} parameter must be a mapping which is used to define the ! environment variables for the new process; the \function{spawnl()}, ! \function{spawnlp()}, \function{spawnv()}, and \function{spawnvp()} ! all cause the new process to inherit the environment of the current ! process. ! ! The variants which include a second \character{p} near the end ! (\function{spawnlp()}, \function{spawnlpe()}, \function{spawnvp()}, ! and \function{spawnvpe()}) will use the \envvar{PATH} environment ! variable to locate the program \var{path}. The other variants, ! \function{spawnl()}, \function{spawnle()}, \function{spawnv()}, and ! \function{spawnve()}, will not use the \envvar{PATH} variable to ! locate the executable. ! ! The \character{l} and \character{v} variants of the ! \function{spawn*()} functions differ in how command-line arguments are ! passed. The \character{l} variants are perhaps the easiest to work ! with if the number of parameters is fixed when the code is written; ! the individual parameters simply become additional parameters to the ! \function{spawnl*()} functions. The \character{v} variants are good ! when the number of parameters is variable, with the arguments being ! passed in a list or tuple as the \var{args} parameter. In either ! case, the arguments to the child process must start with the name of ! the command being run. ! ! As an example, the following calls to \function{spawnlp()} and ! \function{spawnvpe()} are equivalent: ! ! \begin{verbatim} ! import os ! os.spawnlp(os.P_WAIT, 'cp', 'cp', 'index.html', '/dev/null') ! ! L = ['cp', 'index.html', '/dev/null'] ! os.spawnvpe(os.P_WAIT, 'cp', L, os.environ) ! \end{verbatim} ! Availability: \UNIX{}, Windows. \versionadded{1.6} From fdrake@users.sourceforge.net Thu Aug 16 22:56:26 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 16 Aug 2001 14:56:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.107,1.108 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory usw-pr-cvs1:/tmp/cvs-serv8888/perl Modified Files: python.perl Log Message: fix_font(): Instead of using a long if/elsif cluster, use a bloody dictionary. Added some entries to the dictionary to fix part of SF bug #451556. Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** python.perl 2001/08/03 18:36:17 1.107 --- python.perl 2001/08/16 21:56:24 1.108 *************** *** 1183,1213 **** @col_aligns = ('', '', '', '', ''); sub fix_font{ # do a little magic on a font name to get the right behavior in the first # column of the output table my $font = @_[0]; ! if ($font eq 'textrm') { ! $font = ''; ! } ! elsif ($font eq 'file' || $font eq 'filenq') { ! $font = 'tt class="file"'; ! } ! elsif ($font eq 'member') { ! $font = 'tt class="member"'; ! } ! elsif ($font eq 'class') { ! $font = 'tt class="class"'; ! } ! elsif ($font eq 'constant') { ! $font = 'tt class="constant"'; ! } ! elsif ($font eq 'kbd') { ! $font = 'kbd'; ! } ! elsif ($font eq 'programopt') { ! $font = 'b'; ! } ! elsif ($font eq 'exception') { ! $font = 'tt class="exception"'; } return $font; --- 1183,1206 ---- @col_aligns = ('', '', '', '', ''); + %FontConversions = ('cdata' => 'tt class="cdata"', + 'character' => 'tt class="character"', + 'class' => 'tt class="class"', + 'command' => 'code', + 'constant' => 'tt class="constant"', + 'exception' => 'tt class="exception"', + 'file' => 'tt class="file"', + 'filenq' => 'tt class="file"', + 'kbd' => 'kbd', + 'member' => 'tt class="member"', + 'programopt' => 'b', + 'textrm' => '', + ); + sub fix_font{ # do a little magic on a font name to get the right behavior in the first # column of the output table my $font = @_[0]; ! if (defined $FontConversions{$font}) { ! $font = $FontConversions{$font}; } return $font; From tim_one@users.sourceforge.net Thu Aug 16 22:59:49 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 16 Aug 2001 14:59:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules selectmodule.c,2.55,2.56 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv9263/Modules Modified Files: selectmodule.c Log Message: Stop adding 3 to FD_SETSIZE -- it makes no sense. If it turns out it actually does , perhaps an Insure run will catch it. Also removed senseless Windows comment. Index: selectmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/selectmodule.c,v retrieving revision 2.55 retrieving revision 2.56 diff -C2 -d -r2.55 -r2.56 *** selectmodule.c 2001/08/16 16:55:10 2.55 --- selectmodule.c 2001/08/16 21:59:46 2.56 *************** *** 72,79 **** static void ! reap_obj(pylist fd2obj[FD_SETSIZE + 3]) { int i; ! for (i = 0; i < FD_SETSIZE + 3 && fd2obj[i].sentinel >= 0; i++) { Py_XDECREF(fd2obj[i].obj); fd2obj[i].obj = NULL; --- 72,79 ---- static void ! reap_obj(pylist fd2obj[FD_SETSIZE + 1]) { int i; ! for (i = 0; i < FD_SETSIZE + 1 && fd2obj[i].sentinel >= 0; i++) { Py_XDECREF(fd2obj[i].obj); fd2obj[i].obj = NULL; *************** *** 87,91 **** */ static int ! list2set(PyObject *list, fd_set *set, pylist fd2obj[FD_SETSIZE + 3]) { int i; --- 87,91 ---- */ static int ! list2set(PyObject *list, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) { int i; *************** *** 142,146 **** /* returns NULL and sets the Python exception if an error occurred */ static PyObject * ! set2list(fd_set *set, pylist fd2obj[FD_SETSIZE + 3]) { int i, j, count=0; --- 142,146 ---- /* returns NULL and sets the Python exception if an error occurred */ static PyObject * ! set2list(fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) { int i, j, count=0; *************** *** 191,201 **** { #ifdef SELECT_USES_HEAP - /* This would be an awful lot of stack space on Windows! */ pylist *rfd2obj, *wfd2obj, *efd2obj; #else /* !SELECT_USES_HEAP */ ! /* XXX: Why, oh why does this add 3?! As far as anyone can tell, ! * it should only add 1 for the sentinel. ! * ! * XXX: All this should probably be implemented as follows: * - find the highest descriptor we're interested in * - add one --- 191,197 ---- { #ifdef SELECT_USES_HEAP pylist *rfd2obj, *wfd2obj, *efd2obj; #else /* !SELECT_USES_HEAP */ ! /* XXX: All this should probably be implemented as follows: * - find the highest descriptor we're interested in * - add one *************** *** 203,209 **** * See: Stevens, APitUE, $12.5.1 */ ! pylist rfd2obj[FD_SETSIZE + 3]; ! pylist wfd2obj[FD_SETSIZE + 3]; ! pylist efd2obj[FD_SETSIZE + 3]; #endif /* SELECT_USES_HEAP */ PyObject *ifdlist, *ofdlist, *efdlist; --- 199,205 ---- * See: Stevens, APitUE, $12.5.1 */ ! pylist rfd2obj[FD_SETSIZE + 1]; ! pylist wfd2obj[FD_SETSIZE + 1]; ! pylist efd2obj[FD_SETSIZE + 1]; #endif /* SELECT_USES_HEAP */ PyObject *ifdlist, *ofdlist, *efdlist; *************** *** 254,260 **** #ifdef SELECT_USES_HEAP /* Allocate memory for the lists */ ! rfd2obj = PyMem_NEW(pylist, FD_SETSIZE + 3); ! wfd2obj = PyMem_NEW(pylist, FD_SETSIZE + 3); ! efd2obj = PyMem_NEW(pylist, FD_SETSIZE + 3); if (rfd2obj == NULL || wfd2obj == NULL || efd2obj == NULL) { if (rfd2obj) PyMem_DEL(rfd2obj); --- 250,256 ---- #ifdef SELECT_USES_HEAP /* Allocate memory for the lists */ ! rfd2obj = PyMem_NEW(pylist, FD_SETSIZE + 1); ! wfd2obj = PyMem_NEW(pylist, FD_SETSIZE + 1); ! efd2obj = PyMem_NEW(pylist, FD_SETSIZE + 1); if (rfd2obj == NULL || wfd2obj == NULL || efd2obj == NULL) { if (rfd2obj) PyMem_DEL(rfd2obj); From gvanrossum@users.sourceforge.net Fri Aug 17 12:18:40 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 04:18:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.38,2.39 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv26582 Modified Files: typeobject.c Log Message: type_new(): only defer to the winning metatype if it's different from the metatype passed in as an argument. This prevents infinite recursion when a metatype written in Python calls type.__new__() as a "super" call. Also tweaked some comments. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.38 retrieving revision 2.39 diff -C2 -d -r2.38 -r2.39 *** typeobject.c 2001/08/16 18:52:43 2.38 --- typeobject.c 2001/08/17 11:18:38 2.39 *************** *** 498,510 **** static char *kwlist[] = {"name", "bases", "dict", 0}; PyObject *slots, *tmp; ! PyTypeObject *type, *base, *tmptype; etype *et; struct memberlist *mp; int i, nbases, nslots, slotoffset, dynamic; if (metatype == &PyType_Type && PyTuple_Check(args) && PyTuple_GET_SIZE(args) == 1 && (kwds == NULL || (PyDict_Check(kwds) && PyDict_Size(kwds) == 0))) { - /* type(x) -> x.__class__ */ PyObject *x = PyTuple_GET_ITEM(args, 0); Py_INCREF(x->ob_type); --- 498,510 ---- static char *kwlist[] = {"name", "bases", "dict", 0}; PyObject *slots, *tmp; ! PyTypeObject *type, *base, *tmptype, *winner; etype *et; struct memberlist *mp; int i, nbases, nslots, slotoffset, dynamic; + /* Special case: type(x) should return x->ob_type */ if (metatype == &PyType_Type && PyTuple_Check(args) && PyTuple_GET_SIZE(args) == 1 && (kwds == NULL || (PyDict_Check(kwds) && PyDict_Size(kwds) == 0))) { PyObject *x = PyTuple_GET_ITEM(args, 0); Py_INCREF(x->ob_type); *************** *** 512,516 **** } ! /* Check arguments */ if (!PyArg_ParseTupleAndKeywords(args, kwds, "SO!O!:type", kwlist, &name, --- 512,516 ---- } ! /* Check arguments: (name, bases, dict) */ if (!PyArg_ParseTupleAndKeywords(args, kwds, "SO!O!:type", kwlist, &name, *************** *** 524,534 **** it's possible that its instances are not types. */ nbases = PyTuple_GET_SIZE(bases); for (i = 0; i < nbases; i++) { tmp = PyTuple_GET_ITEM(bases, i); tmptype = tmp->ob_type; ! if (PyType_IsSubtype(metatype, tmptype)) continue; ! if (PyType_IsSubtype(tmptype, metatype)) { ! metatype = tmptype; continue; } --- 524,535 ---- it's possible that its instances are not types. */ nbases = PyTuple_GET_SIZE(bases); + winner = metatype; for (i = 0; i < nbases; i++) { tmp = PyTuple_GET_ITEM(bases, i); tmptype = tmp->ob_type; ! if (PyType_IsSubtype(winner, tmptype)) continue; ! if (PyType_IsSubtype(tmptype, winner)) { ! winner = tmptype; continue; } *************** *** 537,542 **** return NULL; } ! if (metatype->tp_new != type_new) /* Pass it to the winner */ ! return metatype->tp_new(metatype, args, kwds); /* Adjust for empty tuple bases */ --- 538,546 ---- return NULL; } ! if (winner != metatype) { ! if (winner->tp_new != type_new) /* Pass it to the winner */ ! return winner->tp_new(winner, args, kwds); ! metatype = winner; ! } /* Adjust for empty tuple bases */ From gvanrossum@users.sourceforge.net Fri Aug 17 12:43:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 04:43:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv30834 Modified Files: test_descr.py Log Message: metaclass(): add tests for metaclasses written in Python: one that subclasses type, one that doesn't (the latter isn't fully functional yet). Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_descr.py 2001/08/16 20:41:56 1.14 --- test_descr.py 2001/08/17 11:43:17 1.15 *************** *** 382,385 **** --- 382,418 ---- def myself(cls): return cls verify(D.myself() == D) + d = D() + verify(d.__class__ is D) + class M1(type): + def __new__(cls, name, bases, dict): + dict['__spam__'] = 1 + return type.__new__(cls, name, bases, dict) + class C: + __metaclass__ = M1 + verify(C.__spam__ == 1) + c = C() + verify(c.__spam__ == 1) + class _instance(object): + pass + class M2(object): + def __new__(cls, name, bases, dict): + self = object.__new__(cls) + self.name = name + self.bases = bases + self.dict = dict + return self + __new__ = staticmethod(__new__) + def __call__(self): + it = _instance() + # XXX Should do more, but that doesn't work yet + return it + class C: + __metaclass__ = M2 + def spam(self): + return 42 + verify(C.name == 'C') + verify(C.bases == ()) + verify('spam' in C.dict) + c = C() def pymods(): From gvanrossum@users.sourceforge.net Fri Aug 17 12:56:00 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 04:56:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv953 Modified Files: test_descr.py Log Message: Add early binding of methods to the 2nd metaclass example. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** test_descr.py 2001/08/17 11:43:17 1.15 --- test_descr.py 2001/08/17 11:55:58 1.16 *************** *** 405,409 **** def __call__(self): it = _instance() ! # XXX Should do more, but that doesn't work yet return it class C: --- 405,413 ---- def __call__(self): it = _instance() ! # Early binding of methods ! for key in self.dict: ! if key.startswith("__"): ! continue ! setattr(it, key, self.dict[key].__get__(it, self)) return it class C: *************** *** 415,418 **** --- 419,423 ---- verify('spam' in C.dict) c = C() + verify(c.spam() == 42) def pymods(): From gvanrossum@users.sourceforge.net Fri Aug 17 13:07:36 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 05:07:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects classobject.c,2.137,2.138 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3272 Modified Files: classobject.c Log Message: Instance methods: allow a NULL value for im_class. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.137 retrieving revision 2.138 diff -C2 -d -r2.137 -r2.138 *** classobject.c 2001/08/16 20:41:56 2.137 --- classobject.c 2001/08/17 12:07:34 2.138 *************** *** 1974,1978 **** Py_XINCREF(self); im->im_self = self; ! Py_INCREF(class); im->im_class = class; PyObject_GC_Init(im); --- 1974,1978 ---- Py_XINCREF(self); im->im_self = self; ! Py_XINCREF(class); im->im_class = class; PyObject_GC_Init(im); *************** *** 2041,2045 **** Py_DECREF(im->im_func); Py_XDECREF(im->im_self); ! Py_DECREF(im->im_class); im->im_self = (PyObject *)free_list; free_list = im; --- 2041,2045 ---- Py_DECREF(im->im_func); Py_XDECREF(im->im_self); ! Py_XDECREF(im->im_class); im->im_self = (PyObject *)free_list; free_list = im; From gvanrossum@users.sourceforge.net Fri Aug 17 14:40:50 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 06:40:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv26541 Modified Files: test_descr.py Log Message: classic(), methods(): add another test relating to unbound methods: when an unbound method of class A is stored as a class variable of class B, and class B is *not* a subclass of class A, that method should *not* get bound to B instances. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_descr.py 2001/08/17 11:55:58 1.16 --- test_descr.py 2001/08/17 13:40:47 1.17 *************** *** 761,764 **** --- 761,767 ---- verify(d.foo(1) == (d, 1)) verify(D.foo(d, 1) == (d, 1)) + class E: # *not* subclassing from C + foo = C.foo + verify(E().foo == C.foo) # i.e., unbound def compattr(): *************** *** 902,905 **** --- 905,911 ---- verify(d2.boo() == 2) verify(d2.goo() == 1) + class E(object): + foo = C.foo + verify(E().foo == C.foo) # i.e., unbound def specials(): From gvanrossum@users.sourceforge.net Fri Aug 17 14:43:29 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 06:43:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects classobject.c,2.138,2.139 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv27250 Modified Files: classobject.c Log Message: instance_getattr2(): rewritten to remove unnecessary stuff and streamlined a bit. instancemethod_descr_get(): don't bind an unbound method of a class that's not a base class of the argument class. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.138 retrieving revision 2.139 diff -C2 -d -r2.138 -r2.139 *** classobject.c 2001/08/17 12:07:34 2.138 --- classobject.c 2001/08/17 13:43:27 2.139 *************** *** 650,662 **** descrgetfunc f; - class = NULL; v = PyDict_GetItem(inst->in_dict, name); ! if (v == NULL) { ! v = class_lookup(inst->in_class, name, &class); ! if (v == NULL) ! return v; } ! Py_INCREF(v); ! if (class != NULL) { f = v->ob_type->tp_descr_get; if (f != NULL) { --- 650,661 ---- descrgetfunc f; v = PyDict_GetItem(inst->in_dict, name); ! if (v != NULL) { ! Py_INCREF(v); ! return v; } ! v = class_lookup(inst->in_class, name, &class); ! if (v != NULL) { ! Py_INCREF(v); f = v->ob_type->tp_descr_get; if (f != NULL) { *************** *** 666,682 **** v = w; } - else if (PyMethod_Check(v)) { - /* XXX This should be a tp_descr_get slot of - PyMethodObjects */ - PyObject *im_class = PyMethod_GET_CLASS(v); - /* Only if classes are compatible */ - if (PyClass_IsSubclass((PyObject *)class, im_class)) { - PyObject *im_func = PyMethod_GET_FUNCTION(v); - PyObject *w = PyMethod_New(im_func, - (PyObject *)inst, im_class); - Py_DECREF(v); - v = w; - } - } } return v; --- 665,668 ---- *************** *** 2195,2202 **** static PyObject * ! instancemethod_descr_get(PyObject *meth, PyObject *obj, PyObject *type) { ! if (PyMethod_GET_SELF(meth) != NULL) { ! /* Don't rebind an already bound method */ Py_INCREF(meth); return meth; --- 2181,2191 ---- static PyObject * ! instancemethod_descr_get(PyObject *meth, PyObject *obj, PyObject *class) { ! /* Don't rebind an already bound method, or an unbound method ! of a class that's not a base class of class */ ! if (PyMethod_GET_SELF(meth) != NULL || ! (PyMethod_GET_CLASS(meth) != NULL && ! !PyObject_IsSubclass(class, PyMethod_GET_CLASS(meth)))) { Py_INCREF(meth); return meth; *************** *** 2204,2208 **** if (obj == Py_None) obj = NULL; ! return PyMethod_New(PyMethod_GET_FUNCTION(meth), obj, type); } --- 2193,2197 ---- if (obj == Py_None) obj = NULL; ! return PyMethod_New(PyMethod_GET_FUNCTION(meth), obj, class); } From gvanrossum@users.sourceforge.net Fri Aug 17 14:58:34 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 06:58:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv30978 Modified Files: test_descr.py Log Message: classic(),metods(): add tests to verify that a bound method without a class has a correct repr(). Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test_descr.py 2001/08/17 13:40:47 1.17 --- test_descr.py 2001/08/17 13:58:31 1.18 *************** *** 764,767 **** --- 764,768 ---- foo = C.foo verify(E().foo == C.foo) # i.e., unbound + verify(repr(C.foo.__get__(C())).startswith(" Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv31188 Modified Files: classobject.c Log Message: Fix core dump in repr() of instancemethod whose class==NULL. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.139 retrieving revision 2.140 diff -C2 -d -r2.139 -r2.140 *** classobject.c 2001/08/17 13:43:27 2.139 --- classobject.c 2001/08/17 13:59:27 2.140 *************** *** 2059,2071 **** else sfuncname = PyString_AS_STRING(funcname); ! klassname = PyObject_GetAttrString(klass, "__name__"); ! if (klassname == NULL) ! PyErr_Clear(); ! else if (!PyString_Check(klassname)) { ! Py_DECREF(klassname); klassname = NULL; } - else - sklassname = PyString_AS_STRING(klassname); if (self == NULL) sprintf(buffer, "", --- 2059,2075 ---- else sfuncname = PyString_AS_STRING(funcname); ! if (klass == NULL) klassname = NULL; + else { + klassname = PyObject_GetAttrString(klass, "__name__"); + if (klassname == NULL) + PyErr_Clear(); + else if (!PyString_Check(klassname)) { + Py_DECREF(klassname); + klassname = NULL; + } + else + sklassname = PyString_AS_STRING(klassname); } if (self == NULL) sprintf(buffer, "", From gvanrossum@users.sourceforge.net Fri Aug 17 15:05:30 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 07:05:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include patchlevel.h,2.51,2.52 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv464 Modified Files: patchlevel.h Log Message: - Get rid of obsolete #define PATCHLEVEL. - Change PY_VERSION (but not the numeric versions) to "2.2a1+". Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.51 retrieving revision 2.52 diff -C2 -d -r2.51 -r2.52 *** patchlevel.h 2001/08/02 04:15:00 2.51 --- patchlevel.h 2001/08/17 14:05:27 2.52 *************** *** 27,34 **** /* Version as a string */ ! #define PY_VERSION "2.2a1" ! ! /* Historic */ ! #define PATCHLEVEL "2.2a1" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 27,31 ---- /* Version as a string */ ! #define PY_VERSION "2.2a1+" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From gvanrossum@users.sourceforge.net Fri Aug 17 16:32:33 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 08:32:33 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.51,1.52 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv19998 Modified Files: Makefile.pre.in Log Message: Strip trailing whitespace, including two lines containing only one or more tabs that XEmacs Makefile mode found suspicious. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Makefile.pre.in 2001/08/15 01:26:28 1.51 --- Makefile.pre.in 2001/08/17 15:32:31 1.52 *************** *** 1,4 **** # Top-level Makefile for Python ! # # As distributed, this file is called Makefile.pre.in; it is processed # into the real Makefile by running the script ./configure, which --- 1,4 ---- # Top-level Makefile for Python ! # # As distributed, this file is called Makefile.pre.in; it is processed # into the real Makefile by running the script ./configure, which *************** *** 6,20 **** # This means that if you edit Makefile, your changes get lost the next # time you run the configure script. Ideally, you can do: ! # # ./configure # make # make test # make install ! # # If you have a previous version of Python installed that you don't # want to overwrite, you can use "make altinstall" instead of "make # install". Refer to the "Installing" section in the README file for # additional details. ! # # See also the section "Build instructions" in the README file. --- 6,20 ---- # This means that if you edit Makefile, your changes get lost the next # time you run the configure script. Ideally, you can do: ! # # ./configure # make # make test # make install ! # # If you have a previous version of Python installed that you don't # want to overwrite, you can use "make altinstall" instead of "make # install". Refer to the "Installing" section in the README file for # additional details. ! # # See also the section "Build instructions" in the README file. *************** *** 283,287 **** # Default target ! all: $(PYTHON) oldsharedmods sharedmods # Build the interpreter --- 283,287 ---- # Default target ! all: $(PYTHON) oldsharedmods sharedmods # Build the interpreter *************** *** 340,344 **** $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): $(LIBRARY) $(PYTHONFRAMEWORKDIR) libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \ ! -framework System @LIBTOOL_CRUFT@ # This rule builds the Cygwin Python DLL --- 340,344 ---- $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): $(LIBRARY) $(PYTHONFRAMEWORKDIR) libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \ ! -framework System @LIBTOOL_CRUFT@ # This rule builds the Cygwin Python DLL *************** *** 501,505 **** # Install almost everything without disturbing previous versions altinstall: altbininstall libinstall inclinstall libainstall \ ! sharedinstall oldsharedinstall # Install shared libraries enabled by Setup --- 501,505 ---- # Install almost everything without disturbing previous versions altinstall: altbininstall libinstall inclinstall libainstall \ ! sharedinstall oldsharedinstall # Install shared libraries enabled by Setup *************** *** 514,518 **** done ! $(DESTSHARED): @for i in $(DESTDIRS); \ do \ --- 514,518 ---- done ! $(DESTSHARED): @for i in $(DESTDIRS); \ do \ *************** *** 750,754 **** $(LN) -fs Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers $(LN) -fs Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources ! # On install, we re-make the framework # structure in the install location, /Library/Frameworks/ or the argument to --- 750,754 ---- $(LN) -fs Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers $(LN) -fs Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources ! # On install, we re-make the framework # structure in the install location, /Library/Frameworks/ or the argument to *************** *** 782,786 **** $(LN) -fs Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) ! # Build the toplevel Makefile Makefile.pre: Makefile.pre.in config.status --- 782,786 ---- $(LN) -fs Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) ! # Build the toplevel Makefile Makefile.pre: Makefile.pre.in config.status *************** *** 834,838 **** -rm -f $(PYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ tags TAGS \ ! config.cache config.log pyconfig.h Modules/config.c -rm -rf build platform --- 834,838 ---- -rm -f $(PYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ tags TAGS \ ! config.cache config.log pyconfig.h Modules/config.c -rm -rf build platform From gvanrossum@users.sourceforge.net Fri Aug 17 17:47:52 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 09:47:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.39,2.40 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv5095 Modified Files: typeobject.c Log Message: type_new(): look for __dynamic__ at the module level (after looking in the class dict). Anything but a nonnegative int in either place is *ignored* (before, a non-Boolean was an error). The default is still static -- in a comparative test, Jeremy's Tools/compiler package ran twice as slow (compiling itself) using dynamic as the default. (The static version, which requires a few tweaks to avoid modifying class variables, runs at about the same speed as the classic version.) slot_tp_descr_get(): this also needed fallback behavior. slot_tp_getattro(): remove a debug fprintf() call. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.39 retrieving revision 2.40 diff -C2 -d -r2.39 -r2.40 *** typeobject.c 2001/08/17 11:18:38 2.39 --- typeobject.c 2001/08/17 16:47:50 2.40 *************** *** 567,587 **** } ! /* Should this be a dynamic class (i.e. modifiable __dict__)? */ tmp = PyDict_GetItemString(dict, "__dynamic__"); if (tmp != NULL) { ! /* The class author has a preference */ ! dynamic = PyObject_IsTrue(tmp); ! Py_DECREF(tmp); if (dynamic < 0) ! return NULL; } ! else { ! /* Make a new class dynamic if any of its bases is dynamic. ! This is not always the same as inheriting the __dynamic__ ! class attribute! */ dynamic = 0; for (i = 0; i < nbases; i++) { ! tmptype = (PyTypeObject *)PyTuple_GET_ITEM(bases, i); ! if (tmptype->tp_flags & Py_TPFLAGS_DYNAMICTYPE) { dynamic = 1; break; --- 567,608 ---- } ! /* Should this be a dynamic class (i.e. modifiable __dict__)? ! Look in two places for a variable named __dynamic__: ! 1) in the class dict ! 2) in the module dict (globals) ! The first variable that is an int >= 0 is used. ! Otherwise, a default is calculated from the base classes: ! if any base class is dynamic, this class is dynamic; otherwise ! it is static. */ ! dynamic = -1; /* Not yet determined */ ! /* Look in the class */ tmp = PyDict_GetItemString(dict, "__dynamic__"); if (tmp != NULL) { ! dynamic = PyInt_AsLong(tmp); if (dynamic < 0) ! PyErr_Clear(); } ! if (dynamic < 0) { ! /* Look in the module globals */ ! tmp = PyEval_GetGlobals(); ! if (tmp != NULL) { ! tmp = PyDict_GetItemString(tmp, "__dynamic__"); ! if (tmp != NULL) { ! dynamic = PyInt_AsLong(tmp); ! if (dynamic < 0) ! PyErr_Clear(); ! } ! } ! } ! if (dynamic < 0) { ! /* Make a new class dynamic if any of its bases is ! dynamic. This is not always the same as inheriting ! the __dynamic__ class attribute! */ dynamic = 0; for (i = 0; i < nbases; i++) { ! tmptype = (PyTypeObject *) ! PyTuple_GET_ITEM(bases, i); ! if (tmptype->tp_flags & ! Py_TPFLAGS_DYNAMICTYPE) { dynamic = 1; break; *************** *** 2566,2571 **** if (tp->tp_getattro == slot_tp_getattro) tp->tp_getattro = PyObject_GenericGetAttr; - else - fprintf(stderr, "huh?\n"); return PyObject_GenericGetAttr(self, name); } --- 2587,2590 ---- *************** *** 2673,2677 **** } ! SLOT2(slot_tp_descr_get, "__get__", PyObject *, PyObject *, "OO") static int --- 2692,2717 ---- } ! static PyObject * ! slot_tp_descr_get(PyObject *self, PyObject *obj, PyObject *type) ! { ! PyTypeObject *tp = self->ob_type; ! PyObject *get; ! static PyObject *get_str = NULL; ! ! if (get_str == NULL) { ! get_str = PyString_InternFromString("__get__"); ! if (get_str == NULL) ! return NULL; ! } ! get = _PyType_Lookup(tp, get_str); ! if (get == NULL) { ! /* Avoid further slowdowns */ ! if (tp->tp_descr_get == slot_tp_descr_get) ! tp->tp_descr_get = NULL; ! Py_INCREF(self); ! return self; ! } ! return PyObject_CallFunction(get, "OOO", self, obj, type); ! } static int From fdrake@users.sourceforge.net Fri Aug 17 18:20:46 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 17 Aug 2001 10:20:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/perl SynopsisTable.pm,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory usw-pr-cvs1:/tmp/cvs-serv12295 Modified Files: SynopsisTable.pm Log Message: Make sure that ampersand escaping is still performed on the contents of local module tables (the lists of modules documented within a chapter, inserted at the beginning of the chapter). If this is not done here, the text is not part of the resulting documents when latex2html does the processing normally. This fixes a little bit more of SF bug #451556. Index: SynopsisTable.pm =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/SynopsisTable.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SynopsisTable.pm 2001/05/09 15:32:14 1.7 --- SynopsisTable.pm 2001/08/17 17:20:44 1.8 *************** *** 59,62 **** --- 59,64 ---- my($key,$type,$synopsis) = $self->get($name); my $link = ""; + $synopsis =~ s//%/g; + $synopsis =~ s//\&/g; $data .= (' \n " : '>') From gvanrossum@users.sourceforge.net Fri Aug 17 18:24:31 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 10:24:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib ftplib.py,1.56,1.57 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv13152 Modified Files: ftplib.py Log Message: Change the 227 response parser to use a more liberal regular expression. This is needed for certain servers that (in violation of the standard) don't return the parentheses in the response. This fixes SF bug #441712 by Henrik Weber (not exactly using his patch). Index: ftplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ftplib.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** ftplib.py 2001/07/31 08:40:21 1.56 --- ftplib.py 2001/08/17 17:24:29 1.57 *************** *** 552,555 **** --- 552,557 ---- + _227_re = None + def parse227(resp): '''Parse the '227' response for a PASV request. *************** *** 559,570 **** if resp[:3] != '227': raise error_reply, resp ! left = resp.find('(') ! if left < 0: raise error_proto, resp ! right = resp.find(')', left + 1) ! if right < 0: ! raise error_proto, resp # should contain '(h1,h2,h3,h4,p1,p2)' ! numbers = resp[left+1:right].split(',') ! if len(numbers) != 6: raise error_proto, resp host = '.'.join(numbers[:4]) port = (int(numbers[4]) << 8) + int(numbers[5]) --- 561,572 ---- if resp[:3] != '227': raise error_reply, resp ! global _227_re ! if _227_re is None: ! import re ! _227_re = re.compile(r'(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)') ! m = _227_re.search(resp) ! if not m: raise error_proto, resp + numbers = m.groups() host = '.'.join(numbers[:4]) port = (int(numbers[4]) << 8) + int(numbers[5]) From gvanrossum@users.sourceforge.net Fri Aug 17 18:36:02 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 10:36:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.106,1.107 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv15889 Modified Files: ACKS Log Message: Another contributor's patch got accepted. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** ACKS 2001/08/13 15:00:36 1.106 --- ACKS 2001/08/17 17:36:00 1.107 *************** *** 423,426 **** --- 423,427 ---- Aaron Watters Bob Watson + Henrik Weber Edward Welbourne Rickard Westman From loewis@users.sourceforge.net Fri Aug 17 19:39:27 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 17 Aug 2001 11:39:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.206,1.207 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv28889/Misc Modified Files: NEWS Log Message: Patch #445762: Support --disable-unicode - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** NEWS 2001/08/16 13:14:59 1.206 --- NEWS 2001/08/17 18:39:24 1.207 *************** *** 2,5 **** --- 2,11 ---- =========================== + Build + + - configure supports a new option --enable-unicode, with the values + ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode + type and supporting code is completely removed from the interpreter. + Tools *************** *** 58,61 **** --- 64,73 ---- using at least one of the mangled Unicode APIs in the extension. + - Two new flags METH_NOARGS and METH_O are available in method definition + tables to simplify implementation of methods with no arguments and a + single untyped argument. Calling such methods is more efficient than + calling corresponding METH_VARARGS methods. METH_OLDARGS is now + deprecated. + Windows *************** *** 90,99 **** (These warnings currently don't conform to the warnings framework of PEP 230; we intend to fix this in 2.2a2.) - - - Two new flags METH_NOARGS and METH_O are available in method definition - tables to simplify implementation of methods with no arguments and a - single untyped argument. Calling such methods is more efficient than - calling corresponding METH_VARARGS methods. METH_OLDARGS is now - deprecated. - The UTF-16 codec was modified to be more RFC compliant. It will now --- 102,105 ---- From loewis@users.sourceforge.net Fri Aug 17 19:39:26 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 17 Aug 2001 11:39:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib ConfigParser.py,1.35,1.36 copy.py,1.19,1.20 site.py,1.34,1.35 types.py,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv28889/Lib Modified Files: ConfigParser.py copy.py site.py types.py Log Message: Patch #445762: Support --disable-unicode - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests. Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ConfigParser.py 2001/08/13 14:58:32 1.35 --- ConfigParser.py 2001/08/17 18:39:24 1.36 *************** *** 83,87 **** """ ! import string import re --- 83,87 ---- """ ! import string, types import re *************** *** 223,227 **** filename may also be given. """ ! if type(filenames) in [type(''), type(u'')]: filenames = [filenames] for filename in filenames: --- 223,227 ---- filename may also be given. """ ! if type(filenames) in types.StringTypes: filenames = [filenames] for filename in filenames: Index: copy.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/copy.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** copy.py 2001/01/20 19:54:20 1.19 --- copy.py 2001/08/17 18:39:24 1.20 *************** *** 92,96 **** d[types.FloatType] = _copy_atomic d[types.StringType] = _copy_atomic ! d[types.UnicodeType] = _copy_atomic try: d[types.CodeType] = _copy_atomic --- 92,99 ---- d[types.FloatType] = _copy_atomic d[types.StringType] = _copy_atomic ! try: ! d[types.UnicodeType] = _copy_atomic ! except AttributeError: ! pass try: d[types.CodeType] = _copy_atomic *************** *** 171,175 **** d[types.FloatType] = _deepcopy_atomic d[types.StringType] = _deepcopy_atomic ! d[types.UnicodeType] = _deepcopy_atomic d[types.CodeType] = _deepcopy_atomic d[types.TypeType] = _deepcopy_atomic --- 174,181 ---- d[types.FloatType] = _deepcopy_atomic d[types.StringType] = _deepcopy_atomic ! try: ! d[types.UnicodeType] = _deepcopy_atomic ! except AttributeError: ! pass d[types.CodeType] = _deepcopy_atomic d[types.TypeType] = _deepcopy_atomic Index: site.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** site.py 2001/08/15 21:20:42 1.34 --- site.py 2001/08/17 18:39:24 1.35 *************** *** 306,310 **** if encoding != "ascii": ! sys.setdefaultencoding(encoding) # --- 306,311 ---- if encoding != "ascii": ! # On Non-Unicode builds this will raise an AttributeError... ! sys.setdefaultencoding(encoding) # Needs Python Unicode build ! # Index: types.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/types.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** types.py 2001/08/11 15:02:57 1.19 --- types.py 2001/08/17 18:39:24 1.20 *************** *** 20,24 **** StringType = str ! UnicodeType = unicode BufferType = type(buffer('')) --- 20,29 ---- StringType = str ! try: ! UnicodeType = unicode ! StringTypes = [StringType, UnicodeType] ! except NameError: ! StringTypes = [StringType] ! BufferType = type(buffer('')) From loewis@users.sourceforge.net Fri Aug 17 19:39:26 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 17 Aug 2001 11:39:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include intobject.h,2.21,2.22 longobject.h,2.20,2.21 object.h,2.85,2.86 unicodeobject.h,2.30,2.31 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv28889/Include Modified Files: intobject.h longobject.h object.h unicodeobject.h Log Message: Patch #445762: Support --disable-unicode - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests. Index: intobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/intobject.h,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** intobject.h 2000/09/01 23:29:26 2.21 --- intobject.h 2001/08/17 18:39:24 2.22 *************** *** 31,35 **** --- 31,37 ---- extern DL_IMPORT(PyObject *) PyInt_FromString(char*, char**, int); + #ifdef Py_USING_UNICODE extern DL_IMPORT(PyObject *) PyInt_FromUnicode(Py_UNICODE*, int, int); + #endif extern DL_IMPORT(PyObject *) PyInt_FromLong(long); extern DL_IMPORT(long) PyInt_AsLong(PyObject *); Index: longobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/longobject.h,v retrieving revision 2.20 retrieving revision 2.21 diff -C2 -d -r2.20 -r2.21 *** longobject.h 2001/06/11 21:23:58 2.20 --- longobject.h 2001/08/17 18:39:24 2.21 *************** *** 43,47 **** --- 43,49 ---- DL_IMPORT(PyObject *) PyLong_FromString(char *, char **, int); + #ifdef Py_USING_UNICODE DL_IMPORT(PyObject *) PyLong_FromUnicode(Py_UNICODE*, int, int); + #endif /* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.85 retrieving revision 2.86 diff -C2 -d -r2.85 -r2.86 *** object.h 2001/08/15 18:32:33 2.85 --- object.h 2001/08/17 18:39:24 2.86 *************** *** 321,325 **** --- 321,327 ---- extern DL_IMPORT(PyObject *) PyObject_Repr(PyObject *); extern DL_IMPORT(PyObject *) PyObject_Str(PyObject *); + #ifdef Py_USING_UNICODE extern DL_IMPORT(PyObject *) PyObject_Unicode(PyObject *); + #endif extern DL_IMPORT(int) PyObject_Compare(PyObject *, PyObject *); extern DL_IMPORT(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int); Index: unicodeobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v retrieving revision 2.30 retrieving revision 2.31 diff -C2 -d -r2.30 -r2.31 *** unicodeobject.h 2001/08/09 22:21:55 2.30 --- unicodeobject.h 2001/08/17 18:39:24 2.31 *************** *** 59,62 **** --- 59,68 ---- /* --- Internal Unicode Format -------------------------------------------- */ + #ifndef Py_USING_UNICODE + + #define PyUnicode_Check(op) 0 + + #else + /* FIXME: MvL's new implementation assumes that Py_UNICODE_SIZE is properly set, but the default rules below doesn't set it. I'll *************** *** 1088,1090 **** --- 1094,1097 ---- } #endif + #endif /* Py_USING_UNICODE */ #endif /* !Py_UNICODEOBJECT_H */ From loewis@users.sourceforge.net Fri Aug 17 19:39:26 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 17 Aug 2001 11:39:26 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.52,1.53 configure,1.239,1.240 configure.in,1.247,1.248 setup.py,1.49,1.50 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv28889 Modified Files: Makefile.pre.in configure configure.in setup.py Log Message: Patch #445762: Support --disable-unicode - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Makefile.pre.in 2001/08/17 15:32:31 1.52 --- Makefile.pre.in 2001/08/17 18:39:24 1.53 *************** *** 148,151 **** --- 148,152 ---- DYNLOADFILE= @DYNLOADFILE@ MACHDEP_OBJS= @MACHDEP_OBJS@ + UNICODE_OBJS= @UNICODE_OBJS@ PYTHON= python$(EXE) *************** *** 264,269 **** Objects/tupleobject.o \ Objects/typeobject.o \ ! Objects/unicodeobject.o \ ! Objects/unicodectype.o --- 265,269 ---- Objects/tupleobject.o \ Objects/typeobject.o \ ! $(UNICODE_OBJS) Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.239 retrieving revision 1.240 diff -C2 -d -r1.239 -r1.240 *** configure 2001/08/16 13:14:59 1.239 --- configure 2001/08/17 18:39:24 1.240 *************** *** 6694,6701 **** --- 6694,6704 ---- esac + if test "$enable_unicode" = "no" then + UNICODE_OBJS="" echo "$ac_t""not used" 1>&6 else + UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o" cat >> confdefs.h <<\EOF #define Py_USING_UNICODE 1 *************** *** 6735,6739 **** # check for endianness echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ! echo "configure:6738: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 6738,6742 ---- # check for endianness echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ! echo "configure:6741: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 6742,6746 **** # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < --- 6745,6749 ---- # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < *************** *** 6753,6761 **** ; return 0; } EOF ! if { (eval echo configure:6756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < --- 6756,6764 ---- ; return 0; } EOF ! if { (eval echo configure:6759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < *************** *** 6768,6772 **** ; return 0; } EOF ! if { (eval echo configure:6771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes --- 6771,6775 ---- ; return 0; } EOF ! if { (eval echo configure:6774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes *************** *** 6788,6792 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no --- 6804,6808 ---- } EOF ! if { (eval echo configure:6807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no *************** *** 6828,6832 **** # or fills with zeros (like the Cray J90, according to Tim Peters). echo $ac_n "checking whether right shift extends the sign bit""... $ac_c" 1>&6 ! echo "configure:6831: checking whether right shift extends the sign bit" >&5 if eval "test \"`echo '$''{'ac_cv_rshift_extends_sign'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 6831,6835 ---- # or fills with zeros (like the Cray J90, according to Tim Peters). echo $ac_n "checking whether right shift extends the sign bit""... $ac_c" 1>&6 ! echo "configure:6834: checking whether right shift extends the sign bit" >&5 if eval "test \"`echo '$''{'ac_cv_rshift_extends_sign'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 6837,6841 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_rshift_extends_sign=yes --- 6849,6853 ---- EOF ! if { (eval echo configure:6852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_rshift_extends_sign=yes *************** *** 6871,6875 **** # check for getc_unlocked and related locking functions echo $ac_n "checking for getc_unlocked() and friends""... $ac_c" 1>&6 ! echo "configure:6874: checking for getc_unlocked() and friends" >&5 if eval "test \"`echo '$''{'ac_cv_have_getc_unlocked'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 6874,6878 ---- # check for getc_unlocked and related locking functions echo $ac_n "checking for getc_unlocked() and friends""... $ac_c" 1>&6 ! echo "configure:6877: checking for getc_unlocked() and friends" >&5 if eval "test \"`echo '$''{'ac_cv_have_getc_unlocked'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 6877,6881 **** cat > conftest.$ac_ext < --- 6880,6884 ---- cat > conftest.$ac_ext < *************** *** 6889,6893 **** ; return 0; } EOF ! if { (eval echo configure:6892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_have_getc_unlocked=yes --- 6892,6896 ---- ; return 0; } EOF ! if { (eval echo configure:6895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_have_getc_unlocked=yes *************** *** 6912,6916 **** # check for readline 4.2 echo $ac_n "checking for rl_completion_matches in -lreadline""... $ac_c" 1>&6 ! echo "configure:6915: checking for rl_completion_matches in -lreadline" >&5 ac_lib_var=`echo readline'_'rl_completion_matches | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 6915,6919 ---- # check for readline 4.2 echo $ac_n "checking for rl_completion_matches in -lreadline""... $ac_c" 1>&6 ! echo "configure:6918: checking for rl_completion_matches in -lreadline" >&5 ac_lib_var=`echo readline'_'rl_completion_matches | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 6920,6924 **** LIBS="-lreadline -ltermcap $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 6934,6938 ---- ; return 0; } EOF ! if { (eval echo configure:6937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 6956,6960 **** echo $ac_n "checking for broken nice()""... $ac_c" 1>&6 ! echo "configure:6959: checking for broken nice()" >&5 if eval "test \"`echo '$''{'ac_cv_broken_nice'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 6959,6963 ---- echo $ac_n "checking for broken nice()""... $ac_c" 1>&6 ! echo "configure:6962: checking for broken nice()" >&5 if eval "test \"`echo '$''{'ac_cv_broken_nice'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 6965,6969 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_broken_nice=yes --- 6980,6984 ---- EOF ! if { (eval echo configure:6983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_broken_nice=yes *************** *** 7008,7017 **** EOF echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 ! echo "configure:7011: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 7011,7020 ---- EOF echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 ! echo "configure:7014: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7062,7066 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7065: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7065,7069 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7068: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then *************** *** 7253,7256 **** --- 7256,7260 ---- s%@LIBM@%$LIBM%g s%@LIBC@%$LIBC%g + s%@UNICODE_OBJS@%$UNICODE_OBJS%g s%@SRCDIRS@%$SRCDIRS%g Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.247 retrieving revision 1.248 diff -C2 -d -r1.247 -r1.248 *** configure.in 2001/08/15 17:14:32 1.247 --- configure.in 2001/08/17 18:39:24 1.248 *************** *** 1681,1688 **** --- 1681,1691 ---- esac + AC_SUBST(UNICODE_OBJS) if test "$enable_unicode" = "no" then + UNICODE_OBJS="" AC_MSG_RESULT(not used) else + UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o" AC_DEFINE(Py_USING_UNICODE) if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** setup.py 2001/08/16 20:30:18 1.49 --- setup.py 2001/08/17 18:39:24 1.50 *************** *** 186,189 **** --- 186,194 ---- self.compiler.include_dirs.insert(0, '/usr/local/include' ) + try: + have_unicode = unicode + except NameError: + have_unicode = 0 + # lib_dirs and inc_dirs are used to search for files; # if a file is found in one of those directories, it can *************** *** 236,240 **** exts.append( Extension('_testcapi', ['_testcapimodule.c']) ) # static Unicode character database ! exts.append( Extension('unicodedata', ['unicodedata.c']) ) # access to ISO C locale support exts.append( Extension('_locale', ['_localemodule.c']) ) --- 241,246 ---- exts.append( Extension('_testcapi', ['_testcapimodule.c']) ) # static Unicode character database ! if have_unicode: ! exts.append( Extension('unicodedata', ['unicodedata.c']) ) # access to ISO C locale support exts.append( Extension('_locale', ['_localemodule.c']) ) From loewis@users.sourceforge.net Fri Aug 17 19:39:27 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 17 Aug 2001 11:39:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _codecsmodule.c,2.8,2.9 _sre.c,2.62,2.63 _tkinter.c,1.118,1.119 cPickle.c,2.61,2.62 pyexpat.c,2.47,2.48 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv28889/Modules Modified Files: _codecsmodule.c _sre.c _tkinter.c cPickle.c pyexpat.c Log Message: Patch #445762: Support --disable-unicode - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests. Index: _codecsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_codecsmodule.c,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** _codecsmodule.c 2001/06/26 15:11:00 2.8 --- _codecsmodule.c 2001/08/17 18:39:25 2.9 *************** *** 72,75 **** --- 72,76 ---- } + #ifdef Py_USING_UNICODE /* --- Helpers ------------------------------------------------------------ */ *************** *** 622,625 **** --- 623,627 ---- #endif /* MS_WIN32 */ + #endif /* Py_USING_UNICODE */ /* --- Module API --------------------------------------------------------- */ *************** *** 628,631 **** --- 630,634 ---- {"register", codecregister, 1}, {"lookup", codeclookup, 1}, + #ifdef Py_USING_UNICODE {"utf_8_encode", utf_8_encode, 1}, {"utf_8_decode", utf_8_decode, 1}, *************** *** 655,658 **** --- 658,662 ---- {"mbcs_decode", mbcs_decode, 1}, #endif + #endif /* Py_USING_UNICODE */ {NULL, NULL} /* sentinel */ }; Index: _sre.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v retrieving revision 2.62 retrieving revision 2.63 diff -C2 -d -r2.62 -r2.63 *** _sre.c 2001/08/16 20:33:48 2.62 --- _sre.c 2001/08/17 18:39:25 2.63 *************** *** 64,68 **** #undef VERBOSE ! #if PY_VERSION_HEX >= 0x01060000 /* defining this enables unicode support (default under 1.6a1 and later) */ #define HAVE_UNICODE --- 64,68 ---- #undef VERBOSE ! #if PY_VERSION_HEX >= 0x01060000 && defined(Py_USING_UNICODE) /* defining this enables unicode support (default under 1.6a1 and later) */ #define HAVE_UNICODE Index: _tkinter.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** _tkinter.c 2001/08/07 15:32:37 1.118 --- _tkinter.c 2001/08/17 18:39:25 1.119 *************** *** 256,259 **** --- 256,260 ---- if (PyString_Check(value)) return PyString_AsString(value); + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(value)) { PyObject *v = PyUnicode_AsUTF8String(value); *************** *** 267,270 **** --- 268,272 ---- return PyString_AsString(v); } + #endif else { PyObject *v = PyObject_Str(value); *************** *** 521,524 **** --- 523,527 ---- return result; } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(value)) { #if TKMAJORMINOR <= 8001 *************** *** 543,546 **** --- 546,550 ---- #endif /* TKMAJORMINOR > 8001 */ } + #endif else { PyObject *v = PyObject_Str(value); *************** *** 617,622 **** --- 621,628 ---- char *s = Tcl_GetStringResult(interp); char *p = s; + /* If the result contains any bytes with the top bit set, it's UTF-8 and we should decode it to Unicode */ + #ifdef Py_USING_UNICODE while (*p != '\0') { if (*p & 0x80) *************** *** 624,627 **** --- 630,634 ---- p++; } + if (*p == '\0') res = PyString_FromStringAndSize(s, (int)(p-s)); *************** *** 635,638 **** --- 642,649 ---- } } + #else + p = strchr(p, '\0'); + res = PyString_FromStringAndSize(s, (int)(p-s)); + #endif } Index: cPickle.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v retrieving revision 2.61 retrieving revision 2.62 diff -C2 -d -r2.61 -r2.62 *** cPickle.c 2001/08/02 04:15:00 2.61 --- cPickle.c 2001/08/17 18:39:25 2.62 *************** *** 1173,1176 **** --- 1173,1177 ---- + #ifdef Py_USING_UNICODE /* A copy of PyUnicode_EncodeRawUnicodeEscape() that also translates backslash and newline characters to \uXXXX escapes. */ *************** *** 1290,1293 **** --- 1291,1295 ---- return -1; } + #endif *************** *** 1825,1828 **** --- 1827,1831 ---- } + #ifdef Py_USING_UNICODE case 'u': if ((type == &PyUnicode_Type) && (PyString_GET_SIZE(args) < 2)) { *************** *** 1830,1833 **** --- 1833,1837 ---- goto finally; } + #endif } *************** *** 1858,1861 **** --- 1862,1866 ---- break; + #ifdef Py_USING_UNICODE case 'u': if (type == &PyUnicode_Type) { *************** *** 1864,1867 **** --- 1869,1873 ---- } break; + #endif case 't': *************** *** 2819,2822 **** --- 2825,2829 ---- + #ifdef Py_USING_UNICODE static int load_unicode(Unpicklerobject *self) { *************** *** 2837,2842 **** --- 2844,2851 ---- return res; } + #endif + #ifdef Py_USING_UNICODE static int load_binunicode(Unpicklerobject *self) { *************** *** 2858,2861 **** --- 2867,2871 ---- return 0; } + #endif *************** *** 3616,3619 **** --- 3626,3630 ---- continue; + #ifdef Py_USING_UNICODE case UNICODE: if (load_unicode(self) < 0) *************** *** 3625,3628 **** --- 3636,3640 ---- break; continue; + #endif case EMPTY_TUPLE: *************** *** 3906,3909 **** --- 3918,3922 ---- continue; + #ifdef Py_USING_UNICODE case UNICODE: if (load_unicode(self) < 0) *************** *** 3915,3918 **** --- 3928,3932 ---- break; continue; + #endif case EMPTY_TUPLE: Index: pyexpat.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v retrieving revision 2.47 retrieving revision 2.48 diff -C2 -d -r2.47 -r2.48 *** pyexpat.c 2001/07/28 09:36:36 2.47 --- pyexpat.c 2001/08/17 18:39:25 2.48 *************** *** 29,32 **** --- 29,37 ---- #endif + #if (PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION > 5) || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 2) + /* In Python 1.6, 2.0 and 2.1, disabling Unicode was not possible. */ + #define Py_USING_UNICODE + #endif + enum HandlerTypes { StartElement, *************** *** 174,178 **** #endif ! #if !(PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6) #if EXPAT_VERSION == 0x010200 static PyObject * --- 179,183 ---- #endif ! #ifdef Py_USING_UNICODE #if EXPAT_VERSION == 0x010200 static PyObject * *************** *** 371,375 **** } ! #if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6 #define STRING_CONV_FUNC conv_string_to_utf8 #else --- 376,380 ---- } ! #ifndef Py_USING_UNICODE #define STRING_CONV_FUNC conv_string_to_utf8 #else *************** *** 507,511 **** ("(O&O&)",STRING_CONV_FUNC,target, STRING_CONV_FUNC,data)) ! #if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6 VOID_HANDLER(CharacterData, (void *userData, const XML_Char *data, int len), --- 512,516 ---- ("(O&O&)",STRING_CONV_FUNC,target, STRING_CONV_FUNC,data)) ! #ifndef Py_USING_UNICODE VOID_HANDLER(CharacterData, (void *userData, const XML_Char *data, int len), *************** *** 532,536 **** #if EXPAT_VERSION >= 0x015f00 ! #if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6 VOID_HANDLER(EntityDecl, (void *userData, --- 537,541 ---- #if EXPAT_VERSION >= 0x015f00 ! #ifndef Py_USING_UNICODE VOID_HANDLER(EntityDecl, (void *userData, *************** *** 609,613 **** } ! #if !(PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6) static PyObject * conv_content_model_unicode(XML_Content * const model) --- 614,618 ---- } ! #ifdef Py_USING_UNICODE static PyObject * conv_content_model_unicode(XML_Content * const model) *************** *** 679,683 **** ("()")) ! #if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6 VOID_HANDLER(Default, (void *userData, const XML_Char *s, int len), --- 684,688 ---- ("()")) ! #ifndef Py_USING_UNICODE VOID_HANDLER(Default, (void *userData, const XML_Char *s, int len), *************** *** 1065,1069 **** ! #if !(PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6) /* --- 1070,1074 ---- ! #ifdef Py_USING_UNICODE /* *************** *** 1159,1164 **** } XML_SetUserData(self->itself, (void *)self); ! #if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6 ! #else XML_SetUnknownEncodingHandler(self->itself, (XML_UnknownEncodingHandler) PyUnknownEncodingHandler, NULL); #endif --- 1164,1168 ---- } XML_SetUserData(self->itself, (void *)self); ! #ifdef Py_USING_UNICODE XML_SetUnknownEncodingHandler(self->itself, (XML_UnknownEncodingHandler) PyUnknownEncodingHandler, NULL); #endif *************** *** 1293,1297 **** if (strcmp(name, "returns_unicode") == 0) { if (PyObject_IsTrue(v)) { ! #if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6 PyErr_SetString(PyExc_ValueError, "Cannot return Unicode strings in Python 1.5"); --- 1297,1301 ---- if (strcmp(name, "returns_unicode") == 0) { if (PyObject_IsTrue(v)) { ! #ifndef Py_USING_UNICODE PyErr_SetString(PyExc_ValueError, "Cannot return Unicode strings in Python 1.5"); *************** *** 1546,1551 **** } #endif ! #if PY_MAJOR_VERSION == 1 && PY_MINOR_VERSION < 6 ! #else init_template_buffer(); #endif --- 1550,1554 ---- } #endif ! #ifdef Py_USING_UNICODE init_template_buffer(); #endif From loewis@users.sourceforge.net Fri Aug 17 19:39:27 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 17 Aug 2001 11:39:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test pickletester.py,1.6,1.7 string_tests.py,1.9,1.10 test_b1.py,1.37,1.38 test_contains.py,1.7,1.8 test_format.py,1.11,1.12 test_iter.py,1.17,1.18 test_pprint.py,1.4,1.5 test_sre.py,1.26,1.27 test_support.py,1.24,1.25 test_winreg.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv28889/Lib/test Modified Files: pickletester.py string_tests.py test_b1.py test_contains.py test_format.py test_iter.py test_pprint.py test_sre.py test_support.py test_winreg.py Log Message: Patch #445762: Support --disable-unicode - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests. Index: pickletester.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/pickletester.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pickletester.py 2001/04/16 00:28:21 1.6 --- pickletester.py 2001/08/17 18:39:24 1.7 *************** *** 1,5 **** # test_pickle and test_cpickle both use this. ! from test_support import TestFailed import sys --- 1,5 ---- # test_pickle and test_cpickle both use this. ! from test_support import TestFailed, have_unicode import sys *************** *** 192,196 **** # Test some Unicode end cases ! endcases = [u'', u'<\\u>', u'<\\\u1234>', u'<\n>', u'<\\>'] for u in endcases: try: --- 192,200 ---- # Test some Unicode end cases ! if have_unicode: ! endcases = [unicode(''), unicode('<\\u>'), unicode('<\\\u1234>'), ! unicode('<\n>'), unicode('<\\>')] ! else: ! endcases = [] for u in endcases: try: Index: string_tests.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/string_tests.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** string_tests.py 2001/05/15 11:58:06 1.9 --- string_tests.py 2001/08/17 18:39:24 1.10 *************** *** 2,6 **** import string ! from test_support import verify, verbose, TestFailed transtable = '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377' --- 2,6 ---- import string ! from test_support import verify, verbose, TestFailed, have_unicode transtable = '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377' *************** *** 126,134 **** test('join', 'a', 'abc', ('abc',)) test('join', 'a', 'z', UserList(['z'])) ! test('join', u'.', u'a.b.c', ['a', 'b', 'c']) ! test('join', '.', u'a.b.c', [u'a', 'b', 'c']) ! test('join', '.', u'a.b.c', ['a', u'b', 'c']) ! test('join', '.', u'a.b.c', ['a', 'b', u'c']) ! test('join', '.', TypeError, ['a', u'b', 3]) for i in [5, 25, 125]: test('join', '-', ((('a' * i) + '-') * i)[:-1], --- 126,135 ---- test('join', 'a', 'abc', ('abc',)) test('join', 'a', 'z', UserList(['z'])) ! if have_unicode: ! test('join', unicode('.'), unicode('a.b.c'), ['a', 'b', 'c']) ! test('join', '.', unicode('a.b.c'), [unicode('a'), 'b', 'c']) ! test('join', '.', unicode('a.b.c'), ['a', unicode('b'), 'c']) ! test('join', '.', unicode('a.b.c'), ['a', 'b', unicode('c')]) ! test('join', '.', TypeError, ['a', unicode('b'), 3]) for i in [5, 25, 125]: test('join', '-', ((('a' * i) + '-') * i)[:-1], Index: test_b1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b1.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** test_b1.py 2001/07/30 22:49:11 1.37 --- test_b1.py 2001/08/17 18:39:24 1.38 *************** *** 120,124 **** if complex(0.0, 3.14) != 3.14j: raise TestFailed, 'complex(0.0, 3.14)' if complex(" 3.14+J ") != 3.14+1j: raise TestFailed, 'complex(" 3.14+J )"' ! if complex(u" 3.14+J ") != 3.14+1j: raise TestFailed, 'complex(u" 3.14+J )"' class Z: def __complex__(self): return 3.14j --- 120,126 ---- if complex(0.0, 3.14) != 3.14j: raise TestFailed, 'complex(0.0, 3.14)' if complex(" 3.14+J ") != 3.14+1j: raise TestFailed, 'complex(" 3.14+J )"' ! if have_unicode: ! if complex(unicode(" 3.14+J ")) != 3.14+1j: ! raise TestFailed, 'complex(u" 3.14+J )"' class Z: def __complex__(self): return 3.14j *************** *** 175,190 **** if eval('c', globals, locals) != 300: raise TestFailed, "eval(4)" ! if eval(u'1+1') != 2: raise TestFailed, 'eval(u\'1+1\')' ! if eval(u' 1+1\n') != 2: raise TestFailed, 'eval(u\' 1+1\\n\')' globals = {'a': 1, 'b': 2} locals = {'b': 200, 'c': 300} ! if eval(u'a', globals) != 1: ! raise TestFailed, "eval(1) == %s" % eval(u'a', globals) ! if eval(u'a', globals, locals) != 1: ! raise TestFailed, "eval(2)" ! if eval(u'b', globals, locals) != 200: ! raise TestFailed, "eval(3)" ! if eval(u'c', globals, locals) != 300: ! raise TestFailed, "eval(4)" print 'execfile' --- 177,194 ---- if eval('c', globals, locals) != 300: raise TestFailed, "eval(4)" ! if have_unicode: ! if eval(unicode('1+1')) != 2: raise TestFailed, 'eval(u\'1+1\')' ! if eval(unicode(' 1+1\n')) != 2: raise TestFailed, 'eval(u\' 1+1\\n\')' globals = {'a': 1, 'b': 2} locals = {'b': 200, 'c': 300} ! if have_unicode: ! if eval(unicode('a'), globals) != 1: ! raise TestFailed, "eval(1) == %s" % eval(unicode('a'), globals) ! if eval(unicode('a'), globals, locals) != 1: ! raise TestFailed, "eval(2)" ! if eval(unicode('b'), globals, locals) != 200: ! raise TestFailed, "eval(3)" ! if eval(unicode('c'), globals, locals) != 300: ! raise TestFailed, "eval(4)" print 'execfile' *************** *** 250,256 **** if float(314L) != 314.0: raise TestFailed, 'float(314L)' if float(" 3.14 ") != 3.14: raise TestFailed, 'float(" 3.14 ")' ! if float(u" 3.14 ") != 3.14: raise TestFailed, 'float(u" 3.14 ")' ! if float(u" \u0663.\u0661\u0664 ") != 3.14: ! raise TestFailed, 'float(u" \u0663.\u0661\u0664 ")' print 'getattr' --- 254,262 ---- if float(314L) != 314.0: raise TestFailed, 'float(314L)' if float(" 3.14 ") != 3.14: raise TestFailed, 'float(" 3.14 ")' ! if have_unicode: ! if float(unicode(" 3.14 ")) != 3.14: ! raise TestFailed, 'float(u" 3.14 ")' ! if float(unicode(" \u0663.\u0661\u0664 ")) != 3.14: ! raise TestFailed, 'float(u" \u0663.\u0661\u0664 ")' print 'getattr' *************** *** 325,329 **** # Different base: if int("10",16) != 16L: raise TestFailed, 'int("10",16)' ! if int(u"10",16) != 16L: raise TestFailed, 'int(u"10",16)' # Test conversion from strings and various anomalies L = [ --- 331,337 ---- # Different base: if int("10",16) != 16L: raise TestFailed, 'int("10",16)' ! if have_unicode: ! if int(unicode("10"),16) != 16L: ! raise TestFailed, 'int(u"10",16)' # Test conversion from strings and various anomalies L = [ *************** *** 344,364 **** ('', ValueError), (' ', ValueError), ! (' \t\t ', ValueError), ! (u'0', 0), ! (u'1', 1), ! (u'9', 9), ! (u'10', 10), ! (u'99', 99), ! (u'100', 100), ! (u'314', 314), ! (u' 314', 314), ! (u'\u0663\u0661\u0664 ', 314), ! (u' \t\t 314 \t\t ', 314), ! (u' 1x', ValueError), ! (u' 1 ', 1), ! (u' 1\02 ', ValueError), ! (u'', ValueError), ! (u' ', ValueError), ! (u' \t\t ', ValueError), ] for s, v in L: --- 352,375 ---- ('', ValueError), (' ', ValueError), ! (' \t\t ', ValueError) ! ] ! if have_unicode: ! L += [ ! (unicode('0'), 0), ! (unicode('1'), 1), ! (unicode('9'), 9), ! (unicode('10'), 10), ! (unicode('99'), 99), ! (unicode('100'), 100), ! (unicode('314'), 314), ! (unicode(' 314'), 314), ! (unicode('\u0663\u0661\u0664 '), 314), ! (unicode(' \t\t 314 \t\t '), 314), ! (unicode(' 1x'), ValueError), ! (unicode(' 1 '), 1), ! (unicode(' 1\02 '), ValueError), ! (unicode(''), ValueError), ! (unicode(' '), ValueError), ! (unicode(' \t\t '), ValueError), ] for s, v in L: *************** *** 461,474 **** if long(-3.5) != -3L: raise TestFailed, 'long(-3.5)' if long("-3") != -3L: raise TestFailed, 'long("-3")' ! if long(u"-3") != -3L: raise TestFailed, 'long(u"-3")' # Different base: if long("10",16) != 16L: raise TestFailed, 'long("10",16)' ! if long(u"10",16) != 16L: raise TestFailed, 'long(u"10",16)' # Check conversions from string (same test set as for int(), and then some) LL = [ ('1' + '0'*20, 10L**20), ! ('1' + '0'*100, 10L**100), ! (u'1' + u'0'*20, 10L**20), ! (u'1' + u'0'*100, 10L**100), ] for s, v in L + LL: --- 472,492 ---- if long(-3.5) != -3L: raise TestFailed, 'long(-3.5)' if long("-3") != -3L: raise TestFailed, 'long("-3")' ! if have_unicode: ! if long(unicode("-3")) != -3L: ! raise TestFailed, 'long(u"-3")' # Different base: if long("10",16) != 16L: raise TestFailed, 'long("10",16)' ! if have_unicode: ! if long(unicode("10"),16) != 16L: ! raise TestFailed, 'long(u"10",16)' # Check conversions from string (same test set as for int(), and then some) LL = [ ('1' + '0'*20, 10L**20), ! ('1' + '0'*100, 10L**100) ! ] ! if have_unicode: ! L+=[ ! (unicode('1') + unicode('0')*20, 10L**20), ! (unicode('1') + unicode('0')*100, 10L**100), ] for s, v in L + LL: Index: test_contains.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_contains.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_contains.py 2001/05/05 10:06:14 1.7 --- test_contains.py 2001/08/17 18:39:24 1.8 *************** *** 1,3 **** ! from test_support import TestFailed class base_set: --- 1,3 ---- ! from test_support import TestFailed, have_unicode class base_set: *************** *** 64,123 **** pass - # Test char in Unicode ! check('c' in u'abc', "'c' not in u'abc'") ! check('d' not in u'abc', "'d' in u'abc'") ! try: ! '' in u'abc' ! check(0, "'' in u'abc' did not raise error") ! except TypeError: ! pass ! try: ! 'ab' in u'abc' ! check(0, "'ab' in u'abc' did not raise error") ! except TypeError: ! pass ! try: ! None in u'abc' ! check(0, "None in u'abc' did not raise error") ! except TypeError: ! pass ! # Test Unicode char in Unicode ! check(u'c' in u'abc', "u'c' not in u'abc'") ! check(u'd' not in u'abc', "u'd' in u'abc'") ! try: ! u'' in u'abc' ! check(0, "u'' in u'abc' did not raise error") ! except TypeError: ! pass ! try: ! u'ab' in u'abc' ! check(0, "u'ab' in u'abc' did not raise error") ! except TypeError: ! pass ! # Test Unicode char in string ! check(u'c' in 'abc', "u'c' not in 'abc'") ! check(u'd' not in 'abc', "u'd' in 'abc'") ! try: ! u'' in 'abc' ! check(0, "u'' in 'abc' did not raise error") ! except TypeError: ! pass ! try: ! u'ab' in 'abc' ! check(0, "u'ab' in 'abc' did not raise error") ! except TypeError: ! pass # A collection of tests on builtin sequence types --- 64,126 ---- pass ! if have_unicode: ! # Test char in Unicode ! check('c' in unicode('abc'), "'c' not in u'abc'") ! check('d' not in unicode('abc'), "'d' in u'abc'") ! try: ! '' in unicode('abc') ! check(0, "'' in u'abc' did not raise error") ! except TypeError: ! pass ! try: ! 'ab' in unicode('abc') ! check(0, "'ab' in u'abc' did not raise error") ! except TypeError: ! pass ! try: ! None in unicode('abc') ! check(0, "None in u'abc' did not raise error") ! except TypeError: ! pass ! # Test Unicode char in Unicode ! check(unicode('c') in unicode('abc'), "u'c' not in u'abc'") ! check(unicode('d') not in unicode('abc'), "u'd' in u'abc'") ! try: ! unicode('') in unicode('abc') ! check(0, "u'' in u'abc' did not raise error") ! except TypeError: ! pass ! try: ! unicode('ab') in unicode('abc') ! check(0, "u'ab' in u'abc' did not raise error") ! except TypeError: ! pass ! # Test Unicode char in string ! check(unicode('c') in 'abc', "u'c' not in 'abc'") ! check(unicode('d') not in 'abc', "u'd' in 'abc'") ! ! try: ! unicode('') in 'abc' ! check(0, "u'' in 'abc' did not raise error") ! except TypeError: ! pass ! ! try: ! unicode('ab') in 'abc' ! check(0, "u'ab' in 'abc' did not raise error") ! except TypeError: ! pass # A collection of tests on builtin sequence types Index: test_format.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_format.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_format.py 2001/04/12 18:38:48 1.11 --- test_format.py 2001/08/17 18:39:24 1.12 *************** *** 1,3 **** ! from test_support import verbose import sys --- 1,3 ---- ! from test_support import verbose, have_unicode import sys *************** *** 35,39 **** def testboth(formatstr, *args): testformat(formatstr, *args) ! testformat(unicode(formatstr), *args) --- 35,40 ---- def testboth(formatstr, *args): testformat(formatstr, *args) ! if have_unicode: ! testformat(unicode(formatstr), *args) *************** *** 213,216 **** test_exc('abc %a', 1, ValueError, "unsupported format character 'a' (0x61) at index 5") ! test_exc(u'abc %\u3000', 1, ValueError, ! "unsupported format character '?' (0x3000) at index 5") --- 214,218 ---- test_exc('abc %a', 1, ValueError, "unsupported format character 'a' (0x61) at index 5") ! if have_unicode: ! test_exc(unicode('abc %\u3000'), 1, ValueError, ! "unsupported format character '?' (0x3000) at index 5") Index: test_iter.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_iter.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test_iter.py 2001/06/21 02:49:54 1.17 --- test_iter.py 2001/08/17 18:39:24 1.18 *************** *** 2,6 **** import unittest ! from test_support import run_unittest, TESTFN, unlink # Test result of triple loop (too big to inline) --- 2,6 ---- import unittest ! from test_support import run_unittest, TESTFN, unlink, have_unicode # Test result of triple loop (too big to inline) *************** *** 215,220 **** # Test a Unicode string ! def test_iter_unicode(self): ! self.check_for_loop(iter(u"abcde"), [u"a", u"b", u"c", u"d", u"e"]) # Test a directory --- 215,223 ---- # Test a Unicode string ! if have_unicode: ! def test_iter_unicode(self): ! self.check_for_loop(iter(unicode("abcde")), ! [unicode("a"), unicode("b"), unicode("c"), ! unicode("d"), unicode("e")]) # Test a directory *************** *** 478,481 **** --- 481,485 ---- self.assertEqual(reduce(add, d), "".join(d.keys())) + # This test case will be removed if we don't have Unicode def test_unicode_join_endcase(self): *************** *** 494,498 **** self.i = i+1 if i == 2: ! return u"fooled you!" return self.it.next() --- 498,502 ---- self.i = i+1 if i == 2: ! return unicode("fooled you!") return self.it.next() *************** *** 511,515 **** try: got = " - ".join(OhPhooey(f)) ! self.assertEqual(got, u"a\n - b\n - fooled you! - c\n") finally: f.close() --- 515,519 ---- try: got = " - ".join(OhPhooey(f)) ! self.assertEqual(got, unicode("a\n - b\n - fooled you! - c\n")) finally: f.close() *************** *** 518,521 **** --- 522,527 ---- except OSError: pass + if not have_unicode: + def test_unicode_join_endcase(self): pass # Test iterators with 'x in y' and 'x not in y'. Index: test_pprint.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pprint.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_pprint.py 2001/05/14 19:15:23 1.4 --- test_pprint.py 2001/08/17 18:39:24 1.5 *************** *** 4,7 **** --- 4,12 ---- import test_support + try: + uni = unicode + except NameError: + def uni(x):return x + class QueryTestCase(unittest.TestCase): *************** *** 15,19 **** """Verify .isrecursive() and .isreadable() w/o recursion.""" verify = self.assert_ ! for safe in (2, 2.0, 2j, "abc", [3], (2,2), {3: 3}, u"yaddayadda", self.a, self.b): verify(not pprint.isrecursive(safe), --- 20,24 ---- """Verify .isrecursive() and .isreadable() w/o recursion.""" verify = self.assert_ ! for safe in (2, 2.0, 2j, "abc", [3], (2,2), {3: 3}, uni("yaddayadda"), self.a, self.b): verify(not pprint.isrecursive(safe), *************** *** 59,64 **** "Simple objects and small containers that should be same as repr()." verify = self.assert_ ! for simple in (0, 0L, 0+0j, 0.0, "", u"", (), [], {}, verify, pprint, ! -6, -6L, -6-6j, -1.5, "x", u"x", (3,), [3], {3: 6}, (1,2), [3,4], {5: 6, 7: 8}, {"xy\tab\n": (3,), 5: [[]], (): {}}, --- 64,69 ---- "Simple objects and small containers that should be same as repr()." verify = self.assert_ ! for simple in (0, 0L, 0+0j, 0.0, "", uni(""), (), [], {}, verify, pprint, ! -6, -6L, -6-6j, -1.5, "x", uni("x"), (3,), [3], {3: 6}, (1,2), [3,4], {5: 6, 7: 8}, {"xy\tab\n": (3,), 5: [[]], (): {}}, Index: test_sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** test_sre.py 2001/08/10 14:52:48 1.26 --- test_sre.py 2001/08/17 18:39:24 1.27 *************** *** 7,11 **** sys.path=['.']+sys.path ! from test_support import verbose, TestFailed import sre import sys, os, string, traceback --- 7,11 ---- sys.path=['.']+sys.path ! from test_support import verbose, TestFailed, have_unicode import sre import sys, os, string, traceback *************** *** 379,384 **** # Try the match with UNICODE locale enabled, and check # that it still succeeds. ! obj=sre.compile(pattern, sre.UNICODE) ! result=obj.search(s) ! if result==None: ! print '=== Fails on unicode-sensitive match', t --- 379,385 ---- # Try the match with UNICODE locale enabled, and check # that it still succeeds. ! if have_unicode: ! obj=sre.compile(pattern, sre.UNICODE) ! result=obj.search(s) ! if result==None: ! print '=== Fails on unicode-sensitive match', t Index: test_support.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** test_support.py 2001/07/16 18:51:32 1.24 --- test_support.py 2001/08/17 18:39:24 1.25 *************** *** 57,60 **** --- 57,66 ---- return cmp(x, y) + try: + unicode + have_unicode = 1 + except NameError: + have_unicode = 0 + import os # Filename used for testing *************** *** 65,71 **** TESTFN = '@test' # Unicode name only used if TEST_FN_ENCODING exists for the platform. ! TESTFN_UNICODE=u"@test-\xe0\xf2" # 2 latin characters. ! if os.name=="nt": ! TESTFN_ENCODING="mbcs" else: TESTFN = 'test' --- 71,78 ---- TESTFN = '@test' # Unicode name only used if TEST_FN_ENCODING exists for the platform. ! if have_unicode: ! TESTFN_UNICODE=unicode("@test-\xe0\xf2", "latin-1") # 2 latin characters. ! if os.name=="nt": ! TESTFN_ENCODING="mbcs" else: TESTFN = 'test' Index: test_winreg.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_winreg.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_winreg.py 2001/01/17 21:51:36 1.9 --- test_winreg.py 2001/08/17 18:39:24 1.10 *************** *** 5,9 **** import os, sys ! from test_support import verify test_key_name = "SOFTWARE\\Python Registry Test Key - Delete Me" --- 5,9 ---- import os, sys ! from test_support import verify, have_unicode test_key_name = "SOFTWARE\\Python Registry Test Key - Delete Me" *************** *** 12,23 **** ("Int Value", 45, REG_DWORD), ("String Val", "A string value", REG_SZ,), - (u"Unicode Val", u"A Unicode value", REG_SZ,), ("StringExpand", "The path is %path%", REG_EXPAND_SZ), - ("UnicodeExpand", u"The path is %path%", REG_EXPAND_SZ), ("Multi-string", ["Lots", "of", "string", "values"], REG_MULTI_SZ), - ("Multi-unicode", [u"Lots", u"of", u"unicode", u"values"], REG_MULTI_SZ), - ("Multi-mixed", [u"Unicode", u"and", "string", "values"],REG_MULTI_SZ), ("Raw Data", ("binary"+chr(0)+"data"), REG_BINARY), ] def WriteTestData(root_key): --- 12,26 ---- ("Int Value", 45, REG_DWORD), ("String Val", "A string value", REG_SZ,), ("StringExpand", "The path is %path%", REG_EXPAND_SZ), ("Multi-string", ["Lots", "of", "string", "values"], REG_MULTI_SZ), ("Raw Data", ("binary"+chr(0)+"data"), REG_BINARY), ] + if have_unicode: + test_data+=[ + (unicode("Unicode Val"), unicode("A Unicode value"), REG_SZ,), + ("UnicodeExpand", unicode("The path is %path%"), REG_EXPAND_SZ), + ("Multi-unicode", [unicode("Lots"), unicode("of"), unicode("unicode"), unicode("values")], REG_MULTI_SZ), + ("Multi-mixed", [unicode("Unicode"), unicode("and"), "string", "values"],REG_MULTI_SZ), + ] def WriteTestData(root_key): From loewis@users.sourceforge.net Fri Aug 17 19:39:27 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 17 Aug 2001 11:39:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects abstract.c,2.71,2.72 complexobject.c,2.38,2.39 floatobject.c,2.85,2.86 intobject.c,2.61,2.62 longobject.c,1.91,1.92 object.c,2.138,2.139 stringobject.c,2.123,2.124 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv28889/Objects Modified Files: abstract.c complexobject.c floatobject.c intobject.c longobject.c object.c stringobject.c Log Message: Patch #445762: Support --disable-unicode - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.71 retrieving revision 2.72 diff -C2 -d -r2.71 -r2.72 *** abstract.c 2001/08/08 05:00:18 2.71 --- abstract.c 2001/08/17 18:39:25 2.72 *************** *** 584,589 **** --- 584,591 ---- if (PyString_Check(v)) return PyString_Format(v, w); + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(v)) return PyUnicode_Format(v, w); + #endif return binary_op(v, w, NB_SLOT(nb_remainder), "%"); } *************** *** 708,713 **** --- 710,717 ---- if (PyString_Check(v)) return PyString_Format(v, w); + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(v)) return PyUnicode_Format(v, w); + #endif else return binary_iop(v, w, NB_SLOT(nb_inplace_remainder), *************** *** 822,829 **** --- 826,835 ---- return int_from_string(PyString_AS_STRING(o), PyString_GET_SIZE(o)); + #ifdef Py_USING_UNICODE if (PyUnicode_Check(o)) return PyInt_FromUnicode(PyUnicode_AS_UNICODE(o), PyUnicode_GET_SIZE(o), 10); + #endif m = o->ob_type->tp_as_number; if (m && m->nb_int) *************** *** 874,877 **** --- 880,884 ---- return long_from_string(PyString_AS_STRING(o), PyString_GET_SIZE(o)); + #ifdef Py_USING_UNICODE if (PyUnicode_Check(o)) /* The above check is done in PyLong_FromUnicode(). */ *************** *** 879,882 **** --- 886,890 ---- PyUnicode_GET_SIZE(o), 10); + #endif m = o->ob_type->tp_as_number; if (m && m->nb_long) Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.38 retrieving revision 2.39 diff -C2 -d -r2.38 -r2.39 *** complexobject.c 2001/08/16 13:15:00 2.38 --- complexobject.c 2001/08/17 18:39:25 2.39 *************** *** 612,616 **** int sign; char buffer[256]; /* For errors */ - char s_buffer[256]; int len; --- 612,615 ---- *************** *** 619,623 **** --- 618,624 ---- len = PyString_GET_SIZE(v); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(v)) { + char s_buffer[256]; if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) { PyErr_SetString(PyExc_ValueError, *************** *** 633,636 **** --- 634,638 ---- len = (int)strlen(s); } + #endif else if (PyObject_AsCharBuffer(v, &s, &len)) { PyErr_SetString(PyExc_TypeError, Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.85 retrieving revision 2.86 diff -C2 -d -r2.85 -r2.86 *** floatobject.c 2001/08/08 05:00:18 2.85 --- floatobject.c 2001/08/17 18:39:25 2.86 *************** *** 110,114 **** --- 110,116 ---- double x; char buffer[256]; /* for errors */ + #ifdef Py_USING_UNICODE char s_buffer[256]; /* for objects convertible to a char buffer */ + #endif int len; *************** *** 119,122 **** --- 121,125 ---- len = PyString_GET_SIZE(v); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(v)) { if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) { *************** *** 133,136 **** --- 136,140 ---- len = (int)strlen(s); } + #endif else if (PyObject_AsCharBuffer(v, &s, &len)) { PyErr_SetString(PyExc_TypeError, Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.61 retrieving revision 2.62 diff -C2 -d -r2.61 -r2.62 *** intobject.c 2001/08/08 05:00:18 2.61 --- intobject.c 2001/08/17 18:39:25 2.62 *************** *** 203,206 **** --- 203,207 ---- } + #ifdef Py_USING_UNICODE PyObject * PyInt_FromUnicode(Py_UNICODE *s, int length, int base) *************** *** 217,220 **** --- 218,222 ---- return PyInt_FromString(buffer, NULL, base); } + #endif /* Methods */ *************** *** 766,773 **** --- 768,777 ---- if (PyString_Check(x)) return PyInt_FromString(PyString_AS_STRING(x), NULL, base); + #ifdef Py_USING_UNICODE if (PyUnicode_Check(x)) return PyInt_FromUnicode(PyUnicode_AS_UNICODE(x), PyUnicode_GET_SIZE(x), base); + #endif PyErr_SetString(PyExc_TypeError, "int() can't convert non-string with explicit base"); Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** longobject.c 2001/08/08 05:00:18 1.91 --- longobject.c 2001/08/17 18:39:25 1.92 *************** *** 972,975 **** --- 972,976 ---- } + #ifdef Py_USING_UNICODE PyObject * PyLong_FromUnicode(Py_UNICODE *u, int length, int base) *************** *** 987,990 **** --- 988,992 ---- return PyLong_FromString(buffer, NULL, base); } + #endif /* forward */ *************** *** 2055,2062 **** --- 2057,2066 ---- else if (PyString_Check(x)) return PyLong_FromString(PyString_AS_STRING(x), NULL, base); + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(x)) return PyLong_FromUnicode(PyUnicode_AS_UNICODE(x), PyUnicode_GET_SIZE(x), base); + #endif else { PyErr_SetString(PyExc_TypeError, Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.138 retrieving revision 2.139 diff -C2 -d -r2.138 -r2.139 *** object.c 2001/08/16 08:17:26 2.138 --- object.c 2001/08/17 18:39:25 2.139 *************** *** 247,250 **** --- 247,251 ---- if (res == NULL) return NULL; + #ifdef Py_USING_UNICODE if (PyUnicode_Check(res)) { PyObject* str; *************** *** 256,259 **** --- 257,261 ---- return NULL; } + #endif if (!PyString_Check(res)) { PyErr_Format(PyExc_TypeError, *************** *** 284,287 **** --- 286,290 ---- if (res == NULL) return NULL; + #ifdef Py_USING_UNICODE if (PyUnicode_Check(res)) { PyObject* str; *************** *** 293,296 **** --- 296,300 ---- return NULL; } + #endif if (!PyString_Check(res)) { PyErr_Format(PyExc_TypeError, *************** *** 303,306 **** --- 307,311 ---- } + #ifdef Py_USING_UNICODE PyObject * PyObject_Unicode(PyObject *v) *************** *** 351,354 **** --- 356,360 ---- return res; } + #endif *************** *** 524,527 **** --- 530,534 ---- } + #ifdef Py_USING_UNICODE /* Special case for Unicode */ if (PyUnicode_Check(v) || PyUnicode_Check(w)) { *************** *** 538,541 **** --- 545,549 ---- PyErr_Clear(); } + #endif /* None is smaller than anything */ *************** *** 1033,1036 **** --- 1041,1045 ---- PyTypeObject *tp = v->ob_type; + #ifdef Py_USING_UNICODE /* The Unicode to string conversion is done here because the existing tp_getattro slots expect a string object as name *************** *** 1041,1044 **** --- 1050,1055 ---- return NULL; } + #endif + if (!PyString_Check(name)) { PyErr_SetString(PyExc_TypeError, *************** *** 1074,1077 **** --- 1085,1089 ---- int err; + #ifdef Py_USING_UNICODE /* The Unicode to string conversion is done here because the existing tp_setattro slots expect a string object as name *************** *** 1082,1086 **** return -1; } ! else if (!PyString_Check(name)){ PyErr_SetString(PyExc_TypeError, "attribute name must be string"); --- 1094,1100 ---- return -1; } ! else ! #endif ! if (!PyString_Check(name)){ PyErr_SetString(PyExc_TypeError, "attribute name must be string"); Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.123 retrieving revision 2.124 diff -C2 -d -r2.123 -r2.124 *** stringobject.c 2001/08/16 13:15:00 2.123 --- stringobject.c 2001/08/17 18:39:25 2.124 *************** *** 174,179 **** } ! if (encoding == NULL) encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ --- 174,185 ---- } ! if (encoding == NULL) { ! #ifdef Py_USING_UNICODE encoding = PyUnicode_GetDefaultEncoding(); + #else + PyErr_SetString(PyExc_ValueError, "no encoding specified"); + goto onError; + #endif + } /* Decode via the codec registry */ *************** *** 198,201 **** --- 204,208 ---- goto onError; + #ifdef Py_USING_UNICODE /* Convert Unicode to a string using the default encoding */ if (PyUnicode_Check(v)) { *************** *** 206,209 **** --- 213,217 ---- goto onError; } + #endif if (!PyString_Check(v)) { PyErr_Format(PyExc_TypeError, *************** *** 246,251 **** } ! if (encoding == NULL) encoding = PyUnicode_GetDefaultEncoding(); /* Encode via the codec registry */ --- 254,265 ---- } ! if (encoding == NULL) { ! #ifdef Py_USING_UNICODE encoding = PyUnicode_GetDefaultEncoding(); + #else + PyErr_SetString(PyExc_ValueError, "no encoding specified"); + goto onError; + #endif + } /* Encode via the codec registry */ *************** *** 270,273 **** --- 284,288 ---- goto onError; + #ifdef Py_USING_UNICODE /* Convert Unicode to a string using the default encoding */ if (PyUnicode_Check(v)) { *************** *** 278,281 **** --- 293,297 ---- goto onError; } + #endif if (!PyString_Check(v)) { PyErr_Format(PyExc_TypeError, *************** *** 345,348 **** --- 361,365 ---- if (!PyString_Check(obj)) { + #ifdef Py_USING_UNICODE if (PyUnicode_Check(obj)) { obj = _PyUnicode_AsDefaultEncodedString(obj, NULL); *************** *** 350,354 **** return -1; } ! else { PyErr_Format(PyExc_TypeError, "expected string or Unicode object, " --- 367,373 ---- return -1; } ! else ! #endif ! { PyErr_Format(PyExc_TypeError, "expected string or Unicode object, " *************** *** 478,483 **** --- 497,504 ---- register PyStringObject *op; if (!PyString_Check(bb)) { + #ifdef Py_USING_UNICODE if (PyUnicode_Check(bb)) return PyUnicode_Concat((PyObject *)a, bb); + #endif PyErr_Format(PyExc_TypeError, "cannot add type \"%.200s\" to string", *************** *** 587,592 **** --- 608,615 ---- register char *s, *end; register char c; + #ifdef Py_USING_UNICODE if (PyUnicode_Check(el)) return PyUnicode_Contains(a, el); + #endif if (!PyString_Check(el) || PyString_Size(el) != 1) { PyErr_SetString(PyExc_TypeError, *************** *** 869,874 **** --- 892,899 ---- n = PyString_GET_SIZE(subobj); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(subobj)) return PyUnicode_Split((PyObject *)self, subobj, maxsplit); + #endif else if (PyObject_AsCharBuffer(subobj, &sub, &n)) return NULL; *************** *** 970,973 **** --- 995,999 ---- item = PySequence_Fast_GET_ITEM(seq, i); if (!PyString_Check(item)){ + #ifdef Py_USING_UNICODE if (PyUnicode_Check(item)) { /* Defer to Unicode join. *************** *** 981,984 **** --- 1007,1011 ---- return result; } + #endif PyErr_Format(PyExc_TypeError, "sequence item %i: expected string," *************** *** 1047,1052 **** --- 1074,1081 ---- n = PyString_GET_SIZE(subobj); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(subobj)) return PyUnicode_Find((PyObject *)self, subobj, i, last, 1); + #endif else if (PyObject_AsCharBuffer(subobj, &sub, &n)) return -2; *************** *** 1382,1385 **** --- 1411,1415 ---- n = PyString_GET_SIZE(subobj); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(subobj)) { int count; *************** *** 1390,1393 **** --- 1420,1424 ---- return PyInt_FromLong((long) count); } + #endif else if (PyObject_AsCharBuffer(subobj, &sub, &n)) return NULL; *************** *** 1482,1485 **** --- 1513,1517 ---- tablen = PyString_GET_SIZE(tableobj); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(tableobj)) { /* Unicode .translate() does not support the deletechars *************** *** 1493,1496 **** --- 1525,1529 ---- return PyUnicode_Translate((PyObject *)self, tableobj, NULL); } + #endif else if (PyObject_AsCharBuffer(tableobj, &table1, &tablen)) return NULL; *************** *** 1501,1504 **** --- 1534,1538 ---- dellen = PyString_GET_SIZE(delobj); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(delobj)) { PyErr_SetString(PyExc_TypeError, *************** *** 1506,1509 **** --- 1540,1544 ---- return NULL; } + #endif else if (PyObject_AsCharBuffer(delobj, &del_table, &dellen)) return NULL; *************** *** 1730,1736 **** --- 1765,1773 ---- sub_len = PyString_GET_SIZE(subobj); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(subobj)) return PyUnicode_Replace((PyObject *)self, subobj, replobj, count); + #endif else if (PyObject_AsCharBuffer(subobj, &sub, &sub_len)) return NULL; *************** *** 1740,1746 **** --- 1777,1785 ---- repl_len = PyString_GET_SIZE(replobj); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(replobj)) return PyUnicode_Replace((PyObject *)self, subobj, replobj, count); + #endif else if (PyObject_AsCharBuffer(replobj, &repl, &repl_len)) return NULL; *************** *** 1793,1796 **** --- 1832,1836 ---- plen = PyString_GET_SIZE(subobj); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(subobj)) { int rc; *************** *** 1802,1805 **** --- 1842,1846 ---- return PyInt_FromLong((long) rc); } + #endif else if (PyObject_AsCharBuffer(subobj, &prefix, &plen)) return NULL; *************** *** 1851,1854 **** --- 1892,1896 ---- slen = PyString_GET_SIZE(subobj); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(subobj)) { int rc; *************** *** 1860,1863 **** --- 1902,1906 ---- return PyInt_FromLong((long) rc); } + #endif else if (PyObject_AsCharBuffer(subobj, &suffix, &slen)) return NULL; *************** *** 2877,2881 **** int fmtcnt, rescnt, reslen, arglen, argidx; int args_owned = 0; ! PyObject *result, *orig_args, *v, *w; PyObject *dict = NULL; if (format == NULL || !PyString_Check(format) || args == NULL) { --- 2920,2927 ---- int fmtcnt, rescnt, reslen, arglen, argidx; int args_owned = 0; ! PyObject *result, *orig_args; ! #ifdef Py_USING_UNICODE ! PyObject *v, *w; ! #endif PyObject *dict = NULL; if (format == NULL || !PyString_Check(format) || args == NULL) { *************** *** 2927,2932 **** --- 2973,2980 ---- int len; char formatbuf[FORMATBUFLEN]; /* For format{float,int,char}() */ + #ifdef Py_USING_UNICODE char *fmt_start = fmt; int argidx_start = argidx; + #endif fmt++; *************** *** 3079,3082 **** --- 3127,3131 ---- case 's': case 'r': + #ifdef Py_USING_UNICODE if (PyUnicode_Check(v)) { fmt = fmt_start; *************** *** 3084,3087 **** --- 3133,3137 ---- goto unicode; } + #endif if (c == 's') temp = PyObject_Str(v); *************** *** 3241,3244 **** --- 3291,3295 ---- return result; + #ifdef Py_USING_UNICODE unicode: if (args_owned) { *************** *** 3285,3288 **** --- 3336,3340 ---- Py_DECREF(args); return w; + #endif /* Py_USING_UNICODE */ error: From loewis@users.sourceforge.net Fri Aug 17 19:39:27 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 17 Aug 2001 11:39:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.226,2.227 compile.c,2.217,2.218 getargs.c,2.61,2.62 marshal.c,1.64,1.65 modsupport.c,2.57,2.58 pythonrun.c,2.146,2.147 sysmodule.c,2.91,2.92 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv28889/Python Modified Files: bltinmodule.c compile.c getargs.c marshal.c modsupport.c pythonrun.c sysmodule.c Log Message: Patch #445762: Support --disable-unicode - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.226 retrieving revision 2.227 diff -C2 -d -r2.226 -r2.227 *** bltinmodule.c 2001/08/16 13:15:00 2.226 --- bltinmodule.c 2001/08/17 18:39:25 2.227 *************** *** 277,280 **** --- 277,281 ---- + #ifdef Py_USING_UNICODE static PyObject * builtin_unichr(PyObject *self, PyObject *args) *************** *** 325,328 **** --- 326,330 ---- \n\ Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."; + #endif *************** *** 631,634 **** --- 633,637 ---- if (!PyArg_ParseTuple(args, "OO|O:getattr", &v, &name, &dflt)) return NULL; + #ifdef Py_USING_UNICODE if (PyUnicode_Check(name)) { name = _PyUnicode_AsDefaultEncodedString(name, NULL); *************** *** 636,639 **** --- 639,643 ---- return NULL; } + #endif if (!PyString_Check(name)) { *************** *** 683,686 **** --- 687,691 ---- if (!PyArg_ParseTuple(args, "OO:hasattr", &v, &name)) return NULL; + #ifdef Py_USING_UNICODE if (PyUnicode_Check(name)) { name = _PyUnicode_AsDefaultEncodedString(name, NULL); *************** *** 688,691 **** --- 693,697 ---- return NULL; } + #endif if (!PyString_Check(name)) { *************** *** 1253,1256 **** --- 1259,1263 ---- return PyInt_FromLong(ord); } + #ifdef Py_USING_UNICODE } else if (PyUnicode_Check(obj)) { size = PyUnicode_GET_SIZE(obj); *************** *** 1259,1262 **** --- 1266,1270 ---- return PyInt_FromLong(ord); } + #endif } else { PyErr_Format(PyExc_TypeError, *************** *** 1844,1848 **** --- 1852,1858 ---- {"setattr", builtin_setattr, METH_VARARGS, setattr_doc}, {"slice", builtin_slice, METH_VARARGS, slice_doc}, + #ifdef Py_USING_UNICODE {"unichr", builtin_unichr, METH_VARARGS, unichr_doc}, + #endif {"vars", builtin_vars, METH_VARARGS, vars_doc}, {"xrange", builtin_xrange, METH_VARARGS, xrange_doc}, *************** *** 1906,1912 **** --- 1916,1924 ---- if (PyDict_SetItemString(dict, "type", (PyObject *) &PyType_Type) < 0) return NULL; + #ifdef Py_USING_UNICODE if (PyDict_SetItemString(dict, "unicode", (PyObject *) &PyUnicode_Type) < 0) return NULL; + #endif debug = PyInt_FromLong(Py_OptimizeFlag == 0); if (PyDict_SetItemString(dict, "__debug__", debug) < 0) { Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.217 retrieving revision 2.218 diff -C2 -d -r2.217 -r2.218 *** compile.c 2001/08/14 20:01:59 2.217 --- compile.c 2001/08/17 18:39:25 2.218 *************** *** 521,526 **** static PyCodeObject *jcompile(node *, char *, struct compiling *, PyCompilerFlags *); ! static PyObject *parsestrplus(node *); ! static PyObject *parsestr(char *); static node *get_rawdocstring(node *); --- 521,526 ---- static PyCodeObject *jcompile(node *, char *, struct compiling *, PyCompilerFlags *); ! static PyObject *parsestrplus(struct compiling*, node *); ! static PyObject *parsestr(struct compiling *, char *); static node *get_rawdocstring(node *); *************** *** 1112,1116 **** static PyObject * ! parsestr(char *s) { PyObject *v; --- 1112,1116 ---- static PyObject * ! parsestr(struct compiling *com, char *s) { PyObject *v; *************** *** 1123,1131 **** --- 1123,1139 ---- int quote = first; int rawmode = 0; + #ifdef Py_USING_UNICODE int unicode = 0; + #endif if (isalpha(quote) || quote == '_') { if (quote == 'u' || quote == 'U') { + #ifdef Py_USING_UNICODE quote = *++s; unicode = 1; + #else + com_error(com, PyExc_SyntaxError, + "Unicode literals not supported in this Python"); + return NULL; + #endif } if (quote == 'r' || quote == 'R') { *************** *** 1156,1159 **** --- 1164,1168 ---- } } + #ifdef Py_USING_UNICODE if (unicode || Py_UnicodeFlag) { if (rawmode) *************** *** 1164,1167 **** --- 1173,1177 ---- s, len, NULL); } + #endif if (rawmode || strchr(s, '\\') == NULL) return PyString_FromStringAndSize(s, len); *************** *** 1239,1252 **** static PyObject * ! parsestrplus(node *n) { PyObject *v; int i; REQ(CHILD(n, 0), STRING); ! if ((v = parsestr(STR(CHILD(n, 0)))) != NULL) { /* String literal concatenation */ for (i = 1; i < NCH(n); i++) { PyObject *s; ! s = parsestr(STR(CHILD(n, i))); if (s == NULL) goto onError; --- 1249,1262 ---- static PyObject * ! parsestrplus(struct compiling* c, node *n) { PyObject *v; int i; REQ(CHILD(n, 0), STRING); ! if ((v = parsestr(c, STR(CHILD(n, 0)))) != NULL) { /* String literal concatenation */ for (i = 1; i < NCH(n); i++) { PyObject *s; ! s = parsestr(c, STR(CHILD(n, i))); if (s == NULL) goto onError; *************** *** 1256,1259 **** --- 1266,1270 ---- goto onError; } + #ifdef Py_USING_UNICODE else { PyObject *temp; *************** *** 1265,1268 **** --- 1276,1280 ---- v = temp; } + #endif } } *************** *** 1446,1450 **** break; case STRING: ! v = parsestrplus(n); if (v == NULL) { c->c_errors++; --- 1458,1462 ---- break; case STRING: ! v = parsestrplus(c, n); if (v == NULL) { c->c_errors++; *************** *** 2937,2941 **** case STRING: ! v = parsestr(STR(n)); if (v == NULL) { PyErr_Clear(); --- 2949,2953 ---- case STRING: ! v = parsestr(c, STR(n)); if (v == NULL) { PyErr_Clear(); *************** *** 3331,3335 **** static PyObject * ! get_docstring(node *n) { /* Don't generate doc-strings if run with -OO */ --- 3343,3347 ---- static PyObject * ! get_docstring(struct compiling *c, node *n) { /* Don't generate doc-strings if run with -OO */ *************** *** 3339,3343 **** if (n == NULL) return NULL; ! return parsestrplus(n); } --- 3351,3355 ---- if (n == NULL) return NULL; ! return parsestrplus(c, n); } *************** *** 3795,3799 **** PyObject *doc; REQ(n, file_input); /* (NEWLINE | stmt)* ENDMARKER */ ! doc = get_docstring(n); if (doc != NULL) { int i = com_addconst(c, doc); --- 3807,3811 ---- PyObject *doc; REQ(n, file_input); /* (NEWLINE | stmt)* ENDMARKER */ ! doc = get_docstring(c, n); if (doc != NULL) { int i = com_addconst(c, doc); *************** *** 3820,3824 **** REQ(n, funcdef); /* funcdef: 'def' NAME parameters ':' suite */ c->c_name = STR(CHILD(n, 1)); ! doc = get_docstring(CHILD(n, 4)); if (doc != NULL) { (void) com_addconst(c, doc); --- 3832,3836 ---- REQ(n, funcdef); /* funcdef: 'def' NAME parameters ':' suite */ c->c_name = STR(CHILD(n, 1)); ! doc = get_docstring(c, CHILD(n, 4)); if (doc != NULL) { (void) com_addconst(c, doc); *************** *** 3870,3874 **** c->c_private = c->c_name; ch = CHILD(n, NCH(n)-1); /* The suite */ ! doc = get_docstring(ch); if (doc != NULL) { int i = com_addconst(c, doc); --- 3882,3886 ---- c->c_private = c->c_name; ch = CHILD(n, NCH(n)-1); /* The suite */ ! doc = get_docstring(c, ch); if (doc != NULL) { int i = com_addconst(c, doc); Index: getargs.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v retrieving revision 2.61 retrieving revision 2.62 diff -C2 -d -r2.61 -r2.62 *** getargs.c 2001/07/30 22:34:24 2.61 --- getargs.c 2001/08/17 18:39:25 2.62 *************** *** 567,570 **** --- 567,571 ---- *q = PyString_GET_SIZE(arg); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(arg)) { arg = UNICODE_DEFAULT_ENCODING(arg); *************** *** 575,578 **** --- 576,580 ---- *q = PyString_GET_SIZE(arg); } + #endif else { /* any buffer-like object */ char *buf; *************** *** 588,591 **** --- 590,594 ---- if (PyString_Check(arg)) *p = PyString_AS_STRING(arg); + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(arg)) { arg = UNICODE_DEFAULT_ENCODING(arg); *************** *** 595,598 **** --- 598,602 ---- *p = PyString_AS_STRING(arg); } + #endif else return converterr("string", arg, msgbuf); *************** *** 617,620 **** --- 621,625 ---- *q = PyString_GET_SIZE(arg); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(arg)) { arg = UNICODE_DEFAULT_ENCODING(arg); *************** *** 625,628 **** --- 630,634 ---- *q = PyString_GET_SIZE(arg); } + #endif else { /* any buffer-like object */ char *buf; *************** *** 641,644 **** --- 647,651 ---- else if (PyString_Check(arg)) *p = PyString_AsString(arg); + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(arg)) { arg = UNICODE_DEFAULT_ENCODING(arg); *************** *** 648,651 **** --- 655,659 ---- *p = PyString_AS_STRING(arg); } + #endif else return converterr("string or None", *************** *** 671,681 **** char **buffer; const char *encoding; ! PyObject *u, *s; int size, recode_strings; /* Get 'e' parameter: the encoding name */ encoding = (const char *)va_arg(*p_va, const char *); if (encoding == NULL) encoding = PyUnicode_GetDefaultEncoding(); /* Get output buffer parameter: --- 679,691 ---- char **buffer; const char *encoding; ! PyObject *s; int size, recode_strings; /* Get 'e' parameter: the encoding name */ encoding = (const char *)va_arg(*p_va, const char *); + #ifdef Py_USING_UNICODE if (encoding == NULL) encoding = PyUnicode_GetDefaultEncoding(); + #endif /* Get output buffer parameter: *************** *** 703,706 **** --- 713,719 ---- } else { + #ifdef Py_USING_UNICODE + PyObject *u; + /* Convert object to Unicode */ u = PyUnicode_FromObject(arg); *************** *** 724,727 **** --- 737,743 ---- arg, msgbuf); } + #else + return converterr("string", arg, msgbuf); + #endif } size = PyString_GET_SIZE(s); *************** *** 809,812 **** --- 825,829 ---- } + #ifdef Py_USING_UNICODE case 'u': {/* raw unicode buffer (Py_UNICODE *) */ if (*format == '#') { /* any buffer-like object */ *************** *** 830,833 **** --- 847,851 ---- break; } + #endif case 'S': { /* string object */ *************** *** 840,843 **** --- 858,862 ---- } + #ifdef Py_USING_UNICODE case 'U': { /* Unicode object */ PyObject **p = va_arg(*p_va, PyObject **); *************** *** 848,851 **** --- 867,871 ---- break; } + #endif case 'O': { /* object */ Index: marshal.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/marshal.c,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** marshal.c 2001/06/18 22:08:13 1.64 --- marshal.c 2001/08/17 18:39:25 1.65 *************** *** 188,191 **** --- 188,192 ---- w_string(PyString_AS_STRING(v), n, p); } + #ifdef Py_USING_UNICODE else if (PyUnicode_Check(v)) { PyObject *utf8; *************** *** 202,205 **** --- 203,207 ---- Py_DECREF(utf8); } + #endif else if (PyTuple_Check(v)) { w_byte(TYPE_TUPLE, p); *************** *** 473,476 **** --- 475,479 ---- return v; + #ifdef Py_USING_UNICODE case TYPE_UNICODE: { *************** *** 495,498 **** --- 498,502 ---- return v; } + #endif case TYPE_TUPLE: Index: modsupport.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/modsupport.c,v retrieving revision 2.57 retrieving revision 2.58 diff -C2 -d -r2.57 -r2.58 *** modsupport.c 2001/08/04 03:11:25 2.57 --- modsupport.c 2001/08/17 18:39:25 2.58 *************** *** 200,203 **** --- 200,204 ---- } + #ifdef Py_USING_UNICODE static int _ustrlen(Py_UNICODE *u) *************** *** 208,211 **** --- 209,213 ---- return i; } + #endif static PyObject * *************** *** 270,273 **** --- 272,276 ---- return PyLong_FromLongLong((LONG_LONG)va_arg(*p_va, LONG_LONG)); #endif + #ifdef Py_USING_UNICODE case 'u': { *************** *** 292,295 **** --- 295,299 ---- return v; } + #endif case 'f': case 'd': Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.146 retrieving revision 2.147 diff -C2 -d -r2.146 -r2.147 *** pythonrun.c 2001/08/16 08:24:00 2.146 --- pythonrun.c 2001/08/17 18:39:25 2.147 *************** *** 126,131 **** --- 126,133 ---- _PyCodecRegistry_Init(); + #ifdef Py_USING_UNICODE /* Init Unicode implementation; relies on the codec registry */ _PyUnicode_Init(); + #endif bimod = _PyBuiltin_Init(); *************** *** 207,212 **** --- 209,216 ---- PyOS_FiniInterrupts(); + #ifdef Py_USING_UNICODE /* Cleanup Unicode implementation */ _PyUnicode_Fini(); + #endif /* Cleanup Codec registry */ Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.91 retrieving revision 2.92 diff -C2 -d -r2.91 -r2.92 *** sysmodule.c 2001/08/16 13:15:00 2.91 --- sysmodule.c 2001/08/17 18:39:25 2.92 *************** *** 177,180 **** --- 177,182 ---- implementation."; + #ifdef Py_USING_UNICODE + static PyObject * sys_setdefaultencoding(PyObject *self, PyObject *args) *************** *** 194,197 **** --- 196,201 ---- Set the current default string encoding used by the Unicode implementation."; + #endif + /* * Cached interned string objects used for calling the profile and *************** *** 531,536 **** --- 535,542 ---- {"excepthook", sys_excepthook, METH_VARARGS, excepthook_doc}, {"exit", sys_exit, METH_OLDARGS, exit_doc}, + #ifdef Py_USING_UNICODE {"getdefaultencoding", (PyCFunction)sys_getdefaultencoding, METH_NOARGS, getdefaultencoding_doc}, + #endif #ifdef HAVE_DLOPEN {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_NOARGS, *************** *** 554,559 **** --- 560,567 ---- {"mdebug", sys_mdebug, METH_VARARGS}, #endif + #ifdef Py_USING_UNICODE {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS, setdefaultencoding_doc}, + #endif {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, setcheckinterval_doc}, *************** *** 783,789 **** --- 791,799 ---- v = PyInt_FromLong(PyInt_GetMax())); Py_XDECREF(v); + #ifdef Py_USING_UNICODE PyDict_SetItemString(sysdict, "maxunicode", v = PyInt_FromLong(PyUnicode_GetMax())); Py_XDECREF(v); + #endif PyDict_SetItemString(sysdict, "builtin_module_names", v = list_builtin_module_names()); From gvanrossum@users.sourceforge.net Fri Aug 17 19:49:54 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 11:49:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib pickle.py,1.49,1.50 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv32109 Modified Files: pickle.py Log Message: Address SF #451547. The approach is a bit draconian: any object that is pickled as a global must now exist by the name under which it is pickled, otherwise the pickling fails. Previously, such things would fail on unpickling, or unpickle as the wrong global object. I'm hoping that this won't break existing code that is playing tricks with this. I need a volunteer to do this for cPickle too. Index: pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** pickle.py 2001/08/02 04:15:00 1.49 --- pickle.py 2001/08/17 18:49:52 1.50 *************** *** 498,501 **** --- 498,515 ---- module = whichmodule(object, name) + try: + __import__(module) + mod = sys.modules[module] + klass = getattr(mod, name) + except (ImportError, KeyError, AttributeError): + raise PicklingError( + "Can't pickle %r: it's not found as %s.%s" % + (object, module, name)) + else: + if klass is not object: + raise PicklingError( + "Can't pickle %r: it's not the same object as %s.%s" % + (object, module, name)) + memo_len = len(memo) write(GLOBAL + module + '\n' + name + '\n' + From tim_one@users.sourceforge.net Fri Aug 17 20:49:04 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 12:49:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test___future__.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11086/test Modified Files: test___future__.py Log Message: A self-contained piece of Michael Hudson's patch #449043 supporting __future__ in simulated shells in support of PEP 264. Much has changed from the patch version: + Repaired bad hex constant for nested_scopes. + Defined symbolic CO_xxx names so global search will find these uses. + Made the exported list of feature names explicit, instead of abusing __all__ for this purpose (and redefined __all__ accordingly). + Added gross .compiler_flag verification to test___future__.py, and reworked it a little to make use of the newly exported explicit list of feature names. Index: test___future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test___future__.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test___future__.py 2001/03/02 02:53:08 1.2 --- test___future__.py 2001/08/17 19:49:02 1.3 *************** *** 6,10 **** GOOD_SERIALS = ("alpha", "beta", "candidate", "final") ! features = [x for x in dir(__future__) if x[:1] != "_"] for feature in features: value = getattr(__future__, feature) --- 6,10 ---- GOOD_SERIALS = ("alpha", "beta", "candidate", "final") ! features = __future__.all_feature_names for feature in features: value = getattr(__future__, feature) *************** *** 40,41 **** --- 40,46 ---- verify(optional < mandatory, "optional not less than mandatory, and mandatory not None") + + verify(hasattr(value, "compiler_flag"), + "feature is missing a .compiler_flag attr") + verify(type(getattr(value, "compiler_flag")) is IntType, + ".compiler_flag isn't int") From tim_one@users.sourceforge.net Fri Aug 17 20:49:04 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 12:49:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib __future__.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11086 Modified Files: __future__.py Log Message: A self-contained piece of Michael Hudson's patch #449043 supporting __future__ in simulated shells in support of PEP 264. Much has changed from the patch version: + Repaired bad hex constant for nested_scopes. + Defined symbolic CO_xxx names so global search will find these uses. + Made the exported list of feature names explicit, instead of abusing __all__ for this purpose (and redefined __all__ accordingly). + Added gross .compiler_flag verification to test___future__.py, and reworked it a little to make use of the newly exported explicit list of feature names. Index: __future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/__future__.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** __future__.py 2001/08/08 05:00:17 1.8 --- __future__.py 2001/08/17 19:49:02 1.9 *************** *** 3,7 **** Each line is of the form: ! FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ")" where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples --- 3,8 ---- Each line is of the form: ! FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease "," ! CompilerFlag ")" where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples *************** *** 38,48 **** .getOptionalRelease() and .getMandatoryRelease(). No feature line is ever to be deleted from this file. """ class _Feature: ! def __init__(self, optionalRelease, mandatoryRelease): self.optional = optionalRelease self.mandatory = mandatoryRelease def getOptionalRelease(self): --- 39,73 ---- .getOptionalRelease() and .getMandatoryRelease(). + CompilerFlag is the (bitfield) flag that should be passed in the fourth + argument to the builtin function compile() to enable the feature in + dynamically compiled code. This flag is stored in the .compiler_flag + attribute on _Future instances. These values must match the appropriate + #defines of CO_xxx flags in Include/compile.h. + No feature line is ever to be deleted from this file. """ + all_feature_names = [ + "nested_scopes", + "generators", + "division", + ] + + __all__ = ["all_feature_names"] + all_feature_names + + + # The CO_xxx symbols are defined here under the same names used by + # compile.h, so that an editor search will find them here. However, + # they're not exported in __all__, because they don't really belong to + # this module. + CO_NESTED = 0x0010 # nested_scopes + CO_GENERATOR_ALLOWED = 0x1000 # generators + CO_FUTURE_DIVISION = 0x2000 # division + class _Feature: ! def __init__(self, optionalRelease, mandatoryRelease, compiler_flag): self.optional = optionalRelease self.mandatory = mandatoryRelease + self.compiler_flag = compiler_flag def getOptionalRelease(self): *************** *** 64,71 **** def __repr__(self): ! return "Feature(" + `self.getOptionalRelease()` + ", " + \ ! `self.getMandatoryRelease()` + ")" ! nested_scopes = _Feature((2, 1, 0, "beta", 1), (2, 2, 0, "alpha", 0)) ! generators = _Feature((2, 2, 0, "alpha", 1), (2, 3, 0, "final", 0)) ! division = _Feature((2, 2, 0, "alpha", 2), (3, 0, 0, "alpha", 0)) --- 89,104 ---- def __repr__(self): ! return "_Feature(" + `self.getOptionalRelease()` + ", " + \ ! `self.getMandatoryRelease()` + ")" ! nested_scopes = _Feature((2, 1, 0, "beta", 1), ! (2, 2, 0, "alpha", 0), ! CO_NESTED) ! ! generators = _Feature((2, 2, 0, "alpha", 1), ! (2, 3, 0, "final", 0), ! CO_GENERATOR_ALLOWED) ! ! division = _Feature((2, 2, 0, "alpha", 2), ! (3, 0, 0, "alpha", 0), ! CO_FUTURE_DIVISION) From bwarsaw@users.sourceforge.net Fri Aug 17 20:59:37 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 17 Aug 2001 12:59:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib uu.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14299 Modified Files: uu.py Log Message: decode(): Raise a uu.Error if no out_file is given but the file specified in the uu header already exists. No additional workaround is provided since out_file=pathname is a deprecated interface, so it is better to simply pass a file-like object into out_file anyway. This closes SF bug #438083. Use isinstance() tests instead of type comparisons. Index: uu.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/uu.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** uu.py 2001/07/11 04:08:49 1.17 --- uu.py 2001/08/17 19:59:34 1.18 *************** *** 34,37 **** --- 34,38 ---- import os import sys + from types import StringType __all__ = ["Error", "encode", "decode"] *************** *** 47,51 **** if in_file == '-': in_file = sys.stdin ! elif type(in_file) == type(''): if name is None: name = os.path.basename(in_file) --- 48,52 ---- if in_file == '-': in_file = sys.stdin ! elif isinstance(in_file, StringType): if name is None: name = os.path.basename(in_file) *************** *** 61,65 **** if out_file == '-': out_file = sys.stdout ! elif type(out_file) == type(''): out_file = open(out_file, 'w') # --- 62,66 ---- if out_file == '-': out_file = sys.stdout ! elif isinstance(out_file, StringType): out_file = open(out_file, 'w') # *************** *** 81,85 **** ! def decode(in_file, out_file=None, mode=None): """Decode uuencoded file""" # --- 82,86 ---- ! def decode(in_file, out_file=None, mode=None, quiet=0): """Decode uuencoded file""" # *************** *** 88,92 **** if in_file == '-': in_file = sys.stdin ! elif type(in_file) == type(''): in_file = open(in_file) # --- 89,93 ---- if in_file == '-': in_file = sys.stdin ! elif isinstance(in_file, StringType): in_file = open(in_file) # *************** *** 108,111 **** --- 109,114 ---- if out_file is None: out_file = hdrfields[2].rstrip() + if os.path.exists(out_file): + raise Error, 'Cannot overwrite existing file: %s' % out_file if mode is None: mode = int(hdrfields[1], 8) *************** *** 115,119 **** if out_file == '-': out_file = sys.stdout ! elif type(out_file) == type(''): fp = open(out_file, 'wb') try: --- 118,122 ---- if out_file == '-': out_file = sys.stdout ! elif isinstance(out_file, StringType): fp = open(out_file, 'wb') try: *************** *** 126,130 **** # s = in_file.readline() ! while s and s != 'end\n': try: data = binascii.a2b_uu(s) --- 129,133 ---- # s = in_file.readline() ! while s and s.strip() != 'end': try: data = binascii.a2b_uu(s) *************** *** 133,137 **** nbytes = (((ord(s[0])-32) & 63) * 4 + 5) / 3 data = binascii.a2b_uu(s[:nbytes]) ! sys.stderr.write("Warning: %s\n" % str(v)) out_file.write(data) s = in_file.readline() --- 136,141 ---- nbytes = (((ord(s[0])-32) & 63) * 4 + 5) / 3 data = binascii.a2b_uu(s[:nbytes]) ! if not quiet: ! sys.stderr.write("Warning: %s\n" % str(v)) out_file.write(data) s = in_file.readline() *************** *** 169,173 **** if dopt: if topt: ! if type(output) == type(''): output = open(output, 'w') else: --- 173,177 ---- if dopt: if topt: ! if isinstance(output, StringType): output = open(output, 'w') else: *************** *** 177,181 **** else: if topt: ! if type(input) == type(''): input = open(input, 'r') else: --- 181,185 ---- else: if topt: ! if isinstance(input, StringType): input = open(input, 'r') else: From bwarsaw@users.sourceforge.net Fri Aug 17 21:00:13 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 17 Aug 2001 13:00:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_uu.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14530 Modified Files: test_uu.py Log Message: Test that uu.py will not override an existing file if out_file isn't given and the path is gleaned from the uu header. Index: test_uu.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_uu.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_uu.py 2001/08/03 13:04:03 1.2 --- test_uu.py 2001/08/17 20:00:11 1.3 *************** *** 123,124 **** --- 123,158 ---- except uu.Error, e: verify(str(e) == 'No valid begin line found in input file') + + # Test to verify that decode() will refuse to overwrite an existing file + import tempfile + outfile = tempfile.mktemp() + inp = StringIO('Here is a message to be uuencoded') + out = StringIO() + uu.encode(inp, out, outfile) + out.seek(0) + try: + if verbose: + print '9. decode w/file not exists is okay' + uu.decode(out) + if not os.path.exists(outfile): + raise TestFailed('uudecode w/ out_file=None failed') + fp = open(outfile) + data = fp.read() + fp.close() + if data <> inp.getvalue(): + raise TestFailed('uudecode stored something weird') + # Try to write it again, which should cause a failure + if verbose: + print '10. uudecode w/file exists fails' + out.seek(0) + try: + uu.decode(out) + except uu.Error: + pass + else: + raise TestFailed('expected to get a "file exists" error') + finally: + try: + os.unlink(outfile) + except OSError: + pass From bwarsaw@users.sourceforge.net Fri Aug 17 21:01:08 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 17 Aug 2001 13:01:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libuu.tex,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv14732 Modified Files: libuu.tex Log Message: Document that uu.decode() will always raise a uu.Error if out_file isn't given, and the file in the uu header already exists. Also add a description of the uu.Error exception class. Index: libuu.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libuu.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** libuu.tex 2000/10/18 17:43:06 1.10 --- libuu.tex 2001/08/17 20:01:06 1.11 *************** *** 8,12 **** This module encodes and decodes files in uuencode format, allowing ! arbitrary binary data to be transferred over ascii-only connections. Wherever a file argument is expected, the methods accept a file-like object. For backwards compatibility, a string containing a pathname --- 8,12 ---- This module encodes and decodes files in uuencode format, allowing ! arbitrary binary data to be transferred over ASCII-only connections. Wherever a file argument is expected, the methods accept a file-like object. For backwards compatibility, a string containing a pathname *************** *** 25,41 **** \begin{funcdesc}{encode}{in_file, out_file\optional{, name\optional{, mode}}} ! Uuencode file \var{in_file} into file \var{out_file}. The uuencoded ! file will have the header specifying \var{name} and \var{mode} as the ! defaults for the results of decoding the file. The default defaults ! are taken from \var{in_file}, or \code{'-'} and \code{0666} respectively. \end{funcdesc} \begin{funcdesc}{decode}{in_file\optional{, out_file\optional{, mode}}} ! This call decodes uuencoded file \var{in_file} placing the result on ! file \var{out_file}. If \var{out_file} is a pathname, \var{mode} is ! used to set the permission bits if the file must be created. Defaults ! for \var{out_file} and \var{mode} are taken from the uuencode header. \end{funcdesc} \begin{seealso} --- 25,50 ---- \begin{funcdesc}{encode}{in_file, out_file\optional{, name\optional{, mode}}} ! Uuencode file \var{in_file} into file \var{out_file}. The uuencoded ! file will have the header specifying \var{name} and \var{mode} as ! the defaults for the results of decoding the file. The default ! defaults are taken from \var{in_file}, or \code{'-'} and \code{0666} ! respectively. \end{funcdesc} \begin{funcdesc}{decode}{in_file\optional{, out_file\optional{, mode}}} ! This call decodes uuencoded file \var{in_file} placing the result on ! file \var{out_file}. If \var{out_file} is a pathname, \var{mode} is ! used to set the permission bits if the file must be ! created. Defaults for \var{out_file} and \var{mode} are taken from ! the uuencode header. However, if the file specified in the header ! already exists, a \exception{uu.Error} is raised. \end{funcdesc} + \begin{excclassdesc}{Error}{} + Subclass of \exception{Exception}, this can be raised by + \function{uu.decode()} under various situations, such as described + above, but also including a badly formated header, or truncated + input file. + \end{excclassdesc} \begin{seealso} From gvanrossum@users.sourceforge.net Fri Aug 17 21:32:38 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 13:32:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.40,2.41 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv21167 Modified Files: typeobject.c Log Message: Weak reference support, closing SF bug #451773. Classes that don't use __slots__ have a __weakref__ member added in the same way as __dict__ is added (i.e. only if the base didn't already have one). Classes using __slots__ can enable weak referenceability by adding '__weakref__' to the __slots__ list. Renamed the __weaklistoffset__ class member to __weakrefoffset__ -- it's not always a list, it seems. (Is tp_weaklistoffset a historical misnomer, or do I misunderstand this?) Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -d -r2.40 -r2.41 *** typeobject.c 2001/08/17 16:47:50 2.40 --- typeobject.c 2001/08/17 20:32:36 2.41 *************** *** 10,14 **** {"__flags__", T_LONG, offsetof(PyTypeObject, tp_flags), READONLY}, {"__doc__", T_STRING, offsetof(PyTypeObject, tp_doc), READONLY}, ! {"__weaklistoffset__", T_LONG, offsetof(PyTypeObject, tp_weaklistoffset), READONLY}, {"__base__", T_OBJECT, offsetof(PyTypeObject, tp_base), READONLY}, --- 10,14 ---- {"__flags__", T_LONG, offsetof(PyTypeObject, tp_flags), READONLY}, {"__doc__", T_STRING, offsetof(PyTypeObject, tp_doc), READONLY}, ! {"__weakrefoffset__", T_LONG, offsetof(PyTypeObject, tp_weaklistoffset), READONLY}, {"__base__", T_OBJECT, offsetof(PyTypeObject, tp_base), READONLY}, *************** *** 202,205 **** --- 202,206 ---- { int dictoffset = self->ob_type->tp_dictoffset; + int weaklistoffset = self->ob_type->tp_weaklistoffset; PyTypeObject *type, *base; destructor f; *************** *** 225,228 **** --- 226,233 ---- } + /* If we added weaklist, we clear it */ + if (weaklistoffset && !base->tp_weaklistoffset) + PyObject_ClearWeakRefs(self); + /* Finalize GC if the base doesn't do GC and we do */ if (PyType_IS_GC(type) && !PyType_IS_GC(base)) *************** *** 456,463 **** extra_ivars(PyTypeObject *type, PyTypeObject *base) { ! int t_size = PyType_BASICSIZE(type); ! int b_size = PyType_BASICSIZE(base); ! assert(t_size >= b_size); /* type smaller than base! */ if (type->tp_itemsize || base->tp_itemsize) { /* If itemsize is involved, stricter rules */ --- 461,468 ---- extra_ivars(PyTypeObject *type, PyTypeObject *base) { ! size_t t_size = PyType_BASICSIZE(type); ! size_t b_size = PyType_BASICSIZE(base); ! assert(t_size >= b_size); /* Else type smaller than base! */ if (type->tp_itemsize || base->tp_itemsize) { /* If itemsize is involved, stricter rules */ *************** *** 465,475 **** type->tp_itemsize != base->tp_itemsize; } ! if (t_size == b_size) ! return 0; ! if (type->tp_dictoffset != 0 && base->tp_dictoffset == 0 && ! type->tp_dictoffset == b_size && ! (size_t)t_size == b_size + sizeof(PyObject *)) ! return 0; /* "Forgive" adding a __dict__ only */ ! return 1; } --- 470,481 ---- type->tp_itemsize != base->tp_itemsize; } ! if (type->tp_weaklistoffset && base->tp_weaklistoffset == 0 && ! type->tp_weaklistoffset + sizeof(PyObject *) == t_size) ! t_size -= sizeof(PyObject *); ! if (type->tp_dictoffset && base->tp_dictoffset == 0 && ! type->tp_dictoffset + sizeof(PyObject *) == t_size) ! t_size -= sizeof(PyObject *); ! ! return t_size != b_size; } *************** *** 501,505 **** etype *et; struct memberlist *mp; ! int i, nbases, nslots, slotoffset, dynamic; /* Special case: type(x) should return x->ob_type */ --- 507,511 ---- etype *et; struct memberlist *mp; ! int i, nbases, nslots, slotoffset, dynamic, add_dict, add_weak; /* Special case: type(x) should return x->ob_type */ *************** *** 614,617 **** --- 620,625 ---- slots = PyDict_GetItemString(dict, "__slots__"); nslots = 0; + add_dict = 0; + add_weak = 0; if (slots != NULL) { /* Make it into a tuple */ *************** *** 630,639 **** return NULL; } } } if (slots == NULL && base->tp_dictoffset == 0 && (base->tp_setattro == PyObject_GenericSetAttr || ! base->tp_setattro == NULL)) ! nslots = 1; /* XXX From here until type is safely allocated, --- 638,654 ---- return NULL; } + /* XXX Check against null bytes in name */ } } if (slots == NULL && base->tp_dictoffset == 0 && (base->tp_setattro == PyObject_GenericSetAttr || ! base->tp_setattro == NULL)) { ! nslots++; ! add_dict++; ! } ! if (slots == NULL && base->tp_weaklistoffset == 0) { ! nslots++; ! add_weak++; ! } /* XXX From here until type is safely allocated, *************** *** 717,730 **** mp->type = T_OBJECT; mp->offset = slotoffset; slotoffset += sizeof(PyObject *); } } ! else if (nslots) { ! type->tp_dictoffset = slotoffset; ! mp->name = "__dict__"; ! mp->type = T_OBJECT; ! mp->offset = slotoffset; ! mp->readonly = 1; ! slotoffset += sizeof(PyObject *); } type->tp_basicsize = slotoffset; --- 732,760 ---- mp->type = T_OBJECT; mp->offset = slotoffset; + if (base->tp_weaklistoffset == 0 && + strcmp(mp->name, "__weakref__") == 0) + type->tp_weaklistoffset = slotoffset; slotoffset += sizeof(PyObject *); } } ! else { ! if (add_dict) { ! type->tp_dictoffset = slotoffset; ! mp->name = "__dict__"; ! mp->type = T_OBJECT; ! mp->offset = slotoffset; ! mp->readonly = 1; ! mp++; ! slotoffset += sizeof(PyObject *); ! } ! if (add_weak) { ! type->tp_weaklistoffset = slotoffset; ! mp->name = "__weakref__"; ! mp->type = T_OBJECT; ! mp->offset = slotoffset; ! mp->readonly = 1; ! mp++; ! slotoffset += sizeof(PyObject *); ! } } type->tp_basicsize = slotoffset; From tim_one@users.sourceforge.net Fri Aug 17 21:47:49 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 13:47:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.267,2.268 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv22472/Python Modified Files: ceval.c Log Message: ceval, PyEval_MergeCompilerFlags: wasn't merging in the CO_FUTURE_DIVISION flag. Redid this to use Jeremy's PyCF_MASK #define instead, so we dont have to remember to fiddle individual feature names here again. pythonrun.h: Also #define a PyCF_MASK_OBSOLETE mask. This isn't used yet, but will be as part of the PEP 264 implementation (compile() mustn't raise an error just because old code uses a flag name that's become obsolete; a warning may be appropriate, but not an error; so compile() has to know about obsolete flags too, but nobody is going to remember to update compile() with individual obsolete flag names across releases either -- i.e., this is the flip side of PyEval_MergeCompilerFlags's oversight). Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.267 retrieving revision 2.268 diff -C2 -d -r2.267 -r2.268 *** ceval.c 2001/08/16 13:15:00 2.267 --- ceval.c 2001/08/17 20:47:47 2.268 *************** *** 2929,2939 **** if (current_frame != NULL) { const int codeflags = current_frame->f_code->co_flags; ! if (codeflags & CO_NESTED) { ! result = 1; ! cf->cf_flags |= CO_NESTED; ! } ! if (codeflags & CO_GENERATOR_ALLOWED) { result = 1; ! cf->cf_flags |= CO_GENERATOR_ALLOWED; } } --- 2929,2936 ---- if (current_frame != NULL) { const int codeflags = current_frame->f_code->co_flags; ! const int compilerflags = codeflags & PyCF_MASK; ! if (compilerflags) { result = 1; ! cf->cf_flags |= compilerflags; } } From tim_one@users.sourceforge.net Fri Aug 17 21:47:49 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 13:47:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include pythonrun.h,2.46,2.47 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv22472/Include Modified Files: pythonrun.h Log Message: ceval, PyEval_MergeCompilerFlags: wasn't merging in the CO_FUTURE_DIVISION flag. Redid this to use Jeremy's PyCF_MASK #define instead, so we dont have to remember to fiddle individual feature names here again. pythonrun.h: Also #define a PyCF_MASK_OBSOLETE mask. This isn't used yet, but will be as part of the PEP 264 implementation (compile() mustn't raise an error just because old code uses a flag name that's become obsolete; a warning may be appropriate, but not an error; so compile() has to know about obsolete flags too, but nobody is going to remember to update compile() with individual obsolete flag names across releases either -- i.e., this is the flip side of PyEval_MergeCompilerFlags's oversight). Index: pythonrun.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v retrieving revision 2.46 retrieving revision 2.47 diff -C2 -d -r2.46 -r2.47 *** pythonrun.h 2001/08/10 21:38:04 2.46 --- pythonrun.h 2001/08/17 20:47:47 2.47 *************** *** 9,12 **** --- 9,14 ---- #define PyCF_MASK (CO_GENERATOR_ALLOWED | CO_FUTURE_DIVISION) + #define PyCF_MASK_OBSOLETE (CO_NESTED) + typedef struct { int cf_flags; /* bitmask of CO_xxx flags relevant to future */ From gvanrossum@users.sourceforge.net Fri Aug 17 22:21:06 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 14:21:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.207,1.208 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv711 Modified Files: NEWS Log Message: Add note on type/class unification. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.207 retrieving revision 1.208 diff -C2 -d -r1.207 -r1.208 *** NEWS 2001/08/17 18:39:24 1.207 --- NEWS 2001/08/17 21:21:04 1.208 *************** *** 24,27 **** --- 24,33 ---- Core + - The type/class unification (PEP 252-253) was integrated into the + trunk and is not so tentative any more (the exact specification of + some features is still tentative). A lot of work has done on fixing + bugs and adding robustness and features (performance still has to + come a long way). + - Warnings about a mismatch in the Python API during extension import now use the Python warning framework (which makes it possible to From gvanrossum@users.sourceforge.net Fri Aug 17 22:27:55 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 14:27:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv2779 Modified Files: test_descr.py Log Message: Add test for weak references. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test_descr.py 2001/08/17 13:58:31 1.18 --- test_descr.py 2001/08/17 21:27:53 1.19 *************** *** 834,838 **** def overloading(): ! if verbose: print "testing operator overloading..." class B(object): --- 834,838 ---- def overloading(): ! if verbose: print "Testing operator overloading..." class B(object): *************** *** 891,895 **** def methods(): ! if verbose: print "testing methods..." class C(object): def __init__(self, x): --- 891,895 ---- def methods(): ! if verbose: print "Testing methods..." class C(object): def __init__(self, x): *************** *** 913,917 **** def specials(): # Test operators like __hash__ for which a built-in default exists ! if verbose: print "testing special operators..." # Test the default behavior for static classes class C(object): --- 913,917 ---- def specials(): # Test operators like __hash__ for which a built-in default exists ! if verbose: print "Testing special operators..." # Test the default behavior for static classes class C(object): *************** *** 1041,1044 **** --- 1041,1073 ---- verify(10 not in p10) + def weakrefs(): + if verbose: print "Testing weak references..." + import weakref + class C(object): + pass + c = C() + r = weakref.ref(c) + verify(r() is c) + del c + verify(r() is None) + del r + class NoWeak(object): + __slots__ = ['foo'] + no = NoWeak() + try: + weakref.ref(no) + except TypeError, msg: + verify(str(msg).find("weakly") >= 0) + else: + verify(0, "weakref.ref(no) should be illegal") + class Weak(object): + __slots__ = ['foo', '__weakref__'] + yes = Weak() + r = weakref.ref(yes) + verify(r() is yes) + del yes + verify(r() is None) + del r + def all(): lists() *************** *** 1069,1072 **** --- 1098,1102 ---- methods() specials() + weakrefs() all() From gvanrossum@users.sourceforge.net Fri Aug 17 22:57:49 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 14:57:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.41,2.42 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv11794 Modified Files: typeobject.c Log Message: Address SF bug #442813. The sequence getitem wrappers should do interpretation of negative indices, since neither the sq_*item slots nor the slot_ wrappers do this. (Slices are a different story, there the size wrapping is done too early.) Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.41 retrieving revision 2.42 diff -C2 -d -r2.41 -r2.42 *** typeobject.c 2001/08/17 20:32:36 2.41 --- typeobject.c 2001/08/17 21:57:47 2.42 *************** *** 1662,1667 **** }; static struct wrapperbase tab_getitem_int[] = { ! {"__getitem__", (wrapperfunc)wrap_intargfunc, "x.__getitem__(i) <==> x[i]"}, {0} --- 1662,1702 ---- }; + static int + getindex(PyObject *self, PyObject *arg) + { + int i; + + i = PyInt_AsLong(arg); + if (i == -1 && PyErr_Occurred()) + return -1; + if (i < 0) { + PySequenceMethods *sq = self->ob_type->tp_as_sequence; + if (sq && sq->sq_length) { + int n = (*sq->sq_length)(self); + if (n < 0) + return -1; + i += n; + } + } + return i; + } + + static PyObject * + wrap_sq_item(PyObject *self, PyObject *args, void *wrapped) + { + intargfunc func = (intargfunc)wrapped; + PyObject *arg; + int i; + + if (!PyArg_ParseTuple(args, "O", &arg)) + return NULL; + i = getindex(self, arg); + if (i == -1 && PyErr_Occurred()) + return NULL; + return (*func)(self, i); + } + static struct wrapperbase tab_getitem_int[] = { ! {"__getitem__", (wrapperfunc)wrap_sq_item, "x.__getitem__(i) <==> x[i]"}, {0} *************** *** 1686,1697 **** static PyObject * ! wrap_intobjargproc(PyObject *self, PyObject *args, void *wrapped) { intobjargproc func = (intobjargproc)wrapped; int i, res; ! PyObject *value; ! if (!PyArg_ParseTuple(args, "iO", &i, &value)) return NULL; res = (*func)(self, i, value); if (res == -1 && PyErr_Occurred()) --- 1721,1735 ---- static PyObject * ! wrap_sq_setitem(PyObject *self, PyObject *args, void *wrapped) { intobjargproc func = (intobjargproc)wrapped; int i, res; ! PyObject *arg, *value; ! if (!PyArg_ParseTuple(args, "OO", &arg, &value)) return NULL; + i = getindex(self, arg); + if (i == -1 && PyErr_Occurred()) + return NULL; res = (*func)(self, i, value); if (res == -1 && PyErr_Occurred()) *************** *** 1702,1712 **** static PyObject * ! wrap_delitem_int(PyObject *self, PyObject *args, void *wrapped) { intobjargproc func = (intobjargproc)wrapped; int i, res; ! if (!PyArg_ParseTuple(args, "i", &i)) return NULL; res = (*func)(self, i, NULL); if (res == -1 && PyErr_Occurred()) --- 1740,1754 ---- static PyObject * ! wrap_sq_delitem(PyObject *self, PyObject *args, void *wrapped) { intobjargproc func = (intobjargproc)wrapped; int i, res; + PyObject *arg; ! if (!PyArg_ParseTuple(args, "O", &arg)) return NULL; + i = getindex(self, arg); + if (i == -1 && PyErr_Occurred()) + return NULL; res = (*func)(self, i, NULL); if (res == -1 && PyErr_Occurred()) *************** *** 1717,1723 **** static struct wrapperbase tab_setitem_int[] = { ! {"__setitem__", (wrapperfunc)wrap_intobjargproc, "x.__setitem__(i, y) <==> x[i]=y"}, ! {"__delitem__", (wrapperfunc)wrap_delitem_int, "x.__delitem__(y) <==> del x[y]"}, {0} --- 1759,1765 ---- static struct wrapperbase tab_setitem_int[] = { ! {"__setitem__", (wrapperfunc)wrap_sq_setitem, "x.__setitem__(i, y) <==> x[i]=y"}, ! {"__delitem__", (wrapperfunc)wrap_sq_delitem, "x.__delitem__(y) <==> del x[y]"}, {0} From loewis@users.sourceforge.net Fri Aug 17 23:08:37 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 17 Aug 2001 15:08:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_b1.py,1.38,1.39 test_format.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14522 Modified Files: test_b1.py test_format.py Log Message: Use raw-unicode-escape for the tests that require it. Index: test_b1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b1.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** test_b1.py 2001/08/17 18:39:24 1.38 --- test_b1.py 2001/08/17 22:08:34 1.39 *************** *** 257,261 **** if float(unicode(" 3.14 ")) != 3.14: raise TestFailed, 'float(u" 3.14 ")' ! if float(unicode(" \u0663.\u0661\u0664 ")) != 3.14: raise TestFailed, 'float(u" \u0663.\u0661\u0664 ")' --- 257,261 ---- if float(unicode(" 3.14 ")) != 3.14: raise TestFailed, 'float(u" 3.14 ")' ! if float(unicode(" \u0663.\u0661\u0664 ",'raw-unicode-escape')) != 3.14: raise TestFailed, 'float(u" \u0663.\u0661\u0664 ")' *************** *** 364,368 **** (unicode('314'), 314), (unicode(' 314'), 314), ! (unicode('\u0663\u0661\u0664 '), 314), (unicode(' \t\t 314 \t\t '), 314), (unicode(' 1x'), ValueError), --- 364,368 ---- (unicode('314'), 314), (unicode(' 314'), 314), ! (unicode('\u0663\u0661\u0664 ','raw-unicode-escape'), 314), (unicode(' \t\t 314 \t\t '), 314), (unicode(' 1x'), ValueError), Index: test_format.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_format.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_format.py 2001/08/17 18:39:24 1.12 --- test_format.py 2001/08/17 22:08:34 1.13 *************** *** 215,218 **** "unsupported format character 'a' (0x61) at index 5") if have_unicode: ! test_exc(unicode('abc %\u3000'), 1, ValueError, "unsupported format character '?' (0x3000) at index 5") --- 215,218 ---- "unsupported format character 'a' (0x61) at index 5") if have_unicode: ! test_exc(unicode('abc %\u3000','raw-unicode-escape'), 1, ValueError, "unsupported format character '?' (0x3000) at index 5") From tim_one@users.sourceforge.net Fri Aug 17 23:11:29 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 15:11:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.208,1.209 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv14737/python/Misc Modified Files: NEWS Log Message: A fiddled version of the rest of Michael Hudson's SF patch #449043 supporting __future__ in simulated shells which implements PEP 264. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.208 retrieving revision 1.209 diff -C2 -d -r1.208 -r1.209 *** NEWS 2001/08/17 21:21:04 1.208 --- NEWS 2001/08/17 22:11:27 1.209 *************** *** 24,27 **** --- 24,32 ---- Core + - Future statements are now effective in simulated interactive shells + (like IDLE). This should "just work" by magic, but read Michael + Hudson's "Future statements in simulated shells" PEP 264 for full + details: . + - The type/class unification (PEP 252-253) was integrated into the trunk and is not so tentative any more (the exact specification of From tim_one@users.sourceforge.net Fri Aug 17 23:11:30 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 15:11:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.227,2.228 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv14737/python/Python Modified Files: bltinmodule.c Log Message: A fiddled version of the rest of Michael Hudson's SF patch #449043 supporting __future__ in simulated shells which implements PEP 264. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.227 retrieving revision 2.228 diff -C2 -d -r2.227 -r2.228 *** bltinmodule.c 2001/08/17 18:39:25 2.227 --- bltinmodule.c 2001/08/17 22:11:27 2.228 *************** *** 378,385 **** char *startstr; int start; PyCompilerFlags cf; ! if (!PyArg_ParseTuple(args, "sss:compile", &str, &filename, &startstr)) return NULL; if (strcmp(startstr, "exec") == 0) start = Py_file_input; --- 378,389 ---- char *startstr; int start; + int dont_inherit = 0; + int supplied_flags = 0; PyCompilerFlags cf; ! if (!PyArg_ParseTuple(args, "sss|ii:compile", &str, &filename, ! &startstr, &supplied_flags, &dont_inherit)) return NULL; + if (strcmp(startstr, "exec") == 0) start = Py_file_input; *************** *** 393,405 **** return NULL; } ! cf.cf_flags = 0; ! if (PyEval_MergeCompilerFlags(&cf)) ! return Py_CompileStringFlags(str, filename, start, &cf); ! else ! return Py_CompileString(str, filename, start); } static char compile_doc[] = ! "compile(source, filename, mode) -> code object\n\ \n\ Compile the source string (a Python module, statement or expression)\n\ --- 397,417 ---- return NULL; } ! ! if (supplied_flags & ~(PyCF_MASK | PyCF_MASK_OBSOLETE)) { ! PyErr_SetString(PyExc_ValueError, ! "compile(): unrecognised flags"); ! return NULL; ! } ! /* XXX Warn if (supplied_flags & PyCF_MASK_OBSOLETE) != 0? */ ! ! cf.cf_flags = supplied_flags; ! if (!dont_inherit) { ! PyEval_MergeCompilerFlags(&cf); ! } ! return Py_CompileStringFlags(str, filename, start, &cf); } static char compile_doc[] = ! "compile(source, filename, mode[, flags[, dont_inherit]]) -> code object\n\ \n\ Compile the source string (a Python module, statement or expression)\n\ *************** *** 407,411 **** The filename will be used for run-time error messages.\n\ The mode must be 'exec' to compile a module, 'single' to compile a\n\ ! single (interactive) statement, or 'eval' to compile an expression."; --- 419,429 ---- The filename will be used for run-time error messages.\n\ The mode must be 'exec' to compile a module, 'single' to compile a\n\ ! single (interactive) statement, or 'eval' to compile an expression.\n\ ! The flags argument, if present, controls which future statements influence\n\ ! the compilation of the code.\n\ ! The dont_inherit argument, if non-zero, stops the compilation inheriting\n\ ! the effects of any future statements in effect in the code calling\n\ ! compile; if absent or zero these statements do influence the compilation,\n\ ! in addition to any features explicitly specified."; From tim_one@users.sourceforge.net Fri Aug 17 23:11:29 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 15:11:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib code.py,1.16,1.17 codeop.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14737/python/Lib Modified Files: code.py codeop.py Log Message: A fiddled version of the rest of Michael Hudson's SF patch #449043 supporting __future__ in simulated shells which implements PEP 264. Index: code.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/code.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** code.py 2001/05/03 04:58:49 1.16 --- code.py 2001/08/17 22:11:27 1.17 *************** *** 8,14 **** import sys import traceback ! from codeop import compile_command ! __all__ = ["InteractiveInterpreter","InteractiveConsole","interact", "compile_command"] --- 8,14 ---- import sys import traceback ! from codeop import CommandCompiler, compile_command ! __all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_command"] *************** *** 46,49 **** --- 46,50 ---- locals = {"__name__": "__console__", "__doc__": None} self.locals = locals + self.compile = CommandCompiler() def runsource(self, source, filename="", symbol="single"): *************** *** 72,76 **** """ try: ! code = compile_command(source, filename, symbol) except (OverflowError, SyntaxError, ValueError): # Case 1 --- 73,77 ---- """ try: ! code = self.compile(source, filename, symbol) except (OverflowError, SyntaxError, ValueError): # Case 1 Index: codeop.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/codeop.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** codeop.py 2001/04/08 00:43:13 1.4 --- codeop.py 2001/08/17 22:11:27 1.5 *************** *** 1,48 **** ! """Utility to compile possibly incomplete Python source code.""" ! __all__ = ["compile_command"] ! def compile_command(source, filename="", symbol="single"): ! r"""Compile a command and determine whether it is incomplete. ! Arguments: ! source -- the source string; may contain \n characters ! filename -- optional filename from which source was read; default "" ! symbol -- optional grammar start symbol; "single" (default) or "eval" ! Return value / exceptions raised: ! - Return a code object if the command is complete and valid ! - Return None if the command is incomplete ! - Raise SyntaxError or OverflowError if the command is a syntax error ! (OverflowError if the error is in a numeric constant) ! Approach: ! First, check if the source consists entirely of blank lines and ! comments; if so, replace it with 'pass', because the built-in ! parser doesn't always do the right thing for these. ! Compile three times: as is, with \n, and with \n\n appended. If ! it compiles as is, it's complete. If it compiles with one \n ! appended, we expect more. If it doesn't compile either way, we ! compare the error we get when compiling with \n or \n\n appended. ! If the errors are the same, the code is broken. But if the errors ! are different, we expect more. Not intuitive; not even guaranteed ! to hold in future releases; but this matches the compiler's ! behavior from Python 1.4 through 1.5.2, at least. ! Caveat: ! It is possible (but not likely) that the parser stops parsing ! with a successful outcome before reaching the end of the source; ! in this case, trailing symbols may be ignored instead of causing an ! error. For example, a backslash followed by two newlines may be ! followed by arbitrary garbage. This will be fixed once the API ! for the parser is better. ! """ # Check for source consisting of only blank lines and comments for line in source.split("\n"): --- 1,68 ---- ! r"""Utilities to compile possibly incomplete Python source code. ! This module provides two interfaces, broadly similar to the builtin ! function compile(), that take progam text, a filename and a 'mode' ! and: ! - Return a code object if the command is complete and valid ! - Return None if the command is incomplete ! - Raise SyntaxError, ValueError or OverflowError if the command is a ! syntax error (OverflowError and ValueError can be produced by ! malformed literals). ! Approach: ! First, check if the source consists entirely of blank lines and ! comments; if so, replace it with 'pass', because the built-in ! parser doesn't always do the right thing for these. ! Compile three times: as is, with \n, and with \n\n appended. If it ! compiles as is, it's complete. If it compiles with one \n appended, ! we expect more. If it doesn't compile either way, we compare the ! error we get when compiling with \n or \n\n appended. If the errors ! are the same, the code is broken. But if the errors are different, we ! expect more. Not intuitive; not even guaranteed to hold in future ! releases; but this matches the compiler's behavior from Python 1.4 ! through 2.2, at least. ! Caveat: ! It is possible (but not likely) that the parser stops parsing with a ! successful outcome before reaching the end of the source; in this ! case, trailing symbols may be ignored instead of causing an error. ! For example, a backslash followed by two newlines may be followed by ! arbitrary garbage. This will be fixed once the API for the parser is ! better. ! The two interfaces are: ! compile_command(source, filename, symbol): ! Compiles a single command in the manner described above. ! CommandCompiler(): ! Instances of this class have __call__ methods identical in ! signature to compile_command; the difference is that if the ! instance compiles program text containing a __future__ statement, ! the instance 'remembers' and compiles all subsequent program texts ! with the statement in force. ! ! The module also provides another class: ! ! Compile(): ! ! Instances of this class act like the built-in function compile, ! but with 'memory' in the sense described above. ! """ ! ! import __future__ ! ! _features = [getattr(__future__, fname) ! for fname in __future__.all_feature_names] ! ! __all__ = ["compile_command", "Compile", "CommandCompiler"] + def _maybe_compile(compiler, source, filename, symbol): # Check for source consisting of only blank lines and comments for line in source.split("\n"): *************** *** 57,71 **** try: ! code = compile(source, filename, symbol) except SyntaxError, err: pass try: ! code1 = compile(source + "\n", filename, symbol) except SyntaxError, err1: pass try: ! code2 = compile(source + "\n\n", filename, symbol) except SyntaxError, err2: pass --- 77,91 ---- try: ! code = compiler(source, filename, symbol) except SyntaxError, err: pass try: ! code1 = compiler(source + "\n", filename, symbol) except SyntaxError, err1: pass try: ! code2 = compiler(source + "\n\n", filename, symbol) except SyntaxError, err2: pass *************** *** 83,84 **** --- 103,170 ---- if not code1 and e1 == e2: raise SyntaxError, err1 + + def compile_command(source, filename="", symbol="single"): + r"""Compile a command and determine whether it is incomplete. + + Arguments: + + source -- the source string; may contain \n characters + filename -- optional filename from which source was read; default + "" + symbol -- optional grammar start symbol; "single" (default) or "eval" + + Return value / exceptions raised: + + - Return a code object if the command is complete and valid + - Return None if the command is incomplete + - Raise SyntaxError, ValueError or OverflowError if the command is a + syntax error (OverflowError and ValueError can be produced by + malformed literals). + """ + return _maybe_compile(compile, source, filename, symbol) + + class Compile: + """Instances of this class behave much like the built-in compile + function, but if one is used to compile text containing a future + statement, it "remembers" and compiles all subsequent program texts + with the statement in force.""" + def __init__(self): + self.flags = 0 + + def __call__(self, source, filename, symbol): + codeob = compile(source, filename, symbol, self.flags, 1) + for feature in _features: + if codeob.co_flags & feature.compiler_flag: + self.flags |= feature.compiler_flag + return codeob + + class CommandCompiler: + """Instances of this class have __call__ methods identical in + signature to compile_command; the difference is that if the + instance compiles program text containing a __future__ statement, + the instance 'remembers' and compiles all subsequent program texts + with the statement in force.""" + + def __init__(self,): + self.compiler = Compile() + + def __call__(self, source, filename="", symbol="single"): + r"""Compile a command and determine whether it is incomplete. + + Arguments: + + source -- the source string; may contain \n characters + filename -- optional filename from which source was read; + default "" + symbol -- optional grammar start symbol; "single" (default) or + "eval" + + Return value / exceptions raised: + + - Return a code object if the command is complete and valid + - Return None if the command is incomplete + - Raise SyntaxError, ValueError or OverflowError if the command is a + syntax error (OverflowError and ValueError can be produced by + malformed literals). + """ + return _maybe_compile(self.compiler, source, filename, symbol) From jackjansen@users.sourceforge.net Fri Aug 17 23:37:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 17 Aug 2001 15:37:04 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.53,1.54 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv20318 Modified Files: Makefile.pre.in Log Message: The OSX framework Headers symlink pointed the wrong way. Fixed. Bill Fancher found this one. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Makefile.pre.in 2001/08/17 18:39:24 1.53 --- Makefile.pre.in 2001/08/17 22:37:02 1.54 *************** *** 772,776 **** fi; \ done ! $(LN) -sf $(FRAMEWORKFINALDEST)/Headers $(INCLUDEPY) $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKFINALDEST)/Resources/Info.plist $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKFINALDEST)/Resources/version.plist --- 772,776 ---- fi; \ done ! $(LN) -sf $(INCLUDEPY) $(FRAMEWORKFINALDEST)/Headers $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKFINALDEST)/Resources/Info.plist $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKFINALDEST)/Resources/version.plist From tim_one@users.sourceforge.net Fri Aug 17 23:42:28 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 15:42:28 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0236.txt,1.9,1.10 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv21341 Modified Files: pep-0236.txt Log Message: Record that PEP 264 resolved some open issues left hanging in 236. Index: pep-0236.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0236.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pep-0236.txt 2001/08/01 20:11:56 1.9 --- pep-0236.txt 2001/08/17 22:42:26 1.10 *************** *** 215,219 **** ! Paritally Resolved Problem: Runtime Compilation Several Python features can compile code during a module's runtime: --- 215,219 ---- ! Resolved Problem: Runtime Compilation Several Python features can compile code during a module's runtime: *************** *** 235,239 **** use M's choices, not necessarily the doctest module's choices. In the 2.1 release, this isn't possible, and no scheme has yet been suggested ! for working around this. In any case, a future_statement appearing "near the top" (see Syntax --- 235,240 ---- use M's choices, not necessarily the doctest module's choices. In the 2.1 release, this isn't possible, and no scheme has yet been suggested ! for working around this. NOTE: PEP 264 later addressed this in a ! flexible way, by adding optional arguments to compile(). In any case, a future_statement appearing "near the top" (see Syntax *************** *** 262,266 **** ! Unresolved Problem: Simulated Interactive Shells Interactive shells "built by hand" (by tools such as IDLE and the Emacs --- 263,267 ---- ! Resolved Problem: Simulated Interactive Shells Interactive shells "built by hand" (by tools such as IDLE and the Emacs *************** *** 270,274 **** own interactive shells to achieve the desired behavior. ! XXX interactive shell and -i; interactive shell and -c Questions and Answers --- 271,279 ---- own interactive shells to achieve the desired behavior. ! NOTE: PEP 264 later addressed this, by adding intelligence to the ! standard codeop.py. Simulated shells that don't use the standard ! library shell helpers can get a similar effect by exploiting the ! new optional arguments to compile() added by PEP 264. ! Questions and Answers From bwarsaw@users.sourceforge.net Fri Aug 17 23:43:51 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 17 Aug 2001 15:43:51 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.126,1.127 pep-0264.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv21676 Modified Files: pep-0000.txt pep-0264.txt Log Message: Tim sez: "Future statements in simulated shells" should move from Open to Accepted. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** pep-0000.txt 2001/08/15 05:46:40 1.126 --- pep-0000.txt 2001/08/17 22:43:49 1.127 *************** *** 60,64 **** S 262 Database of Installed Python Packages Kuchling S 263 Defining Python Source Code Encodings Lemburg - S 264 Future statements in simulated shells Hudson S 265 Sorting Dictionaries by Value Griffin --- 60,63 ---- *************** *** 111,114 **** --- 110,114 ---- SF 260 Simplify xrange() van Rossum S 261 Support for "wide" Unicode characters Prescod + SA 264 Future statements in simulated shells Hudson Empty PEPs (or containing only an abstract) *************** *** 211,215 **** S 262 Database of Installed Python Packages Kuchling S 263 Defining Python Source Code Encodings Lemburg ! S 264 Future statements in simulated shells Hudson S 265 Sorting Dictionaries by Value Griffin S 266 Optimizing Global Variable/Attribute Access Montanaro --- 211,215 ---- S 262 Database of Installed Python Packages Kuchling S 263 Defining Python Source Code Encodings Lemburg ! SA 264 Future statements in simulated shells Hudson S 265 Sorting Dictionaries by Value Griffin S 266 Optimizing Global Variable/Attribute Access Montanaro Index: pep-0264.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0264.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pep-0264.txt 2001/08/12 10:58:19 1.4 --- pep-0264.txt 2001/08/17 22:43:49 1.5 *************** *** 3,7 **** Version: 3 Author: Michael Hudson ! Status: Draft Type: Standards Track Requires: 236 --- 3,7 ---- Version: 3 Author: Michael Hudson ! Status: Accepted Type: Standards Track Requires: 236 From tim_one@users.sourceforge.net Sat Aug 18 00:05:01 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 16:05:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_binop.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv25922/python/Lib/test Modified Files: test_binop.py Log Message: Fix for bug [#452230] future division isn't propagated. builtin_eval wasn't merging in the compiler flags from the current frame; I suppose we never noticed this before because future division is the first future-feature that can affect expressions (nested_scopes and generators had only statement-level effects). Index: test_binop.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_binop.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_binop.py 2001/08/08 22:27:20 1.1 --- test_binop.py 2001/08/17 23:04:59 1.2 *************** *** 336,339 **** --- 336,340 ---- self.assertEqual(3.0 * Rat(1, 2), 1.5) self.assertEqual(Rat(1, 2) * 3.0, 1.5) + self.assertEqual(eval('1/2'), 0.5) """ From tim_one@users.sourceforge.net Sat Aug 18 00:05:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 16:05:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.228,2.229 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv25922/python/Python Modified Files: bltinmodule.c Log Message: Fix for bug [#452230] future division isn't propagated. builtin_eval wasn't merging in the compiler flags from the current frame; I suppose we never noticed this before because future division is the first future-feature that can affect expressions (nested_scopes and generators had only statement-level effects). Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.228 retrieving revision 2.229 diff -C2 -d -r2.228 -r2.229 *** bltinmodule.c 2001/08/17 22:11:27 2.228 --- bltinmodule.c 2001/08/17 23:04:59 2.229 *************** *** 524,527 **** --- 524,528 ---- PyObject *globals = Py_None, *locals = Py_None; char *str; + PyCompilerFlags cf; if (!PyArg_ParseTuple(args, "O|O!O!:eval", *************** *** 537,540 **** --- 538,542 ---- else if (locals == Py_None) locals = globals; + if (PyDict_GetItemString(globals, "__builtins__") == NULL) { if (PyDict_SetItemString(globals, "__builtins__", *************** *** 542,545 **** --- 544,548 ---- return NULL; } + if (PyCode_Check(cmd)) { if (PyTuple_GET_SIZE(((PyCodeObject *)cmd)->co_freevars) > 0) { *************** *** 550,553 **** --- 553,557 ---- return PyEval_EvalCode((PyCodeObject *) cmd, globals, locals); } + if (!PyString_Check(cmd) && !PyUnicode_Check(cmd)) { *************** *** 560,564 **** while (*str == ' ' || *str == '\t') str++; ! return PyRun_String(str, Py_eval_input, globals, locals); } --- 564,571 ---- while (*str == ' ' || *str == '\t') str++; ! ! cf.cf_flags = 0; ! (void)PyEval_MergeCompilerFlags(&cf); ! return PyRun_StringFlags(str, Py_eval_input, globals, locals, &cf); } From jhylton@users.sourceforge.net Sat Aug 18 01:04:33 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 17 Aug 2001 17:04:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler transformer.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv3481 Modified Files: transformer.py Log Message: Add Yield() statement handler Fix Module() handler to avoid including the doc string in the AST Index: transformer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/transformer.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** transformer.py 2001/04/11 16:22:26 1.21 --- transformer.py 2001/08/18 00:04:31 1.22 *************** *** 154,159 **** def file_input(self, nodelist): doc = self.get_docstring(nodelist, symbol.file_input) stmts = [] ! for node in nodelist: if node[0] != token.ENDMARKER and node[0] != token.NEWLINE: self.com_append_stmt(stmts, node) --- 154,163 ---- def file_input(self, nodelist): doc = self.get_docstring(nodelist, symbol.file_input) + if doc is not None: + i = 1 + else: + i = 0 stmts = [] ! for node in nodelist[i:]: if node[0] != token.ENDMARKER and node[0] != token.NEWLINE: self.com_append_stmt(stmts, node) *************** *** 341,344 **** --- 345,353 ---- return n + def yield_stmt(self, nodelist): + n = Yield(self.com_node(nodelist[1])) + n.lineno = nodelist[0][2] + return n + def raise_stmt(self, nodelist): # raise: [test [',' test [',' test]]] *************** *** 1246,1249 **** --- 1255,1259 ---- symbol.return_stmt, symbol.raise_stmt, + symbol.yield_stmt, symbol.import_stmt, symbol.global_stmt, From tim_one@users.sourceforge.net Sat Aug 18 01:05:56 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 17 Aug 2001 17:05:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib doctest.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv2375/python/Lib Modified Files: doctest.py Log Message: Remove the horrid generators hack from doctest.py. This relies on a somewhat less horrid hack : if a module does from __future__ import X then the module dict D is left in a state such that (viewing X as a string) D[X] is getattr(__future__, X) So by examining D for all the names of future features, and making that test for each, we can make a darned good guess as to which future-features were imported by the module. The appropriate flags are then sucked out of the __future__ module, and passed on to compile()'s new optional arguments (PEP 264). Also gave doctest a meaningful __all__, removed the history of changes (CVS serves that purpose now), and removed the __version__ vrbl (similarly; before CVS, it was a reasonable clue, but not anymore). Index: doctest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** doctest.py 2001/07/16 18:39:58 1.16 --- doctest.py 2001/08/18 00:05:50 1.17 *************** *** 1,3 **** ! # Module doctest version 0.9.7 # Released to the public domain 16-Jan-2001, # by Tim Peters (tim.one@home.com). --- 1,3 ---- ! # Module doctest. # Released to the public domain 16-Jan-2001, # by Tim Peters (tim.one@home.com). *************** *** 294,362 **** Test passed. """ - - # 0,0,1 06-Mar-1999 - # initial version posted - # 0,0,2 06-Mar-1999 - # loosened parsing: - # cater to stinkin' tabs - # don't insist on a blank after PS2 prefix - # so trailing "... " line from a compound stmt no longer - # breaks if the file gets whitespace-trimmed - # better error msgs for inconsistent leading whitespace - # 0,9,1 08-Mar-1999 - # exposed the Tester class and added client methods - # plus docstring examples of their use (eww - head-twisting!) - # fixed logic error in reporting total # of tests & failures - # added __test__ support to testmod (a pale reflection of Christian - # Tismer's vision ...) - # removed the "deep" argument; fiddle __test__ instead - # simplified endcase logic for extracting tests, and running them. - # before, if no output was expected but some was produced - # anyway via an eval'ed result, the discrepancy wasn't caught - # made TestClass private and used __test__ to get at it - # many doc updates - # speed _SpoofOut for long expected outputs - # 0,9,2 09-Mar-1999 - # throw out comments from examples, enabling use of the much simpler - # exec compile(... "single") ... - # for simulating the runtime; that barfs on comment-only lines - # used the traceback module to do a much better job of reporting - # exceptions - # run __doc__ values thru str(), "just in case" - # privateness of names now determined by an overridable "isprivate" - # function - # by default a name now considered to be private iff it begins with - # an underscore but doesn't both begin & end with two of 'em; so - # e.g. Class.__init__ etc are searched now -- as they always - # should have been - # 0,9,3 18-Mar-1999 - # added .flush stub to _SpoofOut (JPython buglet diagnosed by - # Hugh Emberson) - # repaired ridiculous docs about backslashes in examples - # minor internal changes - # changed source to Unix line-end conventions - # moved __test__ logic into new Tester.run__test__ method - # 0,9,4 27-Mar-1999 - # report item name and line # in failing examples - # 0,9,5 29-Jun-1999 - # allow straightforward exceptions in examples - thanks to Mark Hammond! - # 0,9,6 16-Jan-2001 - # fiddling for changes in Python 2.0: some of the embedded docstring - # examples no longer worked *exactly* as advertised, due to minor - # language changes, and running doctest on itself pointed that out. - # Hard to think of a better example of why this is useful . - # 0,9,7 9-Feb-2001 - # string method conversion ! # XXX Until generators are part of the language, examples in doctest'ed ! # modules will inherit doctest's __future__ settings (see PEP 236 for ! # more on that). In the absence of a better working idea, the std ! # test suite needs generators, while the set of doctest'ed modules that ! # don't use "yield" in a generator context may well be empty. So ! # enable generators here. This can go away when generators are no ! # longer optional. ! from __future__ import generators ! __version__ = 0, 9, 7 import types --- 294,306 ---- Test passed. """ ! __all__ = [ ! 'testmod', ! 'run_docstring_examples', ! 'is_private', ! 'Tester', ! ] ! import __future__ import types *************** *** 376,381 **** del re - __all__ = [] - # Extract interactive examples from a string. Return a list of triples, # (source, outcome, lineno). "source" is the source code, and ends --- 320,323 ---- *************** *** 488,492 **** # that captures the examples' std output. Return (#failures, #tries). ! def _run_examples_inner(out, fakeout, examples, globs, verbose, name): import sys, traceback OK, BOOM, FAIL = range(3) --- 430,435 ---- # that captures the examples' std output. Return (#failures, #tries). ! def _run_examples_inner(out, fakeout, examples, globs, verbose, name, ! compileflags): import sys, traceback OK, BOOM, FAIL = range(3) *************** *** 500,504 **** fakeout.clear() try: ! exec compile(source, "", "single") in globs got = fakeout.get() state = OK --- 443,448 ---- fakeout.clear() try: ! exec compile(source, "", "single", ! compileflags, 1) in globs got = fakeout.get() state = OK *************** *** 539,546 **** return failures, len(examples) # Run list of examples, in a shallow copy of context (dict) globs. # Return (#failures, #tries). ! def _run_examples(examples, globs, verbose, name): import sys saveout = sys.stdout --- 483,501 ---- return failures, len(examples) + # Get the future-flags associated with the future features that have been + # imported into globs. + + def _extract_future_flags(globs): + flags = 0 + for fname in __future__.all_feature_names: + feature = globs.get(fname, None) + if feature is getattr(__future__, fname): + flags |= feature.compiler_flag + return flags + # Run list of examples, in a shallow copy of context (dict) globs. # Return (#failures, #tries). ! def _run_examples(examples, globs, verbose, name, compileflags): import sys saveout = sys.stdout *************** *** 549,553 **** sys.stdout = fakeout = _SpoofOut() x = _run_examples_inner(saveout.write, fakeout, examples, ! globs, verbose, name) finally: sys.stdout = saveout --- 504,508 ---- sys.stdout = fakeout = _SpoofOut() x = _run_examples_inner(saveout.write, fakeout, examples, ! globs, verbose, name, compileflags) finally: sys.stdout = saveout *************** *** 563,567 **** return x ! def run_docstring_examples(f, globs, verbose=0, name="NoName"): """f, globs, verbose=0, name="NoName" -> run examples from f.__doc__. --- 518,523 ---- return x ! def run_docstring_examples(f, globs, verbose=0, name="NoName", ! compileflags=None): """f, globs, verbose=0, name="NoName" -> run examples from f.__doc__. *************** *** 588,592 **** if not e: return 0, 0 ! return _run_examples(e, globs, verbose, name) def is_private(prefix, base): --- 544,550 ---- if not e: return 0, 0 ! if compileflags is None: ! compileflags = _extract_future_flags(globs) ! return _run_examples(e, globs, verbose, name, compileflags) def is_private(prefix, base): *************** *** 725,728 **** --- 683,688 ---- self.name2ft = {} # map name to (#failures, #trials) pair + self.compileflags = _extract_future_flags(globs) + def runstring(self, s, name): """ *************** *** 756,760 **** e = _extract_examples(s) if e: ! f, t = _run_examples(e, self.globs, self.verbose, name) if self.verbose: print f, "of", t, "examples failed in string", name --- 716,721 ---- e = _extract_examples(s) if e: ! f, t = _run_examples(e, self.globs, self.verbose, name, ! self.compileflags) if self.verbose: print f, "of", t, "examples failed in string", name *************** *** 794,798 **** if self.verbose: print "Running", name + ".__doc__" ! f, t = run_docstring_examples(object, self.globs, self.verbose, name) if self.verbose: print f, "of", t, "examples failed in", name + ".__doc__" --- 755,760 ---- if self.verbose: print "Running", name + ".__doc__" ! f, t = run_docstring_examples(object, self.globs, self.verbose, name, ! self.compileflags) if self.verbose: print f, "of", t, "examples failed in", name + ".__doc__" From jhylton@users.sourceforge.net Sat Aug 18 01:07:17 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 17 Aug 2001 17:07:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler ast.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv3924 Modified Files: ast.py Log Message: Add Yield() node Index: ast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/ast.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ast.py 2001/08/14 21:18:30 1.13 --- ast.py 2001/08/18 00:07:14 1.14 *************** *** 3,6 **** --- 3,9 ---- This file is automatically generated. """ + # XXX performance issues: + # 1. getChildren() could be more efficient for many cases + from types import TupleType, ListType from consts import CO_VARARGS, CO_VARKEYWORDS *************** *** 483,486 **** --- 486,498 ---- def __repr__(self): return "Return(%s)" % (repr(self.value),) + + class Yield(Node): + nodes["yield"] = "Yield" + def __init__(self, value): + self.value = value + def _getChildren(self): + return self.value, + def __repr__(self): + return "Yield(%s)" % repr(self.value) class Add(Node): From jhylton@users.sourceforge.net Sat Aug 18 01:07:48 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 17 Aug 2001 17:07:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler future.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv4004 Modified Files: future.py Log Message: Track removal of doc string from Module().nodes[0] Index: future.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/future.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** future.py 2001/04/09 04:28:48 1.1 --- future.py 2001/08/18 00:07:46 1.2 *************** *** 16,20 **** class FutureParser: ! features = ("nested_scopes",) def __init__(self): --- 16,20 ---- class FutureParser: ! features = ("nested_scopes", "generators", "division") def __init__(self): *************** *** 22,32 **** def visitModule(self, node): - if node.doc is None: - off = 0 - else: - off = 1 - stmt = node.node ! for s in stmt.nodes[off:]: if not self.check_stmt(s): break --- 22,27 ---- def visitModule(self, node): stmt = node.node ! for s in stmt.nodes: if not self.check_stmt(s): break From jhylton@users.sourceforge.net Sat Aug 18 01:14:39 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 17 Aug 2001 17:14:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler ast.py,1.14,1.15 astgen.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv5137 Modified Files: ast.py astgen.py Log Message: Generate correct reprs for Mul, Add, etc. Index: ast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/ast.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ast.py 2001/08/18 00:07:14 1.14 --- ast.py 2001/08/18 00:14:37 1.15 *************** *** 3,9 **** This file is automatically generated. """ - # XXX performance issues: - # 1. getChildren() could be more efficient for many cases - from types import TupleType, ListType from consts import CO_VARARGS, CO_VARKEYWORDS --- 3,6 ---- *************** *** 194,198 **** return self.left, self.right def __repr__(self): ! return "Sub(%s, %s)" % (repr(self.left), repr(self.right)) class ListCompIf(Node): --- 191,195 ---- return self.left, self.right def __repr__(self): ! return "Sub((%s, %s))" % (repr(self.left), repr(self.right)) class ListCompIf(Node): *************** *** 213,217 **** return self.left, self.right def __repr__(self): ! return "Div(%s, %s)" % (repr(self.left), repr(self.right)) class Discard(Node): --- 210,214 ---- return self.left, self.right def __repr__(self): ! return "Div((%s, %s))" % (repr(self.left), repr(self.right)) class Discard(Node): *************** *** 241,245 **** return self.left, self.right def __repr__(self): ! return "RightShift(%s, %s)" % (repr(self.left), repr(self.right)) class Continue(Node): --- 238,242 ---- return self.left, self.right def __repr__(self): ! return "RightShift((%s, %s))" % (repr(self.left), repr(self.right)) class Continue(Node): *************** *** 281,285 **** return self.left, self.right def __repr__(self): ! return "LeftShift(%s, %s)" % (repr(self.left), repr(self.right)) class Mul(Node): --- 278,282 ---- return self.left, self.right def __repr__(self): ! return "LeftShift((%s, %s))" % (repr(self.left), repr(self.right)) class Mul(Node): *************** *** 291,295 **** return self.left, self.right def __repr__(self): ! return "Mul(%s, %s)" % (repr(self.left), repr(self.right)) class Yield(Node): --- 288,292 ---- return self.left, self.right def __repr__(self): ! return "Mul((%s, %s))" % (repr(self.left), repr(self.right)) class Yield(Node): *************** *** 369,373 **** return self.left, self.right def __repr__(self): ! return "Mod(%s, %s)" % (repr(self.left), repr(self.right)) class Class(Node): --- 366,370 ---- return self.left, self.right def __repr__(self): ! return "Mod((%s, %s))" % (repr(self.left), repr(self.right)) class Class(Node): *************** *** 467,471 **** return self.left, self.right def __repr__(self): ! return "Power(%s, %s)" % (repr(self.left), repr(self.right)) class Ellipsis(Node): --- 464,468 ---- return self.left, self.right def __repr__(self): ! return "Power((%s, %s))" % (repr(self.left), repr(self.right)) class Ellipsis(Node): *************** *** 487,499 **** return "Return(%s)" % (repr(self.value),) - class Yield(Node): - nodes["yield"] = "Yield" - def __init__(self, value): - self.value = value - def _getChildren(self): - return self.value, - def __repr__(self): - return "Yield(%s)" % repr(self.value) - class Add(Node): nodes["add"] = "Add" --- 484,487 ---- *************** *** 504,508 **** return self.left, self.right def __repr__(self): ! return "Add(%s, %s)" % (repr(self.left), repr(self.right)) class Function(Node): --- 492,496 ---- return self.left, self.right def __repr__(self): ! return "Add((%s, %s))" % (repr(self.left), repr(self.right)) class Function(Node): Index: astgen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/astgen.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** astgen.py 2001/08/14 21:18:30 1.3 --- astgen.py 2001/08/18 00:14:37 1.4 *************** *** 82,85 **** --- 82,87 ---- if self.argnames: fmt = COMMA.join(["%s"] * self.nargs) + if '(' in self.args: + fmt = '(%s)' % fmt vals = ["repr(self.%s)" % name for name in self.argnames] vals = COMMA.join(vals) From jhylton@users.sourceforge.net Sat Aug 18 01:24:48 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 17 Aug 2001 17:24:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/doc compiler.tex,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/doc In directory usw-pr-cvs1:/tmp/cvs-serv6569 Modified Files: compiler.tex Log Message: Add a little introductory text. Change several sections to subsections (part of the manual -> howto transformation). Flesh out discussion of assignment nodes (and delete statements). Add an example of manipulating AST objects at a >>> prompt Index: compiler.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/doc/compiler.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** compiler.tex 2001/08/15 18:48:10 1.5 --- compiler.tex 2001/08/18 00:24:46 1.6 *************** *** 52,66 **** \section{Introduction\label{Introduction}} ! XXX Need basic intro ! XXX what are the major advantages... the abstract syntax is much ! closer to the python source... ! \section{The basic interface} \declaremodule{}{compiler} ! The top-level of the package defines four functions. \begin{funcdesc}{parse}{buf} --- 52,80 ---- \section{Introduction\label{Introduction}} ! The \module{compiler} package is a Python source to bytecode ! translator written in Python. It uses the builtin parser and standard ! \ulink{\module{parser}} ! {http://www.python.org/doc/current/lib/module-parser.html} to ! generated a concrete syntax tree. This tree is used to generate an ! abstract syntax tree (AST) and then Python bytecode. ! The full functionality of the package duplicates the builtin compiler ! provided with the Python interpreter. It is intended to match its ! behavior almost exactly. Why implement another compiler that does the ! same thing? The package is useful for a variety of purposes. It can ! be modified more easily than the builtin compiler. The AST it ! generates is useful for analyzing Python source code. + This manual explains how the various components of the + \module{compiler} package work. It blends reference material with a + tutorial. (At least it will when the document is done.) ! \subsection{The basic interface} \declaremodule{}{compiler} ! The top-level of the package defines four functions. If you import ! \module{compiler}, you will get these functions and a collection of ! modules contained in the package. \begin{funcdesc}{parse}{buf} *************** *** 92,98 **** \module{misc}, \module{pyassem}, \module{pycodegen}, \module{symbols}, \module{transformer}, and \refmodule[compiler.visitor]{visitor}. - ! \section{Limitations} There are some problems with the error checking of the compiler --- 106,111 ---- \module{misc}, \module{pyassem}, \module{pycodegen}, \module{symbols}, \module{transformer}, and \refmodule[compiler.visitor]{visitor}. ! \subsection{Limitations} There are some problems with the error checking of the compiler *************** *** 106,109 **** --- 119,123 ---- \code{def f(x, x): ...} + A future version of the compiler should fix these problems. \section{Python Abstract Syntax} *************** *** 133,138 **** abstract syntax and of the transformer are due to Stein and Tutt. ! ! \section{AST Nodes} \declaremodule{}{compiler.ast} --- 147,151 ---- abstract syntax and of the transformer are due to Stein and Tutt. ! \subsection{AST Nodes} \declaremodule{}{compiler.ast} *************** *** 222,226 **** ! \section{Assignment nodes} There is a collection of nodes used to represent assignments. Each --- 235,239 ---- ! \subsection{Assignment nodes} There is a collection of nodes used to represent assignments. Each *************** *** 233,239 **** \class{AssTuple}. ! XXX Explain what the AssXXX nodes are for. Mention \code{a.b.c = 2} ! as an example. Explain what the flags are for. \section{Using Visitors to Walk ASTs} --- 246,317 ---- \class{AssTuple}. ! Each target assignment node will describe the kind of object being ! assigned to: \class{AssName} for a simple name, e.g. \code{a = 1}. ! \class{AssAttr} for an attribute assigned, e.g. \code{a.x = 1}. ! \class{AssList} and \class{AssTuple} for list and tuple expansion ! respectively, e.g. \code{a, b, c = a_tuple}. ! ! The target assignment nodes also have a \member{flags} attribute that ! indicates whether the node is being used for assignment or in a delete ! statement. The \class{AssName} is also used to represent a delete ! statement, e.g. \class{del x}. ! ! When an expression contains several attribute references, an ! assignment or delete statement will contain only one \class{AssAttr} ! node -- for the final attribute reference. The other attribute ! references will be represented as \class{Getattr} nodes in the ! \member{expr} attribute of the \class{AssAttr} instance. + \subsection{Examples} + + This section shows several simple examples of ASTs for Python source + code. The examples demonstrate how to use the \function{parse()} + function, what the repr of an AST looks like, and how to access + attributes of an AST node. + + The first module defines a single function. Assume it is stored in + \file{/tmp/doublelib.py}. + + \begin{verbatim} + """This is an example module. + + This is the docstring. + """ + + def double(x): + "Return twice the argument" + return x * 2 + \end{verbatim} + + In the interactive interpreter session below, I have reformatted the + long AST reprs for readability. The AST reprs use unqualified class + names. If you want to create an instance from a repr, you must import + the class names from the \module{compiler.ast} module. + + \begin{verbatim} + >>> import compiler + >>> mod = compiler.parseFile("/tmp/doublelib.py") + >>> mod + Module('This is an example module.\n\nThis is the docstring.\n', + Stmt([Function('double', ['x'], [], 0, 'Return twice the argument', + Stmt([Return(Mul((Name('x'), Const(2))))]))])) + >>> from compiler.ast import * + >>> Module('This is an example module.\n\nThis is the docstring.\n', + ... Stmt([Function('double', ['x'], [], 0, 'Return twice the argument', + ... Stmt([Return(Mul((Name('x'), Const(2))))]))])) + Module('This is an example module.\n\nThis is the docstring.\n', + Stmt([Function('double', ['x'], [], 0, 'Return twice the argument', + Stmt([Return(Mul((Name('x'), Const(2))))]))])) + >>> mod.doc + 'This is an example module.\n\nThis is the docstring.\n' + >>> for node in mod.node.nodes: + ... print node + ... + Function('double', ['x'], [], 0, 'Return twice the argument', + Stmt([Return(Mul((Name('x'), Const(2))))])) + >>> func = mod.node.nodes[0] + >>> func.code + Stmt([Return(Mul((Name('x'), Const(2))))]) + \end{verbatim} \section{Using Visitors to Walk ASTs} From gvanrossum@users.sourceforge.net Sat Aug 18 02:23:22 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 17 Aug 2001 18:23:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib socket.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv16772 Modified Files: socket.py Log Message: When the socket is closed, don't just assign 0 to self._sock. This breaks software that excepts a socket.error but not an AttributeError. Index: socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** socket.py 2001/03/29 04:36:08 1.11 --- socket.py 2001/08/18 01:23:20 1.12 *************** *** 123,126 **** --- 123,131 ---- # + _socketmethods = ( + 'bind', 'connect', 'connect_ex', 'fileno', 'listen', + 'getpeername', 'getsockname', 'getsockopt', 'setsockopt', + 'recv', 'recvfrom', 'send', 'sendto', 'setblocking', 'shutdown') + class _socketobject: *************** *** 129,133 **** def close(self): ! self._sock = 0 def __del__(self): --- 134,138 ---- def close(self): ! self._sock = _closedsocket() def __del__(self): *************** *** 144,155 **** return _fileobject(self._sock, mode, bufsize) ! _s = "def %s(self, *args): return apply(self._sock.%s, args)\n\n" ! for _m in ('bind', 'connect', 'connect_ex', 'fileno', 'listen', ! 'getpeername', 'getsockname', ! 'getsockopt', 'setsockopt', ! 'recv', 'recvfrom', 'send', 'sendto', ! 'setblocking', ! 'shutdown'): exec _s % (_m, _m) --- 149,165 ---- return _fileobject(self._sock, mode, bufsize) ! _s = "def %s(self, *args): return self._sock.%s(*args)\n\n" ! for _m in _socketmethods: exec _s % (_m, _m) + + + class _closedsocket: + + def _bummer(self): + raise error(9, 'Bad file descriptor') + + _s = "def %s(self, *args): self._bummer()\n\n" + for _m in _socketmethods: + exec _s % _m From ping@users.sourceforge.net Sat Aug 18 05:04:52 2001 From: ping@users.sourceforge.net (Ka-Ping Yee) Date: Fri, 17 Aug 2001 21:04:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib cgitb.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11901 Added Files: cgitb.py Log Message: Initial check-in of cgitb. A few enhancements are pending, but this should work reliably. --- NEW FILE: cgitb.py --- """Handle exceptions in CGI scripts by formatting tracebacks into nice HTML. To enable this module, do: import cgitb; cgitb.enable() at the top of your CGI script. The optional arguments to enable() are: display - if true, tracebacks are displayed in the web browser logdir - if set, tracebacks are written to files in this directory By default, tracebacks are displayed but not written to files. Alternatively, if you have caught an exception and want cgitb to display it for you, call cgitb.handle(). The optional argument to handle() is a 3-item tuple (etype, evalue, etb) just like the value of sys.exc_info().""" __author__ = 'Ka-Ping Yee' __version__ = '$Revision: 1.1 $' def reset(): """Return a string that resets the CGI and browser to a known state.""" return ''' --> -->
    ''' def html(etype, evalue, etb, context=5): """Return a nice HTML document describing the traceback.""" import sys, os, types, time, traceback import keyword, tokenize, linecache, inspect, pydoc if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.time()) head = '' + pydoc.html.heading( '%s' % str(etype), '#ffffff', '#aa55cc', pyver + '
    ' + date) + '''

    A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, with the most recent (innermost) call last.''' indent = '' + ' ' * 5 + ' ' frames = [] records = inspect.getinnerframes(etb, context) for frame, file, lnum, func, lines, index in records: file = file and os.path.abspath(file) or '?' link = '%s' % (file, pydoc.html.escape(file)) args, varargs, varkw, locals = inspect.getargvalues(frame) if func == '?': call = '' else: def eqrepr(value): return '=' + pydoc.html.repr(value) call = 'in %s' % func + inspect.formatargvalues( args, varargs, varkw, locals, formatvalue=eqrepr) names = [] def tokeneater(type, token, start, end, line): if type == tokenize.NAME and token not in keyword.kwlist: if token not in names: names.append(token) if type == tokenize.NEWLINE: raise IndexError def linereader(lnum=[lnum]): line = linecache.getline(file, lnum[0]) lnum[0] += 1 return line try: tokenize.tokenize(linereader, tokeneater) except IndexError: pass lvals = [] for name in names: if name in frame.f_code.co_varnames: if locals.has_key(name): value = pydoc.html.repr(locals[name]) else: value = 'undefined' name = '%s' % name else: if frame.f_globals.has_key(name): value = pydoc.html.repr(frame.f_globals[name]) else: value = 'undefined' name = 'global %s' % name lvals.append('%s = %s' % (name, value)) if lvals: lvals = indent + ''' %s
    ''' % (', '.join(lvals)) else: lvals = '' level = '''
    %s %s
    \n''' % (link, call) excerpt = [] if index is not None: i = lnum - index for line in lines: num = '%s' % ( ' ' * (5-len(str(i))) + str(i)) line = '%s %s' % (num, pydoc.html.preformat(line)) if i == lnum: line = '''
    %s
    \n''' % line excerpt.append('\n' + line) if i == lnum: excerpt.append(lvals) i = i + 1 frames.append('

    ' + level + '\n'.join(excerpt)) exception = ['

    %s: %s' % (str(etype), str(evalue))] if type(evalue) is types.InstanceType: for name in dir(evalue): value = pydoc.html.repr(getattr(evalue, name)) exception.append('\n
    %s%s =\n%s' % (indent, name, value)) import traceback plaintrace = ''.join(traceback.format_exception(etype, evalue, etb)) return head + ''.join(frames) + ''.join(exception) + ''' ''' % plaintrace class Hook: def __init__(self, display=1, logdir=None): self.display = display # send tracebacks to browser if true self.logdir = logdir # log tracebacks to files if not None def __call__(self, etype, evalue, etb): """This hook can replace sys.excepthook (for Python 2.1 or higher).""" self.handle((etype, evalue, etb)) def handle(self, info=None): import sys, os info = info or sys.exc_info() text = 0 print reset() try: doc = html(*info) except: # just in case something goes wrong import traceback doc = ''.join(traceback.format_exception(*info)) text = 1 if self.display: if text: doc = doc.replace('&', '&').replace('<', '<') print '

    ', doc, '
    ' else: print doc else: print '

    A problem occurred in a Python script.' if self.logdir is not None: import tempfile name = tempfile.mktemp(['.html', '.txt'][text]) path = os.path.join(self.logdir, os.path.basename(name)) try: file = open(path, 'w') file.write(doc) file.close() print '

    %s contains the description of this error.' % path except: print '

    Tried to write to %s, but failed.' % path handler = Hook().handle def enable(display=1, logdir=None): import sys sys.excepthook = Hook(display, logdir) From ping@users.sourceforge.net Sat Aug 18 05:06:57 2001 From: ping@users.sourceforge.net (Ka-Ping Yee) Date: Fri, 17 Aug 2001 21:06:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib mimetypes.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv12085 Modified Files: mimetypes.py Log Message: Add some fairly important file extensions: bmp css doc mid midi mp2 mp3 xls. Entries taken from the standard Debian mime.types file. Index: mimetypes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mimetypes.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mimetypes.py 2001/08/16 18:14:38 1.17 --- mimetypes.py 2001/08/18 04:06:54 1.18 *************** *** 231,238 **** --- 231,241 ---- '.bcpio': 'application/x-bcpio', '.bin': 'application/octet-stream', + '.bmp': 'image/x-ms-bmp', '.cdf': 'application/x-netcdf', '.cpio': 'application/x-cpio', '.csh': 'application/x-csh', + '.css': 'text/css', '.dll': 'application/octet-stream', + '.doc': 'application/msword', '.dvi': 'application/x-dvi', '.exe': 'application/octet-stream', *************** *** 252,258 **** --- 255,265 ---- '.man': 'application/x-troff-man', '.me': 'application/x-troff-me', + '.mid': 'audio/midi', + '.midi': 'audio/midi', '.mif': 'application/x-mif', '.mov': 'video/quicktime', '.movie': 'video/x-sgi-movie', + '.mp2': 'audio/mpeg', + '.mp3': 'audio/mpeg', '.mpe': 'video/mpeg', '.mpeg': 'video/mpeg', *************** *** 303,306 **** --- 310,314 ---- '.wav': 'audio/x-wav', '.xbm': 'image/x-xbitmap', + '.xls': 'application/excel', '.xml': 'text/xml', '.xsl': 'application/xml', From gstein@users.sourceforge.net Sat Aug 18 10:20:25 2001 From: gstein@users.sourceforge.net (Greg Stein) Date: Sat, 18 Aug 2001 02:20:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib httplib.py,1.38,1.39 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv21294 Modified Files: httplib.py Log Message: Resolve patch #449367. For the HTTPS class (when available), ensure that the x509 certificate data gets passed through to the HTTPSConnection class. Create a new HTTPS.__init__ to do this, and refactor the HTTP.__init__ into a new _setup method for both init's to call. Note: this is solved differently from the patch, which advocated a new **x509 parameter on the base HTTPConnection class. But that would open HTTPConnection to arbitrary (ignored) parameters, so was not as desirable. Index: httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** httplib.py 2001/07/31 08:40:21 1.38 --- httplib.py 2001/08/18 09:20:23 1.39 *************** *** 664,668 **** _connection_class = HTTPConnection ! def __init__(self, host='', port=None, **x509): "Provide a default host, since the superclass requires one." --- 664,668 ---- _connection_class = HTTPConnection ! def __init__(self, host='', port=None): "Provide a default host, since the superclass requires one." *************** *** 674,689 **** # an error when we attempt to connect. Presumably, the client code # will call connect before then, with a proper host. ! self._conn = self._connection_class(host, port) # set up delegation to flesh out interface ! self.send = self._conn.send ! self.putrequest = self._conn.putrequest ! self.endheaders = self._conn.endheaders ! self._conn._http_vsn = self._http_vsn ! self._conn._http_vsn_str = self._http_vsn_str ! # we never actually use these for anything, but we keep them here for ! # compatibility with post-1.5.2 CVS. ! self.key_file = x509.get('key_file') ! self.cert_file = x509.get('cert_file') self.file = None --- 674,690 ---- # an error when we attempt to connect. Presumably, the client code # will call connect before then, with a proper host. ! self._setup(self._connection_class(host, port)) ! ! def _setup(self, conn): ! self._conn = conn ! # set up delegation to flesh out interface ! self.send = conn.send ! self.putrequest = conn.putrequest ! self.endheaders = conn.endheaders ! self.set_debuglevel = conn.set_debuglevel ! conn._http_vsn = self._http_vsn ! conn._http_vsn_str = self._http_vsn_str self.file = None *************** *** 696,702 **** self._conn.connect() - def set_debuglevel(self, debuglevel): - self._conn.set_debuglevel(debuglevel) - def getfile(self): "Provide a getfile, since the superclass' does not use this concept." --- 697,700 ---- *************** *** 755,758 **** --- 753,769 ---- _connection_class = HTTPSConnection + + def __init__(self, host='', port=None, **x509): + # provide a default host, pass the X509 cert info + + # urf. compensate for bad input. + if port == 0: + port = None + self._setup(self._connection_class(host, port, **x509)) + + # we never actually use these for anything, but we keep them + # here for compatibility with post-1.5.2 CVS. + self.key_file = x509.get('key_file') + self.cert_file = x509.get('cert_file') From esr@users.sourceforge.net Sat Aug 18 10:24:40 2001 From: esr@users.sourceforge.net (Eric S. Raymond) Date: Sat, 18 Aug 2001 02:24:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcompilerlike.tex,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv22110/Doc/lib Added Files: libcompilerlike.tex Log Message: Framework code for compilerlike scripts. --- NEW FILE: libcompilerlike.tex --- \section{\module{compilerlike} --- framework code for building compiler-like programs.} \declaremodule{standard}{set} \modulesynopsis{Framework code for building compiler-like programs.} \moduleauthor{Eric S. Raymond}{esr@thyrsus.com} \sectionauthor{Eric S. Raymond}{esr@thyrsus.com} There is a common `compiler-like' pattern in Unix scripts which is useful for translation utilities of all sorts. A program following this pattern behaves as a filter when no argument files are specified on the command line, but otherwise transforms each file individually into a corresponding output file. The \function{filefilter}, \function{linefilter}, and \function{sponge} functions in this module provide a framework and glue code to make such programs easy to write. You supply a function to massage the file data; depending on which entry point you use, it can take input and output file pointers, or it can take a string consisting of the entire file's data and return a replacement, or it can take in succession strings consisting of each of the file's lines and return a translated line for each. All three of these entry points take a name, an argument list of files, a data transformation function, and a name transformation function. They differ only in the arguments they pass to the transformation function when it is called. The name argument is not used by the functions in this module, it is simply passed as the first argument to the transformation function. Typically it is a string that names the filter and is used in generating error messages, but it could be arbitrary data. The second argument, is interpreted as a list of filenames. The files are transformed in left to right order in the list. A filename consisting of a dash is interpreted as a directive to read from standard input (this can be useful in pipelines). The third argument is the data transformation function. Interpretation of this argument varies across the three entry points and is described below. The fourth, optional argument is a name transformation function or name suffix string. If it is of string type, the shortest suffix of each filename beginning with the first character of the argument string is stripped off. If the first character of the argument does not occur in the filename, no suffix is removed. Then the name suffix argument is concatenated to the end of the stripped filename. (Thus, a name suffix argument of ".x" will cause the filenames foo.c and bar.d to be transformed to foo.x and bar.x respectively.) If the fourth argument is specified and is a function, the name of the input file is passed to it and the return value of the function becomes the name of the output software. If this argument is not specified, the imnput file is replaced with the transformed version. Replacement of each file is atomic and doesn't occur until the translation of that file has completed. Any tempfiles are removed automatically on any exception thrown by the translation function, and the exception is then passed upwards. \begin{funcdesc}{filefilter}{name, arguments, trans_data\optional{,trans_file}} Filter using a function taking the name and two file-object arguments. The function is expected to read data from the input file object, transform it, and write the data to the output file object. When the function terminates, the translation is done. The return value of the transformation function is not used. \end{funcdesc} \begin{funcdesc}{linefilter}{name,arguments,trans_data\optional{,trans_file}} Filter using a function taking the name and a string argument. The return value of the function should be a string. This function is applied to each line in the input file in turn; the return values become the lines of the transformed file. \end{funcdesc} \begin{funcdesc}{sponge}{name, arguments, trans_data\optional{, trans_file}} Filter using a function taking the name and a string argument. The return value of the function should be a string. The function will be passed the entire contents of the input file as a string. The string return value of the function will become the entire contents of the transformed file. \end{funcdesc} # End From esr@users.sourceforge.net Sat Aug 18 10:24:40 2001 From: esr@users.sourceforge.net (Eric S. Raymond) Date: Sat, 18 Aug 2001 02:24:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib compilerlike.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22110/Lib Added Files: compilerlike.py Log Message: Framework code for compilerlike scripts. --- NEW FILE: compilerlike.py --- """ compilerlike -- framework code for building compiler-like programs. There is a common `compiler-like' pattern in Unix scripts which is useful for translation utilities of all sorts. A program following this pattern behaves as a filter when no argument files are specified on the command line, but otherwise transforms each file individually into a corresponding output file. This module provides framework and glue code to make such programs easy to write. You supply a function to massage the file data; depending on which entry point you use, it can take input and output file pointers, or it can take a string consisting of the entire file's data and return a replacement, or it can take in succession strings consisting of each of the file's lines and return a translated line for each. Argument files are transformed in left to right order in the argument list. A filename consisting of a dash is interpreted as a directive to read from standard input (this can be useful in pipelines). Replacement of each file is atomic and doesn't occur until the translation of that file has completed. Any tempfiles are removed automatically on any exception thrown by the translation function, and the exception is then passed upwards. """ # Requires Python 2. from __future__ import nested_scopes import sys, os, filecmp, traceback def filefilter(name, arguments, trans_data, trans_filename=None): "Filter stdin to stdout, or file arguments to renamed files." if not arguments: trans_data("stdin", sys.stdin, sys.stdout) else: for file in arguments: if file == '-': # - is conventional for stdin file = "stdin" infp = sys.stdin else: infp = open(file) tempfile = file + ".~%s-%d~" % (name, os.getpid()) outfp = open(tempfile, "w") try: trans_data(file, infp, outfp) except: os.remove(tempfile) # Pass the exception upwards (exc_type, exc_value, exc_traceback) = sys.exc_info() raise exc_type, exc_value, exc_traceback if filecmp.cmp(file, tempfile): os.remove(tempfile) else: if not trans_filename: os.rename(tempfile, file) elif type(trans_filename) == type(""): i = file.rfind(trans_filename[0]) if i > -1: file = file[:i] os.rename(tempfile, stem + trans_filename) else: os.rename(tempfile, trans_filename(file)) def line_by_line(name, infp, outfp, translate_line): "Hook to do line-by-line translation for filters." while 1: line = infp.readline() if line == "": break elif line: # None returns are skipped outfp.write(translate_line(name, line)) def linefilter(name, arguments, trans_data, trans_filename=None): "Filter framework for line-by-line transformation." return filefilter(name, arguments, lambda name, infp, outfp: line_by_line(name, infp, outfp, trans_data), trans_filename) def sponge(name, arguments, trans_data, trans_filename=None): "Read input sources entire and transform them in memory." if not arguments: sys.stdout.write(trans_data(name, sys.stdin.read())) else: for file in arguments: infp = open(file) indoc = infp.read() infp.close() tempfile = file + ".~%s-%d~" % (name, os.getpid()) try: outfp = open(tempfile, "w") except OSError: sys.stderr.write("%s: can't open tempfile" % name) return 1 try: outdoc = trans_data(name, indoc) except: os.remove(tempfile) # Pass the exception upwards (exc_type, exc_value, exc_traceback) = sys.exc_info() raise exc_type, exc_value, exc_traceback if outdoc == indoc: os.remove(tempfile) else: outfp.write(outdoc) if not trans_filename: os.rename(tempfile, file) elif type(trans_filename) == type(""): i = file.rfind(trans_filename[0]) if i > -1: file = file[:i] os.rename(tempfile, file + trans_filename) else: os.rename(tempfile, trans_filename(file)) if __name__ == '__main__': import getopt def nametrans(name): return name + ".out" def filefilter_test(name, infp, outfp): "Test hook for filefilter entry point -- put dashes before blank lines." while 1: line = infp.readline() if not line: break if line == "\n": outfp.write("------------------------------------------\n") outfp.write(line) def linefilter_test(name, data): "Test hook for linefilter entry point -- wrap lines in brackets." return "<" + data[:-1] + ">\n" def sponge_test(name, data): "Test hook for the sponge entry point -- reverse file lines." lines = data.split("\n") lines.reverse() return "\n".join(lines) (options, arguments) = getopt.getopt(sys.argv[1:], "fls") for (switch, val) in options: if switch == '-f': filefilter("filefilter_test", arguments, filefilter_test,nametrans) elif switch == '-l': linefilter("linefilter_test", arguments, linefilter_test,nametrans) elif switch == '-s': sponge("sponge_test", arguments, sponge_test, ".foo") else: print "Unknown option." # End From gvanrossum@users.sourceforge.net Sat Aug 18 18:43:38 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 10:43:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.268,2.269 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv14521 Modified Files: ceval.c Log Message: Fix SF bug #443600: Change to get/set/del slice operations so that if the object doesn't support slicing, *or* if either of the slice arguments is not an int or long, we construct a slice object and call the get/set/del item operation instead. This makes it possible to design classes that support slice arguments of non-integral types. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.268 retrieving revision 2.269 diff -C2 -d -r2.268 -r2.269 *** ceval.c 2001/08/17 20:47:47 2.268 --- ceval.c 2001/08/18 17:43:36 2.269 *************** *** 3348,3360 **** } static PyObject * apply_slice(PyObject *u, PyObject *v, PyObject *w) /* return u[v:w] */ { ! int ilow = 0, ihigh = INT_MAX; ! if (!_PyEval_SliceIndex(v, &ilow)) ! return NULL; ! if (!_PyEval_SliceIndex(w, &ihigh)) ! return NULL; ! return PySequence_GetSlice(u, ilow, ihigh); } --- 3348,3375 ---- } + #undef ISINT + #define ISINT(x) ((x) == NULL || PyInt_Check(x) || PyLong_Check(x)) + static PyObject * apply_slice(PyObject *u, PyObject *v, PyObject *w) /* return u[v:w] */ { ! PyTypeObject *tp = u->ob_type; ! PySequenceMethods *sq = tp->tp_as_sequence; ! ! if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) { ! int ilow = 0, ihigh = INT_MAX; ! if (!_PyEval_SliceIndex(v, &ilow)) ! return NULL; ! if (!_PyEval_SliceIndex(w, &ihigh)) ! return NULL; ! return PySequence_GetSlice(u, ilow, ihigh); ! } ! else { ! PyObject *slice = PySlice_New(v, w, NULL); ! if (slice != NULL) ! return PyObject_GetItem(u, slice); ! else ! return NULL; ! } } *************** *** 3363,3375 **** /* u[v:w] = x */ { ! int ilow = 0, ihigh = INT_MAX; ! if (!_PyEval_SliceIndex(v, &ilow)) ! return -1; ! if (!_PyEval_SliceIndex(w, &ihigh)) ! return -1; ! if (x == NULL) ! return PySequence_DelSlice(u, ilow, ihigh); ! else ! return PySequence_SetSlice(u, ilow, ihigh, x); } --- 3378,3406 ---- /* u[v:w] = x */ { ! PyTypeObject *tp = u->ob_type; ! PySequenceMethods *sq = tp->tp_as_sequence; ! ! if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) { ! int ilow = 0, ihigh = INT_MAX; ! if (!_PyEval_SliceIndex(v, &ilow)) ! return -1; ! if (!_PyEval_SliceIndex(w, &ihigh)) ! return -1; ! if (x == NULL) ! return PySequence_DelSlice(u, ilow, ihigh); ! else ! return PySequence_SetSlice(u, ilow, ihigh, x); ! } ! else { ! PyObject *slice = PySlice_New(v, w, NULL); ! if (slice != NULL) { ! if (x != NULL) ! return PyObject_SetItem(u, slice, x); ! else ! return PyObject_DelItem(u, slice); ! } ! else ! return -1; ! } } From montanaro@users.sourceforge.net Sat Aug 18 19:52:12 2001 From: montanaro@users.sourceforge.net (Skip Montanaro) Date: Sat, 18 Aug 2001 11:52:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.195,2.196 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv25014 Modified Files: posixmodule.c Log Message: added warnings about security risk of using tmpnam and tempnam Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.195 retrieving revision 2.196 diff -C2 -d -r2.195 -r2.196 *** posixmodule.c 2001/07/26 13:41:05 2.195 --- posixmodule.c 2001/08/18 18:52:10 2.196 *************** *** 4212,4215 **** --- 4212,4220 ---- if (!PyArg_ParseTuple(args, "|zz:tempnam", &dir, &pfx)) return NULL; + + if (PyErr_Warn(PyExc_RuntimeWarning, + "tempnam is a potential security risk to your program") < 0) + return NULL; + #ifdef MS_WIN32 name = _tempnam(dir, pfx); *************** *** 4259,4262 **** --- 4264,4272 ---- if (!PyArg_ParseTuple(args, ":tmpnam")) return NULL; + + if (PyErr_Warn(PyExc_RuntimeWarning, + "tmpnam is a potential security risk to your program") < 0) + return NULL; + #ifdef USE_TMPNAM_R name = tmpnam_r(buffer); From tim_one@users.sourceforge.net Sat Aug 18 21:18:51 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 18 Aug 2001 13:18:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test___future__.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv5565/python/Lib/test Modified Files: test___future__.py Log Message: Expose the CO_xxx flags via the "new" module (re-solving a problem "the right way"). Fiddle __future__.py to use them. Jeremy's pyassem.py may also want to use them (by-hand duplication of magic numbers is brittle), but leaving that to his judgment. Beef up __future__'s test to verify the exported feature names appear correct. Index: test___future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test___future__.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test___future__.py 2001/08/17 19:49:02 1.3 --- test___future__.py 2001/08/18 20:18:49 1.4 *************** *** 7,10 **** --- 7,23 ---- features = __future__.all_feature_names + + # Verify that all_feature_names appears correct. + given_feature_names = features[:] + for name in dir(__future__): + obj = getattr(__future__, name, None) + if obj is not None and isinstance(obj, __future__._Feature): + verify(name in given_feature_names, + "%r should have been in all_feature_names" % name) + given_feature_names.remove(name) + verify(len(given_feature_names) == 0, + "all_feature_names has too much: %r" % given_feature_names) + del given_feature_names + for feature in features: value = getattr(__future__, feature) From tim_one@users.sourceforge.net Sat Aug 18 21:18:51 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 18 Aug 2001 13:18:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib __future__.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv5565/python/Lib Modified Files: __future__.py Log Message: Expose the CO_xxx flags via the "new" module (re-solving a problem "the right way"). Fiddle __future__.py to use them. Jeremy's pyassem.py may also want to use them (by-hand duplication of magic numbers is brittle), but leaving that to his judgment. Beef up __future__'s test to verify the exported feature names appear correct. Index: __future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/__future__.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** __future__.py 2001/08/17 19:49:02 1.9 --- __future__.py 2001/08/18 20:18:49 1.10 *************** *** 56,67 **** __all__ = ["all_feature_names"] + all_feature_names ! ! # The CO_xxx symbols are defined here under the same names used by ! # compile.h, so that an editor search will find them here. However, ! # they're not exported in __all__, because they don't really belong to ! # this module. ! CO_NESTED = 0x0010 # nested_scopes ! CO_GENERATOR_ALLOWED = 0x1000 # generators ! CO_FUTURE_DIVISION = 0x2000 # division class _Feature: --- 56,60 ---- __all__ = ["all_feature_names"] + all_feature_names ! import new as _new # for CO_xxx symbols class _Feature: *************** *** 94,104 **** nested_scopes = _Feature((2, 1, 0, "beta", 1), (2, 2, 0, "alpha", 0), ! CO_NESTED) generators = _Feature((2, 2, 0, "alpha", 1), (2, 3, 0, "final", 0), ! CO_GENERATOR_ALLOWED) division = _Feature((2, 2, 0, "alpha", 2), (3, 0, 0, "alpha", 0), ! CO_FUTURE_DIVISION) --- 87,97 ---- nested_scopes = _Feature((2, 1, 0, "beta", 1), (2, 2, 0, "alpha", 0), ! _new.CO_NESTED) generators = _Feature((2, 2, 0, "alpha", 1), (2, 3, 0, "final", 0), ! _new.CO_GENERATOR_ALLOWED) division = _Feature((2, 2, 0, "alpha", 2), (3, 0, 0, "alpha", 0), ! _new.CO_FUTURE_DIVISION) From tim_one@users.sourceforge.net Sat Aug 18 21:18:51 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 18 Aug 2001 13:18:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules newmodule.c,2.32,2.33 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv5565/python/Modules Modified Files: newmodule.c Log Message: Expose the CO_xxx flags via the "new" module (re-solving a problem "the right way"). Fiddle __future__.py to use them. Jeremy's pyassem.py may also want to use them (by-hand duplication of magic numbers is brittle), but leaving that to his judgment. Beef up __future__'s test to verify the exported feature names appear correct. Index: newmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/newmodule.c,v retrieving revision 2.32 retrieving revision 2.33 diff -C2 -d -r2.32 -r2.33 *** newmodule.c 2001/02/01 19:50:28 2.32 --- newmodule.c 2001/08/18 20:18:49 2.33 *************** *** 221,228 **** You need to know a great deal about the interpreter to use this!"; DL_EXPORT(void) initnew(void) { ! Py_InitModule4("new", new_methods, new_doc, (PyObject *)NULL, ! PYTHON_API_VERSION); } --- 221,257 ---- You need to know a great deal about the interpreter to use this!"; + static void + insertint(PyObject *d, char *name, int value) + { + PyObject *v = PyInt_FromLong((long) value); + if (v == NULL) { + /* Don't bother reporting this error */ + PyErr_Clear(); + } + else { + PyDict_SetItemString(d, name, v); + Py_DECREF(v); + } + } + DL_EXPORT(void) initnew(void) { ! PyObject *m; ! PyObject *d; ! ! m = Py_InitModule4("new", new_methods, new_doc, (PyObject *)NULL, ! PYTHON_API_VERSION); ! d = PyModule_GetDict(m); ! ! #define ADDSYM(TOKEN) insertint(d, #TOKEN, TOKEN) ! ADDSYM(CO_OPTIMIZED); ! ADDSYM(CO_NEWLOCALS); ! ADDSYM(CO_VARARGS); ! ADDSYM(CO_VARKEYWORDS); ! ADDSYM(CO_NESTED); ! ADDSYM(CO_GENERATOR); ! ADDSYM(CO_GENERATOR_ALLOWED); ! ADDSYM(CO_FUTURE_DIVISION); ! #undef ADDSYM } From gvanrossum@users.sourceforge.net Sat Aug 18 22:00:41 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 14:00:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib socket.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv13497 Modified Files: socket.py Log Message: Inspired by Greg Stein's proposed simplification of the _closesocket class, I came up with an even simpler solution: raise the error in __getattr__(). Index: socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** socket.py 2001/08/18 01:23:20 1.12 --- socket.py 2001/08/18 21:00:39 1.13 *************** *** 156,165 **** class _closedsocket: ! def _bummer(self): raise error(9, 'Bad file descriptor') - - _s = "def %s(self, *args): self._bummer()\n\n" - for _m in _socketmethods: - exec _s % _m --- 156,161 ---- class _closedsocket: ! def __getattr__(self, name): raise error(9, 'Bad file descriptor') From gvanrossum@users.sourceforge.net Sat Aug 18 22:08:24 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 14:08:24 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.54,1.55 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv14905 Modified Files: Makefile.pre.in Log Message: Add dependencies for Python/thread.c on all of the header files that it may depend on. It's really annoying that thread.o doesn't get rebuilt when the .h file is changed! :-) The dependency is on *all* the Python/thread_*.h files -- that should be sufficient and rarely cause unneeded recompilations. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Makefile.pre.in 2001/08/17 22:37:02 1.54 --- Makefile.pre.in 2001/08/18 21:08:22 1.55 *************** *** 882,884 **** --- 882,888 ---- -o -print + # Dependencies + + Python/thread.o: $(srcdir)/Python/thread_*.h + # IF YOU PUT ANYTHING HERE IT WILL GO AWAY From gvanrossum@users.sourceforge.net Sat Aug 18 22:22:09 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 14:22:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules cPickle.c,2.62,2.63 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17479 Modified Files: cPickle.c Log Message: SF patch #452239 by Gordon McMillan, to fix SF bug #451547. This patch attempts to do to cPickle what Guido did for pickle.py v 1.50. That is: save_global tries importing the module, and fetching the name from the module. If that fails, or the returned object is not the same one we started with, it raises a PicklingError. (All this so pickling a lambda will fail at save time, rather than load time). Index: cPickle.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v retrieving revision 2.62 retrieving revision 2.63 diff -C2 -d -r2.62 -r2.63 *** cPickle.c 2001/08/17 18:39:25 2.62 --- cPickle.c 2001/08/18 21:22:07 2.63 *************** *** 1624,1628 **** static int save_global(Picklerobject *self, PyObject *args, PyObject *name) { ! PyObject *global_name = 0, *module = 0; char *name_str, *module_str; int module_size, name_size, res = -1; --- 1624,1628 ---- static int save_global(Picklerobject *self, PyObject *args, PyObject *name) { ! PyObject *global_name = 0, *module = 0, *mod = 0, *moddict = 0, *klass = 0; char *name_str, *module_str; int module_size, name_size, res = -1; *************** *** 1649,1652 **** --- 1649,1675 ---- name_str = PyString_AS_STRING((PyStringObject *)global_name); + mod = PyImport_ImportModule(module_str); + if (mod == NULL) { + /* Py_ErrClear(); ?? */ + cPickle_ErrFormat(PicklingError, + "Can't pickle %s: it's not found as %s.%s", + "OSS", args, module, global_name); + goto finally; + } + moddict = PyModule_GetDict(mod); /* borrowed ref */ + klass = PyDict_GetItemString(moddict, name_str); /* borrowed ref */ + if (klass == NULL) { + cPickle_ErrFormat(PicklingError, + "Can't pickle %s: it's not found as %s.%s", + "OSS", args, module, global_name); + goto finally; + } + if (klass != args) { + cPickle_ErrFormat(PicklingError, + "Can't pickle %s: it's not the same object as %s.%s", + "OSS", args, module, global_name); + goto finally; + } + if ((*self->write_func)(self, &global, 1) < 0) goto finally; *************** *** 1672,1675 **** --- 1695,1699 ---- Py_XDECREF(module); Py_XDECREF(global_name); + Py_XDECREF(mod); return res; From gvanrossum@users.sourceforge.net Sat Aug 18 22:28:25 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 14:28:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include patchlevel.h,2.52,2.52.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv18655 Modified Files: Tag: r22a2-branch patchlevel.h Log Message: Update the version to 2.2a2. Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.52 retrieving revision 2.52.2.1 diff -C2 -d -r2.52 -r2.52.2.1 *** patchlevel.h 2001/08/17 14:05:27 2.52 --- patchlevel.h 2001/08/18 21:28:23 2.52.2.1 *************** *** 24,31 **** #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA ! #define PY_RELEASE_SERIAL 1 /* Version as a string */ ! #define PY_VERSION "2.2a1+" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 24,31 ---- #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA ! #define PY_RELEASE_SERIAL 2 /* Version as a string */ ! #define PY_VERSION "2.2a2" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From gvanrossum@users.sourceforge.net Sat Aug 18 22:35:44 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 14:35:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.85,1.85.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv20207 Modified Files: Tag: r22a2-branch python20.wse Log Message: Update release version Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.85 retrieving revision 1.85.2.1 diff -C2 -d -r1.85 -r1.85.2.1 *** python20.wse 2001/08/16 02:23:04 1.85 --- python20.wse 2001/08/18 21:35:41 1.85.2.1 *************** *** 2,6 **** item: Global Version=8.14 ! Title=Python 2.2 alpha 1 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 --- 2,6 ---- item: Global Version=8.14 ! Title=Python 2.2 alpha 2 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 *************** *** 65,69 **** item: Set Variable Variable=PYVER_STRING ! Value=2.2a1 end item: Remark --- 65,69 ---- item: Set Variable Variable=PYVER_STRING ! Value=2.2a2 end item: Remark From tim_one@users.sourceforge.net Sun Aug 19 01:56:30 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 18 Aug 2001 17:56:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/PC python_nt.rc,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory usw-pr-cvs1:/tmp/cvs-serv16282/python/PC Modified Files: python_nt.rc Log Message: Windows fiddling for 2.2a2: bump build number; update copyright and company info in resource files; change installer strings to match. This belongs in the release branch too, of course. Index: python_nt.rc =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/python_nt.rc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** python_nt.rc 2001/04/18 21:12:25 1.14 --- python_nt.rc 2001/08/19 00:56:28 1.15 *************** *** 70,78 **** BLOCK "000004b0" BEGIN ! VALUE "CompanyName", "Digital Creations 2\0" VALUE "FileDescription", "Python Core\0" VALUE "FileVersion", PYTHON_VERSION VALUE "InternalName", "Python DLL\0" ! VALUE "LegalCopyright", "Copyright © 2000, 2001 Guido van Rossum. Copyright © 2000 BeOpen.com. Copyright © 1995-2000 CNRI. Copyright © 1991-1995 SMC.\0" VALUE "OriginalFilename", PYTHON_DLL_NAME "\0" VALUE "ProductName", "Python\0" --- 70,78 ---- BLOCK "000004b0" BEGIN ! VALUE "CompanyName", "PythonLabs at Zope Corporation\0" VALUE "FileDescription", "Python Core\0" VALUE "FileVersion", PYTHON_VERSION VALUE "InternalName", "Python DLL\0" ! VALUE "LegalCopyright", "Copyright © 2001 Python Software Foundation. Copyright © 2000 BeOpen.com. Copyright © 1995-2001 CNRI. Copyright © 1991-1995 SMC.\0" VALUE "OriginalFilename", PYTHON_DLL_NAME "\0" VALUE "ProductName", "Python\0" From tim_one@users.sourceforge.net Sun Aug 19 01:56:30 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 18 Aug 2001 17:56:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild BUILDno.txt,1.18,1.19 python20.wse,1.85,1.86 pythoncore.dsp,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv16282/python/PCbuild Modified Files: BUILDno.txt python20.wse pythoncore.dsp Log Message: Windows fiddling for 2.2a2: bump build number; update copyright and company info in resource files; change installer strings to match. This belongs in the release branch too, of course. Index: BUILDno.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/BUILDno.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** BUILDno.txt 2001/07/20 05:17:10 1.18 --- BUILDno.txt 2001/08/19 00:56:28 1.19 *************** *** 34,37 **** --- 34,39 ---- Windows Python BUILD numbers ---------------------------- + 22 2.2a2 + 22-Aug-2001 TENTATIVE 21 2.2a1 18-Jul-2001 Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** python20.wse 2001/08/16 02:23:04 1.85 --- python20.wse 2001/08/19 00:56:28 1.86 *************** *** 2,6 **** item: Global Version=8.14 ! Title=Python 2.2 alpha 1 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 --- 2,6 ---- item: Global Version=8.14 ! Title=Python 2.2 alpha 2 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 *************** *** 19,25 **** Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2a1.exe Dialogs Version=8 ! Version File=2.2a1 Version Description=Python Programming Language Version Copyright=©2001 Python Software Foundation --- 19,25 ---- Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2a2.exe Dialogs Version=8 ! Version File=2.2a2 Version Description=Python Programming Language Version Copyright=©2001 Python Software Foundation *************** *** 65,69 **** item: Set Variable Variable=PYVER_STRING ! Value=2.2a1 end item: Remark --- 65,69 ---- item: Set Variable Variable=PYVER_STRING ! Value=2.2a2 end item: Remark Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.dsp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pythoncore.dsp 2001/08/02 04:15:00 1.19 --- pythoncore.dsp 2001/08/19 00:56:28 1.20 *************** *** 725,733 **** !IF "$(CFG)" == "pythoncore - Win32 Release" ! # ADD CPP /D BUILD=21 !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" ! # ADD CPP /D BUILD=21 !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" --- 725,733 ---- !IF "$(CFG)" == "pythoncore - Win32 Release" ! # ADD CPP /D BUILD=22 !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" ! # ADD CPP /D BUILD=22 !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" From tim_one@users.sourceforge.net Sun Aug 19 02:38:05 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 18 Aug 2001 18:38:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libtime.tex,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv21720/python/dist/src/doc/lib Modified Files: libtime.tex Log Message: Improve Windows time.clock() blurb; was missing return type and unit. Index: libtime.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtime.tex,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** libtime.tex 2001/08/05 15:43:04 1.43 --- libtime.tex 2001/08/19 01:38:03 1.44 *************** *** 135,142 **** timing algorithms. ! On Windows, this function returns the nearest approximation to ! wall-clock time since the first call to this function, based on the ! Win32 function \cfunction{QueryPerformanceCounter()}. The resolution ! is typically better than one microsecond. \end{funcdesc} --- 135,142 ---- timing algorithms. ! On Windows, this function returns wall-clock seconds elapsed since the ! first call to this function, as a floating point number, ! based on the Win32 function \cfunction{QueryPerformanceCounter()}. ! The resolution is typically better than one microsecond. \end{funcdesc} From montanaro@users.sourceforge.net Sun Aug 19 05:25:27 2001 From: montanaro@users.sourceforge.net (Skip Montanaro) Date: Sat, 18 Aug 2001 21:25:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib threading.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23128 Modified Files: threading.py Log Message: add debug calls to self._note for the Semaphore class. This closes bug 443614. I will submit a new feature request and patch to threading.py and libthreading.tex to address the bounded semaphore issue. Index: threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** threading.py 2001/08/13 14:40:29 1.14 --- threading.py 2001/08/19 04:25:24 1.15 *************** *** 262,268 **** --- 262,274 ---- if not blocking: break + if __debug__: + self._note("%s.acquire(%s): blocked waiting, value=%s", + self, blocking, self.__value) self.__cond.wait() else: self.__value = self.__value - 1 + if __debug__: + self._note("%s.acquire: success, value=%s(%s)", + self, self.__value, self.__initial_value) rc = 1 self.__cond.release() *************** *** 272,275 **** --- 278,284 ---- self.__cond.acquire() self.__value = self.__value + 1 + if __debug__: + self._note("%s.release: success, value=%s(%s)", + self, self.__value, self.__initial_value) self.__cond.notify() self.__cond.release() From gvanrossum@users.sourceforge.net Sun Aug 19 05:37:42 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 21:37:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild BUILDno.txt,1.18,1.18.2.1 python20.wse,1.85.2.1,1.85.2.2 pythoncore.dsp,1.19,1.19.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv31373 Modified Files: Tag: r22a2-branch BUILDno.txt python20.wse pythoncore.dsp Log Message: merge Tim's release-related trunk changes into the 2.2a2 branch Index: BUILDno.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/BUILDno.txt,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -C2 -d -r1.18 -r1.18.2.1 *** BUILDno.txt 2001/07/20 05:17:10 1.18 --- BUILDno.txt 2001/08/19 04:37:40 1.18.2.1 *************** *** 34,37 **** --- 34,39 ---- Windows Python BUILD numbers ---------------------------- + 22 2.2a2 + 22-Aug-2001 TENTATIVE 21 2.2a1 18-Jul-2001 Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.85.2.1 retrieving revision 1.85.2.2 diff -C2 -d -r1.85.2.1 -r1.85.2.2 *** python20.wse 2001/08/18 21:35:41 1.85.2.1 --- python20.wse 2001/08/19 04:37:40 1.85.2.2 *************** *** 19,25 **** Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2a1.exe Dialogs Version=8 ! Version File=2.2a1 Version Description=Python Programming Language Version Copyright=©2001 Python Software Foundation --- 19,25 ---- Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2a2.exe Dialogs Version=8 ! Version File=2.2a2 Version Description=Python Programming Language Version Copyright=©2001 Python Software Foundation Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.dsp,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** pythoncore.dsp 2001/08/02 04:15:00 1.19 --- pythoncore.dsp 2001/08/19 04:37:40 1.19.2.1 *************** *** 725,733 **** !IF "$(CFG)" == "pythoncore - Win32 Release" ! # ADD CPP /D BUILD=21 !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" ! # ADD CPP /D BUILD=21 !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" --- 725,733 ---- !IF "$(CFG)" == "pythoncore - Win32 Release" ! # ADD CPP /D BUILD=22 !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" ! # ADD CPP /D BUILD=22 !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" From gvanrossum@users.sourceforge.net Sun Aug 19 05:38:30 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 21:38:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/PC python_nt.rc,1.14,1.14.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory usw-pr-cvs1:/tmp/cvs-serv32236 Modified Files: Tag: r22a2-branch python_nt.rc Log Message: merge Tim's release-related trunk changes into the 2.2a2 branch Index: python_nt.rc =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/python_nt.rc,v retrieving revision 1.14 retrieving revision 1.14.6.1 diff -C2 -d -r1.14 -r1.14.6.1 *** python_nt.rc 2001/04/18 21:12:25 1.14 --- python_nt.rc 2001/08/19 04:38:28 1.14.6.1 *************** *** 70,78 **** BLOCK "000004b0" BEGIN ! VALUE "CompanyName", "Digital Creations 2\0" VALUE "FileDescription", "Python Core\0" VALUE "FileVersion", PYTHON_VERSION VALUE "InternalName", "Python DLL\0" ! VALUE "LegalCopyright", "Copyright © 2000, 2001 Guido van Rossum. Copyright © 2000 BeOpen.com. Copyright © 1995-2000 CNRI. Copyright © 1991-1995 SMC.\0" VALUE "OriginalFilename", PYTHON_DLL_NAME "\0" VALUE "ProductName", "Python\0" --- 70,78 ---- BLOCK "000004b0" BEGIN ! VALUE "CompanyName", "PythonLabs at Zope Corporation\0" VALUE "FileDescription", "Python Core\0" VALUE "FileVersion", PYTHON_VERSION VALUE "InternalName", "Python DLL\0" ! VALUE "LegalCopyright", "Copyright © 2001 Python Software Foundation. Copyright © 2000 BeOpen.com. Copyright © 1995-2001 CNRI. Copyright © 1991-1995 SMC.\0" VALUE "OriginalFilename", PYTHON_DLL_NAME "\0" VALUE "ProductName", "Python\0" From gvanrossum@users.sourceforge.net Sun Aug 19 05:41:51 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 21:41:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib threading.py,1.14,1.14.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv2449 Modified Files: Tag: r22a2-branch threading.py Log Message: Merge Skip's debug change into branch Index: threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** threading.py 2001/08/13 14:40:29 1.14 --- threading.py 2001/08/19 04:41:49 1.14.2.1 *************** *** 262,268 **** --- 262,274 ---- if not blocking: break + if __debug__: + self._note("%s.acquire(%s): blocked waiting, value=%s", + self, blocking, self.__value) self.__cond.wait() else: self.__value = self.__value - 1 + if __debug__: + self._note("%s.acquire: success, value=%s(%s)", + self, self.__value, self.__initial_value) rc = 1 self.__cond.release() *************** *** 272,275 **** --- 278,284 ---- self.__cond.acquire() self.__value = self.__value + 1 + if __debug__: + self._note("%s.release: success, value=%s(%s)", + self, self.__value, self.__initial_value) self.__cond.notify() self.__cond.release() From gvanrossum@users.sourceforge.net Sun Aug 19 06:14:13 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 22:14:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib __future__.py,1.9,1.9.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23127 Modified Files: Tag: r22a2-branch __future__.py Log Message: Merge trunk changes into branch (belated -- I hadn't updated when tagging) Index: __future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/__future__.py,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** __future__.py 2001/08/17 19:49:02 1.9 --- __future__.py 2001/08/19 05:14:11 1.9.2.1 *************** *** 56,67 **** __all__ = ["all_feature_names"] + all_feature_names ! ! # The CO_xxx symbols are defined here under the same names used by ! # compile.h, so that an editor search will find them here. However, ! # they're not exported in __all__, because they don't really belong to ! # this module. ! CO_NESTED = 0x0010 # nested_scopes ! CO_GENERATOR_ALLOWED = 0x1000 # generators ! CO_FUTURE_DIVISION = 0x2000 # division class _Feature: --- 56,60 ---- __all__ = ["all_feature_names"] + all_feature_names ! import new as _new # for CO_xxx symbols class _Feature: *************** *** 94,104 **** nested_scopes = _Feature((2, 1, 0, "beta", 1), (2, 2, 0, "alpha", 0), ! CO_NESTED) generators = _Feature((2, 2, 0, "alpha", 1), (2, 3, 0, "final", 0), ! CO_GENERATOR_ALLOWED) division = _Feature((2, 2, 0, "alpha", 2), (3, 0, 0, "alpha", 0), ! CO_FUTURE_DIVISION) --- 87,97 ---- nested_scopes = _Feature((2, 1, 0, "beta", 1), (2, 2, 0, "alpha", 0), ! _new.CO_NESTED) generators = _Feature((2, 2, 0, "alpha", 1), (2, 3, 0, "final", 0), ! _new.CO_GENERATOR_ALLOWED) division = _Feature((2, 2, 0, "alpha", 2), (3, 0, 0, "alpha", 0), ! _new.CO_FUTURE_DIVISION) From gvanrossum@users.sourceforge.net Sun Aug 19 06:14:13 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 22:14:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test___future__.py,1.3,1.3.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv23127/test Modified Files: Tag: r22a2-branch test___future__.py Log Message: Merge trunk changes into branch (belated -- I hadn't updated when tagging) Index: test___future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test___future__.py,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** test___future__.py 2001/08/17 19:49:02 1.3 --- test___future__.py 2001/08/19 05:14:11 1.3.2.1 *************** *** 7,10 **** --- 7,23 ---- features = __future__.all_feature_names + + # Verify that all_feature_names appears correct. + given_feature_names = features[:] + for name in dir(__future__): + obj = getattr(__future__, name, None) + if obj is not None and isinstance(obj, __future__._Feature): + verify(name in given_feature_names, + "%r should have been in all_feature_names" % name) + given_feature_names.remove(name) + verify(len(given_feature_names) == 0, + "all_feature_names has too much: %r" % given_feature_names) + del given_feature_names + for feature in features: value = getattr(__future__, feature) From gvanrossum@users.sourceforge.net Sun Aug 19 06:14:51 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 22:14:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules newmodule.c,2.32,2.32.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv23216 Modified Files: Tag: r22a2-branch newmodule.c Log Message: Merge trunk changes into branch (belated -- I hadn't updated when tagging) Index: newmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/newmodule.c,v retrieving revision 2.32 retrieving revision 2.32.10.1 diff -C2 -d -r2.32 -r2.32.10.1 *** newmodule.c 2001/02/01 19:50:28 2.32 --- newmodule.c 2001/08/19 05:14:49 2.32.10.1 *************** *** 221,228 **** You need to know a great deal about the interpreter to use this!"; DL_EXPORT(void) initnew(void) { ! Py_InitModule4("new", new_methods, new_doc, (PyObject *)NULL, ! PYTHON_API_VERSION); } --- 221,257 ---- You need to know a great deal about the interpreter to use this!"; + static void + insertint(PyObject *d, char *name, int value) + { + PyObject *v = PyInt_FromLong((long) value); + if (v == NULL) { + /* Don't bother reporting this error */ + PyErr_Clear(); + } + else { + PyDict_SetItemString(d, name, v); + Py_DECREF(v); + } + } + DL_EXPORT(void) initnew(void) { ! PyObject *m; ! PyObject *d; ! ! m = Py_InitModule4("new", new_methods, new_doc, (PyObject *)NULL, ! PYTHON_API_VERSION); ! d = PyModule_GetDict(m); ! ! #define ADDSYM(TOKEN) insertint(d, #TOKEN, TOKEN) ! ADDSYM(CO_OPTIMIZED); ! ADDSYM(CO_NEWLOCALS); ! ADDSYM(CO_VARARGS); ! ADDSYM(CO_VARKEYWORDS); ! ADDSYM(CO_NESTED); ! ADDSYM(CO_GENERATOR); ! ADDSYM(CO_GENERATOR_ALLOWED); ! ADDSYM(CO_FUTURE_DIVISION); ! #undef ADDSYM } From gvanrossum@users.sourceforge.net Sun Aug 19 06:20:24 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 22:20:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.195,2.195.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv23914 Modified Files: Tag: r22a2-branch posixmodule.c Log Message: Merge Skip's warnings for tmpnam into the 2.2a2 branch Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.195 retrieving revision 2.195.2.1 diff -C2 -d -r2.195 -r2.195.2.1 *** posixmodule.c 2001/07/26 13:41:05 2.195 --- posixmodule.c 2001/08/19 05:20:22 2.195.2.1 *************** *** 4212,4215 **** --- 4212,4220 ---- if (!PyArg_ParseTuple(args, "|zz:tempnam", &dir, &pfx)) return NULL; + + if (PyErr_Warn(PyExc_RuntimeWarning, + "tempnam is a potential security risk to your program") < 0) + return NULL; + #ifdef MS_WIN32 name = _tempnam(dir, pfx); *************** *** 4259,4262 **** --- 4264,4272 ---- if (!PyArg_ParseTuple(args, ":tmpnam")) return NULL; + + if (PyErr_Warn(PyExc_RuntimeWarning, + "tmpnam is a potential security risk to your program") < 0) + return NULL; + #ifdef USE_TMPNAM_R name = tmpnam_r(buffer); From gvanrossum@users.sourceforge.net Sun Aug 19 06:29:27 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 22:29:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib __future__.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv29136 Modified Files: __future__.py Log Message: Avoid total dependency on the new module. This addresses the problem reported by Greg Ball on python-dev. Index: __future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/__future__.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** __future__.py 2001/08/18 20:18:49 1.10 --- __future__.py 2001/08/19 05:29:25 1.11 *************** *** 56,60 **** __all__ = ["all_feature_names"] + all_feature_names ! import new as _new # for CO_xxx symbols class _Feature: --- 56,66 ---- __all__ = ["all_feature_names"] + all_feature_names ! try: ! import new as _new # for CO_xxx symbols ! except ImportError: # May happen during build ! class _new: ! CO_NESTED = 0x0010 ! CO_GENERATOR_ALLOWED = 0x1000 ! CO_FUTURE_DIVISION = 0x2000 class _Feature: From gvanrossum@users.sourceforge.net Sun Aug 19 06:40:10 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 22:40:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules Setup.dist,1.22,1.22.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv3610 Modified Files: Tag: r22a2-branch Setup.dist Log Message: A better fix for Greg Ball's problem (see python-dev): make new a static module. Note: if you have a current checkout, you have to copy $(srcdir)/Modules/Setup.dist to Modules/Setup for this to be effective. Index: Setup.dist =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/Setup.dist,v retrieving revision 1.22 retrieving revision 1.22.2.1 diff -C2 -d -r1.22 -r1.22.2.1 *** Setup.dist 2001/08/02 04:15:00 1.22 --- Setup.dist 2001/08/19 05:40:07 1.22.2.1 *************** *** 99,102 **** --- 99,103 ---- posix posixmodule.c # posix (UNIX) system calls _sre _sre.c # Fredrik Lundh's new regular expressions + new newmodule.c # Tommy Burnette's 'new' module # The rest of the modules listed in this file are all commented out by *************** *** 346,354 **** # Wrapper for the panel library that's part of ncurses and SYSV curses. #_curses_panel _curses_panel.c -lpanel -lncurses - - - # Tommy Burnette's 'new' module (creates new empty objects of certain kinds): - - #new newmodule.c --- 347,350 ---- From gvanrossum@users.sourceforge.net Sun Aug 19 06:41:58 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 22:41:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libtime.tex,1.43,1.43.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv3878 Modified Files: Tag: r22a2-branch libtime.tex Log Message: merge Tim's release-related trunk changes into the 2.2a2 branch Index: libtime.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtime.tex,v retrieving revision 1.43 retrieving revision 1.43.2.1 diff -C2 -d -r1.43 -r1.43.2.1 *** libtime.tex 2001/08/05 15:43:04 1.43 --- libtime.tex 2001/08/19 05:41:56 1.43.2.1 *************** *** 135,142 **** timing algorithms. ! On Windows, this function returns the nearest approximation to ! wall-clock time since the first call to this function, based on the ! Win32 function \cfunction{QueryPerformanceCounter()}. The resolution ! is typically better than one microsecond. \end{funcdesc} --- 135,142 ---- timing algorithms. ! On Windows, this function returns wall-clock seconds elapsed since the ! first call to this function, as a floating point number, ! based on the Win32 function \cfunction{QueryPerformanceCounter()}. ! The resolution is typically better than one microsecond. \end{funcdesc} From gvanrossum@users.sourceforge.net Sun Aug 19 06:41:00 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 22:41:00 -0700 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.50,1.50.2.1 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv3786 Modified Files: Tag: r22a2-branch setup.py Log Message: Remove build recipe for newmodule, as it's now static. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.50 retrieving revision 1.50.2.1 diff -C2 -d -r1.50 -r1.50.2.1 *** setup.py 2001/08/17 18:39:24 1.50 --- setup.py 2001/08/19 05:40:58 1.50.2.1 *************** *** 270,277 **** exts.append( Extension('sha', ['shamodule.c']) ) - # Tommy Burnette's 'new' module (creates new empty objects of certain - # kinds): - exts.append( Extension('new', ['newmodule.c']) ) - # Helper module for various ascii-encoders exts.append( Extension('binascii', ['binascii.c']) ) --- 270,273 ---- From montanaro@users.sourceforge.net Sun Aug 19 06:53:49 2001 From: montanaro@users.sourceforge.net (Skip Montanaro) Date: Sat, 18 Aug 2001 22:53:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib threading.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv4972 Modified Files: threading.py Log Message: of course I muffed it separating the notes code from the initial_value code. grrr... Index: threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** threading.py 2001/08/19 04:25:24 1.15 --- threading.py 2001/08/19 05:53:47 1.16 *************** *** 269,274 **** self.__value = self.__value - 1 if __debug__: ! self._note("%s.acquire: success, value=%s(%s)", ! self, self.__value, self.__initial_value) rc = 1 self.__cond.release() --- 269,274 ---- self.__value = self.__value - 1 if __debug__: ! self._note("%s.acquire: success, value=%s", ! self, self.__value) rc = 1 self.__cond.release() *************** *** 279,284 **** self.__value = self.__value + 1 if __debug__: ! self._note("%s.release: success, value=%s(%s)", ! self, self.__value, self.__initial_value) self.__cond.notify() self.__cond.release() --- 279,284 ---- self.__value = self.__value + 1 if __debug__: ! self._note("%s.release: success, value=%s", ! self, self.__value) self.__cond.notify() self.__cond.release() From gvanrossum@users.sourceforge.net Sun Aug 19 07:03:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 23:03:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib threading.py,1.14.2.1,1.14.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv5972 Modified Files: Tag: r22a2-branch threading.py Log Message: Merge Skip's fix to his debug change into branch Index: threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -C2 -d -r1.14.2.1 -r1.14.2.2 *** threading.py 2001/08/19 04:41:49 1.14.2.1 --- threading.py 2001/08/19 06:03:15 1.14.2.2 *************** *** 269,274 **** self.__value = self.__value - 1 if __debug__: ! self._note("%s.acquire: success, value=%s(%s)", ! self, self.__value, self.__initial_value) rc = 1 self.__cond.release() --- 269,274 ---- self.__value = self.__value - 1 if __debug__: ! self._note("%s.acquire: success, value=%s", ! self, self.__value) rc = 1 self.__cond.release() *************** *** 279,284 **** self.__value = self.__value + 1 if __debug__: ! self._note("%s.release: success, value=%s(%s)", ! self, self.__value, self.__initial_value) self.__cond.notify() self.__cond.release() --- 279,284 ---- self.__value = self.__value + 1 if __debug__: ! self._note("%s.release: success, value=%s", ! self, self.__value) self.__cond.notify() self.__cond.release() From gvanrossum@users.sourceforge.net Sun Aug 19 07:46:56 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 23:46:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_os.py,1.3,1.3.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv10864 Modified Files: Tag: r22a2-branch test_os.py Log Message: Ignore warnings for tempnam and tmpnam. Index: test_os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** test_os.py 2001/07/21 01:41:30 1.3 --- test_os.py 2001/08/19 06:46:54 1.3.2.1 *************** *** 5,8 **** --- 5,12 ---- import os import unittest + import warnings + + warnings.filterwarnings("ignore", "tempnam", RuntimeWarning, __name__) + warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning, __name__) from test_support import TESTFN, run_unittest From gvanrossum@users.sourceforge.net Sun Aug 19 07:59:51 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 18 Aug 2001 23:59:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.42,2.42.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv11697 Modified Files: Tag: r22a2-branch typeobject.c Log Message: Address SF bug #452832. tp_new_wrapper(): add safety test to __new__ so that you can't do something unsafe like object.__new__(type) or object.__new__(dictionary), while still allowing e.g. dictionary.__new__(X) where X is a subclass of dictionary. Also improved the other error messages in the same function to give the type name(s) involved. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.42 retrieving revision 2.42.2.1 diff -C2 -d -r2.42 -r2.42.2.1 *** typeobject.c 2001/08/17 21:57:47 2.42 --- typeobject.c 2001/08/19 06:59:49 2.42.2.1 *************** *** 2092,2096 **** tp_new_wrapper(PyObject *self, PyObject *args, PyObject *kwds) { ! PyTypeObject *type, *subtype; PyObject *arg0, *res; --- 2092,2096 ---- tp_new_wrapper(PyObject *self, PyObject *args, PyObject *kwds) { ! PyTypeObject *type, *subtype, *staticbase; PyObject *arg0, *res; *************** *** 2099,2118 **** type = (PyTypeObject *)self; if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 1) { ! PyErr_SetString(PyExc_TypeError, ! "T.__new__(): not enough arguments"); return NULL; } arg0 = PyTuple_GET_ITEM(args, 0); if (!PyType_Check(arg0)) { ! PyErr_SetString(PyExc_TypeError, ! "T.__new__(S): S is not a type object"); return NULL; } subtype = (PyTypeObject *)arg0; if (!PyType_IsSubtype(subtype, type)) { ! PyErr_SetString(PyExc_TypeError, ! "T.__new__(S): S is not a subtype of T"); return NULL; } args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); if (args == NULL) --- 2099,2141 ---- type = (PyTypeObject *)self; if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 1) { ! PyErr_Format(PyExc_TypeError, ! "%s.__new__(): not enough arguments", ! type->tp_name); return NULL; } arg0 = PyTuple_GET_ITEM(args, 0); if (!PyType_Check(arg0)) { ! PyErr_Format(PyExc_TypeError, ! "%s.__new__(X): X is not a type object (%s)", ! type->tp_name, ! arg0->ob_type->tp_name); return NULL; } subtype = (PyTypeObject *)arg0; if (!PyType_IsSubtype(subtype, type)) { ! PyErr_Format(PyExc_TypeError, ! "%s.__new__(%s): %s is not a subtype of %s", ! type->tp_name, ! subtype->tp_name, ! subtype->tp_name, ! type->tp_name); ! return NULL; ! } ! ! /* Check that the use doesn't do something silly and unsafe like ! object.__new__(dictionary). To do this, we check that the ! most derived base that's not a heap type is this type. */ ! staticbase = subtype; ! while (staticbase && (staticbase->tp_flags & Py_TPFLAGS_HEAPTYPE)) ! staticbase = staticbase->tp_base; ! if (staticbase != type) { ! PyErr_Format(PyExc_TypeError, ! "%s.__new__(%s) is not safe, use %s.__new__()", ! type->tp_name, ! subtype->tp_name, ! staticbase == NULL ? "?" : staticbase->tp_name); return NULL; } + args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); if (args == NULL) From jackjansen@users.sourceforge.net Sun Aug 19 23:33:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:33:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build _dummy_tkinter.mcp,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv29932/Python/Mac/Build Modified Files: _dummy_tkinter.mcp Log Message: The destination folder is now :Lib:lib-dynload Index: _dummy_tkinter.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/_dummy_tkinter.mcp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvshOnVJc and /tmp/cvsoMjMhh differ From jackjansen@users.sourceforge.net Sun Aug 19 23:32:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:32:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.101,1.102 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv29863/Python/Mac/Python Modified Files: macglue.c Log Message: PATCHLEVEL is outdated, use PY_VERSION. Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** macglue.c 2001/08/08 13:17:31 1.101 --- macglue.c 2001/08/19 22:32:27 1.102 *************** *** 779,783 **** TextFont(fontID); TextSize(9); ! ParamText(Pstring(PATCHLEVEL), "\p", "\p", "\p"); ShowWindow(theWindow); ModalDialog(NULL, &item); --- 779,783 ---- TextFont(fontID); TextSize(9); ! ParamText(Pstring(PY_VERSION), "\p", "\p", "\p"); ShowWindow(theWindow); ModalDialog(NULL, &item); From jackjansen@users.sourceforge.net Sun Aug 19 23:30:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:30:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/PlugIns readme.txt,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/PlugIns In directory usw-pr-cvs1:/tmp/cvs-serv29564/Python/Mac/PlugIns Removed Files: readme.txt Log Message: Step 1 in packaging the toolbox modules and making MacPython more like normal Python. toolbox modules are now in the Carbon package in :Mac:Lib, with a workaround flat namespace in :Mac:Lib:lib-compat. Other dynamic modules are in :Lib:lib-dynload. :Mac:Lib:lib-toolbox and :Mac:Plugins are gone. --- readme.txt DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:29:59 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:29:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts genpluginprojects.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv29404/Python/Mac/scripts Modified Files: genpluginprojects.py Log Message: Dynamic modules are now put in :Lib:lib-dynload by default. For the toolbox modules this is overridden to put them in :Mac:Lib:Carbon. Index: genpluginprojects.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/genpluginprojects.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** genpluginprojects.py 2001/08/16 20:39:17 1.16 --- genpluginprojects.py 2001/08/19 22:29:57 1.17 *************** *** 36,40 **** sources=[], sourcedirs=[], libraries=[], extradirs=[], ! extraexportsymbols=[]): if architecture == "all": # For the time being we generate two project files. Not as nice as --- 36,40 ---- sources=[], sourcedirs=[], libraries=[], extradirs=[], ! extraexportsymbols=[], outputdir=":::Lib:lib-dynload"): if architecture == "all": # For the time being we generate two project files. Not as nice as *************** *** 79,83 **** "extrasearchdirs" : sourcedirs + extradirs, "libraries": libraries, ! "mac_outputdir" : "::Plugins", "extraexportsymbols" : extraexportsymbols, "mac_targetname" : targetname, --- 79,83 ---- "extrasearchdirs" : sourcedirs + extradirs, "libraries": libraries, ! "mac_outputdir" : outputdir, "extraexportsymbols" : extraexportsymbols, "mac_targetname" : targetname, *************** *** 107,147 **** # bgen-generated Toolbox modules ! genpluginproject("carbon", "AE") ! genpluginproject("ppc", "AE", libraries=["ObjectSupportLib"]) ! genpluginproject("ppc", "App", libraries=["AppearanceLib"]) ! genpluginproject("carbon", "App") ! genpluginproject("ppc", "Cm", libraries=["QuickTimeLib"]) ! genpluginproject("carbon", "Cm") ! genpluginproject("carbon", "Ctl") ! genpluginproject("ppc", "Ctl", libraries=["ControlsLib", "AppearanceLib"]) ! genpluginproject("carbon", "Dlg") ! genpluginproject("ppc", "Dlg", libraries=["DialogsLib", "AppearanceLib"]) ! genpluginproject("carbon", "Drag") ! genpluginproject("ppc", "Drag", libraries=["DragLib"]) ! genpluginproject("all", "Evt") ! genpluginproject("all", "Fm") ! genpluginproject("ppc", "Help") genpluginproject("ppc", "Icn", libraries=["IconServicesLib"]) ! genpluginproject("carbon", "Icn") ! genpluginproject("all", "List") ! genpluginproject("carbon", "Menu") ! genpluginproject("ppc", "Menu", libraries=["MenusLib", "ContextualMenu", "AppearanceLib"]) ! genpluginproject("all", "Qd") ! genpluginproject("ppc", "Qt", libraries=["QuickTimeLib"]) ! genpluginproject("carbon", "Qt") ! genpluginproject("all", "Qdoffs") ! genpluginproject("all", "Res") ! genpluginproject("all", "Scrap") ! genpluginproject("ppc", "Snd", libraries=["SoundLib"]) ! genpluginproject("carbon", "Snd") ! genpluginproject("all", "Sndihooks", sources=[":snd:Sndihooks.c"]) ! genpluginproject("ppc", "TE", libraries=["DragLib"]) ! genpluginproject("carbon", "TE") ! genpluginproject("ppc", "Mlte", libraries=["Textension"]) ! genpluginproject("carbon", "Mlte") ! genpluginproject("carbon", "Win") ! genpluginproject("ppc", "Win", libraries=["WindowsLib", "AppearanceLib"]) # Carbon Only? ! genpluginproject("carbon", "CF") # Other Mac modules --- 107,151 ---- # bgen-generated Toolbox modules ! genpluginproject("carbon", "AE", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "AE", libraries=["ObjectSupportLib"], outputdir="::Lib:Carbon") ! genpluginproject("ppc", "App", libraries=["AppearanceLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "App", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Cm", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Cm", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Ctl", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Ctl", libraries=["ControlsLib", "AppearanceLib"], ! outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Dlg", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Dlg", libraries=["DialogsLib", "AppearanceLib"], ! outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Drag", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Drag", libraries=["DragLib"], outputdir="::Lib:Carbon") ! genpluginproject("all", "Evt", outputdir="::Lib:Carbon") ! genpluginproject("all", "Fm", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Help", outputdir="::Lib:Carbon") genpluginproject("ppc", "Icn", libraries=["IconServicesLib"]) ! genpluginproject("carbon", "Icn", outputdir="::Lib:Carbon") ! genpluginproject("all", "List", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Menu", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Menu", libraries=["MenusLib", "ContextualMenu", "AppearanceLib"], ! outputdir="::Lib:Carbon") ! genpluginproject("all", "Qd", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Qt", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Qt", outputdir="::Lib:Carbon") ! genpluginproject("all", "Qdoffs", outputdir="::Lib:Carbon") ! genpluginproject("all", "Res", outputdir="::Lib:Carbon") ! genpluginproject("all", "Scrap", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Snd", libraries=["SoundLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Snd", outputdir="::Lib:Carbon") ! genpluginproject("all", "Sndihooks", sources=[":snd:Sndihooks.c"], outputdir="::Lib:Carbon") ! genpluginproject("ppc", "TE", libraries=["DragLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "TE", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Mlte", libraries=["Textension"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Mlte", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Win", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Win", libraries=["WindowsLib", "AppearanceLib"], ! outputdir="::Lib:Carbon") # Carbon Only? ! genpluginproject("carbon", "CF", outputdir="::Lib:Carbon") # Other Mac modules From jackjansen@users.sourceforge.net Sun Aug 19 23:28:34 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:28:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Qt.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv29187/Python/Mac/Lib/lib-compat Added Files: Qt.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Qt.py --- from Carbon.Qt import * From jackjansen@users.sourceforge.net Sun Aug 19 23:28:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:28:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Mlte.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv29170/Python/Mac/Lib/lib-compat Added Files: Mlte.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Mlte.py --- from Carbon.Mlte import * From jackjansen@users.sourceforge.net Sun Aug 19 23:28:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:28:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Menu.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv29148/Python/Mac/Lib/lib-compat Added Files: Menu.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Menu.py --- from Carbon.Menu import * From jackjansen@users.sourceforge.net Sun Aug 19 21:28:42 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 13:28:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build AE.carbon.mcp.exp,1.1,NONE AE.carbon.mcp.xml,1.1,NONE App.carbon.mcp.exp,1.1,NONE App.carbon.mcp.xml,1.2,NONE App.mcp.exp,1.1,NONE App.mcp.xml,1.4,NONE CF.carbon.mcp.exp,1.1,NONE CF.carbon.mcp.xml,1.1,NONE Cm.carbon.mcp.exp,1.1,NONE Cm.carbon.mcp.xml,1.2,NONE Cm.mcp.exp,1.1,NONE Cm.mcp.xml,1.4,NONE ColorPicker.carbon.mcp.exp,1.1,NONE ColorPicker.carbon.mcp.xml,1.2,NONE ColorPicker.mcp.exp,1.1,NONE ColorPicker.mcp.xml,1.4,NONE Ctl.carbon.mcp.exp,1.1,NONE Ctl.carbon.mcp.xml,1.1,NONE Ctl.mcp.exp,1.1,NONE Ctl.mcp.xml,1.1,NONE Dlg.carbon.mcp.exp,1.1,NONE Dlg.carbon.mcp.xml,1.1,NONE Dlg.mcp.exp,1.1,NONE Dlg.mcp.xml,1.1,NONE Drag.carbon.mcp.exp,1.1,NONE Drag.carbon.mcp.xml,1.1,NONE Drag.mcp.exp,1.3,NONE Drag.mcp.xml,1.3,NONE Evt.carbon.mcp.exp,1.1,NONE Evt.carbon.mcp.xml,1.1,NONE Evt.mcp.exp,1.1,NONE Evt.mcp.xml,1.1,NONE Fm.carbon.mcp.exp,1.1,NONE Fm.carbon.mcp.xml,1.2,NONE Fm.mcp.exp,1.1,NONE Fm.mcp.xml,1.4,NONE Help.mcp.exp,1.1,NONE Help.mcp.xml,1.4,NONE HtmlRender.prj.exp,1.1,NONE Icn.carbon.mcp.exp,1.1,NONE Icn.carbon.mcp.xml,1.2,NONE Icn.mcp.exp,1.1,NONE Icn.mcp.xml,1.4,NONE List.carbon.mcp.exp,1.1,NONE List.carbon.mcp.xml,1.2,NONE List.mcp.exp,1.1,NONE List.mcp.xml,1.4,NONE Menu.carbon.mcp.exp,1.1,NONE Menu.carbon.mcp.xml,1.1,NONE Menu.mcp.exp,1.1,NONE Menu.mcp.xml,1.1,NONE Mlte.carbon.mcp.exp,1.1,NONE Mlte.carbon.mcp.xml,1.1,NONE Mlte.mcp.exp,1.1,NONE Mlte.mcp.xml,1.1,NONE Printing.mcp.exp,1.1,NONE Printing.mcp.xml,1.4,NONE Qd.carbon.mcp.exp,1.1,NONE Qd.carbon.mcp.xml,1.1,NONE Qd.mcp.exp,1.1,NONE Qd.mcp.xml,1.1,NONE Qdoffs.carbon.mcp.exp,1.1,NONE Qdoffs.carbon.mcp.xml,1.2,NONE Qdoffs.mcp.exp,1.2,NONE Qdoffs.mcp.xml,1.4,NONE Qt.carbon.mcp.exp,1.1,NONE Qt.carbon.mcp.xml,1.2,NONE Qt.mcp.exp,1.1,NONE Qt.mcp.xml,1.5,NONE Res.carbon.mcp.exp,1.1,NONE Res.carbon.mcp.xml,1.1,NONE Res.mcp.exp,1.1,NONE Res.mcp.xml,1.1,NONE Scrap.carbon.mcp.exp,1.1,NONE Scrap.carbon.mcp.xml,1.1,NONE Scrap.mcp.exp,1.1,NONE Scrap.mcp.xml,1.4,NONE Snd.carbon.mcp.exp,1.1,NONE Snd.carbon.mcp.xml,1.2,NONE Snd.mcp.exp,1.1,NONE Snd.mcp.xml,1.4,NONE Sndihooks.carbon.mcp.exp,1.1,NONE Sndihooks.carbon.mcp.xml,1.2,NONE Sndihooks.mcp.exp,1.1,NONE Sndihooks.mcp.xml,1.4,NONE TE.carbon.mcp.exp,1.1,NONE TE.carbon.mcp.xml,1.2,NONE TE.mcp.exp,1.1,NONE TE.mcp.xml,1.4,NONE Win.carbon.mcp.exp,1.1,NONE Win.carbon.mcp.xml,1.1,NONE Win.mcp.exp,1.1,NONE Win.mcp.xml,1.1,NONE _dummy_tkinter.mcp.exp,1.1,NONE _symtable.carbon.mcp.exp,1.1,NONE _symtable.carbon.mcp.xml,1.1,NONE _symtable.mcp.exp,1.1,NONE _symtable.mcp.xml,1.1,NONE _testcapi.carbon.mcp.exp,1.1,NONE _testcapi.carbon.mcp.xml,1.1,NONE _testcapi.mcp.exp,1.1,NONE _testcapi.mcp.xml,1.1,NONE _weakref.carbon.mcp.exp,1.1,NONE _weakref.carbon.mcp.xml,1.1,NONE _weakref.mcp.exp,1.1,NONE _weakref.mcp.xml,1.1,NONE calldll.carbon.mcp.exp,1.1,NONE calldll.carbon.mcp.xml,1.2,NONE calldll.mcp.exp,1.1,NONE calldll.mcp.xml,1.4,NONE ctb.mcp.exp,1.1,NONE ctb.mcp.xml,1.4,NONE gdbm.carbon.mcp.exp,1.1,NONE gdbm.carbon.mcp.xml,1.2,NONE gdbm.mcp.exp,1.1,NONE gdbm.mcp.xml,1.4,NONE icglue.carbon.mcp.exp,1.1,NONE icglue.carbon.mcp.xml,1.1,NONE icglue.mcp.exp,1.1,NONE icglue.mcp.xml,1.4,NONE macspeech.mcp.exp,1.1,NONE macspeech.mcp.xml,1.4,NONE pyexpat.carbon.mcp.exp,1.1,NONE pyexpat.carbon.mcp.xml,1.2,NONE pyexpat.mcp.exp,1.1,NONE pyexpat.mcp.xml,1.4,NONE waste.carbon.mcp.exp,1.1,NONE waste.carbon.mcp.xml,1.1,NONE waste.mcp.exp,1.1,NONE waste.mcp.xml,1.4,NONE xx.prj.exp,1.1,NONE zlib.carbon.mcp.exp,1.1,NONE zlib.carbon.mcp.xml,1.2,NONE zlib.mcp.exp,1.1,NONE zlib.mcp.xml,1.4,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv6937 Removed Files: AE.carbon.mcp.exp AE.carbon.mcp.xml App.carbon.mcp.exp App.carbon.mcp.xml App.mcp.exp App.mcp.xml CF.carbon.mcp.exp CF.carbon.mcp.xml Cm.carbon.mcp.exp Cm.carbon.mcp.xml Cm.mcp.exp Cm.mcp.xml ColorPicker.carbon.mcp.exp ColorPicker.carbon.mcp.xml ColorPicker.mcp.exp ColorPicker.mcp.xml Ctl.carbon.mcp.exp Ctl.carbon.mcp.xml Ctl.mcp.exp Ctl.mcp.xml Dlg.carbon.mcp.exp Dlg.carbon.mcp.xml Dlg.mcp.exp Dlg.mcp.xml Drag.carbon.mcp.exp Drag.carbon.mcp.xml Drag.mcp.exp Drag.mcp.xml Evt.carbon.mcp.exp Evt.carbon.mcp.xml Evt.mcp.exp Evt.mcp.xml Fm.carbon.mcp.exp Fm.carbon.mcp.xml Fm.mcp.exp Fm.mcp.xml Help.mcp.exp Help.mcp.xml HtmlRender.prj.exp Icn.carbon.mcp.exp Icn.carbon.mcp.xml Icn.mcp.exp Icn.mcp.xml List.carbon.mcp.exp List.carbon.mcp.xml List.mcp.exp List.mcp.xml Menu.carbon.mcp.exp Menu.carbon.mcp.xml Menu.mcp.exp Menu.mcp.xml Mlte.carbon.mcp.exp Mlte.carbon.mcp.xml Mlte.mcp.exp Mlte.mcp.xml Printing.mcp.exp Printing.mcp.xml Qd.carbon.mcp.exp Qd.carbon.mcp.xml Qd.mcp.exp Qd.mcp.xml Qdoffs.carbon.mcp.exp Qdoffs.carbon.mcp.xml Qdoffs.mcp.exp Qdoffs.mcp.xml Qt.carbon.mcp.exp Qt.carbon.mcp.xml Qt.mcp.exp Qt.mcp.xml Res.carbon.mcp.exp Res.carbon.mcp.xml Res.mcp.exp Res.mcp.xml Scrap.carbon.mcp.exp Scrap.carbon.mcp.xml Scrap.mcp.exp Scrap.mcp.xml Snd.carbon.mcp.exp Snd.carbon.mcp.xml Snd.mcp.exp Snd.mcp.xml Sndihooks.carbon.mcp.exp Sndihooks.carbon.mcp.xml Sndihooks.mcp.exp Sndihooks.mcp.xml TE.carbon.mcp.exp TE.carbon.mcp.xml TE.mcp.exp TE.mcp.xml Win.carbon.mcp.exp Win.carbon.mcp.xml Win.mcp.exp Win.mcp.xml _dummy_tkinter.mcp.exp _symtable.carbon.mcp.exp _symtable.carbon.mcp.xml _symtable.mcp.exp _symtable.mcp.xml _testcapi.carbon.mcp.exp _testcapi.carbon.mcp.xml _testcapi.mcp.exp _testcapi.mcp.xml _weakref.carbon.mcp.exp _weakref.carbon.mcp.xml _weakref.mcp.exp _weakref.mcp.xml calldll.carbon.mcp.exp calldll.carbon.mcp.xml calldll.mcp.exp calldll.mcp.xml ctb.mcp.exp ctb.mcp.xml gdbm.carbon.mcp.exp gdbm.carbon.mcp.xml gdbm.mcp.exp gdbm.mcp.xml icglue.carbon.mcp.exp icglue.carbon.mcp.xml icglue.mcp.exp icglue.mcp.xml macspeech.mcp.exp macspeech.mcp.xml pyexpat.carbon.mcp.exp pyexpat.carbon.mcp.xml pyexpat.mcp.exp pyexpat.mcp.xml waste.carbon.mcp.exp waste.carbon.mcp.xml waste.mcp.exp waste.mcp.xml xx.prj.exp zlib.carbon.mcp.exp zlib.carbon.mcp.xml zlib.mcp.exp zlib.mcp.xml Log Message: Got rid of all the plugin xml files: they are generated, and they were only in the repository for people building MacPython from CVS (the .cmp project files are in a MacPython source distribution). The process to regenerate them is now easier (and documented!) so these shouldn't be needed anymore. And eventually they should all be built by setup.py anyway. --- AE.carbon.mcp.exp DELETED --- --- AE.carbon.mcp.xml DELETED --- --- App.carbon.mcp.exp DELETED --- --- App.carbon.mcp.xml DELETED --- --- App.mcp.exp DELETED --- --- App.mcp.xml DELETED --- --- CF.carbon.mcp.exp DELETED --- --- CF.carbon.mcp.xml DELETED --- --- Cm.carbon.mcp.exp DELETED --- --- Cm.carbon.mcp.xml DELETED --- --- Cm.mcp.exp DELETED --- --- Cm.mcp.xml DELETED --- --- ColorPicker.carbon.mcp.exp DELETED --- --- ColorPicker.carbon.mcp.xml DELETED --- --- ColorPicker.mcp.exp DELETED --- --- ColorPicker.mcp.xml DELETED --- --- Ctl.carbon.mcp.exp DELETED --- --- Ctl.carbon.mcp.xml DELETED --- --- Ctl.mcp.exp DELETED --- --- Ctl.mcp.xml DELETED --- --- Dlg.carbon.mcp.exp DELETED --- --- Dlg.carbon.mcp.xml DELETED --- --- Dlg.mcp.exp DELETED --- --- Dlg.mcp.xml DELETED --- --- Drag.carbon.mcp.exp DELETED --- --- Drag.carbon.mcp.xml DELETED --- --- Drag.mcp.exp DELETED --- --- Drag.mcp.xml DELETED --- --- Evt.carbon.mcp.exp DELETED --- --- Evt.carbon.mcp.xml DELETED --- --- Evt.mcp.exp DELETED --- --- Evt.mcp.xml DELETED --- --- Fm.carbon.mcp.exp DELETED --- --- Fm.carbon.mcp.xml DELETED --- --- Fm.mcp.exp DELETED --- --- Fm.mcp.xml DELETED --- --- Help.mcp.exp DELETED --- --- Help.mcp.xml DELETED --- --- HtmlRender.prj.exp DELETED --- --- Icn.carbon.mcp.exp DELETED --- --- Icn.carbon.mcp.xml DELETED --- --- Icn.mcp.exp DELETED --- --- Icn.mcp.xml DELETED --- --- List.carbon.mcp.exp DELETED --- --- List.carbon.mcp.xml DELETED --- --- List.mcp.exp DELETED --- --- List.mcp.xml DELETED --- --- Menu.carbon.mcp.exp DELETED --- --- Menu.carbon.mcp.xml DELETED --- --- Menu.mcp.exp DELETED --- --- Menu.mcp.xml DELETED --- --- Mlte.carbon.mcp.exp DELETED --- --- Mlte.carbon.mcp.xml DELETED --- --- Mlte.mcp.exp DELETED --- --- Mlte.mcp.xml DELETED --- --- Printing.mcp.exp DELETED --- --- Printing.mcp.xml DELETED --- --- Qd.carbon.mcp.exp DELETED --- --- Qd.carbon.mcp.xml DELETED --- --- Qd.mcp.exp DELETED --- --- Qd.mcp.xml DELETED --- --- Qdoffs.carbon.mcp.exp DELETED --- --- Qdoffs.carbon.mcp.xml DELETED --- --- Qdoffs.mcp.exp DELETED --- --- Qdoffs.mcp.xml DELETED --- --- Qt.carbon.mcp.exp DELETED --- --- Qt.carbon.mcp.xml DELETED --- --- Qt.mcp.exp DELETED --- --- Qt.mcp.xml DELETED --- --- Res.carbon.mcp.exp DELETED --- --- Res.carbon.mcp.xml DELETED --- --- Res.mcp.exp DELETED --- --- Res.mcp.xml DELETED --- --- Scrap.carbon.mcp.exp DELETED --- --- Scrap.carbon.mcp.xml DELETED --- --- Scrap.mcp.exp DELETED --- --- Scrap.mcp.xml DELETED --- --- Snd.carbon.mcp.exp DELETED --- --- Snd.carbon.mcp.xml DELETED --- --- Snd.mcp.exp DELETED --- --- Snd.mcp.xml DELETED --- --- Sndihooks.carbon.mcp.exp DELETED --- --- Sndihooks.carbon.mcp.xml DELETED --- --- Sndihooks.mcp.exp DELETED --- --- Sndihooks.mcp.xml DELETED --- --- TE.carbon.mcp.exp DELETED --- --- TE.carbon.mcp.xml DELETED --- --- TE.mcp.exp DELETED --- --- TE.mcp.xml DELETED --- --- Win.carbon.mcp.exp DELETED --- --- Win.carbon.mcp.xml DELETED --- --- Win.mcp.exp DELETED --- --- Win.mcp.xml DELETED --- --- _dummy_tkinter.mcp.exp DELETED --- --- _symtable.carbon.mcp.exp DELETED --- --- _symtable.carbon.mcp.xml DELETED --- --- _symtable.mcp.exp DELETED --- --- _symtable.mcp.xml DELETED --- --- _testcapi.carbon.mcp.exp DELETED --- --- _testcapi.carbon.mcp.xml DELETED --- --- _testcapi.mcp.exp DELETED --- --- _testcapi.mcp.xml DELETED --- --- _weakref.carbon.mcp.exp DELETED --- --- _weakref.carbon.mcp.xml DELETED --- --- _weakref.mcp.exp DELETED --- --- _weakref.mcp.xml DELETED --- --- calldll.carbon.mcp.exp DELETED --- --- calldll.carbon.mcp.xml DELETED --- --- calldll.mcp.exp DELETED --- --- calldll.mcp.xml DELETED --- --- ctb.mcp.exp DELETED --- --- ctb.mcp.xml DELETED --- --- gdbm.carbon.mcp.exp DELETED --- --- gdbm.carbon.mcp.xml DELETED --- --- gdbm.mcp.exp DELETED --- --- gdbm.mcp.xml DELETED --- --- icglue.carbon.mcp.exp DELETED --- --- icglue.carbon.mcp.xml DELETED --- --- icglue.mcp.exp DELETED --- --- icglue.mcp.xml DELETED --- --- macspeech.mcp.exp DELETED --- --- macspeech.mcp.xml DELETED --- --- pyexpat.carbon.mcp.exp DELETED --- --- pyexpat.carbon.mcp.xml DELETED --- --- pyexpat.mcp.exp DELETED --- --- pyexpat.mcp.xml DELETED --- --- waste.carbon.mcp.exp DELETED --- --- waste.carbon.mcp.xml DELETED --- --- waste.mcp.exp DELETED --- --- waste.mcp.xml DELETED --- --- xx.prj.exp DELETED --- --- zlib.carbon.mcp.exp DELETED --- --- zlib.carbon.mcp.xml DELETED --- --- zlib.mcp.exp DELETED --- --- zlib.mcp.xml DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 22:17:59 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 14:17:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEXT-NOTES,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv15356/Python/Misc Removed Files: NEXT-NOTES Log Message: Removed NEXT-NOTES, the NeXT is no longer supported. --- NEXT-NOTES DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 22:18:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 14:18:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc README,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv15418/Python/Misc Modified Files: README Log Message: Removed NEXT-NOTES, the NeXT is no longer supported. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/README,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** README 2000/09/01 23:22:12 1.14 --- README 2001/08/19 21:18:04 1.15 *************** *** 21,25 **** Makefile.pre.in Generic Makefile template for building extensions NEWS News for this release - NEXT-NOTES Porting notes for NeXT PURIFY.README Information for Purify users Porting Mini-FAQ on porting to new platforms --- 21,24 ---- From jackjansen@users.sourceforge.net Sun Aug 19 23:00:23 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:00:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Splash.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22251/Python/Mac/Tools/IDE Modified Files: Splash.py Log Message: Temporarily disabled the import hook. It breaks with the package-based Carbon and its workaround. Index: Splash.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Splash.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Splash.py 2001/06/19 21:37:33 1.12 --- Splash.py 2001/08/19 22:00:20 1.13 *************** *** 33,36 **** --- 33,37 ---- fontID = Fm.GetFNum("Python-Sans") if not fontID: + from Fonts import geneva fontID = geneva Qd.TextFont(fontID) *************** *** 65,69 **** return _real__import__(name) ! install_importhook() kHighLevelEvent = 23 --- 66,70 ---- return _real__import__(name) ! #install_importhook() kHighLevelEvent = 23 From jackjansen@users.sourceforge.net Sun Aug 19 23:02:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:02:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Resources pythonpath.r,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Resources In directory usw-pr-cvs1:/tmp/cvs-serv22751/Python/Mac/Resources Modified Files: pythonpath.r Log Message: Step 1 in packaging the toolbox modules and making MacPython more like normal Python. toolbox modules are now in the Carbon package in :Mac:Lib, with a workaround flat namespace in :Mac:Lib:lib-compat. Other dynamic modules are in :Lib:lib-dynload. :Mac:Lib:lib-toolbox and :Mac:Plugins are gone. Index: pythonpath.r =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Resources/pythonpath.r,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** pythonpath.r 2001/08/16 15:16:19 1.12 --- pythonpath.r 2001/08/19 22:02:56 1.13 *************** *** 83,90 **** { "$(PYTHON)", - "$(PYTHON):Mac:PlugIns", "$(PYTHON):Mac:Lib", ! "$(PYTHON):Mac:Lib:lib-toolbox", "$(PYTHON):Mac:Lib:lib-scriptpackages", "$(PYTHON):Lib", "$(PYTHON):Extensions:img:Mac", --- 83,90 ---- { "$(PYTHON)", "$(PYTHON):Mac:Lib", ! "$(PYTHON):Mac:Lib:lib-compat", "$(PYTHON):Mac:Lib:lib-scriptpackages", + "$(PYTHON):Lib:lib-dynload", "$(PYTHON):Lib", "$(PYTHON):Extensions:img:Mac", From jackjansen@users.sourceforge.net Sun Aug 19 23:04:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:04:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib aetools.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23219/Python/Mac/Lib Added Files: aetools.py Log Message: Moved here from lib-toolbox, where they should never have been in the first place (all the other stuff there wa generated with bgen). --- NEW FILE: aetools.py --- """Tools for use in AppleEvent clients and servers. pack(x) converts a Python object to an AEDesc object unpack(desc) does the reverse packevent(event, parameters, attributes) sets params and attrs in an AEAppleEvent record unpackevent(event) returns the parameters and attributes from an AEAppleEvent record Plus... Lots of classes and routines that help representing AE objects, ranges, conditionals, logicals, etc., so you can write, e.g.: x = Character(1, Document("foobar")) and pack(x) will create an AE object reference equivalent to AppleScript's character 1 of document "foobar" Some of the stuff that appears to be exported from this module comes from other files: the pack stuff from aepack, the objects from aetypes. """ from types import * import AE import AppleEvents import MacOS import sys from aetypes import * from aepack import pack, unpack, coerce, AEDescType Error = 'aetools.Error' # Special code to unpack an AppleEvent (which is *not* a disguised record!) # Note by Jack: No??!? If I read the docs correctly it *is*.... aekeywords = [ 'tran', 'rtid', 'evcl', 'evid', 'addr', 'optk', 'timo', 'inte', # this attribute is read only - will be set in AESend 'esrc', # this attribute is read only 'miss', # this attribute is read only 'from' # new in 1.0.1 ] def missed(ae): try: desc = ae.AEGetAttributeDesc('miss', 'keyw') except AE.Error, msg: return None return desc.data def unpackevent(ae): parameters = {} try: dirobj = ae.AEGetParamDesc('----', '****') except AE.Error: pass else: parameters['----'] = unpack(dirobj) del dirobj while 1: key = missed(ae) if not key: break parameters[key] = unpack(ae.AEGetParamDesc(key, '****')) attributes = {} for key in aekeywords: try: desc = ae.AEGetAttributeDesc(key, '****') except (AE.Error, MacOS.Error), msg: if msg[0] != -1701 and msg[0] != -1704: raise sys.exc_type, sys.exc_value continue attributes[key] = unpack(desc) return parameters, attributes def packevent(ae, parameters = {}, attributes = {}): for key, value in parameters.items(): ae.AEPutParamDesc(key, pack(value)) for key, value in attributes.items(): ae.AEPutAttributeDesc(key, pack(value)) # # Support routine for automatically generated Suite interfaces # These routines are also useable for the reverse function. # def keysubst(arguments, keydict): """Replace long name keys by their 4-char counterparts, and check""" ok = keydict.values() for k in arguments.keys(): if keydict.has_key(k): v = arguments[k] del arguments[k] arguments[keydict[k]] = v elif k != '----' and k not in ok: raise TypeError, 'Unknown keyword argument: %s'%k def enumsubst(arguments, key, edict): """Substitute a single enum keyword argument, if it occurs""" if not arguments.has_key(key) or edict is None: return v = arguments[key] ok = edict.values() if edict.has_key(v): arguments[key] = edict[v] elif not v in ok: raise TypeError, 'Unknown enumerator: %s'%v def decodeerror(arguments): """Create the 'best' argument for a raise MacOS.Error""" errn = arguments['errn'] err_a1 = errn if arguments.has_key('errs'): err_a2 = arguments['errs'] else: err_a2 = MacOS.GetErrorString(errn) if arguments.has_key('erob'): err_a3 = arguments['erob'] else: err_a3 = None return (err_a1, err_a2, err_a3) class TalkTo: """An AE connection to an application""" _signature = None # Can be overridden by subclasses def __init__(self, signature=None, start=0, timeout=0): """Create a communication channel with a particular application. Addressing the application is done by specifying either a 4-byte signature, an AEDesc or an object that will __aepack__ to an AEDesc. """ self.target_signature = None if signature is None: signature = self._signature if type(signature) == AEDescType: self.target = signature elif type(signature) == InstanceType and hasattr(signature, '__aepack__'): self.target = signature.__aepack__() elif type(signature) == StringType and len(signature) == 4: self.target = AE.AECreateDesc(AppleEvents.typeApplSignature, signature) self.target_signature = signature else: raise TypeError, "signature should be 4-char string or AEDesc" self.send_flags = AppleEvents.kAEWaitReply self.send_priority = AppleEvents.kAENormalPriority if timeout: self.send_timeout = timeout else: self.send_timeout = AppleEvents.kAEDefaultTimeout if start: self.start() def start(self): """Start the application, if it is not running yet""" try: self.send('ascr', 'noop') except AE.Error: _launch(self.target_signature) def newevent(self, code, subcode, parameters = {}, attributes = {}): """Create a complete structure for an apple event""" event = AE.AECreateAppleEvent(code, subcode, self.target, AppleEvents.kAutoGenerateReturnID, AppleEvents.kAnyTransactionID) packevent(event, parameters, attributes) return event def sendevent(self, event): """Send a pre-created appleevent, await the reply and unpack it""" reply = event.AESend(self.send_flags, self.send_priority, self.send_timeout) parameters, attributes = unpackevent(reply) return reply, parameters, attributes def send(self, code, subcode, parameters = {}, attributes = {}): """Send an appleevent given code/subcode/pars/attrs and unpack the reply""" return self.sendevent(self.newevent(code, subcode, parameters, attributes)) # # The following events are somehow "standard" and don't seem to appear in any # suite... # def activate(self): """Send 'activate' command""" self.send('misc', 'actv') def _get(self, _object, as=None, _attributes={}): """_get: get data from an object Required argument: the object Keyword argument _attributes: AppleEvent attribute dictionary Returns: the data """ _code = 'core' _subcode = 'getd' _arguments = {'----':_object} if as: _arguments['rtyp'] = mktype(as) _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise Error, decodeerror(_arguments) if _arguments.has_key('----'): return _arguments['----'] # Tiny Finder class, for local use only class _miniFinder(TalkTo): def open(self, _object, _attributes={}, **_arguments): """open: Open the specified object(s) Required argument: list of objects to open 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.has_key('errn'): raise Error, decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] #pass _finder = _miniFinder('MACS') def _launch(appfile): """Open a file thru the finder. Specify file by name or fsspec""" _finder.open(_application_file(('ID ', appfile))) class _application_file(ComponentItem): """application file - An application's file on disk""" want = 'appf' _application_file._propdict = { } _application_file._elemdict = { } # Test program # XXXX Should test more, really... def test(): target = AE.AECreateDesc('sign', 'quil') ae = AE.AECreateAppleEvent('aevt', 'oapp', target, -1, 0) print unpackevent(ae) raw_input(":") ae = AE.AECreateAppleEvent('core', 'getd', target, -1, 0) obj = Character(2, Word(1, Document(1))) print obj print repr(obj) packevent(ae, {'----': obj}) params, attrs = unpackevent(ae) print params['----'] raw_input(":") if __name__ == '__main__': test() sys.exit(1) From jackjansen@users.sourceforge.net Sun Aug 19 23:05:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:05:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv23510/Carbon Log Message: Directory /cvsroot/python/python/dist/src/Mac/Lib/Carbon added to the repository From jackjansen@users.sourceforge.net Sun Aug 19 23:10:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:10:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon AppleEvents.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24709/Python/Mac/Lib/Carbon Added Files: AppleEvents.py Log Message: The modules with toolbox constants. --- NEW FILE: AppleEvents.py --- # Generated from 'AEDataModel.h' def FOUR_CHAR_CODE(x): return x typeBoolean = FOUR_CHAR_CODE('bool') typeChar = FOUR_CHAR_CODE('TEXT') typeSInt16 = FOUR_CHAR_CODE('shor') typeSInt32 = FOUR_CHAR_CODE('long') typeUInt32 = FOUR_CHAR_CODE('magn') typeSInt64 = FOUR_CHAR_CODE('comp') typeIEEE32BitFloatingPoint = FOUR_CHAR_CODE('sing') typeIEEE64BitFloatingPoint = FOUR_CHAR_CODE('doub') type128BitFloatingPoint = FOUR_CHAR_CODE('ldbl') typeDecimalStruct = FOUR_CHAR_CODE('decm') typeSMInt = typeSInt16 typeShortInteger = typeSInt16 typeInteger = typeSInt32 typeLongInteger = typeSInt32 typeMagnitude = typeUInt32 typeComp = typeSInt64 typeSMFloat = typeIEEE32BitFloatingPoint typeShortFloat = typeIEEE32BitFloatingPoint typeFloat = typeIEEE64BitFloatingPoint typeLongFloat = typeIEEE64BitFloatingPoint typeExtended = FOUR_CHAR_CODE('exte') typeAEList = FOUR_CHAR_CODE('list') typeAERecord = FOUR_CHAR_CODE('reco') typeAppleEvent = FOUR_CHAR_CODE('aevt') typeEventRecord = FOUR_CHAR_CODE('evrc') typeTrue = FOUR_CHAR_CODE('true') typeFalse = FOUR_CHAR_CODE('fals') typeAlias = FOUR_CHAR_CODE('alis') typeEnumerated = FOUR_CHAR_CODE('enum') typeType = FOUR_CHAR_CODE('type') typeAppParameters = FOUR_CHAR_CODE('appa') typeProperty = FOUR_CHAR_CODE('prop') typeFSS = FOUR_CHAR_CODE('fss ') typeKeyword = FOUR_CHAR_CODE('keyw') typeSectionH = FOUR_CHAR_CODE('sect') typeWildCard = FOUR_CHAR_CODE('****') typeApplSignature = FOUR_CHAR_CODE('sign') typeQDRectangle = FOUR_CHAR_CODE('qdrt') typeFixed = FOUR_CHAR_CODE('fixd') typeSessionID = FOUR_CHAR_CODE('ssid') typeTargetID = FOUR_CHAR_CODE('targ') typeProcessSerialNumber = FOUR_CHAR_CODE('psn ') typeKernelProcessID = FOUR_CHAR_CODE('kpid') typeDispatcherID = FOUR_CHAR_CODE('dspt') typeNull = FOUR_CHAR_CODE('null') keyTransactionIDAttr = FOUR_CHAR_CODE('tran') keyReturnIDAttr = FOUR_CHAR_CODE('rtid') keyEventClassAttr = FOUR_CHAR_CODE('evcl') keyEventIDAttr = FOUR_CHAR_CODE('evid') keyAddressAttr = FOUR_CHAR_CODE('addr') keyOptionalKeywordAttr = FOUR_CHAR_CODE('optk') keyTimeoutAttr = FOUR_CHAR_CODE('timo') keyInteractLevelAttr = FOUR_CHAR_CODE('inte') keyEventSourceAttr = FOUR_CHAR_CODE('esrc') keyMissedKeywordAttr = FOUR_CHAR_CODE('miss') keyOriginalAddressAttr = FOUR_CHAR_CODE('from') kAEDescListFactorNone = 0 kAEDescListFactorType = 4 kAEDescListFactorTypeAndSize = 8 kAutoGenerateReturnID = -1 kAnyTransactionID = 0 kAEDataArray = 0 kAEPackedArray = 1 kAEDescArray = 3 kAEKeyDescArray = 4 kAEHandleArray = 2 keyDirectObject = FOUR_CHAR_CODE('----') keyErrorNumber = FOUR_CHAR_CODE('errn') keyErrorString = FOUR_CHAR_CODE('errs') keyProcessSerialNumber = FOUR_CHAR_CODE('psn ') keyPreDispatch = FOUR_CHAR_CODE('phac') keySelectProc = FOUR_CHAR_CODE('selh') keyAERecorderCount = FOUR_CHAR_CODE('recr') keyAEVersion = FOUR_CHAR_CODE('vers') kCoreEventClass = FOUR_CHAR_CODE('aevt') kAEOpenApplication = FOUR_CHAR_CODE('oapp') kAEOpenDocuments = FOUR_CHAR_CODE('odoc') kAEPrintDocuments = FOUR_CHAR_CODE('pdoc') kAEQuitApplication = FOUR_CHAR_CODE('quit') kAEAnswer = FOUR_CHAR_CODE('ansr') kAEApplicationDied = FOUR_CHAR_CODE('obit') kAEStartRecording = FOUR_CHAR_CODE('reca') kAEStopRecording = FOUR_CHAR_CODE('recc') kAENotifyStartRecording = FOUR_CHAR_CODE('rec1') kAENotifyStopRecording = FOUR_CHAR_CODE('rec0') kAENotifyRecording = FOUR_CHAR_CODE('recr') kAENeverInteract = 0x00000010 kAECanInteract = 0x00000020 kAEAlwaysInteract = 0x00000030 kAECanSwitchLayer = 0x00000040 kAEDontRecord = 0x00001000 kAEDontExecute = 0x00002000 kAEProcessNonReplyEvents = 0x00008000 kAENoReply = 0x00000001 kAEQueueReply = 0x00000002 kAEWaitReply = 0x00000003 kAEDontReconnect = 0x00000080 kAEWantReceipt = 0x00000200 kAEDefaultTimeout = -1 kNoTimeOut = -2 kAENormalPriority = 0x00000000 kAEHighPriority = 0x00000001 kAEUnknownSource = 0 kAEDirectCall = 1 kAESameProcess = 2 kAELocalProcess = 3 kAERemoteProcess = 4 kAEInteractWithSelf = 0 kAEInteractWithLocal = 1 kAEInteractWithAll = 2 kAEDoNotIgnoreHandler = 0x00000000 kAEIgnoreAppPhacHandler = 0x00000001 kAEIgnoreAppEventHandler = 0x00000002 kAEIgnoreSysPhacHandler = 0x00000004 kAEIgnoreSysEventHandler = 0x00000008 kAEIngoreBuiltInEventHandler = 0x00000010 # kAEDontDisposeOnResume = (long)0x80000000 kAENoDispatch = 0 # kAEUseStandardDispatch = (long)0xFFFFFFFF cAEList = FOUR_CHAR_CODE('list') cApplication = FOUR_CHAR_CODE('capp') cArc = FOUR_CHAR_CODE('carc') cBoolean = FOUR_CHAR_CODE('bool') cCell = FOUR_CHAR_CODE('ccel') cChar = FOUR_CHAR_CODE('cha ') cColorTable = FOUR_CHAR_CODE('clrt') cColumn = FOUR_CHAR_CODE('ccol') cDocument = FOUR_CHAR_CODE('docu') cDrawingArea = FOUR_CHAR_CODE('cdrw') cEnumeration = FOUR_CHAR_CODE('enum') cFile = FOUR_CHAR_CODE('file') cFixed = FOUR_CHAR_CODE('fixd') cFixedPoint = FOUR_CHAR_CODE('fpnt') cFixedRectangle = FOUR_CHAR_CODE('frct') cGraphicLine = FOUR_CHAR_CODE('glin') cGraphicObject = FOUR_CHAR_CODE('cgob') cGraphicShape = FOUR_CHAR_CODE('cgsh') cGraphicText = FOUR_CHAR_CODE('cgtx') cGroupedGraphic = FOUR_CHAR_CODE('cpic') cInsertionLoc = FOUR_CHAR_CODE('insl') cInsertionPoint = FOUR_CHAR_CODE('cins') cIntlText = FOUR_CHAR_CODE('itxt') cIntlWritingCode = FOUR_CHAR_CODE('intl') cItem = FOUR_CHAR_CODE('citm') cLine = FOUR_CHAR_CODE('clin') cLongDateTime = FOUR_CHAR_CODE('ldt ') cLongFixed = FOUR_CHAR_CODE('lfxd') cLongFixedPoint = FOUR_CHAR_CODE('lfpt') cLongFixedRectangle = FOUR_CHAR_CODE('lfrc') cLongInteger = FOUR_CHAR_CODE('long') cLongPoint = FOUR_CHAR_CODE('lpnt') cLongRectangle = FOUR_CHAR_CODE('lrct') cMachineLoc = FOUR_CHAR_CODE('mLoc') cMenu = FOUR_CHAR_CODE('cmnu') cMenuItem = FOUR_CHAR_CODE('cmen') cObject = FOUR_CHAR_CODE('cobj') cObjectSpecifier = FOUR_CHAR_CODE('obj ') cOpenableObject = FOUR_CHAR_CODE('coob') cOval = FOUR_CHAR_CODE('covl') cParagraph = FOUR_CHAR_CODE('cpar') cPICT = FOUR_CHAR_CODE('PICT') cPixel = FOUR_CHAR_CODE('cpxl') cPixelMap = FOUR_CHAR_CODE('cpix') cPolygon = FOUR_CHAR_CODE('cpgn') cProperty = FOUR_CHAR_CODE('prop') cQDPoint = FOUR_CHAR_CODE('QDpt') cQDRectangle = FOUR_CHAR_CODE('qdrt') cRectangle = FOUR_CHAR_CODE('crec') cRGBColor = FOUR_CHAR_CODE('cRGB') cRotation = FOUR_CHAR_CODE('trot') cRoundedRectangle = FOUR_CHAR_CODE('crrc') cRow = FOUR_CHAR_CODE('crow') cSelection = FOUR_CHAR_CODE('csel') cShortInteger = FOUR_CHAR_CODE('shor') cTable = FOUR_CHAR_CODE('ctbl') cText = FOUR_CHAR_CODE('ctxt') cTextFlow = FOUR_CHAR_CODE('cflo') cTextStyles = FOUR_CHAR_CODE('tsty') cType = FOUR_CHAR_CODE('type') cVersion = FOUR_CHAR_CODE('vers') cWindow = FOUR_CHAR_CODE('cwin') cWord = FOUR_CHAR_CODE('cwor') enumArrows = FOUR_CHAR_CODE('arro') enumJustification = FOUR_CHAR_CODE('just') enumKeyForm = FOUR_CHAR_CODE('kfrm') enumPosition = FOUR_CHAR_CODE('posi') enumProtection = FOUR_CHAR_CODE('prtn') enumQuality = FOUR_CHAR_CODE('qual') enumSaveOptions = FOUR_CHAR_CODE('savo') enumStyle = FOUR_CHAR_CODE('styl') enumTransferMode = FOUR_CHAR_CODE('tran') formUniqueID = FOUR_CHAR_CODE('ID ') kAEAbout = FOUR_CHAR_CODE('abou') kAEAfter = FOUR_CHAR_CODE('afte') kAEAliasSelection = FOUR_CHAR_CODE('sali') kAEAllCaps = FOUR_CHAR_CODE('alcp') kAEArrowAtEnd = FOUR_CHAR_CODE('aren') kAEArrowAtStart = FOUR_CHAR_CODE('arst') kAEArrowBothEnds = FOUR_CHAR_CODE('arbo') kAEAsk = FOUR_CHAR_CODE('ask ') kAEBefore = FOUR_CHAR_CODE('befo') kAEBeginning = FOUR_CHAR_CODE('bgng') kAEBeginsWith = FOUR_CHAR_CODE('bgwt') kAEBeginTransaction = FOUR_CHAR_CODE('begi') kAEBold = FOUR_CHAR_CODE('bold') kAECaseSensEquals = FOUR_CHAR_CODE('cseq') kAECentered = FOUR_CHAR_CODE('cent') kAEChangeView = FOUR_CHAR_CODE('view') kAEClone = FOUR_CHAR_CODE('clon') kAEClose = FOUR_CHAR_CODE('clos') kAECondensed = FOUR_CHAR_CODE('cond') kAEContains = FOUR_CHAR_CODE('cont') kAECopy = FOUR_CHAR_CODE('copy') kAECoreSuite = FOUR_CHAR_CODE('core') kAECountElements = FOUR_CHAR_CODE('cnte') kAECreateElement = FOUR_CHAR_CODE('crel') kAECreatePublisher = FOUR_CHAR_CODE('cpub') kAECut = FOUR_CHAR_CODE('cut ') kAEDelete = FOUR_CHAR_CODE('delo') kAEDoObjectsExist = FOUR_CHAR_CODE('doex') kAEDoScript = FOUR_CHAR_CODE('dosc') kAEDrag = FOUR_CHAR_CODE('drag') kAEDuplicateSelection = FOUR_CHAR_CODE('sdup') kAEEditGraphic = FOUR_CHAR_CODE('edit') kAEEmptyTrash = FOUR_CHAR_CODE('empt') kAEEnd = FOUR_CHAR_CODE('end ') kAEEndsWith = FOUR_CHAR_CODE('ends') kAEEndTransaction = FOUR_CHAR_CODE('endt') kAEEquals = FOUR_CHAR_CODE('= ') kAEExpanded = FOUR_CHAR_CODE('pexp') kAEFast = FOUR_CHAR_CODE('fast') kAEFinderEvents = FOUR_CHAR_CODE('FNDR') kAEFormulaProtect = FOUR_CHAR_CODE('fpro') kAEFullyJustified = FOUR_CHAR_CODE('full') kAEGetClassInfo = FOUR_CHAR_CODE('qobj') kAEGetData = FOUR_CHAR_CODE('getd') kAEGetDataSize = FOUR_CHAR_CODE('dsiz') kAEGetEventInfo = FOUR_CHAR_CODE('gtei') kAEGetInfoSelection = FOUR_CHAR_CODE('sinf') kAEGetPrivilegeSelection = FOUR_CHAR_CODE('sprv') kAEGetSuiteInfo = FOUR_CHAR_CODE('gtsi') kAEGreaterThan = FOUR_CHAR_CODE('> ') kAEGreaterThanEquals = FOUR_CHAR_CODE('>= ') kAEGrow = FOUR_CHAR_CODE('grow') kAEHidden = FOUR_CHAR_CODE('hidn') kAEHiQuality = FOUR_CHAR_CODE('hiqu') kAEImageGraphic = FOUR_CHAR_CODE('imgr') kAEIsUniform = FOUR_CHAR_CODE('isun') kAEItalic = FOUR_CHAR_CODE('ital') kAELeftJustified = FOUR_CHAR_CODE('left') kAELessThan = FOUR_CHAR_CODE('< ') kAELessThanEquals = FOUR_CHAR_CODE('<= ') kAELowercase = FOUR_CHAR_CODE('lowc') kAEMakeObjectsVisible = FOUR_CHAR_CODE('mvis') kAEMiscStandards = FOUR_CHAR_CODE('misc') kAEModifiable = FOUR_CHAR_CODE('modf') kAEMove = FOUR_CHAR_CODE('move') kAENo = FOUR_CHAR_CODE('no ') kAENoArrow = FOUR_CHAR_CODE('arno') kAENonmodifiable = FOUR_CHAR_CODE('nmod') kAEOpen = FOUR_CHAR_CODE('odoc') kAEOpenSelection = FOUR_CHAR_CODE('sope') kAEOutline = FOUR_CHAR_CODE('outl') kAEPageSetup = FOUR_CHAR_CODE('pgsu') kAEPaste = FOUR_CHAR_CODE('past') kAEPlain = FOUR_CHAR_CODE('plan') kAEPrint = FOUR_CHAR_CODE('pdoc') kAEPrintSelection = FOUR_CHAR_CODE('spri') kAEPrintWindow = FOUR_CHAR_CODE('pwin') kAEPutAwaySelection = FOUR_CHAR_CODE('sput') kAEQDAddOver = FOUR_CHAR_CODE('addo') kAEQDAddPin = FOUR_CHAR_CODE('addp') kAEQDAdMax = FOUR_CHAR_CODE('admx') kAEQDAdMin = FOUR_CHAR_CODE('admn') kAEQDBic = FOUR_CHAR_CODE('bic ') kAEQDBlend = FOUR_CHAR_CODE('blnd') kAEQDCopy = FOUR_CHAR_CODE('cpy ') kAEQDNotBic = FOUR_CHAR_CODE('nbic') kAEQDNotCopy = FOUR_CHAR_CODE('ncpy') kAEQDNotOr = FOUR_CHAR_CODE('ntor') kAEQDNotXor = FOUR_CHAR_CODE('nxor') kAEQDOr = FOUR_CHAR_CODE('or ') kAEQDSubOver = FOUR_CHAR_CODE('subo') kAEQDSubPin = FOUR_CHAR_CODE('subp') kAEQDSupplementalSuite = FOUR_CHAR_CODE('qdsp') kAEQDXor = FOUR_CHAR_CODE('xor ') kAEQuickdrawSuite = FOUR_CHAR_CODE('qdrw') kAEQuitAll = FOUR_CHAR_CODE('quia') kAERedo = FOUR_CHAR_CODE('redo') kAERegular = FOUR_CHAR_CODE('regl') kAEReopenApplication = FOUR_CHAR_CODE('rapp') kAEReplace = FOUR_CHAR_CODE('rplc') kAERequiredSuite = FOUR_CHAR_CODE('reqd') kAERestart = FOUR_CHAR_CODE('rest') kAERevealSelection = FOUR_CHAR_CODE('srev') kAERevert = FOUR_CHAR_CODE('rvrt') kAERightJustified = FOUR_CHAR_CODE('rght') kAESave = FOUR_CHAR_CODE('save') kAESelect = FOUR_CHAR_CODE('slct') kAESetData = FOUR_CHAR_CODE('setd') kAESetPosition = FOUR_CHAR_CODE('posn') kAEShadow = FOUR_CHAR_CODE('shad') kAEShowClipboard = FOUR_CHAR_CODE('shcl') kAEShutDown = FOUR_CHAR_CODE('shut') kAESleep = FOUR_CHAR_CODE('slep') kAESmallCaps = FOUR_CHAR_CODE('smcp') kAESpecialClassProperties = FOUR_CHAR_CODE('c@#!') kAEStrikethrough = FOUR_CHAR_CODE('strk') kAESubscript = FOUR_CHAR_CODE('sbsc') kAESuperscript = FOUR_CHAR_CODE('spsc') kAETableSuite = FOUR_CHAR_CODE('tbls') kAETextSuite = FOUR_CHAR_CODE('TEXT') kAETransactionTerminated = FOUR_CHAR_CODE('ttrm') kAEUnderline = FOUR_CHAR_CODE('undl') kAEUndo = FOUR_CHAR_CODE('undo') kAEWholeWordEquals = FOUR_CHAR_CODE('wweq') kAEYes = FOUR_CHAR_CODE('yes ') kAEZoom = FOUR_CHAR_CODE('zoom') kAEMouseClass = FOUR_CHAR_CODE('mous') kAEDown = FOUR_CHAR_CODE('down') kAEUp = FOUR_CHAR_CODE('up ') kAEMoved = FOUR_CHAR_CODE('move') kAEStoppedMoving = FOUR_CHAR_CODE('stop') kAEWindowClass = FOUR_CHAR_CODE('wind') kAEUpdate = FOUR_CHAR_CODE('updt') kAEActivate = FOUR_CHAR_CODE('actv') kAEDeactivate = FOUR_CHAR_CODE('dact') kAECommandClass = FOUR_CHAR_CODE('cmnd') kAEKeyClass = FOUR_CHAR_CODE('keyc') kAERawKey = FOUR_CHAR_CODE('rkey') kAEVirtualKey = FOUR_CHAR_CODE('keyc') kAENavigationKey = FOUR_CHAR_CODE('nave') kAEAutoDown = FOUR_CHAR_CODE('auto') kAEApplicationClass = FOUR_CHAR_CODE('appl') kAESuspend = FOUR_CHAR_CODE('susp') kAEResume = FOUR_CHAR_CODE('rsme') kAEDiskEvent = FOUR_CHAR_CODE('disk') kAENullEvent = FOUR_CHAR_CODE('null') kAEWakeUpEvent = FOUR_CHAR_CODE('wake') kAEScrapEvent = FOUR_CHAR_CODE('scrp') kAEHighLevel = FOUR_CHAR_CODE('high') keyAEAngle = FOUR_CHAR_CODE('kang') keyAEArcAngle = FOUR_CHAR_CODE('parc') keyAEBaseAddr = FOUR_CHAR_CODE('badd') keyAEBestType = FOUR_CHAR_CODE('pbst') keyAEBgndColor = FOUR_CHAR_CODE('kbcl') keyAEBgndPattern = FOUR_CHAR_CODE('kbpt') keyAEBounds = FOUR_CHAR_CODE('pbnd') keyAECellList = FOUR_CHAR_CODE('kclt') keyAEClassID = FOUR_CHAR_CODE('clID') keyAEColor = FOUR_CHAR_CODE('colr') keyAEColorTable = FOUR_CHAR_CODE('cltb') keyAECurveHeight = FOUR_CHAR_CODE('kchd') keyAECurveWidth = FOUR_CHAR_CODE('kcwd') keyAEDashStyle = FOUR_CHAR_CODE('pdst') keyAEData = FOUR_CHAR_CODE('data') keyAEDefaultType = FOUR_CHAR_CODE('deft') keyAEDefinitionRect = FOUR_CHAR_CODE('pdrt') keyAEDescType = FOUR_CHAR_CODE('dstp') keyAEDestination = FOUR_CHAR_CODE('dest') keyAEDoAntiAlias = FOUR_CHAR_CODE('anta') keyAEDoDithered = FOUR_CHAR_CODE('gdit') keyAEDoRotate = FOUR_CHAR_CODE('kdrt') keyAEDoScale = FOUR_CHAR_CODE('ksca') keyAEDoTranslate = FOUR_CHAR_CODE('ktra') keyAEEditionFileLoc = FOUR_CHAR_CODE('eloc') keyAEElements = FOUR_CHAR_CODE('elms') keyAEEndPoint = FOUR_CHAR_CODE('pend') keyAEEventClass = FOUR_CHAR_CODE('evcl') keyAEEventID = FOUR_CHAR_CODE('evti') keyAEFile = FOUR_CHAR_CODE('kfil') keyAEFileType = FOUR_CHAR_CODE('fltp') keyAEFillColor = FOUR_CHAR_CODE('flcl') keyAEFillPattern = FOUR_CHAR_CODE('flpt') keyAEFlipHorizontal = FOUR_CHAR_CODE('kfho') keyAEFlipVertical = FOUR_CHAR_CODE('kfvt') keyAEFont = FOUR_CHAR_CODE('font') keyAEFormula = FOUR_CHAR_CODE('pfor') keyAEGraphicObjects = FOUR_CHAR_CODE('gobs') keyAEID = FOUR_CHAR_CODE('ID ') keyAEImageQuality = FOUR_CHAR_CODE('gqua') keyAEInsertHere = FOUR_CHAR_CODE('insh') keyAEKeyForms = FOUR_CHAR_CODE('keyf') keyAEKeyword = FOUR_CHAR_CODE('kywd') keyAELevel = FOUR_CHAR_CODE('levl') keyAELineArrow = FOUR_CHAR_CODE('arro') keyAEName = FOUR_CHAR_CODE('pnam') keyAENewElementLoc = FOUR_CHAR_CODE('pnel') keyAEObject = FOUR_CHAR_CODE('kobj') keyAEObjectClass = FOUR_CHAR_CODE('kocl') keyAEOffStyles = FOUR_CHAR_CODE('ofst') keyAEOnStyles = FOUR_CHAR_CODE('onst') keyAEParameters = FOUR_CHAR_CODE('prms') keyAEParamFlags = FOUR_CHAR_CODE('pmfg') keyAEPenColor = FOUR_CHAR_CODE('ppcl') keyAEPenPattern = FOUR_CHAR_CODE('pppa') keyAEPenWidth = FOUR_CHAR_CODE('ppwd') keyAEPixelDepth = FOUR_CHAR_CODE('pdpt') keyAEPixMapMinus = FOUR_CHAR_CODE('kpmm') keyAEPMTable = FOUR_CHAR_CODE('kpmt') keyAEPointList = FOUR_CHAR_CODE('ptlt') keyAEPointSize = FOUR_CHAR_CODE('ptsz') keyAEPosition = FOUR_CHAR_CODE('kpos') keyAEPropData = FOUR_CHAR_CODE('prdt') keyAEProperties = FOUR_CHAR_CODE('qpro') keyAEProperty = FOUR_CHAR_CODE('kprp') keyAEPropFlags = FOUR_CHAR_CODE('prfg') keyAEPropID = FOUR_CHAR_CODE('prop') keyAEProtection = FOUR_CHAR_CODE('ppro') keyAERenderAs = FOUR_CHAR_CODE('kren') keyAERequestedType = FOUR_CHAR_CODE('rtyp') keyAEResult = FOUR_CHAR_CODE('----') keyAEResultInfo = FOUR_CHAR_CODE('rsin') keyAERotation = FOUR_CHAR_CODE('prot') keyAERotPoint = FOUR_CHAR_CODE('krtp') keyAERowList = FOUR_CHAR_CODE('krls') keyAESaveOptions = FOUR_CHAR_CODE('savo') keyAEScale = FOUR_CHAR_CODE('pscl') keyAEScriptTag = FOUR_CHAR_CODE('psct') keyAEShowWhere = FOUR_CHAR_CODE('show') keyAEStartAngle = FOUR_CHAR_CODE('pang') keyAEStartPoint = FOUR_CHAR_CODE('pstp') keyAEStyles = FOUR_CHAR_CODE('ksty') keyAESuiteID = FOUR_CHAR_CODE('suit') keyAEText = FOUR_CHAR_CODE('ktxt') keyAETextColor = FOUR_CHAR_CODE('ptxc') keyAETextFont = FOUR_CHAR_CODE('ptxf') keyAETextPointSize = FOUR_CHAR_CODE('ptps') keyAETextStyles = FOUR_CHAR_CODE('txst') keyAETextLineHeight = FOUR_CHAR_CODE('ktlh') keyAETextLineAscent = FOUR_CHAR_CODE('ktas') keyAETheText = FOUR_CHAR_CODE('thtx') keyAETransferMode = FOUR_CHAR_CODE('pptm') keyAETranslation = FOUR_CHAR_CODE('ptrs') keyAETryAsStructGraf = FOUR_CHAR_CODE('toog') keyAEUniformStyles = FOUR_CHAR_CODE('ustl') keyAEUpdateOn = FOUR_CHAR_CODE('pupd') keyAEUserTerm = FOUR_CHAR_CODE('utrm') keyAEWindow = FOUR_CHAR_CODE('wndw') keyAEWritingCode = FOUR_CHAR_CODE('wrcd') keyMiscellaneous = FOUR_CHAR_CODE('fmsc') keySelection = FOUR_CHAR_CODE('fsel') keyWindow = FOUR_CHAR_CODE('kwnd') keyWhen = FOUR_CHAR_CODE('when') keyWhere = FOUR_CHAR_CODE('wher') keyModifiers = FOUR_CHAR_CODE('mods') keyKey = FOUR_CHAR_CODE('key ') keyKeyCode = FOUR_CHAR_CODE('code') keyKeyboard = FOUR_CHAR_CODE('keyb') keyDriveNumber = FOUR_CHAR_CODE('drv#') keyErrorCode = FOUR_CHAR_CODE('err#') keyHighLevelClass = FOUR_CHAR_CODE('hcls') keyHighLevelID = FOUR_CHAR_CODE('hid ') pArcAngle = FOUR_CHAR_CODE('parc') pBackgroundColor = FOUR_CHAR_CODE('pbcl') pBackgroundPattern = FOUR_CHAR_CODE('pbpt') pBestType = FOUR_CHAR_CODE('pbst') pBounds = FOUR_CHAR_CODE('pbnd') pClass = FOUR_CHAR_CODE('pcls') pClipboard = FOUR_CHAR_CODE('pcli') pColor = FOUR_CHAR_CODE('colr') pColorTable = FOUR_CHAR_CODE('cltb') pContents = FOUR_CHAR_CODE('pcnt') pCornerCurveHeight = FOUR_CHAR_CODE('pchd') pCornerCurveWidth = FOUR_CHAR_CODE('pcwd') pDashStyle = FOUR_CHAR_CODE('pdst') pDefaultType = FOUR_CHAR_CODE('deft') pDefinitionRect = FOUR_CHAR_CODE('pdrt') pEnabled = FOUR_CHAR_CODE('enbl') pEndPoint = FOUR_CHAR_CODE('pend') pFillColor = FOUR_CHAR_CODE('flcl') pFillPattern = FOUR_CHAR_CODE('flpt') pFont = FOUR_CHAR_CODE('font') pFormula = FOUR_CHAR_CODE('pfor') pGraphicObjects = FOUR_CHAR_CODE('gobs') pHasCloseBox = FOUR_CHAR_CODE('hclb') pHasTitleBar = FOUR_CHAR_CODE('ptit') pID = FOUR_CHAR_CODE('ID ') pIndex = FOUR_CHAR_CODE('pidx') pInsertionLoc = FOUR_CHAR_CODE('pins') pIsFloating = FOUR_CHAR_CODE('isfl') pIsFrontProcess = FOUR_CHAR_CODE('pisf') pIsModal = FOUR_CHAR_CODE('pmod') pIsModified = FOUR_CHAR_CODE('imod') pIsResizable = FOUR_CHAR_CODE('prsz') pIsStationeryPad = FOUR_CHAR_CODE('pspd') pIsZoomable = FOUR_CHAR_CODE('iszm') pIsZoomed = FOUR_CHAR_CODE('pzum') pItemNumber = FOUR_CHAR_CODE('itmn') pJustification = FOUR_CHAR_CODE('pjst') pLineArrow = FOUR_CHAR_CODE('arro') pMenuID = FOUR_CHAR_CODE('mnid') pName = FOUR_CHAR_CODE('pnam') pNewElementLoc = FOUR_CHAR_CODE('pnel') pPenColor = FOUR_CHAR_CODE('ppcl') pPenPattern = FOUR_CHAR_CODE('pppa') pPenWidth = FOUR_CHAR_CODE('ppwd') pPixelDepth = FOUR_CHAR_CODE('pdpt') pPointList = FOUR_CHAR_CODE('ptlt') pPointSize = FOUR_CHAR_CODE('ptsz') pProtection = FOUR_CHAR_CODE('ppro') pRotation = FOUR_CHAR_CODE('prot') pScale = FOUR_CHAR_CODE('pscl') pScript = FOUR_CHAR_CODE('scpt') pScriptTag = FOUR_CHAR_CODE('psct') pSelected = FOUR_CHAR_CODE('selc') pSelection = FOUR_CHAR_CODE('sele') pStartAngle = FOUR_CHAR_CODE('pang') pStartPoint = FOUR_CHAR_CODE('pstp') pTextColor = FOUR_CHAR_CODE('ptxc') pTextFont = FOUR_CHAR_CODE('ptxf') pTextItemDelimiters = FOUR_CHAR_CODE('txdl') pTextPointSize = FOUR_CHAR_CODE('ptps') pTextStyles = FOUR_CHAR_CODE('txst') pTransferMode = FOUR_CHAR_CODE('pptm') pTranslation = FOUR_CHAR_CODE('ptrs') pUniformStyles = FOUR_CHAR_CODE('ustl') pUpdateOn = FOUR_CHAR_CODE('pupd') pUserSelection = FOUR_CHAR_CODE('pusl') pVersion = FOUR_CHAR_CODE('vers') pVisible = FOUR_CHAR_CODE('pvis') typeAEText = FOUR_CHAR_CODE('tTXT') typeArc = FOUR_CHAR_CODE('carc') typeBest = FOUR_CHAR_CODE('best') typeCell = FOUR_CHAR_CODE('ccel') typeClassInfo = FOUR_CHAR_CODE('gcli') typeColorTable = FOUR_CHAR_CODE('clrt') typeColumn = FOUR_CHAR_CODE('ccol') typeDashStyle = FOUR_CHAR_CODE('tdas') typeData = FOUR_CHAR_CODE('tdta') typeDrawingArea = FOUR_CHAR_CODE('cdrw') typeElemInfo = FOUR_CHAR_CODE('elin') typeEnumeration = FOUR_CHAR_CODE('enum') typeEPS = FOUR_CHAR_CODE('EPS ') typeEventInfo = FOUR_CHAR_CODE('evin') typeFinderWindow = FOUR_CHAR_CODE('fwin') typeFixedPoint = FOUR_CHAR_CODE('fpnt') typeFixedRectangle = FOUR_CHAR_CODE('frct') typeGraphicLine = FOUR_CHAR_CODE('glin') typeGraphicText = FOUR_CHAR_CODE('cgtx') typeGroupedGraphic = FOUR_CHAR_CODE('cpic') typeInsertionLoc = FOUR_CHAR_CODE('insl') typeIntlText = FOUR_CHAR_CODE('itxt') typeIntlWritingCode = FOUR_CHAR_CODE('intl') typeLongDateTime = FOUR_CHAR_CODE('ldt ') typeLongFixed = FOUR_CHAR_CODE('lfxd') typeLongFixedPoint = FOUR_CHAR_CODE('lfpt') typeLongFixedRectangle = FOUR_CHAR_CODE('lfrc') typeLongPoint = FOUR_CHAR_CODE('lpnt') typeLongRectangle = FOUR_CHAR_CODE('lrct') typeMachineLoc = FOUR_CHAR_CODE('mLoc') typeOval = FOUR_CHAR_CODE('covl') typeParamInfo = FOUR_CHAR_CODE('pmin') typePict = FOUR_CHAR_CODE('PICT') typePixelMap = FOUR_CHAR_CODE('cpix') typePixMapMinus = FOUR_CHAR_CODE('tpmm') typePolygon = FOUR_CHAR_CODE('cpgn') typePropInfo = FOUR_CHAR_CODE('pinf') typeQDPoint = FOUR_CHAR_CODE('QDpt') typeQDRegion = FOUR_CHAR_CODE('Qrgn') typeRectangle = FOUR_CHAR_CODE('crec') typeRGB16 = FOUR_CHAR_CODE('tr16') typeRGB96 = FOUR_CHAR_CODE('tr96') typeRGBColor = FOUR_CHAR_CODE('cRGB') typeRotation = FOUR_CHAR_CODE('trot') typeRoundedRectangle = FOUR_CHAR_CODE('crrc') typeRow = FOUR_CHAR_CODE('crow') typeScrapStyles = FOUR_CHAR_CODE('styl') typeScript = FOUR_CHAR_CODE('scpt') typeStyledText = FOUR_CHAR_CODE('STXT') typeSuiteInfo = FOUR_CHAR_CODE('suin') typeTable = FOUR_CHAR_CODE('ctbl') typeTextStyles = FOUR_CHAR_CODE('tsty') typeTIFF = FOUR_CHAR_CODE('TIFF') typeVersion = FOUR_CHAR_CODE('vers') kAEMenuClass = FOUR_CHAR_CODE('menu') kAEMenuSelect = FOUR_CHAR_CODE('mhit') kAEMouseDown = FOUR_CHAR_CODE('mdwn') kAEMouseDownInBack = FOUR_CHAR_CODE('mdbk') kAEKeyDown = FOUR_CHAR_CODE('kdwn') kAEResized = FOUR_CHAR_CODE('rsiz') kAEPromise = FOUR_CHAR_CODE('prom') keyMenuID = FOUR_CHAR_CODE('mid ') keyMenuItem = FOUR_CHAR_CODE('mitm') keyCloseAllWindows = FOUR_CHAR_CODE('caw ') keyOriginalBounds = FOUR_CHAR_CODE('obnd') keyNewBounds = FOUR_CHAR_CODE('nbnd') keyLocalWhere = FOUR_CHAR_CODE('lwhr') typeHIMenu = FOUR_CHAR_CODE('mobj') typeHIWindow = FOUR_CHAR_CODE('wobj') kBySmallIcon = 0 kByIconView = 1 kByNameView = 2 kByDateView = 3 kBySizeView = 4 kByKindView = 5 kByCommentView = 6 kByLabelView = 7 kByVersionView = 8 kAEInfo = 11 kAEMain = 0 kAESharing = 13 kAEZoomIn = 7 kAEZoomOut = 8 kTextServiceClass = FOUR_CHAR_CODE('tsvc') kUpdateActiveInputArea = FOUR_CHAR_CODE('updt') kShowHideInputWindow = FOUR_CHAR_CODE('shiw') kPos2Offset = FOUR_CHAR_CODE('p2st') kOffset2Pos = FOUR_CHAR_CODE('st2p') kUnicodeNotFromInputMethod = FOUR_CHAR_CODE('unim') kGetSelectedText = FOUR_CHAR_CODE('gtxt') keyAETSMDocumentRefcon = FOUR_CHAR_CODE('refc') keyAEServerInstance = FOUR_CHAR_CODE('srvi') keyAETheData = FOUR_CHAR_CODE('kdat') keyAEFixLength = FOUR_CHAR_CODE('fixl') keyAEUpdateRange = FOUR_CHAR_CODE('udng') keyAECurrentPoint = FOUR_CHAR_CODE('cpos') keyAEBufferSize = FOUR_CHAR_CODE('buff') keyAEMoveView = FOUR_CHAR_CODE('mvvw') keyAENextBody = FOUR_CHAR_CODE('nxbd') keyAETSMScriptTag = FOUR_CHAR_CODE('sclg') keyAETSMTextFont = FOUR_CHAR_CODE('ktxf') keyAETSMTextPointSize = FOUR_CHAR_CODE('ktps') keyAETSMEventRecord = FOUR_CHAR_CODE('tevt') keyAETextServiceEncoding = FOUR_CHAR_CODE('tsen') keyAETextServiceMacEncoding = FOUR_CHAR_CODE('tmen') typeTextRange = FOUR_CHAR_CODE('txrn') typeComponentInstance = FOUR_CHAR_CODE('cmpi') typeOffsetArray = FOUR_CHAR_CODE('ofay') typeTextRangeArray = FOUR_CHAR_CODE('tray') typeLowLevelEventRecord = FOUR_CHAR_CODE('evtr') typeText = typeChar kTSMOutsideOfBody = 1 kTSMInsideOfBody = 2 kTSMInsideOfActiveInputArea = 3 kNextBody = 1 kPreviousBody = 2 kCaretPosition = 1 kRawText = 2 kSelectedRawText = 3 kConvertedText = 4 kSelectedConvertedText = 5 kBlockFillText = 6 kOutlineText = 7 kSelectedText = 8 keyAEHiliteRange = FOUR_CHAR_CODE('hrng') keyAEPinRange = FOUR_CHAR_CODE('pnrg') keyAEClauseOffsets = FOUR_CHAR_CODE('clau') keyAEOffset = FOUR_CHAR_CODE('ofst') keyAEPoint = FOUR_CHAR_CODE('gpos') keyAELeftSide = FOUR_CHAR_CODE('klef') keyAERegionClass = FOUR_CHAR_CODE('rgnc') keyAEDragging = FOUR_CHAR_CODE('bool') keyAELeadingEdge = keyAELeftSide typeUnicodeText = FOUR_CHAR_CODE('utxt') typeStyledUnicodeText = FOUR_CHAR_CODE('sutx') typeEncodedString = FOUR_CHAR_CODE('encs') typeCString = FOUR_CHAR_CODE('cstr') typePString = FOUR_CHAR_CODE('pstr') typeMeters = FOUR_CHAR_CODE('metr') typeInches = FOUR_CHAR_CODE('inch') typeFeet = FOUR_CHAR_CODE('feet') typeYards = FOUR_CHAR_CODE('yard') typeMiles = FOUR_CHAR_CODE('mile') typeKilometers = FOUR_CHAR_CODE('kmtr') typeCentimeters = FOUR_CHAR_CODE('cmtr') typeSquareMeters = FOUR_CHAR_CODE('sqrm') typeSquareFeet = FOUR_CHAR_CODE('sqft') typeSquareYards = FOUR_CHAR_CODE('sqyd') typeSquareMiles = FOUR_CHAR_CODE('sqmi') typeSquareKilometers = FOUR_CHAR_CODE('sqkm') typeLiters = FOUR_CHAR_CODE('litr') typeQuarts = FOUR_CHAR_CODE('qrts') typeGallons = FOUR_CHAR_CODE('galn') typeCubicMeters = FOUR_CHAR_CODE('cmet') typeCubicFeet = FOUR_CHAR_CODE('cfet') typeCubicInches = FOUR_CHAR_CODE('cuin') typeCubicCentimeter = FOUR_CHAR_CODE('ccmt') typeCubicYards = FOUR_CHAR_CODE('cyrd') typeKilograms = FOUR_CHAR_CODE('kgrm') typeGrams = FOUR_CHAR_CODE('gram') typeOunces = FOUR_CHAR_CODE('ozs ') typePounds = FOUR_CHAR_CODE('lbs ') typeDegreesC = FOUR_CHAR_CODE('degc') typeDegreesF = FOUR_CHAR_CODE('degf') typeDegreesK = FOUR_CHAR_CODE('degk') kFAServerApp = FOUR_CHAR_CODE('ssrv') kDoFolderActionEvent = FOUR_CHAR_CODE('fola') kFolderActionCode = FOUR_CHAR_CODE('actn') kFolderOpenedEvent = FOUR_CHAR_CODE('fopn') kFolderClosedEvent = FOUR_CHAR_CODE('fclo') kFolderWindowMovedEvent = FOUR_CHAR_CODE('fsiz') kFolderItemsAddedEvent = FOUR_CHAR_CODE('fget') kFolderItemsRemovedEvent = FOUR_CHAR_CODE('flos') kItemList = FOUR_CHAR_CODE('flst') kNewSizeParameter = FOUR_CHAR_CODE('fnsz') kFASuiteCode = FOUR_CHAR_CODE('faco') kFAAttachCommand = FOUR_CHAR_CODE('atfa') kFARemoveCommand = FOUR_CHAR_CODE('rmfa') kFAEditCommand = FOUR_CHAR_CODE('edfa') kFAFileParam = FOUR_CHAR_CODE('faal') kFAIndexParam = FOUR_CHAR_CODE('indx') kAEInternetSuite = FOUR_CHAR_CODE('gurl') kAEISWebStarSuite = FOUR_CHAR_CODE('WWW½') kAEISGetURL = FOUR_CHAR_CODE('gurl') KAEISHandleCGI = FOUR_CHAR_CODE('sdoc') cURL = FOUR_CHAR_CODE('url ') cInternetAddress = FOUR_CHAR_CODE('IPAD') cHTML = FOUR_CHAR_CODE('html') cFTPItem = FOUR_CHAR_CODE('ftp ') kAEISHTTPSearchArgs = FOUR_CHAR_CODE('kfor') kAEISPostArgs = FOUR_CHAR_CODE('post') kAEISMethod = FOUR_CHAR_CODE('meth') kAEISClientAddress = FOUR_CHAR_CODE('addr') kAEISUserName = FOUR_CHAR_CODE('user') kAEISPassword = FOUR_CHAR_CODE('pass') kAEISFromUser = FOUR_CHAR_CODE('frmu') kAEISServerName = FOUR_CHAR_CODE('svnm') kAEISServerPort = FOUR_CHAR_CODE('svpt') kAEISScriptName = FOUR_CHAR_CODE('scnm') kAEISContentType = FOUR_CHAR_CODE('ctyp') kAEISReferrer = FOUR_CHAR_CODE('refr') kAEISUserAgent = FOUR_CHAR_CODE('Agnt') kAEISAction = FOUR_CHAR_CODE('Kact') kAEISActionPath = FOUR_CHAR_CODE('Kapt') kAEISClientIP = FOUR_CHAR_CODE('Kcip') kAEISFullRequest = FOUR_CHAR_CODE('Kfrq') pScheme = FOUR_CHAR_CODE('pusc') pHost = FOUR_CHAR_CODE('HOST') pPath = FOUR_CHAR_CODE('FTPc') pUserName = FOUR_CHAR_CODE('RAun') pUserPassword = FOUR_CHAR_CODE('RApw') pDNSForm = FOUR_CHAR_CODE('pDNS') pURL = FOUR_CHAR_CODE('pURL') pTextEncoding = FOUR_CHAR_CODE('ptxe') pFTPKind = FOUR_CHAR_CODE('kind') eScheme = FOUR_CHAR_CODE('esch') eurlHTTP = FOUR_CHAR_CODE('http') eurlHTTPS = FOUR_CHAR_CODE('htps') eurlFTP = FOUR_CHAR_CODE('ftp ') eurlMail = FOUR_CHAR_CODE('mail') eurlFile = FOUR_CHAR_CODE('file') eurlGopher = FOUR_CHAR_CODE('gphr') eurlTelnet = FOUR_CHAR_CODE('tlnt') eurlNews = FOUR_CHAR_CODE('news') eurlSNews = FOUR_CHAR_CODE('snws') eurlNNTP = FOUR_CHAR_CODE('nntp') eurlMessage = FOUR_CHAR_CODE('mess') eurlMailbox = FOUR_CHAR_CODE('mbox') eurlMulti = FOUR_CHAR_CODE('mult') eurlLaunch = FOUR_CHAR_CODE('laun') eurlAFP = FOUR_CHAR_CODE('afp ') eurlAT = FOUR_CHAR_CODE('at ') eurlEPPC = FOUR_CHAR_CODE('eppc') eurlRTSP = FOUR_CHAR_CODE('rtsp') eurlIMAP = FOUR_CHAR_CODE('imap') eurlNFS = FOUR_CHAR_CODE('unfs') eurlPOP = FOUR_CHAR_CODE('upop') eurlLDAP = FOUR_CHAR_CODE('uldp') eurlUnknown = FOUR_CHAR_CODE('url?') kConnSuite = FOUR_CHAR_CODE('macc') cDevSpec = FOUR_CHAR_CODE('cdev') cAddressSpec = FOUR_CHAR_CODE('cadr') cADBAddress = FOUR_CHAR_CODE('cadb') cAppleTalkAddress = FOUR_CHAR_CODE('cat ') cBusAddress = FOUR_CHAR_CODE('cbus') cEthernetAddress = FOUR_CHAR_CODE('cen ') cFireWireAddress = FOUR_CHAR_CODE('cfw ') cIPAddress = FOUR_CHAR_CODE('cip ') cLocalTalkAddress = FOUR_CHAR_CODE('clt ') cSCSIAddress = FOUR_CHAR_CODE('cscs') cTokenRingAddress = FOUR_CHAR_CODE('ctok') cUSBAddress = FOUR_CHAR_CODE('cusb') pDeviceType = FOUR_CHAR_CODE('pdvt') pDeviceAddress = FOUR_CHAR_CODE('pdva') pConduit = FOUR_CHAR_CODE('pcon') pProtocol = FOUR_CHAR_CODE('pprt') pATMachine = FOUR_CHAR_CODE('patm') pATZone = FOUR_CHAR_CODE('patz') pATType = FOUR_CHAR_CODE('patt') pDottedDecimal = FOUR_CHAR_CODE('pipd') pDNS = FOUR_CHAR_CODE('pdns') pPort = FOUR_CHAR_CODE('ppor') pNetwork = FOUR_CHAR_CODE('pnet') pNode = FOUR_CHAR_CODE('pnod') pSocket = FOUR_CHAR_CODE('psoc') pSCSIBus = FOUR_CHAR_CODE('pscb') pSCSILUN = FOUR_CHAR_CODE('pslu') eDeviceType = FOUR_CHAR_CODE('edvt') eAddressSpec = FOUR_CHAR_CODE('eads') eConduit = FOUR_CHAR_CODE('econ') eProtocol = FOUR_CHAR_CODE('epro') eADB = FOUR_CHAR_CODE('eadb') eAnalogAudio = FOUR_CHAR_CODE('epau') eAppleTalk = FOUR_CHAR_CODE('epat') eAudioLineIn = FOUR_CHAR_CODE('ecai') eAudioLineOut = FOUR_CHAR_CODE('ecal') eAudioOut = FOUR_CHAR_CODE('ecao') eBus = FOUR_CHAR_CODE('ebus') eCDROM = FOUR_CHAR_CODE('ecd ') eCommSlot = FOUR_CHAR_CODE('eccm') eDigitalAudio = FOUR_CHAR_CODE('epda') eDisplay = FOUR_CHAR_CODE('edds') eDVD = FOUR_CHAR_CODE('edvd') eEthernet = FOUR_CHAR_CODE('ecen') eFireWire = FOUR_CHAR_CODE('ecfw') eFloppy = FOUR_CHAR_CODE('efd ') eHD = FOUR_CHAR_CODE('ehd ') eInfrared = FOUR_CHAR_CODE('ecir') eIP = FOUR_CHAR_CODE('epip') eIrDA = FOUR_CHAR_CODE('epir') eIRTalk = FOUR_CHAR_CODE('epit') eKeyboard = FOUR_CHAR_CODE('ekbd') eLCD = FOUR_CHAR_CODE('edlc') eLocalTalk = FOUR_CHAR_CODE('eclt') eMacIP = FOUR_CHAR_CODE('epmi') eMacVideo = FOUR_CHAR_CODE('epmv') eMicrophone = FOUR_CHAR_CODE('ecmi') eModemPort = FOUR_CHAR_CODE('ecmp') eModemPrinterPort = FOUR_CHAR_CODE('empp') eModem = FOUR_CHAR_CODE('edmm') eMonitorOut = FOUR_CHAR_CODE('ecmn') eMouse = FOUR_CHAR_CODE('emou') eNuBusCard = FOUR_CHAR_CODE('ednb') eNuBus = FOUR_CHAR_CODE('enub') ePCcard = FOUR_CHAR_CODE('ecpc') ePCIbus = FOUR_CHAR_CODE('ecpi') ePCIcard = FOUR_CHAR_CODE('edpi') ePDSslot = FOUR_CHAR_CODE('ecpd') ePDScard = FOUR_CHAR_CODE('epds') ePointingDevice = FOUR_CHAR_CODE('edpd') ePostScript = FOUR_CHAR_CODE('epps') ePPP = FOUR_CHAR_CODE('eppp') ePrinterPort = FOUR_CHAR_CODE('ecpp') ePrinter = FOUR_CHAR_CODE('edpr') eSvideo = FOUR_CHAR_CODE('epsv') eSCSI = FOUR_CHAR_CODE('ecsc') eSerial = FOUR_CHAR_CODE('epsr') eSpeakers = FOUR_CHAR_CODE('edsp') eStorageDevice = FOUR_CHAR_CODE('edst') eSVGA = FOUR_CHAR_CODE('epsg') eTokenRing = FOUR_CHAR_CODE('etok') eTrackball = FOUR_CHAR_CODE('etrk') eTrackpad = FOUR_CHAR_CODE('edtp') eUSB = FOUR_CHAR_CODE('ecus') eVideoIn = FOUR_CHAR_CODE('ecvi') eVideoMonitor = FOUR_CHAR_CODE('edvm') eVideoOut = FOUR_CHAR_CODE('ecvo') cKeystroke = FOUR_CHAR_CODE('kprs') pKeystrokeKey = FOUR_CHAR_CODE('kMsg') pModifiers = FOUR_CHAR_CODE('kMod') pKeyKind = FOUR_CHAR_CODE('kknd') eModifiers = FOUR_CHAR_CODE('eMds') eOptionDown = FOUR_CHAR_CODE('Kopt') eCommandDown = FOUR_CHAR_CODE('Kcmd') eControlDown = FOUR_CHAR_CODE('Kctl') eShiftDown = FOUR_CHAR_CODE('Ksft') eCapsLockDown = FOUR_CHAR_CODE('Kclk') eKeyKind = FOUR_CHAR_CODE('ekst') eEscapeKey = 0x6B733500 eDeleteKey = 0x6B733300 eTabKey = 0x6B733000 eReturnKey = 0x6B732400 eClearKey = 0x6B734700 eEnterKey = 0x6B734C00 eUpArrowKey = 0x6B737E00 eDownArrowKey = 0x6B737D00 eLeftArrowKey = 0x6B737B00 eRightArrowKey = 0x6B737C00 eHelpKey = 0x6B737200 eHomeKey = 0x6B737300 ePageUpKey = 0x6B737400 ePageDownKey = 0x6B737900 eForwardDelKey = 0x6B737500 eEndKey = 0x6B737700 eF1Key = 0x6B737A00 eF2Key = 0x6B737800 eF3Key = 0x6B736300 eF4Key = 0x6B737600 eF5Key = 0x6B736000 eF6Key = 0x6B736100 eF7Key = 0x6B736200 eF8Key = 0x6B736400 eF9Key = 0x6B736500 eF10Key = 0x6B736D00 eF11Key = 0x6B736700 eF12Key = 0x6B736F00 eF13Key = 0x6B736900 eF14Key = 0x6B736B00 eF15Key = 0x6B737100 kAEAND = FOUR_CHAR_CODE('AND ') kAEOR = FOUR_CHAR_CODE('OR ') kAENOT = FOUR_CHAR_CODE('NOT ') kAEFirst = FOUR_CHAR_CODE('firs') kAELast = FOUR_CHAR_CODE('last') kAEMiddle = FOUR_CHAR_CODE('midd') kAEAny = FOUR_CHAR_CODE('any ') kAEAll = FOUR_CHAR_CODE('all ') kAENext = FOUR_CHAR_CODE('next') kAEPrevious = FOUR_CHAR_CODE('prev') keyAECompOperator = FOUR_CHAR_CODE('relo') keyAELogicalTerms = FOUR_CHAR_CODE('term') keyAELogicalOperator = FOUR_CHAR_CODE('logc') keyAEObject1 = FOUR_CHAR_CODE('obj1') keyAEObject2 = FOUR_CHAR_CODE('obj2') keyAEDesiredClass = FOUR_CHAR_CODE('want') keyAEContainer = FOUR_CHAR_CODE('from') keyAEKeyForm = FOUR_CHAR_CODE('form') keyAEKeyData = FOUR_CHAR_CODE('seld') keyAERangeStart = FOUR_CHAR_CODE('star') keyAERangeStop = FOUR_CHAR_CODE('stop') keyDisposeTokenProc = FOUR_CHAR_CODE('xtok') keyAECompareProc = FOUR_CHAR_CODE('cmpr') keyAECountProc = FOUR_CHAR_CODE('cont') keyAEMarkTokenProc = FOUR_CHAR_CODE('mkid') keyAEMarkProc = FOUR_CHAR_CODE('mark') keyAEAdjustMarksProc = FOUR_CHAR_CODE('adjm') keyAEGetErrDescProc = FOUR_CHAR_CODE('indc') formAbsolutePosition = FOUR_CHAR_CODE('indx') formRelativePosition = FOUR_CHAR_CODE('rele') formTest = FOUR_CHAR_CODE('test') formRange = FOUR_CHAR_CODE('rang') formPropertyID = FOUR_CHAR_CODE('prop') formName = FOUR_CHAR_CODE('name') typeObjectSpecifier = FOUR_CHAR_CODE('obj ') typeObjectBeingExamined = FOUR_CHAR_CODE('exmn') typeCurrentContainer = FOUR_CHAR_CODE('ccnt') typeToken = FOUR_CHAR_CODE('toke') typeRelativeDescriptor = FOUR_CHAR_CODE('rel ') typeAbsoluteOrdinal = FOUR_CHAR_CODE('abso') typeIndexDescriptor = FOUR_CHAR_CODE('inde') typeRangeDescriptor = FOUR_CHAR_CODE('rang') typeLogicalDescriptor = FOUR_CHAR_CODE('logi') typeCompDescriptor = FOUR_CHAR_CODE('cmpd') typeOSLTokenList = FOUR_CHAR_CODE('ostl') kAEIDoMinimum = 0x0000 kAEIDoWhose = 0x0001 kAEIDoMarking = 0x0004 kAEPassSubDescs = 0x0008 kAEResolveNestedLists = 0x0010 kAEHandleSimpleRanges = 0x0020 kAEUseRelativeIterators = 0x0040 typeWhoseDescriptor = FOUR_CHAR_CODE('whos') formWhose = FOUR_CHAR_CODE('whos') typeWhoseRange = FOUR_CHAR_CODE('wrng') keyAEWhoseRangeStart = FOUR_CHAR_CODE('wstr') keyAEWhoseRangeStop = FOUR_CHAR_CODE('wstp') keyAEIndex = FOUR_CHAR_CODE('kidx') keyAETest = FOUR_CHAR_CODE('ktst') From jackjansen@users.sourceforge.net Sun Aug 19 23:11:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:11:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Components.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24792/Python/Mac/Lib/Carbon Added Files: Components.py Log Message: The modules with toolbox constants. --- NEW FILE: Components.py --- # Generated from 'Components.h' def FOUR_CHAR_CODE(x): return x kAppleManufacturer = FOUR_CHAR_CODE('appl') kComponentResourceType = FOUR_CHAR_CODE('thng') kComponentAliasResourceType = FOUR_CHAR_CODE('thga') kAnyComponentType = 0 kAnyComponentSubType = 0 kAnyComponentManufacturer = 0 kAnyComponentFlagsMask = 0 cmpIsMissing = 1L << 29 cmpWantsRegisterMessage = 1L << 31 kComponentOpenSelect = -1 kComponentCloseSelect = -2 kComponentCanDoSelect = -3 kComponentVersionSelect = -4 kComponentRegisterSelect = -5 kComponentTargetSelect = -6 kComponentUnregisterSelect = -7 kComponentGetMPWorkFunctionSelect = -8 kComponentExecuteWiredActionSelect = -9 kComponentGetPublicResourceSelect = -10 componentDoAutoVersion = (1 << 0) componentWantsUnregister = (1 << 1) componentAutoVersionIncludeFlags = (1 << 2) componentHasMultiplePlatforms = (1 << 3) componentLoadResident = (1 << 4) defaultComponentIdentical = 0 defaultComponentAnyFlags = 1 defaultComponentAnyManufacturer = 2 defaultComponentAnySubType = 4 defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer) defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType) registerComponentGlobal = 1 registerComponentNoDuplicates = 2 registerComponentAfterExisting = 4 registerComponentAliasesOnly = 8 platform68k = 1 platformPowerPC = 2 platformInterpreted = 3 platformWin32 = 4 platformPowerPCNativeEntryPoint = 5 mpWorkFlagDoWork = (1 << 0) mpWorkFlagDoCompletion = (1 << 1) mpWorkFlagCopyWorkBlock = (1 << 2) mpWorkFlagDontBlock = (1 << 3) mpWorkFlagGetProcessorCount = (1 << 4) mpWorkFlagGetIsRunning = (1 << 6) cmpAliasNoFlags = 0 cmpAliasOnlyThisFile = 1 uppComponentFunctionImplementedProcInfo = 0x000002F0 uppGetComponentVersionProcInfo = 0x000000F0 uppComponentSetTargetProcInfo = 0x000003F0 uppCallComponentOpenProcInfo = 0x000003F0 uppCallComponentCloseProcInfo = 0x000003F0 uppCallComponentCanDoProcInfo = 0x000002F0 uppCallComponentVersionProcInfo = 0x000000F0 uppCallComponentRegisterProcInfo = 0x000000F0 uppCallComponentTargetProcInfo = 0x000003F0 uppCallComponentUnregisterProcInfo = 0x000000F0 uppCallComponentGetMPWorkFunctionProcInfo = 0x00000FF0 uppCallComponentGetPublicResourceProcInfo = 0x00003BF0 From jackjansen@users.sourceforge.net Sun Aug 19 23:11:14 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:11:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon ControlAccessor.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24819/Python/Mac/Lib/Carbon Added Files: ControlAccessor.py Log Message: The modules with toolbox constants. --- NEW FILE: ControlAccessor.py --- # Accessor functions for control properties from Controls import * import struct # These needn't go through this module, but are here for completeness def SetControlData_Handle(control, part, selector, data): control.SetControlData_Handle(part, selector, data) def GetControlData_Handle(control, part, selector): return control.GetControlData_Handle(part, selector) _accessdict = { kControlPopupButtonMenuHandleTag: (SetControlData_Handle, GetControlData_Handle), } _codingdict = { kControlPushButtonDefaultTag : ("b", None, None), kControlEditTextTextTag: (None, None, None), kControlEditTextPasswordTag: (None, None, None), kControlPopupButtonMenuIDTag: ("h", None, None), kControlListBoxDoubleClickTag: ("b", None, None), } def SetControlData(control, part, selector, data): if _accessdict.has_key(selector): setfunc, getfunc = _accessdict[selector] setfunc(control, part, selector, data) return if not _codingdict.has_key(selector): raise KeyError, ('Unknown control selector', selector) structfmt, coder, decoder = _codingdict[selector] if coder: data = coder(data) if structfmt: data = struct.pack(structfmt, data) control.SetControlData(part, selector, data) def GetControlData(control, part, selector): if _accessdict.has_key(selector): setfunc, getfunc = _accessdict[selector] return getfunc(control, part, selector, data) if not _codingdict.has_key(selector): raise KeyError, ('Unknown control selector', selector) structfmt, coder, decoder = _codingdict[selector] data = control.GetControlData(part, selector) if structfmt: data = struct.unpack(structfmt, data) if decoder: data = decoder(data) if type(data) == type(()) and len(data) == 1: data = data[0] return data From jackjansen@users.sourceforge.net Sun Aug 19 23:11:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:11:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Dragconst.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24878/Python/Mac/Lib/Carbon Added Files: Dragconst.py Log Message: The modules with toolbox constants. --- NEW FILE: Dragconst.py --- # Generated from 'Drag.h' def FOUR_CHAR_CODE(x): return x from TextEdit import * from QuickDraw import * kDragHasLeftSenderWindow = (1 << 0) kDragInsideSenderApplication = (1 << 1) kDragInsideSenderWindow = (1 << 2) kDragRegionAndImage = (1 << 4) flavorSenderOnly = (1 << 0) flavorSenderTranslated = (1 << 1) flavorNotSaved = (1 << 2) flavorSystemTranslated = (1 << 8) kDragHasLeftSenderWindow = (1L << 0) kDragInsideSenderApplication = (1L << 1) kDragInsideSenderWindow = (1L << 2) kDragBehaviorNone = 0 kDragBehaviorZoomBackAnimation = (1L << 0) kDragRegionAndImage = (1L << 4) kDragStandardTranslucency = 0L kDragDarkTranslucency = 1L kDragDarkerTranslucency = 2L kDragOpaqueTranslucency = 3L kDragRegionBegin = 1 kDragRegionDraw = 2 kDragRegionHide = 3 kDragRegionIdle = 4 kDragRegionEnd = 5 kZoomNoAcceleration = 0 kZoomAccelerate = 1 kZoomDecelerate = 2 flavorSenderOnly = (1 << 0) flavorSenderTranslated = (1 << 1) flavorNotSaved = (1 << 2) flavorSystemTranslated = (1 << 8) kDragFlavorTypeHFS = FOUR_CHAR_CODE('hfs ') kDragFlavorTypePromiseHFS = FOUR_CHAR_CODE('phfs') flavorTypeHFS = kDragFlavorTypeHFS flavorTypePromiseHFS = kDragFlavorTypePromiseHFS kDragPromisedFlavorFindFile = FOUR_CHAR_CODE('rWm1') kDragPromisedFlavor = FOUR_CHAR_CODE('fssP') kDragPseudoCreatorVolumeOrDirectory = FOUR_CHAR_CODE('MACS') kDragPseudoFileTypeVolume = FOUR_CHAR_CODE('disk') kDragPseudoFileTypeDirectory = FOUR_CHAR_CODE('fold') flavorTypeDirectory = FOUR_CHAR_CODE('diry') kFlavorTypeClippingName = FOUR_CHAR_CODE('clnm') kFlavorTypeClippingFilename = FOUR_CHAR_CODE('clfn') kFlavorTypeDragToTrashOnly = FOUR_CHAR_CODE('fdtt') kFlavorTypeFinderNoTrackingBehavior = FOUR_CHAR_CODE('fntb') kDragTrackingEnterHandler = 1 kDragTrackingEnterWindow = 2 kDragTrackingInWindow = 3 kDragTrackingLeaveWindow = 4 kDragTrackingLeaveHandler = 5 dragHasLeftSenderWindow = kDragHasLeftSenderWindow dragInsideSenderApplication = kDragInsideSenderApplication dragInsideSenderWindow = kDragInsideSenderWindow dragTrackingEnterHandler = kDragTrackingEnterHandler dragTrackingEnterWindow = kDragTrackingEnterWindow dragTrackingInWindow = kDragTrackingInWindow dragTrackingLeaveWindow = kDragTrackingLeaveWindow dragTrackingLeaveHandler = kDragTrackingLeaveHandler dragRegionBegin = kDragRegionBegin dragRegionDraw = kDragRegionDraw dragRegionHide = kDragRegionHide dragRegionIdle = kDragRegionIdle dragRegionEnd = kDragRegionEnd zoomNoAcceleration = kZoomNoAcceleration zoomAccelerate = kZoomAccelerate zoomDecelerate = kZoomDecelerate kDragStandardImage = kDragStandardTranslucency kDragDarkImage = kDragDarkTranslucency kDragDarkerImage = kDragDarkerTranslucency kDragOpaqueImage = kDragOpaqueTranslucency From jackjansen@users.sourceforge.net Sun Aug 19 23:11:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:11:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Events.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24918/Python/Mac/Lib/Carbon Added Files: Events.py Log Message: The modules with toolbox constants. --- NEW FILE: Events.py --- # Generated from 'Events.h' nullEvent = 0 mouseDown = 1 mouseUp = 2 keyDown = 3 keyUp = 4 autoKey = 5 updateEvt = 6 diskEvt = 7 activateEvt = 8 osEvt = 15 kHighLevelEvent = 23 mDownMask = 1 << mouseDown mUpMask = 1 << mouseUp keyDownMask = 1 << keyDown keyUpMask = 1 << keyUp autoKeyMask = 1 << autoKey updateMask = 1 << updateEvt diskMask = 1 << diskEvt activMask = 1 << activateEvt highLevelEventMask = 0x0400 osMask = 1 << osEvt everyEvent = 0xFFFF charCodeMask = 0x000000FF keyCodeMask = 0x0000FF00 adbAddrMask = 0x00FF0000 # osEvtMessageMask = (unsigned long)0xFF000000 mouseMovedMessage = 0x00FA suspendResumeMessage = 0x0001 resumeFlag = 1 convertClipboardFlag = 2 activeFlagBit = 0 btnStateBit = 7 cmdKeyBit = 8 shiftKeyBit = 9 alphaLockBit = 10 optionKeyBit = 11 controlKeyBit = 12 rightShiftKeyBit = 13 rightOptionKeyBit = 14 rightControlKeyBit = 15 activeFlag = 1 << activeFlagBit btnState = 1 << btnStateBit cmdKey = 1 << cmdKeyBit shiftKey = 1 << shiftKeyBit alphaLock = 1 << alphaLockBit optionKey = 1 << optionKeyBit controlKey = 1 << controlKeyBit rightShiftKey = 1 << rightShiftKeyBit rightOptionKey = 1 << rightOptionKeyBit rightControlKey = 1 << rightControlKeyBit kNullCharCode = 0 kHomeCharCode = 1 kEnterCharCode = 3 kEndCharCode = 4 kHelpCharCode = 5 kBellCharCode = 7 kBackspaceCharCode = 8 kTabCharCode = 9 kLineFeedCharCode = 10 kVerticalTabCharCode = 11 kPageUpCharCode = 11 kFormFeedCharCode = 12 kPageDownCharCode = 12 kReturnCharCode = 13 kFunctionKeyCharCode = 16 kEscapeCharCode = 27 kClearCharCode = 27 kLeftArrowCharCode = 28 kRightArrowCharCode = 29 kUpArrowCharCode = 30 kDownArrowCharCode = 31 kDeleteCharCode = 127 kNonBreakingSpaceCharCode = 202 networkEvt = 10 driverEvt = 11 app1Evt = 12 app2Evt = 13 app3Evt = 14 app4Evt = 15 networkMask = 0x0400 driverMask = 0x0800 app1Mask = 0x1000 app2Mask = 0x2000 app3Mask = 0x4000 app4Mask = 0x8000 From jackjansen@users.sourceforge.net Sun Aug 19 23:11:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:11:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Dialogs.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24862/Python/Mac/Lib/Carbon Added Files: Dialogs.py Log Message: The modules with toolbox constants. --- NEW FILE: Dialogs.py --- # Generated from 'Moes:SWDev:Metrowerks Codewarrior 6.0:Metrowerks CodeWarrior:MacOS Support:Universal:Interfaces:CIncludes:Dialogs.h' def FOUR_CHAR_CODE(x): return x kControlDialogItem = 4 kButtonDialogItem = kControlDialogItem | 0 kCheckBoxDialogItem = kControlDialogItem | 1 kRadioButtonDialogItem = kControlDialogItem | 2 kResourceControlDialogItem = kControlDialogItem | 3 kStaticTextDialogItem = 8 kEditTextDialogItem = 16 kIconDialogItem = 32 kPictureDialogItem = 64 kUserDialogItem = 0 kHelpDialogItem = 1 kItemDisableBit = 128 ctrlItem = 4 btnCtrl = 0 chkCtrl = 1 radCtrl = 2 resCtrl = 3 statText = 8 editText = 16 iconItem = 32 picItem = 64 userItem = 0 itemDisable = 128 kStdOkItemIndex = 1 kStdCancelItemIndex = 2 ok = kStdOkItemIndex cancel = kStdCancelItemIndex kStopIcon = 0 kNoteIcon = 1 kCautionIcon = 2 stopIcon = kStopIcon noteIcon = kNoteIcon cautionIcon = kCautionIcon kOkItemIndex = 1 kCancelItemIndex = 2 overlayDITL = 0 appendDITLRight = 1 appendDITLBottom = 2 kAlertStopAlert = 0 kAlertNoteAlert = 1 kAlertCautionAlert = 2 kAlertPlainAlert = 3 kAlertDefaultOKText = -1 kAlertDefaultCancelText = -1 kAlertDefaultOtherText = -1 kAlertStdAlertOKButton = 1 kAlertStdAlertCancelButton = 2 kAlertStdAlertOtherButton = 3 kAlertStdAlertHelpButton = 4 kDialogFlagsUseThemeBackground = (1 << 0) kDialogFlagsUseControlHierarchy = (1 << 1) kDialogFlagsHandleMovableModal = (1 << 2) kDialogFlagsUseThemeControls = (1 << 3) kAlertFlagsUseThemeBackground = (1 << 0) kAlertFlagsUseControlHierarchy = (1 << 1) kAlertFlagsAlertIsMovable = (1 << 2) kAlertFlagsUseThemeControls = (1 << 3) kDialogFontNoFontStyle = 0 kDialogFontUseFontMask = 0x0001 kDialogFontUseFaceMask = 0x0002 kDialogFontUseSizeMask = 0x0004 kDialogFontUseForeColorMask = 0x0008 kDialogFontUseBackColorMask = 0x0010 kDialogFontUseModeMask = 0x0020 kDialogFontUseJustMask = 0x0040 kDialogFontUseAllMask = 0x00FF kDialogFontAddFontSizeMask = 0x0100 kDialogFontUseFontNameMask = 0x0200 kDialogFontAddToMetaFontMask = 0x0400 From jackjansen@users.sourceforge.net Sun Aug 19 23:11:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:11:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Icons.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24958/Python/Mac/Lib/Carbon Added Files: Icons.py Log Message: The modules with toolbox constants. --- NEW FILE: Icons.py --- # Generated from 'Icons.h' def FOUR_CHAR_CODE(x): return x kGenericDocumentIconResource = -4000 kGenericStationeryIconResource = -3985 kGenericEditionFileIconResource = -3989 kGenericApplicationIconResource = -3996 kGenericDeskAccessoryIconResource = -3991 kGenericFolderIconResource = -3999 kPrivateFolderIconResource = -3994 kFloppyIconResource = -3998 kTrashIconResource = -3993 kGenericRAMDiskIconResource = -3988 kGenericCDROMIconResource = -3987 kDesktopIconResource = -3992 kOpenFolderIconResource = -3997 kGenericHardDiskIconResource = -3995 kGenericFileServerIconResource = -3972 kGenericSuitcaseIconResource = -3970 kGenericMoverObjectIconResource = -3969 kGenericPreferencesIconResource = -3971 kGenericQueryDocumentIconResource = -16506 kGenericExtensionIconResource = -16415 kSystemFolderIconResource = -3983 kHelpIconResource = -20271 kAppleMenuFolderIconResource = -3982 genericDocumentIconResource = kGenericDocumentIconResource genericStationeryIconResource = kGenericStationeryIconResource genericEditionFileIconResource = kGenericEditionFileIconResource genericApplicationIconResource = kGenericApplicationIconResource genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource genericFolderIconResource = kGenericFolderIconResource privateFolderIconResource = kPrivateFolderIconResource floppyIconResource = kFloppyIconResource trashIconResource = kTrashIconResource genericRAMDiskIconResource = kGenericRAMDiskIconResource genericCDROMIconResource = kGenericCDROMIconResource desktopIconResource = kDesktopIconResource openFolderIconResource = kOpenFolderIconResource genericHardDiskIconResource = kGenericHardDiskIconResource genericFileServerIconResource = kGenericFileServerIconResource genericSuitcaseIconResource = kGenericSuitcaseIconResource genericMoverObjectIconResource = kGenericMoverObjectIconResource genericPreferencesIconResource = kGenericPreferencesIconResource genericQueryDocumentIconResource = kGenericQueryDocumentIconResource genericExtensionIconResource = kGenericExtensionIconResource systemFolderIconResource = kSystemFolderIconResource appleMenuFolderIconResource = kAppleMenuFolderIconResource kStartupFolderIconResource = -3981 kOwnedFolderIconResource = -3980 kDropFolderIconResource = -3979 kSharedFolderIconResource = -3978 kMountedFolderIconResource = -3977 kControlPanelFolderIconResource = -3976 kPrintMonitorFolderIconResource = -3975 kPreferencesFolderIconResource = -3974 kExtensionsFolderIconResource = -3973 kFontsFolderIconResource = -3968 kFullTrashIconResource = -3984 startupFolderIconResource = kStartupFolderIconResource ownedFolderIconResource = kOwnedFolderIconResource dropFolderIconResource = kDropFolderIconResource sharedFolderIconResource = kSharedFolderIconResource mountedFolderIconResource = kMountedFolderIconResource controlPanelFolderIconResource = kControlPanelFolderIconResource printMonitorFolderIconResource = kPrintMonitorFolderIconResource preferencesFolderIconResource = kPreferencesFolderIconResource extensionsFolderIconResource = kExtensionsFolderIconResource fontsFolderIconResource = kFontsFolderIconResource fullTrashIconResource = kFullTrashIconResource kThumbnail32BitData = FOUR_CHAR_CODE('it32') kThumbnail8BitMask = FOUR_CHAR_CODE('t8mk') kHuge1BitMask = FOUR_CHAR_CODE('ich#') kHuge4BitData = FOUR_CHAR_CODE('ich4') kHuge8BitData = FOUR_CHAR_CODE('ich8') kHuge32BitData = FOUR_CHAR_CODE('ih32') kHuge8BitMask = FOUR_CHAR_CODE('h8mk') kLarge1BitMask = FOUR_CHAR_CODE('ICN#') kLarge4BitData = FOUR_CHAR_CODE('icl4') kLarge8BitData = FOUR_CHAR_CODE('icl8') kLarge32BitData = FOUR_CHAR_CODE('il32') kLarge8BitMask = FOUR_CHAR_CODE('l8mk') kSmall1BitMask = FOUR_CHAR_CODE('ics#') kSmall4BitData = FOUR_CHAR_CODE('ics4') kSmall8BitData = FOUR_CHAR_CODE('ics8') kSmall32BitData = FOUR_CHAR_CODE('is32') kSmall8BitMask = FOUR_CHAR_CODE('s8mk') kMini1BitMask = FOUR_CHAR_CODE('icm#') kMini4BitData = FOUR_CHAR_CODE('icm4') kMini8BitData = FOUR_CHAR_CODE('icm8') kTileIconVariant = FOUR_CHAR_CODE('tile') kRolloverIconVariant = FOUR_CHAR_CODE('over') kDropIconVariant = FOUR_CHAR_CODE('drop') kOpenIconVariant = FOUR_CHAR_CODE('open') kOpenDropIconVariant = FOUR_CHAR_CODE('odrp') large1BitMask = kLarge1BitMask large4BitData = kLarge4BitData large8BitData = kLarge8BitData small1BitMask = kSmall1BitMask small4BitData = kSmall4BitData small8BitData = kSmall8BitData mini1BitMask = kMini1BitMask mini4BitData = kMini4BitData mini8BitData = kMini8BitData kAlignNone = 0x00 kAlignVerticalCenter = 0x01 kAlignTop = 0x02 kAlignBottom = 0x03 kAlignHorizontalCenter = 0x04 kAlignAbsoluteCenter = kAlignVerticalCenter | kAlignHorizontalCenter kAlignCenterTop = kAlignTop | kAlignHorizontalCenter kAlignCenterBottom = kAlignBottom | kAlignHorizontalCenter kAlignLeft = 0x08 kAlignCenterLeft = kAlignVerticalCenter | kAlignLeft kAlignTopLeft = kAlignTop | kAlignLeft kAlignBottomLeft = kAlignBottom | kAlignLeft kAlignRight = 0x0C kAlignCenterRight = kAlignVerticalCenter | kAlignRight kAlignTopRight = kAlignTop | kAlignRight kAlignBottomRight = kAlignBottom | kAlignRight atNone = kAlignNone atVerticalCenter = kAlignVerticalCenter atTop = kAlignTop atBottom = kAlignBottom atHorizontalCenter = kAlignHorizontalCenter atAbsoluteCenter = kAlignAbsoluteCenter atCenterTop = kAlignCenterTop atCenterBottom = kAlignCenterBottom atLeft = kAlignLeft atCenterLeft = kAlignCenterLeft atTopLeft = kAlignTopLeft atBottomLeft = kAlignBottomLeft atRight = kAlignRight atCenterRight = kAlignCenterRight atTopRight = kAlignTopRight atBottomRight = kAlignBottomRight kTransformNone = 0x00 kTransformDisabled = 0x01 kTransformOffline = 0x02 kTransformOpen = 0x03 kTransformLabel1 = 0x0100 kTransformLabel2 = 0x0200 kTransformLabel3 = 0x0300 kTransformLabel4 = 0x0400 kTransformLabel5 = 0x0500 kTransformLabel6 = 0x0600 kTransformLabel7 = 0x0700 kTransformSelected = 0x4000 kTransformSelectedDisabled = kTransformSelected | kTransformDisabled kTransformSelectedOffline = kTransformSelected | kTransformOffline kTransformSelectedOpen = kTransformSelected | kTransformOpen ttNone = kTransformNone ttDisabled = kTransformDisabled ttOffline = kTransformOffline ttOpen = kTransformOpen ttLabel1 = kTransformLabel1 ttLabel2 = kTransformLabel2 ttLabel3 = kTransformLabel3 ttLabel4 = kTransformLabel4 ttLabel5 = kTransformLabel5 ttLabel6 = kTransformLabel6 ttLabel7 = kTransformLabel7 ttSelected = kTransformSelected ttSelectedDisabled = kTransformSelectedDisabled ttSelectedOffline = kTransformSelectedOffline ttSelectedOpen = kTransformSelectedOpen kSelectorLarge1Bit = 0x00000001 kSelectorLarge4Bit = 0x00000002 kSelectorLarge8Bit = 0x00000004 kSelectorLarge32Bit = 0x00000008 kSelectorLarge8BitMask = 0x00000010 kSelectorSmall1Bit = 0x00000100 kSelectorSmall4Bit = 0x00000200 kSelectorSmall8Bit = 0x00000400 kSelectorSmall32Bit = 0x00000800 kSelectorSmall8BitMask = 0x00001000 kSelectorMini1Bit = 0x00010000 kSelectorMini4Bit = 0x00020000 kSelectorMini8Bit = 0x00040000 kSelectorHuge1Bit = 0x01000000 kSelectorHuge4Bit = 0x02000000 kSelectorHuge8Bit = 0x04000000 kSelectorHuge32Bit = 0x08000000 kSelectorHuge8BitMask = 0x10000000 kSelectorAllLargeData = 0x000000FF kSelectorAllSmallData = 0x0000FF00 kSelectorAllMiniData = 0x00FF0000 # kSelectorAllHugeData = (long)0xFF000000 kSelectorAll1BitData = kSelectorLarge1Bit | kSelectorSmall1Bit | kSelectorMini1Bit | kSelectorHuge1Bit kSelectorAll4BitData = kSelectorLarge4Bit | kSelectorSmall4Bit | kSelectorMini4Bit | kSelectorHuge4Bit kSelectorAll8BitData = kSelectorLarge8Bit | kSelectorSmall8Bit | kSelectorMini8Bit | kSelectorHuge8Bit kSelectorAll32BitData = kSelectorLarge32Bit | kSelectorSmall32Bit | kSelectorHuge32Bit # kSelectorAllAvailableData = (long)0xFFFFFFFF svLarge1Bit = kSelectorLarge1Bit svLarge4Bit = kSelectorLarge4Bit svLarge8Bit = kSelectorLarge8Bit svSmall1Bit = kSelectorSmall1Bit svSmall4Bit = kSelectorSmall4Bit svSmall8Bit = kSelectorSmall8Bit svMini1Bit = kSelectorMini1Bit svMini4Bit = kSelectorMini4Bit svMini8Bit = kSelectorMini8Bit svAllLargeData = kSelectorAllLargeData svAllSmallData = kSelectorAllSmallData svAllMiniData = kSelectorAllMiniData svAll1BitData = kSelectorAll1BitData svAll4BitData = kSelectorAll4BitData svAll8BitData = kSelectorAll8BitData # svAllAvailableData = kSelectorAllAvailableData kSystemIconsCreator = FOUR_CHAR_CODE('macs') # err = GetIconRef(kOnSystemDisk kClipboardIcon = FOUR_CHAR_CODE('CLIP') kClippingUnknownTypeIcon = FOUR_CHAR_CODE('clpu') kClippingPictureTypeIcon = FOUR_CHAR_CODE('clpp') kClippingTextTypeIcon = FOUR_CHAR_CODE('clpt') kClippingSoundTypeIcon = FOUR_CHAR_CODE('clps') kDesktopIcon = FOUR_CHAR_CODE('desk') kFinderIcon = FOUR_CHAR_CODE('FNDR') kFontSuitcaseIcon = FOUR_CHAR_CODE('FFIL') kFullTrashIcon = FOUR_CHAR_CODE('ftrh') kGenericApplicationIcon = FOUR_CHAR_CODE('APPL') kGenericCDROMIcon = FOUR_CHAR_CODE('cddr') kGenericControlPanelIcon = FOUR_CHAR_CODE('APPC') kGenericControlStripModuleIcon = FOUR_CHAR_CODE('sdev') kGenericComponentIcon = FOUR_CHAR_CODE('thng') kGenericDeskAccessoryIcon = FOUR_CHAR_CODE('APPD') kGenericDocumentIcon = FOUR_CHAR_CODE('docu') kGenericEditionFileIcon = FOUR_CHAR_CODE('edtf') kGenericExtensionIcon = FOUR_CHAR_CODE('INIT') kGenericFileServerIcon = FOUR_CHAR_CODE('srvr') kGenericFontIcon = FOUR_CHAR_CODE('ffil') kGenericFontScalerIcon = FOUR_CHAR_CODE('sclr') kGenericFloppyIcon = FOUR_CHAR_CODE('flpy') kGenericHardDiskIcon = FOUR_CHAR_CODE('hdsk') kGenericRemovableMediaIcon = FOUR_CHAR_CODE('rmov') kGenericMoverObjectIcon = FOUR_CHAR_CODE('movr') kGenericPCCardIcon = FOUR_CHAR_CODE('pcmc') kGenericPreferencesIcon = FOUR_CHAR_CODE('pref') kGenericQueryDocumentIcon = FOUR_CHAR_CODE('qery') kGenericRAMDiskIcon = FOUR_CHAR_CODE('ramd') kGenericSharedLibaryIcon = FOUR_CHAR_CODE('shlb') kGenericStationeryIcon = FOUR_CHAR_CODE('sdoc') kGenericSuitcaseIcon = FOUR_CHAR_CODE('suit') kGenericWORMIcon = FOUR_CHAR_CODE('worm') kInternationResourcesIcon = FOUR_CHAR_CODE('ifil') kKeyboardLayoutIcon = FOUR_CHAR_CODE('kfil') kSoundFileIcon = FOUR_CHAR_CODE('sfil') kSystemSuitcaseIcon = FOUR_CHAR_CODE('zsys') kTrashIcon = FOUR_CHAR_CODE('trsh') kTrueTypeFontIcon = FOUR_CHAR_CODE('tfil') kTrueTypeFlatFontIcon = FOUR_CHAR_CODE('sfnt') kTrueTypeMultiFlatFontIcon = FOUR_CHAR_CODE('ttcf') kInternetLocationHTTPIcon = FOUR_CHAR_CODE('ilht') kInternetLocationFTPIcon = FOUR_CHAR_CODE('ilft') kInternetLocationAppleShareIcon = FOUR_CHAR_CODE('ilaf') kInternetLocationAppleTalkZoneIcon = FOUR_CHAR_CODE('ilat') kInternetLocationFileIcon = FOUR_CHAR_CODE('ilfi') kInternetLocationMailIcon = FOUR_CHAR_CODE('ilma') kInternetLocationNewsIcon = FOUR_CHAR_CODE('ilnw') kInternetLocationNSLNeighborhoodIcon = FOUR_CHAR_CODE('ilns') kInternetLocationGenericIcon = FOUR_CHAR_CODE('ilge') kGenericFolderIcon = FOUR_CHAR_CODE('fldr') kDropFolderIcon = FOUR_CHAR_CODE('dbox') kMountedFolderIcon = FOUR_CHAR_CODE('mntd') kOpenFolderIcon = FOUR_CHAR_CODE('ofld') kOwnedFolderIcon = FOUR_CHAR_CODE('ownd') kPrivateFolderIcon = FOUR_CHAR_CODE('prvf') kSharedFolderIcon = FOUR_CHAR_CODE('shfl') kSharingPrivsNotApplicableIcon = FOUR_CHAR_CODE('shna') kSharingPrivsReadOnlyIcon = FOUR_CHAR_CODE('shro') kSharingPrivsReadWriteIcon = FOUR_CHAR_CODE('shrw') kSharingPrivsUnknownIcon = FOUR_CHAR_CODE('shuk') kSharingPrivsWritableIcon = FOUR_CHAR_CODE('writ') kUserFolderIcon = FOUR_CHAR_CODE('ufld') kWorkgroupFolderIcon = FOUR_CHAR_CODE('wfld') kGuestUserIcon = FOUR_CHAR_CODE('gusr') kUserIcon = FOUR_CHAR_CODE('user') kOwnerIcon = FOUR_CHAR_CODE('susr') kGroupIcon = FOUR_CHAR_CODE('grup') kAppleExtrasFolderIcon = FOUR_CHAR_CODE('aex€') kAppleMenuFolderIcon = FOUR_CHAR_CODE('amnu') kApplicationsFolderIcon = FOUR_CHAR_CODE('apps') kApplicationSupportFolderIcon = FOUR_CHAR_CODE('asup') kAssistantsFolderIcon = FOUR_CHAR_CODE('ast€') kContextualMenuItemsFolderIcon = FOUR_CHAR_CODE('cmnu') kControlPanelDisabledFolderIcon = FOUR_CHAR_CODE('ctrD') kControlPanelFolderIcon = FOUR_CHAR_CODE('ctrl') kControlStripModulesFolderIcon = FOUR_CHAR_CODE('sdv€') kDocumentsFolderIcon = FOUR_CHAR_CODE('docs') kExtensionsDisabledFolderIcon = FOUR_CHAR_CODE('extD') kExtensionsFolderIcon = FOUR_CHAR_CODE('extn') kFavoritesFolderIcon = FOUR_CHAR_CODE('favs') kFontsFolderIcon = FOUR_CHAR_CODE('font') kHelpFolderIcon = FOUR_CHAR_CODE('€hlp') kInternetFolderIcon = FOUR_CHAR_CODE('int€') kInternetPlugInFolderIcon = FOUR_CHAR_CODE('€net') kLocalesFolderIcon = FOUR_CHAR_CODE('€loc') kMacOSReadMeFolderIcon = FOUR_CHAR_CODE('mor€') kPreferencesFolderIcon = FOUR_CHAR_CODE('prf€') kPrinterDescriptionFolderIcon = FOUR_CHAR_CODE('ppdf') kPrinterDriverFolderIcon = FOUR_CHAR_CODE('€prd') kPrintMonitorFolderIcon = FOUR_CHAR_CODE('prnt') kRecentApplicationsFolderIcon = FOUR_CHAR_CODE('rapp') kRecentDocumentsFolderIcon = FOUR_CHAR_CODE('rdoc') kRecentServersFolderIcon = FOUR_CHAR_CODE('rsrv') kScriptingAdditionsFolderIcon = FOUR_CHAR_CODE('€scr') kSharedLibrariesFolderIcon = FOUR_CHAR_CODE('€lib') kScriptsFolderIcon = FOUR_CHAR_CODE('scr€') kShutdownItemsDisabledFolderIcon = FOUR_CHAR_CODE('shdD') kShutdownItemsFolderIcon = FOUR_CHAR_CODE('shdf') kSpeakableItemsFolder = FOUR_CHAR_CODE('spki') kStartupItemsDisabledFolderIcon = FOUR_CHAR_CODE('strD') kStartupItemsFolderIcon = FOUR_CHAR_CODE('strt') kSystemExtensionDisabledFolderIcon = FOUR_CHAR_CODE('macD') kSystemFolderIcon = FOUR_CHAR_CODE('macs') kTextEncodingsFolderIcon = FOUR_CHAR_CODE('€tex') kAppearanceFolderIcon = FOUR_CHAR_CODE('appr') kUtilitiesFolderIcon = FOUR_CHAR_CODE('uti€') kVoicesFolderIcon = FOUR_CHAR_CODE('fvoc') kColorSyncFolderIcon = FOUR_CHAR_CODE('prof') kInternetSearchSitesFolderIcon = FOUR_CHAR_CODE('issf') kUsersFolderIcon = FOUR_CHAR_CODE('usr€') kAppleScriptBadgeIcon = FOUR_CHAR_CODE('scrp') kLockedBadgeIcon = FOUR_CHAR_CODE('lbdg') kMountedBadgeIcon = FOUR_CHAR_CODE('mbdg') kSharedBadgeIcon = FOUR_CHAR_CODE('sbdg') kAliasBadgeIcon = FOUR_CHAR_CODE('abdg') kAlertNoteIcon = FOUR_CHAR_CODE('note') kAlertCautionIcon = FOUR_CHAR_CODE('caut') kAlertStopIcon = FOUR_CHAR_CODE('stop') kAppleTalkIcon = FOUR_CHAR_CODE('atlk') kAppleTalkZoneIcon = FOUR_CHAR_CODE('atzn') kAFPServerIcon = FOUR_CHAR_CODE('afps') kFTPServerIcon = FOUR_CHAR_CODE('ftps') kHTTPServerIcon = FOUR_CHAR_CODE('htps') kGenericNetworkIcon = FOUR_CHAR_CODE('gnet') kIPFileServerIcon = FOUR_CHAR_CODE('isrv') kAppleLogoIcon = FOUR_CHAR_CODE('capl') kAppleMenuIcon = FOUR_CHAR_CODE('sapl') kBackwardArrowIcon = FOUR_CHAR_CODE('baro') kFavoriteItemsIcon = FOUR_CHAR_CODE('favr') kForwardArrowIcon = FOUR_CHAR_CODE('faro') kGridIcon = FOUR_CHAR_CODE('grid') kHelpIcon = FOUR_CHAR_CODE('help') kKeepArrangedIcon = FOUR_CHAR_CODE('arng') kLockedIcon = FOUR_CHAR_CODE('lock') kNoFilesIcon = FOUR_CHAR_CODE('nfil') kNoFolderIcon = FOUR_CHAR_CODE('nfld') kNoWriteIcon = FOUR_CHAR_CODE('nwrt') kProtectedApplicationFolderIcon = FOUR_CHAR_CODE('papp') kProtectedSystemFolderIcon = FOUR_CHAR_CODE('psys') kRecentItemsIcon = FOUR_CHAR_CODE('rcnt') kShortcutIcon = FOUR_CHAR_CODE('shrt') kSortAscendingIcon = FOUR_CHAR_CODE('asnd') kSortDescendingIcon = FOUR_CHAR_CODE('dsnd') kUnlockedIcon = FOUR_CHAR_CODE('ulck') kConnectToIcon = FOUR_CHAR_CODE('cnct') kIconServicesNormalUsageFlag = 0 kIconFamilyType = FOUR_CHAR_CODE('icns') From jackjansen@users.sourceforge.net Sun Aug 19 23:11:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:11:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Lists.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24974/Python/Mac/Lib/Carbon Added Files: Lists.py Log Message: The modules with toolbox constants. --- NEW FILE: Lists.py --- # Generated from 'Lists.h' def FOUR_CHAR_CODE(x): return x listNotifyNothing = FOUR_CHAR_CODE('nada') listNotifyClick = FOUR_CHAR_CODE('clik') listNotifyDoubleClick = FOUR_CHAR_CODE('dblc') listNotifyPreClick = FOUR_CHAR_CODE('pclk') lDoVAutoscrollBit = 1 lDoHAutoscrollBit = 0 lDoVAutoscroll = 2 lDoHAutoscroll = 1 lOnlyOneBit = 7 lExtendDragBit = 6 lNoDisjointBit = 5 lNoExtendBit = 4 lNoRectBit = 3 lUseSenseBit = 2 lNoNilHiliteBit = 1 lOnlyOne = -128 lExtendDrag = 64 lNoDisjoint = 32 lNoExtend = 16 lNoRect = 8 lUseSense = 4 lNoNilHilite = 2 lInitMsg = 0 lDrawMsg = 1 lHiliteMsg = 2 lCloseMsg = 3 kListDefUserProcType = 0 kListDefStandardTextType = 1 kListDefStandardIconType = 2 From jackjansen@users.sourceforge.net Sun Aug 19 23:12:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:12:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon MacTextEditor.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24993/Python/Mac/Lib/Carbon Added Files: MacTextEditor.py Log Message: The modules with toolbox constants. --- NEW FILE: MacTextEditor.py --- # Generated from 'MacTextEditor.h' def FOUR_CHAR_CODE(x): return x false = 0 true = 1 kTXNClearThisControl = 0xFFFFFFFF kTXNClearTheseFontFeatures = 0x80000000 kTXNDontCareTypeSize = 0xFFFFFFFF kTXNDecrementTypeSize = 0x80000000 kTXNUseCurrentSelection = 0xFFFFFFFF kTXNStartOffset = 0 kTXNEndOffset = 0x7FFFFFFF MovieFileType = FOUR_CHAR_CODE('moov') kTXNWillDefaultToATSUIBit = 0 kTXNWillDefaultToATSUIMask = 1L << kTXNWillDefaultToATSUIBit kTXNWantMoviesBit = 0 kTXNWantSoundBit = 1 kTXNWantGraphicsBit = 2 kTXNAlwaysUseQuickDrawTextBit = 3 kTXNUseTemporaryMemoryBit = 4 kTXNWantMoviesMask = 1L << kTXNWantMoviesBit kTXNWantSoundMask = 1L << kTXNWantSoundBit kTXNWantGraphicsMask = 1L << kTXNWantGraphicsBit kTXNAlwaysUseQuickDrawTextMask = 1L << kTXNAlwaysUseQuickDrawTextBit kTXNUseTemporaryMemoryMask = 1L << kTXNUseTemporaryMemoryBit kTXNDrawGrowIconBit = 0 kTXNShowWindowBit = 1 kTXNWantHScrollBarBit = 2 kTXNWantVScrollBarBit = 3 kTXNNoTSMEverBit = 4 kTXNReadOnlyBit = 5 kTXNNoKeyboardSyncBit = 6 kTXNNoSelectionBit = 7 kTXNSaveStylesAsSTYLResourceBit = 8 kOutputTextInUnicodeEncodingBit = 9 kTXNDoNotInstallDragProcsBit = 10 kTXNAlwaysWrapAtViewEdgeBit = 11 kTXNDrawGrowIconMask = 1L << kTXNDrawGrowIconBit kTXNShowWindowMask = 1L << kTXNShowWindowBit kTXNWantHScrollBarMask = 1L << kTXNWantHScrollBarBit kTXNWantVScrollBarMask = 1L << kTXNWantVScrollBarBit kTXNNoTSMEverMask = 1L << kTXNNoTSMEverBit kTXNReadOnlyMask = 1L << kTXNReadOnlyBit kTXNNoKeyboardSyncMask = 1L << kTXNNoKeyboardSyncBit kTXNNoSelectionMask = 1L << kTXNNoSelectionBit kTXNSaveStylesAsSTYLResourceMask = 1L << kTXNSaveStylesAsSTYLResourceBit kOutputTextInUnicodeEncodingMask = 1L << kOutputTextInUnicodeEncodingBit kTXNDoNotInstallDragProcsMask = 1L << kTXNDoNotInstallDragProcsBit kTXNAlwaysWrapAtViewEdgeMask = 1L << kTXNAlwaysWrapAtViewEdgeBit kTXNFontContinuousBit = 0 kTXNSizeContinuousBit = 1 kTXNStyleContinuousBit = 2 kTXNColorContinuousBit = 3 kTXNFontContinuousMask = 1L << kTXNFontContinuousBit kTXNSizeContinuousMask = 1L << kTXNSizeContinuousBit kTXNStyleContinuousMask = 1L << kTXNStyleContinuousBit kTXNColorContinuousMask = 1L << kTXNColorContinuousBit kTXNIgnoreCaseBit = 0 kTXNEntireWordBit = 1 kTXNUseEncodingWordRulesBit = 31 kTXNIgnoreCaseMask = 1L << kTXNIgnoreCaseBit kTXNEntireWordMask = 1L << kTXNEntireWordBit kTXNUseEncodingWordRulesMask = 1L << kTXNUseEncodingWordRulesBit kTXNTextensionFile = FOUR_CHAR_CODE('txtn') kTXNTextFile = FOUR_CHAR_CODE('TEXT') kTXNPictureFile = FOUR_CHAR_CODE('PICT') kTXNMovieFile = MovieFileType kTXNSoundFile = FOUR_CHAR_CODE('sfil') kTXNAIFFFile = FOUR_CHAR_CODE('AIFF') kTXNTextEditStyleFrameType = 1 kTXNPageFrameType = 2 kTXNMultipleFrameType = 3 kTXNTextData = FOUR_CHAR_CODE('TEXT') kTXNPictureData = FOUR_CHAR_CODE('PICT') kTXNMovieData = FOUR_CHAR_CODE('moov') kTXNSoundData = FOUR_CHAR_CODE('snd ') kTXNUnicodeTextData = FOUR_CHAR_CODE('utxt') kTXNLineDirectionTag = FOUR_CHAR_CODE('lndr') kTXNJustificationTag = FOUR_CHAR_CODE('just') kTXNIOPrivilegesTag = FOUR_CHAR_CODE('iopv') kTXNSelectionStateTag = FOUR_CHAR_CODE('slst') kTXNInlineStateTag = FOUR_CHAR_CODE('inst') kTXNWordWrapStateTag = FOUR_CHAR_CODE('wwrs') kTXNKeyboardSyncStateTag = FOUR_CHAR_CODE('kbsy') kTXNAutoIndentStateTag = FOUR_CHAR_CODE('auin') kTXNTabSettingsTag = FOUR_CHAR_CODE('tabs') kTXNRefConTag = FOUR_CHAR_CODE('rfcn') kTXNMarginsTag = FOUR_CHAR_CODE('marg') kTXNNoUserIOTag = FOUR_CHAR_CODE('nuio') kTXNTypingAction = 0 kTXNCutAction = 1 kTXNPasteAction = 2 kTXNClearAction = 3 kTXNChangeFontAction = 4 kTXNChangeFontColorAction = 5 kTXNChangeFontSizeAction = 6 kTXNChangeStyleAction = 7 kTXNAlignLeftAction = 8 kTXNAlignCenterAction = 9 kTXNAlignRightAction = 10 kTXNDropAction = 11 kTXNMoveAction = 12 kTXNFontFeatureAction = 13 kTXNFontVariationAction = 14 kTXNUndoLastAction = 1024 # kTXNClearThisControl = (long)0xFFFFFFFF # kTXNClearTheseFontFeatures = (long)0x80000000 kTXNReadWrite = false kTXNReadOnly = true kTXNSelectionOn = true kTXNSelectionOff = false kTXNUseInline = false kTXNUseBottomline = true kTXNAutoWrap = false kTXNNoAutoWrap = true kTXNSyncKeyboard = false kTXNNoSyncKeyboard = true kTXNAutoIndentOff = false kTXNAutoIndentOn = true kTXNRightTab = -1 kTXNLeftTab = 0 kTXNCenterTab = 1 kTXNLeftToRight = 0 kTXNRightToLeft = 1 kTXNFlushDefault = 0 kTXNFlushLeft = 1 kTXNFlushRight = 2 kTXNCenter = 4 kTXNFullJust = 8 kTXNForceFullJust = 16 kScrollBarsAlwaysActive = true kScrollBarsSyncWithFocus = false # kTXNDontCareTypeSize = (long)0xFFFFFFFF kTXNDontCareTypeStyle = 0xFF kTXNIncrementTypeSize = 0x00000001 # kTXNDecrementTypeSize = (long)0x80000000 # kTXNUseCurrentSelection = 0xFFFFFFFFUL # kTXNStartOffset = 0UL # kTXNEndOffset = 0x7FFFFFFFUL kTXNSingleStylePerTextDocumentResType = FOUR_CHAR_CODE('MPSR') kTXNMultipleStylesPerTextDocumentResType = FOUR_CHAR_CODE('styl') kTXNShowStart = false kTXNShowEnd = true kTXNQDFontNameAttribute = FOUR_CHAR_CODE('fntn') kTXNQDFontFamilyIDAttribute = FOUR_CHAR_CODE('font') kTXNQDFontSizeAttribute = FOUR_CHAR_CODE('size') kTXNQDFontStyleAttribute = FOUR_CHAR_CODE('face') kTXNQDFontColorAttribute = FOUR_CHAR_CODE('klor') kTXNTextEncodingAttribute = FOUR_CHAR_CODE('encd') kTXNATSUIFontFeaturesAttribute = FOUR_CHAR_CODE('atfe') kTXNATSUIFontVariationsAttribute = FOUR_CHAR_CODE('atva') # kTXNQDFontNameAttributeSize = sizeof(Str255) # kTXNQDFontFamilyIDAttributeSize = sizeof(SInt16) # kTXNQDFontSizeAttributeSize = sizeof(SInt16) # kTXNQDFontStyleAttributeSize = sizeof(Style) # kTXNQDFontColorAttributeSize = sizeof(RGBColor) # kTXNTextEncodingAttributeSize = sizeof(TextEncoding) kTXNSystemDefaultEncoding = 0 kTXNMacOSEncoding = 1 kTXNUnicodeEncoding = 2 kTXNBackgroundTypeRGB = 1 # status = TXNInitTextension( &defaults # justification = LMTESysJust From jackjansen@users.sourceforge.net Sun Aug 19 23:12:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:12:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon MediaDescr.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv25034/Python/Mac/Lib/Carbon Added Files: MediaDescr.py Log Message: The modules with toolbox constants. --- NEW FILE: MediaDescr.py --- # Parsers/generators for QuickTime media descriptions import struct Error = 'MediaDescr.Error' class _MediaDescriptionCodec: def __init__(self, trunc, size, names, fmt): self.trunc = trunc self.size = size self.names = names self.fmt = fmt def decode(self, data): if self.trunc: data = data[:self.size] values = struct.unpack(self.fmt, data) if len(values) != len(self.names): raise Error, ('Format length does not match number of names', descr) rv = {} for i in range(len(values)): name = self.names[i] value = values[i] if type(name) == type(()): name, cod, dec = name value = dec(value) rv[name] = value return rv def encode(dict): list = [self.fmt] for name in self.names: if type(name) == type(()): name, cod, dec = name else: cod = dec = None value = dict[name] if cod: value = cod(value) list.append(value) rv = apply(struct.pack, tuple(list)) return rv # Helper functions def _tofixed(float): hi = int(float) lo = int(float*0x10000) & 0xffff return (hi<<16)|lo def _fromfixed(fixed): hi = (fixed >> 16) & 0xffff lo = (fixed & 0xffff) return hi + (lo / float(0x10000)) def _tostr31(str): return chr(len(str)) + str + '\0'*(31-len(str)) def _fromstr31(str31): return str31[1:1+ord(str31[0])] SampleDescription = _MediaDescriptionCodec( 1, # May be longer, truncate 16, # size ('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex'), # Attributes "l4slhh" # Format ) SoundDescription = _MediaDescriptionCodec( 1, 36, ('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex', 'version', 'revlevel', 'vendor', 'numChannels', 'sampleSize', 'compressionID', 'packetSize', ('sampleRate', _tofixed, _fromfixed)), "l4slhhhh4shhhhl" # Format ) SoundDescriptionV1 = _MediaDescriptionCodec( 1, 52, ('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex', 'version', 'revlevel', 'vendor', 'numChannels', 'sampleSize', 'compressionID', 'packetSize', ('sampleRate', _tofixed, _fromfixed), 'samplesPerPacket', 'bytesPerPacket', 'bytesPerFrame', 'bytesPerSample'), "l4slhhhh4shhhhlllll" # Format ) ImageDescription = _MediaDescriptionCodec( 1, # May be longer, truncate 86, # size ('idSize', 'cType', 'resvd1', 'resvd2', 'dataRefIndex', 'version', 'revisionLevel', 'vendor', 'temporalQuality', 'spatialQuality', 'width', 'height', ('hRes', _tofixed, _fromfixed), ('vRes', _tofixed, _fromfixed), 'dataSize', 'frameCount', ('name', _tostr31, _fromstr31), 'depth', 'clutID'), 'l4slhhhh4sllhhlllh32shh', ) # XXXX Others, like TextDescription and such, remain to be done. From jackjansen@users.sourceforge.net Sun Aug 19 23:12:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:12:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Menus.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv25055/Python/Mac/Lib/Carbon Added Files: Menus.py Log Message: The modules with toolbox constants. --- NEW FILE: Menus.py --- # Generated from 'Menus.h' def FOUR_CHAR_CODE(x): return x noMark = 0 kMenuDrawMsg = 0 kMenuSizeMsg = 2 kMenuPopUpMsg = 3 kMenuCalcItemMsg = 5 kMenuThemeSavvyMsg = 7 mDrawMsg = 0 mSizeMsg = 2 mPopUpMsg = 3 mCalcItemMsg = 5 mChooseMsg = 1 mDrawItemMsg = 4 kMenuChooseMsg = 1 kMenuDrawItemMsg = 4 kThemeSavvyMenuResponse = 0x7473 kMenuInitMsg = 8 kMenuDisposeMsg = 9 kMenuFindItemMsg = 10 kMenuHiliteItemMsg = 11 textMenuProc = 0 hMenuCmd = 27 hierMenu = -1 kInsertHierarchicalMenu = -1 mctAllItems = -98 mctLastIDIndic = -99 kMenuStdMenuProc = 63 kMenuStdMenuBarProc = 63 kMenuNoModifiers = 0 kMenuShiftModifier = (1 << 0) kMenuOptionModifier = (1 << 1) kMenuControlModifier = (1 << 2) kMenuNoCommandModifier = (1 << 3) kMenuNoIcon = 0 kMenuIconType = 1 kMenuShrinkIconType = 2 kMenuSmallIconType = 3 kMenuColorIconType = 4 kMenuIconSuiteType = 5 kMenuIconRefType = 6 kMenuAttrExcludesMarkColumn = (1 << 0) kMenuAttrAutoDisable = (1 << 2) kMenuItemAttrSubmenuParentChoosable = (1 << 2) kMenuTrackingModeMouse = 1 kMenuTrackingModeKeyboard = 2 kMenuDefProcPtr = 0 kMenuPropertyPersistent = 0x00000001 kHierarchicalFontMenuOption = 0x00000001 gestaltContextualMenuAttr = FOUR_CHAR_CODE('cmnu') gestaltContextualMenuUnusedBit = 0 gestaltContextualMenuTrapAvailable = 1 kCMHelpItemNoHelp = 0 kCMHelpItemAppleGuide = 1 kCMHelpItemOtherHelp = 2 kCMNothingSelected = 0 kCMMenuItemSelected = 1 kCMShowHelpSelected = 3 From jackjansen@users.sourceforge.net Sun Aug 19 23:12:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:12:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon QuickTime.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv25126/Python/Mac/Lib/Carbon Added Files: QuickTime.py Log Message: The modules with toolbox constants. --- NEW FILE: QuickTime.py --- # Generated from 'Movies.h' def FOUR_CHAR_CODE(x): return x MovieFileType = FOUR_CHAR_CODE('MooV') MovieScrapType = FOUR_CHAR_CODE('moov') MovieResourceType = FOUR_CHAR_CODE('moov') MovieForwardPointerResourceType = FOUR_CHAR_CODE('fore') MovieBackwardPointerResourceType = FOUR_CHAR_CODE('back') MovieResourceAtomType = FOUR_CHAR_CODE('moov') MovieDataAtomType = FOUR_CHAR_CODE('mdat') FreeAtomType = FOUR_CHAR_CODE('free') SkipAtomType = FOUR_CHAR_CODE('skip') WideAtomPlaceholderType = FOUR_CHAR_CODE('wide') MediaHandlerType = FOUR_CHAR_CODE('mhlr') DataHandlerType = FOUR_CHAR_CODE('dhlr') VideoMediaType = FOUR_CHAR_CODE('vide') SoundMediaType = FOUR_CHAR_CODE('soun') TextMediaType = FOUR_CHAR_CODE('text') BaseMediaType = FOUR_CHAR_CODE('gnrc') MPEGMediaType = FOUR_CHAR_CODE('MPEG') MusicMediaType = FOUR_CHAR_CODE('musi') TimeCodeMediaType = FOUR_CHAR_CODE('tmcd') SpriteMediaType = FOUR_CHAR_CODE('sprt') FlashMediaType = FOUR_CHAR_CODE('flsh') MovieMediaType = FOUR_CHAR_CODE('moov') TweenMediaType = FOUR_CHAR_CODE('twen') ThreeDeeMediaType = FOUR_CHAR_CODE('qd3d') HandleDataHandlerSubType = FOUR_CHAR_CODE('hndl') ResourceDataHandlerSubType = FOUR_CHAR_CODE('rsrc') URLDataHandlerSubType = FOUR_CHAR_CODE('url ') WiredActionHandlerType = FOUR_CHAR_CODE('wire') VisualMediaCharacteristic = FOUR_CHAR_CODE('eyes') AudioMediaCharacteristic = FOUR_CHAR_CODE('ears') kCharacteristicCanSendVideo = FOUR_CHAR_CODE('vsnd') kCharacteristicProvidesActions = FOUR_CHAR_CODE('actn') kCharacteristicNonLinear = FOUR_CHAR_CODE('nonl') kCharacteristicCanStep = FOUR_CHAR_CODE('step') kCharacteristicHasNoDuration = FOUR_CHAR_CODE('noti') kUserDataMovieControllerType = FOUR_CHAR_CODE('ctyp') kUserDataName = FOUR_CHAR_CODE('name') kUserDataTextAuthor = FOUR_CHAR_CODE('©aut') kUserDataTextComment = FOUR_CHAR_CODE('©cmt') kUserDataTextCopyright = FOUR_CHAR_CODE('©cpy') kUserDataTextCreationDate = FOUR_CHAR_CODE('©day') kUserDataTextDescription = FOUR_CHAR_CODE('©des') kUserDataTextDirector = FOUR_CHAR_CODE('©dir') kUserDataTextDisclaimer = FOUR_CHAR_CODE('©dis') kUserDataTextFullName = FOUR_CHAR_CODE('©nam') kUserDataTextHostComputer = FOUR_CHAR_CODE('©hst') kUserDataTextInformation = FOUR_CHAR_CODE('©inf') kUserDataTextKeywords = FOUR_CHAR_CODE('©key') kUserDataTextMake = FOUR_CHAR_CODE('©mak') kUserDataTextModel = FOUR_CHAR_CODE('©mod') kUserDataTextOriginalFormat = FOUR_CHAR_CODE('©fmt') kUserDataTextOriginalSource = FOUR_CHAR_CODE('©src') kUserDataTextPerformers = FOUR_CHAR_CODE('©prf') kUserDataTextProducer = FOUR_CHAR_CODE('©prd') kUserDataTextProduct = FOUR_CHAR_CODE('©PRD') kUserDataTextSoftware = FOUR_CHAR_CODE('©swr') kUserDataTextSpecialPlaybackRequirements = FOUR_CHAR_CODE('©req') kUserDataTextWarning = FOUR_CHAR_CODE('©wrn') kUserDataTextWriter = FOUR_CHAR_CODE('©wrt') kUserDataTextEditDate1 = FOUR_CHAR_CODE('©ed1') kUserDataTextChapter = FOUR_CHAR_CODE('©chp') kUserDataUnicodeBit = 1L << 7 DoTheRightThing = 0 kMusicFlagDontPlay2Soft = 1L << 0 kMusicFlagDontSlaveToMovie = 1L << 1 dfDontDisplay = 1 << 0 dfDontAutoScale = 1 << 1 dfClipToTextBox = 1 << 2 dfUseMovieBGColor = 1 << 3 dfShrinkTextBoxToFit = 1 << 4 dfScrollIn = 1 << 5 dfScrollOut = 1 << 6 dfHorizScroll = 1 << 7 dfReverseScroll = 1 << 8 dfContinuousScroll = 1 << 9 dfFlowHoriz = 1 << 10 dfContinuousKaraoke = 1 << 11 dfDropShadow = 1 << 12 dfAntiAlias = 1 << 13 dfKeyedText = 1 << 14 dfInverseHilite = 1 << 15 dfTextColorHilite = 1 << 16 searchTextDontGoToFoundTime = 1L << 16 searchTextDontHiliteFoundText = 1L << 17 searchTextOneTrackOnly = 1L << 18 searchTextEnabledTracksOnly = 1L << 19 kTextTextHandle = 1 kTextTextPtr = 2 kTextTEStyle = 3 kTextSetSelection = 4 kTextBackColor = 5 kTextForeColor = 6 kTextFace = 7 kTextFont = 8 kTextSize = 9 kTextAlignment = 10 kTextHilite = 11 kTextDropShadow = 12 kTextDisplayFlags = 13 kTextScroll = 14 k3DMediaRendererEntry = FOUR_CHAR_CODE('rend') k3DMediaRendererName = FOUR_CHAR_CODE('name') k3DMediaRendererCode = FOUR_CHAR_CODE('rcod') movieProgressOpen = 0 movieProgressUpdatePercent = 1 movieProgressClose = 2 progressOpFlatten = 1 progressOpInsertTrackSegment = 2 progressOpInsertMovieSegment = 3 progressOpPaste = 4 progressOpAddMovieSelection = 5 progressOpCopy = 6 progressOpCut = 7 progressOpLoadMovieIntoRam = 8 progressOpLoadTrackIntoRam = 9 progressOpLoadMediaIntoRam = 10 progressOpImportMovie = 11 progressOpExportMovie = 12 mediaQualityDraft = 0x0000 mediaQualityNormal = 0x0040 mediaQualityBetter = 0x0080 mediaQualityBest = 0x00C0 kActionMovieSetVolume = 1024 kActionMovieSetRate = 1025 kActionMovieSetLoopingFlags = 1026 kActionMovieGoToTime = 1027 kActionMovieGoToTimeByName = 1028 kActionMovieGoToBeginning = 1029 kActionMovieGoToEnd = 1030 kActionMovieStepForward = 1031 kActionMovieStepBackward = 1032 kActionMovieSetSelection = 1033 kActionMovieSetSelectionByName = 1034 kActionMoviePlaySelection = 1035 kActionMovieSetLanguage = 1036 kActionMovieChanged = 1037 kActionMovieRestartAtTime = 1038 kActionTrackSetVolume = 2048 kActionTrackSetBalance = 2049 kActionTrackSetEnabled = 2050 kActionTrackSetMatrix = 2051 kActionTrackSetLayer = 2052 kActionTrackSetClip = 2053 kActionTrackSetCursor = 2054 kActionTrackSetGraphicsMode = 2055 kActionSpriteSetMatrix = 3072 kActionSpriteSetImageIndex = 3073 kActionSpriteSetVisible = 3074 kActionSpriteSetLayer = 3075 kActionSpriteSetGraphicsMode = 3076 kActionSpritePassMouseToCodec = 3078 kActionSpriteClickOnCodec = 3079 kActionSpriteTranslate = 3080 kActionSpriteScale = 3081 kActionSpriteRotate = 3082 kActionSpriteStretch = 3083 kActionQTVRSetPanAngle = 4096 kActionQTVRSetTiltAngle = 4097 kActionQTVRSetFieldOfView = 4098 kActionQTVRShowDefaultView = 4099 kActionQTVRGoToNodeID = 4100 kActionMusicPlayNote = 5120 kActionMusicSetController = 5121 kActionCase = 6144 kActionWhile = 6145 kActionGoToURL = 6146 kActionSendQTEventToSprite = 6147 kActionDebugStr = 6148 kActionPushCurrentTime = 6149 kActionPushCurrentTimeWithLabel = 6150 kActionPopAndGotoTopTime = 6151 kActionPopAndGotoLabeledTime = 6152 kActionStatusString = 6153 kActionSendQTEventToTrackObject = 6154 kActionAddChannelSubscription = 6155 kActionRemoveChannelSubscription = 6156 kActionOpenCustomActionHandler = 6157 kActionDoScript = 6158 kActionSpriteTrackSetVariable = 7168 kActionSpriteTrackNewSprite = 7169 kActionSpriteTrackDisposeSprite = 7170 kActionSpriteTrackSetVariableToString = 7171 kActionSpriteTrackConcatVariables = 7172 kActionSpriteTrackSetVariableToMovieURL = 7173 kActionSpriteTrackSetVariableToMovieBaseURL = 7174 kActionApplicationNumberAndString = 8192 kActionQD3DNamedObjectTranslateTo = 9216 kActionQD3DNamedObjectScaleTo = 9217 kActionQD3DNamedObjectRotateTo = 9218 kActionFlashTrackSetPan = 10240 kActionFlashTrackSetZoom = 10241 kActionFlashTrackSetZoomRect = 10242 kActionFlashTrackGotoFrameNumber = 10243 kActionFlashTrackGotoFrameLabel = 10244 kActionMovieTrackAddChildMovie = 11264 kActionMovieTrackLoadChildMovie = 11265 kOperandExpression = 1 kOperandConstant = 2 kOperandSubscribedToChannel = 3 kOperandUniqueCustomActionHandlerID = 4 kOperandCustomActionHandlerIDIsOpen = 5 kOperandConnectionSpeed = 6 kOperandGMTDay = 7 kOperandGMTMonth = 8 kOperandGMTYear = 9 kOperandGMTHours = 10 kOperandGMTMinutes = 11 kOperandGMTSeconds = 12 kOperandLocalDay = 13 kOperandLocalMonth = 14 kOperandLocalYear = 15 kOperandLocalHours = 16 kOperandLocalMinutes = 17 kOperandLocalSeconds = 18 kOperandRegisteredForQuickTimePro = 19 kOperandPlatformRunningOn = 20 kOperandQuickTimeVersion = 21 kOperandComponentVersion = 22 kOperandOriginalHandlerRefcon = 23 kOperandTicks = 24 kOperandMaxLoadedTimeInMovie = 25 kOperandMovieVolume = 1024 kOperandMovieRate = 1025 kOperandMovieIsLooping = 1026 kOperandMovieLoopIsPalindrome = 1027 kOperandMovieTime = 1028 kOperandTrackVolume = 2048 kOperandTrackBalance = 2049 kOperandTrackEnabled = 2050 kOperandTrackLayer = 2051 kOperandTrackWidth = 2052 kOperandTrackHeight = 2053 kOperandSpriteBoundsLeft = 3072 kOperandSpriteBoundsTop = 3073 kOperandSpriteBoundsRight = 3074 kOperandSpriteBoundsBottom = 3075 kOperandSpriteImageIndex = 3076 kOperandSpriteVisible = 3077 kOperandSpriteLayer = 3078 kOperandSpriteTrackVariable = 3079 kOperandSpriteTrackNumSprites = 3080 kOperandSpriteTrackNumImages = 3081 kOperandSpriteID = 3082 kOperandSpriteIndex = 3083 kOperandSpriteFirstCornerX = 3084 kOperandSpriteFirstCornerY = 3085 kOperandSpriteSecondCornerX = 3086 kOperandSpriteSecondCornerY = 3087 kOperandSpriteThirdCornerX = 3088 kOperandSpriteThirdCornerY = 3089 kOperandSpriteFourthCornerX = 3090 kOperandSpriteFourthCornerY = 3091 kOperandSpriteImageRegistrationPointX = 3092 kOperandSpriteImageRegistrationPointY = 3093 kOperandQTVRPanAngle = 4096 kOperandQTVRTiltAngle = 4097 kOperandQTVRFieldOfView = 4098 kOperandQTVRNodeID = 4099 kOperandMouseLocalHLoc = 5120 kOperandMouseLocalVLoc = 5121 kOperandKeyIsDown = 5122 kOperandRandom = 5123 kFirstMovieAction = kActionMovieSetVolume kLastMovieAction = kActionMovieRestartAtTime kFirstTrackAction = kActionTrackSetVolume kLastTrackAction = kActionTrackSetGraphicsMode kFirstSpriteAction = kActionSpriteSetMatrix kLastSpriteAction = kActionSpriteStretch kFirstQTVRAction = kActionQTVRSetPanAngle kLastQTVRAction = kActionQTVRGoToNodeID kFirstMusicAction = kActionMusicPlayNote kLastMusicAction = kActionMusicSetController kFirstSystemAction = kActionCase kLastSystemAction = kActionDoScript kFirstSpriteTrackAction = kActionSpriteTrackSetVariable kLastSpriteTrackAction = kActionSpriteTrackSetVariableToMovieBaseURL kFirstApplicationAction = kActionApplicationNumberAndString kLastApplicationAction = kActionApplicationNumberAndString kFirstQD3DNamedObjectAction = kActionQD3DNamedObjectTranslateTo kLastQD3DNamedObjectAction = kActionQD3DNamedObjectRotateTo kFirstFlashTrackAction = kActionFlashTrackSetPan kLastFlashTrackAction = kActionFlashTrackGotoFrameLabel kFirstMovieTrackAction = kActionMovieTrackAddChildMovie kLastMovieTrackAction = kActionMovieTrackLoadChildMovie kFirstAction = kFirstMovieAction kLastAction = kActionMovieTrackLoadChildMovie kTargetMovie = FOUR_CHAR_CODE('moov') kTargetMovieName = FOUR_CHAR_CODE('mona') kTargetMovieID = FOUR_CHAR_CODE('moid') kTargetRootMovie = FOUR_CHAR_CODE('moro') kTargetParentMovie = FOUR_CHAR_CODE('mopa') kTargetChildMovieTrackName = FOUR_CHAR_CODE('motn') kTargetChildMovieTrackID = FOUR_CHAR_CODE('moti') kTargetChildMovieTrackIndex = FOUR_CHAR_CODE('motx') kTargetChildMovieMovieName = FOUR_CHAR_CODE('momn') kTargetChildMovieMovieID = FOUR_CHAR_CODE('momi') kTargetTrackName = FOUR_CHAR_CODE('trna') kTargetTrackID = FOUR_CHAR_CODE('trid') kTargetTrackType = FOUR_CHAR_CODE('trty') kTargetTrackIndex = FOUR_CHAR_CODE('trin') kTargetSpriteName = FOUR_CHAR_CODE('spna') kTargetSpriteID = FOUR_CHAR_CODE('spid') kTargetSpriteIndex = FOUR_CHAR_CODE('spin') kTargetQD3DNamedObjectName = FOUR_CHAR_CODE('nana') kQTEventType = FOUR_CHAR_CODE('evnt') kAction = FOUR_CHAR_CODE('actn') kWhichAction = FOUR_CHAR_CODE('whic') kActionParameter = FOUR_CHAR_CODE('parm') kActionTarget = FOUR_CHAR_CODE('targ') kActionFlags = FOUR_CHAR_CODE('flag') kActionParameterMinValue = FOUR_CHAR_CODE('minv') kActionParameterMaxValue = FOUR_CHAR_CODE('maxv') kActionListAtomType = FOUR_CHAR_CODE('list') kExpressionContainerAtomType = FOUR_CHAR_CODE('expr') kConditionalAtomType = FOUR_CHAR_CODE('test') kOperatorAtomType = FOUR_CHAR_CODE('oper') kOperandAtomType = FOUR_CHAR_CODE('oprn') kCommentAtomType = FOUR_CHAR_CODE('why ') kCustomActionHandler = FOUR_CHAR_CODE('cust') kCustomHandlerID = FOUR_CHAR_CODE('id ') kCustomHandlerDesc = FOUR_CHAR_CODE('desc') kQTEventRecordAtomType = FOUR_CHAR_CODE('erec') kQTEventMouseClick = FOUR_CHAR_CODE('clik') kQTEventMouseClickEnd = FOUR_CHAR_CODE('cend') kQTEventMouseClickEndTriggerButton = FOUR_CHAR_CODE('trig') kQTEventMouseEnter = FOUR_CHAR_CODE('entr') kQTEventMouseExit = FOUR_CHAR_CODE('exit') kQTEventMouseMoved = FOUR_CHAR_CODE('move') kQTEventFrameLoaded = FOUR_CHAR_CODE('fram') kQTEventIdle = FOUR_CHAR_CODE('idle') kQTEventKey = FOUR_CHAR_CODE('key ') kQTEventMovieLoaded = FOUR_CHAR_CODE('load') kQTEventRequestToModifyMovie = FOUR_CHAR_CODE('reqm') kActionFlagActionIsDelta = 1L << 1 kActionFlagParameterWrapsAround = 1L << 2 kActionFlagActionIsToggle = 1L << 3 kStatusStringIsURLLink = 1L << 1 kStatusStringIsStreamingStatus = 1L << 2 kStatusHasCodeNumber = 1L << 3 kStatusIsError = 1L << 4 kScriptIsUnknownType = 1L << 0 kScriptIsJavaScript = 1L << 1 kScriptIsLingoEvent = 1L << 2 kScriptIsVBEvent = 1L << 3 kScriptIsProjectorCommand = 1L << 4 kQTRegistrationDialogTimeOutFlag = 1 << 0 kQTRegistrationDialogShowDialog = 1 << 1 kQTRegistrationDialogForceDialog = 1 << 2 kOperatorAdd = FOUR_CHAR_CODE('add ') kOperatorSubtract = FOUR_CHAR_CODE('sub ') kOperatorMultiply = FOUR_CHAR_CODE('mult') kOperatorDivide = FOUR_CHAR_CODE('div ') kOperatorOr = FOUR_CHAR_CODE('or ') kOperatorAnd = FOUR_CHAR_CODE('and ') kOperatorNot = FOUR_CHAR_CODE('not ') kOperatorLessThan = FOUR_CHAR_CODE('< ') kOperatorLessThanEqualTo = FOUR_CHAR_CODE('<= ') kOperatorEqualTo = FOUR_CHAR_CODE('= ') kOperatorNotEqualTo = FOUR_CHAR_CODE('!= ') kOperatorGreaterThan = FOUR_CHAR_CODE('> ') kOperatorGreaterThanEqualTo = FOUR_CHAR_CODE('>= ') kOperatorModulo = FOUR_CHAR_CODE('mod ') kOperatorIntegerDivide = FOUR_CHAR_CODE('idiv') kOperatorAbsoluteValue = FOUR_CHAR_CODE('abs ') kOperatorNegate = FOUR_CHAR_CODE('neg ') kPlatformMacintosh = 1 kPlatformWindows = 2 kMediaPropertyNonLinearAtomType = FOUR_CHAR_CODE('nonl') kMediaPropertyHasActions = 105 loopTimeBase = 1 palindromeLoopTimeBase = 2 maintainTimeBaseZero = 4 triggerTimeFwd = 0x0001 triggerTimeBwd = 0x0002 triggerTimeEither = 0x0003 triggerRateLT = 0x0004 triggerRateGT = 0x0008 triggerRateEqual = 0x0010 triggerRateLTE = triggerRateLT | triggerRateEqual triggerRateGTE = triggerRateGT | triggerRateEqual triggerRateNotEqual = triggerRateGT | triggerRateEqual | triggerRateLT triggerRateChange = 0 triggerAtStart = 0x0001 triggerAtStop = 0x0002 timeBaseBeforeStartTime = 1 timeBaseAfterStopTime = 2 callBackAtTime = 1 callBackAtRate = 2 callBackAtTimeJump = 3 callBackAtExtremes = 4 callBackAtTimeBaseDisposed = 5 callBackAtInterrupt = 0x8000 callBackAtDeferredTask = 0x4000 qtcbNeedsRateChanges = 1 qtcbNeedsTimeChanges = 2 qtcbNeedsStartStopChanges = 4 keepInRam = 1 << 0 unkeepInRam = 1 << 1 flushFromRam = 1 << 2 loadForwardTrackEdits = 1 << 3 loadBackwardTrackEdits = 1 << 4 newMovieActive = 1 << 0 newMovieDontResolveDataRefs = 1 << 1 newMovieDontAskUnresolvedDataRefs = 1 << 2 newMovieDontAutoAlternates = 1 << 3 newMovieDontUpdateForeBackPointers = 1 << 4 newMovieDontAutoUpdateClock = 1 << 5 newMovieAsyncOK = 1 << 8 newMovieIdleImportOK = 1 << 10 trackUsageInMovie = 1 << 1 trackUsageInPreview = 1 << 2 trackUsageInPoster = 1 << 3 mediaSampleNotSync = 1 << 0 mediaSampleShadowSync = 1 << 1 pasteInParallel = 1 << 0 showUserSettingsDialog = 1 << 1 movieToFileOnlyExport = 1 << 2 movieFileSpecValid = 1 << 3 nextTimeMediaSample = 1 << 0 nextTimeMediaEdit = 1 << 1 nextTimeTrackEdit = 1 << 2 nextTimeSyncSample = 1 << 3 nextTimeStep = 1 << 4 nextTimeEdgeOK = 1 << 14 nextTimeIgnoreActiveSegment = 1 << 15 createMovieFileDeleteCurFile = 1L << 31 createMovieFileDontCreateMovie = 1L << 30 createMovieFileDontOpenFile = 1L << 29 createMovieFileDontCreateResFile = 1L << 28 flattenAddMovieToDataFork = 1L << 0 flattenActiveTracksOnly = 1L << 2 flattenDontInterleaveFlatten = 1L << 3 flattenFSSpecPtrIsDataRefRecordPtr = 1L << 4 flattenCompressMovieResource = 1L << 5 flattenForceMovieResourceBeforeMovieData = 1L << 6 movieInDataForkResID = -1 mcTopLeftMovie = 1 << 0 mcScaleMovieToFit = 1 << 1 mcWithBadge = 1 << 2 mcNotVisible = 1 << 3 mcWithFrame = 1 << 4 movieScrapDontZeroScrap = 1 << 0 movieScrapOnlyPutMovie = 1 << 1 dataRefSelfReference = 1 << 0 dataRefWasNotResolved = 1 << 1 kMovieAnchorDataRefIsDefault = 1 << 0 hintsScrubMode = 1 << 0 hintsLoop = 1 << 1 hintsDontPurge = 1 << 2 hintsUseScreenBuffer = 1 << 5 hintsAllowInterlace = 1 << 6 hintsUseSoundInterp = 1 << 7 hintsHighQuality = 1 << 8 hintsPalindrome = 1 << 9 hintsInactive = 1 << 11 hintsOffscreen = 1 << 12 hintsDontDraw = 1 << 13 hintsAllowBlacklining = 1 << 14 hintsDontUseVideoOverlaySurface = 1 << 16 hintsIgnoreBandwidthRestrictions = 1 << 17 hintsPlayingEveryFrame = 1 << 18 hintsAllowDynamicResize = 1 << 19 hintsSingleField = 1 << 20 mediaHandlerFlagBaseClient = 1 movieTrackMediaType = 1 << 0 movieTrackCharacteristic = 1 << 1 movieTrackEnabledOnly = 1 << 2 movieDrawingCallWhenChanged = 0 movieDrawingCallAlways = 1 kGetMovieImporterValidateToFind = 1L << 0 kGetMovieImporterAllowNewFile = 1L << 1 kGetMovieImporterDontConsiderGraphicsImporters = 1L << 2 kGetMovieImporterDontConsiderFileOnlyImporters = 1L << 6 kMovieLoadStateError = -1L kMovieLoadStateLoading = 1000 kMovieLoadStatePlayable = 10000 kMovieLoadStateComplete = 100000L preloadAlways = 1L << 0 preloadOnlyIfEnabled = 1L << 1 fullScreenHideCursor = 1L << 0 fullScreenAllowEvents = 1L << 1 fullScreenDontChangeMenuBar = 1L << 2 fullScreenPreflightSize = 1L << 3 movieExecuteWiredActionDontExecute = 1L << 0 kBackgroundSpriteLayerNum = 32767 kSpritePropertyMatrix = 1 kSpritePropertyImageDescription = 2 kSpritePropertyImageDataPtr = 3 kSpritePropertyVisible = 4 kSpritePropertyLayer = 5 kSpritePropertyGraphicsMode = 6 kSpritePropertyImageDataSize = 7 kSpritePropertyActionHandlingSpriteID = 8 kSpritePropertyImageIndex = 100 kSpriteTrackPropertyBackgroundColor = 101 kSpriteTrackPropertyOffscreenBitDepth = 102 kSpriteTrackPropertySampleFormat = 103 kSpriteTrackPropertyScaleSpritesToScaleWorld = 104 kSpriteTrackPropertyHasActions = 105 kSpriteTrackPropertyVisible = 106 kSpriteTrackPropertyQTIdleEventsFrequency = 107 kSpriteImagePropertyRegistrationPoint = 1000 kSpriteImagePropertyGroupID = 1001 kNoQTIdleEvents = -1 kOnlyDrawToSpriteWorld = 1L << 0 kSpriteWorldPreflight = 1L << 1 kSpriteWorldDidDraw = 1L << 0 kSpriteWorldNeedsToDraw = 1L << 1 kKeyFrameAndSingleOverride = 1L << 1 kKeyFrameAndAllOverrides = 1L << 2 kScaleSpritesToScaleWorld = 1L << 1 kSpriteWorldHighQuality = 1L << 2 kSpriteWorldDontAutoInvalidate = 1L << 3 kSpriteWorldInvisible = 1L << 4 kParentAtomIsContainer = 0 kEffectNameAtom = FOUR_CHAR_CODE('name') kEffectTypeAtom = FOUR_CHAR_CODE('type') kEffectManufacturerAtom = FOUR_CHAR_CODE('manu') pdActionConfirmDialog = 1 pdActionSetAppleMenu = 2 pdActionSetEditMenu = 3 pdActionGetDialogValues = 4 pdActionSetPreviewUserItem = 5 pdActionSetPreviewPicture = 6 pdActionSetColorPickerEventProc = 7 pdActionSetDialogTitle = 8 pdActionGetSubPanelMenu = 9 pdActionActivateSubPanel = 10 pdActionConductStopAlert = 11 pdActionModelessCallback = 12 pdActionFetchPreview = 13 elOptionsIncludeNoneInList = 0x00000001 pdOptionsCollectOneValue = 0x00000001 pdOptionsAllowOptionalInterpolations = 0x00000002 pdOptionsModalDialogBox = 0x00000004 effectIsRealtime = 0 kAccessKeyAtomType = FOUR_CHAR_CODE('acky') kAccessKeySystemFlag = 1L << 0 ConnectionSpeedPrefsType = FOUR_CHAR_CODE('cspd') BandwidthManagementPrefsType = FOUR_CHAR_CODE('bwmg') kQTIdlePriority = 10 kQTNonRealTimePriority = 20 kQTRealTimeSharedPriority = 25 kQTRealTimePriority = 30 kQTBandwidthNotifyNeedToStop = 1L << 0 kQTBandwidthNotifyGoodToGo = 1L << 1 kQTBandwidthChangeRequest = 1L << 2 kQTBandwidthQueueRequest = 1L << 3 kQTBandwidthScheduledRequest = 1L << 4 kQTBandwidthVoluntaryRelease = 1L << 5 kITextRemoveEverythingBut = 0 << 1 kITextRemoveLeaveSuggestedAlternate = 1 << 1 kITextAtomType = FOUR_CHAR_CODE('itxt') kITextStringAtomType = FOUR_CHAR_CODE('text') kQTParseTextHREFText = FOUR_CHAR_CODE('text') kQTParseTextHREFBaseURL = FOUR_CHAR_CODE('burl') kQTParseTextHREFClickPoint = FOUR_CHAR_CODE('clik') kQTParseTextHREFUseAltDelim = FOUR_CHAR_CODE('altd') kQTParseTextHREFDelimiter = FOUR_CHAR_CODE('delm') kQTParseTextHREFRecomposeHREF = FOUR_CHAR_CODE('rhrf') kQTParseTextHREFURL = FOUR_CHAR_CODE('url ') kQTParseTextHREFTarget = FOUR_CHAR_CODE('targ') kQTParseTextHREFIsAutoHREF = FOUR_CHAR_CODE('auto') kQTParseTextHREFIsServerMap = FOUR_CHAR_CODE('smap') kQTParseTextHREFHREF = FOUR_CHAR_CODE('href') kTrackReferenceChapterList = FOUR_CHAR_CODE('chap') kTrackReferenceTimeCode = FOUR_CHAR_CODE('tmcd') kTrackReferenceModifier = FOUR_CHAR_CODE('ssrc') kTrackModifierInput = 0x696E kTrackModifierType = 0x7479 kTrackModifierReference = FOUR_CHAR_CODE('ssrc') kTrackModifierObjectID = FOUR_CHAR_CODE('obid') kTrackModifierInputName = FOUR_CHAR_CODE('name') kInputMapSubInputID = FOUR_CHAR_CODE('subi') kTrackModifierTypeMatrix = 1 kTrackModifierTypeClip = 2 kTrackModifierTypeGraphicsMode = 5 kTrackModifierTypeVolume = 3 kTrackModifierTypeBalance = 4 kTrackModifierTypeImage = FOUR_CHAR_CODE('vide') kTrackModifierObjectMatrix = 6 kTrackModifierObjectGraphicsMode = 7 kTrackModifierType3d4x4Matrix = 8 kTrackModifierCameraData = 9 kTrackModifierSoundLocalizationData = 10 kTrackModifierObjectImageIndex = 11 kTrackModifierObjectLayer = 12 kTrackModifierObjectVisible = 13 kTrackModifierAngleAspectCamera = 14 kTrackModifierPanAngle = FOUR_CHAR_CODE('pan ') kTrackModifierTiltAngle = FOUR_CHAR_CODE('tilt') kTrackModifierVerticalFieldOfViewAngle = FOUR_CHAR_CODE('fov ') kTrackModifierObjectQTEventSend = FOUR_CHAR_CODE('evnt') kTweenTypeShort = 1 kTweenTypeLong = 2 kTweenTypeFixed = 3 kTweenTypePoint = 4 kTweenTypeQDRect = 5 kTweenTypeQDRegion = 6 kTweenTypeMatrix = 7 kTweenTypeRGBColor = 8 kTweenTypeGraphicsModeWithRGBColor = 9 kTweenTypeQTFloatSingle = 10 kTweenTypeQTFloatDouble = 11 kTweenTypeFixedPoint = 12 kTweenType3dScale = FOUR_CHAR_CODE('3sca') kTweenType3dTranslate = FOUR_CHAR_CODE('3tra') kTweenType3dRotate = FOUR_CHAR_CODE('3rot') kTweenType3dRotateAboutPoint = FOUR_CHAR_CODE('3rap') kTweenType3dRotateAboutAxis = FOUR_CHAR_CODE('3rax') kTweenType3dRotateAboutVector = FOUR_CHAR_CODE('3rvc') kTweenType3dQuaternion = FOUR_CHAR_CODE('3qua') kTweenType3dMatrix = FOUR_CHAR_CODE('3mat') kTweenType3dCameraData = FOUR_CHAR_CODE('3cam') kTweenType3dAngleAspectCameraData = FOUR_CHAR_CODE('3caa') kTweenType3dSoundLocalizationData = FOUR_CHAR_CODE('3slc') kTweenTypePathToMatrixTranslation = FOUR_CHAR_CODE('gxmt') kTweenTypePathToMatrixRotation = FOUR_CHAR_CODE('gxpr') kTweenTypePathToMatrixTranslationAndRotation = FOUR_CHAR_CODE('gxmr') kTweenTypePathToFixedPoint = FOUR_CHAR_CODE('gxfp') kTweenTypePathXtoY = FOUR_CHAR_CODE('gxxy') kTweenTypePathYtoX = FOUR_CHAR_CODE('gxyx') kTweenTypeAtomList = FOUR_CHAR_CODE('atom') kTweenTypePolygon = FOUR_CHAR_CODE('poly') kTweenTypeMultiMatrix = FOUR_CHAR_CODE('mulm') kTweenTypeSpin = FOUR_CHAR_CODE('spin') kTweenType3dMatrixNonLinear = FOUR_CHAR_CODE('3nlr') kTweenType3dVRObject = FOUR_CHAR_CODE('3vro') kTweenEntry = FOUR_CHAR_CODE('twen') kTweenData = FOUR_CHAR_CODE('data') kTweenType = FOUR_CHAR_CODE('twnt') kTweenStartOffset = FOUR_CHAR_CODE('twst') kTweenDuration = FOUR_CHAR_CODE('twdu') kTweenFlags = FOUR_CHAR_CODE('flag') kTweenOutputMin = FOUR_CHAR_CODE('omin') kTweenOutputMax = FOUR_CHAR_CODE('omax') kTweenSequenceElement = FOUR_CHAR_CODE('seqe') kTween3dInitialCondition = FOUR_CHAR_CODE('icnd') kTweenInterpolationID = FOUR_CHAR_CODE('intr') kTweenRegionData = FOUR_CHAR_CODE('qdrg') kTweenPictureData = FOUR_CHAR_CODE('PICT') kListElementType = FOUR_CHAR_CODE('type') kListElementDataType = FOUR_CHAR_CODE('daty') kNameAtom = FOUR_CHAR_CODE('name') kInitialRotationAtom = FOUR_CHAR_CODE('inro') kNonLinearTweenHeader = FOUR_CHAR_CODE('nlth') kTweenReturnDelta = 1L << 0 videoFlagDontLeanAhead = 1L << 0 txtProcDefaultDisplay = 0 txtProcDontDisplay = 1 txtProcDoDisplay = 2 findTextEdgeOK = 1 << 0 findTextCaseSensitive = 1 << 1 findTextReverseSearch = 1 << 2 findTextWrapAround = 1 << 3 findTextUseOffset = 1 << 4 dropShadowOffsetType = FOUR_CHAR_CODE('drpo') dropShadowTranslucencyType = FOUR_CHAR_CODE('drpt') spriteHitTestBounds = 1L << 0 spriteHitTestImage = 1L << 1 spriteHitTestInvisibleSprites = 1L << 2 spriteHitTestIsClick = 1L << 3 spriteHitTestLocInDisplayCoordinates = 1L << 4 kSpriteAtomType = FOUR_CHAR_CODE('sprt') kSpriteImagesContainerAtomType = FOUR_CHAR_CODE('imct') kSpriteImageAtomType = FOUR_CHAR_CODE('imag') kSpriteImageDataAtomType = FOUR_CHAR_CODE('imda') kSpriteImageDataRefAtomType = FOUR_CHAR_CODE('imre') kSpriteImageDataRefTypeAtomType = FOUR_CHAR_CODE('imrt') kSpriteImageGroupIDAtomType = FOUR_CHAR_CODE('imgr') kSpriteImageRegistrationAtomType = FOUR_CHAR_CODE('imrg') kSpriteImageDefaultImageIndexAtomType = FOUR_CHAR_CODE('defi') kSpriteSharedDataAtomType = FOUR_CHAR_CODE('dflt') kSpriteNameAtomType = FOUR_CHAR_CODE('name') kSpriteImageNameAtomType = FOUR_CHAR_CODE('name') kSpriteUsesImageIDsAtomType = FOUR_CHAR_CODE('uses') kSpriteBehaviorsAtomType = FOUR_CHAR_CODE('beha') kSpriteImageBehaviorAtomType = FOUR_CHAR_CODE('imag') kSpriteCursorBehaviorAtomType = FOUR_CHAR_CODE('crsr') kSpriteStatusStringsBehaviorAtomType = FOUR_CHAR_CODE('sstr') kSpriteVariablesContainerAtomType = FOUR_CHAR_CODE('vars') kSpriteStringVariableAtomType = FOUR_CHAR_CODE('strv') kSpriteFloatingPointVariableAtomType = FOUR_CHAR_CODE('flov') kMovieMediaDataReference = FOUR_CHAR_CODE('mmdr') kMovieMediaDefaultDataReferenceID = FOUR_CHAR_CODE('ddri') kMovieMediaSlaveTime = FOUR_CHAR_CODE('slti') kMovieMediaSlaveAudio = FOUR_CHAR_CODE('slau') kMovieMediaSlaveGraphicsMode = FOUR_CHAR_CODE('slgr') kMovieMediaAutoPlay = FOUR_CHAR_CODE('play') kMovieMediaLoop = FOUR_CHAR_CODE('loop') kMovieMediaUseMIMEType = FOUR_CHAR_CODE('mime') kMovieMediaTitle = FOUR_CHAR_CODE('titl') kMovieMediaAltText = FOUR_CHAR_CODE('altt') kMovieMediaClipBegin = FOUR_CHAR_CODE('clpb') kMovieMediaClipDuration = FOUR_CHAR_CODE('clpd') kMovieMediaRegionAtom = FOUR_CHAR_CODE('regi') kMovieMediaSlaveTrackDuration = FOUR_CHAR_CODE('sltr') kMovieMediaEnableFrameStepping = FOUR_CHAR_CODE('enfs') kMovieMediaBackgroundColor = FOUR_CHAR_CODE('bkcl') kMovieMediaFitNone = 0 kMovieMediaFitScroll = FOUR_CHAR_CODE('scro') kMovieMediaFitClipIfNecessary = FOUR_CHAR_CODE('hidd') kMovieMediaFitFill = FOUR_CHAR_CODE('fill') kMovieMediaFitMeet = FOUR_CHAR_CODE('meet') kMovieMediaFitSlice = FOUR_CHAR_CODE('slic') kMovieMediaSpatialAdjustment = FOUR_CHAR_CODE('fit ') kMovieMediaRectangleAtom = FOUR_CHAR_CODE('rect') kMovieMediaTop = FOUR_CHAR_CODE('top ') kMovieMediaLeft = FOUR_CHAR_CODE('left') kMovieMediaWidth = FOUR_CHAR_CODE('wd ') kMovieMediaHeight = FOUR_CHAR_CODE('ht ') kMoviePropertyDuration = FOUR_CHAR_CODE('dura') kMoviePropertyTimeScale = FOUR_CHAR_CODE('tims') kMoviePropertyTime = FOUR_CHAR_CODE('timv') kMoviePropertyNaturalBounds = FOUR_CHAR_CODE('natb') kMoviePropertyMatrix = FOUR_CHAR_CODE('mtrx') kMoviePropertyTrackList = FOUR_CHAR_CODE('tlst') kTrackPropertyMediaType = FOUR_CHAR_CODE('mtyp') kTrackPropertyInstantiation = FOUR_CHAR_CODE('inst') MovieControllerComponentType = FOUR_CHAR_CODE('play') kMovieControllerQTVRFlag = 1 << 0 kMovieControllerDontDisplayToUser = 1 << 1 mcActionIdle = 1 mcActionDraw = 2 mcActionActivate = 3 mcActionDeactivate = 4 mcActionMouseDown = 5 mcActionKey = 6 mcActionPlay = 8 mcActionGoToTime = 12 mcActionSetVolume = 14 mcActionGetVolume = 15 mcActionStep = 18 mcActionSetLooping = 21 mcActionGetLooping = 22 mcActionSetLoopIsPalindrome = 23 mcActionGetLoopIsPalindrome = 24 mcActionSetGrowBoxBounds = 25 mcActionControllerSizeChanged = 26 mcActionSetSelectionBegin = 29 mcActionSetSelectionDuration = 30 mcActionSetKeysEnabled = 32 mcActionGetKeysEnabled = 33 mcActionSetPlaySelection = 34 mcActionGetPlaySelection = 35 mcActionSetUseBadge = 36 mcActionGetUseBadge = 37 mcActionSetFlags = 38 mcActionGetFlags = 39 mcActionSetPlayEveryFrame = 40 mcActionGetPlayEveryFrame = 41 mcActionGetPlayRate = 42 mcActionShowBalloon = 43 mcActionBadgeClick = 44 mcActionMovieClick = 45 mcActionSuspend = 46 mcActionResume = 47 mcActionSetControllerKeysEnabled = 48 mcActionGetTimeSliderRect = 49 mcActionMovieEdited = 50 mcActionGetDragEnabled = 51 mcActionSetDragEnabled = 52 mcActionGetSelectionBegin = 53 mcActionGetSelectionDuration = 54 mcActionPrerollAndPlay = 55 mcActionGetCursorSettingEnabled = 56 mcActionSetCursorSettingEnabled = 57 mcActionSetColorTable = 58 mcActionLinkToURL = 59 mcActionCustomButtonClick = 60 mcActionForceTimeTableUpdate = 61 mcActionSetControllerTimeLimits = 62 mcActionExecuteAllActionsForQTEvent = 63 mcActionExecuteOneActionForQTEvent = 64 mcActionAdjustCursor = 65 mcActionUseTrackForTimeTable = 66 mcActionClickAndHoldPoint = 67 mcActionShowMessageString = 68 mcActionShowStatusString = 69 mcActionGetExternalMovie = 70 mcActionGetChapterTime = 71 mcActionPerformActionList = 72 mcActionEvaluateExpression = 73 mcActionFetchParameterAs = 74 mcActionGetCursorByID = 75 mcActionGetNextURL = 76 mcActionMovieChanged = 77 mcActionDoScript = 78 mcActionRestartAtTime = 79 mcActionGetIndChapter = 80 mcActionLinkToURLExtended = 81 mcFlagSuppressMovieFrame = 1 << 0 mcFlagSuppressStepButtons = 1 << 1 mcFlagSuppressSpeakerButton = 1 << 2 mcFlagsUseWindowPalette = 1 << 3 mcFlagsDontInvalidate = 1 << 4 mcFlagsUseCustomButton = 1 << 5 mcPositionDontInvalidate = 1 << 5 kMCIEEnabledButtonPicture = 1 kMCIEDisabledButtonPicture = 2 kMCIEDepressedButtonPicture = 3 kMCIEEnabledSizeBoxPicture = 4 kMCIEDisabledSizeBoxPicture = 5 kMCIEEnabledUnavailableButtonPicture = 6 kMCIEDisabledUnavailableButtonPicture = 7 kMCIESoundSlider = 128 kMCIESoundThumb = 129 kMCIEColorTable = 256 kMCIEIsFlatAppearance = 257 kMCIEDoButtonIconsDropOnDepress = 258 mcInfoUndoAvailable = 1 << 0 mcInfoCutAvailable = 1 << 1 mcInfoCopyAvailable = 1 << 2 mcInfoPasteAvailable = 1 << 3 mcInfoClearAvailable = 1 << 4 mcInfoHasSound = 1 << 5 mcInfoIsPlaying = 1 << 6 mcInfoIsLooping = 1 << 7 mcInfoIsInPalindrome = 1 << 8 mcInfoEditingEnabled = 1 << 9 mcInfoMovieIsInteractive = 1 << 10 mcMenuUndo = 1 mcMenuCut = 3 mcMenuCopy = 4 mcMenuPaste = 5 mcMenuClear = 6 kFetchAsBooleanPtr = 1 kFetchAsShortPtr = 2 kFetchAsLongPtr = 3 kFetchAsMatrixRecordPtr = 4 kFetchAsModifierTrackGraphicsModeRecord = 5 kFetchAsHandle = 6 kFetchAsStr255 = 7 kFetchAsFloatPtr = 8 kFetchAsPointPtr = 9 kFetchAsNewAtomContainer = 10 kFetchAsQTEventRecordPtr = 11 kFetchAsFixedPtr = 12 kFetchAsSetControllerValuePtr = 13 kFetchAsRgnHandle = 14 kFetchAsComponentDescriptionPtr = 15 kFetchAsCString = 16 kQTCursorOpenHand = -19183 kQTCursorClosedHand = -19182 kQTCursorPointingHand = -19181 kQTCursorRightArrow = -19180 kQTCursorLeftArrow = -19179 kQTCursorDownArrow = -19178 kQTCursorUpArrow = -19177 kQTCursorIBeam = -19176 kVideoMediaResetStatisticsSelect = 0x0105 kVideoMediaGetStatisticsSelect = 0x0106 kVideoMediaGetStallCountSelect = 0x010E kVideoMediaSetCodecParameterSelect = 0x010F kVideoMediaGetCodecParameterSelect = 0x0110 kTextMediaSetTextProcSelect = 0x0101 kTextMediaAddTextSampleSelect = 0x0102 kTextMediaAddTESampleSelect = 0x0103 kTextMediaAddHiliteSampleSelect = 0x0104 kTextMediaDrawRawSelect = 0x0109 kTextMediaSetTextPropertySelect = 0x010A kTextMediaRawSetupSelect = 0x010B kTextMediaRawIdleSelect = 0x010C kTextMediaFindNextTextSelect = 0x0105 kTextMediaHiliteTextSampleSelect = 0x0106 kTextMediaSetTextSampleDataSelect = 0x0107 kSpriteMediaSetPropertySelect = 0x0101 kSpriteMediaGetPropertySelect = 0x0102 kSpriteMediaHitTestSpritesSelect = 0x0103 kSpriteMediaCountSpritesSelect = 0x0104 kSpriteMediaCountImagesSelect = 0x0105 kSpriteMediaGetIndImageDescriptionSelect = 0x0106 kSpriteMediaGetDisplayedSampleNumberSelect = 0x0107 kSpriteMediaGetSpriteNameSelect = 0x0108 kSpriteMediaGetImageNameSelect = 0x0109 kSpriteMediaSetSpritePropertySelect = 0x010A kSpriteMediaGetSpritePropertySelect = 0x010B kSpriteMediaHitTestAllSpritesSelect = 0x010C kSpriteMediaHitTestOneSpriteSelect = 0x010D kSpriteMediaSpriteIndexToIDSelect = 0x010E kSpriteMediaSpriteIDToIndexSelect = 0x010F kSpriteMediaGetSpriteActionsForQTEventSelect = 0x0110 kSpriteMediaSetActionVariableSelect = 0x0111 kSpriteMediaGetActionVariableSelect = 0x0112 kSpriteMediaGetIndImagePropertySelect = 0x0113 kSpriteMediaNewSpriteSelect = 0x0114 kSpriteMediaDisposeSpriteSelect = 0x0115 kSpriteMediaSetActionVariableToStringSelect = 0x0116 kSpriteMediaGetActionVariableAsStringSelect = 0x0117 kFlashMediaSetPanSelect = 0x0101 kFlashMediaSetZoomSelect = 0x0102 kFlashMediaSetZoomRectSelect = 0x0103 kFlashMediaGetRefConBoundsSelect = 0x0104 kFlashMediaGetRefConIDSelect = 0x0105 kFlashMediaIDToRefConSelect = 0x0106 kFlashMediaGetDisplayedFrameNumberSelect = 0x0107 kFlashMediaFrameNumberToMovieTimeSelect = 0x0108 kFlashMediaFrameLabelToMovieTimeSelect = 0x0109 kMovieMediaGetChildDoMCActionCallbackSelect = 0x0102 kMovieMediaGetDoMCActionCallbackSelect = 0x0103 kMovieMediaGetCurrentMoviePropertySelect = 0x0104 kMovieMediaGetCurrentTrackPropertySelect = 0x0105 kMovieMediaGetChildMovieDataReferenceSelect = 0x0106 kMovieMediaSetChildMovieDataReferenceSelect = 0x0107 kMovieMediaLoadChildMovieFromDataReferenceSelect = 0x0108 kMedia3DGetNamedObjectListSelect = 0x0101 kMedia3DGetRendererListSelect = 0x0102 kMedia3DGetCurrentGroupSelect = 0x0103 kMedia3DTranslateNamedObjectToSelect = 0x0104 kMedia3DScaleNamedObjectToSelect = 0x0105 kMedia3DRotateNamedObjectToSelect = 0x0106 kMedia3DSetCameraDataSelect = 0x0107 kMedia3DGetCameraDataSelect = 0x0108 kMedia3DSetCameraAngleAspectSelect = 0x0109 kMedia3DGetCameraAngleAspectSelect = 0x010A kMedia3DSetCameraRangeSelect = 0x010D kMedia3DGetCameraRangeSelect = 0x010E kMedia3DGetViewObjectSelect = 0x010F kMCSetMovieSelect = 0x0002 kMCGetIndMovieSelect = 0x0005 kMCRemoveAllMoviesSelect = 0x0006 kMCRemoveAMovieSelect = 0x0003 kMCRemoveMovieSelect = 0x0006 kMCIsPlayerEventSelect = 0x0007 kMCSetActionFilterSelect = 0x0008 kMCDoActionSelect = 0x0009 kMCSetControllerAttachedSelect = 0x000A kMCIsControllerAttachedSelect = 0x000B kMCSetControllerPortSelect = 0x000C kMCGetControllerPortSelect = 0x000D kMCSetVisibleSelect = 0x000E kMCGetVisibleSelect = 0x000F kMCGetControllerBoundsRectSelect = 0x0010 kMCSetControllerBoundsRectSelect = 0x0011 kMCGetControllerBoundsRgnSelect = 0x0012 kMCGetWindowRgnSelect = 0x0013 kMCMovieChangedSelect = 0x0014 kMCSetDurationSelect = 0x0015 kMCGetCurrentTimeSelect = 0x0016 kMCNewAttachedControllerSelect = 0x0017 kMCDrawSelect = 0x0018 kMCActivateSelect = 0x0019 kMCIdleSelect = 0x001A kMCKeySelect = 0x001B kMCClickSelect = 0x001C kMCEnableEditingSelect = 0x001D kMCIsEditingEnabledSelect = 0x001E kMCCopySelect = 0x001F kMCCutSelect = 0x0020 kMCPasteSelect = 0x0021 kMCClearSelect = 0x0022 kMCUndoSelect = 0x0023 kMCPositionControllerSelect = 0x0024 kMCGetControllerInfoSelect = 0x0025 kMCSetClipSelect = 0x0028 kMCGetClipSelect = 0x0029 kMCDrawBadgeSelect = 0x002A kMCSetUpEditMenuSelect = 0x002B kMCGetMenuStringSelect = 0x002C kMCSetActionFilterWithRefConSelect = 0x002D kMCPtInControllerSelect = 0x002E kMCInvalidateSelect = 0x002F kMCAdjustCursorSelect = 0x0030 kMCGetInterfaceElementSelect = 0x0031 kMCGetDoActionsProcSelect = 0x0032 kMusicMediaGetIndexedTunePlayerSelect = 0x0101 From jackjansen@users.sourceforge.net Sun Aug 19 23:12:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:12:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Resources.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv25170/Python/Mac/Lib/Carbon Added Files: Resources.py Log Message: The modules with toolbox constants. --- NEW FILE: Resources.py --- # Generated from 'Resources.h' resSysHeap = 64 resPurgeable = 32 resLocked = 16 resProtected = 8 resPreload = 4 resChanged = 2 mapReadOnly = 128 mapCompact = 64 mapChanged = 32 resSysRefBit = 7 resSysHeapBit = 6 resPurgeableBit = 5 resLockedBit = 4 resProtectedBit = 3 resPreloadBit = 2 resChangedBit = 1 mapReadOnlyBit = 7 mapCompactBit = 6 mapChangedBit = 5 kResFileNotOpened = -1 kSystemResFile = 0 kRsrcChainBelowSystemMap = 0 kRsrcChainBelowApplicationMap = 1 kRsrcChainAboveApplicationMap = 2 kRsrcChainAboveAllMaps = 4 From jackjansen@users.sourceforge.net Sun Aug 19 23:18:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:18:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Components.py,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26463/Python/Mac/Lib/lib-toolbox Removed Files: Components.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Components.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:19:41 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox MacTextEditor.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26835/Python/Mac/Lib/lib-toolbox Removed Files: MacTextEditor.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- MacTextEditor.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:12:52 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:12:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Sound.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv25209/Python/Mac/Lib/Carbon Added Files: Sound.py Log Message: The modules with toolbox constants. --- NEW FILE: Sound.py --- # Generated from 'Sound.h' def FOUR_CHAR_CODE(x): return x soundListRsrc = FOUR_CHAR_CODE('snd ') kSimpleBeepID = 1 # rate48khz = (long)0xBB800000 # rate44khz = (long)0xAC440000 rate32khz = 0x7D000000 rate22050hz = 0x56220000 rate22khz = 0x56EE8BA3 rate16khz = 0x3E800000 rate11khz = 0x2B7745D1 rate11025hz = 0x2B110000 rate8khz = 0x1F400000 sampledSynth = 5 squareWaveSynth = 1 waveTableSynth = 3 MACE3snthID = 11 MACE6snthID = 13 kMiddleC = 60 kNoVolume = 0 kFullVolume = 0x0100 stdQLength = 128 dataOffsetFlag = 0x8000 kUseOptionalOutputDevice = -1 notCompressed = 0 fixedCompression = -1 variableCompression = -2 twoToOne = 1 eightToThree = 2 threeToOne = 3 sixToOne = 4 sixToOnePacketSize = 8 threeToOnePacketSize = 16 stateBlockSize = 64 leftOverBlockSize = 32 firstSoundFormat = 0x0001 secondSoundFormat = 0x0002 dbBufferReady = 0x00000001 dbLastBuffer = 0x00000004 sysBeepDisable = 0x0000 sysBeepEnable = (1 << 0) sysBeepSynchronous = (1 << 1) unitTypeNoSelection = 0xFFFF unitTypeSeconds = 0x0000 stdSH = 0x00 extSH = 0xFF cmpSH = 0xFE nullCmd = 0 quietCmd = 3 flushCmd = 4 reInitCmd = 5 waitCmd = 10 pauseCmd = 11 resumeCmd = 12 callBackCmd = 13 syncCmd = 14 availableCmd = 24 versionCmd = 25 volumeCmd = 46 getVolumeCmd = 47 clockComponentCmd = 50 getClockComponentCmd = 51 scheduledSoundCmd = 52 linkSoundComponentsCmd = 53 soundCmd = 80 bufferCmd = 81 rateMultiplierCmd = 86 getRateMultiplierCmd = 87 initCmd = 1 freeCmd = 2 totalLoadCmd = 26 loadCmd = 27 freqDurationCmd = 40 restCmd = 41 freqCmd = 42 ampCmd = 43 timbreCmd = 44 getAmpCmd = 45 waveTableCmd = 60 phaseCmd = 61 rateCmd = 82 continueCmd = 83 doubleBufferCmd = 84 getRateCmd = 85 sizeCmd = 90 convertCmd = 91 waveInitChannelMask = 0x07 waveInitChannel0 = 0x04 waveInitChannel1 = 0x05 waveInitChannel2 = 0x06 waveInitChannel3 = 0x07 initChan0 = waveInitChannel0 initChan1 = waveInitChannel1 initChan2 = waveInitChannel2 initChan3 = waveInitChannel3 outsideCmpSH = 0 insideCmpSH = 1 aceSuccess = 0 aceMemFull = 1 aceNilBlock = 2 aceBadComp = 3 aceBadEncode = 4 aceBadDest = 5 aceBadCmd = 6 initChanLeft = 0x0002 initChanRight = 0x0003 initNoInterp = 0x0004 initNoDrop = 0x0008 initMono = 0x0080 initStereo = 0x00C0 initMACE3 = 0x0300 initMACE6 = 0x0400 initPanMask = 0x0003 initSRateMask = 0x0030 initStereoMask = 0x00C0 initCompMask = 0xFF00 siActiveChannels = FOUR_CHAR_CODE('chac') siActiveLevels = FOUR_CHAR_CODE('lmac') siAGCOnOff = FOUR_CHAR_CODE('agc ') siAsync = FOUR_CHAR_CODE('asyn') siAVDisplayBehavior = FOUR_CHAR_CODE('avdb') siChannelAvailable = FOUR_CHAR_CODE('chav') siCompressionAvailable = FOUR_CHAR_CODE('cmav') siCompressionChannels = FOUR_CHAR_CODE('cpct') siCompressionFactor = FOUR_CHAR_CODE('cmfa') siCompressionHeader = FOUR_CHAR_CODE('cmhd') siCompressionNames = FOUR_CHAR_CODE('cnam') siCompressionParams = FOUR_CHAR_CODE('evaw') siCompressionSampleRate = FOUR_CHAR_CODE('cprt') siCompressionType = FOUR_CHAR_CODE('comp') siContinuous = FOUR_CHAR_CODE('cont') siDecompressionParams = FOUR_CHAR_CODE('wave') siDeviceBufferInfo = FOUR_CHAR_CODE('dbin') siDeviceConnected = FOUR_CHAR_CODE('dcon') siDeviceIcon = FOUR_CHAR_CODE('icon') siDeviceName = FOUR_CHAR_CODE('name') siEQSpectrumBands = FOUR_CHAR_CODE('eqsb') siEQSpectrumLevels = FOUR_CHAR_CODE('eqlv') siEQSpectrumOnOff = FOUR_CHAR_CODE('eqlo') siEQToneControlGain = FOUR_CHAR_CODE('eqtg') siEQToneControlOnOff = FOUR_CHAR_CODE('eqtc') siHardwareBalance = FOUR_CHAR_CODE('hbal') siHardwareBalanceSteps = FOUR_CHAR_CODE('hbls') siHardwareBass = FOUR_CHAR_CODE('hbas') siHardwareBassSteps = FOUR_CHAR_CODE('hbst') siHardwareBusy = FOUR_CHAR_CODE('hwbs') siHardwareFormat = FOUR_CHAR_CODE('hwfm') siHardwareMute = FOUR_CHAR_CODE('hmut') siHardwareMuteNoPrefs = FOUR_CHAR_CODE('hmnp') siHardwareTreble = FOUR_CHAR_CODE('htrb') siHardwareTrebleSteps = FOUR_CHAR_CODE('hwts') siHardwareVolume = FOUR_CHAR_CODE('hvol') siHardwareVolumeSteps = FOUR_CHAR_CODE('hstp') siHeadphoneMute = FOUR_CHAR_CODE('pmut') siHeadphoneVolume = FOUR_CHAR_CODE('pvol') siHeadphoneVolumeSteps = FOUR_CHAR_CODE('hdst') siInputAvailable = FOUR_CHAR_CODE('inav') siInputGain = FOUR_CHAR_CODE('gain') siInputSource = FOUR_CHAR_CODE('sour') siInputSourceNames = FOUR_CHAR_CODE('snam') siLevelMeterOnOff = FOUR_CHAR_CODE('lmet') siModemGain = FOUR_CHAR_CODE('mgai') siMonitorAvailable = FOUR_CHAR_CODE('mnav') siMonitorSource = FOUR_CHAR_CODE('mons') siNumberChannels = FOUR_CHAR_CODE('chan') siOptionsDialog = FOUR_CHAR_CODE('optd') siOSTypeInputSource = FOUR_CHAR_CODE('inpt') siOSTypeInputAvailable = FOUR_CHAR_CODE('inav') siOutputDeviceName = FOUR_CHAR_CODE('onam') siPlayThruOnOff = FOUR_CHAR_CODE('plth') siPostMixerSoundComponent = FOUR_CHAR_CODE('psmx') siPreMixerSoundComponent = FOUR_CHAR_CODE('prmx') siQuality = FOUR_CHAR_CODE('qual') siRateMultiplier = FOUR_CHAR_CODE('rmul') siRecordingQuality = FOUR_CHAR_CODE('qual') siSampleRate = FOUR_CHAR_CODE('srat') siSampleRateAvailable = FOUR_CHAR_CODE('srav') siSampleSize = FOUR_CHAR_CODE('ssiz') siSampleSizeAvailable = FOUR_CHAR_CODE('ssav') siSetupCDAudio = FOUR_CHAR_CODE('sucd') siSetupModemAudio = FOUR_CHAR_CODE('sumd') siSlopeAndIntercept = FOUR_CHAR_CODE('flap') siSoundClock = FOUR_CHAR_CODE('sclk') siUseThisSoundClock = FOUR_CHAR_CODE('sclc') siSpeakerMute = FOUR_CHAR_CODE('smut') siSpeakerVolume = FOUR_CHAR_CODE('svol') siSSpCPULoadLimit = FOUR_CHAR_CODE('3dll') siSSpLocalization = FOUR_CHAR_CODE('3dif') siSSpSpeakerSetup = FOUR_CHAR_CODE('3dst') siStereoInputGain = FOUR_CHAR_CODE('sgai') siSubwooferMute = FOUR_CHAR_CODE('bmut') siTwosComplementOnOff = FOUR_CHAR_CODE('twos') siVolume = FOUR_CHAR_CODE('volu') siVoxRecordInfo = FOUR_CHAR_CODE('voxr') siVoxStopInfo = FOUR_CHAR_CODE('voxs') siWideStereo = FOUR_CHAR_CODE('wide') siSupportedExtendedFlags = FOUR_CHAR_CODE('exfl') siCloseDriver = FOUR_CHAR_CODE('clos') siInitializeDriver = FOUR_CHAR_CODE('init') siPauseRecording = FOUR_CHAR_CODE('paus') siUserInterruptProc = FOUR_CHAR_CODE('user') # kInvalidSource = (long)0xFFFFFFFF kNoSource = FOUR_CHAR_CODE('none') kCDSource = FOUR_CHAR_CODE('cd ') kExtMicSource = FOUR_CHAR_CODE('emic') kSoundInSource = FOUR_CHAR_CODE('sinj') kRCAInSource = FOUR_CHAR_CODE('irca') kTVFMTunerSource = FOUR_CHAR_CODE('tvfm') kDAVInSource = FOUR_CHAR_CODE('idav') kIntMicSource = FOUR_CHAR_CODE('imic') kMediaBaySource = FOUR_CHAR_CODE('mbay') kModemSource = FOUR_CHAR_CODE('modm') kPCCardSource = FOUR_CHAR_CODE('pcm ') kZoomVideoSource = FOUR_CHAR_CODE('zvpc') kDVDSource = FOUR_CHAR_CODE('dvda') kNoSoundComponentType = FOUR_CHAR_CODE('****') kSoundComponentType = FOUR_CHAR_CODE('sift') kSoundComponentPPCType = FOUR_CHAR_CODE('nift') kRate8SubType = FOUR_CHAR_CODE('ratb') kRate16SubType = FOUR_CHAR_CODE('ratw') kConverterSubType = FOUR_CHAR_CODE('conv') kSndSourceSubType = FOUR_CHAR_CODE('sour') kMixerType = FOUR_CHAR_CODE('mixr') kMixer8SubType = FOUR_CHAR_CODE('mixb') kMixer16SubType = FOUR_CHAR_CODE('mixw') kSoundInputDeviceType = FOUR_CHAR_CODE('sinp') kWaveInSubType = FOUR_CHAR_CODE('wavi') kWaveInSnifferSubType = FOUR_CHAR_CODE('wisn') kSoundOutputDeviceType = FOUR_CHAR_CODE('sdev') kClassicSubType = FOUR_CHAR_CODE('clas') kASCSubType = FOUR_CHAR_CODE('asc ') kDSPSubType = FOUR_CHAR_CODE('dsp ') kAwacsSubType = FOUR_CHAR_CODE('awac') kGCAwacsSubType = FOUR_CHAR_CODE('awgc') kSingerSubType = FOUR_CHAR_CODE('sing') kSinger2SubType = FOUR_CHAR_CODE('sng2') kWhitSubType = FOUR_CHAR_CODE('whit') kSoundBlasterSubType = FOUR_CHAR_CODE('sbls') kWaveOutSubType = FOUR_CHAR_CODE('wavo') kWaveOutSnifferSubType = FOUR_CHAR_CODE('wosn') kDirectSoundSubType = FOUR_CHAR_CODE('dsnd') kDirectSoundSnifferSubType = FOUR_CHAR_CODE('dssn') kUNIXsdevSubType = FOUR_CHAR_CODE('un1x') kUSBSubType = FOUR_CHAR_CODE('usb ') kBlueBoxSubType = FOUR_CHAR_CODE('bsnd') kSoundCompressor = FOUR_CHAR_CODE('scom') kSoundDecompressor = FOUR_CHAR_CODE('sdec') kAudioComponentType = FOUR_CHAR_CODE('adio') kAwacsPhoneSubType = FOUR_CHAR_CODE('hphn') kAudioVisionSpeakerSubType = FOUR_CHAR_CODE('telc') kAudioVisionHeadphoneSubType = FOUR_CHAR_CODE('telh') kPhilipsFaderSubType = FOUR_CHAR_CODE('tvav') kSGSToneSubType = FOUR_CHAR_CODE('sgs0') kSoundEffectsType = FOUR_CHAR_CODE('snfx') kEqualizerSubType = FOUR_CHAR_CODE('eqal') kSSpLocalizationSubType = FOUR_CHAR_CODE('snd3') kSoundNotCompressed = FOUR_CHAR_CODE('NONE') k8BitOffsetBinaryFormat = FOUR_CHAR_CODE('raw ') k16BitBigEndianFormat = FOUR_CHAR_CODE('twos') k16BitLittleEndianFormat = FOUR_CHAR_CODE('sowt') kFloat32Format = FOUR_CHAR_CODE('fl32') kFloat64Format = FOUR_CHAR_CODE('fl64') k24BitFormat = FOUR_CHAR_CODE('in24') k32BitFormat = FOUR_CHAR_CODE('in32') k32BitLittleEndianFormat = FOUR_CHAR_CODE('23ni') kMACE3Compression = FOUR_CHAR_CODE('MAC3') kMACE6Compression = FOUR_CHAR_CODE('MAC6') kCDXA4Compression = FOUR_CHAR_CODE('cdx4') kCDXA2Compression = FOUR_CHAR_CODE('cdx2') kIMACompression = FOUR_CHAR_CODE('ima4') kULawCompression = FOUR_CHAR_CODE('ulaw') kALawCompression = FOUR_CHAR_CODE('alaw') kMicrosoftADPCMFormat = 0x6D730002 kDVIIntelIMAFormat = 0x6D730011 kDVAudioFormat = FOUR_CHAR_CODE('dvca') kQDesignCompression = FOUR_CHAR_CODE('QDMC') kQUALCOMMCompression = FOUR_CHAR_CODE('Qclp') kOffsetBinary = k8BitOffsetBinaryFormat kTwosComplement = k16BitBigEndianFormat kLittleEndianFormat = k16BitLittleEndianFormat kMPEGLayer3Format = 0x6D730055 kFullMPEGLay3Format = FOUR_CHAR_CODE('.mp3') k16BitNativeEndianFormat = k16BitLittleEndianFormat k16BitNonNativeEndianFormat = k16BitBigEndianFormat k16BitNativeEndianFormat = k16BitBigEndianFormat k16BitNonNativeEndianFormat = k16BitLittleEndianFormat k8BitRawIn = (1 << 0) k8BitTwosIn = (1 << 1) k16BitIn = (1 << 2) kStereoIn = (1 << 3) k8BitRawOut = (1 << 8) k8BitTwosOut = (1 << 9) k16BitOut = (1 << 10) kStereoOut = (1 << 11) kReverse = (1L << 16) kRateConvert = (1L << 17) kCreateSoundSource = (1L << 18) kVMAwareness = (1L << 21) kHighQuality = (1L << 22) kNonRealTime = (1L << 23) kSourcePaused = (1 << 0) kPassThrough = (1L << 16) kNoSoundComponentChain = (1L << 17) kNoMixing = (1 << 0) kNoSampleRateConversion = (1 << 1) kNoSampleSizeConversion = (1 << 2) kNoSampleFormatConversion = (1 << 3) kNoChannelConversion = (1 << 4) kNoDecompression = (1 << 5) kNoVolumeConversion = (1 << 6) kNoRealtimeProcessing = (1 << 7) kScheduledSource = (1 << 8) kNonInterleavedBuffer = (1 << 9) kNonPagingMixer = (1 << 10) kSoundConverterMixer = (1 << 11) kPagingMixer = (1 << 12) kVMAwareMixer = (1 << 13) kExtendedSoundData = (1 << 14) kBestQuality = (1 << 0) kInputMask = 0x000000FF kOutputMask = 0x0000FF00 kOutputShift = 8 kActionMask = 0x00FF0000 kSoundComponentBits = 0x00FFFFFF kAudioFormatAtomType = FOUR_CHAR_CODE('frma') kAudioEndianAtomType = FOUR_CHAR_CODE('enda') kAudioVBRAtomType = FOUR_CHAR_CODE('vbra') kAudioTerminatorAtomType = 0 kAVDisplayHeadphoneRemove = 0 kAVDisplayHeadphoneInsert = 1 kAVDisplayPlainTalkRemove = 2 kAVDisplayPlainTalkInsert = 3 audioAllChannels = 0 audioLeftChannel = 1 audioRightChannel = 2 audioUnmuted = 0 audioMuted = 1 audioDoesMono = (1L << 0) audioDoesStereo = (1L << 1) audioDoesIndependentChannels = (1L << 2) siCDQuality = FOUR_CHAR_CODE('cd ') siBestQuality = FOUR_CHAR_CODE('best') siBetterQuality = FOUR_CHAR_CODE('betr') siGoodQuality = FOUR_CHAR_CODE('good') siNoneQuality = FOUR_CHAR_CODE('none') siDeviceIsConnected = 1 siDeviceNotConnected = 0 siDontKnowIfConnected = -1 siReadPermission = 0 siWritePermission = 1 kSoundConverterDidntFillBuffer = (1 << 0) kSoundConverterHasLeftOverData = (1 << 1) kExtendedSoundSampleCountNotValid = 1L << 0 kExtendedSoundBufferSizeValid = 1L << 1 kScheduledSoundDoScheduled = 1 << 0 kScheduledSoundDoCallBack = 1 << 1 kScheduledSoundExtendedHdr = 1 << 2 kSoundComponentInitOutputDeviceSelect = 0x0001 kSoundComponentSetSourceSelect = 0x0002 kSoundComponentGetSourceSelect = 0x0003 kSoundComponentGetSourceDataSelect = 0x0004 kSoundComponentSetOutputSelect = 0x0005 kSoundComponentAddSourceSelect = 0x0101 kSoundComponentRemoveSourceSelect = 0x0102 kSoundComponentGetInfoSelect = 0x0103 kSoundComponentSetInfoSelect = 0x0104 kSoundComponentStartSourceSelect = 0x0105 kSoundComponentStopSourceSelect = 0x0106 kSoundComponentPauseSourceSelect = 0x0107 kSoundComponentPlaySourceBufferSelect = 0x0108 kAudioGetVolumeSelect = 0x0000 kAudioSetVolumeSelect = 0x0001 kAudioGetMuteSelect = 0x0002 kAudioSetMuteSelect = 0x0003 kAudioSetToDefaultsSelect = 0x0004 kAudioGetInfoSelect = 0x0005 kAudioGetBassSelect = 0x0006 kAudioSetBassSelect = 0x0007 kAudioGetTrebleSelect = 0x0008 kAudioSetTrebleSelect = 0x0009 kAudioGetOutputDeviceSelect = 0x000A kAudioMuteOnEventSelect = 0x0081 kDelegatedSoundComponentSelectors = 0x0100 kSndInputReadAsyncSelect = 0x0001 kSndInputReadSyncSelect = 0x0002 kSndInputPauseRecordingSelect = 0x0003 kSndInputResumeRecordingSelect = 0x0004 kSndInputStopRecordingSelect = 0x0005 kSndInputGetStatusSelect = 0x0006 kSndInputGetDeviceInfoSelect = 0x0007 kSndInputSetDeviceInfoSelect = 0x0008 kSndInputInitHardwareSelect = 0x0009 From jackjansen@users.sourceforge.net Sun Aug 19 23:12:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:12:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon TextEdit.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv25231/Python/Mac/Lib/Carbon Added Files: TextEdit.py Log Message: The modules with toolbox constants. --- NEW FILE: TextEdit.py --- # Generated from 'TextEdit.h' teJustLeft = 0 teJustCenter = 1 teJustRight = -1 teForceLeft = -2 teFlushDefault = 0 teCenter = 1 teFlushRight = -1 teFlushLeft = -2 fontBit = 0 faceBit = 1 sizeBit = 2 clrBit = 3 addSizeBit = 4 toggleBit = 5 doFont = 1 doFace = 2 doSize = 4 doColor = 8 doAll = 15 addSize = 16 doToggle = 32 EOLHook = 0 DRAWHook = 4 WIDTHHook = 8 HITTESTHook = 12 nWIDTHHook = 24 TextWidthHook = 28 intEOLHook = 0 intDrawHook = 1 intWidthHook = 2 intHitTestHook = 3 intNWidthHook = 6 intTextWidthHook = 7 intInlineInputTSMTEPreUpdateHook = 8 intInlineInputTSMTEPostUpdateHook = 9 teFAutoScroll = 0 teFTextBuffering = 1 teFOutlineHilite = 2 teFInlineInput = 3 teFUseWhiteBackground = 4 teFUseInlineInput = 5 teFInlineInputAutoScroll = 6 teBitClear = 0 teBitSet = 1 teBitTest = -1 teWordSelect = 4 teWordDrag = 8 teFromFind = 12 teFromRecal = 16 teFind = 0 teHighlight = 1 teDraw = -1 teCaret = -2 teFUseTextServices = 4 From jackjansen@users.sourceforge.net Sun Aug 19 23:13:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:13:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Windows.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv25254/Python/Mac/Lib/Carbon Added Files: Windows.py Log Message: The modules with toolbox constants. --- NEW FILE: Windows.py --- # Generated from 'MacWindows.h' def FOUR_CHAR_CODE(x): return x kAlertWindowClass = 1L kMovableAlertWindowClass = 2L kModalWindowClass = 3L kMovableModalWindowClass = 4L kFloatingWindowClass = 5L kDocumentWindowClass = 6L kDesktopWindowClass = 7L # kAllWindowClasses = (unsigned long)0xFFFFFFFF kWindowNoAttributes = 0L kWindowCloseBoxAttribute = (1L << 0) kWindowHorizontalZoomAttribute = (1L << 1) kWindowVerticalZoomAttribute = (1L << 2) kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute) kWindowCollapseBoxAttribute = (1L << 3) kWindowResizableAttribute = (1L << 4) kWindowSideTitlebarAttribute = (1L << 5) kWindowNoUpdatesAttribute = (1L << 16) kWindowNoActivatesAttribute = (1L << 17) kWindowNoBufferingAttribute = (1L << 20) kWindowHideOnSuspendAttribute = (1L << 24) kWindowStandardHandlerAttribute = (1L << 25) kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute) kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute) kWindowDefProcType = FOUR_CHAR_CODE('WDEF') kStandardWindowDefinition = 0 kRoundWindowDefinition = 1 kFloatingWindowDefinition = 124 kDocumentWindowVariantCode = 0 kModalDialogVariantCode = 1 kPlainDialogVariantCode = 2 kShadowDialogVariantCode = 3 kMovableModalDialogVariantCode = 5 kAlertVariantCode = 7 kMovableAlertVariantCode = 9 kSideFloaterVariantCode = 8 documentProc = 0 dBoxProc = 1 plainDBox = 2 altDBoxProc = 3 noGrowDocProc = 4 movableDBoxProc = 5 zoomDocProc = 8 zoomNoGrow = 12 floatProc = 1985 floatGrowProc = 1987 floatZoomProc = 1989 floatZoomGrowProc = 1991 floatSideProc = 1993 floatSideGrowProc = 1995 floatSideZoomProc = 1997 floatSideZoomGrowProc = 1999 rDocProc = 16 kWindowDocumentDefProcResID = 64 kWindowDialogDefProcResID = 65 kWindowUtilityDefProcResID = 66 kWindowUtilitySideTitleDefProcResID = 67 kWindowDocumentProc = 1024 kWindowGrowDocumentProc = 1025 kWindowVertZoomDocumentProc = 1026 kWindowVertZoomGrowDocumentProc = 1027 kWindowHorizZoomDocumentProc = 1028 kWindowHorizZoomGrowDocumentProc = 1029 kWindowFullZoomDocumentProc = 1030 kWindowFullZoomGrowDocumentProc = 1031 kWindowPlainDialogProc = 1040 kWindowShadowDialogProc = 1041 kWindowModalDialogProc = 1042 kWindowMovableModalDialogProc = 1043 kWindowAlertProc = 1044 kWindowMovableAlertProc = 1045 kWindowMovableModalGrowProc = 1046 kWindowFloatProc = 1057 kWindowFloatGrowProc = 1059 kWindowFloatVertZoomProc = 1061 kWindowFloatVertZoomGrowProc = 1063 kWindowFloatHorizZoomProc = 1065 kWindowFloatHorizZoomGrowProc = 1067 kWindowFloatFullZoomProc = 1069 kWindowFloatFullZoomGrowProc = 1071 kWindowFloatSideProc = 1073 kWindowFloatSideGrowProc = 1075 kWindowFloatSideVertZoomProc = 1077 kWindowFloatSideVertZoomGrowProc = 1079 kWindowFloatSideHorizZoomProc = 1081 kWindowFloatSideHorizZoomGrowProc = 1083 kWindowFloatSideFullZoomProc = 1085 kWindowFloatSideFullZoomGrowProc = 1087 kWindowNoPosition = 0x0000 kWindowDefaultPosition = 0x0000 kWindowCenterMainScreen = 0x280A kWindowAlertPositionMainScreen = 0x300A kWindowStaggerMainScreen = 0x380A kWindowCenterParentWindow = 0xA80A kWindowAlertPositionParentWindow = 0xB00A kWindowStaggerParentWindow = 0xB80A kWindowCenterParentWindowScreen = 0x680A kWindowAlertPositionParentWindowScreen = 0x700A kWindowStaggerParentWindowScreen = 0x780A kWindowCenterOnMainScreen = 0x00000001 kWindowCenterOnParentWindow = 0x00000002 kWindowCenterOnParentWindowScreen = 0x00000003 kWindowCascadeOnMainScreen = 0x00000004 kWindowCascadeOnParentWindow = 0x00000005 kWindowCascadeOnParentWindowScreen = 0x00000006 kWindowAlertPositionOnMainScreen = 0x00000007 kWindowAlertPositionOnParentWindow = 0x00000008 kWindowAlertPositionOnParentWindowScreen = 0x00000009 kWindowTitleBarRgn = 0 kWindowTitleTextRgn = 1 kWindowCloseBoxRgn = 2 kWindowZoomBoxRgn = 3 kWindowDragRgn = 5 kWindowGrowRgn = 6 kWindowCollapseBoxRgn = 7 kWindowTitleProxyIconRgn = 8 kWindowStructureRgn = 32 kWindowContentRgn = 33 kWindowUpdateRgn = 34 kWindowGlobalPortRgn = 40 dialogKind = 2 userKind = 8 kDialogWindowKind = 2 kApplicationWindowKind = 8 inDesk = 0 inNoWindow = 0 inMenuBar = 1 inSysWindow = 2 inContent = 3 inDrag = 4 inGrow = 5 inGoAway = 6 inZoomIn = 7 inZoomOut = 8 inCollapseBox = 11 inProxyIcon = 12 wNoHit = 0 wInContent = 1 wInDrag = 2 wInGrow = 3 wInGoAway = 4 wInZoomIn = 5 wInZoomOut = 6 wInCollapseBox = 9 wInProxyIcon = 10 kWindowMsgDraw = 0 kWindowMsgHitTest = 1 kWindowMsgCalculateShape = 2 kWindowMsgInitialize = 3 kWindowMsgCleanUp = 4 kWindowMsgDrawGrowOutline = 5 kWindowMsgDrawGrowBox = 6 kWindowMsgGetFeatures = 7 kWindowMsgGetRegion = 8 kWindowMsgDragHilite = 9 kWindowMsgModified = 10 kWindowMsgDrawInCurrentPort = 11 kWindowMsgSetupProxyDragImage = 12 kWindowMsgStateChanged = 13 kWindowMsgMeasureTitle = 14 kWindowMsgGetGrowImageRegion = 19 wDraw = 0 wHit = 1 wCalcRgns = 2 wNew = 3 wDispose = 4 wGrow = 5 wDrawGIcon = 6 kWindowStateTitleChanged = (1 << 0) kWindowGrowSideTop = 0x01 kWindowGrowSideLeft = 0x02 kWindowGrowSideBottom = 0x04 kWindowGrowSideRight = 0x08 kWindowCanGrow = (1 << 0) kWindowCanZoom = (1 << 1) kWindowCanCollapse = (1 << 2) kWindowIsModal = (1 << 3) kWindowCanGetWindowRegion = (1 << 4) kWindowIsAlert = (1 << 5) kWindowHasTitleBar = (1 << 6) kWindowSupportsDragHilite = (1 << 7) kWindowSupportsModifiedBit = (1 << 8) kWindowCanDrawInCurrentPort = (1 << 9) kWindowCanSetupProxyDragImage = (1 << 10) kWindowCanMeasureTitle = (1 << 11) kWindowWantsDisposeAtProcessDeath = (1 << 12) kWindowSupportsSetGrowImageRegion = (1 << 13) kWindowDefSupportsColorGrafPort = 0x40000002 deskPatID = 16 wContentColor = 0 wFrameColor = 1 wTextColor = 2 wHiliteColor = 3 wTitleBarColor = 4 # kMouseUpOutOfSlop = (long)0x80008000 kWindowDefinitionVersionOne = 1 kWindowDefinitionVersionTwo = 2 kWindowIsCollapsedState = (1 << 0L) kStoredWindowSystemTag = FOUR_CHAR_CODE('appl') kStoredBasicWindowDescriptionID = FOUR_CHAR_CODE('sbas') kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255') kWindowDefProcPtr = 0 kWindowDefObjectClass = 1 kWindowPaintProcOptionsNone = 0 kScrollWindowNoOptions = 0 kScrollWindowInvalidate = (1L << 0) kScrollWindowEraseToPortBackground = (1L << 1) kWindowZoomTransitionEffect = 1 kWindowShowTransitionAction = 1 kWindowHideTransitionAction = 2 kWindowPropertyPersistent = 0x00000001 From jackjansen@users.sourceforge.net Sun Aug 19 23:18:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:18:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox aepack.py,1.4,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26223/Python/Mac/Lib/lib-toolbox Removed Files: aepack.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- aepack.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:18:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:18:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox aetypes.py,1.4,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26278/Python/Mac/Lib/lib-toolbox Removed Files: aetypes.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- aetypes.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:19:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Controls.py,1.12,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26586/Python/Mac/Lib/lib-toolbox Removed Files: Controls.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Controls.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:19:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Dialogs.py,1.9,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26636/Python/Mac/Lib/lib-toolbox Removed Files: Dialogs.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Dialogs.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:19:15 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Dragconst.py,1.7,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26681/Python/Mac/Lib/lib-toolbox Removed Files: Dragconst.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Dragconst.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:19:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Events.py,1.6,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26712/Python/Mac/Lib/lib-toolbox Removed Files: Events.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Events.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:19:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox MediaDescr.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26862/Python/Mac/Lib/lib-toolbox Removed Files: MediaDescr.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- MediaDescr.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:19:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox MiniAEFrame.py,1.9,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26934/Python/Mac/Lib/lib-toolbox Removed Files: MiniAEFrame.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- MiniAEFrame.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:20:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:20:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox QDOffscreen.py,1.6,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26967/Python/Mac/Lib/lib-toolbox Removed Files: QDOffscreen.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- QDOffscreen.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:04:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:04:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib aepack.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23194/Python/Mac/Lib Added Files: aepack.py Log Message: Moved here from lib-toolbox, where they should never have been in the first place (all the other stuff there wa generated with bgen). --- NEW FILE: aepack.py --- """Tools for use in AppleEvent clients and servers: conversion between AE types and python types pack(x) converts a Python object to an AEDesc object unpack(desc) does the reverse coerce(x, wanted_sample) coerces a python object to another python object """ # # This code was originally written by Guido, and modified/extended by Jack # to include the various types that were missing. The reference used is # Apple Event Registry, chapter 9. # import struct import string import types from string import strip from types import * import AE from AppleEvents import * import MacOS import macfs import StringIO import aetypes from aetypes import mkenum, mktype # These ones seem to be missing from AppleEvents # (they're in AERegistry.h) #typeColorTable = 'clrt' #typeDrawingArea = 'cdrw' #typePixelMap = 'cpix' #typePixelMapMinus = 'tpmm' #typeRotation = 'trot' #typeTextStyles = 'tsty' #typeStyledText = 'STXT' #typeAEText = 'tTXT' #typeEnumeration = 'enum' # # Some AE types are immedeately coerced into something # we like better (and which is equivalent) # unpacker_coercions = { typeComp : typeFloat, typeColorTable : typeAEList, typeDrawingArea : typeAERecord, typeFixed : typeFloat, typeExtended : typeFloat, typePixelMap : typeAERecord, typeRotation : typeAERecord, typeStyledText : typeAERecord, typeTextStyles : typeAERecord, }; # # Some python types we need in the packer: # AEDescType = type(AE.AECreateDesc('TEXT', '')) _sample_fss = macfs.FSSpec(':') _sample_alias = _sample_fss.NewAliasMinimal() FSSType = type(_sample_fss) AliasType = type(_sample_alias) def pack(x, forcetype = None): """Pack a python object into an AE descriptor""" if forcetype: if type(x) is StringType: return AE.AECreateDesc(forcetype, x) else: return pack(x).AECoerceDesc(forcetype) if x == None: return AE.AECreateDesc('null', '') t = type(x) if t == AEDescType: return x if t == FSSType: return AE.AECreateDesc('fss ', x.data) if t == AliasType: return AE.AECreateDesc('alis', x.data) if t == IntType: return AE.AECreateDesc('long', struct.pack('l', x)) if t == FloatType: return AE.AECreateDesc('doub', struct.pack('d', x)) if t == StringType: return AE.AECreateDesc('TEXT', x) if t == ListType: list = AE.AECreateList('', 0) for item in x: list.AEPutDesc(0, pack(item)) return list if t == DictionaryType: record = AE.AECreateList('', 1) for key, value in x.items(): record.AEPutParamDesc(key, pack(value)) return record if t == InstanceType and hasattr(x, '__aepack__'): return x.__aepack__() return AE.AECreateDesc('TEXT', repr(x)) # Copout def unpack(desc): """Unpack an AE descriptor to a python object""" t = desc.type if unpacker_coercions.has_key(t): desc = desc.AECoerceDesc(unpacker_coercions[t]) t = desc.type # This is a guess by Jack.... if t == typeAEList: l = [] for i in range(desc.AECountItems()): keyword, item = desc.AEGetNthDesc(i+1, '****') l.append(unpack(item)) return l if t == typeAERecord: d = {} for i in range(desc.AECountItems()): keyword, item = desc.AEGetNthDesc(i+1, '****') d[keyword] = unpack(item) return d if t == typeAEText: record = desc.AECoerceDesc('reco') return mkaetext(unpack(record)) if t == typeAlias: return macfs.RawAlias(desc.data) # typeAppleEvent returned as unknown if t == typeBoolean: return struct.unpack('b', desc.data)[0] if t == typeChar: return desc.data # typeColorTable coerced to typeAEList # typeComp coerced to extended # typeData returned as unknown # typeDrawingArea coerced to typeAERecord if t == typeEnumeration: return mkenum(desc.data) # typeEPS returned as unknown if t == typeFalse: return 0 if t == typeFloat: data = desc.data return struct.unpack('d', data)[0] if t == typeFSS: return macfs.RawFSSpec(desc.data) if t == typeInsertionLoc: record = desc.AECoerceDesc('reco') return mkinsertionloc(unpack(record)) # typeInteger equal to typeLongInteger if t == typeIntlText: script, language = struct.unpack('hh', desc.data[:4]) return aetypes.IntlText(script, language, desc.data[4:]) if t == typeIntlWritingCode: script, language = struct.unpack('hh', desc.data) return aetypes.IntlWritingCode(script, language) if t == typeKeyword: return mkkeyword(desc.data) if t == typeLongInteger: return struct.unpack('l', desc.data)[0] if t == typeLongDateTime: a, b = struct.unpack('lL', desc.data) return (long(a) << 32) + b if t == typeNull: return None if t == typeMagnitude: v = struct.unpack('l', desc.data) if v < 0: v = 0x100000000L + v return v if t == typeObjectSpecifier: record = desc.AECoerceDesc('reco') return mkobject(unpack(record)) # typePict returned as unknown # typePixelMap coerced to typeAERecord # typePixelMapMinus returned as unknown # typeProcessSerialNumber returned as unknown if t == typeQDPoint: v, h = struct.unpack('hh', desc.data) return aetypes.QDPoint(v, h) if t == typeQDRectangle: v0, h0, v1, h1 = struct.unpack('hhhh', desc.data) return aetypes.QDRectangle(v0, h0, v1, h1) if t == typeRGBColor: r, g, b = struct.unpack('hhh', desc.data) return aetypes.RGBColor(r, g, b) # typeRotation coerced to typeAERecord # typeScrapStyles returned as unknown # typeSessionID returned as unknown if t == typeShortFloat: return struct.unpack('f', desc.data)[0] if t == typeShortInteger: return struct.unpack('h', desc.data)[0] # typeSMFloat identical to typeShortFloat # typeSMInt indetical to typeShortInt # typeStyledText coerced to typeAERecord if t == typeTargetID: return mktargetid(desc.data) # typeTextStyles coerced to typeAERecord # typeTIFF returned as unknown if t == typeTrue: return 1 if t == typeType: return mktype(desc.data) # # The following are special # if t == 'rang': record = desc.AECoerceDesc('reco') return mkrange(unpack(record)) if t == 'cmpd': record = desc.AECoerceDesc('reco') return mkcomparison(unpack(record)) if t == 'logi': record = desc.AECoerceDesc('reco') return mklogical(unpack(record)) return mkunknown(desc.type, desc.data) def coerce(data, egdata): """Coerce a python object to another type using the AE coercers""" pdata = pack(data) pegdata = pack(egdata) pdata = pdata.AECoerceDesc(pegdata.type) return unpack(pdata) # # Helper routines for unpack # def mktargetid(data): sessionID = getlong(data[:4]) name = mkppcportrec(data[4:4+72]) location = mklocationnamerec(data[76:76+36]) rcvrName = mkppcportrec(data[112:112+72]) return sessionID, name, location, rcvrName def mkppcportrec(rec): namescript = getword(rec[:2]) name = getpstr(rec[2:2+33]) portkind = getword(rec[36:38]) if portkind == 1: ctor = rec[38:42] type = rec[42:46] identity = (ctor, type) else: identity = getpstr(rec[38:38+33]) return namescript, name, portkind, identity def mklocationnamerec(rec): kind = getword(rec[:2]) stuff = rec[2:] if kind == 0: stuff = None if kind == 2: stuff = getpstr(stuff) return kind, stuff def mkunknown(type, data): return aetypes.Unknown(type, data) def getpstr(s): return s[1:1+ord(s[0])] def getlong(s): return (ord(s[0])<<24) | (ord(s[1])<<16) | (ord(s[2])<<8) | ord(s[3]) def getword(s): return (ord(s[0])<<8) | (ord(s[1])<<0) def mkkeyword(keyword): return aetypes.Keyword(keyword) def mkrange(dict): return aetypes.Range(dict['star'], dict['stop']) def mkcomparison(dict): return aetypes.Comparison(dict['obj1'], dict['relo'].enum, dict['obj2']) def mklogical(dict): return aetypes.Logical(dict['logc'], dict['term']) def mkstyledtext(dict): return aetypes.StyledText(dict['ksty'], dict['ktxt']) def mkaetext(dict): return aetypes.AEText(dict[keyAEScriptTag], dict[keyAEStyles], dict[keyAEText]) def mkinsertionloc(dict): return aetypes.InsertionLoc(dict[keyAEObject], dict[keyAEPosition]) def mkobject(dict): want = dict['want'].type form = dict['form'].enum seld = dict['seld'] fr = dict['from'] if form in ('name', 'indx', 'rang', 'test'): if want == 'text': return aetypes.Text(seld, fr) if want == 'cha ': return aetypes.Character(seld, fr) if want == 'cwor': return aetypes.Word(seld, fr) if want == 'clin': return aetypes.Line(seld, fr) if want == 'cpar': return aetypes.Paragraph(seld, fr) if want == 'cwin': return aetypes.Window(seld, fr) if want == 'docu': return aetypes.Document(seld, fr) if want == 'file': return aetypes.File(seld, fr) if want == 'cins': return aetypes.InsertionPoint(seld, fr) if want == 'prop' and form == 'prop' and aetypes.IsType(seld): return aetypes.Property(seld.type, fr) return aetypes.ObjectSpecifier(want, form, seld, fr) def _test(): """Test program. Pack and unpack various things""" objs = [ 'a string', 12, 12.0, None, ['a', 'list', 'of', 'strings'], {'key1': 'value1', 'key2':'value2'}, macfs.FSSpec(':'), macfs.FSSpec(':').NewAliasMinimal(), aetypes.Enum('enum'), aetypes.Type('type'), aetypes.Keyword('kwrd'), aetypes.Range(1, 10), aetypes.Comparison(1, '< ', 10), aetypes.Logical('not ', 1), # Cannot do StyledText # Cannot do AEText aetypes.IntlText(0, 0, 'international text'), aetypes.IntlWritingCode(0,0), aetypes.QDPoint(50,100), aetypes.QDRectangle(50,100,150,200), aetypes.RGBColor(0x7000, 0x6000, 0x5000), aetypes.Unknown('xxxx', 'unknown type data'), aetypes.Character(1), aetypes.Character(2, aetypes.Line(2)), ] for o in objs: print 'BEFORE', o, `o` packed = pack(o) unpacked = unpack(packed) print 'AFTER ', unpacked, `unpacked` import sys sys.exit(1) if __name__ == '__main__': _test() From jackjansen@users.sourceforge.net Sun Aug 19 23:05:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:05:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib WASTEconst.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23433/Python/Mac/Lib Added Files: WASTEconst.py Log Message: Moved here form lib-toolbox, for lack of a better place to go. --- NEW FILE: WASTEconst.py --- # Generated from 'WASTE.h' kPascalStackBased = None # workaround for header parsing weCantUndoErr = -10015 weEmptySelectionErr = -10013 weNotHandledErr = -1708 weUnknownObjectTypeErr = -9478 weObjectNotFoundErr = -9477 weReadOnlyErr = -9476 weUndefinedSelectorErr = -50 weFlushLeft = -2 weFlushRight = -1 weFlushDefault = 0 weCenter = 1 weJustify = 2 weDirDefault = 1 weDirRightToLeft = -1 weDirLeftToRight = 0 weDoFont = 0x0001 weDoFace = 0x0002 weDoSize = 0x0004 weDoColor = 0x0008 weDoAddSize = 0x0010 weDoToggleFace = 0x0020 weDoReplaceFace = 0x0040 weDoPreserveScript = 0x0080 weDoExtractSubscript = 0x0100 weDoFaceMask = 0x0200 kLeadingEdge = -1 kTrailingEdge = 0 kObjectEdge = 2 weFAutoScroll = 0 weFOutlineHilite = 2 weFReadOnly = 5 weFUndo = 6 weFIntCutAndPaste = 7 weFDragAndDrop = 8 weFInhibitRecal = 9 weFUseTempMem = 10 weFDrawOffscreen = 11 weFInhibitRedraw = 12 weFMonoStyled = 13 weFInhibitColor = 31 weDoAutoScroll = 1L << weFAutoScroll weDoOutlineHilite = 1L << weFOutlineHilite weDoReadOnly = 1L << weFReadOnly weDoUndo = 1L << weFUndo weDoIntCutAndPaste = 1L << weFIntCutAndPaste weDoDragAndDrop = 1L << weFDragAndDrop weDoInhibitRecal = 1L << weFInhibitRecal weDoUseTempMem = 1L << weFUseTempMem weDoDrawOffscreen = 1L << weFDrawOffscreen weDoInhibitRedraw = 1L << weFInhibitRedraw weDoMonoStyled = 1L << weFMonoStyled weDoInhibitColor = 1L << weFInhibitColor weBitToggle = -2 weCharByteHook = 'cbyt' weCharToPixelHook = 'c2p ' weCharTypeHook = 'ctyp' weClickLoop = 'clik' weCurrentDrag = 'drag' weDrawTextHook = 'draw' weEraseHook = 'eras' weFluxProc = 'flux' weHiliteDropAreaHook = 'hidr' weLineBreakHook = 'lbrk' wePixelToCharHook = 'p2c ' wePort = 'port' wePreTrackDragHook = 'ptrk' weRefCon = 'refc' weScrollProc = 'scrl' weText = 'text' weTranslateDragHook = 'xdrg' weTranslucencyThreshold = 'tluc' weTSMDocumentID = 'tsmd' weTSMPreUpdate = 'pre ' weTSMPostUpdate = 'post' weURLHint = 'urlh' weWordBreakHook = 'wbrk' weNewHandler = 'new ' weDisposeHandler = 'free' weDrawHandler = 'draw' weClickHandler = 'clik' weStreamHandler = 'strm' weAKNone = 0 weAKUnspecified = 1 weAKTyping = 2 weAKCut = 3 weAKPaste = 4 weAKClear = 5 weAKDrag = 6 weAKSetStyle = 7 weToScrap = 0 weToDrag = 1 weToSoup = 2 From jackjansen@users.sourceforge.net Sun Aug 19 23:10:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:10:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Appearance.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24687/Python/Mac/Lib/Carbon Added Files: Appearance.py Log Message: The modules with toolbox constants. --- NEW FILE: Appearance.py --- # Generated from 'Appearance.h' def FOUR_CHAR_CODE(x): return x kAppearanceEventClass = FOUR_CHAR_CODE('appr') kAEAppearanceChanged = FOUR_CHAR_CODE('thme') kAESystemFontChanged = FOUR_CHAR_CODE('sysf') kAESmallSystemFontChanged = FOUR_CHAR_CODE('ssfn') kAEViewsFontChanged = FOUR_CHAR_CODE('vfnt') kThemeDataFileType = FOUR_CHAR_CODE('thme') kThemePlatinumFileType = FOUR_CHAR_CODE('pltn') kThemeCustomThemesFileType = FOUR_CHAR_CODE('scen') kThemeSoundTrackFileType = FOUR_CHAR_CODE('tsnd') kThemeBrushDialogBackgroundActive = 1 kThemeBrushDialogBackgroundInactive = 2 kThemeBrushAlertBackgroundActive = 3 kThemeBrushAlertBackgroundInactive = 4 kThemeBrushModelessDialogBackgroundActive = 5 kThemeBrushModelessDialogBackgroundInactive = 6 kThemeBrushUtilityWindowBackgroundActive = 7 kThemeBrushUtilityWindowBackgroundInactive = 8 kThemeBrushListViewSortColumnBackground = 9 kThemeBrushListViewBackground = 10 kThemeBrushIconLabelBackground = 11 kThemeBrushListViewSeparator = 12 kThemeBrushChasingArrows = 13 kThemeBrushDragHilite = 14 kThemeBrushDocumentWindowBackground = 15 kThemeBrushFinderWindowBackground = 16 kThemeBrushScrollBarDelimiterActive = 17 kThemeBrushScrollBarDelimiterInactive = 18 kThemeBrushFocusHighlight = 19 kThemeBrushPopupArrowActive = 20 kThemeBrushPopupArrowPressed = 21 kThemeBrushPopupArrowInactive = 22 kThemeBrushAppleGuideCoachmark = 23 kThemeBrushIconLabelBackgroundSelected = 24 kThemeBrushStaticAreaFill = 25 kThemeBrushActiveAreaFill = 26 kThemeBrushButtonFrameActive = 27 kThemeBrushButtonFrameInactive = 28 kThemeBrushButtonFaceActive = 29 kThemeBrushButtonFaceInactive = 30 kThemeBrushButtonFacePressed = 31 kThemeBrushButtonActiveDarkShadow = 32 kThemeBrushButtonActiveDarkHighlight = 33 kThemeBrushButtonActiveLightShadow = 34 kThemeBrushButtonActiveLightHighlight = 35 kThemeBrushButtonInactiveDarkShadow = 36 kThemeBrushButtonInactiveDarkHighlight = 37 kThemeBrushButtonInactiveLightShadow = 38 kThemeBrushButtonInactiveLightHighlight = 39 kThemeBrushButtonPressedDarkShadow = 40 kThemeBrushButtonPressedDarkHighlight = 41 kThemeBrushButtonPressedLightShadow = 42 kThemeBrushButtonPressedLightHighlight = 43 kThemeBrushBevelActiveLight = 44 kThemeBrushBevelActiveDark = 45 kThemeBrushBevelInactiveLight = 46 kThemeBrushBevelInactiveDark = 47 kThemeBrushNotificationWindowBackground = 48 kThemeBrushBlack = -1 kThemeBrushWhite = -2 kThemeTextColorDialogActive = 1 kThemeTextColorDialogInactive = 2 kThemeTextColorAlertActive = 3 kThemeTextColorAlertInactive = 4 kThemeTextColorModelessDialogActive = 5 kThemeTextColorModelessDialogInactive = 6 kThemeTextColorWindowHeaderActive = 7 kThemeTextColorWindowHeaderInactive = 8 kThemeTextColorPlacardActive = 9 kThemeTextColorPlacardInactive = 10 kThemeTextColorPlacardPressed = 11 kThemeTextColorPushButtonActive = 12 kThemeTextColorPushButtonInactive = 13 kThemeTextColorPushButtonPressed = 14 kThemeTextColorBevelButtonActive = 15 kThemeTextColorBevelButtonInactive = 16 kThemeTextColorBevelButtonPressed = 17 kThemeTextColorPopupButtonActive = 18 kThemeTextColorPopupButtonInactive = 19 kThemeTextColorPopupButtonPressed = 20 kThemeTextColorIconLabel = 21 kThemeTextColorListView = 22 kThemeTextColorDocumentWindowTitleActive = 23 kThemeTextColorDocumentWindowTitleInactive = 24 kThemeTextColorMovableModalWindowTitleActive = 25 kThemeTextColorMovableModalWindowTitleInactive = 26 kThemeTextColorUtilityWindowTitleActive = 27 kThemeTextColorUtilityWindowTitleInactive = 28 kThemeTextColorPopupWindowTitleActive = 29 kThemeTextColorPopupWindowTitleInactive = 30 kThemeTextColorRootMenuActive = 31 kThemeTextColorRootMenuSelected = 32 kThemeTextColorRootMenuDisabled = 33 kThemeTextColorMenuItemActive = 34 kThemeTextColorMenuItemSelected = 35 kThemeTextColorMenuItemDisabled = 36 kThemeTextColorPopupLabelActive = 37 kThemeTextColorPopupLabelInactive = 38 kThemeTextColorTabFrontActive = 39 kThemeTextColorTabNonFrontActive = 40 kThemeTextColorTabNonFrontPressed = 41 kThemeTextColorTabFrontInactive = 42 kThemeTextColorTabNonFrontInactive = 43 kThemeTextColorIconLabelSelected = 44 kThemeTextColorBevelButtonStickyActive = 45 kThemeTextColorBevelButtonStickyInactive = 46 kThemeTextColorNotification = 47 kThemeTextColorBlack = -1 kThemeTextColorWhite = -2 kThemeStateInactive = 0 kThemeStateActive = 1 kThemeStatePressed = 2 kThemeStateRollover = 6 kThemeStateUnavailable = 7 kThemeStateDisabled = 0 kThemeStatePressedUp = 2 kThemeStatePressedDown = 3 kThemeArrowCursor = 0 kThemeCopyArrowCursor = 1 kThemeAliasArrowCursor = 2 kThemeContextualMenuArrowCursor = 3 kThemeIBeamCursor = 4 kThemeCrossCursor = 5 kThemePlusCursor = 6 kThemeWatchCursor = 7 kThemeClosedHandCursor = 8 kThemeOpenHandCursor = 9 kThemePointingHandCursor = 10 kThemeCountingUpHandCursor = 11 kThemeCountingDownHandCursor = 12 kThemeCountingUpAndDownHandCursor = 13 kThemeSpinningCursor = 14 kThemeResizeLeftCursor = 15 kThemeResizeRightCursor = 16 kThemeResizeLeftRightCursor = 17 kThemeMenuBarNormal = 0 kThemeMenuBarSelected = 1 kThemeMenuSquareMenuBar = (1 << 0) kThemeMenuActive = 0 kThemeMenuSelected = 1 kThemeMenuDisabled = 3 kThemeMenuTypePullDown = 0 kThemeMenuTypePopUp = 1 kThemeMenuTypeHierarchical = 2 kThemeMenuTypeInactive = 0x0100 kThemeMenuItemPlain = 0 kThemeMenuItemHierarchical = 1 kThemeMenuItemScrollUpArrow = 2 kThemeMenuItemScrollDownArrow = 3 kThemeMenuItemAtTop = 0x0100 kThemeMenuItemAtBottom = 0x0200 kThemeMenuItemHierBackground = 0x0400 kThemeMenuItemPopUpBackground = 0x0800 kThemeMenuItemHasIcon = 0x8000 kThemeBackgroundTabPane = 1 kThemeBackgroundPlacard = 2 kThemeBackgroundWindowHeader = 3 kThemeBackgroundListViewWindowHeader = 4 kThemeNameTag = FOUR_CHAR_CODE('name') kThemeAppearanceFileNameTag = FOUR_CHAR_CODE('thme') kThemeVariantNameTag = FOUR_CHAR_CODE('varn') kThemeSystemFontTag = FOUR_CHAR_CODE('lgsf') kThemeSmallSystemFontTag = FOUR_CHAR_CODE('smsf') kThemeViewsFontTag = FOUR_CHAR_CODE('vfnt') kThemeViewsFontSizeTag = FOUR_CHAR_CODE('vfsz') kThemeDesktopPatternNameTag = FOUR_CHAR_CODE('patn') kThemeDesktopPatternTag = FOUR_CHAR_CODE('patt') kThemeDesktopPictureNameTag = FOUR_CHAR_CODE('dpnm') kThemeDesktopPictureAliasTag = FOUR_CHAR_CODE('dpal') kThemeDesktopPictureAlignmentTag = FOUR_CHAR_CODE('dpan') kThemeHighlightColorNameTag = FOUR_CHAR_CODE('hcnm') kThemeHighlightColorTag = FOUR_CHAR_CODE('hcol') kThemeExamplePictureIDTag = FOUR_CHAR_CODE('epic') kThemeSoundsEnabledTag = FOUR_CHAR_CODE('snds') kThemeSoundTrackNameTag = FOUR_CHAR_CODE('sndt') kThemeSoundMaskTag = FOUR_CHAR_CODE('smsk') kThemeUserDefinedTag = FOUR_CHAR_CODE('user') kThemeScrollBarArrowStyleTag = FOUR_CHAR_CODE('sbar') kThemeScrollBarThumbStyleTag = FOUR_CHAR_CODE('sbth') kThemeSmoothFontEnabledTag = FOUR_CHAR_CODE('smoo') kThemeSmoothFontMinSizeTag = FOUR_CHAR_CODE('smos') kThemeDblClickCollapseTag = FOUR_CHAR_CODE('coll') kThemeCheckBoxClassicX = 0 kThemeCheckBoxCheckMark = 1 kThemeScrollBarArrowsSingle = 0 kThemeScrollBarArrowsLowerRight = 1 kThemeScrollBarThumbNormal = 0 kThemeScrollBarThumbProportional = 1 kThemeSystemFont = 0 kThemeSmallSystemFont = 1 kThemeSmallEmphasizedSystemFont = 2 kThemeViewsFont = 3 kThemeTabNonFront = 0 kThemeTabNonFrontPressed = 1 kThemeTabNonFrontInactive = 2 kThemeTabFront = 3 kThemeTabFrontInactive = 4 kThemeTabNorth = 0 kThemeTabSouth = 1 kThemeTabEast = 2 kThemeTabWest = 3 kThemeSmallTabHeight = 16 kThemeLargeTabHeight = 21 kThemeTabPaneOverlap = 3 kThemeSmallTabHeightMax = 19 kThemeLargeTabHeightMax = 24 kThemeScrollBar = 0 kThemeSmallScrollBar = 1 kThemeSlider = 2 kThemeProgressBar = 3 kThemeIndeterminateBar = 4 kThemeTrackActive = 0 kThemeTrackDisabled = 1 kThemeTrackNothingToScroll = 2 kThemeTrackInactive = 3 kThemeLeftOutsideArrowPressed = 0x01 kThemeLeftInsideArrowPressed = 0x02 kThemeLeftTrackPressed = 0x04 kThemeThumbPressed = 0x08 kThemeRightTrackPressed = 0x10 kThemeRightInsideArrowPressed = 0x20 kThemeRightOutsideArrowPressed = 0x40 kThemeTopOutsideArrowPressed = kThemeLeftOutsideArrowPressed kThemeTopInsideArrowPressed = kThemeLeftInsideArrowPressed kThemeTopTrackPressed = kThemeLeftTrackPressed kThemeBottomTrackPressed = kThemeRightTrackPressed kThemeBottomInsideArrowPressed = kThemeRightInsideArrowPressed kThemeBottomOutsideArrowPressed = kThemeRightOutsideArrowPressed kThemeThumbPlain = 0 kThemeThumbUpward = 1 kThemeThumbDownward = 2 kThemeTrackHorizontal = (1 << 0) kThemeTrackRightToLeft = (1 << 1) kThemeTrackShowThumb = (1 << 2) kThemeTrackThumbRgnIsNotGhost = (1 << 3) kThemeWindowHasGrow = (1 << 0) kThemeWindowHasHorizontalZoom = (1 << 3) kThemeWindowHasVerticalZoom = (1 << 4) kThemeWindowHasFullZoom = kThemeWindowHasHorizontalZoom + kThemeWindowHasVerticalZoom kThemeWindowHasCloseBox = (1 << 5) kThemeWindowHasCollapseBox = (1 << 6) kThemeWindowHasTitleText = (1 << 7) kThemeWindowIsCollapsed = (1 << 8) kThemeWindowHasA = (1 << 9) kThemeWindowHasB = (1 << 10) kThemeDocumentWindow = 0 kThemeDialogWindow = 1 kThemeMovableDialogWindow = 2 kThemeAlertWindow = 3 kThemeMovableAlertWindow = 4 kThemePlainDialogWindow = 5 kThemeShadowDialogWindow = 6 kThemePopupWindow = 7 kThemeUtilityWindow = 8 kThemeUtilitySideWindow = 9 kThemeWidgetCloseBox = 0 kThemeWidgetZoomBox = 1 kThemeWidgetCollapseBox = 2 kThemeWidgetABox = 3 kThemeWidgetBBox = 4 kThemeWidgetBOffBox = 5 kThemeArrowLeft = 0 kThemeArrowDown = 1 kThemeArrowRight = 2 kThemeArrowUp = 3 kThemeArrow3pt = 0 kThemeArrow5pt = 1 kThemeArrow7pt = 2 kThemeArrow9pt = 3 kThemeGrowLeft = (1 << 0) kThemeGrowRight = (1 << 1) kThemeGrowUp = (1 << 2) kThemeGrowDown = (1 << 3) kThemePushButton = 0 kThemeCheckBox = 1 kThemeRadioButton = 2 kThemeBevelButton = 3 kThemeArrowButton = 4 kThemePopupButton = 5 kThemeDisclosureButton = 6 kThemeIncDecButton = 7 kThemeSmallBevelButton = 8 kThemeMediumBevelButton = 3 kThemeLargeBevelButton = 9 kThemeButtonOff = 0 kThemeButtonOn = 1 kThemeButtonMixed = 2 kThemeDisclosureRight = 0 kThemeDisclosureDown = 1 kThemeDisclosureLeft = 2 kThemeAdornmentNone = 0 kThemeAdornmentDefault = (1 << 0) kThemeAdornmentFocus = (1 << 2) kThemeAdornmentRightToLeft = (1 << 4) kThemeAdornmentDrawIndicatorOnly = (1 << 5) kThemeNoSounds = 0 kThemeWindowSoundsMask = (1 << 0) kThemeMenuSoundsMask = (1 << 1) kThemeControlSoundsMask = (1 << 2) kThemeFinderSoundsMask = (1 << 3) kThemeDragSoundNone = 0 kThemeDragSoundMoveWindow = FOUR_CHAR_CODE('wmov') kThemeDragSoundGrowWindow = FOUR_CHAR_CODE('wgro') kThemeDragSoundMoveUtilWindow = FOUR_CHAR_CODE('umov') kThemeDragSoundGrowUtilWindow = FOUR_CHAR_CODE('ugro') kThemeDragSoundMoveDialog = FOUR_CHAR_CODE('dmov') kThemeDragSoundMoveAlert = FOUR_CHAR_CODE('amov') kThemeDragSoundMoveIcon = FOUR_CHAR_CODE('imov') kThemeDragSoundSliderThumb = FOUR_CHAR_CODE('slth') kThemeDragSoundSliderGhost = FOUR_CHAR_CODE('slgh') kThemeDragSoundScrollBarThumb = FOUR_CHAR_CODE('sbth') kThemeDragSoundScrollBarGhost = FOUR_CHAR_CODE('sbgh') kThemeDragSoundScrollBarArrowDecreasing = FOUR_CHAR_CODE('sbad') kThemeDragSoundScrollBarArrowIncreasing = FOUR_CHAR_CODE('sbai') kThemeDragSoundDragging = FOUR_CHAR_CODE('drag') kThemeSoundNone = 0 kThemeSoundMenuOpen = FOUR_CHAR_CODE('mnuo') kThemeSoundMenuClose = FOUR_CHAR_CODE('mnuc') kThemeSoundMenuItemHilite = FOUR_CHAR_CODE('mnui') kThemeSoundMenuItemRelease = FOUR_CHAR_CODE('mnus') kThemeSoundWindowClosePress = FOUR_CHAR_CODE('wclp') kThemeSoundWindowCloseEnter = FOUR_CHAR_CODE('wcle') kThemeSoundWindowCloseExit = FOUR_CHAR_CODE('wclx') kThemeSoundWindowCloseRelease = FOUR_CHAR_CODE('wclr') kThemeSoundWindowZoomPress = FOUR_CHAR_CODE('wzmp') kThemeSoundWindowZoomEnter = FOUR_CHAR_CODE('wzme') kThemeSoundWindowZoomExit = FOUR_CHAR_CODE('wzmx') kThemeSoundWindowZoomRelease = FOUR_CHAR_CODE('wzmr') kThemeSoundWindowCollapsePress = FOUR_CHAR_CODE('wcop') kThemeSoundWindowCollapseEnter = FOUR_CHAR_CODE('wcoe') kThemeSoundWindowCollapseExit = FOUR_CHAR_CODE('wcox') kThemeSoundWindowCollapseRelease = FOUR_CHAR_CODE('wcor') kThemeSoundWindowDragBoundary = FOUR_CHAR_CODE('wdbd') kThemeSoundUtilWinClosePress = FOUR_CHAR_CODE('uclp') kThemeSoundUtilWinCloseEnter = FOUR_CHAR_CODE('ucle') kThemeSoundUtilWinCloseExit = FOUR_CHAR_CODE('uclx') kThemeSoundUtilWinCloseRelease = FOUR_CHAR_CODE('uclr') kThemeSoundUtilWinZoomPress = FOUR_CHAR_CODE('uzmp') kThemeSoundUtilWinZoomEnter = FOUR_CHAR_CODE('uzme') kThemeSoundUtilWinZoomExit = FOUR_CHAR_CODE('uzmx') kThemeSoundUtilWinZoomRelease = FOUR_CHAR_CODE('uzmr') kThemeSoundUtilWinCollapsePress = FOUR_CHAR_CODE('ucop') kThemeSoundUtilWinCollapseEnter = FOUR_CHAR_CODE('ucoe') kThemeSoundUtilWinCollapseExit = FOUR_CHAR_CODE('ucox') kThemeSoundUtilWinCollapseRelease = FOUR_CHAR_CODE('ucor') kThemeSoundUtilWinDragBoundary = FOUR_CHAR_CODE('udbd') kThemeSoundWindowOpen = FOUR_CHAR_CODE('wopn') kThemeSoundWindowClose = FOUR_CHAR_CODE('wcls') kThemeSoundWindowZoomIn = FOUR_CHAR_CODE('wzmi') kThemeSoundWindowZoomOut = FOUR_CHAR_CODE('wzmo') kThemeSoundWindowCollapseUp = FOUR_CHAR_CODE('wcol') kThemeSoundWindowCollapseDown = FOUR_CHAR_CODE('wexp') kThemeSoundWindowActivate = FOUR_CHAR_CODE('wact') kThemeSoundUtilWindowOpen = FOUR_CHAR_CODE('uopn') kThemeSoundUtilWindowClose = FOUR_CHAR_CODE('ucls') kThemeSoundUtilWindowZoomIn = FOUR_CHAR_CODE('uzmi') kThemeSoundUtilWindowZoomOut = FOUR_CHAR_CODE('uzmo') kThemeSoundUtilWindowCollapseUp = FOUR_CHAR_CODE('ucol') kThemeSoundUtilWindowCollapseDown = FOUR_CHAR_CODE('uexp') kThemeSoundUtilWindowActivate = FOUR_CHAR_CODE('uact') kThemeSoundDialogOpen = FOUR_CHAR_CODE('dopn') kThemeSoundDialogClose = FOUR_CHAR_CODE('dlgc') kThemeSoundAlertOpen = FOUR_CHAR_CODE('aopn') kThemeSoundAlertClose = FOUR_CHAR_CODE('altc') kThemeSoundPopupWindowOpen = FOUR_CHAR_CODE('pwop') kThemeSoundPopupWindowClose = FOUR_CHAR_CODE('pwcl') kThemeSoundButtonPress = FOUR_CHAR_CODE('btnp') kThemeSoundButtonEnter = FOUR_CHAR_CODE('btne') kThemeSoundButtonExit = FOUR_CHAR_CODE('btnx') kThemeSoundButtonRelease = FOUR_CHAR_CODE('btnr') kThemeSoundDefaultButtonPress = FOUR_CHAR_CODE('dbtp') kThemeSoundDefaultButtonEnter = FOUR_CHAR_CODE('dbte') kThemeSoundDefaultButtonExit = FOUR_CHAR_CODE('dbtx') kThemeSoundDefaultButtonRelease = FOUR_CHAR_CODE('dbtr') kThemeSoundCancelButtonPress = FOUR_CHAR_CODE('cbtp') kThemeSoundCancelButtonEnter = FOUR_CHAR_CODE('cbte') kThemeSoundCancelButtonExit = FOUR_CHAR_CODE('cbtx') kThemeSoundCancelButtonRelease = FOUR_CHAR_CODE('cbtr') kThemeSoundCheckboxPress = FOUR_CHAR_CODE('chkp') kThemeSoundCheckboxEnter = FOUR_CHAR_CODE('chke') kThemeSoundCheckboxExit = FOUR_CHAR_CODE('chkx') kThemeSoundCheckboxRelease = FOUR_CHAR_CODE('chkr') kThemeSoundRadioPress = FOUR_CHAR_CODE('radp') kThemeSoundRadioEnter = FOUR_CHAR_CODE('rade') kThemeSoundRadioExit = FOUR_CHAR_CODE('radx') kThemeSoundRadioRelease = FOUR_CHAR_CODE('radr') kThemeSoundScrollArrowPress = FOUR_CHAR_CODE('sbap') kThemeSoundScrollArrowEnter = FOUR_CHAR_CODE('sbae') kThemeSoundScrollArrowExit = FOUR_CHAR_CODE('sbax') kThemeSoundScrollArrowRelease = FOUR_CHAR_CODE('sbar') kThemeSoundScrollEndOfTrack = FOUR_CHAR_CODE('sbte') kThemeSoundScrollTrackPress = FOUR_CHAR_CODE('sbtp') kThemeSoundSliderEndOfTrack = FOUR_CHAR_CODE('slte') kThemeSoundSliderTrackPress = FOUR_CHAR_CODE('sltp') kThemeSoundBalloonOpen = FOUR_CHAR_CODE('blno') kThemeSoundBalloonClose = FOUR_CHAR_CODE('blnc') kThemeSoundBevelPress = FOUR_CHAR_CODE('bevp') kThemeSoundBevelEnter = FOUR_CHAR_CODE('beve') kThemeSoundBevelExit = FOUR_CHAR_CODE('bevx') kThemeSoundBevelRelease = FOUR_CHAR_CODE('bevr') kThemeSoundLittleArrowUpPress = FOUR_CHAR_CODE('laup') kThemeSoundLittleArrowDnPress = FOUR_CHAR_CODE('ladp') kThemeSoundLittleArrowEnter = FOUR_CHAR_CODE('lare') kThemeSoundLittleArrowExit = FOUR_CHAR_CODE('larx') kThemeSoundLittleArrowUpRelease = FOUR_CHAR_CODE('laur') kThemeSoundLittleArrowDnRelease = FOUR_CHAR_CODE('ladr') kThemeSoundPopupPress = FOUR_CHAR_CODE('popp') kThemeSoundPopupEnter = FOUR_CHAR_CODE('pope') kThemeSoundPopupExit = FOUR_CHAR_CODE('popx') kThemeSoundPopupRelease = FOUR_CHAR_CODE('popr') kThemeSoundDisclosurePress = FOUR_CHAR_CODE('dscp') kThemeSoundDisclosureEnter = FOUR_CHAR_CODE('dsce') kThemeSoundDisclosureExit = FOUR_CHAR_CODE('dscx') kThemeSoundDisclosureRelease = FOUR_CHAR_CODE('dscr') kThemeSoundTabPressed = FOUR_CHAR_CODE('tabp') kThemeSoundTabEnter = FOUR_CHAR_CODE('tabe') kThemeSoundTabExit = FOUR_CHAR_CODE('tabx') kThemeSoundTabRelease = FOUR_CHAR_CODE('tabr') kThemeSoundDragTargetHilite = FOUR_CHAR_CODE('dthi') kThemeSoundDragTargetUnhilite = FOUR_CHAR_CODE('dtuh') kThemeSoundDragTargetDrop = FOUR_CHAR_CODE('dtdr') kThemeSoundEmptyTrash = FOUR_CHAR_CODE('ftrs') kThemeSoundSelectItem = FOUR_CHAR_CODE('fsel') kThemeSoundNewItem = FOUR_CHAR_CODE('fnew') kThemeSoundReceiveDrop = FOUR_CHAR_CODE('fdrp') kThemeSoundCopyDone = FOUR_CHAR_CODE('fcpd') kThemeSoundResolveAlias = FOUR_CHAR_CODE('fral') kThemeSoundLaunchApp = FOUR_CHAR_CODE('flap') kThemeSoundDiskInsert = FOUR_CHAR_CODE('dski') kThemeSoundDiskEject = FOUR_CHAR_CODE('dske') kThemeSoundFinderDragOnIcon = FOUR_CHAR_CODE('fdon') kThemeSoundFinderDragOffIcon = FOUR_CHAR_CODE('fdof') kThemePopupTabNormalPosition = 0 kThemePopupTabCenterOnWindow = 1 kThemePopupTabCenterOnOffset = 2 kThemeMetricScrollBarWidth = 0 kThemeMetricSmallScrollBarWidth = 1 kThemeMetricCheckBoxGlyphHeight = 2 kThemeMetricRadioButtonGlyphHeight = 3 # appearanceBadBrushIndexErr = themeInvalidBrushErr # appearanceProcessRegisteredErr = themeProcessRegisteredErr # appearanceProcessNotRegisteredErr = themeProcessNotRegisteredErr # appearanceBadTextColorIndexErr = themeBadTextColorErr # appearanceThemeHasNoAccents = themeHasNoAccentsErr # appearanceBadCursorIndexErr = themeBadCursorIndexErr kThemeActiveDialogBackgroundBrush = kThemeBrushDialogBackgroundActive kThemeInactiveDialogBackgroundBrush = kThemeBrushDialogBackgroundInactive kThemeActiveAlertBackgroundBrush = kThemeBrushAlertBackgroundActive kThemeInactiveAlertBackgroundBrush = kThemeBrushAlertBackgroundInactive kThemeActiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundActive kThemeInactiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundInactive kThemeActiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundActive kThemeInactiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundInactive kThemeListViewSortColumnBackgroundBrush = kThemeBrushListViewSortColumnBackground kThemeListViewBackgroundBrush = kThemeBrushListViewBackground kThemeIconLabelBackgroundBrush = kThemeBrushIconLabelBackground kThemeListViewSeparatorBrush = kThemeBrushListViewSeparator kThemeChasingArrowsBrush = kThemeBrushChasingArrows kThemeDragHiliteBrush = kThemeBrushDragHilite kThemeDocumentWindowBackgroundBrush = kThemeBrushDocumentWindowBackground kThemeFinderWindowBackgroundBrush = kThemeBrushFinderWindowBackground kThemeActiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterActive kThemeInactiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterInactive kThemeFocusHighlightBrush = kThemeBrushFocusHighlight kThemeActivePopupArrowBrush = kThemeBrushPopupArrowActive kThemePressedPopupArrowBrush = kThemeBrushPopupArrowPressed kThemeInactivePopupArrowBrush = kThemeBrushPopupArrowInactive kThemeAppleGuideCoachmarkBrush = kThemeBrushAppleGuideCoachmark kThemeActiveDialogTextColor = kThemeTextColorDialogActive kThemeInactiveDialogTextColor = kThemeTextColorDialogInactive kThemeActiveAlertTextColor = kThemeTextColorAlertActive kThemeInactiveAlertTextColor = kThemeTextColorAlertInactive kThemeActiveModelessDialogTextColor = kThemeTextColorModelessDialogActive kThemeInactiveModelessDialogTextColor = kThemeTextColorModelessDialogInactive kThemeActiveWindowHeaderTextColor = kThemeTextColorWindowHeaderActive kThemeInactiveWindowHeaderTextColor = kThemeTextColorWindowHeaderInactive kThemeActivePlacardTextColor = kThemeTextColorPlacardActive kThemeInactivePlacardTextColor = kThemeTextColorPlacardInactive kThemePressedPlacardTextColor = kThemeTextColorPlacardPressed kThemeActivePushButtonTextColor = kThemeTextColorPushButtonActive kThemeInactivePushButtonTextColor = kThemeTextColorPushButtonInactive kThemePressedPushButtonTextColor = kThemeTextColorPushButtonPressed kThemeActiveBevelButtonTextColor = kThemeTextColorBevelButtonActive kThemeInactiveBevelButtonTextColor = kThemeTextColorBevelButtonInactive kThemePressedBevelButtonTextColor = kThemeTextColorBevelButtonPressed kThemeActivePopupButtonTextColor = kThemeTextColorPopupButtonActive kThemeInactivePopupButtonTextColor = kThemeTextColorPopupButtonInactive kThemePressedPopupButtonTextColor = kThemeTextColorPopupButtonPressed kThemeIconLabelTextColor = kThemeTextColorIconLabel kThemeListViewTextColor = kThemeTextColorListView kThemeActiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleActive kThemeInactiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleInactive kThemeActiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleActive kThemeInactiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleInactive kThemeActiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleActive kThemeInactiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleInactive kThemeActivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleActive kThemeInactivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleInactive kThemeActiveRootMenuTextColor = kThemeTextColorRootMenuActive kThemeSelectedRootMenuTextColor = kThemeTextColorRootMenuSelected kThemeDisabledRootMenuTextColor = kThemeTextColorRootMenuDisabled kThemeActiveMenuItemTextColor = kThemeTextColorMenuItemActive kThemeSelectedMenuItemTextColor = kThemeTextColorMenuItemSelected kThemeDisabledMenuItemTextColor = kThemeTextColorMenuItemDisabled kThemeActivePopupLabelTextColor = kThemeTextColorPopupLabelActive kThemeInactivePopupLabelTextColor = kThemeTextColorPopupLabelInactive kAEThemeSwitch = kAEAppearanceChanged kThemeNoAdornment = kThemeAdornmentNone kThemeDefaultAdornment = kThemeAdornmentDefault kThemeFocusAdornment = kThemeAdornmentFocus kThemeRightToLeftAdornment = kThemeAdornmentRightToLeft kThemeDrawIndicatorOnly = kThemeAdornmentDrawIndicatorOnly kThemeBrushPassiveAreaFill = kThemeBrushStaticAreaFill From jackjansen@users.sourceforge.net Sun Aug 19 23:11:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:11:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Controls.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24846/Python/Mac/Lib/Carbon Added Files: Controls.py Log Message: The modules with toolbox constants. --- NEW FILE: Controls.py --- # Generated from 'Controls.h' def FOUR_CHAR_CODE(x): return x from TextEdit import * from QuickDraw import * from Dragconst import * kControlDefProcType = FOUR_CHAR_CODE('CDEF') kControlTemplateResourceType = FOUR_CHAR_CODE('CNTL') kControlColorTableResourceType = FOUR_CHAR_CODE('cctb') kControlDefProcResourceType = FOUR_CHAR_CODE('CDEF') controlNotifyNothing = FOUR_CHAR_CODE('nada') controlNotifyClick = FOUR_CHAR_CODE('clik') controlNotifyFocus = FOUR_CHAR_CODE('focu') controlNotifyKey = FOUR_CHAR_CODE('key ') kControlCanAutoInvalidate = 1L << 0 staticTextProc = 256 editTextProc = 272 iconProc = 288 userItemProc = 304 pictItemProc = 320 cFrameColor = 0 cBodyColor = 1 cTextColor = 2 cThumbColor = 3 kNumberCtlCTabEntries = 4 kControlNoVariant = 0 kControlUsesOwningWindowsFontVariant = 1 << 3 kControlNoPart = 0 kControlIndicatorPart = 129 kControlDisabledPart = 254 kControlInactivePart = 255 kControlEntireControl = 0 kControlStructureMetaPart = -1 kControlContentMetaPart = -2 kControlFocusNoPart = 0 kControlFocusNextPart = -1 kControlFocusPrevPart = -2 kControlCollectionTagBounds = FOUR_CHAR_CODE('boun') kControlCollectionTagValue = FOUR_CHAR_CODE('valu') kControlCollectionTagMinimum = FOUR_CHAR_CODE('min ') kControlCollectionTagMaximum = FOUR_CHAR_CODE('max ') kControlCollectionTagViewSize = FOUR_CHAR_CODE('view') kControlCollectionTagVisibility = FOUR_CHAR_CODE('visi') kControlCollectionTagRefCon = FOUR_CHAR_CODE('refc') kControlCollectionTagTitle = FOUR_CHAR_CODE('titl') kControlCollectionTagIDSignature = FOUR_CHAR_CODE('idsi') kControlCollectionTagIDID = FOUR_CHAR_CODE('idid') kControlCollectionTagCommand = FOUR_CHAR_CODE('cmd ') kControlCollectionTagSubControls = FOUR_CHAR_CODE('subc') kControlContentTextOnly = 0 kControlNoContent = 0 kControlContentIconSuiteRes = 1 kControlContentCIconRes = 2 kControlContentPictRes = 3 kControlContentICONRes = 4 kControlContentIconSuiteHandle = 129 kControlContentCIconHandle = 130 kControlContentPictHandle = 131 kControlContentIconRef = 132 kControlContentICON = 133 kControlKeyScriptBehaviorAllowAnyScript = FOUR_CHAR_CODE('any ') kControlKeyScriptBehaviorPrefersRoman = FOUR_CHAR_CODE('prmn') kControlKeyScriptBehaviorRequiresRoman = FOUR_CHAR_CODE('rrmn') kControlFontBigSystemFont = -1 kControlFontSmallSystemFont = -2 kControlFontSmallBoldSystemFont = -3 kControlFontViewSystemFont = -4 kControlUseFontMask = 0x0001 kControlUseFaceMask = 0x0002 kControlUseSizeMask = 0x0004 kControlUseForeColorMask = 0x0008 kControlUseBackColorMask = 0x0010 kControlUseModeMask = 0x0020 kControlUseJustMask = 0x0040 kControlUseAllMask = 0x00FF kControlAddFontSizeMask = 0x0100 kControlAddToMetaFontMask = 0x0200 kDoNotActivateAndIgnoreClick = 0 kDoNotActivateAndHandleClick = 1 kActivateAndIgnoreClick = 2 kActivateAndHandleClick = 3 kControlFontStyleTag = FOUR_CHAR_CODE('font') kControlKeyFilterTag = FOUR_CHAR_CODE('fltr') kControlSupportsGhosting = 1 << 0 kControlSupportsEmbedding = 1 << 1 kControlSupportsFocus = 1 << 2 kControlWantsIdle = 1 << 3 kControlWantsActivate = 1 << 4 kControlHandlesTracking = 1 << 5 kControlSupportsDataAccess = 1 << 6 kControlHasSpecialBackground = 1 << 7 kControlGetsFocusOnClick = 1 << 8 kControlSupportsCalcBestRect = 1 << 9 kControlSupportsLiveFeedback = 1 << 10 kControlHasRadioBehavior = 1 << 11 kControlSupportsDragAndDrop = 1 << 12 kControlAutoToggles = 1 << 14 kControlSupportsGetRegion = 1 << 17 kControlSupportsFlattening = 1 << 19 kControlSupportsSetCursor = 1 << 20 kControlSupportsContextualMenus = 1 << 21 kControlSupportsClickActivation = 1 << 22 drawCntl = 0 testCntl = 1 calcCRgns = 2 initCntl = 3 dispCntl = 4 posCntl = 5 thumbCntl = 6 dragCntl = 7 autoTrack = 8 calcCntlRgn = 10 calcThumbRgn = 11 drawThumbOutline = 12 kControlMsgDrawGhost = 13 kControlMsgCalcBestRect = 14 kControlMsgHandleTracking = 15 kControlMsgFocus = 16 kControlMsgKeyDown = 17 kControlMsgIdle = 18 kControlMsgGetFeatures = 19 kControlMsgSetData = 20 kControlMsgGetData = 21 kControlMsgActivate = 22 kControlMsgSetUpBackground = 23 kControlMsgCalcValueFromPos = 26 kControlMsgTestNewMsgSupport = 27 kControlMsgSubValueChanged = 25 kControlMsgSubControlAdded = 28 kControlMsgSubControlRemoved = 29 kControlMsgApplyTextColor = 30 kControlMsgGetRegion = 31 kControlMsgFlatten = 32 kControlMsgSetCursor = 33 kControlMsgDragEnter = 38 kControlMsgDragLeave = 39 kControlMsgDragWithin = 40 kControlMsgDragReceive = 41 kControlMsgDisplayDebugInfo = 46 kControlMsgContextualMenuClick = 47 kControlMsgGetClickActivation = 48 kDrawControlEntireControl = 0 kDrawControlIndicatorOnly = 129 kDragControlEntireControl = 0 kDragControlIndicator = 1 kControlSupportsNewMessages = FOUR_CHAR_CODE(' ok ') kControlKeyFilterBlockKey = 0 kControlKeyFilterPassKey = 1 noConstraint = kNoConstraint hAxisOnly = 1 vAxisOnly = 2 kControlDefProcPtr = 0 kControlPropertyPersistent = 0x00000001 kDragTrackingEnterControl = kDragTrackingEnterWindow kDragTrackingInControl = kDragTrackingInWindow kDragTrackingLeaveControl = kDragTrackingLeaveWindow useWFont = kControlUsesOwningWindowsFontVariant inThumb = kControlIndicatorPart kNoHiliteControlPart = kControlNoPart kInIndicatorControlPart = kControlIndicatorPart kReservedControlPart = kControlDisabledPart kControlInactiveControlPart = kControlInactivePart kControlTabListResType = FOUR_CHAR_CODE('tab#') kControlListDescResType = FOUR_CHAR_CODE('ldes') kControlCheckBoxUncheckedValue = 0 kControlCheckBoxCheckedValue = 1 kControlCheckBoxMixedValue = 2 kControlRadioButtonUncheckedValue = 0 kControlRadioButtonCheckedValue = 1 kControlRadioButtonMixedValue = 2 popupFixedWidth = 1 << 0 popupVariableWidth = 1 << 1 popupUseAddResMenu = 1 << 2 popupUseWFont = 1 << 3 popupTitleBold = 1 << 8 popupTitleItalic = 1 << 9 popupTitleUnderline = 1 << 10 popupTitleOutline = 1 << 11 popupTitleShadow = 1 << 12 popupTitleCondense = 1 << 13 popupTitleExtend = 1 << 14 popupTitleNoStyle = 1 << 15 popupTitleLeftJust = 0x00000000 popupTitleCenterJust = 0x00000001 popupTitleRightJust = 0x000000FF pushButProc = 0 checkBoxProc = 1 radioButProc = 2 scrollBarProc = 16 popupMenuProc = 1008 kControlLabelPart = 1 kControlMenuPart = 2 kControlTrianglePart = 4 kControlEditTextPart = 5 kControlPicturePart = 6 kControlIconPart = 7 kControlClockPart = 8 kControlListBoxPart = 24 kControlListBoxDoubleClickPart = 25 kControlImageWellPart = 26 kControlRadioGroupPart = 27 kControlButtonPart = 10 kControlCheckBoxPart = 11 kControlRadioButtonPart = 11 kControlUpButtonPart = 20 kControlDownButtonPart = 21 kControlPageUpPart = 22 kControlPageDownPart = 23 kControlClockHourDayPart = 9 kControlClockMinuteMonthPart = 10 kControlClockSecondYearPart = 11 kControlClockAMPMPart = 12 kControlDataBrowserPart = 24 kControlDataBrowserDraggedPart = 25 kControlBevelButtonSmallBevelProc = 32 kControlBevelButtonNormalBevelProc = 33 kControlBevelButtonLargeBevelProc = 34 kControlBevelButtonSmallBevelVariant = 0 kControlBevelButtonNormalBevelVariant = (1 << 0) kControlBevelButtonLargeBevelVariant = (1 << 1) kControlBevelButtonMenuOnRightVariant = (1 << 2) kControlBevelButtonSmallBevel = 0 kControlBevelButtonNormalBevel = 1 kControlBevelButtonLargeBevel = 2 kControlBehaviorPushbutton = 0 kControlBehaviorToggles = 0x0100 kControlBehaviorSticky = 0x0200 kControlBehaviorSingleValueMenu = 0 kControlBehaviorMultiValueMenu = 0x4000 kControlBehaviorOffsetContents = 0x8000 kControlBehaviorCommandMenu = 0x2000 kControlBevelButtonMenuOnBottom = 0 kControlBevelButtonMenuOnRight = (1 << 2) kControlBevelButtonAlignSysDirection = -1 kControlBevelButtonAlignCenter = 0 kControlBevelButtonAlignLeft = 1 kControlBevelButtonAlignRight = 2 kControlBevelButtonAlignTop = 3 kControlBevelButtonAlignBottom = 4 kControlBevelButtonAlignTopLeft = 5 kControlBevelButtonAlignBottomLeft = 6 kControlBevelButtonAlignTopRight = 7 kControlBevelButtonAlignBottomRight = 8 kControlBevelButtonAlignTextSysDirection = teFlushDefault kControlBevelButtonAlignTextCenter = teCenter kControlBevelButtonAlignTextFlushRight = teFlushRight kControlBevelButtonAlignTextFlushLeft = teFlushLeft kControlBevelButtonPlaceSysDirection = -1 kControlBevelButtonPlaceNormally = 0 kControlBevelButtonPlaceToRightOfGraphic = 1 kControlBevelButtonPlaceToLeftOfGraphic = 2 kControlBevelButtonPlaceBelowGraphic = 3 kControlBevelButtonPlaceAboveGraphic = 4 kControlBevelButtonContentTag = FOUR_CHAR_CODE('cont') kControlBevelButtonTransformTag = FOUR_CHAR_CODE('tran') kControlBevelButtonTextAlignTag = FOUR_CHAR_CODE('tali') kControlBevelButtonTextOffsetTag = FOUR_CHAR_CODE('toff') kControlBevelButtonGraphicAlignTag = FOUR_CHAR_CODE('gali') kControlBevelButtonGraphicOffsetTag = FOUR_CHAR_CODE('goff') kControlBevelButtonTextPlaceTag = FOUR_CHAR_CODE('tplc') kControlBevelButtonMenuValueTag = FOUR_CHAR_CODE('mval') kControlBevelButtonMenuHandleTag = FOUR_CHAR_CODE('mhnd') # kControlBevelButtonCenterPopupGlyphTag = FOUR_CHAR_CODE('pglc') kControlBevelButtonLastMenuTag = FOUR_CHAR_CODE('lmnu') kControlBevelButtonMenuDelayTag = FOUR_CHAR_CODE('mdly') kControlBevelButtonScaleIconTag = FOUR_CHAR_CODE('scal') kControlSliderProc = 48 kControlSliderLiveFeedback = (1 << 0) kControlSliderHasTickMarks = (1 << 1) kControlSliderReverseDirection = (1 << 2) kControlSliderNonDirectional = (1 << 3) kControlTriangleProc = 64 kControlTriangleLeftFacingProc = 65 kControlTriangleAutoToggleProc = 66 kControlTriangleLeftFacingAutoToggleProc = 67 kControlTriangleLastValueTag = FOUR_CHAR_CODE('last') kControlProgressBarProc = 80 # kControlProgressBarIndeterminateTag = FOUR_CHAR_CODE('inde') kControlLittleArrowsProc = 96 kControlChasingArrowsProc = 112 kControlTabLargeProc = 128 kControlTabSmallProc = 129 kControlTabLargeNorthProc = 128 kControlTabSmallNorthProc = 129 kControlTabLargeSouthProc = 130 kControlTabSmallSouthProc = 131 kControlTabLargeEastProc = 132 kControlTabSmallEastProc = 133 kControlTabLargeWestProc = 134 kControlTabSmallWestProc = 135 kControlTabContentRectTag = FOUR_CHAR_CODE('rect') kControlTabEnabledFlagTag = FOUR_CHAR_CODE('enab') kControlTabFontStyleTag = kControlFontStyleTag kControlTabInfoTag = FOUR_CHAR_CODE('tabi') kControlTabInfoVersionZero = 0 kControlSeparatorLineProc = 144 kControlGroupBoxTextTitleProc = 160 kControlGroupBoxCheckBoxProc = 161 kControlGroupBoxPopupButtonProc = 162 kControlGroupBoxSecondaryTextTitleProc = 164 kControlGroupBoxSecondaryCheckBoxProc = 165 kControlGroupBoxSecondaryPopupButtonProc = 166 kControlGroupBoxMenuHandleTag = FOUR_CHAR_CODE('mhan') kControlGroupBoxFontStyleTag = kControlFontStyleTag kControlGroupBoxTitleRectTag = FOUR_CHAR_CODE('trec') kControlImageWellProc = 176 kControlImageWellContentTag = FOUR_CHAR_CODE('cont') kControlImageWellTransformTag = FOUR_CHAR_CODE('tran') kControlPopupArrowEastProc = 192 kControlPopupArrowWestProc = 193 kControlPopupArrowNorthProc = 194 kControlPopupArrowSouthProc = 195 kControlPopupArrowSmallEastProc = 196 kControlPopupArrowSmallWestProc = 197 kControlPopupArrowSmallNorthProc = 198 kControlPopupArrowSmallSouthProc = 199 kControlPopupArrowOrientationEast = 0 kControlPopupArrowOrientationWest = 1 kControlPopupArrowOrientationNorth = 2 kControlPopupArrowOrientationSouth = 3 kControlPlacardProc = 224 kControlClockTimeProc = 240 kControlClockTimeSecondsProc = 241 kControlClockDateProc = 242 kControlClockMonthYearProc = 243 kControlClockTypeHourMinute = 0 kControlClockTypeHourMinuteSecond = 1 kControlClockTypeMonthDay = 2 kControlClockTypeMonthDayYear = 3 kControlClockFlagStandard = 0 kControlClockNoFlags = 0 kControlClockFlagDisplayOnly = 1 kControlClockIsDisplayOnly = 1 kControlClockFlagLive = 2 kControlClockIsLive = 2 kControlClockLongDateTag = FOUR_CHAR_CODE('date') kControlClockFontStyleTag = kControlFontStyleTag kControlUserPaneProc = 256 kControlUserItemDrawProcTag = FOUR_CHAR_CODE('uidp') kControlUserPaneDrawProcTag = FOUR_CHAR_CODE('draw') kControlUserPaneHitTestProcTag = FOUR_CHAR_CODE('hitt') kControlUserPaneTrackingProcTag = FOUR_CHAR_CODE('trak') kControlUserPaneIdleProcTag = FOUR_CHAR_CODE('idle') kControlUserPaneKeyDownProcTag = FOUR_CHAR_CODE('keyd') kControlUserPaneActivateProcTag = FOUR_CHAR_CODE('acti') kControlUserPaneFocusProcTag = FOUR_CHAR_CODE('foci') kControlUserPaneBackgroundProcTag = FOUR_CHAR_CODE('back') kControlEditTextProc = 272 kControlEditTextPasswordProc = 274 kControlEditTextInlineInputProc = 276 kControlEditTextStyleTag = kControlFontStyleTag kControlEditTextTextTag = FOUR_CHAR_CODE('text') kControlEditTextTEHandleTag = FOUR_CHAR_CODE('than') kControlEditTextKeyFilterTag = kControlKeyFilterTag kControlEditTextSelectionTag = FOUR_CHAR_CODE('sele') kControlEditTextPasswordTag = FOUR_CHAR_CODE('pass') kControlEditTextKeyScriptBehaviorTag = FOUR_CHAR_CODE('kscr') kControlEditTextLockedTag = FOUR_CHAR_CODE('lock') kControlEditTextFixedTextTag = FOUR_CHAR_CODE('ftxt') kControlEditTextValidationProcTag = FOUR_CHAR_CODE('vali') kControlEditTextInlinePreUpdateProcTag = FOUR_CHAR_CODE('prup') kControlEditTextInlinePostUpdateProcTag = FOUR_CHAR_CODE('poup') kControlStaticTextProc = 288 kControlStaticTextStyleTag = kControlFontStyleTag kControlStaticTextTextTag = FOUR_CHAR_CODE('text') kControlStaticTextTextHeightTag = FOUR_CHAR_CODE('thei') kControlStaticTextTruncTag = FOUR_CHAR_CODE('trun') kControlPictureProc = 304 kControlPictureNoTrackProc = 305 kControlPictureHandleTag = FOUR_CHAR_CODE('pich') kControlIconProc = 320 kControlIconNoTrackProc = 321 kControlIconSuiteProc = 322 kControlIconSuiteNoTrackProc = 323 kControlIconRefProc = 324 kControlIconRefNoTrackProc = 325 kControlIconTransformTag = FOUR_CHAR_CODE('trfm') kControlIconAlignmentTag = FOUR_CHAR_CODE('algn') kControlIconResourceIDTag = FOUR_CHAR_CODE('ires') kControlIconContentTag = FOUR_CHAR_CODE('cont') kControlWindowHeaderProc = 336 kControlWindowListViewHeaderProc = 337 kControlListBoxProc = 352 kControlListBoxAutoSizeProc = 353 kControlListBoxListHandleTag = FOUR_CHAR_CODE('lhan') kControlListBoxKeyFilterTag = kControlKeyFilterTag kControlListBoxFontStyleTag = kControlFontStyleTag kControlListBoxDoubleClickTag = FOUR_CHAR_CODE('dblc') kControlListBoxLDEFTag = FOUR_CHAR_CODE('ldef') kControlPushButtonProc = 368 kControlCheckBoxProc = 369 kControlRadioButtonProc = 370 kControlPushButLeftIconProc = 374 kControlPushButRightIconProc = 375 kControlCheckBoxAutoToggleProc = 371 kControlRadioButtonAutoToggleProc = 372 kControlPushButtonDefaultTag = FOUR_CHAR_CODE('dflt') kControlPushButtonCancelTag = FOUR_CHAR_CODE('cncl') kControlScrollBarProc = 384 kControlScrollBarLiveProc = 386 kControlPopupButtonProc = 400 kControlPopupFixedWidthVariant = 1 << 0 kControlPopupVariableWidthVariant = 1 << 1 kControlPopupUseAddResMenuVariant = 1 << 2 kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant kControlPopupButtonMenuHandleTag = FOUR_CHAR_CODE('mhan') kControlPopupButtonMenuIDTag = FOUR_CHAR_CODE('mnid') kControlPopupButtonExtraHeightTag = FOUR_CHAR_CODE('exht') kControlRadioGroupProc = 416 kControlScrollTextBoxProc = 432 kControlScrollTextBoxAutoScrollProc = 433 kControlScrollTextBoxDelayBeforeAutoScrollTag = FOUR_CHAR_CODE('stdl') kControlScrollTextBoxDelayBetweenAutoScrollTag = FOUR_CHAR_CODE('scdl') kControlScrollTextBoxAutoScrollAmountTag = FOUR_CHAR_CODE('samt') kControlScrollTextBoxContentsTag = FOUR_CHAR_CODE('tres') kControlCheckboxUncheckedValue = kControlCheckBoxUncheckedValue kControlCheckboxCheckedValue = kControlCheckBoxCheckedValue kControlCheckboxMixedValue = kControlCheckBoxMixedValue inLabel = kControlLabelPart inMenu = kControlMenuPart inTriangle = kControlTrianglePart inButton = kControlButtonPart inCheckBox = kControlCheckBoxPart inUpButton = kControlUpButtonPart inDownButton = kControlDownButtonPart inPageUp = kControlPageUpPart inPageDown = kControlPageDownPart kInLabelControlPart = kControlLabelPart kInMenuControlPart = kControlMenuPart kInTriangleControlPart = kControlTrianglePart kInButtonControlPart = kControlButtonPart kInCheckBoxControlPart = kControlCheckBoxPart kInUpButtonControlPart = kControlUpButtonPart kInDownButtonControlPart = kControlDownButtonPart kInPageUpControlPart = kControlPageUpPart kInPageDownControlPart = kControlPageDownPart From jackjansen@users.sourceforge.net Sun Aug 19 23:12:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:12:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon QDOffscreen.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv25079/Python/Mac/Lib/Carbon Added Files: QDOffscreen.py Log Message: The modules with toolbox constants. --- NEW FILE: QDOffscreen.py --- # Generated from 'QDOffscreen.h' def FOUR_CHAR_CODE(x): return x pixPurgeBit = 0 noNewDeviceBit = 1 useTempMemBit = 2 keepLocalBit = 3 useDistantHdwrMemBit = 4 useLocalHdwrMemBit = 5 pixelsPurgeableBit = 6 pixelsLockedBit = 7 mapPixBit = 16 newDepthBit = 17 alignPixBit = 18 newRowBytesBit = 19 reallocPixBit = 20 clipPixBit = 28 stretchPixBit = 29 ditherPixBit = 30 gwFlagErrBit = 31 pixPurge = 1L << pixPurgeBit noNewDevice = 1L << noNewDeviceBit useTempMem = 1L << useTempMemBit keepLocal = 1L << keepLocalBit useDistantHdwrMem = 1L << useDistantHdwrMemBit useLocalHdwrMem = 1L << useLocalHdwrMemBit pixelsPurgeable = 1L << pixelsPurgeableBit pixelsLocked = 1L << pixelsLockedBit kAllocDirectDrawSurface = 1L << 14 mapPix = 1L << mapPixBit newDepth = 1L << newDepthBit alignPix = 1L << alignPixBit newRowBytes = 1L << newRowBytesBit reallocPix = 1L << reallocPixBit clipPix = 1L << clipPixBit stretchPix = 1L << stretchPixBit ditherPix = 1L << ditherPixBit gwFlagErr = 1L << gwFlagErrBit deviceIsIndirect = (1L << 0) deviceNeedsLock = (1L << 1) deviceIsStatic = (1L << 2) deviceIsExternalBuffer = (1L << 3) deviceIsDDSurface = (1L << 4) deviceIsDCISurface = (1L << 5) deviceIsGDISurface = (1L << 6) deviceIsAScreen = (1L << 7) deviceIsOverlaySurface = (1L << 8) From jackjansen@users.sourceforge.net Sun Aug 19 23:19:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Lists.py,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26808/Python/Mac/Lib/lib-toolbox Removed Files: Lists.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Lists.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:19:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Menus.py,1.10,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26894/Python/Mac/Lib/lib-toolbox Removed Files: Menus.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Menus.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:20:53 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:20:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox WASTEconst.py,1.3,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv27272/Python/Mac/Lib/lib-toolbox Removed Files: WASTEconst.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- WASTEconst.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:25:42 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:25:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat QDOffscreen.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28345/Python/Mac/Lib/lib-compat Added Files: QDOffscreen.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: QDOffscreen.py --- from Carbon.QDOffscreen import * From jackjansen@users.sourceforge.net Sun Aug 19 23:25:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:25:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat QuickDraw.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28367/Python/Mac/Lib/lib-compat Added Files: QuickDraw.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: QuickDraw.py --- from Carbon.QuickDraw import * From jackjansen@users.sourceforge.net Sun Aug 19 23:20:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:20:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox QuickTime.py,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv27094/Python/Mac/Lib/lib-toolbox Removed Files: QuickTime.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- QuickTime.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:25:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:25:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat QuickTime.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28395/Python/Mac/Lib/lib-compat Added Files: QuickTime.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: QuickTime.py --- from Carbon.QuickTime import * From jackjansen@users.sourceforge.net Sun Aug 19 23:26:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Dragconst.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28661/Python/Mac/Lib/lib-compat Added Files: Dragconst.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Dragconst.py --- from Carbon.Dragconst import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Fonts.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28704/Python/Mac/Lib/lib-compat Added Files: Fonts.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Fonts.py --- from Carbon.Fonts import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:08 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Icons.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28761/Python/Mac/Lib/lib-compat Added Files: Icons.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Icons.py --- from Carbon.Icons import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Snd.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28814/Python/Mac/Lib/lib-compat Added Files: Snd.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Snd.py --- from Carbon.Snd import * From jackjansen@users.sourceforge.net Sun Aug 19 23:25:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:25:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Resources.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28419/Python/Mac/Lib/lib-compat Added Files: Resources.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Resources.py --- from Carbon.Resources import * From jackjansen@users.sourceforge.net Sun Aug 19 23:20:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:20:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Sound.py,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv27182/Python/Mac/Lib/lib-toolbox Removed Files: Sound.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Sound.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:20:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:20:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Windows.py,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv27290/Python/Mac/Lib/lib-toolbox Removed Files: Windows.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Windows.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:25:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:25:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat MacTextEditor.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28274/Python/Mac/Lib/lib-compat Added Files: MacTextEditor.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: MacTextEditor.py --- from Carbon.MacTextEditor import * From jackjansen@users.sourceforge.net Sun Aug 19 23:26:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat TextEdit.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28501/Python/Mac/Lib/lib-compat Added Files: TextEdit.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: TextEdit.py --- from Carbon.TextEdit import * From jackjansen@users.sourceforge.net Sun Aug 19 23:26:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat AppleEvents.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28532/Python/Mac/Lib/lib-compat Added Files: AppleEvents.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: AppleEvents.py --- from Carbon.AppleEvents import * From jackjansen@users.sourceforge.net Sun Aug 19 23:26:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Balloons.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28550/Python/Mac/Lib/lib-compat Added Files: Balloons.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Balloons.py --- from Carbon.Balloons import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Win.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28886/Python/Mac/Lib/lib-compat Added Files: Win.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Win.py --- from Carbon.Win import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat App.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28942/Python/Mac/Lib/lib-compat Added Files: App.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: App.py --- from Carbon.App import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat CF.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28966/Python/Mac/Lib/lib-compat Added Files: CF.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: CF.py --- from Carbon.CF import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:52 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Cm.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28983/Python/Mac/Lib/lib-compat Added Files: Cm.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Cm.py --- from Carbon.Cm import * From jackjansen@users.sourceforge.net Sun Aug 19 23:28:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:28:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Dlg.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv29025/Python/Mac/Lib/lib-compat Added Files: Dlg.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Dlg.py --- from Carbon.Dlg import * From jackjansen@users.sourceforge.net Sun Aug 19 23:26:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Dialogs.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28630/Python/Mac/Lib/lib-compat Added Files: Dialogs.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Dialogs.py --- from Carbon.Dialogs import * From jackjansen@users.sourceforge.net Sun Aug 19 23:28:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:28:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Icn.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv29134/Python/Mac/Lib/lib-compat Added Files: Icn.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Icn.py --- from Carbon.Icn import * From jackjansen@users.sourceforge.net Sun Aug 19 23:28:14 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:28:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Help.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv29103/Python/Mac/Lib/lib-compat Added Files: Help.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Help.py --- from Carbon.Help import * From jackjansen@users.sourceforge.net Sun Aug 19 23:28:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:28:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Drag.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv29075/Python/Mac/Lib/lib-compat Added Files: Drag.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Drag.py --- from Carbon.Drag import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Ctl.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv29004/Python/Mac/Lib/lib-compat Added Files: Ctl.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Ctl.py --- from Carbon.Ctl import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Lists.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28779/Python/Mac/Lib/lib-compat Added Files: Lists.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Lists.py --- from Carbon.Lists import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat AE.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28908/Python/Mac/Lib/lib-compat Added Files: AE.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: AE.py --- from Carbon.AE import * From jackjansen@users.sourceforge.net Sun Aug 19 23:27:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:27:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat TE.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28843/Python/Mac/Lib/lib-compat Added Files: TE.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: TE.py --- from Carbon.TE import * From jackjansen@users.sourceforge.net Sun Aug 19 23:08:01 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:08:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon __init__.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv23957/Python/Mac/Lib/Carbon Added Files: __init__.py Log Message: Carbon is now a package encapsulating all the toolbox modules. Carbon is not the best of names right now (because QuickTime, for instance, is part of its own framekwork in OSX terminology, and because all these modules also work on pre-Carbon MacOS) but in a year or so it will be:-). --- NEW FILE: __init__.py --- From jackjansen@users.sourceforge.net Sun Aug 19 23:11:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:11:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Balloons.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24738/Python/Mac/Lib/Carbon Added Files: Balloons.py Log Message: The modules with toolbox constants. --- NEW FILE: Balloons.py --- # Generated from 'Balloons.h' def FOUR_CHAR_CODE(x): return x kTopLeftTipPointsLeftVariant = 0 kTopLeftTipPointsUpVariant = 1 kTopRightTipPointsUpVariant = 2 kTopRightTipPointsRightVariant = 3 kBottomRightTipPointsRightVariant = 4 kBottomRightTipPointsDownVariant = 5 kBottomLeftTipPointsDownVariant = 6 kBottomLeftTipPointsLeftVariant = 7 kBalloonVariantCount = 8 hmBalloonHelpVersion = 0x0002 kHMHelpMenuID = -16490 kHMAboutHelpItem = 1 kHMShowBalloonsItem = 3 kHMHelpID = -5696 kBalloonWDEFID = 126 helpItem = 1 hmDefaultOptions = 0 hmUseSubID = 1 hmAbsoluteCoords = 2 hmSaveBitsNoWindow = 4 hmSaveBitsWindow = 8 hmMatchInTitle = 16 kHMStringItem = 1 kHMPictItem = 2 kHMStringResItem = 3 kHMTEResItem = 6 kHMSTRResItem = 7 kHMSkipItem = 256 kHMCompareItem = 512 kHMNamedResourceItem = 1024 kHMTrackCntlItem = 2048 khmmString = 1 khmmPict = 2 khmmStringRes = 3 khmmTEHandle = 4 khmmPictHandle = 5 khmmTERes = 6 khmmSTRRes = 7 kHMEnabledItem = 0 kHMTETextResType = FOUR_CHAR_CODE('TEXT') kHMTEStyleResType = FOUR_CHAR_CODE('styl') kHMDisabledItem = 1 kHMCheckedItem = 2 kHMOtherItem = 3 kHMRegularWindow = 0 kHMSaveBitsNoWindow = 1 kHMSaveBitsWindow = 2 kHMMenuResType = FOUR_CHAR_CODE('hmnu') kHMDialogResType = FOUR_CHAR_CODE('hdlg') kHMWindListResType = FOUR_CHAR_CODE('hwin') kHMRectListResType = FOUR_CHAR_CODE('hrct') kHMOverrideResType = FOUR_CHAR_CODE('hovr') kHMFinderApplResType = FOUR_CHAR_CODE('hfdr') From jackjansen@users.sourceforge.net Sun Aug 19 23:11:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:11:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Fonts.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv24933/Python/Mac/Lib/Carbon Added Files: Fonts.py Log Message: The modules with toolbox constants. --- NEW FILE: Fonts.py --- # Generated from 'Fonts.h' def FOUR_CHAR_CODE(x): return x kNilOptions = 0 systemFont = 0 applFont = 1 kPlatformDefaultGuiFontID = applFont kPlatformDefaultGuiFontID = -1 commandMark = 17 checkMark = 18 diamondMark = 19 appleMark = 20 propFont = 36864L prpFntH = 36865L prpFntW = 36866L prpFntHW = 36867L fixedFont = 45056L fxdFntH = 45057L fxdFntW = 45058L fxdFntHW = 45059L fontWid = 44208L kInvalidGeneration = 0L kInvalidFontFamily = -1 kInvalidFont = 0L kFMCurrentFilterFormat = 0L kFMDefaultOptions = kNilOptions kFMUseGlobalScopeOption = 0x00000001 kFMInvalidFilterSelector = 0L kFMFontTechnologyFilterSelector = 1L kFMFontContainerFilterSelector = 2L kFMGenerationFilterSelector = 3L kFMFontFamilyCallbackFilterSelector = 4L kFMFontCallbackFilterSelector = 5L kFMTrueTypeFontTechnology = FOUR_CHAR_CODE('true') kFMPostScriptFontTechnology = FOUR_CHAR_CODE('typ1') kFontIDNewYork = 2 kFontIDGeneva = 3 kFontIDMonaco = 4 kFontIDVenice = 5 kFontIDLondon = 6 kFontIDAthens = 7 kFontIDSanFrancisco = 8 kFontIDToronto = 9 kFontIDCairo = 11 kFontIDLosAngeles = 12 kFontIDTimes = 20 kFontIDHelvetica = 21 kFontIDCourier = 22 kFontIDSymbol = 23 kFontIDMobile = 24 newYork = kFontIDNewYork geneva = kFontIDGeneva monaco = kFontIDMonaco venice = kFontIDVenice london = kFontIDLondon athens = kFontIDAthens sanFran = kFontIDSanFrancisco toronto = kFontIDToronto cairo = kFontIDCairo losAngeles = kFontIDLosAngeles times = kFontIDTimes helvetica = kFontIDHelvetica courier = kFontIDCourier symbol = kFontIDSymbol mobile = kFontIDMobile From jackjansen@users.sourceforge.net Sun Aug 19 23:20:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:20:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox QuickDraw.py,1.11,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv27041/Python/Mac/Lib/lib-toolbox Removed Files: QuickDraw.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- QuickDraw.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:05:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:05:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib aetypes.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23245/Python/Mac/Lib Added Files: aetypes.py Log Message: Moved here from lib-toolbox, where they should never have been in the first place (all the other stuff there wa generated with bgen). --- NEW FILE: aetypes.py --- """aetypes - Python objects representing various AE types.""" from AppleEvents import * import struct from types import * import string # # convoluted, since there are cyclic dependencies between this file and # aetools_convert. # def pack(*args): from aepack import pack return apply(pack, args) def IsSubclass(cls, base): """Test whether CLASS1 is the same as or a subclass of CLASS2""" # Loop to optimize for single inheritance while 1: if cls is base: return 1 if len(cls.__bases__) <> 1: break cls = cls.__bases__[0] # Recurse to cope with multiple inheritance for c in cls.__bases__: if IsSubclass(c, base): return 1 return 0 def IsInstance(x, cls): """Test whether OBJECT is an instance of (a subclass of) CLASS""" return type(x) is InstanceType and IsSubclass(x.__class__, cls) def nice(s): """'nice' representation of an object""" if type(s) is StringType: return repr(s) else: return str(s) class Unknown: """An uninterpreted AE object""" def __init__(self, type, data): self.type = type self.data = data def __repr__(self): return "Unknown(%s, %s)" % (`self.type`, `self.data`) def __aepack__(self): return pack(self.data, self.type) class Enum: """An AE enumeration value""" def __init__(self, enum): self.enum = "%-4.4s" % str(enum) def __repr__(self): return "Enum(%s)" % `self.enum` def __str__(self): return string.strip(self.enum) def __aepack__(self): return pack(self.enum, typeEnumeration) def IsEnum(x): return IsInstance(x, Enum) def mkenum(enum): if IsEnum(enum): return enum return Enum(enum) class Boolean: """An AE boolean value""" def __init__(self, bool): self.bool = (not not bool) def __repr__(self): return "Boolean(%s)" % `self.bool` def __str__(self): if self.bool: return "True" else: return "False" def __aepack__(self): return pack(struct.pack('b', self.bool), 'bool') def IsBoolean(x): return IsInstance(x, Boolean) def mkboolean(bool): if IsBoolean(bool): return bool return Boolean(bool) class Type: """An AE 4-char typename object""" def __init__(self, type): self.type = "%-4.4s" % str(type) def __repr__(self): return "Type(%s)" % `self.type` def __str__(self): return string.strip(self.type) def __aepack__(self): return pack(self.type, typeType) def IsType(x): return IsInstance(x, Type) def mktype(type): if IsType(type): return type return Type(type) class Keyword: """An AE 4-char keyword object""" def __init__(self, keyword): self.keyword = "%-4.4s" % str(keyword) def __repr__(self): return "Keyword(%s)" % `self.keyword` def __str__(self): return string.strip(self.keyword) def __aepack__(self): return pack(self.keyword, typeKeyword) def IsKeyword(x): return IsInstance(x, Keyword) class Range: """An AE range object""" def __init__(self, start, stop): self.start = start self.stop = stop def __repr__(self): return "Range(%s, %s)" % (`self.start`, `self.stop`) def __str__(self): return "%s thru %s" % (nice(self.start), nice(self.stop)) def __aepack__(self): return pack({'star': self.start, 'stop': self.stop}, 'rang') def IsRange(x): return IsInstance(x, Range) class Comparison: """An AE Comparison""" def __init__(self, obj1, relo, obj2): self.obj1 = obj1 self.relo = "%-4.4s" % str(relo) self.obj2 = obj2 def __repr__(self): return "Comparison(%s, %s, %s)" % (`self.obj1`, `self.relo`, `self.obj2`) def __str__(self): return "%s %s %s" % (nice(self.obj1), string.strip(self.relo), nice(self.obj2)) def __aepack__(self): return pack({'obj1': self.obj1, 'relo': mkenum(self.relo), 'obj2': self.obj2}, 'cmpd') def IsComparison(x): return IsInstance(x, Comparison) class NComparison(Comparison): # The class attribute 'relo' must be set in a subclass def __init__(self, obj1, obj2): Comparison.__init__(obj1, self.relo, obj2) class Ordinal: """An AE Ordinal""" def __init__(self, abso): # self.obj1 = obj1 self.abso = "%-4.4s" % str(abso) def __repr__(self): return "Ordinal(%s)" % (`self.abso`) def __str__(self): return "%s" % (string.strip(self.abso)) def __aepack__(self): return pack(self.abso, 'abso') def IsOrdinal(x): return IsInstance(x, Ordinal) class NOrdinal(Ordinal): # The class attribute 'abso' must be set in a subclass def __init__(self): Ordinal.__init__(self, self.abso) class Logical: """An AE logical expression object""" def __init__(self, logc, term): self.logc = "%-4.4s" % str(logc) self.term = term def __repr__(self): return "Logical(%s, %s)" % (`self.logc`, `self.term`) def __str__(self): if type(self.term) == ListType and len(self.term) == 2: return "%s %s %s" % (nice(self.term[0]), string.strip(self.logc), nice(self.term[1])) else: return "%s(%s)" % (string.strip(self.logc), nice(self.term)) def __aepack__(self): return pack({'logc': mkenum(self.logc), 'term': self.term}, 'logi') def IsLogical(x): return IsInstance(x, Logical) class StyledText: """An AE object respresenting text in a certain style""" def __init__(self, style, text): self.style = style self.text = text def __repr__(self): return "StyledText(%s, %s)" % (`self.style`, `self.text`) def __str__(self): return self.text def __aepack__(self): return pack({'ksty': self.style, 'ktxt': self.text}, 'STXT') def IsStyledText(x): return IsInstance(x, StyledText) class AEText: """An AE text object with style, script and language specified""" def __init__(self, script, style, text): self.script = script self.style = style self.text = text def __repr__(self): return "AEText(%s, %s, %s)" % (`self.script`, `self.style`, `self.text`) def __str__(self): return self.text def __aepack__(self): return pack({keyAEScriptTag: self.script, keyAEStyles: self.style, keyAEText: self.text}, typeAEText) def IsAEText(x): return IsInstance(x, AEText) class IntlText: """A text object with script and language specified""" def __init__(self, script, language, text): self.script = script self.language = language self.text = text def __repr__(self): return "IntlText(%s, %s, %s)" % (`self.script`, `self.language`, `self.text`) def __str__(self): return self.text def __aepack__(self): return pack(struct.pack('hh', self.script, self.language)+self.text, typeIntlText) def IsIntlText(x): return IsInstance(x, IntlText) class IntlWritingCode: """An object representing script and language""" def __init__(self, script, language): self.script = script self.language = language def __repr__(self): return "IntlWritingCode(%s, %s)" % (`self.script`, `self.language`) def __str__(self): return "script system %d, language %d"%(self.script, self.language) def __aepack__(self): return pack(struct.pack('hh', self.script, self.language), typeIntlWritingCode) def IsIntlWritingCode(x): return IsInstance(x, IntlWritingCode) class QDPoint: """A point""" def __init__(self, v, h): self.v = v self.h = h def __repr__(self): return "QDPoint(%s, %s)" % (`self.v`, `self.h`) def __str__(self): return "(%d, %d)"%(self.v, self.h) def __aepack__(self): return pack(struct.pack('hh', self.v, self.h), typeQDPoint) def IsQDPoint(x): return IsInstance(x, QDPoint) class QDRectangle: """A rectangle""" def __init__(self, v0, h0, v1, h1): self.v0 = v0 self.h0 = h0 self.v1 = v1 self.h1 = h1 def __repr__(self): return "QDRectangle(%s, %s, %s, %s)" % (`self.v0`, `self.h0`, `self.v1`, `self.h1`) def __str__(self): return "(%d, %d)-(%d, %d)"%(self.v0, self.h0, self.v1, self.h1) def __aepack__(self): return pack(struct.pack('hhhh', self.v0, self.h0, self.v1, self.h1), typeQDRectangle) def IsQDRectangle(x): return IsInstance(x, QDRectangle) class RGBColor: """An RGB color""" def __init__(self, r, g, b): self.r = r self.g = g self.b = b def __repr__(self): return "RGBColor(%s, %s, %s)" % (`self.r`, `self.g`, `self.b`) def __str__(self): return "0x%x red, 0x%x green, 0x%x blue"% (self.r, self.g, self.b) def __aepack__(self): return pack(struct.pack('hhh', self.r, self.g, self.b), typeRGBColor) def IsRGBColor(x): return IsInstance(x, RGBColor) class ObjectSpecifier: """A class for constructing and manipulation AE object specifiers in python. An object specifier is actually a record with four fields: key type description --- ---- ----------- 'want' type 4-char class code of thing we want, e.g. word, paragraph or property 'form' enum how we specify which 'want' thing(s) we want, e.g. by index, by range, by name, or by property specifier 'seld' any which thing(s) we want, e.g. its index, its name, or its property specifier 'from' object the object in which it is contained, or null, meaning look for it in the application Note that we don't call this class plain "Object", since that name is likely to be used by the application. """ def __init__(self, want, form, seld, fr = None): self.want = want self.form = form self.seld = seld self.fr = fr def __repr__(self): s = "ObjectSpecifier(%s, %s, %s" % (`self.want`, `self.form`, `self.seld`) if self.fr: s = s + ", %s)" % `self.fr` else: s = s + ")" return s def __aepack__(self): return pack({'want': mktype(self.want), 'form': mkenum(self.form), 'seld': self.seld, 'from': self.fr}, 'obj ') def IsObjectSpecifier(x): return IsInstance(x, ObjectSpecifier) # Backwards compatability, sigh... class Property(ObjectSpecifier): def __init__(self, which, fr = None, want='prop'): ObjectSpecifier.__init__(self, want, 'prop', mktype(which), fr) def __repr__(self): if self.fr: return "Property(%s, %s)" % (`self.seld.type`, `self.fr`) else: return "Property(%s)" % `self.seld.type` def __str__(self): if self.fr: return "Property %s of %s" % (str(self.seld), str(self.fr)) else: return "Property %s" % str(self.seld) class NProperty(ObjectSpecifier): # Subclasses *must* self baseclass attributes: # want is the type of this property # which is the property name of this property def __init__(self, fr = None): #try: # dummy = self.want #except: # self.want = 'prop' self.want = 'prop' ObjectSpecifier.__init__(self, self.want, 'prop', mktype(self.which), fr) def __repr__(self): rv = "Property(%s"%`self.seld.type` if self.fr: rv = rv + ", fr=%s" % `self.fr` if self.want != 'prop': rv = rv + ", want=%s" % `self.want` return rv + ")" def __str__(self): if self.fr: return "Property %s of %s" % (str(self.seld), str(self.fr)) else: return "Property %s" % str(self.seld) class SelectableItem(ObjectSpecifier): def __init__(self, want, seld, fr = None): t = type(seld) if t == StringType: form = 'name' elif IsRange(seld): form = 'rang' elif IsComparison(seld) or IsLogical(seld): form = 'test' elif t == TupleType: # Breakout: specify both form and seld in a tuple # (if you want ID or rele or somesuch) form, seld = seld else: form = 'indx' ObjectSpecifier.__init__(self, want, form, seld, fr) class ComponentItem(SelectableItem): # Derived classes *must* set the *class attribute* 'want' to some constant # Also, dictionaries _propdict and _elemdict must be set to map property # and element names to the correct classes def __init__(self, which, fr = None): SelectableItem.__init__(self, self.want, which, fr) def __repr__(self): if not self.fr: return "%s(%s)" % (self.__class__.__name__, `self.seld`) return "%s(%s, %s)" % (self.__class__.__name__, `self.seld`, `self.fr`) def __str__(self): seld = self.seld if type(seld) == StringType: ss = repr(seld) elif IsRange(seld): start, stop = seld.start, seld.stop if type(start) == InstanceType == type(stop) and \ start.__class__ == self.__class__ == stop.__class__: ss = str(start.seld) + " thru " + str(stop.seld) else: ss = str(seld) else: ss = str(seld) s = "%s %s" % (self.__class__.__name__, ss) if self.fr: s = s + " of %s" % str(self.fr) return s def __getattr__(self, name): if self._elemdict.has_key(name): cls = self._elemdict[name] return DelayedComponentItem(cls, self) if self._propdict.has_key(name): cls = self._propdict[name] return cls(self) raise AttributeError, name class DelayedComponentItem: def __init__(self, compclass, fr): self.compclass = compclass self.fr = fr def __call__(self, which): return self.compclass(which, self.fr) def __repr__(self): return "%s(???, %s)" % (self.__class__.__name__, `self.fr`) def __str__(self): return "selector for element %s of %s"%(self.__class__.__name__, str(self.fr)) template = """ class %s(ComponentItem): want = '%s' """ exec template % ("Text", 'text') exec template % ("Character", 'cha ') exec template % ("Word", 'cwor') exec template % ("Line", 'clin') exec template % ("paragraph", 'cpar') exec template % ("Window", 'cwin') exec template % ("Document", 'docu') exec template % ("File", 'file') exec template % ("InsertionPoint", 'cins') From jackjansen@users.sourceforge.net Sun Aug 19 23:25:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:25:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Windows.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28252/Python/Mac/Lib/lib-compat Added Files: Windows.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Windows.py --- from Carbon.Windows import * From jackjansen@users.sourceforge.net Sun Aug 19 23:25:32 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:25:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat MediaDescr.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28303/Python/Mac/Lib/lib-compat Added Files: MediaDescr.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: MediaDescr.py --- from Carbon.MediaDescr import * From jackjansen@users.sourceforge.net Sun Aug 19 23:25:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:25:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Menus.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28328/Python/Mac/Lib/lib-compat Added Files: Menus.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Menus.py --- from Carbon.Menus import * From jackjansen@users.sourceforge.net Sun Aug 19 23:26:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Events.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28681/Python/Mac/Lib/lib-compat Added Files: Events.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Events.py --- from Carbon.Events import * From jackjansen@users.sourceforge.net Sun Aug 19 23:26:31 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Components.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28568/Python/Mac/Lib/lib-compat Added Files: Components.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Components.py --- from Carbon.Components import * From jackjansen@users.sourceforge.net Sun Aug 19 23:18:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:18:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Appearance.py,1.7,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26345/Python/Mac/Lib/lib-toolbox Removed Files: Appearance.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Appearance.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:18:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:18:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Balloons.py,1.6,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26417/Python/Mac/Lib/lib-toolbox Removed Files: Balloons.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Balloons.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:18:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:18:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox ControlAccessor.py,1.5,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26536/Python/Mac/Lib/lib-toolbox Removed Files: ControlAccessor.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- ControlAccessor.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:19:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Fonts.py,1.9,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26748/Python/Mac/Lib/lib-toolbox Removed Files: Fonts.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Fonts.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:19:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:19:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Icons.py,1.7,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26784/Python/Mac/Lib/lib-toolbox Removed Files: Icons.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Icons.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:12:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:12:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon QuickDraw.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv25104/Python/Mac/Lib/Carbon Added Files: QuickDraw.py Log Message: The modules with toolbox constants. --- NEW FILE: QuickDraw.py --- # Generated from 'QuickDraw.h' def FOUR_CHAR_CODE(x): return x normal = 0 bold = 1 italic = 2 underline = 4 outline = 8 shadow = 0x10 condense = 0x20 extend = 0x40 invalColReq = -1 srcCopy = 0 srcOr = 1 srcXor = 2 srcBic = 3 notSrcCopy = 4 notSrcOr = 5 notSrcXor = 6 notSrcBic = 7 patCopy = 8 patOr = 9 patXor = 10 patBic = 11 notPatCopy = 12 notPatOr = 13 notPatXor = 14 notPatBic = 15 grayishTextOr = 49 hilitetransfermode = 50 hilite = 50 blend = 32 addPin = 33 addOver = 34 subPin = 35 addMax = 37 adMax = 37 subOver = 38 adMin = 39 ditherCopy = 64 transparent = 36 italicBit = 1 ulineBit = 2 outlineBit = 3 shadowBit = 4 condenseBit = 5 extendBit = 6 normalBit = 0 inverseBit = 1 redBit = 4 greenBit = 3 blueBit = 2 cyanBit = 8 magentaBit = 7 yellowBit = 6 blackBit = 5 blackColor = 33 whiteColor = 30 redColor = 205 greenColor = 341 blueColor = 409 cyanColor = 273 magentaColor = 137 yellowColor = 69 picLParen = 0 picRParen = 1 clutType = 0 fixedType = 1 directType = 2 gdDevType = 0 interlacedDevice = 2 roundedDevice = 5 hasAuxMenuBar = 6 burstDevice = 7 ext32Device = 8 ramInit = 10 mainScreen = 11 allInit = 12 screenDevice = 13 noDriver = 14 screenActive = 15 hiliteBit = 7 pHiliteBit = 0 defQDColors = 127 RGBDirect = 16 baseAddr32 = 4 sysPatListID = 0 iBeamCursor = 1 crossCursor = 2 plusCursor = 3 watchCursor = 4 kQDGrafVerbFrame = 0 kQDGrafVerbPaint = 1 kQDGrafVerbErase = 2 kQDGrafVerbInvert = 3 kQDGrafVerbFill = 4 frame = kQDGrafVerbFrame paint = kQDGrafVerbPaint erase = kQDGrafVerbErase invert = kQDGrafVerbInvert fill = kQDGrafVerbFill chunky = 0 chunkyPlanar = 1 planar = 2 singleDevicesBit = 0 dontMatchSeedsBit = 1 allDevicesBit = 2 singleDevices = 1 << singleDevicesBit dontMatchSeeds = 1 << dontMatchSeedsBit allDevices = 1 << allDevicesBit kPrinterFontStatus = 0 kPrinterScalingStatus = 1 kNoConstraint = 0 kVerticalConstraint = 1 kHorizontalConstraint = 2 k1MonochromePixelFormat = 0x00000001 k2IndexedPixelFormat = 0x00000002 k4IndexedPixelFormat = 0x00000004 k8IndexedPixelFormat = 0x00000008 k16BE555PixelFormat = 0x00000010 k24RGBPixelFormat = 0x00000018 k32ARGBPixelFormat = 0x00000020 k1IndexedGrayPixelFormat = 0x00000021 k2IndexedGrayPixelFormat = 0x00000022 k4IndexedGrayPixelFormat = 0x00000024 k8IndexedGrayPixelFormat = 0x00000028 k16LE555PixelFormat = FOUR_CHAR_CODE('L555') k16LE5551PixelFormat = FOUR_CHAR_CODE('5551') k16BE565PixelFormat = FOUR_CHAR_CODE('B565') k16LE565PixelFormat = FOUR_CHAR_CODE('L565') k24BGRPixelFormat = FOUR_CHAR_CODE('24BG') k32BGRAPixelFormat = FOUR_CHAR_CODE('BGRA') k32ABGRPixelFormat = FOUR_CHAR_CODE('ABGR') k32RGBAPixelFormat = FOUR_CHAR_CODE('RGBA') kYUVSPixelFormat = FOUR_CHAR_CODE('yuvs') kYUVUPixelFormat = FOUR_CHAR_CODE('yuvu') kYVU9PixelFormat = FOUR_CHAR_CODE('YVU9') kYUV411PixelFormat = FOUR_CHAR_CODE('Y411') kYVYU422PixelFormat = FOUR_CHAR_CODE('YVYU') kUYVY422PixelFormat = FOUR_CHAR_CODE('UYVY') kYUV211PixelFormat = FOUR_CHAR_CODE('Y211') kCursorImageMajorVersion = 0x0001 kCursorImageMinorVersion = 0x0000 kQDParseRegionFromTop = (1 << 0) kQDParseRegionFromBottom = (1 << 1) kQDParseRegionFromLeft = (1 << 2) kQDParseRegionFromRight = (1 << 3) kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft kQDParseRegionFromBottomRight = kQDParseRegionFromBottom | kQDParseRegionFromRight kQDRegionToRectsMsgInit = 1 kQDRegionToRectsMsgParse = 2 kQDRegionToRectsMsgTerminate = 3 colorXorXFer = 52 noiseXFer = 53 customXFer = 54 kXFer1PixelAtATime = 0x00000001 kXFerConvertPixelToRGB32 = 0x00000002 kCursorComponentsVersion = 0x00010001 kCursorComponentType = FOUR_CHAR_CODE('curs') cursorDoesAnimate = 1L << 0 cursorDoesHardware = 1L << 1 cursorDoesUnreadableScreenBits = 1L << 2 kRenderCursorInHardware = 1L << 0 kRenderCursorInSoftware = 1L << 1 kCursorComponentInit = 0x0001 kCursorComponentGetInfo = 0x0002 kCursorComponentSetOutputMode = 0x0003 kCursorComponentSetData = 0x0004 kCursorComponentReconfigure = 0x0005 kCursorComponentDraw = 0x0006 kCursorComponentErase = 0x0007 kCursorComponentMove = 0x0008 kCursorComponentAnimate = 0x0009 kCursorComponentLastReserved = 0x0050 # Generated from 'QuickDrawText.h' def FOUR_CHAR_CODE(x): return x normal = 0 bold = 1 italic = 2 underline = 4 outline = 8 shadow = 0x10 condense = 0x20 extend = 0x40 leftCaret = 0 rightCaret = -1 kHilite = 1 smLeftCaret = 0 smRightCaret = -1 smHilite = 1 onlyStyleRun = 0 leftStyleRun = 1 rightStyleRun = 2 middleStyleRun = 3 smOnlyStyleRun = 0 smLeftStyleRun = 1 smRightStyleRun = 2 smMiddleStyleRun = 3 tfAntiAlias = 1 << 0 tfUnicode = 1 << 1 From jackjansen@users.sourceforge.net Sun Aug 19 23:18:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:18:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox aetools.py,1.7,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26247/Python/Mac/Lib/lib-toolbox Removed Files: aetools.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- aetools.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:18:34 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:18:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox AppleEvents.py,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv26382/Python/Mac/Lib/lib-toolbox Removed Files: AppleEvents.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- AppleEvents.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:20:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:20:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Resources.py,1.6,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv27151/Python/Mac/Lib/lib-toolbox Removed Files: Resources.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- Resources.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:20:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:20:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox TextEdit.py,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv27256/Python/Mac/Lib/lib-toolbox Removed Files: TextEdit.py Log Message: Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package. --- TextEdit.py DELETED --- From jackjansen@users.sourceforge.net Sun Aug 19 23:26:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Sound.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28448/Python/Mac/Lib/lib-compat Added Files: Sound.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Sound.py --- from Carbon.Sound import * From jackjansen@users.sourceforge.net Sun Aug 19 23:26:41 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Controls.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28611/Python/Mac/Lib/lib-compat Added Files: Controls.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Controls.py --- from Carbon.Controls import * From jackjansen@users.sourceforge.net Sun Aug 19 23:26:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat ControlAccessor.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28587/Python/Mac/Lib/lib-compat Added Files: ControlAccessor.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: ControlAccessor.py --- from Carbon.ControlAccessor import * From jackjansen@users.sourceforge.net Sun Aug 19 23:21:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:21:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv27435/lib-compat Log Message: Directory /cvsroot/python/python/dist/src/Mac/Lib/lib-compat added to the repository From jackjansen@users.sourceforge.net Sun Aug 19 23:26:16 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:26:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Appearance.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv28518/Python/Mac/Lib/lib-compat Added Files: Appearance.py Log Message: Compatibility modules. lib-compat is on the default sys.path for MacPython 2.2, and each of these modules imports * from its namesake in the Carbon package. --- NEW FILE: Appearance.py --- from Carbon.Appearance import * From jackjansen@users.sourceforge.net Sun Aug 19 23:05:08 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 15:05:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib MiniAEFrame.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23334/Python/Mac/Lib Added Files: MiniAEFrame.py Log Message: Moved here from lib-toolbox, where they should never have been in the first place (all the other stuff there wa generated with bgen). --- NEW FILE: MiniAEFrame.py --- """MiniAEFrame - A minimal AppleEvent Application framework. There are two classes: AEServer -- a mixin class offering nice AE handling. MiniApplication -- a very minimal alternative to FrameWork.py, only suitable for the simplest of AppleEvent servers. """ import sys import traceback import MacOS import AE from AppleEvents import * import Evt from Events import * import Menu import Win from Windows import * import Qd import aetools import EasyDialogs kHighLevelEvent = 23 # Not defined anywhere for Python yet? class MiniApplication: """A minimal FrameWork.Application-like class""" def __init__(self): self.quitting = 0 # Initialize menu self.appleid = 1 self.quitid = 2 Menu.ClearMenuBar() self.applemenu = applemenu = Menu.NewMenu(self.appleid, "\024") applemenu.AppendMenu("%s;(-" % self.getaboutmenutext()) if MacOS.runtimemodel == 'ppc': applemenu.AppendResMenu('DRVR') applemenu.InsertMenu(0) self.quitmenu = Menu.NewMenu(self.quitid, "File") self.quitmenu.AppendMenu("Quit") self.quitmenu.SetItemCmd(1, ord("Q")) self.quitmenu.InsertMenu(0) Menu.DrawMenuBar() def __del__(self): self.close() def close(self): pass def mainloop(self, mask = everyEvent, timeout = 60*60): while not self.quitting: self.dooneevent(mask, timeout) def _quit(self): self.quitting = 1 def dooneevent(self, mask = everyEvent, timeout = 60*60): got, event = Evt.WaitNextEvent(mask, timeout) if got: self.lowlevelhandler(event) def lowlevelhandler(self, event): what, message, when, where, modifiers = event h, v = where if what == kHighLevelEvent: msg = "High Level Event: %s %s" % \ (`code(message)`, `code(h | (v<<16))`) try: AE.AEProcessAppleEvent(event) except AE.Error, err: print 'AE error: ', err print 'in', msg traceback.print_exc() return elif what == keyDown: c = chr(message & charCodeMask) if modifiers & cmdKey: if c == '.': raise KeyboardInterrupt, "Command-period" if c == 'q': MacOS.OutputSeen() self.quitting = 1 return elif what == mouseDown: partcode, window = Win.FindWindow(where) if partcode == inMenuBar: result = Menu.MenuSelect(where) id = (result>>16) & 0xffff # Hi word item = result & 0xffff # Lo word if id == self.appleid: if item == 1: EasyDialogs.Message(self.getabouttext()) elif item > 1 and hasattr(Menu, 'OpenDeskAcc'): name = self.applemenu.GetMenuItemText(item) Menu.OpenDeskAcc(name) elif id == self.quitid and item == 1: MacOS.OutputSeen() self.quitting = 1 Menu.HiliteMenu(0) return # Anything not handled is passed to Python/SIOUX MacOS.HandleEvent(event) def getabouttext(self): return self.__class__.__name__ def getaboutmenutext(self): return "About %s\311" % self.__class__.__name__ class AEServer: def __init__(self): self.ae_handlers = {} def installaehandler(self, classe, type, callback): AE.AEInstallEventHandler(classe, type, self.callback_wrapper) self.ae_handlers[(classe, type)] = callback def close(self): for classe, type in self.ae_handlers.keys(): AE.AERemoveEventHandler(classe, type) def callback_wrapper(self, _request, _reply): _parameters, _attributes = aetools.unpackevent(_request) _class = _attributes['evcl'].type _type = _attributes['evid'].type if self.ae_handlers.has_key((_class, _type)): _function = self.ae_handlers[(_class, _type)] elif self.ae_handlers.has_key((_class, '****')): _function = self.ae_handlers[(_class, '****')] elif self.ae_handlers.has_key(('****', '****')): _function = self.ae_handlers[('****', '****')] else: raise 'Cannot happen: AE callback without handler', (_class, _type) # XXXX Do key-to-name mapping here _parameters['_attributes'] = _attributes _parameters['_class'] = _class _parameters['_type'] = _type if _parameters.has_key('----'): _object = _parameters['----'] del _parameters['----'] # The try/except that used to be here can mask programmer errors. # Let the program crash, the programmer can always add a **args # to the formal parameter list. rv = apply(_function, (_object,), _parameters) else: #Same try/except comment as above rv = apply(_function, (), _parameters) if rv == None: aetools.packevent(_reply, {}) else: aetools.packevent(_reply, {'----':rv}) def code(x): "Convert a long int to the 4-character code it really is" s = '' for i in range(4): x, c = divmod(x, 256) s = chr(c) + s return s class _Test(AEServer, MiniApplication): """Mini test application, handles required events""" def __init__(self): MiniApplication.__init__(self) AEServer.__init__(self) self.installaehandler('aevt', 'oapp', self.open_app) self.installaehandler('aevt', 'quit', self.quit) self.installaehandler('****', '****', self.other) self.mainloop() def quit(self, **args): self._quit() def open_app(self, **args): pass def other(self, _object=None, _class=None, _type=None, **args): print 'AppleEvent', (_class, _type), 'for', _object, 'Other args:', args if __name__ == '__main__': _Test() From jackjansen@users.sourceforge.net Sun Aug 19 22:17:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 19 Aug 2001 14:17:05 -0700 Subject: [Python-checkins] CVS: python/dist/src README,1.124,1.125 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv15199/Python Modified Files: README Log Message: Removed NeXT notes (replacing them with a line saying NeXT is no longer supported) and updated MacOSX notes. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** README 2001/05/09 18:13:47 1.124 --- README 2001/08/19 21:17:03 1.125 *************** *** 301,306 **** Sunisms. ! NeXT: To build fat binaries, use the --with-next-archs switch ! described below. QNX: Chris Herborth (chrish@qnx.com) writes: --- 301,306 ---- Sunisms. ! NeXT: Not supported anymore. Start with the MacOSX/Darwin code if you ! want to revive it. QNX: Chris Herborth (chrish@qnx.com) writes: *************** *** 387,400 **** future release. ! Mac OS X 10.0: Run configure with "OPT='-no-cpp-precomp' ./configure ! --with-suffix=.exe --with-dyld". This generates executable ! file: 'python.exe' (it cannot be named 'python' on an HFS or ! HFS+ disk as the file name clashes with directory 'Python'). ! The '-no-cpp-precomp' option prevents a large number of ! compilation warnings. One of the regular expression tests ! fails with a SEGV due to the small stack size used by default ! (how to change this?), and the test_largefile test is only ! expected to work on a Unix UFS filesystem (how to check for ! this on Mac OS X?). Cygwin: Cygwin Python builds OOTB when configured as follows: --- 387,406 ---- future release. ! Mac OS X 10.0: Run configure with "./configure --with-suffix=.exe". ! This generates executable file: 'python.exe' (it cannot be named ! 'python' on an HFS or HFS+ disk as the file name clashes with ! directory 'Python'). One of the regular expression tests fails ! with a SEGV due to the small stack size used by default (how to ! change this?), and the test_largefile test is only expected to ! work on a Unix UFS filesystem (how to check for this on Mac OS ! X?). ! On naked Darwin you may have to add the configure option ! "--without-toolbox-glue" to disable the glue code for the Carbon ! interface modules. (The modules themselves are currently not built ! by default as they are experimental, on real OSX you can enable them ! in setup.py). ! You may want to try the configure option "--enable-framework" which ! installs Python as a framework. The location can be set as argument ! to the --enable-framework option (default /Library/Frameworks). Cygwin: Cygwin Python builds OOTB when configured as follows: *************** *** 619,622 **** --- 625,633 ---- came with Emacs for installation of site-specific files. + On Mac OS X, if you have configured Python with --enable-framework, you + should use "make frameworkinstall" to do the installation. Note that this + installs the Python executable in a place that is not normally on your + PATH, you may want to set up a symlink in /usr/local/bin. + Configuration options and variables *************** *** 701,709 **** --with-libc=-lc_s. These libraries are passed after all other libraries, the C library last. - - --with-next-archs='arch1 arch2': Under NEXTSTEP, this will build - all compiled binaries with the architectures listed. This will - also correctly set the target architecture-specific resource - directory. (This option is not supported on other platforms.) --with-libs='libs': Add 'libs' to the LIBS that the python interpreter --- 712,715 ---- From jackjansen@users.sourceforge.net Mon Aug 20 11:20:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 20 Aug 2001 03:20:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build _dummy_tkinter.mcp.exp,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv18090/python/Mac/Build Added Files: _dummy_tkinter.mcp.exp Log Message: Oops, this file shouldn't have been removed. From gvanrossum@users.sourceforge.net Mon Aug 20 14:05:14 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 06:05:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEXT-NOTES,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv17893 Removed Files: Tag: r22a2-branch NEXT-NOTES Log Message: Deleted in trunk by Jack -> deleting in branch. --- NEXT-NOTES DELETED --- From gvanrossum@users.sourceforge.net Mon Aug 20 14:06:25 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 06:06:25 -0700 Subject: [Python-checkins] CVS: python/dist/src README,1.124,1.124.4.1 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv18132 Modified Files: Tag: r22a2-branch README Log Message: Merge Jack's NeXT and MacOS updates into the branch Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.124 retrieving revision 1.124.4.1 diff -C2 -d -r1.124 -r1.124.4.1 *** README 2001/05/09 18:13:47 1.124 --- README 2001/08/20 13:06:23 1.124.4.1 *************** *** 301,306 **** Sunisms. ! NeXT: To build fat binaries, use the --with-next-archs switch ! described below. QNX: Chris Herborth (chrish@qnx.com) writes: --- 301,306 ---- Sunisms. ! NeXT: Not supported anymore. Start with the MacOSX/Darwin code if you ! want to revive it. QNX: Chris Herborth (chrish@qnx.com) writes: *************** *** 387,400 **** future release. ! Mac OS X 10.0: Run configure with "OPT='-no-cpp-precomp' ./configure ! --with-suffix=.exe --with-dyld". This generates executable ! file: 'python.exe' (it cannot be named 'python' on an HFS or ! HFS+ disk as the file name clashes with directory 'Python'). ! The '-no-cpp-precomp' option prevents a large number of ! compilation warnings. One of the regular expression tests ! fails with a SEGV due to the small stack size used by default ! (how to change this?), and the test_largefile test is only ! expected to work on a Unix UFS filesystem (how to check for ! this on Mac OS X?). Cygwin: Cygwin Python builds OOTB when configured as follows: --- 387,406 ---- future release. ! Mac OS X 10.0: Run configure with "./configure --with-suffix=.exe". ! This generates executable file: 'python.exe' (it cannot be named ! 'python' on an HFS or HFS+ disk as the file name clashes with ! directory 'Python'). One of the regular expression tests fails ! with a SEGV due to the small stack size used by default (how to ! change this?), and the test_largefile test is only expected to ! work on a Unix UFS filesystem (how to check for this on Mac OS ! X?). ! On naked Darwin you may have to add the configure option ! "--without-toolbox-glue" to disable the glue code for the Carbon ! interface modules. (The modules themselves are currently not built ! by default as they are experimental, on real OSX you can enable them ! in setup.py). ! You may want to try the configure option "--enable-framework" which ! installs Python as a framework. The location can be set as argument ! to the --enable-framework option (default /Library/Frameworks). Cygwin: Cygwin Python builds OOTB when configured as follows: *************** *** 619,622 **** --- 625,633 ---- came with Emacs for installation of site-specific files. + On Mac OS X, if you have configured Python with --enable-framework, you + should use "make frameworkinstall" to do the installation. Note that this + installs the Python executable in a place that is not normally on your + PATH, you may want to set up a symlink in /usr/local/bin. + Configuration options and variables *************** *** 701,709 **** --with-libc=-lc_s. These libraries are passed after all other libraries, the C library last. - - --with-next-archs='arch1 arch2': Under NEXTSTEP, this will build - all compiled binaries with the architectures listed. This will - also correctly set the target architecture-specific resource - directory. (This option is not supported on other platforms.) --with-libs='libs': Add 'libs' to the LIBS that the python interpreter --- 712,715 ---- From esr@users.sourceforge.net Mon Aug 20 14:16:32 2001 From: esr@users.sourceforge.net (Eric S. Raymond) Date: Mon, 20 Aug 2001 06:16:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcompilerlike.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv20067/Doc/lib Modified Files: libcompilerlike.tex Log Message: Clean up some argument profiles, enrich the docstring. Index: libcompilerlike.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcompilerlike.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** libcompilerlike.tex 2001/08/18 09:24:38 1.1 --- libcompilerlike.tex 2001/08/20 13:16:30 1.2 *************** *** 32,36 **** generating error messages, but it could be arbitrary data. ! The second argument, is interpreted as a list of filenames. The files are transformed in left to right order in the list. A filename consisting of a dash is interpreted as a directive to read from --- 32,36 ---- generating error messages, but it could be arbitrary data. ! The second argument is interpreted as a list of filenames. The files are transformed in left to right order in the list. A filename consisting of a dash is interpreted as a directive to read from *************** *** 60,65 **** and the exception is then passed upwards. ! \begin{funcdesc}{filefilter}{name, arguments, trans_data\optional{,trans_file}} ! Filter using a function taking the name and two file-object arguments. The function is expected to read data from the input file object, transform it, and write the data to the output file object. --- 60,65 ---- and the exception is then passed upwards. ! \begin{funcdesc}{filefilter}{name, file, arguments, trans_data\optional{,trans_file}} ! Filter using a function taking the name, filename, and two file-object arguments. The function is expected to read data from the input file object, transform it, and write the data to the output file object. *************** *** 68,84 **** \end{funcdesc} ! \begin{funcdesc}{linefilter}{name,arguments,trans_data\optional{,trans_file}} ! Filter using a function taking the name and a string argument. The return ! value of the function should be a string. This function is applied to ! each line in the input file in turn; the return values become the ! lines of the transformed file. \end{funcdesc} ! \begin{funcdesc}{sponge}{name, arguments, trans_data\optional{, trans_file}} ! Filter using a function taking the name and a string argument. The ! return value of the function should be a string. The function will be ! passed the entire contents of the input file as a string. The string ! return value of the function will become the entire contents of the ! transformed file. \end{funcdesc} --- 68,84 ---- \end{funcdesc} ! \begin{funcdesc}{linefilter}{name, file, arguments,trans_data\optional{,trans_file}} ! Filter using a function taking the name, the filename, and a string ! argument. The return value of the function should be a string. This ! function is applied to each line in the input file in turn; the return ! values become the lines of the transformed file. \end{funcdesc} ! \begin{funcdesc}{sponge}{name, file, arguments, trans_data\optional{, trans_file}} ! Filter using a function taking the name, the filename, and a string ! argument. The return value of the function should be a string. The ! function will be passed the entire contents of the input file as a ! string. The string return value of the function will become the ! entire contents of the transformed file. \end{funcdesc} From esr@users.sourceforge.net Mon Aug 20 14:16:32 2001 From: esr@users.sourceforge.net (Eric S. Raymond) Date: Mon, 20 Aug 2001 06:16:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib compilerlike.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv20067/Lib Modified Files: compilerlike.py Log Message: Clean up some argument profiles, enrich the docstring. Index: compilerlike.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compilerlike.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** compilerlike.py 2001/08/18 09:24:38 1.1 --- compilerlike.py 2001/08/20 13:16:30 1.2 *************** *** 8,17 **** output file. ! This module provides framework and glue code to make such programs easy ! to write. You supply a function to massage the file data; depending ! on which entry point you use, it can take input and output file pointers, ! or it can take a string consisting of the entire file's data and return ! a replacement, or it can take in succession strings consisting of each ! of the file's lines and return a translated line for each. Argument files are transformed in left to right order in the argument list. --- 8,28 ---- output file. ! This module provides framework and glue code to make such programs ! easy to write. You supply a function to massage the file data. It ! always takes initial name and filename arguments; depending on which ! entry point you use, it can also take input and output file pointers, ! or it can take a string consisting of the entire file's data and ! return a replacement, or it can take in succession strings consisting ! of each of the file's lines and return a translated line for each. ! ! The fourth, optional argument of each entry point is a name ! transformation function or name suffix string. If it is of string ! type, the shortest suffix of each filename beginning with the first ! character of the argument string is stripped off. If the first ! character of the argument does not occur in the filename, no suffix is ! removed. Then the name suffix argument is concatenated to the end of ! the stripped filename. (Thus, a name suffix argument of ".x" will ! cause the filenames foo.c and bar.d to be transformed to foo.x and ! bar.x respectively.) Argument files are transformed in left to right order in the argument list. *************** *** 26,31 **** # Requires Python 2. - from __future__ import nested_scopes - import sys, os, filecmp, traceback --- 37,40 ---- *************** *** 33,37 **** "Filter stdin to stdout, or file arguments to renamed files." if not arguments: ! trans_data("stdin", sys.stdin, sys.stdout) else: for file in arguments: --- 42,46 ---- "Filter stdin to stdout, or file arguments to renamed files." if not arguments: ! trans_data(name, "stdin", sys.stdin, sys.stdout) else: for file in arguments: *************** *** 44,48 **** outfp = open(tempfile, "w") try: ! trans_data(file, infp, outfp) except: os.remove(tempfile) --- 53,57 ---- outfp = open(tempfile, "w") try: ! trans_data(name, file, infp, outfp) except: os.remove(tempfile) *************** *** 63,67 **** os.rename(tempfile, trans_filename(file)) ! def line_by_line(name, infp, outfp, translate_line): "Hook to do line-by-line translation for filters." while 1: --- 72,76 ---- os.rename(tempfile, trans_filename(file)) ! def line_by_line(name, file, infp, outfp, translate_line): "Hook to do line-by-line translation for filters." while 1: *************** *** 70,74 **** break elif line: # None returns are skipped ! outfp.write(translate_line(name, line)) def linefilter(name, arguments, trans_data, trans_filename=None): --- 79,83 ---- break elif line: # None returns are skipped ! outfp.write(translate_line(name, file, line)) def linefilter(name, arguments, trans_data, trans_filename=None): *************** *** 76,80 **** return filefilter(name, arguments, ! lambda name, infp, outfp: line_by_line(name, infp, outfp, trans_data), trans_filename) --- 85,89 ---- return filefilter(name, arguments, ! lambda name, file, infp, outfp: line_by_line(name, file, infp, outfp, trans_data), trans_filename) *************** *** 82,86 **** "Read input sources entire and transform them in memory." if not arguments: ! sys.stdout.write(trans_data(name, sys.stdin.read())) else: for file in arguments: --- 91,95 ---- "Read input sources entire and transform them in memory." if not arguments: ! sys.stdout.write(trans_data(name, "stdin", sys.stdin.read())) else: for file in arguments: *************** *** 95,99 **** return 1 try: ! outdoc = trans_data(name, indoc) except: os.remove(tempfile) --- 104,108 ---- return 1 try: ! outdoc = trans_data(name, file, indoc) except: os.remove(tempfile) *************** *** 121,125 **** return name + ".out" ! def filefilter_test(name, infp, outfp): "Test hook for filefilter entry point -- put dashes before blank lines." while 1: --- 130,134 ---- return name + ".out" ! def filefilter_test(name, file, infp, outfp): "Test hook for filefilter entry point -- put dashes before blank lines." while 1: *************** *** 131,139 **** outfp.write(line) ! def linefilter_test(name, data): "Test hook for linefilter entry point -- wrap lines in brackets." return "<" + data[:-1] + ">\n" ! def sponge_test(name, data): "Test hook for the sponge entry point -- reverse file lines." lines = data.split("\n") --- 140,148 ---- outfp.write(line) ! def linefilter_test(name, file, data): "Test hook for linefilter entry point -- wrap lines in brackets." return "<" + data[:-1] + ">\n" ! def sponge_test(name, file, data): "Test hook for the sponge entry point -- reverse file lines." lines = data.split("\n") From jackjansen@users.sourceforge.net Mon Aug 20 16:31:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 20 Aug 2001 08:31:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts genpluginprojects.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv24096/python/Mac/scripts Modified Files: genpluginprojects.py Log Message: Various toolbox modules were generated in lib-dynload accidentally in stead of in Carbon. Fixed. Index: genpluginprojects.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/genpluginprojects.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** genpluginprojects.py 2001/08/19 22:29:57 1.17 --- genpluginprojects.py 2001/08/20 15:31:56 1.18 *************** *** 41,47 **** # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, ! libraries, extradirs, extraexportsymbols) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, ! libraries, extradirs, extraexportsymbols) return templatename = "template-%s" % architecture --- 41,47 ---- # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, ! libraries, extradirs, extraexportsymbols, outputdir) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, ! libraries, extradirs, extraexportsymbols, outputdir) return templatename = "template-%s" % architecture *************** *** 124,128 **** genpluginproject("all", "Fm", outputdir="::Lib:Carbon") genpluginproject("ppc", "Help", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Icn", libraries=["IconServicesLib"]) genpluginproject("carbon", "Icn", outputdir="::Lib:Carbon") genpluginproject("all", "List", outputdir="::Lib:Carbon") --- 124,128 ---- genpluginproject("all", "Fm", outputdir="::Lib:Carbon") genpluginproject("ppc", "Help", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Icn", libraries=["IconServicesLib"], outputdir="::Lib:Carbon") genpluginproject("carbon", "Icn", outputdir="::Lib:Carbon") genpluginproject("all", "List", outputdir="::Lib:Carbon") From jackjansen@users.sourceforge.net Mon Aug 20 16:35:27 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 20 Aug 2001 08:35:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Sndihooks.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv24911/python/Mac/Lib/lib-compat Added Files: Sndihooks.py Log Message: Oops, these compatibility modules were missing. Which went unnoticed because their companions had been put in the wrong place. --- NEW FILE: Sndihooks.py --- from Carbon.Sndihooks import * From jackjansen@users.sourceforge.net Mon Aug 20 16:35:32 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 20 Aug 2001 08:35:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Scrap.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv24938/python/Mac/Lib/lib-compat Added Files: Scrap.py Log Message: Oops, these compatibility modules were missing. Which went unnoticed because their companions had been put in the wrong place. --- NEW FILE: Scrap.py --- from Carbon.Scrap import * From jackjansen@users.sourceforge.net Mon Aug 20 16:35:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 20 Aug 2001 08:35:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Qdoffs.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv24961/python/Mac/Lib/lib-compat Added Files: Qdoffs.py Log Message: Oops, these compatibility modules were missing. Which went unnoticed because their companions had been put in the wrong place. --- NEW FILE: Qdoffs.py --- from Carbon.Qdoffs import * From jackjansen@users.sourceforge.net Mon Aug 20 16:35:41 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 20 Aug 2001 08:35:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat List.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv24994/python/Mac/Lib/lib-compat Added Files: List.py Log Message: Oops, these compatibility modules were missing. Which went unnoticed because their companions had been put in the wrong place. --- NEW FILE: List.py --- from Carbon.List import * From jackjansen@users.sourceforge.net Mon Aug 20 16:35:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 20 Aug 2001 08:35:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Fm.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv25037/python/Mac/Lib/lib-compat Added Files: Fm.py Log Message: Oops, these compatibility modules were missing. Which went unnoticed because their companions had been put in the wrong place. --- NEW FILE: Fm.py --- from Carbon.Fm import * From jackjansen@users.sourceforge.net Mon Aug 20 16:35:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 20 Aug 2001 08:35:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Evt.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv25059/python/Mac/Lib/lib-compat Added Files: Evt.py Log Message: Oops, these compatibility modules were missing. Which went unnoticed because their companions had been put in the wrong place. --- NEW FILE: Evt.py --- from Carbon.Evt import * From jackjansen@users.sourceforge.net Mon Aug 20 16:35:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 20 Aug 2001 08:35:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Qd.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv25086/python/Mac/Lib/lib-compat Added Files: Qd.py Log Message: Oops, these compatibility modules were missing. Which went unnoticed because their companions had been put in the wrong place. --- NEW FILE: Qd.py --- from Carbon.Qd import * From jackjansen@users.sourceforge.net Mon Aug 20 16:35:59 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 20 Aug 2001 08:35:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Res.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv25109/python/Mac/Lib/lib-compat Added Files: Res.py Log Message: Oops, these compatibility modules were missing. Which went unnoticed because their companions had been put in the wrong place. --- NEW FILE: Res.py --- from Carbon.Res import * From fdrake@users.sourceforge.net Mon Aug 20 17:49:01 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 20 Aug 2001 09:49:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.140,1.141 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv10474/api Modified Files: api.tex Log Message: Document PyTuple_GET_SIZE(), removing confusing sentence from PyDict_Copy() description. This fixes SF bug #453111. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** api.tex 2001/08/16 13:14:59 1.140 --- api.tex 2001/08/20 16:48:59 1.141 *************** *** 3591,3594 **** --- 3591,3599 ---- \end{cfuncdesc} + \begin{cfuncdesc}{int}{PyTuple_GET_SIZE}{PyObject *p} + Return the size of the tuple \var{p}, which must be non-\NULL{} and + point to a tuple; no error checking is performed. + \end{cfuncdesc} + \begin{cfuncdesc}{PyObject*}{PyTuple_GetItem}{PyObject *p, int pos} Returns the object at position \var{pos} in the tuple pointed *************** *** 3781,3786 **** \begin{cfuncdesc}{PyObject*}{PyDict_Copy}{PyObject *p} ! Returns a new dictionary that contains the same key-value pairs as p. ! Empties an existing dictionary of all key-value pairs. \versionadded{1.6} \end{cfuncdesc} --- 3786,3791 ---- \begin{cfuncdesc}{PyObject*}{PyDict_Copy}{PyObject *p} ! Returns a new dictionary that contains the same key-value pairs as ! \var{p}. \versionadded{1.6} \end{cfuncdesc} From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:36 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac errno_unix.h,NONE,1.1.2.1 fopenRF.c,NONE,1.2.2.1 mkapplet.py,NONE,1.8.2.1 mwerksglue.c,NONE,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv16167 Added Files: Tag: r22a2-branch errno_unix.h fopenRF.c mkapplet.py mwerksglue.c Log Message: Merge Jack's changes from the trunk --- NEW FILE: errno_unix.h --- #define ENOTDIR (-120) #define EACCES (-54) #define EEXIST (-48) #define EBUSY (-47) #define EROFS (-44) #define ENOENT (-43) #define ENFILE (-42) #define EIO (-36) #define ENOSPC (-34) #define ESRCH 3 #define EINTR 4 #define EBADF 9 #define ENODEV 19 #define EINVAL 22 #define EMFILE 24 --- NEW FILE: fopenRF.c --- /* * fopen.c * * Copyright (c) 1991 Symantec Corporation. All rights reserved. * */ #include #include "stdio.h" #include "errno.h" #include "string.h" #include "ansi_private.h" extern long _ftype, _fcreator; #define fcbVPtr(fcb) (* (VCB **) (fcb + 20)) #define fcbDirID(fcb) (* (long *) (fcb + 58)) #define fcbCName(fcb) (fcb + 62) static void setfiletype(StringPtr, int); static void stdio_exit(void); static int fileio(FILE *, int); static int close(FILE *); static void replace(unsigned char *, size_t, int, int); FILE *freopenRF(); FILE *__openRF(); FILE * fopenRF(const char *filename, const char *mode) { return(freopenRF(filename, mode, __getfile())); } FILE * freopenRF(const char *filename, const char *mode, FILE *fp) { int omode, oflag; /* interpret "rwa" */ if (mode[0] == 'r') { omode = fsRdPerm; oflag = 0; } else if (mode[0] == 'w') { omode = fsWrPerm; oflag = F_CREAT+F_TRUNC; } else if (mode[0] == 'a') { omode = fsWrPerm; oflag = F_CREAT+F_APPEND; } else { errno = EINVAL; return(NULL); } /* interpret "b+" */ if (mode[1] == 'b') { oflag |= F_BINARY; if (mode[2] == '+') omode = fsRdWrPerm; } else if (mode[1] == '+') { omode = fsRdWrPerm; if (mode[2] == 'b') oflag |= F_BINARY; } /* open the file */ return(__openRF(filename, omode, oflag, fp)); } FILE * __openRF(const char *filename, int omode, int oflag, FILE *fp) { IOParam pb; char pname[FILENAME_MAX]; if (fp == NULL) return(NULL); fclose(fp); /* set up pb */ pb.ioNamePtr = __c2p(filename, pname); pb.ioVRefNum = 0; pb.ioVersNum = 0; pb.ioPermssn = omode; pb.ioMisc = 0; /* create file */ if (oflag & F_CREAT) { PBCreateSync((ParmBlkPtr)&pb); if (pb.ioResult == noErr) oflag &= ~F_TRUNC; else if (pb.ioResult == dupFNErr && !(oflag & F_EXCL)) oflag &= ~F_CREAT; else { errno = pb.ioResult; return(NULL); } } /* open file */ PBOpenRFSync((ParmBlkPtr)&pb); if (pb.ioResult) { errno = pb.ioResult; if (oflag & F_CREAT) PBDeleteSync((ParmBlkPtr)&pb); return(NULL); } fp->refnum = pb.ioRefNum; /* get/set file length */ if (oflag & F_TRUNC) PBSetEOFSync((ParmBlkPtr)&pb); else if (!(oflag & F_CREAT)) PBGetEOFSync((ParmBlkPtr)&pb); fp->len = (fpos_t) pb.ioMisc; /* initialize rest of FILE structure */ if (oflag & F_APPEND) { fp->append = 1; fp->pos = fp->len; } if (oflag & F_BINARY) fp->binary = 1; setvbuf(fp, NULL, _IOFBF, BUFSIZ); fp->proc = fileio; /* set file type */ if (oflag & (F_CREAT|F_TRUNC)) setfiletype(pb.ioNamePtr, oflag); /* done */ __atexit_stdio(stdio_exit); return(fp); } /* * setfiletype - set type/creator of new file * */ static void setfiletype(StringPtr name, int oflag) { FileParam pb; pb.ioNamePtr = name; pb.ioVRefNum = 0; pb.ioFVersNum = 0; pb.ioFDirIndex = 0; if (PBGetFInfoSync((ParmBlkPtr)&pb) == noErr) { if (oflag & F_BINARY) pb.ioFlFndrInfo.fdType = _ftype; else pb.ioFlFndrInfo.fdType = 'TEXT'; pb.ioFlFndrInfo.fdCreator = _fcreator; PBSetFInfoSync((ParmBlkPtr)&pb); } } /* * stdio_exit - stdio shutdown routine * */ static void stdio_exit(void) { register FILE *fp; int n; for (fp = &__file[0], n = FOPEN_MAX; n--; fp++) fclose(fp); } /* * fileio - I/O handler proc for files and devices * */ static int fileio(FILE *fp, int i) { IOParam pb; pb.ioRefNum = fp->refnum; switch (i) { /* read */ case 0: pb.ioBuffer = (Ptr) fp->ptr; pb.ioReqCount = fp->cnt; pb.ioPosMode = fp->refnum > 0 ? fsFromStart : fsAtMark; pb.ioPosOffset = fp->pos - fp->cnt; PBReadSync((ParmBlkPtr)&pb); if (pb.ioResult == eofErr) { fp->pos = pb.ioPosOffset; if (fp->cnt = pb.ioActCount) pb.ioResult = 0; else { fp->eof = 1; return(EOF); } } if (!pb.ioResult && !fp->binary) replace(fp->ptr, fp->cnt, '\r', '\n'); break; /* write */ case 1: pb.ioBuffer = (Ptr) fp->ptr; pb.ioReqCount = fp->cnt; pb.ioPosMode = fp->refnum > 0 ? fsFromStart : fsAtMark; if ((pb.ioPosOffset = fp->pos - fp->cnt) > fp->len) { pb.ioMisc = (Ptr) pb.ioPosOffset; if (PBSetEOFSync((ParmBlkPtr)&pb) != noErr) break; } if (!fp->binary) replace(fp->ptr, fp->cnt, '\n', '\r'); PBWriteSync((ParmBlkPtr)&pb); if (!pb.ioResult && pb.ioPosOffset > fp->len) fp->len = pb.ioPosOffset; break; /* close */ case 2: pb.ioResult = close(fp); break; } /* done */ if (pb.ioResult) { if (i < 2) { fp->pos -= fp->cnt; fp->cnt = 0; } fp->err = 1; errno = pb.ioResult; return(EOF); } return(0); } static int close(FILE *fp) { HFileParam pb; Str255 buf; register char *fcb = FCBSPtr + fp->refnum; VCB *vcb = fcbVPtr(fcb); register char *s; enum { none, MFS, HFS } del = none; pb.ioVRefNum = vcb->vcbVRefNum; if (fp->remove) { pb.ioNamePtr = buf; pb.ioFVersNum = 0; /* close temporary file - HFS */ if (vcb->vcbSigWord == 0x4244) { pb.ioDirID = fcbDirID(fcb); s = fcbCName(fcb); memcpy(buf, s, Length(s) + 1); del = HFS; } /* close temporary file - MFS */ else if (vcb->vcbSigWord == 0xD2D7) { for (pb.ioFDirIndex = 1; PBGetFInfoSync((ParmBlkPtr)&pb) == noErr; pb.ioFDirIndex++) { if (pb.ioFRefNum == fp->refnum) { del = MFS; break; } } } } /* close file and flush volume buffer */ pb.ioFRefNum = fp->refnum; if (PBCloseSync((ParmBlkPtr)&pb) == noErr) { if (del == MFS) PBDeleteSync((ParmBlkPtr)&pb); else if (del == HFS) PBHDeleteSync((HParmBlkPtr)&pb); pb.ioNamePtr = 0; PBFlushVolSync((ParmBlkPtr)&pb); } return(pb.ioResult); } /* * replace - routine for doing CR/LF conversion * */ static void replace(register unsigned char *s, register size_t n, register int c1, register int c2) { #pragma options(honor_register) register unsigned char *t; for (; n && (t = memchr(s, c1, n)); s = t) { *t++ = c2; n -= t - s; } } --- NEW FILE: mkapplet.py --- """Create an applet from a Python script. This puts up a dialog asking for a Python source file ('TEXT'). The output is a file with the same name but its ".py" suffix dropped. It is created by copying an applet template and then adding a 'PYC ' resource named __main__ containing the compiled, marshalled script. """ import sys sys.stdout = sys.stderr import string import os import marshal import imp import macfs import MacOS from Res import * # .pyc file (and 'PYC ' resource magic number) MAGIC = imp.get_magic() # Template file (searched on sys.path) TEMPLATE = "PythonApplet" # Specification of our resource RESTYPE = 'PYC ' RESNAME = '__main__' # A resource with this name sets the "owner" (creator) of the destination OWNERNAME = "owner resource" # OpenResFile mode parameters READ = 1 WRITE = 2 def main(): # Find the template # (there's no point in proceeding if we can't find it) for p in sys.path: template = os.path.join(p, TEMPLATE) try: tmpl = open(template, "rb") tmpl.close() break except IOError: continue else: die("Template %s not found" % `template`) return # Ask for source text if not specified in sys.argv[1:] if not sys.argv[1:]: srcfss, ok = macfs.StandardGetFile('TEXT') if not ok: return filename = srcfss.as_pathname() tp, tf = os.path.split(filename) if tf[-3:] == '.py': tf = tf[:-3] else: tf = tf + '.applet' dstfss, ok = macfs.StandardPutFile('Save application as:', tf) if not ok: return process(template, filename, dstfss.as_pathname()) else: # Loop over all files to be processed for filename in sys.argv[1:]: process(template, filename, '') undefs = ('????', ' ', '\0\0\0\0', 'BINA') def process(template, filename, output): print "Processing", `filename`, "..." # Read the source and compile it # (there's no point overwriting the destination if it has a syntax error) fp = open(filename) text = fp.read() fp.close() try: code = compile(text, filename, "exec") except (SyntaxError, EOFError): die("Syntax error in script %s" % `filename`) return # Set the destination file name if string.lower(filename[-3:]) == ".py": destname = filename[:-3] rsrcname = destname + '.rsrc' else: destname = filename + ".applet" rsrcname = filename + '.rsrc' if output: destname = output # Copy the data from the template (creating the file as well) tmpl = open(template, "rb") dest = open(destname, "wb") data = tmpl.read() if data: dest.write(data) dest.close() tmpl.close() # Copy the creator of the template to the destination # unless it already got one. Set type to APPL tctor, ttype = MacOS.GetCreatorAndType(template) ctor, type = MacOS.GetCreatorAndType(destname) if type in undefs: type = 'APPL' if ctor in undefs: ctor = tctor # Open the output resource fork try: output = FSpOpenResFile(destname, WRITE) except MacOS.Error: print "Creating resource fork..." CreateResFile(destname) output = FSpOpenResFile(destname, WRITE) # Copy the resources from the template input = FSpOpenResFile(template, READ) newctor = copyres(input, output) CloseResFile(input) if newctor: ctor = newctor # Copy the resources from the target specific resource template, if any try: input = FSpOpenResFile(rsrcname, READ) except MacOS.Error: pass else: newctor = copyres(input, output) CloseResFile(input) if newctor: ctor = newctor # Now set the creator and type of the destination MacOS.SetCreatorAndType(destname, ctor, type) # Make sure we're manipulating the output resource file now UseResFile(output) # Delete any existing 'PYC 'resource named __main__ try: res = Get1NamedResource(RESTYPE, RESNAME) res.RmveResource() except Error: pass # Create the raw data for the resource from the code object data = marshal.dumps(code) del code data = (MAGIC + '\0\0\0\0') + data # Create the resource and write it id = 0 while id < 128: id = Unique1ID(RESTYPE) res = Resource(data) res.AddResource(RESTYPE, id, RESNAME) res.WriteResource() res.ReleaseResource() # Close the output file CloseResFile(output) # Give positive feedback message("Applet %s created." % `destname`) # Copy resources between two resource file descriptors. # Exception: don't copy a __main__ resource. # If a resource's name is "owner resource", its type is returned # (so the caller can use it to set the destination's creator) def copyres(input, output): ctor = None UseResFile(input) ntypes = Count1Types() for itype in range(1, 1+ntypes): type = Get1IndType(itype) nresources = Count1Resources(type) for ires in range(1, 1+nresources): res = Get1IndResource(type, ires) id, type, name = res.GetResInfo() lcname = string.lower(name) if (type, lcname) == (RESTYPE, RESNAME): continue # Don't copy __main__ from template if lcname == OWNERNAME: ctor = type size = res.SizeResource() attrs = res.GetResAttrs() print id, type, name, size, hex(attrs) res.LoadResource() res.DetachResource() UseResFile(output) try: res2 = Get1Resource(type, id) except MacOS.Error: res2 = None if res2: print "Overwriting..." res2.RmveResource() res.AddResource(type, id, name) res.WriteResource() attrs = attrs | res.GetResAttrs() print "New attrs =", hex(attrs) res.SetResAttrs(attrs) UseResFile(input) return ctor # Show a message and exit def die(str): message(str) sys.exit(1) # Show a message def message(str, id = 256): from Dlg import * d = GetNewDialog(id, -1) if not d: print "Error:", `str` print "DLOG id =", id, "not found." return tp, h, rect = d.GetDItem(2) SetIText(h, str) while 1: n = ModalDialog(None) if n == 1: break del d if __name__ == '__main__': main() --- NEW FILE: mwerksglue.c --- /* ** Glue code for MetroWerks CodeWarrior, which misses ** unix-like routines for file-access. */ #ifdef __MWERKS__ #include #include #include #include #include int fileno(fp) FILE *fp; { if (fp==stdin) return 0; else if (fp==stdout) return 1; else if (fp==stderr) return 2; else return 3; } int isatty(fd) int fd; { return (fd >= 0 && fd <= 2); } int unlink(old) char *old; { OSErr err; if ((err=FSDelete(c2pstr(old), 0)) == noErr) return 0; errno= err; return -1; } #endif /* __MWERKS__ */ From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-toolbox Appearance.py,1.7,NONE AppleEvents.py,1.8,NONE Balloons.py,1.6,NONE Components.py,1.8,NONE ControlAccessor.py,1.5,NONE Controls.py,1.12,NONE Dialogs.py,1.9,NONE Dragconst.py,1.7,NONE Events.py,1.6,NONE Fonts.py,1.9,NONE Icons.py,1.7,NONE Lists.py,1.8,NONE MacTextEditor.py,1.1,NONE MediaDescr.py,1.1,NONE Menus.py,1.10,NONE MiniAEFrame.py,1.9,NONE QDOffscreen.py,1.6,NONE QuickDraw.py,1.11,NONE QuickTime.py,1.8,NONE Resources.py,1.6,NONE Sound.py,1.8,NONE TextEdit.py,1.8,NONE WASTEconst.py,1.3,NONE Windows.py,1.8,NONE aepack.py,1.4,NONE aetools.py,1.7,NONE aetypes.py,1.4,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-toolbox In directory usw-pr-cvs1:/tmp/cvs-serv16167/Lib/lib-toolbox Removed Files: Tag: r22a2-branch Appearance.py AppleEvents.py Balloons.py Components.py ControlAccessor.py Controls.py Dialogs.py Dragconst.py Events.py Fonts.py Icons.py Lists.py MacTextEditor.py MediaDescr.py Menus.py MiniAEFrame.py QDOffscreen.py QuickDraw.py QuickTime.py Resources.py Sound.py TextEdit.py WASTEconst.py Windows.py aepack.py aetools.py aetypes.py Log Message: Merge Jack's changes from the trunk --- Appearance.py DELETED --- --- AppleEvents.py DELETED --- --- Balloons.py DELETED --- --- Components.py DELETED --- --- ControlAccessor.py DELETED --- --- Controls.py DELETED --- --- Dialogs.py DELETED --- --- Dragconst.py DELETED --- --- Events.py DELETED --- --- Fonts.py DELETED --- --- Icons.py DELETED --- --- Lists.py DELETED --- --- MacTextEditor.py DELETED --- --- MediaDescr.py DELETED --- --- Menus.py DELETED --- --- MiniAEFrame.py DELETED --- --- QDOffscreen.py DELETED --- --- QuickDraw.py DELETED --- --- QuickTime.py DELETED --- --- Resources.py DELETED --- --- Sound.py DELETED --- --- TextEdit.py DELETED --- --- WASTEconst.py DELETED --- --- Windows.py DELETED --- --- aepack.py DELETED --- --- aetools.py DELETED --- --- aetypes.py DELETED --- From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/MPW buildall,NONE,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/MPW In directory usw-pr-cvs1:/tmp/cvs-serv16167/MPW Added Files: Tag: r22a2-branch buildall Log Message: Merge Jack's changes from the trunk --- NEW FILE: buildall --- Set Defines "-d MPW -d HAVE_CONFIG_H" Set Includes "-i :: -i ::Include -i ::Mac" Set SymOptions "-sym off" Set ModelOptions "-model far" Set OtherOptions "-warnings off" Set LinkOptions "{SymOptions} {ModelOptions}" Set COptions "{OtherOptions} {SymOptions} {ModelOptions} {Defines} {Includes}" # For compiling code resources; Restrictions apply Set ResCOptions "{SymOptions} -model near -b {Defines} {Includes} " Export ResCOptions Export COptions Export LinkOptions # modules with the source in a single sub directory Date Directory {Python} for MODULE in Parser Mac Modules Objects Python Directory :{MODULE}: Echo "### `Directory`: make {1}" make {1} > makefile.out makefile.out Directory :: end Echo "### `Directory`: make {1}" make {1} > makefile.out makefile.out From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.101,1.101.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv16167/Python Modified Files: Tag: r22a2-branch macglue.c Log Message: Merge Jack's changes from the trunk Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.101 retrieving revision 1.101.2.1 diff -C2 -d -r1.101 -r1.101.2.1 *** macglue.c 2001/08/08 13:17:31 1.101 --- macglue.c 2001/08/20 17:12:37 1.101.2.1 *************** *** 779,783 **** TextFont(fontID); TextSize(9); ! ParamText(Pstring(PATCHLEVEL), "\p", "\p", "\p"); ShowWindow(theWindow); ModalDialog(NULL, &item); --- 779,783 ---- TextFont(fontID); TextSize(9); ! ParamText(Pstring(PY_VERSION), "\p", "\p", "\p"); ShowWindow(theWindow); ModalDialog(NULL, &item); From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build _dummy_tkinter.mcp,1.3,1.3.6.1 _dummy_tkinter.mcp.exp,1.1,1.1.6.1 AE.carbon.mcp.exp,1.1,NONE AE.carbon.mcp.xml,1.1,NONE App.carbon.mcp.exp,1.1,NONE App.carbon.mcp.xml,1.2,NONE App.mcp.exp,1.1,NONE App.mcp.xml,1.4,NONE CF.carbon.mcp.exp,1.1,NONE CF.carbon.mcp.xml,1.1,NONE Cm.carbon.mcp.exp,1.1,NONE Cm.carbon.mcp.xml,1.2,NONE Cm.mcp.exp,1.1,NONE Cm.mcp.xml,1.4,NONE ColorPicker.carbon.mcp.exp,1.1,NONE ColorPicker.carbon.mcp.xml,1.2,NONE ColorPicker.mcp.exp,1.1,NONE ColorPicker.mcp.xml,1.4,NONE Ctl.carbon.mcp.exp,1.1,NONE Ctl.carbon.mcp.xml,1.1,NONE Ctl.mcp.exp,1.1,NONE Ctl.mcp.xml,1.1,NONE Dlg.carbon.mcp.exp,1.1,NONE Dlg.carbon.mcp.xml,1.1,NONE Dlg.mcp.exp,1.1,NONE Dlg.mcp.xml,1.1,NONE Drag.carbon.mcp.exp,1.1,NONE Drag.carbon.mcp.xml,1.1,NONE Drag.mcp.exp,1.3,NONE Drag.mcp.xml,1.3,NONE Evt.carbon.mcp.exp,1.1,NONE Evt.carbon.mcp.xml,1.1,NONE Evt.mcp.exp,1.1,NONE Evt.mcp.xml,1.1,NONE Fm.carbon.mcp.exp,1.1,NONE Fm.carbon.mcp.xml,1.2,NONE Fm.mcp.exp,1.1,NONE Fm.mcp.xml,1.4,NONE Help.mcp.exp,1.1,NONE Help.mcp.xml,1.4,NONE HtmlRender.prj.exp,1.1,NONE Icn.carbon.mcp.exp,1.1,NONE Icn.carbon.mcp.xml,1.2,NONE Icn.mcp.exp,1.1,NONE Icn.mcp.xml,1.4,NONE List.carbon.mcp.exp,1.1,NONE List.carbon.mcp.xml,1.2,NONE List.mcp.exp,1.1,NONE List.mcp.xml,1.4,NONE Menu.carbon.mcp.exp,1.1,NONE Menu.carbon.mcp.xml,1.1,NONE Menu.mcp.exp,1.1,NONE Menu.mcp.xml,1.1,NONE Mlte.carbon.mcp.exp,1.1,NONE Mlte.carbon.mcp.xml,1.1,NONE Mlte.mcp.exp,1.1,NONE Mlte.mcp.xml,1.1,NONE Printing.mcp.exp,1.1,NONE Printing.mcp.xml,1.4,NONE Qd.carbon.mcp.exp,1.1,NONE Qd.carbon.mcp.xml,1.1,NONE Qd.mcp.exp,1.1,NONE Qd.mcp.xml,1.1,NONE Qdoffs.carbon.mcp.exp,1.1,NONE Qdoffs.carbon.mcp.xml,1.2,NONE Qdoffs.mcp.exp,1.2,NONE Qdoffs.mcp.xml,1.4,NONE Qt.carbon.mcp.exp,1.1,NONE Qt.carbon.mcp.xml,1.2,NONE Qt.mcp.exp,1.1,NONE Qt.mcp.xml,1.5,NONE Res.carbon.mcp.exp,1.1,NONE Res.carbon.mcp.xml,1.1,NONE Res.mcp.exp,1.1,NONE Res.mcp.xml,1.1,NONE Scrap.carbon.mcp.exp,1.1,NONE Scrap.carbon.mcp.xml,1.1,NONE Scrap.mcp.exp,1.1,NONE Scrap.mcp.xml,1.4,NONE Snd.carbon.mcp.exp,1.1,NONE Snd.carbon.mcp.xml,1.2,NONE Snd.mcp.exp,1.1,NONE Snd.mcp.xml,1.4,NONE Sndihooks.carbon.mcp.exp,1.1,NONE Sndihooks.carbon.mcp.xml,1.2,NONE Sndihooks.mcp.exp,1.1,NONE Sndihooks.mcp.xml,1.4,NONE TE.carbon.mcp.exp,1.1,NONE TE.carbon.mcp.xml,1.2,NONE TE.mcp.exp,1.1,NONE TE.mcp.xml,1.4,NONE Win.carbon.mcp.exp,1.1,NONE Win.carbon.mcp.xml,1.1,NONE Win.mcp.exp,1.1,NONE Win.mcp.xml,1.1,NONE _symtable.carbon.mcp.exp,1.1,NONE _symtable.carbon.mcp.xml,1.1,NONE _symtable.mcp.exp,1.1,NONE _symtable.mcp.xml,1.1,NONE _testcapi.carbon.mcp.exp,1.1,NONE _testcapi.carbon.mcp.xml,1.1,NONE _testcapi.mcp.exp,1.1,NONE _testcapi.mcp.xml,1.1,NONE _weakref.carbon.mcp.exp,1.1,NONE _weakref.carbon.mcp.xml,1.1,NONE _weakref.mcp.exp,1.1,NONE _weakref.mcp.xml,1.1,NONE calldll.carbon.mcp.exp,1.1,NONE calldll.carbon.mcp.xml,1.2,NONE calldll.mcp.exp,1.1,NONE calldll.mcp.xml,1.4,NONE ctb.mcp.exp,1.1,NONE ctb.mcp.xml,1.4,NONE gdbm.carbon.mcp.exp,1.1,NONE gdbm.carbon.mcp.xml,1.2,NONE gdbm.mcp.exp,1.1,NONE gdbm.mcp.xml,1.4,NONE icglue.carbon.mcp.exp,1.1,NONE icglue.carbon.mcp.xml,1.1,NONE icglue.mcp.exp,1.1,NONE icglue.mcp.xml,1.4,NONE macspeech.mcp.exp,1.1,NONE macspeech.mcp.xml,1.4,NONE pyexpat.carbon.mcp.exp,1.1,NONE pyexpat.carbon.mcp.xml,1.2,NONE pyexpat.mcp.exp,1.1,NONE pyexpat.mcp.xml,1.4,NONE waste.carbon.mcp.exp,1.1,NONE waste.carbon.mcp.xml,1.1,NONE waste.mcp.exp,1.1,NONE waste.mcp.xml,1.4,NONE xx.prj.exp,1.1,NONE zlib.carbon.mcp.exp,1.1,NONE zlib.carbon.mcp.xml,1.2,NONE zlib.mcp.exp,1.1,NONE zlib.mcp.xml,1.4,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv16167/Build Modified Files: Tag: r22a2-branch _dummy_tkinter.mcp _dummy_tkinter.mcp.exp Removed Files: Tag: r22a2-branch AE.carbon.mcp.exp AE.carbon.mcp.xml App.carbon.mcp.exp App.carbon.mcp.xml App.mcp.exp App.mcp.xml CF.carbon.mcp.exp CF.carbon.mcp.xml Cm.carbon.mcp.exp Cm.carbon.mcp.xml Cm.mcp.exp Cm.mcp.xml ColorPicker.carbon.mcp.exp ColorPicker.carbon.mcp.xml ColorPicker.mcp.exp ColorPicker.mcp.xml Ctl.carbon.mcp.exp Ctl.carbon.mcp.xml Ctl.mcp.exp Ctl.mcp.xml Dlg.carbon.mcp.exp Dlg.carbon.mcp.xml Dlg.mcp.exp Dlg.mcp.xml Drag.carbon.mcp.exp Drag.carbon.mcp.xml Drag.mcp.exp Drag.mcp.xml Evt.carbon.mcp.exp Evt.carbon.mcp.xml Evt.mcp.exp Evt.mcp.xml Fm.carbon.mcp.exp Fm.carbon.mcp.xml Fm.mcp.exp Fm.mcp.xml Help.mcp.exp Help.mcp.xml HtmlRender.prj.exp Icn.carbon.mcp.exp Icn.carbon.mcp.xml Icn.mcp.exp Icn.mcp.xml List.carbon.mcp.exp List.carbon.mcp.xml List.mcp.exp List.mcp.xml Menu.carbon.mcp.exp Menu.carbon.mcp.xml Menu.mcp.exp Menu.mcp.xml Mlte.carbon.mcp.exp Mlte.carbon.mcp.xml Mlte.mcp.exp Mlte.mcp.xml Printing.mcp.exp Printing.mcp.xml Qd.carbon.mcp.exp Qd.carbon.mcp.xml Qd.mcp.exp Qd.mcp.xml Qdoffs.carbon.mcp.exp Qdoffs.carbon.mcp.xml Qdoffs.mcp.exp Qdoffs.mcp.xml Qt.carbon.mcp.exp Qt.carbon.mcp.xml Qt.mcp.exp Qt.mcp.xml Res.carbon.mcp.exp Res.carbon.mcp.xml Res.mcp.exp Res.mcp.xml Scrap.carbon.mcp.exp Scrap.carbon.mcp.xml Scrap.mcp.exp Scrap.mcp.xml Snd.carbon.mcp.exp Snd.carbon.mcp.xml Snd.mcp.exp Snd.mcp.xml Sndihooks.carbon.mcp.exp Sndihooks.carbon.mcp.xml Sndihooks.mcp.exp Sndihooks.mcp.xml TE.carbon.mcp.exp TE.carbon.mcp.xml TE.mcp.exp TE.mcp.xml Win.carbon.mcp.exp Win.carbon.mcp.xml Win.mcp.exp Win.mcp.xml _symtable.carbon.mcp.exp _symtable.carbon.mcp.xml _symtable.mcp.exp _symtable.mcp.xml _testcapi.carbon.mcp.exp _testcapi.carbon.mcp.xml _testcapi.mcp.exp _testcapi.mcp.xml _weakref.carbon.mcp.exp _weakref.carbon.mcp.xml _weakref.mcp.exp _weakref.mcp.xml calldll.carbon.mcp.exp calldll.carbon.mcp.xml calldll.mcp.exp calldll.mcp.xml ctb.mcp.exp ctb.mcp.xml gdbm.carbon.mcp.exp gdbm.carbon.mcp.xml gdbm.mcp.exp gdbm.mcp.xml icglue.carbon.mcp.exp icglue.carbon.mcp.xml icglue.mcp.exp icglue.mcp.xml macspeech.mcp.exp macspeech.mcp.xml pyexpat.carbon.mcp.exp pyexpat.carbon.mcp.xml pyexpat.mcp.exp pyexpat.mcp.xml waste.carbon.mcp.exp waste.carbon.mcp.xml waste.mcp.exp waste.mcp.xml xx.prj.exp zlib.carbon.mcp.exp zlib.carbon.mcp.xml zlib.mcp.exp zlib.mcp.xml Log Message: Merge Jack's changes from the trunk Index: _dummy_tkinter.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/_dummy_tkinter.mcp,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 Binary files /tmp/cvsrLU32F and /tmp/cvs0tm4Fd differ Index: _dummy_tkinter.mcp.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/_dummy_tkinter.mcp.exp,v retrieving revision 1.1 retrieving revision 1.1.6.1 diff -C2 -d -r1.1 -r1.1.6.1 *** _dummy_tkinter.mcp.exp 2001/03/20 23:29:16 1.1 --- _dummy_tkinter.mcp.exp 2001/08/20 17:12:36 1.1.6.1 *************** *** 1 **** ! init_tkinter --- 1 ---- ! init_tkinter \ No newline at end of file --- AE.carbon.mcp.exp DELETED --- --- AE.carbon.mcp.xml DELETED --- --- App.carbon.mcp.exp DELETED --- --- App.carbon.mcp.xml DELETED --- --- App.mcp.exp DELETED --- --- App.mcp.xml DELETED --- --- CF.carbon.mcp.exp DELETED --- --- CF.carbon.mcp.xml DELETED --- --- Cm.carbon.mcp.exp DELETED --- --- Cm.carbon.mcp.xml DELETED --- --- Cm.mcp.exp DELETED --- --- Cm.mcp.xml DELETED --- --- ColorPicker.carbon.mcp.exp DELETED --- --- ColorPicker.carbon.mcp.xml DELETED --- --- ColorPicker.mcp.exp DELETED --- --- ColorPicker.mcp.xml DELETED --- --- Ctl.carbon.mcp.exp DELETED --- --- Ctl.carbon.mcp.xml DELETED --- --- Ctl.mcp.exp DELETED --- --- Ctl.mcp.xml DELETED --- --- Dlg.carbon.mcp.exp DELETED --- --- Dlg.carbon.mcp.xml DELETED --- --- Dlg.mcp.exp DELETED --- --- Dlg.mcp.xml DELETED --- --- Drag.carbon.mcp.exp DELETED --- --- Drag.carbon.mcp.xml DELETED --- --- Drag.mcp.exp DELETED --- --- Drag.mcp.xml DELETED --- --- Evt.carbon.mcp.exp DELETED --- --- Evt.carbon.mcp.xml DELETED --- --- Evt.mcp.exp DELETED --- --- Evt.mcp.xml DELETED --- --- Fm.carbon.mcp.exp DELETED --- --- Fm.carbon.mcp.xml DELETED --- --- Fm.mcp.exp DELETED --- --- Fm.mcp.xml DELETED --- --- Help.mcp.exp DELETED --- --- Help.mcp.xml DELETED --- --- HtmlRender.prj.exp DELETED --- --- Icn.carbon.mcp.exp DELETED --- --- Icn.carbon.mcp.xml DELETED --- --- Icn.mcp.exp DELETED --- --- Icn.mcp.xml DELETED --- --- List.carbon.mcp.exp DELETED --- --- List.carbon.mcp.xml DELETED --- --- List.mcp.exp DELETED --- --- List.mcp.xml DELETED --- --- Menu.carbon.mcp.exp DELETED --- --- Menu.carbon.mcp.xml DELETED --- --- Menu.mcp.exp DELETED --- --- Menu.mcp.xml DELETED --- --- Mlte.carbon.mcp.exp DELETED --- --- Mlte.carbon.mcp.xml DELETED --- --- Mlte.mcp.exp DELETED --- --- Mlte.mcp.xml DELETED --- --- Printing.mcp.exp DELETED --- --- Printing.mcp.xml DELETED --- --- Qd.carbon.mcp.exp DELETED --- --- Qd.carbon.mcp.xml DELETED --- --- Qd.mcp.exp DELETED --- --- Qd.mcp.xml DELETED --- --- Qdoffs.carbon.mcp.exp DELETED --- --- Qdoffs.carbon.mcp.xml DELETED --- --- Qdoffs.mcp.exp DELETED --- --- Qdoffs.mcp.xml DELETED --- --- Qt.carbon.mcp.exp DELETED --- --- Qt.carbon.mcp.xml DELETED --- --- Qt.mcp.exp DELETED --- --- Qt.mcp.xml DELETED --- --- Res.carbon.mcp.exp DELETED --- --- Res.carbon.mcp.xml DELETED --- --- Res.mcp.exp DELETED --- --- Res.mcp.xml DELETED --- --- Scrap.carbon.mcp.exp DELETED --- --- Scrap.carbon.mcp.xml DELETED --- --- Scrap.mcp.exp DELETED --- --- Scrap.mcp.xml DELETED --- --- Snd.carbon.mcp.exp DELETED --- --- Snd.carbon.mcp.xml DELETED --- --- Snd.mcp.exp DELETED --- --- Snd.mcp.xml DELETED --- --- Sndihooks.carbon.mcp.exp DELETED --- --- Sndihooks.carbon.mcp.xml DELETED --- --- Sndihooks.mcp.exp DELETED --- --- Sndihooks.mcp.xml DELETED --- --- TE.carbon.mcp.exp DELETED --- --- TE.carbon.mcp.xml DELETED --- --- TE.mcp.exp DELETED --- --- TE.mcp.xml DELETED --- --- Win.carbon.mcp.exp DELETED --- --- Win.carbon.mcp.xml DELETED --- --- Win.mcp.exp DELETED --- --- Win.mcp.xml DELETED --- --- _symtable.carbon.mcp.exp DELETED --- --- _symtable.carbon.mcp.xml DELETED --- --- _symtable.mcp.exp DELETED --- --- _symtable.mcp.xml DELETED --- --- _testcapi.carbon.mcp.exp DELETED --- --- _testcapi.carbon.mcp.xml DELETED --- --- _testcapi.mcp.exp DELETED --- --- _testcapi.mcp.xml DELETED --- --- _weakref.carbon.mcp.exp DELETED --- --- _weakref.carbon.mcp.xml DELETED --- --- _weakref.mcp.exp DELETED --- --- _weakref.mcp.xml DELETED --- --- calldll.carbon.mcp.exp DELETED --- --- calldll.carbon.mcp.xml DELETED --- --- calldll.mcp.exp DELETED --- --- calldll.mcp.xml DELETED --- --- ctb.mcp.exp DELETED --- --- ctb.mcp.xml DELETED --- --- gdbm.carbon.mcp.exp DELETED --- --- gdbm.carbon.mcp.xml DELETED --- --- gdbm.mcp.exp DELETED --- --- gdbm.mcp.xml DELETED --- --- icglue.carbon.mcp.exp DELETED --- --- icglue.carbon.mcp.xml DELETED --- --- icglue.mcp.exp DELETED --- --- icglue.mcp.xml DELETED --- --- macspeech.mcp.exp DELETED --- --- macspeech.mcp.xml DELETED --- --- pyexpat.carbon.mcp.exp DELETED --- --- pyexpat.carbon.mcp.xml DELETED --- --- pyexpat.mcp.exp DELETED --- --- pyexpat.mcp.xml DELETED --- --- waste.carbon.mcp.exp DELETED --- --- waste.carbon.mcp.xml DELETED --- --- waste.mcp.exp DELETED --- --- waste.mcp.xml DELETED --- --- xx.prj.exp DELETED --- --- zlib.carbon.mcp.exp DELETED --- --- zlib.carbon.mcp.xml DELETED --- --- zlib.mcp.exp DELETED --- --- zlib.mcp.xml DELETED --- From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Resources pythonpath.r,1.12,1.12.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Resources In directory usw-pr-cvs1:/tmp/cvs-serv16167/Resources Modified Files: Tag: r22a2-branch pythonpath.r Log Message: Merge Jack's changes from the trunk Index: pythonpath.r =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Resources/pythonpath.r,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** pythonpath.r 2001/08/16 15:16:19 1.12 --- pythonpath.r 2001/08/20 17:12:37 1.12.2.1 *************** *** 83,90 **** { "$(PYTHON)", - "$(PYTHON):Mac:PlugIns", "$(PYTHON):Mac:Lib", ! "$(PYTHON):Mac:Lib:lib-toolbox", "$(PYTHON):Mac:Lib:lib-scriptpackages", "$(PYTHON):Lib", "$(PYTHON):Extensions:img:Mac", --- 83,90 ---- { "$(PYTHON)", "$(PYTHON):Mac:Lib", ! "$(PYTHON):Mac:Lib:lib-compat", "$(PYTHON):Mac:Lib:lib-scriptpackages", + "$(PYTHON):Lib:lib-dynload", "$(PYTHON):Lib", "$(PYTHON):Extensions:img:Mac", From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib MiniAEFrame.py,NONE,1.1.2.1 WASTEconst.py,NONE,1.1.2.1 aepack.py,NONE,1.1.2.1 aetools.py,NONE,1.1.2.1 aetypes.py,NONE,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv16167/Lib Added Files: Tag: r22a2-branch MiniAEFrame.py WASTEconst.py aepack.py aetools.py aetypes.py Log Message: Merge Jack's changes from the trunk --- NEW FILE: MiniAEFrame.py --- """MiniAEFrame - A minimal AppleEvent Application framework. There are two classes: AEServer -- a mixin class offering nice AE handling. MiniApplication -- a very minimal alternative to FrameWork.py, only suitable for the simplest of AppleEvent servers. """ import sys import traceback import MacOS import AE from AppleEvents import * import Evt from Events import * import Menu import Win from Windows import * import Qd import aetools import EasyDialogs kHighLevelEvent = 23 # Not defined anywhere for Python yet? class MiniApplication: """A minimal FrameWork.Application-like class""" def __init__(self): self.quitting = 0 # Initialize menu self.appleid = 1 self.quitid = 2 Menu.ClearMenuBar() self.applemenu = applemenu = Menu.NewMenu(self.appleid, "\024") applemenu.AppendMenu("%s;(-" % self.getaboutmenutext()) if MacOS.runtimemodel == 'ppc': applemenu.AppendResMenu('DRVR') applemenu.InsertMenu(0) self.quitmenu = Menu.NewMenu(self.quitid, "File") self.quitmenu.AppendMenu("Quit") self.quitmenu.SetItemCmd(1, ord("Q")) self.quitmenu.InsertMenu(0) Menu.DrawMenuBar() def __del__(self): self.close() def close(self): pass def mainloop(self, mask = everyEvent, timeout = 60*60): while not self.quitting: self.dooneevent(mask, timeout) def _quit(self): self.quitting = 1 def dooneevent(self, mask = everyEvent, timeout = 60*60): got, event = Evt.WaitNextEvent(mask, timeout) if got: self.lowlevelhandler(event) def lowlevelhandler(self, event): what, message, when, where, modifiers = event h, v = where if what == kHighLevelEvent: msg = "High Level Event: %s %s" % \ (`code(message)`, `code(h | (v<<16))`) try: AE.AEProcessAppleEvent(event) except AE.Error, err: print 'AE error: ', err print 'in', msg traceback.print_exc() return elif what == keyDown: c = chr(message & charCodeMask) if modifiers & cmdKey: if c == '.': raise KeyboardInterrupt, "Command-period" if c == 'q': MacOS.OutputSeen() self.quitting = 1 return elif what == mouseDown: partcode, window = Win.FindWindow(where) if partcode == inMenuBar: result = Menu.MenuSelect(where) id = (result>>16) & 0xffff # Hi word item = result & 0xffff # Lo word if id == self.appleid: if item == 1: EasyDialogs.Message(self.getabouttext()) elif item > 1 and hasattr(Menu, 'OpenDeskAcc'): name = self.applemenu.GetMenuItemText(item) Menu.OpenDeskAcc(name) elif id == self.quitid and item == 1: MacOS.OutputSeen() self.quitting = 1 Menu.HiliteMenu(0) return # Anything not handled is passed to Python/SIOUX MacOS.HandleEvent(event) def getabouttext(self): return self.__class__.__name__ def getaboutmenutext(self): return "About %s\311" % self.__class__.__name__ class AEServer: def __init__(self): self.ae_handlers = {} def installaehandler(self, classe, type, callback): AE.AEInstallEventHandler(classe, type, self.callback_wrapper) self.ae_handlers[(classe, type)] = callback def close(self): for classe, type in self.ae_handlers.keys(): AE.AERemoveEventHandler(classe, type) def callback_wrapper(self, _request, _reply): _parameters, _attributes = aetools.unpackevent(_request) _class = _attributes['evcl'].type _type = _attributes['evid'].type if self.ae_handlers.has_key((_class, _type)): _function = self.ae_handlers[(_class, _type)] elif self.ae_handlers.has_key((_class, '****')): _function = self.ae_handlers[(_class, '****')] elif self.ae_handlers.has_key(('****', '****')): _function = self.ae_handlers[('****', '****')] else: raise 'Cannot happen: AE callback without handler', (_class, _type) # XXXX Do key-to-name mapping here _parameters['_attributes'] = _attributes _parameters['_class'] = _class _parameters['_type'] = _type if _parameters.has_key('----'): _object = _parameters['----'] del _parameters['----'] # The try/except that used to be here can mask programmer errors. # Let the program crash, the programmer can always add a **args # to the formal parameter list. rv = apply(_function, (_object,), _parameters) else: #Same try/except comment as above rv = apply(_function, (), _parameters) if rv == None: aetools.packevent(_reply, {}) else: aetools.packevent(_reply, {'----':rv}) def code(x): "Convert a long int to the 4-character code it really is" s = '' for i in range(4): x, c = divmod(x, 256) s = chr(c) + s return s class _Test(AEServer, MiniApplication): """Mini test application, handles required events""" def __init__(self): MiniApplication.__init__(self) AEServer.__init__(self) self.installaehandler('aevt', 'oapp', self.open_app) self.installaehandler('aevt', 'quit', self.quit) self.installaehandler('****', '****', self.other) self.mainloop() def quit(self, **args): self._quit() def open_app(self, **args): pass def other(self, _object=None, _class=None, _type=None, **args): print 'AppleEvent', (_class, _type), 'for', _object, 'Other args:', args if __name__ == '__main__': _Test() --- NEW FILE: WASTEconst.py --- # Generated from 'WASTE.h' kPascalStackBased = None # workaround for header parsing weCantUndoErr = -10015 weEmptySelectionErr = -10013 weNotHandledErr = -1708 weUnknownObjectTypeErr = -9478 weObjectNotFoundErr = -9477 weReadOnlyErr = -9476 weUndefinedSelectorErr = -50 weFlushLeft = -2 weFlushRight = -1 weFlushDefault = 0 weCenter = 1 weJustify = 2 weDirDefault = 1 weDirRightToLeft = -1 weDirLeftToRight = 0 weDoFont = 0x0001 weDoFace = 0x0002 weDoSize = 0x0004 weDoColor = 0x0008 weDoAddSize = 0x0010 weDoToggleFace = 0x0020 weDoReplaceFace = 0x0040 weDoPreserveScript = 0x0080 weDoExtractSubscript = 0x0100 weDoFaceMask = 0x0200 kLeadingEdge = -1 kTrailingEdge = 0 kObjectEdge = 2 weFAutoScroll = 0 weFOutlineHilite = 2 weFReadOnly = 5 weFUndo = 6 weFIntCutAndPaste = 7 weFDragAndDrop = 8 weFInhibitRecal = 9 weFUseTempMem = 10 weFDrawOffscreen = 11 weFInhibitRedraw = 12 weFMonoStyled = 13 weFInhibitColor = 31 weDoAutoScroll = 1L << weFAutoScroll weDoOutlineHilite = 1L << weFOutlineHilite weDoReadOnly = 1L << weFReadOnly weDoUndo = 1L << weFUndo weDoIntCutAndPaste = 1L << weFIntCutAndPaste weDoDragAndDrop = 1L << weFDragAndDrop weDoInhibitRecal = 1L << weFInhibitRecal weDoUseTempMem = 1L << weFUseTempMem weDoDrawOffscreen = 1L << weFDrawOffscreen weDoInhibitRedraw = 1L << weFInhibitRedraw weDoMonoStyled = 1L << weFMonoStyled weDoInhibitColor = 1L << weFInhibitColor weBitToggle = -2 weCharByteHook = 'cbyt' weCharToPixelHook = 'c2p ' weCharTypeHook = 'ctyp' weClickLoop = 'clik' weCurrentDrag = 'drag' weDrawTextHook = 'draw' weEraseHook = 'eras' weFluxProc = 'flux' weHiliteDropAreaHook = 'hidr' weLineBreakHook = 'lbrk' wePixelToCharHook = 'p2c ' wePort = 'port' wePreTrackDragHook = 'ptrk' weRefCon = 'refc' weScrollProc = 'scrl' weText = 'text' weTranslateDragHook = 'xdrg' weTranslucencyThreshold = 'tluc' weTSMDocumentID = 'tsmd' weTSMPreUpdate = 'pre ' weTSMPostUpdate = 'post' weURLHint = 'urlh' weWordBreakHook = 'wbrk' weNewHandler = 'new ' weDisposeHandler = 'free' weDrawHandler = 'draw' weClickHandler = 'clik' weStreamHandler = 'strm' weAKNone = 0 weAKUnspecified = 1 weAKTyping = 2 weAKCut = 3 weAKPaste = 4 weAKClear = 5 weAKDrag = 6 weAKSetStyle = 7 weToScrap = 0 weToDrag = 1 weToSoup = 2 --- NEW FILE: aepack.py --- """Tools for use in AppleEvent clients and servers: conversion between AE types and python types pack(x) converts a Python object to an AEDesc object unpack(desc) does the reverse coerce(x, wanted_sample) coerces a python object to another python object """ # # This code was originally written by Guido, and modified/extended by Jack # to include the various types that were missing. The reference used is # Apple Event Registry, chapter 9. # import struct import string import types from string import strip from types import * import AE from AppleEvents import * import MacOS import macfs import StringIO import aetypes from aetypes import mkenum, mktype # These ones seem to be missing from AppleEvents # (they're in AERegistry.h) #typeColorTable = 'clrt' #typeDrawingArea = 'cdrw' #typePixelMap = 'cpix' #typePixelMapMinus = 'tpmm' #typeRotation = 'trot' #typeTextStyles = 'tsty' #typeStyledText = 'STXT' #typeAEText = 'tTXT' #typeEnumeration = 'enum' # # Some AE types are immedeately coerced into something # we like better (and which is equivalent) # unpacker_coercions = { typeComp : typeFloat, typeColorTable : typeAEList, typeDrawingArea : typeAERecord, typeFixed : typeFloat, typeExtended : typeFloat, typePixelMap : typeAERecord, typeRotation : typeAERecord, typeStyledText : typeAERecord, typeTextStyles : typeAERecord, }; # # Some python types we need in the packer: # AEDescType = type(AE.AECreateDesc('TEXT', '')) _sample_fss = macfs.FSSpec(':') _sample_alias = _sample_fss.NewAliasMinimal() FSSType = type(_sample_fss) AliasType = type(_sample_alias) def pack(x, forcetype = None): """Pack a python object into an AE descriptor""" if forcetype: if type(x) is StringType: return AE.AECreateDesc(forcetype, x) else: return pack(x).AECoerceDesc(forcetype) if x == None: return AE.AECreateDesc('null', '') t = type(x) if t == AEDescType: return x if t == FSSType: return AE.AECreateDesc('fss ', x.data) if t == AliasType: return AE.AECreateDesc('alis', x.data) if t == IntType: return AE.AECreateDesc('long', struct.pack('l', x)) if t == FloatType: return AE.AECreateDesc('doub', struct.pack('d', x)) if t == StringType: return AE.AECreateDesc('TEXT', x) if t == ListType: list = AE.AECreateList('', 0) for item in x: list.AEPutDesc(0, pack(item)) return list if t == DictionaryType: record = AE.AECreateList('', 1) for key, value in x.items(): record.AEPutParamDesc(key, pack(value)) return record if t == InstanceType and hasattr(x, '__aepack__'): return x.__aepack__() return AE.AECreateDesc('TEXT', repr(x)) # Copout def unpack(desc): """Unpack an AE descriptor to a python object""" t = desc.type if unpacker_coercions.has_key(t): desc = desc.AECoerceDesc(unpacker_coercions[t]) t = desc.type # This is a guess by Jack.... if t == typeAEList: l = [] for i in range(desc.AECountItems()): keyword, item = desc.AEGetNthDesc(i+1, '****') l.append(unpack(item)) return l if t == typeAERecord: d = {} for i in range(desc.AECountItems()): keyword, item = desc.AEGetNthDesc(i+1, '****') d[keyword] = unpack(item) return d if t == typeAEText: record = desc.AECoerceDesc('reco') return mkaetext(unpack(record)) if t == typeAlias: return macfs.RawAlias(desc.data) # typeAppleEvent returned as unknown if t == typeBoolean: return struct.unpack('b', desc.data)[0] if t == typeChar: return desc.data # typeColorTable coerced to typeAEList # typeComp coerced to extended # typeData returned as unknown # typeDrawingArea coerced to typeAERecord if t == typeEnumeration: return mkenum(desc.data) # typeEPS returned as unknown if t == typeFalse: return 0 if t == typeFloat: data = desc.data return struct.unpack('d', data)[0] if t == typeFSS: return macfs.RawFSSpec(desc.data) if t == typeInsertionLoc: record = desc.AECoerceDesc('reco') return mkinsertionloc(unpack(record)) # typeInteger equal to typeLongInteger if t == typeIntlText: script, language = struct.unpack('hh', desc.data[:4]) return aetypes.IntlText(script, language, desc.data[4:]) if t == typeIntlWritingCode: script, language = struct.unpack('hh', desc.data) return aetypes.IntlWritingCode(script, language) if t == typeKeyword: return mkkeyword(desc.data) if t == typeLongInteger: return struct.unpack('l', desc.data)[0] if t == typeLongDateTime: a, b = struct.unpack('lL', desc.data) return (long(a) << 32) + b if t == typeNull: return None if t == typeMagnitude: v = struct.unpack('l', desc.data) if v < 0: v = 0x100000000L + v return v if t == typeObjectSpecifier: record = desc.AECoerceDesc('reco') return mkobject(unpack(record)) # typePict returned as unknown # typePixelMap coerced to typeAERecord # typePixelMapMinus returned as unknown # typeProcessSerialNumber returned as unknown if t == typeQDPoint: v, h = struct.unpack('hh', desc.data) return aetypes.QDPoint(v, h) if t == typeQDRectangle: v0, h0, v1, h1 = struct.unpack('hhhh', desc.data) return aetypes.QDRectangle(v0, h0, v1, h1) if t == typeRGBColor: r, g, b = struct.unpack('hhh', desc.data) return aetypes.RGBColor(r, g, b) # typeRotation coerced to typeAERecord # typeScrapStyles returned as unknown # typeSessionID returned as unknown if t == typeShortFloat: return struct.unpack('f', desc.data)[0] if t == typeShortInteger: return struct.unpack('h', desc.data)[0] # typeSMFloat identical to typeShortFloat # typeSMInt indetical to typeShortInt # typeStyledText coerced to typeAERecord if t == typeTargetID: return mktargetid(desc.data) # typeTextStyles coerced to typeAERecord # typeTIFF returned as unknown if t == typeTrue: return 1 if t == typeType: return mktype(desc.data) # # The following are special # if t == 'rang': record = desc.AECoerceDesc('reco') return mkrange(unpack(record)) if t == 'cmpd': record = desc.AECoerceDesc('reco') return mkcomparison(unpack(record)) if t == 'logi': record = desc.AECoerceDesc('reco') return mklogical(unpack(record)) return mkunknown(desc.type, desc.data) def coerce(data, egdata): """Coerce a python object to another type using the AE coercers""" pdata = pack(data) pegdata = pack(egdata) pdata = pdata.AECoerceDesc(pegdata.type) return unpack(pdata) # # Helper routines for unpack # def mktargetid(data): sessionID = getlong(data[:4]) name = mkppcportrec(data[4:4+72]) location = mklocationnamerec(data[76:76+36]) rcvrName = mkppcportrec(data[112:112+72]) return sessionID, name, location, rcvrName def mkppcportrec(rec): namescript = getword(rec[:2]) name = getpstr(rec[2:2+33]) portkind = getword(rec[36:38]) if portkind == 1: ctor = rec[38:42] type = rec[42:46] identity = (ctor, type) else: identity = getpstr(rec[38:38+33]) return namescript, name, portkind, identity def mklocationnamerec(rec): kind = getword(rec[:2]) stuff = rec[2:] if kind == 0: stuff = None if kind == 2: stuff = getpstr(stuff) return kind, stuff def mkunknown(type, data): return aetypes.Unknown(type, data) def getpstr(s): return s[1:1+ord(s[0])] def getlong(s): return (ord(s[0])<<24) | (ord(s[1])<<16) | (ord(s[2])<<8) | ord(s[3]) def getword(s): return (ord(s[0])<<8) | (ord(s[1])<<0) def mkkeyword(keyword): return aetypes.Keyword(keyword) def mkrange(dict): return aetypes.Range(dict['star'], dict['stop']) def mkcomparison(dict): return aetypes.Comparison(dict['obj1'], dict['relo'].enum, dict['obj2']) def mklogical(dict): return aetypes.Logical(dict['logc'], dict['term']) def mkstyledtext(dict): return aetypes.StyledText(dict['ksty'], dict['ktxt']) def mkaetext(dict): return aetypes.AEText(dict[keyAEScriptTag], dict[keyAEStyles], dict[keyAEText]) def mkinsertionloc(dict): return aetypes.InsertionLoc(dict[keyAEObject], dict[keyAEPosition]) def mkobject(dict): want = dict['want'].type form = dict['form'].enum seld = dict['seld'] fr = dict['from'] if form in ('name', 'indx', 'rang', 'test'): if want == 'text': return aetypes.Text(seld, fr) if want == 'cha ': return aetypes.Character(seld, fr) if want == 'cwor': return aetypes.Word(seld, fr) if want == 'clin': return aetypes.Line(seld, fr) if want == 'cpar': return aetypes.Paragraph(seld, fr) if want == 'cwin': return aetypes.Window(seld, fr) if want == 'docu': return aetypes.Document(seld, fr) if want == 'file': return aetypes.File(seld, fr) if want == 'cins': return aetypes.InsertionPoint(seld, fr) if want == 'prop' and form == 'prop' and aetypes.IsType(seld): return aetypes.Property(seld.type, fr) return aetypes.ObjectSpecifier(want, form, seld, fr) def _test(): """Test program. Pack and unpack various things""" objs = [ 'a string', 12, 12.0, None, ['a', 'list', 'of', 'strings'], {'key1': 'value1', 'key2':'value2'}, macfs.FSSpec(':'), macfs.FSSpec(':').NewAliasMinimal(), aetypes.Enum('enum'), aetypes.Type('type'), aetypes.Keyword('kwrd'), aetypes.Range(1, 10), aetypes.Comparison(1, '< ', 10), aetypes.Logical('not ', 1), # Cannot do StyledText # Cannot do AEText aetypes.IntlText(0, 0, 'international text'), aetypes.IntlWritingCode(0,0), aetypes.QDPoint(50,100), aetypes.QDRectangle(50,100,150,200), aetypes.RGBColor(0x7000, 0x6000, 0x5000), aetypes.Unknown('xxxx', 'unknown type data'), aetypes.Character(1), aetypes.Character(2, aetypes.Line(2)), ] for o in objs: print 'BEFORE', o, `o` packed = pack(o) unpacked = unpack(packed) print 'AFTER ', unpacked, `unpacked` import sys sys.exit(1) if __name__ == '__main__': _test() --- NEW FILE: aetools.py --- """Tools for use in AppleEvent clients and servers. pack(x) converts a Python object to an AEDesc object unpack(desc) does the reverse packevent(event, parameters, attributes) sets params and attrs in an AEAppleEvent record unpackevent(event) returns the parameters and attributes from an AEAppleEvent record Plus... Lots of classes and routines that help representing AE objects, ranges, conditionals, logicals, etc., so you can write, e.g.: x = Character(1, Document("foobar")) and pack(x) will create an AE object reference equivalent to AppleScript's character 1 of document "foobar" Some of the stuff that appears to be exported from this module comes from other files: the pack stuff from aepack, the objects from aetypes. """ from types import * import AE import AppleEvents import MacOS import sys from aetypes import * from aepack import pack, unpack, coerce, AEDescType Error = 'aetools.Error' # Special code to unpack an AppleEvent (which is *not* a disguised record!) # Note by Jack: No??!? If I read the docs correctly it *is*.... aekeywords = [ 'tran', 'rtid', 'evcl', 'evid', 'addr', 'optk', 'timo', 'inte', # this attribute is read only - will be set in AESend 'esrc', # this attribute is read only 'miss', # this attribute is read only 'from' # new in 1.0.1 ] def missed(ae): try: desc = ae.AEGetAttributeDesc('miss', 'keyw') except AE.Error, msg: return None return desc.data def unpackevent(ae): parameters = {} try: dirobj = ae.AEGetParamDesc('----', '****') except AE.Error: pass else: parameters['----'] = unpack(dirobj) del dirobj while 1: key = missed(ae) if not key: break parameters[key] = unpack(ae.AEGetParamDesc(key, '****')) attributes = {} for key in aekeywords: try: desc = ae.AEGetAttributeDesc(key, '****') except (AE.Error, MacOS.Error), msg: if msg[0] != -1701 and msg[0] != -1704: raise sys.exc_type, sys.exc_value continue attributes[key] = unpack(desc) return parameters, attributes def packevent(ae, parameters = {}, attributes = {}): for key, value in parameters.items(): ae.AEPutParamDesc(key, pack(value)) for key, value in attributes.items(): ae.AEPutAttributeDesc(key, pack(value)) # # Support routine for automatically generated Suite interfaces # These routines are also useable for the reverse function. # def keysubst(arguments, keydict): """Replace long name keys by their 4-char counterparts, and check""" ok = keydict.values() for k in arguments.keys(): if keydict.has_key(k): v = arguments[k] del arguments[k] arguments[keydict[k]] = v elif k != '----' and k not in ok: raise TypeError, 'Unknown keyword argument: %s'%k def enumsubst(arguments, key, edict): """Substitute a single enum keyword argument, if it occurs""" if not arguments.has_key(key) or edict is None: return v = arguments[key] ok = edict.values() if edict.has_key(v): arguments[key] = edict[v] elif not v in ok: raise TypeError, 'Unknown enumerator: %s'%v def decodeerror(arguments): """Create the 'best' argument for a raise MacOS.Error""" errn = arguments['errn'] err_a1 = errn if arguments.has_key('errs'): err_a2 = arguments['errs'] else: err_a2 = MacOS.GetErrorString(errn) if arguments.has_key('erob'): err_a3 = arguments['erob'] else: err_a3 = None return (err_a1, err_a2, err_a3) class TalkTo: """An AE connection to an application""" _signature = None # Can be overridden by subclasses def __init__(self, signature=None, start=0, timeout=0): """Create a communication channel with a particular application. Addressing the application is done by specifying either a 4-byte signature, an AEDesc or an object that will __aepack__ to an AEDesc. """ self.target_signature = None if signature is None: signature = self._signature if type(signature) == AEDescType: self.target = signature elif type(signature) == InstanceType and hasattr(signature, '__aepack__'): self.target = signature.__aepack__() elif type(signature) == StringType and len(signature) == 4: self.target = AE.AECreateDesc(AppleEvents.typeApplSignature, signature) self.target_signature = signature else: raise TypeError, "signature should be 4-char string or AEDesc" self.send_flags = AppleEvents.kAEWaitReply self.send_priority = AppleEvents.kAENormalPriority if timeout: self.send_timeout = timeout else: self.send_timeout = AppleEvents.kAEDefaultTimeout if start: self.start() def start(self): """Start the application, if it is not running yet""" try: self.send('ascr', 'noop') except AE.Error: _launch(self.target_signature) def newevent(self, code, subcode, parameters = {}, attributes = {}): """Create a complete structure for an apple event""" event = AE.AECreateAppleEvent(code, subcode, self.target, AppleEvents.kAutoGenerateReturnID, AppleEvents.kAnyTransactionID) packevent(event, parameters, attributes) return event def sendevent(self, event): """Send a pre-created appleevent, await the reply and unpack it""" reply = event.AESend(self.send_flags, self.send_priority, self.send_timeout) parameters, attributes = unpackevent(reply) return reply, parameters, attributes def send(self, code, subcode, parameters = {}, attributes = {}): """Send an appleevent given code/subcode/pars/attrs and unpack the reply""" return self.sendevent(self.newevent(code, subcode, parameters, attributes)) # # The following events are somehow "standard" and don't seem to appear in any # suite... # def activate(self): """Send 'activate' command""" self.send('misc', 'actv') def _get(self, _object, as=None, _attributes={}): """_get: get data from an object Required argument: the object Keyword argument _attributes: AppleEvent attribute dictionary Returns: the data """ _code = 'core' _subcode = 'getd' _arguments = {'----':_object} if as: _arguments['rtyp'] = mktype(as) _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise Error, decodeerror(_arguments) if _arguments.has_key('----'): return _arguments['----'] # Tiny Finder class, for local use only class _miniFinder(TalkTo): def open(self, _object, _attributes={}, **_arguments): """open: Open the specified object(s) Required argument: list of objects to open 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.has_key('errn'): raise Error, decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] #pass _finder = _miniFinder('MACS') def _launch(appfile): """Open a file thru the finder. Specify file by name or fsspec""" _finder.open(_application_file(('ID ', appfile))) class _application_file(ComponentItem): """application file - An application's file on disk""" want = 'appf' _application_file._propdict = { } _application_file._elemdict = { } # Test program # XXXX Should test more, really... def test(): target = AE.AECreateDesc('sign', 'quil') ae = AE.AECreateAppleEvent('aevt', 'oapp', target, -1, 0) print unpackevent(ae) raw_input(":") ae = AE.AECreateAppleEvent('core', 'getd', target, -1, 0) obj = Character(2, Word(1, Document(1))) print obj print repr(obj) packevent(ae, {'----': obj}) params, attrs = unpackevent(ae) print params['----'] raw_input(":") if __name__ == '__main__': test() sys.exit(1) --- NEW FILE: aetypes.py --- """aetypes - Python objects representing various AE types.""" from AppleEvents import * import struct from types import * import string # # convoluted, since there are cyclic dependencies between this file and # aetools_convert. # def pack(*args): from aepack import pack return apply(pack, args) def IsSubclass(cls, base): """Test whether CLASS1 is the same as or a subclass of CLASS2""" # Loop to optimize for single inheritance while 1: if cls is base: return 1 if len(cls.__bases__) <> 1: break cls = cls.__bases__[0] # Recurse to cope with multiple inheritance for c in cls.__bases__: if IsSubclass(c, base): return 1 return 0 def IsInstance(x, cls): """Test whether OBJECT is an instance of (a subclass of) CLASS""" return type(x) is InstanceType and IsSubclass(x.__class__, cls) def nice(s): """'nice' representation of an object""" if type(s) is StringType: return repr(s) else: return str(s) class Unknown: """An uninterpreted AE object""" def __init__(self, type, data): self.type = type self.data = data def __repr__(self): return "Unknown(%s, %s)" % (`self.type`, `self.data`) def __aepack__(self): return pack(self.data, self.type) class Enum: """An AE enumeration value""" def __init__(self, enum): self.enum = "%-4.4s" % str(enum) def __repr__(self): return "Enum(%s)" % `self.enum` def __str__(self): return string.strip(self.enum) def __aepack__(self): return pack(self.enum, typeEnumeration) def IsEnum(x): return IsInstance(x, Enum) def mkenum(enum): if IsEnum(enum): return enum return Enum(enum) class Boolean: """An AE boolean value""" def __init__(self, bool): self.bool = (not not bool) def __repr__(self): return "Boolean(%s)" % `self.bool` def __str__(self): if self.bool: return "True" else: return "False" def __aepack__(self): return pack(struct.pack('b', self.bool), 'bool') def IsBoolean(x): return IsInstance(x, Boolean) def mkboolean(bool): if IsBoolean(bool): return bool return Boolean(bool) class Type: """An AE 4-char typename object""" def __init__(self, type): self.type = "%-4.4s" % str(type) def __repr__(self): return "Type(%s)" % `self.type` def __str__(self): return string.strip(self.type) def __aepack__(self): return pack(self.type, typeType) def IsType(x): return IsInstance(x, Type) def mktype(type): if IsType(type): return type return Type(type) class Keyword: """An AE 4-char keyword object""" def __init__(self, keyword): self.keyword = "%-4.4s" % str(keyword) def __repr__(self): return "Keyword(%s)" % `self.keyword` def __str__(self): return string.strip(self.keyword) def __aepack__(self): return pack(self.keyword, typeKeyword) def IsKeyword(x): return IsInstance(x, Keyword) class Range: """An AE range object""" def __init__(self, start, stop): self.start = start self.stop = stop def __repr__(self): return "Range(%s, %s)" % (`self.start`, `self.stop`) def __str__(self): return "%s thru %s" % (nice(self.start), nice(self.stop)) def __aepack__(self): return pack({'star': self.start, 'stop': self.stop}, 'rang') def IsRange(x): return IsInstance(x, Range) class Comparison: """An AE Comparison""" def __init__(self, obj1, relo, obj2): self.obj1 = obj1 self.relo = "%-4.4s" % str(relo) self.obj2 = obj2 def __repr__(self): return "Comparison(%s, %s, %s)" % (`self.obj1`, `self.relo`, `self.obj2`) def __str__(self): return "%s %s %s" % (nice(self.obj1), string.strip(self.relo), nice(self.obj2)) def __aepack__(self): return pack({'obj1': self.obj1, 'relo': mkenum(self.relo), 'obj2': self.obj2}, 'cmpd') def IsComparison(x): return IsInstance(x, Comparison) class NComparison(Comparison): # The class attribute 'relo' must be set in a subclass def __init__(self, obj1, obj2): Comparison.__init__(obj1, self.relo, obj2) class Ordinal: """An AE Ordinal""" def __init__(self, abso): # self.obj1 = obj1 self.abso = "%-4.4s" % str(abso) def __repr__(self): return "Ordinal(%s)" % (`self.abso`) def __str__(self): return "%s" % (string.strip(self.abso)) def __aepack__(self): return pack(self.abso, 'abso') def IsOrdinal(x): return IsInstance(x, Ordinal) class NOrdinal(Ordinal): # The class attribute 'abso' must be set in a subclass def __init__(self): Ordinal.__init__(self, self.abso) class Logical: """An AE logical expression object""" def __init__(self, logc, term): self.logc = "%-4.4s" % str(logc) self.term = term def __repr__(self): return "Logical(%s, %s)" % (`self.logc`, `self.term`) def __str__(self): if type(self.term) == ListType and len(self.term) == 2: return "%s %s %s" % (nice(self.term[0]), string.strip(self.logc), nice(self.term[1])) else: return "%s(%s)" % (string.strip(self.logc), nice(self.term)) def __aepack__(self): return pack({'logc': mkenum(self.logc), 'term': self.term}, 'logi') def IsLogical(x): return IsInstance(x, Logical) class StyledText: """An AE object respresenting text in a certain style""" def __init__(self, style, text): self.style = style self.text = text def __repr__(self): return "StyledText(%s, %s)" % (`self.style`, `self.text`) def __str__(self): return self.text def __aepack__(self): return pack({'ksty': self.style, 'ktxt': self.text}, 'STXT') def IsStyledText(x): return IsInstance(x, StyledText) class AEText: """An AE text object with style, script and language specified""" def __init__(self, script, style, text): self.script = script self.style = style self.text = text def __repr__(self): return "AEText(%s, %s, %s)" % (`self.script`, `self.style`, `self.text`) def __str__(self): return self.text def __aepack__(self): return pack({keyAEScriptTag: self.script, keyAEStyles: self.style, keyAEText: self.text}, typeAEText) def IsAEText(x): return IsInstance(x, AEText) class IntlText: """A text object with script and language specified""" def __init__(self, script, language, text): self.script = script self.language = language self.text = text def __repr__(self): return "IntlText(%s, %s, %s)" % (`self.script`, `self.language`, `self.text`) def __str__(self): return self.text def __aepack__(self): return pack(struct.pack('hh', self.script, self.language)+self.text, typeIntlText) def IsIntlText(x): return IsInstance(x, IntlText) class IntlWritingCode: """An object representing script and language""" def __init__(self, script, language): self.script = script self.language = language def __repr__(self): return "IntlWritingCode(%s, %s)" % (`self.script`, `self.language`) def __str__(self): return "script system %d, language %d"%(self.script, self.language) def __aepack__(self): return pack(struct.pack('hh', self.script, self.language), typeIntlWritingCode) def IsIntlWritingCode(x): return IsInstance(x, IntlWritingCode) class QDPoint: """A point""" def __init__(self, v, h): self.v = v self.h = h def __repr__(self): return "QDPoint(%s, %s)" % (`self.v`, `self.h`) def __str__(self): return "(%d, %d)"%(self.v, self.h) def __aepack__(self): return pack(struct.pack('hh', self.v, self.h), typeQDPoint) def IsQDPoint(x): return IsInstance(x, QDPoint) class QDRectangle: """A rectangle""" def __init__(self, v0, h0, v1, h1): self.v0 = v0 self.h0 = h0 self.v1 = v1 self.h1 = h1 def __repr__(self): return "QDRectangle(%s, %s, %s, %s)" % (`self.v0`, `self.h0`, `self.v1`, `self.h1`) def __str__(self): return "(%d, %d)-(%d, %d)"%(self.v0, self.h0, self.v1, self.h1) def __aepack__(self): return pack(struct.pack('hhhh', self.v0, self.h0, self.v1, self.h1), typeQDRectangle) def IsQDRectangle(x): return IsInstance(x, QDRectangle) class RGBColor: """An RGB color""" def __init__(self, r, g, b): self.r = r self.g = g self.b = b def __repr__(self): return "RGBColor(%s, %s, %s)" % (`self.r`, `self.g`, `self.b`) def __str__(self): return "0x%x red, 0x%x green, 0x%x blue"% (self.r, self.g, self.b) def __aepack__(self): return pack(struct.pack('hhh', self.r, self.g, self.b), typeRGBColor) def IsRGBColor(x): return IsInstance(x, RGBColor) class ObjectSpecifier: """A class for constructing and manipulation AE object specifiers in python. An object specifier is actually a record with four fields: key type description --- ---- ----------- 'want' type 4-char class code of thing we want, e.g. word, paragraph or property 'form' enum how we specify which 'want' thing(s) we want, e.g. by index, by range, by name, or by property specifier 'seld' any which thing(s) we want, e.g. its index, its name, or its property specifier 'from' object the object in which it is contained, or null, meaning look for it in the application Note that we don't call this class plain "Object", since that name is likely to be used by the application. """ def __init__(self, want, form, seld, fr = None): self.want = want self.form = form self.seld = seld self.fr = fr def __repr__(self): s = "ObjectSpecifier(%s, %s, %s" % (`self.want`, `self.form`, `self.seld`) if self.fr: s = s + ", %s)" % `self.fr` else: s = s + ")" return s def __aepack__(self): return pack({'want': mktype(self.want), 'form': mkenum(self.form), 'seld': self.seld, 'from': self.fr}, 'obj ') def IsObjectSpecifier(x): return IsInstance(x, ObjectSpecifier) # Backwards compatability, sigh... class Property(ObjectSpecifier): def __init__(self, which, fr = None, want='prop'): ObjectSpecifier.__init__(self, want, 'prop', mktype(which), fr) def __repr__(self): if self.fr: return "Property(%s, %s)" % (`self.seld.type`, `self.fr`) else: return "Property(%s)" % `self.seld.type` def __str__(self): if self.fr: return "Property %s of %s" % (str(self.seld), str(self.fr)) else: return "Property %s" % str(self.seld) class NProperty(ObjectSpecifier): # Subclasses *must* self baseclass attributes: # want is the type of this property # which is the property name of this property def __init__(self, fr = None): #try: # dummy = self.want #except: # self.want = 'prop' self.want = 'prop' ObjectSpecifier.__init__(self, self.want, 'prop', mktype(self.which), fr) def __repr__(self): rv = "Property(%s"%`self.seld.type` if self.fr: rv = rv + ", fr=%s" % `self.fr` if self.want != 'prop': rv = rv + ", want=%s" % `self.want` return rv + ")" def __str__(self): if self.fr: return "Property %s of %s" % (str(self.seld), str(self.fr)) else: return "Property %s" % str(self.seld) class SelectableItem(ObjectSpecifier): def __init__(self, want, seld, fr = None): t = type(seld) if t == StringType: form = 'name' elif IsRange(seld): form = 'rang' elif IsComparison(seld) or IsLogical(seld): form = 'test' elif t == TupleType: # Breakout: specify both form and seld in a tuple # (if you want ID or rele or somesuch) form, seld = seld else: form = 'indx' ObjectSpecifier.__init__(self, want, form, seld, fr) class ComponentItem(SelectableItem): # Derived classes *must* set the *class attribute* 'want' to some constant # Also, dictionaries _propdict and _elemdict must be set to map property # and element names to the correct classes def __init__(self, which, fr = None): SelectableItem.__init__(self, self.want, which, fr) def __repr__(self): if not self.fr: return "%s(%s)" % (self.__class__.__name__, `self.seld`) return "%s(%s, %s)" % (self.__class__.__name__, `self.seld`, `self.fr`) def __str__(self): seld = self.seld if type(seld) == StringType: ss = repr(seld) elif IsRange(seld): start, stop = seld.start, seld.stop if type(start) == InstanceType == type(stop) and \ start.__class__ == self.__class__ == stop.__class__: ss = str(start.seld) + " thru " + str(stop.seld) else: ss = str(seld) else: ss = str(seld) s = "%s %s" % (self.__class__.__name__, ss) if self.fr: s = s + " of %s" % str(self.fr) return s def __getattr__(self, name): if self._elemdict.has_key(name): cls = self._elemdict[name] return DelayedComponentItem(cls, self) if self._propdict.has_key(name): cls = self._propdict[name] return cls(self) raise AttributeError, name class DelayedComponentItem: def __init__(self, compclass, fr): self.compclass = compclass self.fr = fr def __call__(self, which): return self.compclass(which, self.fr) def __repr__(self): return "%s(???, %s)" % (self.__class__.__name__, `self.fr`) def __str__(self): return "selector for element %s of %s"%(self.__class__.__name__, str(self.fr)) template = """ class %s(ComponentItem): want = '%s' """ exec template % ("Text", 'text') exec template % ("Character", 'cha ') exec template % ("Word", 'cwor') exec template % ("Line", 'clin') exec template % ("paragraph", 'cpar') exec template % ("Window", 'cwin') exec template % ("Document", 'docu') exec template % ("File", 'file') exec template % ("InsertionPoint", 'cins') From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/PlugIns readme.txt,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/PlugIns In directory usw-pr-cvs1:/tmp/cvs-serv16167/PlugIns Removed Files: Tag: r22a2-branch readme.txt Log Message: Merge Jack's changes from the trunk --- readme.txt DELETED --- From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:39 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Splash.py,1.12,1.12.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv16167/Tools/IDE Modified Files: Tag: r22a2-branch Splash.py Log Message: Merge Jack's changes from the trunk Index: Splash.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Splash.py,v retrieving revision 1.12 retrieving revision 1.12.6.1 diff -C2 -d -r1.12 -r1.12.6.1 *** Splash.py 2001/06/19 21:37:33 1.12 --- Splash.py 2001/08/20 17:12:37 1.12.6.1 *************** *** 33,36 **** --- 33,37 ---- fontID = Fm.GetFNum("Python-Sans") if not fontID: + from Fonts import geneva fontID = geneva Qd.TextFont(fontID) *************** *** 65,69 **** return _real__import__(name) ! install_importhook() kHighLevelEvent = 23 --- 66,70 ---- return _real__import__(name) ! #install_importhook() kHighLevelEvent = 23 From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:40 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_config.h,NONE,1.1.2.1 mwerks_shlib_config.h,NONE,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv16167/mwerks Added Files: Tag: r22a2-branch mwerks_config.h mwerks_shlib_config.h Log Message: Merge Jack's changes from the trunk --- NEW FILE: mwerks_config.h --- #define HAVE_CONFIG_H #define USE_STDWIN --- NEW FILE: mwerks_shlib_config.h --- #define HAVE_CONFIG_H #define USE_STDWIN #define USE_MAC_SHARED_LIBRARY From gvanrossum@users.sourceforge.net Mon Aug 20 18:12:40 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 10:12:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts genpluginprojects.py,1.16,1.16.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv16167/scripts Modified Files: Tag: r22a2-branch genpluginprojects.py Log Message: Merge Jack's changes from the trunk Index: genpluginprojects.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/genpluginprojects.py,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -C2 -d -r1.16 -r1.16.2.1 *** genpluginprojects.py 2001/08/16 20:39:17 1.16 --- genpluginprojects.py 2001/08/20 17:12:38 1.16.2.1 *************** *** 36,47 **** sources=[], sourcedirs=[], libraries=[], extradirs=[], ! extraexportsymbols=[]): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, ! libraries, extradirs, extraexportsymbols) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, ! libraries, extradirs, extraexportsymbols) return templatename = "template-%s" % architecture --- 36,47 ---- sources=[], sourcedirs=[], libraries=[], extradirs=[], ! extraexportsymbols=[], outputdir=":::Lib:lib-dynload"): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, ! libraries, extradirs, extraexportsymbols, outputdir) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, ! libraries, extradirs, extraexportsymbols, outputdir) return templatename = "template-%s" % architecture *************** *** 79,83 **** "extrasearchdirs" : sourcedirs + extradirs, "libraries": libraries, ! "mac_outputdir" : "::Plugins", "extraexportsymbols" : extraexportsymbols, "mac_targetname" : targetname, --- 79,83 ---- "extrasearchdirs" : sourcedirs + extradirs, "libraries": libraries, ! "mac_outputdir" : outputdir, "extraexportsymbols" : extraexportsymbols, "mac_targetname" : targetname, *************** *** 107,147 **** # bgen-generated Toolbox modules ! genpluginproject("carbon", "AE") ! genpluginproject("ppc", "AE", libraries=["ObjectSupportLib"]) ! genpluginproject("ppc", "App", libraries=["AppearanceLib"]) ! genpluginproject("carbon", "App") ! genpluginproject("ppc", "Cm", libraries=["QuickTimeLib"]) ! genpluginproject("carbon", "Cm") ! genpluginproject("carbon", "Ctl") ! genpluginproject("ppc", "Ctl", libraries=["ControlsLib", "AppearanceLib"]) ! genpluginproject("carbon", "Dlg") ! genpluginproject("ppc", "Dlg", libraries=["DialogsLib", "AppearanceLib"]) ! genpluginproject("carbon", "Drag") ! genpluginproject("ppc", "Drag", libraries=["DragLib"]) ! genpluginproject("all", "Evt") ! genpluginproject("all", "Fm") ! genpluginproject("ppc", "Help") ! genpluginproject("ppc", "Icn", libraries=["IconServicesLib"]) ! genpluginproject("carbon", "Icn") ! genpluginproject("all", "List") ! genpluginproject("carbon", "Menu") ! genpluginproject("ppc", "Menu", libraries=["MenusLib", "ContextualMenu", "AppearanceLib"]) ! genpluginproject("all", "Qd") ! genpluginproject("ppc", "Qt", libraries=["QuickTimeLib"]) ! genpluginproject("carbon", "Qt") ! genpluginproject("all", "Qdoffs") ! genpluginproject("all", "Res") ! genpluginproject("all", "Scrap") ! genpluginproject("ppc", "Snd", libraries=["SoundLib"]) ! genpluginproject("carbon", "Snd") ! genpluginproject("all", "Sndihooks", sources=[":snd:Sndihooks.c"]) ! genpluginproject("ppc", "TE", libraries=["DragLib"]) ! genpluginproject("carbon", "TE") ! genpluginproject("ppc", "Mlte", libraries=["Textension"]) ! genpluginproject("carbon", "Mlte") ! genpluginproject("carbon", "Win") ! genpluginproject("ppc", "Win", libraries=["WindowsLib", "AppearanceLib"]) # Carbon Only? ! genpluginproject("carbon", "CF") # Other Mac modules --- 107,151 ---- # bgen-generated Toolbox modules ! genpluginproject("carbon", "AE", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "AE", libraries=["ObjectSupportLib"], outputdir="::Lib:Carbon") ! genpluginproject("ppc", "App", libraries=["AppearanceLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "App", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Cm", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Cm", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Ctl", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Ctl", libraries=["ControlsLib", "AppearanceLib"], ! outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Dlg", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Dlg", libraries=["DialogsLib", "AppearanceLib"], ! outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Drag", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Drag", libraries=["DragLib"], outputdir="::Lib:Carbon") ! genpluginproject("all", "Evt", outputdir="::Lib:Carbon") ! genpluginproject("all", "Fm", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Help", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Icn", libraries=["IconServicesLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Icn", outputdir="::Lib:Carbon") ! genpluginproject("all", "List", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Menu", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Menu", libraries=["MenusLib", "ContextualMenu", "AppearanceLib"], ! outputdir="::Lib:Carbon") ! genpluginproject("all", "Qd", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Qt", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Qt", outputdir="::Lib:Carbon") ! genpluginproject("all", "Qdoffs", outputdir="::Lib:Carbon") ! genpluginproject("all", "Res", outputdir="::Lib:Carbon") ! genpluginproject("all", "Scrap", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Snd", libraries=["SoundLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Snd", outputdir="::Lib:Carbon") ! genpluginproject("all", "Sndihooks", sources=[":snd:Sndihooks.c"], outputdir="::Lib:Carbon") ! genpluginproject("ppc", "TE", libraries=["DragLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "TE", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Mlte", libraries=["Textension"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Mlte", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Win", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Win", libraries=["WindowsLib", "AppearanceLib"], ! outputdir="::Lib:Carbon") # Carbon Only? ! genpluginproject("carbon", "CF", outputdir="::Lib:Carbon") # Other Mac modules From gvanrossum@users.sourceforge.net Mon Aug 20 19:37:37 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 11:37:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib compilerlike.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3814 Removed Files: Tag: r22a2-branch compilerlike.py Log Message: Removing compilerlike.py from the release branch. Given the -dev discussion, it is too controversial to go into a release. --- compilerlike.py DELETED --- From gvanrossum@users.sourceforge.net Mon Aug 20 19:48:31 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 11:48:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcompilerlike.tex,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv5993 Removed Files: Tag: r22a2-branch libcompilerlike.tex Log Message: Removing compilerlike from release branch. --- libcompilerlike.tex DELETED --- From fdrake@users.sourceforge.net Mon Aug 20 19:49:02 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 20 Aug 2001 11:49:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libthreading.tex,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv6147/lib Modified Files: libthreading.tex Log Message: Added documentation for BoundedSemaphore(), contributed by Skip Montanaro. This closes SF patch #452836. Index: libthreading.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libthreading.tex,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** libthreading.tex 2001/07/06 20:30:11 1.9 --- libthreading.tex 2001/08/20 18:49:00 1.10 *************** *** 61,72 **** \end{funcdesc} ! \begin{funcdesc}{Semaphore}{} A factory function that returns a new semaphore object. A semaphore manages a counter representing the number of \method{release()} calls minus the number of \method{acquire()} calls, plus an initial value. The \method{acquire()} method blocks if necessary until it can return ! without making the counter negative. \end{funcdesc} \begin{classdesc*}{Thread}{} A class that represents a thread of control. This class can be safely subclassed in a limited fashion. --- 61,82 ---- \end{funcdesc} ! \begin{funcdesc}{Semaphore}{\optional{value}} A factory function that returns a new semaphore object. A semaphore manages a counter representing the number of \method{release()} calls minus the number of \method{acquire()} calls, plus an initial value. The \method{acquire()} method blocks if necessary until it can return ! without making the counter negative. If not given, \var{value} defaults to ! 1. \end{funcdesc} + \begin{funcdesc}{BoundedSemaphore}{\optional{value}} + A factory function that returns a new bounded semaphore object. A bounded + semaphore checks to make sure its current value doesn't exceed its initial + value. If it does, \exception{ValueError} is raised. In most situations + semaphores are used to guard resources with limited capacity. If the + semaphore is released too many times it's a sign of a bug. If not given, + \var{value} defaults to 1. + \end{funcdesc} + \begin{classdesc*}{Thread}{} A class that represents a thread of control. This class can be safely subclassed in a limited fashion. *************** *** 367,370 **** --- 377,408 ---- \end{methoddesc} + + \subsubsection{\class{Semaphore} Example \label{semaphore-examples}} + + Semaphores are often used to guard resources with limited capacity, for + example, a database server. In any situation where the size of the resource + size is fixed, you should use a bounded semaphore. Before spawning any + worker threads, your main thread would initialize the semaphore: + + \begin{verbatim} + maxconnections = 5 + ... + pool_sema = BoundedSemaphore(value=maxconnections) + \end{verbatim} + + Once spawned, worker threads call the semaphore's acquire and release + methods when they need to connect to the server: + + \begin{verbatim} + pool_sema.acquire() + conn = connectdb() + ... use connection ... + conn.close() + pool_sema.release() + \end{verbatim} + + The use of a bounded semaphore reduces the chance that a programming error + which causes the semaphore to be released more than it's acquired will go + undetected. \subsection{Event Objects \label{event-objects}} From jhylton@users.sourceforge.net Mon Aug 20 20:06:40 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 20 Aug 2001 12:06:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.165,1.166 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv9718 Modified Files: socketmodule.c Log Message: It will always be a string, because it is created just before this call. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.165 retrieving revision 1.166 diff -C2 -d -r1.165 -r1.166 *** socketmodule.c 2001/08/15 17:14:33 1.165 --- socketmodule.c 2001/08/20 19:06:36 1.166 *************** *** 1472,1476 **** return NULL; Py_BEGIN_ALLOW_THREADS ! n = recv(s->sock_fd, PyString_AsString(buf), len, flags); Py_END_ALLOW_THREADS if (n < 0) { --- 1472,1476 ---- return NULL; Py_BEGIN_ALLOW_THREADS ! n = recv(s->sock_fd, PyString_AS_STRING(buf), len, flags); Py_END_ALLOW_THREADS if (n < 0) { From gvanrossum@users.sourceforge.net Mon Aug 20 20:10:37 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 12:10:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib __future__.py,1.9.2.1,1.9.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10846 Modified Files: Tag: r22a2-branch __future__.py Log Message: Merge trunk changes into 2.2a2 release branch. I've discovered another reason not to *require* the new module: new is not allowed in restricted mode. Without this patch, this means that any import from __future__ would fail, and in turn e.g. "import types" would fail. I'm beginning to wonder if sticking the CO_ constants in __future__ was such a good idea... Index: __future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/__future__.py,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -C2 -d -r1.9.2.1 -r1.9.2.2 *** __future__.py 2001/08/19 05:14:11 1.9.2.1 --- __future__.py 2001/08/20 19:10:35 1.9.2.2 *************** *** 56,60 **** __all__ = ["all_feature_names"] + all_feature_names ! import new as _new # for CO_xxx symbols class _Feature: --- 56,66 ---- __all__ = ["all_feature_names"] + all_feature_names ! try: ! import new as _new # for CO_xxx symbols ! except ImportError: # May happen during build ! class _new: ! CO_NESTED = 0x0010 ! CO_GENERATOR_ALLOWED = 0x1000 ! CO_FUTURE_DIVISION = 0x2000 class _Feature: From fdrake@users.sourceforge.net Mon Aug 20 20:30:31 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 20 Aug 2001 12:30:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc Makefile.deps,1.71,1.72 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv16265 Modified Files: Makefile.deps Log Message: Split "Extending & Embedding" into separate files, one per chapter. Index: Makefile.deps =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile.deps,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** Makefile.deps 2001/08/02 15:13:58 1.71 --- Makefile.deps 2001/08/20 19:30:29 1.72 *************** *** 27,30 **** --- 27,35 ---- EXTFILES= ext/ext.tex $(MANSTYLES) $(INDEXSTYLES) $(COMMONTEX) \ + ext/extending.tex \ + ext/newtypes.tex \ + ext/unix.tex \ + ext/windows.tex \ + ext/embedding.tex \ texinputs/reportingbugs.tex From fdrake@users.sourceforge.net Mon Aug 20 20:30:31 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 20 Aug 2001 12:30:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ext embedding.tex,NONE,1.1 extending.tex,NONE,1.1 newtypes.tex,NONE,1.1 unix.tex,NONE,1.1 windows.tex,NONE,1.1 ext.tex,1.103,1.104 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv16265/ext Modified Files: ext.tex Added Files: embedding.tex extending.tex newtypes.tex unix.tex windows.tex Log Message: Split "Extending & Embedding" into separate files, one per chapter. --- NEW FILE: embedding.tex --- \chapter{Embedding Python in Another Application \label{embedding}} The previous chapters discussed how to extend Python, that is, how to extend the functionality of Python by attaching a library of C functions to it. It is also possible to do it the other way around: enrich your C/\Cpp{} application by embedding Python in it. Embedding provides your application with the ability to implement some of the functionality of your application in Python rather than C or \Cpp. This can be used for many purposes; one example would be to allow users to tailor the application to their needs by writing some scripts in Python. You can also use it yourself if some of the functionality can be written in Python more easily. Embedding Python is similar to extending it, but not quite. The difference is that when you extend Python, the main program of the application is still the Python interpreter, while if you embed Python, the main program may have nothing to do with Python --- instead, some parts of the application occasionally call the Python interpreter to run some Python code. So if you are embedding Python, you are providing your own main program. One of the things this main program has to do is initialize the Python interpreter. At the very least, you have to call the function \cfunction{Py_Initialize()} (on Mac OS, call \cfunction{PyMac_Initialize()} instead). There are optional calls to pass command line arguments to Python. Then later you can call the interpreter from any part of the application. There are several different ways to call the interpreter: you can pass a string containing Python statements to \cfunction{PyRun_SimpleString()}, or you can pass a stdio file pointer and a file name (for identification in error messages only) to \cfunction{PyRun_SimpleFile()}. You can also call the lower-level operations described in the previous chapters to construct and use Python objects. A simple demo of embedding Python can be found in the directory \file{Demo/embed/} of the source distribution. \begin{seealso} \seetitle[../api/api.html]{Python/C API Reference Manual}{The details of Python's C interface are given in this manual. A great deal of necessary information can be found here.} \end{seealso} \section{Very High Level Embedding \label{high-level-embedding}} The simplest form of embedding Python is the use of the very high level interface. This interface is intended to execute a Python script without needing to interact with the application directly. This can for example be used to perform some operation on a file. \begin{verbatim} #include int main() { Py_Initialize(); PyRun_SimpleString("from time import time,ctime\n" "print 'Today is',ctime(time())\n"); Py_Finalize(); return 0; } \end{verbatim} The above code first initializes the Python interpreter with \cfunction{Py_Initialize()}, followed by the execution of a hard-coded Python script that print the date and time. Afterwards, the \cfunction{Py_Finalize()} call shuts the interpreter down, followed by the end of the program. In a real program, you may want to get the Python script from another source, perhaps a text-editor routine, a file, or a database. Getting the Python code from a file can better be done by using the \cfunction{PyRun_SimpleFile()} function, which saves you the trouble of allocating memory space and loading the file contents. \section{Beyond Very High Level Embedding: An overview \label{lower-level-embedding}} The high level interface gives you the ability to execute arbitrary pieces of Python code from your application, but exchanging data values is quite cumbersome to say the least. If you want that, you should use lower level calls. At the cost of having to write more C code, you can achieve almost anything. It should be noted that extending Python and embedding Python is quite the same activity, despite the different intent. Most topics discussed in the previous chapters are still valid. To show this, consider what the extension code from Python to C really does: \begin{enumerate} \item Convert data values from Python to C, \item Perform a function call to a C routine using the converted values, and \item Convert the data values from the call from C to Python. \end{enumerate} When embedding Python, the interface code does: \begin{enumerate} \item Convert data values from C to Python, \item Perform a function call to a Python interface routine using the converted values, and \item Convert the data values from the call from Python to C. \end{enumerate} As you can see, the data conversion steps are simply swapped to accomodate the different direction of the cross-language transfer. The only difference is the routine that you call between both data conversions. When extending, you call a C routine, when embedding, you call a Python routine. This chapter will not discuss how to convert data from Python to C and vice versa. Also, proper use of references and dealing with errors is assumed to be understood. Since these aspects do not differ from extending the interpreter, you can refer to earlier chapters for the required information. \section{Pure Embedding \label{pure-embedding}} The first program aims to execute a function in a Python script. Like in the section about the very high level interface, the Python interpreter does not directly interact with the application (but that will change in th next section). The code to run a function defined in a Python script is: \verbatiminput{run-func.c} This code loads a Python script using \code{argv[1]}, and calls the function named in \code{argv[2]}. Its integer arguments are the other values of the \code{argv} array. If you compile and link this program (let's call the finished executable \program{call}), and use it to execute a Python script, such as: \begin{verbatim} def multiply(a,b): print "Thy shall add", a, "times", b c = 0 for i in range(0, a): c = c + b return c \end{verbatim} then the result should be: \begin{verbatim} $ call multiply 3 2 Thy shall add 3 times 2 Result of call: 6 \end{verbatim} % $ Although the program is quite large for its functionality, most of the code is for data conversion between Python and C, and for error reporting. The interesting part with respect to embedding Python starts with \begin{verbatim} Py_Initialize(); pName = PyString_FromString(argv[1]); /* Error checking of pName left out */ pModule = PyImport_Import(pName); \end{verbatim} After initializing the interpreter, the script is loaded using \cfunction{PyImport_Import()}. This routine needs a Python string as its argument, which is constructed using the \cfunction{PyString_FromString()} data conversion routine. \begin{verbatim} pDict = PyModule_GetDict(pModule); /* pDict is a borrowed reference */ pFunc = PyDict_GetItemString(pDict, argv[2]); /* pFun is a borrowed reference */ if (pFunc && PyCallable_Check(pFunc)) { ... } \end{verbatim} Once the script is loaded, its dictionary is retrieved with \cfunction{PyModule_GetDict()}. The dictionary is then searched using the normal dictionary access routines for the function name. If the name exists, and the object retunred is callable, you can safely assume that it is a function. The program then proceeds by constructing a tuple of arguments as normal. The call to the python function is then made with: \begin{verbatim} pValue = PyObject_CallObject(pFunc, pArgs); \end{verbatim} Upon return of the function, \code{pValue} is either \NULL{} or it contains a reference to the return value of the function. Be sure to release the reference after examining the value. \section{Extending Embedded Python \label{extending-with-embedding}} Until now, the embedded Python interpreter had no access to functionality from the application itself. The Python API allows this by extending the embedded interpreter. That is, the embedded interpreter gets extended with routines provided by the application. While it sounds complex, it is not so bad. Simply forget for a while that the application starts the Python interpreter. Instead, consider the application to be a set of subroutines, and write some glue code that gives Python access to those routines, just like you would write a normal Python extension. For example: \begin{verbatim} static int numargs=0; /* Return the number of arguments of the application command line */ static PyObject* emb_numargs(PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args, ":numargs")) return NULL; return Py_BuildValue("i", numargs); } static PyMethodDef EmbMethods[]={ {"numargs", emb_numargs, METH_VARARGS}, {NULL, NULL} }; \end{verbatim} Insert the above code just above the \cfunction{main()} function. Also, insert the following two statements directly after \cfunction{Py_Initialize()}: \begin{verbatim} numargs = argc; Py_InitModule("emb", EmbMethods); \end{verbatim} These two lines initialize the \code{numargs} variable, and make the \function{emb.numargs()} function accessible to the embedded Python interpreter. With these extensions, the Python script can do things like \begin{verbatim} import emb print "Number of arguments", emb.numargs() \end{verbatim} In a real application, the methods will expose an API of the application to Python. %\section{For the future} % %You don't happen to have a nice library to get textual %equivalents of numeric values do you :-) ? %Callbacks here ? (I may be using information from that section %?!) %threads %code examples do not really behave well if errors happen % (what to watch out for) \section{Embedding Python in \Cpp{} \label{embeddingInCplusplus}} It is also possible to embed Python in a \Cpp{} program; precisely how this is done will depend on the details of the \Cpp{} system used; in general you will need to write the main program in \Cpp{}, and use the \Cpp{} compiler to compile and link your program. There is no need to recompile Python itself using \Cpp{}. \section{Linking Requirements \label{link-reqs}} While the \program{configure} script shipped with the Python sources will correctly build Python to export the symbols needed by dynamically linked extensions, this is not automatically inherited by applications which embed the Python library statically, at least on \UNIX. This is an issue when the application is linked to the static runtime library (\file{libpython.a}) and needs to load dynamic extensions (implemented as \file{.so} files). The problem is that some entry points are defined by the Python runtime solely for extension modules to use. If the embedding application does not use any of these entry points, some linkers will not include those entries in the symbol table of the finished executable. Some additional options are needed to inform the linker not to remove these symbols. Determining the right options to use for any given platform can be quite difficult, but fortunately the Python configuration already has those values. To retrieve them from an installed Python interpreter, start an interactive interpreter and have a short session like this: \begin{verbatim} >>> import distutils.sysconfig >>> distutils.sysconfig.get_config_var('LINKFORSHARED') '-Xlinker -export-dynamic' \end{verbatim} \refstmodindex{distutils.sysconfig} The contents of the string presented will be the options that should be used. If the string is empty, there's no need to add any additional options. The \constant{LINKFORSHARED} definition corresponds to the variable of the same name in Python's top-level \file{Makefile}. --- NEW FILE: extending.tex --- \chapter{Extending Python with C or \Cpp{} \label{intro}} It is quite easy to add new built-in modules to Python, if you know how to program in C. Such \dfn{extension modules} can do two things that can't be done directly in Python: they can implement new built-in object types, and they can call C library functions and system calls. To support extensions, the Python API (Application Programmers Interface) defines a set of functions, macros and variables that provide access to most aspects of the Python run-time system. The Python API is incorporated in a C source file by including the header \code{"Python.h"}. The compilation of an extension module depends on its intended use as well as on your system setup; details are given in later chapters. \section{A Simple Example [...1656 lines suppressed...] { PyObject *m; Py_InitModule("client", ClientMethods); import_spam(); } \end{verbatim} The main disadvantage of this approach is that the file \file{spammodule.h} is rather complicated. However, the basic structure is the same for each function that is exported, so it has to be learned only once. Finally it should be mentioned that CObjects offer additional functionality, which is especially useful for memory allocation and deallocation of the pointer stored in a CObject. The details are described in the \citetitle[../api/api.html]{Python/C API Reference Manual} in the section ``CObjects'' and in the implementation of CObjects (files \file{Include/cobject.h} and \file{Objects/cobject.c} in the Python source code distribution). --- NEW FILE: newtypes.tex --- \chapter{Defining New Types \label{defining-new-types}} \sectionauthor{Michael Hudson}{mwh21@cam.ac.uk} \sectionauthor{Dave Kuhlman}{dkuhlman@rexx.com} As mentioned in the last chapter, Python allows the writer of an extension module to define new types that can be manipulated from Python code, much like strings and lists in core Python. This is not hard; the code for all extension types follows a pattern, but there are some details that you need to understand before you can get started. \section{The Basics \label{dnt-basics}} The Python runtime sees all Python objects as variables of type \ctype{PyObject*}. A \ctype{PyObject} is not a very magnificent object - it just contains the refcount and a pointer to the object's ``type object''. This is where the action is; the type object determines which (C) functions get called when, for instance, an attribute gets looked up on an object or it is multiplied by another object. I call these C functions ``type methods'' to distinguish them from things like \code{[].append} (which I will call ``object methods'' when I get around to them). So, if you want to define a new object type, you need to create a new type object. This sort of thing can only be explained by example, so here's a minimal, but complete, module that defines a new type: \begin{verbatim} #include staticforward PyTypeObject noddy_NoddyType; typedef struct { PyObject_HEAD } noddy_NoddyObject; static PyObject* noddy_new_noddy(PyObject* self, PyObject* args) { noddy_NoddyObject* noddy; if (!PyArg_ParseTuple(args,":new_noddy")) return NULL; noddy = PyObject_New(noddy_NoddyObject, &noddy_NoddyType); return (PyObject*)noddy; } static void noddy_noddy_dealloc(PyObject* self) { PyObject_Del(self); } static PyTypeObject noddy_NoddyType = { PyObject_HEAD_INIT(NULL) 0, "Noddy", sizeof(noddy_NoddyObject), 0, noddy_noddy_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash */ }; static PyMethodDef noddy_methods[] = { { "new_noddy", noddy_new_noddy, METH_VARARGS }, {NULL, NULL} }; DL_EXPORT(void) initnoddy(void) { noddy_NoddyType.ob_type = &PyType_Type; Py_InitModule("noddy", noddy_methods); } \end{verbatim} Now that's quite a bit to take in at once, but hopefully bits will seem familiar from the last chapter. The first bit that will be new is: \begin{verbatim} staticforward PyTypeObject noddy_NoddyType; \end{verbatim} This names the type object that will be defining further down in the file. It can't be defined here because its definition has to refer to functions that have no yet been defined, but we need to be able to refer to it, hence the declaration. The \code{staticforward} is required to placate various brain dead compilers. \begin{verbatim} typedef struct { PyObject_HEAD } noddy_NoddyObject; \end{verbatim} This is what a Noddy object will contain. In this case nothing more than every Python object contains - a refcount and a pointer to a type object. These are the fields the \code{PyObject_HEAD} macro brings in. The reason for the macro is to standardize the layout and to enable special debugging fields to be brought in debug builds. For contrast \begin{verbatim} typedef struct { PyObject_HEAD long ob_ival; } PyIntObject; \end{verbatim} is the corresponding definition for standard Python integers. Next up is: \begin{verbatim} static PyObject* noddy_new_noddy(PyObject* self, PyObject* args) { noddy_NoddyObject* noddy; if (!PyArg_ParseTuple(args,":new_noddy")) return NULL; noddy = PyObject_New(noddy_NoddyObject, &noddy_NoddyType); return (PyObject*)noddy; } \end{verbatim} This is in fact just a regular module function, as described in the last chapter. The reason it gets special mention is that this is where we create our Noddy object. Defining PyTypeObject structures is all very well, but if there's no way to actually \emph{create} one of the wretched things it is not going to do anyone much good. Almost always, you create objects with a call of the form: \begin{verbatim} PyObject_New(, &); \end{verbatim} This allocates the memory and then initializes the object (sets the reference count to one, makes the \cdata{ob_type} pointer point at the right place and maybe some other stuff, depending on build options). You \emph{can} do these steps separately if you have some reason to --- but at this level we don't bother. We cast the return value to a \ctype{PyObject*} because that's what the Python runtime expects. This is safe because of guarantees about the layout of structures in the C standard, and is a fairly common C programming trick. One could declare \cfunction{noddy_new_noddy} to return a \ctype{noddy_NoddyObject*} and then put a cast in the definition of \cdata{noddy_methods} further down the file --- it doesn't make much difference. Now a Noddy object doesn't do very much and so doesn't need to implement many type methods. One you can't avoid is handling deallocation, so we find \begin{verbatim} static void noddy_noddy_dealloc(PyObject* self) { PyObject_Del(self); } \end{verbatim} This is so short as to be self explanatory. This function will be called when the reference count on a Noddy object reaches \code{0} (or it is found as part of an unreachable cycle by the cyclic garbage collector). \cfunction{PyObject_Del()} is what you call when you want an object to go away. If a Noddy object held references to other Python objects, one would decref them here. Moving on, we come to the crunch --- the type object. \begin{verbatim} static PyTypeObject noddy_NoddyType = { PyObject_HEAD_INIT(NULL) 0, "Noddy", sizeof(noddy_NoddyObject), 0, noddy_noddy_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash */ }; \end{verbatim} Now if you go and look up the definition of \ctype{PyTypeObject} in \file{object.h} you'll see that it has many, many more fields that the definition above. The remaining fields will be filled with zeros by the C compiler, and it's common practice to not specify them explicitly unless you need them. This is so important that I'm going to pick the top of it apart still further: \begin{verbatim} PyObject_HEAD_INIT(NULL) \end{verbatim} This line is a bit of a wart; what we'd like to write is: \begin{verbatim} PyObject_HEAD_INIT(&PyType_Type) \end{verbatim} as the type of a type object is ``type'', but this isn't strictly conforming C and some compilers complain. So instead we fill in the \cdata{ob_type} field of \cdata{noddy_NoddyType} at the earliest oppourtunity --- in \cfunction{initnoddy()}. \begin{verbatim} 0, \end{verbatim} XXX why does the type info struct start PyObject_*VAR*_HEAD?? \begin{verbatim} "Noddy", \end{verbatim} The name of our type. This will appear in the default textual representation of our objects and in some error messages, for example: \begin{verbatim} >>> "" + noddy.new_noddy() Traceback (most recent call last): File "", line 1, in ? TypeError: cannot add type "Noddy" to string \end{verbatim} \begin{verbatim} sizeof(noddy_NoddyObject), \end{verbatim} This is so that Python knows how much memory to allocate when you call \cfunction{PyObject_New}. \begin{verbatim} 0, \end{verbatim} This has to do with variable length objects like lists and strings. Ignore for now... Now we get into the type methods, the things that make your objects different from the others. Of course, the Noddy object doesn't implement many of these, but as mentioned above you have to implement the deallocation function. \begin{verbatim} noddy_noddy_dealloc, /*tp_dealloc*/ \end{verbatim} >From here, all the type methods are nil so I won't go over them yet - that's for the next section! Everything else in the file should be familiar, except for this line in \cfunction{initnoddy}: \begin{verbatim} noddy_NoddyType.ob_type = &PyType_Type; \end{verbatim} This was alluded to above --- the \cdata{noddy_NoddyType} object should have type ``type'', but \code{\&PyType_Type} is not constant and so can't be used in its initializer. To work around this, we patch it up in the module initialization. That's it! All that remains is to build it; put the above code in a file called \file{noddymodule.c} and \begin{verbatim} from distutils.core import setup, Extension setup(name = "noddy", version = "1.0", ext_modules = [Extension("noddy", ["noddymodule.c"])]) \end{verbatim} in a file called \file{setup.py}; then typing \begin{verbatim} $ python setup.py build%$ \end{verbatim} at a shell should produce a file \file{noddy.so} in a subdirectory; move to that directory and fire up Python --- you should be able to \code{import noddy} and play around with Noddy objects. That wasn't so hard, was it? \section{Type Methods \label{dnt-type-methods}} This section aims to give a quick fly-by on the various type methods you can implement and what they do. Here is the definition of \ctype{PyTypeObject}, with some fields only used in debug builds omitted: \begin{verbatim} typedef struct _typeobject { PyObject_VAR_HEAD char *tp_name; /* For printing */ int tp_basicsize, tp_itemsize; /* For allocation */ /* Methods to implement standard operations */ destructor tp_dealloc; printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; cmpfunc tp_compare; reprfunc tp_repr; /* Method suites for standard classes */ PyNumberMethods *tp_as_number; PySequenceMethods *tp_as_sequence; PyMappingMethods *tp_as_mapping; /* More standard operations (here for binary compatibility) */ hashfunc tp_hash; ternaryfunc tp_call; reprfunc tp_str; getattrofunc tp_getattro; setattrofunc tp_setattro; /* Functions to access object as input/output buffer */ PyBufferProcs *tp_as_buffer; /* Flags to define presence of optional/expanded features */ long tp_flags; char *tp_doc; /* Documentation string */ /* Assigned meaning in release 2.0 */ /* call function for all accessible objects */ traverseproc tp_traverse; /* delete references to contained objects */ inquiry tp_clear; /* Assigned meaning in release 2.1 */ /* rich comparisons */ richcmpfunc tp_richcompare; /* weak reference enabler */ long tp_weaklistoffset; /* Added in release 2.2 */ /* Iterators */ getiterfunc tp_iter; iternextfunc tp_iternext; /* Attribute descriptor and subclassing stuff */ struct PyMethodDef *tp_methods; struct memberlist *tp_members; struct getsetlist *tp_getset; struct _typeobject *tp_base; PyObject *tp_dict; descrgetfunc tp_descr_get; descrsetfunc tp_descr_set; long tp_dictoffset; initproc tp_init; allocfunc tp_alloc; newfunc tp_new; destructor tp_free; /* Low-level free-memory routine */ PyObject *tp_bases; PyObject *tp_mro; /* method resolution order */ PyObject *tp_defined; } PyTypeObject; \end{verbatim} Now that's a \emph{lot} of methods. Don't worry too much though - if you have a type you want to define, the chances are very good that you will only implement a handful of these. As you probably expect by now, we're going to go over this and give more information about the various handlers. We won't go in the order they are defined in the structure, because there is a lot of historical baggage that impacts the ordering of the fields; be sure your type initializaion keeps the fields in the right order! It's often easiest to find an example that includes all the fields you need (even if they're initialized to \code{0}) and then change the values to suit your new type. \begin{verbatim} char *tp_name; /* For printing */ \end{verbatim} The name of the type - as mentioned in the last section, this will appear in various places, almost entirely for diagnostic purposes. Try to choose something that will be helpful in such a situation! \begin{verbatim} int tp_basicsize, tp_itemsize; /* For allocation */ \end{verbatim} These fields tell the runtime how much memory to allocate when new objects of this typed are created. Python has some builtin support for variable length structures (think: strings, lists) which is where the \cdata{tp_itemsize} field comes in. This will be dealt with later. \begin{verbatim} char *tp_doc; \end{verbatim} Here you can put a string (or its address) that you want returned when the Python script references \code{obj.__doc__} to retrieve the docstring. Now we come to the basic type methods---the ones most extension types will implement. \subsection{Finalization and De-allocation} \begin{verbatim} destructor tp_dealloc; \end{verbatim} This function is called when the reference count of the instance of your type is reduced to zero and the Python interpreter wants to reclaim it. If your type has memory to free or other clean-up to perform, put it here. The object itself needs to be freed here as well. Here is an example of this function: \begin{verbatim} static void newdatatype_dealloc(newdatatypeobject * obj) { free(obj->obj_UnderlyingDatatypePtr); PyObject_DEL(obj); } \end{verbatim} \subsection{Object Representation} In Python, there are three ways to generate a textual representation of an object: the \function{repr()}\bifuncindex{repr} function (or equivalent backtick syntax), the \function{str()}\bifuncindex{str} function, and the \keyword{print} statement. For most objects, the \keyword{print} statement is equivalent to the \function{str()} function, but it is possible to special-case printing to a \ctype{FILE*} if necessary; this should only be done if efficiency is identified as a problem and profiling suggests that creating a temporary string object to be written to a file is too expensive. These handlers are all optional, and most types at most need to implement the \member{tp_str} and \member{tp_repr} handlers. \begin{verbatim} reprfunc tp_repr; reprfunc tp_str; printfunc tp_print; \end{verbatim} The \member{tp_repr} handler should return a string object containing a representation of the instance for which it is called. Here is a simple example: \begin{verbatim} static PyObject * newdatatype_repr(newdatatypeobject * obj) { char buf[4096]; sprintf(buf, "Repr-ified_newdatatype{{size:%d}}", obj->obj_UnderlyingDatatypePtr->size); return PyString_FromString(buf); } \end{verbatim} If no \member{tp_repr} handler is specified, the interpreter will supply a representation that uses the type's \member{tp_name} and a uniquely-identifying value for the object. The \member{tp_str} handler is to \function{str()} what the \member{tp_repr} handler described above is to \function{repr()}; that is, it is called when Python code calls \function{str()} on an instance of your object. It's implementation is very similar to the \member{tp_repr} function, but the resulting string is intended to be human consumption. It \member{tp_str} is not specified, the \member{tp_repr} handler is used instead. Here is a simple example: \begin{verbatim} static PyObject * newdatatype_str(newdatatypeobject * obj) { PyObject *pyString; char buf[4096]; sprintf(buf, "Stringified_newdatatype{{size:%d}}", obj->obj_UnderlyingDatatypePtr->size ); pyString = PyString_FromString(buf); return pyString; } \end{verbatim} The print function will be called whenever Python needs to "print" an instance of the type. For example, if 'node' is an instance of type TreeNode, then the print function is called when Python code calls: \begin{verbatim} print node \end{verbatim} There is a flags argument and one flag, \constant{Py_PRINT_RAW}, and it suggests that you print without string quotes and possibly without interpreting escape sequences. The print function receives a file object as an argument. You will likely want to write to that file object. Here is a sampe print function: \begin{verbatim} static int newdatatype_print(newdatatypeobject *obj, FILE *fp, int flags) { if (flags & Py_PRINT_RAW) { fprintf(fp, "<{newdatatype object--size: %d}>", obj->obj_UnderlyingDatatypePtr->size); } else { fprintf(fp, "\"<{newdatatype object--size: %d}>\"", obj->obj_UnderlyingDatatypePtr->size); } return 0; } \end{verbatim} \subsection{Attribute Management Functions} \begin{verbatim} getattrfunc tp_getattr; setattrfunc tp_setattr; \end{verbatim} The \member{tp_getattr} handle is called when the object requires an attribute look-up. It is called in the same situations where the \method{__getattr__()} method of a class would be called. A likely way to handle this is (1) to implement a set of functions (such as \cfunction{newdatatype_getSize()} and \cfunction{newdatatype_setSize()} in the example below), (2) provide a method table listing these functions, and (3) provide a getattr function that returns the result of a lookup in that table. Here is an example: \begin{verbatim} static PyMethodDef newdatatype_methods[] = { {"getSize", (PyCFunction)newdatatype_getSize, METH_VARARGS}, {"setSize", (PyCFunction)newdatatype_setSize, METH_VARARGS}, {NULL, NULL} /* sentinel */ }; static PyObject * newdatatype_getattr(newdatatypeobject *obj, char *name) { return Py_FindMethod(newdatatype_methods, (PyObject *)obj, name); } \end{verbatim} The \member{tp_setattr} handler is called when the \method{__setattr__()} or \method{__delattr__()} method of a class instance would be called. When an attribute should be deleted, the third parameter will be \NULL. Here is an example that simply raises an exception; if this were really all you wanted, the \member{tp_setattr} handler should be set to \NULL. \begin{verbatim} static int newdatatype_setattr(newdatatypeobject *obj, char *name, PyObject *v) { char buf[1024]; sprintf(buf, "Set attribute not supported for attribute %s", name); PyErr_SetString(PyExc_RuntimeError, buf); return -1; } \end{verbatim} \subsection{Object Comparison} \begin{verbatim} cmpfunc tp_compare; \end{verbatim} The \member{tp_compare} handler is called when comparisons are needed are the object does not implement the specific rich comparison method which matches the requested comparison. (It is always used if defined and the \cfunction{PyObject_Compare()} or \cfunction{PyObject_Cmp()} functions are used, or if \function{cmp()} is used from Python.) It is analogous to the \method{__cmp__()} method. This function should return a negative integer if \var{obj1} is less than \var{obj2}, \code{0} if they are equal, and a positive integer if \var{obj1} is greater than \var{obj2}. Here is a sample implementation: \begin{verbatim} static int newdatatype_compare(newdatatypeobject * obj1, newdatatypeobject * obj2) { long result; if (obj1->obj_UnderlyingDatatypePtr->size < obj2->obj_UnderlyingDatatypePtr->size) { result = -1; } else if (obj1->obj_UnderlyingDatatypePtr->size > obj2->obj_UnderlyingDatatypePtr->size) { result = 1; } else { result = 0; } return result; } \end{verbatim} \subsection{Abstract Protocol Support} \begin{verbatim} tp_as_number; tp_as_sequence; tp_as_mapping; \end{verbatim} If you wish your object to be able to act like a number, a sequence, or a mapping object, then you place the address of a structure that implements the C type \ctype{PyNumberMethods}, \ctype{PySequenceMethods}, or \ctype{PyMappingMethods}, respectively. It is up to you to fill in this structure with appropriate values. You can find examples of the use of each of these in the \file{Objects} directory of the Python source distribution. \begin{verbatim} hashfunc tp_hash; \end{verbatim} This function, if you choose to provide it, should return a hash number for an instance of your datatype. Here is a moderately pointless example: \begin{verbatim} static long newdatatype_hash(newdatatypeobject *obj) { long result; result = obj->obj_UnderlyingDatatypePtr->size; result = result * 3; return result; } \end{verbatim} \begin{verbatim} ternaryfunc tp_call; \end{verbatim} This function is called when an instance of your datatype is "called", for example, if \code{obj1} is an instance of your datatype and the Python script contains \code{obj1('hello')}, the \member{tp_call} handler is invoked. This function takes three arguments: \begin{enumerate} \item \var{arg1} is the instance of the datatype which is the subject of the call. If the call is \code{obj1('hello')}, then \var{arg1} is \code{obj1}. \item \var{arg2} is a tuple containing the arguments to the call. You can use \cfunction{PyArg_ParseTuple()} to extract the arguments. \item \var{arg3} is a dictionary of keyword arguments that were passed. If this is non-\NULL{} and you support keyword arguments, use \cfunction{PyArg_ParseTupleAndKeywords()} to extract the arguments. If you do not want to support keyword arguments and this is non-\NULL, raise a \exception{TypeError} with a message saying that keyword arguments are not supported. \end{enumerate} Here is a desultory example of the implementation of call function. \begin{verbatim} /* Implement the call function. * obj1 is the instance receiving the call. * obj2 is a tuple containing the arguments to the call, in this * case 3 strings. */ static PyObject * newdatatype_call(newdatatypeobject *obj, PyObject *args, PyObject *other) { PyObject *result; char *arg1; char *arg2; char *arg3; char buf[4096]; if (!PyArg_ParseTuple(args, "sss:call", &arg1, &arg2, &arg3)) { return NULL; } sprintf(buf, "Returning -- value: [%d] arg1: [%s] arg2: [%s] arg3: [%s]\n", obj->obj_UnderlyingDatatypePtr->size, arg1, arg2, arg3); printf(buf); return PyString_FromString(buf); } \end{verbatim} \subsection{More Suggestions} Remember that you can omit most of these functions, in which case you provide \code{0} as a value. In the \file{Objects} directory of the Python source distribution, there is a file \file{xxobject.c}, which is intended to be used as a template for the implementation of new types. One useful strategy for implementing a new type is to copy and rename this file, then read the instructions at the top of it. There are type definitions for each of the functions you must provide. They are in \file{object.h} in the Python include directory that comes with the source distribution of Python. In order to learn how to implement any specific method for your new datatype, do the following: Download and unpack the Python source distribution. Go the the \file{Objects} directory, then search the C source files for \code{tp_} plus the function you want (for example, \code{tp_print} or \code{tp_compare}). You will find examples of the function you want to implement. When you need to verify that the type of an object is indeed the object you are implementing and if you use xxobject.c as an starting template for your implementation, then there is a macro defined for this purpose. The macro definition will look something like this: \begin{verbatim} #define is_newdatatypeobject(v) ((v)->ob_type == &Newdatatypetype) \end{verbatim} And, a sample of its use might be something like the following: \begin{verbatim} if (!is_newdatatypeobject(objp1) { PyErr_SetString(PyExc_TypeError, "arg #1 not a newdatatype"); return NULL; } \end{verbatim} %For a reasonably extensive example, from which most of the snippits %above were taken, see \file{newdatatype.c} and \file{newdatatype.h}. --- NEW FILE: unix.tex --- \chapter{Building C and \Cpp{} Extensions on \UNIX{} \label{building-on-unix}} \sectionauthor{Jim Fulton}{jim@zope.com} %The make file make file, building C extensions on Unix Starting in Python 1.4, Python provides a special make file for building make files for building dynamically-linked extensions and custom interpreters. The make file make file builds a make file that reflects various system variables determined by configure when the Python interpreter was built, so people building module's don't have to resupply these settings. This vastly simplifies the process of building extensions and custom interpreters on Unix systems. The make file make file is distributed as the file \file{Misc/Makefile.pre.in} in the Python source distribution. The first step in building extensions or custom interpreters is to copy this make file to a development directory containing extension module source. The make file make file, \file{Makefile.pre.in} uses metadata provided in a file named \file{Setup}. The format of the \file{Setup} file is the same as the \file{Setup} (or \file{Setup.dist}) file provided in the \file{Modules/} directory of the Python source distribution. The \file{Setup} file contains variable definitions: \begin{verbatim} EC=/projects/ExtensionClass \end{verbatim} and module description lines. It can also contain blank lines and comment lines that start with \character{\#}. A module description line includes a module name, source files, options, variable references, and other input files, such as libraries or object files. Consider a simple example: \begin{verbatim} ExtensionClass ExtensionClass.c \end{verbatim} This is the simplest form of a module definition line. It defines a module, \module{ExtensionClass}, which has a single source file, \file{ExtensionClass.c}. This slightly more complex example uses an \strong{-I} option to specify an include directory: \begin{verbatim} EC=/projects/ExtensionClass cPersistence cPersistence.c -I$(EC) \end{verbatim} % $ <-- bow to font lock This example also illustrates the format for variable references. For systems that support dynamic linking, the \file{Setup} file should begin: \begin{verbatim} *shared* \end{verbatim} to indicate that the modules defined in \file{Setup} are to be built as dynamically linked modules. A line containing only \samp{*static*} can be used to indicate the subsequently listed modules should be statically linked. Here is a complete \file{Setup} file for building a \module{cPersistent} module: \begin{verbatim} # Set-up file to build the cPersistence module. # Note that the text should begin in the first column. *shared* # We need the path to the directory containing the ExtensionClass # include file. EC=/projects/ExtensionClass cPersistence cPersistence.c -I$(EC) \end{verbatim} % $ <-- bow to font lock After the \file{Setup} file has been created, \file{Makefile.pre.in} is run with the \samp{boot} target to create a make file: \begin{verbatim} make -f Makefile.pre.in boot \end{verbatim} This creates the file, Makefile. To build the extensions, simply run the created make file: \begin{verbatim} make \end{verbatim} It's not necessary to re-run \file{Makefile.pre.in} if the \file{Setup} file is changed. The make file automatically rebuilds itself if the \file{Setup} file changes. \section{Building Custom Interpreters \label{custom-interps}} The make file built by \file{Makefile.pre.in} can be run with the \samp{static} target to build an interpreter: \begin{verbatim} make static \end{verbatim} Any modules defined in the \file{Setup} file before the \samp{*shared*} line will be statically linked into the interpreter. Typically, a \samp{*shared*} line is omitted from the \file{Setup} file when a custom interpreter is desired. \section{Module Definition Options \label{module-defn-options}} Several compiler options are supported: \begin{tableii}{l|l}{programopt}{Option}{Meaning} \lineii{-C}{Tell the C pre-processor not to discard comments} \lineii{-D\var{name}=\var{value}}{Define a macro} \lineii{-I\var{dir}}{Specify an include directory, \var{dir}} \lineii{-L\var{dir}}{Specify a link-time library directory, \var{dir}} \lineii{-R\var{dir}}{Specify a run-time library directory, \var{dir}} \lineii{-l\var{lib}}{Link a library, \var{lib}} \lineii{-U\var{name}}{Undefine a macro} \end{tableii} Other compiler options can be included (snuck in) by putting them in variables. Source files can include files with \file{.c}, \file{.C}, \file{.cc}, \file{.cpp}, \file{.cxx}, and \file{.c++} extensions. Other input files include files with \file{.a}, \file{.o}, \file{.sl}, and \file{.so} extensions. \section{Example \label{module-defn-example}} Here is a more complicated example from \file{Modules/Setup.dist}: \begin{verbatim} GMP=/ufs/guido/src/gmp mpz mpzmodule.c -I$(GMP) $(GMP)/libgmp.a \end{verbatim} which could also be written as: \begin{verbatim} mpz mpzmodule.c -I$(GMP) -L$(GMP) -lgmp \end{verbatim} \section{Distributing your extension modules \label{distributing}} There are two ways to distribute extension modules for others to use. The way that allows the easiest cross-platform support is to use the \module{distutils}\refstmodindex{distutils} package. The manual \citetitle[../dist/dist.html]{Distributing Python Modules} contains information on this approach. It is recommended that all new extensions be distributed using this approach to allow easy building and installation across platforms. Older extensions should migrate to this approach as well. What follows describes the older approach; there are still many extensions which use this. When distributing your extension modules in source form, make sure to include a \file{Setup} file. The \file{Setup} file should be named \file{Setup.in} in the distribution. The make file make file, \file{Makefile.pre.in}, will copy \file{Setup.in} to \file{Setup} if the person installing the extension doesn't do so manually. Distributing a \file{Setup.in} file makes it easy for people to customize the \file{Setup} file while keeping the original in \file{Setup.in}. It is a good idea to include a copy of \file{Makefile.pre.in} for people who do not have a source distribution of Python. Do not distribute a make file. People building your modules should use \file{Makefile.pre.in} to build their own make file. A \file{README} file included in the package should provide simple instructions to perform the build. --- NEW FILE: windows.tex --- \chapter{Building C and \Cpp{} Extensions on Windows \label{building-on-windows}} This chapter briefly explains how to create a Windows extension module for Python using Microsoft Visual \Cpp{}, and follows with more detailed background information on how it works. The explanatory material is useful for both the Windows programmer learning to build Python extensions and the \UNIX{} programmer interested in producing software which can be successfully built on both \UNIX{} and Windows. \section{A Cookbook Approach \label{win-cookbook}} \sectionauthor{Neil Schemenauer}{neil_schemenauer@transcanada.com} This section provides a recipe for building a Python extension on Windows. Grab the binary installer from \url{http://www.python.org/} and install Python. The binary installer has all of the required header files except for \file{pyconfig.h}. Get the source distribution and extract it into a convenient location. Copy the \file{pyconfig.h} from the \file{PC/} directory into the \file{include/} directory created by the installer. Create a \file{Setup} file for your extension module, as described in chapter \ref{building-on-unix}. Get David Ascher's \file{compile.py} script from \url{http://starship.python.net/crew/da/compile/}. Run the script to create Microsoft Visual \Cpp{} project files. Open the DSW file in Visual \Cpp{} and select \strong{Build}. If your module creates a new type, you may have trouble with this line: \begin{verbatim} PyObject_HEAD_INIT(&PyType_Type) \end{verbatim} Change it to: \begin{verbatim} PyObject_HEAD_INIT(NULL) \end{verbatim} and add the following to the module initialization function: \begin{verbatim} MyObject_Type.ob_type = &PyType_Type; \end{verbatim} Refer to section 3 of the \citetitle[http://www.python.org/doc/FAQ.html]{Python FAQ} for details on why you must do this. \section{Differences Between \UNIX{} and Windows \label{dynamic-linking}} \sectionauthor{Chris Phoenix}{cphoenix@best.com} \UNIX{} and Windows use completely different paradigms for run-time loading of code. Before you try to build a module that can be dynamically loaded, be aware of how your system works. In \UNIX{}, a shared object (\file{.so}) file contains code to be used by the program, and also the names of functions and data that it expects to find in the program. When the file is joined to the program, all references to those functions and data in the file's code are changed to point to the actual locations in the program where the functions and data are placed in memory. This is basically a link operation. In Windows, a dynamic-link library (\file{.dll}) file has no dangling references. Instead, an access to functions or data goes through a lookup table. So the DLL code does not have to be fixed up at runtime to refer to the program's memory; instead, the code already uses the DLL's lookup table, and the lookup table is modified at runtime to point to the functions and data. In \UNIX{}, there is only one type of library file (\file{.a}) which contains code from several object files (\file{.o}). During the link step to create a shared object file (\file{.so}), the linker may find that it doesn't know where an identifier is defined. The linker will look for it in the object files in the libraries; if it finds it, it will include all the code from that object file. In Windows, there are two types of library, a static library and an import library (both called \file{.lib}). A static library is like a \UNIX{} \file{.a} file; it contains code to be included as necessary. An import library is basically used only to reassure the linker that a certain identifier is legal, and will be present in the program when the DLL is loaded. So the linker uses the information from the import library to build the lookup table for using identifiers that are not included in the DLL. When an application or a DLL is linked, an import library may be generated, which will need to be used for all future DLLs that depend on the symbols in the application or DLL. Suppose you are building two dynamic-load modules, B and C, which should share another block of code A. On \UNIX{}, you would \emph{not} pass \file{A.a} to the linker for \file{B.so} and \file{C.so}; that would cause it to be included twice, so that B and C would each have their own copy. In Windows, building \file{A.dll} will also build \file{A.lib}. You \emph{do} pass \file{A.lib} to the linker for B and C. \file{A.lib} does not contain code; it just contains information which will be used at runtime to access A's code. In Windows, using an import library is sort of like using \samp{import spam}; it gives you access to spam's names, but does not create a separate copy. On \UNIX{}, linking with a library is more like \samp{from spam import *}; it does create a separate copy. \section{Using DLLs in Practice \label{win-dlls}} \sectionauthor{Chris Phoenix}{cphoenix@best.com} Windows Python is built in Microsoft Visual \Cpp{}; using other compilers may or may not work (though Borland seems to). The rest of this section is MSV\Cpp{} specific. When creating DLLs in Windows, you must pass \file{python15.lib} to the linker. To build two DLLs, spam and ni (which uses C functions found in spam), you could use these commands: \begin{verbatim} cl /LD /I/python/include spam.c ../libs/python15.lib cl /LD /I/python/include ni.c spam.lib ../libs/python15.lib \end{verbatim} The first command created three files: \file{spam.obj}, \file{spam.dll} and \file{spam.lib}. \file{Spam.dll} does not contain any Python functions (such as \cfunction{PyArg_ParseTuple()}), but it does know how to find the Python code thanks to \file{python15.lib}. The second command created \file{ni.dll} (and \file{.obj} and \file{.lib}), which knows how to find the necessary functions from spam, and also from the Python executable. Not every identifier is exported to the lookup table. If you want any other modules (including Python) to be able to see your identifiers, you have to say \samp{_declspec(dllexport)}, as in \samp{void _declspec(dllexport) initspam(void)} or \samp{PyObject _declspec(dllexport) *NiGetSpamData(void)}. Developer Studio will throw in a lot of import libraries that you do not really need, adding about 100K to your executable. To get rid of them, use the Project Settings dialog, Link tab, to specify \emph{ignore default libraries}. Add the correct \file{msvcrt\var{xx}.lib} to the list of libraries. Index: ext.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/ext.tex,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** ext.tex 2001/08/15 19:07:18 1.103 --- ext.tex 2001/08/20 19:30:29 1.104 *************** *** 51,3212 **** ! \chapter{Extending Python with C or \Cpp{} \label{intro}} ! ! ! It is quite easy to add new built-in modules to Python, if you know ! how to program in C. Such \dfn{extension modules} can do two things ! that can't be done directly in Python: they can implement new built-in ! object types, and they can call C library functions and system calls. ! [...3142 lines suppressed...] ! \end{verbatim} ! \refstmodindex{distutils.sysconfig} ! ! The contents of the string presented will be the options that should ! be used. If the string is empty, there's no need to add any ! additional options. The \constant{LINKFORSHARED} definition ! corresponds to the variable of the same name in Python's top-level ! \file{Makefile}. --- 51,59 ---- ! \input{extending} ! \input{newtypes} ! \input{unix} ! \input{windows} ! \input{embedding} From gvanrossum@users.sourceforge.net Mon Aug 20 20:43:48 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 12:43:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat AE.py,NONE,1.1.2.1 App.py,NONE,1.1.2.1 Appearance.py,NONE,1.1.2.1 AppleEvents.py,NONE,1.1.2.1 Balloons.py,NONE,1.1.2.1 CF.py,NONE,1.1.2.1 Cm.py,NONE,1.1.2.1 Components.py,NONE,1.1.2.1 ControlAccessor.py,NONE,1.1.2.1 Controls.py,NONE,1.1.2.1 Ctl.py,NONE,1.1.2.1 Dialogs.py,NONE,1.1.2.1 Dlg.py,NONE,1.1.2.1 Drag.py,NONE,1.1.2.1 Dragconst.py,NONE,1.1.2.1 Events.py,NONE,1.1.2.1 Evt.py,NONE,1.1.2.1 Fm.py,NONE,1.1.2.1 Fonts.py,NONE,1.1.2.1 Help.py,NONE,1.1.2.1 Icn.py,NONE,1.1.2.1 Icons.py,NONE,1.1.2.1 List.py,NONE,1.1.2.1 Lists.py,NONE,1.1.2.1 MacTextEditor.py,NONE,1.1.2.1 MediaDescr.py,NONE,1.1.2.1 Menu.py,NONE,1.1.2.1 Menus.py,NONE,1.1.2.1 Mlte.py,NONE,1.1.2.1 QDOffscreen.py,NONE,1.1.2.1 Qd.py,NONE,1.1.2.1 Qdoffs.py,NONE,1.1.2.1 Qt.py,NONE,1.1.2.1 QuickDraw.py,NONE,1.1.2.1 QuickTime.py,NONE,1.1.2.1 Res.py,NONE,1.1.2.1 Resources.py,NONE,1.1.2.1 Scrap.py,NONE,1.1.2.1 Snd.py,NONE,1.1.2.1 Sndihooks.py,NONE,1.1.2.1 Sound.py,NONE,1.1.2.1 TE.py,NONE,1.1.2.1 TextEdit.py,NONE,1.1.2.1 Win.py,NONE,1.1.2.1 Windows.py,NONE,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv21876/lib-compat Added Files: Tag: r22a2-branch AE.py App.py Appearance.py AppleEvents.py Balloons.py CF.py Cm.py Components.py ControlAccessor.py Controls.py Ctl.py Dialogs.py Dlg.py Drag.py Dragconst.py Events.py Evt.py Fm.py Fonts.py Help.py Icn.py Icons.py List.py Lists.py MacTextEditor.py MediaDescr.py Menu.py Menus.py Mlte.py QDOffscreen.py Qd.py Qdoffs.py Qt.py QuickDraw.py QuickTime.py Res.py Resources.py Scrap.py Snd.py Sndihooks.py Sound.py TE.py TextEdit.py Win.py Windows.py Log Message: Merge trunk --- NEW FILE: AE.py --- from Carbon.AE import * --- NEW FILE: App.py --- from Carbon.App import * --- NEW FILE: Appearance.py --- from Carbon.Appearance import * --- NEW FILE: AppleEvents.py --- from Carbon.AppleEvents import * --- NEW FILE: Balloons.py --- from Carbon.Balloons import * --- NEW FILE: CF.py --- from Carbon.CF import * --- NEW FILE: Cm.py --- from Carbon.Cm import * --- NEW FILE: Components.py --- from Carbon.Components import * --- NEW FILE: ControlAccessor.py --- from Carbon.ControlAccessor import * --- NEW FILE: Controls.py --- from Carbon.Controls import * --- NEW FILE: Ctl.py --- from Carbon.Ctl import * --- NEW FILE: Dialogs.py --- from Carbon.Dialogs import * --- NEW FILE: Dlg.py --- from Carbon.Dlg import * --- NEW FILE: Drag.py --- from Carbon.Drag import * --- NEW FILE: Dragconst.py --- from Carbon.Dragconst import * --- NEW FILE: Events.py --- from Carbon.Events import * --- NEW FILE: Evt.py --- from Carbon.Evt import * --- NEW FILE: Fm.py --- from Carbon.Fm import * --- NEW FILE: Fonts.py --- from Carbon.Fonts import * --- NEW FILE: Help.py --- from Carbon.Help import * --- NEW FILE: Icn.py --- from Carbon.Icn import * --- NEW FILE: Icons.py --- from Carbon.Icons import * --- NEW FILE: List.py --- from Carbon.List import * --- NEW FILE: Lists.py --- from Carbon.Lists import * --- NEW FILE: MacTextEditor.py --- from Carbon.MacTextEditor import * --- NEW FILE: MediaDescr.py --- from Carbon.MediaDescr import * --- NEW FILE: Menu.py --- from Carbon.Menu import * --- NEW FILE: Menus.py --- from Carbon.Menus import * --- NEW FILE: Mlte.py --- from Carbon.Mlte import * --- NEW FILE: QDOffscreen.py --- from Carbon.QDOffscreen import * --- NEW FILE: Qd.py --- from Carbon.Qd import * --- NEW FILE: Qdoffs.py --- from Carbon.Qdoffs import * --- NEW FILE: Qt.py --- from Carbon.Qt import * --- NEW FILE: QuickDraw.py --- from Carbon.QuickDraw import * --- NEW FILE: QuickTime.py --- from Carbon.QuickTime import * --- NEW FILE: Res.py --- from Carbon.Res import * --- NEW FILE: Resources.py --- from Carbon.Resources import * --- NEW FILE: Scrap.py --- from Carbon.Scrap import * --- NEW FILE: Snd.py --- from Carbon.Snd import * --- NEW FILE: Sndihooks.py --- from Carbon.Sndihooks import * --- NEW FILE: Sound.py --- from Carbon.Sound import * --- NEW FILE: TE.py --- from Carbon.TE import * --- NEW FILE: TextEdit.py --- from Carbon.TextEdit import * --- NEW FILE: Win.py --- from Carbon.Win import * --- NEW FILE: Windows.py --- from Carbon.Windows import * From gvanrossum@users.sourceforge.net Mon Aug 20 20:43:48 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 12:43:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Appearance.py,NONE,1.1.2.1 AppleEvents.py,NONE,1.1.2.1 Balloons.py,NONE,1.1.2.1 Components.py,NONE,1.1.2.1 ControlAccessor.py,NONE,1.1.2.1 Controls.py,NONE,1.1.2.1 Dialogs.py,NONE,1.1.2.1 Dragconst.py,NONE,1.1.2.1 Events.py,NONE,1.1.2.1 Fonts.py,NONE,1.1.2.1 Icons.py,NONE,1.1.2.1 Lists.py,NONE,1.1.2.1 MacTextEditor.py,NONE,1.1.2.1 MediaDescr.py,NONE,1.1.2.1 Menus.py,NONE,1.1.2.1 QDOffscreen.py,NONE,1.1.2.1 QuickDraw.py,NONE,1.1.2.1 QuickTime.py,NONE,1.1.2.1 Resources.py,NONE,1.1.2.1 Sound.py,NONE,1.1.2.1 TextEdit.py,NONE,1.1.2.1 Windows.py,NONE,1.1.2.1 __init__.py,NONE,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv21876/Carbon Added Files: Tag: r22a2-branch Appearance.py AppleEvents.py Balloons.py Components.py ControlAccessor.py Controls.py Dialogs.py Dragconst.py Events.py Fonts.py Icons.py Lists.py MacTextEditor.py MediaDescr.py Menus.py QDOffscreen.py QuickDraw.py QuickTime.py Resources.py Sound.py TextEdit.py Windows.py __init__.py Log Message: Merge trunk --- NEW FILE: Appearance.py --- # Generated from 'Appearance.h' def FOUR_CHAR_CODE(x): return x kAppearanceEventClass = FOUR_CHAR_CODE('appr') kAEAppearanceChanged = FOUR_CHAR_CODE('thme') kAESystemFontChanged = FOUR_CHAR_CODE('sysf') kAESmallSystemFontChanged = FOUR_CHAR_CODE('ssfn') kAEViewsFontChanged = FOUR_CHAR_CODE('vfnt') kThemeDataFileType = FOUR_CHAR_CODE('thme') kThemePlatinumFileType = FOUR_CHAR_CODE('pltn') kThemeCustomThemesFileType = FOUR_CHAR_CODE('scen') kThemeSoundTrackFileType = FOUR_CHAR_CODE('tsnd') kThemeBrushDialogBackgroundActive = 1 kThemeBrushDialogBackgroundInactive = 2 kThemeBrushAlertBackgroundActive = 3 kThemeBrushAlertBackgroundInactive = 4 kThemeBrushModelessDialogBackgroundActive = 5 kThemeBrushModelessDialogBackgroundInactive = 6 kThemeBrushUtilityWindowBackgroundActive = 7 kThemeBrushUtilityWindowBackgroundInactive = 8 kThemeBrushListViewSortColumnBackground = 9 kThemeBrushListViewBackground = 10 kThemeBrushIconLabelBackground = 11 kThemeBrushListViewSeparator = 12 kThemeBrushChasingArrows = 13 kThemeBrushDragHilite = 14 kThemeBrushDocumentWindowBackground = 15 kThemeBrushFinderWindowBackground = 16 kThemeBrushScrollBarDelimiterActive = 17 kThemeBrushScrollBarDelimiterInactive = 18 kThemeBrushFocusHighlight = 19 kThemeBrushPopupArrowActive = 20 kThemeBrushPopupArrowPressed = 21 kThemeBrushPopupArrowInactive = 22 kThemeBrushAppleGuideCoachmark = 23 kThemeBrushIconLabelBackgroundSelected = 24 kThemeBrushStaticAreaFill = 25 kThemeBrushActiveAreaFill = 26 kThemeBrushButtonFrameActive = 27 kThemeBrushButtonFrameInactive = 28 kThemeBrushButtonFaceActive = 29 kThemeBrushButtonFaceInactive = 30 kThemeBrushButtonFacePressed = 31 kThemeBrushButtonActiveDarkShadow = 32 kThemeBrushButtonActiveDarkHighlight = 33 kThemeBrushButtonActiveLightShadow = 34 kThemeBrushButtonActiveLightHighlight = 35 kThemeBrushButtonInactiveDarkShadow = 36 kThemeBrushButtonInactiveDarkHighlight = 37 kThemeBrushButtonInactiveLightShadow = 38 kThemeBrushButtonInactiveLightHighlight = 39 kThemeBrushButtonPressedDarkShadow = 40 kThemeBrushButtonPressedDarkHighlight = 41 kThemeBrushButtonPressedLightShadow = 42 kThemeBrushButtonPressedLightHighlight = 43 kThemeBrushBevelActiveLight = 44 kThemeBrushBevelActiveDark = 45 kThemeBrushBevelInactiveLight = 46 kThemeBrushBevelInactiveDark = 47 kThemeBrushNotificationWindowBackground = 48 kThemeBrushBlack = -1 kThemeBrushWhite = -2 kThemeTextColorDialogActive = 1 kThemeTextColorDialogInactive = 2 kThemeTextColorAlertActive = 3 kThemeTextColorAlertInactive = 4 kThemeTextColorModelessDialogActive = 5 kThemeTextColorModelessDialogInactive = 6 kThemeTextColorWindowHeaderActive = 7 kThemeTextColorWindowHeaderInactive = 8 kThemeTextColorPlacardActive = 9 kThemeTextColorPlacardInactive = 10 kThemeTextColorPlacardPressed = 11 kThemeTextColorPushButtonActive = 12 kThemeTextColorPushButtonInactive = 13 kThemeTextColorPushButtonPressed = 14 kThemeTextColorBevelButtonActive = 15 kThemeTextColorBevelButtonInactive = 16 kThemeTextColorBevelButtonPressed = 17 kThemeTextColorPopupButtonActive = 18 kThemeTextColorPopupButtonInactive = 19 kThemeTextColorPopupButtonPressed = 20 kThemeTextColorIconLabel = 21 kThemeTextColorListView = 22 kThemeTextColorDocumentWindowTitleActive = 23 kThemeTextColorDocumentWindowTitleInactive = 24 kThemeTextColorMovableModalWindowTitleActive = 25 kThemeTextColorMovableModalWindowTitleInactive = 26 kThemeTextColorUtilityWindowTitleActive = 27 kThemeTextColorUtilityWindowTitleInactive = 28 kThemeTextColorPopupWindowTitleActive = 29 kThemeTextColorPopupWindowTitleInactive = 30 kThemeTextColorRootMenuActive = 31 kThemeTextColorRootMenuSelected = 32 kThemeTextColorRootMenuDisabled = 33 kThemeTextColorMenuItemActive = 34 kThemeTextColorMenuItemSelected = 35 kThemeTextColorMenuItemDisabled = 36 kThemeTextColorPopupLabelActive = 37 kThemeTextColorPopupLabelInactive = 38 kThemeTextColorTabFrontActive = 39 kThemeTextColorTabNonFrontActive = 40 kThemeTextColorTabNonFrontPressed = 41 kThemeTextColorTabFrontInactive = 42 kThemeTextColorTabNonFrontInactive = 43 kThemeTextColorIconLabelSelected = 44 kThemeTextColorBevelButtonStickyActive = 45 kThemeTextColorBevelButtonStickyInactive = 46 kThemeTextColorNotification = 47 kThemeTextColorBlack = -1 kThemeTextColorWhite = -2 kThemeStateInactive = 0 kThemeStateActive = 1 kThemeStatePressed = 2 kThemeStateRollover = 6 kThemeStateUnavailable = 7 kThemeStateDisabled = 0 kThemeStatePressedUp = 2 kThemeStatePressedDown = 3 kThemeArrowCursor = 0 kThemeCopyArrowCursor = 1 kThemeAliasArrowCursor = 2 kThemeContextualMenuArrowCursor = 3 kThemeIBeamCursor = 4 kThemeCrossCursor = 5 kThemePlusCursor = 6 kThemeWatchCursor = 7 kThemeClosedHandCursor = 8 kThemeOpenHandCursor = 9 kThemePointingHandCursor = 10 kThemeCountingUpHandCursor = 11 kThemeCountingDownHandCursor = 12 kThemeCountingUpAndDownHandCursor = 13 kThemeSpinningCursor = 14 kThemeResizeLeftCursor = 15 kThemeResizeRightCursor = 16 kThemeResizeLeftRightCursor = 17 kThemeMenuBarNormal = 0 kThemeMenuBarSelected = 1 kThemeMenuSquareMenuBar = (1 << 0) kThemeMenuActive = 0 kThemeMenuSelected = 1 kThemeMenuDisabled = 3 kThemeMenuTypePullDown = 0 kThemeMenuTypePopUp = 1 kThemeMenuTypeHierarchical = 2 kThemeMenuTypeInactive = 0x0100 kThemeMenuItemPlain = 0 kThemeMenuItemHierarchical = 1 kThemeMenuItemScrollUpArrow = 2 kThemeMenuItemScrollDownArrow = 3 kThemeMenuItemAtTop = 0x0100 kThemeMenuItemAtBottom = 0x0200 kThemeMenuItemHierBackground = 0x0400 kThemeMenuItemPopUpBackground = 0x0800 kThemeMenuItemHasIcon = 0x8000 kThemeBackgroundTabPane = 1 kThemeBackgroundPlacard = 2 kThemeBackgroundWindowHeader = 3 kThemeBackgroundListViewWindowHeader = 4 kThemeNameTag = FOUR_CHAR_CODE('name') kThemeAppearanceFileNameTag = FOUR_CHAR_CODE('thme') kThemeVariantNameTag = FOUR_CHAR_CODE('varn') kThemeSystemFontTag = FOUR_CHAR_CODE('lgsf') kThemeSmallSystemFontTag = FOUR_CHAR_CODE('smsf') kThemeViewsFontTag = FOUR_CHAR_CODE('vfnt') kThemeViewsFontSizeTag = FOUR_CHAR_CODE('vfsz') kThemeDesktopPatternNameTag = FOUR_CHAR_CODE('patn') kThemeDesktopPatternTag = FOUR_CHAR_CODE('patt') kThemeDesktopPictureNameTag = FOUR_CHAR_CODE('dpnm') kThemeDesktopPictureAliasTag = FOUR_CHAR_CODE('dpal') kThemeDesktopPictureAlignmentTag = FOUR_CHAR_CODE('dpan') kThemeHighlightColorNameTag = FOUR_CHAR_CODE('hcnm') kThemeHighlightColorTag = FOUR_CHAR_CODE('hcol') kThemeExamplePictureIDTag = FOUR_CHAR_CODE('epic') kThemeSoundsEnabledTag = FOUR_CHAR_CODE('snds') kThemeSoundTrackNameTag = FOUR_CHAR_CODE('sndt') kThemeSoundMaskTag = FOUR_CHAR_CODE('smsk') kThemeUserDefinedTag = FOUR_CHAR_CODE('user') kThemeScrollBarArrowStyleTag = FOUR_CHAR_CODE('sbar') kThemeScrollBarThumbStyleTag = FOUR_CHAR_CODE('sbth') kThemeSmoothFontEnabledTag = FOUR_CHAR_CODE('smoo') kThemeSmoothFontMinSizeTag = FOUR_CHAR_CODE('smos') kThemeDblClickCollapseTag = FOUR_CHAR_CODE('coll') kThemeCheckBoxClassicX = 0 kThemeCheckBoxCheckMark = 1 kThemeScrollBarArrowsSingle = 0 kThemeScrollBarArrowsLowerRight = 1 kThemeScrollBarThumbNormal = 0 kThemeScrollBarThumbProportional = 1 kThemeSystemFont = 0 kThemeSmallSystemFont = 1 kThemeSmallEmphasizedSystemFont = 2 kThemeViewsFont = 3 kThemeTabNonFront = 0 kThemeTabNonFrontPressed = 1 kThemeTabNonFrontInactive = 2 kThemeTabFront = 3 kThemeTabFrontInactive = 4 kThemeTabNorth = 0 kThemeTabSouth = 1 kThemeTabEast = 2 kThemeTabWest = 3 kThemeSmallTabHeight = 16 kThemeLargeTabHeight = 21 kThemeTabPaneOverlap = 3 kThemeSmallTabHeightMax = 19 kThemeLargeTabHeightMax = 24 kThemeScrollBar = 0 kThemeSmallScrollBar = 1 kThemeSlider = 2 kThemeProgressBar = 3 kThemeIndeterminateBar = 4 kThemeTrackActive = 0 kThemeTrackDisabled = 1 kThemeTrackNothingToScroll = 2 kThemeTrackInactive = 3 kThemeLeftOutsideArrowPressed = 0x01 kThemeLeftInsideArrowPressed = 0x02 kThemeLeftTrackPressed = 0x04 kThemeThumbPressed = 0x08 kThemeRightTrackPressed = 0x10 kThemeRightInsideArrowPressed = 0x20 kThemeRightOutsideArrowPressed = 0x40 kThemeTopOutsideArrowPressed = kThemeLeftOutsideArrowPressed kThemeTopInsideArrowPressed = kThemeLeftInsideArrowPressed kThemeTopTrackPressed = kThemeLeftTrackPressed kThemeBottomTrackPressed = kThemeRightTrackPressed kThemeBottomInsideArrowPressed = kThemeRightInsideArrowPressed kThemeBottomOutsideArrowPressed = kThemeRightOutsideArrowPressed kThemeThumbPlain = 0 kThemeThumbUpward = 1 kThemeThumbDownward = 2 kThemeTrackHorizontal = (1 << 0) kThemeTrackRightToLeft = (1 << 1) kThemeTrackShowThumb = (1 << 2) kThemeTrackThumbRgnIsNotGhost = (1 << 3) kThemeWindowHasGrow = (1 << 0) kThemeWindowHasHorizontalZoom = (1 << 3) kThemeWindowHasVerticalZoom = (1 << 4) kThemeWindowHasFullZoom = kThemeWindowHasHorizontalZoom + kThemeWindowHasVerticalZoom kThemeWindowHasCloseBox = (1 << 5) kThemeWindowHasCollapseBox = (1 << 6) kThemeWindowHasTitleText = (1 << 7) kThemeWindowIsCollapsed = (1 << 8) kThemeWindowHasA = (1 << 9) kThemeWindowHasB = (1 << 10) kThemeDocumentWindow = 0 kThemeDialogWindow = 1 kThemeMovableDialogWindow = 2 kThemeAlertWindow = 3 kThemeMovableAlertWindow = 4 kThemePlainDialogWindow = 5 kThemeShadowDialogWindow = 6 kThemePopupWindow = 7 kThemeUtilityWindow = 8 kThemeUtilitySideWindow = 9 kThemeWidgetCloseBox = 0 kThemeWidgetZoomBox = 1 kThemeWidgetCollapseBox = 2 kThemeWidgetABox = 3 kThemeWidgetBBox = 4 kThemeWidgetBOffBox = 5 kThemeArrowLeft = 0 kThemeArrowDown = 1 kThemeArrowRight = 2 kThemeArrowUp = 3 kThemeArrow3pt = 0 kThemeArrow5pt = 1 kThemeArrow7pt = 2 kThemeArrow9pt = 3 kThemeGrowLeft = (1 << 0) kThemeGrowRight = (1 << 1) kThemeGrowUp = (1 << 2) kThemeGrowDown = (1 << 3) kThemePushButton = 0 kThemeCheckBox = 1 kThemeRadioButton = 2 kThemeBevelButton = 3 kThemeArrowButton = 4 kThemePopupButton = 5 kThemeDisclosureButton = 6 kThemeIncDecButton = 7 kThemeSmallBevelButton = 8 kThemeMediumBevelButton = 3 kThemeLargeBevelButton = 9 kThemeButtonOff = 0 kThemeButtonOn = 1 kThemeButtonMixed = 2 kThemeDisclosureRight = 0 kThemeDisclosureDown = 1 kThemeDisclosureLeft = 2 kThemeAdornmentNone = 0 kThemeAdornmentDefault = (1 << 0) kThemeAdornmentFocus = (1 << 2) kThemeAdornmentRightToLeft = (1 << 4) kThemeAdornmentDrawIndicatorOnly = (1 << 5) kThemeNoSounds = 0 kThemeWindowSoundsMask = (1 << 0) kThemeMenuSoundsMask = (1 << 1) kThemeControlSoundsMask = (1 << 2) kThemeFinderSoundsMask = (1 << 3) kThemeDragSoundNone = 0 kThemeDragSoundMoveWindow = FOUR_CHAR_CODE('wmov') kThemeDragSoundGrowWindow = FOUR_CHAR_CODE('wgro') kThemeDragSoundMoveUtilWindow = FOUR_CHAR_CODE('umov') kThemeDragSoundGrowUtilWindow = FOUR_CHAR_CODE('ugro') kThemeDragSoundMoveDialog = FOUR_CHAR_CODE('dmov') kThemeDragSoundMoveAlert = FOUR_CHAR_CODE('amov') kThemeDragSoundMoveIcon = FOUR_CHAR_CODE('imov') kThemeDragSoundSliderThumb = FOUR_CHAR_CODE('slth') kThemeDragSoundSliderGhost = FOUR_CHAR_CODE('slgh') kThemeDragSoundScrollBarThumb = FOUR_CHAR_CODE('sbth') kThemeDragSoundScrollBarGhost = FOUR_CHAR_CODE('sbgh') kThemeDragSoundScrollBarArrowDecreasing = FOUR_CHAR_CODE('sbad') kThemeDragSoundScrollBarArrowIncreasing = FOUR_CHAR_CODE('sbai') kThemeDragSoundDragging = FOUR_CHAR_CODE('drag') kThemeSoundNone = 0 kThemeSoundMenuOpen = FOUR_CHAR_CODE('mnuo') kThemeSoundMenuClose = FOUR_CHAR_CODE('mnuc') kThemeSoundMenuItemHilite = FOUR_CHAR_CODE('mnui') kThemeSoundMenuItemRelease = FOUR_CHAR_CODE('mnus') kThemeSoundWindowClosePress = FOUR_CHAR_CODE('wclp') kThemeSoundWindowCloseEnter = FOUR_CHAR_CODE('wcle') kThemeSoundWindowCloseExit = FOUR_CHAR_CODE('wclx') kThemeSoundWindowCloseRelease = FOUR_CHAR_CODE('wclr') kThemeSoundWindowZoomPress = FOUR_CHAR_CODE('wzmp') kThemeSoundWindowZoomEnter = FOUR_CHAR_CODE('wzme') kThemeSoundWindowZoomExit = FOUR_CHAR_CODE('wzmx') kThemeSoundWindowZoomRelease = FOUR_CHAR_CODE('wzmr') kThemeSoundWindowCollapsePress = FOUR_CHAR_CODE('wcop') kThemeSoundWindowCollapseEnter = FOUR_CHAR_CODE('wcoe') kThemeSoundWindowCollapseExit = FOUR_CHAR_CODE('wcox') kThemeSoundWindowCollapseRelease = FOUR_CHAR_CODE('wcor') kThemeSoundWindowDragBoundary = FOUR_CHAR_CODE('wdbd') kThemeSoundUtilWinClosePress = FOUR_CHAR_CODE('uclp') kThemeSoundUtilWinCloseEnter = FOUR_CHAR_CODE('ucle') kThemeSoundUtilWinCloseExit = FOUR_CHAR_CODE('uclx') kThemeSoundUtilWinCloseRelease = FOUR_CHAR_CODE('uclr') kThemeSoundUtilWinZoomPress = FOUR_CHAR_CODE('uzmp') kThemeSoundUtilWinZoomEnter = FOUR_CHAR_CODE('uzme') kThemeSoundUtilWinZoomExit = FOUR_CHAR_CODE('uzmx') kThemeSoundUtilWinZoomRelease = FOUR_CHAR_CODE('uzmr') kThemeSoundUtilWinCollapsePress = FOUR_CHAR_CODE('ucop') kThemeSoundUtilWinCollapseEnter = FOUR_CHAR_CODE('ucoe') kThemeSoundUtilWinCollapseExit = FOUR_CHAR_CODE('ucox') kThemeSoundUtilWinCollapseRelease = FOUR_CHAR_CODE('ucor') kThemeSoundUtilWinDragBoundary = FOUR_CHAR_CODE('udbd') kThemeSoundWindowOpen = FOUR_CHAR_CODE('wopn') kThemeSoundWindowClose = FOUR_CHAR_CODE('wcls') kThemeSoundWindowZoomIn = FOUR_CHAR_CODE('wzmi') kThemeSoundWindowZoomOut = FOUR_CHAR_CODE('wzmo') kThemeSoundWindowCollapseUp = FOUR_CHAR_CODE('wcol') kThemeSoundWindowCollapseDown = FOUR_CHAR_CODE('wexp') kThemeSoundWindowActivate = FOUR_CHAR_CODE('wact') kThemeSoundUtilWindowOpen = FOUR_CHAR_CODE('uopn') kThemeSoundUtilWindowClose = FOUR_CHAR_CODE('ucls') kThemeSoundUtilWindowZoomIn = FOUR_CHAR_CODE('uzmi') kThemeSoundUtilWindowZoomOut = FOUR_CHAR_CODE('uzmo') kThemeSoundUtilWindowCollapseUp = FOUR_CHAR_CODE('ucol') kThemeSoundUtilWindowCollapseDown = FOUR_CHAR_CODE('uexp') kThemeSoundUtilWindowActivate = FOUR_CHAR_CODE('uact') kThemeSoundDialogOpen = FOUR_CHAR_CODE('dopn') kThemeSoundDialogClose = FOUR_CHAR_CODE('dlgc') kThemeSoundAlertOpen = FOUR_CHAR_CODE('aopn') kThemeSoundAlertClose = FOUR_CHAR_CODE('altc') kThemeSoundPopupWindowOpen = FOUR_CHAR_CODE('pwop') kThemeSoundPopupWindowClose = FOUR_CHAR_CODE('pwcl') kThemeSoundButtonPress = FOUR_CHAR_CODE('btnp') kThemeSoundButtonEnter = FOUR_CHAR_CODE('btne') kThemeSoundButtonExit = FOUR_CHAR_CODE('btnx') kThemeSoundButtonRelease = FOUR_CHAR_CODE('btnr') kThemeSoundDefaultButtonPress = FOUR_CHAR_CODE('dbtp') kThemeSoundDefaultButtonEnter = FOUR_CHAR_CODE('dbte') kThemeSoundDefaultButtonExit = FOUR_CHAR_CODE('dbtx') kThemeSoundDefaultButtonRelease = FOUR_CHAR_CODE('dbtr') kThemeSoundCancelButtonPress = FOUR_CHAR_CODE('cbtp') kThemeSoundCancelButtonEnter = FOUR_CHAR_CODE('cbte') kThemeSoundCancelButtonExit = FOUR_CHAR_CODE('cbtx') kThemeSoundCancelButtonRelease = FOUR_CHAR_CODE('cbtr') kThemeSoundCheckboxPress = FOUR_CHAR_CODE('chkp') kThemeSoundCheckboxEnter = FOUR_CHAR_CODE('chke') kThemeSoundCheckboxExit = FOUR_CHAR_CODE('chkx') kThemeSoundCheckboxRelease = FOUR_CHAR_CODE('chkr') kThemeSoundRadioPress = FOUR_CHAR_CODE('radp') kThemeSoundRadioEnter = FOUR_CHAR_CODE('rade') kThemeSoundRadioExit = FOUR_CHAR_CODE('radx') kThemeSoundRadioRelease = FOUR_CHAR_CODE('radr') kThemeSoundScrollArrowPress = FOUR_CHAR_CODE('sbap') kThemeSoundScrollArrowEnter = FOUR_CHAR_CODE('sbae') kThemeSoundScrollArrowExit = FOUR_CHAR_CODE('sbax') kThemeSoundScrollArrowRelease = FOUR_CHAR_CODE('sbar') kThemeSoundScrollEndOfTrack = FOUR_CHAR_CODE('sbte') kThemeSoundScrollTrackPress = FOUR_CHAR_CODE('sbtp') kThemeSoundSliderEndOfTrack = FOUR_CHAR_CODE('slte') kThemeSoundSliderTrackPress = FOUR_CHAR_CODE('sltp') kThemeSoundBalloonOpen = FOUR_CHAR_CODE('blno') kThemeSoundBalloonClose = FOUR_CHAR_CODE('blnc') kThemeSoundBevelPress = FOUR_CHAR_CODE('bevp') kThemeSoundBevelEnter = FOUR_CHAR_CODE('beve') kThemeSoundBevelExit = FOUR_CHAR_CODE('bevx') kThemeSoundBevelRelease = FOUR_CHAR_CODE('bevr') kThemeSoundLittleArrowUpPress = FOUR_CHAR_CODE('laup') kThemeSoundLittleArrowDnPress = FOUR_CHAR_CODE('ladp') kThemeSoundLittleArrowEnter = FOUR_CHAR_CODE('lare') kThemeSoundLittleArrowExit = FOUR_CHAR_CODE('larx') kThemeSoundLittleArrowUpRelease = FOUR_CHAR_CODE('laur') kThemeSoundLittleArrowDnRelease = FOUR_CHAR_CODE('ladr') kThemeSoundPopupPress = FOUR_CHAR_CODE('popp') kThemeSoundPopupEnter = FOUR_CHAR_CODE('pope') kThemeSoundPopupExit = FOUR_CHAR_CODE('popx') kThemeSoundPopupRelease = FOUR_CHAR_CODE('popr') kThemeSoundDisclosurePress = FOUR_CHAR_CODE('dscp') kThemeSoundDisclosureEnter = FOUR_CHAR_CODE('dsce') kThemeSoundDisclosureExit = FOUR_CHAR_CODE('dscx') kThemeSoundDisclosureRelease = FOUR_CHAR_CODE('dscr') kThemeSoundTabPressed = FOUR_CHAR_CODE('tabp') kThemeSoundTabEnter = FOUR_CHAR_CODE('tabe') kThemeSoundTabExit = FOUR_CHAR_CODE('tabx') kThemeSoundTabRelease = FOUR_CHAR_CODE('tabr') kThemeSoundDragTargetHilite = FOUR_CHAR_CODE('dthi') kThemeSoundDragTargetUnhilite = FOUR_CHAR_CODE('dtuh') kThemeSoundDragTargetDrop = FOUR_CHAR_CODE('dtdr') kThemeSoundEmptyTrash = FOUR_CHAR_CODE('ftrs') kThemeSoundSelectItem = FOUR_CHAR_CODE('fsel') kThemeSoundNewItem = FOUR_CHAR_CODE('fnew') kThemeSoundReceiveDrop = FOUR_CHAR_CODE('fdrp') kThemeSoundCopyDone = FOUR_CHAR_CODE('fcpd') kThemeSoundResolveAlias = FOUR_CHAR_CODE('fral') kThemeSoundLaunchApp = FOUR_CHAR_CODE('flap') kThemeSoundDiskInsert = FOUR_CHAR_CODE('dski') kThemeSoundDiskEject = FOUR_CHAR_CODE('dske') kThemeSoundFinderDragOnIcon = FOUR_CHAR_CODE('fdon') kThemeSoundFinderDragOffIcon = FOUR_CHAR_CODE('fdof') kThemePopupTabNormalPosition = 0 kThemePopupTabCenterOnWindow = 1 kThemePopupTabCenterOnOffset = 2 kThemeMetricScrollBarWidth = 0 kThemeMetricSmallScrollBarWidth = 1 kThemeMetricCheckBoxGlyphHeight = 2 kThemeMetricRadioButtonGlyphHeight = 3 # appearanceBadBrushIndexErr = themeInvalidBrushErr # appearanceProcessRegisteredErr = themeProcessRegisteredErr # appearanceProcessNotRegisteredErr = themeProcessNotRegisteredErr # appearanceBadTextColorIndexErr = themeBadTextColorErr # appearanceThemeHasNoAccents = themeHasNoAccentsErr # appearanceBadCursorIndexErr = themeBadCursorIndexErr kThemeActiveDialogBackgroundBrush = kThemeBrushDialogBackgroundActive kThemeInactiveDialogBackgroundBrush = kThemeBrushDialogBackgroundInactive kThemeActiveAlertBackgroundBrush = kThemeBrushAlertBackgroundActive kThemeInactiveAlertBackgroundBrush = kThemeBrushAlertBackgroundInactive kThemeActiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundActive kThemeInactiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundInactive kThemeActiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundActive kThemeInactiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundInactive kThemeListViewSortColumnBackgroundBrush = kThemeBrushListViewSortColumnBackground kThemeListViewBackgroundBrush = kThemeBrushListViewBackground kThemeIconLabelBackgroundBrush = kThemeBrushIconLabelBackground kThemeListViewSeparatorBrush = kThemeBrushListViewSeparator kThemeChasingArrowsBrush = kThemeBrushChasingArrows kThemeDragHiliteBrush = kThemeBrushDragHilite kThemeDocumentWindowBackgroundBrush = kThemeBrushDocumentWindowBackground kThemeFinderWindowBackgroundBrush = kThemeBrushFinderWindowBackground kThemeActiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterActive kThemeInactiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterInactive kThemeFocusHighlightBrush = kThemeBrushFocusHighlight kThemeActivePopupArrowBrush = kThemeBrushPopupArrowActive kThemePressedPopupArrowBrush = kThemeBrushPopupArrowPressed kThemeInactivePopupArrowBrush = kThemeBrushPopupArrowInactive kThemeAppleGuideCoachmarkBrush = kThemeBrushAppleGuideCoachmark kThemeActiveDialogTextColor = kThemeTextColorDialogActive kThemeInactiveDialogTextColor = kThemeTextColorDialogInactive kThemeActiveAlertTextColor = kThemeTextColorAlertActive kThemeInactiveAlertTextColor = kThemeTextColorAlertInactive kThemeActiveModelessDialogTextColor = kThemeTextColorModelessDialogActive kThemeInactiveModelessDialogTextColor = kThemeTextColorModelessDialogInactive kThemeActiveWindowHeaderTextColor = kThemeTextColorWindowHeaderActive kThemeInactiveWindowHeaderTextColor = kThemeTextColorWindowHeaderInactive kThemeActivePlacardTextColor = kThemeTextColorPlacardActive kThemeInactivePlacardTextColor = kThemeTextColorPlacardInactive kThemePressedPlacardTextColor = kThemeTextColorPlacardPressed kThemeActivePushButtonTextColor = kThemeTextColorPushButtonActive kThemeInactivePushButtonTextColor = kThemeTextColorPushButtonInactive kThemePressedPushButtonTextColor = kThemeTextColorPushButtonPressed kThemeActiveBevelButtonTextColor = kThemeTextColorBevelButtonActive kThemeInactiveBevelButtonTextColor = kThemeTextColorBevelButtonInactive kThemePressedBevelButtonTextColor = kThemeTextColorBevelButtonPressed kThemeActivePopupButtonTextColor = kThemeTextColorPopupButtonActive kThemeInactivePopupButtonTextColor = kThemeTextColorPopupButtonInactive kThemePressedPopupButtonTextColor = kThemeTextColorPopupButtonPressed kThemeIconLabelTextColor = kThemeTextColorIconLabel kThemeListViewTextColor = kThemeTextColorListView kThemeActiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleActive kThemeInactiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleInactive kThemeActiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleActive kThemeInactiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleInactive kThemeActiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleActive kThemeInactiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleInactive kThemeActivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleActive kThemeInactivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleInactive kThemeActiveRootMenuTextColor = kThemeTextColorRootMenuActive kThemeSelectedRootMenuTextColor = kThemeTextColorRootMenuSelected kThemeDisabledRootMenuTextColor = kThemeTextColorRootMenuDisabled kThemeActiveMenuItemTextColor = kThemeTextColorMenuItemActive kThemeSelectedMenuItemTextColor = kThemeTextColorMenuItemSelected kThemeDisabledMenuItemTextColor = kThemeTextColorMenuItemDisabled kThemeActivePopupLabelTextColor = kThemeTextColorPopupLabelActive kThemeInactivePopupLabelTextColor = kThemeTextColorPopupLabelInactive kAEThemeSwitch = kAEAppearanceChanged kThemeNoAdornment = kThemeAdornmentNone kThemeDefaultAdornment = kThemeAdornmentDefault kThemeFocusAdornment = kThemeAdornmentFocus kThemeRightToLeftAdornment = kThemeAdornmentRightToLeft kThemeDrawIndicatorOnly = kThemeAdornmentDrawIndicatorOnly kThemeBrushPassiveAreaFill = kThemeBrushStaticAreaFill --- NEW FILE: AppleEvents.py --- # Generated from 'AEDataModel.h' def FOUR_CHAR_CODE(x): return x typeBoolean = FOUR_CHAR_CODE('bool') typeChar = FOUR_CHAR_CODE('TEXT') typeSInt16 = FOUR_CHAR_CODE('shor') typeSInt32 = FOUR_CHAR_CODE('long') typeUInt32 = FOUR_CHAR_CODE('magn') typeSInt64 = FOUR_CHAR_CODE('comp') typeIEEE32BitFloatingPoint = FOUR_CHAR_CODE('sing') typeIEEE64BitFloatingPoint = FOUR_CHAR_CODE('doub') type128BitFloatingPoint = FOUR_CHAR_CODE('ldbl') typeDecimalStruct = FOUR_CHAR_CODE('decm') typeSMInt = typeSInt16 typeShortInteger = typeSInt16 typeInteger = typeSInt32 typeLongInteger = typeSInt32 typeMagnitude = typeUInt32 typeComp = typeSInt64 typeSMFloat = typeIEEE32BitFloatingPoint typeShortFloat = typeIEEE32BitFloatingPoint typeFloat = typeIEEE64BitFloatingPoint typeLongFloat = typeIEEE64BitFloatingPoint typeExtended = FOUR_CHAR_CODE('exte') typeAEList = FOUR_CHAR_CODE('list') typeAERecord = FOUR_CHAR_CODE('reco') typeAppleEvent = FOUR_CHAR_CODE('aevt') typeEventRecord = FOUR_CHAR_CODE('evrc') typeTrue = FOUR_CHAR_CODE('true') typeFalse = FOUR_CHAR_CODE('fals') typeAlias = FOUR_CHAR_CODE('alis') typeEnumerated = FOUR_CHAR_CODE('enum') typeType = FOUR_CHAR_CODE('type') typeAppParameters = FOUR_CHAR_CODE('appa') typeProperty = FOUR_CHAR_CODE('prop') typeFSS = FOUR_CHAR_CODE('fss ') typeKeyword = FOUR_CHAR_CODE('keyw') typeSectionH = FOUR_CHAR_CODE('sect') typeWildCard = FOUR_CHAR_CODE('****') typeApplSignature = FOUR_CHAR_CODE('sign') typeQDRectangle = FOUR_CHAR_CODE('qdrt') typeFixed = FOUR_CHAR_CODE('fixd') typeSessionID = FOUR_CHAR_CODE('ssid') typeTargetID = FOUR_CHAR_CODE('targ') typeProcessSerialNumber = FOUR_CHAR_CODE('psn ') typeKernelProcessID = FOUR_CHAR_CODE('kpid') typeDispatcherID = FOUR_CHAR_CODE('dspt') typeNull = FOUR_CHAR_CODE('null') keyTransactionIDAttr = FOUR_CHAR_CODE('tran') keyReturnIDAttr = FOUR_CHAR_CODE('rtid') keyEventClassAttr = FOUR_CHAR_CODE('evcl') keyEventIDAttr = FOUR_CHAR_CODE('evid') keyAddressAttr = FOUR_CHAR_CODE('addr') keyOptionalKeywordAttr = FOUR_CHAR_CODE('optk') keyTimeoutAttr = FOUR_CHAR_CODE('timo') keyInteractLevelAttr = FOUR_CHAR_CODE('inte') keyEventSourceAttr = FOUR_CHAR_CODE('esrc') keyMissedKeywordAttr = FOUR_CHAR_CODE('miss') keyOriginalAddressAttr = FOUR_CHAR_CODE('from') kAEDescListFactorNone = 0 kAEDescListFactorType = 4 kAEDescListFactorTypeAndSize = 8 kAutoGenerateReturnID = -1 kAnyTransactionID = 0 kAEDataArray = 0 kAEPackedArray = 1 kAEDescArray = 3 kAEKeyDescArray = 4 kAEHandleArray = 2 keyDirectObject = FOUR_CHAR_CODE('----') keyErrorNumber = FOUR_CHAR_CODE('errn') keyErrorString = FOUR_CHAR_CODE('errs') keyProcessSerialNumber = FOUR_CHAR_CODE('psn ') keyPreDispatch = FOUR_CHAR_CODE('phac') keySelectProc = FOUR_CHAR_CODE('selh') keyAERecorderCount = FOUR_CHAR_CODE('recr') keyAEVersion = FOUR_CHAR_CODE('vers') kCoreEventClass = FOUR_CHAR_CODE('aevt') kAEOpenApplication = FOUR_CHAR_CODE('oapp') kAEOpenDocuments = FOUR_CHAR_CODE('odoc') kAEPrintDocuments = FOUR_CHAR_CODE('pdoc') kAEQuitApplication = FOUR_CHAR_CODE('quit') kAEAnswer = FOUR_CHAR_CODE('ansr') kAEApplicationDied = FOUR_CHAR_CODE('obit') kAEStartRecording = FOUR_CHAR_CODE('reca') kAEStopRecording = FOUR_CHAR_CODE('recc') kAENotifyStartRecording = FOUR_CHAR_CODE('rec1') kAENotifyStopRecording = FOUR_CHAR_CODE('rec0') kAENotifyRecording = FOUR_CHAR_CODE('recr') kAENeverInteract = 0x00000010 kAECanInteract = 0x00000020 kAEAlwaysInteract = 0x00000030 kAECanSwitchLayer = 0x00000040 kAEDontRecord = 0x00001000 kAEDontExecute = 0x00002000 kAEProcessNonReplyEvents = 0x00008000 kAENoReply = 0x00000001 kAEQueueReply = 0x00000002 kAEWaitReply = 0x00000003 kAEDontReconnect = 0x00000080 kAEWantReceipt = 0x00000200 kAEDefaultTimeout = -1 kNoTimeOut = -2 kAENormalPriority = 0x00000000 kAEHighPriority = 0x00000001 kAEUnknownSource = 0 kAEDirectCall = 1 kAESameProcess = 2 kAELocalProcess = 3 kAERemoteProcess = 4 kAEInteractWithSelf = 0 kAEInteractWithLocal = 1 kAEInteractWithAll = 2 kAEDoNotIgnoreHandler = 0x00000000 kAEIgnoreAppPhacHandler = 0x00000001 kAEIgnoreAppEventHandler = 0x00000002 kAEIgnoreSysPhacHandler = 0x00000004 kAEIgnoreSysEventHandler = 0x00000008 kAEIngoreBuiltInEventHandler = 0x00000010 # kAEDontDisposeOnResume = (long)0x80000000 kAENoDispatch = 0 # kAEUseStandardDispatch = (long)0xFFFFFFFF cAEList = FOUR_CHAR_CODE('list') cApplication = FOUR_CHAR_CODE('capp') cArc = FOUR_CHAR_CODE('carc') cBoolean = FOUR_CHAR_CODE('bool') cCell = FOUR_CHAR_CODE('ccel') cChar = FOUR_CHAR_CODE('cha ') cColorTable = FOUR_CHAR_CODE('clrt') cColumn = FOUR_CHAR_CODE('ccol') cDocument = FOUR_CHAR_CODE('docu') cDrawingArea = FOUR_CHAR_CODE('cdrw') cEnumeration = FOUR_CHAR_CODE('enum') cFile = FOUR_CHAR_CODE('file') cFixed = FOUR_CHAR_CODE('fixd') cFixedPoint = FOUR_CHAR_CODE('fpnt') cFixedRectangle = FOUR_CHAR_CODE('frct') cGraphicLine = FOUR_CHAR_CODE('glin') cGraphicObject = FOUR_CHAR_CODE('cgob') cGraphicShape = FOUR_CHAR_CODE('cgsh') cGraphicText = FOUR_CHAR_CODE('cgtx') cGroupedGraphic = FOUR_CHAR_CODE('cpic') cInsertionLoc = FOUR_CHAR_CODE('insl') cInsertionPoint = FOUR_CHAR_CODE('cins') cIntlText = FOUR_CHAR_CODE('itxt') cIntlWritingCode = FOUR_CHAR_CODE('intl') cItem = FOUR_CHAR_CODE('citm') cLine = FOUR_CHAR_CODE('clin') cLongDateTime = FOUR_CHAR_CODE('ldt ') cLongFixed = FOUR_CHAR_CODE('lfxd') cLongFixedPoint = FOUR_CHAR_CODE('lfpt') cLongFixedRectangle = FOUR_CHAR_CODE('lfrc') cLongInteger = FOUR_CHAR_CODE('long') cLongPoint = FOUR_CHAR_CODE('lpnt') cLongRectangle = FOUR_CHAR_CODE('lrct') cMachineLoc = FOUR_CHAR_CODE('mLoc') cMenu = FOUR_CHAR_CODE('cmnu') cMenuItem = FOUR_CHAR_CODE('cmen') cObject = FOUR_CHAR_CODE('cobj') cObjectSpecifier = FOUR_CHAR_CODE('obj ') cOpenableObject = FOUR_CHAR_CODE('coob') cOval = FOUR_CHAR_CODE('covl') cParagraph = FOUR_CHAR_CODE('cpar') cPICT = FOUR_CHAR_CODE('PICT') cPixel = FOUR_CHAR_CODE('cpxl') cPixelMap = FOUR_CHAR_CODE('cpix') cPolygon = FOUR_CHAR_CODE('cpgn') cProperty = FOUR_CHAR_CODE('prop') cQDPoint = FOUR_CHAR_CODE('QDpt') cQDRectangle = FOUR_CHAR_CODE('qdrt') cRectangle = FOUR_CHAR_CODE('crec') cRGBColor = FOUR_CHAR_CODE('cRGB') cRotation = FOUR_CHAR_CODE('trot') cRoundedRectangle = FOUR_CHAR_CODE('crrc') cRow = FOUR_CHAR_CODE('crow') cSelection = FOUR_CHAR_CODE('csel') cShortInteger = FOUR_CHAR_CODE('shor') cTable = FOUR_CHAR_CODE('ctbl') cText = FOUR_CHAR_CODE('ctxt') cTextFlow = FOUR_CHAR_CODE('cflo') cTextStyles = FOUR_CHAR_CODE('tsty') cType = FOUR_CHAR_CODE('type') cVersion = FOUR_CHAR_CODE('vers') cWindow = FOUR_CHAR_CODE('cwin') cWord = FOUR_CHAR_CODE('cwor') enumArrows = FOUR_CHAR_CODE('arro') enumJustification = FOUR_CHAR_CODE('just') enumKeyForm = FOUR_CHAR_CODE('kfrm') enumPosition = FOUR_CHAR_CODE('posi') enumProtection = FOUR_CHAR_CODE('prtn') enumQuality = FOUR_CHAR_CODE('qual') enumSaveOptions = FOUR_CHAR_CODE('savo') enumStyle = FOUR_CHAR_CODE('styl') enumTransferMode = FOUR_CHAR_CODE('tran') formUniqueID = FOUR_CHAR_CODE('ID ') kAEAbout = FOUR_CHAR_CODE('abou') kAEAfter = FOUR_CHAR_CODE('afte') kAEAliasSelection = FOUR_CHAR_CODE('sali') kAEAllCaps = FOUR_CHAR_CODE('alcp') kAEArrowAtEnd = FOUR_CHAR_CODE('aren') kAEArrowAtStart = FOUR_CHAR_CODE('arst') kAEArrowBothEnds = FOUR_CHAR_CODE('arbo') kAEAsk = FOUR_CHAR_CODE('ask ') kAEBefore = FOUR_CHAR_CODE('befo') kAEBeginning = FOUR_CHAR_CODE('bgng') kAEBeginsWith = FOUR_CHAR_CODE('bgwt') kAEBeginTransaction = FOUR_CHAR_CODE('begi') kAEBold = FOUR_CHAR_CODE('bold') kAECaseSensEquals = FOUR_CHAR_CODE('cseq') kAECentered = FOUR_CHAR_CODE('cent') kAEChangeView = FOUR_CHAR_CODE('view') kAEClone = FOUR_CHAR_CODE('clon') kAEClose = FOUR_CHAR_CODE('clos') kAECondensed = FOUR_CHAR_CODE('cond') kAEContains = FOUR_CHAR_CODE('cont') kAECopy = FOUR_CHAR_CODE('copy') kAECoreSuite = FOUR_CHAR_CODE('core') kAECountElements = FOUR_CHAR_CODE('cnte') kAECreateElement = FOUR_CHAR_CODE('crel') kAECreatePublisher = FOUR_CHAR_CODE('cpub') kAECut = FOUR_CHAR_CODE('cut ') kAEDelete = FOUR_CHAR_CODE('delo') kAEDoObjectsExist = FOUR_CHAR_CODE('doex') kAEDoScript = FOUR_CHAR_CODE('dosc') kAEDrag = FOUR_CHAR_CODE('drag') kAEDuplicateSelection = FOUR_CHAR_CODE('sdup') kAEEditGraphic = FOUR_CHAR_CODE('edit') kAEEmptyTrash = FOUR_CHAR_CODE('empt') kAEEnd = FOUR_CHAR_CODE('end ') kAEEndsWith = FOUR_CHAR_CODE('ends') kAEEndTransaction = FOUR_CHAR_CODE('endt') kAEEquals = FOUR_CHAR_CODE('= ') kAEExpanded = FOUR_CHAR_CODE('pexp') kAEFast = FOUR_CHAR_CODE('fast') kAEFinderEvents = FOUR_CHAR_CODE('FNDR') kAEFormulaProtect = FOUR_CHAR_CODE('fpro') kAEFullyJustified = FOUR_CHAR_CODE('full') kAEGetClassInfo = FOUR_CHAR_CODE('qobj') kAEGetData = FOUR_CHAR_CODE('getd') kAEGetDataSize = FOUR_CHAR_CODE('dsiz') kAEGetEventInfo = FOUR_CHAR_CODE('gtei') kAEGetInfoSelection = FOUR_CHAR_CODE('sinf') kAEGetPrivilegeSelection = FOUR_CHAR_CODE('sprv') kAEGetSuiteInfo = FOUR_CHAR_CODE('gtsi') kAEGreaterThan = FOUR_CHAR_CODE('> ') kAEGreaterThanEquals = FOUR_CHAR_CODE('>= ') kAEGrow = FOUR_CHAR_CODE('grow') kAEHidden = FOUR_CHAR_CODE('hidn') kAEHiQuality = FOUR_CHAR_CODE('hiqu') kAEImageGraphic = FOUR_CHAR_CODE('imgr') kAEIsUniform = FOUR_CHAR_CODE('isun') kAEItalic = FOUR_CHAR_CODE('ital') kAELeftJustified = FOUR_CHAR_CODE('left') kAELessThan = FOUR_CHAR_CODE('< ') kAELessThanEquals = FOUR_CHAR_CODE('<= ') kAELowercase = FOUR_CHAR_CODE('lowc') kAEMakeObjectsVisible = FOUR_CHAR_CODE('mvis') kAEMiscStandards = FOUR_CHAR_CODE('misc') kAEModifiable = FOUR_CHAR_CODE('modf') kAEMove = FOUR_CHAR_CODE('move') kAENo = FOUR_CHAR_CODE('no ') kAENoArrow = FOUR_CHAR_CODE('arno') kAENonmodifiable = FOUR_CHAR_CODE('nmod') kAEOpen = FOUR_CHAR_CODE('odoc') kAEOpenSelection = FOUR_CHAR_CODE('sope') kAEOutline = FOUR_CHAR_CODE('outl') kAEPageSetup = FOUR_CHAR_CODE('pgsu') kAEPaste = FOUR_CHAR_CODE('past') kAEPlain = FOUR_CHAR_CODE('plan') kAEPrint = FOUR_CHAR_CODE('pdoc') kAEPrintSelection = FOUR_CHAR_CODE('spri') kAEPrintWindow = FOUR_CHAR_CODE('pwin') kAEPutAwaySelection = FOUR_CHAR_CODE('sput') kAEQDAddOver = FOUR_CHAR_CODE('addo') kAEQDAddPin = FOUR_CHAR_CODE('addp') kAEQDAdMax = FOUR_CHAR_CODE('admx') kAEQDAdMin = FOUR_CHAR_CODE('admn') kAEQDBic = FOUR_CHAR_CODE('bic ') kAEQDBlend = FOUR_CHAR_CODE('blnd') kAEQDCopy = FOUR_CHAR_CODE('cpy ') kAEQDNotBic = FOUR_CHAR_CODE('nbic') kAEQDNotCopy = FOUR_CHAR_CODE('ncpy') kAEQDNotOr = FOUR_CHAR_CODE('ntor') kAEQDNotXor = FOUR_CHAR_CODE('nxor') kAEQDOr = FOUR_CHAR_CODE('or ') kAEQDSubOver = FOUR_CHAR_CODE('subo') kAEQDSubPin = FOUR_CHAR_CODE('subp') kAEQDSupplementalSuite = FOUR_CHAR_CODE('qdsp') kAEQDXor = FOUR_CHAR_CODE('xor ') kAEQuickdrawSuite = FOUR_CHAR_CODE('qdrw') kAEQuitAll = FOUR_CHAR_CODE('quia') kAERedo = FOUR_CHAR_CODE('redo') kAERegular = FOUR_CHAR_CODE('regl') kAEReopenApplication = FOUR_CHAR_CODE('rapp') kAEReplace = FOUR_CHAR_CODE('rplc') kAERequiredSuite = FOUR_CHAR_CODE('reqd') kAERestart = FOUR_CHAR_CODE('rest') kAERevealSelection = FOUR_CHAR_CODE('srev') kAERevert = FOUR_CHAR_CODE('rvrt') kAERightJustified = FOUR_CHAR_CODE('rght') kAESave = FOUR_CHAR_CODE('save') kAESelect = FOUR_CHAR_CODE('slct') kAESetData = FOUR_CHAR_CODE('setd') kAESetPosition = FOUR_CHAR_CODE('posn') kAEShadow = FOUR_CHAR_CODE('shad') kAEShowClipboard = FOUR_CHAR_CODE('shcl') kAEShutDown = FOUR_CHAR_CODE('shut') kAESleep = FOUR_CHAR_CODE('slep') kAESmallCaps = FOUR_CHAR_CODE('smcp') kAESpecialClassProperties = FOUR_CHAR_CODE('c@#!') kAEStrikethrough = FOUR_CHAR_CODE('strk') kAESubscript = FOUR_CHAR_CODE('sbsc') kAESuperscript = FOUR_CHAR_CODE('spsc') kAETableSuite = FOUR_CHAR_CODE('tbls') kAETextSuite = FOUR_CHAR_CODE('TEXT') kAETransactionTerminated = FOUR_CHAR_CODE('ttrm') kAEUnderline = FOUR_CHAR_CODE('undl') kAEUndo = FOUR_CHAR_CODE('undo') kAEWholeWordEquals = FOUR_CHAR_CODE('wweq') kAEYes = FOUR_CHAR_CODE('yes ') kAEZoom = FOUR_CHAR_CODE('zoom') kAEMouseClass = FOUR_CHAR_CODE('mous') kAEDown = FOUR_CHAR_CODE('down') kAEUp = FOUR_CHAR_CODE('up ') kAEMoved = FOUR_CHAR_CODE('move') kAEStoppedMoving = FOUR_CHAR_CODE('stop') kAEWindowClass = FOUR_CHAR_CODE('wind') kAEUpdate = FOUR_CHAR_CODE('updt') kAEActivate = FOUR_CHAR_CODE('actv') kAEDeactivate = FOUR_CHAR_CODE('dact') kAECommandClass = FOUR_CHAR_CODE('cmnd') kAEKeyClass = FOUR_CHAR_CODE('keyc') kAERawKey = FOUR_CHAR_CODE('rkey') kAEVirtualKey = FOUR_CHAR_CODE('keyc') kAENavigationKey = FOUR_CHAR_CODE('nave') kAEAutoDown = FOUR_CHAR_CODE('auto') kAEApplicationClass = FOUR_CHAR_CODE('appl') kAESuspend = FOUR_CHAR_CODE('susp') kAEResume = FOUR_CHAR_CODE('rsme') kAEDiskEvent = FOUR_CHAR_CODE('disk') kAENullEvent = FOUR_CHAR_CODE('null') kAEWakeUpEvent = FOUR_CHAR_CODE('wake') kAEScrapEvent = FOUR_CHAR_CODE('scrp') kAEHighLevel = FOUR_CHAR_CODE('high') keyAEAngle = FOUR_CHAR_CODE('kang') keyAEArcAngle = FOUR_CHAR_CODE('parc') keyAEBaseAddr = FOUR_CHAR_CODE('badd') keyAEBestType = FOUR_CHAR_CODE('pbst') keyAEBgndColor = FOUR_CHAR_CODE('kbcl') keyAEBgndPattern = FOUR_CHAR_CODE('kbpt') keyAEBounds = FOUR_CHAR_CODE('pbnd') keyAECellList = FOUR_CHAR_CODE('kclt') keyAEClassID = FOUR_CHAR_CODE('clID') keyAEColor = FOUR_CHAR_CODE('colr') keyAEColorTable = FOUR_CHAR_CODE('cltb') keyAECurveHeight = FOUR_CHAR_CODE('kchd') keyAECurveWidth = FOUR_CHAR_CODE('kcwd') keyAEDashStyle = FOUR_CHAR_CODE('pdst') keyAEData = FOUR_CHAR_CODE('data') keyAEDefaultType = FOUR_CHAR_CODE('deft') keyAEDefinitionRect = FOUR_CHAR_CODE('pdrt') keyAEDescType = FOUR_CHAR_CODE('dstp') keyAEDestination = FOUR_CHAR_CODE('dest') keyAEDoAntiAlias = FOUR_CHAR_CODE('anta') keyAEDoDithered = FOUR_CHAR_CODE('gdit') keyAEDoRotate = FOUR_CHAR_CODE('kdrt') keyAEDoScale = FOUR_CHAR_CODE('ksca') keyAEDoTranslate = FOUR_CHAR_CODE('ktra') keyAEEditionFileLoc = FOUR_CHAR_CODE('eloc') keyAEElements = FOUR_CHAR_CODE('elms') keyAEEndPoint = FOUR_CHAR_CODE('pend') keyAEEventClass = FOUR_CHAR_CODE('evcl') keyAEEventID = FOUR_CHAR_CODE('evti') keyAEFile = FOUR_CHAR_CODE('kfil') keyAEFileType = FOUR_CHAR_CODE('fltp') keyAEFillColor = FOUR_CHAR_CODE('flcl') keyAEFillPattern = FOUR_CHAR_CODE('flpt') keyAEFlipHorizontal = FOUR_CHAR_CODE('kfho') keyAEFlipVertical = FOUR_CHAR_CODE('kfvt') keyAEFont = FOUR_CHAR_CODE('font') keyAEFormula = FOUR_CHAR_CODE('pfor') keyAEGraphicObjects = FOUR_CHAR_CODE('gobs') keyAEID = FOUR_CHAR_CODE('ID ') keyAEImageQuality = FOUR_CHAR_CODE('gqua') keyAEInsertHere = FOUR_CHAR_CODE('insh') keyAEKeyForms = FOUR_CHAR_CODE('keyf') keyAEKeyword = FOUR_CHAR_CODE('kywd') keyAELevel = FOUR_CHAR_CODE('levl') keyAELineArrow = FOUR_CHAR_CODE('arro') keyAEName = FOUR_CHAR_CODE('pnam') keyAENewElementLoc = FOUR_CHAR_CODE('pnel') keyAEObject = FOUR_CHAR_CODE('kobj') keyAEObjectClass = FOUR_CHAR_CODE('kocl') keyAEOffStyles = FOUR_CHAR_CODE('ofst') keyAEOnStyles = FOUR_CHAR_CODE('onst') keyAEParameters = FOUR_CHAR_CODE('prms') keyAEParamFlags = FOUR_CHAR_CODE('pmfg') keyAEPenColor = FOUR_CHAR_CODE('ppcl') keyAEPenPattern = FOUR_CHAR_CODE('pppa') keyAEPenWidth = FOUR_CHAR_CODE('ppwd') keyAEPixelDepth = FOUR_CHAR_CODE('pdpt') keyAEPixMapMinus = FOUR_CHAR_CODE('kpmm') keyAEPMTable = FOUR_CHAR_CODE('kpmt') keyAEPointList = FOUR_CHAR_CODE('ptlt') keyAEPointSize = FOUR_CHAR_CODE('ptsz') keyAEPosition = FOUR_CHAR_CODE('kpos') keyAEPropData = FOUR_CHAR_CODE('prdt') keyAEProperties = FOUR_CHAR_CODE('qpro') keyAEProperty = FOUR_CHAR_CODE('kprp') keyAEPropFlags = FOUR_CHAR_CODE('prfg') keyAEPropID = FOUR_CHAR_CODE('prop') keyAEProtection = FOUR_CHAR_CODE('ppro') keyAERenderAs = FOUR_CHAR_CODE('kren') keyAERequestedType = FOUR_CHAR_CODE('rtyp') keyAEResult = FOUR_CHAR_CODE('----') keyAEResultInfo = FOUR_CHAR_CODE('rsin') keyAERotation = FOUR_CHAR_CODE('prot') keyAERotPoint = FOUR_CHAR_CODE('krtp') keyAERowList = FOUR_CHAR_CODE('krls') keyAESaveOptions = FOUR_CHAR_CODE('savo') keyAEScale = FOUR_CHAR_CODE('pscl') keyAEScriptTag = FOUR_CHAR_CODE('psct') keyAEShowWhere = FOUR_CHAR_CODE('show') keyAEStartAngle = FOUR_CHAR_CODE('pang') keyAEStartPoint = FOUR_CHAR_CODE('pstp') keyAEStyles = FOUR_CHAR_CODE('ksty') keyAESuiteID = FOUR_CHAR_CODE('suit') keyAEText = FOUR_CHAR_CODE('ktxt') keyAETextColor = FOUR_CHAR_CODE('ptxc') keyAETextFont = FOUR_CHAR_CODE('ptxf') keyAETextPointSize = FOUR_CHAR_CODE('ptps') keyAETextStyles = FOUR_CHAR_CODE('txst') keyAETextLineHeight = FOUR_CHAR_CODE('ktlh') keyAETextLineAscent = FOUR_CHAR_CODE('ktas') keyAETheText = FOUR_CHAR_CODE('thtx') keyAETransferMode = FOUR_CHAR_CODE('pptm') keyAETranslation = FOUR_CHAR_CODE('ptrs') keyAETryAsStructGraf = FOUR_CHAR_CODE('toog') keyAEUniformStyles = FOUR_CHAR_CODE('ustl') keyAEUpdateOn = FOUR_CHAR_CODE('pupd') keyAEUserTerm = FOUR_CHAR_CODE('utrm') keyAEWindow = FOUR_CHAR_CODE('wndw') keyAEWritingCode = FOUR_CHAR_CODE('wrcd') keyMiscellaneous = FOUR_CHAR_CODE('fmsc') keySelection = FOUR_CHAR_CODE('fsel') keyWindow = FOUR_CHAR_CODE('kwnd') keyWhen = FOUR_CHAR_CODE('when') keyWhere = FOUR_CHAR_CODE('wher') keyModifiers = FOUR_CHAR_CODE('mods') keyKey = FOUR_CHAR_CODE('key ') keyKeyCode = FOUR_CHAR_CODE('code') keyKeyboard = FOUR_CHAR_CODE('keyb') keyDriveNumber = FOUR_CHAR_CODE('drv#') keyErrorCode = FOUR_CHAR_CODE('err#') keyHighLevelClass = FOUR_CHAR_CODE('hcls') keyHighLevelID = FOUR_CHAR_CODE('hid ') pArcAngle = FOUR_CHAR_CODE('parc') pBackgroundColor = FOUR_CHAR_CODE('pbcl') pBackgroundPattern = FOUR_CHAR_CODE('pbpt') pBestType = FOUR_CHAR_CODE('pbst') pBounds = FOUR_CHAR_CODE('pbnd') pClass = FOUR_CHAR_CODE('pcls') pClipboard = FOUR_CHAR_CODE('pcli') pColor = FOUR_CHAR_CODE('colr') pColorTable = FOUR_CHAR_CODE('cltb') pContents = FOUR_CHAR_CODE('pcnt') pCornerCurveHeight = FOUR_CHAR_CODE('pchd') pCornerCurveWidth = FOUR_CHAR_CODE('pcwd') pDashStyle = FOUR_CHAR_CODE('pdst') pDefaultType = FOUR_CHAR_CODE('deft') pDefinitionRect = FOUR_CHAR_CODE('pdrt') pEnabled = FOUR_CHAR_CODE('enbl') pEndPoint = FOUR_CHAR_CODE('pend') pFillColor = FOUR_CHAR_CODE('flcl') pFillPattern = FOUR_CHAR_CODE('flpt') pFont = FOUR_CHAR_CODE('font') pFormula = FOUR_CHAR_CODE('pfor') pGraphicObjects = FOUR_CHAR_CODE('gobs') pHasCloseBox = FOUR_CHAR_CODE('hclb') pHasTitleBar = FOUR_CHAR_CODE('ptit') pID = FOUR_CHAR_CODE('ID ') pIndex = FOUR_CHAR_CODE('pidx') pInsertionLoc = FOUR_CHAR_CODE('pins') pIsFloating = FOUR_CHAR_CODE('isfl') pIsFrontProcess = FOUR_CHAR_CODE('pisf') pIsModal = FOUR_CHAR_CODE('pmod') pIsModified = FOUR_CHAR_CODE('imod') pIsResizable = FOUR_CHAR_CODE('prsz') pIsStationeryPad = FOUR_CHAR_CODE('pspd') pIsZoomable = FOUR_CHAR_CODE('iszm') pIsZoomed = FOUR_CHAR_CODE('pzum') pItemNumber = FOUR_CHAR_CODE('itmn') pJustification = FOUR_CHAR_CODE('pjst') pLineArrow = FOUR_CHAR_CODE('arro') pMenuID = FOUR_CHAR_CODE('mnid') pName = FOUR_CHAR_CODE('pnam') pNewElementLoc = FOUR_CHAR_CODE('pnel') pPenColor = FOUR_CHAR_CODE('ppcl') pPenPattern = FOUR_CHAR_CODE('pppa') pPenWidth = FOUR_CHAR_CODE('ppwd') pPixelDepth = FOUR_CHAR_CODE('pdpt') pPointList = FOUR_CHAR_CODE('ptlt') pPointSize = FOUR_CHAR_CODE('ptsz') pProtection = FOUR_CHAR_CODE('ppro') pRotation = FOUR_CHAR_CODE('prot') pScale = FOUR_CHAR_CODE('pscl') pScript = FOUR_CHAR_CODE('scpt') pScriptTag = FOUR_CHAR_CODE('psct') pSelected = FOUR_CHAR_CODE('selc') pSelection = FOUR_CHAR_CODE('sele') pStartAngle = FOUR_CHAR_CODE('pang') pStartPoint = FOUR_CHAR_CODE('pstp') pTextColor = FOUR_CHAR_CODE('ptxc') pTextFont = FOUR_CHAR_CODE('ptxf') pTextItemDelimiters = FOUR_CHAR_CODE('txdl') pTextPointSize = FOUR_CHAR_CODE('ptps') pTextStyles = FOUR_CHAR_CODE('txst') pTransferMode = FOUR_CHAR_CODE('pptm') pTranslation = FOUR_CHAR_CODE('ptrs') pUniformStyles = FOUR_CHAR_CODE('ustl') pUpdateOn = FOUR_CHAR_CODE('pupd') pUserSelection = FOUR_CHAR_CODE('pusl') pVersion = FOUR_CHAR_CODE('vers') pVisible = FOUR_CHAR_CODE('pvis') typeAEText = FOUR_CHAR_CODE('tTXT') typeArc = FOUR_CHAR_CODE('carc') typeBest = FOUR_CHAR_CODE('best') typeCell = FOUR_CHAR_CODE('ccel') typeClassInfo = FOUR_CHAR_CODE('gcli') typeColorTable = FOUR_CHAR_CODE('clrt') typeColumn = FOUR_CHAR_CODE('ccol') typeDashStyle = FOUR_CHAR_CODE('tdas') typeData = FOUR_CHAR_CODE('tdta') typeDrawingArea = FOUR_CHAR_CODE('cdrw') typeElemInfo = FOUR_CHAR_CODE('elin') typeEnumeration = FOUR_CHAR_CODE('enum') typeEPS = FOUR_CHAR_CODE('EPS ') typeEventInfo = FOUR_CHAR_CODE('evin') typeFinderWindow = FOUR_CHAR_CODE('fwin') typeFixedPoint = FOUR_CHAR_CODE('fpnt') typeFixedRectangle = FOUR_CHAR_CODE('frct') typeGraphicLine = FOUR_CHAR_CODE('glin') typeGraphicText = FOUR_CHAR_CODE('cgtx') typeGroupedGraphic = FOUR_CHAR_CODE('cpic') typeInsertionLoc = FOUR_CHAR_CODE('insl') typeIntlText = FOUR_CHAR_CODE('itxt') typeIntlWritingCode = FOUR_CHAR_CODE('intl') typeLongDateTime = FOUR_CHAR_CODE('ldt ') typeLongFixed = FOUR_CHAR_CODE('lfxd') typeLongFixedPoint = FOUR_CHAR_CODE('lfpt') typeLongFixedRectangle = FOUR_CHAR_CODE('lfrc') typeLongPoint = FOUR_CHAR_CODE('lpnt') typeLongRectangle = FOUR_CHAR_CODE('lrct') typeMachineLoc = FOUR_CHAR_CODE('mLoc') typeOval = FOUR_CHAR_CODE('covl') typeParamInfo = FOUR_CHAR_CODE('pmin') typePict = FOUR_CHAR_CODE('PICT') typePixelMap = FOUR_CHAR_CODE('cpix') typePixMapMinus = FOUR_CHAR_CODE('tpmm') typePolygon = FOUR_CHAR_CODE('cpgn') typePropInfo = FOUR_CHAR_CODE('pinf') typeQDPoint = FOUR_CHAR_CODE('QDpt') typeQDRegion = FOUR_CHAR_CODE('Qrgn') typeRectangle = FOUR_CHAR_CODE('crec') typeRGB16 = FOUR_CHAR_CODE('tr16') typeRGB96 = FOUR_CHAR_CODE('tr96') typeRGBColor = FOUR_CHAR_CODE('cRGB') typeRotation = FOUR_CHAR_CODE('trot') typeRoundedRectangle = FOUR_CHAR_CODE('crrc') typeRow = FOUR_CHAR_CODE('crow') typeScrapStyles = FOUR_CHAR_CODE('styl') typeScript = FOUR_CHAR_CODE('scpt') typeStyledText = FOUR_CHAR_CODE('STXT') typeSuiteInfo = FOUR_CHAR_CODE('suin') typeTable = FOUR_CHAR_CODE('ctbl') typeTextStyles = FOUR_CHAR_CODE('tsty') typeTIFF = FOUR_CHAR_CODE('TIFF') typeVersion = FOUR_CHAR_CODE('vers') kAEMenuClass = FOUR_CHAR_CODE('menu') kAEMenuSelect = FOUR_CHAR_CODE('mhit') kAEMouseDown = FOUR_CHAR_CODE('mdwn') kAEMouseDownInBack = FOUR_CHAR_CODE('mdbk') kAEKeyDown = FOUR_CHAR_CODE('kdwn') kAEResized = FOUR_CHAR_CODE('rsiz') kAEPromise = FOUR_CHAR_CODE('prom') keyMenuID = FOUR_CHAR_CODE('mid ') keyMenuItem = FOUR_CHAR_CODE('mitm') keyCloseAllWindows = FOUR_CHAR_CODE('caw ') keyOriginalBounds = FOUR_CHAR_CODE('obnd') keyNewBounds = FOUR_CHAR_CODE('nbnd') keyLocalWhere = FOUR_CHAR_CODE('lwhr') typeHIMenu = FOUR_CHAR_CODE('mobj') typeHIWindow = FOUR_CHAR_CODE('wobj') kBySmallIcon = 0 kByIconView = 1 kByNameView = 2 kByDateView = 3 kBySizeView = 4 kByKindView = 5 kByCommentView = 6 kByLabelView = 7 kByVersionView = 8 kAEInfo = 11 kAEMain = 0 kAESharing = 13 kAEZoomIn = 7 kAEZoomOut = 8 kTextServiceClass = FOUR_CHAR_CODE('tsvc') kUpdateActiveInputArea = FOUR_CHAR_CODE('updt') kShowHideInputWindow = FOUR_CHAR_CODE('shiw') kPos2Offset = FOUR_CHAR_CODE('p2st') kOffset2Pos = FOUR_CHAR_CODE('st2p') kUnicodeNotFromInputMethod = FOUR_CHAR_CODE('unim') kGetSelectedText = FOUR_CHAR_CODE('gtxt') keyAETSMDocumentRefcon = FOUR_CHAR_CODE('refc') keyAEServerInstance = FOUR_CHAR_CODE('srvi') keyAETheData = FOUR_CHAR_CODE('kdat') keyAEFixLength = FOUR_CHAR_CODE('fixl') keyAEUpdateRange = FOUR_CHAR_CODE('udng') keyAECurrentPoint = FOUR_CHAR_CODE('cpos') keyAEBufferSize = FOUR_CHAR_CODE('buff') keyAEMoveView = FOUR_CHAR_CODE('mvvw') keyAENextBody = FOUR_CHAR_CODE('nxbd') keyAETSMScriptTag = FOUR_CHAR_CODE('sclg') keyAETSMTextFont = FOUR_CHAR_CODE('ktxf') keyAETSMTextPointSize = FOUR_CHAR_CODE('ktps') keyAETSMEventRecord = FOUR_CHAR_CODE('tevt') keyAETextServiceEncoding = FOUR_CHAR_CODE('tsen') keyAETextServiceMacEncoding = FOUR_CHAR_CODE('tmen') typeTextRange = FOUR_CHAR_CODE('txrn') typeComponentInstance = FOUR_CHAR_CODE('cmpi') typeOffsetArray = FOUR_CHAR_CODE('ofay') typeTextRangeArray = FOUR_CHAR_CODE('tray') typeLowLevelEventRecord = FOUR_CHAR_CODE('evtr') typeText = typeChar kTSMOutsideOfBody = 1 kTSMInsideOfBody = 2 kTSMInsideOfActiveInputArea = 3 kNextBody = 1 kPreviousBody = 2 kCaretPosition = 1 kRawText = 2 kSelectedRawText = 3 kConvertedText = 4 kSelectedConvertedText = 5 kBlockFillText = 6 kOutlineText = 7 kSelectedText = 8 keyAEHiliteRange = FOUR_CHAR_CODE('hrng') keyAEPinRange = FOUR_CHAR_CODE('pnrg') keyAEClauseOffsets = FOUR_CHAR_CODE('clau') keyAEOffset = FOUR_CHAR_CODE('ofst') keyAEPoint = FOUR_CHAR_CODE('gpos') keyAELeftSide = FOUR_CHAR_CODE('klef') keyAERegionClass = FOUR_CHAR_CODE('rgnc') keyAEDragging = FOUR_CHAR_CODE('bool') keyAELeadingEdge = keyAELeftSide typeUnicodeText = FOUR_CHAR_CODE('utxt') typeStyledUnicodeText = FOUR_CHAR_CODE('sutx') typeEncodedString = FOUR_CHAR_CODE('encs') typeCString = FOUR_CHAR_CODE('cstr') typePString = FOUR_CHAR_CODE('pstr') typeMeters = FOUR_CHAR_CODE('metr') typeInches = FOUR_CHAR_CODE('inch') typeFeet = FOUR_CHAR_CODE('feet') typeYards = FOUR_CHAR_CODE('yard') typeMiles = FOUR_CHAR_CODE('mile') typeKilometers = FOUR_CHAR_CODE('kmtr') typeCentimeters = FOUR_CHAR_CODE('cmtr') typeSquareMeters = FOUR_CHAR_CODE('sqrm') typeSquareFeet = FOUR_CHAR_CODE('sqft') typeSquareYards = FOUR_CHAR_CODE('sqyd') typeSquareMiles = FOUR_CHAR_CODE('sqmi') typeSquareKilometers = FOUR_CHAR_CODE('sqkm') typeLiters = FOUR_CHAR_CODE('litr') typeQuarts = FOUR_CHAR_CODE('qrts') typeGallons = FOUR_CHAR_CODE('galn') typeCubicMeters = FOUR_CHAR_CODE('cmet') typeCubicFeet = FOUR_CHAR_CODE('cfet') typeCubicInches = FOUR_CHAR_CODE('cuin') typeCubicCentimeter = FOUR_CHAR_CODE('ccmt') typeCubicYards = FOUR_CHAR_CODE('cyrd') typeKilograms = FOUR_CHAR_CODE('kgrm') typeGrams = FOUR_CHAR_CODE('gram') typeOunces = FOUR_CHAR_CODE('ozs ') typePounds = FOUR_CHAR_CODE('lbs ') typeDegreesC = FOUR_CHAR_CODE('degc') typeDegreesF = FOUR_CHAR_CODE('degf') typeDegreesK = FOUR_CHAR_CODE('degk') kFAServerApp = FOUR_CHAR_CODE('ssrv') kDoFolderActionEvent = FOUR_CHAR_CODE('fola') kFolderActionCode = FOUR_CHAR_CODE('actn') kFolderOpenedEvent = FOUR_CHAR_CODE('fopn') kFolderClosedEvent = FOUR_CHAR_CODE('fclo') kFolderWindowMovedEvent = FOUR_CHAR_CODE('fsiz') kFolderItemsAddedEvent = FOUR_CHAR_CODE('fget') kFolderItemsRemovedEvent = FOUR_CHAR_CODE('flos') kItemList = FOUR_CHAR_CODE('flst') kNewSizeParameter = FOUR_CHAR_CODE('fnsz') kFASuiteCode = FOUR_CHAR_CODE('faco') kFAAttachCommand = FOUR_CHAR_CODE('atfa') kFARemoveCommand = FOUR_CHAR_CODE('rmfa') kFAEditCommand = FOUR_CHAR_CODE('edfa') kFAFileParam = FOUR_CHAR_CODE('faal') kFAIndexParam = FOUR_CHAR_CODE('indx') kAEInternetSuite = FOUR_CHAR_CODE('gurl') kAEISWebStarSuite = FOUR_CHAR_CODE('WWW½') kAEISGetURL = FOUR_CHAR_CODE('gurl') KAEISHandleCGI = FOUR_CHAR_CODE('sdoc') cURL = FOUR_CHAR_CODE('url ') cInternetAddress = FOUR_CHAR_CODE('IPAD') cHTML = FOUR_CHAR_CODE('html') cFTPItem = FOUR_CHAR_CODE('ftp ') kAEISHTTPSearchArgs = FOUR_CHAR_CODE('kfor') kAEISPostArgs = FOUR_CHAR_CODE('post') kAEISMethod = FOUR_CHAR_CODE('meth') kAEISClientAddress = FOUR_CHAR_CODE('addr') kAEISUserName = FOUR_CHAR_CODE('user') kAEISPassword = FOUR_CHAR_CODE('pass') kAEISFromUser = FOUR_CHAR_CODE('frmu') kAEISServerName = FOUR_CHAR_CODE('svnm') kAEISServerPort = FOUR_CHAR_CODE('svpt') kAEISScriptName = FOUR_CHAR_CODE('scnm') kAEISContentType = FOUR_CHAR_CODE('ctyp') kAEISReferrer = FOUR_CHAR_CODE('refr') kAEISUserAgent = FOUR_CHAR_CODE('Agnt') kAEISAction = FOUR_CHAR_CODE('Kact') kAEISActionPath = FOUR_CHAR_CODE('Kapt') kAEISClientIP = FOUR_CHAR_CODE('Kcip') kAEISFullRequest = FOUR_CHAR_CODE('Kfrq') pScheme = FOUR_CHAR_CODE('pusc') pHost = FOUR_CHAR_CODE('HOST') pPath = FOUR_CHAR_CODE('FTPc') pUserName = FOUR_CHAR_CODE('RAun') pUserPassword = FOUR_CHAR_CODE('RApw') pDNSForm = FOUR_CHAR_CODE('pDNS') pURL = FOUR_CHAR_CODE('pURL') pTextEncoding = FOUR_CHAR_CODE('ptxe') pFTPKind = FOUR_CHAR_CODE('kind') eScheme = FOUR_CHAR_CODE('esch') eurlHTTP = FOUR_CHAR_CODE('http') eurlHTTPS = FOUR_CHAR_CODE('htps') eurlFTP = FOUR_CHAR_CODE('ftp ') eurlMail = FOUR_CHAR_CODE('mail') eurlFile = FOUR_CHAR_CODE('file') eurlGopher = FOUR_CHAR_CODE('gphr') eurlTelnet = FOUR_CHAR_CODE('tlnt') eurlNews = FOUR_CHAR_CODE('news') eurlSNews = FOUR_CHAR_CODE('snws') eurlNNTP = FOUR_CHAR_CODE('nntp') eurlMessage = FOUR_CHAR_CODE('mess') eurlMailbox = FOUR_CHAR_CODE('mbox') eurlMulti = FOUR_CHAR_CODE('mult') eurlLaunch = FOUR_CHAR_CODE('laun') eurlAFP = FOUR_CHAR_CODE('afp ') eurlAT = FOUR_CHAR_CODE('at ') eurlEPPC = FOUR_CHAR_CODE('eppc') eurlRTSP = FOUR_CHAR_CODE('rtsp') eurlIMAP = FOUR_CHAR_CODE('imap') eurlNFS = FOUR_CHAR_CODE('unfs') eurlPOP = FOUR_CHAR_CODE('upop') eurlLDAP = FOUR_CHAR_CODE('uldp') eurlUnknown = FOUR_CHAR_CODE('url?') kConnSuite = FOUR_CHAR_CODE('macc') cDevSpec = FOUR_CHAR_CODE('cdev') cAddressSpec = FOUR_CHAR_CODE('cadr') cADBAddress = FOUR_CHAR_CODE('cadb') cAppleTalkAddress = FOUR_CHAR_CODE('cat ') cBusAddress = FOUR_CHAR_CODE('cbus') cEthernetAddress = FOUR_CHAR_CODE('cen ') cFireWireAddress = FOUR_CHAR_CODE('cfw ') cIPAddress = FOUR_CHAR_CODE('cip ') cLocalTalkAddress = FOUR_CHAR_CODE('clt ') cSCSIAddress = FOUR_CHAR_CODE('cscs') cTokenRingAddress = FOUR_CHAR_CODE('ctok') cUSBAddress = FOUR_CHAR_CODE('cusb') pDeviceType = FOUR_CHAR_CODE('pdvt') pDeviceAddress = FOUR_CHAR_CODE('pdva') pConduit = FOUR_CHAR_CODE('pcon') pProtocol = FOUR_CHAR_CODE('pprt') pATMachine = FOUR_CHAR_CODE('patm') pATZone = FOUR_CHAR_CODE('patz') pATType = FOUR_CHAR_CODE('patt') pDottedDecimal = FOUR_CHAR_CODE('pipd') pDNS = FOUR_CHAR_CODE('pdns') pPort = FOUR_CHAR_CODE('ppor') pNetwork = FOUR_CHAR_CODE('pnet') pNode = FOUR_CHAR_CODE('pnod') pSocket = FOUR_CHAR_CODE('psoc') pSCSIBus = FOUR_CHAR_CODE('pscb') pSCSILUN = FOUR_CHAR_CODE('pslu') eDeviceType = FOUR_CHAR_CODE('edvt') eAddressSpec = FOUR_CHAR_CODE('eads') eConduit = FOUR_CHAR_CODE('econ') eProtocol = FOUR_CHAR_CODE('epro') eADB = FOUR_CHAR_CODE('eadb') eAnalogAudio = FOUR_CHAR_CODE('epau') eAppleTalk = FOUR_CHAR_CODE('epat') eAudioLineIn = FOUR_CHAR_CODE('ecai') eAudioLineOut = FOUR_CHAR_CODE('ecal') eAudioOut = FOUR_CHAR_CODE('ecao') eBus = FOUR_CHAR_CODE('ebus') eCDROM = FOUR_CHAR_CODE('ecd ') eCommSlot = FOUR_CHAR_CODE('eccm') eDigitalAudio = FOUR_CHAR_CODE('epda') eDisplay = FOUR_CHAR_CODE('edds') eDVD = FOUR_CHAR_CODE('edvd') eEthernet = FOUR_CHAR_CODE('ecen') eFireWire = FOUR_CHAR_CODE('ecfw') eFloppy = FOUR_CHAR_CODE('efd ') eHD = FOUR_CHAR_CODE('ehd ') eInfrared = FOUR_CHAR_CODE('ecir') eIP = FOUR_CHAR_CODE('epip') eIrDA = FOUR_CHAR_CODE('epir') eIRTalk = FOUR_CHAR_CODE('epit') eKeyboard = FOUR_CHAR_CODE('ekbd') eLCD = FOUR_CHAR_CODE('edlc') eLocalTalk = FOUR_CHAR_CODE('eclt') eMacIP = FOUR_CHAR_CODE('epmi') eMacVideo = FOUR_CHAR_CODE('epmv') eMicrophone = FOUR_CHAR_CODE('ecmi') eModemPort = FOUR_CHAR_CODE('ecmp') eModemPrinterPort = FOUR_CHAR_CODE('empp') eModem = FOUR_CHAR_CODE('edmm') eMonitorOut = FOUR_CHAR_CODE('ecmn') eMouse = FOUR_CHAR_CODE('emou') eNuBusCard = FOUR_CHAR_CODE('ednb') eNuBus = FOUR_CHAR_CODE('enub') ePCcard = FOUR_CHAR_CODE('ecpc') ePCIbus = FOUR_CHAR_CODE('ecpi') ePCIcard = FOUR_CHAR_CODE('edpi') ePDSslot = FOUR_CHAR_CODE('ecpd') ePDScard = FOUR_CHAR_CODE('epds') ePointingDevice = FOUR_CHAR_CODE('edpd') ePostScript = FOUR_CHAR_CODE('epps') ePPP = FOUR_CHAR_CODE('eppp') ePrinterPort = FOUR_CHAR_CODE('ecpp') ePrinter = FOUR_CHAR_CODE('edpr') eSvideo = FOUR_CHAR_CODE('epsv') eSCSI = FOUR_CHAR_CODE('ecsc') eSerial = FOUR_CHAR_CODE('epsr') eSpeakers = FOUR_CHAR_CODE('edsp') eStorageDevice = FOUR_CHAR_CODE('edst') eSVGA = FOUR_CHAR_CODE('epsg') eTokenRing = FOUR_CHAR_CODE('etok') eTrackball = FOUR_CHAR_CODE('etrk') eTrackpad = FOUR_CHAR_CODE('edtp') eUSB = FOUR_CHAR_CODE('ecus') eVideoIn = FOUR_CHAR_CODE('ecvi') eVideoMonitor = FOUR_CHAR_CODE('edvm') eVideoOut = FOUR_CHAR_CODE('ecvo') cKeystroke = FOUR_CHAR_CODE('kprs') pKeystrokeKey = FOUR_CHAR_CODE('kMsg') pModifiers = FOUR_CHAR_CODE('kMod') pKeyKind = FOUR_CHAR_CODE('kknd') eModifiers = FOUR_CHAR_CODE('eMds') eOptionDown = FOUR_CHAR_CODE('Kopt') eCommandDown = FOUR_CHAR_CODE('Kcmd') eControlDown = FOUR_CHAR_CODE('Kctl') eShiftDown = FOUR_CHAR_CODE('Ksft') eCapsLockDown = FOUR_CHAR_CODE('Kclk') eKeyKind = FOUR_CHAR_CODE('ekst') eEscapeKey = 0x6B733500 eDeleteKey = 0x6B733300 eTabKey = 0x6B733000 eReturnKey = 0x6B732400 eClearKey = 0x6B734700 eEnterKey = 0x6B734C00 eUpArrowKey = 0x6B737E00 eDownArrowKey = 0x6B737D00 eLeftArrowKey = 0x6B737B00 eRightArrowKey = 0x6B737C00 eHelpKey = 0x6B737200 eHomeKey = 0x6B737300 ePageUpKey = 0x6B737400 ePageDownKey = 0x6B737900 eForwardDelKey = 0x6B737500 eEndKey = 0x6B737700 eF1Key = 0x6B737A00 eF2Key = 0x6B737800 eF3Key = 0x6B736300 eF4Key = 0x6B737600 eF5Key = 0x6B736000 eF6Key = 0x6B736100 eF7Key = 0x6B736200 eF8Key = 0x6B736400 eF9Key = 0x6B736500 eF10Key = 0x6B736D00 eF11Key = 0x6B736700 eF12Key = 0x6B736F00 eF13Key = 0x6B736900 eF14Key = 0x6B736B00 eF15Key = 0x6B737100 kAEAND = FOUR_CHAR_CODE('AND ') kAEOR = FOUR_CHAR_CODE('OR ') kAENOT = FOUR_CHAR_CODE('NOT ') kAEFirst = FOUR_CHAR_CODE('firs') kAELast = FOUR_CHAR_CODE('last') kAEMiddle = FOUR_CHAR_CODE('midd') kAEAny = FOUR_CHAR_CODE('any ') kAEAll = FOUR_CHAR_CODE('all ') kAENext = FOUR_CHAR_CODE('next') kAEPrevious = FOUR_CHAR_CODE('prev') keyAECompOperator = FOUR_CHAR_CODE('relo') keyAELogicalTerms = FOUR_CHAR_CODE('term') keyAELogicalOperator = FOUR_CHAR_CODE('logc') keyAEObject1 = FOUR_CHAR_CODE('obj1') keyAEObject2 = FOUR_CHAR_CODE('obj2') keyAEDesiredClass = FOUR_CHAR_CODE('want') keyAEContainer = FOUR_CHAR_CODE('from') keyAEKeyForm = FOUR_CHAR_CODE('form') keyAEKeyData = FOUR_CHAR_CODE('seld') keyAERangeStart = FOUR_CHAR_CODE('star') keyAERangeStop = FOUR_CHAR_CODE('stop') keyDisposeTokenProc = FOUR_CHAR_CODE('xtok') keyAECompareProc = FOUR_CHAR_CODE('cmpr') keyAECountProc = FOUR_CHAR_CODE('cont') keyAEMarkTokenProc = FOUR_CHAR_CODE('mkid') keyAEMarkProc = FOUR_CHAR_CODE('mark') keyAEAdjustMarksProc = FOUR_CHAR_CODE('adjm') keyAEGetErrDescProc = FOUR_CHAR_CODE('indc') formAbsolutePosition = FOUR_CHAR_CODE('indx') formRelativePosition = FOUR_CHAR_CODE('rele') formTest = FOUR_CHAR_CODE('test') formRange = FOUR_CHAR_CODE('rang') formPropertyID = FOUR_CHAR_CODE('prop') formName = FOUR_CHAR_CODE('name') typeObjectSpecifier = FOUR_CHAR_CODE('obj ') typeObjectBeingExamined = FOUR_CHAR_CODE('exmn') typeCurrentContainer = FOUR_CHAR_CODE('ccnt') typeToken = FOUR_CHAR_CODE('toke') typeRelativeDescriptor = FOUR_CHAR_CODE('rel ') typeAbsoluteOrdinal = FOUR_CHAR_CODE('abso') typeIndexDescriptor = FOUR_CHAR_CODE('inde') typeRangeDescriptor = FOUR_CHAR_CODE('rang') typeLogicalDescriptor = FOUR_CHAR_CODE('logi') typeCompDescriptor = FOUR_CHAR_CODE('cmpd') typeOSLTokenList = FOUR_CHAR_CODE('ostl') kAEIDoMinimum = 0x0000 kAEIDoWhose = 0x0001 kAEIDoMarking = 0x0004 kAEPassSubDescs = 0x0008 kAEResolveNestedLists = 0x0010 kAEHandleSimpleRanges = 0x0020 kAEUseRelativeIterators = 0x0040 typeWhoseDescriptor = FOUR_CHAR_CODE('whos') formWhose = FOUR_CHAR_CODE('whos') typeWhoseRange = FOUR_CHAR_CODE('wrng') keyAEWhoseRangeStart = FOUR_CHAR_CODE('wstr') keyAEWhoseRangeStop = FOUR_CHAR_CODE('wstp') keyAEIndex = FOUR_CHAR_CODE('kidx') keyAETest = FOUR_CHAR_CODE('ktst') --- NEW FILE: Balloons.py --- # Generated from 'Balloons.h' def FOUR_CHAR_CODE(x): return x kTopLeftTipPointsLeftVariant = 0 kTopLeftTipPointsUpVariant = 1 kTopRightTipPointsUpVariant = 2 kTopRightTipPointsRightVariant = 3 kBottomRightTipPointsRightVariant = 4 kBottomRightTipPointsDownVariant = 5 kBottomLeftTipPointsDownVariant = 6 kBottomLeftTipPointsLeftVariant = 7 kBalloonVariantCount = 8 hmBalloonHelpVersion = 0x0002 kHMHelpMenuID = -16490 kHMAboutHelpItem = 1 kHMShowBalloonsItem = 3 kHMHelpID = -5696 kBalloonWDEFID = 126 helpItem = 1 hmDefaultOptions = 0 hmUseSubID = 1 hmAbsoluteCoords = 2 hmSaveBitsNoWindow = 4 hmSaveBitsWindow = 8 hmMatchInTitle = 16 kHMStringItem = 1 kHMPictItem = 2 kHMStringResItem = 3 kHMTEResItem = 6 kHMSTRResItem = 7 kHMSkipItem = 256 kHMCompareItem = 512 kHMNamedResourceItem = 1024 kHMTrackCntlItem = 2048 khmmString = 1 khmmPict = 2 khmmStringRes = 3 khmmTEHandle = 4 khmmPictHandle = 5 khmmTERes = 6 khmmSTRRes = 7 kHMEnabledItem = 0 kHMTETextResType = FOUR_CHAR_CODE('TEXT') kHMTEStyleResType = FOUR_CHAR_CODE('styl') kHMDisabledItem = 1 kHMCheckedItem = 2 kHMOtherItem = 3 kHMRegularWindow = 0 kHMSaveBitsNoWindow = 1 kHMSaveBitsWindow = 2 kHMMenuResType = FOUR_CHAR_CODE('hmnu') kHMDialogResType = FOUR_CHAR_CODE('hdlg') kHMWindListResType = FOUR_CHAR_CODE('hwin') kHMRectListResType = FOUR_CHAR_CODE('hrct') kHMOverrideResType = FOUR_CHAR_CODE('hovr') kHMFinderApplResType = FOUR_CHAR_CODE('hfdr') --- NEW FILE: Components.py --- # Generated from 'Components.h' def FOUR_CHAR_CODE(x): return x kAppleManufacturer = FOUR_CHAR_CODE('appl') kComponentResourceType = FOUR_CHAR_CODE('thng') kComponentAliasResourceType = FOUR_CHAR_CODE('thga') kAnyComponentType = 0 kAnyComponentSubType = 0 kAnyComponentManufacturer = 0 kAnyComponentFlagsMask = 0 cmpIsMissing = 1L << 29 cmpWantsRegisterMessage = 1L << 31 kComponentOpenSelect = -1 kComponentCloseSelect = -2 kComponentCanDoSelect = -3 kComponentVersionSelect = -4 kComponentRegisterSelect = -5 kComponentTargetSelect = -6 kComponentUnregisterSelect = -7 kComponentGetMPWorkFunctionSelect = -8 kComponentExecuteWiredActionSelect = -9 kComponentGetPublicResourceSelect = -10 componentDoAutoVersion = (1 << 0) componentWantsUnregister = (1 << 1) componentAutoVersionIncludeFlags = (1 << 2) componentHasMultiplePlatforms = (1 << 3) componentLoadResident = (1 << 4) defaultComponentIdentical = 0 defaultComponentAnyFlags = 1 defaultComponentAnyManufacturer = 2 defaultComponentAnySubType = 4 defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer) defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType) registerComponentGlobal = 1 registerComponentNoDuplicates = 2 registerComponentAfterExisting = 4 registerComponentAliasesOnly = 8 platform68k = 1 platformPowerPC = 2 platformInterpreted = 3 platformWin32 = 4 platformPowerPCNativeEntryPoint = 5 mpWorkFlagDoWork = (1 << 0) mpWorkFlagDoCompletion = (1 << 1) mpWorkFlagCopyWorkBlock = (1 << 2) mpWorkFlagDontBlock = (1 << 3) mpWorkFlagGetProcessorCount = (1 << 4) mpWorkFlagGetIsRunning = (1 << 6) cmpAliasNoFlags = 0 cmpAliasOnlyThisFile = 1 uppComponentFunctionImplementedProcInfo = 0x000002F0 uppGetComponentVersionProcInfo = 0x000000F0 uppComponentSetTargetProcInfo = 0x000003F0 uppCallComponentOpenProcInfo = 0x000003F0 uppCallComponentCloseProcInfo = 0x000003F0 uppCallComponentCanDoProcInfo = 0x000002F0 uppCallComponentVersionProcInfo = 0x000000F0 uppCallComponentRegisterProcInfo = 0x000000F0 uppCallComponentTargetProcInfo = 0x000003F0 uppCallComponentUnregisterProcInfo = 0x000000F0 uppCallComponentGetMPWorkFunctionProcInfo = 0x00000FF0 uppCallComponentGetPublicResourceProcInfo = 0x00003BF0 --- NEW FILE: ControlAccessor.py --- # Accessor functions for control properties from Controls import * import struct # These needn't go through this module, but are here for completeness def SetControlData_Handle(control, part, selector, data): control.SetControlData_Handle(part, selector, data) def GetControlData_Handle(control, part, selector): return control.GetControlData_Handle(part, selector) _accessdict = { kControlPopupButtonMenuHandleTag: (SetControlData_Handle, GetControlData_Handle), } _codingdict = { kControlPushButtonDefaultTag : ("b", None, None), kControlEditTextTextTag: (None, None, None), kControlEditTextPasswordTag: (None, None, None), kControlPopupButtonMenuIDTag: ("h", None, None), kControlListBoxDoubleClickTag: ("b", None, None), } def SetControlData(control, part, selector, data): if _accessdict.has_key(selector): setfunc, getfunc = _accessdict[selector] setfunc(control, part, selector, data) return if not _codingdict.has_key(selector): raise KeyError, ('Unknown control selector', selector) structfmt, coder, decoder = _codingdict[selector] if coder: data = coder(data) if structfmt: data = struct.pack(structfmt, data) control.SetControlData(part, selector, data) def GetControlData(control, part, selector): if _accessdict.has_key(selector): setfunc, getfunc = _accessdict[selector] return getfunc(control, part, selector, data) if not _codingdict.has_key(selector): raise KeyError, ('Unknown control selector', selector) structfmt, coder, decoder = _codingdict[selector] data = control.GetControlData(part, selector) if structfmt: data = struct.unpack(structfmt, data) if decoder: data = decoder(data) if type(data) == type(()) and len(data) == 1: data = data[0] return data --- NEW FILE: Controls.py --- # Generated from 'Controls.h' def FOUR_CHAR_CODE(x): return x from TextEdit import * from QuickDraw import * from Dragconst import * kControlDefProcType = FOUR_CHAR_CODE('CDEF') kControlTemplateResourceType = FOUR_CHAR_CODE('CNTL') kControlColorTableResourceType = FOUR_CHAR_CODE('cctb') kControlDefProcResourceType = FOUR_CHAR_CODE('CDEF') controlNotifyNothing = FOUR_CHAR_CODE('nada') controlNotifyClick = FOUR_CHAR_CODE('clik') controlNotifyFocus = FOUR_CHAR_CODE('focu') controlNotifyKey = FOUR_CHAR_CODE('key ') kControlCanAutoInvalidate = 1L << 0 staticTextProc = 256 editTextProc = 272 iconProc = 288 userItemProc = 304 pictItemProc = 320 cFrameColor = 0 cBodyColor = 1 cTextColor = 2 cThumbColor = 3 kNumberCtlCTabEntries = 4 kControlNoVariant = 0 kControlUsesOwningWindowsFontVariant = 1 << 3 kControlNoPart = 0 kControlIndicatorPart = 129 kControlDisabledPart = 254 kControlInactivePart = 255 kControlEntireControl = 0 kControlStructureMetaPart = -1 kControlContentMetaPart = -2 kControlFocusNoPart = 0 kControlFocusNextPart = -1 kControlFocusPrevPart = -2 kControlCollectionTagBounds = FOUR_CHAR_CODE('boun') kControlCollectionTagValue = FOUR_CHAR_CODE('valu') kControlCollectionTagMinimum = FOUR_CHAR_CODE('min ') kControlCollectionTagMaximum = FOUR_CHAR_CODE('max ') kControlCollectionTagViewSize = FOUR_CHAR_CODE('view') kControlCollectionTagVisibility = FOUR_CHAR_CODE('visi') kControlCollectionTagRefCon = FOUR_CHAR_CODE('refc') kControlCollectionTagTitle = FOUR_CHAR_CODE('titl') kControlCollectionTagIDSignature = FOUR_CHAR_CODE('idsi') kControlCollectionTagIDID = FOUR_CHAR_CODE('idid') kControlCollectionTagCommand = FOUR_CHAR_CODE('cmd ') kControlCollectionTagSubControls = FOUR_CHAR_CODE('subc') kControlContentTextOnly = 0 kControlNoContent = 0 kControlContentIconSuiteRes = 1 kControlContentCIconRes = 2 kControlContentPictRes = 3 kControlContentICONRes = 4 kControlContentIconSuiteHandle = 129 kControlContentCIconHandle = 130 kControlContentPictHandle = 131 kControlContentIconRef = 132 kControlContentICON = 133 kControlKeyScriptBehaviorAllowAnyScript = FOUR_CHAR_CODE('any ') kControlKeyScriptBehaviorPrefersRoman = FOUR_CHAR_CODE('prmn') kControlKeyScriptBehaviorRequiresRoman = FOUR_CHAR_CODE('rrmn') kControlFontBigSystemFont = -1 kControlFontSmallSystemFont = -2 kControlFontSmallBoldSystemFont = -3 kControlFontViewSystemFont = -4 kControlUseFontMask = 0x0001 kControlUseFaceMask = 0x0002 kControlUseSizeMask = 0x0004 kControlUseForeColorMask = 0x0008 kControlUseBackColorMask = 0x0010 kControlUseModeMask = 0x0020 kControlUseJustMask = 0x0040 kControlUseAllMask = 0x00FF kControlAddFontSizeMask = 0x0100 kControlAddToMetaFontMask = 0x0200 kDoNotActivateAndIgnoreClick = 0 kDoNotActivateAndHandleClick = 1 kActivateAndIgnoreClick = 2 kActivateAndHandleClick = 3 kControlFontStyleTag = FOUR_CHAR_CODE('font') kControlKeyFilterTag = FOUR_CHAR_CODE('fltr') kControlSupportsGhosting = 1 << 0 kControlSupportsEmbedding = 1 << 1 kControlSupportsFocus = 1 << 2 kControlWantsIdle = 1 << 3 kControlWantsActivate = 1 << 4 kControlHandlesTracking = 1 << 5 kControlSupportsDataAccess = 1 << 6 kControlHasSpecialBackground = 1 << 7 kControlGetsFocusOnClick = 1 << 8 kControlSupportsCalcBestRect = 1 << 9 kControlSupportsLiveFeedback = 1 << 10 kControlHasRadioBehavior = 1 << 11 kControlSupportsDragAndDrop = 1 << 12 kControlAutoToggles = 1 << 14 kControlSupportsGetRegion = 1 << 17 kControlSupportsFlattening = 1 << 19 kControlSupportsSetCursor = 1 << 20 kControlSupportsContextualMenus = 1 << 21 kControlSupportsClickActivation = 1 << 22 drawCntl = 0 testCntl = 1 calcCRgns = 2 initCntl = 3 dispCntl = 4 posCntl = 5 thumbCntl = 6 dragCntl = 7 autoTrack = 8 calcCntlRgn = 10 calcThumbRgn = 11 drawThumbOutline = 12 kControlMsgDrawGhost = 13 kControlMsgCalcBestRect = 14 kControlMsgHandleTracking = 15 kControlMsgFocus = 16 kControlMsgKeyDown = 17 kControlMsgIdle = 18 kControlMsgGetFeatures = 19 kControlMsgSetData = 20 kControlMsgGetData = 21 kControlMsgActivate = 22 kControlMsgSetUpBackground = 23 kControlMsgCalcValueFromPos = 26 kControlMsgTestNewMsgSupport = 27 kControlMsgSubValueChanged = 25 kControlMsgSubControlAdded = 28 kControlMsgSubControlRemoved = 29 kControlMsgApplyTextColor = 30 kControlMsgGetRegion = 31 kControlMsgFlatten = 32 kControlMsgSetCursor = 33 kControlMsgDragEnter = 38 kControlMsgDragLeave = 39 kControlMsgDragWithin = 40 kControlMsgDragReceive = 41 kControlMsgDisplayDebugInfo = 46 kControlMsgContextualMenuClick = 47 kControlMsgGetClickActivation = 48 kDrawControlEntireControl = 0 kDrawControlIndicatorOnly = 129 kDragControlEntireControl = 0 kDragControlIndicator = 1 kControlSupportsNewMessages = FOUR_CHAR_CODE(' ok ') kControlKeyFilterBlockKey = 0 kControlKeyFilterPassKey = 1 noConstraint = kNoConstraint hAxisOnly = 1 vAxisOnly = 2 kControlDefProcPtr = 0 kControlPropertyPersistent = 0x00000001 kDragTrackingEnterControl = kDragTrackingEnterWindow kDragTrackingInControl = kDragTrackingInWindow kDragTrackingLeaveControl = kDragTrackingLeaveWindow useWFont = kControlUsesOwningWindowsFontVariant inThumb = kControlIndicatorPart kNoHiliteControlPart = kControlNoPart kInIndicatorControlPart = kControlIndicatorPart kReservedControlPart = kControlDisabledPart kControlInactiveControlPart = kControlInactivePart kControlTabListResType = FOUR_CHAR_CODE('tab#') kControlListDescResType = FOUR_CHAR_CODE('ldes') kControlCheckBoxUncheckedValue = 0 kControlCheckBoxCheckedValue = 1 kControlCheckBoxMixedValue = 2 kControlRadioButtonUncheckedValue = 0 kControlRadioButtonCheckedValue = 1 kControlRadioButtonMixedValue = 2 popupFixedWidth = 1 << 0 popupVariableWidth = 1 << 1 popupUseAddResMenu = 1 << 2 popupUseWFont = 1 << 3 popupTitleBold = 1 << 8 popupTitleItalic = 1 << 9 popupTitleUnderline = 1 << 10 popupTitleOutline = 1 << 11 popupTitleShadow = 1 << 12 popupTitleCondense = 1 << 13 popupTitleExtend = 1 << 14 popupTitleNoStyle = 1 << 15 popupTitleLeftJust = 0x00000000 popupTitleCenterJust = 0x00000001 popupTitleRightJust = 0x000000FF pushButProc = 0 checkBoxProc = 1 radioButProc = 2 scrollBarProc = 16 popupMenuProc = 1008 kControlLabelPart = 1 kControlMenuPart = 2 kControlTrianglePart = 4 kControlEditTextPart = 5 kControlPicturePart = 6 kControlIconPart = 7 kControlClockPart = 8 kControlListBoxPart = 24 kControlListBoxDoubleClickPart = 25 kControlImageWellPart = 26 kControlRadioGroupPart = 27 kControlButtonPart = 10 kControlCheckBoxPart = 11 kControlRadioButtonPart = 11 kControlUpButtonPart = 20 kControlDownButtonPart = 21 kControlPageUpPart = 22 kControlPageDownPart = 23 kControlClockHourDayPart = 9 kControlClockMinuteMonthPart = 10 kControlClockSecondYearPart = 11 kControlClockAMPMPart = 12 kControlDataBrowserPart = 24 kControlDataBrowserDraggedPart = 25 kControlBevelButtonSmallBevelProc = 32 kControlBevelButtonNormalBevelProc = 33 kControlBevelButtonLargeBevelProc = 34 kControlBevelButtonSmallBevelVariant = 0 kControlBevelButtonNormalBevelVariant = (1 << 0) kControlBevelButtonLargeBevelVariant = (1 << 1) kControlBevelButtonMenuOnRightVariant = (1 << 2) kControlBevelButtonSmallBevel = 0 kControlBevelButtonNormalBevel = 1 kControlBevelButtonLargeBevel = 2 kControlBehaviorPushbutton = 0 kControlBehaviorToggles = 0x0100 kControlBehaviorSticky = 0x0200 kControlBehaviorSingleValueMenu = 0 kControlBehaviorMultiValueMenu = 0x4000 kControlBehaviorOffsetContents = 0x8000 kControlBehaviorCommandMenu = 0x2000 kControlBevelButtonMenuOnBottom = 0 kControlBevelButtonMenuOnRight = (1 << 2) kControlBevelButtonAlignSysDirection = -1 kControlBevelButtonAlignCenter = 0 kControlBevelButtonAlignLeft = 1 kControlBevelButtonAlignRight = 2 kControlBevelButtonAlignTop = 3 kControlBevelButtonAlignBottom = 4 kControlBevelButtonAlignTopLeft = 5 kControlBevelButtonAlignBottomLeft = 6 kControlBevelButtonAlignTopRight = 7 kControlBevelButtonAlignBottomRight = 8 kControlBevelButtonAlignTextSysDirection = teFlushDefault kControlBevelButtonAlignTextCenter = teCenter kControlBevelButtonAlignTextFlushRight = teFlushRight kControlBevelButtonAlignTextFlushLeft = teFlushLeft kControlBevelButtonPlaceSysDirection = -1 kControlBevelButtonPlaceNormally = 0 kControlBevelButtonPlaceToRightOfGraphic = 1 kControlBevelButtonPlaceToLeftOfGraphic = 2 kControlBevelButtonPlaceBelowGraphic = 3 kControlBevelButtonPlaceAboveGraphic = 4 kControlBevelButtonContentTag = FOUR_CHAR_CODE('cont') kControlBevelButtonTransformTag = FOUR_CHAR_CODE('tran') kControlBevelButtonTextAlignTag = FOUR_CHAR_CODE('tali') kControlBevelButtonTextOffsetTag = FOUR_CHAR_CODE('toff') kControlBevelButtonGraphicAlignTag = FOUR_CHAR_CODE('gali') kControlBevelButtonGraphicOffsetTag = FOUR_CHAR_CODE('goff') kControlBevelButtonTextPlaceTag = FOUR_CHAR_CODE('tplc') kControlBevelButtonMenuValueTag = FOUR_CHAR_CODE('mval') kControlBevelButtonMenuHandleTag = FOUR_CHAR_CODE('mhnd') # kControlBevelButtonCenterPopupGlyphTag = FOUR_CHAR_CODE('pglc') kControlBevelButtonLastMenuTag = FOUR_CHAR_CODE('lmnu') kControlBevelButtonMenuDelayTag = FOUR_CHAR_CODE('mdly') kControlBevelButtonScaleIconTag = FOUR_CHAR_CODE('scal') kControlSliderProc = 48 kControlSliderLiveFeedback = (1 << 0) kControlSliderHasTickMarks = (1 << 1) kControlSliderReverseDirection = (1 << 2) kControlSliderNonDirectional = (1 << 3) kControlTriangleProc = 64 kControlTriangleLeftFacingProc = 65 kControlTriangleAutoToggleProc = 66 kControlTriangleLeftFacingAutoToggleProc = 67 kControlTriangleLastValueTag = FOUR_CHAR_CODE('last') kControlProgressBarProc = 80 # kControlProgressBarIndeterminateTag = FOUR_CHAR_CODE('inde') kControlLittleArrowsProc = 96 kControlChasingArrowsProc = 112 kControlTabLargeProc = 128 kControlTabSmallProc = 129 kControlTabLargeNorthProc = 128 kControlTabSmallNorthProc = 129 kControlTabLargeSouthProc = 130 kControlTabSmallSouthProc = 131 kControlTabLargeEastProc = 132 kControlTabSmallEastProc = 133 kControlTabLargeWestProc = 134 kControlTabSmallWestProc = 135 kControlTabContentRectTag = FOUR_CHAR_CODE('rect') kControlTabEnabledFlagTag = FOUR_CHAR_CODE('enab') kControlTabFontStyleTag = kControlFontStyleTag kControlTabInfoTag = FOUR_CHAR_CODE('tabi') kControlTabInfoVersionZero = 0 kControlSeparatorLineProc = 144 kControlGroupBoxTextTitleProc = 160 kControlGroupBoxCheckBoxProc = 161 kControlGroupBoxPopupButtonProc = 162 kControlGroupBoxSecondaryTextTitleProc = 164 kControlGroupBoxSecondaryCheckBoxProc = 165 kControlGroupBoxSecondaryPopupButtonProc = 166 kControlGroupBoxMenuHandleTag = FOUR_CHAR_CODE('mhan') kControlGroupBoxFontStyleTag = kControlFontStyleTag kControlGroupBoxTitleRectTag = FOUR_CHAR_CODE('trec') kControlImageWellProc = 176 kControlImageWellContentTag = FOUR_CHAR_CODE('cont') kControlImageWellTransformTag = FOUR_CHAR_CODE('tran') kControlPopupArrowEastProc = 192 kControlPopupArrowWestProc = 193 kControlPopupArrowNorthProc = 194 kControlPopupArrowSouthProc = 195 kControlPopupArrowSmallEastProc = 196 kControlPopupArrowSmallWestProc = 197 kControlPopupArrowSmallNorthProc = 198 kControlPopupArrowSmallSouthProc = 199 kControlPopupArrowOrientationEast = 0 kControlPopupArrowOrientationWest = 1 kControlPopupArrowOrientationNorth = 2 kControlPopupArrowOrientationSouth = 3 kControlPlacardProc = 224 kControlClockTimeProc = 240 kControlClockTimeSecondsProc = 241 kControlClockDateProc = 242 kControlClockMonthYearProc = 243 kControlClockTypeHourMinute = 0 kControlClockTypeHourMinuteSecond = 1 kControlClockTypeMonthDay = 2 kControlClockTypeMonthDayYear = 3 kControlClockFlagStandard = 0 kControlClockNoFlags = 0 kControlClockFlagDisplayOnly = 1 kControlClockIsDisplayOnly = 1 kControlClockFlagLive = 2 kControlClockIsLive = 2 kControlClockLongDateTag = FOUR_CHAR_CODE('date') kControlClockFontStyleTag = kControlFontStyleTag kControlUserPaneProc = 256 kControlUserItemDrawProcTag = FOUR_CHAR_CODE('uidp') kControlUserPaneDrawProcTag = FOUR_CHAR_CODE('draw') kControlUserPaneHitTestProcTag = FOUR_CHAR_CODE('hitt') kControlUserPaneTrackingProcTag = FOUR_CHAR_CODE('trak') kControlUserPaneIdleProcTag = FOUR_CHAR_CODE('idle') kControlUserPaneKeyDownProcTag = FOUR_CHAR_CODE('keyd') kControlUserPaneActivateProcTag = FOUR_CHAR_CODE('acti') kControlUserPaneFocusProcTag = FOUR_CHAR_CODE('foci') kControlUserPaneBackgroundProcTag = FOUR_CHAR_CODE('back') kControlEditTextProc = 272 kControlEditTextPasswordProc = 274 kControlEditTextInlineInputProc = 276 kControlEditTextStyleTag = kControlFontStyleTag kControlEditTextTextTag = FOUR_CHAR_CODE('text') kControlEditTextTEHandleTag = FOUR_CHAR_CODE('than') kControlEditTextKeyFilterTag = kControlKeyFilterTag kControlEditTextSelectionTag = FOUR_CHAR_CODE('sele') kControlEditTextPasswordTag = FOUR_CHAR_CODE('pass') kControlEditTextKeyScriptBehaviorTag = FOUR_CHAR_CODE('kscr') kControlEditTextLockedTag = FOUR_CHAR_CODE('lock') kControlEditTextFixedTextTag = FOUR_CHAR_CODE('ftxt') kControlEditTextValidationProcTag = FOUR_CHAR_CODE('vali') kControlEditTextInlinePreUpdateProcTag = FOUR_CHAR_CODE('prup') kControlEditTextInlinePostUpdateProcTag = FOUR_CHAR_CODE('poup') kControlStaticTextProc = 288 kControlStaticTextStyleTag = kControlFontStyleTag kControlStaticTextTextTag = FOUR_CHAR_CODE('text') kControlStaticTextTextHeightTag = FOUR_CHAR_CODE('thei') kControlStaticTextTruncTag = FOUR_CHAR_CODE('trun') kControlPictureProc = 304 kControlPictureNoTrackProc = 305 kControlPictureHandleTag = FOUR_CHAR_CODE('pich') kControlIconProc = 320 kControlIconNoTrackProc = 321 kControlIconSuiteProc = 322 kControlIconSuiteNoTrackProc = 323 kControlIconRefProc = 324 kControlIconRefNoTrackProc = 325 kControlIconTransformTag = FOUR_CHAR_CODE('trfm') kControlIconAlignmentTag = FOUR_CHAR_CODE('algn') kControlIconResourceIDTag = FOUR_CHAR_CODE('ires') kControlIconContentTag = FOUR_CHAR_CODE('cont') kControlWindowHeaderProc = 336 kControlWindowListViewHeaderProc = 337 kControlListBoxProc = 352 kControlListBoxAutoSizeProc = 353 kControlListBoxListHandleTag = FOUR_CHAR_CODE('lhan') kControlListBoxKeyFilterTag = kControlKeyFilterTag kControlListBoxFontStyleTag = kControlFontStyleTag kControlListBoxDoubleClickTag = FOUR_CHAR_CODE('dblc') kControlListBoxLDEFTag = FOUR_CHAR_CODE('ldef') kControlPushButtonProc = 368 kControlCheckBoxProc = 369 kControlRadioButtonProc = 370 kControlPushButLeftIconProc = 374 kControlPushButRightIconProc = 375 kControlCheckBoxAutoToggleProc = 371 kControlRadioButtonAutoToggleProc = 372 kControlPushButtonDefaultTag = FOUR_CHAR_CODE('dflt') kControlPushButtonCancelTag = FOUR_CHAR_CODE('cncl') kControlScrollBarProc = 384 kControlScrollBarLiveProc = 386 kControlPopupButtonProc = 400 kControlPopupFixedWidthVariant = 1 << 0 kControlPopupVariableWidthVariant = 1 << 1 kControlPopupUseAddResMenuVariant = 1 << 2 kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant kControlPopupButtonMenuHandleTag = FOUR_CHAR_CODE('mhan') kControlPopupButtonMenuIDTag = FOUR_CHAR_CODE('mnid') kControlPopupButtonExtraHeightTag = FOUR_CHAR_CODE('exht') kControlRadioGroupProc = 416 kControlScrollTextBoxProc = 432 kControlScrollTextBoxAutoScrollProc = 433 kControlScrollTextBoxDelayBeforeAutoScrollTag = FOUR_CHAR_CODE('stdl') kControlScrollTextBoxDelayBetweenAutoScrollTag = FOUR_CHAR_CODE('scdl') kControlScrollTextBoxAutoScrollAmountTag = FOUR_CHAR_CODE('samt') kControlScrollTextBoxContentsTag = FOUR_CHAR_CODE('tres') kControlCheckboxUncheckedValue = kControlCheckBoxUncheckedValue kControlCheckboxCheckedValue = kControlCheckBoxCheckedValue kControlCheckboxMixedValue = kControlCheckBoxMixedValue inLabel = kControlLabelPart inMenu = kControlMenuPart inTriangle = kControlTrianglePart inButton = kControlButtonPart inCheckBox = kControlCheckBoxPart inUpButton = kControlUpButtonPart inDownButton = kControlDownButtonPart inPageUp = kControlPageUpPart inPageDown = kControlPageDownPart kInLabelControlPart = kControlLabelPart kInMenuControlPart = kControlMenuPart kInTriangleControlPart = kControlTrianglePart kInButtonControlPart = kControlButtonPart kInCheckBoxControlPart = kControlCheckBoxPart kInUpButtonControlPart = kControlUpButtonPart kInDownButtonControlPart = kControlDownButtonPart kInPageUpControlPart = kControlPageUpPart kInPageDownControlPart = kControlPageDownPart --- NEW FILE: Dialogs.py --- # Generated from 'Moes:SWDev:Metrowerks Codewarrior 6.0:Metrowerks CodeWarrior:MacOS Support:Universal:Interfaces:CIncludes:Dialogs.h' def FOUR_CHAR_CODE(x): return x kControlDialogItem = 4 kButtonDialogItem = kControlDialogItem | 0 kCheckBoxDialogItem = kControlDialogItem | 1 kRadioButtonDialogItem = kControlDialogItem | 2 kResourceControlDialogItem = kControlDialogItem | 3 kStaticTextDialogItem = 8 kEditTextDialogItem = 16 kIconDialogItem = 32 kPictureDialogItem = 64 kUserDialogItem = 0 kHelpDialogItem = 1 kItemDisableBit = 128 ctrlItem = 4 btnCtrl = 0 chkCtrl = 1 radCtrl = 2 resCtrl = 3 statText = 8 editText = 16 iconItem = 32 picItem = 64 userItem = 0 itemDisable = 128 kStdOkItemIndex = 1 kStdCancelItemIndex = 2 ok = kStdOkItemIndex cancel = kStdCancelItemIndex kStopIcon = 0 kNoteIcon = 1 kCautionIcon = 2 stopIcon = kStopIcon noteIcon = kNoteIcon cautionIcon = kCautionIcon kOkItemIndex = 1 kCancelItemIndex = 2 overlayDITL = 0 appendDITLRight = 1 appendDITLBottom = 2 kAlertStopAlert = 0 kAlertNoteAlert = 1 kAlertCautionAlert = 2 kAlertPlainAlert = 3 kAlertDefaultOKText = -1 kAlertDefaultCancelText = -1 kAlertDefaultOtherText = -1 kAlertStdAlertOKButton = 1 kAlertStdAlertCancelButton = 2 kAlertStdAlertOtherButton = 3 kAlertStdAlertHelpButton = 4 kDialogFlagsUseThemeBackground = (1 << 0) kDialogFlagsUseControlHierarchy = (1 << 1) kDialogFlagsHandleMovableModal = (1 << 2) kDialogFlagsUseThemeControls = (1 << 3) kAlertFlagsUseThemeBackground = (1 << 0) kAlertFlagsUseControlHierarchy = (1 << 1) kAlertFlagsAlertIsMovable = (1 << 2) kAlertFlagsUseThemeControls = (1 << 3) kDialogFontNoFontStyle = 0 kDialogFontUseFontMask = 0x0001 kDialogFontUseFaceMask = 0x0002 kDialogFontUseSizeMask = 0x0004 kDialogFontUseForeColorMask = 0x0008 kDialogFontUseBackColorMask = 0x0010 kDialogFontUseModeMask = 0x0020 kDialogFontUseJustMask = 0x0040 kDialogFontUseAllMask = 0x00FF kDialogFontAddFontSizeMask = 0x0100 kDialogFontUseFontNameMask = 0x0200 kDialogFontAddToMetaFontMask = 0x0400 --- NEW FILE: Dragconst.py --- # Generated from 'Drag.h' def FOUR_CHAR_CODE(x): return x from TextEdit import * from QuickDraw import * kDragHasLeftSenderWindow = (1 << 0) kDragInsideSenderApplication = (1 << 1) kDragInsideSenderWindow = (1 << 2) kDragRegionAndImage = (1 << 4) flavorSenderOnly = (1 << 0) flavorSenderTranslated = (1 << 1) flavorNotSaved = (1 << 2) flavorSystemTranslated = (1 << 8) kDragHasLeftSenderWindow = (1L << 0) kDragInsideSenderApplication = (1L << 1) kDragInsideSenderWindow = (1L << 2) kDragBehaviorNone = 0 kDragBehaviorZoomBackAnimation = (1L << 0) kDragRegionAndImage = (1L << 4) kDragStandardTranslucency = 0L kDragDarkTranslucency = 1L kDragDarkerTranslucency = 2L kDragOpaqueTranslucency = 3L kDragRegionBegin = 1 kDragRegionDraw = 2 kDragRegionHide = 3 kDragRegionIdle = 4 kDragRegionEnd = 5 kZoomNoAcceleration = 0 kZoomAccelerate = 1 kZoomDecelerate = 2 flavorSenderOnly = (1 << 0) flavorSenderTranslated = (1 << 1) flavorNotSaved = (1 << 2) flavorSystemTranslated = (1 << 8) kDragFlavorTypeHFS = FOUR_CHAR_CODE('hfs ') kDragFlavorTypePromiseHFS = FOUR_CHAR_CODE('phfs') flavorTypeHFS = kDragFlavorTypeHFS flavorTypePromiseHFS = kDragFlavorTypePromiseHFS kDragPromisedFlavorFindFile = FOUR_CHAR_CODE('rWm1') kDragPromisedFlavor = FOUR_CHAR_CODE('fssP') kDragPseudoCreatorVolumeOrDirectory = FOUR_CHAR_CODE('MACS') kDragPseudoFileTypeVolume = FOUR_CHAR_CODE('disk') kDragPseudoFileTypeDirectory = FOUR_CHAR_CODE('fold') flavorTypeDirectory = FOUR_CHAR_CODE('diry') kFlavorTypeClippingName = FOUR_CHAR_CODE('clnm') kFlavorTypeClippingFilename = FOUR_CHAR_CODE('clfn') kFlavorTypeDragToTrashOnly = FOUR_CHAR_CODE('fdtt') kFlavorTypeFinderNoTrackingBehavior = FOUR_CHAR_CODE('fntb') kDragTrackingEnterHandler = 1 kDragTrackingEnterWindow = 2 kDragTrackingInWindow = 3 kDragTrackingLeaveWindow = 4 kDragTrackingLeaveHandler = 5 dragHasLeftSenderWindow = kDragHasLeftSenderWindow dragInsideSenderApplication = kDragInsideSenderApplication dragInsideSenderWindow = kDragInsideSenderWindow dragTrackingEnterHandler = kDragTrackingEnterHandler dragTrackingEnterWindow = kDragTrackingEnterWindow dragTrackingInWindow = kDragTrackingInWindow dragTrackingLeaveWindow = kDragTrackingLeaveWindow dragTrackingLeaveHandler = kDragTrackingLeaveHandler dragRegionBegin = kDragRegionBegin dragRegionDraw = kDragRegionDraw dragRegionHide = kDragRegionHide dragRegionIdle = kDragRegionIdle dragRegionEnd = kDragRegionEnd zoomNoAcceleration = kZoomNoAcceleration zoomAccelerate = kZoomAccelerate zoomDecelerate = kZoomDecelerate kDragStandardImage = kDragStandardTranslucency kDragDarkImage = kDragDarkTranslucency kDragDarkerImage = kDragDarkerTranslucency kDragOpaqueImage = kDragOpaqueTranslucency --- NEW FILE: Events.py --- # Generated from 'Events.h' nullEvent = 0 mouseDown = 1 mouseUp = 2 keyDown = 3 keyUp = 4 autoKey = 5 updateEvt = 6 diskEvt = 7 activateEvt = 8 osEvt = 15 kHighLevelEvent = 23 mDownMask = 1 << mouseDown mUpMask = 1 << mouseUp keyDownMask = 1 << keyDown keyUpMask = 1 << keyUp autoKeyMask = 1 << autoKey updateMask = 1 << updateEvt diskMask = 1 << diskEvt activMask = 1 << activateEvt highLevelEventMask = 0x0400 osMask = 1 << osEvt everyEvent = 0xFFFF charCodeMask = 0x000000FF keyCodeMask = 0x0000FF00 adbAddrMask = 0x00FF0000 # osEvtMessageMask = (unsigned long)0xFF000000 mouseMovedMessage = 0x00FA suspendResumeMessage = 0x0001 resumeFlag = 1 convertClipboardFlag = 2 activeFlagBit = 0 btnStateBit = 7 cmdKeyBit = 8 shiftKeyBit = 9 alphaLockBit = 10 optionKeyBit = 11 controlKeyBit = 12 rightShiftKeyBit = 13 rightOptionKeyBit = 14 rightControlKeyBit = 15 activeFlag = 1 << activeFlagBit btnState = 1 << btnStateBit cmdKey = 1 << cmdKeyBit shiftKey = 1 << shiftKeyBit alphaLock = 1 << alphaLockBit optionKey = 1 << optionKeyBit controlKey = 1 << controlKeyBit rightShiftKey = 1 << rightShiftKeyBit rightOptionKey = 1 << rightOptionKeyBit rightControlKey = 1 << rightControlKeyBit kNullCharCode = 0 kHomeCharCode = 1 kEnterCharCode = 3 kEndCharCode = 4 kHelpCharCode = 5 kBellCharCode = 7 kBackspaceCharCode = 8 kTabCharCode = 9 kLineFeedCharCode = 10 kVerticalTabCharCode = 11 kPageUpCharCode = 11 kFormFeedCharCode = 12 kPageDownCharCode = 12 kReturnCharCode = 13 kFunctionKeyCharCode = 16 kEscapeCharCode = 27 kClearCharCode = 27 kLeftArrowCharCode = 28 kRightArrowCharCode = 29 kUpArrowCharCode = 30 kDownArrowCharCode = 31 kDeleteCharCode = 127 kNonBreakingSpaceCharCode = 202 networkEvt = 10 driverEvt = 11 app1Evt = 12 app2Evt = 13 app3Evt = 14 app4Evt = 15 networkMask = 0x0400 driverMask = 0x0800 app1Mask = 0x1000 app2Mask = 0x2000 app3Mask = 0x4000 app4Mask = 0x8000 --- NEW FILE: Fonts.py --- # Generated from 'Fonts.h' def FOUR_CHAR_CODE(x): return x kNilOptions = 0 systemFont = 0 applFont = 1 kPlatformDefaultGuiFontID = applFont kPlatformDefaultGuiFontID = -1 commandMark = 17 checkMark = 18 diamondMark = 19 appleMark = 20 propFont = 36864L prpFntH = 36865L prpFntW = 36866L prpFntHW = 36867L fixedFont = 45056L fxdFntH = 45057L fxdFntW = 45058L fxdFntHW = 45059L fontWid = 44208L kInvalidGeneration = 0L kInvalidFontFamily = -1 kInvalidFont = 0L kFMCurrentFilterFormat = 0L kFMDefaultOptions = kNilOptions kFMUseGlobalScopeOption = 0x00000001 kFMInvalidFilterSelector = 0L kFMFontTechnologyFilterSelector = 1L kFMFontContainerFilterSelector = 2L kFMGenerationFilterSelector = 3L kFMFontFamilyCallbackFilterSelector = 4L kFMFontCallbackFilterSelector = 5L kFMTrueTypeFontTechnology = FOUR_CHAR_CODE('true') kFMPostScriptFontTechnology = FOUR_CHAR_CODE('typ1') kFontIDNewYork = 2 kFontIDGeneva = 3 kFontIDMonaco = 4 kFontIDVenice = 5 kFontIDLondon = 6 kFontIDAthens = 7 kFontIDSanFrancisco = 8 kFontIDToronto = 9 kFontIDCairo = 11 kFontIDLosAngeles = 12 kFontIDTimes = 20 kFontIDHelvetica = 21 kFontIDCourier = 22 kFontIDSymbol = 23 kFontIDMobile = 24 newYork = kFontIDNewYork geneva = kFontIDGeneva monaco = kFontIDMonaco venice = kFontIDVenice london = kFontIDLondon athens = kFontIDAthens sanFran = kFontIDSanFrancisco toronto = kFontIDToronto cairo = kFontIDCairo losAngeles = kFontIDLosAngeles times = kFontIDTimes helvetica = kFontIDHelvetica courier = kFontIDCourier symbol = kFontIDSymbol mobile = kFontIDMobile --- NEW FILE: Icons.py --- # Generated from 'Icons.h' def FOUR_CHAR_CODE(x): return x kGenericDocumentIconResource = -4000 kGenericStationeryIconResource = -3985 kGenericEditionFileIconResource = -3989 kGenericApplicationIconResource = -3996 kGenericDeskAccessoryIconResource = -3991 kGenericFolderIconResource = -3999 kPrivateFolderIconResource = -3994 kFloppyIconResource = -3998 kTrashIconResource = -3993 kGenericRAMDiskIconResource = -3988 kGenericCDROMIconResource = -3987 kDesktopIconResource = -3992 kOpenFolderIconResource = -3997 kGenericHardDiskIconResource = -3995 kGenericFileServerIconResource = -3972 kGenericSuitcaseIconResource = -3970 kGenericMoverObjectIconResource = -3969 kGenericPreferencesIconResource = -3971 kGenericQueryDocumentIconResource = -16506 kGenericExtensionIconResource = -16415 kSystemFolderIconResource = -3983 kHelpIconResource = -20271 kAppleMenuFolderIconResource = -3982 genericDocumentIconResource = kGenericDocumentIconResource genericStationeryIconResource = kGenericStationeryIconResource genericEditionFileIconResource = kGenericEditionFileIconResource genericApplicationIconResource = kGenericApplicationIconResource genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource genericFolderIconResource = kGenericFolderIconResource privateFolderIconResource = kPrivateFolderIconResource floppyIconResource = kFloppyIconResource trashIconResource = kTrashIconResource genericRAMDiskIconResource = kGenericRAMDiskIconResource genericCDROMIconResource = kGenericCDROMIconResource desktopIconResource = kDesktopIconResource openFolderIconResource = kOpenFolderIconResource genericHardDiskIconResource = kGenericHardDiskIconResource genericFileServerIconResource = kGenericFileServerIconResource genericSuitcaseIconResource = kGenericSuitcaseIconResource genericMoverObjectIconResource = kGenericMoverObjectIconResource genericPreferencesIconResource = kGenericPreferencesIconResource genericQueryDocumentIconResource = kGenericQueryDocumentIconResource genericExtensionIconResource = kGenericExtensionIconResource systemFolderIconResource = kSystemFolderIconResource appleMenuFolderIconResource = kAppleMenuFolderIconResource kStartupFolderIconResource = -3981 kOwnedFolderIconResource = -3980 kDropFolderIconResource = -3979 kSharedFolderIconResource = -3978 kMountedFolderIconResource = -3977 kControlPanelFolderIconResource = -3976 kPrintMonitorFolderIconResource = -3975 kPreferencesFolderIconResource = -3974 kExtensionsFolderIconResource = -3973 kFontsFolderIconResource = -3968 kFullTrashIconResource = -3984 startupFolderIconResource = kStartupFolderIconResource ownedFolderIconResource = kOwnedFolderIconResource dropFolderIconResource = kDropFolderIconResource sharedFolderIconResource = kSharedFolderIconResource mountedFolderIconResource = kMountedFolderIconResource controlPanelFolderIconResource = kControlPanelFolderIconResource printMonitorFolderIconResource = kPrintMonitorFolderIconResource preferencesFolderIconResource = kPreferencesFolderIconResource extensionsFolderIconResource = kExtensionsFolderIconResource fontsFolderIconResource = kFontsFolderIconResource fullTrashIconResource = kFullTrashIconResource kThumbnail32BitData = FOUR_CHAR_CODE('it32') kThumbnail8BitMask = FOUR_CHAR_CODE('t8mk') kHuge1BitMask = FOUR_CHAR_CODE('ich#') kHuge4BitData = FOUR_CHAR_CODE('ich4') kHuge8BitData = FOUR_CHAR_CODE('ich8') kHuge32BitData = FOUR_CHAR_CODE('ih32') kHuge8BitMask = FOUR_CHAR_CODE('h8mk') kLarge1BitMask = FOUR_CHAR_CODE('ICN#') kLarge4BitData = FOUR_CHAR_CODE('icl4') kLarge8BitData = FOUR_CHAR_CODE('icl8') kLarge32BitData = FOUR_CHAR_CODE('il32') kLarge8BitMask = FOUR_CHAR_CODE('l8mk') kSmall1BitMask = FOUR_CHAR_CODE('ics#') kSmall4BitData = FOUR_CHAR_CODE('ics4') kSmall8BitData = FOUR_CHAR_CODE('ics8') kSmall32BitData = FOUR_CHAR_CODE('is32') kSmall8BitMask = FOUR_CHAR_CODE('s8mk') kMini1BitMask = FOUR_CHAR_CODE('icm#') kMini4BitData = FOUR_CHAR_CODE('icm4') kMini8BitData = FOUR_CHAR_CODE('icm8') kTileIconVariant = FOUR_CHAR_CODE('tile') kRolloverIconVariant = FOUR_CHAR_CODE('over') kDropIconVariant = FOUR_CHAR_CODE('drop') kOpenIconVariant = FOUR_CHAR_CODE('open') kOpenDropIconVariant = FOUR_CHAR_CODE('odrp') large1BitMask = kLarge1BitMask large4BitData = kLarge4BitData large8BitData = kLarge8BitData small1BitMask = kSmall1BitMask small4BitData = kSmall4BitData small8BitData = kSmall8BitData mini1BitMask = kMini1BitMask mini4BitData = kMini4BitData mini8BitData = kMini8BitData kAlignNone = 0x00 kAlignVerticalCenter = 0x01 kAlignTop = 0x02 kAlignBottom = 0x03 kAlignHorizontalCenter = 0x04 kAlignAbsoluteCenter = kAlignVerticalCenter | kAlignHorizontalCenter kAlignCenterTop = kAlignTop | kAlignHorizontalCenter kAlignCenterBottom = kAlignBottom | kAlignHorizontalCenter kAlignLeft = 0x08 kAlignCenterLeft = kAlignVerticalCenter | kAlignLeft kAlignTopLeft = kAlignTop | kAlignLeft kAlignBottomLeft = kAlignBottom | kAlignLeft kAlignRight = 0x0C kAlignCenterRight = kAlignVerticalCenter | kAlignRight kAlignTopRight = kAlignTop | kAlignRight kAlignBottomRight = kAlignBottom | kAlignRight atNone = kAlignNone atVerticalCenter = kAlignVerticalCenter atTop = kAlignTop atBottom = kAlignBottom atHorizontalCenter = kAlignHorizontalCenter atAbsoluteCenter = kAlignAbsoluteCenter atCenterTop = kAlignCenterTop atCenterBottom = kAlignCenterBottom atLeft = kAlignLeft atCenterLeft = kAlignCenterLeft atTopLeft = kAlignTopLeft atBottomLeft = kAlignBottomLeft atRight = kAlignRight atCenterRight = kAlignCenterRight atTopRight = kAlignTopRight atBottomRight = kAlignBottomRight kTransformNone = 0x00 kTransformDisabled = 0x01 kTransformOffline = 0x02 kTransformOpen = 0x03 kTransformLabel1 = 0x0100 kTransformLabel2 = 0x0200 kTransformLabel3 = 0x0300 kTransformLabel4 = 0x0400 kTransformLabel5 = 0x0500 kTransformLabel6 = 0x0600 kTransformLabel7 = 0x0700 kTransformSelected = 0x4000 kTransformSelectedDisabled = kTransformSelected | kTransformDisabled kTransformSelectedOffline = kTransformSelected | kTransformOffline kTransformSelectedOpen = kTransformSelected | kTransformOpen ttNone = kTransformNone ttDisabled = kTransformDisabled ttOffline = kTransformOffline ttOpen = kTransformOpen ttLabel1 = kTransformLabel1 ttLabel2 = kTransformLabel2 ttLabel3 = kTransformLabel3 ttLabel4 = kTransformLabel4 ttLabel5 = kTransformLabel5 ttLabel6 = kTransformLabel6 ttLabel7 = kTransformLabel7 ttSelected = kTransformSelected ttSelectedDisabled = kTransformSelectedDisabled ttSelectedOffline = kTransformSelectedOffline ttSelectedOpen = kTransformSelectedOpen kSelectorLarge1Bit = 0x00000001 kSelectorLarge4Bit = 0x00000002 kSelectorLarge8Bit = 0x00000004 kSelectorLarge32Bit = 0x00000008 kSelectorLarge8BitMask = 0x00000010 kSelectorSmall1Bit = 0x00000100 kSelectorSmall4Bit = 0x00000200 kSelectorSmall8Bit = 0x00000400 kSelectorSmall32Bit = 0x00000800 kSelectorSmall8BitMask = 0x00001000 kSelectorMini1Bit = 0x00010000 kSelectorMini4Bit = 0x00020000 kSelectorMini8Bit = 0x00040000 kSelectorHuge1Bit = 0x01000000 kSelectorHuge4Bit = 0x02000000 kSelectorHuge8Bit = 0x04000000 kSelectorHuge32Bit = 0x08000000 kSelectorHuge8BitMask = 0x10000000 kSelectorAllLargeData = 0x000000FF kSelectorAllSmallData = 0x0000FF00 kSelectorAllMiniData = 0x00FF0000 # kSelectorAllHugeData = (long)0xFF000000 kSelectorAll1BitData = kSelectorLarge1Bit | kSelectorSmall1Bit | kSelectorMini1Bit | kSelectorHuge1Bit kSelectorAll4BitData = kSelectorLarge4Bit | kSelectorSmall4Bit | kSelectorMini4Bit | kSelectorHuge4Bit kSelectorAll8BitData = kSelectorLarge8Bit | kSelectorSmall8Bit | kSelectorMini8Bit | kSelectorHuge8Bit kSelectorAll32BitData = kSelectorLarge32Bit | kSelectorSmall32Bit | kSelectorHuge32Bit # kSelectorAllAvailableData = (long)0xFFFFFFFF svLarge1Bit = kSelectorLarge1Bit svLarge4Bit = kSelectorLarge4Bit svLarge8Bit = kSelectorLarge8Bit svSmall1Bit = kSelectorSmall1Bit svSmall4Bit = kSelectorSmall4Bit svSmall8Bit = kSelectorSmall8Bit svMini1Bit = kSelectorMini1Bit svMini4Bit = kSelectorMini4Bit svMini8Bit = kSelectorMini8Bit svAllLargeData = kSelectorAllLargeData svAllSmallData = kSelectorAllSmallData svAllMiniData = kSelectorAllMiniData svAll1BitData = kSelectorAll1BitData svAll4BitData = kSelectorAll4BitData svAll8BitData = kSelectorAll8BitData # svAllAvailableData = kSelectorAllAvailableData kSystemIconsCreator = FOUR_CHAR_CODE('macs') # err = GetIconRef(kOnSystemDisk kClipboardIcon = FOUR_CHAR_CODE('CLIP') kClippingUnknownTypeIcon = FOUR_CHAR_CODE('clpu') kClippingPictureTypeIcon = FOUR_CHAR_CODE('clpp') kClippingTextTypeIcon = FOUR_CHAR_CODE('clpt') kClippingSoundTypeIcon = FOUR_CHAR_CODE('clps') kDesktopIcon = FOUR_CHAR_CODE('desk') kFinderIcon = FOUR_CHAR_CODE('FNDR') kFontSuitcaseIcon = FOUR_CHAR_CODE('FFIL') kFullTrashIcon = FOUR_CHAR_CODE('ftrh') kGenericApplicationIcon = FOUR_CHAR_CODE('APPL') kGenericCDROMIcon = FOUR_CHAR_CODE('cddr') kGenericControlPanelIcon = FOUR_CHAR_CODE('APPC') kGenericControlStripModuleIcon = FOUR_CHAR_CODE('sdev') kGenericComponentIcon = FOUR_CHAR_CODE('thng') kGenericDeskAccessoryIcon = FOUR_CHAR_CODE('APPD') kGenericDocumentIcon = FOUR_CHAR_CODE('docu') kGenericEditionFileIcon = FOUR_CHAR_CODE('edtf') kGenericExtensionIcon = FOUR_CHAR_CODE('INIT') kGenericFileServerIcon = FOUR_CHAR_CODE('srvr') kGenericFontIcon = FOUR_CHAR_CODE('ffil') kGenericFontScalerIcon = FOUR_CHAR_CODE('sclr') kGenericFloppyIcon = FOUR_CHAR_CODE('flpy') kGenericHardDiskIcon = FOUR_CHAR_CODE('hdsk') kGenericRemovableMediaIcon = FOUR_CHAR_CODE('rmov') kGenericMoverObjectIcon = FOUR_CHAR_CODE('movr') kGenericPCCardIcon = FOUR_CHAR_CODE('pcmc') kGenericPreferencesIcon = FOUR_CHAR_CODE('pref') kGenericQueryDocumentIcon = FOUR_CHAR_CODE('qery') kGenericRAMDiskIcon = FOUR_CHAR_CODE('ramd') kGenericSharedLibaryIcon = FOUR_CHAR_CODE('shlb') kGenericStationeryIcon = FOUR_CHAR_CODE('sdoc') kGenericSuitcaseIcon = FOUR_CHAR_CODE('suit') kGenericWORMIcon = FOUR_CHAR_CODE('worm') kInternationResourcesIcon = FOUR_CHAR_CODE('ifil') kKeyboardLayoutIcon = FOUR_CHAR_CODE('kfil') kSoundFileIcon = FOUR_CHAR_CODE('sfil') kSystemSuitcaseIcon = FOUR_CHAR_CODE('zsys') kTrashIcon = FOUR_CHAR_CODE('trsh') kTrueTypeFontIcon = FOUR_CHAR_CODE('tfil') kTrueTypeFlatFontIcon = FOUR_CHAR_CODE('sfnt') kTrueTypeMultiFlatFontIcon = FOUR_CHAR_CODE('ttcf') kInternetLocationHTTPIcon = FOUR_CHAR_CODE('ilht') kInternetLocationFTPIcon = FOUR_CHAR_CODE('ilft') kInternetLocationAppleShareIcon = FOUR_CHAR_CODE('ilaf') kInternetLocationAppleTalkZoneIcon = FOUR_CHAR_CODE('ilat') kInternetLocationFileIcon = FOUR_CHAR_CODE('ilfi') kInternetLocationMailIcon = FOUR_CHAR_CODE('ilma') kInternetLocationNewsIcon = FOUR_CHAR_CODE('ilnw') kInternetLocationNSLNeighborhoodIcon = FOUR_CHAR_CODE('ilns') kInternetLocationGenericIcon = FOUR_CHAR_CODE('ilge') kGenericFolderIcon = FOUR_CHAR_CODE('fldr') kDropFolderIcon = FOUR_CHAR_CODE('dbox') kMountedFolderIcon = FOUR_CHAR_CODE('mntd') kOpenFolderIcon = FOUR_CHAR_CODE('ofld') kOwnedFolderIcon = FOUR_CHAR_CODE('ownd') kPrivateFolderIcon = FOUR_CHAR_CODE('prvf') kSharedFolderIcon = FOUR_CHAR_CODE('shfl') kSharingPrivsNotApplicableIcon = FOUR_CHAR_CODE('shna') kSharingPrivsReadOnlyIcon = FOUR_CHAR_CODE('shro') kSharingPrivsReadWriteIcon = FOUR_CHAR_CODE('shrw') kSharingPrivsUnknownIcon = FOUR_CHAR_CODE('shuk') kSharingPrivsWritableIcon = FOUR_CHAR_CODE('writ') kUserFolderIcon = FOUR_CHAR_CODE('ufld') kWorkgroupFolderIcon = FOUR_CHAR_CODE('wfld') kGuestUserIcon = FOUR_CHAR_CODE('gusr') kUserIcon = FOUR_CHAR_CODE('user') kOwnerIcon = FOUR_CHAR_CODE('susr') kGroupIcon = FOUR_CHAR_CODE('grup') kAppleExtrasFolderIcon = FOUR_CHAR_CODE('aex€') kAppleMenuFolderIcon = FOUR_CHAR_CODE('amnu') kApplicationsFolderIcon = FOUR_CHAR_CODE('apps') kApplicationSupportFolderIcon = FOUR_CHAR_CODE('asup') kAssistantsFolderIcon = FOUR_CHAR_CODE('ast€') kContextualMenuItemsFolderIcon = FOUR_CHAR_CODE('cmnu') kControlPanelDisabledFolderIcon = FOUR_CHAR_CODE('ctrD') kControlPanelFolderIcon = FOUR_CHAR_CODE('ctrl') kControlStripModulesFolderIcon = FOUR_CHAR_CODE('sdv€') kDocumentsFolderIcon = FOUR_CHAR_CODE('docs') kExtensionsDisabledFolderIcon = FOUR_CHAR_CODE('extD') kExtensionsFolderIcon = FOUR_CHAR_CODE('extn') kFavoritesFolderIcon = FOUR_CHAR_CODE('favs') kFontsFolderIcon = FOUR_CHAR_CODE('font') kHelpFolderIcon = FOUR_CHAR_CODE('€hlp') kInternetFolderIcon = FOUR_CHAR_CODE('int€') kInternetPlugInFolderIcon = FOUR_CHAR_CODE('€net') kLocalesFolderIcon = FOUR_CHAR_CODE('€loc') kMacOSReadMeFolderIcon = FOUR_CHAR_CODE('mor€') kPreferencesFolderIcon = FOUR_CHAR_CODE('prf€') kPrinterDescriptionFolderIcon = FOUR_CHAR_CODE('ppdf') kPrinterDriverFolderIcon = FOUR_CHAR_CODE('€prd') kPrintMonitorFolderIcon = FOUR_CHAR_CODE('prnt') kRecentApplicationsFolderIcon = FOUR_CHAR_CODE('rapp') kRecentDocumentsFolderIcon = FOUR_CHAR_CODE('rdoc') kRecentServersFolderIcon = FOUR_CHAR_CODE('rsrv') kScriptingAdditionsFolderIcon = FOUR_CHAR_CODE('€scr') kSharedLibrariesFolderIcon = FOUR_CHAR_CODE('€lib') kScriptsFolderIcon = FOUR_CHAR_CODE('scr€') kShutdownItemsDisabledFolderIcon = FOUR_CHAR_CODE('shdD') kShutdownItemsFolderIcon = FOUR_CHAR_CODE('shdf') kSpeakableItemsFolder = FOUR_CHAR_CODE('spki') kStartupItemsDisabledFolderIcon = FOUR_CHAR_CODE('strD') kStartupItemsFolderIcon = FOUR_CHAR_CODE('strt') kSystemExtensionDisabledFolderIcon = FOUR_CHAR_CODE('macD') kSystemFolderIcon = FOUR_CHAR_CODE('macs') kTextEncodingsFolderIcon = FOUR_CHAR_CODE('€tex') kAppearanceFolderIcon = FOUR_CHAR_CODE('appr') kUtilitiesFolderIcon = FOUR_CHAR_CODE('uti€') kVoicesFolderIcon = FOUR_CHAR_CODE('fvoc') kColorSyncFolderIcon = FOUR_CHAR_CODE('prof') kInternetSearchSitesFolderIcon = FOUR_CHAR_CODE('issf') kUsersFolderIcon = FOUR_CHAR_CODE('usr€') kAppleScriptBadgeIcon = FOUR_CHAR_CODE('scrp') kLockedBadgeIcon = FOUR_CHAR_CODE('lbdg') kMountedBadgeIcon = FOUR_CHAR_CODE('mbdg') kSharedBadgeIcon = FOUR_CHAR_CODE('sbdg') kAliasBadgeIcon = FOUR_CHAR_CODE('abdg') kAlertNoteIcon = FOUR_CHAR_CODE('note') kAlertCautionIcon = FOUR_CHAR_CODE('caut') kAlertStopIcon = FOUR_CHAR_CODE('stop') kAppleTalkIcon = FOUR_CHAR_CODE('atlk') kAppleTalkZoneIcon = FOUR_CHAR_CODE('atzn') kAFPServerIcon = FOUR_CHAR_CODE('afps') kFTPServerIcon = FOUR_CHAR_CODE('ftps') kHTTPServerIcon = FOUR_CHAR_CODE('htps') kGenericNetworkIcon = FOUR_CHAR_CODE('gnet') kIPFileServerIcon = FOUR_CHAR_CODE('isrv') kAppleLogoIcon = FOUR_CHAR_CODE('capl') kAppleMenuIcon = FOUR_CHAR_CODE('sapl') kBackwardArrowIcon = FOUR_CHAR_CODE('baro') kFavoriteItemsIcon = FOUR_CHAR_CODE('favr') kForwardArrowIcon = FOUR_CHAR_CODE('faro') kGridIcon = FOUR_CHAR_CODE('grid') kHelpIcon = FOUR_CHAR_CODE('help') kKeepArrangedIcon = FOUR_CHAR_CODE('arng') kLockedIcon = FOUR_CHAR_CODE('lock') kNoFilesIcon = FOUR_CHAR_CODE('nfil') kNoFolderIcon = FOUR_CHAR_CODE('nfld') kNoWriteIcon = FOUR_CHAR_CODE('nwrt') kProtectedApplicationFolderIcon = FOUR_CHAR_CODE('papp') kProtectedSystemFolderIcon = FOUR_CHAR_CODE('psys') kRecentItemsIcon = FOUR_CHAR_CODE('rcnt') kShortcutIcon = FOUR_CHAR_CODE('shrt') kSortAscendingIcon = FOUR_CHAR_CODE('asnd') kSortDescendingIcon = FOUR_CHAR_CODE('dsnd') kUnlockedIcon = FOUR_CHAR_CODE('ulck') kConnectToIcon = FOUR_CHAR_CODE('cnct') kIconServicesNormalUsageFlag = 0 kIconFamilyType = FOUR_CHAR_CODE('icns') --- NEW FILE: Lists.py --- # Generated from 'Lists.h' def FOUR_CHAR_CODE(x): return x listNotifyNothing = FOUR_CHAR_CODE('nada') listNotifyClick = FOUR_CHAR_CODE('clik') listNotifyDoubleClick = FOUR_CHAR_CODE('dblc') listNotifyPreClick = FOUR_CHAR_CODE('pclk') lDoVAutoscrollBit = 1 lDoHAutoscrollBit = 0 lDoVAutoscroll = 2 lDoHAutoscroll = 1 lOnlyOneBit = 7 lExtendDragBit = 6 lNoDisjointBit = 5 lNoExtendBit = 4 lNoRectBit = 3 lUseSenseBit = 2 lNoNilHiliteBit = 1 lOnlyOne = -128 lExtendDrag = 64 lNoDisjoint = 32 lNoExtend = 16 lNoRect = 8 lUseSense = 4 lNoNilHilite = 2 lInitMsg = 0 lDrawMsg = 1 lHiliteMsg = 2 lCloseMsg = 3 kListDefUserProcType = 0 kListDefStandardTextType = 1 kListDefStandardIconType = 2 --- NEW FILE: MacTextEditor.py --- # Generated from 'MacTextEditor.h' def FOUR_CHAR_CODE(x): return x false = 0 true = 1 kTXNClearThisControl = 0xFFFFFFFF kTXNClearTheseFontFeatures = 0x80000000 kTXNDontCareTypeSize = 0xFFFFFFFF kTXNDecrementTypeSize = 0x80000000 kTXNUseCurrentSelection = 0xFFFFFFFF kTXNStartOffset = 0 kTXNEndOffset = 0x7FFFFFFF MovieFileType = FOUR_CHAR_CODE('moov') kTXNWillDefaultToATSUIBit = 0 kTXNWillDefaultToATSUIMask = 1L << kTXNWillDefaultToATSUIBit kTXNWantMoviesBit = 0 kTXNWantSoundBit = 1 kTXNWantGraphicsBit = 2 kTXNAlwaysUseQuickDrawTextBit = 3 kTXNUseTemporaryMemoryBit = 4 kTXNWantMoviesMask = 1L << kTXNWantMoviesBit kTXNWantSoundMask = 1L << kTXNWantSoundBit kTXNWantGraphicsMask = 1L << kTXNWantGraphicsBit kTXNAlwaysUseQuickDrawTextMask = 1L << kTXNAlwaysUseQuickDrawTextBit kTXNUseTemporaryMemoryMask = 1L << kTXNUseTemporaryMemoryBit kTXNDrawGrowIconBit = 0 kTXNShowWindowBit = 1 kTXNWantHScrollBarBit = 2 kTXNWantVScrollBarBit = 3 kTXNNoTSMEverBit = 4 kTXNReadOnlyBit = 5 kTXNNoKeyboardSyncBit = 6 kTXNNoSelectionBit = 7 kTXNSaveStylesAsSTYLResourceBit = 8 kOutputTextInUnicodeEncodingBit = 9 kTXNDoNotInstallDragProcsBit = 10 kTXNAlwaysWrapAtViewEdgeBit = 11 kTXNDrawGrowIconMask = 1L << kTXNDrawGrowIconBit kTXNShowWindowMask = 1L << kTXNShowWindowBit kTXNWantHScrollBarMask = 1L << kTXNWantHScrollBarBit kTXNWantVScrollBarMask = 1L << kTXNWantVScrollBarBit kTXNNoTSMEverMask = 1L << kTXNNoTSMEverBit kTXNReadOnlyMask = 1L << kTXNReadOnlyBit kTXNNoKeyboardSyncMask = 1L << kTXNNoKeyboardSyncBit kTXNNoSelectionMask = 1L << kTXNNoSelectionBit kTXNSaveStylesAsSTYLResourceMask = 1L << kTXNSaveStylesAsSTYLResourceBit kOutputTextInUnicodeEncodingMask = 1L << kOutputTextInUnicodeEncodingBit kTXNDoNotInstallDragProcsMask = 1L << kTXNDoNotInstallDragProcsBit kTXNAlwaysWrapAtViewEdgeMask = 1L << kTXNAlwaysWrapAtViewEdgeBit kTXNFontContinuousBit = 0 kTXNSizeContinuousBit = 1 kTXNStyleContinuousBit = 2 kTXNColorContinuousBit = 3 kTXNFontContinuousMask = 1L << kTXNFontContinuousBit kTXNSizeContinuousMask = 1L << kTXNSizeContinuousBit kTXNStyleContinuousMask = 1L << kTXNStyleContinuousBit kTXNColorContinuousMask = 1L << kTXNColorContinuousBit kTXNIgnoreCaseBit = 0 kTXNEntireWordBit = 1 kTXNUseEncodingWordRulesBit = 31 kTXNIgnoreCaseMask = 1L << kTXNIgnoreCaseBit kTXNEntireWordMask = 1L << kTXNEntireWordBit kTXNUseEncodingWordRulesMask = 1L << kTXNUseEncodingWordRulesBit kTXNTextensionFile = FOUR_CHAR_CODE('txtn') kTXNTextFile = FOUR_CHAR_CODE('TEXT') kTXNPictureFile = FOUR_CHAR_CODE('PICT') kTXNMovieFile = MovieFileType kTXNSoundFile = FOUR_CHAR_CODE('sfil') kTXNAIFFFile = FOUR_CHAR_CODE('AIFF') kTXNTextEditStyleFrameType = 1 kTXNPageFrameType = 2 kTXNMultipleFrameType = 3 kTXNTextData = FOUR_CHAR_CODE('TEXT') kTXNPictureData = FOUR_CHAR_CODE('PICT') kTXNMovieData = FOUR_CHAR_CODE('moov') kTXNSoundData = FOUR_CHAR_CODE('snd ') kTXNUnicodeTextData = FOUR_CHAR_CODE('utxt') kTXNLineDirectionTag = FOUR_CHAR_CODE('lndr') kTXNJustificationTag = FOUR_CHAR_CODE('just') kTXNIOPrivilegesTag = FOUR_CHAR_CODE('iopv') kTXNSelectionStateTag = FOUR_CHAR_CODE('slst') kTXNInlineStateTag = FOUR_CHAR_CODE('inst') kTXNWordWrapStateTag = FOUR_CHAR_CODE('wwrs') kTXNKeyboardSyncStateTag = FOUR_CHAR_CODE('kbsy') kTXNAutoIndentStateTag = FOUR_CHAR_CODE('auin') kTXNTabSettingsTag = FOUR_CHAR_CODE('tabs') kTXNRefConTag = FOUR_CHAR_CODE('rfcn') kTXNMarginsTag = FOUR_CHAR_CODE('marg') kTXNNoUserIOTag = FOUR_CHAR_CODE('nuio') kTXNTypingAction = 0 kTXNCutAction = 1 kTXNPasteAction = 2 kTXNClearAction = 3 kTXNChangeFontAction = 4 kTXNChangeFontColorAction = 5 kTXNChangeFontSizeAction = 6 kTXNChangeStyleAction = 7 kTXNAlignLeftAction = 8 kTXNAlignCenterAction = 9 kTXNAlignRightAction = 10 kTXNDropAction = 11 kTXNMoveAction = 12 kTXNFontFeatureAction = 13 kTXNFontVariationAction = 14 kTXNUndoLastAction = 1024 # kTXNClearThisControl = (long)0xFFFFFFFF # kTXNClearTheseFontFeatures = (long)0x80000000 kTXNReadWrite = false kTXNReadOnly = true kTXNSelectionOn = true kTXNSelectionOff = false kTXNUseInline = false kTXNUseBottomline = true kTXNAutoWrap = false kTXNNoAutoWrap = true kTXNSyncKeyboard = false kTXNNoSyncKeyboard = true kTXNAutoIndentOff = false kTXNAutoIndentOn = true kTXNRightTab = -1 kTXNLeftTab = 0 kTXNCenterTab = 1 kTXNLeftToRight = 0 kTXNRightToLeft = 1 kTXNFlushDefault = 0 kTXNFlushLeft = 1 kTXNFlushRight = 2 kTXNCenter = 4 kTXNFullJust = 8 kTXNForceFullJust = 16 kScrollBarsAlwaysActive = true kScrollBarsSyncWithFocus = false # kTXNDontCareTypeSize = (long)0xFFFFFFFF kTXNDontCareTypeStyle = 0xFF kTXNIncrementTypeSize = 0x00000001 # kTXNDecrementTypeSize = (long)0x80000000 # kTXNUseCurrentSelection = 0xFFFFFFFFUL # kTXNStartOffset = 0UL # kTXNEndOffset = 0x7FFFFFFFUL kTXNSingleStylePerTextDocumentResType = FOUR_CHAR_CODE('MPSR') kTXNMultipleStylesPerTextDocumentResType = FOUR_CHAR_CODE('styl') kTXNShowStart = false kTXNShowEnd = true kTXNQDFontNameAttribute = FOUR_CHAR_CODE('fntn') kTXNQDFontFamilyIDAttribute = FOUR_CHAR_CODE('font') kTXNQDFontSizeAttribute = FOUR_CHAR_CODE('size') kTXNQDFontStyleAttribute = FOUR_CHAR_CODE('face') kTXNQDFontColorAttribute = FOUR_CHAR_CODE('klor') kTXNTextEncodingAttribute = FOUR_CHAR_CODE('encd') kTXNATSUIFontFeaturesAttribute = FOUR_CHAR_CODE('atfe') kTXNATSUIFontVariationsAttribute = FOUR_CHAR_CODE('atva') # kTXNQDFontNameAttributeSize = sizeof(Str255) # kTXNQDFontFamilyIDAttributeSize = sizeof(SInt16) # kTXNQDFontSizeAttributeSize = sizeof(SInt16) # kTXNQDFontStyleAttributeSize = sizeof(Style) # kTXNQDFontColorAttributeSize = sizeof(RGBColor) # kTXNTextEncodingAttributeSize = sizeof(TextEncoding) kTXNSystemDefaultEncoding = 0 kTXNMacOSEncoding = 1 kTXNUnicodeEncoding = 2 kTXNBackgroundTypeRGB = 1 # status = TXNInitTextension( &defaults # justification = LMTESysJust --- NEW FILE: MediaDescr.py --- # Parsers/generators for QuickTime media descriptions import struct Error = 'MediaDescr.Error' class _MediaDescriptionCodec: def __init__(self, trunc, size, names, fmt): self.trunc = trunc self.size = size self.names = names self.fmt = fmt def decode(self, data): if self.trunc: data = data[:self.size] values = struct.unpack(self.fmt, data) if len(values) != len(self.names): raise Error, ('Format length does not match number of names', descr) rv = {} for i in range(len(values)): name = self.names[i] value = values[i] if type(name) == type(()): name, cod, dec = name value = dec(value) rv[name] = value return rv def encode(dict): list = [self.fmt] for name in self.names: if type(name) == type(()): name, cod, dec = name else: cod = dec = None value = dict[name] if cod: value = cod(value) list.append(value) rv = apply(struct.pack, tuple(list)) return rv # Helper functions def _tofixed(float): hi = int(float) lo = int(float*0x10000) & 0xffff return (hi<<16)|lo def _fromfixed(fixed): hi = (fixed >> 16) & 0xffff lo = (fixed & 0xffff) return hi + (lo / float(0x10000)) def _tostr31(str): return chr(len(str)) + str + '\0'*(31-len(str)) def _fromstr31(str31): return str31[1:1+ord(str31[0])] SampleDescription = _MediaDescriptionCodec( 1, # May be longer, truncate 16, # size ('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex'), # Attributes "l4slhh" # Format ) SoundDescription = _MediaDescriptionCodec( 1, 36, ('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex', 'version', 'revlevel', 'vendor', 'numChannels', 'sampleSize', 'compressionID', 'packetSize', ('sampleRate', _tofixed, _fromfixed)), "l4slhhhh4shhhhl" # Format ) SoundDescriptionV1 = _MediaDescriptionCodec( 1, 52, ('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex', 'version', 'revlevel', 'vendor', 'numChannels', 'sampleSize', 'compressionID', 'packetSize', ('sampleRate', _tofixed, _fromfixed), 'samplesPerPacket', 'bytesPerPacket', 'bytesPerFrame', 'bytesPerSample'), "l4slhhhh4shhhhlllll" # Format ) ImageDescription = _MediaDescriptionCodec( 1, # May be longer, truncate 86, # size ('idSize', 'cType', 'resvd1', 'resvd2', 'dataRefIndex', 'version', 'revisionLevel', 'vendor', 'temporalQuality', 'spatialQuality', 'width', 'height', ('hRes', _tofixed, _fromfixed), ('vRes', _tofixed, _fromfixed), 'dataSize', 'frameCount', ('name', _tostr31, _fromstr31), 'depth', 'clutID'), 'l4slhhhh4sllhhlllh32shh', ) # XXXX Others, like TextDescription and such, remain to be done. --- NEW FILE: Menus.py --- # Generated from 'Menus.h' def FOUR_CHAR_CODE(x): return x noMark = 0 kMenuDrawMsg = 0 kMenuSizeMsg = 2 kMenuPopUpMsg = 3 kMenuCalcItemMsg = 5 kMenuThemeSavvyMsg = 7 mDrawMsg = 0 mSizeMsg = 2 mPopUpMsg = 3 mCalcItemMsg = 5 mChooseMsg = 1 mDrawItemMsg = 4 kMenuChooseMsg = 1 kMenuDrawItemMsg = 4 kThemeSavvyMenuResponse = 0x7473 kMenuInitMsg = 8 kMenuDisposeMsg = 9 kMenuFindItemMsg = 10 kMenuHiliteItemMsg = 11 textMenuProc = 0 hMenuCmd = 27 hierMenu = -1 kInsertHierarchicalMenu = -1 mctAllItems = -98 mctLastIDIndic = -99 kMenuStdMenuProc = 63 kMenuStdMenuBarProc = 63 kMenuNoModifiers = 0 kMenuShiftModifier = (1 << 0) kMenuOptionModifier = (1 << 1) kMenuControlModifier = (1 << 2) kMenuNoCommandModifier = (1 << 3) kMenuNoIcon = 0 kMenuIconType = 1 kMenuShrinkIconType = 2 kMenuSmallIconType = 3 kMenuColorIconType = 4 kMenuIconSuiteType = 5 kMenuIconRefType = 6 kMenuAttrExcludesMarkColumn = (1 << 0) kMenuAttrAutoDisable = (1 << 2) kMenuItemAttrSubmenuParentChoosable = (1 << 2) kMenuTrackingModeMouse = 1 kMenuTrackingModeKeyboard = 2 kMenuDefProcPtr = 0 kMenuPropertyPersistent = 0x00000001 kHierarchicalFontMenuOption = 0x00000001 gestaltContextualMenuAttr = FOUR_CHAR_CODE('cmnu') gestaltContextualMenuUnusedBit = 0 gestaltContextualMenuTrapAvailable = 1 kCMHelpItemNoHelp = 0 kCMHelpItemAppleGuide = 1 kCMHelpItemOtherHelp = 2 kCMNothingSelected = 0 kCMMenuItemSelected = 1 kCMShowHelpSelected = 3 --- NEW FILE: QDOffscreen.py --- # Generated from 'QDOffscreen.h' def FOUR_CHAR_CODE(x): return x pixPurgeBit = 0 noNewDeviceBit = 1 useTempMemBit = 2 keepLocalBit = 3 useDistantHdwrMemBit = 4 useLocalHdwrMemBit = 5 pixelsPurgeableBit = 6 pixelsLockedBit = 7 mapPixBit = 16 newDepthBit = 17 alignPixBit = 18 newRowBytesBit = 19 reallocPixBit = 20 clipPixBit = 28 stretchPixBit = 29 ditherPixBit = 30 gwFlagErrBit = 31 pixPurge = 1L << pixPurgeBit noNewDevice = 1L << noNewDeviceBit useTempMem = 1L << useTempMemBit keepLocal = 1L << keepLocalBit useDistantHdwrMem = 1L << useDistantHdwrMemBit useLocalHdwrMem = 1L << useLocalHdwrMemBit pixelsPurgeable = 1L << pixelsPurgeableBit pixelsLocked = 1L << pixelsLockedBit kAllocDirectDrawSurface = 1L << 14 mapPix = 1L << mapPixBit newDepth = 1L << newDepthBit alignPix = 1L << alignPixBit newRowBytes = 1L << newRowBytesBit reallocPix = 1L << reallocPixBit clipPix = 1L << clipPixBit stretchPix = 1L << stretchPixBit ditherPix = 1L << ditherPixBit gwFlagErr = 1L << gwFlagErrBit deviceIsIndirect = (1L << 0) deviceNeedsLock = (1L << 1) deviceIsStatic = (1L << 2) deviceIsExternalBuffer = (1L << 3) deviceIsDDSurface = (1L << 4) deviceIsDCISurface = (1L << 5) deviceIsGDISurface = (1L << 6) deviceIsAScreen = (1L << 7) deviceIsOverlaySurface = (1L << 8) --- NEW FILE: QuickDraw.py --- # Generated from 'QuickDraw.h' def FOUR_CHAR_CODE(x): return x normal = 0 bold = 1 italic = 2 underline = 4 outline = 8 shadow = 0x10 condense = 0x20 extend = 0x40 invalColReq = -1 srcCopy = 0 srcOr = 1 srcXor = 2 srcBic = 3 notSrcCopy = 4 notSrcOr = 5 notSrcXor = 6 notSrcBic = 7 patCopy = 8 patOr = 9 patXor = 10 patBic = 11 notPatCopy = 12 notPatOr = 13 notPatXor = 14 notPatBic = 15 grayishTextOr = 49 hilitetransfermode = 50 hilite = 50 blend = 32 addPin = 33 addOver = 34 subPin = 35 addMax = 37 adMax = 37 subOver = 38 adMin = 39 ditherCopy = 64 transparent = 36 italicBit = 1 ulineBit = 2 outlineBit = 3 shadowBit = 4 condenseBit = 5 extendBit = 6 normalBit = 0 inverseBit = 1 redBit = 4 greenBit = 3 blueBit = 2 cyanBit = 8 magentaBit = 7 yellowBit = 6 blackBit = 5 blackColor = 33 whiteColor = 30 redColor = 205 greenColor = 341 blueColor = 409 cyanColor = 273 magentaColor = 137 yellowColor = 69 picLParen = 0 picRParen = 1 clutType = 0 fixedType = 1 directType = 2 gdDevType = 0 interlacedDevice = 2 roundedDevice = 5 hasAuxMenuBar = 6 burstDevice = 7 ext32Device = 8 ramInit = 10 mainScreen = 11 allInit = 12 screenDevice = 13 noDriver = 14 screenActive = 15 hiliteBit = 7 pHiliteBit = 0 defQDColors = 127 RGBDirect = 16 baseAddr32 = 4 sysPatListID = 0 iBeamCursor = 1 crossCursor = 2 plusCursor = 3 watchCursor = 4 kQDGrafVerbFrame = 0 kQDGrafVerbPaint = 1 kQDGrafVerbErase = 2 kQDGrafVerbInvert = 3 kQDGrafVerbFill = 4 frame = kQDGrafVerbFrame paint = kQDGrafVerbPaint erase = kQDGrafVerbErase invert = kQDGrafVerbInvert fill = kQDGrafVerbFill chunky = 0 chunkyPlanar = 1 planar = 2 singleDevicesBit = 0 dontMatchSeedsBit = 1 allDevicesBit = 2 singleDevices = 1 << singleDevicesBit dontMatchSeeds = 1 << dontMatchSeedsBit allDevices = 1 << allDevicesBit kPrinterFontStatus = 0 kPrinterScalingStatus = 1 kNoConstraint = 0 kVerticalConstraint = 1 kHorizontalConstraint = 2 k1MonochromePixelFormat = 0x00000001 k2IndexedPixelFormat = 0x00000002 k4IndexedPixelFormat = 0x00000004 k8IndexedPixelFormat = 0x00000008 k16BE555PixelFormat = 0x00000010 k24RGBPixelFormat = 0x00000018 k32ARGBPixelFormat = 0x00000020 k1IndexedGrayPixelFormat = 0x00000021 k2IndexedGrayPixelFormat = 0x00000022 k4IndexedGrayPixelFormat = 0x00000024 k8IndexedGrayPixelFormat = 0x00000028 k16LE555PixelFormat = FOUR_CHAR_CODE('L555') k16LE5551PixelFormat = FOUR_CHAR_CODE('5551') k16BE565PixelFormat = FOUR_CHAR_CODE('B565') k16LE565PixelFormat = FOUR_CHAR_CODE('L565') k24BGRPixelFormat = FOUR_CHAR_CODE('24BG') k32BGRAPixelFormat = FOUR_CHAR_CODE('BGRA') k32ABGRPixelFormat = FOUR_CHAR_CODE('ABGR') k32RGBAPixelFormat = FOUR_CHAR_CODE('RGBA') kYUVSPixelFormat = FOUR_CHAR_CODE('yuvs') kYUVUPixelFormat = FOUR_CHAR_CODE('yuvu') kYVU9PixelFormat = FOUR_CHAR_CODE('YVU9') kYUV411PixelFormat = FOUR_CHAR_CODE('Y411') kYVYU422PixelFormat = FOUR_CHAR_CODE('YVYU') kUYVY422PixelFormat = FOUR_CHAR_CODE('UYVY') kYUV211PixelFormat = FOUR_CHAR_CODE('Y211') kCursorImageMajorVersion = 0x0001 kCursorImageMinorVersion = 0x0000 kQDParseRegionFromTop = (1 << 0) kQDParseRegionFromBottom = (1 << 1) kQDParseRegionFromLeft = (1 << 2) kQDParseRegionFromRight = (1 << 3) kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft kQDParseRegionFromBottomRight = kQDParseRegionFromBottom | kQDParseRegionFromRight kQDRegionToRectsMsgInit = 1 kQDRegionToRectsMsgParse = 2 kQDRegionToRectsMsgTerminate = 3 colorXorXFer = 52 noiseXFer = 53 customXFer = 54 kXFer1PixelAtATime = 0x00000001 kXFerConvertPixelToRGB32 = 0x00000002 kCursorComponentsVersion = 0x00010001 kCursorComponentType = FOUR_CHAR_CODE('curs') cursorDoesAnimate = 1L << 0 cursorDoesHardware = 1L << 1 cursorDoesUnreadableScreenBits = 1L << 2 kRenderCursorInHardware = 1L << 0 kRenderCursorInSoftware = 1L << 1 kCursorComponentInit = 0x0001 kCursorComponentGetInfo = 0x0002 kCursorComponentSetOutputMode = 0x0003 kCursorComponentSetData = 0x0004 kCursorComponentReconfigure = 0x0005 kCursorComponentDraw = 0x0006 kCursorComponentErase = 0x0007 kCursorComponentMove = 0x0008 kCursorComponentAnimate = 0x0009 kCursorComponentLastReserved = 0x0050 # Generated from 'QuickDrawText.h' def FOUR_CHAR_CODE(x): return x normal = 0 bold = 1 italic = 2 underline = 4 outline = 8 shadow = 0x10 condense = 0x20 extend = 0x40 leftCaret = 0 rightCaret = -1 kHilite = 1 smLeftCaret = 0 smRightCaret = -1 smHilite = 1 onlyStyleRun = 0 leftStyleRun = 1 rightStyleRun = 2 middleStyleRun = 3 smOnlyStyleRun = 0 smLeftStyleRun = 1 smRightStyleRun = 2 smMiddleStyleRun = 3 tfAntiAlias = 1 << 0 tfUnicode = 1 << 1 --- NEW FILE: QuickTime.py --- # Generated from 'Movies.h' def FOUR_CHAR_CODE(x): return x MovieFileType = FOUR_CHAR_CODE('MooV') MovieScrapType = FOUR_CHAR_CODE('moov') MovieResourceType = FOUR_CHAR_CODE('moov') MovieForwardPointerResourceType = FOUR_CHAR_CODE('fore') MovieBackwardPointerResourceType = FOUR_CHAR_CODE('back') MovieResourceAtomType = FOUR_CHAR_CODE('moov') MovieDataAtomType = FOUR_CHAR_CODE('mdat') FreeAtomType = FOUR_CHAR_CODE('free') SkipAtomType = FOUR_CHAR_CODE('skip') WideAtomPlaceholderType = FOUR_CHAR_CODE('wide') MediaHandlerType = FOUR_CHAR_CODE('mhlr') DataHandlerType = FOUR_CHAR_CODE('dhlr') VideoMediaType = FOUR_CHAR_CODE('vide') SoundMediaType = FOUR_CHAR_CODE('soun') TextMediaType = FOUR_CHAR_CODE('text') BaseMediaType = FOUR_CHAR_CODE('gnrc') MPEGMediaType = FOUR_CHAR_CODE('MPEG') MusicMediaType = FOUR_CHAR_CODE('musi') TimeCodeMediaType = FOUR_CHAR_CODE('tmcd') SpriteMediaType = FOUR_CHAR_CODE('sprt') FlashMediaType = FOUR_CHAR_CODE('flsh') MovieMediaType = FOUR_CHAR_CODE('moov') TweenMediaType = FOUR_CHAR_CODE('twen') ThreeDeeMediaType = FOUR_CHAR_CODE('qd3d') HandleDataHandlerSubType = FOUR_CHAR_CODE('hndl') ResourceDataHandlerSubType = FOUR_CHAR_CODE('rsrc') URLDataHandlerSubType = FOUR_CHAR_CODE('url ') WiredActionHandlerType = FOUR_CHAR_CODE('wire') VisualMediaCharacteristic = FOUR_CHAR_CODE('eyes') AudioMediaCharacteristic = FOUR_CHAR_CODE('ears') kCharacteristicCanSendVideo = FOUR_CHAR_CODE('vsnd') kCharacteristicProvidesActions = FOUR_CHAR_CODE('actn') kCharacteristicNonLinear = FOUR_CHAR_CODE('nonl') kCharacteristicCanStep = FOUR_CHAR_CODE('step') kCharacteristicHasNoDuration = FOUR_CHAR_CODE('noti') kUserDataMovieControllerType = FOUR_CHAR_CODE('ctyp') kUserDataName = FOUR_CHAR_CODE('name') kUserDataTextAuthor = FOUR_CHAR_CODE('©aut') kUserDataTextComment = FOUR_CHAR_CODE('©cmt') kUserDataTextCopyright = FOUR_CHAR_CODE('©cpy') kUserDataTextCreationDate = FOUR_CHAR_CODE('©day') kUserDataTextDescription = FOUR_CHAR_CODE('©des') kUserDataTextDirector = FOUR_CHAR_CODE('©dir') kUserDataTextDisclaimer = FOUR_CHAR_CODE('©dis') kUserDataTextFullName = FOUR_CHAR_CODE('©nam') kUserDataTextHostComputer = FOUR_CHAR_CODE('©hst') kUserDataTextInformation = FOUR_CHAR_CODE('©inf') kUserDataTextKeywords = FOUR_CHAR_CODE('©key') kUserDataTextMake = FOUR_CHAR_CODE('©mak') kUserDataTextModel = FOUR_CHAR_CODE('©mod') kUserDataTextOriginalFormat = FOUR_CHAR_CODE('©fmt') kUserDataTextOriginalSource = FOUR_CHAR_CODE('©src') kUserDataTextPerformers = FOUR_CHAR_CODE('©prf') kUserDataTextProducer = FOUR_CHAR_CODE('©prd') kUserDataTextProduct = FOUR_CHAR_CODE('©PRD') kUserDataTextSoftware = FOUR_CHAR_CODE('©swr') kUserDataTextSpecialPlaybackRequirements = FOUR_CHAR_CODE('©req') kUserDataTextWarning = FOUR_CHAR_CODE('©wrn') kUserDataTextWriter = FOUR_CHAR_CODE('©wrt') kUserDataTextEditDate1 = FOUR_CHAR_CODE('©ed1') kUserDataTextChapter = FOUR_CHAR_CODE('©chp') kUserDataUnicodeBit = 1L << 7 DoTheRightThing = 0 kMusicFlagDontPlay2Soft = 1L << 0 kMusicFlagDontSlaveToMovie = 1L << 1 dfDontDisplay = 1 << 0 dfDontAutoScale = 1 << 1 dfClipToTextBox = 1 << 2 dfUseMovieBGColor = 1 << 3 dfShrinkTextBoxToFit = 1 << 4 dfScrollIn = 1 << 5 dfScrollOut = 1 << 6 dfHorizScroll = 1 << 7 dfReverseScroll = 1 << 8 dfContinuousScroll = 1 << 9 dfFlowHoriz = 1 << 10 dfContinuousKaraoke = 1 << 11 dfDropShadow = 1 << 12 dfAntiAlias = 1 << 13 dfKeyedText = 1 << 14 dfInverseHilite = 1 << 15 dfTextColorHilite = 1 << 16 searchTextDontGoToFoundTime = 1L << 16 searchTextDontHiliteFoundText = 1L << 17 searchTextOneTrackOnly = 1L << 18 searchTextEnabledTracksOnly = 1L << 19 kTextTextHandle = 1 kTextTextPtr = 2 kTextTEStyle = 3 kTextSetSelection = 4 kTextBackColor = 5 kTextForeColor = 6 kTextFace = 7 kTextFont = 8 kTextSize = 9 kTextAlignment = 10 kTextHilite = 11 kTextDropShadow = 12 kTextDisplayFlags = 13 kTextScroll = 14 k3DMediaRendererEntry = FOUR_CHAR_CODE('rend') k3DMediaRendererName = FOUR_CHAR_CODE('name') k3DMediaRendererCode = FOUR_CHAR_CODE('rcod') movieProgressOpen = 0 movieProgressUpdatePercent = 1 movieProgressClose = 2 progressOpFlatten = 1 progressOpInsertTrackSegment = 2 progressOpInsertMovieSegment = 3 progressOpPaste = 4 progressOpAddMovieSelection = 5 progressOpCopy = 6 progressOpCut = 7 progressOpLoadMovieIntoRam = 8 progressOpLoadTrackIntoRam = 9 progressOpLoadMediaIntoRam = 10 progressOpImportMovie = 11 progressOpExportMovie = 12 mediaQualityDraft = 0x0000 mediaQualityNormal = 0x0040 mediaQualityBetter = 0x0080 mediaQualityBest = 0x00C0 kActionMovieSetVolume = 1024 kActionMovieSetRate = 1025 kActionMovieSetLoopingFlags = 1026 kActionMovieGoToTime = 1027 kActionMovieGoToTimeByName = 1028 kActionMovieGoToBeginning = 1029 kActionMovieGoToEnd = 1030 kActionMovieStepForward = 1031 kActionMovieStepBackward = 1032 kActionMovieSetSelection = 1033 kActionMovieSetSelectionByName = 1034 kActionMoviePlaySelection = 1035 kActionMovieSetLanguage = 1036 kActionMovieChanged = 1037 kActionMovieRestartAtTime = 1038 kActionTrackSetVolume = 2048 kActionTrackSetBalance = 2049 kActionTrackSetEnabled = 2050 kActionTrackSetMatrix = 2051 kActionTrackSetLayer = 2052 kActionTrackSetClip = 2053 kActionTrackSetCursor = 2054 kActionTrackSetGraphicsMode = 2055 kActionSpriteSetMatrix = 3072 kActionSpriteSetImageIndex = 3073 kActionSpriteSetVisible = 3074 kActionSpriteSetLayer = 3075 kActionSpriteSetGraphicsMode = 3076 kActionSpritePassMouseToCodec = 3078 kActionSpriteClickOnCodec = 3079 kActionSpriteTranslate = 3080 kActionSpriteScale = 3081 kActionSpriteRotate = 3082 kActionSpriteStretch = 3083 kActionQTVRSetPanAngle = 4096 kActionQTVRSetTiltAngle = 4097 kActionQTVRSetFieldOfView = 4098 kActionQTVRShowDefaultView = 4099 kActionQTVRGoToNodeID = 4100 kActionMusicPlayNote = 5120 kActionMusicSetController = 5121 kActionCase = 6144 kActionWhile = 6145 kActionGoToURL = 6146 kActionSendQTEventToSprite = 6147 kActionDebugStr = 6148 kActionPushCurrentTime = 6149 kActionPushCurrentTimeWithLabel = 6150 kActionPopAndGotoTopTime = 6151 kActionPopAndGotoLabeledTime = 6152 kActionStatusString = 6153 kActionSendQTEventToTrackObject = 6154 kActionAddChannelSubscription = 6155 kActionRemoveChannelSubscription = 6156 kActionOpenCustomActionHandler = 6157 kActionDoScript = 6158 kActionSpriteTrackSetVariable = 7168 kActionSpriteTrackNewSprite = 7169 kActionSpriteTrackDisposeSprite = 7170 kActionSpriteTrackSetVariableToString = 7171 kActionSpriteTrackConcatVariables = 7172 kActionSpriteTrackSetVariableToMovieURL = 7173 kActionSpriteTrackSetVariableToMovieBaseURL = 7174 kActionApplicationNumberAndString = 8192 kActionQD3DNamedObjectTranslateTo = 9216 kActionQD3DNamedObjectScaleTo = 9217 kActionQD3DNamedObjectRotateTo = 9218 kActionFlashTrackSetPan = 10240 kActionFlashTrackSetZoom = 10241 kActionFlashTrackSetZoomRect = 10242 kActionFlashTrackGotoFrameNumber = 10243 kActionFlashTrackGotoFrameLabel = 10244 kActionMovieTrackAddChildMovie = 11264 kActionMovieTrackLoadChildMovie = 11265 kOperandExpression = 1 kOperandConstant = 2 kOperandSubscribedToChannel = 3 kOperandUniqueCustomActionHandlerID = 4 kOperandCustomActionHandlerIDIsOpen = 5 kOperandConnectionSpeed = 6 kOperandGMTDay = 7 kOperandGMTMonth = 8 kOperandGMTYear = 9 kOperandGMTHours = 10 kOperandGMTMinutes = 11 kOperandGMTSeconds = 12 kOperandLocalDay = 13 kOperandLocalMonth = 14 kOperandLocalYear = 15 kOperandLocalHours = 16 kOperandLocalMinutes = 17 kOperandLocalSeconds = 18 kOperandRegisteredForQuickTimePro = 19 kOperandPlatformRunningOn = 20 kOperandQuickTimeVersion = 21 kOperandComponentVersion = 22 kOperandOriginalHandlerRefcon = 23 kOperandTicks = 24 kOperandMaxLoadedTimeInMovie = 25 kOperandMovieVolume = 1024 kOperandMovieRate = 1025 kOperandMovieIsLooping = 1026 kOperandMovieLoopIsPalindrome = 1027 kOperandMovieTime = 1028 kOperandTrackVolume = 2048 kOperandTrackBalance = 2049 kOperandTrackEnabled = 2050 kOperandTrackLayer = 2051 kOperandTrackWidth = 2052 kOperandTrackHeight = 2053 kOperandSpriteBoundsLeft = 3072 kOperandSpriteBoundsTop = 3073 kOperandSpriteBoundsRight = 3074 kOperandSpriteBoundsBottom = 3075 kOperandSpriteImageIndex = 3076 kOperandSpriteVisible = 3077 kOperandSpriteLayer = 3078 kOperandSpriteTrackVariable = 3079 kOperandSpriteTrackNumSprites = 3080 kOperandSpriteTrackNumImages = 3081 kOperandSpriteID = 3082 kOperandSpriteIndex = 3083 kOperandSpriteFirstCornerX = 3084 kOperandSpriteFirstCornerY = 3085 kOperandSpriteSecondCornerX = 3086 kOperandSpriteSecondCornerY = 3087 kOperandSpriteThirdCornerX = 3088 kOperandSpriteThirdCornerY = 3089 kOperandSpriteFourthCornerX = 3090 kOperandSpriteFourthCornerY = 3091 kOperandSpriteImageRegistrationPointX = 3092 kOperandSpriteImageRegistrationPointY = 3093 kOperandQTVRPanAngle = 4096 kOperandQTVRTiltAngle = 4097 kOperandQTVRFieldOfView = 4098 kOperandQTVRNodeID = 4099 kOperandMouseLocalHLoc = 5120 kOperandMouseLocalVLoc = 5121 kOperandKeyIsDown = 5122 kOperandRandom = 5123 kFirstMovieAction = kActionMovieSetVolume kLastMovieAction = kActionMovieRestartAtTime kFirstTrackAction = kActionTrackSetVolume kLastTrackAction = kActionTrackSetGraphicsMode kFirstSpriteAction = kActionSpriteSetMatrix kLastSpriteAction = kActionSpriteStretch kFirstQTVRAction = kActionQTVRSetPanAngle kLastQTVRAction = kActionQTVRGoToNodeID kFirstMusicAction = kActionMusicPlayNote kLastMusicAction = kActionMusicSetController kFirstSystemAction = kActionCase kLastSystemAction = kActionDoScript kFirstSpriteTrackAction = kActionSpriteTrackSetVariable kLastSpriteTrackAction = kActionSpriteTrackSetVariableToMovieBaseURL kFirstApplicationAction = kActionApplicationNumberAndString kLastApplicationAction = kActionApplicationNumberAndString kFirstQD3DNamedObjectAction = kActionQD3DNamedObjectTranslateTo kLastQD3DNamedObjectAction = kActionQD3DNamedObjectRotateTo kFirstFlashTrackAction = kActionFlashTrackSetPan kLastFlashTrackAction = kActionFlashTrackGotoFrameLabel kFirstMovieTrackAction = kActionMovieTrackAddChildMovie kLastMovieTrackAction = kActionMovieTrackLoadChildMovie kFirstAction = kFirstMovieAction kLastAction = kActionMovieTrackLoadChildMovie kTargetMovie = FOUR_CHAR_CODE('moov') kTargetMovieName = FOUR_CHAR_CODE('mona') kTargetMovieID = FOUR_CHAR_CODE('moid') kTargetRootMovie = FOUR_CHAR_CODE('moro') kTargetParentMovie = FOUR_CHAR_CODE('mopa') kTargetChildMovieTrackName = FOUR_CHAR_CODE('motn') kTargetChildMovieTrackID = FOUR_CHAR_CODE('moti') kTargetChildMovieTrackIndex = FOUR_CHAR_CODE('motx') kTargetChildMovieMovieName = FOUR_CHAR_CODE('momn') kTargetChildMovieMovieID = FOUR_CHAR_CODE('momi') kTargetTrackName = FOUR_CHAR_CODE('trna') kTargetTrackID = FOUR_CHAR_CODE('trid') kTargetTrackType = FOUR_CHAR_CODE('trty') kTargetTrackIndex = FOUR_CHAR_CODE('trin') kTargetSpriteName = FOUR_CHAR_CODE('spna') kTargetSpriteID = FOUR_CHAR_CODE('spid') kTargetSpriteIndex = FOUR_CHAR_CODE('spin') kTargetQD3DNamedObjectName = FOUR_CHAR_CODE('nana') kQTEventType = FOUR_CHAR_CODE('evnt') kAction = FOUR_CHAR_CODE('actn') kWhichAction = FOUR_CHAR_CODE('whic') kActionParameter = FOUR_CHAR_CODE('parm') kActionTarget = FOUR_CHAR_CODE('targ') kActionFlags = FOUR_CHAR_CODE('flag') kActionParameterMinValue = FOUR_CHAR_CODE('minv') kActionParameterMaxValue = FOUR_CHAR_CODE('maxv') kActionListAtomType = FOUR_CHAR_CODE('list') kExpressionContainerAtomType = FOUR_CHAR_CODE('expr') kConditionalAtomType = FOUR_CHAR_CODE('test') kOperatorAtomType = FOUR_CHAR_CODE('oper') kOperandAtomType = FOUR_CHAR_CODE('oprn') kCommentAtomType = FOUR_CHAR_CODE('why ') kCustomActionHandler = FOUR_CHAR_CODE('cust') kCustomHandlerID = FOUR_CHAR_CODE('id ') kCustomHandlerDesc = FOUR_CHAR_CODE('desc') kQTEventRecordAtomType = FOUR_CHAR_CODE('erec') kQTEventMouseClick = FOUR_CHAR_CODE('clik') kQTEventMouseClickEnd = FOUR_CHAR_CODE('cend') kQTEventMouseClickEndTriggerButton = FOUR_CHAR_CODE('trig') kQTEventMouseEnter = FOUR_CHAR_CODE('entr') kQTEventMouseExit = FOUR_CHAR_CODE('exit') kQTEventMouseMoved = FOUR_CHAR_CODE('move') kQTEventFrameLoaded = FOUR_CHAR_CODE('fram') kQTEventIdle = FOUR_CHAR_CODE('idle') kQTEventKey = FOUR_CHAR_CODE('key ') kQTEventMovieLoaded = FOUR_CHAR_CODE('load') kQTEventRequestToModifyMovie = FOUR_CHAR_CODE('reqm') kActionFlagActionIsDelta = 1L << 1 kActionFlagParameterWrapsAround = 1L << 2 kActionFlagActionIsToggle = 1L << 3 kStatusStringIsURLLink = 1L << 1 kStatusStringIsStreamingStatus = 1L << 2 kStatusHasCodeNumber = 1L << 3 kStatusIsError = 1L << 4 kScriptIsUnknownType = 1L << 0 kScriptIsJavaScript = 1L << 1 kScriptIsLingoEvent = 1L << 2 kScriptIsVBEvent = 1L << 3 kScriptIsProjectorCommand = 1L << 4 kQTRegistrationDialogTimeOutFlag = 1 << 0 kQTRegistrationDialogShowDialog = 1 << 1 kQTRegistrationDialogForceDialog = 1 << 2 kOperatorAdd = FOUR_CHAR_CODE('add ') kOperatorSubtract = FOUR_CHAR_CODE('sub ') kOperatorMultiply = FOUR_CHAR_CODE('mult') kOperatorDivide = FOUR_CHAR_CODE('div ') kOperatorOr = FOUR_CHAR_CODE('or ') kOperatorAnd = FOUR_CHAR_CODE('and ') kOperatorNot = FOUR_CHAR_CODE('not ') kOperatorLessThan = FOUR_CHAR_CODE('< ') kOperatorLessThanEqualTo = FOUR_CHAR_CODE('<= ') kOperatorEqualTo = FOUR_CHAR_CODE('= ') kOperatorNotEqualTo = FOUR_CHAR_CODE('!= ') kOperatorGreaterThan = FOUR_CHAR_CODE('> ') kOperatorGreaterThanEqualTo = FOUR_CHAR_CODE('>= ') kOperatorModulo = FOUR_CHAR_CODE('mod ') kOperatorIntegerDivide = FOUR_CHAR_CODE('idiv') kOperatorAbsoluteValue = FOUR_CHAR_CODE('abs ') kOperatorNegate = FOUR_CHAR_CODE('neg ') kPlatformMacintosh = 1 kPlatformWindows = 2 kMediaPropertyNonLinearAtomType = FOUR_CHAR_CODE('nonl') kMediaPropertyHasActions = 105 loopTimeBase = 1 palindromeLoopTimeBase = 2 maintainTimeBaseZero = 4 triggerTimeFwd = 0x0001 triggerTimeBwd = 0x0002 triggerTimeEither = 0x0003 triggerRateLT = 0x0004 triggerRateGT = 0x0008 triggerRateEqual = 0x0010 triggerRateLTE = triggerRateLT | triggerRateEqual triggerRateGTE = triggerRateGT | triggerRateEqual triggerRateNotEqual = triggerRateGT | triggerRateEqual | triggerRateLT triggerRateChange = 0 triggerAtStart = 0x0001 triggerAtStop = 0x0002 timeBaseBeforeStartTime = 1 timeBaseAfterStopTime = 2 callBackAtTime = 1 callBackAtRate = 2 callBackAtTimeJump = 3 callBackAtExtremes = 4 callBackAtTimeBaseDisposed = 5 callBackAtInterrupt = 0x8000 callBackAtDeferredTask = 0x4000 qtcbNeedsRateChanges = 1 qtcbNeedsTimeChanges = 2 qtcbNeedsStartStopChanges = 4 keepInRam = 1 << 0 unkeepInRam = 1 << 1 flushFromRam = 1 << 2 loadForwardTrackEdits = 1 << 3 loadBackwardTrackEdits = 1 << 4 newMovieActive = 1 << 0 newMovieDontResolveDataRefs = 1 << 1 newMovieDontAskUnresolvedDataRefs = 1 << 2 newMovieDontAutoAlternates = 1 << 3 newMovieDontUpdateForeBackPointers = 1 << 4 newMovieDontAutoUpdateClock = 1 << 5 newMovieAsyncOK = 1 << 8 newMovieIdleImportOK = 1 << 10 trackUsageInMovie = 1 << 1 trackUsageInPreview = 1 << 2 trackUsageInPoster = 1 << 3 mediaSampleNotSync = 1 << 0 mediaSampleShadowSync = 1 << 1 pasteInParallel = 1 << 0 showUserSettingsDialog = 1 << 1 movieToFileOnlyExport = 1 << 2 movieFileSpecValid = 1 << 3 nextTimeMediaSample = 1 << 0 nextTimeMediaEdit = 1 << 1 nextTimeTrackEdit = 1 << 2 nextTimeSyncSample = 1 << 3 nextTimeStep = 1 << 4 nextTimeEdgeOK = 1 << 14 nextTimeIgnoreActiveSegment = 1 << 15 createMovieFileDeleteCurFile = 1L << 31 createMovieFileDontCreateMovie = 1L << 30 createMovieFileDontOpenFile = 1L << 29 createMovieFileDontCreateResFile = 1L << 28 flattenAddMovieToDataFork = 1L << 0 flattenActiveTracksOnly = 1L << 2 flattenDontInterleaveFlatten = 1L << 3 flattenFSSpecPtrIsDataRefRecordPtr = 1L << 4 flattenCompressMovieResource = 1L << 5 flattenForceMovieResourceBeforeMovieData = 1L << 6 movieInDataForkResID = -1 mcTopLeftMovie = 1 << 0 mcScaleMovieToFit = 1 << 1 mcWithBadge = 1 << 2 mcNotVisible = 1 << 3 mcWithFrame = 1 << 4 movieScrapDontZeroScrap = 1 << 0 movieScrapOnlyPutMovie = 1 << 1 dataRefSelfReference = 1 << 0 dataRefWasNotResolved = 1 << 1 kMovieAnchorDataRefIsDefault = 1 << 0 hintsScrubMode = 1 << 0 hintsLoop = 1 << 1 hintsDontPurge = 1 << 2 hintsUseScreenBuffer = 1 << 5 hintsAllowInterlace = 1 << 6 hintsUseSoundInterp = 1 << 7 hintsHighQuality = 1 << 8 hintsPalindrome = 1 << 9 hintsInactive = 1 << 11 hintsOffscreen = 1 << 12 hintsDontDraw = 1 << 13 hintsAllowBlacklining = 1 << 14 hintsDontUseVideoOverlaySurface = 1 << 16 hintsIgnoreBandwidthRestrictions = 1 << 17 hintsPlayingEveryFrame = 1 << 18 hintsAllowDynamicResize = 1 << 19 hintsSingleField = 1 << 20 mediaHandlerFlagBaseClient = 1 movieTrackMediaType = 1 << 0 movieTrackCharacteristic = 1 << 1 movieTrackEnabledOnly = 1 << 2 movieDrawingCallWhenChanged = 0 movieDrawingCallAlways = 1 kGetMovieImporterValidateToFind = 1L << 0 kGetMovieImporterAllowNewFile = 1L << 1 kGetMovieImporterDontConsiderGraphicsImporters = 1L << 2 kGetMovieImporterDontConsiderFileOnlyImporters = 1L << 6 kMovieLoadStateError = -1L kMovieLoadStateLoading = 1000 kMovieLoadStatePlayable = 10000 kMovieLoadStateComplete = 100000L preloadAlways = 1L << 0 preloadOnlyIfEnabled = 1L << 1 fullScreenHideCursor = 1L << 0 fullScreenAllowEvents = 1L << 1 fullScreenDontChangeMenuBar = 1L << 2 fullScreenPreflightSize = 1L << 3 movieExecuteWiredActionDontExecute = 1L << 0 kBackgroundSpriteLayerNum = 32767 kSpritePropertyMatrix = 1 kSpritePropertyImageDescription = 2 kSpritePropertyImageDataPtr = 3 kSpritePropertyVisible = 4 kSpritePropertyLayer = 5 kSpritePropertyGraphicsMode = 6 kSpritePropertyImageDataSize = 7 kSpritePropertyActionHandlingSpriteID = 8 kSpritePropertyImageIndex = 100 kSpriteTrackPropertyBackgroundColor = 101 kSpriteTrackPropertyOffscreenBitDepth = 102 kSpriteTrackPropertySampleFormat = 103 kSpriteTrackPropertyScaleSpritesToScaleWorld = 104 kSpriteTrackPropertyHasActions = 105 kSpriteTrackPropertyVisible = 106 kSpriteTrackPropertyQTIdleEventsFrequency = 107 kSpriteImagePropertyRegistrationPoint = 1000 kSpriteImagePropertyGroupID = 1001 kNoQTIdleEvents = -1 kOnlyDrawToSpriteWorld = 1L << 0 kSpriteWorldPreflight = 1L << 1 kSpriteWorldDidDraw = 1L << 0 kSpriteWorldNeedsToDraw = 1L << 1 kKeyFrameAndSingleOverride = 1L << 1 kKeyFrameAndAllOverrides = 1L << 2 kScaleSpritesToScaleWorld = 1L << 1 kSpriteWorldHighQuality = 1L << 2 kSpriteWorldDontAutoInvalidate = 1L << 3 kSpriteWorldInvisible = 1L << 4 kParentAtomIsContainer = 0 kEffectNameAtom = FOUR_CHAR_CODE('name') kEffectTypeAtom = FOUR_CHAR_CODE('type') kEffectManufacturerAtom = FOUR_CHAR_CODE('manu') pdActionConfirmDialog = 1 pdActionSetAppleMenu = 2 pdActionSetEditMenu = 3 pdActionGetDialogValues = 4 pdActionSetPreviewUserItem = 5 pdActionSetPreviewPicture = 6 pdActionSetColorPickerEventProc = 7 pdActionSetDialogTitle = 8 pdActionGetSubPanelMenu = 9 pdActionActivateSubPanel = 10 pdActionConductStopAlert = 11 pdActionModelessCallback = 12 pdActionFetchPreview = 13 elOptionsIncludeNoneInList = 0x00000001 pdOptionsCollectOneValue = 0x00000001 pdOptionsAllowOptionalInterpolations = 0x00000002 pdOptionsModalDialogBox = 0x00000004 effectIsRealtime = 0 kAccessKeyAtomType = FOUR_CHAR_CODE('acky') kAccessKeySystemFlag = 1L << 0 ConnectionSpeedPrefsType = FOUR_CHAR_CODE('cspd') BandwidthManagementPrefsType = FOUR_CHAR_CODE('bwmg') kQTIdlePriority = 10 kQTNonRealTimePriority = 20 kQTRealTimeSharedPriority = 25 kQTRealTimePriority = 30 kQTBandwidthNotifyNeedToStop = 1L << 0 kQTBandwidthNotifyGoodToGo = 1L << 1 kQTBandwidthChangeRequest = 1L << 2 kQTBandwidthQueueRequest = 1L << 3 kQTBandwidthScheduledRequest = 1L << 4 kQTBandwidthVoluntaryRelease = 1L << 5 kITextRemoveEverythingBut = 0 << 1 kITextRemoveLeaveSuggestedAlternate = 1 << 1 kITextAtomType = FOUR_CHAR_CODE('itxt') kITextStringAtomType = FOUR_CHAR_CODE('text') kQTParseTextHREFText = FOUR_CHAR_CODE('text') kQTParseTextHREFBaseURL = FOUR_CHAR_CODE('burl') kQTParseTextHREFClickPoint = FOUR_CHAR_CODE('clik') kQTParseTextHREFUseAltDelim = FOUR_CHAR_CODE('altd') kQTParseTextHREFDelimiter = FOUR_CHAR_CODE('delm') kQTParseTextHREFRecomposeHREF = FOUR_CHAR_CODE('rhrf') kQTParseTextHREFURL = FOUR_CHAR_CODE('url ') kQTParseTextHREFTarget = FOUR_CHAR_CODE('targ') kQTParseTextHREFIsAutoHREF = FOUR_CHAR_CODE('auto') kQTParseTextHREFIsServerMap = FOUR_CHAR_CODE('smap') kQTParseTextHREFHREF = FOUR_CHAR_CODE('href') kTrackReferenceChapterList = FOUR_CHAR_CODE('chap') kTrackReferenceTimeCode = FOUR_CHAR_CODE('tmcd') kTrackReferenceModifier = FOUR_CHAR_CODE('ssrc') kTrackModifierInput = 0x696E kTrackModifierType = 0x7479 kTrackModifierReference = FOUR_CHAR_CODE('ssrc') kTrackModifierObjectID = FOUR_CHAR_CODE('obid') kTrackModifierInputName = FOUR_CHAR_CODE('name') kInputMapSubInputID = FOUR_CHAR_CODE('subi') kTrackModifierTypeMatrix = 1 kTrackModifierTypeClip = 2 kTrackModifierTypeGraphicsMode = 5 kTrackModifierTypeVolume = 3 kTrackModifierTypeBalance = 4 kTrackModifierTypeImage = FOUR_CHAR_CODE('vide') kTrackModifierObjectMatrix = 6 kTrackModifierObjectGraphicsMode = 7 kTrackModifierType3d4x4Matrix = 8 kTrackModifierCameraData = 9 kTrackModifierSoundLocalizationData = 10 kTrackModifierObjectImageIndex = 11 kTrackModifierObjectLayer = 12 kTrackModifierObjectVisible = 13 kTrackModifierAngleAspectCamera = 14 kTrackModifierPanAngle = FOUR_CHAR_CODE('pan ') kTrackModifierTiltAngle = FOUR_CHAR_CODE('tilt') kTrackModifierVerticalFieldOfViewAngle = FOUR_CHAR_CODE('fov ') kTrackModifierObjectQTEventSend = FOUR_CHAR_CODE('evnt') kTweenTypeShort = 1 kTweenTypeLong = 2 kTweenTypeFixed = 3 kTweenTypePoint = 4 kTweenTypeQDRect = 5 kTweenTypeQDRegion = 6 kTweenTypeMatrix = 7 kTweenTypeRGBColor = 8 kTweenTypeGraphicsModeWithRGBColor = 9 kTweenTypeQTFloatSingle = 10 kTweenTypeQTFloatDouble = 11 kTweenTypeFixedPoint = 12 kTweenType3dScale = FOUR_CHAR_CODE('3sca') kTweenType3dTranslate = FOUR_CHAR_CODE('3tra') kTweenType3dRotate = FOUR_CHAR_CODE('3rot') kTweenType3dRotateAboutPoint = FOUR_CHAR_CODE('3rap') kTweenType3dRotateAboutAxis = FOUR_CHAR_CODE('3rax') kTweenType3dRotateAboutVector = FOUR_CHAR_CODE('3rvc') kTweenType3dQuaternion = FOUR_CHAR_CODE('3qua') kTweenType3dMatrix = FOUR_CHAR_CODE('3mat') kTweenType3dCameraData = FOUR_CHAR_CODE('3cam') kTweenType3dAngleAspectCameraData = FOUR_CHAR_CODE('3caa') kTweenType3dSoundLocalizationData = FOUR_CHAR_CODE('3slc') kTweenTypePathToMatrixTranslation = FOUR_CHAR_CODE('gxmt') kTweenTypePathToMatrixRotation = FOUR_CHAR_CODE('gxpr') kTweenTypePathToMatrixTranslationAndRotation = FOUR_CHAR_CODE('gxmr') kTweenTypePathToFixedPoint = FOUR_CHAR_CODE('gxfp') kTweenTypePathXtoY = FOUR_CHAR_CODE('gxxy') kTweenTypePathYtoX = FOUR_CHAR_CODE('gxyx') kTweenTypeAtomList = FOUR_CHAR_CODE('atom') kTweenTypePolygon = FOUR_CHAR_CODE('poly') kTweenTypeMultiMatrix = FOUR_CHAR_CODE('mulm') kTweenTypeSpin = FOUR_CHAR_CODE('spin') kTweenType3dMatrixNonLinear = FOUR_CHAR_CODE('3nlr') kTweenType3dVRObject = FOUR_CHAR_CODE('3vro') kTweenEntry = FOUR_CHAR_CODE('twen') kTweenData = FOUR_CHAR_CODE('data') kTweenType = FOUR_CHAR_CODE('twnt') kTweenStartOffset = FOUR_CHAR_CODE('twst') kTweenDuration = FOUR_CHAR_CODE('twdu') kTweenFlags = FOUR_CHAR_CODE('flag') kTweenOutputMin = FOUR_CHAR_CODE('omin') kTweenOutputMax = FOUR_CHAR_CODE('omax') kTweenSequenceElement = FOUR_CHAR_CODE('seqe') kTween3dInitialCondition = FOUR_CHAR_CODE('icnd') kTweenInterpolationID = FOUR_CHAR_CODE('intr') kTweenRegionData = FOUR_CHAR_CODE('qdrg') kTweenPictureData = FOUR_CHAR_CODE('PICT') kListElementType = FOUR_CHAR_CODE('type') kListElementDataType = FOUR_CHAR_CODE('daty') kNameAtom = FOUR_CHAR_CODE('name') kInitialRotationAtom = FOUR_CHAR_CODE('inro') kNonLinearTweenHeader = FOUR_CHAR_CODE('nlth') kTweenReturnDelta = 1L << 0 videoFlagDontLeanAhead = 1L << 0 txtProcDefaultDisplay = 0 txtProcDontDisplay = 1 txtProcDoDisplay = 2 findTextEdgeOK = 1 << 0 findTextCaseSensitive = 1 << 1 findTextReverseSearch = 1 << 2 findTextWrapAround = 1 << 3 findTextUseOffset = 1 << 4 dropShadowOffsetType = FOUR_CHAR_CODE('drpo') dropShadowTranslucencyType = FOUR_CHAR_CODE('drpt') spriteHitTestBounds = 1L << 0 spriteHitTestImage = 1L << 1 spriteHitTestInvisibleSprites = 1L << 2 spriteHitTestIsClick = 1L << 3 spriteHitTestLocInDisplayCoordinates = 1L << 4 kSpriteAtomType = FOUR_CHAR_CODE('sprt') kSpriteImagesContainerAtomType = FOUR_CHAR_CODE('imct') kSpriteImageAtomType = FOUR_CHAR_CODE('imag') kSpriteImageDataAtomType = FOUR_CHAR_CODE('imda') kSpriteImageDataRefAtomType = FOUR_CHAR_CODE('imre') kSpriteImageDataRefTypeAtomType = FOUR_CHAR_CODE('imrt') kSpriteImageGroupIDAtomType = FOUR_CHAR_CODE('imgr') kSpriteImageRegistrationAtomType = FOUR_CHAR_CODE('imrg') kSpriteImageDefaultImageIndexAtomType = FOUR_CHAR_CODE('defi') kSpriteSharedDataAtomType = FOUR_CHAR_CODE('dflt') kSpriteNameAtomType = FOUR_CHAR_CODE('name') kSpriteImageNameAtomType = FOUR_CHAR_CODE('name') kSpriteUsesImageIDsAtomType = FOUR_CHAR_CODE('uses') kSpriteBehaviorsAtomType = FOUR_CHAR_CODE('beha') kSpriteImageBehaviorAtomType = FOUR_CHAR_CODE('imag') kSpriteCursorBehaviorAtomType = FOUR_CHAR_CODE('crsr') kSpriteStatusStringsBehaviorAtomType = FOUR_CHAR_CODE('sstr') kSpriteVariablesContainerAtomType = FOUR_CHAR_CODE('vars') kSpriteStringVariableAtomType = FOUR_CHAR_CODE('strv') kSpriteFloatingPointVariableAtomType = FOUR_CHAR_CODE('flov') kMovieMediaDataReference = FOUR_CHAR_CODE('mmdr') kMovieMediaDefaultDataReferenceID = FOUR_CHAR_CODE('ddri') kMovieMediaSlaveTime = FOUR_CHAR_CODE('slti') kMovieMediaSlaveAudio = FOUR_CHAR_CODE('slau') kMovieMediaSlaveGraphicsMode = FOUR_CHAR_CODE('slgr') kMovieMediaAutoPlay = FOUR_CHAR_CODE('play') kMovieMediaLoop = FOUR_CHAR_CODE('loop') kMovieMediaUseMIMEType = FOUR_CHAR_CODE('mime') kMovieMediaTitle = FOUR_CHAR_CODE('titl') kMovieMediaAltText = FOUR_CHAR_CODE('altt') kMovieMediaClipBegin = FOUR_CHAR_CODE('clpb') kMovieMediaClipDuration = FOUR_CHAR_CODE('clpd') kMovieMediaRegionAtom = FOUR_CHAR_CODE('regi') kMovieMediaSlaveTrackDuration = FOUR_CHAR_CODE('sltr') kMovieMediaEnableFrameStepping = FOUR_CHAR_CODE('enfs') kMovieMediaBackgroundColor = FOUR_CHAR_CODE('bkcl') kMovieMediaFitNone = 0 kMovieMediaFitScroll = FOUR_CHAR_CODE('scro') kMovieMediaFitClipIfNecessary = FOUR_CHAR_CODE('hidd') kMovieMediaFitFill = FOUR_CHAR_CODE('fill') kMovieMediaFitMeet = FOUR_CHAR_CODE('meet') kMovieMediaFitSlice = FOUR_CHAR_CODE('slic') kMovieMediaSpatialAdjustment = FOUR_CHAR_CODE('fit ') kMovieMediaRectangleAtom = FOUR_CHAR_CODE('rect') kMovieMediaTop = FOUR_CHAR_CODE('top ') kMovieMediaLeft = FOUR_CHAR_CODE('left') kMovieMediaWidth = FOUR_CHAR_CODE('wd ') kMovieMediaHeight = FOUR_CHAR_CODE('ht ') kMoviePropertyDuration = FOUR_CHAR_CODE('dura') kMoviePropertyTimeScale = FOUR_CHAR_CODE('tims') kMoviePropertyTime = FOUR_CHAR_CODE('timv') kMoviePropertyNaturalBounds = FOUR_CHAR_CODE('natb') kMoviePropertyMatrix = FOUR_CHAR_CODE('mtrx') kMoviePropertyTrackList = FOUR_CHAR_CODE('tlst') kTrackPropertyMediaType = FOUR_CHAR_CODE('mtyp') kTrackPropertyInstantiation = FOUR_CHAR_CODE('inst') MovieControllerComponentType = FOUR_CHAR_CODE('play') kMovieControllerQTVRFlag = 1 << 0 kMovieControllerDontDisplayToUser = 1 << 1 mcActionIdle = 1 mcActionDraw = 2 mcActionActivate = 3 mcActionDeactivate = 4 mcActionMouseDown = 5 mcActionKey = 6 mcActionPlay = 8 mcActionGoToTime = 12 mcActionSetVolume = 14 mcActionGetVolume = 15 mcActionStep = 18 mcActionSetLooping = 21 mcActionGetLooping = 22 mcActionSetLoopIsPalindrome = 23 mcActionGetLoopIsPalindrome = 24 mcActionSetGrowBoxBounds = 25 mcActionControllerSizeChanged = 26 mcActionSetSelectionBegin = 29 mcActionSetSelectionDuration = 30 mcActionSetKeysEnabled = 32 mcActionGetKeysEnabled = 33 mcActionSetPlaySelection = 34 mcActionGetPlaySelection = 35 mcActionSetUseBadge = 36 mcActionGetUseBadge = 37 mcActionSetFlags = 38 mcActionGetFlags = 39 mcActionSetPlayEveryFrame = 40 mcActionGetPlayEveryFrame = 41 mcActionGetPlayRate = 42 mcActionShowBalloon = 43 mcActionBadgeClick = 44 mcActionMovieClick = 45 mcActionSuspend = 46 mcActionResume = 47 mcActionSetControllerKeysEnabled = 48 mcActionGetTimeSliderRect = 49 mcActionMovieEdited = 50 mcActionGetDragEnabled = 51 mcActionSetDragEnabled = 52 mcActionGetSelectionBegin = 53 mcActionGetSelectionDuration = 54 mcActionPrerollAndPlay = 55 mcActionGetCursorSettingEnabled = 56 mcActionSetCursorSettingEnabled = 57 mcActionSetColorTable = 58 mcActionLinkToURL = 59 mcActionCustomButtonClick = 60 mcActionForceTimeTableUpdate = 61 mcActionSetControllerTimeLimits = 62 mcActionExecuteAllActionsForQTEvent = 63 mcActionExecuteOneActionForQTEvent = 64 mcActionAdjustCursor = 65 mcActionUseTrackForTimeTable = 66 mcActionClickAndHoldPoint = 67 mcActionShowMessageString = 68 mcActionShowStatusString = 69 mcActionGetExternalMovie = 70 mcActionGetChapterTime = 71 mcActionPerformActionList = 72 mcActionEvaluateExpression = 73 mcActionFetchParameterAs = 74 mcActionGetCursorByID = 75 mcActionGetNextURL = 76 mcActionMovieChanged = 77 mcActionDoScript = 78 mcActionRestartAtTime = 79 mcActionGetIndChapter = 80 mcActionLinkToURLExtended = 81 mcFlagSuppressMovieFrame = 1 << 0 mcFlagSuppressStepButtons = 1 << 1 mcFlagSuppressSpeakerButton = 1 << 2 mcFlagsUseWindowPalette = 1 << 3 mcFlagsDontInvalidate = 1 << 4 mcFlagsUseCustomButton = 1 << 5 mcPositionDontInvalidate = 1 << 5 kMCIEEnabledButtonPicture = 1 kMCIEDisabledButtonPicture = 2 kMCIEDepressedButtonPicture = 3 kMCIEEnabledSizeBoxPicture = 4 kMCIEDisabledSizeBoxPicture = 5 kMCIEEnabledUnavailableButtonPicture = 6 kMCIEDisabledUnavailableButtonPicture = 7 kMCIESoundSlider = 128 kMCIESoundThumb = 129 kMCIEColorTable = 256 kMCIEIsFlatAppearance = 257 kMCIEDoButtonIconsDropOnDepress = 258 mcInfoUndoAvailable = 1 << 0 mcInfoCutAvailable = 1 << 1 mcInfoCopyAvailable = 1 << 2 mcInfoPasteAvailable = 1 << 3 mcInfoClearAvailable = 1 << 4 mcInfoHasSound = 1 << 5 mcInfoIsPlaying = 1 << 6 mcInfoIsLooping = 1 << 7 mcInfoIsInPalindrome = 1 << 8 mcInfoEditingEnabled = 1 << 9 mcInfoMovieIsInteractive = 1 << 10 mcMenuUndo = 1 mcMenuCut = 3 mcMenuCopy = 4 mcMenuPaste = 5 mcMenuClear = 6 kFetchAsBooleanPtr = 1 kFetchAsShortPtr = 2 kFetchAsLongPtr = 3 kFetchAsMatrixRecordPtr = 4 kFetchAsModifierTrackGraphicsModeRecord = 5 kFetchAsHandle = 6 kFetchAsStr255 = 7 kFetchAsFloatPtr = 8 kFetchAsPointPtr = 9 kFetchAsNewAtomContainer = 10 kFetchAsQTEventRecordPtr = 11 kFetchAsFixedPtr = 12 kFetchAsSetControllerValuePtr = 13 kFetchAsRgnHandle = 14 kFetchAsComponentDescriptionPtr = 15 kFetchAsCString = 16 kQTCursorOpenHand = -19183 kQTCursorClosedHand = -19182 kQTCursorPointingHand = -19181 kQTCursorRightArrow = -19180 kQTCursorLeftArrow = -19179 kQTCursorDownArrow = -19178 kQTCursorUpArrow = -19177 kQTCursorIBeam = -19176 kVideoMediaResetStatisticsSelect = 0x0105 kVideoMediaGetStatisticsSelect = 0x0106 kVideoMediaGetStallCountSelect = 0x010E kVideoMediaSetCodecParameterSelect = 0x010F kVideoMediaGetCodecParameterSelect = 0x0110 kTextMediaSetTextProcSelect = 0x0101 kTextMediaAddTextSampleSelect = 0x0102 kTextMediaAddTESampleSelect = 0x0103 kTextMediaAddHiliteSampleSelect = 0x0104 kTextMediaDrawRawSelect = 0x0109 kTextMediaSetTextPropertySelect = 0x010A kTextMediaRawSetupSelect = 0x010B kTextMediaRawIdleSelect = 0x010C kTextMediaFindNextTextSelect = 0x0105 kTextMediaHiliteTextSampleSelect = 0x0106 kTextMediaSetTextSampleDataSelect = 0x0107 kSpriteMediaSetPropertySelect = 0x0101 kSpriteMediaGetPropertySelect = 0x0102 kSpriteMediaHitTestSpritesSelect = 0x0103 kSpriteMediaCountSpritesSelect = 0x0104 kSpriteMediaCountImagesSelect = 0x0105 kSpriteMediaGetIndImageDescriptionSelect = 0x0106 kSpriteMediaGetDisplayedSampleNumberSelect = 0x0107 kSpriteMediaGetSpriteNameSelect = 0x0108 kSpriteMediaGetImageNameSelect = 0x0109 kSpriteMediaSetSpritePropertySelect = 0x010A kSpriteMediaGetSpritePropertySelect = 0x010B kSpriteMediaHitTestAllSpritesSelect = 0x010C kSpriteMediaHitTestOneSpriteSelect = 0x010D kSpriteMediaSpriteIndexToIDSelect = 0x010E kSpriteMediaSpriteIDToIndexSelect = 0x010F kSpriteMediaGetSpriteActionsForQTEventSelect = 0x0110 kSpriteMediaSetActionVariableSelect = 0x0111 kSpriteMediaGetActionVariableSelect = 0x0112 kSpriteMediaGetIndImagePropertySelect = 0x0113 kSpriteMediaNewSpriteSelect = 0x0114 kSpriteMediaDisposeSpriteSelect = 0x0115 kSpriteMediaSetActionVariableToStringSelect = 0x0116 kSpriteMediaGetActionVariableAsStringSelect = 0x0117 kFlashMediaSetPanSelect = 0x0101 kFlashMediaSetZoomSelect = 0x0102 kFlashMediaSetZoomRectSelect = 0x0103 kFlashMediaGetRefConBoundsSelect = 0x0104 kFlashMediaGetRefConIDSelect = 0x0105 kFlashMediaIDToRefConSelect = 0x0106 kFlashMediaGetDisplayedFrameNumberSelect = 0x0107 kFlashMediaFrameNumberToMovieTimeSelect = 0x0108 kFlashMediaFrameLabelToMovieTimeSelect = 0x0109 kMovieMediaGetChildDoMCActionCallbackSelect = 0x0102 kMovieMediaGetDoMCActionCallbackSelect = 0x0103 kMovieMediaGetCurrentMoviePropertySelect = 0x0104 kMovieMediaGetCurrentTrackPropertySelect = 0x0105 kMovieMediaGetChildMovieDataReferenceSelect = 0x0106 kMovieMediaSetChildMovieDataReferenceSelect = 0x0107 kMovieMediaLoadChildMovieFromDataReferenceSelect = 0x0108 kMedia3DGetNamedObjectListSelect = 0x0101 kMedia3DGetRendererListSelect = 0x0102 kMedia3DGetCurrentGroupSelect = 0x0103 kMedia3DTranslateNamedObjectToSelect = 0x0104 kMedia3DScaleNamedObjectToSelect = 0x0105 kMedia3DRotateNamedObjectToSelect = 0x0106 kMedia3DSetCameraDataSelect = 0x0107 kMedia3DGetCameraDataSelect = 0x0108 kMedia3DSetCameraAngleAspectSelect = 0x0109 kMedia3DGetCameraAngleAspectSelect = 0x010A kMedia3DSetCameraRangeSelect = 0x010D kMedia3DGetCameraRangeSelect = 0x010E kMedia3DGetViewObjectSelect = 0x010F kMCSetMovieSelect = 0x0002 kMCGetIndMovieSelect = 0x0005 kMCRemoveAllMoviesSelect = 0x0006 kMCRemoveAMovieSelect = 0x0003 kMCRemoveMovieSelect = 0x0006 kMCIsPlayerEventSelect = 0x0007 kMCSetActionFilterSelect = 0x0008 kMCDoActionSelect = 0x0009 kMCSetControllerAttachedSelect = 0x000A kMCIsControllerAttachedSelect = 0x000B kMCSetControllerPortSelect = 0x000C kMCGetControllerPortSelect = 0x000D kMCSetVisibleSelect = 0x000E kMCGetVisibleSelect = 0x000F kMCGetControllerBoundsRectSelect = 0x0010 kMCSetControllerBoundsRectSelect = 0x0011 kMCGetControllerBoundsRgnSelect = 0x0012 kMCGetWindowRgnSelect = 0x0013 kMCMovieChangedSelect = 0x0014 kMCSetDurationSelect = 0x0015 kMCGetCurrentTimeSelect = 0x0016 kMCNewAttachedControllerSelect = 0x0017 kMCDrawSelect = 0x0018 kMCActivateSelect = 0x0019 kMCIdleSelect = 0x001A kMCKeySelect = 0x001B kMCClickSelect = 0x001C kMCEnableEditingSelect = 0x001D kMCIsEditingEnabledSelect = 0x001E kMCCopySelect = 0x001F kMCCutSelect = 0x0020 kMCPasteSelect = 0x0021 kMCClearSelect = 0x0022 kMCUndoSelect = 0x0023 kMCPositionControllerSelect = 0x0024 kMCGetControllerInfoSelect = 0x0025 kMCSetClipSelect = 0x0028 kMCGetClipSelect = 0x0029 kMCDrawBadgeSelect = 0x002A kMCSetUpEditMenuSelect = 0x002B kMCGetMenuStringSelect = 0x002C kMCSetActionFilterWithRefConSelect = 0x002D kMCPtInControllerSelect = 0x002E kMCInvalidateSelect = 0x002F kMCAdjustCursorSelect = 0x0030 kMCGetInterfaceElementSelect = 0x0031 kMCGetDoActionsProcSelect = 0x0032 kMusicMediaGetIndexedTunePlayerSelect = 0x0101 --- NEW FILE: Resources.py --- # Generated from 'Resources.h' resSysHeap = 64 resPurgeable = 32 resLocked = 16 resProtected = 8 resPreload = 4 resChanged = 2 mapReadOnly = 128 mapCompact = 64 mapChanged = 32 resSysRefBit = 7 resSysHeapBit = 6 resPurgeableBit = 5 resLockedBit = 4 resProtectedBit = 3 resPreloadBit = 2 resChangedBit = 1 mapReadOnlyBit = 7 mapCompactBit = 6 mapChangedBit = 5 kResFileNotOpened = -1 kSystemResFile = 0 kRsrcChainBelowSystemMap = 0 kRsrcChainBelowApplicationMap = 1 kRsrcChainAboveApplicationMap = 2 kRsrcChainAboveAllMaps = 4 --- NEW FILE: Sound.py --- # Generated from 'Sound.h' def FOUR_CHAR_CODE(x): return x soundListRsrc = FOUR_CHAR_CODE('snd ') kSimpleBeepID = 1 # rate48khz = (long)0xBB800000 # rate44khz = (long)0xAC440000 rate32khz = 0x7D000000 rate22050hz = 0x56220000 rate22khz = 0x56EE8BA3 rate16khz = 0x3E800000 rate11khz = 0x2B7745D1 rate11025hz = 0x2B110000 rate8khz = 0x1F400000 sampledSynth = 5 squareWaveSynth = 1 waveTableSynth = 3 MACE3snthID = 11 MACE6snthID = 13 kMiddleC = 60 kNoVolume = 0 kFullVolume = 0x0100 stdQLength = 128 dataOffsetFlag = 0x8000 kUseOptionalOutputDevice = -1 notCompressed = 0 fixedCompression = -1 variableCompression = -2 twoToOne = 1 eightToThree = 2 threeToOne = 3 sixToOne = 4 sixToOnePacketSize = 8 threeToOnePacketSize = 16 stateBlockSize = 64 leftOverBlockSize = 32 firstSoundFormat = 0x0001 secondSoundFormat = 0x0002 dbBufferReady = 0x00000001 dbLastBuffer = 0x00000004 sysBeepDisable = 0x0000 sysBeepEnable = (1 << 0) sysBeepSynchronous = (1 << 1) unitTypeNoSelection = 0xFFFF unitTypeSeconds = 0x0000 stdSH = 0x00 extSH = 0xFF cmpSH = 0xFE nullCmd = 0 quietCmd = 3 flushCmd = 4 reInitCmd = 5 waitCmd = 10 pauseCmd = 11 resumeCmd = 12 callBackCmd = 13 syncCmd = 14 availableCmd = 24 versionCmd = 25 volumeCmd = 46 getVolumeCmd = 47 clockComponentCmd = 50 getClockComponentCmd = 51 scheduledSoundCmd = 52 linkSoundComponentsCmd = 53 soundCmd = 80 bufferCmd = 81 rateMultiplierCmd = 86 getRateMultiplierCmd = 87 initCmd = 1 freeCmd = 2 totalLoadCmd = 26 loadCmd = 27 freqDurationCmd = 40 restCmd = 41 freqCmd = 42 ampCmd = 43 timbreCmd = 44 getAmpCmd = 45 waveTableCmd = 60 phaseCmd = 61 rateCmd = 82 continueCmd = 83 doubleBufferCmd = 84 getRateCmd = 85 sizeCmd = 90 convertCmd = 91 waveInitChannelMask = 0x07 waveInitChannel0 = 0x04 waveInitChannel1 = 0x05 waveInitChannel2 = 0x06 waveInitChannel3 = 0x07 initChan0 = waveInitChannel0 initChan1 = waveInitChannel1 initChan2 = waveInitChannel2 initChan3 = waveInitChannel3 outsideCmpSH = 0 insideCmpSH = 1 aceSuccess = 0 aceMemFull = 1 aceNilBlock = 2 aceBadComp = 3 aceBadEncode = 4 aceBadDest = 5 aceBadCmd = 6 initChanLeft = 0x0002 initChanRight = 0x0003 initNoInterp = 0x0004 initNoDrop = 0x0008 initMono = 0x0080 initStereo = 0x00C0 initMACE3 = 0x0300 initMACE6 = 0x0400 initPanMask = 0x0003 initSRateMask = 0x0030 initStereoMask = 0x00C0 initCompMask = 0xFF00 siActiveChannels = FOUR_CHAR_CODE('chac') siActiveLevels = FOUR_CHAR_CODE('lmac') siAGCOnOff = FOUR_CHAR_CODE('agc ') siAsync = FOUR_CHAR_CODE('asyn') siAVDisplayBehavior = FOUR_CHAR_CODE('avdb') siChannelAvailable = FOUR_CHAR_CODE('chav') siCompressionAvailable = FOUR_CHAR_CODE('cmav') siCompressionChannels = FOUR_CHAR_CODE('cpct') siCompressionFactor = FOUR_CHAR_CODE('cmfa') siCompressionHeader = FOUR_CHAR_CODE('cmhd') siCompressionNames = FOUR_CHAR_CODE('cnam') siCompressionParams = FOUR_CHAR_CODE('evaw') siCompressionSampleRate = FOUR_CHAR_CODE('cprt') siCompressionType = FOUR_CHAR_CODE('comp') siContinuous = FOUR_CHAR_CODE('cont') siDecompressionParams = FOUR_CHAR_CODE('wave') siDeviceBufferInfo = FOUR_CHAR_CODE('dbin') siDeviceConnected = FOUR_CHAR_CODE('dcon') siDeviceIcon = FOUR_CHAR_CODE('icon') siDeviceName = FOUR_CHAR_CODE('name') siEQSpectrumBands = FOUR_CHAR_CODE('eqsb') siEQSpectrumLevels = FOUR_CHAR_CODE('eqlv') siEQSpectrumOnOff = FOUR_CHAR_CODE('eqlo') siEQToneControlGain = FOUR_CHAR_CODE('eqtg') siEQToneControlOnOff = FOUR_CHAR_CODE('eqtc') siHardwareBalance = FOUR_CHAR_CODE('hbal') siHardwareBalanceSteps = FOUR_CHAR_CODE('hbls') siHardwareBass = FOUR_CHAR_CODE('hbas') siHardwareBassSteps = FOUR_CHAR_CODE('hbst') siHardwareBusy = FOUR_CHAR_CODE('hwbs') siHardwareFormat = FOUR_CHAR_CODE('hwfm') siHardwareMute = FOUR_CHAR_CODE('hmut') siHardwareMuteNoPrefs = FOUR_CHAR_CODE('hmnp') siHardwareTreble = FOUR_CHAR_CODE('htrb') siHardwareTrebleSteps = FOUR_CHAR_CODE('hwts') siHardwareVolume = FOUR_CHAR_CODE('hvol') siHardwareVolumeSteps = FOUR_CHAR_CODE('hstp') siHeadphoneMute = FOUR_CHAR_CODE('pmut') siHeadphoneVolume = FOUR_CHAR_CODE('pvol') siHeadphoneVolumeSteps = FOUR_CHAR_CODE('hdst') siInputAvailable = FOUR_CHAR_CODE('inav') siInputGain = FOUR_CHAR_CODE('gain') siInputSource = FOUR_CHAR_CODE('sour') siInputSourceNames = FOUR_CHAR_CODE('snam') siLevelMeterOnOff = FOUR_CHAR_CODE('lmet') siModemGain = FOUR_CHAR_CODE('mgai') siMonitorAvailable = FOUR_CHAR_CODE('mnav') siMonitorSource = FOUR_CHAR_CODE('mons') siNumberChannels = FOUR_CHAR_CODE('chan') siOptionsDialog = FOUR_CHAR_CODE('optd') siOSTypeInputSource = FOUR_CHAR_CODE('inpt') siOSTypeInputAvailable = FOUR_CHAR_CODE('inav') siOutputDeviceName = FOUR_CHAR_CODE('onam') siPlayThruOnOff = FOUR_CHAR_CODE('plth') siPostMixerSoundComponent = FOUR_CHAR_CODE('psmx') siPreMixerSoundComponent = FOUR_CHAR_CODE('prmx') siQuality = FOUR_CHAR_CODE('qual') siRateMultiplier = FOUR_CHAR_CODE('rmul') siRecordingQuality = FOUR_CHAR_CODE('qual') siSampleRate = FOUR_CHAR_CODE('srat') siSampleRateAvailable = FOUR_CHAR_CODE('srav') siSampleSize = FOUR_CHAR_CODE('ssiz') siSampleSizeAvailable = FOUR_CHAR_CODE('ssav') siSetupCDAudio = FOUR_CHAR_CODE('sucd') siSetupModemAudio = FOUR_CHAR_CODE('sumd') siSlopeAndIntercept = FOUR_CHAR_CODE('flap') siSoundClock = FOUR_CHAR_CODE('sclk') siUseThisSoundClock = FOUR_CHAR_CODE('sclc') siSpeakerMute = FOUR_CHAR_CODE('smut') siSpeakerVolume = FOUR_CHAR_CODE('svol') siSSpCPULoadLimit = FOUR_CHAR_CODE('3dll') siSSpLocalization = FOUR_CHAR_CODE('3dif') siSSpSpeakerSetup = FOUR_CHAR_CODE('3dst') siStereoInputGain = FOUR_CHAR_CODE('sgai') siSubwooferMute = FOUR_CHAR_CODE('bmut') siTwosComplementOnOff = FOUR_CHAR_CODE('twos') siVolume = FOUR_CHAR_CODE('volu') siVoxRecordInfo = FOUR_CHAR_CODE('voxr') siVoxStopInfo = FOUR_CHAR_CODE('voxs') siWideStereo = FOUR_CHAR_CODE('wide') siSupportedExtendedFlags = FOUR_CHAR_CODE('exfl') siCloseDriver = FOUR_CHAR_CODE('clos') siInitializeDriver = FOUR_CHAR_CODE('init') siPauseRecording = FOUR_CHAR_CODE('paus') siUserInterruptProc = FOUR_CHAR_CODE('user') # kInvalidSource = (long)0xFFFFFFFF kNoSource = FOUR_CHAR_CODE('none') kCDSource = FOUR_CHAR_CODE('cd ') kExtMicSource = FOUR_CHAR_CODE('emic') kSoundInSource = FOUR_CHAR_CODE('sinj') kRCAInSource = FOUR_CHAR_CODE('irca') kTVFMTunerSource = FOUR_CHAR_CODE('tvfm') kDAVInSource = FOUR_CHAR_CODE('idav') kIntMicSource = FOUR_CHAR_CODE('imic') kMediaBaySource = FOUR_CHAR_CODE('mbay') kModemSource = FOUR_CHAR_CODE('modm') kPCCardSource = FOUR_CHAR_CODE('pcm ') kZoomVideoSource = FOUR_CHAR_CODE('zvpc') kDVDSource = FOUR_CHAR_CODE('dvda') kNoSoundComponentType = FOUR_CHAR_CODE('****') kSoundComponentType = FOUR_CHAR_CODE('sift') kSoundComponentPPCType = FOUR_CHAR_CODE('nift') kRate8SubType = FOUR_CHAR_CODE('ratb') kRate16SubType = FOUR_CHAR_CODE('ratw') kConverterSubType = FOUR_CHAR_CODE('conv') kSndSourceSubType = FOUR_CHAR_CODE('sour') kMixerType = FOUR_CHAR_CODE('mixr') kMixer8SubType = FOUR_CHAR_CODE('mixb') kMixer16SubType = FOUR_CHAR_CODE('mixw') kSoundInputDeviceType = FOUR_CHAR_CODE('sinp') kWaveInSubType = FOUR_CHAR_CODE('wavi') kWaveInSnifferSubType = FOUR_CHAR_CODE('wisn') kSoundOutputDeviceType = FOUR_CHAR_CODE('sdev') kClassicSubType = FOUR_CHAR_CODE('clas') kASCSubType = FOUR_CHAR_CODE('asc ') kDSPSubType = FOUR_CHAR_CODE('dsp ') kAwacsSubType = FOUR_CHAR_CODE('awac') kGCAwacsSubType = FOUR_CHAR_CODE('awgc') kSingerSubType = FOUR_CHAR_CODE('sing') kSinger2SubType = FOUR_CHAR_CODE('sng2') kWhitSubType = FOUR_CHAR_CODE('whit') kSoundBlasterSubType = FOUR_CHAR_CODE('sbls') kWaveOutSubType = FOUR_CHAR_CODE('wavo') kWaveOutSnifferSubType = FOUR_CHAR_CODE('wosn') kDirectSoundSubType = FOUR_CHAR_CODE('dsnd') kDirectSoundSnifferSubType = FOUR_CHAR_CODE('dssn') kUNIXsdevSubType = FOUR_CHAR_CODE('un1x') kUSBSubType = FOUR_CHAR_CODE('usb ') kBlueBoxSubType = FOUR_CHAR_CODE('bsnd') kSoundCompressor = FOUR_CHAR_CODE('scom') kSoundDecompressor = FOUR_CHAR_CODE('sdec') kAudioComponentType = FOUR_CHAR_CODE('adio') kAwacsPhoneSubType = FOUR_CHAR_CODE('hphn') kAudioVisionSpeakerSubType = FOUR_CHAR_CODE('telc') kAudioVisionHeadphoneSubType = FOUR_CHAR_CODE('telh') kPhilipsFaderSubType = FOUR_CHAR_CODE('tvav') kSGSToneSubType = FOUR_CHAR_CODE('sgs0') kSoundEffectsType = FOUR_CHAR_CODE('snfx') kEqualizerSubType = FOUR_CHAR_CODE('eqal') kSSpLocalizationSubType = FOUR_CHAR_CODE('snd3') kSoundNotCompressed = FOUR_CHAR_CODE('NONE') k8BitOffsetBinaryFormat = FOUR_CHAR_CODE('raw ') k16BitBigEndianFormat = FOUR_CHAR_CODE('twos') k16BitLittleEndianFormat = FOUR_CHAR_CODE('sowt') kFloat32Format = FOUR_CHAR_CODE('fl32') kFloat64Format = FOUR_CHAR_CODE('fl64') k24BitFormat = FOUR_CHAR_CODE('in24') k32BitFormat = FOUR_CHAR_CODE('in32') k32BitLittleEndianFormat = FOUR_CHAR_CODE('23ni') kMACE3Compression = FOUR_CHAR_CODE('MAC3') kMACE6Compression = FOUR_CHAR_CODE('MAC6') kCDXA4Compression = FOUR_CHAR_CODE('cdx4') kCDXA2Compression = FOUR_CHAR_CODE('cdx2') kIMACompression = FOUR_CHAR_CODE('ima4') kULawCompression = FOUR_CHAR_CODE('ulaw') kALawCompression = FOUR_CHAR_CODE('alaw') kMicrosoftADPCMFormat = 0x6D730002 kDVIIntelIMAFormat = 0x6D730011 kDVAudioFormat = FOUR_CHAR_CODE('dvca') kQDesignCompression = FOUR_CHAR_CODE('QDMC') kQUALCOMMCompression = FOUR_CHAR_CODE('Qclp') kOffsetBinary = k8BitOffsetBinaryFormat kTwosComplement = k16BitBigEndianFormat kLittleEndianFormat = k16BitLittleEndianFormat kMPEGLayer3Format = 0x6D730055 kFullMPEGLay3Format = FOUR_CHAR_CODE('.mp3') k16BitNativeEndianFormat = k16BitLittleEndianFormat k16BitNonNativeEndianFormat = k16BitBigEndianFormat k16BitNativeEndianFormat = k16BitBigEndianFormat k16BitNonNativeEndianFormat = k16BitLittleEndianFormat k8BitRawIn = (1 << 0) k8BitTwosIn = (1 << 1) k16BitIn = (1 << 2) kStereoIn = (1 << 3) k8BitRawOut = (1 << 8) k8BitTwosOut = (1 << 9) k16BitOut = (1 << 10) kStereoOut = (1 << 11) kReverse = (1L << 16) kRateConvert = (1L << 17) kCreateSoundSource = (1L << 18) kVMAwareness = (1L << 21) kHighQuality = (1L << 22) kNonRealTime = (1L << 23) kSourcePaused = (1 << 0) kPassThrough = (1L << 16) kNoSoundComponentChain = (1L << 17) kNoMixing = (1 << 0) kNoSampleRateConversion = (1 << 1) kNoSampleSizeConversion = (1 << 2) kNoSampleFormatConversion = (1 << 3) kNoChannelConversion = (1 << 4) kNoDecompression = (1 << 5) kNoVolumeConversion = (1 << 6) kNoRealtimeProcessing = (1 << 7) kScheduledSource = (1 << 8) kNonInterleavedBuffer = (1 << 9) kNonPagingMixer = (1 << 10) kSoundConverterMixer = (1 << 11) kPagingMixer = (1 << 12) kVMAwareMixer = (1 << 13) kExtendedSoundData = (1 << 14) kBestQuality = (1 << 0) kInputMask = 0x000000FF kOutputMask = 0x0000FF00 kOutputShift = 8 kActionMask = 0x00FF0000 kSoundComponentBits = 0x00FFFFFF kAudioFormatAtomType = FOUR_CHAR_CODE('frma') kAudioEndianAtomType = FOUR_CHAR_CODE('enda') kAudioVBRAtomType = FOUR_CHAR_CODE('vbra') kAudioTerminatorAtomType = 0 kAVDisplayHeadphoneRemove = 0 kAVDisplayHeadphoneInsert = 1 kAVDisplayPlainTalkRemove = 2 kAVDisplayPlainTalkInsert = 3 audioAllChannels = 0 audioLeftChannel = 1 audioRightChannel = 2 audioUnmuted = 0 audioMuted = 1 audioDoesMono = (1L << 0) audioDoesStereo = (1L << 1) audioDoesIndependentChannels = (1L << 2) siCDQuality = FOUR_CHAR_CODE('cd ') siBestQuality = FOUR_CHAR_CODE('best') siBetterQuality = FOUR_CHAR_CODE('betr') siGoodQuality = FOUR_CHAR_CODE('good') siNoneQuality = FOUR_CHAR_CODE('none') siDeviceIsConnected = 1 siDeviceNotConnected = 0 siDontKnowIfConnected = -1 siReadPermission = 0 siWritePermission = 1 kSoundConverterDidntFillBuffer = (1 << 0) kSoundConverterHasLeftOverData = (1 << 1) kExtendedSoundSampleCountNotValid = 1L << 0 kExtendedSoundBufferSizeValid = 1L << 1 kScheduledSoundDoScheduled = 1 << 0 kScheduledSoundDoCallBack = 1 << 1 kScheduledSoundExtendedHdr = 1 << 2 kSoundComponentInitOutputDeviceSelect = 0x0001 kSoundComponentSetSourceSelect = 0x0002 kSoundComponentGetSourceSelect = 0x0003 kSoundComponentGetSourceDataSelect = 0x0004 kSoundComponentSetOutputSelect = 0x0005 kSoundComponentAddSourceSelect = 0x0101 kSoundComponentRemoveSourceSelect = 0x0102 kSoundComponentGetInfoSelect = 0x0103 kSoundComponentSetInfoSelect = 0x0104 kSoundComponentStartSourceSelect = 0x0105 kSoundComponentStopSourceSelect = 0x0106 kSoundComponentPauseSourceSelect = 0x0107 kSoundComponentPlaySourceBufferSelect = 0x0108 kAudioGetVolumeSelect = 0x0000 kAudioSetVolumeSelect = 0x0001 kAudioGetMuteSelect = 0x0002 kAudioSetMuteSelect = 0x0003 kAudioSetToDefaultsSelect = 0x0004 kAudioGetInfoSelect = 0x0005 kAudioGetBassSelect = 0x0006 kAudioSetBassSelect = 0x0007 kAudioGetTrebleSelect = 0x0008 kAudioSetTrebleSelect = 0x0009 kAudioGetOutputDeviceSelect = 0x000A kAudioMuteOnEventSelect = 0x0081 kDelegatedSoundComponentSelectors = 0x0100 kSndInputReadAsyncSelect = 0x0001 kSndInputReadSyncSelect = 0x0002 kSndInputPauseRecordingSelect = 0x0003 kSndInputResumeRecordingSelect = 0x0004 kSndInputStopRecordingSelect = 0x0005 kSndInputGetStatusSelect = 0x0006 kSndInputGetDeviceInfoSelect = 0x0007 kSndInputSetDeviceInfoSelect = 0x0008 kSndInputInitHardwareSelect = 0x0009 --- NEW FILE: TextEdit.py --- # Generated from 'TextEdit.h' teJustLeft = 0 teJustCenter = 1 teJustRight = -1 teForceLeft = -2 teFlushDefault = 0 teCenter = 1 teFlushRight = -1 teFlushLeft = -2 fontBit = 0 faceBit = 1 sizeBit = 2 clrBit = 3 addSizeBit = 4 toggleBit = 5 doFont = 1 doFace = 2 doSize = 4 doColor = 8 doAll = 15 addSize = 16 doToggle = 32 EOLHook = 0 DRAWHook = 4 WIDTHHook = 8 HITTESTHook = 12 nWIDTHHook = 24 TextWidthHook = 28 intEOLHook = 0 intDrawHook = 1 intWidthHook = 2 intHitTestHook = 3 intNWidthHook = 6 intTextWidthHook = 7 intInlineInputTSMTEPreUpdateHook = 8 intInlineInputTSMTEPostUpdateHook = 9 teFAutoScroll = 0 teFTextBuffering = 1 teFOutlineHilite = 2 teFInlineInput = 3 teFUseWhiteBackground = 4 teFUseInlineInput = 5 teFInlineInputAutoScroll = 6 teBitClear = 0 teBitSet = 1 teBitTest = -1 teWordSelect = 4 teWordDrag = 8 teFromFind = 12 teFromRecal = 16 teFind = 0 teHighlight = 1 teDraw = -1 teCaret = -2 teFUseTextServices = 4 --- NEW FILE: Windows.py --- # Generated from 'MacWindows.h' def FOUR_CHAR_CODE(x): return x kAlertWindowClass = 1L kMovableAlertWindowClass = 2L kModalWindowClass = 3L kMovableModalWindowClass = 4L kFloatingWindowClass = 5L kDocumentWindowClass = 6L kDesktopWindowClass = 7L # kAllWindowClasses = (unsigned long)0xFFFFFFFF kWindowNoAttributes = 0L kWindowCloseBoxAttribute = (1L << 0) kWindowHorizontalZoomAttribute = (1L << 1) kWindowVerticalZoomAttribute = (1L << 2) kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute) kWindowCollapseBoxAttribute = (1L << 3) kWindowResizableAttribute = (1L << 4) kWindowSideTitlebarAttribute = (1L << 5) kWindowNoUpdatesAttribute = (1L << 16) kWindowNoActivatesAttribute = (1L << 17) kWindowNoBufferingAttribute = (1L << 20) kWindowHideOnSuspendAttribute = (1L << 24) kWindowStandardHandlerAttribute = (1L << 25) kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute) kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute) kWindowDefProcType = FOUR_CHAR_CODE('WDEF') kStandardWindowDefinition = 0 kRoundWindowDefinition = 1 kFloatingWindowDefinition = 124 kDocumentWindowVariantCode = 0 kModalDialogVariantCode = 1 kPlainDialogVariantCode = 2 kShadowDialogVariantCode = 3 kMovableModalDialogVariantCode = 5 kAlertVariantCode = 7 kMovableAlertVariantCode = 9 kSideFloaterVariantCode = 8 documentProc = 0 dBoxProc = 1 plainDBox = 2 altDBoxProc = 3 noGrowDocProc = 4 movableDBoxProc = 5 zoomDocProc = 8 zoomNoGrow = 12 floatProc = 1985 floatGrowProc = 1987 floatZoomProc = 1989 floatZoomGrowProc = 1991 floatSideProc = 1993 floatSideGrowProc = 1995 floatSideZoomProc = 1997 floatSideZoomGrowProc = 1999 rDocProc = 16 kWindowDocumentDefProcResID = 64 kWindowDialogDefProcResID = 65 kWindowUtilityDefProcResID = 66 kWindowUtilitySideTitleDefProcResID = 67 kWindowDocumentProc = 1024 kWindowGrowDocumentProc = 1025 kWindowVertZoomDocumentProc = 1026 kWindowVertZoomGrowDocumentProc = 1027 kWindowHorizZoomDocumentProc = 1028 kWindowHorizZoomGrowDocumentProc = 1029 kWindowFullZoomDocumentProc = 1030 kWindowFullZoomGrowDocumentProc = 1031 kWindowPlainDialogProc = 1040 kWindowShadowDialogProc = 1041 kWindowModalDialogProc = 1042 kWindowMovableModalDialogProc = 1043 kWindowAlertProc = 1044 kWindowMovableAlertProc = 1045 kWindowMovableModalGrowProc = 1046 kWindowFloatProc = 1057 kWindowFloatGrowProc = 1059 kWindowFloatVertZoomProc = 1061 kWindowFloatVertZoomGrowProc = 1063 kWindowFloatHorizZoomProc = 1065 kWindowFloatHorizZoomGrowProc = 1067 kWindowFloatFullZoomProc = 1069 kWindowFloatFullZoomGrowProc = 1071 kWindowFloatSideProc = 1073 kWindowFloatSideGrowProc = 1075 kWindowFloatSideVertZoomProc = 1077 kWindowFloatSideVertZoomGrowProc = 1079 kWindowFloatSideHorizZoomProc = 1081 kWindowFloatSideHorizZoomGrowProc = 1083 kWindowFloatSideFullZoomProc = 1085 kWindowFloatSideFullZoomGrowProc = 1087 kWindowNoPosition = 0x0000 kWindowDefaultPosition = 0x0000 kWindowCenterMainScreen = 0x280A kWindowAlertPositionMainScreen = 0x300A kWindowStaggerMainScreen = 0x380A kWindowCenterParentWindow = 0xA80A kWindowAlertPositionParentWindow = 0xB00A kWindowStaggerParentWindow = 0xB80A kWindowCenterParentWindowScreen = 0x680A kWindowAlertPositionParentWindowScreen = 0x700A kWindowStaggerParentWindowScreen = 0x780A kWindowCenterOnMainScreen = 0x00000001 kWindowCenterOnParentWindow = 0x00000002 kWindowCenterOnParentWindowScreen = 0x00000003 kWindowCascadeOnMainScreen = 0x00000004 kWindowCascadeOnParentWindow = 0x00000005 kWindowCascadeOnParentWindowScreen = 0x00000006 kWindowAlertPositionOnMainScreen = 0x00000007 kWindowAlertPositionOnParentWindow = 0x00000008 kWindowAlertPositionOnParentWindowScreen = 0x00000009 kWindowTitleBarRgn = 0 kWindowTitleTextRgn = 1 kWindowCloseBoxRgn = 2 kWindowZoomBoxRgn = 3 kWindowDragRgn = 5 kWindowGrowRgn = 6 kWindowCollapseBoxRgn = 7 kWindowTitleProxyIconRgn = 8 kWindowStructureRgn = 32 kWindowContentRgn = 33 kWindowUpdateRgn = 34 kWindowGlobalPortRgn = 40 dialogKind = 2 userKind = 8 kDialogWindowKind = 2 kApplicationWindowKind = 8 inDesk = 0 inNoWindow = 0 inMenuBar = 1 inSysWindow = 2 inContent = 3 inDrag = 4 inGrow = 5 inGoAway = 6 inZoomIn = 7 inZoomOut = 8 inCollapseBox = 11 inProxyIcon = 12 wNoHit = 0 wInContent = 1 wInDrag = 2 wInGrow = 3 wInGoAway = 4 wInZoomIn = 5 wInZoomOut = 6 wInCollapseBox = 9 wInProxyIcon = 10 kWindowMsgDraw = 0 kWindowMsgHitTest = 1 kWindowMsgCalculateShape = 2 kWindowMsgInitialize = 3 kWindowMsgCleanUp = 4 kWindowMsgDrawGrowOutline = 5 kWindowMsgDrawGrowBox = 6 kWindowMsgGetFeatures = 7 kWindowMsgGetRegion = 8 kWindowMsgDragHilite = 9 kWindowMsgModified = 10 kWindowMsgDrawInCurrentPort = 11 kWindowMsgSetupProxyDragImage = 12 kWindowMsgStateChanged = 13 kWindowMsgMeasureTitle = 14 kWindowMsgGetGrowImageRegion = 19 wDraw = 0 wHit = 1 wCalcRgns = 2 wNew = 3 wDispose = 4 wGrow = 5 wDrawGIcon = 6 kWindowStateTitleChanged = (1 << 0) kWindowGrowSideTop = 0x01 kWindowGrowSideLeft = 0x02 kWindowGrowSideBottom = 0x04 kWindowGrowSideRight = 0x08 kWindowCanGrow = (1 << 0) kWindowCanZoom = (1 << 1) kWindowCanCollapse = (1 << 2) kWindowIsModal = (1 << 3) kWindowCanGetWindowRegion = (1 << 4) kWindowIsAlert = (1 << 5) kWindowHasTitleBar = (1 << 6) kWindowSupportsDragHilite = (1 << 7) kWindowSupportsModifiedBit = (1 << 8) kWindowCanDrawInCurrentPort = (1 << 9) kWindowCanSetupProxyDragImage = (1 << 10) kWindowCanMeasureTitle = (1 << 11) kWindowWantsDisposeAtProcessDeath = (1 << 12) kWindowSupportsSetGrowImageRegion = (1 << 13) kWindowDefSupportsColorGrafPort = 0x40000002 deskPatID = 16 wContentColor = 0 wFrameColor = 1 wTextColor = 2 wHiliteColor = 3 wTitleBarColor = 4 # kMouseUpOutOfSlop = (long)0x80008000 kWindowDefinitionVersionOne = 1 kWindowDefinitionVersionTwo = 2 kWindowIsCollapsedState = (1 << 0L) kStoredWindowSystemTag = FOUR_CHAR_CODE('appl') kStoredBasicWindowDescriptionID = FOUR_CHAR_CODE('sbas') kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255') kWindowDefProcPtr = 0 kWindowDefObjectClass = 1 kWindowPaintProcOptionsNone = 0 kScrollWindowNoOptions = 0 kScrollWindowInvalidate = (1L << 0) kScrollWindowEraseToPortBackground = (1L << 1) kWindowZoomTransitionEffect = 1 kWindowShowTransitionAction = 1 kWindowHideTransitionAction = 2 kWindowPropertyPersistent = 0x00000001 --- NEW FILE: __init__.py --- From gvanrossum@users.sourceforge.net Mon Aug 20 20:45:59 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 12:45:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc README,1.14,1.14.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv23153 Modified Files: Tag: r22a2-branch README Log Message: Merge trunk changes (track removal of NEXT-NOTES) Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/README,v retrieving revision 1.14 retrieving revision 1.14.10.1 diff -C2 -d -r1.14 -r1.14.10.1 *** README 2000/09/01 23:22:12 1.14 --- README 2001/08/20 19:45:55 1.14.10.1 *************** *** 21,25 **** Makefile.pre.in Generic Makefile template for building extensions NEWS News for this release - NEXT-NOTES Porting notes for NeXT PURIFY.README Information for Purify users Porting Mini-FAQ on porting to new platforms --- 21,24 ---- From gvanrossum@users.sourceforge.net Mon Aug 20 20:48:34 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 12:48:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.165,1.165.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv24215 Modified Files: Tag: r22a2-branch socketmodule.c Log Message: Merge Jeremy's trunk change Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.165 retrieving revision 1.165.2.1 diff -C2 -d -r1.165 -r1.165.2.1 *** socketmodule.c 2001/08/15 17:14:33 1.165 --- socketmodule.c 2001/08/20 19:48:32 1.165.2.1 *************** *** 1472,1476 **** return NULL; Py_BEGIN_ALLOW_THREADS ! n = recv(s->sock_fd, PyString_AsString(buf), len, flags); Py_END_ALLOW_THREADS if (n < 0) { --- 1472,1476 ---- return NULL; Py_BEGIN_ALLOW_THREADS ! n = recv(s->sock_fd, PyString_AS_STRING(buf), len, flags); Py_END_ALLOW_THREADS if (n < 0) { From jhylton@users.sourceforge.net Mon Aug 20 21:10:03 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 20 Aug 2001 13:10:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_os.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv1068 Modified Files: test_os.py Log Message: Silence warnings during test_os Index: test_os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_os.py 2001/07/21 01:41:30 1.3 --- test_os.py 2001/08/20 20:10:01 1.4 *************** *** 5,8 **** --- 5,9 ---- import os import unittest + import warnings from test_support import TESTFN, run_unittest *************** *** 30,33 **** --- 31,36 ---- if not hasattr(os, "tempnam"): return + warnings.filterwarnings("ignore", "tempnam", RuntimeWarning, + "test_os") self.check_tempfile(os.tempnam()) *************** *** 52,55 **** --- 55,60 ---- if not hasattr(os, "tmpnam"): return + warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning, + "test_os") self.check_tempfile(os.tmpnam()) From montanaro@users.sourceforge.net Mon Aug 20 21:28:00 2001 From: montanaro@users.sourceforge.net (Skip Montanaro) Date: Mon, 20 Aug 2001 13:28:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib threading.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv5936 Modified Files: threading.py Log Message: Added new BoundedSemaphore class. Closes bug 452836. Index: threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** threading.py 2001/08/19 05:53:47 1.16 --- threading.py 2001/08/20 20:27:58 1.17 *************** *** 285,288 **** --- 285,303 ---- + def BoundedSemaphore(*args, **kwargs): + return apply(_BoundedSemaphore, args, kwargs) + + class _BoundedSemaphore(_Semaphore): + """Semaphore that checks that # releases is <= # acquires""" + def __init__(self, value=1, verbose=None): + _Semaphore.__init__(self, value, verbose) + self._initial_value = value + + def release(self): + if self._Semaphore__value >= self._initial_value: + raise ValueError, "Semaphore released too many times" + return _Semaphore.release(self) + + def Event(*args, **kwargs): return apply(_Event, args, kwargs) From montanaro@users.sourceforge.net Mon Aug 20 21:28:51 2001 From: montanaro@users.sourceforge.net (Skip Montanaro) Date: Mon, 20 Aug 2001 13:28:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_threading.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv6210 Added Files: test_threading.py Log Message: add a few test cases for threading module. --- NEW FILE: test_threading.py --- # Very rudimentary test of threading module # Create a bunch of threads, let each do some work, wait until all are done from test_support import verbose import random import threading import time numtasks = 10 # no more than 3 of the 10 can run at once sema = threading.BoundedSemaphore(value=3) mutex = threading.RLock() running = 0 class TestThread(threading.Thread): def run(self): global running delay = random.random() * numtasks if verbose: print 'task', self.getName(), 'will run for', round(delay, 1), 'sec' sema.acquire() mutex.acquire() running = running + 1 if verbose: print running, 'tasks are running' mutex.release() time.sleep(delay) if verbose: print 'task', self.getName(), 'done' mutex.acquire() running = running - 1 if verbose: print self.getName(), 'is finished.', running, 'tasks are running' mutex.release() sema.release() threads = [] def starttasks(): for i in range(numtasks): t = TestThread(name=""%i) threads.append(t) t.start() starttasks() print 'waiting for all tasks to complete' for t in threads: t.join() print 'all tasks done' From bwarsaw@users.sourceforge.net Mon Aug 20 21:29:09 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 20 Aug 2001 13:29:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_class.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv6326 Modified Files: test_class.py Log Message: Committing and closing SF patch #403671 by Finn Bock to help Jython pass these tests. Index: test_class.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_class.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_class.py 2001/01/22 14:51:41 1.5 --- test_class.py 2001/08/20 20:29:07 1.6 *************** *** 52,56 **** # generic operations "init", - "del", ] --- 52,55 ---- *************** *** 87,90 **** --- 86,92 ---- return 0 + def __del__(self, *args): + print "__del__:", args + for method in testmeths: exec """def __%(method)s__(self, *args): *************** *** 162,169 **** del AllTests.__delslice__ ! testme[:42] ! testme[:42] = "The Answer" ! del testme[:42] ! # Unary operations --- 164,178 ---- del AllTests.__delslice__ ! import sys ! if sys.platform[:4] != 'java': ! testme[:42] ! testme[:42] = "The Answer" ! del testme[:42] ! else: ! # This works under Jython, but the actual slice values are ! # different. ! print "__getitem__: (slice(0, 42, None),)" ! print "__setitem__: (slice(0, 42, None), 'The Answer')" ! print "__delitem__: (slice(0, 42, None),)" # Unary operations *************** *** 172,180 **** +testme abs(testme) ! int(testme) ! long(testme) ! float(testme) ! oct(testme) ! hex(testme) --- 181,198 ---- +testme abs(testme) ! if sys.platform[:4] != 'java': ! int(testme) ! long(testme) ! float(testme) ! oct(testme) ! hex(testme) ! else: ! # Jython enforced that the these methods return ! # a value of the expected type. ! print "__int__: ()" ! print "__long__: ()" ! print "__float__: ()" ! print "__oct__: ()" ! print "__hex__: ()" *************** *** 199,203 **** del testme ! # Interfering tests --- 217,223 ---- del testme ! if sys.platform[:4] == 'java': ! import java ! java.lang.System.gc() # Interfering tests From bwarsaw@users.sourceforge.net Mon Aug 20 21:30:40 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 20 Aug 2001 13:30:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_class.py,1.5,1.5.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv6848 Modified Files: Tag: r22a2-branch test_class.py Log Message: Committing and closing SF patch #403671 by Finn Bock to help Jython pass these tests. Index: test_class.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_class.py,v retrieving revision 1.5 retrieving revision 1.5.10.1 diff -C2 -d -r1.5 -r1.5.10.1 *** test_class.py 2001/01/22 14:51:41 1.5 --- test_class.py 2001/08/20 20:30:38 1.5.10.1 *************** *** 52,56 **** # generic operations "init", - "del", ] --- 52,55 ---- *************** *** 87,90 **** --- 86,92 ---- return 0 + def __del__(self, *args): + print "__del__:", args + for method in testmeths: exec """def __%(method)s__(self, *args): *************** *** 162,169 **** del AllTests.__delslice__ ! testme[:42] ! testme[:42] = "The Answer" ! del testme[:42] ! # Unary operations --- 164,178 ---- del AllTests.__delslice__ ! import sys ! if sys.platform[:4] != 'java': ! testme[:42] ! testme[:42] = "The Answer" ! del testme[:42] ! else: ! # This works under Jython, but the actual slice values are ! # different. ! print "__getitem__: (slice(0, 42, None),)" ! print "__setitem__: (slice(0, 42, None), 'The Answer')" ! print "__delitem__: (slice(0, 42, None),)" # Unary operations *************** *** 172,180 **** +testme abs(testme) ! int(testme) ! long(testme) ! float(testme) ! oct(testme) ! hex(testme) --- 181,198 ---- +testme abs(testme) ! if sys.platform[:4] != 'java': ! int(testme) ! long(testme) ! float(testme) ! oct(testme) ! hex(testme) ! else: ! # Jython enforced that the these methods return ! # a value of the expected type. ! print "__int__: ()" ! print "__long__: ()" ! print "__float__: ()" ! print "__oct__: ()" ! print "__hex__: ()" *************** *** 199,203 **** del testme ! # Interfering tests --- 217,223 ---- del testme ! if sys.platform[:4] == 'java': ! import java ! java.lang.System.gc() # Interfering tests From jhylton@users.sourceforge.net Mon Aug 20 21:33:44 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 20 Aug 2001 13:33:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test regrtest.py,1.41,1.42 test_future.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv8046/Lib/test Modified Files: regrtest.py test_future.py Log Message: Fix SF bug [ #450245 ] Error in parsing future stmts Add test case to cover multiple future statements on separate lines of a module. Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** regrtest.py 2001/08/12 21:53:08 1.41 --- regrtest.py 2001/08/20 20:33:42 1.42 *************** *** 215,218 **** --- 215,219 ---- 'test_future1', 'test_future2', + 'test_future3', ] Index: test_future.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_future.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_future.py 2001/04/18 01:19:27 1.3 --- test_future.py 2001/08/20 20:33:42 1.4 *************** *** 18,21 **** --- 18,24 ---- import test_future2 + unload('test_future3') + import test_future3 + # The remaining tests should fail try: From jhylton@users.sourceforge.net Mon Aug 20 21:33:44 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 20 Aug 2001 13:33:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_future,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv8046/Lib/test/output Modified Files: test_future Log Message: Fix SF bug [ #450245 ] Error in parsing future stmts Add test case to cover multiple future statements on separate lines of a module. Index: test_future =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_future,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_future 2001/04/18 01:19:28 1.2 --- test_future 2001/08/20 20:33:42 1.3 *************** *** 2,5 **** --- 2,6 ---- 6 6 + 2 SyntaxError badsyntax_future3 3 SyntaxError badsyntax_future4 3 From jhylton@users.sourceforge.net Mon Aug 20 21:32:35 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 20 Aug 2001 13:32:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python future.c,2.10,2.11 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv7670/Python Modified Files: future.c Log Message: Fix SF bug [ #450245 ] Error in parsing future stmts Check return value from future_parse() in for loop for file_input to accomodate multiple future statements on separate lines. Add several comments explaining how the code works. Remove out-dated XXX comment. Index: future.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/future.c,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -d -r2.10 -r2.11 *** future.c 2001/08/10 21:41:33 2.10 --- future.c 2001/08/20 20:32:33 2.11 *************** *** 9,12 **** --- 9,15 ---- #define FUTURE_IMPORT_STAR "future statement does not support import *" + /* FUTURE_POSSIBLE() is provided to accomodate doc strings, which is + the only statement that can occur before a future statement. + */ #define FUTURE_POSSIBLE(FF) ((FF)->ff_last_lineno == -1) *************** *** 58,62 **** "beginning of the file"); PyErr_SyntaxLocation(filename, n->n_lineno); - /* XXX set filename and lineno */ } --- 61,64 ---- *************** *** 76,80 **** */ ! /* future_parse() return values: -1 indicates an error occurred, e.g. unknown feature name 0 indicates no feature was found --- 78,87 ---- */ ! /* future_parse() finds future statements at the beginnning of a ! module. The function calls itself recursively, rather than ! factoring out logic for different kinds of statements into ! different routines. ! ! Return values: -1 indicates an error occurred, e.g. unknown feature name 0 indicates no feature was found *************** *** 98,106 **** case file_input: for (i = 0; i < NCH(n); i++) { node *ch = CHILD(n, i); if (TYPE(ch) == stmt) { r = future_parse(ff, ch, filename); ! if (!FUTURE_POSSIBLE(ff)) return r; } --- 105,121 ---- case file_input: + /* Check each statement in the file, starting with the + first, and continuing until the first statement + that isn't a future statement. + */ for (i = 0; i < NCH(n); i++) { node *ch = CHILD(n, i); if (TYPE(ch) == stmt) { r = future_parse(ff, ch, filename); ! /* Need to check both conditions below ! to accomodate doc strings, which ! causes r < 0. ! */ ! if (r < 1 && !FUTURE_POSSIBLE(ff)) return r; } From gstein@users.sourceforge.net Mon Aug 20 22:04:11 2001 From: gstein@users.sourceforge.net (Greg Stein) Date: Mon, 20 Aug 2001 14:04:11 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.127,1.128 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv15993 Modified Files: pep-0000.txt Log Message: Reserving PEP 267... hopefully checking in tonite Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** pep-0000.txt 2001/08/17 22:43:49 1.127 --- pep-0000.txt 2001/08/20 21:04:09 1.128 *************** *** 61,64 **** --- 61,65 ---- S 263 Defining Python Source Code Encodings Lemburg S 265 Sorting Dictionaries by Value Griffin + S 267 Extended HTTP functionality and WebDAV Stein Py-in-the-sky PEPs (not considered for Python 2.2) *************** *** 214,217 **** --- 215,219 ---- S 265 Sorting Dictionaries by Value Griffin S 266 Optimizing Global Variable/Attribute Access Montanaro + S 267 Extended HTTP functionality and WebDAV Stein Key *************** *** 255,258 **** --- 257,261 ---- Schemenauer, Neil nas@arctrix.com Schneider-Kamp, Peter nowonder@nowonder.de + Stein, Greg gstein@lyra.org Warsaw, Barry barry@zope.com Wilson, Greg gvwilson@ddj.com From jhylton@users.sourceforge.net Mon Aug 20 22:18:58 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 20 Aug 2001 14:18:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_future3.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv20247 Added Files: test_future3.py Log Message: Add test case to cover multiple future statements on separate lines of a module. From fdrake@users.sourceforge.net Mon Aug 20 22:24:21 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 20 Aug 2001 14:24:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib HTMLParser.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22193/Lib Modified Files: HTMLParser.py Log Message: Deal more appropriately with bare ampersands and pointy brackets; this module has to deal with "class" HTML-as-deployed as well as XHTML, so we cannot be as strict as XHTML allows. This closes SF bug #453059, but uses a different fix than suggested in the bug comments. Index: HTMLParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/HTMLParser.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HTMLParser.py 2001/08/03 19:50:59 1.4 --- HTMLParser.py 2001/08/20 21:24:19 1.5 *************** *** 16,20 **** interesting_normal = re.compile('[&<]') interesting_cdata = re.compile(r'<(/|\Z)') ! incomplete = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*|#[0-9]*)?') entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') --- 16,21 ---- interesting_normal = re.compile('[&<]') interesting_cdata = re.compile(r'<(/|\Z)') ! incomplete = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*' ! '|#([0-9]*|[xX][0-9a-fA-F]*))?') entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') *************** *** 186,194 **** k = self.parse_declaration(i) else: ! if i < n-1: ! raise HTMLParseError( ! "invalid '<' construct: %s" % `rawdata[i:i+2]`, ! self.getpos()) ! k = -1 if k < 0: if end: --- 187,192 ---- k = self.parse_declaration(i) else: ! self.handle_data("<") ! k = i + 1 if k < 0: if end: *************** *** 204,208 **** k = match.end() if rawdata[k-1] != ';': ! k = k-1 i = self.updatepos(i, k) continue --- 202,206 ---- k = match.end() if rawdata[k-1] != ';': ! k = k - 1 i = self.updatepos(i, k) continue *************** *** 213,227 **** k = match.end() if rawdata[k-1] != ';': ! k = k-1 i = self.updatepos(i, k) continue ! if incomplete.match(rawdata, i): ! if end: raise HTMLParseError( "EOF in middle of entity or char ref", self.getpos()) return -1 # incomplete ! raise HTMLParseError("'&' not part of entity or char ref", ! self.getpos()) else: assert 0, "interesting.search() lied" --- 211,227 ---- k = match.end() if rawdata[k-1] != ';': ! k = k - 1 i = self.updatepos(i, k) continue ! match = incomplete.match(rawdata, i) ! if match: ! rest = rawdata[i:] ! if end and rest != "&" and match.group() == rest: raise HTMLParseError( "EOF in middle of entity or char ref", self.getpos()) return -1 # incomplete ! self.handle_data("&") ! i = self.updatepos(i, i + 1) else: assert 0, "interesting.search() lied" From fdrake@users.sourceforge.net Mon Aug 20 22:24:21 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 20 Aug 2001 14:24:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_htmlparser.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22193/Lib/test Modified Files: test_htmlparser.py Log Message: Deal more appropriately with bare ampersands and pointy brackets; this module has to deal with "class" HTML-as-deployed as well as XHTML, so we cannot be as strict as XHTML allows. This closes SF bug #453059, but uses a different fix than suggested in the bug comments. Index: test_htmlparser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_htmlparser.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_htmlparser.py 2001/08/03 19:53:01 1.3 --- test_htmlparser.py 2001/08/20 21:24:19 1.4 *************** *** 2,5 **** --- 2,6 ---- import HTMLParser + import pprint import sys import test_support *************** *** 84,90 **** parser.feed(c) parser.close() ! self.assert_(parser.get_events() == ! self.initial_events + events + self.final_events, ! parser.get_events()) def _run_check_extra(self, source, events): --- 85,92 ---- parser.feed(c) parser.close() ! events = parser.get_events() ! self.assertEqual(events, ! self.initial_events + events + self.final_events, ! "got events:\n" + pprint.pformat(events)) def _run_check_extra(self, source, events): *************** *** 138,141 **** --- 140,155 ---- ]) + def test_doctype_decl(self): + inside = """\ + DOCTYPE html [ + + + + ]""" + self._run_check("" % inside, [ + ("decl", inside), + ]) + def test_bad_nesting(self): # Strangely, this *is* supposed to test that overlapping *************** *** 149,152 **** --- 163,176 ---- ]) + def test_bare_ampersands(self): + self._run_check("this text & contains & ampersands &", [ + ("data", "this text & contains & ampersands &"), + ]) + + def test_bare_pointy_brackets(self): + self._run_check("this < text > contains < bare>pointy< brackets", [ + ("data", "this < text > contains < bare>pointy< brackets"), + ]) + def test_attr_syntax(self): output = [ *************** *** 200,205 **** def test_starttag_junk_chars(self): - self._parse_error("<") - self._parse_error("<>") self._parse_error("") self._parse_error("") --- 224,227 ---- *************** *** 208,213 **** self._parse_error("") self._parse_error("") - self._parse_error("<$") - self._parse_error("<$>") self._parse_error("") --- 230,233 ---- From gstein@users.sourceforge.net Mon Aug 20 22:25:00 2001 From: gstein@users.sourceforge.net (Greg Stein) Date: Mon, 20 Aug 2001 14:25:00 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0267.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv22057 Added Files: pep-0267.txt Log Message: Initial draft to publish the abstract/rationale. More detail coming soon. --- NEW FILE: pep-0267.txt --- PEP: 267 Title: Extended HTTP functionality and WebDAV Version: $Revision: 1.1 $ Last-Modified: $Date: 2001/08/20 21:24:58 $ Author: gstein@lyra.org (Greg Stein) Status: Draft Type: Standards Trap Created: 20-Aug-2001 Python-Version: 2.2 Post-History: Abstract This PEP discusses new modules and extended functionality for Python's HTTP support. Notably, the addition of authenticated requests, proxy support, authenticated proxy usage, and WebDAV [1] capabilities. Rationale Python has been quite popular as a result of its "batteries included" positioning. One of the most heavily used protocols, HTTP, has been included with Python for years (httplib). However, this support has not kept up with the full needs and requirements of many HTTP-based applications and systems. In addition, new protocols based on HTTP, such as WebDAV and XML-RPC, are becoming useful and are seeing increasing usage. Supplying this functionality meets Python's "batteries included" role and also keeps Python at the leading edge of new technologies. While authentication and proxy support are two very notable features missing from Python's core HTTP processing, they are minimally handled as part of Python's URL handling (urllib and urllib2). However, applications that need fine-grained or sophisticated HTTP handling cannot make use of the features while they reside in urllib. Refactoring these features into a location where they can be directly associated with an HTTP connection will improve their utility for both urllib and for sophisticated applications. The motivation for this PEP was from several people requesting these features directly, and from a number of feature requests on SourceForge. Since the exact form of the modules to be provided and the classes/architecture used could be subject to debate, this PEP was created to provide a focal point for those discussions. Specification more info here... Reference Implementation reference imp will probably go into /nondist/sandbox/... References [1] http://www.webdav.org/ Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil End: From fdrake@users.sourceforge.net Mon Aug 20 22:33:43 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 20 Aug 2001 14:33:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc ACKS,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv25359 Modified Files: ACKS Log Message: Add another name. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ACKS 2001/08/15 19:00:29 1.25 --- ACKS 2001/08/20 21:33:41 1.26 *************** *** 125,128 **** --- 125,129 ---- Denis S. Otkidach William Park + Joonas Paalasmaa Harri Pasanen Tim Peters From fdrake@users.sourceforge.net Mon Aug 20 22:36:40 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 20 Aug 2001 14:36:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.108,1.109 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory usw-pr-cvs1:/tmp/cvs-serv26523/perl Modified Files: python.perl Log Message: New \grammartoken markup, similar to \token but allowed everywhere. Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** python.perl 2001/08/16 21:56:24 1.108 --- python.perl 2001/08/20 21:36:38 1.109 *************** *** 717,720 **** --- 717,724 ---- } + sub do_cmd_grammartoken{ + return do_cmd_token(@_); + } + sub do_env_productionlist{ local($_) = @_; From fdrake@users.sourceforge.net Mon Aug 20 22:36:40 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 20 Aug 2001 14:36:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs python.sty,1.80,1.81 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv26523/texinputs Modified Files: python.sty Log Message: New \grammartoken markup, similar to \token but allowed everywhere. Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** python.sty 2001/08/03 18:36:17 1.80 --- python.sty 2001/08/20 21:36:38 1.81 *************** *** 868,871 **** --- 868,872 ---- + \newcommand{\grammartoken}[1]{\texttt{#1}} \newenvironment{productionlist}[1][\py@badkey]{ \def\optional##1{{\Large[}##1{\Large]}} *************** *** 873,876 **** --- 874,878 ---- \def\orgroup##1{{\def\or{\textbar\ }##1}} \def\token##1{##1} + \let\grammartoken=\token \begin{center} \begin{tabular}{lcl} From tim_one@users.sourceforge.net Mon Aug 20 22:45:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 20 Aug 2001 14:45:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_threading.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv27959 Modified Files: test_threading.py Log Message: Test failed because these was no expected-output file, but always printed to stdout. Repaired by not printing at all except in verbose mode. Made the test about 6x faster -- envelope analysis showed it took time proportional to the square of the # of tasks. Now it's linear. Index: test_threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_threading.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_threading.py 2001/08/20 20:28:48 1.1 --- test_threading.py 2001/08/20 21:45:19 1.2 *************** *** 8,11 **** --- 8,13 ---- import time + # This takes about n/3 seconds to run (about n/3 clumps of tasks, times + # about 1 second per clump). numtasks = 10 *************** *** 18,24 **** def run(self): global running ! delay = random.random() * numtasks if verbose: ! print 'task', self.getName(), 'will run for', round(delay, 1), 'sec' sema.acquire() mutex.acquire() --- 20,26 ---- def run(self): global running ! delay = random.random() * 2 if verbose: ! print 'task', self.getName(), 'will run for', delay, 'sec' sema.acquire() mutex.acquire() *************** *** 46,52 **** starttasks() ! print 'waiting for all tasks to complete' for t in threads: t.join() ! print 'all tasks done' ! --- 48,55 ---- starttasks() ! if verbose: ! print 'waiting for all tasks to complete' for t in threads: t.join() ! if verbose: ! print 'all tasks done' From tim_one@users.sourceforge.net Mon Aug 20 22:48:02 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 20 Aug 2001 14:48:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib asyncore.py,1.16,1.17 compilerlike.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv30201 Modified Files: asyncore.py compilerlike.py Log Message: Whitespace normalization. Index: asyncore.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** asyncore.py 2001/08/13 15:21:55 1.16 --- asyncore.py 2001/08/20 21:48:00 1.17 *************** *** 55,59 **** import os from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ ! ENOTCONN, ESHUTDOWN try: --- 55,59 ---- import os from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ ! ENOTCONN, ESHUTDOWN try: Index: compilerlike.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compilerlike.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** compilerlike.py 2001/08/20 13:16:30 1.2 --- compilerlike.py 2001/08/20 21:48:00 1.3 *************** *** 45,49 **** else: for file in arguments: ! if file == '-': # - is conventional for stdin file = "stdin" infp = sys.stdin --- 45,49 ---- else: for file in arguments: ! if file == '-': # - is conventional for stdin file = "stdin" infp = sys.stdin *************** *** 78,82 **** if line == "": break ! elif line: # None returns are skipped outfp.write(translate_line(name, file, line)) --- 78,82 ---- if line == "": break ! elif line: # None returns are skipped outfp.write(translate_line(name, file, line)) From gvanrossum@users.sourceforge.net Mon Aug 20 22:59:04 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 14:59:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib threading.py,1.14.2.2,1.14.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv1410 Modified Files: Tag: r22a2-branch threading.py Log Message: Merge Skip's BoundedSemaphore from trunk into branch. Index: threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v retrieving revision 1.14.2.2 retrieving revision 1.14.2.3 diff -C2 -d -r1.14.2.2 -r1.14.2.3 *** threading.py 2001/08/19 06:03:15 1.14.2.2 --- threading.py 2001/08/20 21:59:02 1.14.2.3 *************** *** 285,288 **** --- 285,303 ---- + def BoundedSemaphore(*args, **kwargs): + return apply(_BoundedSemaphore, args, kwargs) + + class _BoundedSemaphore(_Semaphore): + """Semaphore that checks that # releases is <= # acquires""" + def __init__(self, value=1, verbose=None): + _Semaphore.__init__(self, value, verbose) + self._initial_value = value + + def release(self): + if self._Semaphore__value >= self._initial_value: + raise ValueError, "Semaphore released too many times" + return _Semaphore.release(self) + + def Event(*args, **kwargs): return apply(_Event, args, kwargs) From gvanrossum@users.sourceforge.net Mon Aug 20 23:00:08 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 15:00:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_threading.py,NONE,1.2.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv1815 Added Files: Tag: r22a2-branch test_threading.py Log Message: Merge Skip's BoundedSemaphore from trunk into branch. --- NEW FILE: test_threading.py --- # Very rudimentary test of threading module # Create a bunch of threads, let each do some work, wait until all are done from test_support import verbose import random import threading import time # This takes about n/3 seconds to run (about n/3 clumps of tasks, times # about 1 second per clump). numtasks = 10 # no more than 3 of the 10 can run at once sema = threading.BoundedSemaphore(value=3) mutex = threading.RLock() running = 0 class TestThread(threading.Thread): def run(self): global running delay = random.random() * 2 if verbose: print 'task', self.getName(), 'will run for', delay, 'sec' sema.acquire() mutex.acquire() running = running + 1 if verbose: print running, 'tasks are running' mutex.release() time.sleep(delay) if verbose: print 'task', self.getName(), 'done' mutex.acquire() running = running - 1 if verbose: print self.getName(), 'is finished.', running, 'tasks are running' mutex.release() sema.release() threads = [] def starttasks(): for i in range(numtasks): t = TestThread(name=""%i) threads.append(t) t.start() starttasks() if verbose: print 'waiting for all tasks to complete' for t in threads: t.join() if verbose: print 'all tasks done' From bwarsaw@users.sourceforge.net Mon Aug 20 23:26:27 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 20 Aug 2001 15:26:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.166,1.167 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv8298 Modified Files: socketmodule.c Log Message: SSL_dealloc(): Apply the change suggested in SF bug #425370 which changes the order of the free calls to be the reverse of the alloc calls. Closes that bug. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.166 retrieving revision 1.167 diff -C2 -d -r1.166 -r1.167 *** socketmodule.c 2001/08/20 19:06:36 1.166 --- socketmodule.c 2001/08/20 22:26:24 1.167 *************** *** 2628,2633 **** if (self->server_cert) /* Possible not to have one? */ X509_free (self->server_cert); - SSL_CTX_free(self->ctx); SSL_free(self->ssl); Py_XDECREF(self->x_attr); Py_XDECREF(self->Socket); --- 2628,2633 ---- if (self->server_cert) /* Possible not to have one? */ X509_free (self->server_cert); SSL_free(self->ssl); + SSL_CTX_free(self->ctx); Py_XDECREF(self->x_attr); Py_XDECREF(self->Socket); From bwarsaw@users.sourceforge.net Mon Aug 20 23:29:25 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 20 Aug 2001 15:29:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_support.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv9150 Modified Files: test_support.py Log Message: use_large_resources => use_resources requires(): New function which can be used to `assert' that a specific -u/--use resource flag is present. Raises a TestSkipped if not. This is used in test_largefile and test_socket_ssl to enable external or resource consumptive tests that are normally disabled. Index: test_support.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test_support.py 2001/08/17 18:39:24 1.25 --- test_support.py 2001/08/20 22:29:23 1.26 *************** *** 20,25 **** """ ! verbose = 1 # Flag set to 0 by regrtest.py ! use_large_resources = 1 # Flag set to 0 by regrtest.py def unload(name): --- 20,25 ---- """ ! verbose = 1 # Flag set to 0 by regrtest.py ! use_resources = [] # Flag set to [] by regrtest.py def unload(name): *************** *** 37,40 **** --- 37,46 ---- except os.error: pass + + def requires(resource, msg=None): + if resource not in use_resources: + if msg is None: + msg = "Use of the `%s' resource not enabled" % resource + raise TestSkipped(msg) FUZZ = 1e-6 From bwarsaw@users.sourceforge.net Mon Aug 20 23:33:48 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 20 Aug 2001 15:33:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test regrtest.py,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv10015 Modified Files: regrtest.py Log Message: Removed --have-resources flag in favor of the more granular -u/--use flag, which specifies external or resource intensive tests to perform. This is used by test_largefile and test_socket_ssl. -u/--use takes a comma separated list of flags, currently supported: largefile, network. usage(): New function. Note that the semantics of main() have changed slightly; instead of returning an error code, it raises a SystemExit (via sys.exit()) with the given error code. main(): use_large_resources => use_resources Also, added support for long-option alternative to the short options. _expectations: Added test_socket_ssl to the list of expectedly skipped tests. Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** regrtest.py 2001/08/20 20:33:42 1.42 --- regrtest.py 2001/08/20 22:33:46 1.43 *************** *** 16,20 **** -r: random -- randomize test execution order -l: findleaks -- if GC is available detect tests that leak memory ! --have-resources -- run tests that require large resources (time/space) If non-option arguments are present, they are names for tests to run, --- 16,21 ---- -r: random -- randomize test execution order -l: findleaks -- if GC is available detect tests that leak memory ! -u: use -- specify which special resource intensive tests to run ! -h: help -- print this text and exit If non-option arguments are present, they are names for tests to run, *************** *** 31,34 **** --- 32,46 ---- used instead of /tmp). + -u is used to specify which special resource intensive tests to run, such as + those requiring large file support or network connectivity. The argument is a + comma-separated list of words indicating the resources to test. Currently + only the following are defined: + + largefile - It is okay to run some test that may create huge files. These + tests can take a long time and may consume >2GB of disk space + temporarily. + + network - It is okay to run tests that use external network resource, + e.g. testing SSL support for sockets. """ *************** *** 42,48 **** import test_support def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, findleaks=0, ! use_large_resources=0): """Execute a test suite. --- 54,66 ---- import test_support + def usage(code, msg=''): + print __doc__ + if msg: print msg + sys.exit(code) + + def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, findleaks=0, ! use_resources=None): """Execute a test suite. *************** *** 61,66 **** files beginning with test_ will be used. ! The other seven default arguments (verbose, quiet, generate, exclude, ! single, randomize, and findleaks) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. --- 79,84 ---- files beginning with test_ will be used. ! The other default arguments (verbose, quiet, generate, exclude, single, ! randomize, findleaks, and use_resources) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. *************** *** 69,89 **** try: ! opts, args = getopt.getopt(sys.argv[1:], 'vgqxsrl', ['have-resources']) except getopt.error, msg: ! print msg ! print __doc__ ! return 2 for o, a in opts: ! if o == '-v': verbose = verbose+1 ! if o == '-q': quiet = 1; verbose = 0 ! if o == '-g': generate = 1 ! if o == '-x': exclude = 1 ! if o == '-s': single = 1 ! if o == '-r': randomize = 1 ! if o == '-l': findleaks = 1 ! if o == '--have-resources': use_large_resources = 1 if generate and verbose: ! print "-g and -v don't go together!" ! return 2 good = [] bad = [] --- 87,126 ---- try: ! opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrlu:', ! ['help', 'verbose', 'quiet', 'generate', ! 'exclude', 'single', 'random', ! 'findleaks', 'use=']) except getopt.error, msg: ! usage(2, msg) ! ! # Defaults ! if use_resources is None: ! use_resources = [] for o, a in opts: ! if o in ('-h', '--help'): ! usage(0) ! elif o in ('-v', '--verbose'): ! verbose += 1 ! elif o in ('-q', '--quiet'): ! quiet = 1; ! verbose = 0 ! elif o in ('-g', '--generate'): ! generate = 1 ! elif o in ('-x', '--exclude'): ! exclude = 1 ! elif o in ('-s', '--single'): ! single = 1 ! elif o in ('-r', '--randomize'): ! randomize = 1 ! elif o in ('-l', '--findleaks'): ! findleaks = 1 ! elif o in ('-u', '--use'): ! use_resources = [x.lower() for x in a.split(',')] ! for r in use_resources: ! if r not in ('largefile', 'network'): ! usage(1, 'Invalid -u/--use option: %s' % a) if generate and verbose: ! usage(2, "-g and -v don't go together!") ! good = [] bad = [] *************** *** 131,135 **** random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet ! test_support.use_large_resources = use_large_resources save_modules = sys.modules.keys() for test in tests: --- 168,172 ---- random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet ! test_support.use_resources = use_resources save_modules = sys.modules.keys() for test in tests: *************** *** 198,202 **** os.unlink(filename) ! return len(bad) > 0 STDTESTS = [ --- 235,240 ---- os.unlink(filename) ! sys.exit(len(bad) > 0) ! STDTESTS = [ *************** *** 348,352 **** class Compare: - def __init__(self, filename): if os.path.exists(filename): --- 386,389 ---- *************** *** 453,456 **** --- 490,494 ---- test_pwd test_signal + test_socket_ssl test_socketserver test_sunaudiodev *************** *** 468,471 **** --- 506,510 ---- test_nis test_ntpath + test_socket_ssl test_socketserver test_sunaudiodev *************** *** 498,500 **** if __name__ == '__main__': ! sys.exit(main()) --- 537,539 ---- if __name__ == '__main__': ! main() From bwarsaw@users.sourceforge.net Mon Aug 20 23:37:36 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 20 Aug 2001 15:37:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_largefile.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv10809 Modified Files: test_largefile.py Log Message: Use test_support.requires() to decide whether additional largefile tests should be run. Index: test_largefile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_largefile.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_largefile.py 2001/04/10 14:50:51 1.4 --- test_largefile.py 2001/08/20 22:37:34 1.5 *************** *** 31,41 **** ! # on Windows this test comsumes large resources: ! # it takes a long time to build the >2GB file and takes >2GB of disk space ! # therefore test_support.use_large_resources must be defined to run this test ! if sys.platform[:3] == 'win' and not test_support.use_large_resources: ! raise test_support.TestSkipped, \ ! "test requires %s bytes and a long time to run" % str(size) ! --- 31,42 ---- ! # On Windows this test comsumes large resources; It takes a long time to build ! # the >2GB file and takes >2GB of disk space therefore the resource must be ! # enabled to run this test. If not, nothing after this line stanza will be ! # executed. ! if sys.platform[:3] == 'win': ! test_support.requires( ! 'largefile', ! 'test requires %s bytes and a long time to run' % str(size)) From bwarsaw@users.sourceforge.net Mon Aug 20 23:39:45 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 20 Aug 2001 15:39:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_socket_ssl.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11791 Added Files: test_socket_ssl.py Log Message: A test of SSL support, using a roundabout method suggested by Guido. However, this is only enabled with regrtest's --use=network switch. --- NEW FILE: test_socket_ssl.py --- # Test just the SSL support in the socket module, in a moderately bogus way. import test_support # Optionally test SSL support. This currently requires the 'network' resource # as given on the regrtest command line. If not available, nothing after this # line will be executed. test_support.requires('network') import socket import urllib urllib.urlopen('https://sf.net') From bwarsaw@users.sourceforge.net Tue Aug 21 00:59:28 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 20 Aug 2001 16:59:28 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0009.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv28005 Modified Files: pep-0009.txt Log Message: Bogus trailing whitespace Index: pep-0009.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0009.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0009.txt 2001/08/15 15:28:57 1.2 --- pep-0009.txt 2001/08/20 23:59:26 1.3 *************** *** 191,193 **** indent-tabs-mode: nil End: - --- 191,192 ---- From bwarsaw@users.sourceforge.net Tue Aug 21 01:02:28 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 20 Aug 2001 17:02:28 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0268.txt,NONE,1.1 pep-0000.txt,1.128,1.129 pep-0267.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv28647 Modified Files: pep-0000.txt pep-0267.txt Added Files: pep-0268.txt Log Message: Greg Stein was a bad boy! <268 spank> Jeremy Hylton's "Optimized Access to Module Namespaces" PEP gets 267. We'll let Greg slide this time, so his (albeit incomplete other than a Rationale) PEP gets 268. It must get filled in soon though or it'll get moved to the "Empty" category. :( --- NEW FILE: pep-0268.txt --- PEP: 267 Title: Extended HTTP functionality and WebDAV Version: $Revision: 1.1 $ Last-Modified: $Date: 2001/08/21 00:02:26 $ Author: gstein@lyra.org (Greg Stein) Status: Draft Type: Standards Track Created: 20-Aug-2001 Python-Version: 2.2 Post-History: Abstract This PEP discusses new modules and extended functionality for Python's HTTP support. Notably, the addition of authenticated requests, proxy support, authenticated proxy usage, and WebDAV [1] capabilities. Rationale Python has been quite popular as a result of its "batteries included" positioning. One of the most heavily used protocols, HTTP, has been included with Python for years (httplib). However, this support has not kept up with the full needs and requirements of many HTTP-based applications and systems. In addition, new protocols based on HTTP, such as WebDAV and XML-RPC, are becoming useful and are seeing increasing usage. Supplying this functionality meets Python's "batteries included" role and also keeps Python at the leading edge of new technologies. While authentication and proxy support are two very notable features missing from Python's core HTTP processing, they are minimally handled as part of Python's URL handling (urllib and urllib2). However, applications that need fine-grained or sophisticated HTTP handling cannot make use of the features while they reside in urllib. Refactoring these features into a location where they can be directly associated with an HTTP connection will improve their utility for both urllib and for sophisticated applications. The motivation for this PEP was from several people requesting these features directly, and from a number of feature requests on SourceForge. Since the exact form of the modules to be provided and the classes/architecture used could be subject to debate, this PEP was created to provide a focal point for those discussions. Specification more info here... Reference Implementation reference imp will probably go into /nondist/sandbox/... References [1] http://www.webdav.org/ Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil End: Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** pep-0000.txt 2001/08/20 21:04:09 1.128 --- pep-0000.txt 2001/08/21 00:02:26 1.129 *************** *** 61,65 **** S 263 Defining Python Source Code Encodings Lemburg S 265 Sorting Dictionaries by Value Griffin ! S 267 Extended HTTP functionality and WebDAV Stein Py-in-the-sky PEPs (not considered for Python 2.2) --- 61,66 ---- S 263 Defining Python Source Code Encodings Lemburg S 265 Sorting Dictionaries by Value Griffin ! S 267 Optimized Access to Module Namespaces Hylton ! S 268 Extended HTTP functionality and WebDAV Stein Py-in-the-sky PEPs (not considered for Python 2.2) *************** *** 215,219 **** S 265 Sorting Dictionaries by Value Griffin S 266 Optimizing Global Variable/Attribute Access Montanaro ! S 267 Extended HTTP functionality and WebDAV Stein Key --- 216,221 ---- S 265 Sorting Dictionaries by Value Griffin S 266 Optimizing Global Variable/Attribute Access Montanaro ! S 267 Optimized Access to Module Namespaces Hylton ! S 268 Extended HTTP functionality and WebDAV Stein Key Index: pep-0267.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0267.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0267.txt 2001/08/20 21:24:58 1.1 --- pep-0267.txt 2001/08/21 00:02:26 1.2 *************** *** 1,65 **** PEP: 267 ! Title: Extended HTTP functionality and WebDAV Version: $Revision$ Last-Modified: $Date$ ! Author: gstein@lyra.org (Greg Stein) Status: Draft ! Type: Standards Trap ! Created: 20-Aug-2001 Python-Version: 2.2 Post-History: - Abstract ! This PEP discusses new modules and extended functionality for ! Python's HTTP support. Notably, the addition of authenticated ! requests, proxy support, authenticated proxy usage, and WebDAV [1] ! capabilities. ! Rationale ! Python has been quite popular as a result of its "batteries ! included" positioning. One of the most heavily used protocols, ! HTTP, has been included with Python for years (httplib). However, ! this support has not kept up with the full needs and requirements ! of many HTTP-based applications and systems. In addition, new ! protocols based on HTTP, such as WebDAV and XML-RPC, are becoming ! useful and are seeing increasing usage. Supplying this ! functionality meets Python's "batteries included" role and also ! keeps Python at the leading edge of new technologies. - While authentication and proxy support are two very notable - features missing from Python's core HTTP processing, they are - minimally handled as part of Python's URL handling (urllib and - urllib2). However, applications that need fine-grained or - sophisticated HTTP handling cannot make use of the features while - they reside in urllib. Refactoring these features into a location - where they can be directly associated with an HTTP connection will - improve their utility for both urllib and for sophisticated - applications. ! The motivation for this PEP was from several people requesting ! these features directly, and from a number of feature requests on ! SourceForge. Since the exact form of the modules to be provided ! and the classes/architecture used could be subject to debate, this ! PEP was created to provide a focal point for those discussions. ! Specification ! more info here... ! Reference Implementation ! reference imp will probably go into /nondist/sandbox/... ! References ! [1] http://www.webdav.org/ --- 1,267 ---- PEP: 267 ! Title: Optimized Access to Module Namespaces Version: $Revision$ Last-Modified: $Date$ ! Author: jeremy@zope.com (Jeremy Hylton) Status: Draft ! Type: Standards Track ! Created: 23-May-2001 Python-Version: 2.2 Post-History: Abstract ! This PEP proposes a new implementation of global module namespaces ! and the builtin namespace that speeds name resolution. The ! implementation would use an array of object pointers for most ! operations in these namespaces. The compiler would assign indices ! for global variables and module attributes at compile time. + The current implementation represents these namespaces as + dictionaries. A global name incurs a dictionary lookup each time + it is used; a builtin name incurs two dictionary lookups, a failed + lookup in the global namespace and a second lookup in the builtin + namespace. ! This implementation should speed Python code that uses ! module-level functions and variables. It should also eliminate ! awkward coding styles that have evolved to speed access to these ! names. ! The implementation is complicated because the global and builtin ! namespaces can be modified dynamically in ways that are impossible ! for the compiler to detect. (Example: A module's namespace is ! modified by a script after the module is imported.) As a result, ! the implementation must maintain several auxiliary data structures ! to preserve these dynamic features. ! Introduction + This PEP proposes a new implementation of attribute access for + module objects that optimizes access to module variables known at + compile time. The module will store these variables in an array + and provide an interface to lookup attributes using array offsets. + For globals, builtins, and attributes of imported modules, the + compiler will generate code that uses the array offsets for fast + access. ! [describe the key parts of the design: dlict, compiler support, ! stupid name trick workarounds, optimization of other module's ! globals] ! The implementation will preserve existing semantics for module ! namespaces, including the ability to modify module namespaces at ! runtime in ways that affect the visibility of builtin names. ! DLict design ! The namespaces are implemented using a data structure that has ! sometimes gone under the name dlict. It is a dictionary that has ! numbered slots for some dictionary entries. The type must be ! implemented in C to achieve acceptable performance. The new ! type-class unification work should make this fairly easy. The ! DLict will presumably be a subclass of dictionary with an ! alternate storage module for some keys. + A Python implementation is included here to illustrate the basic + design: ! """A dictionary-list hybrid""" ! import types ! ! class DLict: ! def __init__(self, names): ! assert isinstance(names, types.DictType) ! self.names = {} ! self.list = [None] * size ! self.empty = [1] * size ! self.dict = {} ! self.size = 0 ! ! def __getitem__(self, name): ! i = self.names.get(name) ! if i is None: ! return self.dict[name] ! if self.empty[i] is not None: ! raise KeyError, name ! return self.list[i] ! ! def __setitem__(self, name, val): ! i = self.names.get(name) ! if i is None: ! self.dict[name] = val ! else: ! self.empty[i] = None ! self.list[i] = val ! self.size += 1 ! ! def __delitem__(self, name): ! i = self.names.get(name) ! if i is None: ! del self.dict[name] ! else: ! if self.empty[i] is not None: ! raise KeyError, name ! self.empty[i] = 1 ! self.list[i] = None ! self.size -= 1 ! ! def keys(self): ! if self.dict: ! return self.names.keys() + self.dict.keys() ! else: ! return self.names.keys() ! ! def values(self): ! if self.dict: ! return self.names.values() + self.dict.values() ! else: ! return self.names.values() ! ! def items(self): ! if self.dict: ! return self.names.items() ! else: ! return self.names.items() + self.dict.items() ! ! def __len__(self): ! return self.size + len(self.dict) ! ! def __cmp__(self, dlict): ! c = cmp(self.names, dlict.names) ! if c != 0: ! return c ! c = cmp(self.size, dlict.size) ! if c != 0: ! return c ! for i in range(len(self.names)): ! c = cmp(self.empty[i], dlict.empty[i]) ! if c != 0: ! return c ! if self.empty[i] is None: ! c = cmp(self.list[i], dlict.empty[i]) ! if c != 0: ! return c ! return cmp(self.dict, dlict.dict) ! ! def clear(self): ! self.dict.clear() ! for i in range(len(self.names)): ! if self.empty[i] is None: ! self.empty[i] = 1 ! self.list[i] = None ! ! def update(self): ! pass ! ! def load(self, index): ! """dlict-special method to support indexed access""" ! if self.empty[index] is None: ! return self.list[index] ! else: ! raise KeyError, index # XXX might want reverse mapping ! ! def store(self, index, val): ! """dlict-special method to support indexed access""" ! self.empty[index] = None ! self.list[index] = val ! ! def delete(self, index): ! """dlict-special method to support indexed access""" ! self.empty[index] = 1 ! self.list[index] = None ! ! ! Compiler issues ! ! The compiler currently collects the names of all global variables ! in a module. These are names bound at the module level or bound ! in a class or function body that declares them to be global. ! ! The compiler would assign indices for each global name and add the ! names and indices of the globals to the module's code object. ! Each code object would then be bound irrevocably to the module it ! was defined in. (Not sure if there are some subtle problems with ! this.) ! ! For attributes of imported modules, the module will store an ! indirection record. Internally, the module will store a pointer ! to the defining module and the offset of the attribute in the ! defining module's global variable array. The offset would be ! initialized the first time the name is looked up. + + Runtime model + + The PythonVM will be extended with new opcodes to access globals + and module attributes via a module-level array. + + A function object would need to point to the module that defined + it in order to provide access to the module-level global array. + + For module attributes stored in the dlict (call them static + attributes), the get/delattr implementation would need to track + access to these attributes using the old by-name interface. If a + static attribute is updated dynamically, e.g. + + mod.__dict__["foo"] = 2 + + The implementation would need to update the array slot instead of + the backup dict. + + + Backwards compatibility + + The dlict will need to maintain meta-information about whether a + slot is currently used or not. It will also need to maintain a + pointer to the builtin namespace. When a name is not currently + used in the global namespace, the lookup will have to fail over to + the builtin namespace. + + In the reverse case, each module may need a special accessor + function for the builtin namespace that checks to see if a global + shadowing the builtin has been added dynamically. This check + would only occur if there was a dynamic change to the module's + dlict, i.e. when a name is bound that wasn't discovered at + compile-time. + + These mechanisms would have little if any cost for the common case + whether a module's global namespace is not modified in strange + ways at runtime. They would add overhead for modules that did + unusual things with global names, but this is an uncommon practice + and probably one worth discouraging. + + It may be desirable to disable dynamic additions to the global + namespace in some future version of Python. If so, the new + implementation could provide warnings. + + + Related PEPs + + PEP 266, Optimizing Global Variable/Attribute Access, proposes a + different mechanism for optimizing access to global variables as + well as attributes of objects. The mechanism uses two new opcodes + TRACK_OBJECT and UNTRACK_OBJECT to create a slot in the local + variables array that aliases the global or object attribute. If + the object being aliases is rebound, the rebind operation is + responsible for updating the aliases. + + The objecting tracking approach applies to a wider range of + objects than just module. It may also have a higher runtime cost, + because each function that uses a global or object attribute must + execute extra opcodes to register its interest in an object and + unregister on exit; the cost of registration is unclear, but + presumably involves a dynamically resizable data structure to hold + a list of callbacks. + + The implementation proposed here avoids the need for registration, + because it does not create aliases. Instead it allows functions + that reference a global variable or module attribute to retain a + pointer to the location where the original binding is stored. A + second advantage is that the initial lookup is performed once per + module rather than once per function call. From gvanrossum@users.sourceforge.net Tue Aug 21 04:05:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:05:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libthreading.tex,1.9,1.9.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv30284/lib Modified Files: Tag: r22a2-branch libthreading.tex Log Message: Merge the Docs from the trunk for the last time. Index: libthreading.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libthreading.tex,v retrieving revision 1.9 retrieving revision 1.9.4.1 diff -C2 -d -r1.9 -r1.9.4.1 *** libthreading.tex 2001/07/06 20:30:11 1.9 --- libthreading.tex 2001/08/21 03:05:17 1.9.4.1 *************** *** 61,72 **** \end{funcdesc} ! \begin{funcdesc}{Semaphore}{} A factory function that returns a new semaphore object. A semaphore manages a counter representing the number of \method{release()} calls minus the number of \method{acquire()} calls, plus an initial value. The \method{acquire()} method blocks if necessary until it can return ! without making the counter negative. \end{funcdesc} \begin{classdesc*}{Thread}{} A class that represents a thread of control. This class can be safely subclassed in a limited fashion. --- 61,82 ---- \end{funcdesc} ! \begin{funcdesc}{Semaphore}{\optional{value}} A factory function that returns a new semaphore object. A semaphore manages a counter representing the number of \method{release()} calls minus the number of \method{acquire()} calls, plus an initial value. The \method{acquire()} method blocks if necessary until it can return ! without making the counter negative. If not given, \var{value} defaults to ! 1. \end{funcdesc} + \begin{funcdesc}{BoundedSemaphore}{\optional{value}} + A factory function that returns a new bounded semaphore object. A bounded + semaphore checks to make sure its current value doesn't exceed its initial + value. If it does, \exception{ValueError} is raised. In most situations + semaphores are used to guard resources with limited capacity. If the + semaphore is released too many times it's a sign of a bug. If not given, + \var{value} defaults to 1. + \end{funcdesc} + \begin{classdesc*}{Thread}{} A class that represents a thread of control. This class can be safely subclassed in a limited fashion. *************** *** 367,370 **** --- 377,408 ---- \end{methoddesc} + + \subsubsection{\class{Semaphore} Example \label{semaphore-examples}} + + Semaphores are often used to guard resources with limited capacity, for + example, a database server. In any situation where the size of the resource + size is fixed, you should use a bounded semaphore. Before spawning any + worker threads, your main thread would initialize the semaphore: + + \begin{verbatim} + maxconnections = 5 + ... + pool_sema = BoundedSemaphore(value=maxconnections) + \end{verbatim} + + Once spawned, worker threads call the semaphore's acquire and release + methods when they need to connect to the server: + + \begin{verbatim} + pool_sema.acquire() + conn = connectdb() + ... use connection ... + conn.close() + pool_sema.release() + \end{verbatim} + + The use of a bounded semaphore reduces the chance that a programming error + which causes the semaphore to be released more than it's acquired will go + undetected. \subsection{Event Objects \label{event-objects}} From gvanrossum@users.sourceforge.net Tue Aug 21 04:05:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:05:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.140,1.140.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv30284/api Modified Files: Tag: r22a2-branch api.tex Log Message: Merge the Docs from the trunk for the last time. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.140 retrieving revision 1.140.2.1 diff -C2 -d -r1.140 -r1.140.2.1 *** api.tex 2001/08/16 13:14:59 1.140 --- api.tex 2001/08/21 03:05:17 1.140.2.1 *************** *** 3591,3594 **** --- 3591,3599 ---- \end{cfuncdesc} + \begin{cfuncdesc}{int}{PyTuple_GET_SIZE}{PyObject *p} + Return the size of the tuple \var{p}, which must be non-\NULL{} and + point to a tuple; no error checking is performed. + \end{cfuncdesc} + \begin{cfuncdesc}{PyObject*}{PyTuple_GetItem}{PyObject *p, int pos} Returns the object at position \var{pos} in the tuple pointed *************** *** 3781,3786 **** \begin{cfuncdesc}{PyObject*}{PyDict_Copy}{PyObject *p} ! Returns a new dictionary that contains the same key-value pairs as p. ! Empties an existing dictionary of all key-value pairs. \versionadded{1.6} \end{cfuncdesc} --- 3786,3791 ---- \begin{cfuncdesc}{PyObject*}{PyDict_Copy}{PyObject *p} ! Returns a new dictionary that contains the same key-value pairs as ! \var{p}. \versionadded{1.6} \end{cfuncdesc} From gvanrossum@users.sourceforge.net Tue Aug 21 04:05:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:05:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.108,1.108.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory usw-pr-cvs1:/tmp/cvs-serv30284/perl Modified Files: Tag: r22a2-branch python.perl Log Message: Merge the Docs from the trunk for the last time. Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.108 retrieving revision 1.108.2.1 diff -C2 -d -r1.108 -r1.108.2.1 *** python.perl 2001/08/16 21:56:24 1.108 --- python.perl 2001/08/21 03:05:17 1.108.2.1 *************** *** 717,720 **** --- 717,724 ---- } + sub do_cmd_grammartoken{ + return do_cmd_token(@_); + } + sub do_env_productionlist{ local($_) = @_; From gvanrossum@users.sourceforge.net Tue Aug 21 04:05:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:05:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc ACKS,1.25,1.25.2.1 Makefile.deps,1.71,1.71.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv30284 Modified Files: Tag: r22a2-branch ACKS Makefile.deps Log Message: Merge the Docs from the trunk for the last time. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -C2 -d -r1.25 -r1.25.2.1 *** ACKS 2001/08/15 19:00:29 1.25 --- ACKS 2001/08/21 03:05:17 1.25.2.1 *************** *** 125,128 **** --- 125,129 ---- Denis S. Otkidach William Park + Joonas Paalasmaa Harri Pasanen Tim Peters Index: Makefile.deps =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile.deps,v retrieving revision 1.71 retrieving revision 1.71.2.1 diff -C2 -d -r1.71 -r1.71.2.1 *** Makefile.deps 2001/08/02 15:13:58 1.71 --- Makefile.deps 2001/08/21 03:05:17 1.71.2.1 *************** *** 27,30 **** --- 27,35 ---- EXTFILES= ext/ext.tex $(MANSTYLES) $(INDEXSTYLES) $(COMMONTEX) \ + ext/extending.tex \ + ext/newtypes.tex \ + ext/unix.tex \ + ext/windows.tex \ + ext/embedding.tex \ texinputs/reportingbugs.tex From gvanrossum@users.sourceforge.net Tue Aug 21 04:05:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:05:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs python.sty,1.80,1.80.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv30284/texinputs Modified Files: Tag: r22a2-branch python.sty Log Message: Merge the Docs from the trunk for the last time. Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.80 retrieving revision 1.80.2.1 diff -C2 -d -r1.80 -r1.80.2.1 *** python.sty 2001/08/03 18:36:17 1.80 --- python.sty 2001/08/21 03:05:17 1.80.2.1 *************** *** 868,871 **** --- 868,872 ---- + \newcommand{\grammartoken}[1]{\texttt{#1}} \newenvironment{productionlist}[1][\py@badkey]{ \def\optional##1{{\Large[}##1{\Large]}} *************** *** 873,876 **** --- 874,878 ---- \def\orgroup##1{{\def\or{\textbar\ }##1}} \def\token##1{##1} + \let\grammartoken=\token \begin{center} \begin{tabular}{lcl} From gvanrossum@users.sourceforge.net Tue Aug 21 04:05:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:05:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ext embedding.tex,NONE,1.1.2.1 extending.tex,NONE,1.1.2.1 newtypes.tex,NONE,1.1.2.1 unix.tex,NONE,1.1.2.1 windows.tex,NONE,1.1.2.1 ext.tex,1.103,1.103.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv30284/ext Modified Files: Tag: r22a2-branch ext.tex Added Files: Tag: r22a2-branch embedding.tex extending.tex newtypes.tex unix.tex windows.tex Log Message: Merge the Docs from the trunk for the last time. --- NEW FILE: embedding.tex --- \chapter{Embedding Python in Another Application \label{embedding}} The previous chapters discussed how to extend Python, that is, how to extend the functionality of Python by attaching a library of C functions to it. It is also possible to do it the other way around: enrich your C/\Cpp{} application by embedding Python in it. Embedding provides your application with the ability to implement some of the functionality of your application in Python rather than C or \Cpp. This can be used for many purposes; one example would be to allow users to tailor the application to their needs by writing some scripts in Python. You can also use it yourself if some of the functionality can be written in Python more easily. Embedding Python is similar to extending it, but not quite. The difference is that when you extend Python, the main program of the application is still the Python interpreter, while if you embed Python, the main program may have nothing to do with Python --- instead, some parts of the application occasionally call the Python interpreter to run some Python code. So if you are embedding Python, you are providing your own main program. One of the things this main program has to do is initialize the Python interpreter. At the very least, you have to call the function \cfunction{Py_Initialize()} (on Mac OS, call \cfunction{PyMac_Initialize()} instead). There are optional calls to pass command line arguments to Python. Then later you can call the interpreter from any part of the application. There are several different ways to call the interpreter: you can pass a string containing Python statements to \cfunction{PyRun_SimpleString()}, or you can pass a stdio file pointer and a file name (for identification in error messages only) to \cfunction{PyRun_SimpleFile()}. You can also call the lower-level operations described in the previous chapters to construct and use Python objects. A simple demo of embedding Python can be found in the directory \file{Demo/embed/} of the source distribution. \begin{seealso} \seetitle[../api/api.html]{Python/C API Reference Manual}{The details of Python's C interface are given in this manual. A great deal of necessary information can be found here.} \end{seealso} \section{Very High Level Embedding \label{high-level-embedding}} The simplest form of embedding Python is the use of the very high level interface. This interface is intended to execute a Python script without needing to interact with the application directly. This can for example be used to perform some operation on a file. \begin{verbatim} #include int main() { Py_Initialize(); PyRun_SimpleString("from time import time,ctime\n" "print 'Today is',ctime(time())\n"); Py_Finalize(); return 0; } \end{verbatim} The above code first initializes the Python interpreter with \cfunction{Py_Initialize()}, followed by the execution of a hard-coded Python script that print the date and time. Afterwards, the \cfunction{Py_Finalize()} call shuts the interpreter down, followed by the end of the program. In a real program, you may want to get the Python script from another source, perhaps a text-editor routine, a file, or a database. Getting the Python code from a file can better be done by using the \cfunction{PyRun_SimpleFile()} function, which saves you the trouble of allocating memory space and loading the file contents. \section{Beyond Very High Level Embedding: An overview \label{lower-level-embedding}} The high level interface gives you the ability to execute arbitrary pieces of Python code from your application, but exchanging data values is quite cumbersome to say the least. If you want that, you should use lower level calls. At the cost of having to write more C code, you can achieve almost anything. It should be noted that extending Python and embedding Python is quite the same activity, despite the different intent. Most topics discussed in the previous chapters are still valid. To show this, consider what the extension code from Python to C really does: \begin{enumerate} \item Convert data values from Python to C, \item Perform a function call to a C routine using the converted values, and \item Convert the data values from the call from C to Python. \end{enumerate} When embedding Python, the interface code does: \begin{enumerate} \item Convert data values from C to Python, \item Perform a function call to a Python interface routine using the converted values, and \item Convert the data values from the call from Python to C. \end{enumerate} As you can see, the data conversion steps are simply swapped to accomodate the different direction of the cross-language transfer. The only difference is the routine that you call between both data conversions. When extending, you call a C routine, when embedding, you call a Python routine. This chapter will not discuss how to convert data from Python to C and vice versa. Also, proper use of references and dealing with errors is assumed to be understood. Since these aspects do not differ from extending the interpreter, you can refer to earlier chapters for the required information. \section{Pure Embedding \label{pure-embedding}} The first program aims to execute a function in a Python script. Like in the section about the very high level interface, the Python interpreter does not directly interact with the application (but that will change in th next section). The code to run a function defined in a Python script is: \verbatiminput{run-func.c} This code loads a Python script using \code{argv[1]}, and calls the function named in \code{argv[2]}. Its integer arguments are the other values of the \code{argv} array. If you compile and link this program (let's call the finished executable \program{call}), and use it to execute a Python script, such as: \begin{verbatim} def multiply(a,b): print "Thy shall add", a, "times", b c = 0 for i in range(0, a): c = c + b return c \end{verbatim} then the result should be: \begin{verbatim} $ call multiply 3 2 Thy shall add 3 times 2 Result of call: 6 \end{verbatim} % $ Although the program is quite large for its functionality, most of the code is for data conversion between Python and C, and for error reporting. The interesting part with respect to embedding Python starts with \begin{verbatim} Py_Initialize(); pName = PyString_FromString(argv[1]); /* Error checking of pName left out */ pModule = PyImport_Import(pName); \end{verbatim} After initializing the interpreter, the script is loaded using \cfunction{PyImport_Import()}. This routine needs a Python string as its argument, which is constructed using the \cfunction{PyString_FromString()} data conversion routine. \begin{verbatim} pDict = PyModule_GetDict(pModule); /* pDict is a borrowed reference */ pFunc = PyDict_GetItemString(pDict, argv[2]); /* pFun is a borrowed reference */ if (pFunc && PyCallable_Check(pFunc)) { ... } \end{verbatim} Once the script is loaded, its dictionary is retrieved with \cfunction{PyModule_GetDict()}. The dictionary is then searched using the normal dictionary access routines for the function name. If the name exists, and the object retunred is callable, you can safely assume that it is a function. The program then proceeds by constructing a tuple of arguments as normal. The call to the python function is then made with: \begin{verbatim} pValue = PyObject_CallObject(pFunc, pArgs); \end{verbatim} Upon return of the function, \code{pValue} is either \NULL{} or it contains a reference to the return value of the function. Be sure to release the reference after examining the value. \section{Extending Embedded Python \label{extending-with-embedding}} Until now, the embedded Python interpreter had no access to functionality from the application itself. The Python API allows this by extending the embedded interpreter. That is, the embedded interpreter gets extended with routines provided by the application. While it sounds complex, it is not so bad. Simply forget for a while that the application starts the Python interpreter. Instead, consider the application to be a set of subroutines, and write some glue code that gives Python access to those routines, just like you would write a normal Python extension. For example: \begin{verbatim} static int numargs=0; /* Return the number of arguments of the application command line */ static PyObject* emb_numargs(PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args, ":numargs")) return NULL; return Py_BuildValue("i", numargs); } static PyMethodDef EmbMethods[]={ {"numargs", emb_numargs, METH_VARARGS}, {NULL, NULL} }; \end{verbatim} Insert the above code just above the \cfunction{main()} function. Also, insert the following two statements directly after \cfunction{Py_Initialize()}: \begin{verbatim} numargs = argc; Py_InitModule("emb", EmbMethods); \end{verbatim} These two lines initialize the \code{numargs} variable, and make the \function{emb.numargs()} function accessible to the embedded Python interpreter. With these extensions, the Python script can do things like \begin{verbatim} import emb print "Number of arguments", emb.numargs() \end{verbatim} In a real application, the methods will expose an API of the application to Python. %\section{For the future} % %You don't happen to have a nice library to get textual %equivalents of numeric values do you :-) ? %Callbacks here ? (I may be using information from that section %?!) %threads %code examples do not really behave well if errors happen % (what to watch out for) \section{Embedding Python in \Cpp{} \label{embeddingInCplusplus}} It is also possible to embed Python in a \Cpp{} program; precisely how this is done will depend on the details of the \Cpp{} system used; in general you will need to write the main program in \Cpp{}, and use the \Cpp{} compiler to compile and link your program. There is no need to recompile Python itself using \Cpp{}. \section{Linking Requirements \label{link-reqs}} While the \program{configure} script shipped with the Python sources will correctly build Python to export the symbols needed by dynamically linked extensions, this is not automatically inherited by applications which embed the Python library statically, at least on \UNIX. This is an issue when the application is linked to the static runtime library (\file{libpython.a}) and needs to load dynamic extensions (implemented as \file{.so} files). The problem is that some entry points are defined by the Python runtime solely for extension modules to use. If the embedding application does not use any of these entry points, some linkers will not include those entries in the symbol table of the finished executable. Some additional options are needed to inform the linker not to remove these symbols. Determining the right options to use for any given platform can be quite difficult, but fortunately the Python configuration already has those values. To retrieve them from an installed Python interpreter, start an interactive interpreter and have a short session like this: \begin{verbatim} >>> import distutils.sysconfig >>> distutils.sysconfig.get_config_var('LINKFORSHARED') '-Xlinker -export-dynamic' \end{verbatim} \refstmodindex{distutils.sysconfig} The contents of the string presented will be the options that should be used. If the string is empty, there's no need to add any additional options. The \constant{LINKFORSHARED} definition corresponds to the variable of the same name in Python's top-level \file{Makefile}. --- NEW FILE: extending.tex --- \chapter{Extending Python with C or \Cpp{} \label{intro}} It is quite easy to add new built-in modules to Python, if you know how to program in C. Such \dfn{extension modules} can do two things that can't be done directly in Python: they can implement new built-in object types, and they can call C library functions and system calls. To support extensions, the Python API (Application Programmers Interface) defines a set of functions, macros and variables that provide access to most aspects of the Python run-time system. The Python API is incorporated in a C source file by including the header \code{"Python.h"}. The compilation of an extension module depends on its intended use as well as on your system setup; details are given in later chapters. \section{A Simple Example [...1656 lines suppressed...] { PyObject *m; Py_InitModule("client", ClientMethods); import_spam(); } \end{verbatim} The main disadvantage of this approach is that the file \file{spammodule.h} is rather complicated. However, the basic structure is the same for each function that is exported, so it has to be learned only once. Finally it should be mentioned that CObjects offer additional functionality, which is especially useful for memory allocation and deallocation of the pointer stored in a CObject. The details are described in the \citetitle[../api/api.html]{Python/C API Reference Manual} in the section ``CObjects'' and in the implementation of CObjects (files \file{Include/cobject.h} and \file{Objects/cobject.c} in the Python source code distribution). --- NEW FILE: newtypes.tex --- \chapter{Defining New Types \label{defining-new-types}} \sectionauthor{Michael Hudson}{mwh21@cam.ac.uk} \sectionauthor{Dave Kuhlman}{dkuhlman@rexx.com} As mentioned in the last chapter, Python allows the writer of an extension module to define new types that can be manipulated from Python code, much like strings and lists in core Python. This is not hard; the code for all extension types follows a pattern, but there are some details that you need to understand before you can get started. \section{The Basics \label{dnt-basics}} The Python runtime sees all Python objects as variables of type \ctype{PyObject*}. A \ctype{PyObject} is not a very magnificent object - it just contains the refcount and a pointer to the object's ``type object''. This is where the action is; the type object determines which (C) functions get called when, for instance, an attribute gets looked up on an object or it is multiplied by another object. I call these C functions ``type methods'' to distinguish them from things like \code{[].append} (which I will call ``object methods'' when I get around to them). So, if you want to define a new object type, you need to create a new type object. This sort of thing can only be explained by example, so here's a minimal, but complete, module that defines a new type: \begin{verbatim} #include staticforward PyTypeObject noddy_NoddyType; typedef struct { PyObject_HEAD } noddy_NoddyObject; static PyObject* noddy_new_noddy(PyObject* self, PyObject* args) { noddy_NoddyObject* noddy; if (!PyArg_ParseTuple(args,":new_noddy")) return NULL; noddy = PyObject_New(noddy_NoddyObject, &noddy_NoddyType); return (PyObject*)noddy; } static void noddy_noddy_dealloc(PyObject* self) { PyObject_Del(self); } static PyTypeObject noddy_NoddyType = { PyObject_HEAD_INIT(NULL) 0, "Noddy", sizeof(noddy_NoddyObject), 0, noddy_noddy_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash */ }; static PyMethodDef noddy_methods[] = { { "new_noddy", noddy_new_noddy, METH_VARARGS }, {NULL, NULL} }; DL_EXPORT(void) initnoddy(void) { noddy_NoddyType.ob_type = &PyType_Type; Py_InitModule("noddy", noddy_methods); } \end{verbatim} Now that's quite a bit to take in at once, but hopefully bits will seem familiar from the last chapter. The first bit that will be new is: \begin{verbatim} staticforward PyTypeObject noddy_NoddyType; \end{verbatim} This names the type object that will be defining further down in the file. It can't be defined here because its definition has to refer to functions that have no yet been defined, but we need to be able to refer to it, hence the declaration. The \code{staticforward} is required to placate various brain dead compilers. \begin{verbatim} typedef struct { PyObject_HEAD } noddy_NoddyObject; \end{verbatim} This is what a Noddy object will contain. In this case nothing more than every Python object contains - a refcount and a pointer to a type object. These are the fields the \code{PyObject_HEAD} macro brings in. The reason for the macro is to standardize the layout and to enable special debugging fields to be brought in debug builds. For contrast \begin{verbatim} typedef struct { PyObject_HEAD long ob_ival; } PyIntObject; \end{verbatim} is the corresponding definition for standard Python integers. Next up is: \begin{verbatim} static PyObject* noddy_new_noddy(PyObject* self, PyObject* args) { noddy_NoddyObject* noddy; if (!PyArg_ParseTuple(args,":new_noddy")) return NULL; noddy = PyObject_New(noddy_NoddyObject, &noddy_NoddyType); return (PyObject*)noddy; } \end{verbatim} This is in fact just a regular module function, as described in the last chapter. The reason it gets special mention is that this is where we create our Noddy object. Defining PyTypeObject structures is all very well, but if there's no way to actually \emph{create} one of the wretched things it is not going to do anyone much good. Almost always, you create objects with a call of the form: \begin{verbatim} PyObject_New(, &); \end{verbatim} This allocates the memory and then initializes the object (sets the reference count to one, makes the \cdata{ob_type} pointer point at the right place and maybe some other stuff, depending on build options). You \emph{can} do these steps separately if you have some reason to --- but at this level we don't bother. We cast the return value to a \ctype{PyObject*} because that's what the Python runtime expects. This is safe because of guarantees about the layout of structures in the C standard, and is a fairly common C programming trick. One could declare \cfunction{noddy_new_noddy} to return a \ctype{noddy_NoddyObject*} and then put a cast in the definition of \cdata{noddy_methods} further down the file --- it doesn't make much difference. Now a Noddy object doesn't do very much and so doesn't need to implement many type methods. One you can't avoid is handling deallocation, so we find \begin{verbatim} static void noddy_noddy_dealloc(PyObject* self) { PyObject_Del(self); } \end{verbatim} This is so short as to be self explanatory. This function will be called when the reference count on a Noddy object reaches \code{0} (or it is found as part of an unreachable cycle by the cyclic garbage collector). \cfunction{PyObject_Del()} is what you call when you want an object to go away. If a Noddy object held references to other Python objects, one would decref them here. Moving on, we come to the crunch --- the type object. \begin{verbatim} static PyTypeObject noddy_NoddyType = { PyObject_HEAD_INIT(NULL) 0, "Noddy", sizeof(noddy_NoddyObject), 0, noddy_noddy_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash */ }; \end{verbatim} Now if you go and look up the definition of \ctype{PyTypeObject} in \file{object.h} you'll see that it has many, many more fields that the definition above. The remaining fields will be filled with zeros by the C compiler, and it's common practice to not specify them explicitly unless you need them. This is so important that I'm going to pick the top of it apart still further: \begin{verbatim} PyObject_HEAD_INIT(NULL) \end{verbatim} This line is a bit of a wart; what we'd like to write is: \begin{verbatim} PyObject_HEAD_INIT(&PyType_Type) \end{verbatim} as the type of a type object is ``type'', but this isn't strictly conforming C and some compilers complain. So instead we fill in the \cdata{ob_type} field of \cdata{noddy_NoddyType} at the earliest oppourtunity --- in \cfunction{initnoddy()}. \begin{verbatim} 0, \end{verbatim} XXX why does the type info struct start PyObject_*VAR*_HEAD?? \begin{verbatim} "Noddy", \end{verbatim} The name of our type. This will appear in the default textual representation of our objects and in some error messages, for example: \begin{verbatim} >>> "" + noddy.new_noddy() Traceback (most recent call last): File "", line 1, in ? TypeError: cannot add type "Noddy" to string \end{verbatim} \begin{verbatim} sizeof(noddy_NoddyObject), \end{verbatim} This is so that Python knows how much memory to allocate when you call \cfunction{PyObject_New}. \begin{verbatim} 0, \end{verbatim} This has to do with variable length objects like lists and strings. Ignore for now... Now we get into the type methods, the things that make your objects different from the others. Of course, the Noddy object doesn't implement many of these, but as mentioned above you have to implement the deallocation function. \begin{verbatim} noddy_noddy_dealloc, /*tp_dealloc*/ \end{verbatim} >From here, all the type methods are nil so I won't go over them yet - that's for the next section! Everything else in the file should be familiar, except for this line in \cfunction{initnoddy}: \begin{verbatim} noddy_NoddyType.ob_type = &PyType_Type; \end{verbatim} This was alluded to above --- the \cdata{noddy_NoddyType} object should have type ``type'', but \code{\&PyType_Type} is not constant and so can't be used in its initializer. To work around this, we patch it up in the module initialization. That's it! All that remains is to build it; put the above code in a file called \file{noddymodule.c} and \begin{verbatim} from distutils.core import setup, Extension setup(name = "noddy", version = "1.0", ext_modules = [Extension("noddy", ["noddymodule.c"])]) \end{verbatim} in a file called \file{setup.py}; then typing \begin{verbatim} $ python setup.py build%$ \end{verbatim} at a shell should produce a file \file{noddy.so} in a subdirectory; move to that directory and fire up Python --- you should be able to \code{import noddy} and play around with Noddy objects. That wasn't so hard, was it? \section{Type Methods \label{dnt-type-methods}} This section aims to give a quick fly-by on the various type methods you can implement and what they do. Here is the definition of \ctype{PyTypeObject}, with some fields only used in debug builds omitted: \begin{verbatim} typedef struct _typeobject { PyObject_VAR_HEAD char *tp_name; /* For printing */ int tp_basicsize, tp_itemsize; /* For allocation */ /* Methods to implement standard operations */ destructor tp_dealloc; printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; cmpfunc tp_compare; reprfunc tp_repr; /* Method suites for standard classes */ PyNumberMethods *tp_as_number; PySequenceMethods *tp_as_sequence; PyMappingMethods *tp_as_mapping; /* More standard operations (here for binary compatibility) */ hashfunc tp_hash; ternaryfunc tp_call; reprfunc tp_str; getattrofunc tp_getattro; setattrofunc tp_setattro; /* Functions to access object as input/output buffer */ PyBufferProcs *tp_as_buffer; /* Flags to define presence of optional/expanded features */ long tp_flags; char *tp_doc; /* Documentation string */ /* Assigned meaning in release 2.0 */ /* call function for all accessible objects */ traverseproc tp_traverse; /* delete references to contained objects */ inquiry tp_clear; /* Assigned meaning in release 2.1 */ /* rich comparisons */ richcmpfunc tp_richcompare; /* weak reference enabler */ long tp_weaklistoffset; /* Added in release 2.2 */ /* Iterators */ getiterfunc tp_iter; iternextfunc tp_iternext; /* Attribute descriptor and subclassing stuff */ struct PyMethodDef *tp_methods; struct memberlist *tp_members; struct getsetlist *tp_getset; struct _typeobject *tp_base; PyObject *tp_dict; descrgetfunc tp_descr_get; descrsetfunc tp_descr_set; long tp_dictoffset; initproc tp_init; allocfunc tp_alloc; newfunc tp_new; destructor tp_free; /* Low-level free-memory routine */ PyObject *tp_bases; PyObject *tp_mro; /* method resolution order */ PyObject *tp_defined; } PyTypeObject; \end{verbatim} Now that's a \emph{lot} of methods. Don't worry too much though - if you have a type you want to define, the chances are very good that you will only implement a handful of these. As you probably expect by now, we're going to go over this and give more information about the various handlers. We won't go in the order they are defined in the structure, because there is a lot of historical baggage that impacts the ordering of the fields; be sure your type initializaion keeps the fields in the right order! It's often easiest to find an example that includes all the fields you need (even if they're initialized to \code{0}) and then change the values to suit your new type. \begin{verbatim} char *tp_name; /* For printing */ \end{verbatim} The name of the type - as mentioned in the last section, this will appear in various places, almost entirely for diagnostic purposes. Try to choose something that will be helpful in such a situation! \begin{verbatim} int tp_basicsize, tp_itemsize; /* For allocation */ \end{verbatim} These fields tell the runtime how much memory to allocate when new objects of this typed are created. Python has some builtin support for variable length structures (think: strings, lists) which is where the \cdata{tp_itemsize} field comes in. This will be dealt with later. \begin{verbatim} char *tp_doc; \end{verbatim} Here you can put a string (or its address) that you want returned when the Python script references \code{obj.__doc__} to retrieve the docstring. Now we come to the basic type methods---the ones most extension types will implement. \subsection{Finalization and De-allocation} \begin{verbatim} destructor tp_dealloc; \end{verbatim} This function is called when the reference count of the instance of your type is reduced to zero and the Python interpreter wants to reclaim it. If your type has memory to free or other clean-up to perform, put it here. The object itself needs to be freed here as well. Here is an example of this function: \begin{verbatim} static void newdatatype_dealloc(newdatatypeobject * obj) { free(obj->obj_UnderlyingDatatypePtr); PyObject_DEL(obj); } \end{verbatim} \subsection{Object Representation} In Python, there are three ways to generate a textual representation of an object: the \function{repr()}\bifuncindex{repr} function (or equivalent backtick syntax), the \function{str()}\bifuncindex{str} function, and the \keyword{print} statement. For most objects, the \keyword{print} statement is equivalent to the \function{str()} function, but it is possible to special-case printing to a \ctype{FILE*} if necessary; this should only be done if efficiency is identified as a problem and profiling suggests that creating a temporary string object to be written to a file is too expensive. These handlers are all optional, and most types at most need to implement the \member{tp_str} and \member{tp_repr} handlers. \begin{verbatim} reprfunc tp_repr; reprfunc tp_str; printfunc tp_print; \end{verbatim} The \member{tp_repr} handler should return a string object containing a representation of the instance for which it is called. Here is a simple example: \begin{verbatim} static PyObject * newdatatype_repr(newdatatypeobject * obj) { char buf[4096]; sprintf(buf, "Repr-ified_newdatatype{{size:%d}}", obj->obj_UnderlyingDatatypePtr->size); return PyString_FromString(buf); } \end{verbatim} If no \member{tp_repr} handler is specified, the interpreter will supply a representation that uses the type's \member{tp_name} and a uniquely-identifying value for the object. The \member{tp_str} handler is to \function{str()} what the \member{tp_repr} handler described above is to \function{repr()}; that is, it is called when Python code calls \function{str()} on an instance of your object. It's implementation is very similar to the \member{tp_repr} function, but the resulting string is intended to be human consumption. It \member{tp_str} is not specified, the \member{tp_repr} handler is used instead. Here is a simple example: \begin{verbatim} static PyObject * newdatatype_str(newdatatypeobject * obj) { PyObject *pyString; char buf[4096]; sprintf(buf, "Stringified_newdatatype{{size:%d}}", obj->obj_UnderlyingDatatypePtr->size ); pyString = PyString_FromString(buf); return pyString; } \end{verbatim} The print function will be called whenever Python needs to "print" an instance of the type. For example, if 'node' is an instance of type TreeNode, then the print function is called when Python code calls: \begin{verbatim} print node \end{verbatim} There is a flags argument and one flag, \constant{Py_PRINT_RAW}, and it suggests that you print without string quotes and possibly without interpreting escape sequences. The print function receives a file object as an argument. You will likely want to write to that file object. Here is a sampe print function: \begin{verbatim} static int newdatatype_print(newdatatypeobject *obj, FILE *fp, int flags) { if (flags & Py_PRINT_RAW) { fprintf(fp, "<{newdatatype object--size: %d}>", obj->obj_UnderlyingDatatypePtr->size); } else { fprintf(fp, "\"<{newdatatype object--size: %d}>\"", obj->obj_UnderlyingDatatypePtr->size); } return 0; } \end{verbatim} \subsection{Attribute Management Functions} \begin{verbatim} getattrfunc tp_getattr; setattrfunc tp_setattr; \end{verbatim} The \member{tp_getattr} handle is called when the object requires an attribute look-up. It is called in the same situations where the \method{__getattr__()} method of a class would be called. A likely way to handle this is (1) to implement a set of functions (such as \cfunction{newdatatype_getSize()} and \cfunction{newdatatype_setSize()} in the example below), (2) provide a method table listing these functions, and (3) provide a getattr function that returns the result of a lookup in that table. Here is an example: \begin{verbatim} static PyMethodDef newdatatype_methods[] = { {"getSize", (PyCFunction)newdatatype_getSize, METH_VARARGS}, {"setSize", (PyCFunction)newdatatype_setSize, METH_VARARGS}, {NULL, NULL} /* sentinel */ }; static PyObject * newdatatype_getattr(newdatatypeobject *obj, char *name) { return Py_FindMethod(newdatatype_methods, (PyObject *)obj, name); } \end{verbatim} The \member{tp_setattr} handler is called when the \method{__setattr__()} or \method{__delattr__()} method of a class instance would be called. When an attribute should be deleted, the third parameter will be \NULL. Here is an example that simply raises an exception; if this were really all you wanted, the \member{tp_setattr} handler should be set to \NULL. \begin{verbatim} static int newdatatype_setattr(newdatatypeobject *obj, char *name, PyObject *v) { char buf[1024]; sprintf(buf, "Set attribute not supported for attribute %s", name); PyErr_SetString(PyExc_RuntimeError, buf); return -1; } \end{verbatim} \subsection{Object Comparison} \begin{verbatim} cmpfunc tp_compare; \end{verbatim} The \member{tp_compare} handler is called when comparisons are needed are the object does not implement the specific rich comparison method which matches the requested comparison. (It is always used if defined and the \cfunction{PyObject_Compare()} or \cfunction{PyObject_Cmp()} functions are used, or if \function{cmp()} is used from Python.) It is analogous to the \method{__cmp__()} method. This function should return a negative integer if \var{obj1} is less than \var{obj2}, \code{0} if they are equal, and a positive integer if \var{obj1} is greater than \var{obj2}. Here is a sample implementation: \begin{verbatim} static int newdatatype_compare(newdatatypeobject * obj1, newdatatypeobject * obj2) { long result; if (obj1->obj_UnderlyingDatatypePtr->size < obj2->obj_UnderlyingDatatypePtr->size) { result = -1; } else if (obj1->obj_UnderlyingDatatypePtr->size > obj2->obj_UnderlyingDatatypePtr->size) { result = 1; } else { result = 0; } return result; } \end{verbatim} \subsection{Abstract Protocol Support} \begin{verbatim} tp_as_number; tp_as_sequence; tp_as_mapping; \end{verbatim} If you wish your object to be able to act like a number, a sequence, or a mapping object, then you place the address of a structure that implements the C type \ctype{PyNumberMethods}, \ctype{PySequenceMethods}, or \ctype{PyMappingMethods}, respectively. It is up to you to fill in this structure with appropriate values. You can find examples of the use of each of these in the \file{Objects} directory of the Python source distribution. \begin{verbatim} hashfunc tp_hash; \end{verbatim} This function, if you choose to provide it, should return a hash number for an instance of your datatype. Here is a moderately pointless example: \begin{verbatim} static long newdatatype_hash(newdatatypeobject *obj) { long result; result = obj->obj_UnderlyingDatatypePtr->size; result = result * 3; return result; } \end{verbatim} \begin{verbatim} ternaryfunc tp_call; \end{verbatim} This function is called when an instance of your datatype is "called", for example, if \code{obj1} is an instance of your datatype and the Python script contains \code{obj1('hello')}, the \member{tp_call} handler is invoked. This function takes three arguments: \begin{enumerate} \item \var{arg1} is the instance of the datatype which is the subject of the call. If the call is \code{obj1('hello')}, then \var{arg1} is \code{obj1}. \item \var{arg2} is a tuple containing the arguments to the call. You can use \cfunction{PyArg_ParseTuple()} to extract the arguments. \item \var{arg3} is a dictionary of keyword arguments that were passed. If this is non-\NULL{} and you support keyword arguments, use \cfunction{PyArg_ParseTupleAndKeywords()} to extract the arguments. If you do not want to support keyword arguments and this is non-\NULL, raise a \exception{TypeError} with a message saying that keyword arguments are not supported. \end{enumerate} Here is a desultory example of the implementation of call function. \begin{verbatim} /* Implement the call function. * obj1 is the instance receiving the call. * obj2 is a tuple containing the arguments to the call, in this * case 3 strings. */ static PyObject * newdatatype_call(newdatatypeobject *obj, PyObject *args, PyObject *other) { PyObject *result; char *arg1; char *arg2; char *arg3; char buf[4096]; if (!PyArg_ParseTuple(args, "sss:call", &arg1, &arg2, &arg3)) { return NULL; } sprintf(buf, "Returning -- value: [%d] arg1: [%s] arg2: [%s] arg3: [%s]\n", obj->obj_UnderlyingDatatypePtr->size, arg1, arg2, arg3); printf(buf); return PyString_FromString(buf); } \end{verbatim} \subsection{More Suggestions} Remember that you can omit most of these functions, in which case you provide \code{0} as a value. In the \file{Objects} directory of the Python source distribution, there is a file \file{xxobject.c}, which is intended to be used as a template for the implementation of new types. One useful strategy for implementing a new type is to copy and rename this file, then read the instructions at the top of it. There are type definitions for each of the functions you must provide. They are in \file{object.h} in the Python include directory that comes with the source distribution of Python. In order to learn how to implement any specific method for your new datatype, do the following: Download and unpack the Python source distribution. Go the the \file{Objects} directory, then search the C source files for \code{tp_} plus the function you want (for example, \code{tp_print} or \code{tp_compare}). You will find examples of the function you want to implement. When you need to verify that the type of an object is indeed the object you are implementing and if you use xxobject.c as an starting template for your implementation, then there is a macro defined for this purpose. The macro definition will look something like this: \begin{verbatim} #define is_newdatatypeobject(v) ((v)->ob_type == &Newdatatypetype) \end{verbatim} And, a sample of its use might be something like the following: \begin{verbatim} if (!is_newdatatypeobject(objp1) { PyErr_SetString(PyExc_TypeError, "arg #1 not a newdatatype"); return NULL; } \end{verbatim} %For a reasonably extensive example, from which most of the snippits %above were taken, see \file{newdatatype.c} and \file{newdatatype.h}. --- NEW FILE: unix.tex --- \chapter{Building C and \Cpp{} Extensions on \UNIX{} \label{building-on-unix}} \sectionauthor{Jim Fulton}{jim@zope.com} %The make file make file, building C extensions on Unix Starting in Python 1.4, Python provides a special make file for building make files for building dynamically-linked extensions and custom interpreters. The make file make file builds a make file that reflects various system variables determined by configure when the Python interpreter was built, so people building module's don't have to resupply these settings. This vastly simplifies the process of building extensions and custom interpreters on Unix systems. The make file make file is distributed as the file \file{Misc/Makefile.pre.in} in the Python source distribution. The first step in building extensions or custom interpreters is to copy this make file to a development directory containing extension module source. The make file make file, \file{Makefile.pre.in} uses metadata provided in a file named \file{Setup}. The format of the \file{Setup} file is the same as the \file{Setup} (or \file{Setup.dist}) file provided in the \file{Modules/} directory of the Python source distribution. The \file{Setup} file contains variable definitions: \begin{verbatim} EC=/projects/ExtensionClass \end{verbatim} and module description lines. It can also contain blank lines and comment lines that start with \character{\#}. A module description line includes a module name, source files, options, variable references, and other input files, such as libraries or object files. Consider a simple example: \begin{verbatim} ExtensionClass ExtensionClass.c \end{verbatim} This is the simplest form of a module definition line. It defines a module, \module{ExtensionClass}, which has a single source file, \file{ExtensionClass.c}. This slightly more complex example uses an \strong{-I} option to specify an include directory: \begin{verbatim} EC=/projects/ExtensionClass cPersistence cPersistence.c -I$(EC) \end{verbatim} % $ <-- bow to font lock This example also illustrates the format for variable references. For systems that support dynamic linking, the \file{Setup} file should begin: \begin{verbatim} *shared* \end{verbatim} to indicate that the modules defined in \file{Setup} are to be built as dynamically linked modules. A line containing only \samp{*static*} can be used to indicate the subsequently listed modules should be statically linked. Here is a complete \file{Setup} file for building a \module{cPersistent} module: \begin{verbatim} # Set-up file to build the cPersistence module. # Note that the text should begin in the first column. *shared* # We need the path to the directory containing the ExtensionClass # include file. EC=/projects/ExtensionClass cPersistence cPersistence.c -I$(EC) \end{verbatim} % $ <-- bow to font lock After the \file{Setup} file has been created, \file{Makefile.pre.in} is run with the \samp{boot} target to create a make file: \begin{verbatim} make -f Makefile.pre.in boot \end{verbatim} This creates the file, Makefile. To build the extensions, simply run the created make file: \begin{verbatim} make \end{verbatim} It's not necessary to re-run \file{Makefile.pre.in} if the \file{Setup} file is changed. The make file automatically rebuilds itself if the \file{Setup} file changes. \section{Building Custom Interpreters \label{custom-interps}} The make file built by \file{Makefile.pre.in} can be run with the \samp{static} target to build an interpreter: \begin{verbatim} make static \end{verbatim} Any modules defined in the \file{Setup} file before the \samp{*shared*} line will be statically linked into the interpreter. Typically, a \samp{*shared*} line is omitted from the \file{Setup} file when a custom interpreter is desired. \section{Module Definition Options \label{module-defn-options}} Several compiler options are supported: \begin{tableii}{l|l}{programopt}{Option}{Meaning} \lineii{-C}{Tell the C pre-processor not to discard comments} \lineii{-D\var{name}=\var{value}}{Define a macro} \lineii{-I\var{dir}}{Specify an include directory, \var{dir}} \lineii{-L\var{dir}}{Specify a link-time library directory, \var{dir}} \lineii{-R\var{dir}}{Specify a run-time library directory, \var{dir}} \lineii{-l\var{lib}}{Link a library, \var{lib}} \lineii{-U\var{name}}{Undefine a macro} \end{tableii} Other compiler options can be included (snuck in) by putting them in variables. Source files can include files with \file{.c}, \file{.C}, \file{.cc}, \file{.cpp}, \file{.cxx}, and \file{.c++} extensions. Other input files include files with \file{.a}, \file{.o}, \file{.sl}, and \file{.so} extensions. \section{Example \label{module-defn-example}} Here is a more complicated example from \file{Modules/Setup.dist}: \begin{verbatim} GMP=/ufs/guido/src/gmp mpz mpzmodule.c -I$(GMP) $(GMP)/libgmp.a \end{verbatim} which could also be written as: \begin{verbatim} mpz mpzmodule.c -I$(GMP) -L$(GMP) -lgmp \end{verbatim} \section{Distributing your extension modules \label{distributing}} There are two ways to distribute extension modules for others to use. The way that allows the easiest cross-platform support is to use the \module{distutils}\refstmodindex{distutils} package. The manual \citetitle[../dist/dist.html]{Distributing Python Modules} contains information on this approach. It is recommended that all new extensions be distributed using this approach to allow easy building and installation across platforms. Older extensions should migrate to this approach as well. What follows describes the older approach; there are still many extensions which use this. When distributing your extension modules in source form, make sure to include a \file{Setup} file. The \file{Setup} file should be named \file{Setup.in} in the distribution. The make file make file, \file{Makefile.pre.in}, will copy \file{Setup.in} to \file{Setup} if the person installing the extension doesn't do so manually. Distributing a \file{Setup.in} file makes it easy for people to customize the \file{Setup} file while keeping the original in \file{Setup.in}. It is a good idea to include a copy of \file{Makefile.pre.in} for people who do not have a source distribution of Python. Do not distribute a make file. People building your modules should use \file{Makefile.pre.in} to build their own make file. A \file{README} file included in the package should provide simple instructions to perform the build. --- NEW FILE: windows.tex --- \chapter{Building C and \Cpp{} Extensions on Windows \label{building-on-windows}} This chapter briefly explains how to create a Windows extension module for Python using Microsoft Visual \Cpp{}, and follows with more detailed background information on how it works. The explanatory material is useful for both the Windows programmer learning to build Python extensions and the \UNIX{} programmer interested in producing software which can be successfully built on both \UNIX{} and Windows. \section{A Cookbook Approach \label{win-cookbook}} \sectionauthor{Neil Schemenauer}{neil_schemenauer@transcanada.com} This section provides a recipe for building a Python extension on Windows. Grab the binary installer from \url{http://www.python.org/} and install Python. The binary installer has all of the required header files except for \file{pyconfig.h}. Get the source distribution and extract it into a convenient location. Copy the \file{pyconfig.h} from the \file{PC/} directory into the \file{include/} directory created by the installer. Create a \file{Setup} file for your extension module, as described in chapter \ref{building-on-unix}. Get David Ascher's \file{compile.py} script from \url{http://starship.python.net/crew/da/compile/}. Run the script to create Microsoft Visual \Cpp{} project files. Open the DSW file in Visual \Cpp{} and select \strong{Build}. If your module creates a new type, you may have trouble with this line: \begin{verbatim} PyObject_HEAD_INIT(&PyType_Type) \end{verbatim} Change it to: \begin{verbatim} PyObject_HEAD_INIT(NULL) \end{verbatim} and add the following to the module initialization function: \begin{verbatim} MyObject_Type.ob_type = &PyType_Type; \end{verbatim} Refer to section 3 of the \citetitle[http://www.python.org/doc/FAQ.html]{Python FAQ} for details on why you must do this. \section{Differences Between \UNIX{} and Windows \label{dynamic-linking}} \sectionauthor{Chris Phoenix}{cphoenix@best.com} \UNIX{} and Windows use completely different paradigms for run-time loading of code. Before you try to build a module that can be dynamically loaded, be aware of how your system works. In \UNIX{}, a shared object (\file{.so}) file contains code to be used by the program, and also the names of functions and data that it expects to find in the program. When the file is joined to the program, all references to those functions and data in the file's code are changed to point to the actual locations in the program where the functions and data are placed in memory. This is basically a link operation. In Windows, a dynamic-link library (\file{.dll}) file has no dangling references. Instead, an access to functions or data goes through a lookup table. So the DLL code does not have to be fixed up at runtime to refer to the program's memory; instead, the code already uses the DLL's lookup table, and the lookup table is modified at runtime to point to the functions and data. In \UNIX{}, there is only one type of library file (\file{.a}) which contains code from several object files (\file{.o}). During the link step to create a shared object file (\file{.so}), the linker may find that it doesn't know where an identifier is defined. The linker will look for it in the object files in the libraries; if it finds it, it will include all the code from that object file. In Windows, there are two types of library, a static library and an import library (both called \file{.lib}). A static library is like a \UNIX{} \file{.a} file; it contains code to be included as necessary. An import library is basically used only to reassure the linker that a certain identifier is legal, and will be present in the program when the DLL is loaded. So the linker uses the information from the import library to build the lookup table for using identifiers that are not included in the DLL. When an application or a DLL is linked, an import library may be generated, which will need to be used for all future DLLs that depend on the symbols in the application or DLL. Suppose you are building two dynamic-load modules, B and C, which should share another block of code A. On \UNIX{}, you would \emph{not} pass \file{A.a} to the linker for \file{B.so} and \file{C.so}; that would cause it to be included twice, so that B and C would each have their own copy. In Windows, building \file{A.dll} will also build \file{A.lib}. You \emph{do} pass \file{A.lib} to the linker for B and C. \file{A.lib} does not contain code; it just contains information which will be used at runtime to access A's code. In Windows, using an import library is sort of like using \samp{import spam}; it gives you access to spam's names, but does not create a separate copy. On \UNIX{}, linking with a library is more like \samp{from spam import *}; it does create a separate copy. \section{Using DLLs in Practice \label{win-dlls}} \sectionauthor{Chris Phoenix}{cphoenix@best.com} Windows Python is built in Microsoft Visual \Cpp{}; using other compilers may or may not work (though Borland seems to). The rest of this section is MSV\Cpp{} specific. When creating DLLs in Windows, you must pass \file{python15.lib} to the linker. To build two DLLs, spam and ni (which uses C functions found in spam), you could use these commands: \begin{verbatim} cl /LD /I/python/include spam.c ../libs/python15.lib cl /LD /I/python/include ni.c spam.lib ../libs/python15.lib \end{verbatim} The first command created three files: \file{spam.obj}, \file{spam.dll} and \file{spam.lib}. \file{Spam.dll} does not contain any Python functions (such as \cfunction{PyArg_ParseTuple()}), but it does know how to find the Python code thanks to \file{python15.lib}. The second command created \file{ni.dll} (and \file{.obj} and \file{.lib}), which knows how to find the necessary functions from spam, and also from the Python executable. Not every identifier is exported to the lookup table. If you want any other modules (including Python) to be able to see your identifiers, you have to say \samp{_declspec(dllexport)}, as in \samp{void _declspec(dllexport) initspam(void)} or \samp{PyObject _declspec(dllexport) *NiGetSpamData(void)}. Developer Studio will throw in a lot of import libraries that you do not really need, adding about 100K to your executable. To get rid of them, use the Project Settings dialog, Link tab, to specify \emph{ignore default libraries}. Add the correct \file{msvcrt\var{xx}.lib} to the list of libraries. Index: ext.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/ext.tex,v retrieving revision 1.103 retrieving revision 1.103.2.1 diff -C2 -d -r1.103 -r1.103.2.1 *** ext.tex 2001/08/15 19:07:18 1.103 --- ext.tex 2001/08/21 03:05:17 1.103.2.1 *************** *** 51,3212 **** ! \chapter{Extending Python with C or \Cpp{} \label{intro}} ! ! ! It is quite easy to add new built-in modules to Python, if you know ! how to program in C. Such \dfn{extension modules} can do two things ! that can't be done directly in Python: they can implement new built-in ! object types, and they can call C library functions and system calls. ! [...3142 lines suppressed...] ! \end{verbatim} ! \refstmodindex{distutils.sysconfig} ! ! The contents of the string presented will be the options that should ! be used. If the string is empty, there's no need to add any ! additional options. The \constant{LINKFORSHARED} definition ! corresponds to the variable of the same name in Python's top-level ! \file{Makefile}. --- 51,59 ---- ! \input{extending} ! \input{newtypes} ! \input{unix} ! \input{windows} ! \input{embedding} From gvanrossum@users.sourceforge.net Tue Aug 21 04:24:07 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:24:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.165.2.1,1.165.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv1570/branch/Modules Modified Files: Tag: r22a2-branch socketmodule.c Log Message: Merge trunk->branch Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.165.2.1 retrieving revision 1.165.2.2 diff -C2 -d -r1.165.2.1 -r1.165.2.2 *** socketmodule.c 2001/08/20 19:48:32 1.165.2.1 --- socketmodule.c 2001/08/21 03:24:05 1.165.2.2 *************** *** 2628,2633 **** if (self->server_cert) /* Possible not to have one? */ X509_free (self->server_cert); - SSL_CTX_free(self->ctx); SSL_free(self->ssl); Py_XDECREF(self->x_attr); Py_XDECREF(self->Socket); --- 2628,2633 ---- if (self->server_cert) /* Possible not to have one? */ X509_free (self->server_cert); SSL_free(self->ssl); + SSL_CTX_free(self->ctx); Py_XDECREF(self->x_attr); Py_XDECREF(self->Socket); From gvanrossum@users.sourceforge.net Tue Aug 21 04:25:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:25:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python future.c,2.10,2.10.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv1851/branch/Python Modified Files: Tag: r22a2-branch future.c Log Message: Merge trunk->branch Index: future.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/future.c,v retrieving revision 2.10 retrieving revision 2.10.2.1 diff -C2 -d -r2.10 -r2.10.2.1 *** future.c 2001/08/10 21:41:33 2.10 --- future.c 2001/08/21 03:25:15 2.10.2.1 *************** *** 9,12 **** --- 9,15 ---- #define FUTURE_IMPORT_STAR "future statement does not support import *" + /* FUTURE_POSSIBLE() is provided to accomodate doc strings, which is + the only statement that can occur before a future statement. + */ #define FUTURE_POSSIBLE(FF) ((FF)->ff_last_lineno == -1) *************** *** 58,62 **** "beginning of the file"); PyErr_SyntaxLocation(filename, n->n_lineno); - /* XXX set filename and lineno */ } --- 61,64 ---- *************** *** 76,80 **** */ ! /* future_parse() return values: -1 indicates an error occurred, e.g. unknown feature name 0 indicates no feature was found --- 78,87 ---- */ ! /* future_parse() finds future statements at the beginnning of a ! module. The function calls itself recursively, rather than ! factoring out logic for different kinds of statements into ! different routines. ! ! Return values: -1 indicates an error occurred, e.g. unknown feature name 0 indicates no feature was found *************** *** 98,106 **** case file_input: for (i = 0; i < NCH(n); i++) { node *ch = CHILD(n, i); if (TYPE(ch) == stmt) { r = future_parse(ff, ch, filename); ! if (!FUTURE_POSSIBLE(ff)) return r; } --- 105,121 ---- case file_input: + /* Check each statement in the file, starting with the + first, and continuing until the first statement + that isn't a future statement. + */ for (i = 0; i < NCH(n); i++) { node *ch = CHILD(n, i); if (TYPE(ch) == stmt) { r = future_parse(ff, ch, filename); ! /* Need to check both conditions below ! to accomodate doc strings, which ! causes r < 0. ! */ ! if (r < 1 && !FUTURE_POSSIBLE(ff)) return r; } From gvanrossum@users.sourceforge.net Tue Aug 21 04:36:05 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:36:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib HTMLParser.py,1.4,1.4.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3678 Modified Files: Tag: r22a2-branch HTMLParser.py Log Message: Merge trunk->branch Index: HTMLParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/HTMLParser.py,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** HTMLParser.py 2001/08/03 19:50:59 1.4 --- HTMLParser.py 2001/08/21 03:36:03 1.4.2.1 *************** *** 16,20 **** interesting_normal = re.compile('[&<]') interesting_cdata = re.compile(r'<(/|\Z)') ! incomplete = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*|#[0-9]*)?') entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') --- 16,21 ---- interesting_normal = re.compile('[&<]') interesting_cdata = re.compile(r'<(/|\Z)') ! incomplete = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*' ! '|#([0-9]*|[xX][0-9a-fA-F]*))?') entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') *************** *** 186,194 **** k = self.parse_declaration(i) else: ! if i < n-1: ! raise HTMLParseError( ! "invalid '<' construct: %s" % `rawdata[i:i+2]`, ! self.getpos()) ! k = -1 if k < 0: if end: --- 187,192 ---- k = self.parse_declaration(i) else: ! self.handle_data("<") ! k = i + 1 if k < 0: if end: *************** *** 204,208 **** k = match.end() if rawdata[k-1] != ';': ! k = k-1 i = self.updatepos(i, k) continue --- 202,206 ---- k = match.end() if rawdata[k-1] != ';': ! k = k - 1 i = self.updatepos(i, k) continue *************** *** 213,227 **** k = match.end() if rawdata[k-1] != ';': ! k = k-1 i = self.updatepos(i, k) continue ! if incomplete.match(rawdata, i): ! if end: raise HTMLParseError( "EOF in middle of entity or char ref", self.getpos()) return -1 # incomplete ! raise HTMLParseError("'&' not part of entity or char ref", ! self.getpos()) else: assert 0, "interesting.search() lied" --- 211,227 ---- k = match.end() if rawdata[k-1] != ';': ! k = k - 1 i = self.updatepos(i, k) continue ! match = incomplete.match(rawdata, i) ! if match: ! rest = rawdata[i:] ! if end and rest != "&" and match.group() == rest: raise HTMLParseError( "EOF in middle of entity or char ref", self.getpos()) return -1 # incomplete ! self.handle_data("&") ! i = self.updatepos(i, i + 1) else: assert 0, "interesting.search() lied" From gvanrossum@users.sourceforge.net Tue Aug 21 04:37:44 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:37:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_future,1.2,1.2.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv4055/output Modified Files: Tag: r22a2-branch test_future Log Message: Merge trunk->branch Index: test_future =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_future,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -C2 -d -r1.2 -r1.2.6.1 *** test_future 2001/04/18 01:19:28 1.2 --- test_future 2001/08/21 03:37:42 1.2.6.1 *************** *** 2,5 **** --- 2,6 ---- 6 6 + 2 SyntaxError badsyntax_future3 3 SyntaxError badsyntax_future4 3 From gvanrossum@users.sourceforge.net Tue Aug 21 04:37:44 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:37:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_future3.py,NONE,1.3.2.1 test_socket_ssl.py,NONE,1.1.2.1 regrtest.py,1.41,1.41.2.1 test_future.py,1.3,1.3.6.1 test_htmlparser.py,1.3,1.3.2.1 test_largefile.py,1.4,1.4.8.1 test_os.py,1.3.2.1,1.3.2.2 test_support.py,1.25,1.25.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv4055 Modified Files: Tag: r22a2-branch regrtest.py test_future.py test_htmlparser.py test_largefile.py test_os.py test_support.py Added Files: Tag: r22a2-branch test_future3.py test_socket_ssl.py Log Message: Merge trunk->branch --- NEW FILE: test_future3.py --- from __future__ import nested_scopes from __future__ import division from __future__ import nested_scopes def f(x): def g(y): return y // x return g print f(2)(5) --- NEW FILE: test_socket_ssl.py --- # Test just the SSL support in the socket module, in a moderately bogus way. import test_support # Optionally test SSL support. This currently requires the 'network' resource # as given on the regrtest command line. If not available, nothing after this # line will be executed. test_support.requires('network') import socket import urllib urllib.urlopen('https://sf.net') Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.41 retrieving revision 1.41.2.1 diff -C2 -d -r1.41 -r1.41.2.1 *** regrtest.py 2001/08/12 21:53:08 1.41 --- regrtest.py 2001/08/21 03:37:42 1.41.2.1 *************** *** 16,20 **** -r: random -- randomize test execution order -l: findleaks -- if GC is available detect tests that leak memory ! --have-resources -- run tests that require large resources (time/space) If non-option arguments are present, they are names for tests to run, --- 16,21 ---- -r: random -- randomize test execution order -l: findleaks -- if GC is available detect tests that leak memory ! -u: use -- specify which special resource intensive tests to run ! -h: help -- print this text and exit If non-option arguments are present, they are names for tests to run, *************** *** 31,34 **** --- 32,46 ---- used instead of /tmp). + -u is used to specify which special resource intensive tests to run, such as + those requiring large file support or network connectivity. The argument is a + comma-separated list of words indicating the resources to test. Currently + only the following are defined: + + largefile - It is okay to run some test that may create huge files. These + tests can take a long time and may consume >2GB of disk space + temporarily. + + network - It is okay to run tests that use external network resource, + e.g. testing SSL support for sockets. """ *************** *** 42,48 **** import test_support def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, findleaks=0, ! use_large_resources=0): """Execute a test suite. --- 54,66 ---- import test_support + def usage(code, msg=''): + print __doc__ + if msg: print msg + sys.exit(code) + + def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, findleaks=0, ! use_resources=None): """Execute a test suite. *************** *** 61,66 **** files beginning with test_ will be used. ! The other seven default arguments (verbose, quiet, generate, exclude, ! single, randomize, and findleaks) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. --- 79,84 ---- files beginning with test_ will be used. ! The other default arguments (verbose, quiet, generate, exclude, single, ! randomize, findleaks, and use_resources) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. *************** *** 69,89 **** try: ! opts, args = getopt.getopt(sys.argv[1:], 'vgqxsrl', ['have-resources']) except getopt.error, msg: ! print msg ! print __doc__ ! return 2 for o, a in opts: ! if o == '-v': verbose = verbose+1 ! if o == '-q': quiet = 1; verbose = 0 ! if o == '-g': generate = 1 ! if o == '-x': exclude = 1 ! if o == '-s': single = 1 ! if o == '-r': randomize = 1 ! if o == '-l': findleaks = 1 ! if o == '--have-resources': use_large_resources = 1 if generate and verbose: ! print "-g and -v don't go together!" ! return 2 good = [] bad = [] --- 87,126 ---- try: ! opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrlu:', ! ['help', 'verbose', 'quiet', 'generate', ! 'exclude', 'single', 'random', ! 'findleaks', 'use=']) except getopt.error, msg: ! usage(2, msg) ! ! # Defaults ! if use_resources is None: ! use_resources = [] for o, a in opts: ! if o in ('-h', '--help'): ! usage(0) ! elif o in ('-v', '--verbose'): ! verbose += 1 ! elif o in ('-q', '--quiet'): ! quiet = 1; ! verbose = 0 ! elif o in ('-g', '--generate'): ! generate = 1 ! elif o in ('-x', '--exclude'): ! exclude = 1 ! elif o in ('-s', '--single'): ! single = 1 ! elif o in ('-r', '--randomize'): ! randomize = 1 ! elif o in ('-l', '--findleaks'): ! findleaks = 1 ! elif o in ('-u', '--use'): ! use_resources = [x.lower() for x in a.split(',')] ! for r in use_resources: ! if r not in ('largefile', 'network'): ! usage(1, 'Invalid -u/--use option: %s' % a) if generate and verbose: ! usage(2, "-g and -v don't go together!") ! good = [] bad = [] *************** *** 131,135 **** random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet ! test_support.use_large_resources = use_large_resources save_modules = sys.modules.keys() for test in tests: --- 168,172 ---- random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet ! test_support.use_resources = use_resources save_modules = sys.modules.keys() for test in tests: *************** *** 198,203 **** os.unlink(filename) ! return len(bad) > 0 STDTESTS = [ 'test_grammar', --- 235,241 ---- os.unlink(filename) ! sys.exit(len(bad) > 0) + STDTESTS = [ 'test_grammar', *************** *** 215,218 **** --- 253,257 ---- 'test_future1', 'test_future2', + 'test_future3', ] *************** *** 347,351 **** class Compare: - def __init__(self, filename): if os.path.exists(filename): --- 386,389 ---- *************** *** 452,455 **** --- 490,494 ---- test_pwd test_signal + test_socket_ssl test_socketserver test_sunaudiodev *************** *** 467,470 **** --- 506,510 ---- test_nis test_ntpath + test_socket_ssl test_socketserver test_sunaudiodev *************** *** 497,499 **** if __name__ == '__main__': ! sys.exit(main()) --- 537,539 ---- if __name__ == '__main__': ! main() Index: test_future.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_future.py,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** test_future.py 2001/04/18 01:19:27 1.3 --- test_future.py 2001/08/21 03:37:42 1.3.6.1 *************** *** 18,21 **** --- 18,24 ---- import test_future2 + unload('test_future3') + import test_future3 + # The remaining tests should fail try: Index: test_htmlparser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_htmlparser.py,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** test_htmlparser.py 2001/08/03 19:53:01 1.3 --- test_htmlparser.py 2001/08/21 03:37:42 1.3.2.1 *************** *** 2,5 **** --- 2,6 ---- import HTMLParser + import pprint import sys import test_support *************** *** 84,90 **** parser.feed(c) parser.close() ! self.assert_(parser.get_events() == ! self.initial_events + events + self.final_events, ! parser.get_events()) def _run_check_extra(self, source, events): --- 85,92 ---- parser.feed(c) parser.close() ! events = parser.get_events() ! self.assertEqual(events, ! self.initial_events + events + self.final_events, ! "got events:\n" + pprint.pformat(events)) def _run_check_extra(self, source, events): *************** *** 138,141 **** --- 140,155 ---- ]) + def test_doctype_decl(self): + inside = """\ + DOCTYPE html [ + + + + ]""" + self._run_check("" % inside, [ + ("decl", inside), + ]) + def test_bad_nesting(self): # Strangely, this *is* supposed to test that overlapping *************** *** 149,152 **** --- 163,176 ---- ]) + def test_bare_ampersands(self): + self._run_check("this text & contains & ampersands &", [ + ("data", "this text & contains & ampersands &"), + ]) + + def test_bare_pointy_brackets(self): + self._run_check("this < text > contains < bare>pointy< brackets", [ + ("data", "this < text > contains < bare>pointy< brackets"), + ]) + def test_attr_syntax(self): output = [ *************** *** 200,205 **** def test_starttag_junk_chars(self): - self._parse_error("<") - self._parse_error("<>") self._parse_error("") self._parse_error("") --- 224,227 ---- *************** *** 208,213 **** self._parse_error("") self._parse_error("") - self._parse_error("<$") - self._parse_error("<$>") self._parse_error("") --- 230,233 ---- Index: test_largefile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_largefile.py,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** test_largefile.py 2001/04/10 14:50:51 1.4 --- test_largefile.py 2001/08/21 03:37:42 1.4.8.1 *************** *** 31,41 **** ! # on Windows this test comsumes large resources: ! # it takes a long time to build the >2GB file and takes >2GB of disk space ! # therefore test_support.use_large_resources must be defined to run this test ! if sys.platform[:3] == 'win' and not test_support.use_large_resources: ! raise test_support.TestSkipped, \ ! "test requires %s bytes and a long time to run" % str(size) ! --- 31,42 ---- ! # On Windows this test comsumes large resources; It takes a long time to build ! # the >2GB file and takes >2GB of disk space therefore the resource must be ! # enabled to run this test. If not, nothing after this line stanza will be ! # executed. ! if sys.platform[:3] == 'win': ! test_support.requires( ! 'largefile', ! 'test requires %s bytes and a long time to run' % str(size)) Index: test_os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** test_os.py 2001/08/19 06:46:54 1.3.2.1 --- test_os.py 2001/08/21 03:37:42 1.3.2.2 *************** *** 34,37 **** --- 34,39 ---- if not hasattr(os, "tempnam"): return + warnings.filterwarnings("ignore", "tempnam", RuntimeWarning, + "test_os") self.check_tempfile(os.tempnam()) *************** *** 56,59 **** --- 58,63 ---- if not hasattr(os, "tmpnam"): return + warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning, + "test_os") self.check_tempfile(os.tmpnam()) Index: test_support.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -C2 -d -r1.25 -r1.25.2.1 *** test_support.py 2001/08/17 18:39:24 1.25 --- test_support.py 2001/08/21 03:37:42 1.25.2.1 *************** *** 20,25 **** """ ! verbose = 1 # Flag set to 0 by regrtest.py ! use_large_resources = 1 # Flag set to 0 by regrtest.py def unload(name): --- 20,25 ---- """ ! verbose = 1 # Flag set to 0 by regrtest.py ! use_resources = [] # Flag set to [] by regrtest.py def unload(name): *************** *** 37,40 **** --- 37,46 ---- except os.error: pass + + def requires(resource, msg=None): + if resource not in use_resources: + if msg is None: + msg = "Use of the `%s' resource not enabled" % resource + raise TestSkipped(msg) FUZZ = 1e-6 From gvanrossum@users.sourceforge.net Tue Aug 21 04:39:10 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 20 Aug 2001 20:39:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib asyncore.py,1.16,1.16.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv4305 Modified Files: Tag: r22a2-branch asyncore.py Log Message: Merge trunk->branch Index: asyncore.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -C2 -d -r1.16 -r1.16.2.1 *** asyncore.py 2001/08/13 15:21:55 1.16 --- asyncore.py 2001/08/21 03:39:08 1.16.2.1 *************** *** 55,59 **** import os from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ ! ENOTCONN, ESHUTDOWN try: --- 55,59 ---- import os from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ ! ENOTCONN, ESHUTDOWN try: From montanaro@users.sourceforge.net Tue Aug 21 05:23:23 2001 From: montanaro@users.sourceforge.net (Skip Montanaro) Date: Mon, 20 Aug 2001 21:23:23 -0700 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.50,1.51 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv11570 Modified Files: setup.py Log Message: This is supposed to help configure better sort out the various libdb incarnations. It's probably not quite sufficient, but should be better than the status quo... Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** setup.py 2001/08/17 18:39:24 1.50 --- setup.py 2001/08/21 04:23:21 1.51 *************** *** 390,394 **** dblib = [] ! if self.compiler.find_library_file(lib_dirs, 'db'): dblib = ['db'] --- 390,400 ---- dblib = [] ! if self.compiler.find_library_file(lib_dirs, 'db-3.1'): ! dblib = ['db-3.1'] ! elif self.compiler.find_library_file(lib_dirs, 'db2'): ! dblib = ['db2'] ! elif self.compiler.find_library_file(lib_dirs, 'db1'): ! dblib = ['db1'] ! elif self.compiler.find_library_file(lib_dirs, 'db'): dblib = ['db'] From ping@users.sourceforge.net Tue Aug 21 07:53:03 2001 From: ping@users.sourceforge.net (Ka-Ping Yee) Date: Mon, 20 Aug 2001 23:53:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib cgitb.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv29874 Modified Files: cgitb.py Log Message: Enhancements: - file URL now starts with "file://" (standard) rather than "file:" - new optional argument 'context' to enable() - repeated variable names don't have their values shown twice - dotted attributes are shown; missing attributes handled reasonably - highlight the whole logical line even if it has multiple physical lines - use nice generator interface to tokenize - formatting fixed so that it looks good in lynx, links, and w3m too Index: cgitb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/cgitb.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cgitb.py 2001/08/18 04:04:50 1.1 --- cgitb.py 2001/08/21 06:53:01 1.2 *************** *** 9,14 **** display - if true, tracebacks are displayed in the web browser logdir - if set, tracebacks are written to files in this directory ! By default, tracebacks are displayed but not written to files. Alternatively, if you have caught an exception and want cgitb to display it --- 9,15 ---- display - if true, tracebacks are displayed in the web browser logdir - if set, tracebacks are written to files in this directory + context - number of lines of source code to show for each stack frame ! By default, tracebacks are displayed but not saved, and context is 5. Alternatively, if you have caught an exception and want cgitb to display it *************** *** 24,36 **** Content-Type: text/html ! --> ! --> -->

    ''' ! def html(etype, evalue, etb, context=5): ! """Return a nice HTML document describing the traceback.""" ! import sys, os, types, time, traceback ! import keyword, tokenize, linecache, inspect, pydoc if type(etype) is types.ClassType: --- 25,71 ---- Content-Type: text/html ! --> ! --> --> ''' ! __UNDEF__ = [] # a special sentinel object ! def small(text): return '' + text + '' ! def strong(text): return '' + text + '' ! def grey(text): return '' + text + '' ! ! def lookup(name, frame, locals): ! """Find the value for a given name in the given environment.""" ! if name in locals: ! return 'local', locals[name] ! if name in frame.f_globals: ! return 'global', frame.f_globals[name] ! return None, __UNDEF__ ! ! def scanvars(reader, frame, locals): ! """Scan one logical line of Python and look up values of variables used.""" ! import tokenize, keyword ! vars, lasttoken, parent, prefix = [], None, None, '' ! for ttype, token, start, end, line in tokenize.generate_tokens(reader): ! if ttype == tokenize.NEWLINE: break ! if ttype == tokenize.NAME and token not in keyword.kwlist: ! if lasttoken == '.': ! if parent is not __UNDEF__: ! value = getattr(parent, token, __UNDEF__) ! vars.append((prefix + token, prefix, value)) ! else: ! where, value = lookup(token, frame, locals) ! vars.append((token, where, value)) ! elif token == '.': ! prefix += lasttoken + '.' ! parent = value ! else: ! parent, prefix = None, '' ! lasttoken = token ! return vars ! ! def html((etype, evalue, etb), context=5): ! """Return a nice HTML document describing a given traceback.""" ! import sys, os, types, time, traceback, linecache, inspect, pydoc if type(etype) is types.ClassType: *************** *** 38,117 **** pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.time()) ! head = '' + pydoc.html.heading( '%s' % str(etype), ! '#ffffff', '#aa55cc', pyver + '
    ' + date) + ''' !

    A problem occurred in a Python script. ! Here is the sequence of function calls leading up to ! the error, with the most recent (innermost) call last.''' ! indent = '' + ' ' * 5 + ' ' frames = [] records = inspect.getinnerframes(etb, context) for frame, file, lnum, func, lines, index in records: file = file and os.path.abspath(file) or '?' ! link = '%s' % (file, pydoc.html.escape(file)) args, varargs, varkw, locals = inspect.getargvalues(frame) ! if func == '?': ! call = '' ! else: ! def eqrepr(value): return '=' + pydoc.html.repr(value) ! call = 'in %s' % func + inspect.formatargvalues( ! args, varargs, varkw, locals, formatvalue=eqrepr) ! ! names = [] ! def tokeneater(type, token, start, end, line): ! if type == tokenize.NAME and token not in keyword.kwlist: ! if token not in names: names.append(token) ! if type == tokenize.NEWLINE: raise IndexError ! def linereader(lnum=[lnum]): ! line = linecache.getline(file, lnum[0]) ! lnum[0] += 1 ! return line ! try: ! tokenize.tokenize(linereader, tokeneater) ! except IndexError: pass ! lvals = [] ! for name in names: ! if name in frame.f_code.co_varnames: ! if locals.has_key(name): ! value = pydoc.html.repr(locals[name]) ! else: ! value = 'undefined' ! name = '%s' % name ! else: ! if frame.f_globals.has_key(name): ! value = pydoc.html.repr(frame.f_globals[name]) ! else: ! value = 'undefined' ! name = 'global %s' % name ! lvals.append('%s = %s' % (name, value)) ! if lvals: ! lvals = indent + ''' ! %s
    ''' % (', '.join(lvals)) ! else: ! lvals = '' ! level = ''' ! !
    %s %s
    \n''' % (link, call) ! excerpt = [] if index is not None: i = lnum - index for line in lines: ! num = '%s' % ( ! ' ' * (5-len(str(i))) + str(i)) ! line = '%s %s' % (num, pydoc.html.preformat(line)) ! if i == lnum: ! line = ''' ! !
    %s
    \n''' % line ! excerpt.append('\n' + line) ! if i == lnum: ! excerpt.append(lvals) ! i = i + 1 ! frames.append('

    ' + level + '\n'.join(excerpt)) ! exception = ['

    %s: %s' % (str(etype), str(evalue))] if type(evalue) is types.InstanceType: for name in dir(evalue): --- 73,133 ---- pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.time()) ! head = '' + pydoc.html.heading( '%s' % str(etype), ! '#ffffff', '#6622aa', pyver + '
    ' + date) + ''' !

    A problem occurred in a Python script. Here is the sequence of ! function calls leading up to the error, in the order they occurred.''' ! indent = '' + small(' ' * 5) + ' ' frames = [] records = inspect.getinnerframes(etb, context) for frame, file, lnum, func, lines, index in records: file = file and os.path.abspath(file) or '?' ! link = '%s' % (file, pydoc.html.escape(file)) args, varargs, varkw, locals = inspect.getargvalues(frame) ! call = '' ! if func != '?': ! call = 'in ' + strong(func) + \ ! inspect.formatargvalues(args, varargs, varkw, locals, ! formatvalue=lambda value: '=' + pydoc.html.repr(value)) ! highlight = {} ! def reader(lnum=[lnum]): ! highlight[lnum[0]] = 1 ! try: return linecache.getline(file, lnum[0]) ! finally: lnum[0] += 1 ! vars = scanvars(reader, frame, locals) ! rows = ['%s%s %s' % ! (' ', link, call)] if index is not None: i = lnum - index for line in lines: ! num = small(' ' * (5-len(str(i))) + str(i)) + ' ' ! line = '%s%s' % (num, pydoc.html.preformat(line)) ! if i in highlight: ! rows.append('%s' % line) ! else: ! rows.append('%s' % grey(line)) ! i += 1 ! done, dump = {}, [] ! for name, where, value in vars: ! if name in done: continue ! done[name] = 1 ! if value is not __UNDEF__: ! if where == 'global': name = 'global ' + strong(name) ! elif where == 'local': name = strong(name) ! else: name = where + strong(name.split('.')[-1]) ! dump.append('%s = %s' % (name, pydoc.html.repr(value))) ! else: ! dump.append(name + ' undefined') ! ! rows.append('%s' % small(grey(', '.join(dump)))) ! frames.append('''

    ! ! %s
    ''' % '\n'.join(rows)) ! ! exception = ['

    %s: %s' % (strong(str(etype)), str(evalue))] if type(evalue) is types.InstanceType: for name in dir(evalue): *************** *** 120,163 **** import traceback - plaintrace = ''.join(traceback.format_exception(etype, evalue, etb)) - return head + ''.join(frames) + ''.join(exception) + ''' ! ! ''' % plaintrace class Hook: ! def __init__(self, display=1, logdir=None): self.display = display # send tracebacks to browser if true self.logdir = logdir # log tracebacks to files if not None def __call__(self, etype, evalue, etb): - """This hook can replace sys.excepthook (for Python 2.1 or higher).""" self.handle((etype, evalue, etb)) def handle(self, info=None): ! import sys, os info = info or sys.exc_info() - text = 0 print reset() try: ! doc = html(*info) except: # just in case something goes wrong import traceback ! doc = ''.join(traceback.format_exception(*info)) ! text = 1 if self.display: if text: doc = doc.replace('&', '&').replace('<', '<') ! print '

    ', doc, '
    ' else: print doc --- 136,176 ---- import traceback return head + ''.join(frames) + ''.join(exception) + ''' ! ! ''' % ''.join(traceback.format_exception(etype, evalue, etb)) class Hook: ! """A hook to replace sys.excepthook that shows tracebacks in HTML.""" ! ! def __init__(self, display=1, logdir=None, context=5): self.display = display # send tracebacks to browser if true self.logdir = logdir # log tracebacks to files if not None + self.context = context # number of source code lines per frame def __call__(self, etype, evalue, etb): self.handle((etype, evalue, etb)) def handle(self, info=None): ! import sys info = info or sys.exc_info() print reset() try: ! text, doc = 0, html(info, self.context) except: # just in case something goes wrong import traceback ! text, doc = 1, ''.join(traceback.format_exception(*info)) if self.display: if text: doc = doc.replace('&', '&').replace('<', '<') ! print '
    ' + doc + '
    ' else: print doc *************** *** 166,170 **** if self.logdir is not None: ! import tempfile name = tempfile.mktemp(['.html', '.txt'][text]) path = os.path.join(self.logdir, os.path.basename(name)) --- 179,183 ---- if self.logdir is not None: ! import os, tempfile name = tempfile.mktemp(['.html', '.txt'][text]) path = os.path.join(self.logdir, os.path.basename(name)) *************** *** 173,182 **** file.write(doc) file.close() ! print '

    %s contains the description of this error.' % path except: ! print '

    Tried to write to %s, but failed.' % path handler = Hook().handle ! def enable(display=1, logdir=None): import sys ! sys.excepthook = Hook(display, logdir) --- 186,200 ---- file.write(doc) file.close() ! print '

    %s contains the description of this error.' % path except: ! print '

    Tried to save traceback to %s, but failed.' % path handler = Hook().handle ! def enable(display=1, logdir=None, context=5): ! """Install an exception handler that formats tracebacks as HTML. ! ! The optional argument 'display' can be set to 0 to suppress sending the ! traceback to the browser, and 'logdir' can be set to a directory to cause ! tracebacks to be written to files there.""" import sys ! sys.excepthook = Hook(display, logdir, context) From gstein@users.sourceforge.net Tue Aug 21 09:16:37 2001 From: gstein@users.sourceforge.net (Greg Stein) Date: Tue, 21 Aug 2001 01:16:37 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0268.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv625 Modified Files: pep-0268.txt Log Message: Add some initial details for the authentication handling. Index: pep-0268.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0268.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0268.txt 2001/08/21 00:02:26 1.1 --- pep-0268.txt 2001/08/21 08:16:35 1.2 *************** *** 14,18 **** This PEP discusses new modules and extended functionality for ! Python's HTTP support. Notably, the addition of authenticated requests, proxy support, authenticated proxy usage, and WebDAV [1] capabilities. --- 14,18 ---- This PEP discusses new modules and extended functionality for ! Python's HTTP support. Notably, the addition of authenticated requests, proxy support, authenticated proxy usage, and WebDAV [1] capabilities. *************** *** 22,31 **** Python has been quite popular as a result of its "batteries ! included" positioning. One of the most heavily used protocols, ! HTTP, has been included with Python for years (httplib). However, this support has not kept up with the full needs and requirements ! of many HTTP-based applications and systems. In addition, new protocols based on HTTP, such as WebDAV and XML-RPC, are becoming ! useful and are seeing increasing usage. Supplying this functionality meets Python's "batteries included" role and also keeps Python at the leading edge of new technologies. --- 22,31 ---- Python has been quite popular as a result of its "batteries ! included" positioning. One of the most heavily used protocols, ! HTTP [2], has been included with Python for years (httplib). However, this support has not kept up with the full needs and requirements ! of many HTTP-based applications and systems. In addition, new protocols based on HTTP, such as WebDAV and XML-RPC, are becoming ! useful and are seeing increasing usage. Supplying this functionality meets Python's "batteries included" role and also keeps Python at the leading edge of new technologies. *************** *** 34,40 **** features missing from Python's core HTTP processing, they are minimally handled as part of Python's URL handling (urllib and ! urllib2). However, applications that need fine-grained or sophisticated HTTP handling cannot make use of the features while ! they reside in urllib. Refactoring these features into a location where they can be directly associated with an HTTP connection will improve their utility for both urllib and for sophisticated --- 34,40 ---- features missing from Python's core HTTP processing, they are minimally handled as part of Python's URL handling (urllib and ! urllib2). However, applications that need fine-grained or sophisticated HTTP handling cannot make use of the features while ! they reside in urllib. Refactoring these features into a location where they can be directly associated with an HTTP connection will improve their utility for both urllib and for sophisticated *************** *** 43,47 **** The motivation for this PEP was from several people requesting these features directly, and from a number of feature requests on ! SourceForge. Since the exact form of the modules to be provided and the classes/architecture used could be subject to debate, this PEP was created to provide a focal point for those discussions. --- 43,47 ---- The motivation for this PEP was from several people requesting these features directly, and from a number of feature requests on ! SourceForge. Since the exact form of the modules to be provided and the classes/architecture used could be subject to debate, this PEP was created to provide a focal point for those discussions. *************** *** 50,59 **** Specification ! more info here... Reference Implementation ! reference imp will probably go into /nondist/sandbox/... --- 50,133 ---- Specification ! Two modules will be added to the standard library: 'httpx' (HTTP ! extended functionality), and 'davlib' (WebDAV library). ! ! [ suggestions for module names are welcome; davlib has some ! precedence, but something like 'webdav' might be desirable ] ! ! ! HTTP Authentication ! ! The httpx module will provide a mixin for performing HTTP ! authentication (for both proxy and origin server ! authentication). This mixin (httpx.HandleAuthentication) can be ! combined with the HTTPConnection or the HTTPSConnection classes ! (the mixin may possibly work with the HTTP and HTTPS compatibility ! classes, but that is not a requirement). ! ! The mixin will delegate the authentication process to one or more ! "authenticator" objects, allowing multiple connections to share ! authenticators. The use of a separate object allows for a long ! term connection to an authentication system (e.g. LDAP). An ! authenticator for the Basic mechanism [3] will be provided. Digest ! would be great, but we need to find some code for it (or a ! motivated developer). User-supplied authenticator subclasses can ! be registered and used by the connections. ! ! A "credentials" object is also associated with the mixin, and ! stores the credentials (e.g. username and password) needed by the ! authenticators. Subclasses of the credentials object can be ! created to hold additional information (e.g. NT domain). ! ! The mixin overrides the getresponse() method to detect 401 ! (Unauthorized) and 407 (Proxy Authentication Required) ! responses. When this is found, the response object, the ! connection, and the credentials are passed to the authenticator ! corresponding with the authentication scheme specified in the ! response (multiple authenticators are tried in decreasing order of ! security if multiple schemes are in the response). Each ! authenticator can examine the response headers and decide whether ! and how to resend the request with the correct authentication ! headers. + Resending a request, with the appropriate credentials, is one of + the more difficult portions of the authentication system. The + difficulty arises in recording what was sent originally: the + request line, the headers, and the body. By overriding putrequest, + putheader, and endheaders, we can capture all but the body. Once + the endheaders method is called, then we capture all calls to + send() (until the next putrequest method call) to hold the body + content. The mixin will have a configurable limit for the amount + of data to hold in this fashion (e.g. only hold up to 100k of body + content). Assuming that the entire body has been stored, then we + can resend the request with the appropriate authentication + information. + + [ what to do when the body is too big: raise an error? special + return value? ... ] + [ need more info here about storing realms/headers in the + credentials object (keyed by host, port) ... resending those + automatically when making requests ... persisting the credentials + object to have the info next time ... ] + + [ two sets of credentials: one for proxy, one for origin ... ] + + + Proxy Handling + + ... info about proxy handling ... note that proxy auth is handled + above ... + + + WebDAV Features + + ... info about the dav module ... + + Reference Implementation ! reference impl will probably go into /nondist/sandbox/ until ! accepted into the main Lib directory ... *************** *** 61,64 **** --- 135,142 ---- [1] http://www.webdav.org/ + + [2] http://asg.web.cmu.edu/rfc/rfc2616.html + + [3] http://asg.web.cmu.edu/rfc/rfc2617.html From gstein@users.sourceforge.net Tue Aug 21 09:22:49 2001 From: gstein@users.sourceforge.net (Greg Stein) Date: Tue, 21 Aug 2001 01:22:49 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0268.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv3404 Modified Files: pep-0268.txt Log Message: Update the text to use direct RFC references (to automagically pick up URLs to those specs). Fix the PEP: header at top, after Barry's renumbering. Index: pep-0268.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0268.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0268.txt 2001/08/21 08:16:35 1.2 --- pep-0268.txt 2001/08/21 08:22:47 1.3 *************** *** 1,3 **** ! PEP: 267 Title: Extended HTTP functionality and WebDAV Version: $Revision$ --- 1,3 ---- ! PEP: 268 Title: Extended HTTP functionality and WebDAV Version: $Revision$ *************** *** 23,33 **** Python has been quite popular as a result of its "batteries included" positioning. One of the most heavily used protocols, ! HTTP [2], has been included with Python for years (httplib). However, ! this support has not kept up with the full needs and requirements ! of many HTTP-based applications and systems. In addition, new ! protocols based on HTTP, such as WebDAV and XML-RPC, are becoming ! useful and are seeing increasing usage. Supplying this ! functionality meets Python's "batteries included" role and also ! keeps Python at the leading edge of new technologies. While authentication and proxy support are two very notable --- 23,34 ---- Python has been quite popular as a result of its "batteries included" positioning. One of the most heavily used protocols, ! HTTP (see RFC 2616), has been included with Python for years ! (httplib). However, this support has not kept up with the full ! needs and requirements of many HTTP-based applications and ! systems. In addition, new protocols based on HTTP, such as WebDAV ! and XML-RPC, are becoming useful and are seeing increasing ! usage. Supplying this functionality meets Python's "batteries ! included" role and also keeps Python at the leading edge of new ! technologies. While authentication and proxy support are two very notable *************** *** 70,77 **** authenticators. The use of a separate object allows for a long term connection to an authentication system (e.g. LDAP). An ! authenticator for the Basic mechanism [3] will be provided. Digest ! would be great, but we need to find some code for it (or a ! motivated developer). User-supplied authenticator subclasses can ! be registered and used by the connections. A "credentials" object is also associated with the mixin, and --- 71,78 ---- authenticators. The use of a separate object allows for a long term connection to an authentication system (e.g. LDAP). An ! authenticator for the Basic mechanism (see RFC 2617) will be ! provided. Digest would be great, but we need to find some code for ! it (or a motivated developer). User-supplied authenticator ! subclasses can be registered and used by the connections. A "credentials" object is also associated with the mixin, and *************** *** 135,142 **** [1] http://www.webdav.org/ - - [2] http://asg.web.cmu.edu/rfc/rfc2616.html - - [3] http://asg.web.cmu.edu/rfc/rfc2617.html --- 136,139 ---- From jackjansen@users.sourceforge.net Tue Aug 21 11:49:14 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 21 Aug 2001 03:49:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_config.h,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv2222 Removed Files: mwerks_config.h Log Message: This file has been dead for aeons. I have no idea how it suddenly surfaced again. --- mwerks_config.h DELETED --- From jackjansen@users.sourceforge.net Tue Aug 21 11:51:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 21 Aug 2001 03:51:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac mwerksglue.c,1.1,NONE fopenRF.c,1.2,NONE mkapplet.py,1.8,NONE errno_unix.h,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv2942 Removed Files: mwerksglue.c fopenRF.c mkapplet.py errno_unix.h Log Message: These long dead files somehow got revived. Killed them (but for how long? :-). --- mwerksglue.c DELETED --- --- fopenRF.c DELETED --- --- mkapplet.py DELETED --- --- errno_unix.h DELETED --- From bwarsaw@users.sourceforge.net Tue Aug 21 13:45:57 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 21 Aug 2001 05:45:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac errno_unix.h,1.1.2.1,NONE fopenRF.c,1.2.2.1,NONE mkapplet.py,1.8.2.1,NONE mwerksglue.c,1.1.2.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv1549 Removed Files: Tag: r22a2-branch errno_unix.h fopenRF.c mkapplet.py mwerksglue.c Log Message: Removing Mac files deleted by Jack in the trunk. --- errno_unix.h DELETED --- --- fopenRF.c DELETED --- --- mkapplet.py DELETED --- --- mwerksglue.c DELETED --- From bwarsaw@users.sourceforge.net Tue Aug 21 13:45:57 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 21 Aug 2001 05:45:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_config.h,1.1.2.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv1549/mwerks Removed Files: Tag: r22a2-branch mwerks_config.h Log Message: Removing Mac files deleted by Jack in the trunk. --- mwerks_config.h DELETED --- From bwarsaw@users.sourceforge.net Tue Aug 21 13:49:07 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 21 Aug 2001 05:49:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib cgitb.py,1.1,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3386 Modified Files: Tag: r22a2-branch cgitb.py Log Message: Merging in Ka-Ping's changes from the trunk: Enhancements: - file URL now starts with "file://" (standard) rather than "file:" - new optional argument 'context' to enable() - repeated variable names don't have their values shown twice - dotted attributes are shown; missing attributes handled reasonably - highlight the whole logical line even if it has multiple physical lines - use nice generator interface to tokenize - formatting fixed so that it looks good in lynx, links, and w3m too Index: cgitb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/cgitb.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** cgitb.py 2001/08/18 04:04:50 1.1 --- cgitb.py 2001/08/21 12:49:05 1.1.2.1 *************** *** 9,14 **** display - if true, tracebacks are displayed in the web browser logdir - if set, tracebacks are written to files in this directory ! By default, tracebacks are displayed but not written to files. Alternatively, if you have caught an exception and want cgitb to display it --- 9,15 ---- display - if true, tracebacks are displayed in the web browser logdir - if set, tracebacks are written to files in this directory + context - number of lines of source code to show for each stack frame ! By default, tracebacks are displayed but not saved, and context is 5. Alternatively, if you have caught an exception and want cgitb to display it *************** *** 24,36 **** Content-Type: text/html ! --> ! --> --> ''' ! def html(etype, evalue, etb, context=5): ! """Return a nice HTML document describing the traceback.""" ! import sys, os, types, time, traceback ! import keyword, tokenize, linecache, inspect, pydoc if type(etype) is types.ClassType: --- 25,71 ---- Content-Type: text/html ! --> ! --> --> ''' ! __UNDEF__ = [] # a special sentinel object ! def small(text): return '' + text + '' ! def strong(text): return '' + text + '' ! def grey(text): return '' + text + '' ! ! def lookup(name, frame, locals): ! """Find the value for a given name in the given environment.""" ! if name in locals: ! return 'local', locals[name] ! if name in frame.f_globals: ! return 'global', frame.f_globals[name] ! return None, __UNDEF__ ! ! def scanvars(reader, frame, locals): ! """Scan one logical line of Python and look up values of variables used.""" ! import tokenize, keyword ! vars, lasttoken, parent, prefix = [], None, None, '' ! for ttype, token, start, end, line in tokenize.generate_tokens(reader): ! if ttype == tokenize.NEWLINE: break ! if ttype == tokenize.NAME and token not in keyword.kwlist: ! if lasttoken == '.': ! if parent is not __UNDEF__: ! value = getattr(parent, token, __UNDEF__) ! vars.append((prefix + token, prefix, value)) ! else: ! where, value = lookup(token, frame, locals) ! vars.append((token, where, value)) ! elif token == '.': ! prefix += lasttoken + '.' ! parent = value ! else: ! parent, prefix = None, '' ! lasttoken = token ! return vars ! ! def html((etype, evalue, etb), context=5): ! """Return a nice HTML document describing a given traceback.""" ! import sys, os, types, time, traceback, linecache, inspect, pydoc if type(etype) is types.ClassType: *************** *** 38,117 **** pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.time()) ! head = '' + pydoc.html.heading( '%s' % str(etype), ! '#ffffff', '#aa55cc', pyver + '
    ' + date) + ''' !

    A problem occurred in a Python script. ! Here is the sequence of function calls leading up to ! the error, with the most recent (innermost) call last.''' ! indent = '' + ' ' * 5 + ' ' frames = [] records = inspect.getinnerframes(etb, context) for frame, file, lnum, func, lines, index in records: file = file and os.path.abspath(file) or '?' ! link = '%s' % (file, pydoc.html.escape(file)) args, varargs, varkw, locals = inspect.getargvalues(frame) ! if func == '?': ! call = '' ! else: ! def eqrepr(value): return '=' + pydoc.html.repr(value) ! call = 'in %s' % func + inspect.formatargvalues( ! args, varargs, varkw, locals, formatvalue=eqrepr) ! ! names = [] ! def tokeneater(type, token, start, end, line): ! if type == tokenize.NAME and token not in keyword.kwlist: ! if token not in names: names.append(token) ! if type == tokenize.NEWLINE: raise IndexError ! def linereader(lnum=[lnum]): ! line = linecache.getline(file, lnum[0]) ! lnum[0] += 1 ! return line ! try: ! tokenize.tokenize(linereader, tokeneater) ! except IndexError: pass ! lvals = [] ! for name in names: ! if name in frame.f_code.co_varnames: ! if locals.has_key(name): ! value = pydoc.html.repr(locals[name]) ! else: ! value = 'undefined' ! name = '%s' % name ! else: ! if frame.f_globals.has_key(name): ! value = pydoc.html.repr(frame.f_globals[name]) ! else: ! value = 'undefined' ! name = 'global %s' % name ! lvals.append('%s = %s' % (name, value)) ! if lvals: ! lvals = indent + ''' ! %s
    ''' % (', '.join(lvals)) ! else: ! lvals = '' ! level = ''' ! !
    %s %s
    \n''' % (link, call) ! excerpt = [] if index is not None: i = lnum - index for line in lines: ! num = '%s' % ( ! ' ' * (5-len(str(i))) + str(i)) ! line = '%s %s' % (num, pydoc.html.preformat(line)) ! if i == lnum: ! line = ''' ! !
    %s
    \n''' % line ! excerpt.append('\n' + line) ! if i == lnum: ! excerpt.append(lvals) ! i = i + 1 ! frames.append('

    ' + level + '\n'.join(excerpt)) ! exception = ['

    %s: %s' % (str(etype), str(evalue))] if type(evalue) is types.InstanceType: for name in dir(evalue): --- 73,133 ---- pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.time()) ! head = '' + pydoc.html.heading( '%s' % str(etype), ! '#ffffff', '#6622aa', pyver + '
    ' + date) + ''' !

    A problem occurred in a Python script. Here is the sequence of ! function calls leading up to the error, in the order they occurred.''' ! indent = '' + small(' ' * 5) + ' ' frames = [] records = inspect.getinnerframes(etb, context) for frame, file, lnum, func, lines, index in records: file = file and os.path.abspath(file) or '?' ! link = '%s' % (file, pydoc.html.escape(file)) args, varargs, varkw, locals = inspect.getargvalues(frame) ! call = '' ! if func != '?': ! call = 'in ' + strong(func) + \ ! inspect.formatargvalues(args, varargs, varkw, locals, ! formatvalue=lambda value: '=' + pydoc.html.repr(value)) ! highlight = {} ! def reader(lnum=[lnum]): ! highlight[lnum[0]] = 1 ! try: return linecache.getline(file, lnum[0]) ! finally: lnum[0] += 1 ! vars = scanvars(reader, frame, locals) ! rows = ['%s%s %s' % ! (' ', link, call)] if index is not None: i = lnum - index for line in lines: ! num = small(' ' * (5-len(str(i))) + str(i)) + ' ' ! line = '%s%s' % (num, pydoc.html.preformat(line)) ! if i in highlight: ! rows.append('%s' % line) ! else: ! rows.append('%s' % grey(line)) ! i += 1 ! done, dump = {}, [] ! for name, where, value in vars: ! if name in done: continue ! done[name] = 1 ! if value is not __UNDEF__: ! if where == 'global': name = 'global ' + strong(name) ! elif where == 'local': name = strong(name) ! else: name = where + strong(name.split('.')[-1]) ! dump.append('%s = %s' % (name, pydoc.html.repr(value))) ! else: ! dump.append(name + ' undefined') ! ! rows.append('%s' % small(grey(', '.join(dump)))) ! frames.append('''

    ! ! %s
    ''' % '\n'.join(rows)) ! ! exception = ['

    %s: %s' % (strong(str(etype)), str(evalue))] if type(evalue) is types.InstanceType: for name in dir(evalue): *************** *** 120,163 **** import traceback - plaintrace = ''.join(traceback.format_exception(etype, evalue, etb)) - return head + ''.join(frames) + ''.join(exception) + ''' ! ! ''' % plaintrace class Hook: ! def __init__(self, display=1, logdir=None): self.display = display # send tracebacks to browser if true self.logdir = logdir # log tracebacks to files if not None def __call__(self, etype, evalue, etb): - """This hook can replace sys.excepthook (for Python 2.1 or higher).""" self.handle((etype, evalue, etb)) def handle(self, info=None): ! import sys, os info = info or sys.exc_info() - text = 0 print reset() try: ! doc = html(*info) except: # just in case something goes wrong import traceback ! doc = ''.join(traceback.format_exception(*info)) ! text = 1 if self.display: if text: doc = doc.replace('&', '&').replace('<', '<') ! print '

    ', doc, '
    ' else: print doc --- 136,176 ---- import traceback return head + ''.join(frames) + ''.join(exception) + ''' ! ! ''' % ''.join(traceback.format_exception(etype, evalue, etb)) class Hook: ! """A hook to replace sys.excepthook that shows tracebacks in HTML.""" ! ! def __init__(self, display=1, logdir=None, context=5): self.display = display # send tracebacks to browser if true self.logdir = logdir # log tracebacks to files if not None + self.context = context # number of source code lines per frame def __call__(self, etype, evalue, etb): self.handle((etype, evalue, etb)) def handle(self, info=None): ! import sys info = info or sys.exc_info() print reset() try: ! text, doc = 0, html(info, self.context) except: # just in case something goes wrong import traceback ! text, doc = 1, ''.join(traceback.format_exception(*info)) if self.display: if text: doc = doc.replace('&', '&').replace('<', '<') ! print '
    ' + doc + '
    ' else: print doc *************** *** 166,170 **** if self.logdir is not None: ! import tempfile name = tempfile.mktemp(['.html', '.txt'][text]) path = os.path.join(self.logdir, os.path.basename(name)) --- 179,183 ---- if self.logdir is not None: ! import os, tempfile name = tempfile.mktemp(['.html', '.txt'][text]) path = os.path.join(self.logdir, os.path.basename(name)) *************** *** 173,182 **** file.write(doc) file.close() ! print '

    %s contains the description of this error.' % path except: ! print '

    Tried to write to %s, but failed.' % path handler = Hook().handle ! def enable(display=1, logdir=None): import sys ! sys.excepthook = Hook(display, logdir) --- 186,200 ---- file.write(doc) file.close() ! print '

    %s contains the description of this error.' % path except: ! print '

    Tried to save traceback to %s, but failed.' % path handler = Hook().handle ! def enable(display=1, logdir=None, context=5): ! """Install an exception handler that formats tracebacks as HTML. ! ! The optional argument 'display' can be set to 0 to suppress sending the ! traceback to the browser, and 'logdir' can be set to a directory to cause ! tracebacks to be written to files there.""" import sys ! sys.excepthook = Hook(display, logdir, context) From gvanrossum@users.sourceforge.net Tue Aug 21 14:27:30 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 21 Aug 2001 06:27:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib cgitb.py,1.1.2.1,1.1.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25418 Modified Files: Tag: r22a2-branch cgitb.py Log Message: Merge trunk->branch Index: cgitb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/cgitb.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 From gvanrossum@users.sourceforge.net Tue Aug 21 14:29:42 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 21 Aug 2001 06:29:42 -0700 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.50.2.1,1.50.2.2 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv27252 Modified Files: Tag: r22a2-branch setup.py Log Message: Merge trunk->branch Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.50.2.1 retrieving revision 1.50.2.2 diff -C2 -d -r1.50.2.1 -r1.50.2.2 *** setup.py 2001/08/19 05:40:58 1.50.2.1 --- setup.py 2001/08/21 13:29:40 1.50.2.2 *************** *** 386,390 **** dblib = [] ! if self.compiler.find_library_file(lib_dirs, 'db'): dblib = ['db'] --- 386,396 ---- dblib = [] ! if self.compiler.find_library_file(lib_dirs, 'db-3.1'): ! dblib = ['db-3.1'] ! elif self.compiler.find_library_file(lib_dirs, 'db2'): ! dblib = ['db2'] ! elif self.compiler.find_library_file(lib_dirs, 'db1'): ! dblib = ['db1'] ! elif self.compiler.find_library_file(lib_dirs, 'db'): dblib = ['db'] From jackjansen@users.sourceforge.net Tue Aug 21 20:28:22 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 21 Aug 2001 12:28:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.209,1.210 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv5971/Python/Misc Modified Files: NEWS Log Message: Added a note about --enable-framework on Mac OS X. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.209 retrieving revision 1.210 diff -C2 -d -r1.209 -r1.210 *** NEWS 2001/08/17 22:11:27 1.209 --- NEWS 2001/08/21 19:28:20 1.210 *************** *** 7,10 **** --- 7,15 ---- ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode type and supporting code is completely removed from the interpreter. + + - A new configure option --enable-framework builds a Mac OS X framework, + which "make frameworkinstall" will install. This provides a starting + point for more mac-like functionality, join pythonmac-sig@python.org + if you are interested in helping. Tools From gstein@users.sourceforge.net Tue Aug 21 21:20:24 2001 From: gstein@users.sourceforge.net (Greg Stein) Date: Tue, 21 Aug 2001 13:20:24 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0268.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv26437 Modified Files: pep-0268.txt Log Message: Complete the authentication section, and flesh out the proxy and DAV sections. Index: pep-0268.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0268.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0268.txt 2001/08/21 08:22:47 1.3 --- pep-0268.txt 2001/08/21 20:20:22 1.4 *************** *** 8,12 **** Created: 20-Aug-2001 Python-Version: 2.2 ! Post-History: --- 8,12 ---- Created: 20-Aug-2001 Python-Version: 2.2 ! Post-History: 21-Aug-2001 *************** *** 63,67 **** authentication (for both proxy and origin server authentication). This mixin (httpx.HandleAuthentication) can be ! combined with the HTTPConnection or the HTTPSConnection classes (the mixin may possibly work with the HTTP and HTTPS compatibility classes, but that is not a requirement). --- 63,67 ---- authentication (for both proxy and origin server authentication). This mixin (httpx.HandleAuthentication) can be ! combined with the HTTPConnection and the HTTPSConnection classes (the mixin may possibly work with the HTTP and HTTPS compatibility classes, but that is not a requirement). *************** *** 71,82 **** authenticators. The use of a separate object allows for a long term connection to an authentication system (e.g. LDAP). An ! authenticator for the Basic mechanism (see RFC 2617) will be ! provided. Digest would be great, but we need to find some code for ! it (or a motivated developer). User-supplied authenticator ! subclasses can be registered and used by the connections. ! A "credentials" object is also associated with the mixin, and ! stores the credentials (e.g. username and password) needed by the ! authenticators. Subclasses of the credentials object can be created to hold additional information (e.g. NT domain). --- 71,81 ---- authenticators. The use of a separate object allows for a long term connection to an authentication system (e.g. LDAP). An ! authenticator for the Basic and Digest mechanisms (see RFC 2617) ! will be provided. User-supplied authenticator subclasses can be ! registered and used by the connections. ! A "credentials" object (httpx.Credentials) is also associated with ! the mixin, and stores the credentials (e.g. username and password) ! needed by the authenticators. Subclasses of Credentials can be created to hold additional information (e.g. NT domain). *************** *** 90,94 **** authenticator can examine the response headers and decide whether and how to resend the request with the correct authentication ! headers. Resending a request, with the appropriate credentials, is one of --- 89,94 ---- authenticator can examine the response headers and decide whether and how to resend the request with the correct authentication ! headers. If no authenticator can successfully handle the ! authentication, then an exception is raised. Resending a request, with the appropriate credentials, is one of *************** *** 105,128 **** information. ! [ what to do when the body is too big: raise an error? special ! return value? ... ] ! [ need more info here about storing realms/headers in the ! credentials object (keyed by host, port) ... resending those ! automatically when making requests ... persisting the credentials ! object to have the info next time ... ] ! [ two sets of credentials: one for proxy, one for origin ... ] Proxy Handling ! ... info about proxy handling ... note that proxy auth is handled ! above ... WebDAV Features ! ... info about the dav module ... --- 105,179 ---- information. ! If the body is too large to be stored, then the getresponse() ! simply returns the response object, indicating the 401 or 407 ! error. Since the authentication information has been computed and ! cached (into the Credentials object; see below), the caller can ! simply regenerate the request. The mixin will attach the ! appropriate credentials. ! A "protection space" (see RFC 2617, section 1.2) is defined as a ! tuple of the host, port, and authentication realm. When a request ! is initially sent to an HTTP server, we do not know the ! authentication realm (the realm is only returned when ! authentication fails). However, we do have the path from the URL, ! and that can be useful in determining the credentials to send to ! the server. The Basic authentication scheme is typically set up ! hierarchically: the credentials for /path can be tried for ! /path/subpath. The Digest authentication scheme has explicit ! support for the hierarchical setup. The httpx.Credentials object ! will store credentials for multiple protection spaces, and can be ! looked up in two differents ways: ! 1) looked up using (host, port, path) -- this lookup scheme is ! used when generating a request for a path where we don't know the ! authentication realm. ! ! 2) looked up using (host, port, realm) -- this mechanism is used ! during the authentication process when the server has specified ! that the Request-URI resides within a specific realm. + The mixin will override endheaders() to automatically insert + credentials, if available. + + It is also important to note that two sets of credentials are + important, and stored by the mixin. One set for any proxy that may + be used, and one used for the target origin server. + Proxy Handling ! The httpx module will provide a mixin for using a proxy to perform ! HTTP(S) operations. This mixin (httpx.UseProxy) can be combined ! with the HTTPConnection and the HTTPSConnection classes (the mixin ! may possibly work with the HTTP and HTTPS compatibility classes, ! but that is not a requirement). + The mixin will record the (host, port) of the proxy to use. XXX + will be overridden to use this host/port combination for + connections and to rewrite request URLs into the absoluteURIs + referring to the origin server (these URIs are passed to the proxy + server). + + Proxy authentication is handled by the httpx.HandleAuthentication + class since a user may directly use HTTP(S)Connection to speak + with proxies. + WebDAV Features ! The davlib module will provide a mixin for sending WebDAV requests ! to a WebDAV-enabled server. This mixin (davlib.DAVClient) can be ! combined with the HTTPConnection and the HTTPSConnection classes ! (the mixin may possibly work with the HTTP and HTTPS compatibility ! classes, but that is not a requirement). ! ! The mixin provides methods to perform the various HTTP methods ! defined by HTTP in RFC 2616, and by WebDAV in RFC 2518. ! ! A custom response object is used to decode 207 (Multi-Status) ! responses. The response object will use the standard library's xml ! package to parse the multistatus XML information, producing a ! simple structure of objects to hold the multistatus data. Multiple ! parsing schemes will be tried/used, in order of decreasing speed. From bwarsaw@users.sourceforge.net Wed Aug 22 05:07:41 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 21 Aug 2001 21:07:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.209,1.209.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv12405 Modified Files: Tag: r22a2-branch NEWS Log Message: More NEWS for 2.2a2. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.209 retrieving revision 1.209.2.1 diff -C2 -d -r1.209 -r1.209.2.1 *** NEWS 2001/08/17 22:11:27 1.209 --- NEWS 2001/08/22 04:07:38 1.209.2.1 *************** *** 8,11 **** --- 8,20 ---- type and supporting code is completely removed from the interpreter. + - A new configure option --enable-framework builds a Mac OS X framework, + which "make frameworkinstall" will install. This provides a starting + point for more mac-like functionality, join pythonmac-sig@python.org + if you are interested in helping. + + - The NeXT platform is no longer supported. + + - The `new' module is now statically linked. + Tools *************** *** 17,21 **** - regrtest.py now knows which tests are expected to be skipped on some ! platforms, allowing to give clearer test result output. - Several new tests in the standard test suite, with special thanks to --- 26,32 ---- - regrtest.py now knows which tests are expected to be skipped on some ! platforms, allowing to give clearer test result output. regrtest ! also has optional --use/-u switch to run normally disabled tests ! which require network access or consume significant disk resources. - Several new tests in the standard test suite, with special thanks to *************** *** 24,27 **** --- 35,47 ---- Core + - The floor division operator // has been added as outlined in PEP + 238. The / operator still provides classic division (and will until + Python 3.0) unless "from __future__ import division" is included, in + which case the / operator will provide true division. The operator + module provides truediv() and floordiv() functions. Augmented + assignment variants are included, as are the equivalent overloadable + methods and C API methods. See the PEP for a full discussion: + + - Future statements are now effective in simulated interactive shells (like IDLE). This should "just work" by magic, but read Michael *************** *** 56,59 **** --- 76,87 ---- - Readline completion support for cmd.Cmd was added. + + - Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings. + + - Added function threading.BoundedSemaphore() + + - Added Ka-Ping Yee's cgitb.py module. + + - The `new' module now exposes the CO_xxx flags. New platforms From bwarsaw@users.sourceforge.net Wed Aug 22 05:08:43 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 21 Aug 2001 21:08:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.210,1.211 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv12600 Modified Files: NEWS Log Message: More NEWS for 2.2a2. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.210 retrieving revision 1.211 diff -C2 -d -r1.210 -r1.211 *** NEWS 2001/08/21 19:28:20 1.210 --- NEWS 2001/08/22 04:08:41 1.211 *************** *** 7,11 **** ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode type and supporting code is completely removed from the interpreter. ! - A new configure option --enable-framework builds a Mac OS X framework, which "make frameworkinstall" will install. This provides a starting --- 7,11 ---- ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode type and supporting code is completely removed from the interpreter. ! - A new configure option --enable-framework builds a Mac OS X framework, which "make frameworkinstall" will install. This provides a starting *************** *** 13,16 **** --- 13,20 ---- if you are interested in helping. + - The NeXT platform is no longer supported. + + - The `new' module is now statically linked. + Tools *************** *** 22,26 **** - regrtest.py now knows which tests are expected to be skipped on some ! platforms, allowing to give clearer test result output. - Several new tests in the standard test suite, with special thanks to --- 26,32 ---- - regrtest.py now knows which tests are expected to be skipped on some ! platforms, allowing to give clearer test result output. regrtest ! also has optional --use/-u switch to run normally disabled tests ! which require network access or consume significant disk resources. - Several new tests in the standard test suite, with special thanks to *************** *** 29,32 **** --- 35,47 ---- Core + - The floor division operator // has been added as outlined in PEP + 238. The / operator still provides classic division (and will until + Python 3.0) unless "from __future__ import division" is included, in + which case the / operator will provide true division. The operator + module provides truediv() and floordiv() functions. Augmented + assignment variants are included, as are the equivalent overloadable + methods and C API methods. See the PEP for a full discussion: + + - Future statements are now effective in simulated interactive shells (like IDLE). This should "just work" by magic, but read Michael *************** *** 61,64 **** --- 76,87 ---- - Readline completion support for cmd.Cmd was added. + + - Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings. + + - Added function threading.BoundedSemaphore() + + - Added Ka-Ping Yee's cgitb.py module. + + - The `new' module now exposes the CO_xxx flags. New platforms From montanaro@users.sourceforge.net Wed Aug 22 13:43:41 2001 From: montanaro@users.sourceforge.net (Skip Montanaro) Date: Wed, 22 Aug 2001 05:43:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcalendar.tex,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv17241 Modified Files: libcalendar.tex Log Message: indicate that the years for which the calendar function will work are platform dependent. See SF bug 434143. Index: libcalendar.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcalendar.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** libcalendar.tex 2001/05/09 15:50:17 1.10 --- libcalendar.tex 2001/08/22 12:43:38 1.11 *************** *** 80,84 **** width, lines per week, and number of spaces between month columns, respectively. Depends on the first weekday as set by ! \function{setfirstweekday()}. \end{funcdesc} --- 80,85 ---- width, lines per week, and number of spaces between month columns, respectively. Depends on the first weekday as set by ! \function{setfirstweekday()}. The earliest year for which a calendar can ! be generated is platform-dependent. \end{funcdesc} From montanaro@users.sourceforge.net Wed Aug 22 13:44:29 2001 From: montanaro@users.sourceforge.net (Skip Montanaro) Date: Wed, 22 Aug 2001 05:44:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libtime.tex,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv17481 Modified Files: libtime.tex Log Message: indicate that mktime is platform-dependent. See SF bug 434143. Index: libtime.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtime.tex,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** libtime.tex 2001/08/19 01:38:03 1.44 --- libtime.tex 2001/08/22 12:44:27 1.45 *************** *** 174,178 **** \emph{local} time, not UTC. It returns a floating point number, for compatibility with \function{time()}. If the input value cannot be ! represented as a valid time, \exception{OverflowError} is raised. \end{funcdesc} --- 174,179 ---- \emph{local} time, not UTC. It returns a floating point number, for compatibility with \function{time()}. If the input value cannot be ! represented as a valid time, \exception{OverflowError} is raised. The ! earliest date for which it can generate a time is platform-dependent. \end{funcdesc} From bwarsaw@users.sourceforge.net Wed Aug 22 20:24:45 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 22 Aug 2001 12:24:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.42,2.43 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv12169/Objects Modified Files: typeobject.c Log Message: Merge changes from r22a2-branch back into trunk. Also, change patch level to 2.2a2+ Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.42 retrieving revision 2.43 diff -C2 -d -r2.42 -r2.43 *** typeobject.c 2001/08/17 21:57:47 2.42 --- typeobject.c 2001/08/22 19:24:42 2.43 *************** *** 2092,2096 **** tp_new_wrapper(PyObject *self, PyObject *args, PyObject *kwds) { ! PyTypeObject *type, *subtype; PyObject *arg0, *res; --- 2092,2096 ---- tp_new_wrapper(PyObject *self, PyObject *args, PyObject *kwds) { ! PyTypeObject *type, *subtype, *staticbase; PyObject *arg0, *res; *************** *** 2099,2118 **** type = (PyTypeObject *)self; if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 1) { ! PyErr_SetString(PyExc_TypeError, ! "T.__new__(): not enough arguments"); return NULL; } arg0 = PyTuple_GET_ITEM(args, 0); if (!PyType_Check(arg0)) { ! PyErr_SetString(PyExc_TypeError, ! "T.__new__(S): S is not a type object"); return NULL; } subtype = (PyTypeObject *)arg0; if (!PyType_IsSubtype(subtype, type)) { ! PyErr_SetString(PyExc_TypeError, ! "T.__new__(S): S is not a subtype of T"); return NULL; } args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); if (args == NULL) --- 2099,2141 ---- type = (PyTypeObject *)self; if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 1) { ! PyErr_Format(PyExc_TypeError, ! "%s.__new__(): not enough arguments", ! type->tp_name); return NULL; } arg0 = PyTuple_GET_ITEM(args, 0); if (!PyType_Check(arg0)) { ! PyErr_Format(PyExc_TypeError, ! "%s.__new__(X): X is not a type object (%s)", ! type->tp_name, ! arg0->ob_type->tp_name); return NULL; } subtype = (PyTypeObject *)arg0; if (!PyType_IsSubtype(subtype, type)) { ! PyErr_Format(PyExc_TypeError, ! "%s.__new__(%s): %s is not a subtype of %s", ! type->tp_name, ! subtype->tp_name, ! subtype->tp_name, ! type->tp_name); ! return NULL; ! } ! ! /* Check that the use doesn't do something silly and unsafe like ! object.__new__(dictionary). To do this, we check that the ! most derived base that's not a heap type is this type. */ ! staticbase = subtype; ! while (staticbase && (staticbase->tp_flags & Py_TPFLAGS_HEAPTYPE)) ! staticbase = staticbase->tp_base; ! if (staticbase != type) { ! PyErr_Format(PyExc_TypeError, ! "%s.__new__(%s) is not safe, use %s.__new__()", ! type->tp_name, ! subtype->tp_name, ! staticbase == NULL ? "?" : staticbase->tp_name); return NULL; } + args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); if (args == NULL) From bwarsaw@users.sourceforge.net Wed Aug 22 20:24:44 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 22 Aug 2001 12:24:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules Setup.dist,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12169/Modules Modified Files: Setup.dist Log Message: Merge changes from r22a2-branch back into trunk. Also, change patch level to 2.2a2+ Index: Setup.dist =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/Setup.dist,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Setup.dist 2001/08/02 04:15:00 1.22 --- Setup.dist 2001/08/22 19:24:42 1.23 *************** *** 99,102 **** --- 99,103 ---- posix posixmodule.c # posix (UNIX) system calls _sre _sre.c # Fredrik Lundh's new regular expressions + new newmodule.c # Tommy Burnette's 'new' module # The rest of the modules listed in this file are all commented out by *************** *** 346,354 **** # Wrapper for the panel library that's part of ncurses and SYSV curses. #_curses_panel _curses_panel.c -lpanel -lncurses - - - # Tommy Burnette's 'new' module (creates new empty objects of certain kinds): - - #new newmodule.c --- 347,350 ---- From bwarsaw@users.sourceforge.net Wed Aug 22 20:24:44 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 22 Aug 2001 12:24:44 -0700 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.51,1.52 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv12169 Modified Files: setup.py Log Message: Merge changes from r22a2-branch back into trunk. Also, change patch level to 2.2a2+ Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** setup.py 2001/08/21 04:23:21 1.51 --- setup.py 2001/08/22 19:24:42 1.52 *************** *** 270,277 **** exts.append( Extension('sha', ['shamodule.c']) ) - # Tommy Burnette's 'new' module (creates new empty objects of certain - # kinds): - exts.append( Extension('new', ['newmodule.c']) ) - # Helper module for various ascii-encoders exts.append( Extension('binascii', ['binascii.c']) ) --- 270,273 ---- From bwarsaw@users.sourceforge.net Wed Aug 22 20:24:44 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 22 Aug 2001 12:24:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_os.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12169/Lib/test Modified Files: test_os.py Log Message: Merge changes from r22a2-branch back into trunk. Also, change patch level to 2.2a2+ Index: test_os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_os.py 2001/08/20 20:10:01 1.4 --- test_os.py 2001/08/22 19:24:42 1.5 *************** *** 7,10 **** --- 7,13 ---- import warnings + warnings.filterwarnings("ignore", "tempnam", RuntimeWarning, __name__) + warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning, __name__) + from test_support import TESTFN, run_unittest From bwarsaw@users.sourceforge.net Wed Aug 22 20:24:44 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 22 Aug 2001 12:24:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include patchlevel.h,2.52,2.53 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv12169/Include Modified Files: patchlevel.h Log Message: Merge changes from r22a2-branch back into trunk. Also, change patch level to 2.2a2+ Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.52 retrieving revision 2.53 diff -C2 -d -r2.52 -r2.53 *** patchlevel.h 2001/08/17 14:05:27 2.52 --- patchlevel.h 2001/08/22 19:24:42 2.53 *************** *** 24,31 **** #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA ! #define PY_RELEASE_SERIAL 1 /* Version as a string */ ! #define PY_VERSION "2.2a1+" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 24,31 ---- #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA ! #define PY_RELEASE_SERIAL 2 /* Version as a string */ ! #define PY_VERSION "2.2a2+" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From bwarsaw@users.sourceforge.net Wed Aug 22 21:26:58 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 22 Aug 2001 13:26:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.211,1.212 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv1145 Modified Files: NEWS Log Message: Add an item about Tim's new installer. This didn't make it into the 2.2a2 release, but it's still worth mentioning. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.211 retrieving revision 1.212 diff -C2 -d -r1.211 -r1.212 *** NEWS 2001/08/22 04:08:41 1.211 --- NEWS 2001/08/22 20:26:56 1.212 *************** *** 4,7 **** --- 4,10 ---- Build + - Tim Peters developed a brand new Windows installer using Wise 8.1, + generously donated to us by Wise Solutions. + - configure supports a new option --enable-unicode, with the values ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode From tim_one@users.sourceforge.net Wed Aug 22 22:36:52 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 22 Aug 2001 14:36:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.212,1.213 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv21125/python/Misc Modified Files: NEWS Log Message: "The usual" post-release fiddling. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.212 retrieving revision 1.213 diff -C2 -d -r1.212 -r1.213 *** NEWS 2001/08/22 20:26:56 1.212 --- NEWS 2001/08/22 21:36:50 1.213 *************** *** 1,2 **** --- 1,20 ---- + What's New in Python 2.2a3? + =========================== + + Core + + Library + + Tools + + Build + + New platforms + + Tests + + Windows + + What's New in Python 2.2a2? =========================== From tim_one@users.sourceforge.net Wed Aug 22 22:36:52 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 22 Aug 2001 14:36:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild BUILDno.txt,1.19,1.20 python20.wse,1.86,1.87 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv21125/python/PCbuild Modified Files: BUILDno.txt python20.wse Log Message: "The usual" post-release fiddling. Index: BUILDno.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/BUILDno.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** BUILDno.txt 2001/08/19 00:56:28 1.19 --- BUILDno.txt 2001/08/22 21:36:50 1.20 *************** *** 35,39 **** ---------------------------- 22 2.2a2 ! 22-Aug-2001 TENTATIVE 21 2.2a1 18-Jul-2001 --- 35,39 ---- ---------------------------- 22 2.2a2 ! 22-Aug-2001 21 2.2a1 18-Jul-2001 Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** python20.wse 2001/08/19 00:56:28 1.86 --- python20.wse 2001/08/22 21:36:50 1.87 *************** *** 2,6 **** item: Global Version=8.14 ! Title=Python 2.2 alpha 2 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 --- 2,6 ---- item: Global Version=8.14 ! Title=Python 2.2 alpha 3 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 *************** *** 19,25 **** Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2a2.exe Dialogs Version=8 ! Version File=2.2a2 Version Description=Python Programming Language Version Copyright=©2001 Python Software Foundation --- 19,25 ---- Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2a3.exe Dialogs Version=8 ! Version File=2.2a3 Version Description=Python Programming Language Version Copyright=©2001 Python Software Foundation *************** *** 65,69 **** item: Set Variable Variable=PYVER_STRING ! Value=2.2a2 end item: Remark --- 65,69 ---- item: Set Variable Variable=PYVER_STRING ! Value=2.2a3 end item: Remark From tim_one@users.sourceforge.net Wed Aug 22 23:18:33 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 22 Aug 2001 15:18:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.87,1.88 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv30441 Modified Files: python20.wse Log Message: Add pynche's top-level txt files to Windows installer -- I don't believe we've *ever* installed them! Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** python20.wse 2001/08/22 21:36:50 1.87 --- python20.wse 2001/08/22 22:18:31 1.88 *************** *** 2141,2145 **** end item: Install File ! Source=..\tools\compiler\README Destination=%MAINDIR%\Tools\compiler\README.txt Description=Python compiler written in Python --- 2141,2145 ---- end item: Install File ! Source=..\tools\compiler\readme Destination=%MAINDIR%\Tools\compiler\README.txt Description=Python compiler written in Python *************** *** 2162,2165 **** --- 2162,2171 ---- item: Install File Source=..\tools\pynche\*.py + Destination=%MAINDIR%\Tools\pynche + Description=pynche color editor + Flags=0000000000000010 + end + item: Install File + Source=..\tools\pynche\*.txt Destination=%MAINDIR%\Tools\pynche Description=pynche color editor From bwarsaw@users.sourceforge.net Wed Aug 22 23:41:42 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 22 Aug 2001 15:41:42 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0101.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv3078 Added Files: pep-0101.txt Log Message: PEP 101, Doing Python Releases, Warsaw & van Rossum --- NEW FILE: pep-0101.txt --- PEP: 101 Title: Doing Python Releases 101 Version: $Revision: 1.1 $ Last-Modified: $Date: 2001/08/22 22:41:40 $ Author: barry@zope.com (Barry A. Warsaw), guido@python.org (Guido van Rossum) Status: Active Type: Informational Created: 22-Aug-2001 Post-History: Abstract Making a Python release is an arduous processes that takes a minimum of half a day's work even for an experienced releaser. Until recently, most -- if not all -- of that burden was borne by Guido himself. But several recent releases have been performed by other folks, so this PEP attempts to collect, in one place, all the steps needed to make a Python release. (Note: These steps were recorded during the Python 2.2a2 release done by Barry and Guido. It will be checked for accuracy with the subsequent release, to be done by Barry.) How to Make A Release Here are the steps taken to make a Python release. Some steps are more fuzzy than others because there's little that can be automated (e.g. writing the NEWS entries). Where a step is usually performed by An Expert, the name of that expert is given. Otherwise, assume the step is done by the Release Manager (RM), the designated person performing the release. Almost every place the RM is mentioned below, this step can also be done by Guido, naturally! XXX: We should include a dependency graph to illustrate the steps that can be taken in parallel, or those that depend on other steps. We use the following conventions in the examples below. Where a release number is given, it is of the form X.YaZ, e.g. 2.1a3 for Python 2.2 alpha 2, where "a" == alpha, "b" == beta, "rc" == release candidate, and "f" == final. If a micro release number is used, then we'll say X.Y.MaZ. - 3 or 4 days before the release, create a branch for X.YaZ. All Python development happens on the trunk. A few days before the release, the RM will create a branch for this release. Only the RM is authorized to make commits to this branch, but checkins can proceed as normal on the trunk. It is the responsibility of the RM to decide on a case-by-case basis which trunk modifications should be merged into the branch. To create a branch the following steps are taken: * CVS tag the trunk with the symbolic name "rXYaZ-fork", e.g. % cvs tag r2.2a3-fork * Make the branch with the symbolic name "rXYaZ-branch", e.g. % cvs tag -b r2.2a3-branch * Check out a clean version of the branch into a new directory. You'll be doing a lot of work in this directory and you want to keep it straight from your trunk working directory. E.g. % cvs -d -q co -d python-22a3 python/dist/src - For the next 3 or 4 days, selectively merge stuff from trunk into branch. For each change you see on the trunk (i.e. via the python-checkins mailing list), you need to decide whether the change should also be applied to the branch. If so, it's fairly easy to apply the change by diffing the file and patching it manually. You can also sometimes get away with just copying the file from the trunk directory to the branch directory, but be careful so you don't lose changes that only exist in the branch! - The night before the release, the RM updates the Misc/NEWS file, adding high level items new to this release. E.g. if we're releasing 2.2a3, there must be a section at the top of the file explaining "What's new in Python 2.2a3". It will be followed by a section entitled "What's new in Python 2.2a2". Note that you /hope/ that as developers add new features to the trunk, they've updated the NEWS file accordingly. You can't be positive, so double check. If you're a Unix weenie, it helps to verify with Tim Peters about changes on Windows, and Jack Jansen about changes on the Mac. - Also the night before the release, a freeze is put on checkins into the branch. At this point, nobody except Fred Drake or Tim Peters should make any commits to the branch. If the RM screwed up and some desperate last minute change to the branch is necessary, it can mean extra work for Fred and Tim. So try to avoid this! - Once the branch is frozen, Fred Drake needs to create the HTML from the documentation. He does this and uploads the file to www.python.org. Then he tells Tim Peters where this file is. This may generate some last minute changes on the branch. - Tim Peters grabs the HTML and uses this to build the Windows installer. Tim then creates a new "release" named X.YaZ on the SourceForge file release manager. (Diversion: SF's file manager has "packages" and "releases". We use packages to name major upcoming releases, e.g. python-2.2 or python-2.1.1. Inside each package are a number of "releases" for each new actual release -- i.e. the thing you're building. An example of a release name is 2.2a3. Once created, packages and releases are never deleted, but old ones are hidden to reduce confusion. More on this below.) If this is the first release for this major Python version, Tim will create a new package containing the major Python version number. - Tim does performs his Windows magic, generating an installer executable. He uploads this file to SourceForge under the release he just created. He then sends the RM a notice which includes the MD5 checksum of the Windows executable. Note that Tim's creation of the Windows executable may generate a few more commits on the branch. - Now, you're ready to build the source tarball. First cd to your working directory for the branch. E.g. % cd .../python-22a3 - Do a "cvs update" in this directory. You should not see any "M" files, but you may see several "P" files. I.e. you better not have any uncommitted changes in your working directory, but you may pick up some of Fred's or Tim's last minute changes. - Now tag the branch using a symbolic name like "rXYaZ", e.g. r22a3 % cvs tag r22a3 - Change to a neutral directory, i.e. one in which you can do a fresh, virgin, export of the branch. You will be creating a new directory at this location, to be named "Python-X.YaZ". Do a CVS export of the tagged branch. % cd ~ % cvs -d export -rr22a3 -d Python-2.2a3 python/dist/src - Generate the tarball. Note that we're not using the `z' option on the tar command because 1) that's only supported by GNU tar as far as we know; 2) we're going to max out the compression level, which isn't a supported option. % tar cf - Python-2.2a2 | gzip -9 > Python-2.2a2.tgz - Calculate the MD5 checksum of the tgz file you just created % md5sum Python-2.2a2.tgz Note that if you don't have the md5sum program, there is a Python replacement in the Tools/scripts/md5sum.py file. - Now you want to perform the very important step of checking the tarball you just created, to make sure a completely clean, virgin build passes the regression test. Here are the best steps to take: % cd /tmp % tar zxvf ~/Python-2.2a3.tgz % cd Python-2.2a3 % ls (Do things look reasonable?) % ./configure (Loads of configure output) % make test (Do all the expected tests pass?) If the tests pass, then you can feel good that the tarball is fine. If some of the tests pass, or anything else about the freshly unpacked directory looks weird, you better stop now and figure out what the problem is. - Start your upload to SF. You need to get Python-2.2a3.tgz into SourceForge. This can take a while both because of the time it takes to upload 650+KB of data, /and/ because SF has a 30 minute delay built into the file release process. The next few steps can be taken in parallel, so it's best to start the upload now and keep an eye on its progress. I've found that the `ncftpput' program is a great tool to use if you have it available. You can execute the following command to do the upload: % ncftpput -F upload.sf.net incoming Python-2.2a3.tgz If you don't have ncftpput around, you can use whatever ftp client you're comfortable with. Just be sure that you're uploading this to the "incoming" directory on upload.sf.net. - You also need to upload the tgz file to creosote.python.org. Usually Tim will have already uploaded the exe file to creosote, but if not, you'll need to do that too. These steps can take a long time depending on your network bandwidth. You have two choices: 1) Upload them to SF first, then wget them from creosote. Pros: easy to do; much friendlier to your own personal bandwidth. Cons: can take even longer because you're subject to the 30 minute SF file upload delay, and the upload rate from SF->creosote never seems to get above 20 KB/sec. 2) scp both files from your own machine to creosote. Pros: you avoid the 30 minute SF delay. Cons: you don't get much else done if you're on a small pipe. - While you're waiting, you can start twiddling the web pages to include the announcement. XXX: This section will be rewritten once we CVS-ify the web pages! It's only a rough sketch for now because only the Pythonlabs guys can do this part, and there's no need to expose our cruft. ;) % (on leroy) cd ~guido/w/X.Y % cp index.ht new-index.ht (Edit the file for content: usually you can globally replace X.Ya(Z-1) with X.YaZ. However, you'll need to think about the "What's New?" section. You also need to watch out about two specific links in the file, one which references "the full scoop" on changes -- a shownotes link, and one which references the downloads on SF -- a showfiles link. You won't be able to update either link until you've completed the steps below. For now just note what needs to change. Also, update the MD5 checksums.) - Preview the web page by doing a "make" -- NOT a "make install". View the page via a file: url. - Similarly, edit the ../index.ht file, i.e. the python.org home page. In the Big Blue Announcement Block, move the paragraph for the new version up to the top and boldify the phrase "Python X.YaZ is out". Edit for content, and preview as above. Do NOT do a "make install" yet! - Now we're waiting for the ncftpput command, and the scp to creosote to finish. Da de da, da de dum, hmm, hmm, dum de dum. - Do the SourceForge file release dance. * Go to the Python project and click on "Admin" * Click on "Edit/Release Files" * Since Tim has usually by now created the package and release we're going to use, scroll down and click on "Edit Releases" for the package we're releasing into. * Find the release named X.YaZ and click on "Edit This Release" You should now perform Step 1 of the file release dance... * The "Status" field should be "Active" not "Hidden" * In the text box that says "Paste The Notes In", paste in all the "What's New" entries from the Misc/NEWS file that describe this major version of Python, /not/ just the ones for this particular release. E.g. If we're releasing Python 2.2a3, we'd include the "What's New" sections for Python 2.2a3, 2.2a2, and 2.2a1. * Leave the "Paste The Change Log In" section blank, but click on "Preserve my pre-formatted text". * Hit the Submit/Refresh button for Step 1. This will bring you back to the file release page. DO NOT do this step until your ftp upload is complete! Once it is, you can perform Step 2 of the file release dance... * Click on the checkbox next to the file Python-X.YaZ.tgz. Be sure no other box is checked! Then click on the "Add Files and/or Refresh View" button for Step 2. And now, Step 3... * There should be exactly two files listed here, one is the tgz file you just added, and the other is the exe file that Tim added earlier. * For the tgz file, be sure that the "Processor" field says "Any" and the "File Type" field says "Source .gz". * Click on "Update/Refresh" for the .tgz file. * For the exe file, make sure that the "Processor" field says "i386" and the "File Type" field says "Other". Tim usually gets this right , but if not, make any necessary changes and click on "Update/Refresh" for the exe file. Step 4... DO NOT DO STEP 4 NOW. Wait until after you send out the email announcement to send the SF email notice. - Still on SF, click on the "Files" button at the top of the page. Find the release you've just made and click on it -- not on the tgz or exe file, but on the release link under the package name. E.g. package named python-2.2, click on the "2.2a3" link. This should be a page that says "Release Name: X.YaZ" and it should contain the "What's New" sections you pasted in earlier. Note the url of this page. Copy and paste it into the ~guido/w/X.Y/new-index.ht file you created above. This is the "shownotes" link mentioned earlier. - Now click on the "Summary" link at the top of the page and scroll down to the "Latest File Releases" section. Find the package you just made a release for (the Version should be X.YaZ, and the Date should be today's date). Click on the "Download" link. Your new release should be highlighted in pink. Note the url for this page. Copy and paste it into the ~guido/w/X.Y/new-index.ht file from above. This is the "showfiles" link mentioned earlier. - Now you need to go to creosote.python.org and move all the files in place over there. Our policy is that every Python version gets its own directory, but each directory may contain several releases. We keep all old releases, moving them into a "prev" subdirectory when we have a new release. So, there's a directory called "2.2" which contains Python-2.2a2.exe and Python-2.2a2.tgz, along with a "prev" subdirectory containing Python-2.2a1.exe and Python-2.2a1.tgz. So... * On creosote, cd to ~ftp/pub/python/X.Y creating it if necessary. * Move the previous release files to a directory called "prev" creating the directory if necessary (make sure the directory has g+ws bits on). If this is the first alpha release of a new Python version, skip this step. * Move the .tgz file and the .exe file to this directory. Make sure they are world readable. They should also be group writable. - Now preview the new-index.ht file once more. IMPORTANT: follow every link on the page to make sure it goes where you expect it to go, and that what you expect to be there is there. - If everything looks good, move new-index.ht to index.ht and do a "make install" in this directory. Go up to the parent directory (i.e. the root of the web page hierarchy) and do a "make install" there too. You're release is now live! - Now it's time to write the announcement for the mailing lists. This is the fuzzy bit because not much can be automated. You can use one of Guido's earlier announcements as a template, but please edit it for content! Once the announcement is ready, send it to the following addresses: python-list@python.org python-announce@python.org python-dev@python.org - Go back to the file releases page on SF and complete Step 4, sending out the email notification. Now it's time to do some cleanup. These steps are very important! - Go back to SF, Admin->Edit/Release Files. Click on "Edit Releases" for the package you just added to. For each old release, click on "Edit This Release" and under Step 1, change the "Status" to "Hidden". Click on the Step 1 Submit/Refresh button. - Merge the branch back into the trunk! Now that we've released this branch, we don't need it any more. We've already tagged it so we can always reproduce it. Note that merging branches is a bit of a black art, but here's what's worked for us. * Check out a completely clean, virgin working directory of the trunk, by doing this in the directory that is the parent of your branch working directory python-XYaZ: % cvs -d co -d python-clean python/dist/src * Run a diff against your branch by doing this in the common parent directory containing both python-clean and python-XYaZ: % diff -r python-clean python-22a2 | grep ^diff | grep -v CVS * Take the output of this and stick it in a file, e.g. /tmp/diffcmd.sh * Edit diffcmd.sh to get rid of files that you know don't have important changes. You're looking for files that have updates in the branch that haven't made it to the trunk. If you've been diligent about merging changes from the trunk into the branch, there shouldn't be many of these files. * Edit /tmp/diffcmd.sh, changing all the -r's into -u's. Run the /tmp/diffcmd.sh command like so: % sh /tmp/diffcmd.sh > /tmp/pydiff.txt * Attempt to patch your python-clean working directory. Do this first, noting that --dry-run does not actually apply any patches, it just makes sure that the patch command runs successfully to completion: % patch -p1 --dry-run < /tmp/pydiff.txt * If this goes well, run it again, taking out the --dry-run option. If this fails, or if it prompts you for a file to patch, try using -p0 instead of -p1. Otherwise, your diff command was messed up, so try again. * cd to python-clean and do a "cvs commit". Use as your log message something like "Merging the rXYaZ-branch tag back into the trunk". * Edit the file Include/patchlevel.h so that the PY_VERSION string says something like "X.YaZ+". Note the trailing `+' indicating that the trunk is going to be moving forward with development. E.g. the line should look like: #define PY_VERSION "2.2a2+" Commit this change. * Now test your clean, merged trunk by doing % make distclean % ./configure % make test To ensure that the regression test suite passes. If not, you screwed up somewhere! What Next? Rejoice. Drink. Be Merry. Write a PEP like this one. Or be like unto Guido and take A Vacation. You've just made a Python release! Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil End: From bwarsaw@users.sourceforge.net Wed Aug 22 23:43:44 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 22 Aug 2001 15:43:44 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.129,1.130 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv3428 Modified Files: pep-0000.txt Log Message: PEP 101, Doing Python Releases, Warsaw & van Rossum Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** pep-0000.txt 2001/08/21 00:02:26 1.129 --- pep-0000.txt 2001/08/22 22:43:42 1.130 *************** *** 37,40 **** --- 37,41 ---- Other Informational PEPs + I 101 Doing Python Releases 101 Warsaw, van Rossum I 247 API for Cryptographic Hash Functions Kuchling I 248 Python Database API Specification v1.0 Lemburg *************** *** 147,150 **** --- 148,152 ---- SF 100 Python Unicode Integration Lemburg + I 101 Doing Python Releases 101 Warsaw, van Rossum IF 160 Python 1.6 Release Schedule Drake From gvanrossum@users.sourceforge.net Thu Aug 23 03:55:41 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 22 Aug 2001 19:55:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python exceptions.c,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv17698 Modified Files: exceptions.c Log Message: Introduce OverflowWarning -- to be issued when short int operations are overflowing and a long int operation is substituted. Index: exceptions.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** exceptions.c 2001/08/02 04:15:00 1.25 --- exceptions.c 2001/08/23 02:55:39 1.26 *************** *** 106,109 **** --- 106,110 ---- +-- DeprecationWarning\n\ +-- SyntaxWarning\n\ + +-- OverflowWarning\n\ +-- RuntimeWarning"; *************** *** 913,916 **** --- 914,920 ---- static char + OverflowWarning__doc__[] = "Base class for warnings about numeric overflow."; + + static char RuntimeWarning__doc__[] = "Base class for warnings about dubious runtime behavior."; *************** *** 974,977 **** --- 978,982 ---- PyObject *PyExc_DeprecationWarning; PyObject *PyExc_SyntaxWarning; + PyObject *PyExc_OverflowWarning; PyObject *PyExc_RuntimeWarning; *************** *** 1048,1051 **** --- 1053,1058 ---- DeprecationWarning__doc__}, {"SyntaxWarning", &PyExc_SyntaxWarning, &PyExc_Warning, SyntaxWarning__doc__}, + {"OverflowWarning", &PyExc_OverflowWarning, &PyExc_Warning, + OverflowWarning__doc__}, {"RuntimeWarning", &PyExc_RuntimeWarning, &PyExc_Warning, RuntimeWarning__doc__}, From gvanrossum@users.sourceforge.net Thu Aug 23 03:58:09 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 22 Aug 2001 19:58:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.269,2.270 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv17965 Modified Files: ceval.c Log Message: When an inlined operation on two small ints causes overflow, don't raise the exception here -- call the generic function (which may convert the arguments to long and try again). Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.269 retrieving revision 2.270 diff -C2 -d -r2.269 -r2.270 *** ceval.c 2001/08/18 17:43:36 2.269 --- ceval.c 2001/08/23 02:58:07 2.270 *************** *** 916,929 **** b = PyInt_AS_LONG(w); i = a + b; ! if ((i^a) < 0 && (i^b) < 0) { ! PyErr_SetString(PyExc_OverflowError, ! "integer addition"); ! x = NULL; ! } ! else ! x = PyInt_FromLong(i); } ! else x = PyNumber_Add(v, w); Py_DECREF(v); Py_DECREF(w); --- 916,927 ---- b = PyInt_AS_LONG(w); i = a + b; ! if ((i^a) < 0 && (i^b) < 0) ! goto slow_add; ! x = PyInt_FromLong(i); } ! else { ! slow_add: x = PyNumber_Add(v, w); + } Py_DECREF(v); Py_DECREF(w); *************** *** 941,954 **** b = PyInt_AS_LONG(w); i = a - b; ! if ((i^a) < 0 && (i^~b) < 0) { ! PyErr_SetString(PyExc_OverflowError, ! "integer subtraction"); ! x = NULL; ! } ! else ! x = PyInt_FromLong(i); } ! else x = PyNumber_Subtract(v, w); Py_DECREF(v); Py_DECREF(w); --- 939,950 ---- b = PyInt_AS_LONG(w); i = a - b; ! if ((i^a) < 0 && (i^~b) < 0) ! goto slow_sub; ! x = PyInt_FromLong(i); } ! else { ! slow_sub: x = PyNumber_Subtract(v, w); + } Py_DECREF(v); Py_DECREF(w); *************** *** 1103,1116 **** b = PyInt_AS_LONG(w); i = a + b; ! if ((i^a) < 0 && (i^b) < 0) { ! PyErr_SetString(PyExc_OverflowError, ! "integer addition"); ! x = NULL; ! } ! else ! x = PyInt_FromLong(i); } ! else x = PyNumber_InPlaceAdd(v, w); Py_DECREF(v); Py_DECREF(w); --- 1099,1110 ---- b = PyInt_AS_LONG(w); i = a + b; ! if ((i^a) < 0 && (i^b) < 0) ! goto slow_iadd; ! x = PyInt_FromLong(i); } ! else { ! slow_iadd: x = PyNumber_InPlaceAdd(v, w); + } Py_DECREF(v); Py_DECREF(w); *************** *** 1128,1141 **** b = PyInt_AS_LONG(w); i = a - b; ! if ((i^a) < 0 && (i^~b) < 0) { ! PyErr_SetString(PyExc_OverflowError, ! "integer subtraction"); ! x = NULL; ! } ! else ! x = PyInt_FromLong(i); } ! else x = PyNumber_InPlaceSubtract(v, w); Py_DECREF(v); Py_DECREF(w); --- 1122,1133 ---- b = PyInt_AS_LONG(w); i = a - b; ! if ((i^a) < 0 && (i^~b) < 0) ! goto slow_isub; ! x = PyInt_FromLong(i); } ! else { ! slow_isub: x = PyNumber_InPlaceSubtract(v, w); + } Py_DECREF(v); Py_DECREF(w); From gvanrossum@users.sourceforge.net Thu Aug 23 03:56:09 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 22 Aug 2001 19:56:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include pyerrors.h,2.48,2.49 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv17794 Modified Files: pyerrors.h Log Message: Introduce OverflowWarning -- to be issued when short int operations are overflowing and a long int operation is substituted. Index: pyerrors.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyerrors.h,v retrieving revision 2.48 retrieving revision 2.49 diff -C2 -d -r2.48 -r2.49 *** pyerrors.h 2001/07/31 18:05:33 2.48 --- pyerrors.h 2001/08/23 02:56:07 2.49 *************** *** 67,70 **** --- 67,71 ---- extern DL_IMPORT(PyObject *) PyExc_DeprecationWarning; extern DL_IMPORT(PyObject *) PyExc_SyntaxWarning; + extern DL_IMPORT(PyObject *) PyExc_OverflowWarning; extern DL_IMPORT(PyObject *) PyExc_RuntimeWarning; From gvanrossum@users.sourceforge.net Thu Aug 23 03:59:06 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 22 Aug 2001 19:59:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects intobject.c,2.62,2.63 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv18246 Modified Files: intobject.c Log Message: Change all case where we used to raise OverflowError to issue a warning and then redo the operation using long ints. Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.62 retrieving revision 2.63 diff -C2 -d -r2.62 -r2.63 *** intobject.c 2001/08/17 18:39:25 2.62 --- intobject.c 2001/08/23 02:59:04 2.63 *************** *** 23,31 **** }; ! static PyObject * err_ovf(char *msg) { ! PyErr_SetString(PyExc_OverflowError, msg); ! return NULL; } --- 23,36 ---- }; ! /* Return 1 if exception raised, 0 if caller should retry using longs */ ! static int err_ovf(char *msg) { ! if (PyErr_Warn(PyExc_OverflowWarning, msg) < 0) { ! PyErr_SetString(PyExc_OverflowError, msg); ! return 1; ! } ! else ! return 0; } *************** *** 278,284 **** CONVERT_TO_LONG(w, b); x = a + b; ! if ((x^a) < 0 && (x^b) < 0) ! return err_ovf("integer addition"); ! return PyInt_FromLong(x); } --- 283,291 ---- CONVERT_TO_LONG(w, b); x = a + b; ! if ((x^a) >= 0 || (x^b) >= 0) ! return PyInt_FromLong(x); ! if (err_ovf("integer addition")) ! return NULL; ! return PyLong_Type.tp_as_number->nb_add((PyObject *)v, (PyObject *)w); } *************** *** 290,296 **** CONVERT_TO_LONG(w, b); x = a - b; ! if ((x^a) < 0 && (x^~b) < 0) ! return err_ovf("integer subtraction"); ! return PyInt_FromLong(x); } --- 297,306 ---- CONVERT_TO_LONG(w, b); x = a - b; ! if ((x^a) >= 0 || (x^~b) >= 0) ! return PyInt_FromLong(x); ! if (err_ovf("integer subtraction")) ! return NULL; ! return PyLong_Type.tp_as_number->nb_subtract((PyObject *)v, ! (PyObject *)w); } *************** *** 433,440 **** bad: ! return err_ovf("integer multiplication"); } ! static int i_divmod(register long x, register long y, long *p_xdivy, long *p_xmody) --- 443,459 ---- bad: ! if (err_ovf("integer multiplication")) ! return NULL; ! return PyLong_Type.tp_as_number->nb_multiply(v, w); } ! /* Return type of i_divmod */ ! enum divmod_result { ! DIVMOD_OK, /* Correct result */ ! DIVMOD_OVERFLOW, /* Overflow, try again using longs */ ! DIVMOD_ERROR /* Exception raised */ ! }; ! ! static enum divmod_result i_divmod(register long x, register long y, long *p_xdivy, long *p_xmody) *************** *** 445,454 **** PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); ! return -1; } /* (-sys.maxint-1)/-1 is the only overflow case. */ if (y == -1 && x < 0 && x == -x) { ! err_ovf("integer division"); ! return -1; } xdivy = x / y; --- 464,474 ---- PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); ! return DIVMOD_ERROR; } /* (-sys.maxint-1)/-1 is the only overflow case. */ if (y == -1 && x < 0 && x == -x) { ! if (err_ovf("integer division")) ! return DIVMOD_ERROR; ! return DIVMOD_OVERFLOW; } xdivy = x / y; *************** *** 466,470 **** *p_xdivy = xdivy; *p_xmody = xmody; ! return 0; } --- 486,490 ---- *p_xdivy = xdivy; *p_xmody = xmody; ! return DIVMOD_OK; } *************** *** 476,482 **** CONVERT_TO_LONG(x, xi); CONVERT_TO_LONG(y, yi); ! if (i_divmod(xi, yi, &d, &m) < 0) return NULL; ! return PyInt_FromLong(d); } --- 496,508 ---- CONVERT_TO_LONG(x, xi); CONVERT_TO_LONG(y, yi); ! switch (i_divmod(xi, yi, &d, &m)) { ! case DIVMOD_OK: ! return PyInt_FromLong(d); ! case DIVMOD_OVERFLOW: ! return PyLong_Type.tp_as_number->nb_divide((PyObject *)x, ! (PyObject *)y); ! default: return NULL; ! } } *************** *** 488,494 **** CONVERT_TO_LONG(x, xi); CONVERT_TO_LONG(y, yi); ! if (i_divmod(xi, yi, &d, &m) < 0) return NULL; ! return PyInt_FromLong(m); } --- 514,526 ---- CONVERT_TO_LONG(x, xi); CONVERT_TO_LONG(y, yi); ! switch (i_divmod(xi, yi, &d, &m)) { ! case DIVMOD_OK: ! return PyInt_FromLong(m); ! case DIVMOD_OVERFLOW: ! return PyLong_Type.tp_as_number->nb_remainder((PyObject *)x, ! (PyObject *)y); ! default: return NULL; ! } } *************** *** 500,506 **** CONVERT_TO_LONG(x, xi); CONVERT_TO_LONG(y, yi); ! if (i_divmod(xi, yi, &d, &m) < 0) return NULL; ! return Py_BuildValue("(ll)", d, m); } --- 532,544 ---- CONVERT_TO_LONG(x, xi); CONVERT_TO_LONG(y, yi); ! switch (i_divmod(xi, yi, &d, &m)) { ! case DIVMOD_OK: ! return Py_BuildValue("(ll)", d, m); ! case DIVMOD_OVERFLOW: ! return PyLong_Type.tp_as_number->nb_divmod((PyObject *)x, ! (PyObject *)y); ! default: return NULL; ! } } *************** *** 508,512 **** int_pow(PyIntObject *v, PyIntObject *w, PyIntObject *z) { - #if 1 register long iv, iw, iz=0, ix, temp, prev; CONVERT_TO_LONG(v, iv); --- 546,549 ---- *************** *** 543,548 **** if (temp == 0) break; /* Avoid ix / 0 */ ! if (ix / temp != prev) ! return err_ovf("integer exponentiation"); } iw >>= 1; /* Shift exponent down by 1 bit */ --- 580,591 ---- if (temp == 0) break; /* Avoid ix / 0 */ ! if (ix / temp != prev) { ! if (err_ovf("integer exponentiation")) ! return NULL; ! return PyLong_Type.tp_as_number->nb_power( ! (PyObject *)v, ! (PyObject *)w, ! (PyObject *)w); ! } } iw >>= 1; /* Shift exponent down by 1 bit */ *************** *** 550,555 **** prev = temp; temp *= temp; /* Square the value of temp */ ! if (prev!=0 && temp/prev!=prev) ! return err_ovf("integer exponentiation"); if (iz) { /* If we did a multiplication, perform a modulo */ --- 593,602 ---- prev = temp; temp *= temp; /* Square the value of temp */ ! if (prev!=0 && temp/prev!=prev) { ! if (err_ovf("integer exponentiation")) ! return NULL; ! return PyLong_Type.tp_as_number->nb_power( ! (PyObject *)v, (PyObject *)w, (PyObject *)z); ! } if (iz) { /* If we did a multiplication, perform a modulo */ *************** *** 560,593 **** if (iz) { long div, mod; ! if (i_divmod(ix, iz, &div, &mod) < 0) ! return(NULL); ! ix=mod; ! } ! return PyInt_FromLong(ix); ! #else ! register long iv, iw, ix; ! CONVERT_TO_LONG(v, iv); ! CONVERT_TO_LONG(w, iw); ! if (iw < 0) { ! PyErr_SetString(PyExc_ValueError, ! "integer to the negative power"); ! return NULL; ! } ! if ((PyObject *)z != Py_None) { ! PyErr_SetString(PyExc_TypeError, ! "pow(int, int, int) not yet supported"); ! return NULL; ! } ! ix = 1; ! while (--iw >= 0) { ! long prev = ix; ! ix = ix * iv; ! if (iv == 0) ! break; /* 0 to some power -- avoid ix / 0 */ ! if (ix / iv != prev) ! return err_ovf("integer exponentiation"); } return PyInt_FromLong(ix); - #endif } --- 607,622 ---- if (iz) { long div, mod; ! switch (i_divmod(ix, iz, &div, &mod)) { ! case DIVMOD_OK: ! ix = mod; ! break; ! case DIVMOD_OVERFLOW: ! return PyLong_Type.tp_as_number->nb_power( ! (PyObject *)v, (PyObject *)w, (PyObject *)z); ! default: ! return NULL; ! } } return PyInt_FromLong(ix); } *************** *** 598,603 **** a = v->ob_ival; x = -a; ! if (a < 0 && x < 0) ! return err_ovf("integer negation"); return PyInt_FromLong(x); } --- 627,635 ---- a = v->ob_ival; x = -a; ! if (a < 0 && x < 0) { ! if (err_ovf("integer negation")) ! return NULL; ! return PyNumber_Negative(PyLong_FromLong(a)); ! } return PyInt_FromLong(x); } From gvanrossum@users.sourceforge.net Thu Aug 23 04:07:44 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 22 Aug 2001 20:07:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib warnings.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv19776 Modified Files: warnings.py Log Message: Ignore OverflowWarning by default. To enable the warning, use python -Wdefault or python -Wdefault::OverflowWarning Index: warnings.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/warnings.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** warnings.py 2001/03/01 04:27:19 1.7 --- warnings.py 2001/08/23 03:07:42 1.8 *************** *** 250,251 **** --- 250,252 ---- else: _processoptions(sys.warnoptions) + filterwarnings("ignore", category=OverflowWarning, append=1) From gvanrossum@users.sourceforge.net Thu Aug 23 04:23:05 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 22 Aug 2001 20:23:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_exceptions.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22603 Modified Files: test_exceptions.py Log Message: Turn OverflowWarning into an error locally, in order to make the OverflowError test succeed. Index: test_exceptions.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_exceptions.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_exceptions.py 2001/08/13 23:07:00 1.13 --- test_exceptions.py 2001/08/23 03:23:03 1.14 *************** *** 3,6 **** --- 3,9 ---- from test_support import * from types import ClassType + import warnings + + warnings.filterwarnings("error", "", OverflowWarning, __name__) print '5. Built-in exceptions' From gvanrossum@users.sourceforge.net Thu Aug 23 04:50:56 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 22 Aug 2001 20:50:56 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0237.txt,1.10,1.11 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv26695 Modified Files: pep-0237.txt Log Message: Explain the semantics of OverflowWarning, for the benefit of the documenter. Clarify a few other issues (some brought up by Martin von Loewis in private email). Index: pep-0237.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0237.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pep-0237.txt 2001/08/14 19:30:15 1.10 --- pep-0237.txt 2001/08/23 03:50:54 1.11 *************** *** 122,125 **** --- 122,143 ---- optimization. + - The expression type(x).__name__ depends on whether x is a short + or a long int. Since implementation alternative 2 is chosen, + this difference will remain. + + - Long and short ints are handled different by the marshal module, + and by the pickle and cPickle modules. This difference will + remain. + + - Short ints with small values (typically between -1 and 99 + inclusive) are "interned" -- whenever a result has such a value, + an existing short int with the same value is returned. This is + not done for long ints with the same values. This difference + will remain. (Since there is no guarantee of this interning, is + is debatable whether this is a semantic difference -- but code + may exist that uses 'is' for comparisons of short ints and + happens to work because of this interning. Such code may fail + if used with long ints.) + Literals *************** *** 164,169 **** depends on this exception would have to be too convoluted to be concerned about it.) For those concerned about extreme ! backwards compatibility, a command line option will allow a ! warning to be issued at this point, but this is off by default. B. The remaining semantic differences are addressed. In most --- 182,188 ---- depends on this exception would have to be too convoluted to be concerned about it.) For those concerned about extreme ! backwards compatibility, a command line option (or a call to ! the warnings module) will allow a warning or an error to be ! issued at this point, but this is off by default. B. The remaining semantic differences are addressed. In most *************** *** 206,209 **** --- 225,276 ---- + OverflowWarning + + Here are the rules that guide warnings generated in situations + that currently raise OverflowError. This applies to transition + phase A. + + - A new warning category is introduced, OverflowWarning. This is + a built-in name. + + - If an int result overflows, an OverflowWarning warning is + issued, with a message argument indicating the operation, + e.g. "integer addition". This may or may not cause a warning + message to be displayed on sys.stderr, or may cause an exception + to be raised, all under control of the -W command line and the + warnings module. + + - The OverflowWarning warning is ignored by default. + + - The OverflowWarning warning can be controlled like all warnings, + via the -W command line option or via the + warnings.filterwarnings() call. For example: + + python -Wdefault::OverflowWarning + + cause the OverflowWarning to be displayed the first time it + occurs at a particular source line, and + + python -Werror::OverflowWarning + + cause the OverflowWarning to be turned into an exception + whenever it happens. The following code enables the warning + from inside the program: + + import warnings + warnings.filterwarnings("default", "", OverflowWarning) + + See the python man page for the -W option and the the warnings + module documentation for filterwarnings(). + + - If the OverflowWarning warning is turned into an error, + OverflowError is substituted. This is needed for backwards + compatibility. + + - Unless the warning is turned into an exceptions, the result of + the operation (e.g., x+y) is recomputed after converting the + arguments to long ints. + + Example *************** *** 230,238 **** ! Open Issues ! We expect that these issues will be resolved over time, as more ! feedback is received or we gather more experience with the initial ! implementation. - What to do about sys.maxint? Leave it in, since it is still --- 297,303 ---- ! Resolved Issues ! These issues, previously open, have been resolved. - What to do about sys.maxint? Leave it in, since it is still From gvanrossum@users.sourceforge.net Thu Aug 23 05:34:43 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 22 Aug 2001 21:34:43 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0237.txt,1.11,1.12 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv2705 Modified Files: pep-0237.txt Log Message: Update posted-date and added implementation information. Index: pep-0237.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0237.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pep-0237.txt 2001/08/23 03:50:54 1.11 --- pep-0237.txt 2001/08/23 04:34:41 1.12 *************** *** 7,11 **** Created: 11-Mar-2001 Python-Version: 2.2 ! Post-History: 16-Mar-2001, 14-Aug-2001 --- 7,11 ---- Created: 11-Mar-2001 Python-Version: 2.2 ! Post-History: 16-Mar-2001, 14-Aug-2001, 23-Aug-2001 *************** *** 310,313 **** --- 310,320 ---- - Should the overflow warning be on a portable maximum size? No. + + + Implementation + + A complete implementation of phase A is present in the current CVS + tree and will be release with Python 2.2a3. (It didn't make it + into 2.2a2.) Still missing are documentation and a test suite. From jackjansen@users.sourceforge.net Thu Aug 23 14:18:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:18:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk Tkinter.py,1.153,1.154 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv20730/Python/Lib/lib-tk Modified Files: Tkinter.py Log Message: The MacOS module may be available on Mac OS X, but it doesn't have a SchedParams() method, and there's no need to call it anyway. Index: Tkinter.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkinter.py,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** Tkinter.py 2001/08/09 16:57:33 1.153 --- Tkinter.py 2001/08/23 13:18:10 1.154 *************** *** 1479,1483 **** baseName = baseName + ext self.tk = _tkinter.create(screenName, baseName, className) ! if _MacOS: # Disable event scanning except for Command-Period _MacOS.SchedParams(1, 0) --- 1479,1483 ---- baseName = baseName + ext self.tk = _tkinter.create(screenName, baseName, className) ! if _MacOS and hasattr(MacOS, 'SchedParams'): # Disable event scanning except for Command-Period _MacOS.SchedParams(1, 0) From jackjansen@users.sourceforge.net Thu Aug 23 14:26:01 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:26:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk Tkinter.py,1.154,1.155 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv22318/Python/Lib/lib-tk Modified Files: Tkinter.py Log Message: Don't make even the _slightest_ modification between test and checkin, or you will break something:-) Index: Tkinter.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkinter.py,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -d -r1.154 -r1.155 *** Tkinter.py 2001/08/23 13:18:10 1.154 --- Tkinter.py 2001/08/23 13:25:59 1.155 *************** *** 1479,1483 **** baseName = baseName + ext self.tk = _tkinter.create(screenName, baseName, className) ! if _MacOS and hasattr(MacOS, 'SchedParams'): # Disable event scanning except for Command-Period _MacOS.SchedParams(1, 0) --- 1479,1483 ---- baseName = baseName + ext self.tk = _tkinter.create(screenName, baseName, className) ! if _MacOS and hasattr(_MacOS, 'SchedParams'): # Disable event scanning except for Command-Period _MacOS.SchedParams(1, 0) From gvanrossum@users.sourceforge.net Thu Aug 23 14:37:52 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 23 Aug 2001 06:37:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib urllib.py,1.131,1.132 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv24887 Modified Files: urllib.py Log Message: SF patch #454553 by Walter Dörwald: auto-guess content-type header for ftp urls. Index: urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v retrieving revision 1.131 retrieving revision 1.132 diff -C2 -d -r1.131 -r1.132 *** urllib.py 2001/08/11 15:02:57 1.131 --- urllib.py 2001/08/23 13:37:50 1.132 *************** *** 441,444 **** --- 441,445 ---- def open_ftp(self, url): """Use FTP protocol.""" + import mimetypes, mimetools, StringIO host, path = splithost(url) if not host: raise IOError, ('ftp error', 'no host given') *************** *** 483,492 **** type = value.upper() (fp, retrlen) = self.ftpcache[key].retrfile(file, type) if retrlen is not None and retrlen >= 0: ! import mimetools, StringIO ! headers = mimetools.Message(StringIO.StringIO( ! 'Content-Length: %d\n' % retrlen)) ! else: ! headers = noheaders() return addinfourl(fp, headers, "ftp:" + url) except ftperrors(), msg: --- 484,494 ---- type = value.upper() (fp, retrlen) = self.ftpcache[key].retrfile(file, type) + mtype = mimetypes.guess_type("ftp:" + url)[0] + headers = "" + if mtype: + headers += "Content-Type: %s\n" % mtype if retrlen is not None and retrlen >= 0: ! headers += "Content-Length: %d\n" % retrlen ! headers = mimetools.Message(StringIO.StringIO(headers)) return addinfourl(fp, headers, "ftp:" + url) except ftperrors(), msg: From gvanrossum@users.sourceforge.net Thu Aug 23 14:38:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 23 Aug 2001 06:38:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib liburllib.tex,1.38,1.39 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv25052 Modified Files: liburllib.tex Log Message: SF patch #454553 by Walter Dörwald: auto-guess content-type header for ftp urls. Index: liburllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** liburllib.tex 2001/08/03 18:39:36 1.38 --- liburllib.tex 2001/08/23 13:38:15 1.39 *************** *** 44,48 **** a Content-Length header will be present if (as is now usual) the server passed back a file length in response to the FTP retrieval ! request. When the method is local-file, returned headers will include a Date representing the file's last-modified time, a Content-Length giving file size, and a Content-Type containing a guess at the file's --- 44,49 ---- a Content-Length header will be present if (as is now usual) the server passed back a file length in response to the FTP retrieval ! request. A Content-Type header will be present if the MIME type can ! be guessed. When the method is local-file, returned headers will include a Date representing the file's last-modified time, a Content-Length giving file size, and a Content-Type containing a guess at the file's From jackjansen@users.sourceforge.net Thu Aug 23 14:47:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:47:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ae aesupport.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ae In directory usw-pr-cvs1:/tmp/cvs-serv26749/Python/Mac/Modules/ae Modified Files: aesupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: aesupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ae/aesupport.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** aesupport.py 2001/06/20 21:44:38 1.22 --- aesupport.py 2001/08/23 13:47:45 1.23 *************** *** 165,169 **** """ ! module = MacModule('AE', 'AE', includestuff, finalstuff, initstuff) class AEDescDefinition(GlobalObjectDefinition): --- 165,169 ---- """ ! module = MacModule('_AE', 'AE', includestuff, finalstuff, initstuff) class AEDescDefinition(GlobalObjectDefinition): *************** *** 223,226 **** for f in aedescmethods: aedescobject.add(f) ! SetOutputFileName('AEmodule.c') module.generate() --- 223,226 ---- for f in aedescmethods: aedescobject.add(f) ! SetOutputFileName('_AEmodule.c') module.generate() From jackjansen@users.sourceforge.net Thu Aug 23 14:47:52 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:47:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/app appsupport.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/app In directory usw-pr-cvs1:/tmp/cvs-serv26773/Python/Mac/Modules/app Modified Files: appsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: appsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/app/appsupport.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** appsupport.py 2001/05/22 21:51:14 1.7 --- appsupport.py 2001/08/23 13:47:50 1.8 *************** *** 8,17 **** # Declarations that change for each manager MACHEADERFILE = 'Appearance.h' # The Apple header file ! MODNAME = 'App' # The name of the module OBJECTNAME = 'UNUSED' # The basic name of the objects used here KIND = 'Record' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,17 ---- # Declarations that change for each manager MACHEADERFILE = 'Appearance.h' # The Apple header file ! MODNAME = '_App' # The name of the module OBJECTNAME = 'UNUSED' # The basic name of the objects used here KIND = 'Record' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'App' # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:47:59 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:47:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cf cfsupport.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cf In directory usw-pr-cvs1:/tmp/cvs-serv26797/Python/Mac/Modules/cf Modified Files: cfsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: cfsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/cfsupport.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** cfsupport.py 2001/08/03 15:36:23 1.7 --- cfsupport.py 2001/08/23 13:47:57 1.8 *************** *** 9,16 **** # Declarations that change for each manager ! MODNAME = 'CF' # The name of the module # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner OUTPUTFILE = MODNAME + "module.c" # The file generated by this program --- 9,16 ---- # Declarations that change for each manager ! MODNAME = '_CF' # The name of the module # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'CF' # The prefix for module-wide routines INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner OUTPUTFILE = MODNAME + "module.c" # The file generated by this program From jackjansen@users.sourceforge.net Thu Aug 23 14:48:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:48:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cm cmsupport.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cm In directory usw-pr-cvs1:/tmp/cvs-serv26821/Python/Mac/Modules/cm Modified Files: cmsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: cmsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cm/cmsupport.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cmsupport.py 2001/05/22 21:51:33 1.4 --- cmsupport.py 2001/08/23 13:48:02 1.5 *************** *** 8,15 **** # Declarations that change for each manager MACHEADERFILE = 'Components.h' # The Apple header file ! MODNAME = 'Cm' # The name of the module # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines C_OBJECTPREFIX = 'CmpObj' # The prefix for object methods CI_OBJECTPREFIX = 'CmpInstObj' --- 8,15 ---- # Declarations that change for each manager MACHEADERFILE = 'Components.h' # The Apple header file ! MODNAME = '_Cm' # The name of the module # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Cm' # The prefix for module-wide routines C_OBJECTPREFIX = 'CmpObj' # The prefix for object methods CI_OBJECTPREFIX = 'CmpInstObj' From jackjansen@users.sourceforge.net Thu Aug 23 14:48:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:48:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ctl ctlsupport.py,1.40,1.41 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ctl In directory usw-pr-cvs1:/tmp/cvs-serv26879/Python/Mac/Modules/ctl Modified Files: ctlsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: ctlsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ctl/ctlsupport.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** ctlsupport.py 2001/06/20 21:31:28 1.40 --- ctlsupport.py 2001/08/23 13:48:09 1.41 *************** *** 8,16 **** # Declarations that change for each manager MACHEADERFILE = 'Controls.h' # The Apple header file ! MODNAME = 'Ctl' # The name of the module OBJECTNAME = 'Control' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + 'Handle' # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,16 ---- # Declarations that change for each manager MACHEADERFILE = 'Controls.h' # The Apple header file ! MODNAME = '_Ctl' # The name of the module OBJECTNAME = 'Control' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Ctl' # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + 'Handle' # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:48:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:48:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/dlg dlgsupport.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/dlg In directory usw-pr-cvs1:/tmp/cvs-serv26932/Python/Mac/Modules/dlg Modified Files: dlgsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: dlgsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/dlg/dlgsupport.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** dlgsupport.py 2001/05/22 21:51:58 1.24 --- dlgsupport.py 2001/08/23 13:48:18 1.25 *************** *** 241,245 **** # Create the generator groups and link them ! module = MacModule('Dlg', 'Dlg', includestuff, finalstuff, initstuff) object = MyObjectDefinition('Dialog', 'DlgObj', 'DialogPtr') module.addobject(object) --- 241,245 ---- # Create the generator groups and link them ! module = MacModule('_Dlg', 'Dlg', includestuff, finalstuff, initstuff) object = MyObjectDefinition('Dialog', 'DlgObj', 'DialogPtr') module.addobject(object) *************** *** 301,304 **** # generate output ! SetOutputFileName('Dlgmodule.c') module.generate() --- 301,304 ---- # generate output ! SetOutputFileName('_Dlgmodule.c') module.generate() From jackjansen@users.sourceforge.net Thu Aug 23 14:48:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:48:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/drag dragsupport.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/drag In directory usw-pr-cvs1:/tmp/cvs-serv26962/Python/Mac/Modules/drag Modified Files: dragsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: dragsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/drag/dragsupport.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dragsupport.py 2001/05/22 21:52:08 1.6 --- dragsupport.py 2001/08/23 13:48:25 1.7 *************** *** 8,16 **** # Declarations that change for each manager MACHEADERFILE = 'Drag.h' # The Apple header file ! MODNAME = 'Drag' # The name of the module OBJECTNAME = 'DragObj' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = 'DragRef' # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,16 ---- # Declarations that change for each manager MACHEADERFILE = 'Drag.h' # The Apple header file ! MODNAME = '_Drag' # The name of the module OBJECTNAME = 'DragObj' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Drag' # The prefix for module-wide routines OBJECTTYPE = 'DragRef' # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:48:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:48:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/evt evtsupport.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/evt In directory usw-pr-cvs1:/tmp/cvs-serv27011/Python/Mac/Modules/evt Modified Files: evtsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: evtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/evt/evtsupport.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** evtsupport.py 2001/05/22 21:52:17 1.12 --- evtsupport.py 2001/08/23 13:48:34 1.13 *************** *** 8,17 **** # Declarations that change for each manager MACHEADERFILE = 'Events.h' # The Apple header file ! MODNAME = 'Evt' # The name of the module OBJECTNAME = 'Event' # The basic name of the objects used here KIND = 'Record' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,17 ---- # Declarations that change for each manager MACHEADERFILE = 'Events.h' # The Apple header file ! MODNAME = '_Evt' # The name of the module OBJECTNAME = 'Event' # The basic name of the objects used here KIND = 'Record' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Evt' # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:48:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:48:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/fm fmsupport.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/fm In directory usw-pr-cvs1:/tmp/cvs-serv27044/Python/Mac/Modules/fm Modified Files: fmsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: fmsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/fm/fmsupport.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** fmsupport.py 2001/05/22 21:52:26 1.3 --- fmsupport.py 2001/08/23 13:48:38 1.4 *************** *** 8,15 **** # Declarations that change for each manager MACHEADERFILE = 'Fonts.h' # The Apple header file ! MODNAME = 'Fm' # The name of the module # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner OUTPUTFILE = MODNAME + "module.c" # The file generated by this program --- 8,15 ---- # Declarations that change for each manager MACHEADERFILE = 'Fonts.h' # The Apple header file ! MODNAME = '_Fm' # The name of the module # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Fm' # The prefix for module-wide routines INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner OUTPUTFILE = MODNAME + "module.c" # The file generated by this program From jackjansen@users.sourceforge.net Thu Aug 23 14:48:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:48:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts genpluginprojects.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv27129/Python/Mac/scripts Modified Files: genpluginprojects.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: genpluginprojects.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/genpluginprojects.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** genpluginprojects.py 2001/08/20 15:31:56 1.18 --- genpluginprojects.py 2001/08/23 13:48:49 1.19 *************** *** 60,64 **** for moduledir in MODULEDIRS: if '%' in moduledir: ! moduledir = moduledir % module fn = os.path.join(projectdir, os.path.join(moduledir, sources[0])) if os.path.exists(fn): --- 60,70 ---- for moduledir in MODULEDIRS: if '%' in moduledir: ! # For historical reasons an initial _ in the modulename ! # is not reflected in the folder name ! if module[0] == '_': ! modulewithout_ = module[1:] ! else: ! modulewithout_ = module ! moduledir = moduledir % modulewithout_ fn = os.path.join(projectdir, os.path.join(moduledir, sources[0])) if os.path.exists(fn): *************** *** 107,151 **** # bgen-generated Toolbox modules ! genpluginproject("carbon", "AE", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "AE", libraries=["ObjectSupportLib"], outputdir="::Lib:Carbon") ! genpluginproject("ppc", "App", libraries=["AppearanceLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "App", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Cm", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Cm", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Ctl", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Ctl", libraries=["ControlsLib", "AppearanceLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Dlg", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Dlg", libraries=["DialogsLib", "AppearanceLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Drag", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Drag", libraries=["DragLib"], outputdir="::Lib:Carbon") ! genpluginproject("all", "Evt", outputdir="::Lib:Carbon") ! genpluginproject("all", "Fm", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Help", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Icn", libraries=["IconServicesLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Icn", outputdir="::Lib:Carbon") ! genpluginproject("all", "List", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Menu", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Menu", libraries=["MenusLib", "ContextualMenu", "AppearanceLib"], outputdir="::Lib:Carbon") ! genpluginproject("all", "Qd", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Qt", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Qt", outputdir="::Lib:Carbon") ! genpluginproject("all", "Qdoffs", outputdir="::Lib:Carbon") ! genpluginproject("all", "Res", outputdir="::Lib:Carbon") ! genpluginproject("all", "Scrap", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Snd", libraries=["SoundLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Snd", outputdir="::Lib:Carbon") ! genpluginproject("all", "Sndihooks", sources=[":snd:Sndihooks.c"], outputdir="::Lib:Carbon") ! genpluginproject("ppc", "TE", libraries=["DragLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "TE", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Mlte", libraries=["Textension"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Mlte", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "Win", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "Win", libraries=["WindowsLib", "AppearanceLib"], outputdir="::Lib:Carbon") # Carbon Only? ! genpluginproject("carbon", "CF", outputdir="::Lib:Carbon") # Other Mac modules --- 113,157 ---- # bgen-generated Toolbox modules ! genpluginproject("carbon", "_AE", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_AE", libraries=["ObjectSupportLib"], outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_App", libraries=["AppearanceLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_App", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Cm", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_Cm", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_Ctl", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Ctl", libraries=["ControlsLib", "AppearanceLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_Dlg", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Dlg", libraries=["DialogsLib", "AppearanceLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_Drag", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Drag", libraries=["DragLib"], outputdir="::Lib:Carbon") ! genpluginproject("all", "_Evt", outputdir="::Lib:Carbon") ! genpluginproject("all", "_Fm", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Help", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Icn", libraries=["IconServicesLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_Icn", outputdir="::Lib:Carbon") ! genpluginproject("all", "_List", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_Menu", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Menu", libraries=["MenusLib", "ContextualMenu", "AppearanceLib"], outputdir="::Lib:Carbon") ! genpluginproject("all", "_Qd", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Qt", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_Qt", outputdir="::Lib:Carbon") ! genpluginproject("all", "_Qdoffs", outputdir="::Lib:Carbon") ! genpluginproject("all", "_Res", outputdir="::Lib:Carbon") ! genpluginproject("all", "_Scrap", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Snd", libraries=["SoundLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_Snd", outputdir="::Lib:Carbon") ! genpluginproject("all", "_Sndihooks", sources=[":snd:_Sndihooks.c"], outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_TE", libraries=["DragLib"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_TE", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Mlte", libraries=["Textension"], outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_Mlte", outputdir="::Lib:Carbon") ! genpluginproject("carbon", "_Win", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Win", libraries=["WindowsLib", "AppearanceLib"], outputdir="::Lib:Carbon") # Carbon Only? ! genpluginproject("carbon", "_CF", outputdir="::Lib:Carbon") # Other Mac modules From jackjansen@users.sourceforge.net Thu Aug 23 14:48:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:48:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts fullbuild.py,1.70,1.71 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv27081/Python/Mac/scripts Modified Files: fullbuild.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: fullbuild.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/fullbuild.py,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** fullbuild.py 2001/08/16 20:39:09 1.70 --- fullbuild.py 2001/08/23 13:48:44 1.71 *************** *** 251,276 **** (":Mac:Build:ColorPicker.mcp", "ColorPicker.ppc"), (":Mac:Build:Printing.mcp", "Printing.ppc"), ! (":Mac:Build:AE.mcp", "AE.ppc"), ! (":Mac:Build:App.mcp", "App.ppc"), ! (":Mac:Build:Cm.mcp", "Cm.ppc"), ! (":Mac:Build:Ctl.mcp", "Ctl.ppc"), ! (":Mac:Build:Dlg.mcp", "Dlg.ppc"), ! (":Mac:Build:Drag.mcp", "Drag.ppc"), ! (":Mac:Build:Evt.mcp", "Evt.ppc"), ! (":Mac:Build:Fm.mcp", "Fm.ppc"), ! (":Mac:Build:Help.mcp", "Help.ppc"), ! (":Mac:Build:Icn.mcp", "Icn.ppc"), ! (":Mac:Build:List.mcp", "List.ppc"), ! (":Mac:Build:Menu.mcp", "Menu.ppc"), ! (":Mac:Build:Mlte.mcp", "Mlte.ppc"), ! (":Mac:Build:Qd.mcp", "Qd.ppc"), ! (":Mac:Build:Qdoffs.mcp", "Qdoffs.ppc"), ! (":Mac:Build:Qt.mcp", "Qt.ppc"), ! (":Mac:Build:Res.mcp", "Res.ppc"), ! (":Mac:Build:Scrap.mcp", "Scrap.ppc"), ! (":Mac:Build:Snd.mcp", "Snd.ppc"), ! (":Mac:Build:Sndihooks.mcp", "Sndihooks.ppc"), ! (":Mac:Build:TE.mcp", "TE.ppc"), ! (":Mac:Build:Win.mcp", "Win.ppc"), ]), --- 251,276 ---- (":Mac:Build:ColorPicker.mcp", "ColorPicker.ppc"), (":Mac:Build:Printing.mcp", "Printing.ppc"), ! (":Mac:Build:_AE.mcp", "_AE.ppc"), ! (":Mac:Build:_App.mcp", "_App.ppc"), ! (":Mac:Build:_Cm.mcp", "_Cm.ppc"), ! (":Mac:Build:_Ctl.mcp", "_Ctl.ppc"), ! (":Mac:Build:_Dlg.mcp", "_Dlg.ppc"), ! (":Mac:Build:_Drag.mcp", "_Drag.ppc"), ! (":Mac:Build:_Evt.mcp", "_Evt.ppc"), ! (":Mac:Build:_Fm.mcp", "_Fm.ppc"), ! (":Mac:Build:_Help.mcp", "_Help.ppc"), ! (":Mac:Build:_Icn.mcp", "_Icn.ppc"), ! (":Mac:Build:_List.mcp", "_List.ppc"), ! (":Mac:Build:_Menu.mcp", "_Menu.ppc"), ! (":Mac:Build:_Mlte.mcp", "_Mlte.ppc"), ! (":Mac:Build:_Qd.mcp", "_Qd.ppc"), ! (":Mac:Build:_Qdoffs.mcp", "_Qdoffs.ppc"), ! (":Mac:Build:_Qt.mcp", "_Qt.ppc"), ! (":Mac:Build:_Res.mcp", "_Res.ppc"), ! (":Mac:Build:_Scrap.mcp", "_Scrap.ppc"), ! (":Mac:Build:_Snd.mcp", "_Snd.ppc"), ! (":Mac:Build:_Sndihooks.mcp", "_Sndihooks.ppc"), ! (":Mac:Build:_TE.mcp", "_TE.ppc"), ! (":Mac:Build:_Win.mcp", "_Win.ppc"), ]), *************** *** 288,313 **** ## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), ! (":Mac:Build:AE.carbon.mcp", "AE.carbon"), ! (":Mac:Build:App.carbon.mcp", "App.carbon"), ! (":Mac:Build:CF.carbon.mcp", "CF.carbon"), ! (":Mac:Build:Cm.carbon.mcp", "Cm.carbon"), ! (":Mac:Build:Ctl.carbon.mcp", "Ctl.carbon"), ! (":Mac:Build:Dlg.carbon.mcp", "Dlg.carbon"), ! (":Mac:Build:Drag.carbon.mcp", "Drag.carbon"), ! (":Mac:Build:Evt.carbon.mcp", "Evt.carbon"), ! (":Mac:Build:Fm.carbon.mcp", "Fm.carbon"), ! (":Mac:Build:Icn.carbon.mcp", "Icn.carbon"), ! (":Mac:Build:List.carbon.mcp", "List.carbon"), ! (":Mac:Build:Menu.carbon.mcp", "Menu.carbon"), ! (":Mac:Build:Mlte.carbon.mcp", "Mlte.carbon"), ! (":Mac:Build:Qd.carbon.mcp", "Qd.carbon"), ! (":Mac:Build:Qdoffs.carbon.mcp", "Qdoffs.carbon"), ! (":Mac:Build:Qt.carbon.mcp", "Qt.carbon"), ! (":Mac:Build:Res.carbon.mcp", "Res.carbon"), ! (":Mac:Build:Scrap.carbon.mcp", "Scrap.carbon"), ! (":Mac:Build:Snd.carbon.mcp", "Snd.carbon"), ! (":Mac:Build:Sndihooks.carbon.mcp", "Sndihooks.carbon"), ! (":Mac:Build:TE.carbon.mcp", "TE.carbon"), ! (":Mac:Build:Win.carbon.mcp", "Win.carbon"), ]), --- 288,313 ---- ## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), ! (":Mac:Build:_AE.carbon.mcp", "_AE.carbon"), ! (":Mac:Build:_App.carbon.mcp", "_App.carbon"), ! (":Mac:Build:_CF.carbon.mcp", "_CF.carbon"), ! (":Mac:Build:_Cm.carbon.mcp", "_Cm.carbon"), ! (":Mac:Build:_Ctl.carbon.mcp", "_Ctl.carbon"), ! (":Mac:Build:_Dlg.carbon.mcp", "_Dlg.carbon"), ! (":Mac:Build:_Drag.carbon.mcp", "_Drag.carbon"), ! (":Mac:Build:_Evt.carbon.mcp", "_Evt.carbon"), ! (":Mac:Build:_Fm.carbon.mcp", "_Fm.carbon"), ! (":Mac:Build:_Icn.carbon.mcp", "_Icn.carbon"), ! (":Mac:Build:_List.carbon.mcp", "_List.carbon"), ! (":Mac:Build:_Menu.carbon.mcp", "_Menu.carbon"), ! (":Mac:Build:_Mlte.carbon.mcp", "_Mlte.carbon"), ! (":Mac:Build:_Qd.carbon.mcp", "_Qd.carbon"), ! (":Mac:Build:_Qdoffs.carbon.mcp", "_Qdoffs.carbon"), ! (":Mac:Build:_Qt.carbon.mcp", "_Qt.carbon"), ! (":Mac:Build:_Res.carbon.mcp", "_Res.carbon"), ! (":Mac:Build:_Scrap.carbon.mcp", "_Scrap.carbon"), ! (":Mac:Build:_Snd.carbon.mcp", "_Snd.carbon"), ! (":Mac:Build:_Sndihooks.carbon.mcp", "_Sndihooks.carbon"), ! (":Mac:Build:_TE.carbon.mcp", "_TE.carbon"), ! (":Mac:Build:_Win.carbon.mcp", "_Win.carbon"), ]), From jackjansen@users.sourceforge.net Thu Aug 23 14:49:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:49:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/icn icnsupport.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/icn In directory usw-pr-cvs1:/tmp/cvs-serv27339/Python/Mac/Modules/icn Modified Files: icnsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: icnsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/icn/icnsupport.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** icnsupport.py 2001/05/22 21:52:42 1.5 --- icnsupport.py 2001/08/23 13:49:36 1.6 *************** *** 8,17 **** # Declarations that change for each manager MACHEADERFILE = 'Icons.h' # The Apple header file ! MODNAME = 'Icn' # The name of the module OBJECTNAME = 'Icon' # The basic name of the objects used here KIND = 'Handle' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,17 ---- # Declarations that change for each manager MACHEADERFILE = 'Icons.h' # The Apple header file ! MODNAME = '_Icn' # The name of the module OBJECTNAME = 'Icon' # The basic name of the objects used here KIND = 'Handle' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Icn' # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:49:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:49:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/list listsupport.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/list In directory usw-pr-cvs1:/tmp/cvs-serv27365/Python/Mac/Modules/list Modified Files: listsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: listsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/listsupport.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** listsupport.py 2001/05/22 21:52:53 1.9 --- listsupport.py 2001/08/23 13:49:41 1.10 *************** *** 8,17 **** # Declarations that change for each manager MACHEADERFILE = 'Lists.h' # The Apple header file ! MODNAME = 'List' # The name of the module OBJECTNAME = 'List' # The basic name of the objects used here KIND = 'Handle' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = "ListHandle" # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,17 ---- # Declarations that change for each manager MACHEADERFILE = 'Lists.h' # The Apple header file ! MODNAME = '_List' # The name of the module OBJECTNAME = 'List' # The basic name of the objects used here KIND = 'Handle' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'List' # The prefix for module-wide routines OBJECTTYPE = "ListHandle" # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:49:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:49:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include macbuildno.h,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv27389/Python/Mac/Include Modified Files: macbuildno.h Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: macbuildno.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/macbuildno.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** macbuildno.h 2001/08/07 13:52:18 1.18 --- macbuildno.h 2001/08/23 13:49:47 1.19 *************** *** 1 **** ! #define BUILD 101 --- 1 ---- ! #define BUILD 104 From jackjansen@users.sourceforge.net Thu Aug 23 14:50:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:50:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qdoffs qdoffssupport.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qdoffs In directory usw-pr-cvs1:/tmp/cvs-serv27582/Python/Mac/Modules/qdoffs Modified Files: qdoffssupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: qdoffssupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qdoffs/qdoffssupport.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** qdoffssupport.py 2001/05/22 21:53:59 1.5 --- qdoffssupport.py 2001/08/23 13:50:16 1.6 *************** *** 8,16 **** # Declarations that change for each manager MACHEADERFILE = 'QDOffscreen.h' # The Apple header file ! MODNAME = 'Qdoffs' # The name of the module OBJECTNAME = 'GWorld' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + 'Ptr' # The C type used to represent them OBJECTPREFIX = OBJECTNAME + 'Obj' # The prefix for object methods --- 8,16 ---- # Declarations that change for each manager MACHEADERFILE = 'QDOffscreen.h' # The Apple header file ! MODNAME = '_Qdoffs' # The name of the module OBJECTNAME = 'GWorld' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Qdoffs' # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + 'Ptr' # The C type used to represent them OBJECTPREFIX = OBJECTNAME + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:50:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:50:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/scrap scrapsupport.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/scrap In directory usw-pr-cvs1:/tmp/cvs-serv27710/Python/Mac/Modules/scrap Modified Files: scrapsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: scrapsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/scrap/scrapsupport.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scrapsupport.py 2001/05/22 21:55:26 1.3 --- scrapsupport.py 2001/08/23 13:50:47 1.4 *************** *** 11,18 **** # Declarations that change for each manager MACHEADERFILE = 'Scrap.h' # The Apple header file ! MODNAME = 'Scrap' # The name of the module # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner OUTPUTFILE = '@' + MODNAME + "module.c" # The file generated by this program --- 11,18 ---- # Declarations that change for each manager MACHEADERFILE = 'Scrap.h' # The Apple header file ! MODNAME = '_Scrap' # The name of the module # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Scrap' # The prefix for module-wide routines INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner OUTPUTFILE = '@' + MODNAME + "module.c" # The file generated by this program From jackjansen@users.sourceforge.net Thu Aug 23 14:51:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:51:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/snd sndsupport.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/snd In directory usw-pr-cvs1:/tmp/cvs-serv27821/Python/Mac/Modules/snd Modified Files: sndsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: sndsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/snd/sndsupport.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** sndsupport.py 2001/06/20 21:22:23 1.16 --- sndsupport.py 2001/08/23 13:51:17 1.17 *************** *** 335,339 **** spbobject = SpbObjectDefinition('SPB', 'SPBObj', 'SPBPtr') spbgenerator = ManualGenerator("SPB", "return SPBObj_New();") ! module = MacModule('Snd', 'Snd', includestuff, finalstuff, initstuff) module.addobject(sndobject) module.addobject(spbobject) --- 335,339 ---- spbobject = SpbObjectDefinition('SPB', 'SPBObj', 'SPBPtr') spbgenerator = ManualGenerator("SPB", "return SPBObj_New();") ! module = MacModule('_Snd', 'Snd', includestuff, finalstuff, initstuff) module.addobject(sndobject) module.addobject(spbobject) *************** *** 360,363 **** # generate output ! SetOutputFileName('Sndmodule.c') module.generate() --- 360,363 ---- # generate output ! SetOutputFileName('_Sndmodule.c') module.generate() From jackjansen@users.sourceforge.net Thu Aug 23 14:49:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:49:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/help helpsupport.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/help In directory usw-pr-cvs1:/tmp/cvs-serv27287/Python/Mac/Modules/help Modified Files: helpsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: helpsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/help/helpsupport.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** helpsupport.py 2000/07/14 22:16:40 1.4 --- helpsupport.py 2001/08/23 13:49:19 1.5 *************** *** 8,17 **** # Declarations that change for each manager MACHEADERFILE = 'Balloons.h' # The Apple header file ! MODNAME = 'Help' # The name of the module OBJECTNAME = 'UNUSED' # The basic name of the objects used here KIND = 'Record' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,17 ---- # Declarations that change for each manager MACHEADERFILE = 'Balloons.h' # The Apple header file ! MODNAME = '_Help' # The name of the module OBJECTNAME = 'UNUSED' # The basic name of the objects used here KIND = 'Record' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Help' # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:49:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:49:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macconfig.c,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv27428/Python/Mac/Modules Modified Files: macconfig.c Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: macconfig.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macconfig.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** macconfig.c 2001/08/07 15:29:17 1.26 --- macconfig.c 2001/08/23 13:49:54 1.27 *************** *** 95,127 **** #define USE_CORE_TOOLBOX #endif ! extern void initApp(); ! extern void initFm(); ! extern void initHelp(); ! extern void initIcn(); ! extern void initList(); ! extern void initMlte(); ! extern void initQdoffs(); ! extern void initSnd(); ! extern void initSndihooks(); ! extern void initScrap(); ! extern void initTE(); extern void initColorPicker(); extern void initPrinting(); ! extern void initCF(); #endif #ifdef USE_CORE_TOOLBOX ! extern void initAE(); ! extern void initCtl(); ! extern void initDlg(); ! extern void initDrag(); ! extern void initEvt(); ! extern void initMenu(); ! extern void initQd(); ! extern void initRes(); ! extern void initWin(); #endif #ifdef USE_QT ! extern void initCm(); ! extern void initQt(); #endif --- 95,127 ---- #define USE_CORE_TOOLBOX #endif ! extern void init_App(); ! extern void init_Fm(); ! extern void init_Help(); ! extern void init_Icn(); ! extern void init_List(); ! extern void init_Mlte(); ! extern void init_Qdoffs(); ! extern void init_Snd(); ! extern void init_Sndihooks(); ! extern void init_Scrap(); ! extern void init_TE(); extern void initColorPicker(); extern void initPrinting(); ! extern void init_CF(); #endif #ifdef USE_CORE_TOOLBOX ! extern void init_AE(); ! extern void init_Ctl(); ! extern void init_Dlg(); ! extern void init_Drag(); ! extern void init_Evt(); ! extern void init_Menu(); ! extern void init_Qd(); ! extern void init_Res(); ! extern void init_Win(); #endif #ifdef USE_QT ! extern void init_Cm(); ! extern void init_Qt(); #endif *************** *** 218,255 **** #endif #ifdef USE_CORE_TOOLBOX ! {"AE", initAE}, ! {"Ctl", initCtl}, ! {"Dlg", initDlg}, ! {"Drag", initDrag}, ! {"Evt", initEvt}, ! {"Menu", initMenu}, ! {"Qd", initQd}, ! {"Win", initWin}, ! {"Res", initRes}, #endif #ifdef USE_TOOLBOX ! {"App", initApp}, ! {"Fm", initFm}, ! {"Icn", initIcn}, ! {"List", initList}, ! {"Mlte", initMlte}, ! {"Qdoffs", initQdoffs}, ! {"Snd", initSnd}, ! {"Sndihooks", initSndihooks}, /* Carbon scrap manager is completely different */ ! {"Scrap", initScrap}, ! {"TE", initTE}, {"ColorPicker", initColorPicker}, #if !TARGET_API_MAC_CARBON ! {"Help", initHelp}, {"Printing", initPrinting}, #endif #if TARGET_API_MAC_CARBON ! {"CF", initCF}, #endif #endif #ifdef USE_QT ! {"Cm", initCm}, ! {"Qt", initQt}, #endif #ifdef USE_IMG --- 218,255 ---- #endif #ifdef USE_CORE_TOOLBOX ! {"_AE", init_AE}, ! {"_Ctl", init_Ctl}, ! {"_Dlg", init_Dlg}, ! {"_Drag", init_Drag}, ! {"_Evt", init_Evt}, ! {"_Menu", init_Menu}, ! {"_Qd", init_Qd}, ! {"_Win", init_Win}, ! {"_Res", init_Res}, #endif #ifdef USE_TOOLBOX ! {"_App", init_App}, ! {"_Fm", init_Fm}, ! {"_Icn", init_Icn}, ! {"_List", init_List}, ! {"_Mlte", init_Mlte}, ! {"_Qdoffs", init_Qdoffs}, ! {"_Snd", init_Snd}, ! {"_Sndihooks", init_Sndihooks}, /* Carbon scrap manager is completely different */ ! {"_Scrap", init_Scrap}, ! {"_TE", init_TE}, {"ColorPicker", initColorPicker}, #if !TARGET_API_MAC_CARBON ! {"_Help", init_Help}, {"Printing", initPrinting}, #endif #if TARGET_API_MAC_CARBON ! {"_CF", init_CF}, #endif #endif #ifdef USE_QT ! {"_Cm", init_Cm}, ! {"_Qt", init_Qt}, #endif #ifdef USE_IMG From jackjansen@users.sourceforge.net Thu Aug 23 14:50:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:50:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/menu menusupport.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/menu In directory usw-pr-cvs1:/tmp/cvs-serv27462/Python/Mac/Modules/menu Modified Files: menusupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: menusupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/menu/menusupport.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** menusupport.py 2001/05/22 21:53:13 1.11 --- menusupport.py 2001/08/23 13:50:01 1.12 *************** *** 8,16 **** # Declarations that change for each manager MACHEADERFILE = 'Menus.h' # The Apple header file ! MODNAME = 'Menu' # The name of the module OBJECTNAME = 'Menu' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + 'Handle' # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,16 ---- # Declarations that change for each manager MACHEADERFILE = 'Menus.h' # The Apple header file ! MODNAME = '_Menu' # The name of the module OBJECTNAME = 'Menu' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Menu' # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + 'Handle' # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:50:09 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:50:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/mlte mltesupport.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/mlte In directory usw-pr-cvs1:/tmp/cvs-serv27549/Python/Mac/Modules/mlte Modified Files: mltesupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: mltesupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/mlte/mltesupport.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mltesupport.py 2001/07/16 21:58:44 1.4 --- mltesupport.py 2001/08/23 13:50:07 1.5 *************** *** 9,16 **** # Declarations that change for each manager ! MODNAME = 'Mlte' # The name of the module # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner OUTPUTFILE = MODNAME + "module.c" # The file generated by this program --- 9,16 ---- # Declarations that change for each manager ! MODNAME = '_Mlte' # The name of the module # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Mlte' # The prefix for module-wide routines INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner OUTPUTFILE = MODNAME + "module.c" # The file generated by this program From jackjansen@users.sourceforge.net Thu Aug 23 14:50:24 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:50:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qd qdsupport.py,1.33,1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qd In directory usw-pr-cvs1:/tmp/cvs-serv27607/Python/Mac/Modules/qd Modified Files: qdsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: qdsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qd/qdsupport.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** qdsupport.py 2001/06/20 21:22:12 1.33 --- qdsupport.py 2001/08/23 13:50:22 1.34 *************** *** 8,16 **** # Declarations that change for each manager MACHEADERFILE = 'QuickDraw.h' # The Apple header file ! MODNAME = 'Qd' # The name of the module OBJECTNAME = 'Graf' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + 'Ptr' # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,16 ---- # Declarations that change for each manager MACHEADERFILE = 'QuickDraw.h' # The Apple header file ! MODNAME = '_Qd' # The name of the module OBJECTNAME = 'Graf' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Qd' # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + 'Ptr' # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:50:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:50:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qt qtsupport.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory usw-pr-cvs1:/tmp/cvs-serv27639/Python/Mac/Modules/qt Modified Files: qtsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: qtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtsupport.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** qtsupport.py 2001/05/22 21:54:42 1.17 --- qtsupport.py 2001/08/23 13:50:27 1.18 *************** *** 10,18 **** # Declarations that change for each manager MACHEADERFILE = 'Movies.h' # The Apple header file ! MODNAME = 'Qt' # The name of the module OBJECTNAME = 'Movie' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = "Movie" # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 10,18 ---- # Declarations that change for each manager MACHEADERFILE = 'Movies.h' # The Apple header file ! MODNAME = '_Qt' # The name of the module OBJECTNAME = 'Movie' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Qt' # The prefix for module-wide routines OBJECTTYPE = "Movie" # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:50:44 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:50:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/res ressupport.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/res In directory usw-pr-cvs1:/tmp/cvs-serv27691/Python/Mac/Modules/res Modified Files: ressupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: ressupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/res/ressupport.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ressupport.py 2001/05/22 21:55:14 1.15 --- ressupport.py 2001/08/23 13:50:42 1.16 *************** *** 94,98 **** """ ! module = MacModule('Res', 'Res', includestuff, finalstuff, initstuff) getattrHookCode = """ --- 94,98 ---- """ ! module = MacModule('_Res', 'Res', includestuff, finalstuff, initstuff) getattrHookCode = """ *************** *** 193,196 **** for f in resmethods: resobject.add(f) ! SetOutputFileName('Resmodule.c') module.generate() --- 193,196 ---- for f in resmethods: resobject.add(f) ! SetOutputFileName('_Resmodule.c') module.generate() From jackjansen@users.sourceforge.net Thu Aug 23 14:51:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:51:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/te tesupport.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/te In directory usw-pr-cvs1:/tmp/cvs-serv27854/Python/Mac/Modules/te Modified Files: tesupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: tesupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/te/tesupport.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tesupport.py 2001/05/22 21:56:10 1.8 --- tesupport.py 2001/08/23 13:51:33 1.9 *************** *** 8,17 **** # Declarations that change for each manager MACHEADERFILE = 'TextEdit.h' # The Apple header file ! MODNAME = 'TE' # The name of the module OBJECTNAME = 'TE' # The basic name of the objects used here KIND = 'Handle' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = "TEHandle" # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,17 ---- # Declarations that change for each manager MACHEADERFILE = 'TextEdit.h' # The Apple header file ! MODNAME = '_TE' # The name of the module OBJECTNAME = 'TE' # The basic name of the objects used here KIND = 'Handle' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'TE' # The prefix for module-wide routines OBJECTTYPE = "TEHandle" # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:51:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:51:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/win winsupport.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/win In directory usw-pr-cvs1:/tmp/cvs-serv27935/Python/Mac/Modules/win Modified Files: winsupport.py Log Message: The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. Index: winsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/winsupport.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** winsupport.py 2001/06/20 21:20:22 1.25 --- winsupport.py 2001/08/23 13:51:46 1.26 *************** *** 8,16 **** # Declarations that change for each manager MACHEADERFILE = 'Windows.h' # The Apple header file ! MODNAME = 'Win' # The name of the module OBJECTNAME = 'Window' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = MODNAME # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + 'Ptr' # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods --- 8,16 ---- # Declarations that change for each manager MACHEADERFILE = 'Windows.h' # The Apple header file ! MODNAME = '_Win' # The name of the module OBJECTNAME = 'Window' # The basic name of the objects used here # The following is *usually* unchanged but may still require tuning ! MODPREFIX = 'Win' # The prefix for module-wide routines OBJECTTYPE = OBJECTNAME + 'Ptr' # The C type used to represent them OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods From jackjansen@users.sourceforge.net Thu Aug 23 14:53:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:53:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python mactoolboxglue.c,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv28399/Python/Python Modified Files: mactoolboxglue.c Log Message: Mac toolbox modules have gotten an _ prepended to their name. Index: mactoolboxglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/mactoolboxglue.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mactoolboxglue.c 2001/08/08 15:28:03 1.2 --- mactoolboxglue.c 2001/08/23 13:53:34 1.3 *************** *** 349,410 **** GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "macfs") ! GLUE_NEW(AppleEvent *, AEDesc_New, "AE") /* XXXX Why by address? */ ! GLUE_CONVERT(AppleEvent, AEDesc_Convert, "AE") ! GLUE_NEW(Component, CmpObj_New, "Cm") ! GLUE_CONVERT(Component, CmpObj_Convert, "Cm") ! GLUE_NEW(ComponentInstance, CmpInstObj_New, "Cm") ! GLUE_CONVERT(ComponentInstance, CmpInstObj_Convert, "Cm") ! GLUE_NEW(ControlHandle, CtlObj_New, "Ctl") ! GLUE_CONVERT(ControlHandle, CtlObj_Convert, "Ctl") ! GLUE_NEW(DialogPtr, DlgObj_New, "Dlg") ! GLUE_CONVERT(DialogPtr, DlgObj_Convert, "Dlg") ! GLUE_NEW(DialogPtr, DlgObj_WhichDialog, "Dlg") ! GLUE_NEW(DragReference, DragObj_New, "Drag") ! GLUE_CONVERT(DragReference, DragObj_Convert, "Drag") ! GLUE_NEW(ListHandle, ListObj_New, "List") ! GLUE_CONVERT(ListHandle, ListObj_Convert, "List") ! GLUE_NEW(MenuHandle, MenuObj_New, "Menu") ! GLUE_CONVERT(MenuHandle, MenuObj_Convert, "Menu") ! GLUE_NEW(GrafPtr, GrafObj_New, "Qd") ! GLUE_CONVERT(GrafPtr, GrafObj_Convert, "Qd") ! GLUE_NEW(BitMapPtr, BMObj_New, "Qd") ! GLUE_CONVERT(BitMapPtr, BMObj_Convert, "Qd") ! GLUE_NEW(RGBColor *, QdRGB_New, "Qd") /* XXXX Why? */ ! GLUE_CONVERT(RGBColor, QdRGB_Convert, "Qd") ! GLUE_NEW(GWorldPtr, GWorldObj_New, "Qdoffs") ! GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Qdoffs") ! GLUE_NEW(Track, TrackObj_New, "Qt") ! GLUE_CONVERT(Track, TrackObj_Convert, "Qt") ! GLUE_NEW(Movie, MovieObj_New, "Qt") ! GLUE_CONVERT(Movie, MovieObj_Convert, "Qt") ! GLUE_NEW(MovieController, MovieCtlObj_New, "Qt") ! GLUE_CONVERT(MovieController, MovieCtlObj_Convert, "Qt") ! GLUE_NEW(TimeBase, TimeBaseObj_New, "Qt") ! GLUE_CONVERT(TimeBase, TimeBaseObj_Convert, "Qt") ! GLUE_NEW(UserData, UserDataObj_New, "Qt") ! GLUE_CONVERT(UserData, UserDataObj_Convert, "Qt") ! GLUE_NEW(Media, MediaObj_New, "Qt") ! GLUE_CONVERT(Media, MediaObj_Convert, "Qt") ! GLUE_NEW(Handle, ResObj_New, "Res") ! GLUE_CONVERT(Handle, ResObj_Convert, "Res") ! GLUE_NEW(Handle, OptResObj_New, "Res") ! GLUE_CONVERT(Handle, OptResObj_Convert, "Res") ! GLUE_NEW(TEHandle, TEObj_New, "TE") ! GLUE_CONVERT(TEHandle, TEObj_Convert, "TE") ! GLUE_NEW(WindowPtr, WinObj_New, "Win") ! GLUE_CONVERT(WindowPtr, WinObj_Convert, "Win") ! GLUE_NEW(WindowPtr, WinObj_WhichWindow, "Win") #endif /* USE_TOOLBOX_OBJECT_GLUE */ --- 349,410 ---- GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "macfs") ! GLUE_NEW(AppleEvent *, AEDesc_New, "_AE") /* XXXX Why by address? */ ! GLUE_CONVERT(AppleEvent, AEDesc_Convert, "_AE") ! GLUE_NEW(Component, CmpObj_New, "_Cm") ! GLUE_CONVERT(Component, CmpObj_Convert, "_Cm") ! GLUE_NEW(ComponentInstance, CmpInstObj_New, "_Cm") ! GLUE_CONVERT(ComponentInstance, CmpInstObj_Convert, "_Cm") ! GLUE_NEW(ControlHandle, CtlObj_New, "_Ctl") ! GLUE_CONVERT(ControlHandle, CtlObj_Convert, "_Ctl") ! GLUE_NEW(DialogPtr, DlgObj_New, "_Dlg") ! GLUE_CONVERT(DialogPtr, DlgObj_Convert, "_Dlg") ! GLUE_NEW(DialogPtr, DlgObj_WhichDialog, "_Dlg") ! GLUE_NEW(DragReference, DragObj_New, "_Drag") ! GLUE_CONVERT(DragReference, DragObj_Convert, "_Drag") ! GLUE_NEW(ListHandle, ListObj_New, "_List") ! GLUE_CONVERT(ListHandle, ListObj_Convert, "_List") ! GLUE_NEW(MenuHandle, MenuObj_New, "_Menu") ! GLUE_CONVERT(MenuHandle, MenuObj_Convert, "_Menu") ! GLUE_NEW(GrafPtr, GrafObj_New, "_Qd") ! GLUE_CONVERT(GrafPtr, GrafObj_Convert, "_Qd") ! GLUE_NEW(BitMapPtr, BMObj_New, "_Qd") ! GLUE_CONVERT(BitMapPtr, BMObj_Convert, "_Qd") ! GLUE_NEW(RGBColor *, QdRGB_New, "_Qd") /* XXXX Why? */ ! GLUE_CONVERT(RGBColor, QdRGB_Convert, "_Qd") ! GLUE_NEW(GWorldPtr, GWorldObj_New, "_Qdoffs") ! GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "_Qdoffs") ! GLUE_NEW(Track, TrackObj_New, "_Qt") ! GLUE_CONVERT(Track, TrackObj_Convert, "_Qt") ! GLUE_NEW(Movie, MovieObj_New, "_Qt") ! GLUE_CONVERT(Movie, MovieObj_Convert, "_Qt") ! GLUE_NEW(MovieController, MovieCtlObj_New, "_Qt") ! GLUE_CONVERT(MovieController, MovieCtlObj_Convert, "_Qt") ! GLUE_NEW(TimeBase, TimeBaseObj_New, "_Qt") ! GLUE_CONVERT(TimeBase, TimeBaseObj_Convert, "_Qt") ! GLUE_NEW(UserData, UserDataObj_New, "_Qt") ! GLUE_CONVERT(UserData, UserDataObj_Convert, "_Qt") ! GLUE_NEW(Media, MediaObj_New, "_Qt") ! GLUE_CONVERT(Media, MediaObj_Convert, "_Qt") ! GLUE_NEW(Handle, ResObj_New, "_Res") ! GLUE_CONVERT(Handle, ResObj_Convert, "_Res") ! GLUE_NEW(Handle, OptResObj_New, "_Res") ! GLUE_CONVERT(Handle, OptResObj_Convert, "_Res") ! GLUE_NEW(TEHandle, TEObj_New, "_TE") ! GLUE_CONVERT(TEHandle, TEObj_Convert, "_TE") ! GLUE_NEW(WindowPtr, WinObj_New, "_Win") ! GLUE_CONVERT(WindowPtr, WinObj_Convert, "_Win") ! GLUE_NEW(WindowPtr, WinObj_WhichWindow, "_Win") #endif /* USE_TOOLBOX_OBJECT_GLUE */ From jackjansen@users.sourceforge.net Thu Aug 23 14:58:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:58:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/snd _Sndihooks.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/snd In directory usw-pr-cvs1:/tmp/cvs-serv29655/Python/Mac/Modules/snd Added Files: _Sndihooks.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Sndihooks.c --- /*********************************************************** Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Stichting Mathematisch Centrum or CWI or Corporation for National Research Initiatives or CNRI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. While CWI is the initial source for this software, a modified version is made available by the Corporation for National Research Initiatives (CNRI) at the Internet address ftp://ftp.python.org. STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" #include #pragma options align=mac68k struct SampleRateAvailable_arg { short numrates; Handle rates; }; struct SampleSizeAvailable_arg { short numsizes; Handle sizes; }; #pragma options align=reset static PyObject *ErrorObject; /* Convert Python object to unsigned Fixed */ static int PyMac_GetUFixed(PyObject *v, Fixed *f) { double d; unsigned long uns; if( !PyArg_Parse(v, "d", &d)) return 0; uns = (unsigned long)(d * 0x10000); *f = (Fixed)uns; return 1; } /* Convert a Point to a Python object */ static PyObject * PyMac_BuildUFixed(Fixed f) { double d; unsigned long funs; funs = (unsigned long)f; d = funs; d = d / 0x10000; return Py_BuildValue("d", d); } /* ----------------------------------------------------- */ static char sndih_getChannelAvailable__doc__[] = "" ; static PyObject * sndih_getChannelAvailable(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short nchannel; OSErr err; if (!PyArg_ParseTuple(args, "l", &inRefNum)) return NULL; if( (err=SPBGetDeviceInfo(inRefNum, siChannelAvailable, (Ptr)&nchannel)) != noErr ) return PyMac_Error(err); return Py_BuildValue("h", nchannel); } static char sndih_getNumberChannels__doc__[] = "" ; static PyObject * sndih_getNumberChannels(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short nchannel; OSErr err; if (!PyArg_ParseTuple(args, "l", &inRefNum)) return NULL; if( (err=SPBGetDeviceInfo(inRefNum, siNumberChannels, (Ptr)&nchannel)) != noErr ) return PyMac_Error(err); return Py_BuildValue("h", nchannel); } static char sndih_setNumberChannels__doc__[] = "" ; static PyObject * sndih_setNumberChannels(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short nchannel; OSErr err; if (!PyArg_ParseTuple(args, "lh", &inRefNum, &nchannel)) return NULL; if( (err=SPBSetDeviceInfo(inRefNum, siNumberChannels, (Ptr)&nchannel)) != noErr ) return PyMac_Error(err); Py_INCREF(Py_None); return Py_None; } static char sndih_getContinuous__doc__[] = "" ; static PyObject * sndih_getContinuous(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short onoff; OSErr err; if (!PyArg_ParseTuple(args, "l", &inRefNum)) return NULL; if( (err=SPBGetDeviceInfo(inRefNum, siContinuous, (Ptr)&onoff)) != noErr ) return PyMac_Error(err); return Py_BuildValue("h", onoff); } static char sndih_setContinuous__doc__[] = "" ; static PyObject * sndih_setContinuous(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short onoff; OSErr err; if (!PyArg_ParseTuple(args, "lh", &inRefNum, &onoff)) return NULL; if( (err=SPBSetDeviceInfo(inRefNum, siContinuous, (Ptr)&onoff)) != noErr ) return PyMac_Error(err); Py_INCREF(Py_None); return Py_None; } static char sndih_getInputSourceNames__doc__[] = "" ; static PyObject * sndih_getInputSourceNames(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; Handle names; OSErr err; if (!PyArg_ParseTuple(args, "l", &inRefNum)) return NULL; if( (err=SPBGetDeviceInfo(inRefNum, siInputSourceNames, (Ptr)&names)) != noErr ) return PyMac_Error(err); return Py_BuildValue("O&", ResObj_New, names); } static char sndih_getInputSource__doc__[] = "" ; static PyObject * sndih_getInputSource(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short source; OSErr err; if (!PyArg_ParseTuple(args, "l", &inRefNum)) return NULL; if( (err=SPBGetDeviceInfo(inRefNum, siInputSource, (Ptr)&source)) != noErr ) return PyMac_Error(err); return Py_BuildValue("h", source); } static char sndih_setInputSource__doc__[] = "" ; static PyObject * sndih_setInputSource(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short source; OSErr err; if (!PyArg_ParseTuple(args, "lh", &inRefNum, &source)) return NULL; if( (err=SPBSetDeviceInfo(inRefNum, siInputSource, (Ptr)&source)) != noErr ) return PyMac_Error(err); Py_INCREF(Py_None); return Py_None; } static char sndih_getPlayThruOnOff__doc__[] = "" ; static PyObject * sndih_getPlayThruOnOff(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short onoff; OSErr err; if (!PyArg_ParseTuple(args, "l", &inRefNum)) return NULL; if( (err=SPBGetDeviceInfo(inRefNum, siPlayThruOnOff, (Ptr)&onoff)) != noErr ) return PyMac_Error(err); return Py_BuildValue("h", onoff); } static char sndih_setPlayThruOnOff__doc__[] = "" ; static PyObject * sndih_setPlayThruOnOff(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short onoff; OSErr err; if (!PyArg_ParseTuple(args, "lh", &inRefNum, &onoff)) return NULL; if( (err=SPBSetDeviceInfo(inRefNum, siPlayThruOnOff, (Ptr)&onoff)) != noErr ) return PyMac_Error(err); Py_INCREF(Py_None); return Py_None; } static char sndih_getSampleRate__doc__[] = "" ; static PyObject * sndih_getSampleRate(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; Fixed sample_rate; OSErr err; if (!PyArg_ParseTuple(args, "l", &inRefNum)) return NULL; if( (err=SPBGetDeviceInfo(inRefNum, siSampleRate, (Ptr)&sample_rate)) != noErr ) return PyMac_Error(err); return Py_BuildValue("O&", PyMac_BuildUFixed, sample_rate); } static char sndih_setSampleRate__doc__[] = "" ; static PyObject * sndih_setSampleRate(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; Fixed sample_rate; OSErr err; if (!PyArg_ParseTuple(args, "lO&", &inRefNum, PyMac_GetUFixed, &sample_rate)) return NULL; if( (err=SPBSetDeviceInfo(inRefNum, siSampleRate, (Ptr)&sample_rate)) != noErr ) return PyMac_Error(err); Py_INCREF(Py_None); return Py_None; } static char sndih_getSampleSize__doc__[] = "" ; static PyObject * sndih_getSampleSize(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short bits; OSErr err; if (!PyArg_ParseTuple(args, "l", &inRefNum)) return NULL; if( (err=SPBGetDeviceInfo(inRefNum, siSampleSize, (Ptr)&bits)) != noErr ) return PyMac_Error(err); return Py_BuildValue("h", bits); } static char sndih_setSampleSize__doc__[] = "" ; static PyObject * sndih_setSampleSize(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; short size; OSErr err; if (!PyArg_ParseTuple(args, "lh", &inRefNum, &size)) return NULL; if( (err=SPBSetDeviceInfo(inRefNum, siSampleSize, (Ptr)&size)) != noErr ) return PyMac_Error(err); Py_INCREF(Py_None); return Py_None; } static char sndih_getSampleSizeAvailable__doc__[] = "" ; static PyObject * sndih_getSampleSizeAvailable(self, args) PyObject *self; /* Not used */ PyObject *args; { long inRefNum; struct SampleSizeAvailable_arg arg; OSErr err; PyObject *rsizes; short *fsizes; int i; arg.sizes = NULL; rsizes = NULL; if (!PyArg_ParseTuple(args, "l", &inRefNum)) return NULL; if( (err=SPBGetDeviceInfo(inRefNum, siSampleSizeAvailable, (Ptr)&arg)) != noErr ) { return PyMac_Error(err); } fsizes = (short *)*(arg.sizes); /* Handle contains a list of rates */ if( (rsizes = PyTuple_New(arg.numsizes)) == NULL) return NULL; for( i=0; i Update of /cvsroot/python/python/dist/src/Mac/Modules/win In directory usw-pr-cvs1:/tmp/cvs-serv29702/Python/Mac/Modules/win Added Files: _Winmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Winmodule.c --- /* ========================== Module _Win =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...2775 lines suppressed...] PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_New); PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_WhichWindow); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WindowPtr, WinObj_Convert); m = Py_InitModule("_Win", Win_methods); d = PyModule_GetDict(m); Win_Error = PyMac_GetOSErrException(); if (Win_Error == NULL || PyDict_SetItemString(d, "Error", Win_Error) != 0) return; Window_Type.ob_type = &PyType_Type; Py_INCREF(&Window_Type); if (PyDict_SetItemString(d, "WindowType", (PyObject *)&Window_Type) != 0) Py_FatalError("can't initialize WindowType"); } /* ======================== End module _Win ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 14:58:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:58:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/te _TEmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/te In directory usw-pr-cvs1:/tmp/cvs-serv29743/Python/Mac/Modules/te Added Files: _TEmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _TEmodule.c --- /* =========================== Module _TE =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...1001 lines suppressed...] PyMac_INIT_TOOLBOX_OBJECT_NEW(TEHandle, TEObj_New); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TEHandle, TEObj_Convert); m = Py_InitModule("_TE", TE_methods); d = PyModule_GetDict(m); TE_Error = PyMac_GetOSErrException(); if (TE_Error == NULL || PyDict_SetItemString(d, "Error", TE_Error) != 0) return; TE_Type.ob_type = &PyType_Type; Py_INCREF(&TE_Type); if (PyDict_SetItemString(d, "TEType", (PyObject *)&TE_Type) != 0) Py_FatalError("can't initialize TEType"); } /* ========================= End module _TE ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 14:59:01 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:59:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/snd _Sndmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/snd In directory usw-pr-cvs1:/tmp/cvs-serv29770/Python/Mac/Modules/snd Added Files: _Sndmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Sndmodule.c --- /* ========================== Module _Snd =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...1423 lines suppressed...] m = Py_InitModule("_Snd", Snd_methods); d = PyModule_GetDict(m); Snd_Error = PyMac_GetOSErrException(); if (Snd_Error == NULL || PyDict_SetItemString(d, "Error", Snd_Error) != 0) return; SndChannel_Type.ob_type = &PyType_Type; Py_INCREF(&SndChannel_Type); if (PyDict_SetItemString(d, "SndChannelType", (PyObject *)&SndChannel_Type) != 0) Py_FatalError("can't initialize SndChannelType"); SPB_Type.ob_type = &PyType_Type; Py_INCREF(&SPB_Type); if (PyDict_SetItemString(d, "SPBType", (PyObject *)&SPB_Type) != 0) Py_FatalError("can't initialize SPBType"); } /* ======================== End module _Snd ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 14:59:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:59:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/res _Resmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/res In directory usw-pr-cvs1:/tmp/cvs-serv29852/Python/Mac/Modules/res Added Files: _Resmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Resmodule.c --- /* ========================== Module _Res =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...1548 lines suppressed...] PyMac_INIT_TOOLBOX_OBJECT_NEW(Handle, ResObj_New); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Handle, ResObj_Convert); PyMac_INIT_TOOLBOX_OBJECT_NEW(Handle, OptResObj_New); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Handle, OptResObj_Convert); m = Py_InitModule("_Res", Res_methods); d = PyModule_GetDict(m); Res_Error = PyMac_GetOSErrException(); if (Res_Error == NULL || PyDict_SetItemString(d, "Error", Res_Error) != 0) return; Resource_Type.ob_type = &PyType_Type; Py_INCREF(&Resource_Type); if (PyDict_SetItemString(d, "ResourceType", (PyObject *)&Resource_Type) != 0) Py_FatalError("can't initialize ResourceType"); } /* ======================== End module _Res ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 14:59:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:59:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qt _Qtmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory usw-pr-cvs1:/tmp/cvs-serv29898/Python/Mac/Modules/qt Added Files: _Qtmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Qtmodule.c --- /* =========================== Module _Qt =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...8387 lines suppressed...] UserData_Type.ob_type = &PyType_Type; Py_INCREF(&UserData_Type); if (PyDict_SetItemString(d, "UserDataType", (PyObject *)&UserData_Type) != 0) Py_FatalError("can't initialize UserDataType"); Media_Type.ob_type = &PyType_Type; Py_INCREF(&Media_Type); if (PyDict_SetItemString(d, "MediaType", (PyObject *)&Media_Type) != 0) Py_FatalError("can't initialize MediaType"); Track_Type.ob_type = &PyType_Type; Py_INCREF(&Track_Type); if (PyDict_SetItemString(d, "TrackType", (PyObject *)&Track_Type) != 0) Py_FatalError("can't initialize TrackType"); Movie_Type.ob_type = &PyType_Type; Py_INCREF(&Movie_Type); if (PyDict_SetItemString(d, "MovieType", (PyObject *)&Movie_Type) != 0) Py_FatalError("can't initialize MovieType"); } /* ========================= End module _Qt ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 14:59:53 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 06:59:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qdoffs _Qdoffsmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qdoffs In directory usw-pr-cvs1:/tmp/cvs-serv30020/Python/Mac/Modules/qdoffs Added Files: _Qdoffsmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Qdoffsmodule.c --- /* ========================= Module _Qdoffs ========================= */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS #include #else #include #endif #ifdef USE_TOOLBOX_OBJECT_GLUE extern PyObject *_GWorldObj_New(GWorldPtr); extern int _GWorldObj_Convert(PyObject *, GWorldPtr *); #define GWorldObj_New _GWorldObj_New #define GWorldObj_Convert _GWorldObj_Convert #endif #define as_GrafPtr(gworld) ((GrafPtr)(gworld)) static PyObject *Qdoffs_Error; /* ----------------------- Object type GWorld ----------------------- */ PyTypeObject GWorld_Type; #define GWorldObj_Check(x) ((x)->ob_type == &GWorld_Type) typedef struct GWorldObject { PyObject_HEAD GWorldPtr ob_itself; } GWorldObject; PyObject *GWorldObj_New(GWorldPtr itself) { GWorldObject *it; if (itself == NULL) return PyMac_Error(resNotFound); it = PyObject_NEW(GWorldObject, &GWorld_Type); if (it == NULL) return NULL; it->ob_itself = itself; return (PyObject *)it; } GWorldObj_Convert(PyObject *v, GWorldPtr *p_itself) { if (!GWorldObj_Check(v)) { PyErr_SetString(PyExc_TypeError, "GWorld required"); return 0; } *p_itself = ((GWorldObject *)v)->ob_itself; return 1; } static void GWorldObj_dealloc(GWorldObject *self) { DisposeGWorld(self->ob_itself); PyMem_DEL(self); } static PyObject *GWorldObj_GetGWorldDevice(GWorldObject *_self, PyObject *_args) { PyObject *_res = NULL; GDHandle _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetGWorldDevice(_self->ob_itself); _res = Py_BuildValue("O&", ResObj_New, _rv); return _res; } static PyObject *GWorldObj_GetGWorldPixMap(GWorldObject *_self, PyObject *_args) { PyObject *_res = NULL; PixMapHandle _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetGWorldPixMap(_self->ob_itself); _res = Py_BuildValue("O&", ResObj_New, _rv); return _res; } static PyObject *GWorldObj_as_GrafPtr(GWorldObject *_self, PyObject *_args) { PyObject *_res = NULL; GrafPtr _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = as_GrafPtr(_self->ob_itself); _res = Py_BuildValue("O&", GrafObj_New, _rv); return _res; } static PyMethodDef GWorldObj_methods[] = { {"GetGWorldDevice", (PyCFunction)GWorldObj_GetGWorldDevice, 1, "() -> (GDHandle _rv)"}, {"GetGWorldPixMap", (PyCFunction)GWorldObj_GetGWorldPixMap, 1, "() -> (PixMapHandle _rv)"}, {"as_GrafPtr", (PyCFunction)GWorldObj_as_GrafPtr, 1, "() -> (GrafPtr _rv)"}, {NULL, NULL, 0} }; PyMethodChain GWorldObj_chain = { GWorldObj_methods, NULL }; static PyObject *GWorldObj_getattr(GWorldObject *self, char *name) { return Py_FindMethodInChain(&GWorldObj_chain, (PyObject *)self, name); } #define GWorldObj_setattr NULL #define GWorldObj_compare NULL #define GWorldObj_repr NULL #define GWorldObj_hash NULL PyTypeObject GWorld_Type = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "GWorld", /*tp_name*/ sizeof(GWorldObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ (destructor) GWorldObj_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ (getattrfunc) GWorldObj_getattr, /*tp_getattr*/ (setattrfunc) GWorldObj_setattr, /*tp_setattr*/ (cmpfunc) GWorldObj_compare, /*tp_compare*/ (reprfunc) GWorldObj_repr, /*tp_repr*/ (PyNumberMethods *)0, /* tp_as_number */ (PySequenceMethods *)0, /* tp_as_sequence */ (PyMappingMethods *)0, /* tp_as_mapping */ (hashfunc) GWorldObj_hash, /*tp_hash*/ }; /* --------------------- End object type GWorld --------------------- */ static PyObject *Qdoffs_NewGWorld(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; QDErr _err; GWorldPtr offscreenGWorld; short PixelDepth; Rect boundsRect; CTabHandle cTable; GDHandle aGDevice; GWorldFlags flags; if (!PyArg_ParseTuple(_args, "hO&O&O&l", &PixelDepth, PyMac_GetRect, &boundsRect, OptResObj_Convert, &cTable, OptResObj_Convert, &aGDevice, &flags)) return NULL; _err = NewGWorld(&offscreenGWorld, PixelDepth, &boundsRect, cTable, aGDevice, flags); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", GWorldObj_New, offscreenGWorld); return _res; } static PyObject *Qdoffs_LockPixels(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; PixMapHandle pm; if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &pm)) return NULL; _rv = LockPixels(pm); _res = Py_BuildValue("b", _rv); return _res; } static PyObject *Qdoffs_UnlockPixels(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; PixMapHandle pm; if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &pm)) return NULL; UnlockPixels(pm); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Qdoffs_UpdateGWorld(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; GWorldFlags _rv; GWorldPtr offscreenGWorld; short pixelDepth; Rect boundsRect; CTabHandle cTable; GDHandle aGDevice; GWorldFlags flags; if (!PyArg_ParseTuple(_args, "hO&O&O&l", &pixelDepth, PyMac_GetRect, &boundsRect, OptResObj_Convert, &cTable, OptResObj_Convert, &aGDevice, &flags)) return NULL; _rv = UpdateGWorld(&offscreenGWorld, pixelDepth, &boundsRect, cTable, aGDevice, flags); _res = Py_BuildValue("lO&", _rv, GWorldObj_New, offscreenGWorld); return _res; } static PyObject *Qdoffs_GetGWorld(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; CGrafPtr port; GDHandle gdh; if (!PyArg_ParseTuple(_args, "")) return NULL; GetGWorld(&port, &gdh); _res = Py_BuildValue("O&O&", GrafObj_New, port, ResObj_New, gdh); return _res; } static PyObject *Qdoffs_SetGWorld(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; CGrafPtr port; GDHandle gdh; if (!PyArg_ParseTuple(_args, "O&O&", GrafObj_Convert, &port, OptResObj_Convert, &gdh)) return NULL; SetGWorld(port, gdh); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Qdoffs_CTabChanged(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; CTabHandle ctab; if (!PyArg_ParseTuple(_args, "O&", OptResObj_Convert, &ctab)) return NULL; CTabChanged(ctab); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Qdoffs_PixPatChanged(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; PixPatHandle ppat; if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &ppat)) return NULL; PixPatChanged(ppat); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Qdoffs_PortChanged(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; GrafPtr port; if (!PyArg_ParseTuple(_args, "O&", GrafObj_Convert, &port)) return NULL; PortChanged(port); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Qdoffs_GDeviceChanged(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; GDHandle gdh; if (!PyArg_ParseTuple(_args, "O&", OptResObj_Convert, &gdh)) return NULL; GDeviceChanged(gdh); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Qdoffs_AllowPurgePixels(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; PixMapHandle pm; if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &pm)) return NULL; AllowPurgePixels(pm); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Qdoffs_NoPurgePixels(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; PixMapHandle pm; if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &pm)) return NULL; NoPurgePixels(pm); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Qdoffs_GetPixelsState(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; GWorldFlags _rv; PixMapHandle pm; if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &pm)) return NULL; _rv = GetPixelsState(pm); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *Qdoffs_SetPixelsState(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; PixMapHandle pm; GWorldFlags state; if (!PyArg_ParseTuple(_args, "O&l", ResObj_Convert, &pm, &state)) return NULL; SetPixelsState(pm, state); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Qdoffs_GetPixRowBytes(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; PixMapHandle pm; if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &pm)) return NULL; _rv = GetPixRowBytes(pm); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *Qdoffs_NewScreenBuffer(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; QDErr _err; Rect globalRect; Boolean purgeable; GDHandle gdh; PixMapHandle offscreenPixMap; if (!PyArg_ParseTuple(_args, "O&b", PyMac_GetRect, &globalRect, &purgeable)) return NULL; _err = NewScreenBuffer(&globalRect, purgeable, &gdh, &offscreenPixMap); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&O&", ResObj_New, gdh, ResObj_New, offscreenPixMap); return _res; } static PyObject *Qdoffs_DisposeScreenBuffer(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; PixMapHandle offscreenPixMap; if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &offscreenPixMap)) return NULL; DisposeScreenBuffer(offscreenPixMap); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Qdoffs_QDDone(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; GrafPtr port; if (!PyArg_ParseTuple(_args, "O&", GrafObj_Convert, &port)) return NULL; _rv = QDDone(port); _res = Py_BuildValue("b", _rv); return _res; } static PyObject *Qdoffs_OffscreenVersion(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = OffscreenVersion(); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *Qdoffs_NewTempScreenBuffer(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; QDErr _err; Rect globalRect; Boolean purgeable; GDHandle gdh; PixMapHandle offscreenPixMap; if (!PyArg_ParseTuple(_args, "O&b", PyMac_GetRect, &globalRect, &purgeable)) return NULL; _err = NewTempScreenBuffer(&globalRect, purgeable, &gdh, &offscreenPixMap); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&O&", ResObj_New, gdh, ResObj_New, offscreenPixMap); return _res; } static PyObject *Qdoffs_PixMap32Bit(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; PixMapHandle pmHandle; if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &pmHandle)) return NULL; _rv = PixMap32Bit(pmHandle); _res = Py_BuildValue("b", _rv); return _res; } static PyObject *Qdoffs_GetPixMapBytes(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; PixMapHandle pm; int from, length; char *cp; if ( !PyArg_ParseTuple(_args, "O&ii", ResObj_Convert, &pm, &from, &length) ) return NULL; cp = GetPixBaseAddr(pm)+from; return PyString_FromStringAndSize(cp, length); } static PyObject *Qdoffs_PutPixMapBytes(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; PixMapHandle pm; int from, length; char *cp, *icp; if ( !PyArg_ParseTuple(_args, "O&is#", ResObj_Convert, &pm, &from, &icp, &length) ) return NULL; cp = GetPixBaseAddr(pm)+from; memcpy(cp, icp, length); Py_INCREF(Py_None); return Py_None; } static PyMethodDef Qdoffs_methods[] = { {"NewGWorld", (PyCFunction)Qdoffs_NewGWorld, 1, "(short PixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldPtr offscreenGWorld)"}, {"LockPixels", (PyCFunction)Qdoffs_LockPixels, 1, "(PixMapHandle pm) -> (Boolean _rv)"}, {"UnlockPixels", (PyCFunction)Qdoffs_UnlockPixels, 1, "(PixMapHandle pm) -> None"}, {"UpdateGWorld", (PyCFunction)Qdoffs_UpdateGWorld, 1, "(short pixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldFlags _rv, GWorldPtr offscreenGWorld)"}, {"GetGWorld", (PyCFunction)Qdoffs_GetGWorld, 1, "() -> (CGrafPtr port, GDHandle gdh)"}, {"SetGWorld", (PyCFunction)Qdoffs_SetGWorld, 1, "(CGrafPtr port, GDHandle gdh) -> None"}, {"CTabChanged", (PyCFunction)Qdoffs_CTabChanged, 1, "(CTabHandle ctab) -> None"}, {"PixPatChanged", (PyCFunction)Qdoffs_PixPatChanged, 1, "(PixPatHandle ppat) -> None"}, {"PortChanged", (PyCFunction)Qdoffs_PortChanged, 1, "(GrafPtr port) -> None"}, {"GDeviceChanged", (PyCFunction)Qdoffs_GDeviceChanged, 1, "(GDHandle gdh) -> None"}, {"AllowPurgePixels", (PyCFunction)Qdoffs_AllowPurgePixels, 1, "(PixMapHandle pm) -> None"}, {"NoPurgePixels", (PyCFunction)Qdoffs_NoPurgePixels, 1, "(PixMapHandle pm) -> None"}, {"GetPixelsState", (PyCFunction)Qdoffs_GetPixelsState, 1, "(PixMapHandle pm) -> (GWorldFlags _rv)"}, {"SetPixelsState", (PyCFunction)Qdoffs_SetPixelsState, 1, "(PixMapHandle pm, GWorldFlags state) -> None"}, {"GetPixRowBytes", (PyCFunction)Qdoffs_GetPixRowBytes, 1, "(PixMapHandle pm) -> (long _rv)"}, {"NewScreenBuffer", (PyCFunction)Qdoffs_NewScreenBuffer, 1, "(Rect globalRect, Boolean purgeable) -> (GDHandle gdh, PixMapHandle offscreenPixMap)"}, {"DisposeScreenBuffer", (PyCFunction)Qdoffs_DisposeScreenBuffer, 1, "(PixMapHandle offscreenPixMap) -> None"}, {"QDDone", (PyCFunction)Qdoffs_QDDone, 1, "(GrafPtr port) -> (Boolean _rv)"}, {"OffscreenVersion", (PyCFunction)Qdoffs_OffscreenVersion, 1, "() -> (long _rv)"}, {"NewTempScreenBuffer", (PyCFunction)Qdoffs_NewTempScreenBuffer, 1, "(Rect globalRect, Boolean purgeable) -> (GDHandle gdh, PixMapHandle offscreenPixMap)"}, {"PixMap32Bit", (PyCFunction)Qdoffs_PixMap32Bit, 1, "(PixMapHandle pmHandle) -> (Boolean _rv)"}, {"GetPixMapBytes", (PyCFunction)Qdoffs_GetPixMapBytes, 1, "(pixmap, int start, int size) -> string. Return bytes from the pixmap"}, {"PutPixMapBytes", (PyCFunction)Qdoffs_PutPixMapBytes, 1, "(pixmap, int start, string data). Store bytes into the pixmap"}, {NULL, NULL, 0} }; void init_Qdoffs(void) { PyObject *m; PyObject *d; PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldPtr, GWorldObj_New); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldPtr, GWorldObj_Convert); m = Py_InitModule("_Qdoffs", Qdoffs_methods); d = PyModule_GetDict(m); Qdoffs_Error = PyMac_GetOSErrException(); if (Qdoffs_Error == NULL || PyDict_SetItemString(d, "Error", Qdoffs_Error) != 0) return; GWorld_Type.ob_type = &PyType_Type; Py_INCREF(&GWorld_Type); if (PyDict_SetItemString(d, "GWorldType", (PyObject *)&GWorld_Type) != 0) Py_FatalError("can't initialize GWorldType"); } /* ======================= End module _Qdoffs ======================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:00:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:00:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/mlte _Mltemodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/mlte In directory usw-pr-cvs1:/tmp/cvs-serv30194/Python/Mac/Modules/mlte Added Files: _Mltemodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Mltemodule.c --- /* ========================== Module _Mlte ========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...1353 lines suppressed...] m = Py_InitModule("_Mlte", Mlte_methods); d = PyModule_GetDict(m); Mlte_Error = PyMac_GetOSErrException(); if (Mlte_Error == NULL || PyDict_SetItemString(d, "Error", Mlte_Error) != 0) return; TXNObject_Type.ob_type = &PyType_Type; Py_INCREF(&TXNObject_Type); if (PyDict_SetItemString(d, "TXNObjectType", (PyObject *)&TXNObject_Type) != 0) Py_FatalError("can't initialize TXNObjectType"); TXNFontMenuObject_Type.ob_type = &PyType_Type; Py_INCREF(&TXNFontMenuObject_Type); if (PyDict_SetItemString(d, "TXNFontMenuObjectType", (PyObject *)&TXNFontMenuObject_Type) != 0) Py_FatalError("can't initialize TXNFontMenuObjectType"); } /* ======================== End module _Mlte ======================== */ From jackjansen@users.sourceforge.net Thu Aug 23 15:00:34 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:00:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/list _Listmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/list In directory usw-pr-cvs1:/tmp/cvs-serv30254/Python/Mac/Modules/list Added Files: _Listmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Listmodule.c --- /* ========================== Module _List ========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...970 lines suppressed...] PyMac_INIT_TOOLBOX_OBJECT_NEW(ListHandle, ListObj_New); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListHandle, ListObj_Convert); m = Py_InitModule("_List", List_methods); d = PyModule_GetDict(m); List_Error = PyMac_GetOSErrException(); if (List_Error == NULL || PyDict_SetItemString(d, "Error", List_Error) != 0) return; List_Type.ob_type = &PyType_Type; Py_INCREF(&List_Type); if (PyDict_SetItemString(d, "ListType", (PyObject *)&List_Type) != 0) Py_FatalError("can't initialize ListType"); } /* ======================== End module _List ======================== */ From jackjansen@users.sourceforge.net Thu Aug 23 15:00:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:00:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/help _Helpmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/help In directory usw-pr-cvs1:/tmp/cvs-serv30318/Python/Mac/Modules/help Added Files: _Helpmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Helpmodule.c --- /* ========================== Module _Help ========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #include static PyObject *Help_Error; static PyObject *Help_HMGetHelpMenuHandle(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; MenuHandle mh; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = HMGetHelpMenuHandle(&mh); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", MenuObj_New, mh); return _res; } static PyObject *Help_HMRemoveBalloon(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = HMRemoveBalloon(); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Help_HMIsBalloon(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = HMIsBalloon(); _res = Py_BuildValue("b", _rv); return _res; } static PyObject *Help_HMGetBalloons(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = HMGetBalloons(); _res = Py_BuildValue("b", _rv); return _res; } static PyObject *Help_HMSetBalloons(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; Boolean flag; if (!PyArg_ParseTuple(_args, "b", &flag)) return NULL; _err = HMSetBalloons(flag); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Help_HMSetFont(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; SInt16 font; if (!PyArg_ParseTuple(_args, "h", &font)) return NULL; _err = HMSetFont(font); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Help_HMSetFontSize(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; UInt16 fontSize; if (!PyArg_ParseTuple(_args, "H", &fontSize)) return NULL; _err = HMSetFontSize(fontSize); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Help_HMGetFont(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; SInt16 font; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = HMGetFont(&font); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("h", font); return _res; } static PyObject *Help_HMGetFontSize(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; UInt16 fontSize; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = HMGetFontSize(&fontSize); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("H", fontSize); return _res; } static PyObject *Help_HMSetDialogResID(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; SInt16 resID; if (!PyArg_ParseTuple(_args, "h", &resID)) return NULL; _err = HMSetDialogResID(resID); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Help_HMSetMenuResID(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; SInt16 menuID; SInt16 resID; if (!PyArg_ParseTuple(_args, "hh", &menuID, &resID)) return NULL; _err = HMSetMenuResID(menuID, resID); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Help_HMScanTemplateItems(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; SInt16 whichID; SInt16 whichResFile; ResType whichType; if (!PyArg_ParseTuple(_args, "hhO&", &whichID, &whichResFile, PyMac_GetOSType, &whichType)) return NULL; _err = HMScanTemplateItems(whichID, whichResFile, whichType); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Help_HMGetDialogResID(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; SInt16 resID; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = HMGetDialogResID(&resID); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("h", resID); return _res; } static PyObject *Help_HMGetMenuResID(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; SInt16 menuID; SInt16 resID; if (!PyArg_ParseTuple(_args, "h", &menuID)) return NULL; _err = HMGetMenuResID(menuID, &resID); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("h", resID); return _res; } static PyObject *Help_HMGetBalloonWindow(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; WindowPtr window; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = HMGetBalloonWindow(&window); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", WinObj_WhichWindow, window); return _res; } static PyMethodDef Help_methods[] = { {"HMGetHelpMenuHandle", (PyCFunction)Help_HMGetHelpMenuHandle, 1, "() -> (MenuHandle mh)"}, {"HMRemoveBalloon", (PyCFunction)Help_HMRemoveBalloon, 1, "() -> None"}, {"HMIsBalloon", (PyCFunction)Help_HMIsBalloon, 1, "() -> (Boolean _rv)"}, {"HMGetBalloons", (PyCFunction)Help_HMGetBalloons, 1, "() -> (Boolean _rv)"}, {"HMSetBalloons", (PyCFunction)Help_HMSetBalloons, 1, "(Boolean flag) -> None"}, {"HMSetFont", (PyCFunction)Help_HMSetFont, 1, "(SInt16 font) -> None"}, {"HMSetFontSize", (PyCFunction)Help_HMSetFontSize, 1, "(UInt16 fontSize) -> None"}, {"HMGetFont", (PyCFunction)Help_HMGetFont, 1, "() -> (SInt16 font)"}, {"HMGetFontSize", (PyCFunction)Help_HMGetFontSize, 1, "() -> (UInt16 fontSize)"}, {"HMSetDialogResID", (PyCFunction)Help_HMSetDialogResID, 1, "(SInt16 resID) -> None"}, {"HMSetMenuResID", (PyCFunction)Help_HMSetMenuResID, 1, "(SInt16 menuID, SInt16 resID) -> None"}, {"HMScanTemplateItems", (PyCFunction)Help_HMScanTemplateItems, 1, "(SInt16 whichID, SInt16 whichResFile, ResType whichType) -> None"}, {"HMGetDialogResID", (PyCFunction)Help_HMGetDialogResID, 1, "() -> (SInt16 resID)"}, {"HMGetMenuResID", (PyCFunction)Help_HMGetMenuResID, 1, "(SInt16 menuID) -> (SInt16 resID)"}, {"HMGetBalloonWindow", (PyCFunction)Help_HMGetBalloonWindow, 1, "() -> (WindowPtr window)"}, {NULL, NULL, 0} }; void init_Help(void) { PyObject *m; PyObject *d; m = Py_InitModule("_Help", Help_methods); d = PyModule_GetDict(m); Help_Error = PyMac_GetOSErrException(); if (Help_Error == NULL || PyDict_SetItemString(d, "Error", Help_Error) != 0) return; } /* ======================== End module _Help ======================== */ From jackjansen@users.sourceforge.net Thu Aug 23 15:01:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:01:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/evt _Evtmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/evt In directory usw-pr-cvs1:/tmp/cvs-serv30421/Python/Mac/Modules/evt Added Files: _Evtmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Evtmodule.c --- /* ========================== Module _Evt =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS #include #else #include #endif static PyObject *Evt_Error; static PyObject *Evt_GetMouse(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Point mouseLoc; if (!PyArg_ParseTuple(_args, "")) return NULL; GetMouse(&mouseLoc); _res = Py_BuildValue("O&", PyMac_BuildPoint, mouseLoc); return _res; } static PyObject *Evt_Button(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = Button(); _res = Py_BuildValue("b", _rv); return _res; } static PyObject *Evt_StillDown(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = StillDown(); _res = Py_BuildValue("b", _rv); return _res; } static PyObject *Evt_WaitMouseUp(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = WaitMouseUp(); _res = Py_BuildValue("b", _rv); return _res; } static PyObject *Evt_TickCount(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; UInt32 _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = TickCount(); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *Evt_GetCaretTime(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; UInt32 _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetCaretTime(); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *Evt_GetKeys(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; KeyMap theKeys__out__; if (!PyArg_ParseTuple(_args, "")) return NULL; GetKeys(theKeys__out__); _res = Py_BuildValue("s#", (char *)&theKeys__out__, (int)sizeof(KeyMap)); theKeys__error__: ; return _res; } static PyObject *Evt_GetDblTime(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; UInt32 _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetDblTime(); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *Evt_SetEventMask(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; EventMask value; if (!PyArg_ParseTuple(_args, "H", &value)) return NULL; SetEventMask(value); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Evt_GetNextEvent(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; EventMask eventMask; EventRecord theEvent; if (!PyArg_ParseTuple(_args, "H", &eventMask)) return NULL; _rv = GetNextEvent(eventMask, &theEvent); _res = Py_BuildValue("bO&", _rv, PyMac_BuildEventRecord, &theEvent); return _res; } static PyObject *Evt_EventAvail(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; EventMask eventMask; EventRecord theEvent; if (!PyArg_ParseTuple(_args, "H", &eventMask)) return NULL; _rv = EventAvail(eventMask, &theEvent); _res = Py_BuildValue("bO&", _rv, PyMac_BuildEventRecord, &theEvent); return _res; } static PyObject *Evt_PostEvent(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; EventKind eventNum; UInt32 eventMsg; if (!PyArg_ParseTuple(_args, "Hl", &eventNum, &eventMsg)) return NULL; _err = PostEvent(eventNum, eventMsg); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } #if !TARGET_API_MAC_CARBON static PyObject *Evt_OSEventAvail(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; EventMask mask; EventRecord theEvent; if (!PyArg_ParseTuple(_args, "H", &mask)) return NULL; _rv = OSEventAvail(mask, &theEvent); _res = Py_BuildValue("bO&", _rv, PyMac_BuildEventRecord, &theEvent); return _res; } #endif #if !TARGET_API_MAC_CARBON static PyObject *Evt_GetOSEvent(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; EventMask mask; EventRecord theEvent; if (!PyArg_ParseTuple(_args, "H", &mask)) return NULL; _rv = GetOSEvent(mask, &theEvent); _res = Py_BuildValue("bO&", _rv, PyMac_BuildEventRecord, &theEvent); return _res; } #endif static PyObject *Evt_FlushEvents(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; EventMask whichMask; EventMask stopMask; if (!PyArg_ParseTuple(_args, "HH", &whichMask, &stopMask)) return NULL; FlushEvents(whichMask, stopMask); Py_INCREF(Py_None); _res = Py_None; return _res; } #if !TARGET_API_MAC_CARBON static PyObject *Evt_SystemClick(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; EventRecord theEvent; WindowPtr theWindow; if (!PyArg_ParseTuple(_args, "O&O&", PyMac_GetEventRecord, &theEvent, WinObj_Convert, &theWindow)) return NULL; SystemClick(&theEvent, theWindow); Py_INCREF(Py_None); _res = Py_None; return _res; } #endif #if !TARGET_API_MAC_CARBON static PyObject *Evt_SystemTask(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; if (!PyArg_ParseTuple(_args, "")) return NULL; SystemTask(); Py_INCREF(Py_None); _res = Py_None; return _res; } #endif #if !TARGET_API_MAC_CARBON static PyObject *Evt_SystemEvent(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; EventRecord theEvent; if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &theEvent)) return NULL; _rv = SystemEvent(&theEvent); _res = Py_BuildValue("b", _rv); return _res; } #endif #if TARGET_API_MAC_CARBON static PyObject *Evt_GetGlobalMouse(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Point globalMouse; if (!PyArg_ParseTuple(_args, "")) return NULL; GetGlobalMouse(&globalMouse); _res = Py_BuildValue("O&", PyMac_BuildPoint, globalMouse); return _res; } #endif #if TARGET_API_MAC_CARBON static PyObject *Evt_GetCurrentKeyModifiers(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; UInt32 _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetCurrentKeyModifiers(); _res = Py_BuildValue("l", _rv); return _res; } #endif #if TARGET_API_MAC_CARBON static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = CheckEventQueueForUserCancel(); _res = Py_BuildValue("b", _rv); return _res; } #endif static PyObject *Evt_WaitNextEvent(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; EventMask eventMask; EventRecord theEvent; UInt32 sleep; Handle mouseregion = (Handle)0; if (!PyArg_ParseTuple(_args, "Hl|O&", &eventMask, &sleep, OptResObj_Convert, &mouseregion)) return NULL; _rv = WaitNextEvent(eventMask, &theEvent, sleep, (RgnHandle)mouseregion); _res = Py_BuildValue("bO&", _rv, PyMac_BuildEventRecord, &theEvent); return _res; } static PyMethodDef Evt_methods[] = { {"GetMouse", (PyCFunction)Evt_GetMouse, 1, "() -> (Point mouseLoc)"}, {"Button", (PyCFunction)Evt_Button, 1, "() -> (Boolean _rv)"}, {"StillDown", (PyCFunction)Evt_StillDown, 1, "() -> (Boolean _rv)"}, {"WaitMouseUp", (PyCFunction)Evt_WaitMouseUp, 1, "() -> (Boolean _rv)"}, {"TickCount", (PyCFunction)Evt_TickCount, 1, "() -> (UInt32 _rv)"}, {"GetCaretTime", (PyCFunction)Evt_GetCaretTime, 1, "() -> (UInt32 _rv)"}, {"GetKeys", (PyCFunction)Evt_GetKeys, 1, "() -> (KeyMap theKeys)"}, {"GetDblTime", (PyCFunction)Evt_GetDblTime, 1, "() -> (UInt32 _rv)"}, {"SetEventMask", (PyCFunction)Evt_SetEventMask, 1, "(EventMask value) -> None"}, {"GetNextEvent", (PyCFunction)Evt_GetNextEvent, 1, "(EventMask eventMask) -> (Boolean _rv, EventRecord theEvent)"}, {"EventAvail", (PyCFunction)Evt_EventAvail, 1, "(EventMask eventMask) -> (Boolean _rv, EventRecord theEvent)"}, {"PostEvent", (PyCFunction)Evt_PostEvent, 1, "(EventKind eventNum, UInt32 eventMsg) -> None"}, #if !TARGET_API_MAC_CARBON {"OSEventAvail", (PyCFunction)Evt_OSEventAvail, 1, "(EventMask mask) -> (Boolean _rv, EventRecord theEvent)"}, #endif #if !TARGET_API_MAC_CARBON {"GetOSEvent", (PyCFunction)Evt_GetOSEvent, 1, "(EventMask mask) -> (Boolean _rv, EventRecord theEvent)"}, #endif {"FlushEvents", (PyCFunction)Evt_FlushEvents, 1, "(EventMask whichMask, EventMask stopMask) -> None"}, #if !TARGET_API_MAC_CARBON {"SystemClick", (PyCFunction)Evt_SystemClick, 1, "(EventRecord theEvent, WindowPtr theWindow) -> None"}, #endif #if !TARGET_API_MAC_CARBON {"SystemTask", (PyCFunction)Evt_SystemTask, 1, "() -> None"}, #endif #if !TARGET_API_MAC_CARBON {"SystemEvent", (PyCFunction)Evt_SystemEvent, 1, "(EventRecord theEvent) -> (Boolean _rv)"}, #endif #if TARGET_API_MAC_CARBON {"GetGlobalMouse", (PyCFunction)Evt_GetGlobalMouse, 1, "() -> (Point globalMouse)"}, #endif #if TARGET_API_MAC_CARBON {"GetCurrentKeyModifiers", (PyCFunction)Evt_GetCurrentKeyModifiers, 1, "() -> (UInt32 _rv)"}, #endif #if TARGET_API_MAC_CARBON {"CheckEventQueueForUserCancel", (PyCFunction)Evt_CheckEventQueueForUserCancel, 1, "() -> (Boolean _rv)"}, #endif {"WaitNextEvent", (PyCFunction)Evt_WaitNextEvent, 1, "(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"}, {NULL, NULL, 0} }; void init_Evt(void) { PyObject *m; PyObject *d; m = Py_InitModule("_Evt", Evt_methods); d = PyModule_GetDict(m); Evt_Error = PyMac_GetOSErrException(); if (Evt_Error == NULL || PyDict_SetItemString(d, "Error", Evt_Error) != 0) return; } /* ======================== End module _Evt ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:00:14 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:00:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qd _Qdmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qd In directory usw-pr-cvs1:/tmp/cvs-serv30079/Python/Mac/Modules/qd Added Files: _Qdmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Qdmodule.c --- /* =========================== Module _Qd =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...5656 lines suppressed...] if (PyDict_SetItemString(d, "BitMapType", (PyObject *)&BitMap_Type) != 0) Py_FatalError("can't initialize BitMapType"); QDGlobalsAccess_Type.ob_type = &PyType_Type; Py_INCREF(&QDGlobalsAccess_Type); if (PyDict_SetItemString(d, "QDGlobalsAccessType", (PyObject *)&QDGlobalsAccess_Type) != 0) Py_FatalError("can't initialize QDGlobalsAccessType"); { PyObject *o; o = QDGA_New(); if (o == NULL || PyDict_SetItemString(d, "qd", o) != 0) return; } } /* ========================= End module _Qd ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:00:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:00:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/menu _Menumodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/menu In directory usw-pr-cvs1:/tmp/cvs-serv30220/Python/Mac/Modules/menu Added Files: _Menumodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Menumodule.c --- /* ========================== Module _Menu ========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...2527 lines suppressed...] PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuHandle, MenuObj_New); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuHandle, MenuObj_Convert); m = Py_InitModule("_Menu", Menu_methods); d = PyModule_GetDict(m); Menu_Error = PyMac_GetOSErrException(); if (Menu_Error == NULL || PyDict_SetItemString(d, "Error", Menu_Error) != 0) return; Menu_Type.ob_type = &PyType_Type; Py_INCREF(&Menu_Type); if (PyDict_SetItemString(d, "MenuType", (PyObject *)&Menu_Type) != 0) Py_FatalError("can't initialize MenuType"); } /* ======================== End module _Menu ======================== */ From jackjansen@users.sourceforge.net Thu Aug 23 15:00:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:00:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/icn _Icnmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/icn In directory usw-pr-cvs1:/tmp/cvs-serv30287/Python/Mac/Modules/icn Added Files: _Icnmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Icnmodule.c --- /* ========================== Module _Icn =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...1378 lines suppressed...] void init_Icn(void) { PyObject *m; PyObject *d; m = Py_InitModule("_Icn", Icn_methods); d = PyModule_GetDict(m); Icn_Error = PyMac_GetOSErrException(); if (Icn_Error == NULL || PyDict_SetItemString(d, "Error", Icn_Error) != 0) return; } /* ======================== End module _Icn ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:00:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:00:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/fm _Fmmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/fm In directory usw-pr-cvs1:/tmp/cvs-serv30356/Python/Mac/Modules/fm Added Files: _Fmmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Fmmodule.c --- /* =========================== Module _Fm =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS #include #else #include #endif /* ** Parse/generate ComponentDescriptor records */ static PyObject * FMRec_New(FMetricRec *itself) { return Py_BuildValue("O&O&O&O&O&", PyMac_BuildFixed, itself->ascent, PyMac_BuildFixed, itself->descent, PyMac_BuildFixed, itself->leading, PyMac_BuildFixed, itself->widMax, ResObj_New, itself->wTabHandle); } #if 0 /* Not needed... */ static int FMRec_Convert(PyObject *v, FMetricRec *p_itself) { return PyArg_ParseTuple(v, "O&O&O&O&O&", PyMac_GetFixed, &itself->ascent, PyMac_GetFixed, &itself->descent, PyMac_GetFixed, &itself->leading, PyMac_GetFixed, &itself->widMax, ResObj_Convert, &itself->wTabHandle); } #endif static PyObject *Fm_Error; #if !TARGET_API_MAC_CARBON static PyObject *Fm_InitFonts(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; if (!PyArg_ParseTuple(_args, "")) return NULL; InitFonts(); Py_INCREF(Py_None); _res = Py_None; return _res; } #endif static PyObject *Fm_GetFontName(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; short familyID; Str255 name; if (!PyArg_ParseTuple(_args, "h", &familyID)) return NULL; GetFontName(familyID, name); _res = Py_BuildValue("O&", PyMac_BuildStr255, name); return _res; } static PyObject *Fm_GetFNum(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Str255 name; short familyID; if (!PyArg_ParseTuple(_args, "O&", PyMac_GetStr255, name)) return NULL; GetFNum(name, &familyID); _res = Py_BuildValue("h", familyID); return _res; } static PyObject *Fm_RealFont(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; short fontNum; short size; if (!PyArg_ParseTuple(_args, "hh", &fontNum, &size)) return NULL; _rv = RealFont(fontNum, size); _res = Py_BuildValue("b", _rv); return _res; } #if !TARGET_API_MAC_CARBON static PyObject *Fm_SetFontLock(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean lockFlag; if (!PyArg_ParseTuple(_args, "b", &lockFlag)) return NULL; SetFontLock(lockFlag); Py_INCREF(Py_None); _res = Py_None; return _res; } #endif static PyObject *Fm_SetFScaleDisable(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean fscaleDisable; if (!PyArg_ParseTuple(_args, "b", &fscaleDisable)) return NULL; SetFScaleDisable(fscaleDisable); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Fm_FontMetrics(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; FMetricRec theMetrics; if (!PyArg_ParseTuple(_args, "")) return NULL; FontMetrics(&theMetrics); _res = Py_BuildValue("O&", FMRec_New, &theMetrics); return _res; } static PyObject *Fm_SetFractEnable(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean fractEnable; if (!PyArg_ParseTuple(_args, "b", &fractEnable)) return NULL; SetFractEnable(fractEnable); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Fm_GetDefFontSize(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; short _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetDefFontSize(); _res = Py_BuildValue("h", _rv); return _res; } static PyObject *Fm_IsOutline(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; Point numer; Point denom; if (!PyArg_ParseTuple(_args, "O&O&", PyMac_GetPoint, &numer, PyMac_GetPoint, &denom)) return NULL; _rv = IsOutline(numer, denom); _res = Py_BuildValue("b", _rv); return _res; } static PyObject *Fm_SetOutlinePreferred(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean outlinePreferred; if (!PyArg_ParseTuple(_args, "b", &outlinePreferred)) return NULL; SetOutlinePreferred(outlinePreferred); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Fm_GetOutlinePreferred(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetOutlinePreferred(); _res = Py_BuildValue("b", _rv); return _res; } static PyObject *Fm_SetPreserveGlyph(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean preserveGlyph; if (!PyArg_ParseTuple(_args, "b", &preserveGlyph)) return NULL; SetPreserveGlyph(preserveGlyph); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Fm_GetPreserveGlyph(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Boolean _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetPreserveGlyph(); _res = Py_BuildValue("b", _rv); return _res; } #if !TARGET_API_MAC_CARBON static PyObject *Fm_FlushFonts(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = FlushFonts(); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } #endif static PyObject *Fm_GetSysFont(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; short _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetSysFont(); _res = Py_BuildValue("h", _rv); return _res; } static PyObject *Fm_GetAppFont(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; short _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetAppFont(); _res = Py_BuildValue("h", _rv); return _res; } static PyMethodDef Fm_methods[] = { #if !TARGET_API_MAC_CARBON {"InitFonts", (PyCFunction)Fm_InitFonts, 1, "() -> None"}, #endif {"GetFontName", (PyCFunction)Fm_GetFontName, 1, "(short familyID) -> (Str255 name)"}, {"GetFNum", (PyCFunction)Fm_GetFNum, 1, "(Str255 name) -> (short familyID)"}, {"RealFont", (PyCFunction)Fm_RealFont, 1, "(short fontNum, short size) -> (Boolean _rv)"}, #if !TARGET_API_MAC_CARBON {"SetFontLock", (PyCFunction)Fm_SetFontLock, 1, "(Boolean lockFlag) -> None"}, #endif {"SetFScaleDisable", (PyCFunction)Fm_SetFScaleDisable, 1, "(Boolean fscaleDisable) -> None"}, {"FontMetrics", (PyCFunction)Fm_FontMetrics, 1, "() -> (FMetricRec theMetrics)"}, {"SetFractEnable", (PyCFunction)Fm_SetFractEnable, 1, "(Boolean fractEnable) -> None"}, {"GetDefFontSize", (PyCFunction)Fm_GetDefFontSize, 1, "() -> (short _rv)"}, {"IsOutline", (PyCFunction)Fm_IsOutline, 1, "(Point numer, Point denom) -> (Boolean _rv)"}, {"SetOutlinePreferred", (PyCFunction)Fm_SetOutlinePreferred, 1, "(Boolean outlinePreferred) -> None"}, {"GetOutlinePreferred", (PyCFunction)Fm_GetOutlinePreferred, 1, "() -> (Boolean _rv)"}, {"SetPreserveGlyph", (PyCFunction)Fm_SetPreserveGlyph, 1, "(Boolean preserveGlyph) -> None"}, {"GetPreserveGlyph", (PyCFunction)Fm_GetPreserveGlyph, 1, "() -> (Boolean _rv)"}, #if !TARGET_API_MAC_CARBON {"FlushFonts", (PyCFunction)Fm_FlushFonts, 1, "() -> None"}, #endif {"GetSysFont", (PyCFunction)Fm_GetSysFont, 1, "() -> (short _rv)"}, {"GetAppFont", (PyCFunction)Fm_GetAppFont, 1, "() -> (short _rv)"}, {NULL, NULL, 0} }; void init_Fm(void) { PyObject *m; PyObject *d; m = Py_InitModule("_Fm", Fm_methods); d = PyModule_GetDict(m); Fm_Error = PyMac_GetOSErrException(); if (Fm_Error == NULL || PyDict_SetItemString(d, "Error", Fm_Error) != 0) return; } /* ========================= End module _Fm ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:01:13 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:01:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/drag _Dragmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/drag In directory usw-pr-cvs1:/tmp/cvs-serv30446/Python/Mac/Modules/drag Added Files: _Dragmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Dragmodule.c --- /* ========================== Module _Drag ========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...973 lines suppressed...] PyDict_SetItemString(d, "Error", Drag_Error) != 0) return; DragObj_Type.ob_type = &PyType_Type; Py_INCREF(&DragObj_Type); if (PyDict_SetItemString(d, "DragObjType", (PyObject *)&DragObj_Type) != 0) Py_FatalError("can't initialize DragObjType"); dragglue_TrackingHandlerUPP = NewDragTrackingHandlerUPP(dragglue_TrackingHandler); dragglue_ReceiveHandlerUPP = NewDragReceiveHandlerUPP(dragglue_ReceiveHandler); dragglue_SendDataUPP = NewDragSendDataUPP(dragglue_SendData); #if 0 dragglue_InputUPP = NewDragInputUPP(dragglue_Input); dragglue_DrawingUPP = NewDragDrawingUPP(dragglue_Drawing); #endif } /* ======================== End module _Drag ======================== */ From jackjansen@users.sourceforge.net Thu Aug 23 15:01:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:01:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/dlg _Dlgmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/dlg In directory usw-pr-cvs1:/tmp/cvs-serv30485/Python/Mac/Modules/dlg Added Files: _Dlgmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Dlgmodule.c --- /* ========================== Module _Dlg =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...1395 lines suppressed...] PyMac_INIT_TOOLBOX_OBJECT_NEW(DialogPtr, DlgObj_New); PyMac_INIT_TOOLBOX_OBJECT_NEW(DialogPtr, DlgObj_WhichDialog); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DialogPtr, DlgObj_Convert); m = Py_InitModule("_Dlg", Dlg_methods); d = PyModule_GetDict(m); Dlg_Error = PyMac_GetOSErrException(); if (Dlg_Error == NULL || PyDict_SetItemString(d, "Error", Dlg_Error) != 0) return; Dialog_Type.ob_type = &PyType_Type; Py_INCREF(&Dialog_Type); if (PyDict_SetItemString(d, "DialogType", (PyObject *)&Dialog_Type) != 0) Py_FatalError("can't initialize DialogType"); } /* ======================== End module _Dlg ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:01:31 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:01:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ctl _Ctlmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ctl In directory usw-pr-cvs1:/tmp/cvs-serv30528/Python/Mac/Modules/ctl Added Files: _Ctlmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Ctlmodule.c --- /* ========================== Module _Ctl =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...2655 lines suppressed...] myhittestproc_upp = NewControlUserPaneHitTestUPP(myhittestproc); mytrackingproc_upp = NewControlUserPaneTrackingUPP(mytrackingproc); PyMac_INIT_TOOLBOX_OBJECT_NEW(ControlHandle, CtlObj_New); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ControlHandle, CtlObj_Convert); m = Py_InitModule("_Ctl", Ctl_methods); d = PyModule_GetDict(m); Ctl_Error = PyMac_GetOSErrException(); if (Ctl_Error == NULL || PyDict_SetItemString(d, "Error", Ctl_Error) != 0) return; Control_Type.ob_type = &PyType_Type; Py_INCREF(&Control_Type); if (PyDict_SetItemString(d, "ControlType", (PyObject *)&Control_Type) != 0) Py_FatalError("can't initialize ControlType"); } /* ======================== End module _Ctl ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:01:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:01:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cm _Cmmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cm In directory usw-pr-cvs1:/tmp/cvs-serv30579/Python/Mac/Modules/cm Added Files: _Cmmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Cmmodule.c --- /* =========================== Module _Cm =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS #include #else #include #endif #ifdef USE_TOOLBOX_OBJECT_GLUE extern PyObject *_CmpObj_New(Component); extern int _CmpObj_Convert(PyObject *, Component *); extern PyObject *_CmpInstObj_New(ComponentInstance); extern int _CmpInstObj_Convert(PyObject *, ComponentInstance *); #define CmpObj_New _CmpObj_New #define CmpObj_Convert _CmpObj_Convert #define CmpInstObj_New _CmpInstObj_New #define CmpInstObj_Convert _CmpInstObj_Convert #endif /* ** Parse/generate ComponentDescriptor records */ static PyObject * CmpDesc_New(ComponentDescription *itself) { return Py_BuildValue("O&O&O&ll", PyMac_BuildOSType, itself->componentType, PyMac_BuildOSType, itself->componentSubType, PyMac_BuildOSType, itself->componentManufacturer, itself->componentFlags, itself->componentFlagsMask); } static int CmpDesc_Convert(PyObject *v, ComponentDescription *p_itself) { return PyArg_ParseTuple(v, "O&O&O&ll", PyMac_GetOSType, &p_itself->componentType, PyMac_GetOSType, &p_itself->componentSubType, PyMac_GetOSType, &p_itself->componentManufacturer, &p_itself->componentFlags, &p_itself->componentFlagsMask); } static PyObject *Cm_Error; /* ----------------- Object type ComponentInstance ------------------ */ PyTypeObject ComponentInstance_Type; #define CmpInstObj_Check(x) ((x)->ob_type == &ComponentInstance_Type) typedef struct ComponentInstanceObject { PyObject_HEAD ComponentInstance ob_itself; } ComponentInstanceObject; PyObject *CmpInstObj_New(ComponentInstance itself) { ComponentInstanceObject *it; if (itself == NULL) { PyErr_SetString(Cm_Error,"NULL ComponentInstance"); return NULL; } it = PyObject_NEW(ComponentInstanceObject, &ComponentInstance_Type); if (it == NULL) return NULL; it->ob_itself = itself; return (PyObject *)it; } CmpInstObj_Convert(PyObject *v, ComponentInstance *p_itself) { if (!CmpInstObj_Check(v)) { PyErr_SetString(PyExc_TypeError, "ComponentInstance required"); return 0; } *p_itself = ((ComponentInstanceObject *)v)->ob_itself; return 1; } static void CmpInstObj_dealloc(ComponentInstanceObject *self) { /* Cleanup of self->ob_itself goes here */ PyMem_DEL(self); } static PyObject *CmpInstObj_CloseComponent(ComponentInstanceObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = CloseComponent(_self->ob_itself); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *CmpInstObj_GetComponentInstanceError(ComponentInstanceObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = GetComponentInstanceError(_self->ob_itself); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *CmpInstObj_SetComponentInstanceError(ComponentInstanceObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr theError; if (!PyArg_ParseTuple(_args, "h", &theError)) return NULL; SetComponentInstanceError(_self->ob_itself, theError); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *CmpInstObj_GetComponentInstanceStorage(ComponentInstanceObject *_self, PyObject *_args) { PyObject *_res = NULL; Handle _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetComponentInstanceStorage(_self->ob_itself); _res = Py_BuildValue("O&", ResObj_New, _rv); return _res; } static PyObject *CmpInstObj_SetComponentInstanceStorage(ComponentInstanceObject *_self, PyObject *_args) { PyObject *_res = NULL; Handle theStorage; if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &theStorage)) return NULL; SetComponentInstanceStorage(_self->ob_itself, theStorage); Py_INCREF(Py_None); _res = Py_None; return _res; } #if !TARGET_API_MAC_CARBON static PyObject *CmpInstObj_GetComponentInstanceA5(ComponentInstanceObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetComponentInstanceA5(_self->ob_itself); _res = Py_BuildValue("l", _rv); return _res; } #endif #if !TARGET_API_MAC_CARBON static PyObject *CmpInstObj_SetComponentInstanceA5(ComponentInstanceObject *_self, PyObject *_args) { PyObject *_res = NULL; long theA5; if (!PyArg_ParseTuple(_args, "l", &theA5)) return NULL; SetComponentInstanceA5(_self->ob_itself, theA5); Py_INCREF(Py_None); _res = Py_None; return _res; } #endif static PyObject *CmpInstObj_ComponentFunctionImplemented(ComponentInstanceObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; short ftnNumber; if (!PyArg_ParseTuple(_args, "h", &ftnNumber)) return NULL; _rv = ComponentFunctionImplemented(_self->ob_itself, ftnNumber); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *CmpInstObj_GetComponentVersion(ComponentInstanceObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetComponentVersion(_self->ob_itself); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *CmpInstObj_ComponentSetTarget(ComponentInstanceObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; ComponentInstance target; if (!PyArg_ParseTuple(_args, "O&", CmpInstObj_Convert, &target)) return NULL; _rv = ComponentSetTarget(_self->ob_itself, target); _res = Py_BuildValue("l", _rv); return _res; } static PyMethodDef CmpInstObj_methods[] = { {"CloseComponent", (PyCFunction)CmpInstObj_CloseComponent, 1, "() -> None"}, {"GetComponentInstanceError", (PyCFunction)CmpInstObj_GetComponentInstanceError, 1, "() -> None"}, {"SetComponentInstanceError", (PyCFunction)CmpInstObj_SetComponentInstanceError, 1, "(OSErr theError) -> None"}, {"GetComponentInstanceStorage", (PyCFunction)CmpInstObj_GetComponentInstanceStorage, 1, "() -> (Handle _rv)"}, {"SetComponentInstanceStorage", (PyCFunction)CmpInstObj_SetComponentInstanceStorage, 1, "(Handle theStorage) -> None"}, #if !TARGET_API_MAC_CARBON {"GetComponentInstanceA5", (PyCFunction)CmpInstObj_GetComponentInstanceA5, 1, "() -> (long _rv)"}, #endif #if !TARGET_API_MAC_CARBON {"SetComponentInstanceA5", (PyCFunction)CmpInstObj_SetComponentInstanceA5, 1, "(long theA5) -> None"}, #endif {"ComponentFunctionImplemented", (PyCFunction)CmpInstObj_ComponentFunctionImplemented, 1, "(short ftnNumber) -> (long _rv)"}, {"GetComponentVersion", (PyCFunction)CmpInstObj_GetComponentVersion, 1, "() -> (long _rv)"}, {"ComponentSetTarget", (PyCFunction)CmpInstObj_ComponentSetTarget, 1, "(ComponentInstance target) -> (long _rv)"}, {NULL, NULL, 0} }; PyMethodChain CmpInstObj_chain = { CmpInstObj_methods, NULL }; static PyObject *CmpInstObj_getattr(ComponentInstanceObject *self, char *name) { return Py_FindMethodInChain(&CmpInstObj_chain, (PyObject *)self, name); } #define CmpInstObj_setattr NULL #define CmpInstObj_compare NULL #define CmpInstObj_repr NULL #define CmpInstObj_hash NULL PyTypeObject ComponentInstance_Type = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "ComponentInstance", /*tp_name*/ sizeof(ComponentInstanceObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ (destructor) CmpInstObj_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ (getattrfunc) CmpInstObj_getattr, /*tp_getattr*/ (setattrfunc) CmpInstObj_setattr, /*tp_setattr*/ (cmpfunc) CmpInstObj_compare, /*tp_compare*/ (reprfunc) CmpInstObj_repr, /*tp_repr*/ (PyNumberMethods *)0, /* tp_as_number */ (PySequenceMethods *)0, /* tp_as_sequence */ (PyMappingMethods *)0, /* tp_as_mapping */ (hashfunc) CmpInstObj_hash, /*tp_hash*/ }; /* --------------- End object type ComponentInstance ---------------- */ /* --------------------- Object type Component ---------------------- */ PyTypeObject Component_Type; #define CmpObj_Check(x) ((x)->ob_type == &Component_Type) typedef struct ComponentObject { PyObject_HEAD Component ob_itself; } ComponentObject; PyObject *CmpObj_New(Component itself) { ComponentObject *it; if (itself == NULL) { /* XXXX Or should we return None? */ PyErr_SetString(Cm_Error,"No such component"); return NULL; } it = PyObject_NEW(ComponentObject, &Component_Type); if (it == NULL) return NULL; it->ob_itself = itself; return (PyObject *)it; } CmpObj_Convert(PyObject *v, Component *p_itself) { if ( v == Py_None ) { *p_itself = 0; return 1; } if (!CmpObj_Check(v)) { PyErr_SetString(PyExc_TypeError, "Component required"); return 0; } *p_itself = ((ComponentObject *)v)->ob_itself; return 1; } static void CmpObj_dealloc(ComponentObject *self) { /* Cleanup of self->ob_itself goes here */ PyMem_DEL(self); } static PyObject *CmpObj_UnregisterComponent(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = UnregisterComponent(_self->ob_itself); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *CmpObj_GetComponentInfo(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; ComponentDescription cd; Handle componentName; Handle componentInfo; Handle componentIcon; if (!PyArg_ParseTuple(_args, "O&O&O&", ResObj_Convert, &componentName, ResObj_Convert, &componentInfo, ResObj_Convert, &componentIcon)) return NULL; _err = GetComponentInfo(_self->ob_itself, &cd, componentName, componentInfo, componentIcon); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", CmpDesc_New, &cd); return _res; } static PyObject *CmpObj_OpenComponent(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; ComponentInstance _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = OpenComponent(_self->ob_itself); _res = Py_BuildValue("O&", CmpInstObj_New, _rv); return _res; } static PyObject *CmpObj_GetComponentRefcon(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetComponentRefcon(_self->ob_itself); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *CmpObj_SetComponentRefcon(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; long theRefcon; if (!PyArg_ParseTuple(_args, "l", &theRefcon)) return NULL; SetComponentRefcon(_self->ob_itself, theRefcon); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *CmpObj_OpenComponentResFile(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; short _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = OpenComponentResFile(_self->ob_itself); _res = Py_BuildValue("h", _rv); return _res; } static PyObject *CmpObj_GetComponentResource(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; OSType resType; short resID; Handle theResource; if (!PyArg_ParseTuple(_args, "O&h", PyMac_GetOSType, &resType, &resID)) return NULL; _err = GetComponentResource(_self->ob_itself, resType, resID, &theResource); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", ResObj_New, theResource); return _res; } static PyObject *CmpObj_GetComponentIndString(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; Str255 theString; short strListID; short index; if (!PyArg_ParseTuple(_args, "O&hh", PyMac_GetStr255, theString, &strListID, &index)) return NULL; _err = GetComponentIndString(_self->ob_itself, theString, strListID, index); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *CmpObj_ResolveComponentAlias(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; Component _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = ResolveComponentAlias(_self->ob_itself); _res = Py_BuildValue("O&", CmpObj_New, _rv); return _res; } static PyObject *CmpObj_CountComponentInstances(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = CountComponentInstances(_self->ob_itself); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *CmpObj_SetDefaultComponent(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; short flags; if (!PyArg_ParseTuple(_args, "h", &flags)) return NULL; _err = SetDefaultComponent(_self->ob_itself, flags); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *CmpObj_CaptureComponent(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; Component _rv; Component capturingComponent; if (!PyArg_ParseTuple(_args, "O&", CmpObj_Convert, &capturingComponent)) return NULL; _rv = CaptureComponent(_self->ob_itself, capturingComponent); _res = Py_BuildValue("O&", CmpObj_New, _rv); return _res; } static PyObject *CmpObj_UncaptureComponent(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = UncaptureComponent(_self->ob_itself); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *CmpObj_GetComponentIconSuite(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; Handle iconSuite; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = GetComponentIconSuite(_self->ob_itself, &iconSuite); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", ResObj_New, iconSuite); return _res; } static PyMethodDef CmpObj_methods[] = { {"UnregisterComponent", (PyCFunction)CmpObj_UnregisterComponent, 1, "() -> None"}, {"GetComponentInfo", (PyCFunction)CmpObj_GetComponentInfo, 1, "(Handle componentName, Handle componentInfo, Handle componentIcon) -> (ComponentDescription cd)"}, {"OpenComponent", (PyCFunction)CmpObj_OpenComponent, 1, "() -> (ComponentInstance _rv)"}, {"GetComponentRefcon", (PyCFunction)CmpObj_GetComponentRefcon, 1, "() -> (long _rv)"}, {"SetComponentRefcon", (PyCFunction)CmpObj_SetComponentRefcon, 1, "(long theRefcon) -> None"}, {"OpenComponentResFile", (PyCFunction)CmpObj_OpenComponentResFile, 1, "() -> (short _rv)"}, {"GetComponentResource", (PyCFunction)CmpObj_GetComponentResource, 1, "(OSType resType, short resID) -> (Handle theResource)"}, {"GetComponentIndString", (PyCFunction)CmpObj_GetComponentIndString, 1, "(Str255 theString, short strListID, short index) -> None"}, {"ResolveComponentAlias", (PyCFunction)CmpObj_ResolveComponentAlias, 1, "() -> (Component _rv)"}, {"CountComponentInstances", (PyCFunction)CmpObj_CountComponentInstances, 1, "() -> (long _rv)"}, {"SetDefaultComponent", (PyCFunction)CmpObj_SetDefaultComponent, 1, "(short flags) -> None"}, {"CaptureComponent", (PyCFunction)CmpObj_CaptureComponent, 1, "(Component capturingComponent) -> (Component _rv)"}, {"UncaptureComponent", (PyCFunction)CmpObj_UncaptureComponent, 1, "() -> None"}, {"GetComponentIconSuite", (PyCFunction)CmpObj_GetComponentIconSuite, 1, "() -> (Handle iconSuite)"}, {NULL, NULL, 0} }; PyMethodChain CmpObj_chain = { CmpObj_methods, NULL }; static PyObject *CmpObj_getattr(ComponentObject *self, char *name) { return Py_FindMethodInChain(&CmpObj_chain, (PyObject *)self, name); } #define CmpObj_setattr NULL #define CmpObj_compare NULL #define CmpObj_repr NULL #define CmpObj_hash NULL PyTypeObject Component_Type = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Component", /*tp_name*/ sizeof(ComponentObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ (destructor) CmpObj_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ (getattrfunc) CmpObj_getattr, /*tp_getattr*/ (setattrfunc) CmpObj_setattr, /*tp_setattr*/ (cmpfunc) CmpObj_compare, /*tp_compare*/ (reprfunc) CmpObj_repr, /*tp_repr*/ (PyNumberMethods *)0, /* tp_as_number */ (PySequenceMethods *)0, /* tp_as_sequence */ (PyMappingMethods *)0, /* tp_as_mapping */ (hashfunc) CmpObj_hash, /*tp_hash*/ }; /* ------------------- End object type Component -------------------- */ static PyObject *Cm_RegisterComponentResource(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Component _rv; ComponentResourceHandle cr; short global; if (!PyArg_ParseTuple(_args, "O&h", ResObj_Convert, &cr, &global)) return NULL; _rv = RegisterComponentResource(cr, global); _res = Py_BuildValue("O&", CmpObj_New, _rv); return _res; } static PyObject *Cm_FindNextComponent(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; Component _rv; Component aComponent; ComponentDescription looking; if (!PyArg_ParseTuple(_args, "O&O&", CmpObj_Convert, &aComponent, CmpDesc_Convert, &looking)) return NULL; _rv = FindNextComponent(aComponent, &looking); _res = Py_BuildValue("O&", CmpObj_New, _rv); return _res; } static PyObject *Cm_CountComponents(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; ComponentDescription looking; if (!PyArg_ParseTuple(_args, "O&", CmpDesc_Convert, &looking)) return NULL; _rv = CountComponents(&looking); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *Cm_GetComponentListModSeed(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = GetComponentListModSeed(); _res = Py_BuildValue("l", _rv); return _res; } static PyObject *Cm_CloseComponentResFile(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; short refnum; if (!PyArg_ParseTuple(_args, "h", &refnum)) return NULL; _err = CloseComponentResFile(refnum); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Cm_OpenDefaultComponent(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; ComponentInstance _rv; OSType componentType; OSType componentSubType; if (!PyArg_ParseTuple(_args, "O&O&", PyMac_GetOSType, &componentType, PyMac_GetOSType, &componentSubType)) return NULL; _rv = OpenDefaultComponent(componentType, componentSubType); _res = Py_BuildValue("O&", CmpInstObj_New, _rv); return _res; } static PyObject *Cm_RegisterComponentResourceFile(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; long _rv; short resRefNum; short global; if (!PyArg_ParseTuple(_args, "hh", &resRefNum, &global)) return NULL; _rv = RegisterComponentResourceFile(resRefNum, global); _res = Py_BuildValue("l", _rv); return _res; } static PyMethodDef Cm_methods[] = { {"RegisterComponentResource", (PyCFunction)Cm_RegisterComponentResource, 1, "(ComponentResourceHandle cr, short global) -> (Component _rv)"}, {"FindNextComponent", (PyCFunction)Cm_FindNextComponent, 1, "(Component aComponent, ComponentDescription looking) -> (Component _rv)"}, {"CountComponents", (PyCFunction)Cm_CountComponents, 1, "(ComponentDescription looking) -> (long _rv)"}, {"GetComponentListModSeed", (PyCFunction)Cm_GetComponentListModSeed, 1, "() -> (long _rv)"}, {"CloseComponentResFile", (PyCFunction)Cm_CloseComponentResFile, 1, "(short refnum) -> None"}, {"OpenDefaultComponent", (PyCFunction)Cm_OpenDefaultComponent, 1, "(OSType componentType, OSType componentSubType) -> (ComponentInstance _rv)"}, {"RegisterComponentResourceFile", (PyCFunction)Cm_RegisterComponentResourceFile, 1, "(short resRefNum, short global) -> (long _rv)"}, {NULL, NULL, 0} }; void init_Cm(void) { PyObject *m; PyObject *d; PyMac_INIT_TOOLBOX_OBJECT_NEW(Component, CmpObj_New); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Component, CmpObj_Convert); PyMac_INIT_TOOLBOX_OBJECT_NEW(ComponentInstance, CmpInstObj_New); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ComponentInstance, CmpInstObj_Convert); m = Py_InitModule("_Cm", Cm_methods); d = PyModule_GetDict(m); Cm_Error = PyMac_GetOSErrException(); if (Cm_Error == NULL || PyDict_SetItemString(d, "Error", Cm_Error) != 0) return; ComponentInstance_Type.ob_type = &PyType_Type; Py_INCREF(&ComponentInstance_Type); if (PyDict_SetItemString(d, "ComponentInstanceType", (PyObject *)&ComponentInstance_Type) != 0) Py_FatalError("can't initialize ComponentInstanceType"); Component_Type.ob_type = &PyType_Type; Py_INCREF(&Component_Type); if (PyDict_SetItemString(d, "ComponentType", (PyObject *)&Component_Type) != 0) Py_FatalError("can't initialize ComponentType"); } /* ========================= End module _Cm ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:01:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:01:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cf _CFmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cf In directory usw-pr-cvs1:/tmp/cvs-serv30607/Python/Mac/Modules/cf Added Files: _CFmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _CFmodule.c --- /* =========================== Module _CF =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...3140 lines suppressed...] CFMutableDataRef_Type.ob_type = &PyType_Type; Py_INCREF(&CFMutableDataRef_Type); if (PyDict_SetItemString(d, "CFMutableDataRefType", (PyObject *)&CFMutableDataRef_Type) != 0) Py_FatalError("can't initialize CFMutableDataRefType"); CFStringRef_Type.ob_type = &PyType_Type; Py_INCREF(&CFStringRef_Type); if (PyDict_SetItemString(d, "CFStringRefType", (PyObject *)&CFStringRef_Type) != 0) Py_FatalError("can't initialize CFStringRefType"); CFMutableStringRef_Type.ob_type = &PyType_Type; Py_INCREF(&CFMutableStringRef_Type); if (PyDict_SetItemString(d, "CFMutableStringRefType", (PyObject *)&CFMutableStringRef_Type) != 0) Py_FatalError("can't initialize CFMutableStringRefType"); CFURLRef_Type.ob_type = &PyType_Type; Py_INCREF(&CFURLRef_Type); if (PyDict_SetItemString(d, "CFURLRefType", (PyObject *)&CFURLRef_Type) != 0) Py_FatalError("can't initialize CFURLRefType"); } /* ========================= End module _CF ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:01:53 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:01:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/app _Appmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/app In directory usw-pr-cvs1:/tmp/cvs-serv30683/Python/Mac/Modules/app Added Files: _Appmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Appmodule.c --- /* ========================== Module _App =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...1137 lines suppressed...] void init_App(void) { PyObject *m; PyObject *d; m = Py_InitModule("_App", App_methods); d = PyModule_GetDict(m); App_Error = PyMac_GetOSErrException(); if (App_Error == NULL || PyDict_SetItemString(d, "Error", App_Error) != 0) return; } /* ======================== End module _App ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:02:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:02:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ae _AEmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ae In directory usw-pr-cvs1:/tmp/cvs-serv30776/Python/Mac/Modules/ae Added Files: _AEmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _AEmodule.c --- /* =========================== Module _AE =========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ "Not available in this shared library/OS version"); \ return NULL; \ }} while(0) #ifdef WITHOUT_FRAMEWORKS [...1244 lines suppressed...] upp_GenericEventHandler = NewAEEventHandlerUPP(GenericEventHandler); #endif PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_New); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc, AEDesc_Convert); m = Py_InitModule("_AE", AE_methods); d = PyModule_GetDict(m); AE_Error = PyMac_GetOSErrException(); if (AE_Error == NULL || PyDict_SetItemString(d, "Error", AE_Error) != 0) return; AEDesc_Type.ob_type = &PyType_Type; Py_INCREF(&AEDesc_Type); if (PyDict_SetItemString(d, "AEDescType", (PyObject *)&AEDesc_Type) != 0) Py_FatalError("can't initialize AEDescType"); } /* ========================= End module _AE ========================= */ From jackjansen@users.sourceforge.net Thu Aug 23 15:02:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:02:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/scrap _Scrapmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/scrap In directory usw-pr-cvs1:/tmp/cvs-serv30824/Python/Mac/Modules/scrap Added Files: _Scrapmodule.c Log Message: Renamed the Mac toolbox modules to have an initial _ in their name. --- NEW FILE: _Scrapmodule.c --- /* ========================== Module Scrap ========================== */ #include "Python.h" #include "macglue.h" #include "pymactoolbox.h" #ifdef WITHOUT_FRAMEWORKS #include #else #include #endif #if !TARGET_API_MAC_CARBON /* ** Generate ScrapInfo records */ static PyObject * SCRRec_New(itself) ScrapStuff *itself; { return Py_BuildValue("lO&hhO&", itself->scrapSize, ResObj_New, itself->scrapHandle, itself->scrapCount, itself->scrapState, PyMac_BuildStr255, itself->scrapName); } #endif static PyObject *Scrap_Error; static PyObject *Scrap_LoadScrap(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; OSStatus _err; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = LoadScrap(); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Scrap_UnloadScrap(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; OSStatus _err; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = UnloadScrap(); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } #if !TARGET_API_MAC_CARBON static PyObject *Scrap_InfoScrap(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; ScrapStuffPtr _rv; if (!PyArg_ParseTuple(_args, "")) return NULL; _rv = InfoScrap(); _res = Py_BuildValue("O&", SCRRec_New, _rv); return _res; } #endif #if !TARGET_API_MAC_CARBON static PyObject *Scrap_GetScrap(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; long _rv; Handle destination; ScrapFlavorType flavorType; SInt32 offset; if (!PyArg_ParseTuple(_args, "O&O&", ResObj_Convert, &destination, PyMac_GetOSType, &flavorType)) return NULL; _rv = GetScrap(destination, flavorType, &offset); _res = Py_BuildValue("ll", _rv, offset); return _res; } #endif static PyObject *Scrap_ZeroScrap(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; OSStatus _err; if (!PyArg_ParseTuple(_args, "")) return NULL; #if TARGET_API_MAC_CARBON { ScrapRef scrap; _err = ClearCurrentScrap(); if (_err != noErr) return PyMac_Error(_err); _err = GetCurrentScrap(&scrap); } #else _err = ZeroScrap(); #endif if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } static PyObject *Scrap_PutScrap(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; OSStatus _err; SInt32 sourceBufferByteCount; ScrapFlavorType flavorType; char *sourceBuffer__in__; int sourceBuffer__len__; int sourceBuffer__in_len__; #if TARGET_API_MAC_CARBON ScrapRef scrap; #endif if (!PyArg_ParseTuple(_args, "O&s#", PyMac_GetOSType, &flavorType, &sourceBuffer__in__, &sourceBuffer__in_len__)) return NULL; sourceBufferByteCount = sourceBuffer__in_len__; sourceBuffer__len__ = sourceBuffer__in_len__; #if TARGET_API_MAC_CARBON _err = GetCurrentScrap(&scrap); if (_err != noErr) return PyMac_Error(_err); _err = PutScrapFlavor(scrap, flavorType, 0, sourceBufferByteCount, sourceBuffer__in__); #else _err = PutScrap(sourceBufferByteCount, flavorType, sourceBuffer__in__); #endif if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; sourceBuffer__error__: ; return _res; } #if TARGET_API_MAC_CARBON static PyObject *Scrap_ClearCurrentScrap(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; OSStatus _err; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = ClearCurrentScrap(); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } #endif #if TARGET_API_MAC_CARBON static PyObject *Scrap_CallInScrapPromises(_self, _args) PyObject *_self; PyObject *_args; { PyObject *_res = NULL; OSStatus _err; if (!PyArg_ParseTuple(_args, "")) return NULL; _err = CallInScrapPromises(); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; } #endif static PyMethodDef Scrap_methods[] = { {"LoadScrap", (PyCFunction)Scrap_LoadScrap, 1, "() -> None"}, {"UnloadScrap", (PyCFunction)Scrap_UnloadScrap, 1, "() -> None"}, #if !TARGET_API_MAC_CARBON {"InfoScrap", (PyCFunction)Scrap_InfoScrap, 1, "() -> (ScrapStuffPtr _rv)"}, #endif #if !TARGET_API_MAC_CARBON {"GetScrap", (PyCFunction)Scrap_GetScrap, 1, "(Handle destination, ScrapFlavorType flavorType) -> (long _rv, SInt32 offset)"}, #endif {"ZeroScrap", (PyCFunction)Scrap_ZeroScrap, 1, "() -> None"}, {"PutScrap", (PyCFunction)Scrap_PutScrap, 1, "(ScrapFlavorType flavorType, Buffer sourceBuffer) -> None"}, #if TARGET_API_MAC_CARBON {"ClearCurrentScrap", (PyCFunction)Scrap_ClearCurrentScrap, 1, "() -> None"}, #endif #if TARGET_API_MAC_CARBON {"CallInScrapPromises", (PyCFunction)Scrap_CallInScrapPromises, 1, "() -> None"}, #endif {NULL, NULL, 0} }; void init_Scrap() { PyObject *m; PyObject *d; m = Py_InitModule("_Scrap", Scrap_methods); d = PyModule_GetDict(m); Scrap_Error = PyMac_GetOSErrException(); if (Scrap_Error == NULL || PyDict_SetItemString(d, "Error", Scrap_Error) != 0) return; } /* ======================== End module Scrap ======================== */ From jackjansen@users.sourceforge.net Thu Aug 23 15:10:44 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:10:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon AE.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv1868/Python/Mac/Lib/Carbon Added Files: AE.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: AE.py --- from _AE import * From jackjansen@users.sourceforge.net Thu Aug 23 15:10:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:10:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon App.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv1909/Python/Mac/Lib/Carbon Added Files: App.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: App.py --- from _App import * From jackjansen@users.sourceforge.net Thu Aug 23 15:10:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:10:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon CF.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv1948/Python/Mac/Lib/Carbon Added Files: CF.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: CF.py --- from _CF import * From jackjansen@users.sourceforge.net Thu Aug 23 15:10:59 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:10:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Cm.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv1972/Python/Mac/Lib/Carbon Added Files: Cm.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Cm.py --- from _Cm import * From jackjansen@users.sourceforge.net Thu Aug 23 15:11:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Ctl.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2036/Python/Mac/Lib/Carbon Added Files: Ctl.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Ctl.py --- from _Ctl import * From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cf CFmodule.c,1.6,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cf In directory usw-pr-cvs1:/tmp/cvs-serv1982/cf Removed Files: CFmodule.c Log Message: Renamed. --- CFmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Dlg.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2061/Python/Mac/Lib/Carbon Added Files: Dlg.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Dlg.py --- from _Dlg import * From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/fm Fmmodule.c,1.9,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/fm In directory usw-pr-cvs1:/tmp/cvs-serv1982/fm Removed Files: Fmmodule.c Log Message: Renamed. --- Fmmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/evt Evtmodule.c,1.19,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/evt In directory usw-pr-cvs1:/tmp/cvs-serv1982/evt Removed Files: Evtmodule.c Log Message: Renamed. --- Evtmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Help.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2372/Python/Mac/Lib/Carbon Added Files: Help.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Help.py --- from _Help import * From jackjansen@users.sourceforge.net Thu Aug 23 15:12:13 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:12:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Qdoffs.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2602/Python/Mac/Lib/Carbon Added Files: Qdoffs.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Qdoffs.py --- from _Qdoffs import * From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ae AEmodule.c,1.27,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ae In directory usw-pr-cvs1:/tmp/cvs-serv1982/ae Removed Files: AEmodule.c Log Message: Renamed. --- AEmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ctl Ctlmodule.c,1.45,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ctl In directory usw-pr-cvs1:/tmp/cvs-serv1982/ctl Removed Files: Ctlmodule.c Log Message: Renamed. --- Ctlmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/drag Dragmodule.c,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/drag In directory usw-pr-cvs1:/tmp/cvs-serv1982/drag Removed Files: Dragmodule.c Log Message: Renamed. --- Dragmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/dlg Dlgmodule.c,1.26,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/dlg In directory usw-pr-cvs1:/tmp/cvs-serv1982/dlg Removed Files: Dlgmodule.c Log Message: Renamed. --- Dlgmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cm Cmmodule.c,1.14,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cm In directory usw-pr-cvs1:/tmp/cvs-serv1982/cm Removed Files: Cmmodule.c Log Message: Renamed. --- Cmmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/help Helpmodule.c,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/help In directory usw-pr-cvs1:/tmp/cvs-serv1982/help Removed Files: Helpmodule.c Log Message: Renamed. --- Helpmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/icn Icnmodule.c,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/icn In directory usw-pr-cvs1:/tmp/cvs-serv1982/icn Removed Files: Icnmodule.c Log Message: Renamed. --- Icnmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/menu Menumodule.c,1.27,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/menu In directory usw-pr-cvs1:/tmp/cvs-serv1982/menu Removed Files: Menumodule.c Log Message: Renamed. --- Menumodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/te TEmodule.c,1.14,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/te In directory usw-pr-cvs1:/tmp/cvs-serv1982/te Removed Files: TEmodule.c Log Message: Renamed. --- TEmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qd Qdmodule.c,1.41,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qd In directory usw-pr-cvs1:/tmp/cvs-serv1982/qd Removed Files: Qdmodule.c Log Message: Renamed. --- Qdmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qdoffs Qdoffsmodule.c,1.8,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qdoffs In directory usw-pr-cvs1:/tmp/cvs-serv1982/qdoffs Removed Files: Qdoffsmodule.c Log Message: Renamed. --- Qdoffsmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/list Listmodule.c,1.15,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/list In directory usw-pr-cvs1:/tmp/cvs-serv1982/list Removed Files: Listmodule.c Log Message: Renamed. --- Listmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qt Qtmodule.c,1.24,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory usw-pr-cvs1:/tmp/cvs-serv1982/qt Removed Files: Qtmodule.c Log Message: Renamed. --- Qtmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/scrap Scrapmodule.c,1.7,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/scrap In directory usw-pr-cvs1:/tmp/cvs-serv1982/scrap Removed Files: Scrapmodule.c Log Message: Renamed. --- Scrapmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/res Resmodule.c,1.27,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/res In directory usw-pr-cvs1:/tmp/cvs-serv1982/res Removed Files: Resmodule.c Log Message: Renamed. --- Resmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/snd Sndihooks.c,1.2,NONE Sndmodule.c,1.26,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/snd In directory usw-pr-cvs1:/tmp/cvs-serv1982/snd Removed Files: Sndihooks.c Sndmodule.c Log Message: Renamed. --- Sndihooks.c DELETED --- --- Sndmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/win Winmodule.c,1.36,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/win In directory usw-pr-cvs1:/tmp/cvs-serv1982/win Removed Files: Winmodule.c Log Message: Renamed. --- Winmodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/mlte Mltemodule.c,1.5,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/mlte In directory usw-pr-cvs1:/tmp/cvs-serv1982/mlte Removed Files: Mltemodule.c Log Message: Renamed. --- Mltemodule.c DELETED --- From jackjansen@users.sourceforge.net Thu Aug 23 15:11:16 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Drag.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2281/Python/Mac/Lib/Carbon Added Files: Drag.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Drag.py --- from _Drag import * From jackjansen@users.sourceforge.net Thu Aug 23 15:11:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Evt.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2307/Python/Mac/Lib/Carbon Added Files: Evt.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Evt.py --- from _Evt import * From jackjansen@users.sourceforge.net Thu Aug 23 15:11:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Fm.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2332/Python/Mac/Lib/Carbon Added Files: Fm.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Fm.py --- from _Fm import * From jackjansen@users.sourceforge.net Thu Aug 23 15:11:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Icn.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2409/Python/Mac/Lib/Carbon Added Files: Icn.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Icn.py --- from _Icn import * From jackjansen@users.sourceforge.net Thu Aug 23 15:11:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon List.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2432/Python/Mac/Lib/Carbon Added Files: List.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: List.py --- from _List import * From jackjansen@users.sourceforge.net Thu Aug 23 15:11:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:11:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Menu.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2477/Python/Mac/Lib/Carbon Added Files: Menu.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Menu.py --- from _Menu import * From jackjansen@users.sourceforge.net Thu Aug 23 15:12:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:12:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Mlte.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2544/Python/Mac/Lib/Carbon Added Files: Mlte.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Mlte.py --- from _Mlte import * From jackjansen@users.sourceforge.net Thu Aug 23 15:12:09 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:12:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Qd.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2570/Python/Mac/Lib/Carbon Added Files: Qd.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Qd.py --- from _Qd import * From jackjansen@users.sourceforge.net Thu Aug 23 15:12:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:12:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Qt.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2706/Python/Mac/Lib/Carbon Added Files: Qt.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Qt.py --- from _Qt import * From jackjansen@users.sourceforge.net Thu Aug 23 15:12:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:12:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Res.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2736/Python/Mac/Lib/Carbon Added Files: Res.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Res.py --- from _Res import * From jackjansen@users.sourceforge.net Thu Aug 23 15:12:32 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:12:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Scrap.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2770/Python/Mac/Lib/Carbon Added Files: Scrap.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Scrap.py --- from _Scrap import * From jackjansen@users.sourceforge.net Thu Aug 23 15:12:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:12:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Snd.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2815/Python/Mac/Lib/Carbon Added Files: Snd.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Snd.py --- from _Snd import * From jackjansen@users.sourceforge.net Thu Aug 23 15:12:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:12:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Sndihooks.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2847/Python/Mac/Lib/Carbon Added Files: Sndihooks.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Sndihooks.py --- from _Sndihooks import * From jackjansen@users.sourceforge.net Thu Aug 23 15:13:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:13:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon TE.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2909/Python/Mac/Lib/Carbon Added Files: TE.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: TE.py --- from _TE import * From jackjansen@users.sourceforge.net Thu Aug 23 15:13:08 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 23 Aug 2001 07:13:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/Carbon Win.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/Carbon In directory usw-pr-cvs1:/tmp/cvs-serv2972/Python/Mac/Lib/Carbon Added Files: Win.py Log Message: Wrapper modules underound the toolbox modules, which now have an _ prepended. --- NEW FILE: Win.py --- from _Win import * From bwarsaw@users.sourceforge.net Thu Aug 23 17:14:47 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 23 Aug 2001 09:14:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/pynche ChipViewer.py,2.9,2.10 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/pynche In directory usw-pr-cvs1:/tmp/cvs-serv10100 Modified Files: ChipViewer.py Log Message: Implement some suggestions by Laura Creighton. ChipWidget.__init__(): Added a message area just below the color name. Both the message and name widgets are now FLAT, DISABLED Entry widgets instead of Labels. This allows users to copy-n-paste the color names or color specs. Also, the contents of both widgets are now driven by StringVars. set_color(): This only sets the chip color; it does not set the name widgets. set_name(): New method which only sets the name widget contents. set_message(): New method which only sets the message widget contents. ChipViewer.update_yourself(): Set the color, name, and message for each chip as follows: the first line always contains the color spec in #rrggbb format. The second line will contain the color name, but slightly differently for each widget. For the Selected widget, if the color exactly matches the Nearest color, the name is shown, otherwise the message field will be empty. The name field of the Nearest widget will always contain the color name. Index: ChipViewer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/pynche/ChipViewer.py,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** ChipViewer.py 2001/07/10 21:37:28 2.9 --- ChipViewer.py 2001/08/23 16:14:45 2.10 *************** *** 40,47 **** background=initialcolor) self.__chip.grid(row=1, column=0) ! # create the color name, ctor argument must be a string ! self.__name = Label(master, text=initialcolor) self.__name.grid(row=2, column=0) ! # # set bindings if presscmd: --- 40,56 ---- background=initialcolor) self.__chip.grid(row=1, column=0) ! # create the color name ! self.__namevar = StringVar() ! self.__namevar.set(initialcolor) ! self.__name = Entry(master, textvariable=self.__namevar, ! relief=FLAT, justify=CENTER, state=DISABLED, ! font=self.__label['font']) self.__name.grid(row=2, column=0) ! # create the message area ! self.__msgvar = StringVar() ! self.__name = Entry(master, textvariable=self.__msgvar, ! relief=FLAT, justify=CENTER, state=DISABLED, ! font=self.__label['font']) ! self.__name.grid(row=3, column=0) # set bindings if presscmd: *************** *** 50,60 **** self.__chip.bind('', releasecmd) ! def set_color(self, color, colorname=None): self.__chip.config(background=color) - self.__name.config(text=colorname or color) def get_color(self): return self.__chip['background'] def press(self): self.__chip.configure(relief=SUNKEN) --- 59,74 ---- self.__chip.bind('', releasecmd) ! def set_color(self, color): self.__chip.config(background=color) def get_color(self): return self.__chip['background'] + def set_name(self, colorname): + self.__namevar.set(colorname) + + def set_message(self, message): + self.__msgvar.set(message) + def press(self): self.__chip.configure(relief=SUNKEN) *************** *** 98,102 **** nearest_rrggbb = ColorDB.triplet_to_rrggbb(nearest_tuple) self.__selected.set_color(rrggbb) ! self.__nearest.set_color(nearest_rrggbb, nearest) def __buttonpress(self, event=None): --- 112,124 ---- nearest_rrggbb = ColorDB.triplet_to_rrggbb(nearest_tuple) self.__selected.set_color(rrggbb) ! self.__nearest.set_color(nearest_rrggbb) ! # set the name and messages areas ! self.__selected.set_name(rrggbb) ! if rrggbb == nearest_rrggbb: ! self.__selected.set_message(nearest) ! else: ! self.__selected.set_message('') ! self.__nearest.set_name(nearest_rrggbb) ! self.__nearest.set_message(nearest) def __buttonpress(self, event=None): From bwarsaw@users.sourceforge.net Thu Aug 23 17:15:04 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 23 Aug 2001 09:15:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/pynche Main.py,2.20,2.21 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/pynche In directory usw-pr-cvs1:/tmp/cvs-serv10194 Modified Files: Main.py Log Message: Bump to version 1.3 Index: Main.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/pynche/Main.py,v retrieving revision 2.20 retrieving revision 2.21 diff -C2 -d -r2.20 -r2.21 *** Main.py 2001/07/10 21:42:04 2.20 --- Main.py 2001/08/23 16:15:02 2.21 *************** *** 49,53 **** """ ! __version__ = '1.2' import sys --- 49,53 ---- """ ! __version__ = '1.3' import sys From bwarsaw@users.sourceforge.net Thu Aug 23 17:15:23 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 23 Aug 2001 09:15:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/pynche README,2.15,2.16 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/pynche In directory usw-pr-cvs1:/tmp/cvs-serv10286 Modified Files: README Log Message: Bump to version 1.3. Also document the new behavior of the chip widgets. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/pynche/README,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -d -r2.15 -r2.16 *** README 2001/07/10 21:37:04 2.15 --- README 2001/08/23 16:15:21 2.16 *************** *** 3,7 **** Contact: Barry A. Warsaw Email: bwarsaw@python.org ! Version: 1.2 Introduction --- 3,7 ---- Contact: Barry A. Warsaw Email: bwarsaw@python.org ! Version: 1.3 Introduction *************** *** 17,26 **** the acronym `ICE'. ! Pynche should work with Python 1.5.2, 2.0, or 2.1, using Tk 8.0.x. ! It's been tested on Solaris 2.6, Windows NT 4, and various Linux ! distros. You'll want to be sure to have at least Tk 8.0.3 for ! Windows. Also, Pynche is very colormap intensive, so it doesn't ! work very well on 8-bit graphics cards; 24bit+ graphics cards are ! so cheap these days, I'll probably never "fix" that. Pynche must find a text database of colors names in order to --- 17,27 ---- the acronym `ICE'. ! Pynche should work with any variant of Python after 1.5.2 ! (e.g. 2.0.1 and 2.1.1), using Tk 8.0.x. It's been tested on ! Solaris 2.6, Windows NT 4, and various Linux distros. You'll want ! to be sure to have at least Tk 8.0.3 for Windows. Also, Pynche is ! very colormap intensive, so it doesn't work very well on 8-bit ! graphics cards; 24bit+ graphics cards are so cheap these days, ! I'll probably never "fix" that. Pynche must find a text database of colors names in order to *************** *** 165,169 **** color selected in the variation strips, along with its X11 color specification. The Nearest chip shows you the closest color in ! the X11 database to the selected color, giving its X11 color name. Clicking on the Nearest color chip selects that color. Color distance is calculated in the 3D space of the RGB color solid and --- 166,175 ---- color selected in the variation strips, along with its X11 color specification. The Nearest chip shows you the closest color in ! the X11 database to the selected color, giving its X11 color ! specification, and below that, its X11 color name. When the ! Selected chip color exactly matches the Nearest chip color, you ! will see the color name appear below the color specification for ! the Selected chip. ! Clicking on the Nearest color chip selects that color. Color distance is calculated in the 3D space of the RGB color solid and *************** *** 176,179 **** --- 182,188 ---- Nearest chip. The other names are "aliases" and they are visible in the Color List Window (see below). + + Both the color specifications and color names are selectable for + copying and pasting into another window. From bckfnn@users.sourceforge.net Thu Aug 23 19:57:03 2001 From: bckfnn@users.sourceforge.net (Finn Bock) Date: Thu, 23 Aug 2001 11:57:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_charmapcodec.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv23312 Modified Files: test_charmapcodec.py Log Message: Committing and closing SF patch #441348 to help Jython to pass this test. Index: test_charmapcodec.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_charmapcodec.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_charmapcodec.py 2001/01/18 02:22:22 1.4 --- test_charmapcodec.py 2001/08/23 18:57:01 1.5 *************** *** 14,18 **** print '*** check failed: %s != %s' % (repr(a), repr(b)) else: ! print '%s == %s: OK' % (repr(a), repr(b)) # test codec's full path name (see test/testcodec.py) --- 14,18 ---- print '*** check failed: %s != %s' % (repr(a), repr(b)) else: ! print '%s == %s: OK' % (a, b) # test codec's full path name (see test/testcodec.py) From effbot@users.sourceforge.net Thu Aug 23 21:04:35 2001 From: effbot@users.sourceforge.net (Fredrik Lundh) Date: Thu, 23 Aug 2001 13:04:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib xmlrpclib.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv7665/Lib Modified Files: xmlrpclib.py Log Message: updated to current PythonWare version (1.0b3). fixed type checks in DateTime constructor. use ServerProxy instead of Server in sample code. Index: xmlrpclib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xmlrpclib.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xmlrpclib.py 2001/08/02 04:15:00 1.2 --- xmlrpclib.py 2001/08/23 20:04:33 1.3 *************** *** 28,32 **** # 2001-03-28 fl Make sure response tuple is a singleton # 2001-03-29 fl Don't require empty params element (from Nicholas Riley) ! # 2001-06-10 fl Folded in _xmlrpclib accelerator support # # Copyright (c) 1999-2001 by Secret Labs AB. --- 28,33 ---- # 2001-03-28 fl Make sure response tuple is a singleton # 2001-03-29 fl Don't require empty params element (from Nicholas Riley) ! # 2001-06-10 fl Folded in _xmlrpclib accelerator support (1.0b2) ! # 2001-08-20 fl Base xmlrpclib.Error on built-in Exception (from Paul Prescod) # # Copyright (c) 1999-2001 by Secret Labs AB. *************** *** 114,123 **** return string ! __version__ = "1.0b2" # -------------------------------------------------------------------- # Exceptions ! class Error: # base class for client errors pass --- 115,124 ---- return string ! __version__ = "1.0b3" # -------------------------------------------------------------------- # Exceptions ! class Error(Exception): # base class for client errors pass *************** *** 196,202 **** def __init__(self, value=0): ! t = type(value) ! if not isinstance(t, StringType): ! if not isinstance(t, TupleType): if value == 0: value = time.time() --- 197,202 ---- def __init__(self, value=0): ! if not isinstance(value, StringType): ! if not isinstance(value, TupleType): if value == 0: value = time.time() *************** *** 388,391 **** --- 388,396 ---- else: # parameter block + # FIXME: the xml-rpc specification allows us to leave out + # the entire block if there are no parameters. + # however, changing this may break older code (including + # old versions of xmlrpclib.py), so this is better left as + # is for now. See @XMLRPC3 for more information. /F write("\n") for v in values: *************** *** 902,906 **** def __repr__(self): return ( ! "" % (self.__host, self.__handler) ) --- 907,911 ---- def __repr__(self): return ( ! "" % (self.__host, self.__handler) ) *************** *** 915,918 **** --- 920,924 ---- # result getattr(server, "strange-python-name")(args) + # compatibility Server = ServerProxy *************** *** 924,929 **** # simple test program (from the XML-RPC specification) ! # server = Server("http://localhost:8000") # local server ! server = Server("http://betty.userland.com") print server --- 930,935 ---- # simple test program (from the XML-RPC specification) ! # server = ServerProxy("http://localhost:8000") # local server ! server = ServerProxy("http://betty.userland.com") print server From effbot@users.sourceforge.net Thu Aug 23 21:13:10 2001 From: effbot@users.sourceforge.net (Fredrik Lundh) Date: Thu, 23 Aug 2001 13:13:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib xmlrpclib.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10189/Lib Modified Files: xmlrpclib.py Log Message: untabification Index: xmlrpclib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xmlrpclib.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** xmlrpclib.py 2001/08/23 20:04:33 1.3 --- xmlrpclib.py 2001/08/23 20:13:08 1.4 *************** *** 388,396 **** else: # parameter block ! # FIXME: the xml-rpc specification allows us to leave out ! # the entire block if there are no parameters. ! # however, changing this may break older code (including ! # old versions of xmlrpclib.py), so this is better left as ! # is for now. See @XMLRPC3 for more information. /F write("\n") for v in values: --- 388,396 ---- else: # parameter block ! # FIXME: the xml-rpc specification allows us to leave out ! # the entire block if there are no parameters. ! # however, changing this may break older code (including ! # old versions of xmlrpclib.py), so this is better left as ! # is for now. See @XMLRPC3 for more information. /F write("\n") for v in values: From tim_one@users.sourceforge.net Thu Aug 23 21:34:03 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 23 Aug 2001 13:34:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_long.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv15188/python/Lib/test Modified Files: test_long.py Log Message: Remove test_long's expected-output file. Index: test_long.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_long.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_long.py 2001/01/17 19:11:13 1.6 --- test_long.py 2001/08/23 20:34:01 1.7 *************** *** 89,93 **** def test_division(maxdigits=MAXDIGITS): ! print "long / * % divmod" digits = range(1, maxdigits+1) for lenx in digits: --- 89,94 ---- def test_division(maxdigits=MAXDIGITS): ! if verbose: ! print "long / * % divmod" digits = range(1, maxdigits+1) for lenx in digits: *************** *** 150,154 **** def test_bitop_identities(maxdigits=MAXDIGITS): ! print "long bit-operation identities" for x in special: test_bitop_identities_1(x) --- 151,156 ---- def test_bitop_identities(maxdigits=MAXDIGITS): ! if verbose: ! print "long bit-operation identities" for x in special: test_bitop_identities_1(x) *************** *** 198,202 **** def test_format(maxdigits=MAXDIGITS): ! print "long str/hex/oct/atol" for x in special: test_format_1(x) --- 200,205 ---- def test_format(maxdigits=MAXDIGITS): ! if verbose: ! print "long str/hex/oct/atol" for x in special: test_format_1(x) *************** *** 209,213 **** def test_misc(maxdigits=MAXDIGITS): ! print "long miscellaneous operations" import sys --- 212,217 ---- def test_misc(maxdigits=MAXDIGITS): ! if verbose: ! print "long miscellaneous operations" import sys From tim_one@users.sourceforge.net Thu Aug 23 21:34:04 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 23 Aug 2001 13:34:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_long,1.3,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv15188/python/Lib/test/output Removed Files: test_long Log Message: Remove test_long's expected-output file. --- test_long DELETED --- From gward@users.sourceforge.net Thu Aug 23 21:53:30 2001 From: gward@users.sourceforge.net (Greg Ward) Date: Thu, 23 Aug 2001 13:53:30 -0700 Subject: [Python-checkins] CVS: distutils/distutils/command install.py,1.57,1.58 Message-ID: Update of /cvsroot/python/distutils/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv20084/command Modified Files: install.py Log Message: Patch #449054 to implement PEP 250. The standard install directory for modules and extensions on Windows is now $PREFIX/Lib/site-packages. Includes backwards compatibility code for pre-2.2 Pythons. Contributed by Paul Moore. Index: install.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/command/install.py,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** install.py 2001/08/10 18:59:59 1.57 --- install.py 2001/08/23 20:53:27 1.58 *************** *** 17,20 **** --- 17,37 ---- from glob import glob + if sys.version < "2.2": + WINDOWS_SCHEME = { + 'purelib': '$base', + 'platlib': '$base', + 'headers': '$base/Include/$dist_name', + 'scripts': '$base/Scripts', + 'data' : '$base', + } + else: + WINDOWS_SCHEME = { + 'purelib': '$base/Lib/site-packages', + 'platlib': '$base/Lib/site-packages', + 'headers': '$base/Include/$dist_name', + 'scripts': '$base/Scripts', + 'data' : '$base', + } + INSTALL_SCHEMES = { 'unix_prefix': { *************** *** 31,42 **** 'scripts': '$base/bin', 'data' : '$base', - }, - 'nt': { - 'purelib': '$base', - 'platlib': '$base', - 'headers': '$base/Include/$dist_name', - 'scripts': '$base/Scripts', - 'data' : '$base', }, 'mac': { 'purelib': '$base/Lib/site-packages', --- 48,53 ---- 'scripts': '$base/bin', 'data' : '$base', }, + 'nt': WINDOWS_SCHEME, 'mac': { 'purelib': '$base/Lib/site-packages', From gward@users.sourceforge.net Thu Aug 23 21:53:30 2001 From: gward@users.sourceforge.net (Greg Ward) Date: Thu, 23 Aug 2001 13:53:30 -0700 Subject: [Python-checkins] CVS: distutils/distutils sysconfig.py,1.40,1.41 Message-ID: Update of /cvsroot/python/distutils/distutils In directory usw-pr-cvs1:/tmp/cvs-serv20084 Modified Files: sysconfig.py Log Message: Patch #449054 to implement PEP 250. The standard install directory for modules and extensions on Windows is now $PREFIX/Lib/site-packages. Includes backwards compatibility code for pre-2.2 Pythons. Contributed by Paul Moore. Index: sysconfig.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/sysconfig.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** sysconfig.py 2001/08/02 20:03:12 1.40 --- sysconfig.py 2001/08/23 20:53:27 1.41 *************** *** 95,99 **** return os.path.join(prefix, "Lib") else: ! return prefix elif os.name == "mac": --- 95,102 ---- return os.path.join(prefix, "Lib") else: ! if sys.version < "2.2": ! return prefix ! else: ! return os.path.join(PREFIX, "Lib", "site-packages") elif os.name == "mac": From tim_one@users.sourceforge.net Thu Aug 23 22:28:35 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 23 Aug 2001 14:28:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects intobject.c,2.63,2.64 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv940 Modified Files: intobject.c Log Message: int_pow(): Repair typo when passing on to float pow (the 2nd argument was being passed as both the 2nd and 3rd args). Regression test will follow. Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.63 retrieving revision 2.64 diff -C2 -d -r2.63 -r2.64 *** intobject.c 2001/08/23 02:59:04 2.63 --- intobject.c 2001/08/23 21:28:33 2.64 *************** *** 586,590 **** (PyObject *)v, (PyObject *)w, ! (PyObject *)w); } } --- 586,590 ---- (PyObject *)v, (PyObject *)w, ! (PyObject *)z); } } From gvanrossum@users.sourceforge.net Thu Aug 23 22:32:42 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 23 Aug 2001 14:32:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects intobject.c,2.64,2.65 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv2537 Modified Files: intobject.c Log Message: err_ovf(): only raise OverflowError when OverflowWarning was raised. Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.64 retrieving revision 2.65 diff -C2 -d -r2.64 -r2.65 *** intobject.c 2001/08/23 21:28:33 2.64 --- intobject.c 2001/08/23 21:32:40 2.65 *************** *** 28,32 **** { if (PyErr_Warn(PyExc_OverflowWarning, msg) < 0) { ! PyErr_SetString(PyExc_OverflowError, msg); return 1; } --- 28,33 ---- { if (PyErr_Warn(PyExc_OverflowWarning, msg) < 0) { ! if (PyErr_ExceptionMatches(PyExc_OverflowWarning)) ! PyErr_SetString(PyExc_OverflowError, msg); return 1; } From gvanrossum@users.sourceforge.net Thu Aug 23 22:39:19 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 23 Aug 2001 14:39:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects descrobject.c,2.3,2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv4396 Modified Files: descrobject.c Log Message: Add new built-in type 'getset' (PyGetSet_Type). This implements the 'getset' class from test_binop.py. Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -d -r2.3 -r2.4 *** descrobject.c 2001/08/16 13:15:00 2.3 --- descrobject.c 2001/08/23 21:39:17 2.4 *************** *** 841,842 **** --- 841,977 ---- return (PyObject *)wp; } + + + /* A built-in 'getset' type */ + + /* + class getset(object): + + def __init__(self, get=None, set=None): + self.__get = get + self.__set = set + + def __get__(self, inst, type=None): + if self.__get is None: + raise AttributeError, "unreadable attribute" + if inst is None: + return self + return self.__get(inst) + + def __set__(self, inst, value): + if self.__set is None: + raise AttributeError, "unsettable attribute" + return self.__set(inst, value) + */ + + typedef struct { + PyObject_HEAD + PyObject *get; + PyObject *set; + } getsetobject; + + static void + getset_dealloc(PyObject *self) + { + getsetobject *gs = (getsetobject *)self; + + Py_XDECREF(gs->get); + Py_XDECREF(gs->set); + self->ob_type->tp_free(self); + } + + static PyObject * + getset_descr_get(PyObject *self, PyObject *obj, PyObject *type) + { + getsetobject *gs = (getsetobject *)self; + + if (gs->get == NULL) { + PyErr_SetString(PyExc_AttributeError, "unreadable attribute"); + return NULL; + } + if (obj == NULL || obj == Py_None) { + Py_INCREF(self); + return self; + } + return PyObject_CallFunction(gs->get, "(O)", obj); + } + + static int + getset_descr_set(PyObject *self, PyObject *obj, PyObject *value) + { + getsetobject *gs = (getsetobject *)self; + PyObject *res; + + if (gs->set == NULL) { + PyErr_SetString(PyExc_AttributeError, "unsettable attribute"); + return -1; + } + res = PyObject_CallFunction(gs->set, "(OO)", obj, value); + if (res == NULL) + return -1; + Py_DECREF(res); + return 0; + } + + static int + getset_init(PyObject *self, PyObject *args, PyObject *kwds) + { + PyObject *get, *set; + getsetobject *gs = (getsetobject *)self; + + if (!PyArg_ParseTuple(args, "OO:getset.__init__", &get, &set)) + return -1; + if (get == Py_None) + get = NULL; + if (set == Py_None) + set = NULL; + Py_XINCREF(get); + Py_XINCREF(set); + gs->get = get; + gs->set = set; + return 0; + } + + PyTypeObject PyGetSet_Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, /* ob_size */ + "getset", /* tp_name */ + sizeof(getsetobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + getset_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + getset_descr_get, /* tp_descr_get */ + getset_descr_set, /* tp_descr_set */ + 0, /* tp_dictoffset */ + getset_init, /* tp_init */ + PyType_GenericAlloc, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ + _PyObject_Del, /* tp_free */ + }; From gvanrossum@users.sourceforge.net Thu Aug 23 22:39:34 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 23 Aug 2001 14:39:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include descrobject.h,2.1,2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv4467 Modified Files: descrobject.h Log Message: Add new built-in type 'getset' (PyGetSet_Type). This implements the 'getset' class from test_binop.py. Index: descrobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/descrobject.h,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -d -r2.1 -r2.2 *** descrobject.h 2001/08/02 04:15:00 2.1 --- descrobject.h 2001/08/23 21:39:32 2.2 *************** *** 31,32 **** --- 31,35 ---- extern DL_IMPORT(PyObject *) PyDictProxy_New(PyObject *); extern DL_IMPORT(PyObject *) PyWrapper_New(PyObject *, PyObject *); + + + extern DL_IMPORT(PyTypeObject) PyGetSet_Type; From gvanrossum@users.sourceforge.net Thu Aug 23 22:40:40 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 23 Aug 2001 14:40:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.229,2.230 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv4734 Modified Files: bltinmodule.c Log Message: Add new built-in type 'getset' (PyGetSet_Type). This implements the 'getset' class from test_binop.py. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.229 retrieving revision 2.230 diff -C2 -d -r2.229 -r2.230 *** bltinmodule.c 2001/08/17 23:04:59 2.229 --- bltinmodule.c 2001/08/23 21:40:38 2.230 *************** *** 1922,1925 **** --- 1922,1928 ---- (PyObject *) &PyFloat_Type) < 0) return NULL; + if (PyDict_SetItemString(dict, "getset", + (PyObject *) &PyGetSet_Type) < 0) + return NULL; if (PyDict_SetItemString(dict, "int", (PyObject *) &PyInt_Type) < 0) return NULL; From tim_one@users.sourceforge.net Thu Aug 23 23:31:39 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 23 Aug 2001 15:31:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.86,2.87 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv12020 Modified Files: floatobject.c Log Message: float_pow: Put *all* of the burden on the libm pow in normal cases. powu: Deleted. This started with a nonsensical error msg: >>> x = -1. >>> import sys >>> x**(-sys.maxint-1L) Traceback (most recent call last): File "", line 1, in ? ValueError: negative number cannot be raised to a fractional power >>> The special-casing in float_pow was simply wrong in this case (there's not even anything peculiar about these inputs), and I don't see any point to it in *any* case: a decent libm pow should have worst-case error under 1 ULP, so in particular should deliver the exact result whenever the exact result is representable (else its error is at least 1 ULP). Thus our special fiddling for integral values "shouldn't" buy anything in accuracy, and, to the contrary, repeated multiplication is less accurate than a decent pow when the true result isn't exactly representable. So just letting pow() do its job here (we may not be able to trust libm x-platform in exceptional cases, but these are normal cases). Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.86 retrieving revision 2.87 diff -C2 -d -r2.86 -r2.87 *** floatobject.c 2001/08/17 18:39:25 2.86 --- floatobject.c 2001/08/23 22:31:37 2.87 *************** *** 470,492 **** } - static double powu(double x, long n) - { - double r = 1.; - double p = x; - long mask = 1; - while (mask > 0 && n >= mask) { - if (n & mask) - r *= p; - mask <<= 1; - p *= p; - } - return r; - } - static PyObject * float_pow(PyObject *v, PyObject *w, PyObject *z) { double iv, iw, ix; - long intw; /* XXX Doesn't handle overflows if z!=None yet; it may never do so :( * The z parameter is really only going to be useful for integers and --- 470,477 ---- *************** *** 496,509 **** CONVERT_TO_DOUBLE(v, iv); CONVERT_TO_DOUBLE(w, iw); - intw = (long)iw; /* Sort out special cases here instead of relying on pow() */ ! if (iw == 0) { /* x**0 is 1, even 0**0 */ PyFPE_START_PROTECT("pow", return NULL) if ((PyObject *)z != Py_None) { double iz; CONVERT_TO_DOUBLE(z, iz); ! ix=fmod(1.0, iz); ! if (ix!=0 && iz<0) ix+=iz; } else --- 481,494 ---- CONVERT_TO_DOUBLE(v, iv); CONVERT_TO_DOUBLE(w, iw); /* Sort out special cases here instead of relying on pow() */ ! if (iw == 0) { /* v**0 is 1, even 0**0 */ PyFPE_START_PROTECT("pow", return NULL) if ((PyObject *)z != Py_None) { double iz; CONVERT_TO_DOUBLE(z, iz); ! ix = fmod(1.0, iz); ! if (ix != 0 && iz < 0) ! ix += iz; } else *************** *** 512,516 **** return PyFloat_FromDouble(ix); } ! if (iv == 0.0) { if (iw < 0.0) { PyErr_SetString(PyExc_ZeroDivisionError, --- 497,501 ---- return PyFloat_FromDouble(ix); } ! if (iv == 0.0) { /* 0**w is error if w<0, else 1 */ if (iw < 0.0) { PyErr_SetString(PyExc_ZeroDivisionError, *************** *** 520,546 **** return PyFloat_FromDouble(0.0); } ! ! if (iw == intw && intw > LONG_MIN) { ! /* ruled out LONG_MIN because -LONG_MIN isn't representable */ ! errno = 0; ! PyFPE_START_PROTECT("pow", return NULL) ! if (intw > 0) ! ix = powu(iv, intw); ! else ! ix = 1./powu(iv, -intw); ! PyFPE_END_PROTECT(ix) ! } ! else { ! /* Sort out special cases here instead of relying on pow() */ ! if (iv < 0.0) { ! PyErr_SetString(PyExc_ValueError, ! "negative number cannot be raised to a fractional power"); ! return NULL; ! } ! errno = 0; ! PyFPE_START_PROTECT("pow", return NULL) ! ix = pow(iv, iw); ! PyFPE_END_PROTECT(ix) } CHECK(ix); if (errno != 0) { --- 505,517 ---- return PyFloat_FromDouble(0.0); } ! if (iv < 0.0 && iw != floor(iw)) { ! PyErr_SetString(PyExc_ValueError, ! "negative number cannot be raised to a fractional power"); ! return NULL; } + errno = 0; + PyFPE_START_PROTECT("pow", return NULL) + ix = pow(iv, iw); + PyFPE_END_PROTECT(ix) CHECK(ix); if (errno != 0) { *************** *** 553,559 **** CONVERT_TO_DOUBLE(z, iz); PyFPE_START_PROTECT("pow", return 0) ! ix=fmod(ix, iz); /* XXX To Be Rewritten */ ! if (ix!=0 && ((iv<0 && iz>0) || (iv>0 && iz<0) )) { ! ix+=iz; } PyFPE_END_PROTECT(ix) --- 524,530 ---- CONVERT_TO_DOUBLE(z, iz); PyFPE_START_PROTECT("pow", return 0) ! ix = fmod(ix, iz); /* XXX To Be Rewritten */ ! if (ix != 0 && ((iv < 0 && iz > 0) || (iv > 0 && iz < 0) )) { ! ix += iz; } PyFPE_END_PROTECT(ix) From bwarsaw@users.sourceforge.net Thu Aug 23 23:35:34 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 23 Aug 2001 15:35:34 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0101.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv15992 Modified Files: pep-0101.txt Log Message: Typos, spell check, untab Index: pep-0101.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0101.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0101.txt 2001/08/22 22:41:40 1.1 --- pep-0101.txt 2001/08/23 22:35:32 1.2 *************** *** 50,54 **** the release, the RM will create a branch for this release. Only the RM is authorized to make commits to this branch, but ! checkins can proceed as normal on the trunk. It is the responsibility of the RM to decide on a case-by-case basis which trunk modifications should be merged into the branch. --- 50,54 ---- the release, the RM will create a branch for this release. Only the RM is authorized to make commits to this branch, but ! check ins can proceed as normal on the trunk. It is the responsibility of the RM to decide on a case-by-case basis which trunk modifications should be merged into the branch. *************** *** 72,76 **** change should also be applied to the branch. ! If so, it's fairly easy to apply the change by diffing the file and patching it manually. You can also sometimes get away with just copying the file from the trunk directory to the branch --- 72,76 ---- change should also be applied to the branch. ! If so, it's fairly easy to apply the change by diff'ing the file and patching it manually. You can also sometimes get away with just copying the file from the trunk directory to the branch *************** *** 90,94 **** about changes on the Mac. ! - Also the night before the release, a freeze is put on checkins into the branch. At this point, nobody except Fred Drake or Tim Peters should make any commits to the branch. If the RM screwed --- 90,94 ---- about changes on the Mac. ! - Also the night before the release, a freeze is put on check ins into the branch. At this point, nobody except Fred Drake or Tim Peters should make any commits to the branch. If the RM screwed *************** *** 180,187 **** - Start your upload to SF. You need to get Python-2.2a3.tgz into SourceForge. This can take a while both because of the time it ! takes to upload 650+KB of data, /and/ because SF has a 30 minute ! delay built into the file release process. The next few steps ! can be taken in parallel, so it's best to start the upload now ! and keep an eye on its progress. I've found that the `ncftpput' program is a great tool to use if --- 180,187 ---- - Start your upload to SF. You need to get Python-2.2a3.tgz into SourceForge. This can take a while both because of the time it ! takes to upload such a huge file, /and/ because SF has a 30 ! minute delay built into the file release process. The next few ! steps can be taken in parallel, so it's best to start the upload ! now and keep an eye on its progress. I've found that the `ncftpput' program is a great tool to use if *************** *** 415,419 **** development. E.g. the line should look like: ! #define PY_VERSION "2.2a2+" Commit this change. --- 415,419 ---- development. E.g. the line should look like: ! #define PY_VERSION "2.2a2+" Commit this change. From tim_one@users.sourceforge.net Thu Aug 23 23:56:23 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 23 Aug 2001 15:56:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_long.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv20480/python/Lib/test Modified Files: test_long.py Log Message: SF bug [#454456] int overflow code needs tests. Added tests for boundary cases in magical PEP 237 int->long auto-overflow, but nothing here addresses the rest of the bug report so left it open. Index: test_long.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_long.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_long.py 2001/08/23 20:34:01 1.7 --- test_long.py 2001/08/23 22:56:21 1.8 *************** *** 256,259 **** --- 256,319 ---- raise TestFailed, "int(long(-sys.maxint-1) - 1) didn't overflow" + # ----------------------------------- tests of auto int->long conversion + + def test_auto_overflow(): + import math, sys + + if verbose: + print "auto-convert int->long on overflow" + + special = [0, 1, 2, 3, sys.maxint-1, sys.maxint, sys.maxint+1] + sqrt = int(math.sqrt(sys.maxint)) + special.extend([sqrt-1, sqrt, sqrt+1]) + special.extend([-i for i in special]) + + def checkit(*args): + # Heavy use of nested scopes here! + verify(got == expected, "for %r expected %r got %r" % + (args, expected, got)) + + for x in special: + longx = long(x) + + expected = -longx + got = -x + checkit('-', x) + + for y in special: + longy = long(y) + + expected = longx + longy + got = x + y + checkit(x, '+', y) + + expected = longx - longy + got = x - y + checkit(x, '-', y) + + expected = longx * longy + got = x * y + checkit(x, '*', y) + + if y: + expected = longx / longy + got = x / y + checkit(x, '/', y) + + expected = divmod(longx, longy) + got = divmod(longx, longy) + checkit(x, 'divmod', y) + + if abs(y) < 5 and not (x == 0 and y < 0): + expected = longx ** longy + got = x ** y + checkit(x, '**', y) + + for z in special: + if z != 0: + expected = pow(longx, longy, long(z)) + got = pow(x, y, z) + checkit('pow', x, y, '%', z) + # ---------------------------------------------------------------- do it *************** *** 262,263 **** --- 322,324 ---- test_format() test_misc() + test_auto_overflow() From tim_one@users.sourceforge.net Fri Aug 24 00:02:59 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 23 Aug 2001 16:02:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_long.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22400/python/Lib/test Modified Files: test_long.py Log Message: Add a test for the new // operator too. Index: test_long.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_long.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_long.py 2001/08/23 22:56:21 1.8 --- test_long.py 2001/08/23 23:02:57 1.9 *************** *** 301,304 **** --- 301,308 ---- checkit(x, '/', y) + expected = longx // longy + got = x // y + checkit(x, '//', y) + expected = divmod(longx, longy) got = divmod(longx, longy) From tim_one@users.sourceforge.net Fri Aug 24 05:33:12 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 23 Aug 2001 21:33:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_charmapcodec,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv20946/lib/test/output Modified Files: test_charmapcodec Log Message: Looks like someone forgot the change the expected output file. Index: test_charmapcodec =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_charmapcodec,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_charmapcodec 2001/01/10 10:21:11 1.2 --- test_charmapcodec 2001/08/24 04:33:10 1.3 *************** *** 1,16 **** test_charmapcodec ! u'abc' == u'abc': OK ! u'abcdef' == u'abcdef': OK ! u'defabc' == u'defabc': OK ! u'dabcf' == u'dabcf': OK ! u'dabcfabc' == u'dabcfabc': OK ! 'abc' == 'abc': OK ! 'abcdef' == 'abcdef': OK ! 'defabc' == 'defabc': OK ! 'dabcf' == 'dabcf': OK ! 'dabcfabc' == 'dabcfabc': OK ! u'def' == u'def': OK ! u'def' == u'def': OK ! u'df' == u'df': OK ! u'df' == u'df': OK \001 maps to undefined: OK --- 1,16 ---- test_charmapcodec ! abc == abc: OK ! abcdef == abcdef: OK ! defabc == defabc: OK ! dabcf == dabcf: OK ! dabcfabc == dabcfabc: OK ! abc == abc: OK ! abcdef == abcdef: OK ! defabc == defabc: OK ! dabcf == dabcf: OK ! dabcfabc == dabcfabc: OK ! def == def: OK ! def == def: OK ! df == df: OK ! df == df: OK \001 maps to undefined: OK From tim_one@users.sourceforge.net Fri Aug 24 07:29:14 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 23 Aug 2001 23:29:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules newmodule.c,2.33,2.34 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv7657/python/Modules Modified Files: newmodule.c Log Message: Back out trying to use the C values for CO_xxx. __future__.py reverted to 1.9. newmodule.c reverted to 2.32. Index: newmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/newmodule.c,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -d -r2.33 -r2.34 *** newmodule.c 2001/08/18 20:18:49 2.33 --- newmodule.c 2001/08/24 06:29:12 2.34 *************** *** 221,257 **** You need to know a great deal about the interpreter to use this!"; - static void - insertint(PyObject *d, char *name, int value) - { - PyObject *v = PyInt_FromLong((long) value); - if (v == NULL) { - /* Don't bother reporting this error */ - PyErr_Clear(); - } - else { - PyDict_SetItemString(d, name, v); - Py_DECREF(v); - } - } - DL_EXPORT(void) initnew(void) { ! PyObject *m; ! PyObject *d; ! ! m = Py_InitModule4("new", new_methods, new_doc, (PyObject *)NULL, ! PYTHON_API_VERSION); ! d = PyModule_GetDict(m); ! ! #define ADDSYM(TOKEN) insertint(d, #TOKEN, TOKEN) ! ADDSYM(CO_OPTIMIZED); ! ADDSYM(CO_NEWLOCALS); ! ADDSYM(CO_VARARGS); ! ADDSYM(CO_VARKEYWORDS); ! ADDSYM(CO_NESTED); ! ADDSYM(CO_GENERATOR); ! ADDSYM(CO_GENERATOR_ALLOWED); ! ADDSYM(CO_FUTURE_DIVISION); ! #undef ADDSYM } --- 221,228 ---- You need to know a great deal about the interpreter to use this!"; DL_EXPORT(void) initnew(void) { ! Py_InitModule4("new", new_methods, new_doc, (PyObject *)NULL, ! PYTHON_API_VERSION); } From tim_one@users.sourceforge.net Fri Aug 24 07:29:14 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 23 Aug 2001 23:29:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib __future__.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv7657/python/Lib Modified Files: __future__.py Log Message: Back out trying to use the C values for CO_xxx. __future__.py reverted to 1.9. newmodule.c reverted to 2.32. Index: __future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/__future__.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** __future__.py 2001/08/19 05:29:25 1.11 --- __future__.py 2001/08/24 06:29:12 1.12 *************** *** 56,66 **** __all__ = ["all_feature_names"] + all_feature_names ! try: ! import new as _new # for CO_xxx symbols ! except ImportError: # May happen during build ! class _new: ! CO_NESTED = 0x0010 ! CO_GENERATOR_ALLOWED = 0x1000 ! CO_FUTURE_DIVISION = 0x2000 class _Feature: --- 56,66 ---- __all__ = ["all_feature_names"] + all_feature_names ! # The CO_xxx symbols are defined here under the same names used by ! # compile.h, so that an editor search will find them here. However, ! # they're not exported in __all__, because they don't really belong to ! # this module. ! CO_NESTED = 0x0010 # nested_scopes ! CO_GENERATOR_ALLOWED = 0x1000 # generators ! CO_FUTURE_DIVISION = 0x2000 # division class _Feature: *************** *** 93,103 **** nested_scopes = _Feature((2, 1, 0, "beta", 1), (2, 2, 0, "alpha", 0), ! _new.CO_NESTED) generators = _Feature((2, 2, 0, "alpha", 1), (2, 3, 0, "final", 0), ! _new.CO_GENERATOR_ALLOWED) division = _Feature((2, 2, 0, "alpha", 2), (3, 0, 0, "alpha", 0), ! _new.CO_FUTURE_DIVISION) --- 93,103 ---- nested_scopes = _Feature((2, 1, 0, "beta", 1), (2, 2, 0, "alpha", 0), ! CO_NESTED) generators = _Feature((2, 2, 0, "alpha", 1), (2, 3, 0, "final", 0), ! CO_GENERATOR_ALLOWED) division = _Feature((2, 2, 0, "alpha", 2), (3, 0, 0, "alpha", 0), ! CO_FUTURE_DIVISION) From jackjansen@users.sourceforge.net Fri Aug 24 10:17:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 24 Aug 2001 02:17:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/app Appmodule.c,1.7,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/app In directory usw-pr-cvs1:/tmp/cvs-serv17488/python/Mac/Modules/app Removed Files: Appmodule.c Log Message: Last renamed module that wasn't removed yet. --- Appmodule.c DELETED --- From gvanrossum@users.sourceforge.net Fri Aug 24 10:55:54 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 02:55:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects descrobject.c,2.4,2.5 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv27168 Modified Files: descrobject.c Log Message: getset_init(): make the arguments optional. getset_doc: add docstring. Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** descrobject.c 2001/08/23 21:39:17 2.4 --- descrobject.c 2001/08/24 09:55:51 2.5 *************** *** 917,924 **** getset_init(PyObject *self, PyObject *args, PyObject *kwds) { ! PyObject *get, *set; getsetobject *gs = (getsetobject *)self; ! if (!PyArg_ParseTuple(args, "OO:getset.__init__", &get, &set)) return -1; if (get == Py_None) --- 917,924 ---- getset_init(PyObject *self, PyObject *args, PyObject *kwds) { ! PyObject *get = NULL, *set = NULL; getsetobject *gs = (getsetobject *)self; ! if (!PyArg_ParseTuple(args, "|OO:getset.__init__", &get, &set)) return -1; if (get == Py_None) *************** *** 933,936 **** --- 933,944 ---- } + static char getset_doc[] = + "getset([getfunc[, setfunc]]) -> getset attribute\n" + "Typical use to define a managed attribute x of C instances:\n" + "class C(object):\n" + " def getx(self): return self.__x\n" + " def setx(self, value): self.__x = value\n" + " x = getset(getx, setx)"; + PyTypeObject PyGetSet_Type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 956,960 **** 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ ! 0, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ --- 964,968 ---- 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ ! getset_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ From gvanrossum@users.sourceforge.net Fri Aug 24 11:13:34 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 03:13:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.43,2.44 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv30607 Modified Files: typeobject.c Log Message: slot_tp_descr_get(): guard against NULL obj or type (bug reported by Thomas Hellor on python-dev). slot_tp_descr_set(): if value is NULL, call __del__ instead of __set__. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.43 retrieving revision 2.44 diff -C2 -d -r2.43 -r2.44 *** typeobject.c 2001/08/22 19:24:42 2.43 --- typeobject.c 2001/08/24 10:13:31 2.44 *************** *** 2807,2810 **** --- 2807,2814 ---- return self; } + if (obj == NULL) + obj = Py_None; + if (type == NULL) + type = Py_None; return PyObject_CallFunction(get, "OOO", self, obj, type); } *************** *** 2813,2818 **** slot_tp_descr_set(PyObject *self, PyObject *target, PyObject *value) { ! PyObject *res = PyObject_CallMethod(self, "__set__", ! "OO", target, value); if (res == NULL) return -1; --- 2817,2827 ---- slot_tp_descr_set(PyObject *self, PyObject *target, PyObject *value) { ! PyObject *res; ! ! if (value == NULL) ! res = PyObject_CallMethod(self, "__del__", "O", target); ! else ! res = PyObject_CallMethod(self, "__set__", ! "OO", target, value); if (res == NULL) return -1; From gvanrossum@users.sourceforge.net Fri Aug 24 11:17:38 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 03:17:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects descrobject.c,2.5,2.6 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv31393 Modified Files: descrobject.c Log Message: getset_descr_set(): guard against deletion (indicated by a set call with a NULL value), in a somewhat lame way: call the set() function with one argument. Should I add a 3rd function, 'del', instead? Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** descrobject.c 2001/08/24 09:55:51 2.5 --- descrobject.c 2001/08/24 10:17:36 2.6 *************** *** 907,911 **** return -1; } ! res = PyObject_CallFunction(gs->set, "(OO)", obj, value); if (res == NULL) return -1; --- 907,914 ---- return -1; } ! if (value == NULL) ! res = PyObject_CallFunction(gs->set, "(O)", obj); ! else ! res = PyObject_CallFunction(gs->set, "(OO)", obj, value); if (res == NULL) return -1; From gvanrossum@users.sourceforge.net Fri Aug 24 14:10:15 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 06:10:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib urllib2.py,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv31967 Modified Files: urllib2.py Log Message: SF patch #454553 by Walter Dörwald: add content-type to FTP URLs, like for urllib. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** urllib2.py 2001/08/11 21:44:46 1.19 --- urllib2.py 2001/08/24 13:10:13 1.20 *************** *** 957,965 **** type = value.upper() fp, retrlen = fw.retrfile(file, type) if retrlen is not None and retrlen >= 0: ! sf = StringIO('Content-Length: %d\n' % retrlen) ! headers = mimetools.Message(sf) ! else: ! headers = noheaders() return addinfourl(fp, headers, req.get_full_url()) except ftplib.all_errors, msg: --- 957,968 ---- type = value.upper() fp, retrlen = fw.retrfile(file, type) + headers = "" + mtype = mimetypes.guess_type(req.get_full_url())[0] + if mtype: + headers += "Content-Type: %s\n" % mtype if retrlen is not None and retrlen >= 0: ! headers += "Content-Length: %d\n" % retrlen ! sf = StringIO(headers) ! headers = mimetools.Message(sf) return addinfourl(fp, headers, req.get_full_url()) except ftplib.all_errors, msg: From gvanrossum@users.sourceforge.net Fri Aug 24 16:23:22 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 08:23:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects descrobject.c,2.6,2.7 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv338 Modified Files: descrobject.c Log Message: Change the getset type to take an optional third function argument: the delete function. (Question: should the attribute name also be recorded in the getset object? That makes the protocol more work, but may give us better error messages.) Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** descrobject.c 2001/08/24 10:17:36 2.6 --- descrobject.c 2001/08/24 15:23:20 2.7 *************** *** 869,872 **** --- 869,873 ---- PyObject *get; PyObject *set; + PyObject *del; } getsetobject; *************** *** 878,881 **** --- 879,883 ---- Py_XDECREF(gs->get); Py_XDECREF(gs->set); + Py_XDECREF(gs->del); self->ob_type->tp_free(self); } *************** *** 901,914 **** { getsetobject *gs = (getsetobject *)self; ! PyObject *res; ! if (gs->set == NULL) { ! PyErr_SetString(PyExc_AttributeError, "unsettable attribute"); return -1; } if (value == NULL) ! res = PyObject_CallFunction(gs->set, "(O)", obj); else ! res = PyObject_CallFunction(gs->set, "(OO)", obj, value); if (res == NULL) return -1; --- 903,923 ---- { getsetobject *gs = (getsetobject *)self; ! PyObject *func, *res; ! if (value == NULL) ! func = gs->del; ! else ! func = gs->set; ! if (func == NULL) { ! PyErr_SetString(PyExc_AttributeError, ! value == NULL ? ! "can't delete attribute" : ! "can't set attribute"); return -1; } if (value == NULL) ! res = PyObject_CallFunction(func, "(O)", obj); else ! res = PyObject_CallFunction(func, "(OO)", obj, value); if (res == NULL) return -1; *************** *** 920,927 **** getset_init(PyObject *self, PyObject *args, PyObject *kwds) { ! PyObject *get = NULL, *set = NULL; getsetobject *gs = (getsetobject *)self; ! if (!PyArg_ParseTuple(args, "|OO:getset.__init__", &get, &set)) return -1; if (get == Py_None) --- 929,936 ---- getset_init(PyObject *self, PyObject *args, PyObject *kwds) { ! PyObject *get = NULL, *set = NULL, *del = NULL; getsetobject *gs = (getsetobject *)self; ! if (!PyArg_ParseTuple(args, "|OOO:getset.__init__", &get, &set, &del)) return -1; if (get == Py_None) *************** *** 931,946 **** Py_XINCREF(get); Py_XINCREF(set); gs->get = get; gs->set = set; return 0; } static char getset_doc[] = ! "getset([getfunc[, setfunc]]) -> getset attribute\n" "Typical use to define a managed attribute x of C instances:\n" "class C(object):\n" " def getx(self): return self.__x\n" " def setx(self, value): self.__x = value\n" ! " x = getset(getx, setx)"; PyTypeObject PyGetSet_Type = { --- 940,958 ---- Py_XINCREF(get); Py_XINCREF(set); + Py_XINCREF(del); gs->get = get; gs->set = set; + gs->del = del; return 0; } static char getset_doc[] = ! "getset([getfunc[, setfunc[, delfunc]]]) -> getset attribute\n" "Typical use to define a managed attribute x of C instances:\n" "class C(object):\n" " def getx(self): return self.__x\n" " def setx(self, value): self.__x = value\n" ! " def delx(self): del self.__x\n" ! " x = getset(getx, setx, delx)"; PyTypeObject PyGetSet_Type = { From gvanrossum@users.sourceforge.net Fri Aug 24 16:24:26 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 08:24:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv677 Modified Files: test_descr.py Log Message: Add a test for the new getset type. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** test_descr.py 2001/08/17 21:27:53 1.19 --- test_descr.py 2001/08/24 15:24:24 1.20 *************** *** 1070,1073 **** --- 1070,1096 ---- del r + def getsets(): + if verbose: print "Testing getset..." + class C(object): + def getx(self): + return self.__x + def setx(self, value): + self.__x = value + def delx(self): + del self.__x + x = getset(getx, setx, delx) + a = C() + verify(not hasattr(a, "x")) + a.x = 42 + verify(a._C__x == 42) + verify(a.x == 42) + del a.x + verify(not hasattr(a, "x")) + verify(not hasattr(a, "_C__x")) + C.x.__set__(a, 100) + verify(C.x.__get__(a) == 100) + ## C.x.__set__(a) + ## verify(not hasattr(a, "x")) + def all(): lists() *************** *** 1099,1102 **** --- 1122,1126 ---- specials() weakrefs() + getsets() all() From gvanrossum@users.sourceforge.net Fri Aug 24 17:47:03 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 09:47:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.44,2.45 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv21505 Modified Files: typeobject.c Log Message: Add 'super', another new object type with magical properties. super(type) -> unbound super object super(type, obj) -> bound super object; requires isinstance(obj, type) Typical use to call a cooperative superclass method: class C(B): def meth(self, arg): super(C, self).meth(arg); Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.44 retrieving revision 2.45 diff -C2 -d -r2.44 -r2.45 *** typeobject.c 2001/08/24 10:13:31 2.44 --- typeobject.c 2001/08/24 16:47:00 2.45 *************** *** 2999,3000 **** --- 2999,3155 ---- TPSLOT("__new__", tp_new, slot_tp_new); } + + + /* Cooperative 'super' */ + + typedef struct { + PyObject_HEAD + PyObject *type; + PyObject *obj; + } superobject; + + static void + super_dealloc(PyObject *self) + { + superobject *su = (superobject *)self; + + Py_XDECREF(su->obj); + Py_XDECREF(su->type); + self->ob_type->tp_free(self); + } + + static PyObject * + super_getattro(PyObject *self, PyObject *name) + { + superobject *su = (superobject *)self; + + if (su->obj != NULL) { + PyObject *mro, *res, *tmp; + descrgetfunc f; + int i, n; + + mro = ((PyTypeObject *)(su->obj->ob_type))->tp_mro; + assert(mro != NULL && PyTuple_Check(mro)); + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (su->type == PyTuple_GET_ITEM(mro, i)) + break; + } + assert(i < n); + i++; + res = NULL; + for (; i < n; i++) { + tmp = PyTuple_GET_ITEM(mro, i); + assert(PyType_Check(tmp)); + res = PyDict_GetItem( + ((PyTypeObject *)tmp)->tp_defined, name); + if (res != NULL) { + Py_INCREF(res); + f = res->ob_type->tp_descr_get; + if (f != NULL) { + tmp = f(res, su->obj, res); + Py_DECREF(res); + res = tmp; + } + return res; + } + } + } + return PyObject_GenericGetAttr(self, name); + } + + static PyObject * + super_descr_get(PyObject *self, PyObject *obj, PyObject *type) + { + superobject *su = (superobject *)self; + superobject *new; + + if (obj == NULL || obj == Py_None || su->obj != NULL) { + /* Not binding to an object, or already bound */ + Py_INCREF(self); + return self; + } + new = (superobject *)PySuper_Type.tp_new(&PySuper_Type, NULL, NULL); + if (new == NULL) + return NULL; + Py_INCREF(su->type); + Py_INCREF(obj); + new->type = su->type; + new->obj = obj; + return (PyObject *)new; + } + + static int + super_init(PyObject *self, PyObject *args, PyObject *kwds) + { + superobject *su = (superobject *)self; + PyObject *type, *obj = NULL; + + if (!PyArg_ParseTuple(args, "O!|O:super", &PyType_Type, &type, &obj)) + return -1; + if (obj == Py_None) + obj = NULL; + if (obj != NULL && !PyType_IsSubtype(obj->ob_type, + (PyTypeObject *)type)) { + PyErr_SetString(PyExc_TypeError, + "super(type, obj) requires isinstance(obj, type)"); + return -1; + } + Py_INCREF(type); + Py_XINCREF(obj); + su->type = type; + su->obj = obj; + return 0; + } + + static char super_doc[] = + "super(type) -> unbound super object\n" + "super(type, obj) -> bound super object; requires isinstance(obj, type)\n" + "Typical use to call a cooperative superclass method:\n" + "class C(B):\n" + " def meth(self, arg):\n" + " super(C, self).meth(arg)"; + + PyTypeObject PySuper_Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, /* ob_size */ + "super", /* tp_name */ + sizeof(superobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + super_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + super_getattro, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + super_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + super_descr_get, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + super_init, /* tp_init */ + PyType_GenericAlloc, /* tp_alloc */ + PyType_GenericNew, /* tp_new */ + _PyObject_Del, /* tp_free */ + }; From gvanrossum@users.sourceforge.net Fri Aug 24 17:51:44 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 09:51:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include object.h,2.86,2.87 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv22512 Modified Files: object.h Log Message: Add decl of PySuper_Type; fixup comments for the two other types. Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.86 retrieving revision 2.87 diff -C2 -d -r2.86 -r2.87 *** object.h 2001/08/17 18:39:24 2.86 --- object.h 2001/08/24 16:51:42 2.87 *************** *** 305,310 **** ((ob)->ob_type == (tp) || PyType_IsSubtype((ob)->ob_type, (tp))) ! extern DL_IMPORT(PyTypeObject) PyType_Type; /* Metatype */ ! extern DL_IMPORT(PyTypeObject) PyBaseObject_Type; /* Most base object type */ #define PyType_Check(op) PyObject_TypeCheck(op, &PyType_Type) --- 305,311 ---- ((ob)->ob_type == (tp) || PyType_IsSubtype((ob)->ob_type, (tp))) ! extern DL_IMPORT(PyTypeObject) PyType_Type; /* built-in 'type' */ ! extern DL_IMPORT(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */ ! extern DL_IMPORT(PyTypeObject) PySuper_Type; /* built-in 'super' */ #define PyType_Check(op) PyObject_TypeCheck(op, &PyType_Type) From gvanrossum@users.sourceforge.net Fri Aug 24 17:52:20 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 09:52:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.230,2.231 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv22643 Modified Files: bltinmodule.c Log Message: Add 'super' builtin type. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.230 retrieving revision 2.231 diff -C2 -d -r2.230 -r2.231 *** bltinmodule.c 2001/08/23 21:40:38 2.230 --- bltinmodule.c 2001/08/24 16:52:18 2.231 *************** *** 1939,1942 **** --- 1939,1945 ---- if (PyDict_SetItemString(dict, "str", (PyObject *) &PyString_Type) < 0) return NULL; + if (PyDict_SetItemString(dict, "super", + (PyObject *) &PySuper_Type) < 0) + return NULL; if (PyDict_SetItemString(dict, "tuple", (PyObject *) &PyTuple_Type) < 0) From gvanrossum@users.sourceforge.net Fri Aug 24 17:55:29 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 09:55:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv23288 Modified Files: test_descr.py Log Message: Add test suite for super(). Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test_descr.py 2001/08/24 15:24:24 1.20 --- test_descr.py 2001/08/24 16:55:27 1.21 *************** *** 1093,1096 **** --- 1093,1127 ---- ## verify(not hasattr(a, "x")) + def supers(): + if verify: print "Testing super..." + + class A(object): + def meth(self, a): + return "A(%r)" % a + + verify(A().meth(1) == "A(1)") + + class B(A): + def __init__(self): + self.__super = super(B, self) + def meth(self, a): + return "B(%r)" % a + self.__super.meth(a) + + verify(B().meth(2) == "B(2)A(2)") + + class C(A): + __dynamic__ = 1 + def meth(self, a): + return "C(%r)" % a + self.__super.meth(a) + C._C__super = super(C) + + verify(C().meth(3) == "C(3)A(3)") + + class D(C, B): + def meth(self, a): + return "D(%r)" % a + super(D, self).meth(a) + + verify (D().meth(4) == "D(4)C(4)B(4)A(4)") + def all(): lists() *************** *** 1123,1126 **** --- 1154,1158 ---- weakrefs() getsets() + supers() all() From gvanrossum@users.sourceforge.net Fri Aug 24 18:07:22 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 10:07:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv26269 Modified Files: test_descr.py Log Message: supers(): typo -- "if verify" should be "if verbose". Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** test_descr.py 2001/08/24 16:55:27 1.21 --- test_descr.py 2001/08/24 17:07:20 1.22 *************** *** 1094,1098 **** def supers(): ! if verify: print "Testing super..." class A(object): --- 1094,1098 ---- def supers(): ! if verbose: print "Testing super..." class A(object): From tim_one@users.sourceforge.net Fri Aug 24 18:13:57 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 24 Aug 2001 10:13:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib __future__.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv27956/python/Lib Modified Files: __future__.py Log Message: Repair repr of future-features (wasn't updated to include the new compiler-flag argument). Index: __future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/__future__.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** __future__.py 2001/08/24 06:29:12 1.12 --- __future__.py 2001/08/24 17:13:54 1.13 *************** *** 88,93 **** def __repr__(self): ! return "_Feature(" + `self.getOptionalRelease()` + ", " + \ ! `self.getMandatoryRelease()` + ")" nested_scopes = _Feature((2, 1, 0, "beta", 1), --- 88,94 ---- def __repr__(self): ! return "_Feature" + repr((self.optional, ! self.mandatory, ! self.compiler_flag)) nested_scopes = _Feature((2, 1, 0, "beta", 1), From bwarsaw@users.sourceforge.net Fri Aug 24 19:32:08 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 24 Aug 2001 11:32:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include stringobject.h,2.28,2.29 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv13719/Include Modified Files: stringobject.h Log Message: PyString_FromFormat() and PyString_FromFormatV(): Largely ripped from PyErr_Format() these new C API methods can be used instead of sprintf()'s into hardcoded char* buffers. This allows us to fix many situation where long package, module, or class names get truncated in reprs. PyString_FromFormat() is the varargs variety. PyString_FromFormatV() is the va_list variety Original PyErr_Format() code was modified to allow %p and %ld expansions. Many reprs were converted to this, checkins coming soo. Not changed: complex_repr(), float_repr(), float_print(), float_str(), int_repr(). There may be other candidates not yet converted. Closes patch #454743. Index: stringobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/stringobject.h,v retrieving revision 2.28 retrieving revision 2.29 diff -C2 -d -r2.28 -r2.29 *** stringobject.h 2001/06/16 05:11:17 2.28 --- stringobject.h 2001/08/24 18:32:06 2.29 *************** *** 8,11 **** --- 8,13 ---- #endif + #include + /* Type PyStringObject represents a character string. An extra zero byte is *************** *** 54,57 **** --- 56,61 ---- extern DL_IMPORT(PyObject *) PyString_FromStringAndSize(const char *, int); extern DL_IMPORT(PyObject *) PyString_FromString(const char *); + extern DL_IMPORT(PyObject *) PyString_FromFormatV(const char*, va_list); + extern DL_IMPORT(PyObject *) PyString_FromFormat(const char*, ...); extern DL_IMPORT(int) PyString_Size(PyObject *); extern DL_IMPORT(char *) PyString_AsString(PyObject *); From bwarsaw@users.sourceforge.net Fri Aug 24 19:32:08 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 24 Aug 2001 11:32:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects stringobject.c,2.124,2.125 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13719/Objects Modified Files: stringobject.c Log Message: PyString_FromFormat() and PyString_FromFormatV(): Largely ripped from PyErr_Format() these new C API methods can be used instead of sprintf()'s into hardcoded char* buffers. This allows us to fix many situation where long package, module, or class names get truncated in reprs. PyString_FromFormat() is the varargs variety. PyString_FromFormatV() is the va_list variety Original PyErr_Format() code was modified to allow %p and %ld expansions. Many reprs were converted to this, checkins coming soo. Not changed: complex_repr(), float_repr(), float_print(), float_str(), int_repr(). There may be other candidates not yet converted. Closes patch #454743. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.124 retrieving revision 2.125 diff -C2 -d -r2.124 -r2.125 *** stringobject.c 2001/08/17 18:39:25 2.124 --- stringobject.c 2001/08/24 18:32:06 2.125 *************** *** 148,151 **** --- 148,306 ---- } + PyObject * + PyString_FromFormatV(const char *format, va_list vargs) + { + va_list count = vargs; + int n = 0; + const char* f; + char *s; + PyObject* string; + + /* step 1: figure out how large a buffer we need */ + for (f = format; *f; f++) { + if (*f == '%') { + const char* p = f; + while (*++f && *f != '%' && !isalpha(Py_CHARMASK(*f))) + ; + + /* skip the 'l' in %ld, since it doesn't change the + width. although only %d is supported (see + "expand" section below), others can be easily + add */ + if (*f == 'l' && *(f+1) == 'd') + ++f; + + switch (*f) { + case 'c': + (void)va_arg(count, int); + /* fall through... */ + case '%': + n++; + break; + case 'd': case 'i': case 'x': + (void) va_arg(count, int); + /* 20 bytes should be enough to hold a 64-bit + integer */ + n += 20; + break; + case 's': + s = va_arg(count, char*); + n += strlen(s); + break; + case 'p': + (void) va_arg(count, int); + /* maximum 64-bit pointer representation: + * 0xffffffffffffffff + * so 19 characters is enough. + */ + n += 19; + break; + default: + /* if we stumble upon an unknown + formatting code, copy the rest of + the format string to the output + string. (we cannot just skip the + code, since there's no way to know + what's in the argument list) */ + n += strlen(p); + goto expand; + } + } else + n++; + } + expand: + /* step 2: fill the buffer */ + string = PyString_FromStringAndSize(NULL, n); + if (!string) + return NULL; + + s = PyString_AsString(string); + + for (f = format; *f; f++) { + if (*f == '%') { + const char* p = f++; + int i, longflag = 0; + /* parse the width.precision part (we're only + interested in the precision value, if any) */ + n = 0; + while (isdigit(Py_CHARMASK(*f))) + n = (n*10) + *f++ - '0'; + if (*f == '.') { + f++; + n = 0; + while (isdigit(Py_CHARMASK(*f))) + n = (n*10) + *f++ - '0'; + } + while (*f && *f != '%' && !isalpha(Py_CHARMASK(*f))) + f++; + /* handle the long flag, but only for %ld. others + can be added when necessary. */ + if (*f == 'l' && *(f+1) == 'd') { + longflag = 1; + ++f; + } + + switch (*f) { + case 'c': + *s++ = va_arg(vargs, int); + break; + case 'd': + if (longflag) + sprintf(s, "%ld", va_arg(vargs, long)); + else + sprintf(s, "%d", va_arg(vargs, int)); + s += strlen(s); + break; + case 'i': + sprintf(s, "%i", va_arg(vargs, int)); + s += strlen(s); + break; + case 'x': + sprintf(s, "%x", va_arg(vargs, int)); + s += strlen(s); + break; + case 's': + p = va_arg(vargs, char*); + i = strlen(p); + if (n > 0 && i > n) + i = n; + memcpy(s, p, i); + s += i; + break; + case 'p': + sprintf(s, "%p", va_arg(vargs, void*)); + s += strlen(s); + break; + case '%': + *s++ = '%'; + break; + default: + strcpy(s, p); + s += strlen(s); + goto end; + } + } else + *s++ = *f; + } + + end: + _PyString_Resize(&string, s - PyString_AsString(string)); + return string; + } + + PyObject * + PyString_FromFormat(const char *format, ...) + { + va_list vargs; + + #ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, format); + #else + va_start(vargs); + #endif + return PyString_FromFormatV(format, vargs); + } + + PyObject *PyString_Decode(const char *s, int size, From bwarsaw@users.sourceforge.net Fri Aug 24 19:34:29 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 24 Aug 2001 11:34:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects bufferobject.c,2.14,2.15 cellobject.c,1.3,1.4 classobject.c,2.140,2.141 descrobject.c,2.7,2.8 fileobject.c,2.118,2.119 funcobject.c,2.40,2.41 methodobject.c,2.37,2.38 moduleobject.c,2.35,2.36 object.c,2.139,2.140 rangeobject.c,2.28,2.29 typeobject.c,2.45,2.46 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv14195/Objects Modified Files: bufferobject.c cellobject.c classobject.c descrobject.c fileobject.c funcobject.c methodobject.c moduleobject.c object.c rangeobject.c typeobject.c Log Message: repr's converted to using PyString_FromFormat() instead of sprintf'ing into a hardcoded char* buffer. Closes patch #454743. Index: bufferobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/bufferobject.c,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -d -r2.14 -r2.15 *** bufferobject.c 2001/08/02 04:15:00 2.14 --- bufferobject.c 2001/08/24 18:34:26 2.15 *************** *** 185,202 **** buffer_repr(PyBufferObject *self) { - char buf[300]; char *status = self->b_readonly ? "read-only" : "read-write"; if ( self->b_base == NULL ) ! { ! sprintf(buf, "<%s buffer ptr %p, size %d at %p>", ! status, ! self->b_ptr, ! self->b_size, ! self); ! } else ! { ! sprintf(buf, "<%s buffer for %p, ptr %p, size %d at %p>", status, self->b_base, --- 185,199 ---- buffer_repr(PyBufferObject *self) { char *status = self->b_readonly ? "read-only" : "read-write"; if ( self->b_base == NULL ) ! return PyString_FromFormat("<%s buffer ptr %p, size %d at %p>", ! status, ! self->b_ptr, ! self->b_size, ! self); else ! return PyString_FromFormat( ! "<%s buffer for %p, ptr %p, size %d at %p>", status, self->b_base, *************** *** 204,210 **** self->b_size, self); - } - - return PyString_FromString(buf); } --- 201,204 ---- Index: cellobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/cellobject.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cellobject.c 2001/08/02 04:15:00 1.3 --- cellobject.c 2001/08/24 18:34:26 1.4 *************** *** 63,74 **** cell_repr(PyCellObject *op) { - char buf[256]; - if (op->ob_ref == NULL) ! sprintf(buf, "", op); ! else ! sprintf(buf, "", ! op, op->ob_ref->ob_type->tp_name, op->ob_ref); ! return PyString_FromString(buf); } --- 63,72 ---- cell_repr(PyCellObject *op) { if (op->ob_ref == NULL) ! return PyString_FromFormat("", op); ! ! return PyString_FromFormat("", ! op, op->ob_ref->ob_type->tp_name, ! op->ob_ref); } Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.140 retrieving revision 2.141 diff -C2 -d -r2.140 -r2.141 *** classobject.c 2001/08/17 13:59:27 2.140 --- classobject.c 2001/08/24 18:34:26 2.141 *************** *** 314,318 **** { PyObject *mod = PyDict_GetItemString(op->cl_dict, "__module__"); - char buf[140]; char *name; if (op->cl_name == NULL || !PyString_Check(op->cl_name)) --- 314,317 ---- *************** *** 321,330 **** name = PyString_AsString(op->cl_name); if (mod == NULL || !PyString_Check(mod)) ! sprintf(buf, "", name, op); else ! sprintf(buf, "", ! PyString_AsString(mod), ! name, op); ! return PyString_FromString(buf); } --- 320,328 ---- name = PyString_AsString(op->cl_name); if (mod == NULL || !PyString_Check(mod)) ! return PyString_FromFormat("", name, op); else ! return PyString_FromFormat("", ! PyString_AsString(mod), ! name, op); } *************** *** 777,781 **** func = instance_getattr(inst, reprstr); if (func == NULL) { - char buf[140]; PyObject *classname = inst->in_class->cl_name; PyObject *mod = PyDict_GetItemString( --- 775,778 ---- *************** *** 788,798 **** PyErr_Clear(); if (mod == NULL || !PyString_Check(mod)) ! sprintf(buf, "", ! cname, inst); else ! sprintf(buf, "<%.50s.%.50s instance at %p>", ! PyString_AsString(mod), ! cname, inst); ! return PyString_FromString(buf); } res = PyEval_CallObject(func, (PyObject *)NULL); --- 785,794 ---- PyErr_Clear(); if (mod == NULL || !PyString_Check(mod)) ! return PyString_FromFormat("", ! cname, inst); else ! return PyString_FromFormat("<%s.%s instance at %p>", ! PyString_AsString(mod), ! cname, inst); } res = PyEval_CallObject(func, (PyObject *)NULL); *************** *** 2043,2047 **** instancemethod_repr(PyMethodObject *a) { - char buffer[240]; PyObject *self = a->im_self; PyObject *func = a->im_func; --- 2039,2042 ---- *************** *** 2073,2078 **** } if (self == NULL) ! sprintf(buffer, "", ! sklassname, sfuncname); else { /* XXX Shouldn't use repr() here! */ --- 2068,2073 ---- } if (self == NULL) ! result = PyString_FromFormat("", ! sklassname, sfuncname); else { /* XXX Shouldn't use repr() here! */ *************** *** 2084,2092 **** goto fail; } ! sprintf(buffer, "", ! sklassname, sfuncname, PyString_AS_STRING(selfrepr)); Py_DECREF(selfrepr); } - result = PyString_FromString(buffer); fail: Py_XDECREF(funcname); --- 2079,2087 ---- goto fail; } ! result = PyString_FromFormat("", ! sklassname, sfuncname, ! PyString_AS_STRING(selfrepr)); Py_DECREF(selfrepr); } fail: Py_XDECREF(funcname); Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** descrobject.c 2001/08/24 15:23:20 2.7 --- descrobject.c 2001/08/24 18:34:26 2.8 *************** *** 56,63 **** descr_repr(PyDescrObject *descr, char *format) { ! char buffer[500]; ! ! sprintf(buffer, format, descr_name(descr), descr->d_type->tp_name); ! return PyString_FromString(buffer); } --- 56,61 ---- descr_repr(PyDescrObject *descr, char *format) { ! return PyString_FromFormat(format, descr_name(descr), ! descr->d_type->tp_name); } *************** *** 66,70 **** { return descr_repr((PyDescrObject *)descr, ! ""); } --- 64,68 ---- { return descr_repr((PyDescrObject *)descr, ! ""); } *************** *** 73,77 **** { return descr_repr((PyDescrObject *)descr, ! ""); } --- 71,75 ---- { return descr_repr((PyDescrObject *)descr, ! ""); } *************** *** 80,84 **** { return descr_repr((PyDescrObject *)descr, ! ""); } --- 78,82 ---- { return descr_repr((PyDescrObject *)descr, ! ""); } *************** *** 87,91 **** { return descr_repr((PyDescrObject *)descr, ! ""); } --- 85,89 ---- { return descr_repr((PyDescrObject *)descr, ! ""); } *************** *** 101,106 **** if (!PyObject_IsInstance(obj, (PyObject *)(descr->d_type))) { PyErr_Format(PyExc_TypeError, ! "descriptor '%.200s' for '%.100s' objects " ! "doesn't apply to '%.100s' object", descr_name((PyDescrObject *)descr), descr->d_type->tp_name, --- 99,104 ---- if (!PyObject_IsInstance(obj, (PyObject *)(descr->d_type))) { PyErr_Format(PyExc_TypeError, ! "descriptor '%s' for '%s' objects " ! "doesn't apply to '%s' object", descr_name((PyDescrObject *)descr), descr->d_type->tp_name, Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.118 retrieving revision 2.119 diff -C2 -d -r2.118 -r2.119 *** fileobject.c 2001/08/16 13:15:00 2.118 --- fileobject.c 2001/08/24 18:34:26 2.119 *************** *** 180,190 **** file_repr(PyFileObject *f) { ! char buf[300]; ! sprintf(buf, "<%s file '%.256s', mode '%.10s' at %p>", ! f->f_fp == NULL ? "closed" : "open", ! PyString_AsString(f->f_name), ! PyString_AsString(f->f_mode), ! f); ! return PyString_FromString(buf); } --- 180,188 ---- file_repr(PyFileObject *f) { ! return PyString_FromFormat("<%s file '%s', mode '%s' at %p>", ! f->f_fp == NULL ? "closed" : "open", ! PyString_AsString(f->f_name), ! PyString_AsString(f->f_mode), ! f); } Index: funcobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/funcobject.c,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -d -r2.40 -r2.41 *** funcobject.c 2001/08/14 18:23:58 2.40 --- funcobject.c 2001/08/24 18:34:26 2.41 *************** *** 240,251 **** func_repr(PyFunctionObject *op) { - char buf[140]; if (op->func_name == Py_None) ! sprintf(buf, "", op); ! else ! sprintf(buf, "", ! PyString_AsString(op->func_name), ! op); ! return PyString_FromString(buf); } --- 240,248 ---- func_repr(PyFunctionObject *op) { if (op->func_name == Py_None) ! return PyString_FromFormat("", op); ! return PyString_FromFormat("", ! PyString_AsString(op->func_name), ! op); } Index: methodobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/methodobject.c,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -d -r2.37 -r2.38 *** methodobject.c 2001/08/16 13:15:00 2.37 --- methodobject.c 2001/08/24 18:34:26 2.38 *************** *** 173,185 **** meth_repr(PyCFunctionObject *m) { - char buf[200]; if (m->m_self == NULL) ! sprintf(buf, "", m->m_ml->ml_name); ! else ! sprintf(buf, ! "", ! m->m_ml->ml_name, m->m_self->ob_type->tp_name, ! m->m_self); ! return PyString_FromString(buf); } --- 173,183 ---- meth_repr(PyCFunctionObject *m) { if (m->m_self == NULL) ! return PyString_FromFormat("", ! m->m_ml->ml_name); ! return PyString_FromFormat("", ! m->m_ml->ml_name, ! m->m_self->ob_type->tp_name, ! m->m_self); } Index: moduleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/moduleobject.c,v retrieving revision 2.35 retrieving revision 2.36 diff -C2 -d -r2.35 -r2.36 *** moduleobject.c 2001/08/16 20:39:24 2.35 --- moduleobject.c 2001/08/24 18:34:26 2.36 *************** *** 158,168 **** module_repr(PyModuleObject *m) { - static int template1len = sizeof("") + 1; - static int template2len = sizeof("") + 1; - - char *buf; char *name; char *filename; - PyObject *rtn; name = PyModule_GetName((PyObject *)m); --- 158,163 ---- *************** *** 174,190 **** if (filename == NULL) { PyErr_Clear(); ! buf = PyObject_MALLOC( ! sizeof(char) * (strlen(name) + template1len)); ! sprintf(buf, "", name); ! } ! else { ! buf = PyObject_MALLOC( ! sizeof(char) * (strlen(name) + strlen(filename) + ! template2len)); ! sprintf(buf, "", name, filename); } ! rtn = PyString_FromString(buf); ! PyObject_FREE(buf); ! return rtn; } --- 169,175 ---- if (filename == NULL) { PyErr_Clear(); ! return PyString_FromFormat("", name); } ! return PyString_FromFormat("", name, filename); } Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.139 retrieving revision 2.140 diff -C2 -d -r2.139 -r2.140 *** object.c 2001/08/17 18:39:25 2.139 --- object.c 2001/08/24 18:34:26 2.140 *************** *** 223,226 **** --- 223,227 ---- #endif /* WITH_CYCLE_GC */ + PyObject * PyObject_Repr(PyObject *v) *************** *** 236,245 **** if (v == NULL) return PyString_FromString(""); ! else if (v->ob_type->tp_repr == NULL) { ! char buf[120]; ! sprintf(buf, "<%.80s object at %p>", ! v->ob_type->tp_name, v); ! return PyString_FromString(buf); ! } else { PyObject *res; --- 237,243 ---- if (v == NULL) return PyString_FromString(""); ! else if (v->ob_type->tp_repr == NULL) ! return PyString_FromFormat("<%s object at %p", ! v->ob_type->tp_name, v); else { PyObject *res; Index: rangeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/rangeobject.c,v retrieving revision 2.28 retrieving revision 2.29 diff -C2 -d -r2.28 -r2.29 *** rangeobject.c 2001/08/16 13:15:00 2.28 --- rangeobject.c 2001/08/24 18:34:26 2.29 *************** *** 127,154 **** range_repr(rangeobject *r) { ! /* buffers must be big enough to hold 3 longs + an int + ! * a bit of "(xrange(...) * ...)" text. ! */ ! char buf1[250]; ! char buf2[250]; ! if (r->start == 0 && r->step == 1) ! sprintf(buf1, "xrange(%ld)", r->start + r->len * r->step); else if (r->step == 1) ! sprintf(buf1, "xrange(%ld, %ld)", ! r->start, ! r->start + r->len * r->step); else ! sprintf(buf1, "xrange(%ld, %ld, %ld)", ! r->start, ! r->start + r->len * r->step, ! r->step); ! ! if (r->reps != 1) ! sprintf(buf2, "(%s * %d)", buf1, r->reps); ! ! return PyString_FromString(r->reps == 1 ? buf1 : buf2); } --- 127,154 ---- range_repr(rangeobject *r) { ! PyObject *rtn; ! if (r->start == 0 && r->step == 1) ! rtn = PyString_FromFormat("xrange(%ld)", ! r->start + r->len * r->step); else if (r->step == 1) ! rtn = PyString_FromFormat("xrange(%ld, %ld)", ! r->start, ! r->start + r->len * r->step); else ! rtn = PyString_FromFormat("xrange(%ld, %ld, %ld)", ! r->start, ! r->start + r->len * r->step, ! r->step); ! if (r->reps != 1) { ! PyObject *extra = PyString_FromFormat( ! "(%s * %d)", ! PyString_AS_STRING(rtn), r->reps); ! Py_DECREF(rtn); ! rtn = extra; ! } ! return rtn; } Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.45 retrieving revision 2.46 diff -C2 -d -r2.45 -r2.46 *** typeobject.c 2001/08/24 16:47:00 2.45 --- typeobject.c 2001/08/24 18:34:26 2.46 *************** *** 114,119 **** type_repr(PyTypeObject *type) { ! PyObject *mod, *name; ! char buf[200]; mod = type_module(type, NULL); --- 114,118 ---- type_repr(PyTypeObject *type) { ! PyObject *mod, *name, *rtn; mod = type_module(type, NULL); *************** *** 127,139 **** if (name == NULL) return NULL; ! if (mod != NULL && strcmp(PyString_AS_STRING(mod), "__builtin__")) ! sprintf(buf, "", ! PyString_AS_STRING(mod), ! PyString_AS_STRING(name)); else ! sprintf(buf, "", type->tp_name); Py_XDECREF(mod); Py_DECREF(name); ! return PyString_FromString(buf); } --- 126,141 ---- if (name == NULL) return NULL; ! ! if (mod != NULL && strcmp(PyString_AS_STRING(mod), "__builtin__")) { ! rtn = PyString_FromFormat("", ! PyString_AS_STRING(mod), ! PyString_AS_STRING(name)); ! } else ! rtn = PyString_FromFormat("", type->tp_name); ! Py_XDECREF(mod); Py_DECREF(name); ! return rtn; } *************** *** 969,974 **** { PyTypeObject *type; ! PyObject *mod, *name; ! char buf[200]; type = self->ob_type; --- 971,975 ---- { PyTypeObject *type; ! PyObject *mod, *name, *rtn; type = self->ob_type; *************** *** 984,996 **** return NULL; if (mod != NULL && strcmp(PyString_AS_STRING(mod), "__builtin__")) ! sprintf(buf, "<%.80s.%.80s instance at %p>", ! PyString_AS_STRING(mod), ! PyString_AS_STRING(name), ! self); else ! sprintf(buf, "<%.80s instance at %p>", type->tp_name, self); Py_XDECREF(mod); Py_DECREF(name); ! return PyString_FromString(buf); } --- 985,998 ---- return NULL; if (mod != NULL && strcmp(PyString_AS_STRING(mod), "__builtin__")) ! rtn = PyString_FromFormat("<%s.%s instance at %p>", ! PyString_AS_STRING(mod), ! PyString_AS_STRING(name), ! self); else ! rtn = PyString_FromFormat("<%s instance at %p>", ! type->tp_name, self); Py_XDECREF(mod); Py_DECREF(name); ! return rtn; } *************** *** 2591,2601 **** return res; } ! else { ! char buf[120]; ! PyErr_Clear(); ! sprintf(buf, "<%.80s object at %p>", ! self->ob_type->tp_name, self); ! return PyString_FromString(buf); ! } } --- 2593,2599 ---- return res; } ! PyErr_Clear(); ! return PyString_FromFormat("<%s object at %p>", ! self->ob_type->tp_name, self); } From bwarsaw@users.sourceforge.net Fri Aug 24 19:35:25 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 24 Aug 2001 11:35:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python errors.c,2.63,2.64 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv14469/Python Modified Files: errors.c Log Message: PyErr_Format(): Factor out most of this code into PyString_FromFormat() since it's much more generally useful than just for exceptions. Index: errors.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v retrieving revision 2.63 retrieving revision 2.64 diff -C2 -d -r2.63 -r2.64 *** errors.c 2001/05/30 06:09:50 2.63 --- errors.c 2001/08/24 18:35:23 2.64 *************** *** 386,445 **** { va_list vargs; - int n, i; - const char* f; - char* s; PyObject* string; - /* step 1: figure out how large a buffer we need */ - - #ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, format); - #else - va_start(vargs); - #endif - - n = 0; - for (f = format; *f; f++) { - if (*f == '%') { - const char* p = f; - while (*++f && *f != '%' && !isalpha(Py_CHARMASK(*f))) - ; - switch (*f) { - case 'c': - (void) va_arg(vargs, int); - /* fall through... */ - case '%': - n++; - break; - case 'd': case 'i': case 'x': - (void) va_arg(vargs, int); - /* 20 bytes should be enough to hold a 64-bit - integer */ - n = n + 20; - break; - case 's': - s = va_arg(vargs, char*); - n = n + strlen(s); - break; - default: - /* if we stumble upon an unknown - formatting code, copy the rest of - the format string to the output - string. (we cannot just skip the - code, since there's no way to know - what's in the argument list) */ - n = n + strlen(p); - goto expand; - } - } else - n = n + 1; - } - - expand: - - string = PyString_FromStringAndSize(NULL, n); - if (!string) - return NULL; - #ifdef HAVE_STDARG_PROTOTYPES va_start(vargs, format); --- 386,391 ---- *************** *** 447,511 **** va_start(vargs); #endif - - /* step 2: fill the buffer */ - - s = PyString_AsString(string); ! for (f = format; *f; f++) { ! if (*f == '%') { ! const char* p = f++; ! /* parse the width.precision part (we're only ! interested in the precision value, if any) */ ! n = 0; ! while (isdigit(Py_CHARMASK(*f))) ! n = (n*10) + *f++ - '0'; ! if (*f == '.') { ! f++; ! n = 0; ! while (isdigit(Py_CHARMASK(*f))) ! n = (n*10) + *f++ - '0'; ! } ! while (*f && *f != '%' && !isalpha(Py_CHARMASK(*f))) ! f++; ! switch (*f) { ! case 'c': ! *s++ = va_arg(vargs, int); ! break; ! case 'd': ! sprintf(s, "%d", va_arg(vargs, int)); ! s = s + strlen(s); ! break; ! case 'i': ! sprintf(s, "%i", va_arg(vargs, int)); ! s = s + strlen(s); ! break; ! case 'x': ! sprintf(s, "%x", va_arg(vargs, int)); ! s = s + strlen(s); ! break; ! case 's': ! p = va_arg(vargs, char*); ! i = strlen(p); ! if (n > 0 && i > n) ! i = n; ! memcpy(s, p, i); ! s = s + i; ! break; ! case '%': ! *s++ = '%'; ! break; ! default: ! strcpy(s, p); ! s = s + strlen(s); ! goto end; ! } ! } else ! *s++ = *f; ! } ! ! end: ! ! _PyString_Resize(&string, s - PyString_AsString(string)); ! PyErr_SetObject(exception, string); Py_XDECREF(string); --- 393,398 ---- va_start(vargs); #endif ! string = PyString_FromFormatV(format, vargs); PyErr_SetObject(exception, string); Py_XDECREF(string); From bwarsaw@users.sourceforge.net Fri Aug 24 19:37:35 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 24 Aug 2001 11:37:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_repr.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14875/Lib/test Modified Files: test_repr.py Log Message: Added lots of tests for reprs of "simple" objects, such as file, lambda (anonymous functions?), function, xrange, buffer, cell (need to fill in), and (some) descriptor types. Also added a new test case for testing repr truncation fixes. Index: test_repr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_repr.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_repr.py 2001/08/09 21:40:30 1.2 --- test_repr.py 2001/08/24 18:37:32 1.3 *************** *** 4,8 **** --- 4,11 ---- """ + import sys + import os import unittest + from test_support import run_unittest from repr import repr as r # Don't shadow builtin repr *************** *** 76,79 **** --- 79,114 ---- eq(r(i3), (""%id(i3))) + def test_file(self): + fp = open(unittest.__file__) + self.failUnless(repr(fp).startswith( + " at 0x")) + # XXX anonymous functions? see func_repr + + def test_builtin_function(self): + eq = self.assertEquals + # Functions + eq(repr(hash), '') + # Methods + self.failUnless(repr(''.split).startswith( + '") + # XXX member descriptors + # XXX attribute descriptors + # XXX slot descriptors + # static and class methods + class C: + def foo(cls): pass + x = staticmethod(C.foo) + self.failUnless(repr(x).startswith('" % areallylongpackageandmodulenametotestreprtruncation.__file__) + + def test_type(self): + eq = self.assertEquals + touch(os.path.join(self.subpkgname, 'foo.py'), '''\ + class foo(object): + pass + ''') + from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import foo + eq(repr(foo.foo), + "") + + def test_object(self): + # XXX Test the repr of a type with a really long tp_name but with no + # tp_repr. WIBNI we had ::Inline? :) + pass + + def test_class(self): + touch(os.path.join(self.subpkgname, 'bar.py'), '''\ + class bar: + pass + ''') + from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar + self.failUnless(repr(bar.bar).startswith( + "') + # Bound method next + iqux = qux.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() + self.failUnless(repr(iqux.amethod).startswith( + ' Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv15032/Lib/test Modified Files: test_import.py Log Message: Rip the import repr truncation test out of here and put it in test_repr.py Index: test_import.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_import.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_import.py 2001/08/16 20:42:38 1.8 --- test_import.py 2001/08/24 18:38:02 1.9 *************** *** 70,106 **** finally: del sys.path[0] - - def touch(path): - fp = open(path, 'w') - fp.close() - - # test imports of packages with really long names, but specifically that their - # reprs include the full name - try: - longname = 'areallylongpackageandmodulenametotestreprtruncation' - os.mkdir(longname) - touch(os.path.join(longname, '__init__.py')) - os.mkdir(os.path.join(longname, longname)) - touch(os.path.join(longname, longname, '__init__.py')) - touch(os.path.join(longname, longname, longname + '.py')) - sys.path.insert(0, os.getcwd()) - from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation - if `areallylongpackageandmodulenametotestreprtruncation` <> \ - "" % areallylongpackageandmodulenametotestreprtruncation.__file__: - raise TestFailed, 'module name truncation' - finally: - # Delete recursively - del sys.path[0] - def zap(actions, dirname, names): - for name in names: - actions.append(os.path.join(dirname, name)) - actions = [] - os.path.walk(longname, zap, actions) - actions.append(longname) - actions.sort() - actions.reverse() - for p in actions: - if os.path.isdir(p): - os.rmdir(p) - else: - os.remove(p) --- 70,71 ---- From gvanrossum@users.sourceforge.net Fri Aug 24 19:48:29 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 11:48:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects classobject.c,2.141,2.142 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv16986 Modified Files: classobject.c Log Message: Improve the error message issued when an unbound method is called with an inappropriate first argument. Now that there are more ways for this to fail, make sure to report the name of the class of the expected instance and of the actual instance. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.141 retrieving revision 2.142 diff -C2 -d -r2.141 -r2.142 *** classobject.c 2001/08/24 18:34:26 2.141 --- classobject.c 2001/08/24 18:48:27 2.142 *************** *** 2128,2131 **** --- 2128,2173 ---- } + static char * + getclassname(PyObject *class) + { + PyObject *name; + + if (class == NULL) + name = NULL; + else + name = PyObject_GetAttrString(class, "__name__"); + if (name == NULL) { + PyErr_Clear(); + return "?"; + } + if (!PyString_Check(name)) { + Py_DECREF(name); + return "?"; + } + PyString_InternInPlace(&name); + Py_DECREF(name); + return PyString_AS_STRING(name); + } + + static char * + getinstclassname(PyObject *inst) + { + PyObject *class; + char *name; + + if (inst == NULL) + return "nothing"; + + class = PyObject_GetAttrString(inst, "__class__"); + if (class == NULL) { + PyErr_Clear(); + class = (PyObject *)(inst->ob_type); + Py_INCREF(class); + } + name = getclassname(class); + Py_XDECREF(class); + return name; + } + static PyObject * instancemethod_call(PyObject *func, PyObject *arg, PyObject *kw) *************** *** 2151,2158 **** if (!ok) { PyErr_Format(PyExc_TypeError, ! "unbound method %s%s must be " ! "called with instance as first argument", PyEval_GetFuncName(func), ! PyEval_GetFuncDesc(func)); return NULL; } --- 2193,2204 ---- if (!ok) { PyErr_Format(PyExc_TypeError, ! "unbound method %s%s must be called with " ! "%s instance as first argument " ! "(got %s%s instead)", PyEval_GetFuncName(func), ! PyEval_GetFuncDesc(func), ! getclassname(class), ! getinstclassname(self), ! self == NULL ? "" : " instance"); return NULL; } From gvanrossum@users.sourceforge.net Fri Aug 24 19:49:12 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 11:49:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects descrobject.c,2.8,2.9 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv17233 Modified Files: descrobject.c Log Message: getset_init(): the function name in the PyArg_ParseTuple() format should just be "getset", not "getset.__init__". Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** descrobject.c 2001/08/24 18:34:26 2.8 --- descrobject.c 2001/08/24 18:49:10 2.9 *************** *** 930,934 **** getsetobject *gs = (getsetobject *)self; ! if (!PyArg_ParseTuple(args, "|OOO:getset.__init__", &get, &set, &del)) return -1; if (get == Py_None) --- 930,934 ---- getsetobject *gs = (getsetobject *)self; ! if (!PyArg_ParseTuple(args, "|OOO:getset", &get, &set, &del)) return -1; if (get == Py_None) From gvanrossum@users.sourceforge.net Fri Aug 24 19:52:52 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 11:52:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_binop.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18109 Modified Files: test_binop.py Log Message: Remove the local 'getset' class -- this is now a built-in type with the same signature. Index: test_binop.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_binop.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_binop.py 2001/08/17 23:04:59 1.2 --- test_binop.py 2001/08/24 18:52:50 1.3 *************** *** 4,25 **** import unittest - class getset(object): - - """Define a get/set attribute descriptor. - - This will eventually become a built-in.""" - - def __init__(self, get, set=None): - self.__get = get - self.__set = set - - def __get__(self, inst, type=None): - return self.__get(inst) - - def __set__(self, inst, value): - if self.__set is None: - raise AttributeError, "this attribute is read-only" - return self.__set(inst, value) - def gcd(a, b): """Greatest common divisor using Euclid's algorithm.""" --- 4,7 ---- From bwarsaw@users.sourceforge.net Fri Aug 24 20:11:59 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 24 Aug 2001 12:11:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_extcall.py,1.16,1.17 test_gettext.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22166/Lib/test Modified Files: test_extcall.py test_gettext.py Log Message: Quick and dirty fix for test_extcall failures trigged by Guido's recent classobject.c change. When calling an unbound method with no instances as first argument, the error message has changed. The message now contains the class name, but the output text being compared to is too generic, so skip printing it. Index: test_extcall.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_extcall.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_extcall.py 2001/05/13 00:19:31 1.16 --- test_extcall.py 2001/08/24 19:11:57 1.17 *************** *** 192,200 **** print Foo.method(*(1, 2, 3)) except TypeError, err: ! print err try: print Foo.method(1, *(2, 3)) except TypeError, err: ! print err # A PyCFunction that takes only positional parameters should allow an --- 192,204 ---- print Foo.method(*(1, 2, 3)) except TypeError, err: ! pass ! else: ! print 'expected a TypeError for unbound method call' try: print Foo.method(1, *(2, 3)) except TypeError, err: ! pass ! else: ! print 'expected a TypeError for unbound method call' # A PyCFunction that takes only positional parameters should allow an Index: test_gettext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gettext.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_gettext.py 2000/10/23 17:22:07 1.7 --- test_gettext.py 2001/08/24 19:11:57 1.8 *************** *** 153,158 **** ''' # Dummy translation for Python's test_gettext.py module. ! # Copyright (C) 2000 BeOpen.com ! # Barry Warsaw , 2000. # msgid "" --- 153,158 ---- ''' # Dummy translation for Python's test_gettext.py module. ! # Copyright (C) 2001 Python Software Foundation ! # Barry Warsaw , 2000. # msgid "" From gvanrossum@users.sourceforge.net Fri Aug 24 20:31:45 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 12:31:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_extcall,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv26171 Modified Files: test_extcall Log Message: Update test output to match new (more informative) error message about calling unbound method with wrong first argument. Index: test_extcall =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_extcall,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_extcall 2001/08/16 08:32:39 1.10 --- test_extcall 2001/08/24 19:31:43 1.11 *************** *** 35,40 **** 3 3 ! unbound method method() must be called with instance as first argument ! unbound method method() must be called with instance as first argument za () {} -> za() takes exactly 1 argument (0 given) za () {'a': 'aa'} -> ok za aa B D E V a --- 35,40 ---- 3 3 ! unbound method method() must be called with Foo instance as first argument (got int instance instead) ! unbound method method() must be called with Foo instance as first argument (got int instance instead) za () {} -> za() takes exactly 1 argument (0 given) za () {'a': 'aa'} -> ok za aa B D E V a From gvanrossum@users.sourceforge.net Fri Aug 24 20:46:23 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 24 Aug 2001 12:46:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_extcall,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv29640/Lib/test/output Modified Files: test_extcall Log Message: Undo previous checkin -- Barry fixed it better. Index: test_extcall =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_extcall,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_extcall 2001/08/24 19:31:43 1.11 --- test_extcall 2001/08/24 19:46:21 1.12 *************** *** 35,40 **** 3 3 - unbound method method() must be called with Foo instance as first argument (got int instance instead) - unbound method method() must be called with Foo instance as first argument (got int instance instead) za () {} -> za() takes exactly 1 argument (0 given) za () {'a': 'aa'} -> ok za aa B D E V a --- 35,38 ---- From tim_one@users.sourceforge.net Sat Aug 25 04:02:30 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 24 Aug 2001 20:02:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects stringobject.c,2.125,2.126 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv18713/python/Objects Modified Files: stringobject.c Log Message: PyString_FromFormatV: Massage platform %p output to match what gcc does, at least in the first two characters. %p is ill-defined, and people will forever commit bad tests otherwise ("bad" in the sense that they fall over (at least on Windows) for lack of a leading '0x'; 5 of the 7 tests in test_repr.py failed on Windows for that reason this time around). Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.125 retrieving revision 2.126 diff -C2 -d -r2.125 -r2.126 *** stringobject.c 2001/08/24 18:32:06 2.125 --- stringobject.c 2001/08/25 03:02:28 2.126 *************** *** 270,273 **** --- 270,281 ---- case 'p': sprintf(s, "%p", va_arg(vargs, void*)); + /* %p is ill-defined: ensure leading 0x. */ + if (s[1] == 'X') + s[1] = 'x'; + else if (s[1] != 'x') { + memmove(s+2, s, strlen(s)+1); + s[0] = '0'; + s[1] = 'x'; + } s += strlen(s); break; From jackjansen@users.sourceforge.net Sat Aug 25 12:49:16 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:49:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Icn.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15068/Python/Mac/Lib/lib-compat Modified Files: Icn.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Icn.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Icn.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Icn.py 2001/08/19 22:28:17 1.1 --- Icn.py 2001/08/25 11:49:14 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Icn import * From jackjansen@users.sourceforge.net Sat Aug 25 12:49:24 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:49:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Icons.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15094/Python/Mac/Lib/lib-compat Modified Files: Icons.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Icons.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Icons.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Icons.py 2001/08/19 22:27:05 1.1 --- Icons.py 2001/08/25 11:49:22 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Icons import * From jackjansen@users.sourceforge.net Sat Aug 25 12:49:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:49:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat List.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15118/Python/Mac/Lib/lib-compat Modified Files: List.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: List.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/List.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** List.py 2001/08/20 15:35:39 1.1 --- List.py 2001/08/25 11:49:26 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.List import * From jackjansen@users.sourceforge.net Sat Aug 25 12:49:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:49:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Lists.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15139/Python/Mac/Lib/lib-compat Modified Files: Lists.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Lists.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Lists.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Lists.py 2001/08/19 22:27:10 1.1 --- Lists.py 2001/08/25 11:49:31 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Lists import * From jackjansen@users.sourceforge.net Sat Aug 25 12:49:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:49:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat MacTextEditor.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15163/Python/Mac/Lib/lib-compat Modified Files: MacTextEditor.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: MacTextEditor.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/MacTextEditor.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MacTextEditor.py 2001/08/19 22:25:24 1.1 --- MacTextEditor.py 2001/08/25 11:49:35 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.MacTextEditor import * From jackjansen@users.sourceforge.net Sat Aug 25 12:49:42 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:49:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat MediaDescr.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15191/Python/Mac/Lib/lib-compat Modified Files: MediaDescr.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: MediaDescr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/MediaDescr.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MediaDescr.py 2001/08/19 22:25:30 1.1 --- MediaDescr.py 2001/08/25 11:49:40 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.MediaDescr import * From jackjansen@users.sourceforge.net Sat Aug 25 12:49:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:49:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Menu.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15239/Python/Mac/Lib/lib-compat Modified Files: Menu.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Menu.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Menu.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Menu.py 2001/08/19 22:28:23 1.1 --- Menu.py 2001/08/25 11:49:55 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Menu import * From jackjansen@users.sourceforge.net Sat Aug 25 12:50:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:50:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Qdoffs.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15375/Python/Mac/Lib/lib-compat Modified Files: Qdoffs.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Qdoffs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Qdoffs.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Qdoffs.py 2001/08/20 15:35:34 1.1 --- Qdoffs.py 2001/08/25 11:50:16 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Qdoffs import * From jackjansen@users.sourceforge.net Sat Aug 25 12:50:33 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:50:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Qt.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15430/Python/Mac/Lib/lib-compat Modified Files: Qt.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Qt.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Qt.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Qt.py 2001/08/19 22:28:32 1.1 --- Qt.py 2001/08/25 11:50:31 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Qt import * From jackjansen@users.sourceforge.net Sat Aug 25 12:50:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:50:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Res.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15507/Python/Mac/Lib/lib-compat Modified Files: Res.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Res.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Res.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Res.py 2001/08/20 15:35:57 1.1 --- Res.py 2001/08/25 11:50:56 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Res import * From jackjansen@users.sourceforge.net Sat Aug 25 12:51:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:51:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Scrap.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15565/Python/Mac/Lib/lib-compat Modified Files: Scrap.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Scrap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Scrap.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Scrap.py 2001/08/20 15:35:30 1.1 --- Scrap.py 2001/08/25 11:51:05 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Scrap import * From jackjansen@users.sourceforge.net Sat Aug 25 12:51:27 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:51:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Sound.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15644/Python/Mac/Lib/lib-compat Modified Files: Sound.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Sound.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Sound.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Sound.py 2001/08/19 22:26:00 1.1 --- Sound.py 2001/08/25 11:51:25 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Sound import * From jackjansen@users.sourceforge.net Sat Aug 25 12:51:44 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:51:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Win.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15739/Python/Mac/Lib/lib-compat Modified Files: Win.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Win.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Win.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Win.py 2001/08/19 22:27:31 1.1 --- Win.py 2001/08/25 11:51:42 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Win import * From jackjansen@users.sourceforge.net Sat Aug 25 12:51:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:51:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Windows.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15779/Python/Mac/Lib/lib-compat Modified Files: Windows.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Windows.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Windows.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Windows.py 2001/08/19 22:25:19 1.1 --- Windows.py 2001/08/25 11:51:49 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Windows import * From jackjansen@users.sourceforge.net Sat Aug 25 12:51:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:51:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat App.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15824/Python/Mac/Lib/lib-compat Modified Files: App.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: App.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/App.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** App.py 2001/08/19 22:27:41 1.1 --- App.py 2001/08/25 11:51:53 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.App import * From jackjansen@users.sourceforge.net Sat Aug 25 12:50:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:50:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Menus.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15290/Python/Mac/Lib/lib-compat Modified Files: Menus.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Menus.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Menus.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Menus.py 2001/08/19 22:25:35 1.1 --- Menus.py 2001/08/25 11:50:02 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Menus import * From jackjansen@users.sourceforge.net Sat Aug 25 12:50:09 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:50:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Mlte.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15326/Python/Mac/Lib/lib-compat Modified Files: Mlte.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Mlte.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Mlte.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mlte.py 2001/08/19 22:28:28 1.1 --- Mlte.py 2001/08/25 11:50:07 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Mlte import * From jackjansen@users.sourceforge.net Sat Aug 25 12:50:14 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:50:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Qd.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15350/Python/Mac/Lib/lib-compat Modified Files: Qd.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Qd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Qd.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Qd.py 2001/08/20 15:35:52 1.1 --- Qd.py 2001/08/25 11:50:12 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Qd import * From jackjansen@users.sourceforge.net Sat Aug 25 12:50:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:50:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat QDOffscreen.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15410/Python/Mac/Lib/lib-compat Modified Files: QDOffscreen.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: QDOffscreen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/QDOffscreen.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QDOffscreen.py 2001/08/19 22:25:40 1.1 --- QDOffscreen.py 2001/08/25 11:50:23 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.QDOffscreen import * From jackjansen@users.sourceforge.net Sat Aug 25 12:50:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:50:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat QuickDraw.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15458/Python/Mac/Lib/lib-compat Modified Files: QuickDraw.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: QuickDraw.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/QuickDraw.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QuickDraw.py 2001/08/19 22:25:44 1.1 --- QuickDraw.py 2001/08/25 11:50:36 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.QuickDraw import * From jackjansen@users.sourceforge.net Sat Aug 25 12:50:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:50:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat QuickTime.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15476/Python/Mac/Lib/lib-compat Modified Files: QuickTime.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: QuickTime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/QuickTime.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QuickTime.py 2001/08/19 22:25:48 1.1 --- QuickTime.py 2001/08/25 11:50:41 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.QuickTime import * From jackjansen@users.sourceforge.net Sat Aug 25 12:51:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:51:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Resources.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15525/Python/Mac/Lib/lib-compat Modified Files: Resources.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Resources.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Resources.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Resources.py 2001/08/19 22:25:53 1.1 --- Resources.py 2001/08/25 11:51:01 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Resources import * From jackjansen@users.sourceforge.net Sat Aug 25 12:51:15 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:51:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Snd.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15599/Python/Mac/Lib/lib-compat Modified Files: Snd.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Snd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Snd.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Snd.py 2001/08/19 22:27:18 1.1 --- Snd.py 2001/08/25 11:51:13 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Snd import * From jackjansen@users.sourceforge.net Sat Aug 25 12:51:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:51:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Sndihooks.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15617/Python/Mac/Lib/lib-compat Modified Files: Sndihooks.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Sndihooks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Sndihooks.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Sndihooks.py 2001/08/20 15:35:25 1.1 --- Sndihooks.py 2001/08/25 11:51:18 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Sndihooks import * From jackjansen@users.sourceforge.net Sat Aug 25 12:51:32 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:51:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat TE.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15690/Python/Mac/Lib/lib-compat Modified Files: TE.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: TE.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/TE.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TE.py 2001/08/19 22:27:22 1.1 --- TE.py 2001/08/25 11:51:30 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.TE import * From jackjansen@users.sourceforge.net Sat Aug 25 12:51:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:51:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat TextEdit.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15714/Python/Mac/Lib/lib-compat Modified Files: TextEdit.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: TextEdit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/TextEdit.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TextEdit.py 2001/08/19 22:26:08 1.1 --- TextEdit.py 2001/08/25 11:51:34 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.TextEdit import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Cm.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16020/Python/Mac/Lib/lib-compat Modified Files: Cm.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Cm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Cm.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Cm.py 2001/08/19 22:27:50 1.1 --- Cm.py 2001/08/25 11:52:16 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Cm import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Dlg.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16181/Python/Mac/Lib/lib-compat Modified Files: Dlg.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Dlg.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Dlg.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Dlg.py 2001/08/19 22:28:00 1.1 --- Dlg.py 2001/08/25 11:52:48 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Dlg import * From jackjansen@users.sourceforge.net Sat Aug 25 12:53:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:53:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Evt.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16281/Python/Mac/Lib/lib-compat Modified Files: Evt.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Evt.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Evt.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Evt.py 2001/08/20 15:35:48 1.1 --- Evt.py 2001/08/25 11:53:08 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Evt import * From jackjansen@users.sourceforge.net Sat Aug 25 12:53:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:53:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Help.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16325/Python/Mac/Lib/lib-compat Modified Files: Help.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Help.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Help.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Help.py 2001/08/19 22:28:12 1.1 --- Help.py 2001/08/25 11:53:19 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Help import * From jackjansen@users.sourceforge.net Sat Aug 25 12:53:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:53:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat AE.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16381/Python/Mac/Lib/lib-compat Modified Files: AE.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: AE.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/AE.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AE.py 2001/08/19 22:27:36 1.1 --- AE.py 2001/08/25 11:53:43 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.AE import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Appearance.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15854/Python/Mac/Lib/lib-compat Modified Files: Appearance.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Appearance.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Appearance.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Appearance.py 2001/08/19 22:26:14 1.1 --- Appearance.py 2001/08/25 11:51:58 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Appearance import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat AppleEvents.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15912/Python/Mac/Lib/lib-compat Modified Files: AppleEvents.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: AppleEvents.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/AppleEvents.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AppleEvents.py 2001/08/19 22:26:18 1.1 --- AppleEvents.py 2001/08/25 11:52:03 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.AppleEvents import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Balloons.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15954/Python/Mac/Lib/lib-compat Modified Files: Balloons.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Balloons.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Balloons.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Balloons.py 2001/08/19 22:26:23 1.1 --- Balloons.py 2001/08/25 11:52:08 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Balloons import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:14 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat CF.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv15989/Python/Mac/Lib/lib-compat Modified Files: CF.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: CF.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/CF.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CF.py 2001/08/19 22:27:45 1.1 --- CF.py 2001/08/25 11:52:12 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.CF import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:23 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Components.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16053/Python/Mac/Lib/lib-compat Modified Files: Components.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Components.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Components.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Components.py 2001/08/19 22:26:29 1.1 --- Components.py 2001/08/25 11:52:21 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Components import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat ControlAccessor.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16094/Python/Mac/Lib/lib-compat Modified Files: ControlAccessor.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: ControlAccessor.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/ControlAccessor.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ControlAccessor.py 2001/08/19 22:26:34 1.1 --- ControlAccessor.py 2001/08/25 11:52:28 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.ControlAccessor import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Controls.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16123/Python/Mac/Lib/lib-compat Modified Files: Controls.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Controls.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Controls.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Controls.py 2001/08/19 22:26:39 1.1 --- Controls.py 2001/08/25 11:52:33 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Controls import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:39 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Ctl.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16136/Python/Mac/Lib/lib-compat Modified Files: Ctl.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Ctl.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Ctl.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Ctl.py 2001/08/19 22:27:55 1.1 --- Ctl.py 2001/08/25 11:52:37 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Ctl import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Dialogs.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16156/Python/Mac/Lib/lib-compat Modified Files: Dialogs.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Dialogs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Dialogs.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Dialogs.py 2001/08/19 22:26:43 1.1 --- Dialogs.py 2001/08/25 11:52:41 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Dialogs import * From jackjansen@users.sourceforge.net Sat Aug 25 12:52:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:52:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Drag.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16199/Python/Mac/Lib/lib-compat Modified Files: Drag.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Drag.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Drag.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Drag.py 2001/08/19 22:28:04 1.1 --- Drag.py 2001/08/25 11:52:53 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Drag import * From jackjansen@users.sourceforge.net Sat Aug 25 12:53:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:53:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Dragconst.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16220/Python/Mac/Lib/lib-compat Modified Files: Dragconst.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Dragconst.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Dragconst.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Dragconst.py 2001/08/19 22:26:48 1.1 --- Dragconst.py 2001/08/25 11:52:57 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Dragconst import * From jackjansen@users.sourceforge.net Sat Aug 25 12:53:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:53:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Events.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16262/Python/Mac/Lib/lib-compat Modified Files: Events.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Events.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Events.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Events.py 2001/08/19 22:26:53 1.1 --- Events.py 2001/08/25 11:53:02 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Events import * From jackjansen@users.sourceforge.net Sat Aug 25 12:53:16 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:53:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Fm.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16301/Python/Mac/Lib/lib-compat Modified Files: Fm.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Fm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Fm.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Fm.py 2001/08/20 15:35:44 1.1 --- Fm.py 2001/08/25 11:53:14 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Fm import * From jackjansen@users.sourceforge.net Sat Aug 25 12:53:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 04:53:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/lib-compat Fonts.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/lib-compat In directory usw-pr-cvs1:/tmp/cvs-serv16363/Python/Mac/Lib/lib-compat Modified Files: Fonts.py Log Message: Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. Index: Fonts.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/lib-compat/Fonts.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Fonts.py 2001/08/19 22:27:01 1.1 --- Fonts.py 2001/08/25 11:53:35 1.2 *************** *** 1 **** --- 1,4 ---- + import warnings + warnings.warn("The %s module is deprecated; use Carbon.%s"%(__name__, __name__), + DeprecationWarning, stacklevel=2) from Carbon.Fonts import * From jackjansen@users.sourceforge.net Sat Aug 25 13:00:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:00:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject __init__.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject In directory usw-pr-cvs1:/tmp/cvs-serv17565/Python/Mac/Lib/mkcwproject Modified Files: __init__.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/__init__.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** __init__.py 2001/08/11 22:28:11 1.9 --- __init__.py 2001/08/25 12:00:44 1.10 *************** *** 2,6 **** import cwtalker import os ! import AppleEvents import macfs --- 2,6 ---- import cwtalker import os ! from Carbon import AppleEvents import macfs From jackjansen@users.sourceforge.net Sat Aug 25 13:00:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:00:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib aepack.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17588/Python/Mac/Lib Modified Files: aepack.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: aepack.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/aepack.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** aepack.py 2001/08/19 22:04:46 1.1 --- aepack.py 2001/08/25 12:00:49 1.2 *************** *** 18,23 **** from string import strip from types import * ! import AE ! from AppleEvents import * import MacOS import macfs --- 18,23 ---- from string import strip from types import * ! from Carbon import AE ! from Carbon.AppleEvents import * import MacOS import macfs From jackjansen@users.sourceforge.net Sat Aug 25 13:00:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:00:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test AEservertest.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv17612/Python/Mac/Lib/test Modified Files: AEservertest.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: AEservertest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/AEservertest.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AEservertest.py 2001/01/29 15:28:46 1.4 --- AEservertest.py 2001/08/25 12:00:53 1.5 *************** *** 11,23 **** import traceback import MacOS ! import AE ! from AppleEvents import * ! import Evt ! from Events import * ! import Menu ! import Dlg ! import Win ! from Windows import * ! import Qd import macfs --- 11,23 ---- import traceback import MacOS ! from Carbon import AE ! from Carbon.AppleEvents import * ! from Carbon import Evt ! from Carbon.Events import * ! from Carbon import Menu ! from Carbon import Dlg ! from Carbon import Win ! from Carbon.Windows import * ! from Carbon import Qd import macfs From jackjansen@users.sourceforge.net Sat Aug 25 13:01:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:01:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test aete.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv17639/Python/Mac/Lib/test Modified Files: aete.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: aete.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/aete.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** aete.py 1995/02/19 15:56:53 1.3 --- aete.py 2001/08/25 12:01:01 1.4 *************** *** 9,13 **** import StringIO ! from Res import * def main(): --- 9,13 ---- import StringIO ! from Carbon.Res import * def main(): From jackjansen@users.sourceforge.net Sat Aug 25 13:01:09 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:01:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib aetools.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17688/Python/Mac/Lib Modified Files: aetools.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: aetools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/aetools.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** aetools.py 2001/08/19 22:04:54 1.1 --- aetools.py 2001/08/25 12:01:07 1.2 *************** *** 23,28 **** from types import * ! import AE ! import AppleEvents import MacOS import sys --- 23,28 ---- from types import * ! from Carbon import AE ! from Carbon import AppleEvents import MacOS import sys From jackjansen@users.sourceforge.net Sat Aug 25 13:01:15 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:01:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib aetypes.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17723/Python/Mac/Lib Modified Files: aetypes.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: aetypes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/aetypes.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** aetypes.py 2001/08/19 22:05:00 1.1 --- aetypes.py 2001/08/25 12:01:13 1.2 *************** *** 1,5 **** """aetypes - Python objects representing various AE types.""" ! from AppleEvents import * import struct from types import * --- 1,5 ---- """aetypes - Python objects representing various AE types.""" ! from Carbon.AppleEvents import * import struct from types import * From jackjansen@users.sourceforge.net Sat Aug 25 13:01:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:01:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib Audio_mac.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17746/Python/Mac/Lib Modified Files: Audio_mac.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Audio_mac.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/Audio_mac.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Audio_mac.py 2001/02/09 15:56:19 1.8 --- Audio_mac.py 2001/08/25 12:01:17 1.9 *************** *** 41,49 **** def writeframes(self, data): import time ! from Sound import bufferCmd, callBackCmd, extSH import struct import MacOS if not self._chan: ! import Snd self._chan = Snd.SndNewChannel(5, 0, self._callback) nframes = len(data) / self._nchannels / self._sampwidth --- 41,49 ---- def writeframes(self, data): import time ! from Carbon.Sound import bufferCmd, callBackCmd, extSH import struct import MacOS if not self._chan: ! from Carbon import Snd self._chan = Snd.SndNewChannel(5, 0, self._callback) nframes = len(data) / self._nchannels / self._sampwidth From jackjansen@users.sourceforge.net Sat Aug 25 13:01:27 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:01:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/PythonScript baepack.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript In directory usw-pr-cvs1:/tmp/cvs-serv17772/Python/Mac/Contrib/PythonScript Modified Files: baepack.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: baepack.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript/baepack.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** baepack.py 2000/12/12 22:13:35 1.2 --- baepack.py 2001/08/25 12:01:25 1.3 *************** *** 18,23 **** from string import strip from types import * ! import AE ! from AppleEvents import * import MacOS import macfs --- 18,23 ---- from string import strip from types import * ! from Carbon import AE ! from Carbon.AppleEvents import * import MacOS import macfs *************** *** 196,200 **** return v if t == typeObjectSpecifier: ! import Res # print desc, type(desc) # print desc.__members__ --- 196,200 ---- return v if t == typeObjectSpecifier: ! from Carbon import Res # print desc, type(desc) # print desc.__members__ From jackjansen@users.sourceforge.net Sat Aug 25 13:01:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:01:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/PythonScript baetools.py,1.1.1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript In directory usw-pr-cvs1:/tmp/cvs-serv17796/Python/Mac/Contrib/PythonScript Modified Files: baetools.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: baetools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript/baetools.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** baetools.py 1998/08/18 14:55:17 1.1.1.1 --- baetools.py 2001/08/25 12:01:33 1.2 *************** *** 22,27 **** from types import * ! import AE ! import AppleEvents import MacOS import sys --- 22,27 ---- from types import * ! from Carbon import AE ! from Carbon import AppleEvents import MacOS import sys From jackjansen@users.sourceforge.net Sat Aug 25 13:01:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:01:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/PythonScript baetypes.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript In directory usw-pr-cvs1:/tmp/cvs-serv17816/Python/Mac/Contrib/PythonScript Modified Files: baetypes.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: baetypes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript/baetypes.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** baetypes.py 2000/12/12 22:13:36 1.2 --- baetypes.py 2001/08/25 12:01:38 1.3 *************** *** 1,5 **** """aetypes - Python objects representing various AE types.""" ! from AppleEvents import * import struct from types import * --- 1,5 ---- """aetypes - Python objects representing various AE types.""" ! from Carbon.AppleEvents import * import struct from types import * From jackjansen@users.sourceforge.net Sat Aug 25 13:01:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:01:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts BuildApplication.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv17837/Python/Mac/scripts Modified Files: BuildApplication.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: BuildApplication.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/BuildApplication.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** BuildApplication.py 2000/12/14 23:34:15 1.7 --- BuildApplication.py 2001/08/25 12:01:44 1.8 *************** *** 15,20 **** import macfs import MacOS ! import Res ! import Dlg import EasyDialogs import buildtools --- 15,20 ---- import macfs import MacOS ! from Carbon import Res ! from Carbon import Dlg import EasyDialogs import buildtools From jackjansen@users.sourceforge.net Sat Aug 25 13:01:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:01:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/CGI BuildCGIApplet.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/CGI In directory usw-pr-cvs1:/tmp/cvs-serv17854/Python/Mac/Tools/CGI Modified Files: BuildCGIApplet.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: BuildCGIApplet.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/CGI/BuildCGIApplet.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BuildCGIApplet.py 2000/06/20 21:54:32 1.3 --- BuildCGIApplet.py 2001/08/25 12:01:48 1.4 *************** *** 11,15 **** import macfs import MacOS ! import Res import EasyDialogs import buildtools --- 11,15 ---- import macfs import MacOS ! from Carbon import Res import EasyDialogs import buildtools From jackjansen@users.sourceforge.net Sat Aug 25 13:01:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:01:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE BuildIDE.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv17877/Python/Mac/Tools/IDE Modified Files: BuildIDE.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: BuildIDE.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/BuildIDE.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BuildIDE.py 2000/06/20 21:54:33 1.5 --- BuildIDE.py 2001/08/25 12:01:52 1.6 *************** *** 6,10 **** import os import buildtools ! import Res import py_resource --- 6,10 ---- import os import buildtools ! from Carbon import Res import py_resource From jackjansen@users.sourceforge.net Sat Aug 25 13:02:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:02:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib buildtools.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17909/Python/Mac/Lib Modified Files: buildtools.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: buildtools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/buildtools.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** buildtools.py 2001/02/17 23:30:19 1.8 --- buildtools.py 2001/08/25 12:01:58 1.9 *************** *** 7,11 **** import marshal import macfs ! import Res import MACFS import MacOS --- 7,11 ---- import marshal import macfs ! from Carbon import Res import MACFS import MacOS From jackjansen@users.sourceforge.net Sat Aug 25 13:02:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:02:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib cfmfile.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17961/Python/Mac/Lib Modified Files: cfmfile.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: cfmfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/cfmfile.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cfmfile.py 2001/05/17 12:44:35 1.3 --- cfmfile.py 2001/08/25 12:02:03 1.4 *************** *** 8,12 **** import macfs import struct ! import Res import os import sys --- 8,12 ---- import macfs import struct ! from Carbon import Res import os import sys From jackjansen@users.sourceforge.net Sat Aug 25 13:02:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:02:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse cicnbrowse.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv17980/Python/Mac/Demo/PICTbrowse Modified Files: cicnbrowse.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: cicnbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/cicnbrowse.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cicnbrowse.py 2001/01/09 22:22:58 1.5 --- cicnbrowse.py 2001/08/25 12:02:09 1.6 *************** *** 3,14 **** import FrameWork import EasyDialogs ! import Res ! import Qd ! import Win ! import Controls ! import List import sys import struct ! import Icn # --- 3,14 ---- import FrameWork import EasyDialogs ! from Carbon import Res ! from Carbon import Qd ! from Carbon import Win ! from Carbon import Controls ! from Carbon import List import sys import struct ! from Carbon import Icn # From jackjansen@users.sourceforge.net Sat Aug 25 13:02:16 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:02:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test cmtest.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18008/Python/Mac/Lib/test Modified Files: cmtest.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: cmtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/cmtest.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cmtest.py 1995/11/30 15:03:09 1.1 --- cmtest.py 2001/08/25 12:02:14 1.2 *************** *** 1,7 **** """cmtest - List all components in the system""" ! import Cm ! import Res ! import sys def getstr255(r): --- 1,7 ---- """cmtest - List all components in the system""" ! from Carbon import Cm ! from Carbon import Res ! from Carbon import sys def getstr255(r): From jackjansen@users.sourceforge.net Sat Aug 25 13:02:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:02:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts ConfigurePython.py,1.39,1.40 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv18025/Python/Mac/scripts Modified Files: ConfigurePython.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: ConfigurePython.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/ConfigurePython.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ConfigurePython.py 2001/03/29 13:53:19 1.39 --- ConfigurePython.py 2001/08/25 12:02:19 1.40 *************** *** 14,18 **** import gestalt import string ! import Res SPLASH_COPYCORE=512 --- 14,18 ---- import gestalt import string ! from Carbon import Res SPLASH_COPYCORE=512 *************** *** 90,94 **** if macfs.FSSpec(sys.exec_prefix).as_tuple()[0] != -1: # XXXX try: ! import Dlg rv = Dlg.CautionAlert(ALERT_NONBOOT, None) if rv == ALERT_NONBOOT_COPY: --- 90,94 ---- if macfs.FSSpec(sys.exec_prefix).as_tuple()[0] != -1: # XXXX try: ! from Carbon import Dlg rv = Dlg.CautionAlert(ALERT_NONBOOT, None) if rv == ALERT_NONBOOT_COPY: *************** *** 142,146 **** # Hack to make sure we get the new MACFS sys.path.insert(0, os.path.join(oldcwd, ':Mac:Lib')) ! import Dlg rv = Dlg.CautionAlert(ALERT_NOTPYTHONFOLDER, None) if rv == ALERT_NOTPYTHONFOLDER_REMOVE_QUIT: --- 142,146 ---- # Hack to make sure we get the new MACFS sys.path.insert(0, os.path.join(oldcwd, ':Mac:Lib')) ! from Carbon import Dlg rv = Dlg.CautionAlert(ALERT_NOTPYTHONFOLDER, None) if rv == ALERT_NOTPYTHONFOLDER_REMOVE_QUIT: *************** *** 163,167 **** n = n + mkcorealias('PythonCoreCarbon', 'PythonCoreCarbon') if n == 0: ! import Dlg Dlg.CautionAlert(ALERT_NOCORE, None) if verbose: --- 163,167 ---- n = n + mkcorealias('PythonCoreCarbon', 'PythonCoreCarbon') if n == 0: ! from Carbon import Dlg Dlg.CautionAlert(ALERT_NOCORE, None) if verbose: From jackjansen@users.sourceforge.net Sat Aug 25 13:02:27 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:02:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/resources copyres.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/resources In directory usw-pr-cvs1:/tmp/cvs-serv18063/Python/Mac/Demo/resources Modified Files: copyres.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: copyres.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/resources/copyres.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** copyres.py 1995/01/30 11:53:02 1.1 --- copyres.py 2001/08/25 12:02:25 1.2 *************** *** 1,4 **** ! from Res import * ! from Resources import * import MacOS --- 1,4 ---- ! from Carbon.Res import * ! from Carbon.Resources import * import MacOS From jackjansen@users.sourceforge.net Sat Aug 25 13:02:32 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:02:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test ctbtest.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18078/Python/Mac/Lib/test Modified Files: ctbtest.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: ctbtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/ctbtest.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ctbtest.py 1997/06/12 10:49:55 1.4 --- ctbtest.py 2001/08/25 12:02:29 1.5 *************** *** 4,9 **** # import ctb ! import Evt ! import Events import MacOS import sys --- 4,9 ---- # import ctb ! from Carbon import Evt ! from Carbon import Events import MacOS import sys From jackjansen@users.sourceforge.net Sat Aug 25 13:03:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:03:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/example1 dnslookup-1.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/example1 In directory usw-pr-cvs1:/tmp/cvs-serv18393/Python/Mac/Demo/example1 Modified Files: dnslookup-1.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: dnslookup-1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/example1/dnslookup-1.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dnslookup-1.py 2000/06/20 22:01:04 1.2 --- dnslookup-1.py 2001/08/25 12:03:48 1.3 *************** *** 3,8 **** import EasyDialogs ! import Res ! import Dlg import sys import socket --- 3,8 ---- import EasyDialogs ! from Carbon import Res ! from Carbon import Dlg import sys import socket From jackjansen@users.sourceforge.net Sat Aug 25 13:03:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:03:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/example2 dnslookup-2.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/example2 In directory usw-pr-cvs1:/tmp/cvs-serv18447/Python/Mac/Demo/example2 Modified Files: dnslookup-2.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: dnslookup-2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/example2/dnslookup-2.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dnslookup-2.py 2001/02/14 17:07:04 1.3 --- dnslookup-2.py 2001/08/25 12:03:53 1.4 *************** *** 1,6 **** import FrameWork import EasyDialogs ! import Res ! import Dlg import sys import socket --- 1,6 ---- import FrameWork import EasyDialogs ! from Carbon import Res ! from Carbon import Dlg import sys import socket From jackjansen@users.sourceforge.net Sat Aug 25 13:04:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:04:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test dragtest.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18557/Python/Mac/Lib/test Modified Files: dragtest.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: dragtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/dragtest.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dragtest.py 1999/06/21 16:19:43 1.1 --- dragtest.py 2001/08/25 12:04:04 1.2 *************** *** 1,3 **** ! import Drag import time xxxx=1 --- 1,3 ---- ! from Carbon import Drag import time xxxx=1 From jackjansen@users.sourceforge.net Sat Aug 25 13:04:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:04:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib EasyDialogs.py,1.33,1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18611/Python/Mac/Lib Modified Files: EasyDialogs.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: EasyDialogs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/EasyDialogs.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** EasyDialogs.py 2001/07/27 09:21:28 1.33 --- EasyDialogs.py 2001/08/25 12:04:10 1.34 *************** *** 15,30 **** """ ! from Dlg import GetNewDialog, SetDialogItemText, GetDialogItemText, ModalDialog ! import Qd ! import QuickDraw ! import Dialogs ! import Windows ! import Dlg,Win,Evt,Events # sdm7g ! import Ctl ! import Controls ! import Menu import MacOS import string ! from ControlAccessor import * # Also import Controls constants import macfs --- 15,30 ---- """ ! from Carbon.Dlg import GetNewDialog, SetDialogItemText, GetDialogItemText, ModalDialog ! from Carbon import Qd ! from Carbon import QuickDraw ! from Carbon import Dialogs ! from Carbon import Windows ! from Carbon import Dlg,Win,Evt,Events # sdm7g ! from Carbon import Ctl ! from Carbon import Controls ! from Carbon import Menu import MacOS import string ! from Carbon.ControlAccessor import * # Also import Controls constants import macfs From jackjansen@users.sourceforge.net Sat Aug 25 13:04:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:04:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test echo.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18698/Python/Mac/Lib/test Modified Files: echo.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: echo.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/echo.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** echo.py 2001/01/29 15:28:46 1.8 --- echo.py 2001/08/25 12:04:19 1.9 *************** *** 11,23 **** import traceback import MacOS ! import AE ! from AppleEvents import * ! import Evt ! from Events import * ! import Menu ! import Dlg ! import Win ! from Windows import * ! import Qd import aetools --- 11,23 ---- import traceback import MacOS ! from Carbon import AE ! from Carbon.AppleEvents import * ! from Carbon import Evt ! from Carbon.Events import * ! from Carbon import Menu ! from Carbon import Dlg ! from Carbon import Win ! from Carbon.Windows import * ! from Carbon import Qd import aetools From jackjansen@users.sourceforge.net Sat Aug 25 13:04:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:04:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib findertools.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18793/Python/Mac/Lib Modified Files: findertools.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: findertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/findertools.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** findertools.py 2001/07/24 11:37:23 1.7 --- findertools.py 2001/08/25 12:04:33 1.8 *************** *** 16,20 **** """ import Finder ! import AppleEvents import aetools import MacOS --- 16,20 ---- """ import Finder ! from Carbon import AppleEvents import aetools import MacOS From jackjansen@users.sourceforge.net Sat Aug 25 13:04:53 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:04:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib FrameWork.py,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18868/Python/Mac/Lib Modified Files: FrameWork.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: FrameWork.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/FrameWork.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** FrameWork.py 2001/08/03 13:31:36 1.44 --- FrameWork.py 2001/08/25 12:04:51 1.45 *************** *** 6,27 **** import traceback ! from AE import * ! from AppleEvents import * ! from Ctl import * ! from Controls import * ! from Dlg import * ! from Dialogs import * ! from Evt import * ! from Events import * ! from Menu import * ! from Menus import * ! from Qd import * ! from QuickDraw import * ! #from Res import * ! #from Resources import * ! #from Snd import * ! #from Sound import * ! from Win import * ! from Windows import * import types --- 6,27 ---- import traceback ! from Carbon.AE import * ! from Carbon.AppleEvents import * ! from Carbon.Ctl import * ! from Carbon.Controls import * ! from Carbon.Dlg import * ! from Carbon.Dialogs import * ! from Carbon.Evt import * ! from Carbon.Events import * ! from Carbon.Menu import * ! from Carbon.Menus import * ! from Carbon.Qd import * ! from Carbon.QuickDraw import * ! #from Carbon.Res import * ! #from Carbon.Resources import * ! #from Carbon.Snd import * ! #from Carbon.Sound import * ! from Carbon.Win import * ! from Carbon.Windows import * import types From jackjansen@users.sourceforge.net Sat Aug 25 13:05:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:05:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/PythonScript getaete.py,1.1.1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript In directory usw-pr-cvs1:/tmp/cvs-serv19015/Python/Mac/Contrib/PythonScript Modified Files: getaete.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: getaete.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript/getaete.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** getaete.py 1998/08/18 14:55:18 1.1.1.1 --- getaete.py 2001/08/25 12:05:09 1.2 *************** *** 19,23 **** import macfs import string ! from Res import * import struct --- 19,23 ---- import macfs import string ! from Carbon.Res import * import struct From jackjansen@users.sourceforge.net Sat Aug 25 13:05:16 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:05:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/waste htmled.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/waste In directory usw-pr-cvs1:/tmp/cvs-serv19045/Python/Mac/Demo/waste Modified Files: htmled.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: htmled.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/waste/htmled.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** htmled.py 2001/08/03 13:31:34 1.9 --- htmled.py 2001/08/25 12:05:14 1.10 *************** *** 4,16 **** # - Functionality: find, etc. ! from Menu import DrawMenuBar from FrameWork import * ! import Win ! import Qd ! import Res ! import Fm import waste import WASTEconst ! import Scrap import os import macfs --- 4,16 ---- # - Functionality: find, etc. ! from Carbon.Menu import DrawMenuBar from FrameWork import * ! from Carbon import Win ! from Carbon import Qd ! from Carbon import Res ! from Carbon import Fm import waste import WASTEconst ! from Carbon import Scrap import os import macfs From jackjansen@users.sourceforge.net Sat Aug 25 13:05:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:05:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test icgluetest.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv19094/Python/Mac/Lib/test Modified Files: icgluetest.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: icgluetest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/icgluetest.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** icgluetest.py 2001/08/03 14:12:36 1.3 --- icgluetest.py 2001/08/25 12:05:23 1.4 *************** *** 3,7 **** import icglue ! import Res ici = icglue.ICStart('Pyth') --- 3,7 ---- import icglue ! from Carbon import Res ici = icglue.ICStart('Pyth') From jackjansen@users.sourceforge.net Sat Aug 25 13:05:42 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:05:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/imgbrowse imgbrowse.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/imgbrowse In directory usw-pr-cvs1:/tmp/cvs-serv19202/Python/Mac/Demo/imgbrowse Modified Files: imgbrowse.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: imgbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/imgbrowse/imgbrowse.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** imgbrowse.py 1996/10/04 15:22:36 1.4 --- imgbrowse.py 2001/08/25 12:05:40 1.5 *************** *** 3,11 **** import FrameWork import EasyDialogs ! import Res ! import Qd ! import QuickDraw ! import Win ! #import List import sys import struct --- 3,11 ---- import FrameWork import EasyDialogs ! from Carbon import Res ! from Carbon import Qd ! from Carbon import QuickDraw ! from Carbon import Win ! #ifrom Carbon mport List import sys import struct From jackjansen@users.sourceforge.net Sat Aug 25 13:06:34 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:06:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/macfreeze macfreezegui.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/macfreeze In directory usw-pr-cvs1:/tmp/cvs-serv19493/Python/Mac/Tools/macfreeze Modified Files: macfreezegui.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: macfreezegui.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/macfreeze/macfreezegui.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** macfreezegui.py 2000/06/20 21:54:34 1.2 --- macfreezegui.py 2001/08/25 12:06:32 1.3 *************** *** 1,4 **** """macfreezegui - The GUI for macfreeze""" ! import Dlg import macfs import EasyDialogs --- 1,4 ---- """macfreezegui - The GUI for macfreeze""" ! from Carbon import Dlg import macfs import EasyDialogs *************** *** 6,10 **** import os import string ! import Res ID_MAINDIALOG=512 --- 6,10 ---- import os import string ! from Carbon import Res ID_MAINDIALOG=512 From jackjansen@users.sourceforge.net Sat Aug 25 13:06:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:06:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/macfreeze macgen_rsrc.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/macfreeze In directory usw-pr-cvs1:/tmp/cvs-serv19638/Python/Mac/Tools/macfreeze Modified Files: macgen_rsrc.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: macgen_rsrc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/macfreeze/macgen_rsrc.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** macgen_rsrc.py 1999/01/21 12:49:20 1.3 --- macgen_rsrc.py 2001/08/25 12:06:47 1.4 *************** *** 2,6 **** import EasyDialogs import py_resource ! import Res import sys --- 2,6 ---- import EasyDialogs import py_resource ! from Carbon import Res import sys From jackjansen@users.sourceforge.net Sat Aug 25 13:07:08 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts mkestrres.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv19824/Python/Mac/scripts Modified Files: mkestrres.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: mkestrres.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/mkestrres.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mkestrres.py 2001/01/02 22:02:02 1.6 --- mkestrres.py 2001/08/25 12:07:06 1.7 *************** *** 4,8 **** import macfs import string ! import Res import os --- 4,8 ---- import macfs import string ! from Carbon import Res import os From jackjansen@users.sourceforge.net Sat Aug 25 13:07:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/IDE scripts/Widget demos ModalDialog.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/IDE scripts/Widget demos In directory usw-pr-cvs1:/tmp/cvs-serv19967/Python/Mac/IDE scripts/Widget demos Modified Files: ModalDialog.py Log Message: Import the MacOS toolbox modules from the Carbon package. From jackjansen@users.sourceforge.net Sat Aug 25 13:07:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/ImageHelpers MovieUtils.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/ImageHelpers In directory usw-pr-cvs1:/tmp/cvs-serv20114/Python/Mac/Contrib/ImageHelpers Modified Files: MovieUtils.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: MovieUtils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/ImageHelpers/MovieUtils.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MovieUtils.py 2000/09/22 12:46:19 1.1 --- MovieUtils.py 2001/08/25 12:07:43 1.2 *************** *** 1,9 **** ! import Qt ! import QuickTime import macfs ! import Qd ! from QuickDraw import srcCopy from ExtPixMapWrapper import ExtPixMapWrapper ! from Qdoffs import * import ImageMac import W --- 1,9 ---- ! from Carbon import Qt ! from Carbon import QuickTime import macfs ! from Carbon import Qd ! from Carbon.QuickDraw import srcCopy from ExtPixMapWrapper import ExtPixMapWrapper ! from Carbon.Qdoffs import * import ImageMac import W From jackjansen@users.sourceforge.net Sat Aug 25 13:07:59 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/textedit ped.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/textedit In directory usw-pr-cvs1:/tmp/cvs-serv20216/Python/Mac/Demo/textedit Modified Files: ped.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: ped.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/textedit/ped.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ped.py 2001/08/03 13:31:34 1.7 --- ped.py 2001/08/25 12:07:57 1.8 *************** *** 6,15 **** # - Functionality: find, etc. ! from Menu import DrawMenuBar from FrameWork import * ! import Win ! import Qd ! import TE ! import Scrap import os import macfs --- 6,15 ---- # - Functionality: find, etc. ! from Carbon.Menu import DrawMenuBar from FrameWork import * ! from Carbon import Win ! from Carbon import Qd ! from Carbon import TE ! from Carbon import Scrap import os import macfs From jackjansen@users.sourceforge.net Sat Aug 25 13:08:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:08:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse PICTbrowse.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv20466/Python/Mac/Demo/PICTbrowse Modified Files: PICTbrowse.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PICTbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/PICTbrowse.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PICTbrowse.py 2001/08/03 13:31:34 1.8 --- PICTbrowse.py 2001/08/25 12:08:38 1.9 *************** *** 3,11 **** import FrameWork import EasyDialogs ! import Res ! import Qd ! import Win ! import Controls ! import List import sys import struct --- 3,11 ---- import FrameWork import EasyDialogs ! from Carbon import Res ! from Carbon import Qd ! from Carbon import Win ! from Carbon import Controls ! from Carbon import List import sys import struct From jackjansen@users.sourceforge.net Sat Aug 25 13:08:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:08:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse PICTbrowse2.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv20519/Python/Mac/Demo/PICTbrowse Modified Files: PICTbrowse2.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PICTbrowse2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/PICTbrowse2.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PICTbrowse2.py 2001/08/03 13:31:34 1.8 --- PICTbrowse2.py 2001/08/25 12:08:44 1.9 *************** *** 3,11 **** import FrameWork import EasyDialogs ! import Res ! import Qd ! import Win ! import Controls ! import List import sys import struct --- 3,11 ---- import FrameWork import EasyDialogs ! from Carbon import Res ! from Carbon import Qd ! from Carbon import Win ! from Carbon import Controls ! from Carbon import List import sys import struct From jackjansen@users.sourceforge.net Sat Aug 25 13:08:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:08:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib PixMapWrapper.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv20569/Python/Mac/Lib Modified Files: PixMapWrapper.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PixMapWrapper.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/PixMapWrapper.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PixMapWrapper.py 2000/10/22 21:59:23 1.2 --- PixMapWrapper.py 2001/08/25 12:08:49 1.3 *************** *** 6,11 **** J. Strout February 1999""" ! import Qd ! import QuickDraw import struct import MacOS --- 6,11 ---- J. Strout February 1999""" ! from Carbon import Qd ! from Carbon import QuickDraw import struct import MacOS From jackjansen@users.sourceforge.net Sat Aug 25 13:09:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:09:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/PythonScript printaete.py,1.1.1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript In directory usw-pr-cvs1:/tmp/cvs-serv20688/Python/Mac/Contrib/PythonScript Modified Files: printaete.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: printaete.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript/printaete.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** printaete.py 1998/08/18 14:55:18 1.1.1.1 --- printaete.py 2001/08/25 12:09:03 1.2 *************** *** 15,19 **** import string import macpath ! from Res import * # for testing only --- 15,19 ---- import string import macpath ! from Carbon.Res import * # for testing only From jackjansen@users.sourceforge.net Sat Aug 25 13:09:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:09:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/printing PrintingDemo.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/printing In directory usw-pr-cvs1:/tmp/cvs-serv20721/Python/Mac/Demo/printing Modified Files: PrintingDemo.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PrintingDemo.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/printing/PrintingDemo.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PrintingDemo.py 1998/04/27 15:06:50 1.1 --- PrintingDemo.py 2001/08/25 12:09:08 1.2 *************** *** 1,6 **** import Printing ! import Qd ! import Fm ! import Res # some constants --- 1,6 ---- import Printing ! from Carbon import Qd ! from Carbon import Fm ! from Carbon import Res # some constants From jackjansen@users.sourceforge.net Sat Aug 25 13:09:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:09:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib py_resource.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv20824/Python/Mac/Lib Modified Files: py_resource.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: py_resource.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/py_resource.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** py_resource.py 1998/08/18 12:23:11 1.3 --- py_resource.py 2001/08/25 12:09:22 1.4 *************** *** 1,5 **** """Creation of PYC resources""" import os ! import Res import __builtin__ --- 1,5 ---- """Creation of PYC resources""" import os ! from Carbon import Res import __builtin__ From jackjansen@users.sourceforge.net Sat Aug 25 13:09:41 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:09:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyDebugger.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv20936/Python/Mac/Tools/IDE Modified Files: PyDebugger.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PyDebugger.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyDebugger.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyDebugger.py 2001/06/20 19:57:55 1.6 --- PyDebugger.py 2001/08/25 12:09:39 1.7 *************** *** 7,13 **** import WASTEconst import PyBrowser ! import Qd ! import Evt ! import Lists import MacOS _filenames = {} --- 7,13 ---- import WASTEconst import PyBrowser ! from Carbon import Qd ! from Carbon import Evt ! from Carbon import Lists import MacOS _filenames = {} *************** *** 66,70 **** def start(self, bottomframe = None, running = 0): W.getapplication().DebuggerQuit = bdb.BdbQuit ! import Menu Menu.HiliteMenu(0) if self.closed: --- 66,70 ---- def start(self, bottomframe = None, running = 0): W.getapplication().DebuggerQuit = bdb.BdbQuit ! from Carbon import Menu Menu.HiliteMenu(0) if self.closed: From jackjansen@users.sourceforge.net Sat Aug 25 13:10:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:10:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyEdit.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv21166/Python/Mac/Tools/IDE Modified Files: PyEdit.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PyEdit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyEdit.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PyEdit.py 2001/07/20 19:05:50 1.22 --- PyEdit.py 2001/08/25 12:10:15 1.23 *************** *** 8,14 **** import MACFS import MacOS ! import Win ! import Res ! import Evt import os import imp --- 8,14 ---- import MACFS import MacOS ! from Carbon import Win ! from Carbon import Res ! from Carbon import Evt import os import imp *************** *** 358,362 **** if self.editgroup.editor.changed: import EasyDialogs ! import Qd Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save window "%s" before closing?' % self.title, --- 358,362 ---- if self.editgroup.editor.changed: import EasyDialogs ! from Carbon import Qd Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save window "%s" before closing?' % self.title, *************** *** 949,953 **** self.hide() import EasyDialogs ! import Res editor.changed = 1 editor.selchanged = 1 --- 949,953 ---- self.hide() import EasyDialogs ! from Carbon import Res editor.changed = 1 editor.selchanged = 1 From jackjansen@users.sourceforge.net Sat Aug 25 13:10:22 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:10:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/CGI PythonCGISlave.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/CGI In directory usw-pr-cvs1:/tmp/cvs-serv21208/Python/Mac/Tools/CGI Modified Files: PythonCGISlave.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PythonCGISlave.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/CGI/PythonCGISlave.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PythonCGISlave.py 2000/03/28 12:05:12 1.1 --- PythonCGISlave.py 2001/08/25 12:10:20 1.2 *************** *** 71,75 **** def get_cgi_code(): # If we're a CGI wrapper, the CGI code resides in a PYC resource. ! import Res, marshal try: code = Res.GetNamedResource('PYC ', "CGI_MAIN") --- 71,76 ---- def get_cgi_code(): # If we're a CGI wrapper, the CGI code resides in a PYC resource. ! from Carbon import Res ! import marshal try: code = Res.GetNamedResource('PYC ', "CGI_MAIN") From jackjansen@users.sourceforge.net Sat Aug 25 13:04:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:04:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts EditPythonPrefs.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv18741/Python/Mac/scripts Modified Files: EditPythonPrefs.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: EditPythonPrefs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/EditPythonPrefs.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** EditPythonPrefs.py 2001/01/29 14:59:33 1.24 --- EditPythonPrefs.py 2001/08/25 12:04:24 1.25 *************** *** 4,11 **** # be rewritten in a modeless way some time soon. ! from Dlg import * ! from Events import * ! from Res import * ! import Controls import string import struct --- 4,11 ---- # be rewritten in a modeless way some time soon. ! from Carbon.Dlg import * ! from Carbon.Events import * ! from Carbon.Res import * ! from Carbon import Controls import string import struct *************** *** 14,22 **** import os import sys ! import Res # For Res.Error import pythonprefs import EasyDialogs try: ! import Help except ImportError: Help = None --- 14,22 ---- import os import sys ! from Carbon import Res # For Res.Error import pythonprefs import EasyDialogs try: ! from Carbon import Help except ImportError: Help = None From jackjansen@users.sourceforge.net Sat Aug 25 13:04:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:04:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Unsupported findmodulefiles.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Unsupported In directory usw-pr-cvs1:/tmp/cvs-serv18825/Python/Mac/Unsupported Modified Files: findmodulefiles.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: findmodulefiles.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Unsupported/findmodulefiles.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** findmodulefiles.py 2000/09/12 20:16:47 1.1 --- findmodulefiles.py 2001/08/25 12:04:38 1.2 *************** *** 60,64 **** """Copy list-of-modules to resource file dst.""" import py_resource ! import Res import sys --- 60,64 ---- """Copy list-of-modules to resource file dst.""" import py_resource ! from Carbon import Res import sys From jackjansen@users.sourceforge.net Sat Aug 25 13:04:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:04:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE FontSettings.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv18846/Python/Mac/Tools/IDE Modified Files: FontSettings.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: FontSettings.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/FontSettings.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FontSettings.py 1999/01/30 22:36:20 1.1 --- FontSettings.py 2001/08/25 12:04:43 1.2 *************** *** 9,14 **** import W import PyEdit ! import TextEdit ! import Qd import string import types --- 9,14 ---- import W import PyEdit ! from Carbon import TextEdit ! from Carbon import Qd import string import types *************** *** 105,109 **** font, style, size, color = fontsettings if type(font) <> types.StringType: ! import Res res = Res.GetResource('FOND', font) font = res.GetResInfo()[2] --- 105,109 ---- font, style, size, color = fontsettings if type(font) <> types.StringType: ! from Carbon import Res res = Res.GetResource('FOND', font) font = res.GetResInfo()[2] From jackjansen@users.sourceforge.net Sat Aug 25 13:04:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:04:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts fullbuild.py,1.71,1.72 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv18896/Python/Mac/scripts Modified Files: fullbuild.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: fullbuild.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/fullbuild.py,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** fullbuild.py 2001/08/23 13:48:44 1.71 --- fullbuild.py 2001/08/25 12:04:56 1.72 *************** *** 22,26 **** import aetools ! import AppleEvents OLDAESUPPORT = 0 --- 22,26 ---- import aetools ! from Carbon import AppleEvents OLDAESUPPORT = 0 *************** *** 34,39 **** import CodeWarrior ! import Res ! import Dlg import buildtools --- 34,39 ---- import CodeWarrior ! from Carbon import Res ! from Carbon import Dlg import buildtools From jackjansen@users.sourceforge.net Sat Aug 25 13:05:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:05:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts gensuitemodule.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv18958/Python/Mac/scripts Modified Files: gensuitemodule.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: gensuitemodule.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/gensuitemodule.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** gensuitemodule.py 2001/07/20 19:02:34 1.16 --- gensuitemodule.py 2001/08/25 12:05:04 1.17 *************** *** 15,19 **** import macfs ! from Res import * def main(): --- 15,19 ---- import macfs ! from Carbon.Res import * def main(): From jackjansen@users.sourceforge.net Sat Aug 25 13:05:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:05:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib ic.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv19064/Python/Mac/Lib Modified Files: ic.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: ic.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/ic.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ic.py 2001/01/29 13:27:46 1.4 --- ic.py 2001/08/25 12:05:18 1.5 *************** *** 4,8 **** import string import sys ! import Res import macfs import macostools --- 4,8 ---- import string import sys ! from Carbon import Res import macfs import macostools From jackjansen@users.sourceforge.net Sat Aug 25 13:05:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:05:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse ICONbrowse.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv19127/Python/Mac/Demo/PICTbrowse Modified Files: ICONbrowse.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: ICONbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/ICONbrowse.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ICONbrowse.py 2001/08/03 13:31:34 1.6 --- ICONbrowse.py 2001/08/25 12:05:28 1.7 *************** *** 3,14 **** import FrameWork import EasyDialogs ! import Res ! import Qd ! import Win ! import Controls ! import List import sys import struct ! import Icn # --- 3,14 ---- import FrameWork import EasyDialogs ! from Carbon import Res ! from Carbon import Qd ! from Carbon import Win ! from Carbon import Controls ! from Carbon import List import sys import struct ! from Carbon import Icn # From jackjansen@users.sourceforge.net Sat Aug 25 13:05:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:05:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/ImageHelpers ImageMac.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/ImageHelpers In directory usw-pr-cvs1:/tmp/cvs-serv19163/Python/Mac/Contrib/ImageHelpers Modified Files: ImageMac.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: ImageMac.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/ImageHelpers/ImageMac.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ImageMac.py 2000/09/22 12:46:19 1.1 --- ImageMac.py 2001/08/25 12:05:34 1.2 *************** *** 22,26 **** ''' import W ! import Qd from ExtPixMapWrapper import * from Numeric import * --- 22,26 ---- ''' import W ! from Carbon import Qd from ExtPixMapWrapper import * from Numeric import * From jackjansen@users.sourceforge.net Sat Aug 25 13:05:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:05:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/resources listres.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/resources In directory usw-pr-cvs1:/tmp/cvs-serv19236/Python/Mac/Demo/resources Modified Files: listres.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: listres.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/resources/listres.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** listres.py 1995/01/30 11:53:03 1.1 --- listres.py 2001/08/25 12:05:45 1.2 *************** *** 1,6 **** # List all resources ! import Res ! from Resources import * def list1resources(): --- 1,6 ---- # List all resources ! from Carbon import Res ! from Carbon.Resources import * def list1resources(): From jackjansen@users.sourceforge.net Sat Aug 25 13:06:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:06:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/imgbrowse mac_image.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/imgbrowse In directory usw-pr-cvs1:/tmp/cvs-serv19408/Python/Mac/Demo/imgbrowse Modified Files: mac_image.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: mac_image.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/imgbrowse/mac_image.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mac_image.py 2000/10/22 21:56:32 1.3 --- mac_image.py 2001/08/25 12:06:15 1.4 *************** *** 1,5 **** """mac_image - Helper routines (hacks) for images""" import imgformat ! import Qd import time import struct --- 1,5 ---- """mac_image - Helper routines (hacks) for images""" import imgformat ! from Carbon import Qd import time import struct From jackjansen@users.sourceforge.net Sat Aug 25 13:06:39 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:06:39 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib macfsn.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv19538/Python/Mac/Lib Modified Files: macfsn.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: macfsn.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/macfsn.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** macfsn.py 2000/05/05 23:10:58 1.4 --- macfsn.py 2001/08/25 12:06:37 1.5 *************** *** 3,7 **** import macfs import struct ! import Res try: import Nav --- 3,7 ---- import macfs import struct ! from Carbon import Res try: import Nav From jackjansen@users.sourceforge.net Sat Aug 25 13:06:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:06:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/macfreeze macgen_bin.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/macfreeze In directory usw-pr-cvs1:/tmp/cvs-serv19586/Python/Mac/Tools/macfreeze Modified Files: macgen_bin.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: macgen_bin.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/macfreeze/macgen_bin.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** macgen_bin.py 2001/03/20 21:55:51 1.8 --- macgen_bin.py 2001/08/25 12:06:41 1.9 *************** *** 8,12 **** from MACFS import * import MacOS ! import Res import py_resource import cfmfile --- 8,12 ---- from MACFS import * import MacOS ! from Carbon import Res import py_resource import cfmfile From jackjansen@users.sourceforge.net Sat Aug 25 13:06:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:06:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib macostools.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv19675/Python/Mac/Lib Modified Files: macostools.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: macostools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/macostools.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** macostools.py 2001/03/06 22:46:25 1.11 --- macostools.py 2001/08/25 12:06:52 1.12 *************** *** 6,10 **** import macfs ! import Res import os from MACFS import * --- 6,10 ---- import macfs ! from Carbon import Res import os from MACFS import * From jackjansen@users.sourceforge.net Sat Aug 25 13:06:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:06:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib MiniAEFrame.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv19714/Python/Mac/Lib Modified Files: MiniAEFrame.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: MiniAEFrame.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/MiniAEFrame.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MiniAEFrame.py 2001/08/19 22:05:06 1.1 --- MiniAEFrame.py 2001/08/25 12:06:56 1.2 *************** *** 10,21 **** import traceback import MacOS ! import AE ! from AppleEvents import * ! import Evt ! from Events import * ! import Menu ! import Win ! from Windows import * ! import Qd import aetools --- 10,21 ---- import traceback import MacOS ! from Carbon import AE ! from Carbon.AppleEvents import * ! from Carbon import Evt ! from Carbon.Events import * ! from Carbon import Menu ! from Carbon import Win ! from Carbon.Windows import * ! from Carbon import Qd import aetools From jackjansen@users.sourceforge.net Sat Aug 25 13:07:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts MkDistr_ui.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv19754/Python/Mac/scripts Modified Files: MkDistr_ui.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: MkDistr_ui.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/MkDistr_ui.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MkDistr_ui.py 2001/02/14 17:05:20 1.12 --- MkDistr_ui.py 2001/08/25 12:07:01 1.13 *************** *** 13,22 **** # - Change cursor while busy (need cursor support in Qd) # ! import Res ! import Dlg ! import Ctl ! import List ! import Win ! import Qd from FrameWork import * import EasyDialogs --- 13,22 ---- # - Change cursor while busy (need cursor support in Qd) # ! from Carbon import Res ! from Carbon import Dlg ! from Carbon import Ctl ! from Carbon import List ! from Carbon import Win ! from Carbon import Qd from FrameWork import * import EasyDialogs From jackjansen@users.sourceforge.net Sat Aug 25 13:07:14 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Unsupported mkfrozenresources.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Unsupported In directory usw-pr-cvs1:/tmp/cvs-serv19878/Python/Mac/Unsupported Modified Files: mkfrozenresources.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: mkfrozenresources.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Unsupported/mkfrozenresources.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mkfrozenresources.py 2000/09/12 20:16:47 1.1 --- mkfrozenresources.py 2001/08/25 12:07:12 1.2 *************** *** 5,9 **** import macfs import py_resource ! import Res import sys --- 5,9 ---- import macfs import py_resource ! from Carbon import Res import sys From jackjansen@users.sourceforge.net Sat Aug 25 13:07:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/mlte mlted.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/mlte In directory usw-pr-cvs1:/tmp/cvs-serv19928/Python/Mac/Demo/mlte Modified Files: mlted.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: mlted.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/mlte/mlted.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mlted.py 2001/08/03 13:31:34 1.3 --- mlted.py 2001/08/25 12:07:17 1.4 *************** *** 6,18 **** from Menu import DrawMenuBar from FrameWork import * ! import Win ! import Ctl ! import Qd ! import Res ! import Scrap import os import macfs ! import MacTextEditor ! import Mlte UNDOLABELS = [ # Indexed by MLTECanUndo() value --- 6,18 ---- from Menu import DrawMenuBar from FrameWork import * ! from Carbon import Win ! from Carbon import Ctl ! from Carbon import Qd ! from Carbon import Res ! from Carbon import Scrap import os import macfs ! from Carbon import MacTextEditor ! from Carbon import Mlte UNDOLABELS = [ # Indexed by MLTECanUndo() value From jackjansen@users.sourceforge.net Sat Aug 25 13:07:31 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE ModuleBrowser.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv20019/Python/Mac/Tools/IDE Modified Files: ModuleBrowser.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: ModuleBrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/ModuleBrowser.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ModuleBrowser.py 2001/06/19 21:37:33 1.4 --- ModuleBrowser.py 2001/08/25 12:07:29 1.5 *************** *** 1,5 **** import W import sys ! import Qd __version__ = "0.2" --- 1,5 ---- import W import sys ! from Carbon import Qd __version__ = "0.2" From jackjansen@users.sourceforge.net Sat Aug 25 13:07:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/quicktime MovieInWindow.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/quicktime In directory usw-pr-cvs1:/tmp/cvs-serv20069/Python/Mac/Demo/quicktime Modified Files: MovieInWindow.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: MovieInWindow.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/quicktime/MovieInWindow.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MovieInWindow.py 1998/07/22 13:35:31 1.4 --- MovieInWindow.py 2001/08/25 12:07:36 1.5 *************** *** 4,15 **** """ ! import Qt ! import QuickTime ! import Qd ! import QuickDraw ! import Evt ! import Events ! import Win ! import Windows import macfs import sys --- 4,15 ---- """ ! from Carbon import Qt ! from Carbon import QuickTime ! from Carbon import Qd ! from Carbon import QuickDraw ! from Carbon import Evt ! from Carbon import Events ! from Carbon import Win ! from Carbon import Windows import macfs import sys From jackjansen@users.sourceforge.net Sat Aug 25 13:07:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse oldPICTbrowse.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv20149/Python/Mac/Demo/PICTbrowse Modified Files: oldPICTbrowse.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: oldPICTbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/oldPICTbrowse.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** oldPICTbrowse.py 2001/08/03 13:31:34 1.4 --- oldPICTbrowse.py 2001/08/25 12:07:48 1.5 *************** *** 3,10 **** import FrameWork import EasyDialogs ! import Res ! import Qd ! import Win ! import List import sys import struct --- 3,10 ---- import FrameWork import EasyDialogs ! from Carbon import Res ! from Carbon import Qd ! from Carbon import Win ! from Carbon import List import sys import struct From jackjansen@users.sourceforge.net Sat Aug 25 13:07:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:07:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts PackLibDir.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv20183/Python/Mac/scripts Modified Files: PackLibDir.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PackLibDir.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/PackLibDir.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PackLibDir.py 1996/05/31 13:02:52 1.5 --- PackLibDir.py 2001/08/25 12:07:53 1.6 *************** *** 1,7 **** # # Turn a pyc file into a resource file containing it in 'PYC ' resource form ! from Res import * ! import Res ! from Resources import * import os import macfs --- 1,7 ---- # # Turn a pyc file into a resource file containing it in 'PYC ' resource form ! from Carbon.Res import * ! from Carbon import Res ! from Carbon.Resources import * import os import macfs From jackjansen@users.sourceforge.net Sat Aug 25 13:08:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:08:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/sound playaiff.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/sound In directory usw-pr-cvs1:/tmp/cvs-serv20603/Python/Mac/Demo/sound Modified Files: playaiff.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: playaiff.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/sound/playaiff.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** playaiff.py 1995/01/30 11:52:49 1.1 --- playaiff.py 2001/08/25 12:08:54 1.2 *************** *** 1,4 **** ! from Sound import * ! import Snd import aifc, audioop --- 1,4 ---- ! from Carbon.Sound import * ! from Carbon import Snd import aifc, audioop From jackjansen@users.sourceforge.net Sat Aug 25 13:09:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:09:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib preferences.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv20636/Python/Mac/Lib Modified Files: preferences.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: preferences.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/preferences.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** preferences.py 1999/02/02 15:48:54 1.2 --- preferences.py 2001/08/25 12:08:58 1.3 *************** *** 2,6 **** # General parser/loaders for preferences files and such # ! import Res import macfs import struct --- 2,6 ---- # General parser/loaders for preferences files and such # ! from Carbon import Res import macfs import struct From jackjansen@users.sourceforge.net Sat Aug 25 13:09:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:09:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE ProfileBrowser.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv20771/Python/Mac/Tools/IDE Modified Files: ProfileBrowser.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: ProfileBrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/ProfileBrowser.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProfileBrowser.py 1999/01/30 22:36:33 1.1 --- ProfileBrowser.py 2001/08/25 12:09:15 1.2 *************** *** 1,4 **** import W ! import Evt import sys --- 1,4 ---- import W ! from Carbon import Evt import sys From jackjansen@users.sourceforge.net Sat Aug 25 13:09:31 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:09:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyBrowser.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv20861/Python/Mac/Tools/IDE Modified Files: PyBrowser.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PyBrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyBrowser.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyBrowser.py 2001/07/10 19:25:40 1.9 --- PyBrowser.py 2001/08/25 12:09:29 1.10 *************** *** 128,132 **** def trackcolumn(self, (x, y)): ! import Qd, QuickDraw, Evt self.SetPort() l, t, r, b = self._bounds --- 128,132 ---- def trackcolumn(self, (x, y)): ! from Carbon import Qd, QuickDraw, Evt self.SetPort() l, t, r, b = self._bounds From jackjansen@users.sourceforge.net Sat Aug 25 13:09:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:09:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyConsole.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv20897/Python/Mac/Tools/IDE Modified Files: PyConsole.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PyConsole.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyConsole.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyConsole.py 2001/08/06 11:12:18 1.7 --- PyConsole.py 2001/08/25 12:09:34 1.8 *************** *** 1,8 **** import W import Wkeys ! import Fm import WASTEconst from types import * ! import Events import string import sys --- 1,8 ---- import W import Wkeys ! from Carbon import Fm import WASTEconst from types import * ! from Carbon import Events import string import sys *************** *** 10,14 **** import MacOS import MacPrefs ! import Qd import PyInteractive --- 10,14 ---- import MacOS import MacPrefs ! from Carbon import Qd import PyInteractive *************** *** 179,183 **** def clearbuffer(self): ! import Res self.consoletext.ted.WEUseText(Res.Resource('')) self.consoletext.write(sys.ps1) --- 179,183 ---- def clearbuffer(self): ! from Carbon import Res self.consoletext.ted.WEUseText(Res.Resource('')) self.consoletext.write(sys.ps1) *************** *** 327,331 **** def clearbuffer(self): ! import Res self.w.outputtext.set('') --- 327,331 ---- def clearbuffer(self): ! from Carbon import Res self.w.outputtext.set('') From jackjansen@users.sourceforge.net Sat Aug 25 13:09:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:09:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyDocSearch.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv20999/Python/Mac/Tools/IDE Modified Files: PyDocSearch.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PyDocSearch.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyDocSearch.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyDocSearch.py 2001/06/19 21:37:33 1.5 --- PyDocSearch.py 2001/08/25 12:09:48 1.6 *************** *** 60,64 **** def createlist(self): ! import List self._calcbounds() self.SetPort() --- 60,64 ---- def createlist(self): ! from Carbon import List self._calcbounds() self.SetPort() From jackjansen@users.sourceforge.net Sat Aug 25 13:10:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:10:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PythonIDE.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv21264/Python/Mac/Tools/IDE Modified Files: PythonIDE.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PythonIDE.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDE.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PythonIDE.py 2001/06/19 21:37:33 1.6 --- PythonIDE.py 2001/08/25 12:10:37 1.7 *************** *** 11,18 **** MacOS.EnableAppswitch(-1) ! import Qd, QuickDraw Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data) ! import Res, sys, os try: Res.GetResource('DITL', 468) --- 11,19 ---- MacOS.EnableAppswitch(-1) ! from Carbon import Qd, QuickDraw Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data) ! from Carbon import Res ! import sys, os try: Res.GetResource('DITL', 468) From jackjansen@users.sourceforge.net Sat Aug 25 13:10:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:10:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PythonIDEMain.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv21353/Python/Mac/Tools/IDE Modified Files: PythonIDEMain.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PythonIDEMain.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDEMain.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PythonIDEMain.py 2001/06/19 21:37:33 1.12 --- PythonIDEMain.py 2001/08/25 12:10:43 1.13 *************** *** 15,19 **** self.preffilepath = ":Python:PythonIDE preferences" Wapplication.Application.__init__(self, 'Pide') ! import AE, AppleEvents AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenApplication, --- 15,20 ---- self.preffilepath = ":Python:PythonIDE preferences" Wapplication.Application.__init__(self, 'Pide') ! from Carbon import AE ! from Carbon import AppleEvents AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenApplication, *************** *** 124,128 **** def quitevent(self, theAppleEvent, theReply): ! import AE AE.AEInteractWithUser(50000000) self._quit() --- 125,129 ---- def quitevent(self, theAppleEvent, theReply): ! from Carbon import AE AE.AEInteractWithUser(50000000) self._quit() From jackjansen@users.sourceforge.net Sat Aug 25 13:12:42 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:12:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts run.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv21946/Python/Mac/scripts Modified Files: run.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: run.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/run.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** run.py 1995/02/21 21:00:32 1.2 --- run.py 2001/08/25 12:12:40 1.3 *************** *** 28,32 **** def message(str = "Hello, world!", id = 256): ! import Dlg d = Dlg.GetNewDialog(id, -1) if not d: --- 28,32 ---- def message(str = "Hello, world!", id = 256): ! from Carbon import Dlg d = Dlg.GetNewDialog(id, -1) if not d: From jackjansen@users.sourceforge.net Sat Aug 25 13:12:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:12:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts RunLibScript.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv21969/Python/Mac/scripts Modified Files: RunLibScript.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: RunLibScript.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/RunLibScript.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RunLibScript.py 2000/06/20 21:54:05 1.4 --- RunLibScript.py 2001/08/25 12:12:45 1.5 *************** *** 7,11 **** import os import string ! import Dlg import macfs --- 7,11 ---- import os import string ! from Carbon import Dlg import macfs *************** *** 84,88 **** def main(): curdir = os.getcwd() ! import Res try: Res.FSpOpenResFile('RunLibScript.rsrc', 1) --- 84,88 ---- def main(): curdir = os.getcwd() ! from Carbon import Res try: Res.FSpOpenResFile('RunLibScript.rsrc', 1) From jackjansen@users.sourceforge.net Sat Aug 25 13:13:01 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/waste swed.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/waste In directory usw-pr-cvs1:/tmp/cvs-serv22015/Python/Mac/Demo/waste Modified Files: swed.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: swed.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/waste/swed.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** swed.py 2001/08/03 13:31:34 1.10 --- swed.py 2001/08/25 12:12:59 1.11 *************** *** 4,16 **** # - Functionality: find, etc. ! from Menu import DrawMenuBar from FrameWork import * ! import Win ! import Qd ! import Res ! import Fm import waste import WASTEconst ! import Scrap import os import macfs --- 4,16 ---- # - Functionality: find, etc. ! from Carbon.Menu import DrawMenuBar from FrameWork import * ! from Carbon import Win ! from Carbon import Qd ! from Carbon import Res ! from Carbon import Fm import waste import WASTEconst ! from Carbon import Scrap import os import macfs From jackjansen@users.sourceforge.net Sat Aug 25 13:13:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tlist.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22112/Python/Mac/Lib/test Modified Files: tlist.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: tlist.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/tlist.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tlist.py 1996/07/26 16:04:29 1.5 --- tlist.py 2001/08/25 12:13:19 1.6 *************** *** 9,16 **** from FrameWork import * ! import Win ! import Qd ! import List ! import Lists import os --- 9,16 ---- from FrameWork import * ! from Carbon import Win ! from Carbon import Qd ! from Carbon import List ! from Carbon import Lists import os From jackjansen@users.sourceforge.net Sat Aug 25 13:13:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/quicktime VerySimplePlayer.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/quicktime In directory usw-pr-cvs1:/tmp/cvs-serv22181/Python/Mac/Demo/quicktime Modified Files: VerySimplePlayer.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: VerySimplePlayer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/quicktime/VerySimplePlayer.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VerySimplePlayer.py 2001/06/25 08:48:05 1.4 --- VerySimplePlayer.py 2001/08/25 12:13:33 1.5 *************** *** 4,15 **** """ ! import Qt ! import QuickTime ! import Qd ! import QuickDraw ! import Evt ! import Events ! import Win ! import Windows import macfs import sys --- 4,15 ---- """ ! from Carbon import Qt ! from Carbon import QuickTime ! from Carbon import Qd ! from Carbon import QuickDraw ! from Carbon import Evt ! from Carbon import Events ! from Carbon import Win ! from Carbon import Windows import macfs import sys From jackjansen@users.sourceforge.net Sat Aug 25 13:13:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wbase.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22245/Python/Mac/Tools/IDE Modified Files: Wbase.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Wbase.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wbase.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Wbase.py 2001/01/23 14:58:20 1.4 --- Wbase.py 2001/08/25 12:13:53 1.5 *************** *** 1,6 **** ! import Qd ! import Win ! import QuickDraw ! import Evt import string from types import * --- 1,6 ---- ! from Carbon import Qd ! from Carbon import Win ! from Carbon import QuickDraw ! from Carbon import Evt import string from types import * From jackjansen@users.sourceforge.net Sat Aug 25 13:14:15 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:14:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wlists.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22332/Python/Mac/Tools/IDE Modified Files: Wlists.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Wlists.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wlists.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Wlists.py 2001/01/23 14:58:20 1.4 --- Wlists.py 2001/08/25 12:14:13 1.5 *************** *** 1,11 **** import Wbase import Wkeys ! import Scrap import string ! import Evt ! import Events ! import Qd ! import Win ! import Lists --- 1,11 ---- import Wbase import Wkeys ! from Carbon import Scrap import string ! from Carbon import Evt ! from Carbon import Events ! from Carbon import Qd ! from Carbon import Win ! from Carbon import Lists *************** *** 40,44 **** def createlist(self): ! import List self._calcbounds() self.SetPort() --- 40,44 ---- def createlist(self): ! from Carbon import List self._calcbounds() self.SetPort() *************** *** 372,376 **** def createlist(self): ! import List self._calcbounds() self.SetPort() --- 372,376 ---- def createlist(self): ! from Carbon import List self._calcbounds() self.SetPort() From jackjansen@users.sourceforge.net Sat Aug 25 13:14:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:14:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wminiapp.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22375/Python/Mac/Tools/IDE Modified Files: Wminiapp.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Wminiapp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wminiapp.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Wminiapp.py 2000/07/01 14:31:24 1.1 --- Wminiapp.py 2001/08/25 12:14:26 1.2 *************** *** 6,10 **** def __init__(self): ! import Res Res.FSpOpenResFile("Widgets.rsrc", 1) self._menustocheck = [] --- 6,10 ---- def __init__(self): ! from Carbon import Res Res.FSpOpenResFile("Widgets.rsrc", 1) self._menustocheck = [] From jackjansen@users.sourceforge.net Sat Aug 25 13:14:53 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:14:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wtext.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22431/Python/Mac/Tools/IDE Modified Files: Wtext.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Wtext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wtext.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Wtext.py 2001/06/21 17:51:17 1.11 --- Wtext.py 2001/08/25 12:14:51 1.12 *************** *** 1,11 **** ! import Qd ! import TE ! import Fm import waste import WASTEconst ! import Res ! import Evt ! import Events ! import Scrap import string --- 1,11 ---- ! from Carbon import Qd ! from Carbon import TE ! from Carbon import Fm import waste import WASTEconst ! from Carbon import Res ! from Carbon import Evt ! from Carbon import Events ! from Carbon import Scrap import string *************** *** 16,21 **** import PyFontify from types import * ! import Fonts ! import TextEdit --- 16,21 ---- import PyFontify from types import * ! from Carbon import Fonts ! from Carbon import TextEdit *************** *** 176,180 **** def getfontsettings(self): ! import Res (font, style, size, color) = self.ted.WEGetRunInfo(0)[4] font = Fm.GetFontName(font) --- 176,180 ---- def getfontsettings(self): ! from Carbon import Res (font, style, size, color) = self.ted.WEGetRunInfo(0)[4] font = Fm.GetFontName(font) From jackjansen@users.sourceforge.net Sat Aug 25 13:10:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:10:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/PythonScript PythonScript.py,1.1.1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript In directory usw-pr-cvs1:/tmp/cvs-serv21410/Python/Mac/Contrib/PythonScript Modified Files: PythonScript.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PythonScript.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/PythonScript/PythonScript.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PythonScript.py 1998/08/18 14:55:18 1.1.1.1 --- PythonScript.py 2001/08/25 12:10:48 1.2 *************** *** 11,15 **** import baetools import baetypes ! import AE import AppleEvents import macfs --- 11,15 ---- import baetools import baetypes ! from Carbon import AE import AppleEvents import macfs From jackjansen@users.sourceforge.net Sat Aug 25 13:10:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:10:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/BBPy PythonSlave.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/BBPy In directory usw-pr-cvs1:/tmp/cvs-serv21466/Python/Mac/Contrib/BBPy Modified Files: PythonSlave.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: PythonSlave.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/BBPy/PythonSlave.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PythonSlave.py 2001/05/17 12:45:04 1.2 --- PythonSlave.py 2001/08/25 12:10:52 1.3 *************** *** 15,26 **** import aetools import string ! import AE ! import EasyDialogs import os ! import Qd from Types import * ! from Events import charCodeMask, cmdKey import MacOS ! import Evt def dummyfunc(): pass --- 15,26 ---- import aetools import string ! from Carbon import AE ! from Carbon import EasyDialogs import os ! from Carbon import Qd from Types import * ! from Carbon.Events import charCodeMask, cmdKey import MacOS ! from Carbon import Evt def dummyfunc(): pass From jackjansen@users.sourceforge.net Sat Aug 25 13:12:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:12:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Splash.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv21993/Python/Mac/Tools/IDE Modified Files: Splash.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Splash.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Splash.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Splash.py 2001/08/19 22:00:20 1.13 --- Splash.py 2001/08/25 12:12:52 1.14 *************** *** 1,9 **** ! import Dlg ! import Res splash = Dlg.GetNewDialog(468, -1) splash.DrawDialog() ! import Qd, TE, Fm, sys _real__import__ = None --- 1,10 ---- ! from Carbon import Dlg ! from Carbon import Res splash = Dlg.GetNewDialog(468, -1) splash.DrawDialog() ! from Carbon import Qd, TE, Fm ! import sys _real__import__ = None *************** *** 33,37 **** fontID = Fm.GetFNum("Python-Sans") if not fontID: ! from Fonts import geneva fontID = geneva Qd.TextFont(fontID) --- 34,38 ---- fontID = Fm.GetFNum("Python-Sans") if not fontID: ! from Carbon.Fonts import geneva fontID = geneva Qd.TextFont(fontID) *************** *** 69,76 **** kHighLevelEvent = 23 ! import Win ! from Fonts import * ! from QuickDraw import * ! from TextEdit import * import string import sys --- 70,77 ---- kHighLevelEvent = 23 ! from Carbon import Win ! from Carbon.Fonts import * ! from Carbon.QuickDraw import * ! from Carbon.TextEdit import * import string import sys *************** *** 131,136 **** def wait(): ! import Evt ! import Events global splash try: --- 132,137 ---- def wait(): ! from Carbon import Evt ! from Carbon import Events global splash try: From jackjansen@users.sourceforge.net Sat Aug 25 13:13:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tell.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22054/Python/Mac/Lib/test Modified Files: tell.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: tell.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/tell.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tell.py 1996/03/18 14:21:15 1.1 --- tell.py 2001/08/25 12:13:03 1.2 *************** *** 2,7 **** # This could be the basis of a Script Editor like application. ! from AE import * ! from AppleEvents import * import aetools import types --- 2,7 ---- # This could be the basis of a Script Editor like application. ! from Carbon.AE import * ! from Carbon.AppleEvents import * import aetools import types From jackjansen@users.sourceforge.net Sat Aug 25 13:13:09 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test test_setcontroldata.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22073/Python/Mac/Lib/test Modified Files: test_setcontroldata.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: test_setcontroldata.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/test_setcontroldata.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_setcontroldata.py 1999/12/09 15:36:36 1.1 --- test_setcontroldata.py 2001/08/25 12:13:07 1.2 *************** *** 1,4 **** import W ! from Controls import * w = W.Window((200,200), "Test") --- 1,4 ---- import W ! from Carbon.Controls import * w = W.Window((200,200), "Test") From jackjansen@users.sourceforge.net Sat Aug 25 13:13:15 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/calldll testcalldll.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/calldll In directory usw-pr-cvs1:/tmp/cvs-serv22090/Python/Mac/Demo/calldll Modified Files: testcalldll.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: testcalldll.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/calldll/testcalldll.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testcalldll.py 1999/03/17 21:44:07 1.1 --- testcalldll.py 2001/08/25 12:13:13 1.2 *************** *** 3,7 **** import sys import MacOS ! import Res fss, ok = macfs.PromptGetFile("Show me calldll.ppc.slb") --- 3,7 ---- import sys import MacOS ! from Carbon import Res fss, ok = macfs.PromptGetFile("Show me calldll.ppc.slb") From jackjansen@users.sourceforge.net Sat Aug 25 13:13:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tsnd.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22139/Python/Mac/Lib/test Modified Files: tsnd.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: tsnd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/tsnd.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tsnd.py 1995/01/30 11:52:54 1.1 --- tsnd.py 2001/08/25 12:13:24 1.2 *************** *** 2,7 **** # Get a list of all 'snd ' resources in the system and play them all. ! from Res import * ! from Snd import * ch = SndNewChannel(0, 0, None) --- 2,7 ---- # Get a list of all 'snd ' resources in the system and play them all. ! from Carbon.Res import * ! from Carbon.Snd import * ch = SndNewChannel(0, 0, None) From jackjansen@users.sourceforge.net Sat Aug 25 13:13:30 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/test tte.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22158/Python/Mac/Lib/test Modified Files: tte.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: tte.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/test/tte.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tte.py 1996/04/10 14:43:15 1.1 --- tte.py 2001/08/25 12:13:28 1.2 *************** *** 1,7 **** # Test TE module, simple version ! from Win import * ! from TE import * ! import Qd r = (40, 40, 140, 140) --- 1,7 ---- # Test TE module, simple version ! from Carbon.Win import * ! from Carbon.TE import * ! from Carbon import Qd r = (40, 40, 140, 140) From jackjansen@users.sourceforge.net Sat Aug 25 13:13:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib videoreader.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22205/Python/Mac/Lib Modified Files: videoreader.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: videoreader.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/videoreader.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** videoreader.py 2000/09/15 13:43:46 1.1 --- videoreader.py 2001/08/25 12:13:41 1.2 *************** *** 7,16 **** # import sys ! import Qt ! import QuickTime ! import Qd ! import Qdoffs ! import QDOffscreen ! import Res import MediaDescr import imgformat --- 7,16 ---- # import sys ! from Carbon import Qt ! from Carbon import QuickTime ! from Carbon import Qd ! from Carbon import Qdoffs ! from Carbon import QDOffscreen ! from Carbon import Res import MediaDescr import imgformat From jackjansen@users.sourceforge.net Sat Aug 25 13:13:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:13:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wapplication.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22229/Python/Mac/Tools/IDE Modified Files: Wapplication.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Wapplication.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wapplication.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Wapplication.py 2001/06/19 21:37:33 1.11 --- Wapplication.py 2001/08/25 12:13:47 1.12 *************** *** 1,6 **** import FrameWork ! import Win ! import Qd ! import Evt import MacOS import Events --- 1,6 ---- import FrameWork ! from Carbon import Win ! from Carbon import Qd ! from Carbon import Evt import MacOS import Events *************** *** 8,12 **** from types import * ! import Menu; MenuToolbox = Menu; del Menu --- 8,12 ---- from types import * ! from Carbon import Menu; MenuToolbox = Menu; del Menu From jackjansen@users.sourceforge.net Sat Aug 25 13:14:01 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:14:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wcontrols.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22266/Python/Mac/Tools/IDE Modified Files: Wcontrols.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Wcontrols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wcontrols.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Wcontrols.py 2001/07/10 19:25:40 1.6 --- Wcontrols.py 2001/08/25 12:13:59 1.7 *************** *** 1,8 **** ! import Ctl ! import Controls ! import Win import Wbase ! import Qd ! import Evt class ControlWidget(Wbase.ClickableWidget): --- 1,8 ---- ! from Carbon import Ctl ! from Carbon import Controls ! from Carbon import Win import Wbase ! from Carbon import Qd ! from Carbon import Evt class ControlWidget(Wbase.ClickableWidget): From jackjansen@users.sourceforge.net Sat Aug 25 13:14:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:14:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/waste wed.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/waste In directory usw-pr-cvs1:/tmp/cvs-serv22309/Python/Mac/Demo/waste Modified Files: wed.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: wed.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/waste/wed.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wed.py 2001/08/03 13:31:34 1.6 --- wed.py 2001/08/25 12:14:04 1.7 *************** *** 4,15 **** # - Functionality: find, etc. ! from Menu import DrawMenuBar from FrameWork import * ! import Win ! import Qd ! import Res import waste import WASTEconst ! import Scrap import os import macfs --- 4,15 ---- # - Functionality: find, etc. ! from Carbon.Menu import DrawMenuBar from FrameWork import * ! from Carbon import Win ! from Carbon import Qd ! from Carbon import Res import waste import WASTEconst ! from Carbon import Scrap import os import macfs From jackjansen@users.sourceforge.net Sat Aug 25 13:14:24 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:14:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wmenus.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22357/Python/Mac/Tools/IDE Modified Files: Wmenus.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Wmenus.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wmenus.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Wmenus.py 2001/01/29 15:18:46 1.4 --- Wmenus.py 2001/08/25 12:14:22 1.5 *************** *** 1,5 **** import FrameWork ! import Qd ! import Wbase, Wcontrols, Ctl, Controls from types import * import Wapplication --- 1,6 ---- import FrameWork ! from Carbon import Qd ! import Wbase, Wcontrols ! from Carbon import Ctl, Controls from types import * import Wapplication *************** *** 245,249 **** def _getfontlist(): ! import Res fontnames = [] for i in range(1, Res.CountResources('FOND') + 1): --- 246,250 ---- def _getfontlist(): ! from Carbon import Res fontnames = [] for i in range(1, Res.CountResources('FOND') + 1): From jackjansen@users.sourceforge.net Sat Aug 25 13:14:40 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:14:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wquicktime.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22397/Python/Mac/Tools/IDE Modified Files: Wquicktime.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Wquicktime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wquicktime.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Wquicktime.py 2001/01/23 14:58:20 1.3 --- Wquicktime.py 2001/08/25 12:14:38 1.4 *************** *** 1,9 **** import os ! import Qd ! import Win ! import Qt, QuickTime import W import macfs ! import Evt, Events _moviesinitialized = 0 --- 1,9 ---- import os ! from Carbon import Qd ! from Carbon import Win ! from Carbon import Qt, QuickTime import W import macfs ! from Carbon import Evt, Events _moviesinitialized = 0 From jackjansen@users.sourceforge.net Sat Aug 25 13:14:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:14:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wtraceback.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22468/Python/Mac/Tools/IDE Modified Files: Wtraceback.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Wtraceback.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wtraceback.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Wtraceback.py 2001/06/21 21:52:15 1.6 --- Wtraceback.py 2001/08/25 12:14:55 1.7 *************** *** 4,8 **** import os import types ! import List --- 4,8 ---- import os import types ! from Carbon import List From jackjansen@users.sourceforge.net Sat Aug 25 13:15:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 25 Aug 2001 05:15:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wwindows.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22501/Python/Mac/Tools/IDE Modified Files: Wwindows.py Log Message: Import the MacOS toolbox modules from the Carbon package. Index: Wwindows.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wwindows.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Wwindows.py 2001/06/19 21:37:33 1.10 --- Wwindows.py 2001/08/25 12:15:04 1.11 *************** *** 1,11 **** ! import Qd ! import Win ! import Evt ! import Fm import FrameWork ! import Windows ! import Events import Wbase ! import Dlg import MacOS import Menu --- 1,11 ---- ! from Carbon import Qd ! from Carbon import Win ! from Carbon import Evt ! from Carbon import Fm import FrameWork ! from Carbon import Windows ! from Carbon import Events import Wbase ! from Carbon import Dlg import MacOS import Menu *************** *** 571,575 **** "Can't find window or widget to insert text into; copy to clipboard instead?", 1) == 1: ! import Scrap Scrap.ZeroScrap() Scrap.PutScrap('TEXT', stuff) --- 571,575 ---- "Can't find window or widget to insert text into; copy to clipboard instead?", 1) == 1: ! from Carbon import Scrap Scrap.ZeroScrap() Scrap.PutScrap('TEXT', stuff) From bwarsaw@users.sourceforge.net Mon Aug 27 04:11:11 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Sun, 26 Aug 2001 20:11:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects stringobject.c,2.126,2.127 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv11992 Modified Files: stringobject.c Log Message: Two improvements suggested by Greg Stein: PyString_FromFormatV(): In the final resize at the end, we can use PyString_AS_STRING() since we know the object is a string and can avoid the typechecking. PyString_FromFormat(): GS sez: "For safety/propriety, you should call va_end() on the vargs variable." Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.126 retrieving revision 2.127 diff -C2 -d -r2.126 -r2.127 *** stringobject.c 2001/08/25 03:02:28 2.126 --- stringobject.c 2001/08/27 03:11:09 2.127 *************** *** 293,297 **** end: ! _PyString_Resize(&string, s - PyString_AsString(string)); return string; } --- 293,297 ---- end: ! _PyString_Resize(&string, s - PyString_AS_STRING(string)); return string; } *************** *** 300,303 **** --- 300,304 ---- PyString_FromFormat(const char *format, ...) { + PyObject* ret; va_list vargs; *************** *** 307,311 **** va_start(vargs); #endif ! return PyString_FromFormatV(format, vargs); } --- 308,314 ---- va_start(vargs); #endif ! ret = PyString_FromFormatV(format, vargs); ! va_end(vargs); ! return ret; } From tim_one@users.sourceforge.net Mon Aug 27 07:37:50 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 26 Aug 2001 23:37:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.107,1.108 NEWS,1.213,1.214 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv17006/python/Misc Modified Files: ACKS NEWS Log Message: SF patch [ #455137 ] Makes popen work with COMMAND.COM on WNT, from Brian Quinlan. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** ACKS 2001/08/17 17:36:00 1.107 --- ACKS 2001/08/27 06:37:48 1.108 *************** *** 318,321 **** --- 318,322 ---- Amrit Prem Paul Prescod + Brian Quinlan Eric Raymond John Redford Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.213 retrieving revision 1.214 diff -C2 -d -r1.213 -r1.214 *** NEWS 2001/08/22 21:36:50 1.213 --- NEWS 2001/08/27 06:37:48 1.214 *************** *** 16,19 **** --- 16,22 ---- Windows + + The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC + points to command.com (patch from Brian Quinlan). + What's New in Python 2.2a2? From tim_one@users.sourceforge.net Mon Aug 27 07:37:50 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 26 Aug 2001 23:37:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.196,2.197 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17006/python/Modules Modified Files: posixmodule.c Log Message: SF patch [ #455137 ] Makes popen work with COMMAND.COM on WNT, from Brian Quinlan. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.196 retrieving revision 2.197 diff -C2 -d -r2.196 -r2.197 *** posixmodule.c 2001/08/18 18:52:10 2.196 --- posixmodule.c 2001/08/27 06:37:48 2.197 *************** *** 2404,2414 **** if (i = GetEnvironmentVariable("COMSPEC",NULL,0)) { s1 = (char *)_alloca(i); if (!(x = GetEnvironmentVariable("COMSPEC", s1, i))) return x; ! if (GetVersion() < 0x80000000) { ! /* ! * NT/2000 ! */ x = i + strlen(s3) + strlen(cmdstring) + 1; s2 = (char *)_alloca(x); --- 2404,2424 ---- if (i = GetEnvironmentVariable("COMSPEC",NULL,0)) { + char *comshell; + s1 = (char *)_alloca(i); if (!(x = GetEnvironmentVariable("COMSPEC", s1, i))) return x; ! ! /* Explicitly check if we are using COMMAND.COM. If we are ! * then use the w9xpopen hack. ! */ ! comshell = s1 + x; ! while (comshell >= s1 && *comshell != '\\') ! --comshell; ! ++comshell; ! ! if (GetVersion() < 0x80000000 && ! _stricmp(comshell, "command.com") != 0) { ! /* NT/2000 and not using command.com. */ x = i + strlen(s3) + strlen(cmdstring) + 1; s2 = (char *)_alloca(x); *************** *** 2418,2423 **** else { /* ! * Oh gag, we're on Win9x. Use the workaround listed in ! * KB: Q150956 */ char modulepath[_MAX_PATH]; --- 2428,2433 ---- else { /* ! * Oh gag, we're on Win9x or using COMMAND.COM. Use ! * the workaround listed in KB: Q150956 */ char modulepath[_MAX_PATH]; *************** *** 2455,2459 **** PyErr_Format(PyExc_RuntimeError, "Can not locate '%s' which is needed " ! "for popen to work on this platform.", szConsoleSpawn); return FALSE; --- 2465,2470 ---- PyErr_Format(PyExc_RuntimeError, "Can not locate '%s' which is needed " ! "for popen to work with your shell " ! "or platform.", szConsoleSpawn); return FALSE; *************** *** 2479,2483 **** Now we'll just error out.. */ else { ! PyErr_SetString(PyExc_RuntimeError, "Can not locate a COMSPEC environment variable to use as the shell"); return FALSE; } --- 2490,2496 ---- Now we'll just error out.. */ else { ! PyErr_SetString(PyExc_RuntimeError, ! "Cannot locate a COMSPEC environment variable to " ! "use as the shell"); return FALSE; } *************** *** 2508,2512 **** return TRUE; } ! win32_error("CreateProcess", NULL); return FALSE; } --- 2521,2525 ---- return TRUE; } ! win32_error("CreateProcess", s2); return FALSE; } From jackjansen@users.sourceforge.net Mon Aug 27 11:54:52 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 03:54:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wtext.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8618/python/Mac/Tools/IDE Modified Files: Wtext.py Log Message: A few forgotten "from Carbon"s. Index: Wtext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wtext.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Wtext.py 2001/08/25 12:14:51 1.12 --- Wtext.py 2001/08/27 10:54:50 1.13 *************** *** 10,14 **** import string ! import Win import Wbase import Wkeys --- 10,14 ---- import string ! from Carbon import Win import Wbase import Wkeys From jackjansen@users.sourceforge.net Mon Aug 27 11:54:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 03:54:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wwindows.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8641/python/Mac/Tools/IDE Modified Files: Wwindows.py Log Message: A few forgotten "from Carbon"s. Index: Wwindows.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wwindows.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Wwindows.py 2001/08/25 12:15:04 1.11 --- Wwindows.py 2001/08/27 10:54:55 1.12 *************** *** 9,13 **** from Carbon import Dlg import MacOS ! import Menu import struct import traceback --- 9,13 ---- from Carbon import Dlg import MacOS ! from Carbon import Menu import struct import traceback From jackjansen@users.sourceforge.net Mon Aug 27 11:55:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 03:55:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wapplication.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8814/python/Mac/Tools/IDE Modified Files: Wapplication.py Log Message: - A forgotten "from Carbon". - Made the "killed unknown window" code dependent on a global var, so you can easily turn the behaviour off for IDE debugging. Index: Wapplication.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wapplication.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Wapplication.py 2001/08/25 12:13:47 1.12 --- Wapplication.py 2001/08/27 10:55:41 1.13 *************** *** 4,8 **** from Carbon import Evt import MacOS ! import Events import traceback from types import * --- 4,8 ---- from Carbon import Evt import MacOS ! from Carbon import Events import traceback from types import * *************** *** 10,13 **** --- 10,14 ---- from Carbon import Menu; MenuToolbox = Menu; del Menu + KILLUNKNOWNWINDOWS=1 # Set to 0 for debugging. class Application(FrameWork.Application): *************** *** 185,189 **** window.do_rawupdate(wid, event) else: ! if wid: wid.HideWindow() import sys --- 186,190 ---- window.do_rawupdate(wid, event) else: ! if KILLUNKNOWNWINDOWS and wid: wid.HideWindow() import sys From jackjansen@users.sourceforge.net Mon Aug 27 14:57:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 06:57:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonInterpreter.mcp,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv17348/python/Mac/Build Modified Files: PythonInterpreter.mcp Log Message: Added targets for building the Carbon and Classic interpreter if you don't want to go through fullbuild.py. Index: PythonInterpreter.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonInterpreter.mcp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 Binary files /tmp/cvsqoNhiH and /tmp/cvsOCGk7f differ From jackjansen@users.sourceforge.net Mon Aug 27 14:58:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 06:58:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonStandalone.mcp,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv17446/python/Mac/Build Modified Files: PythonStandalone.mcp Log Message: Updated to the current state of affairs. Index: PythonStandalone.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandalone.mcp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 Binary files /tmp/cvs2mSO0I and /tmp/cvs06TD5g differ From jackjansen@users.sourceforge.net Mon Aug 27 14:58:23 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 06:58:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonStandSmall.mcp,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv17515/python/Mac/Build Modified Files: PythonStandSmall.mcp Log Message: Updated to the current state of affairs. Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 Binary files /tmp/cvsDF5XyQ and /tmp/cvsWBHHsz differ From jackjansen@users.sourceforge.net Mon Aug 27 14:59:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 06:59:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/macfreeze macgen_src.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/macfreeze In directory usw-pr-cvs1:/tmp/cvs-serv17875/python/Mac/Tools/macfreeze Modified Files: macgen_src.py Log Message: When we're freezing to sourcecode and one of the modules is a dynamic module that is in a package we freeze that module at toplevel (outside any package). Not optimal, but there is little more we can do as config.c has no way to specify a builtin module has to be dumped into a package. Index: macgen_src.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/macfreeze/macgen_src.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** macgen_src.py 1999/10/01 08:28:01 1.3 --- macgen_src.py 2001/08/27 13:59:35 1.4 *************** *** 89,92 **** --- 89,96 ---- for module in module_dict.keys(): if module_dict[module].gettype() in ('builtin', 'dynamic'): + # if the module is in a package we have no choice but + # to put it at the toplevel in the frozen application. + if '.' in module: + module = module.split('.')[-1] c_modules.append(module) ifp = open(CONFIG_TEMPLATE) From jackjansen@users.sourceforge.net Mon Aug 27 15:01:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 07:01:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python mactoolboxglue.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv18333/python/Python Modified Files: mactoolboxglue.c Log Message: Refer to the toolbox modules by their official name (Carbon.AE), not the internal name (_AE). This can slow things down (once) but it's the only way I can get things to work on OSX, OS9 dynamically loaded and OS9 frozen. Index: mactoolboxglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/mactoolboxglue.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mactoolboxglue.c 2001/08/23 13:53:34 1.3 --- mactoolboxglue.c 2001/08/27 14:01:05 1.4 *************** *** 269,273 **** } ! /* Convert a Point to a Python object */ PyObject * PyMac_BuildFixed(Fixed f) --- 269,273 ---- } ! /* Convert a Fixed to a Python object */ PyObject * PyMac_BuildFixed(Fixed f) *************** *** 349,410 **** GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "macfs") ! GLUE_NEW(AppleEvent *, AEDesc_New, "_AE") /* XXXX Why by address? */ ! GLUE_CONVERT(AppleEvent, AEDesc_Convert, "_AE") ! GLUE_NEW(Component, CmpObj_New, "_Cm") ! GLUE_CONVERT(Component, CmpObj_Convert, "_Cm") ! GLUE_NEW(ComponentInstance, CmpInstObj_New, "_Cm") ! GLUE_CONVERT(ComponentInstance, CmpInstObj_Convert, "_Cm") ! GLUE_NEW(ControlHandle, CtlObj_New, "_Ctl") ! GLUE_CONVERT(ControlHandle, CtlObj_Convert, "_Ctl") ! GLUE_NEW(DialogPtr, DlgObj_New, "_Dlg") ! GLUE_CONVERT(DialogPtr, DlgObj_Convert, "_Dlg") ! GLUE_NEW(DialogPtr, DlgObj_WhichDialog, "_Dlg") ! GLUE_NEW(DragReference, DragObj_New, "_Drag") ! GLUE_CONVERT(DragReference, DragObj_Convert, "_Drag") ! GLUE_NEW(ListHandle, ListObj_New, "_List") ! GLUE_CONVERT(ListHandle, ListObj_Convert, "_List") ! GLUE_NEW(MenuHandle, MenuObj_New, "_Menu") ! GLUE_CONVERT(MenuHandle, MenuObj_Convert, "_Menu") ! GLUE_NEW(GrafPtr, GrafObj_New, "_Qd") ! GLUE_CONVERT(GrafPtr, GrafObj_Convert, "_Qd") ! GLUE_NEW(BitMapPtr, BMObj_New, "_Qd") ! GLUE_CONVERT(BitMapPtr, BMObj_Convert, "_Qd") ! GLUE_NEW(RGBColor *, QdRGB_New, "_Qd") /* XXXX Why? */ ! GLUE_CONVERT(RGBColor, QdRGB_Convert, "_Qd") ! GLUE_NEW(GWorldPtr, GWorldObj_New, "_Qdoffs") ! GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "_Qdoffs") ! GLUE_NEW(Track, TrackObj_New, "_Qt") ! GLUE_CONVERT(Track, TrackObj_Convert, "_Qt") ! GLUE_NEW(Movie, MovieObj_New, "_Qt") ! GLUE_CONVERT(Movie, MovieObj_Convert, "_Qt") ! GLUE_NEW(MovieController, MovieCtlObj_New, "_Qt") ! GLUE_CONVERT(MovieController, MovieCtlObj_Convert, "_Qt") ! GLUE_NEW(TimeBase, TimeBaseObj_New, "_Qt") ! GLUE_CONVERT(TimeBase, TimeBaseObj_Convert, "_Qt") ! GLUE_NEW(UserData, UserDataObj_New, "_Qt") ! GLUE_CONVERT(UserData, UserDataObj_Convert, "_Qt") ! GLUE_NEW(Media, MediaObj_New, "_Qt") ! GLUE_CONVERT(Media, MediaObj_Convert, "_Qt") ! GLUE_NEW(Handle, ResObj_New, "_Res") ! GLUE_CONVERT(Handle, ResObj_Convert, "_Res") ! GLUE_NEW(Handle, OptResObj_New, "_Res") ! GLUE_CONVERT(Handle, OptResObj_Convert, "_Res") ! GLUE_NEW(TEHandle, TEObj_New, "_TE") ! GLUE_CONVERT(TEHandle, TEObj_Convert, "_TE") ! GLUE_NEW(WindowPtr, WinObj_New, "_Win") ! GLUE_CONVERT(WindowPtr, WinObj_Convert, "_Win") ! GLUE_NEW(WindowPtr, WinObj_WhichWindow, "_Win") #endif /* USE_TOOLBOX_OBJECT_GLUE */ --- 349,410 ---- GLUE_CONVERT(FSSpec, PyMac_GetFSSpec, "macfs") ! GLUE_NEW(AppleEvent *, AEDesc_New, "Carbon.AE") /* XXXX Why by address? */ ! GLUE_CONVERT(AppleEvent, AEDesc_Convert, "Carbon.AE") ! GLUE_NEW(Component, CmpObj_New, "Carbon.Cm") ! GLUE_CONVERT(Component, CmpObj_Convert, "Carbon.Cm") ! GLUE_NEW(ComponentInstance, CmpInstObj_New, "Carbon.Cm") ! GLUE_CONVERT(ComponentInstance, CmpInstObj_Convert, "Carbon.Cm") ! GLUE_NEW(ControlHandle, CtlObj_New, "Carbon.Ctl") ! GLUE_CONVERT(ControlHandle, CtlObj_Convert, "Carbon.Ctl") ! GLUE_NEW(DialogPtr, DlgObj_New, "Carbon.Dlg") ! GLUE_CONVERT(DialogPtr, DlgObj_Convert, "Carbon.Dlg") ! GLUE_NEW(DialogPtr, DlgObj_WhichDialog, "Carbon.Dlg") ! GLUE_NEW(DragReference, DragObj_New, "Carbon.Drag") ! GLUE_CONVERT(DragReference, DragObj_Convert, "Carbon.Drag") ! GLUE_NEW(ListHandle, ListObj_New, "Carbon.List") ! GLUE_CONVERT(ListHandle, ListObj_Convert, "Carbon.List") ! GLUE_NEW(MenuHandle, MenuObj_New, "Carbon.Menu") ! GLUE_CONVERT(MenuHandle, MenuObj_Convert, "Carbon.Menu") ! GLUE_NEW(GrafPtr, GrafObj_New, "Carbon.Qd") ! GLUE_CONVERT(GrafPtr, GrafObj_Convert, "Carbon.Qd") ! GLUE_NEW(BitMapPtr, BMObj_New, "Carbon.Qd") ! GLUE_CONVERT(BitMapPtr, BMObj_Convert, "Carbon.Qd") ! GLUE_NEW(RGBColor *, QdRGB_New, "Carbon.Qd") /* XXXX Why? */ ! GLUE_CONVERT(RGBColor, QdRGB_Convert, "Carbon.Qd") ! GLUE_NEW(GWorldPtr, GWorldObj_New, "Carbon.Qdoffs") ! GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Carbon.Qdoffs") ! GLUE_NEW(Track, TrackObj_New, "Carbon.Qt") ! GLUE_CONVERT(Track, TrackObj_Convert, "Carbon.Qt") ! GLUE_NEW(Movie, MovieObj_New, "Carbon.Qt") ! GLUE_CONVERT(Movie, MovieObj_Convert, "Carbon.Qt") ! GLUE_NEW(MovieController, MovieCtlObj_New, "Carbon.Qt") ! GLUE_CONVERT(MovieController, MovieCtlObj_Convert, "Carbon.Qt") ! GLUE_NEW(TimeBase, TimeBaseObj_New, "Carbon.Qt") ! GLUE_CONVERT(TimeBase, TimeBaseObj_Convert, "Carbon.Qt") ! GLUE_NEW(UserData, UserDataObj_New, "Carbon.Qt") ! GLUE_CONVERT(UserData, UserDataObj_Convert, "Carbon.Qt") ! GLUE_NEW(Media, MediaObj_New, "Carbon.Qt") ! GLUE_CONVERT(Media, MediaObj_Convert, "Carbon.Qt") ! GLUE_NEW(Handle, ResObj_New, "Carbon.Res") ! GLUE_CONVERT(Handle, ResObj_Convert, "Carbon.Res") ! GLUE_NEW(Handle, OptResObj_New, "Carbon.Res") ! GLUE_CONVERT(Handle, OptResObj_Convert, "Carbon.Res") ! GLUE_NEW(TEHandle, TEObj_New, "Carbon.TE") ! GLUE_CONVERT(TEHandle, TEObj_Convert, "Carbon.TE") ! GLUE_NEW(WindowPtr, WinObj_New, "Carbon.Win") ! GLUE_CONVERT(WindowPtr, WinObj_Convert, "Carbon.Win") ! GLUE_NEW(WindowPtr, WinObj_WhichWindow, "Carbon.Win") #endif /* USE_TOOLBOX_OBJECT_GLUE */ From jackjansen@users.sourceforge.net Mon Aug 27 15:30:58 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 07:30:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/bgen/bgen bgenGenerator.py,1.10,1.11 bgenGeneratorGroup.py,1.5,1.6 bgenModule.py,1.8,1.9 bgenObjectDefinition.py,1.11,1.12 bgenOutput.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/bgen/bgen In directory usw-pr-cvs1:/tmp/cvs-serv27501 Modified Files: bgenGenerator.py bgenGeneratorGroup.py bgenModule.py bgenObjectDefinition.py bgenOutput.py Log Message: Fixes by Thomas Heller: - make the selftests work again (they were apparently not used since very early in bgen's development), with some minor cleanup by me - make emacs python mode happier Index: bgenGenerator.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenGenerator.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** bgenGenerator.py 2001/07/01 22:09:24 1.10 --- bgenGenerator.py 2001/08/27 14:30:55 1.11 *************** *** 260,269 **** def _test(): void = None ! eggs = Generator(void, "eggs", ! Variable(stringptr, 'cmd'), ! Variable(int, 'x'), ! Variable(double, 'y', InOutMode), ! Variable(int, 'status', ErrorMode), ! ) eggs.setprefix("spam") print "/* START */" --- 260,269 ---- def _test(): void = None ! eggs = FunctionGenerator(void, "eggs", ! (stringptr, 'cmd', InMode), ! (int, 'x', InMode), ! (double, 'y', InOutMode), ! (int, 'status', ErrorMode), ! ) eggs.setprefix("spam") print "/* START */" Index: bgenGeneratorGroup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenGeneratorGroup.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** bgenGeneratorGroup.py 2000/12/12 22:24:35 1.5 --- bgenGeneratorGroup.py 2001/08/27 14:30:55 1.6 *************** *** 29,35 **** def _test(): ! from bgenGenerator import Generator group = GeneratorGroup("spam") ! eggs = Generator(void, "eggs") group.add(eggs) print "/* START */" --- 29,36 ---- def _test(): ! void = None ! from bgenGenerator import FunctionGenerator group = GeneratorGroup("spam") ! eggs = FunctionGenerator(void, "eggs") group.add(eggs) print "/* START */" Index: bgenModule.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenModule.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** bgenModule.py 2001/05/19 13:59:11 1.8 --- bgenModule.py 2001/08/27 14:30:55 1.9 *************** *** 79,85 **** def _test(): ! from bgenGenerator import Generator m = Module("spam", "", "#include ") ! g = Generator(None, "bacon") m.add(g) m.generate() --- 79,85 ---- def _test(): ! from bgenGenerator import FunctionGenerator m = Module("spam", "", "#include ") ! g = FunctionGenerator(None, "bacon") m.add(g) m.generate() Index: bgenObjectDefinition.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenObjectDefinition.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** bgenObjectDefinition.py 2001/06/28 22:07:30 1.11 --- bgenObjectDefinition.py 2001/08/27 14:30:55 1.12 *************** *** 190,194 **** self.name, self.typename); IndentLevel() ! Output("""Py_FatalError("can't initialize %sType");""", self.name) DedentLevel() --- 190,194 ---- self.name, self.typename); IndentLevel() ! Output("""Py_FatalError("can\'t initialize %sType");""", self.name) DedentLevel() Index: bgenOutput.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenOutput.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bgenOutput.py 1995/01/25 22:59:16 1.2 --- bgenOutput.py 2001/08/27 14:30:55 1.3 *************** *** 44,48 **** def GetLevel(): ! """"Return the current indentation level.""" return _Level --- 44,48 ---- def GetLevel(): ! """Return the current indentation level.""" return _Level From jackjansen@users.sourceforge.net Mon Aug 27 16:08:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 08:08:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils ccompiler.py,1.39,1.40 unixccompiler.py,1.35,1.36 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv4659 Modified Files: ccompiler.py unixccompiler.py Log Message: Patch by Bill Noon: added 'dylib' as a library type along with 'static' and 'shared'. This fixes extension building for dynamic Pythons on MacOSX. Index: ccompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/ccompiler.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ccompiler.py 2001/02/27 19:13:15 1.39 --- ccompiler.py 2001/08/27 15:08:16 1.40 *************** *** 793,798 **** if output_dir is None: output_dir = '' ! if lib_type not in ("static","shared"): ! raise ValueError, "'lib_type' must be \"static\" or \"shared\"" fmt = getattr (self, lib_type + "_lib_format") ext = getattr (self, lib_type + "_lib_extension") --- 793,798 ---- if output_dir is None: output_dir = '' ! if lib_type not in ("static","shared","dylib"): ! raise ValueError, "'lib_type' must be \"static\", \"shared\" or \"dylib\"" fmt = getattr (self, lib_type + "_lib_format") ext = getattr (self, lib_type + "_lib_extension") Index: unixccompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/unixccompiler.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** unixccompiler.py 2001/07/16 14:46:13 1.35 --- unixccompiler.py 2001/08/27 15:08:16 1.36 *************** *** 72,76 **** static_lib_extension = ".a" shared_lib_extension = ".so" ! static_lib_format = shared_lib_format = "lib%s%s" --- 72,77 ---- static_lib_extension = ".a" shared_lib_extension = ".so" ! dylib_lib_extension = ".dylib" ! static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" *************** *** 260,263 **** --- 261,266 ---- shared = os.path.join( dir, self.library_filename(lib, lib_type='shared')) + dylib = os.path.join( + dir, self.library_filename(lib, lib_type='dylib')) static = os.path.join( dir, self.library_filename(lib, lib_type='static')) *************** *** 267,271 **** # assuming that *all* Unix C compilers do. And of course I'm # ignoring even GCC's "-static" option. So sue me. ! if os.path.exists(shared): return shared elif os.path.exists(static): --- 270,276 ---- # assuming that *all* Unix C compilers do. And of course I'm # ignoring even GCC's "-static" option. So sue me. ! if os.path.exists(dylib): ! return dylib ! elif os.path.exists(shared): return shared elif os.path.exists(static): From jackjansen@users.sourceforge.net Mon Aug 27 16:24:09 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 08:24:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib EasyDialogs.py,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv9687 Modified Files: EasyDialogs.py Log Message: Patch by Dean Draayer: support for indeterminate progress bars. You get these by specifying maxval=0, which is now also the default. Untested. Index: EasyDialogs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/EasyDialogs.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** EasyDialogs.py 2001/08/25 12:04:10 1.34 --- EasyDialogs.py 2001/08/27 15:24:07 1.35 *************** *** 215,231 **** screenbounds[2]-4, screenbounds[3]-4 ! class ProgressBar: ! def __init__(self, title="Working...", maxval=100, label="", id=263): self.w = None self.d = None - self.maxval = maxval - self.curval = -1 self.d = GetNewDialog(id, -1) self.w = self.d.GetDialogWindow() self.label(label) - self._update(0) - self.d.AutoSizeDialog() self.title(title) self.w.ShowWindow() self.d.DrawDialog() --- 215,231 ---- screenbounds[2]-4, screenbounds[3]-4 ! kControlProgressBarIndeterminateTag = 'inde' # from Controls.py ! ! class ProgressBar: ! def __init__(self, title="Working...", maxval=0, label="", id=263): self.w = None self.d = None self.d = GetNewDialog(id, -1) self.w = self.d.GetDialogWindow() self.label(label) self.title(title) + self.set(0, maxval) + self.d.AutoSizeDialog() self.w.ShowWindow() self.d.DrawDialog() *************** *** 249,270 **** self._label = lf2cr(newstr[0]) text_h = self.d.GetDialogItemAsControl(2) ! SetDialogItemText(text_h, self._label) ! def _update(self, value): maxval = self.maxval ! if maxval == 0: ! # XXXX Quick fix. Should probably display an unknown duration ! value = 0 ! maxval = 1 ! if maxval > 32767: ! value = int(value/(maxval/32767.0)) ! maxval = 32767 ! progbar = self.d.GetDialogItemAsControl(3) ! progbar.SetControlMaximum(maxval) ! progbar.SetControlValue(value) # Test for cancel button - ready, ev = Evt.WaitNextEvent( Events.mDownMask, 1 ) ! if ready : what,msg,when,where,mod = ev part = Win.FindWindow(where)[0] --- 249,269 ---- self._label = lf2cr(newstr[0]) text_h = self.d.GetDialogItemAsControl(2) ! SetDialogItemText(text_h, self._label) ! def _update(self, value): maxval = self.maxval ! if maxval == 0: # an indeterminate bar ! Ctl.IdleControls(self.w) # spin the barber pole ! else: # a determinate bar ! if maxval > 32767: ! value = int(value/(maxval/32767.0)) ! maxval = 32767 ! progbar = self.d.GetDialogItemAsControl(3) ! progbar.SetControlMaximum(maxval) ! progbar.SetControlValue(value) # set the bar length ! # Test for cancel button ready, ev = Evt.WaitNextEvent( Events.mDownMask, 1 ) ! if ready : what,msg,when,where,mod = ev part = Win.FindWindow(where)[0] *************** *** 287,292 **** if max != None: self.maxval = max ! if value < 0: value = 0 ! if value > self.maxval: value = self.maxval self.curval = value self._update(value) --- 286,298 ---- if max != None: self.maxval = max ! bar = self.d.GetDialogItemAsControl(3) ! if max <= 0: # indeterminate bar ! bar.SetControlData(0,kControlProgressBarIndeterminateTag,'\x01') ! else: # determinate bar ! bar.SetControlData(0,kControlProgressBarIndeterminateTag,'\x00') ! if value < 0: ! value = 0 ! elif value > self.maxval: ! value = self.maxval self.curval = value self._update(value) *************** *** 541,556 **** else: Message("Hello everybody!!\nThe secret nickname of %s is %s!!!"%(s, s2)) ! text = ( "Working Hard...", "Hardly Working..." , "So far, so good!", "Keep on truckin'" ) ! bar = ProgressBar("Progress, progress...", 100) try: appsw = MacOS.SchedParams(1, 0) ! for i in range(100): bar.set(i) ! time.sleep(0.1) if i % 10 == 0: bar.label(text[(i/10) % 4]) bar.label("Done.") ! time.sleep(0.3) # give'em a chance to see the done. finally: del bar --- 547,566 ---- else: Message("Hello everybody!!\nThe secret nickname of %s is %s!!!"%(s, s2)) ! text = ( "Working Hard...", "Hardly Working..." , "So far, so good!", "Keep on truckin'" ) ! bar = ProgressBar("Progress, progress...", 0, label="Ramping up...") try: appsw = MacOS.SchedParams(1, 0) ! for i in xrange(20): ! bar.inc() ! time.sleep(0.05) ! bar.set(0,100) ! for i in xrange(100): bar.set(i) ! time.sleep(0.05) if i % 10 == 0: bar.label(text[(i/10) % 4]) bar.label("Done.") ! time.sleep(1.0) # give'em a chance to see "Done." finally: del bar From jackjansen@users.sourceforge.net Mon Aug 27 16:30:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 08:30:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac ReadMe,1.31,1.32 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv12579 Modified Files: ReadMe Log Message: Added Dean Draayer to the thank you list. Index: ReadMe =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/ReadMe,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ReadMe 2001/08/03 13:31:34 1.31 --- ReadMe 2001/08/27 15:30:48 1.32 *************** *** 188,193 **** Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn, ! Tom Bridgman, Russel Owen, Pascal Oberndoerfer and all the other people ! who provided feedback, code or both! MacPython includes waste, a TextEdit replacement which is (c) 1998 Marco Piovanelli. --- 188,193 ---- Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn, ! Tom Bridgman, Russel Owen, Pascal Oberndoerfer, Dean Draayer ! and all the other people who provided feedback, code or both! MacPython includes waste, a TextEdit replacement which is (c) 1998 Marco Piovanelli. From tim_one@users.sourceforge.net Mon Aug 27 20:19:30 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 27 Aug 2001 12:19:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_compile.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11755/python/Lib/test Modified Files: test_compile.py Log Message: SF bug [#455775] float parsing discrepancy. PyTokenizer_Get: error if exponent contains no digits (3e, 2.0e+, ...). Index: test_compile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_compile.py 2001/02/21 07:29:48 1.6 --- test_compile.py 2001/08/27 19:19:28 1.7 *************** *** 51,52 **** --- 51,67 ---- except SyntaxError: pass + + if verbose: + print "testing bad float literals" + + def expect_error(s): + try: + eval(s) + raise TestFailed("%r accepted" % s) + except SyntaxError: + pass + + expect_error("2e") + expect_error("2.0e+") + expect_error("1e-") + expect_error("3-4e/21") From tim_one@users.sourceforge.net Mon Aug 27 20:19:30 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 27 Aug 2001 12:19:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Parser tokenizer.c,2.51,2.52 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory usw-pr-cvs1:/tmp/cvs-serv11755/python/Parser Modified Files: tokenizer.c Log Message: SF bug [#455775] float parsing discrepancy. PyTokenizer_Get: error if exponent contains no digits (3e, 2.0e+, ...). Index: tokenizer.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/tokenizer.c,v retrieving revision 2.51 retrieving revision 2.52 diff -C2 -d -r2.51 -r2.52 *** tokenizer.c 2001/08/08 05:00:18 2.51 --- tokenizer.c 2001/08/27 19:19:28 2.52 *************** *** 757,763 **** c = tok_nextc(tok); else { ! /* Accept floating point numbers. ! XXX This accepts incomplete things like ! XXX 12e or 1e+; worry run-time */ if (c == '.') { fraction: --- 757,761 ---- c = tok_nextc(tok); else { ! /* Accept floating point numbers. */ if (c == '.') { fraction: *************** *** 772,778 **** if (c == '+' || c == '-') c = tok_nextc(tok); ! while (isdigit(c)) { ! c = tok_nextc(tok); } } #ifndef WITHOUT_COMPLEX --- 770,781 ---- if (c == '+' || c == '-') c = tok_nextc(tok); ! if (!isdigit(c)) { ! tok->done = E_TOKEN; ! tok_backup(tok, c); ! return ERRORTOKEN; } + do { + c = tok_nextc(tok); + } while (isdigit(c)); } #ifndef WITHOUT_COMPLEX From jhylton@users.sourceforge.net Mon Aug 27 20:45:28 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 12:45:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.218,2.219 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv23783 Modified Files: compile.c Log Message: If an integer constant can't be generated from an integer literal because of overflow, generate a long instead. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.218 retrieving revision 2.219 diff -C2 -d -r2.218 -r2.219 *** compile.c 2001/08/17 18:39:25 2.218 --- compile.c 2001/08/27 19:45:25 2.219 *************** *** 1085,1093 **** x = PyOS_strtol(s, &end, 0); if (*end == '\0') { ! if (errno != 0) { ! com_error(co, PyExc_OverflowError, ! "integer literal too large"); ! return NULL; ! } return PyInt_FromLong(x); } --- 1085,1090 ---- x = PyOS_strtol(s, &end, 0); if (*end == '\0') { ! if (errno != 0) ! return PyLong_FromString(s, (char **)0, 0); return PyInt_FromLong(x); } From mwh@users.sourceforge.net Mon Aug 27 21:02:19 2001 From: mwh@users.sourceforge.net (Michael Hudson) Date: Mon, 27 Aug 2001 13:02:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref refa1.tex,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv30254/ref Modified Files: refa1.tex Log Message: Docs for the PEP 264 changes. Index: refa1.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/refa1.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** refa1.tex 2001/03/28 16:55:53 1.5 --- refa1.tex 2001/08/27 20:02:17 1.6 *************** *** 41,52 **** \end{itemize} ! The only feature recognized by Python 2.1 is \samp{nested_scopes}. ! A future statement is recognized and treated specially at compile time: ! Changes to the semantics of core constructs are often implemented by ! generating different code. It may even be the case that a new feature ! introduces new incompatible syntax (such as a new reserved word), in ! which case the compiler may need to parse the module differently. Such ! decisions cannot be pushed off until runtime. For any given release, the compiler knows which feature names have been --- 41,55 ---- \end{itemize} ! The features recognized by Python 2.2 are \samp{generators}, ! \samp{division} and \samp{nested_scopes}. \samp{nested_scopes} ! is redundant in 2.2 as the nested scopes feature is active by default. ! A future statement is recognized and treated specially at compile ! time: Changes to the semantics of core constructs are often ! implemented by generating different code. It may even be the case ! that a new feature introduces new incompatible syntax (such as a new ! reserved word), in which case the compiler may need to parse the ! module differently. Such decisions cannot be pushed off until ! runtime. For any given release, the compiler knows which feature names have been *************** *** 73,78 **** Code compiled by an exec statement or calls to the builtin functions \function{compile()} and \function{execfile()} that occur in a module ! \module{M} containing a future statement will use the new syntax or ! semantics associated with the future statement. A future statement typed at an interactive interpreter prompt will --- 76,84 ---- Code compiled by an exec statement or calls to the builtin functions \function{compile()} and \function{execfile()} that occur in a module ! \module{M} containing a future statement will, by default, use the new ! syntax or semantics associated with the future statement. This can, ! starting with Python 2.2 be controlled by optional arguments to ! \function{compile()} --- see the documentation of that function in the ! library reference for details. A future statement typed at an interactive interpreter prompt will *************** *** 111,115 **** \begin{verbatim} ! FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ")" \end{verbatim} --- 117,122 ---- \begin{verbatim} ! FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease "," ! CompilerFlag ")" \end{verbatim} *************** *** 143,146 **** --- 150,158 ---- Instances of class \class{_Feature} have two corresponding methods, \method{getOptionalRelease()} and \method{getMandatoryRelease()}. + + CompilerFlag is the (bitfield) flag that should be passed in the + fourth argument to the builtin function \function{compile()} to enable + the feature in dynamically compiled code. This flag is stored in the + \member{compiler_flag} attribute on \class{_Future} instances. No feature description will ever be deleted from \module{__future__}. From mwh@users.sourceforge.net Mon Aug 27 21:02:19 2001 From: mwh@users.sourceforge.net (Michael Hudson) Date: Mon, 27 Aug 2001 13:02:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcode.tex,1.12,1.13 libcodeop.tex,1.3,1.4 libfuncs.tex,1.81,1.82 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv30254/lib Modified Files: libcode.tex libcodeop.tex libfuncs.tex Log Message: Docs for the PEP 264 changes. Index: libcode.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcode.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** libcode.tex 2000/09/14 20:42:53 1.12 --- libcode.tex 2001/08/27 20:02:16 1.13 *************** *** 61,67 **** valid; \code{None} if the command is incomplete; raises \exception{SyntaxError} if the command is complete and contains a ! syntax error, or raises \exception{OverflowError} if the command ! includes a numeric constant which exceeds the range of the ! appropriate numeric type. \end{funcdesc} --- 61,66 ---- valid; \code{None} if the command is incomplete; raises \exception{SyntaxError} if the command is complete and contains a ! syntax error, or raises \exception{OverflowError} or ! \exception{ValueError} if the command cotains an invalid literal. \end{funcdesc} Index: libcodeop.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcodeop.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libcodeop.tex 2000/12/01 15:25:23 1.3 --- libcodeop.tex 2001/08/27 20:02:16 1.4 *************** *** 6,18 **** \declaremodule{standard}{codeop} \sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il} \modulesynopsis{Compile (possibly incomplete) Python code.} ! The \module{codeop} module provides a function to compile Python code ! with hints on whether it is certainly complete, possibly complete or ! definitely incomplete. This is used by the \refmodule{code} module ! and should not normally be used directly. ! The \module{codeop} module defines the following function: \begin{funcdesc}{compile_command} {source\optional{, filename\optional{, symbol}}} --- 6,33 ---- \declaremodule{standard}{codeop} \sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il} + \sectionauthor{Michael Hudson}{mwh@python.net} \modulesynopsis{Compile (possibly incomplete) Python code.} ! The \module{codeop} module provides utilities upon which the Python ! read-eval-print loop can be emulated -- as in the \refmodule{code} ! module. As a result, you probably don't want to use the module ! directly -- if you want to include such a loop in your program you ! probably want to use the \refmodule{code} instead. ! There are two parts to this job: + \begin{list} + \listitem Being able to tell if a line of input completes a Python + statement -- in short telling whether to print ``>>> '' or + ``... '' next. + \listitem Remembering which future statements the user has entered, so + subsequent input can be compiled wiht these in effect. + \end{list} + + The \module{codeop} module provides a way of doing each of these + things, and a way of doing them both. + + To do just the former: + \begin{funcdesc}{compile_command} {source\optional{, filename\optional{, symbol}}} *************** *** 26,31 **** If there is a problem with \var{source}, an exception will be raised. \exception{SyntaxError} is raised if there is invalid Python syntax, ! and \exception{OverflowError} if there is an invalid numeric ! constant. The \var{symbol} argument determines whether \var{source} is compiled --- 41,46 ---- If there is a problem with \var{source}, an exception will be raised. \exception{SyntaxError} is raised if there is invalid Python syntax, ! and \exception{OverflowError} or \exception{ValueError} if there is an ! invalid literal. The \var{symbol} argument determines whether \var{source} is compiled *************** *** 42,43 **** --- 57,103 ---- for the parser is better. \end{funcdesc} + + \begin{classdesc}{Compile}{} + Instances of this class have \method{__call__} methods indentical in + signature to the built-in function \function{compile}, but with the + difference that if the instance compiles program text containing a + \module{__future__} statement, the instance 'remembers' and compiles + all subsequent program texts with the statement in force. + \end{classdesc} + + \begin{classdesc}{CommandCompiler}{} + Instances of this class have \method{__call__} methods identical in + signature to \function{compile_command}; the difference is that if the + instance compiles program text containing a \method{__future__} + statement, the instance 'remembers' and compiles all subsequent + program texts with the statement in force. + \end{classdesc} + + A note on version compatibility: the \class{Compile} and + \class{CommandCompiler} are new in Python 2.2. If you want to enable + the future-tracking features of 2.2 but also retain compatibility with + 2.1 and earlier versions of Python you can either write + + \begin{verbatim} + try: + from codeop import CommandCompiler + compile_command = CommandCompiler() + del CommandCompiler + except ImportError: + from codeop import compile_command + \end{verbatim} + + which is a low-impact change, but introduces possibly unwanted global + state into your program, or you can write: + + \begin{verbatim} + try: + from codeop import CommandCompiler + except ImportError: + def CommandCompiler(): + from codeop import compile_command + return compile_comamnd + \end{verbatim} + + and then call \code{CommandCompiler} every time you need a fresh + compiler object. Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** libfuncs.tex 2001/07/26 20:02:17 1.81 --- libfuncs.tex 2001/08/27 20:02:16 1.82 *************** *** 119,123 **** \end{funcdesc} ! \begin{funcdesc}{compile}{string, filename, kind} Compile the \var{string} into a code object. Code objects can be executed by an \keyword{exec} statement or evaluated by a call to --- 119,124 ---- \end{funcdesc} ! \begin{funcdesc}{compile}{string, filename, kind\optional{, ! flags\optional{, dont_inherit}}} Compile the \var{string} into a code object. Code objects can be executed by an \keyword{exec} statement or evaluated by a call to *************** *** 131,134 **** --- 132,153 ---- interactive statement (in the latter case, expression statements that evaluate to something else than \code{None} will printed). + + The optional arguments \var{flags} and \optional{dont_inherit} + (which are new in Python 2.2) control which future statements (see + \pep{236}) affect the compilation of \var{string}. If neither is + present (or both are zero) the code is compiled with those future + statements that are in effect in the code that is calling compile. + If the \var{flags} argument is given and \var{dont_inherit} is not + (or is zero) then the future statements specified by the \var{flags} + argument are used in addition to those that would be used anyway. + If \var{dont_inherit} is a non-zero integer then the \var{flags} + argument is it -- the future statements in effect around the call to + compile are ignored. + + Future statemants are specified by bits which can be bitwise or-ed + together to specify multiple statements. The bitfield required to + specify a given feature can be found as the \member{compiler_flag} + attribute on the \class{_Feature} instance in the + \module{__future__} module. \end{funcdesc} From jhylton@users.sourceforge.net Mon Aug 27 21:16:55 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 13:16:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib rfc822.py,1.60,1.61 urllib.py,1.132,1.133 urllib2.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3216 Modified Files: rfc822.py urllib.py urllib2.py Log Message: Add content-type header to ftp URLs (SF patch #454553) Modify rfc822.formatdate() to always generate English names, regardless of locale. This is required by RFC 1123. In open_local_file() of urllib and urllib2, use new formatdate() from rfc822. Index: rfc822.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/rfc822.py,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** rfc822.py 2001/08/13 14:43:15 1.60 --- rfc822.py 2001/08/27 20:16:53 1.61 *************** *** 954,962 **** Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 """ if timeval is None: timeval = time.time() ! return "%s" % time.strftime('%a, %d %b %Y %H:%M:%S GMT', ! time.gmtime(timeval)) --- 954,972 ---- Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 + + According to RFC 1123, day and month names must always be in + English. If not for that, this code could use strftime(). It + can't because strftime() honors the locale and could generated + non-English names. """ if timeval is None: timeval = time.time() ! timeval = time.gmtime(timeval) ! return "%s, %02d %s %04d %02d:%02d:%02d GMT" % ( ! ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][timeval[6]], ! timeval[2], ! ["Jan", "Feb", "Mar", "Apr", "May", "Jun", ! "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][timeval[1]-1], ! timeval[0], timeval[3], timeval[4], timeval[5]) Index: urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** urllib.py 2001/08/23 13:37:50 1.132 --- urllib.py 2001/08/27 20:16:53 1.133 *************** *** 407,422 **** def open_local_file(self, url): """Use local file.""" ! import mimetypes, mimetools, StringIO host, file = splithost(url) localname = url2pathname(file) stats = os.stat(localname) size = stats[stat.ST_SIZE] ! modified = time.gmtime(stats[stat.ST_MTIME]) ! modified = "%s, %02d %s %04d %02d:%02d:%02d GMT" % ( ! ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][modified[6]], ! modified[2], ! ["Jan", "Feb", "Mar", "Apr", "May", "Jun", ! "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][modified[1]-1], ! modified[0], modified[3], modified[4], modified[5]) mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( --- 407,416 ---- def open_local_file(self, url): """Use local file.""" ! import mimetypes, mimetools, rfc822, StringIO host, file = splithost(url) localname = url2pathname(file) stats = os.stat(localname) size = stats[stat.ST_SIZE] ! modified = rfc822.formatdate(stats[stat.ST_MTIME]) mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** urllib2.py 2001/08/24 13:10:13 1.20 --- urllib2.py 2001/08/27 20:16:53 1.21 *************** *** 97,103 **** --- 97,106 ---- import mimetypes import mimetools + import rfc822 import ftplib import sys import time + import os + import stat import gopherlib import posixpath *************** *** 915,928 **** # not entirely sure what the rules are here def open_local_file(self, req): - mtype = mimetypes.guess_type(req.get_selector())[0] - headers = mimetools.Message(StringIO('Content-Type: %s\n' \ - % (mtype or 'text/plain'))) host = req.get_host() file = req.get_selector() if host: host, port = splitport(host) if not host or \ (not port and socket.gethostbyname(host) in self.get_names()): ! return addinfourl(open(url2pathname(file), 'rb'), headers, 'file:'+file) raise URLError('file not on local host') --- 918,937 ---- # not entirely sure what the rules are here def open_local_file(self, req): host = req.get_host() file = req.get_selector() + localfile = url2pathname(file) + stats = os.stat(localfile) + size = stats[stat.ST_SIZE] + modified = rfc822.formatdate(stats[stat.ST_MTIME]) + mtype = mimetypes.guess_type(file)[0] + stats = os.stat(localfile) + headers = mimetools.Message(StringIO( + 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % + (mtype or 'text/plain', size, modified))) if host: host, port = splitport(host) if not host or \ (not port and socket.gethostbyname(host) in self.get_names()): ! return addinfourl(open(localfile, 'rb'), headers, 'file:'+file) raise URLError('file not on local host') From jhylton@users.sourceforge.net Mon Aug 27 21:39:23 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 13:39:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler compile.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler In directory usw-pr-cvs1:/tmp/cvs-serv11661 Modified Files: compile.py Log Message: Add -c option to continue if one file has a SyntaxError Index: compile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compile.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** compile.py 2000/10/13 21:59:32 1.3 --- compile.py 2001/08/27 20:39:21 1.4 *************** *** 4,11 **** from compiler import compile, visitor def main(): VERBOSE = 0 DISPLAY = 0 ! opts, args = getopt.getopt(sys.argv[1:], 'vqd') for k, v in opts: if k == '-v': --- 4,14 ---- from compiler import compile, visitor + ##import profile + def main(): VERBOSE = 0 DISPLAY = 0 ! CONTINUE = 0 ! opts, args = getopt.getopt(sys.argv[1:], 'vqdc') for k, v in opts: if k == '-v': *************** *** 20,23 **** --- 23,28 ---- if k == '-d': DISPLAY = 1 + if k == '-c': + CONTINUE = 1 if not args: print "no files to compile" *************** *** 26,30 **** if VERBOSE: print filename ! compile(filename, DISPLAY) if __name__ == "__main__": --- 31,43 ---- if VERBOSE: print filename ! try: ! compile(filename, DISPLAY) ! ## profile.run('compile(%s, %s)' % (`filename`, `DISPLAY`), ! ## filename + ".prof") ! except SyntaxError, err: ! print err ! print err.lineno ! if not CONTINUE: ! sys.exit(-1) if __name__ == "__main__": From jhylton@users.sourceforge.net Mon Aug 27 21:40:45 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 13:40:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler regrtest.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler In directory usw-pr-cvs1:/tmp/cvs-serv12242 Modified Files: regrtest.py Log Message: Revise regrtest to compile entire standard library. The tests are run from a copy of the library directory, where everything has been compiled by the compiler package. Add a raw_input() call at the end of the script, so that I can check the output before the temp directory with the compiled code is removed. Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/regrtest.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** regrtest.py 2000/10/13 22:00:13 1.1 --- regrtest.py 2001/08/27 20:40:43 1.2 *************** *** 22,31 **** return dest def compile_files(dir): ! print "Compiling", line_len = 10 for file in os.listdir(dir): base, ext = os.path.splitext(file) ! if ext == '.py' and base[:4] == 'test': source = os.path.join(dir, file) line_len = line_len + len(file) + 1 --- 22,39 ---- return dest + def copy_library(): + dest = tempfile.mktemp() + os.mkdir(dest) + libdir = os.path.split(test.__path__[0])[0] + os.system("cp -r %s/* %s" % (libdir, dest)) + print "Creating copy of standard library in", dest + return dest + def compile_files(dir): ! print "Compiling", dir line_len = 10 for file in os.listdir(dir): base, ext = os.path.splitext(file) ! if ext == '.py': source = os.path.join(dir, file) line_len = line_len + len(file) + 1 *************** *** 34,45 **** line_len = len(source) + 9 print file, ! compile(source) # make sure the .pyc file is not over-written os.chmod(source + "c", 444) print ! def run_regrtest(test_dir): os.chdir(test_dir) ! os.system("%s -v regrtest.py" % sys.executable) def cleanup(dir): --- 42,63 ---- line_len = len(source) + 9 print file, ! try: ! compile(source) ! except SyntaxError, err: ! print err ! continue # make sure the .pyc file is not over-written os.chmod(source + "c", 444) + else: + path = os.path.join(dir, file) + if os.path.isdir(path): + print + compile_files(path) print ! def run_regrtest(lib_dir): ! test_dir = os.path.join(lib_dir, "test") os.chdir(test_dir) ! os.system("PYTHONPATH=%s %s -v regrtest.py -r" % (lib_dir, sys.executable)) def cleanup(dir): *************** *** 47,54 **** def main(): ! test_dir = copy_test_suite() ! compile_files(test_dir) ! run_regrtest(test_dir) ! cleanup(test_dir) if __name__ == "__main__": --- 65,73 ---- def main(): ! lib_dir = copy_library() ! compile_files(lib_dir) ! run_regrtest(lib_dir) ! raw_input("Cleanup?") ! cleanup(lib_dir) if __name__ == "__main__": From jhylton@users.sourceforge.net Mon Aug 27 21:43:18 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 13:43:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler ACKS,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler In directory usw-pr-cvs1:/tmp/cvs-serv13173 Added Files: ACKS Log Message: Add everyone I can think of off the top of my head --- NEW FILE: ACKS --- Mark Hammond Shane Hathaway Neil Schemenauer Evan Simpson Greg Stein Bill Tutt Moshe Zadka From jhylton@users.sourceforge.net Mon Aug 27 21:44:22 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 13:44:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler ACKS,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler In directory usw-pr-cvs1:/tmp/cvs-serv13552 Modified Files: ACKS Log Message: Why didn't I think of Fred off the top of my head? Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/ACKS,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ACKS 2001/08/27 20:43:16 1.1 --- ACKS 2001/08/27 20:44:20 1.2 *************** *** 1,2 **** --- 1,3 ---- + Fred L. Drake, Jr. Mark Hammond Shane Hathaway From jhylton@users.sourceforge.net Mon Aug 27 21:47:10 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 13:47:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler visitor.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv14932 Modified Files: visitor.py Log Message: Two changes to visitor API: Remove _preorder as alias for dispatch and call dispatch directly. Add an extra optional argument to walk() XXX Also comment out some code that does debugging prints. Index: visitor.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/visitor.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** visitor.py 2001/04/11 16:26:05 1.6 --- visitor.py 2001/08/27 20:47:08 1.7 *************** *** 1,5 **** - import sys from compiler import ast class ASTVisitor: """Performs a depth-first walk of the AST --- 1,7 ---- from compiler import ast + # XXX should probably rename ASTVisitor to ASTWalker + # XXX can it be made even more generic? + class ASTVisitor: """Performs a depth-first walk of the AST *************** *** 45,49 **** for child in node.getChildren(): if isinstance(child, ast.Node): ! apply(self._preorder, (child,) + args) def dispatch(self, node, *args): --- 47,51 ---- for child in node.getChildren(): if isinstance(child, ast.Node): ! self.dispatch(child, *args) def dispatch(self, node, *args): *************** *** 55,65 **** meth = getattr(self.visitor, 'visit' + className, self.default) self._cache[klass] = meth ! if self.VERBOSE > 0: ! className = klass.__name__ ! if self.VERBOSE == 1: ! if meth == 0: ! print "dispatch", className ! else: ! print "dispatch", className, (meth and meth.__name__ or '') return meth(node, *args) --- 57,67 ---- meth = getattr(self.visitor, 'visit' + className, self.default) self._cache[klass] = meth ! ## if self.VERBOSE > 0: ! ## className = klass.__name__ ! ## if self.VERBOSE == 1: ! ## if meth == 0: ! ## print "dispatch", className ! ## else: ! ## print "dispatch", className, (meth and meth.__name__ or '') return meth(node, *args) *************** *** 67,74 **** """Do preorder walk of tree using visitor""" self.visitor = visitor ! visitor.visit = self._preorder ! self._preorder(tree, *args) # XXX *args make sense? ! ! _preorder = dispatch class ExampleASTVisitor(ASTVisitor): --- 69,74 ---- """Do preorder walk of tree using visitor""" self.visitor = visitor ! visitor.visit = self.dispatch ! self.dispatch(tree, *args) # XXX *args make sense? class ExampleASTVisitor(ASTVisitor): *************** *** 91,95 **** print "dispatch", className, (meth and meth.__name__ or '') if meth: ! return apply(meth, (node,) + args) elif self.VERBOSE > 0: klass = node.__class__ --- 91,95 ---- print "dispatch", className, (meth and meth.__name__ or '') if meth: ! meth(node, *args) elif self.VERBOSE > 0: klass = node.__class__ *************** *** 103,115 **** print "\t", "%-12.12s" % attr, getattr(node, attr) print ! return apply(self.default, (node,) + args) _walker = ASTVisitor ! def walk(tree, visitor, verbose=None): ! w = _walker() if verbose is not None: ! w.VERBOSE = verbose ! w.preorder(tree, visitor) ! return w.visitor def dumpNode(node): --- 103,118 ---- print "\t", "%-12.12s" % attr, getattr(node, attr) print ! return self.default(node, *args) + # XXX this is an API change + _walker = ASTVisitor ! def walk(tree, visitor, walker=None, verbose=None): ! if walker is None: ! walker = _walker() if verbose is not None: ! walker.VERBOSE = verbose ! walker.preorder(tree, visitor) ! return walker.visitor def dumpNode(node): From jhylton@users.sourceforge.net Mon Aug 27 22:02:53 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 14:02:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler transformer.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv21844 Modified Files: transformer.py Log Message: Add lookup_name() to optimize use of stack frames The use of com_node() introduces a lot of extra stack frames, enough to cause a stack overflow compiling test.test_parser with the standard interpreter recursionlimit. The com_node() is a convenience function that hides the dispatch details, but comes at a very high cost. It is more efficient to dispatch directly in the callers. In these cases, use lookup_node() and call the dispatched node directly. Also handle yield_stmt in a way that will work with Python 2.1 (suggested by Shane Hathaway) Index: transformer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/transformer.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** transformer.py 2001/08/18 00:04:31 1.22 --- transformer.py 2001/08/27 21:02:51 1.23 *************** *** 275,279 **** def expr_stmt(self, nodelist): # augassign testlist | testlist ('=' testlist)* ! exprNode = self.com_node(nodelist[-1]) if len(nodelist) == 1: n = Discard(exprNode) --- 275,280 ---- def expr_stmt(self, nodelist): # augassign testlist | testlist ('=' testlist)* ! en = nodelist[-1] ! exprNode = self.lookup_node(en)(en[1:]) if len(nodelist) == 1: n = Discard(exprNode) *************** *** 697,700 **** --- 698,712 ---- # + # The use of com_node() introduces a lot of extra stack frames, + # enough to cause a stack overflow compiling test.test_parser with + # the standard interpreter recursionlimit. The com_node() is a + # convenience function that hides the dispatch details, but comes + # at a very high cost. It is more efficient to dispatch directly + # in the callers. In these cases, use lookup_node() and call the + # dispatched node directly. + + def lookup_node(self, node): + return self._dispatch[node[0]] + def com_node(self, node): # Note: compile.c has handling in com_node for del_stmt, pass_stmt, *************** *** 939,950 **** l = len(nodelist) if l == 1: ! return self.com_node(nodelist[0]) items = [] for i in range(0, l, 2): ! items.append(self.com_node(nodelist[i])) return constructor(items) def com_stmt(self, node): ! result = self.com_node(node) assert result is not None if isinstance(result, Stmt): --- 951,964 ---- l = len(nodelist) if l == 1: ! n = nodelist[0] ! return self.lookup_node(n)(n[1:]) items = [] for i in range(0, l, 2): ! n = nodelist[i] ! items.append(self.lookup_node(n)(n[1:])) return constructor(items) def com_stmt(self, node): ! result = self.lookup_node(node)(node[1:]) assert result is not None if isinstance(result, Stmt): *************** *** 1255,1259 **** symbol.return_stmt, symbol.raise_stmt, - symbol.yield_stmt, symbol.import_stmt, symbol.global_stmt, --- 1269,1272 ---- *************** *** 1281,1284 **** --- 1294,1300 ---- symbol.atom, ] + + if hasattr(symbol, 'yield_stmt'): + _legal_node_types.append(symbol.yield_stmt) _assign_types = [ From jhylton@users.sourceforge.net Mon Aug 27 22:06:37 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 14:06:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler symbols.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv23621 Modified Files: symbols.py Log Message: Fix for sibling nodes that define the same free variable Evan Simpson's fix. And his explanation: If you defined two nested functions in a row that refer to the same non-global variable, the second one will be generated as though the variable were global. Index: symbols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/symbols.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** symbols.py 2001/04/12 07:06:25 1.5 --- symbols.py 2001/08/27 21:06:35 1.6 *************** *** 80,84 **** def DEBUG(self): - return print >> sys.stderr, self.name, self.nested and "nested" or "" print >> sys.stderr, "\tglobals: ", self.globals --- 80,83 ---- *************** *** 163,172 **** elif isinstance(self, FunctionScope) and sc == SC_LOCAL: self.cells[name] = 1 ! else: child_globals.append(name) else: if sc == SC_LOCAL: self.cells[name] = 1 ! else: child_globals.append(name) return child_globals --- 162,171 ---- elif isinstance(self, FunctionScope) and sc == SC_LOCAL: self.cells[name] = 1 ! elif sc != SC_CELL: child_globals.append(name) else: if sc == SC_LOCAL: self.cells[name] = 1 ! elif sc != SC_CELL: child_globals.append(name) return child_globals *************** *** 222,226 **** self.visit(node.code, scope) self.handle_free_vars(scope, parent) - scope.DEBUG() def visitLambda(self, node, parent): --- 221,224 ---- *************** *** 244,249 **** def handle_free_vars(self, scope, parent): parent.add_child(scope) - if scope.children: - scope.DEBUG() scope.handle_children() --- 242,245 ---- *************** *** 299,302 **** --- 295,306 ---- scope.add_def(node.name) + def visitAssAttr(self, node, scope, assign=0): + self.visit(node.expr, scope, 0) + + def visitSubscript(self, node, scope, assign=0): + self.visit(node.expr, scope, 0) + for n in node.subs: + self.visit(n, scope, 0) + def visitAugAssign(self, node, scope): # If the LHS is a name, then this counts as assignment. From jackjansen@users.sourceforge.net Mon Aug 27 22:14:50 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:14:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts PackLibDir.py,1.6,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv26588/Python/Mac/scripts Removed Files: PackLibDir.py Log Message: These have long outlived there usefulness, in my opinion. Moved to Unsupported. --- PackLibDir.py DELETED --- From jackjansen@users.sourceforge.net Mon Aug 27 22:14:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:14:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts PackLibDir.rsrc,1.3,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv26646/Python/Mac/scripts Removed Files: PackLibDir.rsrc Log Message: These have long outlived there usefulness, in my opinion. Moved to Unsupported. --- PackLibDir.rsrc DELETED --- From jackjansen@users.sourceforge.net Mon Aug 27 22:15:09 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:15:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts run.py,1.3,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv26807/Python/Mac/scripts Removed Files: run.py Log Message: These have long outlived there usefulness, in my opinion. Moved to Unsupported. --- run.py DELETED --- From jackjansen@users.sourceforge.net Mon Aug 27 22:15:13 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:15:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts RunLibScript.py,1.5,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv26851/Python/Mac/scripts Removed Files: RunLibScript.py Log Message: These have long outlived there usefulness, in my opinion. Moved to Unsupported. --- RunLibScript.py DELETED --- From jackjansen@users.sourceforge.net Mon Aug 27 22:15:18 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:15:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts RunLibScript.rsrc,1.3,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv26890/Python/Mac/scripts Removed Files: RunLibScript.rsrc Log Message: These have long outlived there usefulness, in my opinion. Moved to Unsupported. --- RunLibScript.rsrc DELETED --- From jackjansen@users.sourceforge.net Mon Aug 27 22:17:27 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:17:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Unsupported PackLibDir.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Unsupported In directory usw-pr-cvs1:/tmp/cvs-serv27703/Python/Mac/Unsupported Added Files: PackLibDir.py Log Message: These have long outlived there usefulness, in my opinion. Moved to Unsupported. --- NEW FILE: PackLibDir.py --- # # Turn a pyc file into a resource file containing it in 'PYC ' resource form from Carbon.Res import * from Carbon import Res from Carbon.Resources import * import os import macfs import sys import py_resource error = 'mkpycresourcefile.error' def mkpycresourcefile(src, dst): """Copy pyc file/dir src to resource file dst.""" if not os.path.isdir(src) and src[-4:] <> '.pyc': raise error, 'I can only handle .pyc files or directories' fsid = py_resource.create(dst) if os.path.isdir(src): handlesubdir(src) else: id, name = py_resource.frompycfile(src) print 'Wrote %d: %s %s'%(id, name, src) CloseResFile(fsid) def handlesubdir(srcdir): """Recursively scan a directory for pyc files and copy to resources""" src = os.listdir(srcdir) for file in src: file = os.path.join(srcdir, file) if os.path.isdir(file): handlesubdir(file) elif file[-4:] == '.pyc': id, name = py_resource.frompycfile(file) print 'Wrote %d: %s %s'%(id, name, file) if __name__ == '__main__': args = sys.argv[1:] if not args: ifss, ok = macfs.GetDirectory('Select root of tree to pack:') if not ok: sys.exit(0) args = [ifss.as_pathname()] for ifn in args: ofss, ok = macfs.StandardPutFile('Output for '+os.path.split(ifn)[1]) if not ok: sys.exit(0) mkpycresourcefile(ifn, ofss.as_pathname()) sys.exit(1) # So we can see something... From jackjansen@users.sourceforge.net Mon Aug 27 22:17:31 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:17:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Unsupported PackLibDir.rsrc,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Unsupported In directory usw-pr-cvs1:/tmp/cvs-serv27737/Python/Mac/Unsupported Added Files: PackLibDir.rsrc Log Message: These have long outlived there usefulness, in my opinion. Moved to Unsupported. --- NEW FILE: PackLibDir.rsrc --- h Pà   à jackjansen h BNDL From jackjansen@users.sourceforge.net Mon Aug 27 22:17:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:17:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Unsupported run.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Unsupported In directory usw-pr-cvs1:/tmp/cvs-serv27778/Python/Mac/Unsupported Added Files: run.py Log Message: These have long outlived there usefulness, in my opinion. Moved to Unsupported. --- NEW FILE: run.py --- # Script (applet) to run any Python command def main(): import sys sys.stdout = sys.stderr del sys.argv[:1] if not sys.argv: import macfs srcfss, ok = macfs.StandardGetFile('TEXT') if not ok: return filename = srcfss.as_pathname() sys.argv.append(filename) import __main__ try: execfile(sys.argv[0], __main__.__dict__) except SystemExit, msg: if msg: message("Exit status: %s" % str(msg)) print "exit", `msg` #sys.exit(msg) except: etype = sys.exc_type if hasattr(etype, "__name__"): etype = etype.__name__ message("%s: %s" % (etype, sys.exc_value)) print "exit 1" #sys.exit(1) def message(str = "Hello, world!", id = 256): from Carbon import Dlg d = Dlg.GetNewDialog(id, -1) if not d: print str return tp, h, rect = d.GetDItem(2) Dlg.SetIText(h, str) while 1: n = Dlg.ModalDialog(None) if n == 1: break main() From jackjansen@users.sourceforge.net Mon Aug 27 22:17:41 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:17:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Unsupported RunLibScript.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Unsupported In directory usw-pr-cvs1:/tmp/cvs-serv27813/Python/Mac/Unsupported Added Files: RunLibScript.py Log Message: These have long outlived there usefulness, in my opinion. Moved to Unsupported. --- NEW FILE: RunLibScript.py --- """Import a module while pretending its name is __main__. This can be used to run scripts from the PackedLib resource file while pretending they have been double-clicked.""" import imp import sys import os import string from Carbon import Dlg import macfs DIALOG_ID = 512 OK = 1 CANCEL = 2 SCRIPTNAME=3 ARGV=4 STDIN_CONS=5 STDIN_FILE=6 STDOUT_CONS=7 STDOUT_FILE=8 WORKING_DIR=9 PAUSE=10 def import_as_main(name): fp, path, (suffix, mode, type) = imp.find_module(name) if type == imp.PY_SOURCE: imp.load_source('__main__', path, fp) elif type == imp.PY_COMPILED: imp.load_compiled('__main__', path, fp) elif type == imp.PY_RESOURCE: imp.load_resource('__main__', path) def interact(): d = Dlg.GetNewDialog(DIALOG_ID, -1) wdir = stdin = stdout = None pause = 0 tp, in_c_h, rect = d.GetDialogItem(STDIN_CONS) tp, in_f_h, rect = d.GetDialogItem(STDIN_FILE) tp, out_c_h, rect = d.GetDialogItem(STDOUT_CONS) tp, out_f_h, rect = d.GetDialogItem(STDOUT_FILE) tp, pause_h, rect = d.GetDialogItem(PAUSE) in_c_h = in_c_h.as_Control() in_f_h = in_f_h.as_Control() out_c_h = out_c_h.as_Control() out_f_h = out_f_h.as_Control() pause_h = pause_h.as_Control() while 1: in_c_h.SetControlValue(not stdin) in_f_h.SetControlValue(not not stdin) out_c_h.SetControlValue(not stdout) out_f_h.SetControlValue(not not stdout) pause_h.SetControlValue(pause) n = Dlg.ModalDialog(None) if n == OK: break elif n == CANCEL: sys.exit(0) elif n == STDIN_CONS: stdin = None elif n == STDIN_FILE: fss, ok = macfs.StandardGetFile('TEXT') if ok: stdin = fss elif n == STDOUT_FILE: fss, ok = macfs.StandardPutFile('stdout:') if ok: stdout = fss elif n == WORKING_DIR: fss, ok = macfs.GetDirectory() if ok: wdir = fss elif n == PAUSE: pause = (not pause) tp, h, rect = d.GetDialogItem(SCRIPTNAME) name = Dlg.GetDialogItemText(h) tp, h, rect = d.GetDialogItem(ARGV) argv = Dlg.GetDialogItemText(h) return name, argv, stdin, stdout, wdir, pause def main(): curdir = os.getcwd() from Carbon import Res try: Res.FSpOpenResFile('RunLibScript.rsrc', 1) except: pass # Assume we're an applet already name, argv, stdin, stdout, wdir, pause = interact() if not name: sys.exit(0) sys.argv = [name] + string.split(argv) if stdin: sys.stdin = open(stdin.as_pathname()) if stdout: sys.stdout = open(stdout.as_pathname(), 'w') if wdir: os.chdir(wdir.as_pathname()) else: os.chdir(curdir) import_as_main(name) if pause: sys.exit(1) if __name__ == '__main__': main() From jackjansen@users.sourceforge.net Mon Aug 27 22:17:46 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:17:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Unsupported RunLibScript.rsrc,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Unsupported In directory usw-pr-cvs1:/tmp/cvs-serv27855/Python/Mac/Unsupported Added Files: RunLibScript.rsrc Log Message: These have long outlived there usefulness, in my opinion. Moved to Unsupported. --- NEW FILE: RunLibScript.rsrc --- Pà Arguments: jackjansen ¬ § È`ð,ÿÿ From jackjansen@users.sourceforge.net Mon Aug 27 22:21:09 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:21:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib macresource.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv29306/Python/Mac/Lib Added Files: macresource.py Log Message: Module to help other modules locate their resources. It currently knows about resources in applets and separate OS9 style resource files, but it will eventually also be thought the hoops to jump through on OSX/MachO. --- NEW FILE: macresource.py --- """macresource - Locate and open the resources needed for a script.""" from Carbon import Res import os import sys class ArgumentError(TypeError): pass class ResourceFileNotFoundError(ImportError): pass def need(restype, resid, filename=None, modname=None): """Open a resource file, if needed. restype and resid are required parameters, and identify the resource for which to test. If it is available we are done. If it is not available we look for a file filename (default: modname with .rsrc appended) either in the same folder as where modname was loaded from, or otherwise across sys.path.""" if modname is None and filename is None: raise ArgumentError, "Either filename or modname argument (or both) must be given" if type(resid) is type(1): try: h = Res.GetResource(restype, resid) except Res.Error: pass else: return else: try: h = Res.GetNamedResource(restype, resid) except Res.Error: pass else: return # Construct a filename if we don't have one if not filename: if '.' in modname: filename = modname.split('.')[-1] + '.rsrc' else: filename = modname + '.rsrc' # Now create a list of folders to search searchdirs = [] if modname == '__main__': # If we're main we look in the current directory searchdirs = [os.curdir] if sys.modules.has_key(modname): mod = sys.modules[modname] if hasattr(mod, '__file__'): searchdirs = [mod.__file__] if not searchdirs: searchdirs = sys.path # And look for the file for dir in searchdirs: pathname = os.path.join(dir, filename) if os.path.exists(pathname): break else: raise ResourceFileNotFoundError, filename Res.FSpOpenResFile(pathname, 1) # And check that the resource exists now if type(resid) is type(1): h = Res.GetResource(restype, resid) else: h = Res.GetNamedResource(restype, resid) From fdrake@acm.org Mon Aug 27 22:21:37 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Mon, 27 Aug 2001 17:21:37 -0400 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler ACKS,1.1,1.2 In-Reply-To: References: Message-ID: <15242.47585.3336.560001@grendel.digicool.com> Jeremy Hylton writes: > Why didn't I think of Fred off the top of my head? It's so easy to be forgotten when in Fredericksburg... -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From jackjansen@users.sourceforge.net Mon Aug 27 22:37:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:37:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib macresource.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3854/Python/Mac/Lib Modified Files: macresource.py Log Message: need() now returns the refno of the resource file opened, or None if the specified resource was already available and no file was opened. Index: macresource.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/macresource.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** macresource.py 2001/08/27 21:21:07 1.1 --- macresource.py 2001/08/27 21:37:45 1.2 *************** *** 13,17 **** is available we are done. If it is not available we look for a file filename (default: modname with .rsrc appended) either in the same folder as ! where modname was loaded from, or otherwise across sys.path.""" if modname is None and filename is None: --- 13,19 ---- is available we are done. If it is not available we look for a file filename (default: modname with .rsrc appended) either in the same folder as ! where modname was loaded from, or otherwise across sys.path. ! ! Returns the refno of the resource file opened (or None)""" if modname is None and filename is None: *************** *** 24,28 **** pass else: ! return else: try: --- 26,30 ---- pass else: ! return None else: try: *************** *** 31,35 **** pass else: ! return # Construct a filename if we don't have one --- 33,37 ---- pass else: ! return None # Construct a filename if we don't have one *************** *** 60,64 **** raise ResourceFileNotFoundError, filename ! Res.FSpOpenResFile(pathname, 1) # And check that the resource exists now --- 62,66 ---- raise ResourceFileNotFoundError, filename ! refno = Res.FSpOpenResFile(pathname, 1) # And check that the resource exists now *************** *** 67,68 **** --- 69,71 ---- else: h = Res.GetNamedResource(restype, resid) + return refno \ No newline at end of file From jackjansen@users.sourceforge.net Mon Aug 27 22:39:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:39:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/macfreeze macfreezegui.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/macfreeze In directory usw-pr-cvs1:/tmp/cvs-serv4569/Python/Mac/Tools/macfreeze Modified Files: macfreezegui.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: macfreezegui.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/macfreeze/macfreezegui.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** macfreezegui.py 2001/08/25 12:06:32 1.3 --- macfreezegui.py 2001/08/27 21:39:18 1.4 *************** *** 7,10 **** --- 7,11 ---- import string from Carbon import Res + import macresource ID_MAINDIALOG=512 *************** *** 55,69 **** # Get the dialog, possibly opening the resource file (if needed) ! try: ! d = Dlg.GetNewDialog(ID_MAINDIALOG, -1) ! except Dlg.Error: ! d = None ! if d == None: ! try: ! Res.FSpOpenResFile('macfreeze.rsrc', 1) ! except Res.Error: ! d = None ! else: ! d = Dlg.GetNewDialog(ID_MAINDIALOG, -1) if d == None: EasyDialogs.Message("Dialog resource not found or faulty") --- 56,61 ---- # Get the dialog, possibly opening the resource file (if needed) ! macresource.need('DLOG', ID_MAINDIALOG, 'macfreeze.rsrc') ! d = Dlg.GetNewDialog(ID_MAINDIALOG, -1) if d == None: EasyDialogs.Message("Dialog resource not found or faulty") From jackjansen@users.sourceforge.net Mon Aug 27 22:39:24 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:39:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PythonIDE.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv4600/Python/Mac/Tools/IDE Modified Files: PythonIDE.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: PythonIDE.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDE.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PythonIDE.py 2001/08/25 12:10:37 1.7 --- PythonIDE.py 2001/08/27 21:39:22 1.8 *************** *** 14,36 **** Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data) ! from Carbon import Res import sys, os ! try: ! Res.GetResource('DITL', 468) ! except Res.Error: ! # we're not an applet ! Res.FSpOpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:PythonIDE.rsrc"), 1) ! Res.FSpOpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc"), 1) ide_path = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE") else: ! # we're an applet ! try: ! Res.GetResource('CURS', 468) ! except Res.Error: ! Res.FSpOpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc"), 1) ! ide_path = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE") ! else: ! # we're a full blown applet ! ide_path = sys.argv[0] if ide_path not in sys.path: sys.path.insert(0, ide_path) --- 14,28 ---- Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data) ! import macresource import sys, os ! macresource.need('DITL', 468, "PythonIDE.rsrc") ! widgetresfile = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc") ! refno = macresource.need('CURS', 468, widgetresfile) ! if refno: ! # We're not a fullblown application ide_path = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE") else: ! # We are a fully frozen application ! ide_path = sys.argv[0] if ide_path not in sys.path: sys.path.insert(0, ide_path) From jackjansen@users.sourceforge.net Mon Aug 27 22:39:31 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:39:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts MkDistr_ui.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv4690/Python/Mac/scripts Modified Files: MkDistr_ui.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: MkDistr_ui.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/MkDistr_ui.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MkDistr_ui.py 2001/08/25 12:07:01 1.13 --- MkDistr_ui.py 2001/08/27 21:39:29 1.14 *************** *** 24,27 **** --- 24,28 ---- import os import sys + import macresource # Resource IDs *************** *** 322,326 **** def InitUI(): """Initialize stuff needed by UI (a resource file)""" ! Res.FSpOpenResFile('MkDistr.rsrc', 1) class _testerhelp: --- 323,327 ---- def InitUI(): """Initialize stuff needed by UI (a resource file)""" ! macresource.need('DLOG', ID_MAIN, 'MkDistr.rsrc', modname=__name__) class _testerhelp: *************** *** 341,345 **** def __init__(self): import sys ! Res.FSpOpenResFile('MkDistr.rsrc', 1) self.inc = _testerhelp('include') self.exc = _testerhelp('exclude') --- 342,346 ---- def __init__(self): import sys ! InitUI() self.inc = _testerhelp('include') self.exc = _testerhelp('exclude') From jackjansen@users.sourceforge.net Mon Aug 27 22:39:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:39:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts fullbuild.py,1.72,1.73 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv4744/Python/Mac/scripts Modified Files: fullbuild.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: fullbuild.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/fullbuild.py,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** fullbuild.py 2001/08/25 12:04:56 1.72 --- fullbuild.py 2001/08/27 21:39:36 1.73 *************** *** 20,23 **** --- 20,24 ---- import string import genpluginprojects + import macresource import aetools *************** *** 370,378 **** def main(): ! try: ! h = Res.FSpOpenResFile('fullbuild.rsrc', 1) ! except Res.Error: ! pass # Assume we already have acces to our own resource ! dir, ok = macfs.GetDirectory('Python source folder:') if not ok: --- 371,375 ---- def main(): ! macresource.need('DLOG', DIALOG_ID, 'fullbuild.rsrc') dir, ok = macfs.GetDirectory('Python source folder:') if not ok: From jackjansen@users.sourceforge.net Mon Aug 27 22:40:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:40:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse PICTbrowse.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv5516/Python/Mac/Demo/PICTbrowse Modified Files: PICTbrowse.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: PICTbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/PICTbrowse.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PICTbrowse.py 2001/08/25 12:08:38 1.9 --- PICTbrowse.py 2001/08/27 21:40:49 1.10 *************** *** 10,13 **** --- 10,14 ---- import sys import struct + import macresource # *************** *** 22,33 **** def main(): ! try: ! dummy = Res.GetResource('DLOG', ID_MAIN) ! except Res.Error: ! try: ! Res.FSpOpenResFile("PICTbrowse.rsrc", 1) ! except Res.Error, arg: ! EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1]) ! sys.exit(1) PICTbrowse() --- 23,27 ---- def main(): ! macresource.need('DLOG', ID_MAIN, "PICTbrowse.rsrc") PICTbrowse() From jackjansen@users.sourceforge.net Mon Aug 27 22:40:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:40:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse oldPICTbrowse.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv5551/Python/Mac/Demo/PICTbrowse Modified Files: oldPICTbrowse.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: oldPICTbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/oldPICTbrowse.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** oldPICTbrowse.py 2001/08/25 12:07:48 1.5 --- oldPICTbrowse.py 2001/08/27 21:40:53 1.6 *************** *** 9,12 **** --- 9,13 ---- import sys import struct + import macresource # *************** *** 21,32 **** def main(): ! try: ! dummy = Res.GetResource('DLOG', ID_MAIN) ! except Res.Error: ! try: ! Res.FSpOpenResFile("oldPICTbrowse.rsrc", 0) ! except Res.Error, arg: ! EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1]) ! sys.exit(1) PICTbrowse() --- 22,26 ---- def main(): ! macresource.need('DLOG', ID_MAIN, "oldPICTbrowse.rsrc") PICTbrowse() From jackjansen@users.sourceforge.net Mon Aug 27 22:41:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:41:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/example1 dnslookup-1.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/example1 In directory usw-pr-cvs1:/tmp/cvs-serv5739/Python/Mac/Demo/example1 Modified Files: dnslookup-1.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: dnslookup-1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/example1/dnslookup-1.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dnslookup-1.py 2001/08/25 12:03:48 1.3 --- dnslookup-1.py 2001/08/27 21:41:16 1.4 *************** *** 8,11 **** --- 8,12 ---- import socket import string + import macresource # # Definitions for our resources *************** *** 16,28 **** ITEM_LOOKUP_BUTTON=3 ITEM_QUIT_BUTTON=4 ! ! def main(): """Main routine: open resource file, call dialog handler""" ! try: ! Res.FSpOpenResFile("dnslookup-1.rsrc", 1) ! except Res.Error: ! EasyDialogs.Message("Cannot open dnslookup-1.rsrc") ! sys.exit(1) do_dialog() --- 17,24 ---- ITEM_LOOKUP_BUTTON=3 ITEM_QUIT_BUTTON=4 ! def main(): """Main routine: open resource file, call dialog handler""" ! macresource.need("DLOG", ID_MAIN, "dnslookup-1.rsrc") do_dialog() From jackjansen@users.sourceforge.net Mon Aug 27 22:41:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:41:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts EditPythonPrefs.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv5768/Python/Mac/scripts Modified Files: EditPythonPrefs.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: EditPythonPrefs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/EditPythonPrefs.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** EditPythonPrefs.py 2001/08/25 12:04:24 1.25 --- EditPythonPrefs.py 2001/08/27 21:41:23 1.26 *************** *** 16,19 **** --- 16,20 ---- from Carbon import Res # For Res.Error import pythonprefs + import macresource import EasyDialogs try: *************** *** 196,203 **** def main(): ! try: ! h = FSpOpenResFile('EditPythonPrefs.rsrc', 1) ! except Res.Error: ! pass # Assume we already have acces to our own resource MacOS.SchedParams(1, 0) --- 197,201 ---- def main(): ! macresource.need('DLOG', DIALOG_ID, 'EditPythonPrefs.rsrc') MacOS.SchedParams(1, 0) From jackjansen@users.sourceforge.net Mon Aug 27 22:40:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:40:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts BuildApplication.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv5073/Python/Mac/scripts Modified Files: BuildApplication.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: BuildApplication.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/BuildApplication.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BuildApplication.py 2001/08/25 12:01:44 1.8 --- BuildApplication.py 2001/08/27 21:40:27 1.9 *************** *** 19,22 **** --- 19,23 ---- import EasyDialogs import buildtools + import macresource # Hmmm... *************** *** 39,49 **** ! try: ! Res.GetResource('DITL', DLG_ID) ! except Res.Error: ! Res.FSpOpenResFile("BuildApplication.rsrc", 1) ! else: ! pass # we're an applet ! def main(): --- 40,44 ---- ! macresource.need('DITL', DLG_ID, "BuildApplication.rsrc") def main(): From jackjansen@users.sourceforge.net Mon Aug 27 22:40:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:40:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse PICTbrowse2.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv5335/Python/Mac/Demo/PICTbrowse Modified Files: PICTbrowse2.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: PICTbrowse2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/PICTbrowse2.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PICTbrowse2.py 2001/08/25 12:08:44 1.9 --- PICTbrowse2.py 2001/08/27 21:40:34 1.10 *************** *** 10,13 **** --- 10,14 ---- import sys import struct + import macresource # *************** *** 26,37 **** def main(): ! try: ! dummy = Res.GetResource('DLOG', ID_MAIN) ! except Res.Error: ! try: ! Res.FSpOpenResFile("PICTbrowse.rsrc", 1) ! except Res.Error, arg: ! EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1]) ! sys.exit(1) PICTbrowse() --- 27,31 ---- def main(): ! macresource.need('DLOG', ID_MAIN, "PICTbrowse.rsrc") PICTbrowse() From jackjansen@users.sourceforge.net Mon Aug 27 22:41:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:41:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse ICONbrowse.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv5598/Python/Mac/Demo/PICTbrowse Modified Files: ICONbrowse.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: ICONbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/ICONbrowse.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ICONbrowse.py 2001/08/25 12:05:28 1.7 --- ICONbrowse.py 2001/08/27 21:40:58 1.8 *************** *** 11,14 **** --- 11,15 ---- import struct from Carbon import Icn + import macresource # *************** *** 27,38 **** def main(): ! try: ! dummy = Res.GetResource('DLOG', ID_MAIN) ! except Res.Error: ! try: ! Res.FSpOpenResFile("PICTbrowse.rsrc", 1) ! except Res.Error, arg: ! EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1]) ! sys.exit(1) ICONbrowse() --- 28,32 ---- def main(): ! macresource.need('DLOG', ID_MAIN, "PICTbrowse.rsrc") ICONbrowse() From jackjansen@users.sourceforge.net Mon Aug 27 22:41:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:41:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/PICTbrowse cicnbrowse.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse In directory usw-pr-cvs1:/tmp/cvs-serv5658/Python/Mac/Demo/PICTbrowse Modified Files: cicnbrowse.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: cicnbrowse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/PICTbrowse/cicnbrowse.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** cicnbrowse.py 2001/08/25 12:02:09 1.6 --- cicnbrowse.py 2001/08/27 21:41:03 1.7 *************** *** 11,14 **** --- 11,15 ---- import struct from Carbon import Icn + import macresource # *************** *** 27,38 **** def main(): ! try: ! dummy = Res.GetResource('DLOG', ID_MAIN) ! except Res.Error: ! try: ! Res.FSpOpenResFile("PICTbrowse.rsrc", 1) ! except Res.Error, arg: ! EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1]) ! sys.exit(1) CIconbrowse() --- 28,32 ---- def main(): ! macresource.need('DLOG', ID_MAIN, "PICTbrowse.rsrc") CIconbrowse() *************** *** 120,126 **** self.id = id FrameWork.DialogWindow.open(self, ID_MAIN) ! self.wid.SetDialogDefaultItem(MAIN_SHOW) self.contents = contents ! self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST) h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart, Controls.kControlListBoxListHandleTag) --- 114,120 ---- self.id = id FrameWork.DialogWindow.open(self, ID_MAIN) ! self.dlg.SetDialogDefaultItem(MAIN_SHOW) self.contents = contents ! self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST) h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart, Controls.kControlListBoxListHandleTag) From jackjansen@users.sourceforge.net Mon Aug 27 22:41:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 14:41:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo/example2 dnslookup-2.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo/example2 In directory usw-pr-cvs1:/tmp/cvs-serv5692/Python/Mac/Demo/example2 Modified Files: dnslookup-2.py Log Message: Use the new macresource module to open the accompanying resource file (if needed). Index: dnslookup-2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/example2/dnslookup-2.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dnslookup-2.py 2001/08/25 12:03:53 1.4 --- dnslookup-2.py 2001/08/27 21:41:08 1.5 *************** *** 6,9 **** --- 6,10 ---- import socket import string + import macresource # # Definitions for our resources *************** *** 16,27 **** def main(): ! try: ! dummy = Res.GetResource('DLOG', ID_MAIN) ! except Res.Error: ! try: ! Res.FSpOpenResFile("dnslookup-2.rsrc", 1) ! except Res.Error: ! EasyDialogs.Message("Cannot open dnslookup-2.rsrc") ! sys.exit(1) DNSLookup() --- 17,21 ---- def main(): ! macresource.need("DLOG", ID_MAIN, "dnslookup-2.rsrc") DNSLookup() From tim_one@users.sourceforge.net Mon Aug 27 22:45:34 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 27 Aug 2001 14:45:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_unary.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv6554/python/Lib/test Modified Files: test_unary.py Log Message: Change test_overflow to test_no_overflow; looks like big int literals are auto-coerced to longs now, but this test still expected OverflowError. I can't imagine this test failure was unique to Windows. Index: test_unary.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unary.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_unary.py 2001/08/12 02:22:27 1.1 --- test_unary.py 2001/08/27 21:45:32 1.2 *************** *** 28,35 **** self.assert_(-2L == 0 - 2L) ! def test_overflow(self): ! self.assertRaises(OverflowError, eval, "+" + ("9" * 32)) ! self.assertRaises(OverflowError, eval, "-" + ("9" * 32)) ! self.assertRaises(OverflowError, eval, "~" + ("9" * 32)) def test_bad_types(self): --- 28,36 ---- self.assert_(-2L == 0 - 2L) ! def test_no_overflow(self): ! nines = "9" * 32 ! self.assert_(eval("+" + nines) == eval("+" + nines + "L")) ! self.assert_(eval("-" + nines) == eval("-" + nines + "L")) ! self.assert_(eval("~" + nines) == eval("~" + nines + "L")) def test_bad_types(self): From tim_one@users.sourceforge.net Mon Aug 27 22:50:46 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 27 Aug 2001 14:50:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_grammar.py,1.35,1.36 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv9286/python/Lib/test Modified Files: test_grammar.py Log Message: Fix another test still expecting overflow on big int literals. Index: test_grammar.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grammar.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** test_grammar.py 2001/03/19 20:42:11 1.35 --- test_grammar.py 2001/08/27 21:50:42 1.36 *************** *** 38,45 **** x = eval(s) except OverflowError: ! continue ! ## raise TestFailed, \ ! print \ ! 'No OverflowError on huge integer literal ' + `s` elif eval('maxint == 9223372036854775807'): if eval('-9223372036854775807-1 != 01000000000000000000000'): --- 38,42 ---- x = eval(s) except OverflowError: ! print "OverflowError on huge integer literal " + `s` elif eval('maxint == 9223372036854775807'): if eval('-9223372036854775807-1 != 01000000000000000000000'): *************** *** 52,58 **** x = eval(s) except OverflowError: ! continue ! raise TestFailed, \ ! 'No OverflowError on huge integer literal ' + `s` else: print 'Weird maxint value', maxint --- 49,53 ---- x = eval(s) except OverflowError: ! print "OverflowError on huge integer literal " + `s` else: print 'Weird maxint value', maxint From jhylton@users.sourceforge.net Mon Aug 27 22:51:55 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 14:51:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.39,1.40 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv9563 Modified Files: pycodegen.py Log Message: Many changes -- bug fixes and sundry improvements Make nested scopes enabled by default Add is_constant_false() helper so that compiled code and symbols are consistent with builtin compiler's handling of "if 0:" Fix doc string handling to be consistent with recent change that eliminates the doc string from the Module's node attribute. Add fix to print handling from Evan & Shane. Track change to visitor api by making "verbose" explicit. Comment out setting CO_NESTED flag (it's unnecessary in 2.2). Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** pycodegen.py 2001/04/12 21:54:41 1.39 --- pycodegen.py 2001/08/27 21:51:52 1.40 *************** *** 41,45 **** class Module: def __init__(self, source, filename): ! self.filename = filename self.source = source self.code = None --- 41,45 ---- class Module: def __init__(self, source, filename): ! self.filename = os.path.abspath(filename) self.source = source self.code = None *************** *** 47,56 **** def compile(self, display=0): tree = parse(self.source) ! root, filename = os.path.split(self.filename) ! if "nested_scopes" in future.find_futures(tree): ! gen = NestedScopeModuleCodeGenerator(filename) ! else: ! gen = ModuleCodeGenerator(filename) ! walk(tree, gen, 1) if display: import pprint --- 47,52 ---- def compile(self, display=0): tree = parse(self.source) ! gen = NestedScopeModuleCodeGenerator(self.filename) ! walk(tree, gen, verbose=1) if display: import pprint *************** *** 116,119 **** --- 112,121 ---- self.names.add(node.name) + def is_constant_false(node): + if isinstance(node, ast.Const): + if not node.value: + return 1 + return 0 + class CodeGenerator: """Defines basic code generator for Python bytecode *************** *** 235,242 **** def visitModule(self, node): self.emit('SET_LINENO', 0) - lnf = walk(node.node, self.NameFinder(), 0) - self.locals.push(lnf.getLocals()) if node.doc: ! self.fixDocstring(node.node) self.visit(node.node) self.emit('LOAD_CONST', None) --- 237,245 ---- def visitModule(self, node): self.emit('SET_LINENO', 0) if node.doc: ! self.emit('LOAD_CONST', node.doc) ! self.storeName('__doc__') ! lnf = walk(node.node, self.NameFinder(), verbose=0) ! self.locals.push(lnf.getLocals()) self.visit(node.node) self.emit('LOAD_CONST', None) *************** *** 265,269 **** gen = self.ClassGen(node, self.filename, self.scopes) if node.doc: ! self.fixDocstring(node.code) walk(node.code, gen) gen.finish() --- 268,273 ---- gen = self.ClassGen(node, self.filename, self.scopes) if node.doc: ! self.emit('LOAD_CONST', node.doc) ! self.storeName('__doc__') walk(node.code, gen) gen.finish() *************** *** 279,295 **** self.storeName(node.name) - def fixDocstring(self, node): - """Rewrite the ast for a class with a docstring. - - The AST includes a Discard(Const(docstring)) node. Replace - this with an Assign([AssName('__doc__', ...]) - """ - assert isinstance(node, ast.Stmt) - stmts = node.nodes - discard = stmts[0] - assert isinstance(discard, ast.Discard) - stmts[0] = ast.Assign([ast.AssName('__doc__', 'OP_ASSIGN')], - discard.expr) - stmts[0].lineno = discard.lineno # The rest are standard visitor methods --- 283,286 ---- *************** *** 301,304 **** --- 292,298 ---- for i in range(numtests): test, suite = node.tests[i] + if is_constant_false(test): + # XXX will need to check generator stuff here + continue self.set_lineno(test) self.visit(test) *************** *** 794,798 **** self.emit(opcode, kw << 8 | pos) ! def visitPrint(self, node): self.set_lineno(node) if node.dest: --- 788,792 ---- self.emit(opcode, kw << 8 | pos) ! def visitPrint(self, node, newline=0): self.set_lineno(node) if node.dest: *************** *** 807,813 **** else: self.emit('PRINT_ITEM') def visitPrintnl(self, node): ! self.visitPrint(node) if node.dest: self.emit('PRINT_NEWLINE_TO') --- 801,809 ---- else: self.emit('PRINT_ITEM') + if node.dest and not newline: + self.emit('POP_TOP') def visitPrintnl(self, node): ! self.visitPrint(node, newline=1) if node.dest: self.emit('PRINT_NEWLINE_TO') *************** *** 1022,1026 **** gen = self.ClassGen(node, self.filename, self.scopes) if node.doc: ! self.fixDocstring(node.code) walk(node.code, gen) gen.finish() --- 1018,1023 ---- gen = self.ClassGen(node, self.filename, self.scopes) if node.doc: ! self.emit('LOAD_CONST', node.doc) ! self.storeName('__doc__') walk(node.code, gen) gen.finish() *************** *** 1073,1077 **** self.graph = pyassem.PyFlowGraph("", filename) self.__super_init(filename) ! self.graph.setFlag(CO_NESTED) class AbstractFunctionCode: --- 1070,1074 ---- self.graph = pyassem.PyFlowGraph("", filename) self.__super_init(filename) ! ## self.graph.setFlag(CO_NESTED) class AbstractFunctionCode: *************** *** 1095,1099 **** self.setDocstring(func.doc) ! lnf = walk(func.code, self.NameFinder(args), 0) self.locals.push(lnf.getLocals()) if func.varargs: --- 1092,1096 ---- self.setDocstring(func.doc) ! lnf = walk(func.code, self.NameFinder(args), verbose=0) self.locals.push(lnf.getLocals()) if func.varargs: *************** *** 1148,1152 **** self.graph.setFreeVars(self.scope.get_free_vars()) self.graph.setCellVars(self.scope.get_cell_vars()) ! self.graph.setFlag(CO_NESTED) class AbstractClassCode: --- 1145,1149 ---- self.graph.setFreeVars(self.scope.get_free_vars()) self.graph.setCellVars(self.scope.get_cell_vars()) ! ## self.graph.setFlag(CO_NESTED) class AbstractClassCode: *************** *** 1156,1160 **** optimized=0) self.super_init(filename) ! lnf = walk(klass.code, self.NameFinder(), 0) self.locals.push(lnf.getLocals()) self.graph.setFlag(CO_NEWLOCALS) --- 1153,1157 ---- optimized=0) self.super_init(filename) ! lnf = walk(klass.code, self.NameFinder(), verbose=0) self.locals.push(lnf.getLocals()) self.graph.setFlag(CO_NEWLOCALS) *************** *** 1187,1191 **** self.graph.setFreeVars(self.scope.get_free_vars()) self.graph.setCellVars(self.scope.get_cell_vars()) ! self.graph.setFlag(CO_NESTED) def generateArgList(arglist): --- 1184,1188 ---- self.graph.setFreeVars(self.scope.get_free_vars()) self.graph.setCellVars(self.scope.get_cell_vars()) ! ## self.graph.setFlag(CO_NESTED) def generateArgList(arglist): *************** *** 1209,1213 **** """Find the op (DELETE, LOAD, STORE) in an AssTuple tree""" v = OpFinder() ! walk(node, v, 0) return v.op --- 1206,1210 ---- """Find the op (DELETE, LOAD, STORE) in an AssTuple tree""" v = OpFinder() ! walk(node, v, verbose=0) return v.op From jhylton@users.sourceforge.net Mon Aug 27 22:58:11 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 14:58:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.40,1.41 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv10771 Modified Files: pycodegen.py Log Message: emit SET_LINENO for augmented assignments Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** pycodegen.py 2001/08/27 21:51:52 1.40 --- pycodegen.py 2001/08/27 21:58:09 1.41 *************** *** 118,121 **** --- 118,124 ---- return 0 + def mangle(name): + return name + class CodeGenerator: """Defines basic code generator for Python bytecode *************** *** 695,698 **** --- 698,702 ---- def visitAugAssign(self, node): + self.set_lineno(node) aug_node = wrap_aug(node.node) self.visit(aug_node, "load") From jackjansen@users.sourceforge.net Mon Aug 27 23:32:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 15:32:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_urllib2.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv19180/Python/Lib/test Modified Files: test_urllib2.py Log Message: A quick hack to make the test pass on the Mac (similar to the quick hack to make it pass on Windows:-). Index: test_urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urllib2.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_urllib2.py 2001/07/16 20:49:49 1.3 --- test_urllib2.py 2001/08/27 22:31:58 1.4 *************** *** 16,19 **** --- 16,23 ---- if fname[1:2] == ":": fname = fname[2:] + # And more hacking to get it to work on MacOS. This assumes + # urllib.pathname2url works, unfortunately... + if os.name == 'mac': + fname = '/' + fname.replace(':', '/') file_url = "file://%s" % fname f = urllib2.urlopen(file_url) From jackjansen@users.sourceforge.net Mon Aug 27 23:50:44 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 15:50:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macconfig.c,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv23177/Python/Mac/Modules Modified Files: macconfig.c Log Message: exceptions was missing from the module list. Added. Index: macconfig.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macconfig.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** macconfig.c 2001/08/23 13:49:54 1.27 --- macconfig.c 2001/08/27 22:50:41 1.28 *************** *** 307,310 **** --- 307,311 ---- {"__main__", NULL}, {"__builtin__", NULL}, + {"exceptions", NULL}, {"sys", NULL}, From jhylton@users.sourceforge.net Mon Aug 27 23:56:19 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Mon, 27 Aug 2001 15:56:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler misc.py,1.7,1.8 pycodegen.py,1.41,1.42 symbols.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv24399 Modified Files: misc.py pycodegen.py symbols.py Log Message: Handle private names (Hard to believe these were never handled before) Add misc.mangle() that mangles based on the rules in compile.c. XXX Need to test the corner cases Update CodeGenerator with a class_name attribute bound to None. If a particular instance is created within a class scope, the instance's class_name is bound to that class's name. Add mangle() method to CodeGenerator that mangles if the class_name has a class_name in it. Modify the FunctionCodeGenerator family to handle an extra argument-- the class_name. Wrap all name ops and attrnames in calls to self.mangle() Index: misc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/misc.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** misc.py 2000/11/06 03:43:11 1.7 --- misc.py 2001/08/27 22:56:16 1.8 *************** *** 40,41 **** --- 40,64 ---- def top(self): return self.stack[-1] + + MANGLE_LEN = 256 # magic constant from compile.c + + def mangle(name, klass): + if not name.startswith('__'): + return name + if len(name) + 2 >= MANGLE_LEN: + return name + if name.endswith('__'): + return name + try: + i = 0 + while klass[i] == '_': + i = i + 1 + except IndexError: + return name + klass = klass[i:] + + tlen = len(klass) + len(name) + if tlen > MANGLE_LEN: + klass = klass[:MANGLE_LEN-tlen] + + return "_%s%s" % (klass, name) Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** pycodegen.py 2001/08/27 21:58:09 1.41 --- pycodegen.py 2001/08/27 22:56:16 1.42 *************** *** 118,124 **** return 0 - def mangle(name): - return name - class CodeGenerator: """Defines basic code generator for Python bytecode --- 118,121 ---- *************** *** 137,140 **** --- 134,138 ---- optimized = 0 # is namespace access optimized? __initialized = None + class_name = None # provide default for instance variable def __init__(self, filename): *************** *** 176,179 **** --- 174,183 ---- return self.graph.getCode() + def mangle(self, name): + if self.class_name is not None: + return misc.mangle(name, self.class_name) + else: + return name + # Next five methods handle name access *************** *** 191,194 **** --- 195,199 ---- def _nameOp(self, prefix, name): + name = self.mangle(name) if not self.optimized: self.emit(prefix + '_NAME', name) *************** *** 259,263 **** def _visitFuncOrLambda(self, node, isLambda=0): ! gen = self.FunctionGen(node, self.filename, self.scopes, isLambda) walk(node.code, gen) gen.finish() --- 264,269 ---- def _visitFuncOrLambda(self, node, isLambda=0): ! gen = self.FunctionGen(node, self.filename, self.scopes, isLambda, ! self.class_name) walk(node.code, gen) gen.finish() *************** *** 646,650 **** def visitGetattr(self, node): self.visit(node.expr) ! self.emit('LOAD_ATTR', node.attrname) # next five implement assignments --- 652,656 ---- def visitGetattr(self, node): self.visit(node.expr) ! self.emit('LOAD_ATTR', self.mangle(node.attrname)) # next five implement assignments *************** *** 672,678 **** self.visit(node.expr) if node.flags == 'OP_ASSIGN': ! self.emit('STORE_ATTR', node.attrname) elif node.flags == 'OP_DELETE': ! self.emit('DELETE_ATTR', node.attrname) else: print "warning: unexpected flags:", node.flags --- 678,684 ---- self.visit(node.expr) if node.flags == 'OP_ASSIGN': ! self.emit('STORE_ATTR', self.mangle(node.attrname)) elif node.flags == 'OP_DELETE': ! self.emit('DELETE_ATTR', self.mangle(node.attrname)) else: print "warning: unexpected flags:", node.flags *************** *** 729,736 **** self.visit(node.expr) self.emit('DUP_TOP') ! self.emit('LOAD_ATTR', node.attrname) elif mode == "store": self.emit('ROT_TWO') ! self.emit('STORE_ATTR', node.attrname) def visitAugSlice(self, node, mode): --- 735,742 ---- self.visit(node.expr) self.emit('DUP_TOP') ! self.emit('LOAD_ATTR', self.mangle(node.attrname)) elif mode == "store": self.emit('ROT_TWO') ! self.emit('STORE_ATTR', self.mangle(node.attrname)) def visitAugSlice(self, node, mode): *************** *** 988,991 **** --- 994,998 ---- def _nameOp(self, prefix, name): + name = self.mangle(name) scope = self.scope.check_name(name) if scope == SC_LOCAL: *************** *** 1003,1007 **** def _visitFuncOrLambda(self, node, isLambda=0): ! gen = self.FunctionGen(node, self.filename, self.scopes, isLambda) walk(node.code, gen) gen.finish() --- 1010,1015 ---- def _visitFuncOrLambda(self, node, isLambda=0): ! gen = self.FunctionGen(node, self.filename, self.scopes, isLambda, ! self.class_name) walk(node.code, gen) gen.finish() *************** *** 1080,1084 **** lambdaCount = 0 ! def __init__(self, func, filename, scopes, isLambda): if isLambda: klass = FunctionCodeGenerator --- 1088,1093 ---- lambdaCount = 0 ! def __init__(self, func, filename, scopes, isLambda, class_name): ! self.class_name = class_name if isLambda: klass = FunctionCodeGenerator *************** *** 1143,1150 **** __super_init = AbstractFunctionCode.__init__ ! def __init__(self, func, filename, scopes, isLambda): self.scopes = scopes self.scope = scopes[func] ! self.__super_init(func, filename, scopes, isLambda) self.graph.setFreeVars(self.scope.get_free_vars()) self.graph.setCellVars(self.scope.get_cell_vars()) --- 1152,1159 ---- __super_init = AbstractFunctionCode.__init__ ! def __init__(self, func, filename, scopes, isLambda, class_name): self.scopes = scopes self.scope = scopes[func] ! self.__super_init(func, filename, scopes, isLambda, class_name) self.graph.setFreeVars(self.scope.get_free_vars()) self.graph.setCellVars(self.scope.get_cell_vars()) *************** *** 1154,1157 **** --- 1163,1167 ---- def __init__(self, klass, filename, scopes): + self.class_name = klass.name self.graph = pyassem.PyFlowGraph(klass.name, filename, optimized=0) *************** *** 1164,1167 **** --- 1174,1178 ---- def _nameOp(self, prefix, name): + name = self.mangle(name) # Class namespaces are always unoptimized self.emit(prefix + '_NAME', name) Index: symbols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/symbols.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** symbols.py 2001/08/27 21:06:35 1.6 --- symbols.py 2001/08/27 22:56:16 1.7 *************** *** 3,8 **** --- 3,10 ---- from compiler import ast from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL, SC_UNKNOWN + from compiler.misc import mangle import types + import sys *************** *** 36,47 **** def mangle(self, name): if self.klass is None: - return name - if not name.startswith('__'): - return name - if len(name) + 2 >= MANGLE_LEN: - return name - if name.endswith('__'): return name ! return "_%s%s" % (self.klass, name) def add_def(self, name): --- 38,43 ---- def mangle(self, name): if self.klass is None: return name ! return mangle(name, self.klass) def add_def(self, name): From jackjansen@users.sourceforge.net Tue Aug 28 00:16:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 27 Aug 2001 16:16:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.102,1.103 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv28865/Python/Mac/Python Modified Files: macglue.c Log Message: Experimental feature: allow \n as well as \r as newline for text files, by breaking in to the lowlevel I/O system. Can be disabled by defining WITHOUT_UNIX_NEWLINES. Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** macglue.c 2001/08/19 22:32:27 1.102 --- macglue.c 2001/08/27 23:16:34 1.103 *************** *** 180,183 **** --- 180,200 ---- int PyMac_AppearanceCompliant; + #ifndef WITHOUT_UNIX_NEWLINES + /* + ** Experimental feature (for 2.2a2): allow unix newlines + ** as well as Mac newlines on input. We replace a lowlevel + ** MSL routine to accomplish this + */ + void + __convert_to_newlines(unsigned char * buf, size_t * n_ptr) + { + unsigned char *p; + size_t n = *n_ptr; + + for(p=buf; n > 0; p++, n--) + if ( *p == '\r' ) *p = '\n'; + } + #endif /* WITHOUT_UNIX_NEWLINES */ + /* Given an FSSpec, return the FSSpec of the parent folder */ From bwarsaw@users.sourceforge.net Tue Aug 28 03:31:30 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 27 Aug 2001 19:31:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.141,1.142 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv4752 Modified Files: api.tex Log Message: Documentation for PyString_FromFormat() and PyString_FromFormatV(). Closes SF patch #455666. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** api.tex 2001/08/20 16:48:59 1.141 --- api.tex 2001/08/28 02:31:28 1.142 *************** *** 2623,2626 **** --- 2623,2654 ---- \end{cfuncdesc} + \begin{cfuncdesc}{PyObject*}{PyString_FromFormat}{const char *format, ...} + Takes a C \code{printf}-style \var{format} string and a variable + number of arguments, calculates the size of the resulting Python + string and returns a string with the values formatted into it. The + variable arguments must be C types and must correspond exactly to the + format characters in the \var{format} string. The following format + characters are allowed: + \begin{tableiii}{l|l|l}{member}{Format Characters}{Type}{Comment} + \lineiii{\%\%}{\emph{n/a}}{The literal \% character.} + \lineiii{\%c}{int}{A single character, represented as an C int.} + \lineiii{\%d}{int}{Exactly equivalent to \code{printf("\%d")}.} + \lineiii{\%ld}{long}{Exactly equivalent to \code{printf("\%ld")}.} + \lineiii{\%i}{int}{Exactly equivalent to \code{printf("\%i")}.} + \lineiii{\%x}{int}{Exactly equivalent to \code{printf("\%x")}.} + \lineiii{\%s}{char*}{A null-terminated C character array.} + \lineiii{\%p}{void*}{The hex representation of a C pointer. + Mostly equivalent to \code{printf("\%p")} except that it is + guaranteed to start with the literal \code{0x} regardless of + what the platform's \code{printf} yields.} + \end{tableiii} + \end{cfuncdesc} + + \begin{cfuncdesc}{PyObject*}{PyString_FromFormatV}{const char *format, + va_list vargs} + Identical to \function{PyString_FromFormat()} except that it takes + exactly two arguments. + \end{cfuncdesc} + \begin{cfuncdesc}{int}{PyString_Size}{PyObject *string} Returns the length of the string in string object \var{string}. From bwarsaw@users.sourceforge.net Tue Aug 28 03:32:06 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 27 Aug 2001 19:32:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api refcounts.dat,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv5063 Modified Files: refcounts.dat Log Message: Refcount info for PyString_FromFormat() and PyString_FromFormatV(). Closes SF patch #455666. Index: refcounts.dat =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounts.dat,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** refcounts.dat 2001/08/08 18:50:18 1.28 --- refcounts.dat 2001/08/28 02:32:04 1.29 *************** *** 919,922 **** --- 919,930 ---- PyString_FromStringAndSize:int:len:: + PyString_FromFormat:PyObject*::+1: + PyString_FromFormat:const char*:format:: + PyString_FromFormat::...:: + + PyString_FromFormatV:PyObject*::+1: + PyString_FromFormatV:const char*:format:: + PyString_FromFormatV:va_list:vargs:: + PyString_GET_SIZE:int::: PyString_GET_SIZE:PyObject*:string:0: From esr@users.sourceforge.net Tue Aug 28 13:50:05 2001 From: esr@users.sourceforge.net (Eric S. Raymond) Date: Tue, 28 Aug 2001 05:50:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.66,1.67 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv3406 Modified Files: libre.tex Log Message: Plant a mention in the description of backreferences of the fact that while \0 doesn't do what one might expect, \g<0> does. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** libre.tex 2001/08/02 20:52:00 1.66 --- libre.tex 2001/08/28 12:50:03 1.67 *************** *** 298,301 **** --- 298,303 ---- is 0, or \var{number} is 3 octal digits long, it will not be interpreted as a group match, but as the character with octal value \var{number}. + (There is a group 0, which is the entire matched pattern, but it can't + be referenced with \regexp{\e 0}; instead, use \regexp{\e g<0>}.) Inside the \character{[} and \character{]} of a character class, all numeric escapes are treated as characters. *************** *** 567,571 **** ambiguous in a replacement such as \samp{\e g<2>0}. \samp{\e 20} would be interpreted as a reference to group 20, not a reference to ! group 2 followed by the literal character \character{0}. \end{funcdesc} --- 569,575 ---- ambiguous in a replacement such as \samp{\e g<2>0}. \samp{\e 20} would be interpreted as a reference to group 20, not a reference to ! group 2 followed by the literal character \character{0}. The ! backreference \samp{\e g<0>} substitutes in the entire substring ! matched by the RE. \end{funcdesc} From fdrake@users.sourceforge.net Tue Aug 28 15:25:05 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 28 Aug 2001 07:25:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcodeop.tex,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv6852/lib Modified Files: libcodeop.tex Log Message: Fix a number of minor markup errors, and improve the consistency a bit. Index: libcodeop.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcodeop.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** libcodeop.tex 2001/08/27 20:02:16 1.4 --- libcodeop.tex 2001/08/28 14:25:03 1.5 *************** *** 10,27 **** The \module{codeop} module provides utilities upon which the Python ! read-eval-print loop can be emulated -- as in the \refmodule{code} ! module. As a result, you probably don't want to use the module ! directly -- if you want to include such a loop in your program you ! probably want to use the \refmodule{code} instead. There are two parts to this job: ! \begin{list} ! \listitem Being able to tell if a line of input completes a Python ! statement -- in short telling whether to print ``>>> '' or ! ``... '' next. ! \listitem Remembering which future statements the user has entered, so ! subsequent input can be compiled wiht these in effect. ! \end{list} The \module{codeop} module provides a way of doing each of these --- 10,27 ---- The \module{codeop} module provides utilities upon which the Python ! read-eval-print loop can be emulated, as is done in the ! \refmodule{code} module. As a result, you probably don't want to use ! the module directly; if you want to include such a loop in your ! program you probably want to use the \refmodule{code} module instead. There are two parts to this job: ! \begin{enumerate} ! \item Being able to tell if a line of input completes a Python ! statement: in short, telling whether to print ! `\code{>\code{>}>~} or `\code{...~}' next. ! \item Remembering which future statements the user has entered, so ! subsequent input can be compiled with these in effect. ! \end{enumerate} The \module{codeop} module provides a way of doing each of these *************** *** 59,64 **** \begin{classdesc}{Compile}{} ! Instances of this class have \method{__call__} methods indentical in ! signature to the built-in function \function{compile}, but with the difference that if the instance compiles program text containing a \module{__future__} statement, the instance 'remembers' and compiles --- 59,64 ---- \begin{classdesc}{Compile}{} ! Instances of this class have \method{__call__()} methods indentical in ! signature to the built-in function \function{compile()}, but with the difference that if the instance compiles program text containing a \module{__future__} statement, the instance 'remembers' and compiles *************** *** 67,73 **** \begin{classdesc}{CommandCompiler}{} ! Instances of this class have \method{__call__} methods identical in ! signature to \function{compile_command}; the difference is that if the ! instance compiles program text containing a \method{__future__} statement, the instance 'remembers' and compiles all subsequent program texts with the statement in force. --- 67,73 ---- \begin{classdesc}{CommandCompiler}{} ! Instances of this class have \method{__call__()} methods identical in ! signature to \function{compile_command()}; the difference is that if ! the instance compiles program text containing a \code{__future__} statement, the instance 'remembers' and compiles all subsequent program texts with the statement in force. From jackjansen@users.sourceforge.net Tue Aug 28 15:49:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 28 Aug 2001 07:49:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test regrtest.py,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv15409/python/Lib/test Modified Files: regrtest.py Log Message: Added list of tests expected to be skipped on the mac. Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** regrtest.py 2001/08/20 22:33:46 1.43 --- regrtest.py 2001/08/28 14:49:00 1.44 *************** *** 513,516 **** --- 513,552 ---- test_winsound """, + 'mac': + """ + test_al + test_bsddb + test_cd + test_cl + test_commands + test_crypt + test_dbm + test_dl + test_fcntl + test_fork1 + test_gl + test_grp + test_imgfile + test_largefile + test_linuxaudiodev + test_locale + test_mmap + test_nis + test_ntpath + test_openpty + test_poll + test_popen2 + test_pty + test_pwd + test_signal + test_socket_ssl + test_socketserver + test_sunaudiodev + test_sundry + test_timing + test_unicode_file + test_winreg + test_winsound + """, } From fdrake@users.sourceforge.net Tue Aug 28 15:56:07 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 28 Aug 2001 07:56:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libstdtypes.tex,1.67,1.68 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv18226/lib Modified Files: libstdtypes.tex Log Message: Added explanation that [...] * n generates shallow copies of [...], so the contents will be shared by multiple references. This closes SF bug #455694. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** libstdtypes.tex 2001/08/14 18:22:24 1.67 --- libstdtypes.tex 2001/08/28 14:56:05 1.68 *************** *** 417,421 **** \hline \lineiii{\var{s} + \var{t}}{the concatenation of \var{s} and \var{t}}{} ! \lineiii{\var{s} * \var{n}\textrm{,} \var{n} * \var{s}}{\var{n} copies of \var{s} concatenated}{(1)} \hline \lineiii{\var{s}[\var{i}]}{\var{i}'th item of \var{s}, origin 0}{(2)} --- 417,421 ---- \hline \lineiii{\var{s} + \var{t}}{the concatenation of \var{s} and \var{t}}{} ! \lineiii{\var{s} * \var{n}\textrm{,} \var{n} * \var{s}}{\var{n} shallow copies of \var{s} concatenated}{(1)} \hline \lineiii{\var{s}[\var{i}]}{\var{i}'th item of \var{s}, origin 0}{(2)} *************** *** 443,447 **** \item[(1)] Values of \var{n} less than \code{0} are treated as \code{0} (which yields an empty sequence of the same type as ! \var{s}). \item[(2)] If \var{i} or \var{j} is negative, the index is relative to --- 443,471 ---- \item[(1)] Values of \var{n} less than \code{0} are treated as \code{0} (which yields an empty sequence of the same type as ! \var{s}). Note also that the copies are shallow; nested structures ! are not copied. This often haunts new Python programmers; consider: ! ! \begin{verbatim} ! >>> lists = [[]] * 3 ! >>> lists ! [[], [], []] ! >>> lists[0].append(3) ! >>> lists ! [[3], [3], [3]] ! \end{verbatim} ! ! What has happened is that \code{lists} is a list containing three ! copies of the list \code{[[]]} (a one-element list containing an ! empty list), but the contained list is shared by each copy. You can ! create a list of different lists this way: ! ! \begin{verbatim} ! >>> lists = [[] for i in range(3)] ! >>> lists[0].append(3) ! >>> lists[1].append(5) ! >>> lists[2].append(7) ! >>> lists ! [[3], [5], [7]] ! \end{verbatim} \item[(2)] If \var{i} or \var{j} is negative, the index is relative to From jhylton@users.sourceforge.net Tue Aug 28 16:32:50 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 28 Aug 2001 08:32:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib dis.py,1.35,1.36 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv30295 Modified Files: dis.py Log Message: FOR_ITER is a jrel_op() not a plain old def_op() Index: dis.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dis.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** dis.py 2001/06/18 22:08:13 1.35 --- dis.py 2001/08/28 15:32:48 1.36 *************** *** 235,239 **** name_op('DELETE_NAME', 91) # "" def_op('UNPACK_SEQUENCE', 92) # Number of tuple items ! def_op('FOR_ITER', 93) name_op('STORE_ATTR', 95) # Index in name list --- 235,239 ---- name_op('DELETE_NAME', 91) # "" def_op('UNPACK_SEQUENCE', 92) # Number of tuple items ! jrel_op('FOR_ITER', 93) name_op('STORE_ATTR', 95) # Index in name list From gvwilson@users.sourceforge.net Tue Aug 28 17:19:37 2001 From: gvwilson@users.sourceforge.net (Greg Wilson) Date: Tue, 28 Aug 2001 09:19:37 -0700 Subject: [Python-checkins] CVS: python/nondist/sandbox/sets set.py,1.2,1.3 test_set.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/sets In directory usw-pr-cvs1:/tmp/cvs-serv11763 Modified Files: set.py test_set.py Log Message: Modified sets to inherit directly from dictionary Index: set.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/sets/set.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** set.py 2001/05/25 15:54:25 1.2 --- set.py 2001/08/28 16:19:35 1.3 *************** *** 15,19 **** from copy import deepcopy ! class Set: # Displayed when operation forbidden because set has been frozen --- 15,19 ---- from copy import deepcopy ! class Set(dictionary): # Displayed when operation forbidden because set has been frozen *************** *** 31,39 **** thereafter.""" - self.elements = {} self.sort_repr = sort_repr if seq is not None: for x in seq: ! self.elements[x] = None self.hashcode = None --- 31,38 ---- thereafter.""" self.sort_repr = sort_repr if seq is not None: for x in seq: ! self[x] = None self.hashcode = None *************** *** 41,45 **** def __str__(self): """Convert set to string.""" ! content = self.elements.keys() if self.sort_repr: content.sort() --- 40,44 ---- def __str__(self): """Convert set to string.""" ! content = self.keys() if self.sort_repr: content.sort() *************** *** 51,78 **** #---------------------------------------- - def __len__(self): - """Return number of elements in set.""" - return len(self.elements) - - #---------------------------------------- - def __contains__(self, item): - """Test presence of value in set.""" - return item in self.elements - - #---------------------------------------- def __iter__(self): """Return iterator for enumerating set elements. This is a keys iterator for the underlying dictionary.""" ! return self.elements.iterkeys() #---------------------------------------- ! def __cmp__(self, other): ! """Compare one set with another. Sets may only be compared ! with sets; ordering is determined by the keys in the ! underlying dictionary.""" ! if not isinstance(other, Set): ! raise ValueError, "Sets can only be compared to sets" ! return cmp(self.elements, other.elements) #---------------------------------------- def __hash__(self): --- 50,79 ---- #---------------------------------------- def __iter__(self): """Return iterator for enumerating set elements. This is a keys iterator for the underlying dictionary.""" ! return self.iterkeys() #---------------------------------------- ! # Comparisons ! ! def __lt__(self, other): ! return self._generic_cmp(other, dictionary.__lt__) ! ! def __le__(self, other): ! return self._generic_cmp(other, dictionary.__le__) + def __eq__(self, other): + return self._generic_cmp(other, dictionary.__eq__) + + def __ne__(self, other): + return self._generic_cmp(other, dictionary.__ne__) + + def __gt__(self, other): + return self._generic_cmp(other, dictionary.__gt__) + + def __ge__(self, other): + return self._generic_cmp(other, dictionary.__ge__) + #---------------------------------------- def __hash__(self): *************** *** 90,94 **** # Combine hash codes of set elements to produce set's hash code. self.hashcode = 0 ! for elt in self.elements: self.hashcode ^= hash(elt) return self.hashcode --- 91,95 ---- # Combine hash codes of set elements to produce set's hash code. self.hashcode = 0 ! for elt in self: self.hashcode ^= hash(elt) return self.hashcode *************** *** 107,111 **** """Return a shallow copy of the set.""" result = Set() ! result.elements = self.elements.copy() return result --- 108,113 ---- """Return a shallow copy of the set.""" result = Set() ! for elt in self: ! result[elt] = None return result *************** *** 118,122 **** result = Set() memo[id(self)] = result ! result.elements = deepcopy(self.elements, memo) return result --- 120,125 ---- result = Set() memo[id(self)] = result ! for elt in self: ! result[deepcopy(elt, memo)] = None return result *************** *** 126,130 **** if self.hashcode is not None: raise ValueError, Set._Frozen_Msg % "clearing" ! self.elements.clear() #---------------------------------------- --- 129,133 ---- if self.hashcode is not None: raise ValueError, Set._Frozen_Msg % "clearing" ! dictionary.clear(self) #---------------------------------------- *************** *** 134,138 **** self._binary_sanity_check(other, "updating union") ! self.elements.update(other.elements) return self --- 137,141 ---- self._binary_sanity_check(other, "updating union") ! self.update(other) return self *************** *** 153,161 **** self._binary_sanity_check(other, "updating intersection") ! new_elements = {} ! for elt in self.elements: ! if elt in other.elements: ! new_elements[elt] = None ! self.elements = new_elements return self --- 156,164 ---- self._binary_sanity_check(other, "updating intersection") ! old_elements = self.keys() ! self.clear() ! for elt in old_elements: ! if elt in other: ! self[elt] = None return self *************** *** 171,177 **** little, big = other, self result = Set() ! for elt in little.elements: ! if elt in big.elements: ! result.elements[elt] = None return result --- 174,180 ---- little, big = other, self result = Set() ! for elt in little: ! if elt in big: ! result[elt] = None return result *************** *** 184,188 **** self._binary_sanity_check(other, "updating symmetric difference") ! self.elements = self._raw_sym_difference(self.elements, other.elements) return self --- 187,191 ---- self._binary_sanity_check(other, "updating symmetric difference") ! self = self._raw_sym_difference(self, other) return self *************** *** 196,200 **** self._binary_sanity_check(other) result = Set() ! result.elements = self._raw_sym_difference(self.elements, other.elements) return result --- 199,203 ---- self._binary_sanity_check(other) result = Set() ! result = self._raw_sym_difference(self, other) return result *************** *** 204,212 **** self._binary_sanity_check(other, "updating difference") ! new_elements = {} ! for elt in self.elements: ! if elt not in other.elements: ! new_elements[elt] = None ! self.elements = new_elements return self --- 207,215 ---- self._binary_sanity_check(other, "updating difference") ! old_elements = self.keys() ! self.clear() ! for elt in old_elements: ! if elt not in other: ! self[elt] = None return self *************** *** 218,224 **** self._binary_sanity_check(other) result = Set() ! for elt in self.elements: ! if elt not in other.elements: ! result.elements[elt] = None return result --- 221,227 ---- self._binary_sanity_check(other) result = Set() ! for elt in self: ! if elt not in other: ! result[elt] = None return result *************** *** 245,249 **** if self.hashcode is not None: raise ValueError, Set._Frozen_Msg % "adding an element" ! self.elements[item] = None #---------------------------------------- --- 248,252 ---- if self.hashcode is not None: raise ValueError, Set._Frozen_Msg % "adding an element" ! self[item] = None #---------------------------------------- *************** *** 255,259 **** raise ValueError, Set._Frozen_Msg % "adding an element" for item in iterable: ! self.elements[item] = None #---------------------------------------- --- 258,262 ---- raise ValueError, Set._Frozen_Msg % "adding an element" for item in iterable: ! self[item] = None #---------------------------------------- *************** *** 264,271 **** if self.hashcode is not None: raise ValueError, Set._Frozen_Msg % "removing an element" ! try: ! del self.elements[item] ! except KeyError: ! raise LookupError, `item` #---------------------------------------- --- 267,271 ---- if self.hashcode is not None: raise ValueError, Set._Frozen_Msg % "removing an element" ! del self[item] #---------------------------------------- *************** *** 277,281 **** raise ValueError, Set._Frozen_Msg % "removing an element" try: ! del self.elements[item] except KeyError: pass --- 277,281 ---- raise ValueError, Set._Frozen_Msg % "removing an element" try: ! del self[item] except KeyError: pass *************** *** 285,293 **** """Remove and return a randomly-chosen set element.""" ! try: ! (key, value) = self.elements.popitem() ! return key ! except KeyError: ! raise LookupError, "set is empty" #---------------------------------------- --- 285,291 ---- """Remove and return a randomly-chosen set element.""" ! if self.hashcode is not None: ! raise ValueError, Set._Frozen_Msg % "removing an element" ! return dictionary.popitem(self)[0] #---------------------------------------- *************** *** 296,313 **** if not isinstance(other, Set): raise ValueError, "Subset tests only permitted between sets" ! for element in self.elements: ! if element not in other.elements: return 0 return 1 #---------------------------------------- ! def contains_all_of(self, other): ! """Report whether other subset is subset of this set.""" if not isinstance(other, Set): ! raise ValueError, "Subset tests only permitted between sets" ! for element in other.elements: ! if element not in self.elements: ! return 0 ! return 1 #---------------------------------------- --- 294,311 ---- if not isinstance(other, Set): raise ValueError, "Subset tests only permitted between sets" ! for element in self: ! if element not in other: return 0 return 1 #---------------------------------------- ! # Generic comparison ! def _generic_cmp(self, other, method): ! """Compare one set with another using a dictionary method. ! Sets may only be compared with sets; ordering is determined ! by the keys in the underlying dictionary.""" if not isinstance(other, Set): ! raise ValueError, "Sets can only be compared to sets" ! return method(self, other) #---------------------------------------- Index: test_set.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/sets/test_set.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_set.py 2001/05/25 15:54:25 1.2 --- test_set.py 2001/08/28 16:19:35 1.3 *************** *** 383,393 **** assert not result, "non-subset: " + self.name - def test_contains_all_of(self): - result = self.left.contains_all_of(self.right) - if ">" in self.cases: - assert result, "contains all: " + self.name - else: - assert not result, "not contains all: " + self.name - #------------------------------------------------------------------------------- --- 383,386 ---- From jhylton@users.sourceforge.net Tue Aug 28 17:35:20 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 28 Aug 2001 09:35:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv16049 Modified Files: pycodegen.py Log Message: Generate FOR_ITER-based loops instead of old FOR_LOOP-based loops Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** pycodegen.py 2001/08/27 22:56:16 1.42 --- pycodegen.py 2001/08/28 16:35:18 1.43 *************** *** 356,364 **** self.emit('SETUP_LOOP', after) self.visit(node.list) ! self.visit(ast.Const(0)) self.nextBlock(start) self.set_lineno(node, force=1) ! self.emit('FOR_LOOP', anchor) ! self.nextBlock() self.visit(node.assign) self.visit(node.body) --- 356,364 ---- self.emit('SETUP_LOOP', after) self.visit(node.list) ! self.emit('GET_ITER') ! self.nextBlock(start) self.set_lineno(node, force=1) ! self.emit('FOR_ITER', anchor) self.visit(node.assign) self.visit(node.body) *************** *** 568,572 **** else: self.nextBlock() ! self.emit('POP_TOP') self.emit('END_FINALLY') if node.else_: --- 568,573 ---- else: self.nextBlock() ! if expr: # XXX ! self.emit('POP_TOP') self.emit('END_FINALLY') if node.else_: *************** *** 1002,1006 **** self.emit(prefix + '_FAST', name) elif scope == SC_GLOBAL: ! self.emit(prefix + '_GLOBAL', name) elif scope == SC_FREE or scope == SC_CELL: self.emit(prefix + '_DEREF', name) --- 1003,1010 ---- self.emit(prefix + '_FAST', name) elif scope == SC_GLOBAL: ! if not self.optimized: ! self.emit(prefix + '_NAME', name) ! else: ! self.emit(prefix + '_GLOBAL', name) elif scope == SC_FREE or scope == SC_CELL: self.emit(prefix + '_DEREF', name) From jhylton@users.sourceforge.net Tue Aug 28 17:36:14 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 28 Aug 2001 09:36:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pyassem.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv16254 Modified Files: pyassem.py Log Message: XXX_NAME ops should affect varnames varnames should list all the local variables (with arguments first). The XXX_NAME ops typically occur at the module level and assignment ops should create locals. Index: pyassem.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pyassem.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** pyassem.py 2001/06/09 09:26:21 1.20 --- pyassem.py 2001/08/28 16:36:12 1.21 *************** *** 492,498 **** _convert_DELETE_FAST = _convert_LOAD_FAST def _convert_NAME(self, arg): return self._lookupName(arg, self.names) - _convert_LOAD_NAME = _convert_NAME _convert_STORE_NAME = _convert_NAME _convert_DELETE_NAME = _convert_NAME --- 492,501 ---- _convert_DELETE_FAST = _convert_LOAD_FAST + def _convert_LOAD_NAME(self, arg): + return self._lookupName(arg, self.names) + def _convert_NAME(self, arg): + self._lookupName(arg, self.varnames) return self._lookupName(arg, self.names) _convert_STORE_NAME = _convert_NAME _convert_DELETE_NAME = _convert_NAME From gvanrossum@users.sourceforge.net Tue Aug 28 17:37:53 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 28 Aug 2001 09:37:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python getargs.c,2.62,2.63 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv16610 Modified Files: getargs.c Log Message: The "O!" format code should implement an isinstance() test rather than a type equality test. Index: getargs.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v retrieving revision 2.62 retrieving revision 2.63 diff -C2 -d -r2.62 -r2.63 *** getargs.c 2001/08/17 18:39:25 2.62 --- getargs.c 2001/08/28 16:37:51 2.63 *************** *** 876,880 **** p = va_arg(*p_va, PyObject **); format++; ! if (arg->ob_type == type) *p = arg; else --- 876,880 ---- p = va_arg(*p_va, PyObject **); format++; ! if (PyType_IsSubtype(arg->ob_type, type)) *p = arg; else From jhylton@users.sourceforge.net Tue Aug 28 18:28:41 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 28 Aug 2001 10:28:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv32059 Modified Files: pycodegen.py Log Message: Make sure the JUMP_ABSOLUTE and POP_BLOCK at the end of a for loop are contiguous. Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** pycodegen.py 2001/08/28 16:35:18 1.43 --- pycodegen.py 2001/08/28 17:28:33 1.44 *************** *** 364,368 **** self.visit(node.body) self.emit('JUMP_ABSOLUTE', start) ! self.startBlock(anchor) self.emit('POP_BLOCK') self.loops.pop() --- 364,368 ---- self.visit(node.body) self.emit('JUMP_ABSOLUTE', start) ! self.nextBlock(anchor) self.emit('POP_BLOCK') self.loops.pop() From gvanrossum@users.sourceforge.net Tue Aug 28 18:47:54 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 28 Aug 2001 10:47:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.46,2.47 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv4247 Modified Files: typeobject.c Log Message: Change in policy: when a slot_tp_xxx function looks for the __xxx__ method, don't use getattr, but only look in the dict of the type and base types. This prevents picking up all sorts of weird stuff, including things defined by the metaclass when the object is a class (type). For this purpose, a helper function lookup_method() was added. One or two other places also use this. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.46 retrieving revision 2.47 diff -C2 -d -r2.46 -r2.47 *** typeobject.c 2001/08/24 18:34:26 2.46 --- typeobject.c 2001/08/28 17:47:51 2.47 *************** *** 290,293 **** --- 290,323 ---- } + /* Internal routine to do a method lookup in the type + without looking in the instance dictionary + (so we can't use PyObject_GetAttr) but still binding + it to the instance. The arguments are the object, + the method name as a C string, and the address of a + static variable used to cache the interned Python string. */ + + static PyObject * + lookup_method(PyObject *self, char *attrstr, PyObject **attrobj) + { + PyObject *res; + + if (*attrobj == NULL) { + *attrobj = PyString_InternFromString(attrstr); + if (*attrobj == NULL) + return NULL; + } + res = _PyType_Lookup(self->ob_type, *attrobj); + if (res == NULL) + PyErr_SetObject(PyExc_AttributeError, *attrobj); + else { + descrgetfunc f; + if ((f = res->ob_type->tp_descr_get) == NULL) + Py_INCREF(res); + else + res = f(res, self, (PyObject *)(self->ob_type)); + } + return res; + } + /* Method resolution order algorithm from "Putting Metaclasses to Work" by Forman and Danforth (Addison-Wesley 1999). */ *************** *** 400,404 **** } else { ! mro = PyObject_GetAttrString((PyObject *)type, "mro"); if (mro == NULL) return -1; --- 430,435 ---- } else { ! static PyObject *mro_str; ! mro = lookup_method((PyObject *)type, "mro", &mro_str); if (mro == NULL) return -1; *************** *** 2406,2411 **** { PyObject *func, *res, *args; ! func = PyObject_GetAttrString(self, "__contains__"); if (func != NULL) { --- 2437,2443 ---- { PyObject *func, *res, *args; + static PyObject *contains_str; ! func = lookup_method(self, "__contains__", &contains_str); if (func != NULL) { *************** *** 2480,2488 **** { PyObject *func, *res; ! func = PyObject_GetAttrString(self, "__nonzero__"); if (func == NULL) { PyErr_Clear(); ! func = PyObject_GetAttrString(self, "__len__"); } --- 2512,2521 ---- { PyObject *func, *res; + static PyObject *nonzero_str, *len_str; ! func = lookup_method(self, "__nonzero__", &nonzero_str); if (func == NULL) { PyErr_Clear(); ! func = lookup_method(self, "__len__", &len_str); } *************** *** 2533,2539 **** { PyObject *func, *args, *res; int c; ! func = PyObject_GetAttrString(self, "__cmp__"); if (func == NULL) { PyErr_Clear(); --- 2566,2573 ---- { PyObject *func, *args, *res; + static PyObject *cmp_str; int c; ! func = lookup_method(self, "__cmp__", &cmp_str); if (func == NULL) { PyErr_Clear(); *************** *** 2586,2591 **** { PyObject *func, *res; ! func = PyObject_GetAttrString(self, "__repr__"); if (func != NULL) { res = PyEval_CallObject(func, NULL); --- 2620,2626 ---- { PyObject *func, *res; + static PyObject *repr_str; ! func = lookup_method(self, "__repr__", &repr_str); if (func != NULL) { res = PyEval_CallObject(func, NULL); *************** *** 2602,2607 **** { PyObject *func, *res; ! func = PyObject_GetAttrString(self, "__str__"); if (func != NULL) { res = PyEval_CallObject(func, NULL); --- 2637,2643 ---- { PyObject *func, *res; + static PyObject *str_str; ! func = lookup_method(self, "__str__", &str_str); if (func != NULL) { res = PyEval_CallObject(func, NULL); *************** *** 2619,2625 **** { PyObject *func, *res; long h; ! func = PyObject_GetAttrString(self, "__hash__"); if (func != NULL) { --- 2655,2663 ---- { PyObject *func, *res; + static PyObject *hash_str, *eq_str, *cmp_str; + long h; ! func = lookup_method(self, "__hash__", &hash_str); if (func != NULL) { *************** *** 2632,2639 **** else { PyErr_Clear(); ! func = PyObject_GetAttrString(self, "__eq__"); if (func == NULL) { PyErr_Clear(); ! func = PyObject_GetAttrString(self, "__cmp__"); } if (func != NULL) { --- 2670,2677 ---- else { PyErr_Clear(); ! func = lookup_method(self, "__eq__", &eq_str); if (func == NULL) { PyErr_Clear(); ! func = lookup_method(self, "__cmp__", &cmp_str); } if (func != NULL) { *************** *** 2653,2657 **** slot_tp_call(PyObject *self, PyObject *args, PyObject *kwds) { ! PyObject *meth = PyObject_GetAttrString(self, "__call__"); PyObject *res; --- 2691,2696 ---- slot_tp_call(PyObject *self, PyObject *args, PyObject *kwds) { ! static PyObject *call_str; ! PyObject *meth = lookup_method(self, "__call__", &call_str); PyObject *res; *************** *** 2715,2720 **** { PyObject *func, *args, *res; ! func = PyObject_GetAttrString(self, name_op[op]); if (func == NULL) { PyErr_Clear(); --- 2754,2760 ---- { PyObject *func, *args, *res; + static PyObject *op_str[6]; ! func = lookup_method(self, name_op[op], &op_str[op]); if (func == NULL) { PyErr_Clear(); *************** *** 2762,2767 **** { PyObject *func, *res; ! func = PyObject_GetAttrString(self, "__iter__"); if (func != NULL) { res = PyObject_CallObject(func, NULL); --- 2802,2808 ---- { PyObject *func, *res; + static PyObject *iter_str, *getitem_str; ! func = lookup_method(self, "__iter__", &iter_str); if (func != NULL) { res = PyObject_CallObject(func, NULL); *************** *** 2770,2774 **** } PyErr_Clear(); ! func = PyObject_GetAttrString(self, "__getitem__"); if (func == NULL) { PyErr_SetString(PyExc_TypeError, "iter() of non-sequence"); --- 2811,2815 ---- } PyErr_Clear(); ! func = lookup_method(self, "__getitem__", &getitem_str); if (func == NULL) { PyErr_SetString(PyExc_TypeError, "iter() of non-sequence"); *************** *** 2831,2835 **** slot_tp_init(PyObject *self, PyObject *args, PyObject *kwds) { ! PyObject *meth = PyObject_GetAttrString(self, "__init__"); PyObject *res; --- 2872,2877 ---- slot_tp_init(PyObject *self, PyObject *args, PyObject *kwds) { ! static PyObject *init_str; ! PyObject *meth = lookup_method(self, "__init__", &init_str); PyObject *res; From gvanrossum@users.sourceforge.net Tue Aug 28 18:58:58 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 28 Aug 2001 10:58:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv9057 Modified Files: test_descr.py Log Message: Fix one test to reflect the change in method lookup policy. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** test_descr.py 2001/08/24 17:07:20 1.22 --- test_descr.py 2001/08/28 17:58:55 1.23 *************** *** 442,447 **** x = a.foo del a.foo ! verify(log == [('getattr', '__init__'), ! ('getattr', '__setattr__'), ("setattr", "foo", 12), ("getattr", "foo"), --- 442,446 ---- x = a.foo del a.foo ! verify(log == [('getattr', '__setattr__'), ("setattr", "foo", 12), ("getattr", "foo"), From fdrake@users.sourceforge.net Tue Aug 28 19:09:13 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 28 Aug 2001 11:09:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/doc doc.tex,1.50,1.51 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory usw-pr-cvs1:/tmp/cvs-serv12042/doc Modified Files: doc.tex Log Message: Revise comments about TeX & LaTeX for accuracy. This closes SF bug #456222. Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** doc.tex 2001/08/14 21:36:19 1.50 --- doc.tex 2001/08/28 18:09:11 1.51 *************** *** 1577,1584 **** \item[\program{latex}] ! This is a world-class typesetter by Donald Knuth. It is used ! for the conversion to PostScript, and is needed for the HTML ! conversion as well (\LaTeX2HTML requires one of the ! intermediate files it creates). \item[\program{latex2html}] --- 1577,1585 ---- \item[\program{latex}] ! \LaTeX{} is a large and extensible macro package by Leslie ! Lamport, based on \TeX, a world-class typesetter by Donald ! Knuth. It is used for the conversion to PostScript, and is ! needed for the HTML conversion as well (\LaTeX2HTML requires ! one of the intermediate files it creates). \item[\program{latex2html}] *************** *** 1597,1601 **** but GNU \program{make} is required for the experimental processes in \file{Doc/tools/sgmlconv/}, at least while ! they're experimental. \item[\program{makeindex}] --- 1598,1603 ---- but GNU \program{make} is required for the experimental processes in \file{Doc/tools/sgmlconv/}, at least while ! they're experimental. This is not required for running the ! \rpgram{mkhowto} script. \item[\program{makeindex}] From gvanrossum@users.sourceforge.net Tue Aug 28 19:22:16 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 28 Aug 2001 11:22:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.47,2.48 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv16419 Modified Files: typeobject.c Log Message: Finish the previous checkin: also avoid getattr when calling the method directly. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.47 retrieving revision 2.48 diff -C2 -d -r2.47 -r2.48 *** typeobject.c 2001/08/28 17:47:51 2.47 --- typeobject.c 2001/08/28 18:22:14 2.48 *************** *** 320,323 **** --- 320,372 ---- } + /* A variation of PyObject_CallMethod that uses lookup_method() + instead of PyObject_GetAttrString(). This uses the same convention + as lookup_method to cache the interned name string object. */ + + PyObject * + call_method(PyObject *o, char *name, PyObject **nameobj, char *format, ...) + { + va_list va; + PyObject *args, *func = 0, *retval; + PyObject *dummy_str = NULL; + va_start(va, format); + + func = lookup_method(o, name, &dummy_str); + Py_XDECREF(dummy_str); + if (func == NULL) { + va_end(va); + PyErr_SetString(PyExc_AttributeError, name); + return 0; + } + + if (format && *format) + args = Py_VaBuildValue(format, va); + else + args = PyTuple_New(0); + + va_end(va); + + if (!args) + return NULL; + + if (!PyTuple_Check(args)) { + PyObject *a; + + a = PyTuple_New(1); + if (a == NULL) + return NULL; + if (PyTuple_SetItem(a, 0, args) < 0) + return NULL; + args = a; + } + + retval = PyObject_CallObject(func, args); + + Py_DECREF(args); + Py_DECREF(func); + + return retval; + } + /* Method resolution order algorithm from "Putting Metaclasses to Work" by Forman and Danforth (Addison-Wesley 1999). */ *************** *** 2342,2346 **** FUNCNAME(PyObject *self) \ { \ ! return PyObject_CallMethod(self, OPSTR, ""); \ } --- 2391,2396 ---- FUNCNAME(PyObject *self) \ { \ ! static PyObject cache_str; \ ! return call_method(self, OPSTR, &cache_str, ""); \ } *************** *** 2349,2353 **** FUNCNAME(PyObject *self, ARG1TYPE arg1) \ { \ ! return PyObject_CallMethod(self, OPSTR, ARGCODES, arg1); \ } --- 2399,2404 ---- FUNCNAME(PyObject *self, ARG1TYPE arg1) \ { \ ! static PyObject *cache_str; \ ! return call_method(self, OPSTR, &cache_str, ARGCODES, arg1); \ } *************** *** 2357,2365 **** FUNCNAME(PyObject *self, PyObject *other) \ { \ if (self->ob_type->tp_as_number != NULL && \ self->ob_type->tp_as_number->SLOTNAME == TESTFUNC) { \ PyObject *r; \ ! r = PyObject_CallMethod( \ ! self, OPSTR, "O", other); \ if (r != Py_NotImplemented || \ other->ob_type == self->ob_type) \ --- 2408,2417 ---- FUNCNAME(PyObject *self, PyObject *other) \ { \ + static PyObject *cache_str, *rcache_str; \ if (self->ob_type->tp_as_number != NULL && \ self->ob_type->tp_as_number->SLOTNAME == TESTFUNC) { \ PyObject *r; \ ! r = call_method( \ ! self, OPSTR, &cache_str, "O", other); \ if (r != Py_NotImplemented || \ other->ob_type == self->ob_type) \ *************** *** 2369,2374 **** if (other->ob_type->tp_as_number != NULL && \ other->ob_type->tp_as_number->SLOTNAME == TESTFUNC) { \ ! return PyObject_CallMethod( \ ! other, ROPSTR, "O", self); \ } \ Py_INCREF(Py_NotImplemented); \ --- 2421,2426 ---- if (other->ob_type->tp_as_number != NULL && \ other->ob_type->tp_as_number->SLOTNAME == TESTFUNC) { \ ! return call_method( \ ! other, ROPSTR, &rcache_str, "O", self); \ } \ Py_INCREF(Py_NotImplemented); \ *************** *** 2383,2387 **** FUNCNAME(PyObject *self, ARG1TYPE arg1, ARG2TYPE arg2) \ { \ ! return PyObject_CallMethod(self, OPSTR, ARGCODES, arg1, arg2); \ } --- 2435,2440 ---- FUNCNAME(PyObject *self, ARG1TYPE arg1, ARG2TYPE arg2) \ { \ ! static PyObject *cache_str; \ ! return call_method(self, OPSTR, &cache_str, ARGCODES, arg1, arg2); \ } *************** *** 2389,2393 **** slot_sq_length(PyObject *self) { ! PyObject *res = PyObject_CallMethod(self, "__len__", ""); if (res == NULL) --- 2442,2447 ---- slot_sq_length(PyObject *self) { ! static PyObject *len_str; ! PyObject *res = call_method(self, "__len__", &len_str, ""); if (res == NULL) *************** *** 2405,2414 **** { PyObject *res; if (value == NULL) ! res = PyObject_CallMethod(self, "__delitem__", "i", index); else ! res = PyObject_CallMethod(self, "__setitem__", ! "iO", index, value); if (res == NULL) return -1; --- 2459,2470 ---- { PyObject *res; + static PyObject *delitem_str, *setitem_str; if (value == NULL) ! res = call_method(self, "__delitem__", &delitem_str, ! "i", index); else ! res = call_method(self, "__setitem__", &setitem_str, ! "iO", index, value); if (res == NULL) return -1; *************** *** 2421,2430 **** { PyObject *res; if (value == NULL) ! res = PyObject_CallMethod(self, "__delslice__", "ii", i, j); else ! res = PyObject_CallMethod(self, "__setslice__", ! "iiO", i, j, value); if (res == NULL) return -1; --- 2477,2488 ---- { PyObject *res; + static PyObject *delslice_str, *setslice_str; if (value == NULL) ! res = call_method(self, "__delslice__", &delslice_str, ! "ii", i, j); else ! res = call_method(self, "__setslice__", &setslice_str, ! "iiO", i, j, value); if (res == NULL) return -1; *************** *** 2471,2480 **** { PyObject *res; if (value == NULL) ! res = PyObject_CallMethod(self, "__delitem__", "O", key); else ! res = PyObject_CallMethod(self, "__setitem__", ! "OO", key, value); if (res == NULL) return -1; --- 2529,2540 ---- { PyObject *res; + static PyObject *delitem_str, *setitem_str; if (value == NULL) ! res = call_method(self, "__delitem__", &delitem_str, ! "O", key); else ! res = call_method(self, "__setitem__", &setitem_str, ! "OO", key, value); if (res == NULL) return -1; *************** *** 2498,2505 **** slot_nb_power(PyObject *self, PyObject *other, PyObject *modulus) { if (modulus == Py_None) return slot_nb_power_binary(self, other); /* Three-arg power doesn't use __rpow__ */ ! return PyObject_CallMethod(self, "__pow__", "OO", other, modulus); } --- 2558,2568 ---- slot_nb_power(PyObject *self, PyObject *other, PyObject *modulus) { + static PyObject *pow_str; + if (modulus == Py_None) return slot_nb_power_binary(self, other); /* Three-arg power doesn't use __rpow__ */ ! return call_method(self, "__pow__", &pow_str, ! "OO", other, modulus); } *************** *** 2728,2737 **** { PyObject *res; if (value == NULL) ! res = PyObject_CallMethod(self, "__delattr__", "O", name); else ! res = PyObject_CallMethod(self, "__setattr__", ! "OO", name, value); if (res == NULL) return -1; --- 2791,2802 ---- { PyObject *res; + static PyObject *delattr_str, *setattr_str; if (value == NULL) ! res = call_method(self, "__delattr__", &delattr_str, ! "O", name); else ! res = call_method(self, "__setattr__", &setattr_str, ! "OO", name, value); if (res == NULL) return -1; *************** *** 2823,2827 **** slot_tp_iternext(PyObject *self) { ! return PyObject_CallMethod(self, "next", ""); } --- 2888,2893 ---- slot_tp_iternext(PyObject *self) { ! static PyObject *next_str; ! return call_method(self, "next", &next_str, ""); } *************** *** 2857,2866 **** { PyObject *res; if (value == NULL) ! res = PyObject_CallMethod(self, "__del__", "O", target); else ! res = PyObject_CallMethod(self, "__set__", ! "OO", target, value); if (res == NULL) return -1; --- 2923,2934 ---- { PyObject *res; + static PyObject *del_str, *set_str; if (value == NULL) ! res = call_method(self, "__del__", &del_str, ! "O", target); else ! res = call_method(self, "__set__", &set_str, ! "OO", target, value); if (res == NULL) return -1; From gvanrossum@users.sourceforge.net Tue Aug 28 19:23:26 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 28 Aug 2001 11:23:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv16884 Modified Files: test_descr.py Log Message: Fix the test again due to fewer calls to __getattr__. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** test_descr.py 2001/08/28 17:58:55 1.23 --- test_descr.py 2001/08/28 18:23:24 1.24 *************** *** 442,449 **** x = a.foo del a.foo ! verify(log == [('getattr', '__setattr__'), ! ("setattr", "foo", 12), ("getattr", "foo"), - ('getattr', '__delattr__'), ("delattr", "foo")], log) --- 442,447 ---- x = a.foo del a.foo ! verify(log == [("setattr", "foo", 12), ("getattr", "foo"), ("delattr", "foo")], log) From gvanrossum@users.sourceforge.net Tue Aug 28 19:28:23 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 28 Aug 2001 11:28:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.48,2.49 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv18210 Modified Files: typeobject.c Log Message: Fix a typo in SLOT0 macro for the declaration of cache_str. Dunno why I didn't catch this before. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.48 retrieving revision 2.49 diff -C2 -d -r2.48 -r2.49 *** typeobject.c 2001/08/28 18:22:14 2.48 --- typeobject.c 2001/08/28 18:28:21 2.49 *************** *** 2391,2395 **** FUNCNAME(PyObject *self) \ { \ ! static PyObject cache_str; \ return call_method(self, OPSTR, &cache_str, ""); \ } --- 2391,2395 ---- FUNCNAME(PyObject *self) \ { \ ! static PyObject *cache_str; \ return call_method(self, OPSTR, &cache_str, ""); \ } From tim_one@users.sourceforge.net Tue Aug 28 21:56:29 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 28 Aug 2001 13:56:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.214,1.215 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv25462/python/misc Modified Files: NEWS Log Message: Note change in fp literal syntax (e.g. "3e-" worked by accident before). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.214 retrieving revision 1.215 diff -C2 -d -r1.214 -r1.215 *** NEWS 2001/08/27 06:37:48 1.214 --- NEWS 2001/08/28 20:56:27 1.215 *************** *** 4,7 **** --- 4,10 ---- Core + + An old tokenizer bug allowed floating point literals with an incomplete + exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError. + Library From bwarsaw@users.sourceforge.net Tue Aug 28 22:26:35 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 28 Aug 2001 14:26:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_gettext.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv1978 Modified Files: test_gettext.py Log Message: Update an email address. Index: test_gettext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gettext.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_gettext.py 2001/08/24 19:11:57 1.8 --- test_gettext.py 2001/08/28 21:26:33 1.9 *************** *** 108,112 **** GNU_MO_DATA = '''\ 3hIElQAAAAAFAAAAHAAAAEQAAAAHAAAAbAAAAAAAAACIAAAAFQAAAIkAAAChAAAAnwAAAAcAAABB ! AQAACwAAAEkBAAAbAQAAVQEAABYAAABxAgAAoQAAAIgCAAAFAAAAKgMAAAkAAAAwAwAAAQAAAAQA AAACAAAAAAAAAAUAAAAAAAAAAwAAAABSYXltb25kIEx1eHVyeSBZYWNoLXQAVGhpcyBtb2R1bGUg cHJvdmlkZXMgaW50ZXJuYXRpb25hbGl6YXRpb24gYW5kIGxvY2FsaXphdGlvbgpzdXBwb3J0IGZv --- 108,112 ---- GNU_MO_DATA = '''\ 3hIElQAAAAAFAAAAHAAAAEQAAAAHAAAAbAAAAAAAAACIAAAAFQAAAIkAAAChAAAAnwAAAAcAAABB ! AQAACwAAAEkBAAAZAQAAVQEAABYAAABvAgAAoQAAAIYCAAAFAAAAKAMAAAkAAAAuAwAAAQAAAAQA AAACAAAAAAAAAAUAAAAAAAAAAwAAAABSYXltb25kIEx1eHVyeSBZYWNoLXQAVGhpcyBtb2R1bGUg cHJvdmlkZXMgaW50ZXJuYXRpb25hbGl6YXRpb24gYW5kIGxvY2FsaXphdGlvbgpzdXBwb3J0IGZv *************** *** 114,125 **** TlUKZ2V0dGV4dCBtZXNzYWdlIGNhdGFsb2cgbGlicmFyeS4AbXVsbHVzawBudWRnZSBudWRnZQBQ cm9qZWN0LUlkLVZlcnNpb246IDIuMApQTy1SZXZpc2lvbi1EYXRlOiAyMDAwLTA4LTI5IDEyOjE5 ! LTA0OjAwCkxhc3QtVHJhbnNsYXRvcjogQmFycnkgQS4gV2Fyc2F3IDxid2Fyc2F3QGJlb3Blbi5j ! b20+Ckxhbmd1YWdlLVRlYW06IFhYIDxweXRob24tZGV2QHB5dGhvbi5vcmc+Ck1JTUUtVmVyc2lv ! bjogMS4wCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD1rb2k4X3IKQ29udGVudC1U ! cmFuc2Zlci1FbmNvZGluZzogbm9uZQpHZW5lcmF0ZWQtQnk6IHB5Z2V0dGV4dC5weSAxLjEKAFRo ! cm9hdHdvYmJsZXIgTWFuZ3JvdmUAR3V2ZiB6YnFoeXIgY2ViaXZxcmYgdmFncmVhbmd2YmFueXZt ! bmd2YmEgbmFxIHlicG55dm1uZ3ZiYQpmaGNjYmVnIHNiZSBsYmhlIENsZ3ViYSBjZWJ0ZW56ZiBv ! bCBjZWJpdnF2YXQgbmEgdmFncmVzbnByIGdiIGd1ciBUQUgKdHJnZ3JrZyB6cmZmbnRyIHBuZ255 ! YnQgeXZvZW5lbC4AYmFjb24Ad2luayB3aW5rAA== ''' --- 114,125 ---- TlUKZ2V0dGV4dCBtZXNzYWdlIGNhdGFsb2cgbGlicmFyeS4AbXVsbHVzawBudWRnZSBudWRnZQBQ cm9qZWN0LUlkLVZlcnNpb246IDIuMApQTy1SZXZpc2lvbi1EYXRlOiAyMDAwLTA4LTI5IDEyOjE5 ! LTA0OjAwCkxhc3QtVHJhbnNsYXRvcjogQmFycnkgQS4gV2Fyc2F3IDxiYXJyeUBweXRob24ub3Jn ! PgpMYW5ndWFnZS1UZWFtOiBYWCA8cHl0aG9uLWRldkBweXRob24ub3JnPgpNSU1FLVZlcnNpb246 ! IDEuMApDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9a29pOF9yCkNvbnRlbnQtVHJh ! bnNmZXItRW5jb2Rpbmc6IG5vbmUKR2VuZXJhdGVkLUJ5OiBweWdldHRleHQucHkgMS4xCgBUaHJv ! YXR3b2JibGVyIE1hbmdyb3ZlAEd1dmYgemJxaHlyIGNlYml2cXJmIHZhZ3JlYW5ndmJhbnl2bW5n ! dmJhIG5hcSB5YnBueXZtbmd2YmEKZmhjY2JlZyBzYmUgbGJoZSBDbGd1YmEgY2VidGVuemYgb2wg ! Y2ViaXZxdmF0IG5hIHZhZ3Jlc25wciBnYiBndXIgVEFICnRyZ2dya2cgenJmZm50ciBwbmdueWJ0 ! IHl2b2VuZWwuAGJhY29uAHdpbmsgd2luawA= ''' *************** *** 160,164 **** "Project-Id-Version: 2.0\n" "PO-Revision-Date: 2000-08-29 12:19-04:00\n" ! "Last-Translator: Barry A. Warsaw \n" "Language-Team: XX \n" "MIME-Version: 1.0\n" --- 160,164 ---- "Project-Id-Version: 2.0\n" "PO-Revision-Date: 2000-08-29 12:19-04:00\n" ! "Last-Translator: Barry A. Warsaw \n" "Language-Team: XX \n" "MIME-Version: 1.0\n" From tim_one@users.sourceforge.net Tue Aug 28 23:08:37 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 28 Aug 2001 15:08:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules cPickle.c,2.63,2.64 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv13465/python/modules Modified Files: cPickle.c Log Message: load_int: The fallback to long ints was coded in such a way that it couldn't succeed. Fixed. Index: cPickle.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v retrieving revision 2.63 retrieving revision 2.64 diff -C2 -d -r2.63 -r2.64 *** cPickle.c 2001/08/18 21:22:07 2.63 --- cPickle.c 2001/08/28 22:08:34 2.64 *************** *** 2543,2550 **** /* Hm, maybe we've got something long. Let's try reading it as a Python long object. */ ! errno=0; ! UNLESS (py_int=PyLong_FromString(s,&endptr,0)) goto finally; ! ! if ((*endptr != '\n') || (endptr[1] != '\0')) { PyErr_SetString(PyExc_ValueError, "could not convert string to int"); --- 2543,2549 ---- /* Hm, maybe we've got something long. Let's try reading it as a Python long object. */ ! errno = 0; ! py_int = PyLong_FromString(s, NULL, 0); ! if (py_int == NULL) { PyErr_SetString(PyExc_ValueError, "could not convert string to int"); From tim_one@users.sourceforge.net Tue Aug 28 23:21:20 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 28 Aug 2001 15:21:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib pickle.py,1.50,1.51 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv15915/Lib Modified Files: pickle.py Log Message: pickle.py, load_int(): Match cPickle's just-repaired ability to unpickle 64-bit INTs on 32-bit boxes (where they become longs). Also exploit that int(str) and long(str) will ignore a trailing newline (saves creating a new string at the Python level). pickletester.py: Simulate reading a pickle produced by a 64-bit box. Index: pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** pickle.py 2001/08/17 18:49:52 1.50 --- pickle.py 2001/08/28 22:21:18 1.51 *************** *** 616,620 **** def load_int(self): ! self.append(int(self.readline()[:-1])) dispatch[INT] = load_int --- 616,624 ---- def load_int(self): ! data = self.readline() ! try: ! self.append(int(data)) ! except ValueError: ! self.append(long(data)) dispatch[INT] = load_int From tim_one@users.sourceforge.net Tue Aug 28 23:21:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 28 Aug 2001 15:21:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test pickletester.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv15915/Lib/test Modified Files: pickletester.py Log Message: pickle.py, load_int(): Match cPickle's just-repaired ability to unpickle 64-bit INTs on 32-bit boxes (where they become longs). Also exploit that int(str) and long(str) will ignore a trailing newline (saves creating a new string at the Python level). pickletester.py: Simulate reading a pickle produced by a 64-bit box. Index: pickletester.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/pickletester.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pickletester.py 2001/08/17 18:39:24 1.7 --- pickletester.py 2001/08/28 22:21:18 1.8 *************** *** 222,223 **** --- 222,238 ---- got)) n = n >> 1 + + # Fake a pickle from a sizeof(long)==8 box. + maxint64 = (1L << 63) - 1 + data = 'I' + str(maxint64) + '\n.' + got = pickle.loads(data) + if maxint64 != got: + raise TestFailed("maxint64 test failed %r %r" % (maxint64, got)) + # Try too with a bogus literal. + data = 'I' + str(maxint64) + 'JUNK\n.' + try: + got = pickle.loads(data) + except ValueError: + pass + else: + raise TestFailed("should have raised error on bogus INT literal") From bwarsaw@users.sourceforge.net Wed Aug 29 02:42:00 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 28 Aug 2001 18:42:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ext newtypes.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv20054 Modified Files: newtypes.tex Log Message: On Fred's suggestion, convert sprintf() examples to use PyString_FromFormat(). Also fixed one grammar problem, and a few other mark-up issues. Sample code not checked. Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/newtypes.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** newtypes.tex 2001/08/20 19:30:29 1.1 --- newtypes.tex 2001/08/29 01:41:58 1.2 *************** *** 498,505 **** newdatatype_repr(newdatatypeobject * obj) { ! char buf[4096]; ! sprintf(buf, "Repr-ified_newdatatype{{size:%d}}", obj->obj_UnderlyingDatatypePtr->size); - return PyString_FromString(buf); } \end{verbatim} --- 498,503 ---- newdatatype_repr(newdatatypeobject * obj) { ! return PyString_FromFormat("Repr-ified_newdatatype{{size:\%d}}", obj->obj_UnderlyingDatatypePtr->size); } \end{verbatim} *************** *** 513,517 **** is, it is called when Python code calls \function{str()} on an instance of your object. It's implementation is very similar to the ! \member{tp_repr} function, but the resulting string is intended to be human consumption. It \member{tp_str} is not specified, the \member{tp_repr} handler is used instead. --- 511,515 ---- is, it is called when Python code calls \function{str()} on an instance of your object. It's implementation is very similar to the ! \member{tp_repr} function, but the resulting string is intended for human consumption. It \member{tp_str} is not specified, the \member{tp_repr} handler is used instead. *************** *** 523,533 **** newdatatype_str(newdatatypeobject * obj) { ! PyObject *pyString; ! char buf[4096]; ! sprintf(buf, "Stringified_newdatatype{{size:%d}}", obj->obj_UnderlyingDatatypePtr->size ); - pyString = PyString_FromString(buf); - return pyString; } \end{verbatim} --- 521,527 ---- newdatatype_str(newdatatypeobject * obj) { ! return PyString_FromFormat("Stringified_newdatatype{{size:\%d}}", obj->obj_UnderlyingDatatypePtr->size ); } \end{verbatim} *************** *** 611,617 **** newdatatype_setattr(newdatatypeobject *obj, char *name, PyObject *v) { ! char buf[1024]; ! sprintf(buf, "Set attribute not supported for attribute %s", name); ! PyErr_SetString(PyExc_RuntimeError, buf); return -1; } --- 605,609 ---- newdatatype_setattr(newdatatypeobject *obj, char *name, PyObject *v) { ! (void)PyErr_Format(PyExc_RuntimeError, "Read-only attribute: \%s", name); return -1; } *************** *** 741,754 **** char *arg2; char *arg3; ! char buf[4096]; if (!PyArg_ParseTuple(args, "sss:call", &arg1, &arg2, &arg3)) { return NULL; } ! sprintf(buf, ! "Returning -- value: [%d] arg1: [%s] arg2: [%s] arg3: [%s]\n", ! obj->obj_UnderlyingDatatypePtr->size, ! arg1, arg2, arg3); ! printf(buf); ! return PyString_FromString(buf); } \end{verbatim} --- 733,746 ---- char *arg2; char *arg3; ! if (!PyArg_ParseTuple(args, "sss:call", &arg1, &arg2, &arg3)) { return NULL; } ! result = PyString_FromFormat( ! "Returning -- value: [\%d] arg1: [\%s] arg2: [\%s] arg3: [\%s]\n", ! obj->obj_UnderlyingDatatypePtr->size, ! arg1, arg2, arg3); ! printf("\%s", PyString_AS_STRING(result)); ! return result; } \end{verbatim} From tim_one@users.sourceforge.net Wed Aug 29 03:28:43 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 28 Aug 2001 19:28:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_marshal.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv27201/Lib/test Added Files: test_marshal.py Log Message: marshal.c r_long64: When reading a TYPE_INT64 value on a box with 32-bit ints, convert to PyLong (rather than throwing away the high-order 32 bits). --- NEW FILE: test_marshal.py --- from test_support import TestFailed import marshal import sys # XXX Much more needed here. # Test the full range of Python ints. n = sys.maxint while n: for expected in (-n, n): s = marshal.dumps(expected) got = marshal.loads(s) if expected != got: raise TestFailed("for int %d, marshal string is %r, loaded " "back as %d" % (expected, s, got)) n = n >> 1 # Simulate int marshaling on a 64-bit box. This is most interesting if # we're running the test on a 32-bit box, of course. def to_little_endian_string(value, nbytes): bytes = [] for i in range(nbytes): bytes.append(chr(value & 0xff)) value >>= 8 return ''.join(bytes) maxint64 = (1L << 63) - 1 minint64 = -maxint64-1 for base in maxint64, minint64, -maxint64, -(minint64 >> 1): while base: s = 'I' + to_little_endian_string(base, 8) got = marshal.loads(s) if base != got: raise TestFailed("for int %d, simulated marshal string is %r, " "loaded back as %d" % (base, s, got)) if base == -1: # a fixed-point for shifting right 1 base = 0 else: base >>= 1 From tim_one@users.sourceforge.net Wed Aug 29 03:28:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 28 Aug 2001 19:28:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python marshal.c,1.65,1.66 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv27201/Python Modified Files: marshal.c Log Message: marshal.c r_long64: When reading a TYPE_INT64 value on a box with 32-bit ints, convert to PyLong (rather than throwing away the high-order 32 bits). Index: marshal.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/marshal.c,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** marshal.c 2001/08/17 18:39:25 1.65 --- marshal.c 2001/08/29 02:28:41 1.66 *************** *** 343,363 **** } ! static long r_long64(RFILE *p) { ! register long x; ! x = r_long(p); #if SIZEOF_LONG > 4 ! x = (x & 0xFFFFFFFFL) | (r_long(p) << 32); #else ! if (r_long(p) != 0) { ! PyObject *f = PySys_GetObject("stderr"); ! if (f != NULL) ! (void) PyFile_WriteString( ! "Warning: un-marshal 64-bit int in 32-bit mode\n", ! f); } #endif - return x; } --- 343,375 ---- } ! /* r_long64 deals with the TYPE_INT64 code. On a machine with ! sizeof(long) > 4, it returns a Python int object, else a Python long ! object. Note that w_long64 writes out TYPE_INT if 32 bits is enough, ! so there's no inefficiency here in returning a PyLong on 32-bit boxes ! for everything written via TYPE_INT64 (i.e., if an int is written via ! TYPE_INT64, it *needs* more than 32 bits). ! */ ! static PyObject * r_long64(RFILE *p) { ! long lo4 = r_long(p); ! long hi4 = r_long(p); #if SIZEOF_LONG > 4 ! long x = (hi4 << 32) | (lo4 & 0xFFFFFFFFL); ! return PyInt_FromLong(x); #else ! unsigned char buf[8]; ! int one = 1; ! int is_little_endian = (int)*(char*)&one; ! if (is_little_endian) { ! memcpy(buf, &lo4, 4); ! memcpy(buf+4, &hi4, 4); ! } ! else { ! memcpy(buf, &hi4, 4); ! memcpy(buf+4, &lo4, 4); } + return _PyLong_FromByteArray(buf, 8, is_little_endian, 1); #endif } *************** *** 395,399 **** case TYPE_INT64: ! return PyInt_FromLong(r_long64(p)); case TYPE_LONG: --- 407,411 ---- case TYPE_INT64: ! return r_long64(p); case TYPE_LONG: From tim_one@users.sourceforge.net Wed Aug 29 03:28:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 28 Aug 2001 19:28:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.215,1.216 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv27201/Misc Modified Files: NEWS Log Message: marshal.c r_long64: When reading a TYPE_INT64 value on a box with 32-bit ints, convert to PyLong (rather than throwing away the high-order 32 bits). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.215 retrieving revision 1.216 diff -C2 -d -r1.215 -r1.216 *** NEWS 2001/08/28 20:56:27 1.215 --- NEWS 2001/08/29 02:28:42 1.216 *************** *** 9,12 **** --- 9,17 ---- Library + + pickle, cPickle and marshal on 32-bit platforms can now correctly read + dumps containing ints written on platforms where Python ints are 8 bytes. + When read on a box where Python ints are 4 bytes, such values are + converted to Python longs. + Tools From fdrake@users.sourceforge.net Wed Aug 29 03:34:12 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 28 Aug 2001 19:34:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/doc doc.tex,1.51,1.52 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory usw-pr-cvs1:/tmp/cvs-serv29185 Modified Files: doc.tex Log Message: Fix a minor markup typo. Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** doc.tex 2001/08/28 18:09:11 1.51 --- doc.tex 2001/08/29 02:34:10 1.52 *************** *** 1599,1603 **** processes in \file{Doc/tools/sgmlconv/}, at least while they're experimental. This is not required for running the ! \rpgram{mkhowto} script. \item[\program{makeindex}] --- 1599,1603 ---- processes in \file{Doc/tools/sgmlconv/}, at least while they're experimental. This is not required for running the ! \program{mkhowto} script. \item[\program{makeindex}] From jackjansen@users.sourceforge.net Wed Aug 29 16:24:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 29 Aug 2001 08:24:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python thread_pthread.h,2.30,2.31 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv21036/python/Python Modified Files: thread_pthread.h Log Message: GUSI on the Mac creates threads with a default stack size of 20KB, which is not enough for Python. Increased the stacksize to a (somewhat arbitrary) 64KB. Index: thread_pthread.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_pthread.h,v retrieving revision 2.30 retrieving revision 2.31 diff -C2 -d -r2.30 -r2.31 *** thread_pthread.h 2000/09/01 23:29:28 2.30 --- thread_pthread.h 2001/08/29 15:24:53 2.31 *************** *** 49,53 **** --- 49,60 ---- #endif + #ifdef USE_GUSI + /* The Macintosh GUSI I/O library sets the stackspace to + ** 20KB, much too low. We up it to 64K. + */ + #define THREAD_STACK_SIZE 0x10000 + #endif + /* set default attribute object for different versions */ *************** *** 129,136 **** --- 136,150 ---- pthread_t th; int success; + #ifdef THREAD_STACK_SIZE + pthread_attr_t attrs; + #endif dprintf(("PyThread_start_new_thread called\n")); if (!initialized) PyThread_init_thread(); + #ifdef THREAD_STACK_SIZE + pthread_attr_init(&attrs); + pthread_attr_setstacksize(&attrs, THREAD_STACK_SIZE); + #endif success = pthread_create(&th, #if defined(PY_PTHREAD_D4) *************** *** 147,156 **** arg #elif defined(PY_PTHREAD_STD) (pthread_attr_t*)NULL, (void* (*)(void *))func, (void *)arg #endif ); ! if (success == 0) { #if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D6) || defined(PY_PTHREAD_D7) --- 161,176 ---- arg #elif defined(PY_PTHREAD_STD) + #ifdef THREAD_STACK_SIZE + &attrs, + #else (pthread_attr_t*)NULL, + #endif (void* (*)(void *))func, (void *)arg #endif ); ! #ifdef THREAD_STACK_SIZE ! pthread_attr_destroy(&attrs); ! #endif if (success == 0) { #if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D6) || defined(PY_PTHREAD_D7) From gvanrossum@users.sourceforge.net Wed Aug 29 16:45:34 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 08:45:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include complexobject.h,2.7,2.8 floatobject.h,2.18,2.19 intobject.h,2.22,2.23 longobject.h,2.21,2.22 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv31299/Include Modified Files: complexobject.h floatobject.h intobject.h longobject.h Log Message: Make the PyXXX_Check() macros for the numeric types inheritance-aware. Index: complexobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/complexobject.h,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** complexobject.h 2000/07/09 00:20:36 2.7 --- complexobject.h 2001/08/29 15:45:32 2.8 *************** *** 43,47 **** extern DL_IMPORT(PyTypeObject) PyComplex_Type; ! #define PyComplex_Check(op) ((op)->ob_type == &PyComplex_Type) extern DL_IMPORT(PyObject *) PyComplex_FromCComplex(Py_complex); --- 43,47 ---- extern DL_IMPORT(PyTypeObject) PyComplex_Type; ! #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type) extern DL_IMPORT(PyObject *) PyComplex_FromCComplex(Py_complex); Index: floatobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/floatobject.h,v retrieving revision 2.18 retrieving revision 2.19 diff -C2 -d -r2.18 -r2.19 *** floatobject.h 2001/05/08 15:19:57 2.18 --- floatobject.h 2001/08/29 15:45:32 2.19 *************** *** 19,23 **** extern DL_IMPORT(PyTypeObject) PyFloat_Type; ! #define PyFloat_Check(op) ((op)->ob_type == &PyFloat_Type) /* Return Python float from string PyObject. Second argument ignored on --- 19,23 ---- extern DL_IMPORT(PyTypeObject) PyFloat_Type; ! #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type) /* Return Python float from string PyObject. Second argument ignored on Index: intobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/intobject.h,v retrieving revision 2.22 retrieving revision 2.23 diff -C2 -d -r2.22 -r2.23 *** intobject.h 2001/08/17 18:39:24 2.22 --- intobject.h 2001/08/29 15:45:32 2.23 *************** *** 28,32 **** extern DL_IMPORT(PyTypeObject) PyInt_Type; ! #define PyInt_Check(op) ((op)->ob_type == &PyInt_Type) extern DL_IMPORT(PyObject *) PyInt_FromString(char*, char**, int); --- 28,32 ---- extern DL_IMPORT(PyTypeObject) PyInt_Type; ! #define PyInt_Check(op) PyObject_TypeCheck(op, &PyInt_Type) extern DL_IMPORT(PyObject *) PyInt_FromString(char*, char**, int); Index: longobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/longobject.h,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** longobject.h 2001/08/17 18:39:24 2.21 --- longobject.h 2001/08/29 15:45:32 2.22 *************** *** 12,16 **** extern DL_IMPORT(PyTypeObject) PyLong_Type; ! #define PyLong_Check(op) ((op)->ob_type == &PyLong_Type) extern DL_IMPORT(PyObject *) PyLong_FromLong(long); --- 12,16 ---- extern DL_IMPORT(PyTypeObject) PyLong_Type; ! #define PyLong_Check(op) PyObject_TypeCheck(op, &PyLong_Type) extern DL_IMPORT(PyObject *) PyLong_FromLong(long); From gvanrossum@users.sourceforge.net Wed Aug 29 16:47:08 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 08:47:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.49,2.50 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv32144 Modified Files: typeobject.c Log Message: Fix super() so that it is usable for static methods (like __new__) as well. In particular, the second argument can now be a subclass of the first as well (normally it must be an instance though). Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.49 retrieving revision 2.50 diff -C2 -d -r2.49 -r2.50 *** typeobject.c 2001/08/28 18:28:21 2.49 --- typeobject.c 2001/08/29 15:47:06 2.50 *************** *** 3113,3117 **** typedef struct { PyObject_HEAD ! PyObject *type; PyObject *obj; } superobject; --- 3113,3117 ---- typedef struct { PyObject_HEAD ! PyTypeObject *type; PyObject *obj; } superobject; *************** *** 3137,3148 **** int i, n; ! mro = ((PyTypeObject *)(su->obj->ob_type))->tp_mro; assert(mro != NULL && PyTuple_Check(mro)); n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { ! if (su->type == PyTuple_GET_ITEM(mro, i)) break; } ! assert(i < n); i++; res = NULL; --- 3137,3162 ---- int i, n; ! mro = su->obj->ob_type->tp_mro; assert(mro != NULL && PyTuple_Check(mro)); n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { ! if ((PyObject *)(su->type) == PyTuple_GET_ITEM(mro, i)) break; } ! if (i >= n && PyType_Check(su->obj)) { ! mro = ((PyTypeObject *)(su->obj))->tp_mro; ! assert(mro != NULL && PyTuple_Check(mro)); ! n = PyTuple_GET_SIZE(mro); ! for (i = 0; i < n; i++) { ! if ((PyObject *)(su->type) == ! PyTuple_GET_ITEM(mro, i)) ! break; ! } ! if (i >= n) { ! PyErr_SetString(PyExc_TypeError, ! "bogus super object"); ! return NULL; ! } ! } i++; res = NULL; *************** *** 3192,3196 **** { superobject *su = (superobject *)self; ! PyObject *type, *obj = NULL; if (!PyArg_ParseTuple(args, "O!|O:super", &PyType_Type, &type, &obj)) --- 3206,3211 ---- { superobject *su = (superobject *)self; ! PyTypeObject *type; ! PyObject *obj = NULL; if (!PyArg_ParseTuple(args, "O!|O:super", &PyType_Type, &type, &obj)) *************** *** 3198,3205 **** if (obj == Py_None) obj = NULL; ! if (obj != NULL && !PyType_IsSubtype(obj->ob_type, ! (PyTypeObject *)type)) { PyErr_SetString(PyExc_TypeError, ! "super(type, obj) requires isinstance(obj, type)"); return -1; } --- 3213,3223 ---- if (obj == Py_None) obj = NULL; ! if (obj != NULL && ! !PyType_IsSubtype(obj->ob_type, type) && ! !(PyType_Check(obj) && ! PyType_IsSubtype((PyTypeObject *)obj, type))) { PyErr_SetString(PyExc_TypeError, ! "super(type, obj): " ! "obj must be an instance or subtype of type"); return -1; } *************** *** 3214,3217 **** --- 3232,3236 ---- "super(type) -> unbound super object\n" "super(type, obj) -> bound super object; requires isinstance(obj, type)\n" + "super(type, type2) -> bound super object; requires issubclass(type2, type)\n" "Typical use to call a cooperative superclass method:\n" "class C(B):\n" From gvanrossum@users.sourceforge.net Wed Aug 29 16:47:49 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 08:47:49 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.87,2.88 intobject.c,2.65,2.66 longobject.c,1.92,1.93 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv32398 Modified Files: floatobject.c intobject.c longobject.c Log Message: Make int, long and float subclassable. This uses a slightly wimpy and wasteful approach, but it works. :-) Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.87 retrieving revision 2.88 diff -C2 -d -r2.87 -r2.88 *** floatobject.c 2001/08/23 22:31:37 2.87 --- floatobject.c 2001/08/29 15:47:46 2.88 *************** *** 627,630 **** --- 627,633 ---- + staticforward PyObject * + float_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds); + static PyObject * float_new(PyTypeObject *type, PyObject *args, PyObject *kwds) *************** *** 633,637 **** static char *kwlist[] = {"x", 0}; ! assert(type == &PyFloat_Type); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:float", kwlist, &x)) return NULL; --- 636,641 ---- static char *kwlist[] = {"x", 0}; ! if (type != &PyFloat_Type) ! return float_subtype_new(type, args, kwds); /* Wimp out */ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:float", kwlist, &x)) return NULL; *************** *** 641,644 **** --- 645,671 ---- } + /* Wimpy, slow approach to tp_new calls for subtypes of float: + first create a regular float from whatever arguments we got, + then allocate a subtype instance and initialize its ob_fval + from the regular float. The regular float is then thrown away. + */ + static PyObject * + float_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *tmp, *new; + + assert(PyType_IsSubtype(type, &PyFloat_Type)); + tmp = float_new(&PyFloat_Type, args, kwds); + if (tmp == NULL) + return NULL; + assert(PyFloat_Check(tmp)); + new = type->tp_alloc(type, 0);; + if (new == NULL) + return NULL; + ((PyFloatObject *)new)->ob_fval = ((PyFloatObject *)tmp)->ob_fval; + Py_DECREF(tmp); + return new; + } + static char float_doc[] = "float(x) -> floating point number\n\ *************** *** 709,713 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /* tp_flags */ float_doc, /* tp_doc */ 0, /* tp_traverse */ --- 736,741 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES | ! Py_TPFLAGS_BASETYPE, /* tp_flags */ float_doc, /* tp_doc */ 0, /* tp_traverse */ *************** *** 751,755 **** i < N_FLOATOBJECTS; i++, p++) { ! if (PyFloat_Check(p) && p->ob_refcnt != 0) frem++; } --- 779,783 ---- i < N_FLOATOBJECTS; i++, p++) { ! if (p->ob_type == &PyFloat_Type && p->ob_refcnt != 0) frem++; } *************** *** 761,765 **** i < N_FLOATOBJECTS; i++, p++) { ! if (!PyFloat_Check(p) || p->ob_refcnt == 0) { p->ob_type = (struct _typeobject *) free_list; --- 789,794 ---- i < N_FLOATOBJECTS; i++, p++) { ! if (p->ob_type != &PyFloat_Type || ! p->ob_refcnt == 0) { p->ob_type = (struct _typeobject *) free_list; *************** *** 793,797 **** i < N_FLOATOBJECTS; i++, p++) { ! if (PyFloat_Check(p) && p->ob_refcnt != 0) { char buf[100]; PyFloat_AsString(buf, p); --- 822,827 ---- i < N_FLOATOBJECTS; i++, p++) { ! if (p->ob_type == &PyFloat_Type && ! p->ob_refcnt != 0) { char buf[100]; PyFloat_AsString(buf, p); Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.65 retrieving revision 2.66 diff -C2 -d -r2.65 -r2.66 *** intobject.c 2001/08/23 21:32:40 2.65 --- intobject.c 2001/08/29 15:47:46 2.66 *************** *** 135,140 **** int_dealloc(PyIntObject *v) { ! v->ob_type = (struct _typeobject *)free_list; ! free_list = v; } --- 135,144 ---- int_dealloc(PyIntObject *v) { ! if (v->ob_type == &PyInt_Type) { ! v->ob_type = (struct _typeobject *)free_list; ! free_list = v; ! } ! else ! v->ob_type->tp_free((PyObject *)v); } *************** *** 784,787 **** --- 788,794 ---- } + staticforward PyObject * + int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds); + static PyObject * int_new(PyTypeObject *type, PyObject *args, PyObject *kwds) *************** *** 791,795 **** static char *kwlist[] = {"x", "base", 0}; ! assert(type == &PyInt_Type); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:int", kwlist, &x, &base)) --- 798,803 ---- static char *kwlist[] = {"x", "base", 0}; ! if (type != &PyInt_Type) ! return int_subtype_new(type, args, kwds); /* Wimp out */ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:int", kwlist, &x, &base)) *************** *** 812,815 **** --- 820,846 ---- } + /* Wimpy, slow approach to tp_new calls for subtypes of int: + first create a regular int from whatever arguments we got, + then allocate a subtype instance and initialize its ob_ival + from the regular int. The regular int is then thrown away. + */ + static PyObject * + int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *tmp, *new; + + assert(PyType_IsSubtype(type, &PyInt_Type)); + tmp = int_new(&PyInt_Type, args, kwds); + if (tmp == NULL) + return NULL; + assert(PyInt_Check(tmp)); + new = type->tp_alloc(type, 0);; + if (new == NULL) + return NULL; + ((PyIntObject *)new)->ob_ival = ((PyIntObject *)tmp)->ob_ival; + Py_DECREF(tmp); + return new; + } + static char int_doc[] = "int(x[, base]) -> integer\n\ *************** *** 883,887 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /* tp_flags */ int_doc, /* tp_doc */ 0, /* tp_traverse */ --- 914,919 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES | ! Py_TPFLAGS_BASETYPE, /* tp_flags */ int_doc, /* tp_doc */ 0, /* tp_traverse */ *************** *** 935,939 **** i < N_INTOBJECTS; i++, p++) { ! if (PyInt_Check(p) && p->ob_refcnt != 0) irem++; } --- 967,971 ---- i < N_INTOBJECTS; i++, p++) { ! if (p->ob_type == &PyInt_Type && p->ob_refcnt != 0) irem++; } *************** *** 945,949 **** i < N_INTOBJECTS; i++, p++) { ! if (!PyInt_Check(p) || p->ob_refcnt == 0) { p->ob_type = (struct _typeobject *) free_list; --- 977,982 ---- i < N_INTOBJECTS; i++, p++) { ! if (p->ob_type != &PyInt_Type || ! p->ob_refcnt == 0) { p->ob_type = (struct _typeobject *) free_list; *************** *** 987,991 **** i < N_INTOBJECTS; i++, p++) { ! if (PyInt_Check(p) && p->ob_refcnt != 0) fprintf(stderr, "# \n", --- 1020,1024 ---- i < N_INTOBJECTS; i++, p++) { ! if (p->ob_type == &PyInt_Type && p->ob_refcnt != 0) fprintf(stderr, "# \n", Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** longobject.c 2001/08/17 18:39:25 1.92 --- longobject.c 2001/08/29 15:47:46 1.93 *************** *** 2039,2042 **** --- 2039,2044 ---- return long_format(v, 16, 1); } + staticforward PyObject * + long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds); static PyObject * *************** *** 2047,2051 **** static char *kwlist[] = {"x", "base", 0}; ! assert(type == &PyLong_Type); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:long", kwlist, &x, &base)) --- 2049,2054 ---- static char *kwlist[] = {"x", "base", 0}; ! if (type != &PyLong_Type) ! return long_subtype_new(type, args, kwds); /* Wimp out */ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:long", kwlist, &x, &base)) *************** *** 2070,2073 **** --- 2073,2106 ---- } + /* Wimpy, slow approach to tp_new calls for subtypes of long: + first create a regular long from whatever arguments we got, + then allocate a subtype instance and initialize it from + the regular long. The regular long is then thrown away. + */ + static PyObject * + long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyLongObject *tmp, *new; + int i, n; + + assert(PyType_IsSubtype(type, &PyLong_Type)); + tmp = (PyLongObject *)long_new(&PyLong_Type, args, kwds); + if (tmp == NULL) + return NULL; + assert(PyLong_Check(tmp)); + n = tmp->ob_size; + if (n < 0) + n = -n; + new = (PyLongObject *)type->tp_alloc(type, n); + if (new == NULL) + return NULL; + assert(PyLong_Check(new)); + new->ob_size = type->ob_size; + for (i = 0; i < n; i++) + new->ob_digit[i] = tmp->ob_digit[i]; + Py_DECREF(tmp); + return (PyObject *)new; + } + static char long_doc[] = "long(x[, base]) -> integer\n\ *************** *** 2141,2145 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /* tp_flags */ long_doc, /* tp_doc */ 0, /* tp_traverse */ --- 2174,2179 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES | ! Py_TPFLAGS_BASETYPE, /* tp_flags */ long_doc, /* tp_doc */ 0, /* tp_traverse */ From gvanrossum@users.sourceforge.net Wed Aug 29 16:48:45 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 08:48:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv433 Modified Files: test_descr.py Log Message: Now that int is subclassable, have to change a test that tests for non-subclassability. (More tests for number subclassing should follow.) Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** test_descr.py 2001/08/28 18:23:24 1.24 --- test_descr.py 2001/08/29 15:48:43 1.25 *************** *** 685,694 **** try: ! class C(int): pass except TypeError: pass else: ! verify(0, "inheritance from int should be illegal") try: --- 685,694 ---- try: ! class C(type(len)): pass except TypeError: pass else: ! verify(0, "inheritance from CFunction should be illegal") try: From jhylton@users.sourceforge.net Wed Aug 29 18:19:04 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 10:19:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler transformer.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv14429 Modified Files: transformer.py Log Message: Don't include doc string of class in its code child Index: transformer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/transformer.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** transformer.py 2001/08/27 21:02:51 1.23 --- transformer.py 2001/08/29 17:19:02 1.24 *************** *** 223,226 **** --- 223,231 ---- code = self.com_node(nodelist[-1]) + if doc is not None: + assert isinstance(code, Stmt) + assert isinstance(code.nodes[0], Discard) + del code.nodes[0] + n = Class(name, bases, doc, code) n.lineno = nodelist[1][2] From jhylton@users.sourceforge.net Wed Aug 29 18:50:24 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 10:50:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_augassign.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv3767 Modified Files: test_augassign.py Log Message: Add tests for augmented floor division Index: test_augassign.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_augassign.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_augassign.py 2000/10/23 17:22:07 1.2 --- test_augassign.py 2001/08/29 17:50:22 1.3 *************** *** 7,10 **** --- 7,11 ---- x -= 8 x /= 2 + x //= 1 x %= 12 x &= 2 *************** *** 20,23 **** --- 21,25 ---- x[0] -= 8 x[0] /= 2 + x[0] //= 2 x[0] %= 12 x[0] &= 2 *************** *** 33,36 **** --- 35,39 ---- x[0] -= 8 x[0] /= 2 + x[0] //= 1 x[0] %= 12 x[0] &= 2 *************** *** 129,132 **** --- 132,152 ---- return self + def __floordiv__(self, val): + print "__floordiv__ called" + return self + def __ifloordiv__(self, val): + print "__ifloordiv__ called" + return self + def __rfloordiv__(self, val): + print "__rfloordiv__ called" + return self + + def __truediv__(self, val): + print "__truediv__ called" + return self + def __itruediv__(self, val): + print "__itruediv__ called" + return self + def __mod__(self, val): print "__mod__ called" *************** *** 201,204 **** --- 221,228 ---- 1 / x x /= 1 + + x // 1 + 1 // x + x //= 1 x % 1 From jhylton@users.sourceforge.net Wed Aug 29 18:50:29 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 10:50:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_augassign,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv3816 Modified Files: test_augassign Log Message: Add tests for augmented floor division Index: test_augassign =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_augassign,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_augassign 2000/08/24 20:14:10 1.1 --- test_augassign 2001/08/29 17:50:27 1.2 *************** *** 26,29 **** --- 26,32 ---- __rdiv__ called __idiv__ called + __floordiv__ called + __rfloordiv__ called + __ifloordiv__ called __mod__ called __rmod__ called From jhylton@users.sourceforge.net Wed Aug 29 19:02:23 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 11:02:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib dis.py,1.36,1.37 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10418 Modified Files: dis.py Log Message: Add opcodes for floor division and true division (PEP 238) Index: dis.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dis.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** dis.py 2001/08/28 15:32:48 1.36 --- dis.py 2001/08/29 18:02:21 1.37 *************** *** 176,179 **** --- 176,183 ---- def_op('BINARY_SUBTRACT', 24) def_op('BINARY_SUBSCR', 25) + def_op('BINARY_FLOOR_DIVIDE', 26) + def_op('BINARY_TRUE_DIVIDE', 27) + def_op('INPLACE_FLOOR_DIVIDE', 28) + def_op('INPLACE_TRUE_DIVIDE', 29) def_op('SLICE+0', 30) From jhylton@users.sourceforge.net Wed Aug 29 19:08:04 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 11:08:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler ast.py,1.15,1.16 ast.txt,1.2,1.3 astgen.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv13493 Modified Files: ast.py ast.txt astgen.py Log Message: Revise implementations of getChildren() and getChildNodes(). Add support for floor division (// and //=) The implementation of getChildren() and getChildNodes() is intended to be faster, because it avoids calling flatten() on every return value. But it's not clear that it is a lot faster, because constructing a tuple with just the right values ends up being slow. (Too many attribute lookups probably.) The ast.txt file is much more complicated, with funny characters at the ends of names (*, &, !) to indicate the types of each child node. The astgen script is also much more complex, making me wonder if it's still useful. Index: ast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/ast.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ast.py 2001/08/18 00:14:37 1.15 --- ast.py 2001/08/29 18:08:02 1.16 *************** *** 17,20 **** --- 17,23 ---- return l + def flatten_nodes(list): + return [n for n in flatten(list) if isinstance(n, Node)] + def asList(nodes): l = [] *************** *** 32,50 **** [...1481 lines suppressed...] self.lower = lower self.upper = upper ! ! def getChildren(self): ! children = [] ! children.append(self.expr) ! children.append(self.flags) ! children.append(self.lower) ! children.append(self.upper) ! return tuple(children) ! ! def getChildNodes(self): ! nodes = [] ! nodes.append(self.expr) ! if self.lower is not None: nodes.append(self.lower) ! if self.upper is not None: nodes.append(self.upper) ! return tuple(nodes) ! def __repr__(self): return "Slice(%s, %s, %s, %s)" % (repr(self.expr), repr(self.flags), repr(self.lower), repr(self.upper)) Index: ast.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/ast.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ast.txt 2001/08/14 18:57:43 1.2 --- ast.txt 2001/08/29 18:08:02 1.3 *************** *** 1,55 **** ! Module: doc, node ! Stmt: nodes ! Function: name, argnames, defaults, flags, doc, code ! Lambda: argnames, defaults, flags, code ! Class: name, bases, doc, code Pass: Break: Continue: ! For: assign, list, body, else_ ! While: test, body, else_ ! If: tests, else_ ! Exec: expr, locals, globals ! From: modname, names ! Import: names ! Raise: expr1, expr2, expr3 TryFinally: body, final ! TryExcept: body, handlers, else_ Return: value Yield: value ! Const: value ! Print: nodes, dest ! Printnl: nodes, dest Discard: expr ! AugAssign: node, op, expr ! Assign: nodes, expr ! AssTuple: nodes ! AssList: nodes ! AssName: name, flags ! AssAttr: expr, attrname, flags ! ListComp: expr, quals ! ListCompFor: assign, list, ifs ListCompIf: test ! List: nodes ! Dict: items Not: expr ! Compare: expr, ops ! Name: name Global: names Backquote: expr ! Getattr: expr, attrname ! CallFunc: node, args, star_args = None, dstar_args = None ! Keyword: name, expr ! Subscript: expr, flags, subs Ellipsis: ! Sliceobj: nodes ! Slice: expr, flags, lower, upper ! Assert: test, fail ! Tuple: nodes ! Or: nodes ! And: nodes ! Bitor: nodes ! Bitxor: nodes ! Bitand: nodes LeftShift: (left, right) RightShift: (left, right) --- 1,63 ---- ! # This file describes the nodes of the AST in ast.py. The module is ! # generated by astgen.py. ! # The descriptions use the following special notation to describe ! # properties of the children: ! # * this child is not a node ! # ! this child is a sequence that contains nodes in it ! # & this child may be set to None ! # = ... a default value for the node constructor (optional args) ! Module: doc*, node ! Stmt: nodes! ! Function: name*, argnames*, defaults!, flags*, doc*, code ! Lambda: argnames*, defaults!, flags*, code ! Class: name*, bases!, doc*, code Pass: Break: Continue: ! For: assign, list, body, else_& ! While: test, body, else_& ! If: tests!, else_& ! Exec: expr, locals&, globals& ! From: modname*, names* ! Import: names* ! Raise: expr1&, expr2&, expr3& TryFinally: body, final ! TryExcept: body, handlers!, else_& Return: value Yield: value ! Const: value* ! Print: nodes!, dest& ! Printnl: nodes!, dest& Discard: expr ! AugAssign: node, op*, expr ! Assign: nodes!, expr ! AssTuple: nodes! ! AssList: nodes! ! AssName: name*, flags* ! AssAttr: expr, attrname*, flags* ! ListComp: expr, quals! ! ListCompFor: assign, list, ifs! ListCompIf: test ! List: nodes! ! Dict: items! Not: expr ! Compare: expr, ops! ! Name: name* Global: names Backquote: expr ! Getattr: expr, attrname* ! CallFunc: node, args!, star_args& = None, dstar_args& = None ! Keyword: name*, expr ! Subscript: expr, flags*, subs! Ellipsis: ! Sliceobj: nodes! ! Slice: expr, flags*, lower&, upper& ! Assert: test, fail& ! Tuple: nodes! ! Or: nodes! ! And: nodes! ! Bitor: nodes! ! Bitxor: nodes! ! Bitand: nodes! LeftShift: (left, right) RightShift: (left, right) *************** *** 60,63 **** --- 68,72 ---- Mod: (left, right) Power: (left, right) + FloorDiv: (left, right) UnaryAdd: expr UnarySub: expr Index: astgen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/astgen.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** astgen.py 2001/08/18 00:14:37 1.4 --- astgen.py 2001/08/29 18:08:02 1.5 *************** *** 1,3 **** ! """Generate ast module from specification""" import fileinput --- 1,10 ---- ! """Generate ast module from specification ! ! This script generates the ast module from a simple specification, ! which makes it easy to accomodate changes in the grammar. This ! approach would be quite reasonable if the grammar changed often. ! Instead, it is rather complex to generate the appropriate code. And ! the Node interface has changed more often than the grammar. ! """ import fileinput *************** *** 25,29 **** if i == -1: return arg ! return arg[:i].strip() class NodeInfo: --- 32,42 ---- if i == -1: return arg ! t = arg[:i].strip() ! return t ! ! P_NODE = 1 ! P_OTHER = 2 ! P_NESTED = 3 ! P_NONE = 4 class NodeInfo: *************** *** 33,39 **** self.args = args.strip() self.argnames = self.get_argnames() self.nargs = len(self.argnames) - self.children = COMMA.join(["self.%s" % c - for c in self.argnames]) self.init = [] --- 46,51 ---- self.args = args.strip() self.argnames = self.get_argnames() + self.argprops = self.get_argprops() self.nargs = len(self.argnames) self.init = [] *************** *** 48,51 **** --- 60,95 ---- for arg in args.split(',') if arg] + def get_argprops(self): + """Each argument can have a property like '*' or '!' + + XXX This method modifies the argnames in place! + """ + d = {} + hardest_arg = P_NODE + for i in range(len(self.argnames)): + arg = self.argnames[i] + if arg.endswith('*'): + arg = self.argnames[i] = arg[:-1] + d[arg] = P_OTHER + hardest_arg = P_OTHER + elif arg.endswith('!'): + arg = self.argnames[i] = arg[:-1] + d[arg] = P_NESTED + hardest_arg = P_NESTED + elif arg.endswith('&'): + arg = self.argnames[i] = arg[:-1] + d[arg] = P_NONE + hardest_arg = P_NONE + else: + d[arg] = P_NODE + self.hardest_arg = hardest_arg + + if hardest_arg > P_NODE: + self.args = self.args.replace('*', '') + self.args = self.args.replace('!', '') + self.args = self.args.replace('&', '') + + return d + def gen_source(self): buf = StringIO() *************** *** 53,57 **** --- 97,105 ---- print >> buf, ' nodes["%s"] = "%s"' % (self.name.lower(), self.name) self._gen_init(buf) + print >> buf self._gen_getChildren(buf) + print >> buf + self._gen_getChildNodes(buf) + print >> buf self._gen_repr(buf) buf.seek(0, 0) *************** *** 69,80 **** def _gen_getChildren(self, buf): ! print >> buf, " def _getChildren(self):" ! if self.argnames: ! if self.nargs == 1: ! print >> buf, " return %s," % self.children ! else: ! print >> buf, " return %s" % self.children else: print >> buf, " return ()" def _gen_repr(self, buf): --- 117,171 ---- def _gen_getChildren(self, buf): ! print >> buf, " def getChildren(self):" ! if len(self.argnames) == 0: ! print >> buf, " return ()" else: + if self.hardest_arg < P_NESTED: + clist = COMMA.join(["self.%s" % c + for c in self.argnames]) + if self.nargs == 1: + print >> buf, " return %s," % clist + else: + print >> buf, " return %s" % clist + else: + print >> buf, " children = []" + template = " children.%s(%sself.%s%s)" + for name in self.argnames: + if self.argprops[name] == P_NESTED: + print >> buf, template % ("extend", "flatten(", + name, ")") + else: + print >> buf, template % ("append", "", name, "") + print >> buf, " return tuple(children)" + + def _gen_getChildNodes(self, buf): + print >> buf, " def getChildNodes(self):" + if len(self.argnames) == 0: print >> buf, " return ()" + else: + if self.hardest_arg < P_NESTED: + clist = ["self.%s" % c + for c in self.argnames + if self.argprops[c] == P_NODE] + if len(clist) == 0: + print >> buf, " return ()" + elif len(clist) == 1: + print >> buf, " return %s," % clist[0] + else: + print >> buf, " return %s" % COMMA.join(clist) + else: + print >> buf, " nodes = []" + template = " nodes.%s(%sself.%s%s)" + for name in self.argnames: + if self.argprops[name] == P_NONE: + tmp = (" if self.%s is not None:" + " nodes.append(self.%s)") + print >> buf, tmp % (name, name) + elif self.argprops[name] == P_NESTED: + print >> buf, template % ("extend", "flatten_nodes(", + name, ")") + elif self.argprops[name] == P_NODE: + print >> buf, template % ("append", "", name, "") + print >> buf, " return tuple(nodes)" def _gen_repr(self, buf): *************** *** 99,102 **** --- 190,195 ---- cur = None for line in fileinput.input(file): + if line.strip().startswith('#'): + continue mo = rx_init.search(line) if mo is None: *************** *** 150,153 **** --- 243,249 ---- return l + def flatten_nodes(list): + return [n for n in flatten(list) if isinstance(n, Node)] + def asList(nodes): l = [] *************** *** 165,183 **** nodes = {} ! class Node: ! lineno = None def getType(self): ! pass def getChildren(self): ! # XXX It would be better to generate flat values to begin with ! return flatten(self._getChildren()) def asList(self): return tuple(asList(self.getChildren())) def getChildNodes(self): ! return [n for n in self.getChildren() if isinstance(n, Node)] class EmptyNode(Node): ! def __init__(self): ! self.lineno = None ### EPILOGUE --- 261,277 ---- nodes = {} ! class Node: # an abstract base class ! lineno = None # provide a lineno for nodes that don't have one def getType(self): ! pass # implemented by subclass def getChildren(self): ! pass # implemented by subclasses def asList(self): return tuple(asList(self.getChildren())) def getChildNodes(self): ! pass # implemented by subclasses class EmptyNode(Node): ! pass ### EPILOGUE From jhylton@users.sourceforge.net Wed Aug 29 19:09:52 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 11:09:52 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pyassem.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv14439 Modified Files: pyassem.py Log Message: Modify name conversion to be (hopefully) a bit more efficient. Use a dictionary instead of a list to map objects to their offsets in a const/name tuple of a code object. XXX The conversion is perhaps incomplete, in that we shouldn't have to do the list2dict to start. Index: pyassem.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pyassem.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** pyassem.py 2001/08/28 16:36:12 1.21 --- pyassem.py 2001/08/29 18:09:50 1.22 *************** *** 16,19 **** --- 16,30 ---- return l + def list2dict(l): + d = {} + for i in range(len(l)): + d[l[i]] = i + return d + + def dict2list(d): + l = [(v, k) for k, v in d.items()] + l.sort() + return [k for v, k in l] + class FlowGraph: def __init__(self): *************** *** 327,331 **** super_init = FlowGraph.__init__ ! def __init__(self, name, filename, args=(), optimized=0): self.super_init() self.name = name --- 338,342 ---- super_init = FlowGraph.__init__ ! def __init__(self, name, filename, args=(), optimized=0, klass=None): self.super_init() self.name = name *************** *** 334,337 **** --- 345,349 ---- self.args = args # XXX self.argcount = getArgCount(args) + self.klass = klass if optimized: self.flags = CO_OPTIMIZED | CO_NEWLOCALS *************** *** 446,457 **** self.consts.insert(0, self.docstring) self.sort_cellvars() for i in range(len(self.insts)): t = self.insts[i] if len(t) == 2: ! opname = t[0] ! oparg = t[1] conv = self._converters.get(opname, None) if conv: self.insts[i] = opname, conv(self, oparg) self.stage = CONV --- 458,480 ---- self.consts.insert(0, self.docstring) self.sort_cellvars() + + self.c_varnames = list2dict(self.varnames) + self.c_names = list2dict(self.names) + self.c_consts = list2dict(self.consts) + self.c_closure = list2dict(self.closure) + for i in range(len(self.insts)): t = self.insts[i] if len(t) == 2: ! opname, oparg = t conv = self._converters.get(opname, None) if conv: self.insts[i] = opname, conv(self, oparg) + + self.varnames = dict2list(self.c_varnames) + self.names = dict2list(self.c_names) + self.consts = dict2list(self.c_consts) + self.closure = dict2list(self.c_closure) + self.stage = CONV *************** *** 469,478 **** self.closure = self.cellvars + self.freevars ! def _lookupName(self, name, list): """Return index of name in list, appending if necessary""" t = type(name) for i in range(len(list)): ! # must do a comparison on type first to prevent UnicodeErrors ! if t == type(list[i]) and list[i] == name: return i end = len(list) --- 492,512 ---- self.closure = self.cellvars + self.freevars ! def _lookupName(self, name, dict): ! i = dict.get(name, None) ! if i is None: ! i = dict[name] = len(dict) ! return i ! ! def XXX_lookupName(self, name, list): """Return index of name in list, appending if necessary""" + # XXX It should be possible to replace this with some + # dictionary operations, but not sure how t = type(name) for i in range(len(list)): ! # must do a comparison on type first to prevent UnicodeErrors ! # not clear that a dictionary would work, because we could ! # get UnicodeErrors on lookups ! elt = list[i] ! if isinstance(elt, t) and elt == name: return i end = len(list) *************** *** 484,501 **** if hasattr(arg, 'getCode'): arg = arg.getCode() ! return self._lookupName(arg, self.consts) def _convert_LOAD_FAST(self, arg): ! self._lookupName(arg, self.names) ! return self._lookupName(arg, self.varnames) _convert_STORE_FAST = _convert_LOAD_FAST _convert_DELETE_FAST = _convert_LOAD_FAST def _convert_LOAD_NAME(self, arg): ! return self._lookupName(arg, self.names) def _convert_NAME(self, arg): ! self._lookupName(arg, self.varnames) ! return self._lookupName(arg, self.names) _convert_STORE_NAME = _convert_NAME _convert_DELETE_NAME = _convert_NAME --- 518,536 ---- if hasattr(arg, 'getCode'): arg = arg.getCode() ! return self._lookupName(arg, self.c_consts) def _convert_LOAD_FAST(self, arg): ! self._lookupName(arg, self.c_names) ! return self._lookupName(arg, self.c_varnames) _convert_STORE_FAST = _convert_LOAD_FAST _convert_DELETE_FAST = _convert_LOAD_FAST def _convert_LOAD_NAME(self, arg): ! return self._lookupName(arg, self.c_names) def _convert_NAME(self, arg): ! if self.klass is None: ! self._lookupName(arg, self.c_varnames) ! return self._lookupName(arg, self.c_names) _convert_STORE_NAME = _convert_NAME _convert_DELETE_NAME = _convert_NAME *************** *** 510,522 **** def _convert_DEREF(self, arg): ! self._lookupName(arg, self.names) ! self._lookupName(arg, self.varnames) ! return self._lookupName(arg, self.closure) _convert_LOAD_DEREF = _convert_DEREF _convert_STORE_DEREF = _convert_DEREF def _convert_LOAD_CLOSURE(self, arg): ! self._lookupName(arg, self.varnames) ! return self._lookupName(arg, self.closure) _cmp = list(dis.cmp_op) --- 545,557 ---- def _convert_DEREF(self, arg): ! self._lookupName(arg, self.c_names) ! self._lookupName(arg, self.c_varnames) ! return self._lookupName(arg, self.c_closure) _convert_LOAD_DEREF = _convert_DEREF _convert_STORE_DEREF = _convert_DEREF def _convert_LOAD_CLOSURE(self, arg): ! self._lookupName(arg, self.c_varnames) ! return self._lookupName(arg, self.c_closure) _cmp = list(dis.cmp_op) From jhylton@users.sourceforge.net Wed Aug 29 19:10:53 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 11:10:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler symbols.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv15041 Modified Files: symbols.py Log Message: Add generator detection to symbol table. Fix bug in handling of statements like "l[x:y] = 2". The visitor was treating this as assignments to l, x, and y! Index: symbols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/symbols.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** symbols.py 2001/08/27 22:56:16 1.7 --- symbols.py 2001/08/29 18:10:51 1.8 *************** *** 26,29 **** --- 26,30 ---- # i.e. if it is nested within another function. self.nested = None + self.generator = None self.klass = None if klass is not None: *************** *** 288,291 **** --- 289,313 ---- scope.add_def(asname or name) + def visitGlobal(self, node, scope): + for name in node.names: + scope.add_global(name) + + def visitAssign(self, node, scope): + """Propagate assignment flag down to child nodes. + + The Assign node doesn't itself contains the variables being + assigned to. Instead, the children in node.nodes are visited + with the assign flag set to true. When the names occur in + those nodes, they are marked as defs. + + Some names that occur in an assignment target are not bound by + the assignment, e.g. a name occurring inside a slice. The + visitor handles these nodes specially; they do not propagate + the assign flag to their children. + """ + for n in node.nodes: + self.visit(n, scope, 1) + self.visit(node.expr, scope) + def visitAssName(self, node, scope, assign=1): scope.add_def(node.name) *************** *** 298,301 **** --- 320,330 ---- for n in node.subs: self.visit(n, scope, 0) + + def visitSlice(self, node, scope, assign=0): + self.visit(node.expr, scope, assign) + if node.lower: + self.visit(node.lower, scope, 0) + if node.upper: + self.visit(node.upper, scope, 0) def visitAugAssign(self, node, scope): *************** *** 307,319 **** self.visit(node.expr, scope) - def visitAssign(self, node, scope): - for n in node.nodes: - self.visit(n, scope, 1) - self.visit(node.expr, scope) - - def visitGlobal(self, node, scope): - for name in node.names: - scope.add_global(name) - # prune if statements if tests are false --- 336,339 ---- *************** *** 330,333 **** --- 350,359 ---- if node.else_: self.visit(node.else_, scope) + + # a yield statement signals a generator + + def visitYield(self, node, scope): + self.generator = 1 + self.visit(node.value, scope) def sort(l): From jhylton@users.sourceforge.net Wed Aug 29 19:12:32 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 11:12:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler transformer.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv16108 Modified Files: transformer.py Log Message: Add support for // and //=. Avoid if/elif/elif/else tests where the final else is supposed to handle exactly one case instead of all other cases. When the list of operators is extended, the catchall else treats all new operators as the last operator in the set of tests. Instead, raise an exception if an unexpected operator occurs. Index: transformer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/transformer.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** transformer.py 2001/08/29 17:19:02 1.24 --- transformer.py 2001/08/29 18:12:30 1.25 *************** *** 589,595 **** node = LeftShift([node, right]) node.lineno = nodelist[1][2] ! else: node = RightShift([node, right]) node.lineno = nodelist[1][2] return node --- 589,597 ---- node = LeftShift([node, right]) node.lineno = nodelist[1][2] ! elif nodelist[i-1][0] == token.RIGHTSHIFT: node = RightShift([node, right]) node.lineno = nodelist[1][2] + else: + raise ValueError, "unexpected token: %s" % nodelist[i-1][0] return node *************** *** 601,607 **** node = Add([node, right]) node.lineno = nodelist[1][2] ! else: node = Sub([node, right]) node.lineno = nodelist[1][2] return node --- 603,611 ---- node = Add([node, right]) node.lineno = nodelist[1][2] ! elif nodelist[i-1][0] == token.MINUS: node = Sub([node, right]) node.lineno = nodelist[1][2] + else: + raise ValueError, "unexpected token: %s" % nodelist[i-1][0] return node *************** *** 615,620 **** elif t == token.SLASH: node = Div([node, right]) ! else: node = Mod([node, right]) node.lineno = nodelist[1][2] return node --- 619,628 ---- elif t == token.SLASH: node = Div([node, right]) ! elif t == token.PERCENT: node = Mod([node, right]) + elif t == token.DOUBLESLASH: + node = FloorDiv([node, right]) + else: + raise ValueError, "unexpected token: %s" % t node.lineno = nodelist[1][2] return node *************** *** 751,758 **** if i < len(nodelist): # should be DOUBLESTAR or STAR STAR ! if nodelist[i][0] == token.DOUBLESTAR: node = nodelist[i+1] ! else: node = nodelist[i+2] names.append(node[1]) flags = flags | CO_VARKEYWORDS --- 759,769 ---- if i < len(nodelist): # should be DOUBLESTAR or STAR STAR ! t = nodelist[i][0] ! if t == token.DOUBLESTAR: node = nodelist[i+1] ! elif t == token.STARSTAR: node = nodelist[i+2] + else: + raise ValueError, "unexpected token: %s" % t names.append(node[1]) flags = flags | CO_VARKEYWORDS From jhylton@users.sourceforge.net Wed Aug 29 19:14:42 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 11:14:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv17703 Modified Files: pycodegen.py Log Message: Support // and //= Generate SET_LINENO for del statements. Define klass=1 for PyFlowGraph constructor for a class statement. A class has no varnames. Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** pycodegen.py 2001/08/28 17:28:33 1.44 --- pycodegen.py 2001/08/29 18:14:39 1.45 *************** *** 672,675 **** --- 672,676 ---- self.storeName(node.name) elif node.flags == 'OP_DELETE': + self.set_lineno(node) self.delName(node.name) else: *************** *** 717,720 **** --- 718,722 ---- '*=' : 'INPLACE_MULTIPLY', '/=' : 'INPLACE_DIVIDE', + '//=': 'INPLACE_FLOOR_DIVIDE', '%=' : 'INPLACE_MODULO', '**=': 'INPLACE_POWER', *************** *** 890,893 **** --- 892,898 ---- return self.binaryOp(node, 'BINARY_DIVIDE') + def visitFloorDiv(self, node): + return self.binaryOp(node, 'BINARY_FLOOR_DIVIDE') + def visitMod(self, node): return self.binaryOp(node, 'BINARY_MODULO') *************** *** 1169,1173 **** self.class_name = klass.name self.graph = pyassem.PyFlowGraph(klass.name, filename, ! optimized=0) self.super_init(filename) lnf = walk(klass.code, self.NameFinder(), verbose=0) --- 1174,1178 ---- self.class_name = klass.name self.graph = pyassem.PyFlowGraph(klass.name, filename, ! optimized=0, klass=1) self.super_init(filename) lnf = walk(klass.code, self.NameFinder(), verbose=0) From jhylton@users.sourceforge.net Wed Aug 29 19:17:24 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 11:17:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler visitor.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv19380 Modified Files: visitor.py Log Message: Change default() to use getChildNodes() instead of getChildren() Index: visitor.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/visitor.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** visitor.py 2001/08/27 20:47:08 1.7 --- visitor.py 2001/08/29 18:17:22 1.8 *************** *** 45,51 **** def default(self, node, *args): ! for child in node.getChildren(): ! if isinstance(child, ast.Node): ! self.dispatch(child, *args) def dispatch(self, node, *args): --- 45,50 ---- def default(self, node, *args): ! for child in node.getChildNodes(): ! self.dispatch(child, *args) def dispatch(self, node, *args): From jhylton@users.sourceforge.net Wed Aug 29 20:45:35 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 12:45:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pyassem.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv4464 Modified Files: pyassem.py Log Message: Undo change from list to dict for handling varnames, consts, etc. As the doc string for _lookupName() explains: This routine uses a list instead of a dictionary, because a dictionary can't store two different keys if the keys have the same value but different types, e.g. 2 and 2L. The compiler must treat these two separately, so it does an explicit type comparison before comparing the values. Index: pyassem.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pyassem.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** pyassem.py 2001/08/29 18:09:50 1.22 --- pyassem.py 2001/08/29 19:45:33 1.23 *************** *** 16,30 **** return l - def list2dict(l): - d = {} - for i in range(len(l)): - d[l[i]] = i - return d - - def dict2list(d): - l = [(v, k) for k, v in d.items()] - l.sort() - return [k for v, k in l] - class FlowGraph: def __init__(self): --- 16,19 ---- *************** *** 458,467 **** self.consts.insert(0, self.docstring) self.sort_cellvars() - - self.c_varnames = list2dict(self.varnames) - self.c_names = list2dict(self.names) - self.c_consts = list2dict(self.consts) - self.c_closure = list2dict(self.closure) - for i in range(len(self.insts)): t = self.insts[i] --- 447,450 ---- *************** *** 471,480 **** if conv: self.insts[i] = opname, conv(self, oparg) - - self.varnames = dict2list(self.c_varnames) - self.names = dict2list(self.c_names) - self.consts = dict2list(self.c_consts) - self.closure = dict2list(self.c_closure) - self.stage = CONV --- 454,457 ---- *************** *** 492,512 **** self.closure = self.cellvars + self.freevars ! def _lookupName(self, name, dict): ! i = dict.get(name, None) ! if i is None: ! i = dict[name] = len(dict) ! return i ! def XXX_lookupName(self, name, list): ! """Return index of name in list, appending if necessary""" ! # XXX It should be possible to replace this with some ! # dictionary operations, but not sure how t = type(name) for i in range(len(list)): ! # must do a comparison on type first to prevent UnicodeErrors ! # not clear that a dictionary would work, because we could ! # get UnicodeErrors on lookups ! elt = list[i] ! if isinstance(elt, t) and elt == name: return i end = len(list) --- 469,484 ---- self.closure = self.cellvars + self.freevars ! def _lookupName(self, name, list): ! """Return index of name in list, appending if necessary ! This routine uses a list instead of a dictionary, because a ! dictionary can't store two different keys if the keys have the ! same value but different types, e.g. 2 and 2L. The compiler ! must treat these two separately, so it does an explicit type ! comparison before comparing the values. ! """ t = type(name) for i in range(len(list)): ! if t == type(list[i]) and list[i] == name: return i end = len(list) *************** *** 518,536 **** if hasattr(arg, 'getCode'): arg = arg.getCode() ! return self._lookupName(arg, self.c_consts) def _convert_LOAD_FAST(self, arg): ! self._lookupName(arg, self.c_names) ! return self._lookupName(arg, self.c_varnames) _convert_STORE_FAST = _convert_LOAD_FAST _convert_DELETE_FAST = _convert_LOAD_FAST def _convert_LOAD_NAME(self, arg): ! return self._lookupName(arg, self.c_names) def _convert_NAME(self, arg): ! if self.klass is None: ! self._lookupName(arg, self.c_varnames) ! return self._lookupName(arg, self.c_names) _convert_STORE_NAME = _convert_NAME _convert_DELETE_NAME = _convert_NAME --- 490,509 ---- if hasattr(arg, 'getCode'): arg = arg.getCode() ! return self._lookupName(arg, self.consts) def _convert_LOAD_FAST(self, arg): ! self._lookupName(arg, self.names) ! return self._lookupName(arg, self.varnames) _convert_STORE_FAST = _convert_LOAD_FAST _convert_DELETE_FAST = _convert_LOAD_FAST def _convert_LOAD_NAME(self, arg): ! if self.klass is None: ! self._lookupName(arg, self.varnames) ! return self._lookupName(arg, self.names) def _convert_NAME(self, arg): ! self._lookupName(arg, self.varnames) ! return self._lookupName(arg, self.names) _convert_STORE_NAME = _convert_NAME _convert_DELETE_NAME = _convert_NAME *************** *** 545,557 **** def _convert_DEREF(self, arg): ! self._lookupName(arg, self.c_names) ! self._lookupName(arg, self.c_varnames) ! return self._lookupName(arg, self.c_closure) _convert_LOAD_DEREF = _convert_DEREF _convert_STORE_DEREF = _convert_DEREF def _convert_LOAD_CLOSURE(self, arg): ! self._lookupName(arg, self.c_varnames) ! return self._lookupName(arg, self.c_closure) _cmp = list(dis.cmp_op) --- 518,530 ---- def _convert_DEREF(self, arg): ! self._lookupName(arg, self.names) ! self._lookupName(arg, self.varnames) ! return self._lookupName(arg, self.closure) _convert_LOAD_DEREF = _convert_DEREF _convert_STORE_DEREF = _convert_DEREF def _convert_LOAD_CLOSURE(self, arg): ! self._lookupName(arg, self.varnames) ! return self._lookupName(arg, self.closure) _cmp = list(dis.cmp_op) From jackjansen@users.sourceforge.net Wed Aug 29 21:26:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 29 Aug 2001 13:26:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_threaded_import.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv26285 Modified Files: test_threaded_import.py Log Message: Workaround by Tim Peters to skip this test if run from test.autotest, in which case it will hang because the import lock is already held by the main thread. Index: test_threaded_import.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_threaded_import.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_threaded_import.py 2001/05/22 18:28:25 1.2 --- test_threaded_import.py 2001/08/29 20:26:24 1.3 *************** *** 7,11 **** import thread ! from test_support import verbose critical_section = thread.allocate_lock() --- 7,11 ---- import thread ! from test_support import verbose, TestSkipped critical_section = thread.allocate_lock() *************** *** 33,36 **** --- 33,40 ---- def test_main(): # magic name! see above global N, done + import sys + for modname in sys.modules: + if modname.find('autotest') >= 0: + raise TestSkipped("can't run from autotest") done.acquire() for N in (20, 50) * 3: From jhylton@users.sourceforge.net Wed Aug 29 21:55:20 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 13:55:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pyassem.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv8050 Modified Files: pyassem.py Log Message: Fix off-by-one errors in code to find depth of stack. XXX The code is still widely inaccurate, but most (all?) of the time it's an overestimate. Index: pyassem.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pyassem.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** pyassem.py 2001/08/29 19:45:33 1.23 --- pyassem.py 2001/08/29 20:55:17 1.24 *************** *** 765,773 **** # BUILD_LIST, CALL_FUNCTION, MAKE_FUNCTION, BUILD_SLICE def UNPACK_SEQUENCE(self, count): ! return count def BUILD_TUPLE(self, count): ! return -count def BUILD_LIST(self, count): ! return -count def CALL_FUNCTION(self, argc): hi, lo = divmod(argc, 256) --- 765,773 ---- # BUILD_LIST, CALL_FUNCTION, MAKE_FUNCTION, BUILD_SLICE def UNPACK_SEQUENCE(self, count): ! return count-1 def BUILD_TUPLE(self, count): ! return -count+1 def BUILD_LIST(self, count): ! return -count+1 def CALL_FUNCTION(self, argc): hi, lo = divmod(argc, 256) From jhylton@users.sourceforge.net Wed Aug 29 21:56:32 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 13:56:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler transformer.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv8782 Modified Files: transformer.py Log Message: Make sure that atoms (Tuple, List, etc.) have lineno attributes Index: transformer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/transformer.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** transformer.py 2001/08/29 18:12:30 1.25 --- transformer.py 2001/08/29 20:56:30 1.26 *************** *** 100,104 **** """Transform an AST into a modified parse tree.""" if type(tree) != type(()) and type(tree) != type([]): ! tree = parser.ast2tuple(tree,1) return self.compile_node(tree) --- 100,104 ---- """Transform an AST into a modified parse tree.""" if type(tree) != type(()) and type(tree) != type([]): ! tree = parser.ast2tuple(tree, line_info=1) return self.compile_node(tree) *************** *** 658,662 **** def atom(self, nodelist): ! return self._atom_dispatch[nodelist[0][0]](nodelist) def atom_lpar(self, nodelist): --- 658,664 ---- def atom(self, nodelist): ! n = self._atom_dispatch[nodelist[0][0]](nodelist) ! n.lineno = nodelist[0][2] ! return n def atom_lpar(self, nodelist): From jhylton@users.sourceforge.net Wed Aug 29 21:57:45 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 13:57:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.45,1.46 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv9318 Modified Files: pycodegen.py Log Message: Generate SET_LINENO for list and tuple literals when the open paren starts a new line. Also fix undetected typo in visitDict() -- uncovered by recent change to add lineno attrs to atoms. Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** pycodegen.py 2001/08/29 18:14:39 1.45 --- pycodegen.py 2001/08/29 20:57:43 1.46 *************** *** 954,957 **** --- 954,958 ---- def visitTuple(self, node): + self.set_lineno(node) for elt in node.nodes: self.visit(elt) *************** *** 959,962 **** --- 960,964 ---- def visitList(self, node): + self.set_lineno(node) for elt in node.nodes: self.visit(elt) *************** *** 971,975 **** lineno = getattr(node, 'lineno', None) if lineno: ! set.emit('SET_LINENO', lineno) self.emit('BUILD_MAP', 0) for k, v in node.items: --- 973,977 ---- lineno = getattr(node, 'lineno', None) if lineno: ! self.emit('SET_LINENO', lineno) self.emit('BUILD_MAP', 0) for k, v in node.items: From tim_one@users.sourceforge.net Wed Aug 29 22:37:12 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 29 Aug 2001 14:37:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python thread_nt.h,2.17,2.18 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv23991/Python Modified Files: thread_nt.h Log Message: SF bug [#456252] Python should never stomp on [u]intptr_t. pyport.h: typedef a new Py_intptr_t type. DELICATE ASSUMPTION: That HAVE_UINTPTR_T implies intptr_t is available as well as uintptr_t. If that turns out not to be true, things must get uglier (C99 wants both, so I think it's an assumption we're *likely* to get away with). thread_nt.h, PyThread_start_new_thread: MS _beginthread is documented as returning unsigned long; no idea why uintptr_t was being used. Others: Always use Py_[u]intptr_t, never [u]intptr_t directly. Index: thread_nt.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_nt.h,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -d -r2.17 -r2.18 *** thread_nt.h 2000/09/01 23:29:28 2.17 --- thread_nt.h 2001/08/29 21:37:10 2.18 *************** *** 153,157 **** int PyThread_start_new_thread(void (*func)(void *), void *arg) { ! uintptr_t rv; int success = 0; --- 153,157 ---- int PyThread_start_new_thread(void (*func)(void *), void *arg) { ! unsigned long rv; int success = 0; *************** *** 162,166 **** rv = _beginthread(func, 0, arg); /* use default stack size */ ! if (rv != -1) { success = 1; dprintf(("%ld: PyThread_start_new_thread succeeded: %p\n", PyThread_get_thread_ident(), rv)); --- 162,166 ---- rv = _beginthread(func, 0, arg); /* use default stack size */ ! if (rv != (unsigned long)-1) { success = 1; dprintf(("%ld: PyThread_start_new_thread succeeded: %p\n", PyThread_get_thread_ident(), rv)); From tim_one@users.sourceforge.net Wed Aug 29 22:37:12 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 29 Aug 2001 14:37:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/PC msvcrtmodule.c,1.6,1.7 pyconfig.h,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory usw-pr-cvs1:/tmp/cvs-serv23991/PC Modified Files: msvcrtmodule.c pyconfig.h Log Message: SF bug [#456252] Python should never stomp on [u]intptr_t. pyport.h: typedef a new Py_intptr_t type. DELICATE ASSUMPTION: That HAVE_UINTPTR_T implies intptr_t is available as well as uintptr_t. If that turns out not to be true, things must get uglier (C99 wants both, so I think it's an assumption we're *likely* to get away with). thread_nt.h, PyThread_start_new_thread: MS _beginthread is documented as returning unsigned long; no idea why uintptr_t was being used. Others: Always use Py_[u]intptr_t, never [u]intptr_t directly. Index: msvcrtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/msvcrtmodule.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** msvcrtmodule.c 2000/12/12 01:58:56 1.6 --- msvcrtmodule.c 2001/08/29 21:37:09 1.7 *************** *** 99,103 **** { int fd; ! intptr_t handle; if (!PyArg_ParseTuple(args,"i:get_osfhandle", &fd)) --- 99,103 ---- { int fd; ! Py_intptr_t handle; if (!PyArg_ParseTuple(args,"i:get_osfhandle", &fd)) Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/pyconfig.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pyconfig.h 2001/07/26 21:34:59 1.2 --- pyconfig.h 2001/08/29 21:37:09 1.3 *************** *** 295,302 **** #include #endif - #if defined(MS_WINDOWS) && !defined(MS_WIN64) - typedef long intptr_t; - typedef unsigned long uintptr_t; - #endif #if defined(MS_WIN64) --- 295,298 ---- From tim_one@users.sourceforge.net Wed Aug 29 22:37:11 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 29 Aug 2001 14:37:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include pyport.h,2.32,2.33 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv23991/Include Modified Files: pyport.h Log Message: SF bug [#456252] Python should never stomp on [u]intptr_t. pyport.h: typedef a new Py_intptr_t type. DELICATE ASSUMPTION: That HAVE_UINTPTR_T implies intptr_t is available as well as uintptr_t. If that turns out not to be true, things must get uglier (C99 wants both, so I think it's an assumption we're *likely* to get away with). thread_nt.h, PyThread_start_new_thread: MS _beginthread is documented as returning unsigned long; no idea why uintptr_t was being used. Others: Always use Py_[u]intptr_t, never [u]intptr_t directly. Index: pyport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v retrieving revision 2.32 retrieving revision 2.33 diff -C2 -d -r2.32 -r2.33 *** pyport.h 2001/08/08 18:24:45 2.32 --- pyport.h 2001/08/29 21:37:09 2.33 *************** *** 64,77 **** /* uintptr_t is the C9X name for an unsigned integral type such that a * legitimate void* can be cast to uintptr_t and then back to void* again ! * without loss of information. */ #ifdef HAVE_UINTPTR_T ! typedef uintptr_t Py_uintptr_t; #elif SIZEOF_VOID_P <= SIZEOF_INT ! typedef unsigned int Py_uintptr_t; #elif SIZEOF_VOID_P <= SIZEOF_LONG ! typedef unsigned long Py_uintptr_t; #elif defined(HAVE_LONG_LONG) && (SIZEOF_VOID_P <= SIZEOF_LONG_LONG) ! typedef unsigned LONG_LONG Py_uintptr_t; #else # error "Python needs a typedef for Py_uintptr_t in pyport.h." --- 64,86 ---- /* uintptr_t is the C9X name for an unsigned integral type such that a * legitimate void* can be cast to uintptr_t and then back to void* again ! * without loss of information. Similarly for intptr_t, wrt a signed ! * integral type. */ #ifdef HAVE_UINTPTR_T ! typedef uintptr_t Py_uintptr_t; ! typedef intptr_t Py_intptr_t; ! #elif SIZEOF_VOID_P <= SIZEOF_INT ! typedef unsigned int Py_uintptr_t; ! typedef int Py_intptr_t; ! #elif SIZEOF_VOID_P <= SIZEOF_LONG ! typedef unsigned long Py_uintptr_t; ! typedef long Py_intptr_t; ! #elif defined(HAVE_LONG_LONG) && (SIZEOF_VOID_P <= SIZEOF_LONG_LONG) ! typedef unsigned LONG_LONG Py_uintptr_t; ! typedef LONG_LONG Py_intptr_t; ! #else # error "Python needs a typedef for Py_uintptr_t in pyport.h." From tim_one@users.sourceforge.net Wed Aug 29 22:37:12 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 29 Aug 2001 14:37:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.197,2.198 socketmodule.c,1.167,1.168 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv23991/Modules Modified Files: posixmodule.c socketmodule.c Log Message: SF bug [#456252] Python should never stomp on [u]intptr_t. pyport.h: typedef a new Py_intptr_t type. DELICATE ASSUMPTION: That HAVE_UINTPTR_T implies intptr_t is available as well as uintptr_t. If that turns out not to be true, things must get uglier (C99 wants both, so I think it's an assumption we're *likely* to get away with). thread_nt.h, PyThread_start_new_thread: MS _beginthread is documented as returning unsigned long; no idea why uintptr_t was being used. Others: Always use Py_[u]intptr_t, never [u]intptr_t directly. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.197 retrieving revision 2.198 diff -C2 -d -r2.197 -r2.198 *** posixmodule.c 2001/08/27 06:37:48 2.197 --- posixmodule.c 2001/08/29 21:37:09 2.198 *************** *** 1552,1556 **** char **argvlist; int mode, i, argc; ! intptr_t spawnval; PyObject *(*getitem)(PyObject *, int); --- 1552,1556 ---- char **argvlist; int mode, i, argc; ! Py_intptr_t spawnval; PyObject *(*getitem)(PyObject *, int); *************** *** 1621,1625 **** PyObject *key, *val, *keys=NULL, *vals=NULL, *res=NULL; int mode, i, pos, argc, envc; ! intptr_t spawnval; PyObject *(*getitem)(PyObject *, int); --- 1621,1625 ---- PyObject *key, *val, *keys=NULL, *vals=NULL, *res=NULL; int mode, i, pos, argc, envc; ! Py_intptr_t spawnval; PyObject *(*getitem)(PyObject *, int); *************** *** 3690,3695 **** if (!ok) return win32_error("CreatePipe", NULL); ! read_fd = _open_osfhandle((intptr_t)read, 0); ! write_fd = _open_osfhandle((intptr_t)write, 1); return Py_BuildValue("(ii)", read_fd, write_fd); #endif /* MS_WIN32 */ --- 3690,3695 ---- if (!ok) return win32_error("CreatePipe", NULL); ! read_fd = _open_osfhandle((Py_intptr_t)read, 0); ! write_fd = _open_osfhandle((Py_intptr_t)write, 1); return Py_BuildValue("(ii)", read_fd, write_fd); #endif /* MS_WIN32 */ Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.167 retrieving revision 1.168 diff -C2 -d -r1.167 -r1.168 *** socketmodule.c 2001/08/20 22:26:24 1.167 --- socketmodule.c 2001/08/29 21:37:09 1.168 *************** *** 1424,1428 **** int bufsize = -1; #ifdef MS_WIN32 ! intptr_t fd; #else int fd; --- 1424,1428 ---- int bufsize = -1; #ifdef MS_WIN32 ! Py_intptr_t fd; #else int fd; From jackjansen@users.sourceforge.net Wed Aug 29 23:04:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 29 Aug 2001 15:04:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac ReadMe,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv9078/Python/Mac Modified Files: ReadMe Log Message: Started on release notes and readme for 2.2a2. Index: ReadMe =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/ReadMe,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ReadMe 2001/08/27 15:30:48 1.32 --- ReadMe 2001/08/29 22:04:00 1.33 *************** *** 1,3 **** ! How to install Python 2.1.1 on your Macintosh --------------------------------------------- --- 1,3 ---- ! How to install Python 2.2a2 on your Macintosh --------------------------------------------- *************** *** 6,10 **** use the Carbon version or not. ! You should definitely read the Relnotes file too. A special note about the active installer: do not background it, it may hang --- 6,11 ---- use the Carbon version or not. ! You should definitely read the Relnotes file too, and the section below about ! toolbox module reorganization. A special note about the active installer: do not background it, it may hang *************** *** 12,15 **** --- 13,19 ---- are working on it. + Aside from the general new Python 2.2a2 listed in the general relnotes file + there is some other new machine-independent stuff in this release as well, as + it was built from newer sources than unix/windows 2.2a2. ------ *************** *** 25,33 **** now. The documentation is in HTML format, start with index.html. - Caveats - ------- - Aside from the general new Python 2.1.1 features compared to 2.0 the main - feature of this release is Carbon support. - This installer installs MacPython for classic PPC MacOS, MacPython for Carbon (OS X, OS 9 or OS8 with CarbonLib installed) or both, depending on your --- 29,32 ---- *************** *** 37,40 **** --- 36,114 ---- If you want 68k support you will have to stay with MacPython 1.5.2. + Toolbox module reorganization and more + -------------------------------------- + + You can safely skip this section if this is your first encounter with MacPython. + + I am working on a new organization of the mac-specific modules, and in + general bringing the MacPython folder structure more in line with + unix-Python. This is not only a good idea, it will also immensely + facilitate moving MacPython functionality to an OSX Python that is based + on Mach-O and the unix-Python distribution. But don't worry: MacPython + is definitely not dead yet, and the hope is that the transition will be + as seamless as possible. + + First a change that should not cause too much concern: :Mac:Plugins has + gone, and most of the dynamically loaded modules have moved to + :Lib:lib-dynload. + + Second, and more important: the toolbox modules, such as Res and + Resource, have moved to a Carbon package. So, in stead of "import Res" + you should now say "from Carbon import Res" and in stead of "from Res + import *" you should use "from Carbon.Res import *". For the lifetime of + MacPython 2.2 there is a folder :Mac:Lib:lib-compat on sys.path that + contains modules with the old names which imports the new names after + issuing a warning. + + Note that although the package is called Carbon the modules work fine under + classic PPC, and they are normal classic modules. Also note that some + modules you may think of as toolbox modules (such as Waste) really are not, + and they are not in the Carbon package. + + Some open issues I would like to discuss on the PythonMac-SIG, please join + in if you have views on the matter: + - Is this all a good idea? + - Some modules are not in the Carbon package (icglue, for instance, or + supporting module such as aetools and aepack) and maybe they should be, + some are (ControlAccessors) which arguably should not. Opinions are welcome. + - I'm tempted to put Qt and QuickTime into their own package, especially + since I'm also working on porting it to Windows. It would also be in line + with Apple's organization. Opinions? + - Should we get rid of the Res/Resource dichotomy, where the first is the + extension module and the second is the Python module with the constants? + We could simply import the extension module functionality into the Python + module, at the expense of a rather large namespace. + - Should we have a Carbon.Carbon module that simply imports the whole world, + so that "from Carbon.Carbon import *" is pretty much equivalent to the C + #include ? + - Should we put all the other Mac modules into a Mac package? This will make + MacPython programs a lot more verbose, but that is a good thing too if people + try to port Mac Python scripts to other platforms. + Should the Carbon package then be a sub-package of the Mac package? + + Another change related to the OSX growth path is that there is a new module + macresource that you can use to easily open a resource file accompanying your + script. Use "macresource.need("DLOG", MY_DIALOG_ID, "name.rsrc") and if the + given resource is not available (it _is_ available if your script has been + turned into an applet) the given resource file will be opened. This method will + eventually also contain the magic needed to open the resource file on + OSX MachO Python. + + ... and more + ------------ + + A feature that I am not sure about (so: feedback!) is that if you open a textfile + for reading MacPython will now accept either unix linefeeds (LF, '\n') or + Macintosh linefeeds (CR, '\r') and present both of them as '\n'. This is done on + a low level, so it works for files opened by scripts as well as for your scripts + and modules itself. + + But: + - this works only for input, and there's no way to find out what the original + linefeed convention of the file was. + - this is unconditional, so there's no way to turn it off, either on a file-by-file + basis or globally (but opening binary files works as it always has, of course). + - Windows \r\n linefeeds are not supported and get turned into \n\n. + What to install --------------- *************** *** 45,49 **** For Carbon MacPython you only get PIL: there is no Tcl/Tk for Carbon yet. This is the reason Classic MacPython is also installed on MacOSX: it allows you ! to run Tkinter applications, albeit in the MacOS9 box. - img: another imaging package. Has more file format support and is faster than imaging, but has only limited operations on images. There is a bridge --- 119,123 ---- For Carbon MacPython you only get PIL: there is no Tcl/Tk for Carbon yet. This is the reason Classic MacPython is also installed on MacOSX: it allows you ! to run Tkinter applications, albeit in the Classic box. - img: another imaging package. Has more file format support and is faster than imaging, but has only limited operations on images. There is a bridge *************** *** 105,109 **** Two items are installed in the system folder: the interpreter shared libraries PythonCore and PythonCoreCarbon lives in the Extensions folder and the ! "Python 2.1.1 Preferences" file in the Python subfolder in the Preferences folder. All the rest of Python lives in the folder you installed in. --- 179,183 ---- Two items are installed in the system folder: the interpreter shared libraries PythonCore and PythonCoreCarbon lives in the Extensions folder and the ! "Python 2.2a2 Preferences" file in the Python subfolder in the Preferences folder. All the rest of Python lives in the folder you installed in. *************** *** 114,118 **** beta installers triggered this problem if you simply threw away your Python folder, so if you installed a 2.1beta you should clean out the aliases in /Library/CFMSupport ! too. The final 2.1 installer always copied the shared libraries on OSX, so it does not have the problem anymore. --- 188,192 ---- beta installers triggered this problem if you simply threw away your Python folder, so if you installed a 2.1beta you should clean out the aliases in /Library/CFMSupport ! too. The final 2.1 and 2.1.1 installers always copied the shared libraries on OSX, so it does not have the problem anymore. *************** *** 154,162 **** are lost and you have to set them again. ! After you are satisfied that 2.1.1 works as expected you can trash anything in the system folder that has "python" in the name and not ! "2.1.1". ! As of 2.1 the ConfigurePython applets will try to detect incompatible preferences files and offer to remove them. This means that re-running ConfigurePython after a second install of the same MacPython version (or after moving the Python folder) --- 228,236 ---- are lost and you have to set them again. ! After you are satisfied that 2.2a2 works as expected you can trash anything in the system folder that has "python" in the name and not ! "2.2a2". ! The ConfigurePython... applets will try to detect incompatible preferences files and offer to remove them. This means that re-running ConfigurePython after a second install of the same MacPython version (or after moving the Python folder) From jackjansen@users.sourceforge.net Wed Aug 29 23:04:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 29 Aug 2001 15:04:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac Relnotes,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv9198/Python/Mac Modified Files: Relnotes Log Message: Started on release notes and readme for 2.2a2. Index: Relnotes =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Relnotes,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Relnotes 2001/08/03 13:31:34 1.24 --- Relnotes 2001/08/29 22:04:08 1.25 *************** *** 1,48 **** ! Changes in 2.1.1 since 2.1 ! -------------------------- These release notes refer to Mac-specific changes only. See NEWS (in the Misc folder) ! for machine-independent changes. ! - Handling non-ascii characters in sys.path on non-MacRoman systems should be fixed, ! iff MacPython has a codec for the charset. Otherwise you should get an error, at least. ! Pathnames in sys.path also retain their original case again. ! - IDE could crash on corrupt preferences. Fixed. ! - IDE will now work if you use either pre or sre as re. ! - Evt.WaitNextEvent could give an error when bit 15 was set, which could cause a problem ! with IDE in classic mode. Fixed. ! - MacOS8.X users in classic mode had problems with Fm not loading, which also caused ! IDE not working. Fixed. ! - Fm.IsAntiAliasedTextEnabled and Fm.SetAntiAliasedTextEnabled have gone for now, to ! fix the problem above. ! - Disabled the Tkinter file I/O event handler, which was there but didn't work anyway. ! - Problems with loading dynamic modules that are part of a package into BuildApplication- ! generated programs were fixed. ! - The order of the EasyDialogs yes/no/cancel buttons has been conformed to the Mac ! standard. ! - Handling of Dialogs and Windows that were not created by Python is a bit more graceful ! now, which may fix some crashes. ! - Ctl.SendControlMessage has gone. But it didn't work anyway. ! - Various problems with the TextEdit and Waste demos have been fixed. ! - Embedding/extending only: in preparation to allowing the use of MacPython modules in ! unix-Python on OSX the xxx_New and xxx_Convert routines are now optionally vectored via ! glue routines in macglue.c. The only change that may be needed for embedders/extenders is ! that you may want to include pymactoolbox.h in your sources. ! - Embedding/extending only: Most MacPython source is now much more Mach-O friendly, and ! should work with Universal Headers 3.4. ! - Experimental: an Mlte module has been added, an interface to the Multi Lingual Text ! Engine. There is a minimal example in :Mac:Demos:mlte. ! - Experimental: some support for FSRef objects has been added. You can do little more that ! convert them to/from FSSpecs. Carbon only. ! - Experimental: the CF module has some support for CoreFoundation types. CFString ! and CFURL work, to a degree, and can be converted to/from Python strings and Unicode ! objects. Carbon only. What is not in this distribution -------------------------------- ! - The garbage collection mods have not been enabled, mainly due to lack of test-time. ! - Stackless Python/microthreads hasn't been ported to 2.1 yet. If/when it becomes available Just will undoubtedly announce it on pythonmac-sig and the MacPython homepage. Known problems --- 1,35 ---- ! Changes in 2.2a2 since 2.1.1 ! ---------------------------- These release notes refer to Mac-specific changes only. See NEWS (in the Misc folder) ! for machine-independent changes. But note that more things may have changed: MacPython ! 2.2a2 is built from newer sources than unix/windows 2.2a2 (for CVS users: the r22a2-mac ! tag is what you are looking for). ! - The main change is that all toolbox modules have moved to a package called Carbon. ! So things like "import Res" should be changed to "from Carbon import Res", and ! "from Res import *" to "from Carbon.Res import *". Please see the readme file for ! some open questions and join the discussions on pythonmac-sig if you have anything ! to contribute. Aside from reducing clutter this change will also benefit the ! port to Mach-O/OSX Python later. ! - On input MacPython now accepts either \n (unix style) or \r (mac style) newlines ! for text files. This is an experimental feature; again: feedback is requested. ! - There is a new module macresource which makes it easier to open a resource file ! accompanying your script when the script is not (yet) converted to an applet. ! This module will later also do the right thing in Mach-O/OSX Python. ! - Threads had a stack that was too small for many serious Python applications (20K). ! They now get 64K. There is still no overflow check, though. ! - Garbage collection and the gc module have (finally) been enabled. ! - EasyDialogs.ProgressBar now has indeterminate progressbars if you specify maxval=0. ! This is also the new default. Patch supplied by Dean Draayer. ! - Various outdated scripts have been moved to :Mac:Unsupported. ! - Various outdated items from :Mac:Lib:test have been removed. What is not in this distribution -------------------------------- ! - Stackless Python/microthreads hasn't been ported to 2.2 yet. If/when it becomes available Just will undoubtedly announce it on pythonmac-sig and the MacPython homepage. + - The toolbox modules have not been updated to Universal Header 3.4 or CarbonLib 1.4 yet. Known problems *************** *** 52,56 **** http://www.cwi.nl/~jack/macpython.html. ! - MacPython 2.1.1 (and MacPython 2.1) will not run correctly on a multiprocessor MacOS X machine, it will quickly deadlock during I/O operations. The GUSI I/O library is suspected, hints/clues/workarounds are solicited. --- 39,43 ---- http://www.cwi.nl/~jack/macpython.html. ! - MacPython 2.2a2 (and MacPython 2.1) will not run correctly on a multiprocessor MacOS X machine, it will quickly deadlock during I/O operations. The GUSI I/O library is suspected, hints/clues/workarounds are solicited. From jackjansen@users.sourceforge.net Wed Aug 29 23:08:01 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 29 Aug 2001 15:08:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts fullbuild.py,1.73,1.74 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv11868/Python/Mac/scripts Modified Files: fullbuild.py Log Message: Added xx and xxsubtype modules, for completeness and because xxsubtype is used by the test suite. Index: fullbuild.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/fullbuild.py,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** fullbuild.py 2001/08/27 21:39:36 1.73 --- fullbuild.py 2001/08/29 22:07:59 1.74 *************** *** 240,243 **** --- 240,245 ---- (":Mac:Build:_symtable.mcp", "_symtable.ppc"), (":Mac:Build:_testcapi.mcp", "_testcapi.ppc"), + (":Mac:Build:xx.mcp", "xx.ppc"), + (":Mac:Build:xxsubtype.mcp", "xxsubtype.ppc"), (":Mac:Build:pyexpat.mcp", "pyexpat.ppc"), (":Mac:Build:calldll.mcp", "calldll.ppc"), *************** *** 280,283 **** --- 282,287 ---- (":Mac:Build:_symtable.carbon.mcp", "_symtable.carbon"), (":Mac:Build:_testcapi.carbon.mcp", "_testcapi.carbon"), + (":Mac:Build:xx.carbon.mcp", "xx.carbon"), + (":Mac:Build:xxsubtype.carbon.mcp", "xxsubtype.carbon"), (":Mac:Build:pyexpat.carbon.mcp", "pyexpat.carbon"), (":Mac:Build:calldll.carbon.mcp", "calldll.carbon"), From jackjansen@users.sourceforge.net Wed Aug 29 23:08:08 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 29 Aug 2001 15:08:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts genpluginprojects.py,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv12017/Python/Mac/scripts Modified Files: genpluginprojects.py Log Message: Added xx and xxsubtype modules, for completeness and because xxsubtype is used by the test suite. Index: genpluginprojects.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/genpluginprojects.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** genpluginprojects.py 2001/08/23 13:48:49 1.19 --- genpluginprojects.py 2001/08/29 22:08:06 1.20 *************** *** 110,114 **** --- 110,117 ---- genpluginproject("all", "_weakref", sources=["_weakref.c"]) genpluginproject("all", "_symtable", sources=["symtablemodule.c"]) + # Example/test modules genpluginproject("all", "_testcapi") + genpluginproject("all", "xx") + genpluginproject("all", "xxsubtype", sources=["xxsubtype.c"]) # bgen-generated Toolbox modules From jhylton@users.sourceforge.net Wed Aug 29 23:26:37 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 15:26:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler misc.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv24249 Modified Files: misc.py Log Message: Add __getitem__() handler for use by visitContinue() Index: misc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/misc.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** misc.py 2001/08/27 22:56:16 1.8 --- misc.py 2001/08/29 22:26:35 1.9 *************** *** 40,43 **** --- 40,45 ---- def top(self): return self.stack[-1] + def __getitem__(self, index): # needed by visitContinue() + return self.stack[index] MANGLE_LEN = 256 # magic constant from compile.c From jhylton@users.sourceforge.net Wed Aug 29 23:27:16 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 15:27:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pyassem.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv24788 Modified Files: pyassem.py Log Message: Improve stack depth computation for try/except and try/finally Add CONTINUE_LOOP to the list of unconditional transfers Index: pyassem.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pyassem.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** pyassem.py 2001/08/29 20:55:17 1.24 --- pyassem.py 2001/08/29 22:27:14 1.25 *************** *** 268,272 **** _uncond_transfer = ('RETURN_VALUE', 'RAISE_VARARGS', ! 'JUMP_ABSOLUTE', 'JUMP_FORWARD') def pruneNext(self): --- 268,272 ---- _uncond_transfer = ('RETURN_VALUE', 'RAISE_VARARGS', ! 'JUMP_ABSOLUTE', 'JUMP_FORWARD', 'CONTINUE_LOOP') def pruneNext(self): *************** *** 754,757 **** --- 754,760 ---- 'IMPORT_NAME': 0, 'IMPORT_FROM': 1, + # close enough... + 'SETUP_EXCEPT': 3, + 'SETUP_FINALLY': 3, } # use pattern match From jhylton@users.sourceforge.net Wed Aug 29 23:30:11 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 29 Aug 2001 15:30:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.46,1.47 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv26905 Modified Files: pycodegen.py Log Message: Track the block stack more reasonably in order to handle continue in try/except or try/finally. Previous versions had only track SETUP_LOOP blocks and ignored the exception part. This meant that it allowed continue inside a try/except but generated buggy code. Now it does the right thing. Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** pycodegen.py 2001/08/29 20:57:43 1.46 --- pycodegen.py 2001/08/29 22:30:09 1.47 *************** *** 29,32 **** --- 29,37 ---- } + LOOP = 1 + EXCEPT = 2 + TRY_FINALLY = 3 + END_FINALLY = 4 + def compile(filename, display=0): f = open(filename) *************** *** 143,147 **** self.filename = filename self.locals = misc.Stack() ! self.loops = misc.Stack() self.curStack = 0 self.maxStack = 0 --- 148,152 ---- self.filename = filename self.locals = misc.Stack() ! self.setups = misc.Stack() self.curStack = 0 self.maxStack = 0 *************** *** 328,332 **** self.nextBlock(loop) ! self.loops.push(loop) self.set_lineno(node, force=1) --- 333,337 ---- self.nextBlock(loop) ! self.setups.push((LOOP, loop)) self.set_lineno(node, force=1) *************** *** 342,346 **** self.emit('POP_TOP') self.emit('POP_BLOCK') ! self.loops.pop() if node.else_: self.visit(node.else_) --- 347,351 ---- self.emit('POP_TOP') self.emit('POP_BLOCK') ! self.setups.pop() if node.else_: self.visit(node.else_) *************** *** 351,355 **** anchor = self.newBlock() after = self.newBlock() ! self.loops.push(start) self.set_lineno(node) --- 356,360 ---- anchor = self.newBlock() after = self.newBlock() ! self.setups.push((LOOP, start)) self.set_lineno(node) *************** *** 366,370 **** self.nextBlock(anchor) self.emit('POP_BLOCK') ! self.loops.pop() if node.else_: self.visit(node.else_) --- 371,375 ---- self.nextBlock(anchor) self.emit('POP_BLOCK') ! self.setups.pop() if node.else_: self.visit(node.else_) *************** *** 372,376 **** def visitBreak(self, node): ! if not self.loops: raise SyntaxError, "'break' outside loop (%s, %d)" % \ (self.filename, node.lineno) --- 377,381 ---- def visitBreak(self, node): ! if not self.setups: raise SyntaxError, "'break' outside loop (%s, %d)" % \ (self.filename, node.lineno) *************** *** 379,389 **** def visitContinue(self, node): ! if not self.loops: raise SyntaxError, "'continue' outside loop (%s, %d)" % \ (self.filename, node.lineno) ! l = self.loops.top() ! self.set_lineno(node) ! self.emit('JUMP_ABSOLUTE', l) ! self.nextBlock() def visitTest(self, node, jump): --- 384,412 ---- def visitContinue(self, node): ! if not self.setups: raise SyntaxError, "'continue' outside loop (%s, %d)" % \ (self.filename, node.lineno) ! kind, block = self.setups.top() ! if kind == LOOP: ! self.set_lineno(node) ! self.emit('JUMP_ABSOLUTE', block) ! self.nextBlock() ! elif kind == EXCEPT or kind == TRY_FINALLY: ! self.set_lineno(node) ! # find the block that starts the loop ! top = len(self.setups) ! while top > 0: ! top = top - 1 ! kind, loop_block = self.setups[top] ! if kind == LOOP: ! break ! if kind != LOOP: ! raise SyntaxError, "'continue' outside loop (%s, %d)" % \ ! (self.filename, node.lineno) ! self.emit('CONTINUE_LOOP', loop_block) ! self.nextBlock() ! elif kind == END_FINALLY: ! msg = "'continue' not allowed inside 'finally' clause (%s, %d)" ! raise SyntaxError, msg % (self.filename, node.lineno) def visitTest(self, node, jump): *************** *** 530,533 **** --- 553,557 ---- def visitTryExcept(self, node): + body = self.newBlock() handlers = self.newBlock() end = self.newBlock() *************** *** 538,544 **** self.set_lineno(node) self.emit('SETUP_EXCEPT', handlers) ! self.nextBlock() self.visit(node.body) self.emit('POP_BLOCK') self.emit('JUMP_FORWARD', lElse) self.startBlock(handlers) --- 562,570 ---- self.set_lineno(node) self.emit('SETUP_EXCEPT', handlers) ! self.nextBlock(body) ! self.setups.push((EXCEPT, body)) self.visit(node.body) self.emit('POP_BLOCK') + self.setups.pop() self.emit('JUMP_FORWARD', lElse) self.startBlock(handlers) *************** *** 571,574 **** --- 597,601 ---- self.emit('POP_TOP') self.emit('END_FINALLY') + self.setups.pop() if node.else_: self.nextBlock(lElse) *************** *** 577,590 **** def visitTryFinally(self, node): final = self.newBlock() self.set_lineno(node) self.emit('SETUP_FINALLY', final) ! self.nextBlock() self.visit(node.body) self.emit('POP_BLOCK') self.emit('LOAD_CONST', None) self.nextBlock(final) self.visit(node.final) self.emit('END_FINALLY') # misc --- 604,622 ---- def visitTryFinally(self, node): + body = self.newBlock() final = self.newBlock() self.set_lineno(node) self.emit('SETUP_FINALLY', final) ! self.nextBlock(body) ! self.setups.push((TRY_FINALLY, body)) self.visit(node.body) self.emit('POP_BLOCK') + self.setups.pop() self.emit('LOAD_CONST', None) self.nextBlock(final) + self.setups.push((END_FINALLY, final)) self.visit(node.final) self.emit('END_FINALLY') + self.setups.pop() # misc From nascheme@users.sourceforge.net Thu Aug 30 00:44:23 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:44:23 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.55,1.56 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv1395 Modified Files: Makefile.pre.in Log Message: Always compile gcmodule. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Makefile.pre.in 2001/08/18 21:08:22 1.55 --- Makefile.pre.in 2001/08/29 23:44:21 1.56 *************** *** 160,164 **** Modules/config.o \ Modules/getpath.o \ ! Modules/main.o # Used of signalmodule.o is not available --- 160,165 ---- Modules/config.o \ Modules/getpath.o \ ! Modules/main.o \ ! Modules/gcmodule.o # Used of signalmodule.o is not available From nascheme@users.sourceforge.net Thu Aug 30 00:44:44 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:44:44 -0700 Subject: [Python-checkins] CVS: python/dist/src configure.in,1.248,1.249 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv1468 Modified Files: configure.in Log Message: Always compile gcmodule. Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.248 retrieving revision 1.249 diff -C2 -d -r1.248 -r1.249 *** configure.in 2001/08/17 18:39:24 1.248 --- configure.in 2001/08/29 23:44:38 1.249 *************** *** 1122,1127 **** # Check for GC support - AC_SUBST(USE_GC_MODULE) - USE_GC_MODULE="" AC_MSG_CHECKING(for --with-cycle-gc) AC_ARG_WITH(cycle-gc, --- 1122,1125 ---- *************** *** 1131,1138 **** then with_cycle_gc="yes" fi ! if test "$with_cycle_gc" = "no" then - USE_GC_MODULE="#" - else AC_DEFINE(WITH_CYCLE_GC) fi --- 1129,1134 ---- then with_cycle_gc="yes" fi ! if test "$with_cycle_gc" != "no" then AC_DEFINE(WITH_CYCLE_GC) fi From nascheme@users.sourceforge.net Thu Aug 30 00:45:27 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:45:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include frameobject.h,2.33,2.34 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv1702/Include Modified Files: frameobject.h Log Message: Make frames a PyVarObject instead of a PyObject. Index: frameobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/frameobject.h,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -d -r2.33 -r2.34 *** frameobject.h 2001/06/23 05:26:56 2.33 --- frameobject.h 2001/08/29 23:45:25 2.34 *************** *** 15,19 **** typedef struct _frame { ! PyObject_HEAD struct _frame *f_back; /* previous frame, or NULL */ PyCodeObject *f_code; /* code segment */ --- 15,19 ---- typedef struct _frame { ! PyObject_VAR_HEAD struct _frame *f_back; /* previous frame, or NULL */ PyCodeObject *f_code; /* code segment */ *************** *** 35,39 **** int f_iblock; /* index in f_blockstack */ PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */ - int f_size; /* size of localsplus */ int f_nlocals; /* number of locals */ int f_ncells; --- 35,38 ---- From nascheme@users.sourceforge.net Thu Aug 30 00:46:37 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:46:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include object.h,2.87,2.88 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv1991/Include Modified Files: object.h Log Message: Change the GC type flag since the API has changed. Allow types using the old flag to still compile. Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.87 retrieving revision 2.88 diff -C2 -d -r2.87 -r2.88 *** object.h 2001/08/24 16:51:42 2.87 --- object.h 2001/08/29 23:46:35 2.88 *************** *** 390,399 **** #define Py_TPFLAGS_HAVE_SEQUENCE_IN (1L<<1) ! /* Objects which participate in garbage collection (see objimp.h) */ ! #ifdef WITH_CYCLE_GC ! #define Py_TPFLAGS_GC (1L<<2) ! #else ! #define Py_TPFLAGS_GC 0 ! #endif /* PySequenceMethods and PyNumberMethods contain in-place operators */ --- 390,396 ---- #define Py_TPFLAGS_HAVE_SEQUENCE_IN (1L<<1) ! /* This is here for backwards compatibility. Extensions that use the old GC ! * API will still compile but the objects will not be tracked by the GC. */ ! #define Py_TPFLAGS_GC 0 /* used to be (1L<<2) */ /* PySequenceMethods and PyNumberMethods contain in-place operators */ *************** *** 429,432 **** --- 426,436 ---- /* Set while the type is being 'readied', to prevent recursive ready calls */ #define Py_TPFLAGS_READYING (1L<<13) + + /* Objects support garbage collection (see objimp.h) */ + #ifdef WITH_CYCLE_GC + #define Py_TPFLAGS_HAVE_GC (1L<<14) + #else + #define Py_TPFLAGS_HAVE_GC 0 + #endif #define Py_TPFLAGS_DEFAULT ( \ From nascheme@users.sourceforge.net Thu Aug 30 00:49:30 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:49:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include objimpl.h,2.36,2.37 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv2730/Include Modified Files: objimpl.h Log Message: Change the GC type flag since the API has changed. Allow types using the old flag to still compile. Remove the PyType_BASICSIZE and PyType_SET_BASICSIZE macros. Add PyObject_GC_New, PyObject_GC_NewVar, PyObject_GC_Resize, PyObject_GC_Del, PyObject_GC_Track, PyObject_GC_UnTrack. Part of SF patch #421893. Index: objimpl.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/objimpl.h,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -d -r2.36 -r2.37 *** objimpl.h 2001/08/03 13:03:24 2.36 --- objimpl.h 2001/08/29 23:49:28 2.37 *************** *** 220,287 **** */ ! /* To make a new object participate in garbage collection use ! PyObject_{New, VarNew, Del} to manage the memory. Set the type flag ! Py_TPFLAGS_GC and define the type method tp_traverse. You should also ! add the method tp_clear if your object is mutable. Include ! PyGC_HEAD_SIZE in the calculation of tp_basicsize. Call ! PyObject_GC_Init after the pointers followed by tp_traverse become ! valid (usually just before returning the object from the allocation ! method. Call PyObject_GC_Fini before those pointers become invalid ! (usually at the top of the deallocation method). */ ! ! #ifndef WITH_CYCLE_GC ! #define PyGC_HEAD_SIZE 0 ! #define PyObject_GC_Init(op) ! #define PyObject_GC_Fini(op) ! #define PyObject_AS_GC(op) (op) ! #define PyObject_FROM_GC(op) (op) ! #define PyType_IS_GC(t) 0 ! #define PyObject_IS_GC(o) 0 ! #define PyType_BASICSIZE(t) ((t)->tp_basicsize) ! #define PyType_SET_BASICSIZE(t, s) ((t)->tp_basicsize = (s)) ! #else ! /* Add the object into the container set */ ! extern DL_IMPORT(void) _PyGC_Insert(PyObject *); ! /* Remove the object from the container set */ ! extern DL_IMPORT(void) _PyGC_Remove(PyObject *); ! #define PyObject_GC_Init(op) _PyGC_Insert((PyObject *)op) ! #define PyObject_GC_Fini(op) _PyGC_Remove((PyObject *)op) ! /* Structure *prefixed* to container objects participating in GC */ typedef struct _gc_head { ! struct _gc_head *gc_next; struct _gc_head *gc_prev; int gc_refs; } PyGC_Head; ! #define PyGC_HEAD_SIZE sizeof(PyGC_Head) ! /* Test if a type has a GC head */ ! #define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_GC) ! /* Test if an object has a GC head */ ! #define PyObject_IS_GC(o) PyType_IS_GC((o)->ob_type) ! /* Get an object's GC head */ ! #define PyObject_AS_GC(o) ((PyGC_Head *)(o)-1) ! /* Get the object given the PyGC_Head */ ! #define PyObject_FROM_GC(g) ((PyObject *)(((PyGC_Head *)g)+1)) ! /* Calculate tp_basicsize excluding PyGC_HEAD_SIZE if applicable */ ! #define PyType_BASICSIZE(t) (!PyType_IS_GC(t) ? (t)->tp_basicsize : \ ! (t)->tp_basicsize - PyGC_HEAD_SIZE) ! #define PyType_SET_BASICSIZE(t, s) (!PyType_IS_GC(t) ? \ ! ((t)->tp_basicsize = (s)) : \ ! ((t)->tp_basicsize = (s) + PyGC_HEAD_SIZE)) ! extern DL_IMPORT(void) _PyGC_Dump(PyGC_Head *); ! #endif /* WITH_CYCLE_GC */ /* Test if a type supports weak references */ --- 220,303 ---- */ ! /* Test if a type has a GC head */ ! #define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC) ! /* Test if an object has a GC head */ ! #define PyObject_IS_GC(o) PyType_IS_GC((o)->ob_type) ! extern DL_IMPORT(PyObject *) _PyObject_GC_Malloc(PyTypeObject *, int); ! extern DL_IMPORT(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, int); ! #define PyObject_GC_Resize(type, op, n) \ ! ( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) ) ! #ifdef WITH_CYCLE_GC ! extern DL_IMPORT(PyObject *) _PyObject_GC_New(PyTypeObject *); ! extern DL_IMPORT(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, int); ! extern DL_IMPORT(void) _PyObject_GC_Del(PyObject *); ! extern DL_IMPORT(void) _PyObject_GC_Track(PyObject *); ! extern DL_IMPORT(void) _PyObject_GC_UnTrack(PyObject *); ! /* GC information is stored BEFORE the object structure */ typedef struct _gc_head { ! struct _gc_head *gc_next; /* not NULL if object is tracked */ struct _gc_head *gc_prev; int gc_refs; } PyGC_Head; ! extern PyGC_Head _PyGC_generation0; ! /* Tell the GC to track this object. NB: While the object is tracked the ! * collector it must be safe to call the ob_traverse method. */ ! #define _PyObject_GC_TRACK(o) do { \ ! PyGC_Head *g = (PyGC_Head *)(o)-1; \ ! if (g->gc_next != NULL) \ ! Py_FatalError("GC object already in linked list"); \ ! g->gc_next = &_PyGC_generation0; \ ! g->gc_prev = _PyGC_generation0.gc_prev; \ ! g->gc_prev->gc_next = g; \ ! _PyGC_generation0.gc_prev = g; \ ! } while (0); ! /* Tell the GC to stop tracking this object. */ ! #define _PyObject_GC_UNTRACK(o) do { \ ! PyGC_Head *g = (PyGC_Head *)(o)-1; \ ! g->gc_prev->gc_next = g->gc_next; \ ! g->gc_next->gc_prev = g->gc_prev; \ ! g->gc_next = NULL; \ ! } while (0); ! #define PyObject_GC_Track(op) _PyObject_GC_Track((PyObject *)op) ! #define PyObject_GC_UnTrack(op) _PyObject_GC_UnTrack((PyObject *)op) ! ! #define PyObject_GC_New(type, typeobj) \ ! ( (type *) _PyObject_GC_New(typeobj) ) ! #define PyObject_GC_NewVar(type, typeobj, n) \ ! ( (type *) _PyObject_GC_NewVar((typeobj), (n)) ) ! #define PyObject_GC_Del(op) _PyObject_GC_Del((PyObject *)(op)) ! #else /* !WITH_CYCLE_GC */ ! #define PyObject_GC_New PyObject_New ! #define PyObject_GC_NewVar PyObject_NewVar ! #define PyObject_GC_Del PyObject_Del ! #define PyObject_GC_TRACK(op) ! #define PyObject_GC_UNTRACK(op) ! #define PyObject_GC_Track(op) ! #define PyObject_GC_UnTrack(op) ! #endif ! ! /* This is here for the sake of backwards compatibility. Extensions that ! * use the old GC API will still compile but the objects will not be ! * tracked by the GC. */ ! #define PyGC_HEAD_SIZE 0 ! #define PyObject_GC_Init(op) ! #define PyObject_GC_Fini(op) ! #define PyObject_AS_GC(op) (op) ! #define PyObject_FROM_GC(op) (op) ! /* Test if a type supports weak references */ From nascheme@users.sourceforge.net Thu Aug 30 00:50:45 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:50:45 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules xreadlinesmodule.c,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv3016/Modules Modified Files: xreadlinesmodule.c Log Message: Remove bogus PyGC_HEAD_SIZE. Index: xreadlinesmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/xreadlinesmodule.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** xreadlinesmodule.c 2001/07/19 21:29:49 1.7 --- xreadlinesmodule.c 2001/08/29 23:50:42 1.8 *************** *** 137,141 **** 0, "xreadlines", ! sizeof(PyXReadlinesObject) + PyGC_HEAD_SIZE, 0, (destructor)xreadlines_dealloc, /* tp_dealloc */ --- 137,141 ---- 0, "xreadlines", ! sizeof(PyXReadlinesObject), 0, (destructor)xreadlines_dealloc, /* tp_dealloc */ From nascheme@users.sourceforge.net Thu Aug 30 00:50:04 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:50:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _weakref.c,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv2876/Modules Modified Files: _weakref.c Log Message: Use new GC API. Index: _weakref.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_weakref.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** _weakref.c 2001/08/16 14:11:30 1.12 --- _weakref.c 2001/08/29 23:50:02 1.13 *************** *** 39,43 **** } else { ! result = PyObject_NEW(PyWeakReference, &PyWeakReference_Type); } if (result) --- 39,43 ---- } else { ! result = PyObject_GC_New(PyWeakReference, &PyWeakReference_Type); } if (result) *************** *** 78,83 **** weakref_dealloc(PyWeakReference *self) { clear_weakref(self); - PyObject_GC_Fini((PyObject *)self); self->wr_next = free_list; free_list = self; --- 78,83 ---- weakref_dealloc(PyWeakReference *self) { + PyObject_GC_UnTrack((PyObject *)self); clear_weakref(self); self->wr_next = free_list; free_list = self; *************** *** 171,175 **** 0, "weakref", ! sizeof(PyWeakReference) + PyGC_HEAD_SIZE, 0, (destructor)weakref_dealloc,/*tp_dealloc*/ --- 171,175 ---- 0, "weakref", ! sizeof(PyWeakReference), 0, (destructor)weakref_dealloc,/*tp_dealloc*/ *************** *** 188,192 **** 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, 0, /*tp_doc*/ (traverseproc)gc_traverse, /*tp_traverse*/ --- 188,192 ---- 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, 0, /*tp_doc*/ (traverseproc)gc_traverse, /*tp_traverse*/ *************** *** 430,434 **** 0, "weakproxy", ! sizeof(PyWeakReference) + PyGC_HEAD_SIZE, 0, /* methods */ --- 430,434 ---- 0, "weakproxy", ! sizeof(PyWeakReference), 0, /* methods */ *************** *** 448,452 **** (setattrofunc)proxy_setattr,/*tp_setattro*/ 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC |Py_TPFLAGS_CHECKTYPES, /*tp_flags*/ 0, /*tp_doc*/ --- 448,452 ---- (setattrofunc)proxy_setattr,/*tp_setattro*/ 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |Py_TPFLAGS_CHECKTYPES, /*tp_flags*/ 0, /*tp_doc*/ *************** *** 461,465 **** 0, "weakcallableproxy", ! sizeof(PyWeakReference) + PyGC_HEAD_SIZE, 0, /* methods */ --- 461,465 ---- 0, "weakcallableproxy", ! sizeof(PyWeakReference), 0, /* methods */ *************** *** 479,483 **** (setattrofunc)proxy_setattr,/*tp_setattro*/ 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC |Py_TPFLAGS_CHECKTYPES, /*tp_flags*/ 0, /*tp_doc*/ --- 479,483 ---- (setattrofunc)proxy_setattr,/*tp_setattro*/ 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |Py_TPFLAGS_CHECKTYPES, /*tp_flags*/ 0, /*tp_doc*/ *************** *** 649,653 **** insert_after(result, prev); } ! PyObject_GC_Init((PyObject *) result); } } --- 649,653 ---- insert_after(result, prev); } ! PyObject_GC_Track(result); } } *************** *** 707,711 **** else insert_after(result, prev); ! PyObject_GC_Init((PyObject *) result); } } --- 707,711 ---- else insert_after(result, prev); ! PyObject_GC_Track(result); } } From nascheme@users.sourceforge.net Thu Aug 30 00:51:02 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:51:02 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects cellobject.c,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3072/Objects Modified Files: cellobject.c Log Message: Use new GC API. Index: cellobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/cellobject.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cellobject.c 2001/08/24 18:34:26 1.4 --- cellobject.c 2001/08/29 23:51:00 1.5 *************** *** 8,16 **** PyCellObject *op; ! op = (PyCellObject *)PyObject_New(PyCellObject, &PyCell_Type); op->ob_ref = obj; Py_XINCREF(obj); ! PyObject_GC_Init(op); return (PyObject *)op; } --- 8,16 ---- PyCellObject *op; ! op = (PyCellObject *)PyObject_GC_New(PyCellObject, &PyCell_Type); op->ob_ref = obj; Py_XINCREF(obj); ! _PyObject_GC_TRACK(op); return (PyObject *)op; } *************** *** 43,49 **** cell_dealloc(PyCellObject *op) { ! PyObject_GC_Fini(op); Py_XDECREF(op->ob_ref); ! PyObject_Del(op); } --- 43,49 ---- cell_dealloc(PyCellObject *op) { ! _PyObject_GC_UNTRACK(op); Py_XDECREF(op->ob_ref); ! PyObject_GC_Del(op); } *************** *** 91,95 **** 0, "cell", ! sizeof(PyCellObject) + PyGC_HEAD_SIZE, 0, (destructor)cell_dealloc, /* tp_dealloc */ --- 91,95 ---- 0, "cell", ! sizeof(PyCellObject), 0, (destructor)cell_dealloc, /* tp_dealloc */ *************** *** 108,112 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)cell_traverse, /* tp_traverse */ --- 108,112 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ (traverseproc)cell_traverse, /* tp_traverse */ From nascheme@users.sourceforge.net Thu Aug 30 00:51:43 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:51:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects classobject.c,2.142,2.143 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3223/Objects Modified Files: classobject.c Log Message: Use new GC API. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.142 retrieving revision 2.143 diff -C2 -d -r2.142 -r2.143 *** classobject.c 2001/08/24 18:48:27 2.142 --- classobject.c 2001/08/29 23:51:41 2.143 *************** *** 82,86 **** Py_INCREF(bases); } ! op = PyObject_NEW(PyClassObject, &PyClass_Type); if (op == NULL) { Py_DECREF(bases); --- 82,86 ---- Py_INCREF(bases); } ! op = PyObject_GC_New(PyClassObject, &PyClass_Type); if (op == NULL) { Py_DECREF(bases); *************** *** 103,107 **** Py_XINCREF(op->cl_setattr); Py_XINCREF(op->cl_delattr); ! PyObject_GC_Init(op); return (PyObject *) op; } --- 103,107 ---- Py_XINCREF(op->cl_setattr); Py_XINCREF(op->cl_delattr); ! _PyObject_GC_TRACK(op); return (PyObject *) op; } *************** *** 124,128 **** class_dealloc(PyClassObject *op) { ! PyObject_GC_Fini(op); Py_DECREF(op->cl_bases); Py_DECREF(op->cl_dict); --- 124,128 ---- class_dealloc(PyClassObject *op) { ! _PyObject_GC_UNTRACK(op); Py_DECREF(op->cl_bases); Py_DECREF(op->cl_dict); *************** *** 131,136 **** Py_XDECREF(op->cl_setattr); Py_XDECREF(op->cl_delattr); ! op = (PyClassObject *) PyObject_AS_GC(op); ! PyObject_DEL(op); } --- 131,135 ---- Py_XDECREF(op->cl_setattr); Py_XDECREF(op->cl_delattr); ! PyObject_GC_Del(op); } *************** *** 395,399 **** 0, "class", ! sizeof(PyClassObject) + PyGC_HEAD_SIZE, 0, (destructor)class_dealloc, /* tp_dealloc */ --- 394,398 ---- 0, "class", ! sizeof(PyClassObject), 0, (destructor)class_dealloc, /* tp_dealloc */ *************** *** 412,416 **** (setattrofunc)class_setattr, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)class_traverse, /* tp_traverse */ --- 411,415 ---- (setattrofunc)class_setattr, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ (traverseproc)class_traverse, /* tp_traverse */ *************** *** 475,479 **** Py_INCREF(dict); } ! inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); if (inst == NULL) { Py_DECREF(dict); --- 474,478 ---- Py_INCREF(dict); } ! inst = PyObject_GC_New(PyInstanceObject, &PyInstance_Type); if (inst == NULL) { Py_DECREF(dict); *************** *** 484,488 **** inst->in_class = (PyClassObject *)klass; inst->in_dict = dict; ! PyObject_GC_Init(inst); return (PyObject *)inst; } --- 483,487 ---- inst->in_class = (PyClassObject *)klass; inst->in_dict = dict; ! _PyObject_GC_TRACK(inst); return (PyObject *)inst; } *************** *** 543,547 **** extern long _Py_RefTotal; #endif ! PyObject_ClearWeakRefs((PyObject *) inst); --- 542,546 ---- extern long _Py_RefTotal; #endif ! _PyObject_GC_UNTRACK(inst); PyObject_ClearWeakRefs((PyObject *) inst); *************** *** 593,596 **** --- 592,596 ---- inst->ob_type->tp_frees--; #endif + _PyObject_GC_TRACK(inst); return; /* __del__ added a reference; don't delete now */ } *************** *** 605,613 **** #endif #endif - PyObject_GC_Fini(inst); Py_DECREF(inst->in_class); Py_XDECREF(inst->in_dict); ! inst = (PyInstanceObject *) PyObject_AS_GC(inst); ! PyObject_DEL(inst); } --- 605,611 ---- #endif #endif Py_DECREF(inst->in_class); Py_XDECREF(inst->in_dict); ! PyObject_GC_Del(inst); } *************** *** 1897,1901 **** 0, "instance", ! sizeof(PyInstanceObject) + PyGC_HEAD_SIZE, 0, (destructor)instance_dealloc, /* tp_dealloc */ --- 1895,1899 ---- 0, "instance", ! sizeof(PyInstanceObject), 0, (destructor)instance_dealloc, /* tp_dealloc */ *************** *** 1914,1918 **** (setattrofunc)instance_setattr, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC | Py_TPFLAGS_CHECKTYPES,/*tp_flags*/ 0, /* tp_doc */ (traverseproc)instance_traverse, /* tp_traverse */ --- 1912,1916 ---- (setattrofunc)instance_setattr, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_CHECKTYPES,/*tp_flags*/ 0, /* tp_doc */ (traverseproc)instance_traverse, /* tp_traverse */ *************** *** 1947,1951 **** } else { ! im = PyObject_NEW(PyMethodObject, &PyMethod_Type); if (im == NULL) return NULL; --- 1945,1949 ---- } else { ! im = PyObject_GC_New(PyMethodObject, &PyMethod_Type); if (im == NULL) return NULL; *************** *** 1958,1962 **** Py_XINCREF(class); im->im_class = class; ! PyObject_GC_Init(im); return (PyObject *)im; } --- 1956,1960 ---- Py_XINCREF(class); im->im_class = class; ! _PyObject_GC_TRACK(im); return (PyObject *)im; } *************** *** 2019,2024 **** instancemethod_dealloc(register PyMethodObject *im) { PyObject_ClearWeakRefs((PyObject *)im); - PyObject_GC_Fini(im); Py_DECREF(im->im_func); Py_XDECREF(im->im_self); --- 2017,2022 ---- instancemethod_dealloc(register PyMethodObject *im) { + _PyObject_GC_UNTRACK(im); PyObject_ClearWeakRefs((PyObject *)im); Py_DECREF(im->im_func); Py_XDECREF(im->im_self); *************** *** 2245,2249 **** 0, "instance method", ! sizeof(PyMethodObject) + PyGC_HEAD_SIZE, 0, (destructor)instancemethod_dealloc, /* tp_dealloc */ --- 2243,2247 ---- 0, "instance method", ! sizeof(PyMethodObject), 0, (destructor)instancemethod_dealloc, /* tp_dealloc */ *************** *** 2262,2266 **** (setattrofunc)instancemethod_setattro, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)instancemethod_traverse, /* tp_traverse */ --- 2260,2264 ---- (setattrofunc)instancemethod_setattro, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ (traverseproc)instancemethod_traverse, /* tp_traverse */ *************** *** 2288,2293 **** PyMethodObject *im = free_list; free_list = (PyMethodObject *)(im->im_self); ! im = (PyMethodObject *) PyObject_AS_GC(im); ! PyObject_DEL(im); } } --- 2286,2290 ---- PyMethodObject *im = free_list; free_list = (PyMethodObject *)(im->im_self); ! PyObject_GC_Del(im); } } From nascheme@users.sourceforge.net Thu Aug 30 00:51:54 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:51:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects dictobject.c,2.109,2.110 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3263/Objects Modified Files: dictobject.c Log Message: Use new GC API. Index: dictobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v retrieving revision 2.109 retrieving revision 2.110 diff -C2 -d -r2.109 -r2.110 *** dictobject.c 2001/08/16 13:15:00 2.109 --- dictobject.c 2001/08/29 23:51:52 2.110 *************** *** 159,163 **** #endif } ! mp = PyObject_NEW(dictobject, &PyDict_Type); if (mp == NULL) return NULL; --- 159,163 ---- #endif } ! mp = PyObject_GC_New(dictobject, &PyDict_Type); if (mp == NULL) return NULL; *************** *** 167,171 **** ++created; #endif ! PyObject_GC_Init(mp); return (PyObject *)mp; } --- 167,171 ---- ++created; #endif ! _PyObject_GC_TRACK(mp); return (PyObject *)mp; } *************** *** 693,697 **** int fill = mp->ma_fill; Py_TRASHCAN_SAFE_BEGIN(mp) ! PyObject_GC_Fini(mp); for (ep = mp->ma_table; fill > 0; ep++) { if (ep->me_key) { --- 693,697 ---- int fill = mp->ma_fill; Py_TRASHCAN_SAFE_BEGIN(mp) ! _PyObject_GC_UNTRACK(mp); for (ep = mp->ma_table; fill > 0; ep++) { if (ep->me_key) { *************** *** 703,708 **** if (mp->ma_table != mp->ma_smalltable) PyMem_DEL(mp->ma_table); ! mp = (dictobject *) PyObject_AS_GC(mp); ! PyObject_DEL(mp); Py_TRASHCAN_SAFE_END(mp) } --- 703,707 ---- if (mp->ma_table != mp->ma_smalltable) PyMem_DEL(mp->ma_table); ! PyObject_GC_Del(mp); Py_TRASHCAN_SAFE_END(mp) } *************** *** 1704,1708 **** 0, "dictionary", ! sizeof(dictobject) + PyGC_HEAD_SIZE, 0, (destructor)dict_dealloc, /* tp_dealloc */ --- 1703,1707 ---- 0, "dictionary", ! sizeof(dictobject), 0, (destructor)dict_dealloc, /* tp_dealloc */ *************** *** 1721,1725 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC | Py_TPFLAGS_BASETYPE, /* tp_flags */ "dictionary type", /* tp_doc */ --- 1720,1724 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /* tp_flags */ "dictionary type", /* tp_doc */ From nascheme@users.sourceforge.net Thu Aug 30 00:52:20 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:52:20 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects frameobject.c,2.54,2.55 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3356/Objects Modified Files: frameobject.c Log Message: Make frames a PyVarObject. Use new GC API. Index: frameobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -d -r2.54 -r2.55 *** frameobject.c 2001/08/02 04:15:00 2.54 --- frameobject.c 2001/08/29 23:52:17 2.55 *************** *** 48,52 **** f_nlocals number of locals f_stacksize size of value stack ! f_size size of localsplus Note that the value and block stacks are preserved -- this can save another malloc() call or two (and two free() calls as well!). --- 48,52 ---- f_nlocals number of locals f_stacksize size of value stack ! ob_size size of localsplus Note that the value and block stacks are preserved -- this can save another malloc() call or two (and two free() calls as well!). *************** *** 69,73 **** Py_TRASHCAN_SAFE_BEGIN(f) ! PyObject_GC_Fini(f); /* Kill all local variables */ slots = f->f_nlocals + f->f_ncells + f->f_nfreevars; --- 69,73 ---- Py_TRASHCAN_SAFE_BEGIN(f) ! _PyObject_GC_UNTRACK(f); /* Kill all local variables */ slots = f->f_nlocals + f->f_ncells + f->f_nfreevars; *************** *** 126,130 **** VISIT(*p); } - return 0; } --- 126,129 ---- *************** *** 172,177 **** 0, "frame", ! sizeof(PyFrameObject) + PyGC_HEAD_SIZE, ! 0, (destructor)frame_dealloc, /* tp_dealloc */ 0, /* tp_print */ --- 171,176 ---- 0, "frame", ! sizeof(PyFrameObject), ! sizeof(PyObject *), (destructor)frame_dealloc, /* tp_dealloc */ 0, /* tp_print */ *************** *** 189,193 **** PyObject_GenericSetAttr, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)frame_traverse, /* tp_traverse */ --- 188,192 ---- PyObject_GenericSetAttr, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ (traverseproc)frame_traverse, /* tp_traverse */ *************** *** 242,273 **** builtins = NULL; if (free_list == NULL) { ! /* PyObject_New is inlined */ ! f = (PyFrameObject *) ! PyObject_MALLOC(sizeof(PyFrameObject) + ! extras*sizeof(PyObject *) + ! PyGC_HEAD_SIZE); if (f == NULL) ! return (PyFrameObject *)PyErr_NoMemory(); ! f = (PyFrameObject *) PyObject_FROM_GC(f); ! PyObject_INIT(f, &PyFrame_Type); ! f->f_size = extras; } else { f = free_list; free_list = free_list->f_back; ! if (f->f_size < extras) { ! f = (PyFrameObject *) PyObject_AS_GC(f); ! f = (PyFrameObject *) ! PyObject_REALLOC(f, sizeof(PyFrameObject) + ! extras*sizeof(PyObject *) + ! PyGC_HEAD_SIZE); if (f == NULL) ! return (PyFrameObject *)PyErr_NoMemory(); ! f = (PyFrameObject *) PyObject_FROM_GC(f); ! f->f_size = extras; } else ! extras = f->f_size; ! PyObject_INIT(f, &PyFrame_Type); } if (builtins == NULL) { --- 241,259 ---- builtins = NULL; if (free_list == NULL) { ! f = PyObject_GC_NewVar(PyFrameObject, &PyFrame_Type, extras); if (f == NULL) ! return NULL; } else { f = free_list; free_list = free_list->f_back; ! if (f->ob_size < extras) { ! f = PyObject_GC_Resize(PyFrameObject, f, extras); if (f == NULL) ! return NULL; } else ! extras = f->ob_size; ! _Py_NewReference(f); } if (builtins == NULL) { *************** *** 324,329 **** f->f_valuestack = f->f_localsplus + (f->f_nlocals + ncells + nfrees); f->f_stacktop = f->f_valuestack; ! ! PyObject_GC_Init(f); return f; } --- 310,314 ---- f->f_valuestack = f->f_localsplus + (f->f_nlocals + ncells + nfrees); f->f_stacktop = f->f_valuestack; ! _PyObject_GC_TRACK(f); return f; } *************** *** 487,492 **** PyFrameObject *f = free_list; free_list = free_list->f_back; ! f = (PyFrameObject *) PyObject_AS_GC(f); ! PyObject_DEL(f); } } --- 472,476 ---- PyFrameObject *f = free_list; free_list = free_list->f_back; ! PyObject_GC_Del(f); } } From nascheme@users.sourceforge.net Thu Aug 30 00:52:54 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:52:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects listobject.c,2.99,2.100 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3614/Objects Modified Files: listobject.c Log Message: Use new GC API. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.99 retrieving revision 2.100 diff -C2 -d -r2.99 -r2.100 *** listobject.c 2001/08/16 13:15:00 2.99 --- listobject.c 2001/08/29 23:52:52 2.100 *************** *** 62,72 **** return PyErr_NoMemory(); } ! /* PyObject_NewVar is inlined */ ! op = (PyListObject *) PyObject_MALLOC(sizeof(PyListObject) ! + PyGC_HEAD_SIZE); if (op == NULL) { ! return PyErr_NoMemory(); } - op = (PyListObject *) PyObject_FROM_GC(op); if (size <= 0) { op->ob_item = NULL; --- 62,69 ---- return PyErr_NoMemory(); } ! op = PyObject_GC_New(PyListObject, &PyList_Type); if (op == NULL) { ! return NULL; } if (size <= 0) { op->ob_item = NULL; *************** *** 75,86 **** op->ob_item = (PyObject **) PyMem_MALLOC(nbytes); if (op->ob_item == NULL) { - PyObject_FREE(PyObject_AS_GC(op)); return PyErr_NoMemory(); } } ! PyObject_INIT_VAR(op, &PyList_Type, size); for (i = 0; i < size; i++) op->ob_item[i] = NULL; ! PyObject_GC_Init(op); return (PyObject *) op; } --- 72,82 ---- op->ob_item = (PyObject **) PyMem_MALLOC(nbytes); if (op->ob_item == NULL) { return PyErr_NoMemory(); } } ! op->ob_size = size; for (i = 0; i < size; i++) op->ob_item[i] = NULL; ! _PyObject_GC_TRACK(op); return (PyObject *) op; } *************** *** 201,205 **** int i; Py_TRASHCAN_SAFE_BEGIN(op) ! PyObject_GC_Fini(op); if (op->ob_item != NULL) { /* Do it backwards, for Christian Tismer. --- 197,201 ---- int i; Py_TRASHCAN_SAFE_BEGIN(op) ! _PyObject_GC_UNTRACK(op); if (op->ob_item != NULL) { /* Do it backwards, for Christian Tismer. *************** *** 213,218 **** PyMem_FREE(op->ob_item); } ! op = (PyListObject *) PyObject_AS_GC(op); ! PyObject_DEL(op); Py_TRASHCAN_SAFE_END(op) } --- 209,213 ---- PyMem_FREE(op->ob_item); } ! PyObject_GC_Del(op); Py_TRASHCAN_SAFE_END(op) } *************** *** 1676,1680 **** 0, "list", ! sizeof(PyListObject) + PyGC_HEAD_SIZE, 0, (destructor)list_dealloc, /* tp_dealloc */ --- 1671,1675 ---- 0, "list", ! sizeof(PyListObject), 0, (destructor)list_dealloc, /* tp_dealloc */ *************** *** 1693,1697 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC | Py_TPFLAGS_BASETYPE, /* tp_flags */ list_doc, /* tp_doc */ --- 1688,1692 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /* tp_flags */ list_doc, /* tp_doc */ *************** *** 1763,1767 **** 0, "list (immutable, during sort)", ! sizeof(PyListObject) + PyGC_HEAD_SIZE, 0, 0, /* Cannot happen */ /* tp_dealloc */ --- 1758,1762 ---- 0, "list (immutable, during sort)", ! sizeof(PyListObject), 0, 0, /* Cannot happen */ /* tp_dealloc */ *************** *** 1780,1784 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ list_doc, /* tp_doc */ (traverseproc)list_traverse, /* tp_traverse */ --- 1775,1779 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ list_doc, /* tp_doc */ (traverseproc)list_traverse, /* tp_traverse */ From nascheme@users.sourceforge.net Thu Aug 30 00:52:34 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:52:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects funcobject.c,2.41,2.42 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3402/Objects Modified Files: funcobject.c Log Message: Use new GC API. Index: funcobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/funcobject.c,v retrieving revision 2.41 retrieving revision 2.42 diff -C2 -d -r2.41 -r2.42 *** funcobject.c 2001/08/24 18:34:26 2.41 --- funcobject.c 2001/08/29 23:52:31 2.42 *************** *** 10,14 **** PyFunction_New(PyObject *code, PyObject *globals) { ! PyFunctionObject *op = PyObject_NEW(PyFunctionObject, &PyFunction_Type); if (op != NULL) { --- 10,14 ---- PyFunction_New(PyObject *code, PyObject *globals) { ! PyFunctionObject *op = PyObject_GC_New(PyFunctionObject, &PyFunction_Type); if (op != NULL) { *************** *** 38,42 **** else return NULL; ! PyObject_GC_Init(op); return (PyObject *)op; } --- 38,42 ---- else return NULL; ! _PyObject_GC_TRACK(op); return (PyObject *)op; } *************** *** 224,229 **** func_dealloc(PyFunctionObject *op) { PyObject_ClearWeakRefs((PyObject *) op); - PyObject_GC_Fini(op); Py_DECREF(op->func_code); Py_DECREF(op->func_globals); --- 224,229 ---- func_dealloc(PyFunctionObject *op) { + _PyObject_GC_UNTRACK(op); PyObject_ClearWeakRefs((PyObject *) op); Py_DECREF(op->func_code); Py_DECREF(op->func_globals); *************** *** 233,238 **** Py_XDECREF(op->func_dict); Py_XDECREF(op->func_closure); ! op = (PyFunctionObject *) PyObject_AS_GC(op); ! PyObject_DEL(op); } --- 233,237 ---- Py_XDECREF(op->func_dict); Py_XDECREF(op->func_closure); ! PyObject_GC_Del(op); } *************** *** 353,357 **** 0, "function", ! sizeof(PyFunctionObject) + PyGC_HEAD_SIZE, 0, (destructor)func_dealloc, /* tp_dealloc */ --- 352,356 ---- 0, "function", ! sizeof(PyFunctionObject), 0, (destructor)func_dealloc, /* tp_dealloc */ *************** *** 370,374 **** func_setattro, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)func_traverse, /* tp_traverse */ --- 369,373 ---- func_setattro, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ 0, /* tp_doc */ (traverseproc)func_traverse, /* tp_traverse */ From nascheme@users.sourceforge.net Thu Aug 30 00:53:11 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:53:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects moduleobject.c,2.36,2.37 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3870/Objects Modified Files: moduleobject.c Log Message: Use new GC API. Index: moduleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/moduleobject.c,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -d -r2.36 -r2.37 *** moduleobject.c 2001/08/24 18:34:26 2.36 --- moduleobject.c 2001/08/29 23:53:09 2.37 *************** *** 20,29 **** PyModuleObject *m; PyObject *nameobj; ! m = PyObject_NEW(PyModuleObject, &PyModule_Type); if (m == NULL) return NULL; nameobj = PyString_FromString(name); m->md_dict = PyDict_New(); - PyObject_GC_Init(m); if (m->md_dict == NULL || nameobj == NULL) goto fail; --- 20,28 ---- PyModuleObject *m; PyObject *nameobj; ! m = PyObject_GC_New(PyModuleObject, &PyModule_Type); if (m == NULL) return NULL; nameobj = PyString_FromString(name); m->md_dict = PyDict_New(); if (m->md_dict == NULL || nameobj == NULL) goto fail; *************** *** 33,36 **** --- 32,36 ---- goto fail; Py_DECREF(nameobj); + PyObject_GC_Track(m); return (PyObject *)m; *************** *** 147,156 **** module_dealloc(PyModuleObject *m) { ! PyObject_GC_Fini(m); if (m->md_dict != NULL) { _PyModule_Clear((PyObject *)m); Py_DECREF(m->md_dict); } ! PyObject_DEL(PyObject_AS_GC(m)); } --- 147,156 ---- module_dealloc(PyModuleObject *m) { ! PyObject_GC_UnTrack(m); if (m->md_dict != NULL) { _PyModule_Clear((PyObject *)m); Py_DECREF(m->md_dict); } ! PyObject_GC_Del(m); } *************** *** 189,193 **** 0, /* ob_size */ "module", /* tp_name */ ! sizeof(PyModuleObject) + PyGC_HEAD_SIZE, /* tp_size */ 0, /* tp_itemsize */ (destructor)module_dealloc, /* tp_dealloc */ --- 189,193 ---- 0, /* ob_size */ "module", /* tp_name */ ! sizeof(PyModuleObject), /* tp_size */ 0, /* tp_itemsize */ (destructor)module_dealloc, /* tp_dealloc */ *************** *** 206,210 **** PyObject_GenericSetAttr, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC | Py_TPFLAGS_BASETYPE, /* tp_flags */ 0, /* tp_doc */ --- 206,210 ---- PyObject_GenericSetAttr, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /* tp_flags */ 0, /* tp_doc */ From nascheme@users.sourceforge.net Thu Aug 30 00:54:05 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:54:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects object.c,2.140,2.141 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv4466/Objects Modified Files: object.c Log Message: Remove GC related code. It lives in gcmodule now. Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.140 retrieving revision 2.141 diff -C2 -d -r2.140 -r2.141 *** object.c 2001/08/24 18:34:26 2.140 --- object.c 2001/08/29 23:54:03 2.141 *************** *** 94,99 **** return op; } - if (PyType_IS_GC(tp)) - op = (PyObject *) PyObject_FROM_GC(op); /* Any changes should be reflected in PyObject_INIT (objimpl.h) */ op->ob_type = tp; --- 94,97 ---- *************** *** 110,115 **** return op; } - if (PyType_IS_GC(tp)) - op = (PyVarObject *) PyObject_FROM_GC(op); /* Any changes should be reflected in PyObject_INIT_VAR */ op->ob_size = size; --- 108,111 ---- *************** *** 126,131 **** if (op == NULL) return PyErr_NoMemory(); - if (PyType_IS_GC(tp)) - op = (PyObject *) PyObject_FROM_GC(op); return PyObject_INIT(op, tp); } --- 122,125 ---- *************** *** 138,143 **** if (op == NULL) return (PyVarObject *)PyErr_NoMemory(); - if (PyType_IS_GC(tp)) - op = (PyVarObject *) PyObject_FROM_GC(op); return PyObject_INIT_VAR(op, tp, size); } --- 132,135 ---- *************** *** 146,161 **** _PyObject_Del(PyObject *op) { - if (op && PyType_IS_GC(op->ob_type)) { - op = (PyObject *) PyObject_AS_GC(op); - } PyObject_FREE(op); } - #ifndef WITH_CYCLE_GC - /* extension modules might need these */ - void _PyGC_Insert(PyObject *op) { } - void _PyGC_Remove(PyObject *op) { } - #endif - int PyObject_Print(PyObject *op, FILE *fp, int flags) --- 138,144 ---- *************** *** 216,227 **** } - #ifdef WITH_CYCLE_GC - void _PyGC_Dump(PyGC_Head* op) - { - _PyObject_Dump(PyObject_FROM_GC(op)); - } - #endif /* WITH_CYCLE_GC */ - - PyObject * PyObject_Repr(PyObject *v) --- 199,202 ---- *************** *** 1147,1151 **** return NULL; if (dictoffset < 0) { ! dictoffset += PyType_BASICSIZE(tp); assert(dictoffset > 0); /* Sanity check */ if (tp->tp_itemsize > 0) { --- 1122,1126 ---- return NULL; if (dictoffset < 0) { ! dictoffset += tp->tp_basicsize; assert(dictoffset > 0); /* Sanity check */ if (tp->tp_itemsize > 0) { From nascheme@users.sourceforge.net Thu Aug 30 00:54:23 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:54:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects tupleobject.c,2.54,2.55 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv4717/Objects Modified Files: tupleobject.c Log Message: Use new GC API. Index: tupleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -d -r2.54 -r2.55 *** tupleobject.c 2001/08/02 04:15:00 2.54 --- tupleobject.c 2001/08/29 23:54:21 2.55 *************** *** 63,78 **** /* Check for overflow */ if (nbytes / sizeof(PyObject *) != (size_t)size || ! (nbytes += sizeof(PyTupleObject) - sizeof(PyObject *) ! + PyGC_HEAD_SIZE) <= 0) { return PyErr_NoMemory(); } ! /* PyObject_NewVar is inlined */ ! op = (PyTupleObject *) PyObject_MALLOC(nbytes); if (op == NULL) ! return PyErr_NoMemory(); ! op = (PyTupleObject *) PyObject_FROM_GC(op); ! PyObject_INIT_VAR(op, &PyTuple_Type, size); } for (i = 0; i < size; i++) --- 63,74 ---- /* Check for overflow */ if (nbytes / sizeof(PyObject *) != (size_t)size || ! (nbytes += sizeof(PyTupleObject) - sizeof(PyObject *)) <= 0) { return PyErr_NoMemory(); } ! op = PyObject_GC_NewVar(PyTupleObject, &PyTuple_Type, size); if (op == NULL) ! return NULL; } for (i = 0; i < size; i++) *************** *** 85,89 **** } #endif ! PyObject_GC_Init(op); return (PyObject *) op; } --- 81,85 ---- } #endif ! _PyObject_GC_TRACK(op); return (PyObject *) op; } *************** *** 145,149 **** register int len = op->ob_size; Py_TRASHCAN_SAFE_BEGIN(op) ! PyObject_GC_Fini(op); if (len > 0) { i = len; --- 141,145 ---- register int len = op->ob_size; Py_TRASHCAN_SAFE_BEGIN(op) ! _PyObject_GC_UNTRACK(op); if (len > 0) { i = len; *************** *** 159,164 **** #endif } ! op = (PyTupleObject *) PyObject_AS_GC(op); ! PyObject_DEL(op); done: Py_TRASHCAN_SAFE_END(op) --- 155,159 ---- #endif } ! PyObject_GC_Del(op); done: Py_TRASHCAN_SAFE_END(op) *************** *** 518,522 **** 0, "tuple", ! sizeof(PyTupleObject) - sizeof(PyObject *) + PyGC_HEAD_SIZE, sizeof(PyObject *), (destructor)tupledealloc, /* tp_dealloc */ --- 513,517 ---- 0, "tuple", ! sizeof(PyTupleObject) - sizeof(PyObject *), sizeof(PyObject *), (destructor)tupledealloc, /* tp_dealloc */ *************** *** 535,539 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /* tp_flags */ tuple_doc, /* tp_doc */ (traverseproc)tupletraverse, /* tp_traverse */ --- 530,534 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ tuple_doc, /* tp_doc */ (traverseproc)tupletraverse, /* tp_traverse */ *************** *** 596,599 **** --- 591,595 ---- --_Py_RefTotal; #endif + _PyObject_GC_UNTRACK(v); _Py_ForgetReference((PyObject *) v); for (i = newsize; i < v->ob_size; i++) { *************** *** 601,623 **** v->ob_item[i] = NULL; } ! PyObject_GC_Fini(v); ! v = (PyTupleObject *) PyObject_AS_GC(v); ! sv = (PyTupleObject *) PyObject_REALLOC((char *)v, ! sizeof(PyTupleObject) ! + PyGC_HEAD_SIZE ! + newsize * sizeof(PyObject *)); if (sv == NULL) { *pv = NULL; ! PyObject_DEL(v); ! PyErr_NoMemory(); return -1; } - sv = (PyTupleObject *) PyObject_FROM_GC(sv); _Py_NewReference((PyObject *) sv); for (i = sv->ob_size; i < newsize; i++) sv->ob_item[i] = NULL; - sv->ob_size = newsize; *pv = (PyObject *) sv; ! PyObject_GC_Init(sv); return 0; } --- 597,611 ---- v->ob_item[i] = NULL; } ! sv = PyObject_GC_Resize(PyTupleObject, v, newsize); if (sv == NULL) { *pv = NULL; ! PyObject_GC_Del(v); return -1; } _Py_NewReference((PyObject *) sv); for (i = sv->ob_size; i < newsize; i++) sv->ob_item[i] = NULL; *pv = (PyObject *) sv; ! _PyObject_GC_TRACK(sv); return 0; } *************** *** 639,644 **** q = p; p = (PyTupleObject *)(p->ob_item[0]); ! q = (PyTupleObject *) PyObject_AS_GC(q); ! PyObject_DEL(q); } } --- 627,631 ---- q = p; p = (PyTupleObject *)(p->ob_item[0]); ! PyObject_GC_Del(q); } } From nascheme@users.sourceforge.net Thu Aug 30 00:54:56 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:54:56 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.50,2.51 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv5218/Objects Modified Files: typeobject.c Log Message: Use new GC API. Remove usage of BASICSIZE macros. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.50 retrieving revision 2.51 diff -C2 -d -r2.50 -r2.51 *** typeobject.c 2001/08/29 15:47:06 2.50 --- typeobject.c 2001/08/29 23:54:54 2.51 *************** *** 168,184 **** { int size; - void *mem; PyObject *obj; /* Inline PyObject_New() so we can zero the memory */ size = _PyObject_VAR_SIZE(type, nitems); ! mem = PyObject_MALLOC(size); ! if (mem == NULL) return PyErr_NoMemory(); ! memset(mem, '\0', size); ! if (PyType_IS_GC(type)) ! obj = PyObject_FROM_GC(mem); ! else ! obj = (PyObject *)mem; if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) Py_INCREF(type); --- 168,184 ---- { int size; PyObject *obj; /* Inline PyObject_New() so we can zero the memory */ size = _PyObject_VAR_SIZE(type, nitems); ! if (PyType_IS_GC(type)) { ! obj = _PyObject_GC_Malloc(type, nitems); ! } ! else { ! obj = PyObject_MALLOC(size); ! } ! if (obj == NULL) return PyErr_NoMemory(); ! memset(obj, '\0', size); if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) Py_INCREF(type); *************** *** 188,192 **** (void) PyObject_INIT_VAR((PyVarObject *)obj, type, nitems); if (PyType_IS_GC(type)) ! PyObject_GC_Init(obj); return obj; } --- 188,192 ---- (void) PyObject_INIT_VAR((PyVarObject *)obj, type, nitems); if (PyType_IS_GC(type)) ! _PyObject_GC_TRACK(obj); return obj; } *************** *** 543,548 **** extra_ivars(PyTypeObject *type, PyTypeObject *base) { ! size_t t_size = PyType_BASICSIZE(type); ! size_t b_size = PyType_BASICSIZE(base); assert(t_size >= b_size); /* Else type smaller than base! */ --- 543,548 ---- extra_ivars(PyTypeObject *type, PyTypeObject *base) { ! size_t t_size = type->tp_basicsize; ! size_t b_size = base->tp_basicsize; assert(t_size >= b_size); /* Else type smaller than base! */ *************** *** 807,811 **** /* Add descriptors for custom slots from __slots__, or for __dict__ */ mp = et->members; ! slotoffset = PyType_BASICSIZE(base); if (slots != NULL) { for (i = 0; i < nslots; i++, mp++) { --- 807,811 ---- /* Add descriptors for custom slots from __slots__, or for __dict__ */ mp = et->members; ! slotoffset = base->tp_basicsize; if (slots != NULL) { for (i = 0; i < nslots; i++, mp++) { *************** *** 1242,1252 **** /* Copying basicsize is connected to the GC flags */ ! oldsize = PyType_BASICSIZE(base); ! newsize = type->tp_basicsize ? PyType_BASICSIZE(type) : oldsize; ! if (!(type->tp_flags & Py_TPFLAGS_GC) && ! (base->tp_flags & Py_TPFLAGS_GC) && (type->tp_flags & Py_TPFLAGS_HAVE_RICHCOMPARE/*GC slots exist*/) && (!type->tp_traverse && !type->tp_clear)) { ! type->tp_flags |= Py_TPFLAGS_GC; if (type->tp_traverse == NULL) type->tp_traverse = base->tp_traverse; --- 1242,1252 ---- /* Copying basicsize is connected to the GC flags */ ! oldsize = base->tp_basicsize; ! newsize = type->tp_basicsize ? type->tp_basicsize : oldsize; ! if (!(type->tp_flags & Py_TPFLAGS_HAVE_GC) && ! (base->tp_flags & Py_TPFLAGS_HAVE_GC) && (type->tp_flags & Py_TPFLAGS_HAVE_RICHCOMPARE/*GC slots exist*/) && (!type->tp_traverse && !type->tp_clear)) { ! type->tp_flags |= Py_TPFLAGS_HAVE_GC; if (type->tp_traverse == NULL) type->tp_traverse = base->tp_traverse; *************** *** 1261,1265 **** } } ! PyType_SET_BASICSIZE(type, newsize); /* Copy other non-function slots */ --- 1261,1265 ---- } } ! type->tp_basicsize = newsize; /* Copy other non-function slots */ From nascheme@users.sourceforge.net Thu Aug 30 00:57:24 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:57:24 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils cmd.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv7016/Lib/distutils Modified Files: cmd.py Log Message: Flush output more aggressively. This makes things look better if the setup script is running from inside Vim. Index: cmd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/cmd.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** cmd.py 2001/03/22 03:48:31 1.27 --- cmd.py 2001/08/29 23:57:22 1.28 *************** *** 189,192 **** --- 189,193 ---- if self.verbose >= level: print msg + sys.stdout.flush() def debug_print (self, msg): *************** *** 197,200 **** --- 198,202 ---- if DEBUG: print msg + sys.stdout.flush() From nascheme@users.sourceforge.net Thu Aug 30 00:58:49 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 16:58:49 -0700 Subject: [Python-checkins] CVS: python/dist/src configure,1.240,1.241 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv7950 Modified Files: configure Log Message: Always build gcmodule. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.240 retrieving revision 1.241 diff -C2 -d -r1.240 -r1.241 *** configure 2001/08/17 18:39:24 1.240 --- configure 2001/08/29 23:58:47 1.241 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.247 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.249 [...3612 lines suppressed...] *** 7065,7069 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7068: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7072,7076 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7075: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then *************** *** 7244,7248 **** s%@USE_THREAD_MODULE@%$USE_THREAD_MODULE%g s%@LDLAST@%$LDLAST%g - s%@USE_GC_MODULE@%$USE_GC_MODULE%g s%@DLINCLDIR@%$DLINCLDIR%g s%@DYNLOADFILE@%$DYNLOADFILE%g --- 7251,7254 ---- From nascheme@users.sourceforge.net Thu Aug 30 01:05:53 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 17:05:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.18,2.19 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12908/Modules Modified Files: gcmodule.c Log Message: Make more things internal to this file. Remove visit_finalizer_reachable since it's the same as visit_reachable. Rename visit_reachable to visit_move. Objects can now have the GC type flag set, reachable by tp_traverse and not be in a GC linked list. This should make the collector more robust and easier to use by extension module writers. Add memory management functions for container objects (new, del, resize). Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.18 retrieving revision 2.19 diff -C2 -d -r2.18 -r2.19 *** gcmodule.c 2001/08/10 14:46:47 2.18 --- gcmodule.c 2001/08/30 00:05:51 2.19 *************** *** 9,13 **** Eric Tiedemann, and various others. ! http://www.arctrix.com/nas/python/gc.html http://www.python.org/pipermail/python-dev/2000-March/003869.html http://www.python.org/pipermail/python-dev/2000-March/004010.html --- 9,13 ---- Eric Tiedemann, and various others. ! http://www.arctrix.com/nas/python/gc/ http://www.python.org/pipermail/python-dev/2000-March/003869.html http://www.python.org/pipermail/python-dev/2000-March/004010.html *************** *** 19,34 **** */ - #include "Python.h" #ifdef WITH_CYCLE_GC ! /* magic gc_refs value */ ! #define GC_MOVED -1 /*** Global GC state ***/ /* linked lists of container objects */ ! static PyGC_Head generation0 = {&generation0, &generation0, 0}; static PyGC_Head generation1 = {&generation1, &generation1, 0}; static PyGC_Head generation2 = {&generation2, &generation2, 0}; --- 19,37 ---- */ #include "Python.h" #ifdef WITH_CYCLE_GC ! /* Get an object's GC head */ ! #define AS_GC(o) ((PyGC_Head *)(o)-1) ! ! /* Get the object given the GC head */ ! #define FROM_GC(g) ((PyObject *)(((PyGC_Head *)g)+1)) + /*** Global GC state ***/ /* linked lists of container objects */ ! PyGC_Head _PyGC_generation0 = {&_PyGC_generation0, &_PyGC_generation0, 0}; static PyGC_Head generation1 = {&generation1, &generation1, 0}; static PyGC_Head generation2 = {&generation2, &generation2, 0}; *************** *** 44,47 **** --- 47,53 ---- static int allocated; + /* true if we are currently running the collector */ + static int collecting; + /* set for debugging information */ #define DEBUG_STATS (1<<0) /* print collection statistics */ *************** *** 58,61 **** --- 64,70 ---- static int debug; + /* Special gc_refs value */ + #define GC_MOVED -123 + /* list of uncollectable objects */ static PyObject *garbage; *************** *** 87,94 **** node->gc_prev->gc_next = node->gc_next; node->gc_next->gc_prev = node->gc_prev; ! #ifdef Py_DEBUG ! node->gc_prev = NULL; ! node->gc_next = NULL; ! #endif } --- 96,100 ---- node->gc_prev->gc_next = node->gc_next; node->gc_next->gc_prev = node->gc_prev; ! node->gc_next = NULL; /* object is not currently tracked */ } *************** *** 138,141 **** --- 144,148 ---- + /* Set all gc_refs = ob_refcnt */ static void *************** *** 144,148 **** PyGC_Head *gc = containers->gc_next; for (; gc != containers; gc=gc->gc_next) { ! gc->gc_refs = PyObject_FROM_GC(gc)->ob_refcnt; } } --- 151,155 ---- PyGC_Head *gc = containers->gc_next; for (; gc != containers; gc=gc->gc_next) { ! gc->gc_refs = FROM_GC(gc)->ob_refcnt; } } *************** *** 152,156 **** { if (op && PyObject_IS_GC(op)) { ! PyObject_AS_GC(op)->gc_refs--; } return 0; --- 159,165 ---- { if (op && PyObject_IS_GC(op)) { ! PyGC_Head *gc = AS_GC(op); ! if (gc->gc_next != NULL) ! AS_GC(op)->gc_refs--; } return 0; *************** *** 164,169 **** PyGC_Head *gc = containers->gc_next; for (; gc != containers; gc=gc->gc_next) { ! traverse = PyObject_FROM_GC(gc)->ob_type->tp_traverse; ! (void) traverse(PyObject_FROM_GC(gc), (visitproc)visit_decref, NULL); --- 173,178 ---- PyGC_Head *gc = containers->gc_next; for (; gc != containers; gc=gc->gc_next) { ! traverse = FROM_GC(gc)->ob_type->tp_traverse; ! (void) traverse(FROM_GC(gc), (visitproc)visit_decref, NULL); *************** *** 189,199 **** static int ! visit_reachable(PyObject *op, PyGC_Head *roots) { if (PyObject_IS_GC(op)) { ! PyGC_Head *gc = PyObject_AS_GC(op); ! if (gc && gc->gc_refs != GC_MOVED) { gc_list_remove(gc); ! gc_list_append(gc, roots); gc->gc_refs = GC_MOVED; } --- 198,208 ---- static int ! visit_move(PyObject *op, PyGC_Head *tolist) { if (PyObject_IS_GC(op)) { ! PyGC_Head *gc = AS_GC(op); ! if (gc->gc_next != NULL && gc->gc_refs != GC_MOVED) { gc_list_remove(gc); ! gc_list_append(gc, tolist); gc->gc_refs = GC_MOVED; } *************** *** 210,222 **** for (; gc != reachable; gc=gc->gc_next) { /* careful, reachable list is growing here */ ! PyObject *op = PyObject_FROM_GC(gc); traverse = op->ob_type->tp_traverse; (void) traverse(op, ! (visitproc)visit_reachable, (void *)reachable); } } ! /* move all objects with finalizers (instances with __del__) */ static void move_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) --- 219,231 ---- for (; gc != reachable; gc=gc->gc_next) { /* careful, reachable list is growing here */ ! PyObject *op = FROM_GC(gc); traverse = op->ob_type->tp_traverse; (void) traverse(op, ! (visitproc)visit_move, (void *)reachable); } } ! /* Move all objects with finalizers (instances with __del__) */ static void move_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) *************** *** 231,235 **** } for (; gc != unreachable; gc=next) { ! PyObject *op = PyObject_FROM_GC(gc); next = gc->gc_next; if (PyInstance_Check(op) && PyObject_HasAttr(op, delstr)) { --- 240,244 ---- } for (; gc != unreachable; gc=next) { ! PyObject *op = FROM_GC(gc); next = gc->gc_next; if (PyInstance_Check(op) && PyObject_HasAttr(op, delstr)) { *************** *** 240,259 **** } - - /* called by tp_traverse */ - static int - visit_finalizer_reachable(PyObject *op, PyGC_Head *finalizers) - { - if (PyObject_IS_GC(op)) { - PyGC_Head *gc = PyObject_AS_GC(op); - if (gc && gc->gc_refs != GC_MOVED) { - gc_list_remove(gc); - gc_list_append(gc, finalizers); - gc->gc_refs = GC_MOVED; - } - } - return 0; - } - /* Move objects referenced from roots to roots */ static void --- 249,252 ---- *************** *** 264,270 **** for (; gc != finalizers; gc=gc->gc_next) { /* careful, finalizers list is growing here */ ! traverse = PyObject_FROM_GC(gc)->ob_type->tp_traverse; ! (void) traverse(PyObject_FROM_GC(gc), ! (visitproc)visit_finalizer_reachable, (void *)finalizers); } --- 257,263 ---- for (; gc != finalizers; gc=gc->gc_next) { /* careful, finalizers list is growing here */ ! traverse = FROM_GC(gc)->ob_type->tp_traverse; ! (void) traverse(FROM_GC(gc), ! (visitproc)visit_move, (void *)finalizers); } *************** *** 307,311 **** for (gc = finalizers->gc_next; gc != finalizers; gc = finalizers->gc_next) { ! PyObject *op = PyObject_FROM_GC(gc); if ((debug & DEBUG_SAVEALL) || PyInstance_Check(op)) { /* If SAVEALL is not set then just append --- 300,304 ---- for (gc = finalizers->gc_next; gc != finalizers; gc = finalizers->gc_next) { ! PyObject *op = FROM_GC(gc); if ((debug & DEBUG_SAVEALL) || PyInstance_Check(op)) { /* If SAVEALL is not set then just append *************** *** 331,335 **** while (unreachable->gc_next != unreachable) { PyGC_Head *gc = unreachable->gc_next; ! PyObject *op = PyObject_FROM_GC(gc); if (debug & DEBUG_SAVEALL) { PyList_Append(garbage, op); --- 324,328 ---- while (unreachable->gc_next != unreachable) { PyGC_Head *gc = unreachable->gc_next; ! PyObject *op = FROM_GC(gc); if (debug & DEBUG_SAVEALL) { PyList_Append(garbage, op); *************** *** 367,371 **** "gc: objects in each generation: %ld %ld %ld\n", generation, ! gc_list_size(&generation0), gc_list_size(&generation1), gc_list_size(&generation2)); --- 360,364 ---- "gc: objects in each generation: %ld %ld %ld\n", generation, ! gc_list_size(&_PyGC_generation0), gc_list_size(&generation1), gc_list_size(&generation2)); *************** *** 408,412 **** m++; if (debug & DEBUG_COLLECTABLE) { ! debug_cycle("collectable", PyObject_FROM_GC(gc)); } } --- 401,405 ---- m++; if (debug & DEBUG_COLLECTABLE) { ! debug_cycle("collectable", FROM_GC(gc)); } } *************** *** 422,426 **** n++; if (debug & DEBUG_UNCOLLECTABLE) { ! debug_cycle("uncollectable", PyObject_FROM_GC(gc)); } } --- 415,419 ---- n++; if (debug & DEBUG_UNCOLLECTABLE) { ! debug_cycle("uncollectable", FROM_GC(gc)); } } *************** *** 462,466 **** if (collections1 > threshold2) { generation = 2; ! gc_list_merge(&generation0, &generation2); gc_list_merge(&generation1, &generation2); if (generation2.gc_next != &generation2) { --- 455,459 ---- if (collections1 > threshold2) { generation = 2; ! gc_list_merge(&_PyGC_generation0, &generation2); gc_list_merge(&generation1, &generation2); if (generation2.gc_next != &generation2) { *************** *** 472,476 **** generation = 1; collections1++; ! gc_list_merge(&generation0, &generation1); if (generation1.gc_next != &generation1) { n = collect(&generation1, &generation2); --- 465,469 ---- generation = 1; collections1++; ! gc_list_merge(&_PyGC_generation0, &generation1); if (generation1.gc_next != &generation1) { n = collect(&generation1, &generation2); *************** *** 481,486 **** generation = 0; collections0++; ! if (generation0.gc_next != &generation0) { ! n = collect(&generation0, &generation1); } } --- 474,479 ---- generation = 0; collections0++; ! if (_PyGC_generation0.gc_next != &_PyGC_generation0) { ! n = collect(&_PyGC_generation0, &generation1); } } *************** *** 488,530 **** } - void - _PyGC_Insert(PyObject *op) - { - /* collection lock since collecting may cause allocations */ - static int collecting = 0; - - #ifdef Py_DEBUG - if (!PyObject_IS_GC(op)) { - abort(); - } - #endif - if (allocated > threshold0 && - enabled && - threshold0 && - !collecting && - !PyErr_Occurred()) { - collecting++; - collect_generations(); - collecting--; - } - allocated++; - gc_list_append(PyObject_AS_GC(op), &generation0); - } - - void - _PyGC_Remove(PyObject *op) - { - PyGC_Head *g = PyObject_AS_GC(op); - #ifdef Py_DEBUG - if (!PyObject_IS_GC(op)) { - abort(); - } - #endif - gc_list_remove(g); - if (allocated > 0) { - allocated--; - } - } - static char gc_enable__doc__[] = "enable() -> None\n" --- 481,484 ---- *************** *** 596,600 **** generation = 2; ! gc_list_merge(&generation0, &generation2); gc_list_merge(&generation1, &generation2); n = collect(&generation2, &generation2); --- 550,554 ---- generation = 2; ! gc_list_merge(&_PyGC_generation0, &generation2); gc_list_merge(&generation1, &generation2); n = collect(&generation2, &generation2); *************** *** 694,698 **** traverseproc traverse; for (gc = list->gc_next; gc != list; gc = gc->gc_next) { ! obj = PyObject_FROM_GC(gc); traverse = obj->ob_type->tp_traverse; if (obj == objs || obj == resultlist) --- 648,652 ---- traverseproc traverse; for (gc = list->gc_next; gc != list; gc = gc->gc_next) { ! obj = FROM_GC(gc); traverse = obj->ob_type->tp_traverse; if (obj == objs || obj == resultlist) *************** *** 714,718 **** { PyObject *result = PyList_New(0); ! if (!(gc_referents_for(args, &generation0, result) && gc_referents_for(args, &generation1, result) && gc_referents_for(args, &generation2, result))) { --- 668,672 ---- { PyObject *result = PyList_New(0); ! if (!(gc_referents_for(args, &_PyGC_generation0, result) && gc_referents_for(args, &generation1, result) && gc_referents_for(args, &generation2, result))) { *************** *** 736,740 **** PyGC_Head *gc; for (gc = gc_list->gc_next; gc != gc_list; gc = gc->gc_next) { ! PyObject *op = PyObject_FROM_GC(gc); if (op != py_list) { Py_INCREF(op); --- 690,694 ---- PyGC_Head *gc; for (gc = gc_list->gc_next; gc != gc_list; gc = gc->gc_next) { ! PyObject *op = FROM_GC(gc); if (op != py_list) { Py_INCREF(op); *************** *** 752,756 **** return NULL; result = PyList_New(0); ! append_objects(result, &generation0); append_objects(result, &generation1); append_objects(result, &generation2); --- 706,710 ---- return NULL; result = PyList_New(0); ! append_objects(result, &_PyGC_generation0); append_objects(result, &generation1); append_objects(result, &generation2); *************** *** 821,823 **** --- 775,878 ---- } + /* for debugging */ + void _PyGC_Dump(PyGC_Head *g) + { + _PyObject_Dump(FROM_GC(g)); + } + #endif /* WITH_CYCLE_GC */ + + /* extension modules might be compiled with GC support so these + functions must always be available */ + + void + _PyObject_GC_Track(PyObject *op) + { + _PyObject_GC_TRACK(op); + } + + void + _PyObject_GC_UnTrack(PyObject *op) + { + _PyObject_GC_UNTRACK(op); + } + + PyObject * + _PyObject_GC_Malloc(PyTypeObject *tp, int size) + { + PyObject *op; + #ifdef WITH_CYCLE_GC + PyGC_Head *g = PyObject_MALLOC(_PyObject_VAR_SIZE(tp, size) + + sizeof(PyGC_Head)); + if (g == NULL) + return (PyObject *)PyErr_NoMemory(); + g->gc_next = NULL; + allocated++; + if (allocated > threshold0 && + enabled && + threshold0 && + !collecting && + !PyErr_Occurred()) { + collecting = 1; + collect_generations(); + collecting = 0; + } + op = FROM_GC(g); + #else + op = PyObject_MALLOC(_PyObject_VAR_SIZE(tp, size)); + if (op == NULL) + return (PyObject *)PyErr_NoMemory(); + + #endif + return op; + } + + PyObject * + _PyObject_GC_New(PyTypeObject *tp) + { + PyObject *op = _PyObject_GC_Malloc(tp, 0); + return PyObject_INIT(op, tp); + } + + PyVarObject * + _PyObject_GC_NewVar(PyTypeObject *tp, int size) + { + PyVarObject *op = (PyVarObject *) _PyObject_GC_Malloc(tp, size); + return PyObject_INIT_VAR(op, tp, size); + } + + PyVarObject * + _PyObject_GC_Resize(PyVarObject *op, int size) + { + #ifdef WITH_CYCLE_GC + PyGC_Head *g = AS_GC(op); + g = PyObject_REALLOC(g, _PyObject_VAR_SIZE(op->ob_type, size) + + sizeof(PyGC_Head)); + if (g == NULL) + return (PyVarObject *)PyErr_NoMemory(); + op = (PyVarObject *) FROM_GC(g); + #else + op = PyObject_REALLOC(op, _PyObject_VAR_SIZE(op->ob_type, size)); + if (op == NULL) + return (PyVarObject *)PyErr_NoMemory(); + #endif + op->ob_size = size; + return op; + } + + void + _PyObject_GC_Del(PyObject *op) + { + #ifdef WITH_CYCLE_GC + PyGC_Head *g = AS_GC(op); + if (g->gc_next != NULL) + gc_list_remove(g); + if (allocated > 0) { + allocated--; + } + PyObject_FREE(g); + #else + PyObject_FREE(op); + #endif + } + From nascheme@users.sourceforge.net Thu Aug 30 01:12:34 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 17:12:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules config.c.in,1.74,1.75 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17201/Modules Modified Files: config.c.in Log Message: gcmodule is now enabled here Index: config.c.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/config.c.in,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** config.c.in 2001/08/02 04:15:00 1.74 --- config.c.in 2001/08/30 00:12:32 1.75 *************** *** 23,26 **** --- 23,27 ---- extern void PyMarshal_Init(void); extern void initimp(void); + extern void initgc(void); struct _inittab _PyImport_Inittab[] = { *************** *** 39,42 **** --- 40,48 ---- {"sys", NULL}, {"exceptions", NULL}, + + #ifdef WITH_CYCLE_GC + /* This lives in gcmodule.c */ + {"gc", initgc}, + #endif /* Sentinel */ From nascheme@users.sourceforge.net Thu Aug 30 01:13:40 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Wed, 29 Aug 2001 17:13:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules Setup.config.in,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17863/Modules Modified Files: Setup.config.in Log Message: gcmodule is now always compiled Index: Setup.config.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/Setup.config.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Setup.config.in 2001/02/21 21:10:14 1.10 --- Setup.config.in 2001/08/30 00:13:38 1.11 *************** *** 4,10 **** # based on configure-time options. - # Garbage collection enabled with --with-cycle-gc - @USE_GC_MODULE@gc gcmodule.c - # Threading @USE_THREAD_MODULE@thread threadmodule.c --- 4,7 ---- From tim_one@users.sourceforge.net Thu Aug 30 01:32:53 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 29 Aug 2001 17:32:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects frameobject.c,2.55,2.56 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv29660/objects Modified Files: frameobject.c Log Message: Squash new compiler wng in debug build. Index: frameobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v retrieving revision 2.55 retrieving revision 2.56 diff -C2 -d -r2.55 -r2.56 *** frameobject.c 2001/08/29 23:52:17 2.55 --- frameobject.c 2001/08/30 00:32:51 2.56 *************** *** 255,259 **** else extras = f->ob_size; ! _Py_NewReference(f); } if (builtins == NULL) { --- 255,259 ---- else extras = f->ob_size; ! _Py_NewReference((PyObject *)f); } if (builtins == NULL) { From gvanrossum@users.sourceforge.net Thu Aug 30 04:08:10 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 20:08:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include stringobject.h,2.29,2.30 tupleobject.h,2.25,2.26 unicodeobject.h,2.31,2.32 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv25513 Modified Files: stringobject.h tupleobject.h unicodeobject.h Log Message: Make the Py_Check() macro use PyObject_TypeCheck(). Index: stringobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/stringobject.h,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -d -r2.29 -r2.30 *** stringobject.h 2001/08/24 18:32:06 2.29 --- stringobject.h 2001/08/30 03:08:07 2.30 *************** *** 52,56 **** extern DL_IMPORT(PyTypeObject) PyString_Type; ! #define PyString_Check(op) ((op)->ob_type == &PyString_Type) extern DL_IMPORT(PyObject *) PyString_FromStringAndSize(const char *, int); --- 52,56 ---- extern DL_IMPORT(PyTypeObject) PyString_Type; ! #define PyString_Check(op) PyObject_TypeCheck(op, &PyString_Type) extern DL_IMPORT(PyObject *) PyString_FromStringAndSize(const char *, int); Index: tupleobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/tupleobject.h,v retrieving revision 2.25 retrieving revision 2.26 diff -C2 -d -r2.25 -r2.26 *** tupleobject.h 2001/05/28 22:30:07 2.25 --- tupleobject.h 2001/08/30 03:08:07 2.26 *************** *** 27,31 **** extern DL_IMPORT(PyTypeObject) PyTuple_Type; ! #define PyTuple_Check(op) ((op)->ob_type == &PyTuple_Type) extern DL_IMPORT(PyObject *) PyTuple_New(int size); --- 27,31 ---- extern DL_IMPORT(PyTypeObject) PyTuple_Type; ! #define PyTuple_Check(op) PyObject_TypeCheck(op, &PyTuple_Type) extern DL_IMPORT(PyObject *) PyTuple_New(int size); Index: unicodeobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v retrieving revision 2.31 retrieving revision 2.32 diff -C2 -d -r2.31 -r2.32 *** unicodeobject.h 2001/08/17 18:39:24 2.31 --- unicodeobject.h 2001/08/30 03:08:07 2.32 *************** *** 373,377 **** extern DL_IMPORT(PyTypeObject) PyUnicode_Type; ! #define PyUnicode_Check(op) (((op)->ob_type == &PyUnicode_Type)) /* Fast access macros */ --- 373,377 ---- extern DL_IMPORT(PyTypeObject) PyUnicode_Type; ! #define PyUnicode_Check(op) PyObject_TypeCheck(op, &PyUnicode_Type) /* Fast access macros */ From gvanrossum@users.sourceforge.net Thu Aug 30 04:09:33 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 20:09:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.88,2.89 intobject.c,2.66,2.67 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv25993 Modified Files: floatobject.c intobject.c Log Message: Fix typo: double semicolons. Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.88 retrieving revision 2.89 diff -C2 -d -r2.88 -r2.89 *** floatobject.c 2001/08/29 15:47:46 2.88 --- floatobject.c 2001/08/30 03:09:31 2.89 *************** *** 660,664 **** return NULL; assert(PyFloat_Check(tmp)); ! new = type->tp_alloc(type, 0);; if (new == NULL) return NULL; --- 660,664 ---- return NULL; assert(PyFloat_Check(tmp)); ! new = type->tp_alloc(type, 0); if (new == NULL) return NULL; Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.66 retrieving revision 2.67 diff -C2 -d -r2.66 -r2.67 *** intobject.c 2001/08/29 15:47:46 2.66 --- intobject.c 2001/08/30 03:09:31 2.67 *************** *** 835,839 **** return NULL; assert(PyInt_Check(tmp)); ! new = type->tp_alloc(type, 0);; if (new == NULL) return NULL; --- 835,839 ---- return NULL; assert(PyInt_Check(tmp)); ! new = type->tp_alloc(type, 0); if (new == NULL) return NULL; From gvanrossum@users.sourceforge.net Thu Aug 30 04:10:38 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 20:10:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects descrobject.c,2.9,2.10 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv26762 Modified Files: descrobject.c Log Message: Make getset subclassable. Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** descrobject.c 2001/08/24 18:49:10 2.9 --- descrobject.c 2001/08/30 03:10:36 2.10 *************** *** 976,980 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ getset_doc, /* tp_doc */ 0, /* tp_traverse */ --- 976,980 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ getset_doc, /* tp_doc */ 0, /* tp_traverse */ From gvanrossum@users.sourceforge.net Thu Aug 30 04:12:01 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 20:12:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects stringobject.c,2.127,2.128 tupleobject.c,2.55,2.56 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv27033 Modified Files: stringobject.c tupleobject.c Log Message: Make str and tuple types subclassable. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.127 retrieving revision 2.128 diff -C2 -d -r2.127 -r2.128 *** stringobject.c 2001/08/27 03:11:09 2.127 --- stringobject.c 2001/08/30 03:11:59 2.128 *************** *** 2684,2687 **** --- 2684,2690 ---- }; + staticforward PyObject * + str_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds); + static PyObject * string_new(PyTypeObject *type, PyObject *args, PyObject *kwds) *************** *** 2690,2694 **** static char *kwlist[] = {"object", 0}; ! assert(type == &PyString_Type); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:str", kwlist, &x)) return NULL; --- 2693,2698 ---- static char *kwlist[] = {"object", 0}; ! if (type != &PyString_Type) ! return str_subtype_new(type, args, kwds); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:str", kwlist, &x)) return NULL; *************** *** 2698,2701 **** --- 2702,2723 ---- } + static PyObject * + str_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *tmp, *new; + int n; + + assert(PyType_IsSubtype(type, &PyString_Type)); + tmp = string_new(&PyString_Type, args, kwds); + if (tmp == NULL) + return NULL; + assert(PyString_Check(tmp)); + new = type->tp_alloc(type, n = PyString_GET_SIZE(tmp)); + if (new == NULL) + return NULL; + memcpy(PyString_AS_STRING(new), PyString_AS_STRING(tmp), n+1); + return new; + } + static char string_doc[] = "str(object) -> string\n\ *************** *** 2725,2729 **** 0, /* tp_setattro */ &string_as_buffer, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ string_doc, /* tp_doc */ 0, /* tp_traverse */ --- 2747,2751 ---- 0, /* tp_setattro */ &string_as_buffer, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ string_doc, /* tp_doc */ 0, /* tp_traverse */ Index: tupleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v retrieving revision 2.55 retrieving revision 2.56 diff -C2 -d -r2.55 -r2.56 *** tupleobject.c 2001/08/29 23:54:21 2.55 --- tupleobject.c 2001/08/30 03:11:59 2.56 *************** *** 476,479 **** --- 476,482 ---- } + staticforward PyObject * + tuple_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds); + static PyObject * tuple_new(PyTypeObject *type, PyObject *args, PyObject *kwds) *************** *** 482,486 **** static char *kwlist[] = {"sequence", 0}; ! assert(type == &PyTuple_Type); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:tuple", kwlist, &arg)) return NULL; --- 485,490 ---- static char *kwlist[] = {"sequence", 0}; ! if (type != &PyTuple_Type) ! return tuple_subtype_new(type, args, kwds); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:tuple", kwlist, &arg)) return NULL; *************** *** 492,495 **** --- 496,522 ---- } + static PyObject * + tuple_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *tmp, *new, *item; + int i, n; + + assert(PyType_IsSubtype(type, &PyTuple_Type)); + tmp = tuple_new(&PyTuple_Type, args, kwds); + if (tmp == NULL) + return NULL; + assert(PyTuple_Check(tmp)); + new = type->tp_alloc(type, n = PyTuple_GET_SIZE(tmp)); + if (new == NULL) + return NULL; + for (i = 0; i < n; i++) { + item = PyTuple_GET_ITEM(tmp, i); + Py_INCREF(item); + PyTuple_SET_ITEM(new, i, item); + } + Py_DECREF(tmp); + return new; + } + static char tuple_doc[] = "tuple(sequence) -> list\n\ *************** *** 530,534 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ tuple_doc, /* tp_doc */ (traverseproc)tupletraverse, /* tp_traverse */ --- 557,562 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | ! Py_TPFLAGS_BASETYPE, /* tp_flags */ tuple_doc, /* tp_doc */ (traverseproc)tupletraverse, /* tp_traverse */ From gvanrossum@users.sourceforge.net Thu Aug 30 04:13:01 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 20:13:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.108,2.109 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv27362 Modified Files: unicodeobject.c Log Message: Make unicode subclassable. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.108 retrieving revision 2.109 diff -C2 -d -r2.108 -r2.109 *** unicodeobject.c 2001/08/16 13:15:00 2.108 --- unicodeobject.c 2001/08/30 03:12:59 2.109 *************** *** 5299,5302 **** --- 5299,5305 ---- }; + staticforward PyObject * + unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds); + static PyObject * unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) *************** *** 5307,5311 **** char *errors = NULL; ! assert(type == &PyUnicode_Type); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:unicode", kwlist, &x, &encoding, &errors)) --- 5310,5315 ---- char *errors = NULL; ! if (type != &PyUnicode_Type) ! return unicode_subtype_new(type, args, kwds); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:unicode", kwlist, &x, &encoding, &errors)) *************** *** 5316,5319 **** --- 5320,5349 ---- } + static PyObject * + unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyUnicodeObject *tmp, *new; + int n; + + assert(PyType_IsSubtype(type, &PyUnicode_Type)); + tmp = (PyUnicodeObject *)unicode_new(&PyUnicode_Type, args, kwds); + if (tmp == NULL) + return NULL; + assert(PyUnicode_Check(tmp)); + new = (PyUnicodeObject *) type->tp_alloc(type, n = tmp->length); + if (new == NULL) + return NULL; + new->str = PyMem_NEW(Py_UNICODE, n+1); + if (new->str == NULL) { + _Py_ForgetReference((PyObject *)new); + PyObject_DEL(new); + return NULL; + } + Py_UNICODE_COPY(new->str, tmp->str, n+1); + new->length = n; + Py_DECREF(tmp); + return (PyObject *)new; + } + static char unicode_doc[] = "unicode(string [, encoding[, errors]]) -> object\n\ *************** *** 5345,5349 **** 0, /* tp_setattro */ &unicode_as_buffer, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ unicode_doc, /* tp_doc */ 0, /* tp_traverse */ --- 5375,5379 ---- 0, /* tp_setattro */ &unicode_as_buffer, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ unicode_doc, /* tp_doc */ 0, /* tp_traverse */ From gvanrossum@users.sourceforge.net Thu Aug 30 05:37:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 21:37:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.51,2.52 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv14363 Modified Files: typeobject.c Log Message: Make 'super' subclassable. (Not sure how useful this is yet. :-) Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.51 retrieving revision 2.52 diff -C2 -d -r2.51 -r2.52 *** typeobject.c 2001/08/29 23:54:54 2.51 --- typeobject.c 2001/08/30 04:37:15 2.52 *************** *** 3260,3264 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ super_doc, /* tp_doc */ 0, /* tp_traverse */ --- 3260,3264 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ super_doc, /* tp_doc */ 0, /* tp_traverse */ From gvanrossum@users.sourceforge.net Thu Aug 30 05:43:37 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 29 Aug 2001 21:43:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.52,2.53 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv15256 Modified Files: typeobject.c Log Message: Safety measures now that str and tuple are subclassable: If tp_itemsize of the basetype is nonzero, only allow empty __slots__ (declaring that no __dict__ should be added), and don't add a weakref offset. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.52 retrieving revision 2.53 diff -C2 -d -r2.52 -r2.53 *** typeobject.c 2001/08/30 04:37:15 2.52 --- typeobject.c 2001/08/30 04:43:35 2.53 *************** *** 713,716 **** --- 713,723 ---- return NULL; nslots = PyTuple_GET_SIZE(slots); + if (nslots > 0 && base->tp_itemsize != 0) { + PyErr_Format(PyExc_TypeError, + "nonempty __slots__ " + "not supported for subtype of '%s'", + base->tp_name); + return NULL; + } for (i = 0; i < nslots; i++) { if (!PyString_Check(PyTuple_GET_ITEM(slots, i))) { *************** *** 729,733 **** add_dict++; } ! if (slots == NULL && base->tp_weaklistoffset == 0) { nslots++; add_weak++; --- 736,741 ---- add_dict++; } ! if (slots == NULL && base->tp_weaklistoffset == 0 && ! base->tp_itemsize == 0) { nslots++; add_weak++; From tim_one@users.sourceforge.net Thu Aug 30 06:16:15 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 29 Aug 2001 22:16:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.216,1.217 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv23325/Misc Modified Files: NEWS Log Message: Add a new function imp.lock_held(), and use it to skip test_threaded_import when that test is doomed to deadlock. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.216 retrieving revision 1.217 diff -C2 -d -r1.216 -r1.217 *** NEWS 2001/08/29 02:28:42 1.216 --- NEWS 2001/08/30 05:16:13 1.217 *************** *** 9,12 **** --- 9,15 ---- Library + + A new function, imp.lock_held(), returns 1 when the import lock is + currently held. See the docs for the imp module. + + pickle, cPickle and marshal on 32-bit platforms can now correctly read dumps containing ints written on platforms where Python ints are 8 bytes. *************** *** 17,20 **** --- 20,29 ---- Build + + API + + + XXX Say something about Neil's GC rework, and that extensions that + don't upgrade to the new scheme will still compile but not actually + participate in GC. New platforms From tim_one@users.sourceforge.net Thu Aug 30 06:16:15 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 29 Aug 2001 22:16:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python import.c,2.185,2.186 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv23325/Python Modified Files: import.c Log Message: Add a new function imp.lock_held(), and use it to skip test_threaded_import when that test is doomed to deadlock. Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.185 retrieving revision 2.186 diff -C2 -d -r2.185 -r2.186 *** import.c 2001/08/13 23:05:44 2.185 --- import.c 2001/08/30 05:16:13 2.186 *************** *** 182,185 **** --- 182,197 ---- #endif + static PyObject * + imp_lock_held(PyObject *self, PyObject *args) + { + if (!PyArg_ParseTuple(args, ":lock_held")) + return NULL; + #ifdef WITH_THREAD + return PyInt_FromLong(import_lock_thread != -1); + #else + return PyInt_FromLong(0); + #endif + } + /* Helper for sys */ *************** *** 2340,2343 **** --- 2352,2361 ---- "; + static char doc_lock_held[] = "\ + lock_held() -> 0 or 1\n\ + Return 1 if the import lock is currently held.\n\ + On platforms without threads, return 0.\ + "; + static PyMethodDef imp_methods[] = { {"find_module", imp_find_module, 1, doc_find_module}, *************** *** 2346,2349 **** --- 2364,2368 ---- {"load_module", imp_load_module, 1, doc_load_module}, {"new_module", imp_new_module, 1, doc_new_module}, + {"lock_held", imp_lock_held, 1, doc_lock_held}, /* The rest are obsolete */ {"get_frozen_object", imp_get_frozen_object, 1}, From tim_one@users.sourceforge.net Thu Aug 30 06:16:15 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 29 Aug 2001 22:16:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libimp.tex,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv23325/Doc/lib Modified Files: libimp.tex Log Message: Add a new function imp.lock_held(), and use it to skip test_threaded_import when that test is doomed to deadlock. Index: libimp.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libimp.tex,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** libimp.tex 2001/07/06 19:28:48 1.29 --- libimp.tex 2001/08/30 05:16:12 1.30 *************** *** 94,97 **** --- 94,110 ---- \end{funcdesc} + \begin{funcdesc}{lock_held}{} + Return 1 if the import lock is currently held, else 0. + On platforms without threads, always return 0. + + On platforms with threads, a thread executing an import holds an internal + lock until the import is complete. + This lock blocks other threads from doing an import until the original + import completes, which in turn prevents other threads from seeing + incomplete module objects constructed by the original thread while in + the process of completing its import (and the imports, if any, + triggered by that). + \end{funcdesc} + The following constants with integer values, defined in this module, are used to indicate the search result of \function{find_module()}. From tim_one@users.sourceforge.net Thu Aug 30 06:16:15 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 29 Aug 2001 22:16:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_threaded_import.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv23325/Lib/test Modified Files: test_threaded_import.py Log Message: Add a new function imp.lock_held(), and use it to skip test_threaded_import when that test is doomed to deadlock. Index: test_threaded_import.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_threaded_import.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_threaded_import.py 2001/08/29 20:26:24 1.3 --- test_threaded_import.py 2001/08/30 05:16:13 1.4 *************** *** 33,40 **** def test_main(): # magic name! see above global N, done ! import sys ! for modname in sys.modules: ! if modname.find('autotest') >= 0: ! raise TestSkipped("can't run from autotest") done.acquire() for N in (20, 50) * 3: --- 33,42 ---- def test_main(): # magic name! see above global N, done ! ! import imp ! if imp.lock_held(): ! # This triggers on, e.g., from test import autotest. ! raise TestSkipped("can't run when import lock is held") ! done.acquire() for N in (20, 50) * 3: From tim_one@users.sourceforge.net Thu Aug 30 07:15:34 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 29 Aug 2001 23:15:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects listobject.c,2.100,2.101 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv9058 Modified Files: listobject.c Log Message: Give the internal immutable list type .extend and .pop methods (they "should have" been added here when they were added to lists). Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.100 retrieving revision 2.101 diff -C2 -d -r2.100 -r2.101 *** listobject.c 2001/08/29 23:52:52 2.100 --- listobject.c 2001/08/30 06:15:32 2.101 *************** *** 1728,1731 **** --- 1728,1733 ---- {"append", (PyCFunction)immutable_list_op, METH_VARARGS}, {"insert", (PyCFunction)immutable_list_op, METH_VARARGS}, + {"extend", (PyCFunction)immutable_list_op, METH_O}, + {"pop", (PyCFunction)immutable_list_op, METH_VARARGS}, {"remove", (PyCFunction)immutable_list_op, METH_VARARGS}, {"index", (PyCFunction)listindex, METH_O}, From jackjansen@users.sourceforge.net Thu Aug 30 14:26:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 30 Aug 2001 06:26:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions/(vise) Python 2.2.vct,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory usw-pr-cvs1:/tmp/cvs-serv19304/Python/Mac/Distributions/(vise) Added Files: Python 2.2.vct Log Message: Started on the 2.2a2 installer --- NEW FILE: Python 2.2.vct --- : ú : : : : : : : : P ’Ä : :  : iÌ Æ ƒ : : p : ?$Ê : : ? : g : : : : Ð : : : ^6B : Ž : : : : : : : : : : : : : v Ò ¡ : ñ 4 ø : : ¢ › : : : : : : lg \  : :  : : r : : º ¸ : ¸ õÁ¾ : : : : Ì è ä â Î Ž ‡  ¬ º : : : : : : : : : N : : : : : : : v Ž·…d   Ã•Ç : U·…W È·…p ö      ! :  ð : : : : : : : : ä : J : : : : : : : Ó  ͉¸ Ó = : : :  : ó : : :   : & ·zu ·zu ·zu ·zu : I :  JÈè : ·zu ã : ·zu ' Œ ' ª GJ : : : : : : : : :  è# : : : : : : : :   ñ ò ñ ó ñ ô ñ õ : : … † : : : Ö 2 : ã(À‹˜ âë 6$ ú ýš^ : : : ´ : : š : ¹  : : : : ¡ . Ó Ô Û Z :  : : : : : I Y : {Ù SB jù : , K º n : : : : : øa : ¾ %© å “m › ¨ › º › » : : : Ð Ñ : Ò b × Ì ú : à X : ¨ : : : : : : m : : g†o ¾ : : : : oF= : ¢ : ¢ ¢ ¢ ¢ H : # : : : : : 9 4 : : : B w : : : 8@ : V  : : : ã : –Ž3 : : : : : : : : : : : » : : : ׂ€ Ø  binary Distribution:Demo:classes:PVct binary Distribution:Demo:sgi:gl:PVct binary Distribution:Extensions:Imaging:PVct binary Distribution:Mac:Contrib:PVct binary Distribution:Mac:Lib:lib-scriptpackages:StdSuites:PVct YN*nÿì .ÿðR€Ö€/aÿÿÿÿ pº€o Rƒ`pº€nSƒ Lß YN*nÿì DDDDDD ÿÿÌÌ33  ^*Tÿÿ ;;T*Tÿÿ V p`p`p p Y?< pÎ=@ X0=@ÿ”B@=@ÿ˜p-@ÿ¶Aîÿ|p¢`8 xÕ`JDfxÕ0=@ p`p`p p Y?< pÎ=@ X0=@ÿ”B@=@ÿ˜p-@ÿ¶Aîÿ|p¢`8 xÕ`JDfxÕ0=@ Nº 0* /* g>5n Bª NГGETVOLUMEINFONONAME NÐDETERMINEVREFNUM © "n éJoy!peffpwpc à  B " Nº Nº Nº 0* /* g>5n Bª NГGETVOLUMEINFONONAME NÐDETERMINEVREFNUM © "n  B "˜ """""" ªªªªªª """""" $n &n x Nºÿ>$H¼®þúPOfv`µÅeäJgAîÿ ?< ?©˜0Lß v / p gHnÿ JCg?Cx`  $n &n x Nºÿ>$H¼®þúPOfv`µÅeäJgAîÿ ?< ?©˜0Lß v / p gHnÿ JCg?Cx`  """""" $n &n x Nºÿ>$H¼®þúPOfv`µÅeäJgAîÿ ?< ?©˜0Lß v / p gHnÿ JCg?Cx`  $n &n x Nºÿ>$H¼®þúPOfv`µÅeäJgAîÿ ?< ?©˜0Lß v / p gHnÿ JCg?Cx`  $n &n x Nºÿ>$H¼®þúPOfv`µÅeäJgAîÿ ?< ?©˜0Lß v / p gHnÿ JCg?Cx`  /5n Bª NГGETVOLUMEINFONONAME NÐDETERMINEVREFNUM © "n  8„rl8¥tn8Ædm8çev9R#H "ì Nº 0* /* g>5n Bª NГGETVOLUMEINFONONAME NÐDETERMINEVREFNUM © "n  "è /$n îîîîîî /$n /$n /$n /$n ÿÿÌÌ33 ­TÎÎTªÕ //­Î /$n ®| """""" /$n """""" /$n /$n /$n /$n | /$n /$n /$n /$n /$n /$n DDDDDD /$n ®| """""" /$n /$n """""" /$n /$n /$n /$n /$n /$n Nº Nº Nº Nº 5o Ho >¯ 0* /* Nº(06 g:5o Bª NÐHç0Oïÿà&o NÐHç0Oïÿ”&o © "n , , ,  B ", Nº Nº Nº Nº 5o Ho >¯ 0* /* Nº(06 g:5o Bª NÐHç0Oïÿà&o NÐHç0Oïÿ”&o © "n , , ,  B ", NºÊ6 NºŽ6 NºJ6 Nº Nº Nºj6 5o Ho >¯ /o 0* /* Nº(06 g:5o Bª NÐHç0Oïÿà&o NÐHç0Oïÿ”&o © "n  B á€A "P Nº 5o Ho >¯ 0* /* Nº(06 g:5o Bª NÐHç0Oïÿà&o NÐHç0Oïÿ”&o © "n  B "T »»»»»» /$n /$n /$n /$n /$n /$n /$n /$n Stationery Ämod Appearance Assistants Sound Sets x Components Frameworks www.cwi.nl,ÿÑdô‘<°û$0 Edl)û$Àû$¬˜h$ Ed%"û$èû$ì ftp.cwi.nl,ÿÑdô‘<°û$0 Edl)û$Àû$¬˜h$ Ed%"û$èû$ì IFld “·›mÍ jackjansen T´ 5XS i\ _± Ôj2 ?“À WÏ N[n „_- ¶cœ òw• *‹Ž È ÿÿ$¡Ý From sjoerd@users.sourceforge.net Thu Aug 30 14:59:01 2001 From: sjoerd@users.sourceforge.net (Sjoerd Mullender) Date: Thu, 30 Aug 2001 06:59:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects methodobject.c,2.38,2.39 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv31510 Modified Files: methodobject.c Log Message: Removed some unreachable break statements to silence SGI compiler. Index: methodobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/methodobject.c,v retrieving revision 2.38 retrieving revision 2.39 diff -C2 -d -r2.38 -r2.39 *** methodobject.c 2001/08/24 18:34:26 2.38 --- methodobject.c 2001/08/30 13:58:58 2.39 *************** *** 79,83 **** case METH_VARARGS: return (*meth)(self, arg); - break; case METH_NOARGS: if (size == 0) --- 79,82 ---- *************** *** 87,91 **** f->m_ml->ml_name, size); return NULL; - break; case METH_O: if (size == 1) --- 86,89 ---- *************** *** 95,99 **** f->m_ml->ml_name, size); return NULL; - break; case METH_OLDARGS: /* the really old style */ --- 93,96 ---- From sjoerd@users.sourceforge.net Thu Aug 30 15:05:23 2001 From: sjoerd@users.sourceforge.net (Sjoerd Mullender) Date: Thu, 30 Aug 2001 07:05:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.270,2.271 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv1765 Modified Files: ceval.c Log Message: Removed some unreachable break statements to silence SGI compiler. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.270 retrieving revision 2.271 diff -C2 -d -r2.270 -r2.271 *** ceval.c 2001/08/23 02:58:07 2.270 --- ceval.c 2001/08/30 14:05:20 2.271 *************** *** 3050,3054 **** return result; } - break; case METH_NOARGS: if (na == 0) --- 3050,3053 ---- *************** *** 3058,3062 **** ((PyCFunctionObject*)func)->m_ml->ml_name, na); return NULL; - break; case METH_O: if (na == 1) { --- 3057,3060 ---- *************** *** 3070,3074 **** ((PyCFunctionObject*)func)->m_ml->ml_name, na); return NULL; - break; default: fprintf(stderr, "%.200s() flags = %d\n", --- 3068,3071 ---- From sjoerd@users.sourceforge.net Thu Aug 30 15:06:48 2001 From: sjoerd@users.sourceforge.net (Sjoerd Mullender) Date: Thu, 30 Aug 2001 07:06:48 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.219,2.220 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv2394 Modified Files: compile.c Log Message: Removed unreachable goto statement to silence SGI compiler. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.219 retrieving revision 2.220 diff -C2 -d -r2.219 -r2.220 *** compile.c 2001/08/27 19:45:25 2.219 --- compile.c 2001/08/30 14:06:45 2.220 *************** *** 5364,5368 **** return; } - goto loop; case atom: tmp = CHILD(n, 0); --- 5364,5367 ---- From sjoerd@users.sourceforge.net Thu Aug 30 15:15:40 2001 From: sjoerd@users.sourceforge.net (Sjoerd Mullender) Date: Thu, 30 Aug 2001 07:15:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules getaddrinfo.c,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv7012 Modified Files: getaddrinfo.c Log Message: Removed an unreachable break statement to silence SGI compiler. Index: getaddrinfo.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/getaddrinfo.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** getaddrinfo.c 2001/07/24 06:33:08 1.6 --- getaddrinfo.c 2001/08/30 14:15:38 1.7 *************** *** 331,335 **** default: ERR(EAI_SOCKTYPE); ! break; } } --- 331,335 ---- default: ERR(EAI_SOCKTYPE); ! /* unreachable */ } } From sjoerd@users.sourceforge.net Thu Aug 30 15:37:09 2001 From: sjoerd@users.sourceforge.net (Sjoerd Mullender) Date: Thu, 30 Aug 2001 07:37:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _sre.c,2.63,2.64 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv14377 Modified Files: _sre.c Log Message: Removed unreachable return to silence SGI compiler. Index: _sre.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v retrieving revision 2.63 retrieving revision 2.64 diff -C2 -d -r2.63 -r2.64 *** _sre.c 2001/08/17 18:39:25 2.63 --- _sre.c 2001/08/30 14:37:07 2.64 *************** *** 1141,1146 **** } ! /* shouldn't end up here */ ! return SRE_ERROR_ILLEGAL; } --- 1141,1145 ---- } ! /* can't end up here */ } From fdrake@users.sourceforge.net Thu Aug 30 15:42:42 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 30 Aug 2001 07:42:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libsha.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv16676/lib Modified Files: libsha.tex Log Message: Update the links to the FIPS document that defines the Secure Hash Algorithm. This closes SF bug #454917. Index: libsha.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsha.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** libsha.tex 2001/07/06 20:30:11 1.7 --- libsha.tex 2001/08/30 14:42:40 1.8 *************** *** 67,77 **** \begin{seealso} ! \seetitle[http://csrc.nist.gov/fips/fip180-1.txt]{Secure Hash Standard}{ ! The Secure Hash Algorithm is defined by NIST document FIPS ! PUB 180-1: ! \citetitle[http://csrc.nist.gov/fips/fip180-1.txt]{Secure ! Hash Standard}, published in April of 1995. It is ! available online as plain text (at least one diagram was ! omitted) and as PDF at ! \url{http://csrc.nist.gov/fips/fip180-1.pdf}.} \end{seealso} --- 67,78 ---- \begin{seealso} ! \seetitle[http://csrc.nist.gov/publications/fips/fips180-1/fip180-1.txt] ! {Secure Hash Standard} ! {The Secure Hash Algorithm is defined by NIST document FIPS ! PUB 180-1: ! \citetitle[http://csrc.nist.gov/publications/fips/fips180-1/fip180-1.txt] ! {Secure Hash Standard}, published in April of 1995. It is ! available online as plain text (at least one diagram was ! omitted) and as PDF at ! \url{http://csrc.nist.gov/publications/fips/fips180-1/fip180-1.pdf}.} \end{seealso} From mwh@users.sourceforge.net Thu Aug 30 15:50:22 2001 From: mwh@users.sourceforge.net (Michael Hudson) Date: Thu, 30 Aug 2001 07:50:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python marshal.c,1.66,1.67 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv20449 Modified Files: marshal.c Log Message: fix for part of bug #453523: disable unmarshalling of code objects in restricted execution mode. Index: marshal.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/marshal.c,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** marshal.c 2001/08/29 02:28:41 1.66 --- marshal.c 2001/08/30 14:50:20 1.67 *************** *** 570,574 **** case TYPE_CODE: ! { int argcount = r_short(p); int nlocals = r_short(p); --- 570,580 ---- case TYPE_CODE: ! if (PyEval_GetRestricted()) { ! PyErr_SetString(PyExc_RuntimeError, ! "cannot unmarshal code objects in " ! "restricted execution mode"); ! return NULL; ! } ! else { int argcount = r_short(p); int nlocals = r_short(p); From gvanrossum@users.sourceforge.net Thu Aug 30 16:07:46 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 08:07:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib getpass.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv28710 Modified Files: getpass.py Log Message: win_getpass(): if sys.stdin is not sys.__stdin__, use default_getpass(). This should prevent hanging when it is called in IDLE. Fixes SF bug #455648. Index: getpass.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/getpass.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** getpass.py 2001/08/13 15:30:22 1.13 --- getpass.py 2001/08/30 15:07:44 1.14 *************** *** 43,46 **** --- 43,48 ---- def win_getpass(prompt='Password: '): """Prompt for password with echo off, using Windows getch().""" + if sys.stdin is not sys.__stdin__: + return default_getpass(prompt) import msvcrt for c in prompt: From nascheme@users.sourceforge.net Thu Aug 30 16:24:19 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Thu, 30 Aug 2001 08:24:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.142,1.143 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv3569/Doc/api Modified Files: api.tex Log Message: Update documentation for GC API. Closes SF patch #421893. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** api.tex 2001/08/28 02:31:28 1.142 --- api.tex 2001/08/30 15:24:17 1.143 *************** *** 5509,5519 **** To create a container type, the \member{tp_flags} field of the type ! object must include the \constant{Py_TPFLAGS_GC} and provide an ! implementation of the \member{tp_traverse} handler. The computed ! value of the \member{tp_basicsize} field must include ! \constant{PyGC_HEAD_SIZE} as well. If instances of the type are ! mutable, a \member{tp_clear} implementation must also be provided. ! \begin{datadesc}{Py_TPFLAGS_GC} Objects with a type with this flag set must conform with the rules documented here. For convenience these objects will be referred to --- 5509,5518 ---- To create a container type, the \member{tp_flags} field of the type ! object must include the \constant{Py_TPFLAGS_HAVE_GC} and provide an ! implementation of the \member{tp_traverse} handler. If instances of the ! type are mutable, a \member{tp_clear} implementation must also be ! provided. ! \begin{datadesc}{Py_TPFLAGS_HAVE_GC} Objects with a type with this flag set must conform with the rules documented here. For convenience these objects will be referred to *************** *** 5521,5542 **** \end{datadesc} - \begin{datadesc}{PyGC_HEAD_SIZE} - Extra memory needed for the garbage collector. Container objects - must include this in the calculation of their tp_basicsize. If the - collector is disabled at compile time then this is \code{0}. - \end{datadesc} - Constructors for container types must conform to two rules: \begin{enumerate} \item The memory for the object must be allocated using ! \cfunction{PyObject_New()} or \cfunction{PyObject_VarNew()}. \item Once all the fields which may contain references to other containers are initialized, it must call ! \cfunction{PyObject_GC_Init()}. \end{enumerate} ! \begin{cfuncdesc}{void}{PyObject_GC_Init}{PyObject *op} Adds the object \var{op} to the set of container objects tracked by the collector. The collector can run at unexpected times so objects --- 5520,5551 ---- \end{datadesc} Constructors for container types must conform to two rules: \begin{enumerate} \item The memory for the object must be allocated using ! \cfunction{PyObject_GC_New()} or \cfunction{PyObject_GC_VarNew()}. \item Once all the fields which may contain references to other containers are initialized, it must call ! \cfunction{PyObject_GC_Track()}. \end{enumerate} ! \begin{cfuncdesc}{\var{TYPE}*}{PyObject_GC_New}{TYPE, PyTypeObject *type} ! Analogous to \cfunction{PyObject_New()} but for container objects with ! the \constant{Py_TPFLAGS_HAVE_GC} flag set. ! \end{cfuncdesc} ! ! \begin{cfuncdesc}{\var{TYPE}*}{PyObject_GC_NewVar}{TYPE, PyTypeObject *type, ! int size} ! Analogous to \cfunction{PyObject_NewVar()} but for container objects ! with the \constant{Py_TPFLAGS_HAVE_GC} flag set. ! \end{cfuncdesc} ! ! \begin{cfuncdesc}{PyVarObject *}{PyObject_GC_Resize}{PyVarObject *op, int} ! Resize an object allocated by \cfunction{PyObject_NewVar()}. Returns ! the resized object or \NULL{} on failure. ! \end{cfuncdesc} ! ! \begin{cfuncdesc}{void}{PyObject_GC_Track}{PyObject *op} Adds the object \var{op} to the set of container objects tracked by the collector. The collector can run at unexpected times so objects *************** *** 5546,5549 **** --- 5555,5563 ---- \end{cfuncdesc} + \begin{cfuncdesc}{void}{_PyObject_GC_TRACK}{PyObject *op} + A macro version of \cfunction{PyObject_GC_Track()}. It should not be + used for extension modules. + \end{cfuncdesc} + Similarly, the deallocator for the object must conform to a similar pair of rules: *************** *** 5551,5572 **** \begin{enumerate} \item Before fields which refer to other containers are invalidated, ! \cfunction{PyObject_GC_Fini()} must be called. \item The object's memory must be deallocated using ! \cfunction{PyObject_Del()}. \end{enumerate} ! \begin{cfuncdesc}{void}{PyObject_GC_Fini}{PyObject *op} Remove the object \var{op} from the set of container objects tracked ! by the collector. Note that \cfunction{PyObject_GC_Init()} can be called again on this object to add it back to the set of tracked objects. The deallocator (\member{tp_dealloc} handler) should call this for the object before any of the fields used by the \member{tp_traverse} handler become invalid. ! \strong{Note:} Any container which may be referenced from another ! object reachable by the collector must itself be tracked by the ! collector, so it is generally not safe to call this function ! anywhere but in the object's deallocator. \end{cfuncdesc} --- 5565,5591 ---- \begin{enumerate} \item Before fields which refer to other containers are invalidated, ! \cfunction{PyObject_GC_UnTrack()} must be called. \item The object's memory must be deallocated using ! \cfunction{PyObject_GC_Del()}. \end{enumerate} ! \begin{cfuncdesc}{void}{PyObject_GC_Del}{PyObject *op} ! Releases memory allocated to an object using ! \cfunction{PyObject_GC_New()} or \cfunction{PyObject_GC_NewVar()}. ! \end{cfuncdesc} ! ! \begin{cfuncdesc}{void}{PyObject_GC_UnTrack}{PyObject *op} Remove the object \var{op} from the set of container objects tracked ! by the collector. Note that \cfunction{PyObject_GC_Track()} can be called again on this object to add it back to the set of tracked objects. The deallocator (\member{tp_dealloc} handler) should call this for the object before any of the fields used by the \member{tp_traverse} handler become invalid. + \end{cfuncdesc} ! \begin{cfuncdesc}{void}{_PyObject_GC_UNTRACK}{PyObject *op} ! A macro version of \cfunction{PyObject_GC_UnTrack()}. It should not be ! used for extension modules. \end{cfuncdesc} *************** *** 5651,5657 **** my_dealloc(MyObject *self) { ! PyObject_GC_Fini((PyObject *) self); Py_XDECREF(self->container); ! PyObject_Del(self); } \end{verbatim} --- 5670,5676 ---- my_dealloc(MyObject *self) { ! PyObject_GC_UnTrack((PyObject *) self); Py_XDECREF(self->container); ! PyObject_GC_Del(self); } \end{verbatim} *************** *** 5663,5667 **** 0, "MyObject", ! sizeof(MyObject) + PyGC_HEAD_SIZE, 0, (destructor)my_dealloc, /* tp_dealloc */ --- 5682,5686 ---- 0, "MyObject", ! sizeof(MyObject), 0, (destructor)my_dealloc, /* tp_dealloc */ *************** *** 5680,5684 **** 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, 0, /* tp_doc */ (traverseproc)my_traverse, /* tp_traverse */ --- 5699,5703 ---- 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, /* tp_doc */ (traverseproc)my_traverse, /* tp_traverse */ *************** *** 5696,5703 **** if (PyArg_ParseTuple(args, "|O:new_object", &container)) { ! result = PyObject_New(MyObject, &MyObject_Type); if (result != NULL) { result->container = container; ! PyObject_GC_Init(); } } --- 5715,5722 ---- if (PyArg_ParseTuple(args, "|O:new_object", &container)) { ! result = PyObject_GC_New(MyObject, &MyObject_Type); if (result != NULL) { result->container = container; ! PyObject_GC_Track(result); } } From nascheme@users.sourceforge.net Thu Aug 30 16:38:04 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Thu, 30 Aug 2001 08:38:04 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.217,1.218 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv10883/Misc Modified Files: NEWS Log Message: A news about GC API change. Explain how to upgrade extension modules. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.217 retrieving revision 1.218 diff -C2 -d -r1.217 -r1.218 *** NEWS 2001/08/30 05:16:13 1.217 --- NEWS 2001/08/30 15:38:01 1.218 *************** *** 23,29 **** API ! + XXX Say something about Neil's GC rework, and that extensions that ! don't upgrade to the new scheme will still compile but not actually ! participate in GC. New platforms --- 23,42 ---- API ! + The GC API has been changed. Extensions that use the old API will still ! compile but will not participate in GC. To upgrade an extension ! module: ! ! - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC ! ! - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and ! PyObject_GC_Del to deallocate them ! ! - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini ! to PyObject_GC_UnTrack ! ! - remove PyGC_HEAD_SIZE from object size calculations ! ! - remove calls to PyObject_AS_GC and PyObject_FROM_GC ! New platforms From jhylton@users.sourceforge.net Thu Aug 30 16:50:37 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Thu, 30 Aug 2001 08:50:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv16635 Modified Files: pycodegen.py Log Message: spurious pop Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** pycodegen.py 2001/08/29 22:30:09 1.47 --- pycodegen.py 2001/08/30 15:50:34 1.48 *************** *** 597,601 **** self.emit('POP_TOP') self.emit('END_FINALLY') - self.setups.pop() if node.else_: self.nextBlock(lElse) --- 597,600 ---- From gvanrossum@users.sourceforge.net Thu Aug 30 16:54:46 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 08:54:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects longobject.c,1.93,1.94 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv19134 Modified Files: longobject.c Log Message: Ah, the joy of writing test cases... long_subtype_new(): fix a typo (type->ob_size instead of tmp->ob_size). Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** longobject.c 2001/08/29 15:47:46 1.93 --- longobject.c 2001/08/30 15:54:44 1.94 *************** *** 2096,2100 **** return NULL; assert(PyLong_Check(new)); ! new->ob_size = type->ob_size; for (i = 0; i < n; i++) new->ob_digit[i] = tmp->ob_digit[i]; --- 2096,2100 ---- return NULL; assert(PyLong_Check(new)); ! new->ob_size = tmp->ob_size; for (i = 0; i < n; i++) new->ob_digit[i] = tmp->ob_digit[i]; From gvanrossum@users.sourceforge.net Thu Aug 30 17:06:25 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 09:06:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.271,2.272 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv26112 Modified Files: ceval.c Log Message: Do the int inlining only if the type is really an int, not whenever PyInt_Check() succeeds. That returns true for subtypes of int, which may override __add__ or __sub__. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.271 retrieving revision 2.272 diff -C2 -d -r2.271 -r2.272 *** ceval.c 2001/08/30 14:05:20 2.271 --- ceval.c 2001/08/30 16:06:23 2.272 *************** *** 549,552 **** --- 549,555 ---- #endif + /* Strict int check macros */ + #define ISSTRICTINT(v) ((v)->ob_type == &PyInt_Type) + /* Local variable macros */ *************** *** 910,914 **** w = POP(); v = POP(); ! if (PyInt_Check(v) && PyInt_Check(w)) { /* INLINE: int + int */ register long a, b, i; --- 913,917 ---- w = POP(); v = POP(); ! if (ISSTRICTINT(v) && ISSTRICTINT(w)) { /* INLINE: int + int */ register long a, b, i; *************** *** 933,937 **** w = POP(); v = POP(); ! if (PyInt_Check(v) && PyInt_Check(w)) { /* INLINE: int - int */ register long a, b, i; --- 936,940 ---- w = POP(); v = POP(); ! if (ISSTRICTINT(v) && ISSTRICTINT(w)) { /* INLINE: int - int */ register long a, b, i; *************** *** 956,960 **** w = POP(); v = POP(); ! if (v->ob_type == &PyList_Type && PyInt_Check(w)) { /* INLINE: list[int] */ long i = PyInt_AsLong(w); --- 959,963 ---- w = POP(); v = POP(); ! if (v->ob_type == &PyList_Type && ISSTRICTINT(w)) { /* INLINE: list[int] */ long i = PyInt_AsLong(w); *************** *** 1093,1097 **** w = POP(); v = POP(); ! if (PyInt_Check(v) && PyInt_Check(w)) { /* INLINE: int + int */ register long a, b, i; --- 1096,1100 ---- w = POP(); v = POP(); ! if (ISSTRICTINT(v) && ISSTRICTINT(w)) { /* INLINE: int + int */ register long a, b, i; *************** *** 1116,1120 **** w = POP(); v = POP(); ! if (PyInt_Check(v) && PyInt_Check(w)) { /* INLINE: int - int */ register long a, b, i; --- 1119,1123 ---- w = POP(); v = POP(); ! if (ISSTRICTINT(v) && ISSTRICTINT(w)) { /* INLINE: int - int */ register long a, b, i; *************** *** 1719,1723 **** w = POP(); v = POP(); ! if (PyInt_Check(v) && PyInt_Check(w)) { /* INLINE: cmp(int, int) */ register long a, b; --- 1722,1726 ---- w = POP(); v = POP(); ! if (ISSTRICTINT(v) && ISSTRICTINT(w)) { /* INLINE: cmp(int, int) */ register long a, b; From gvanrossum@users.sourceforge.net Thu Aug 30 19:31:32 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 11:31:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects tupleobject.c,2.56,2.57 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv1110 Modified Files: tupleobject.c Log Message: More stuff discovered while writing the simplest of testcases: tupledealloc(): only feed the free list when the type is really a tuple, not a subtype. Otherwise, use PyObject_GC_Del(). _PyTuple_Resize(): disallow using this for tuple subtypes. Index: tupleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v retrieving revision 2.56 retrieving revision 2.57 diff -C2 -d -r2.56 -r2.57 *** tupleobject.c 2001/08/30 03:11:59 2.56 --- tupleobject.c 2001/08/30 18:31:30 2.57 *************** *** 147,151 **** Py_XDECREF(op->ob_item[i]); #if MAXSAVESIZE > 0 ! if (len < MAXSAVESIZE && num_free_tuples[len] < MAXSAVEDTUPLES) { op->ob_item[0] = (PyObject *) free_tuples[len]; num_free_tuples[len]++; --- 147,154 ---- Py_XDECREF(op->ob_item[i]); #if MAXSAVESIZE > 0 ! if (len < MAXSAVESIZE && ! num_free_tuples[len] < MAXSAVEDTUPLES && ! op->ob_type == &PyTuple_Type) ! { op->ob_item[0] = (PyObject *) free_tuples[len]; num_free_tuples[len]++; *************** *** 595,599 **** v = (PyTupleObject *) *pv; ! if (v == NULL || !PyTuple_Check(v) || (v->ob_size != 0 && v->ob_refcnt != 1)) { *pv = 0; --- 598,602 ---- v = (PyTupleObject *) *pv; ! if (v == NULL || v->ob_type != &PyTuple_Type || (v->ob_size != 0 && v->ob_refcnt != 1)) { *pv = 0; From fdrake@users.sourceforge.net Thu Aug 30 19:53:30 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 30 Aug 2001 11:53:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.220,2.221 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv7596 Modified Files: compile.c Log Message: When re-writing a factor containing a unary negation of a literal, only affect nodes without another operator. This was causing negated exponentiations to drop the exponentiation. This closes SF bug #456756. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.220 retrieving revision 2.221 diff -C2 -d -r2.220 -r2.221 *** compile.c 2001/08/30 14:06:45 2.220 --- compile.c 2001/08/30 18:53:25 2.221 *************** *** 1892,1897 **** --- 1892,1900 ---- */ if ((childtype == PLUS || childtype == MINUS || childtype == TILDE) + && NCH(n) == 2 && TYPE(CHILD(n, 1)) == factor + && NCH(CHILD(n, 1)) == 1 && TYPE(CHILD(CHILD(n, 1), 0)) == power + && NCH(CHILD(CHILD(n, 1), 0)) == 1 && TYPE(CHILD(CHILD(CHILD(n, 1), 0), 0)) == atom && TYPE(CHILD(CHILD(CHILD(CHILD(n, 1), 0), 0), 0)) == NUMBER) { From fdrake@users.sourceforge.net Thu Aug 30 19:56:32 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 30 Aug 2001 11:56:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_pow.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv8624/Lib/test Modified Files: test_pow.py Log Message: Added a regression test for the negation-of-exponentiation optimization bug from compile.c. (SF bug #456756.) Index: test_pow.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pow.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_pow.py 2001/07/12 12:51:22 1.8 --- test_pow.py 2001/08/30 18:56:30 1.9 *************** *** 2,5 **** --- 2,8 ---- import test_support + from test_support import verify + + def powtest(type): if type != float: *************** *** 76,79 **** --- 79,90 ---- print 'Testing floating point mode...' powtest(float) + + # Make sure '**' does the right thing; these form a + # regression test for SourceForge bug #456756. + # + verify((-2 ** 2) == -4, + "expected '-2 ** 2' to be -4, got %s" % (-2 ** 2)) + verify(((-2) ** 2) == 4, + "expected '(-2) ** 2' to be 4, got %s" % ((-2) ** 2)) # Other tests-- not very systematic From fdrake@users.sourceforge.net Thu Aug 30 20:15:22 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 30 Aug 2001 12:15:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_pow.py,1.9,1.10 test_unary.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv13624 Modified Files: test_pow.py test_unary.py Log Message: Revert the previous patch to test_pow.py and move the test to test_unary.py based on a suggestion from Tim Peters; also make sure that we're really doing exponentiation and not multiplication. Index: test_pow.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pow.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_pow.py 2001/08/30 18:56:30 1.9 --- test_pow.py 2001/08/30 19:15:20 1.10 *************** *** 2,7 **** import test_support - from test_support import verify - def powtest(type): --- 2,5 ---- *************** *** 79,90 **** print 'Testing floating point mode...' powtest(float) - - # Make sure '**' does the right thing; these form a - # regression test for SourceForge bug #456756. - # - verify((-2 ** 2) == -4, - "expected '-2 ** 2' to be -4, got %s" % (-2 ** 2)) - verify(((-2) ** 2) == 4, - "expected '(-2) ** 2' to be 4, got %s" % ((-2) ** 2)) # Other tests-- not very systematic --- 77,80 ---- Index: test_unary.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unary.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_unary.py 2001/08/27 21:45:32 1.2 --- test_unary.py 2001/08/30 19:15:20 1.3 *************** *** 34,37 **** --- 34,45 ---- self.assert_(eval("~" + nines) == eval("~" + nines + "L")) + def test_negation_of_exponentiation(self): + # Make sure '**' does the right thing; these form a + # regression test for SourceForge bug #456756. + self.assertEqual(-2 ** 3, -8) + self.assertEqual((-2) ** 3, -8) + self.assertEqual(-2 ** 4, -16) + self.assertEqual((-2) ** 4, 16) + def test_bad_types(self): for op in '+', '-', '~': From gvanrossum@users.sourceforge.net Thu Aug 30 21:00:09 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 13:00:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.53,2.54 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv28410 Modified Files: typeobject.c Log Message: Pytype_GenericAlloc(): round up size so we zap all four bytes of the __dict__ slot for string subtypes. subtype_dealloc(): properly use _PyObject_GetDictPtr() to get the (potentially negative) dict offset. Don't copy things into local variables that are used only once. type_new(): properly calculate a negative dict offset when tp_itemsize is nonzero. The __dict__ attribute, if present, is now a calculated attribute rather than a structure member. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.53 retrieving revision 2.54 diff -C2 -d -r2.53 -r2.54 *** typeobject.c 2001/08/30 04:43:35 2.53 --- typeobject.c 2001/08/30 20:00:07 2.54 *************** *** 167,170 **** --- 167,172 ---- PyType_GenericAlloc(PyTypeObject *type, int nitems) { + #define PTRSIZE (sizeof(PyObject *)) + int size; PyObject *obj; *************** *** 172,175 **** --- 174,183 ---- /* Inline PyObject_New() so we can zero the memory */ size = _PyObject_VAR_SIZE(type, nitems); + /* Round up size, if necessary, so we fully zero out __dict__ */ + if (type->tp_itemsize % PTRSIZE != 0) { + size += PTRSIZE - 1; + size /= PTRSIZE; + size *= PTRSIZE; + } if (PyType_IS_GC(type)) { obj = _PyObject_GC_Malloc(type, nitems); *************** *** 203,208 **** subtype_dealloc(PyObject *self) { - int dictoffset = self->ob_type->tp_dictoffset; - int weaklistoffset = self->ob_type->tp_weaklistoffset; PyTypeObject *type, *base; destructor f; --- 211,214 ---- *************** *** 219,233 **** /* If we added a dict, DECREF it */ ! if (dictoffset && !base->tp_dictoffset) { ! PyObject **dictptr = (PyObject **) ((char *)self + dictoffset); ! PyObject *dict = *dictptr; ! if (dict != NULL) { ! Py_DECREF(dict); ! *dictptr = NULL; } } /* If we added weaklist, we clear it */ ! if (weaklistoffset && !base->tp_weaklistoffset) PyObject_ClearWeakRefs(self); --- 225,241 ---- /* If we added a dict, DECREF it */ ! if (type->tp_dictoffset && !base->tp_dictoffset) { ! PyObject **dictptr = _PyObject_GetDictPtr(self); ! if (dictptr != NULL) { ! PyObject *dict = *dictptr; ! if (dict != NULL) { ! Py_DECREF(dict); ! *dictptr = NULL; ! } } } /* If we added weaklist, we clear it */ ! if (type->tp_weaklistoffset && !base->tp_weaklistoffset) PyObject_ClearWeakRefs(self); *************** *** 581,584 **** --- 589,619 ---- static PyObject * + subtype_dict(PyObject *obj, void *context) + { + PyObject **dictptr = _PyObject_GetDictPtr(obj); + PyObject *dict; + + if (dictptr == NULL) { + PyErr_SetString(PyExc_AttributeError, + "This object has no __dict__"); + return NULL; + } + dict = *dictptr; + if (dict == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + else { + Py_INCREF(dict); + return dict; + } + } + + struct getsetlist subtype_getsets[] = { + {"__dict__", subtype_dict, NULL, NULL}, + {0}, + }; + + static PyObject * type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds) { *************** *** 733,737 **** (base->tp_setattro == PyObject_GenericSetAttr || base->tp_setattro == NULL)) { - nslots++; add_dict++; } --- 768,771 ---- *************** *** 830,842 **** else { if (add_dict) { ! type->tp_dictoffset = slotoffset; ! mp->name = "__dict__"; ! mp->type = T_OBJECT; ! mp->offset = slotoffset; ! mp->readonly = 1; ! mp++; slotoffset += sizeof(PyObject *); } if (add_weak) { type->tp_weaklistoffset = slotoffset; mp->name = "__weakref__"; --- 864,876 ---- else { if (add_dict) { ! if (base->tp_itemsize) ! type->tp_dictoffset = -sizeof(PyObject *); ! else ! type->tp_dictoffset = slotoffset; slotoffset += sizeof(PyObject *); + type->tp_getset = subtype_getsets; } if (add_weak) { + assert(!base->tp_itemsize); type->tp_weaklistoffset = slotoffset; mp->name = "__weakref__"; *************** *** 849,852 **** --- 883,887 ---- } type->tp_basicsize = slotoffset; + type->tp_itemsize = base->tp_itemsize; type->tp_members = et->members; From gvanrossum@users.sourceforge.net Thu Aug 30 21:06:11 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 13:06:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv30722 Modified Files: test_descr.py Log Message: Add testcases for inheritance from tricky builtins (numbers, strings, tuples). Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test_descr.py 2001/08/29 15:48:43 1.25 --- test_descr.py 2001/08/30 20:06:08 1.26 *************** *** 1121,1124 **** --- 1121,1197 ---- verify (D().meth(4) == "D(4)C(4)B(4)A(4)") + def inherits(): + if verbose: print "Testing inheritance from basic types..." + + class hexint(int): + def __repr__(self): + return hex(self) + def __add__(self, other): + return hexint(int.__add__(self, other)) + # (Note that overriding __radd__ doesn't work, + # because the int type gets first dibs.) + verify(repr(hexint(7) + 9) == "0x10") + verify(repr(hexint(1000) + 7) == "0x3ef") + + class octlong(long): + __slots__ = [] + def __str__(self): + s = oct(self) + if s[-1] == 'L': + s = s[:-1] + return s + def __add__(self, other): + return self.__class__(super(octlong, self).__add__(other)) + __radd__ = __add__ + verify(str(octlong(3) + 5) == "010") + # (Note that overriding __radd__ here only seems to work + # because the example uses a short int left argument.) + verify(str(5 + octlong(3000)) == "05675") + + class precfloat(float): + __slots__ = ['prec'] + def __init__(self, value=0.0, prec=12): + self.prec = int(prec) + float.__init__(value) + def __repr__(self): + return "%.*g" % (self.prec, self) + verify(repr(precfloat(1.1)) == "1.1") + + class madtuple(tuple): + _rev = None + def rev(self): + if self._rev is not None: + return self._rev + L = list(self) + L.reverse() + self._rev = self.__class__(L) + return self._rev + a = madtuple((1,2,3,4,5,6,7,8,9,0)) + verify(a.rev() == madtuple((0,9,8,7,6,5,4,3,2,1))) + verify(a.rev().rev() == madtuple((1,2,3,4,5,6,7,8,9,0))) + for i in range(512): + t = madtuple(range(i)) + u = t.rev() + v = u.rev() + verify(v == t) + + class madstring(str): + _rev = None + def rev(self): + if self._rev is not None: + return self._rev + L = list(self) + L.reverse() + self._rev = self.__class__("".join(L)) + return self._rev + s = madstring("abcdefghijklmnopqrstuvwxyz") + verify(s.rev() == madstring("zyxwvutsrqponmlkjihgfedcba")) + verify(s.rev().rev() == madstring("abcdefghijklmnopqrstuvwxyz")) + for i in range(256): + s = madstring("".join(map(chr, range(i)))) + t = s.rev() + u = t.rev() + verify(u == s) + def all(): lists() *************** *** 1152,1155 **** --- 1225,1229 ---- getsets() supers() + inherits() all() From tim_one@users.sourceforge.net Thu Aug 30 21:07:57 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 30 Aug 2001 13:07:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.54,2.55 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv31365/python/Objects Modified Files: typeobject.c Log Message: Squash new compiler wng. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -d -r2.54 -r2.55 *** typeobject.c 2001/08/30 20:00:07 2.54 --- typeobject.c 2001/08/30 20:07:55 2.55 *************** *** 865,869 **** if (add_dict) { if (base->tp_itemsize) ! type->tp_dictoffset = -sizeof(PyObject *); else type->tp_dictoffset = slotoffset; --- 865,869 ---- if (add_dict) { if (base->tp_itemsize) ! type->tp_dictoffset = -(long)sizeof(PyObject *); else type->tp_dictoffset = slotoffset; From jhylton@users.sourceforge.net Thu Aug 30 21:25:57 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Thu, 30 Aug 2001 13:25:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler consts.py,1.2,1.3 pyassem.py,1.25,1.26 pycodegen.py,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory usw-pr-cvs1:/tmp/cvs-serv5054/compiler Modified Files: consts.py pyassem.py pycodegen.py Log Message: Fix _convert_NAME() so that it doesn't store locals for class bodies. Fix list comp code generation -- emit GET_ITER instead of Const(0) after the list. Add CO_GENERATOR flag to generators. Get CO_xxx flags from the new module Index: consts.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/consts.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** consts.py 2001/04/12 06:39:24 1.2 --- consts.py 2001/08/30 20:25:54 1.3 *************** *** 1,5 **** ! # code flags ! CO_VARARGS = 1 ! CO_VARKEYWORDS = 2 # operation flags --- 1,4 ---- ! from new import * # import all the CO_xxx flags ! del classobj, code, function, instance, instancemethod, module # operation flags Index: pyassem.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pyassem.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** pyassem.py 2001/08/29 22:27:14 1.25 --- pyassem.py 2001/08/30 20:25:54 1.26 *************** *** 8,11 **** --- 8,13 ---- from compiler import misc + from compiler.consts import CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS, \ + CO_VARKEYWORDS def xxx_sort(l): *************** *** 312,320 **** # flags for code objects - CO_OPTIMIZED = 0x0001 - CO_NEWLOCALS = 0x0002 - CO_VARARGS = 0x0004 - CO_VARKEYWORDS = 0x0008 - CO_NESTED = 0x0010 # the FlowGraph is transformed in place; it exists in one of these states --- 314,317 ---- *************** *** 504,508 **** def _convert_NAME(self, arg): ! self._lookupName(arg, self.varnames) return self._lookupName(arg, self.names) _convert_STORE_NAME = _convert_NAME --- 501,506 ---- def _convert_NAME(self, arg): ! if self.klass is None: ! self._lookupName(arg, self.varnames) return self._lookupName(arg, self.names) _convert_STORE_NAME = _convert_NAME *************** *** 740,746 **** # PRINT_EXPR? 'PRINT_ITEM': -1, - 'LOAD_LOCALS': 1, 'RETURN_VALUE': -1, ! 'EXEC_STMT': -2, 'BUILD_CLASS': -2, 'STORE_NAME': -1, --- 738,743 ---- # PRINT_EXPR? 'PRINT_ITEM': -1, 'RETURN_VALUE': -1, ! 'EXEC_STMT': -3, 'BUILD_CLASS': -2, 'STORE_NAME': -1, *************** *** 757,760 **** --- 754,758 ---- 'SETUP_EXCEPT': 3, 'SETUP_FINALLY': 3, + 'FOR_ITER': 1, } # use pattern match Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** pycodegen.py 2001/08/30 15:50:34 1.48 --- pycodegen.py 2001/08/30 20:25:55 1.49 *************** *** 12,17 **** from compiler import pyassem, misc, future, symbols from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL ! from compiler.pyassem import CO_VARARGS, CO_VARKEYWORDS, CO_NEWLOCALS,\ ! CO_NESTED, TupleArg # Do we have Python 1.x or Python 2.x? --- 12,18 ---- from compiler import pyassem, misc, future, symbols from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL ! from compiler.consts import CO_VARARGS, CO_VARKEYWORDS, CO_NEWLOCALS,\ ! CO_NESTED, CO_GENERATOR ! from compiler.pyassem import TupleArg # Do we have Python 1.x or Python 2.x? *************** *** 496,503 **** self.visit(node.list) ! self.visit(ast.Const(0)) self.nextBlock(start) self.emit('SET_LINENO', node.lineno) ! self.emit('FOR_LOOP', anchor) self.nextBlock() self.visit(node.assign) --- 497,504 ---- self.visit(node.list) ! self.emit('GET_ITER') self.nextBlock(start) self.emit('SET_LINENO', node.lineno) ! self.emit('FOR_ITER', anchor) self.nextBlock() self.visit(node.assign) *************** *** 1200,1203 **** --- 1201,1206 ---- self.graph.setFreeVars(self.scope.get_free_vars()) self.graph.setCellVars(self.scope.get_cell_vars()) + if self.scope.generator is not None: + self.graph.setFlag(CO_GENERATOR) ## self.graph.setFlag(CO_NESTED) From gvanrossum@users.sourceforge.net Thu Aug 30 21:26:07 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 13:26:07 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects object.c,2.141,2.142 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv5113 Modified Files: object.c Log Message: PyObject_Repr(): add missing ">" back at end of format string: "<%s object at %p>". Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.141 retrieving revision 2.142 diff -C2 -d -r2.141 -r2.142 *** object.c 2001/08/29 23:54:03 2.141 --- object.c 2001/08/30 20:26:05 2.142 *************** *** 213,217 **** return PyString_FromString(""); else if (v->ob_type->tp_repr == NULL) ! return PyString_FromFormat("<%s object at %p", v->ob_type->tp_name, v); else { --- 213,217 ---- return PyString_FromString(""); else if (v->ob_type->tp_repr == NULL) ! return PyString_FromFormat("<%s object at %p>", v->ob_type->tp_name, v); else { From tim_one@users.sourceforge.net Thu Aug 30 21:52:01 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 30 Aug 2001 13:52:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.218,1.219 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv10452/python/Misc Modified Files: NEWS Log Message: SF patch #455966: Allow leading 0 in float/imag literals. Consequences for Jython still unknown (but raised on Jython-Dev). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.218 retrieving revision 1.219 diff -C2 -d -r1.218 -r1.219 *** NEWS 2001/08/30 15:38:01 1.218 --- NEWS 2001/08/30 20:51:59 1.219 *************** *** 4,7 **** --- 4,13 ---- Core + + The syntax of floating-point and imaginary literals has been + liberalized, to allow leading zeroes. Examples of literals now + legal that were SyntaxErrors before: + + 00.0 0e3 0100j 07.5 00000000000000000008. + + An old tokenizer bug allowed floating point literals with an incomplete exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError. *************** *** 28,38 **** - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC ! - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and PyObject_GC_Del to deallocate them ! - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini to PyObject_GC_UnTrack ! - remove PyGC_HEAD_SIZE from object size calculations --- 34,44 ---- - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC ! - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and PyObject_GC_Del to deallocate them ! - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini to PyObject_GC_UnTrack ! - remove PyGC_HEAD_SIZE from object size calculations From tim_one@users.sourceforge.net Thu Aug 30 21:52:01 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 30 Aug 2001 13:52:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_compile.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv10452/python/Lib/test Modified Files: test_compile.py Log Message: SF patch #455966: Allow leading 0 in float/imag literals. Consequences for Jython still unknown (but raised on Jython-Dev). Index: test_compile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_compile.py 2001/08/27 19:19:28 1.7 --- test_compile.py 2001/08/30 20:51:59 1.8 *************** *** 66,67 **** --- 66,111 ---- expect_error("1e-") expect_error("3-4e/21") + + + if verbose: + print "testing literals with leading zeroes" + + def expect_same(test_source, expected): + got = eval(test_source) + if got != expected: + raise TestFailed("eval(%r) gave %r, but expected %r" % + (test_source, got, expected)) + + expect_error("077787") + expect_error("0xj") + expect_error("0x.") + expect_error("0e") + expect_same("0777", 511) + expect_same("0777L", 511) + expect_same("000777", 511) + expect_same("0xff", 255) + expect_same("0xffL", 255) + expect_same("0XfF", 255) + expect_same("0777.", 777) + expect_same("0777.0", 777) + expect_same("000000000000000000000000000000000000000000000000000777e0", 777) + expect_same("0777e1", 7770) + expect_same("0e0", 0) + expect_same("0000E-012", 0) + expect_same("09.5", 9.5) + expect_same("0777j", 777j) + expect_same("00j", 0j) + expect_same("00.0", 0) + expect_same("0e3", 0) + expect_same("090000000000000.", 90000000000000.) + expect_same("090000000000000.0000000000000000000000", 90000000000000.) + expect_same("090000000000000e0", 90000000000000.) + expect_same("090000000000000e-0", 90000000000000.) + expect_same("090000000000000j", 90000000000000j) + expect_error("090000000000000") # plain octal literal w/ decimal digit + expect_error("080000000000000") # plain octal literal w/ decimal digit + expect_error("000000000000009") # plain octal literal w/ decimal digit + expect_error("000000000000008") # plain octal literal w/ decimal digit + expect_same("000000000000007", 7) + expect_same("000000000000008.", 8.) + expect_same("000000000000009.", 9.) From tim_one@users.sourceforge.net Thu Aug 30 21:52:01 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 30 Aug 2001 13:52:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref2.tex,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv10452/python/Doc/ref Modified Files: ref2.tex Log Message: SF patch #455966: Allow leading 0 in float/imag literals. Consequences for Jython still unknown (but raised on Jython-Dev). Index: ref2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ref2.tex 2001/08/14 21:43:31 1.30 --- ref2.tex 2001/08/30 20:51:58 1.31 *************** *** 518,525 **** {[\token{intpart}] \token{fraction} | \token{intpart} "."} \production{exponentfloat} ! {(\token{nonzerodigit} \token{digit}* | \token{pointfloat}) \token{exponent}} \production{intpart} ! {\token{nonzerodigit} \token{digit}* | "0"} \production{fraction} {"." \token{digit}+} --- 518,525 ---- {[\token{intpart}] \token{fraction} | \token{intpart} "."} \production{exponentfloat} ! {(\token{intpart} | \token{pointfloat}) \token{exponent}} \production{intpart} ! {\token{digit}+} \production{fraction} {"." \token{digit}+} *************** *** 528,535 **** \end{productionlist} ! Note that the integer part of a floating point number cannot look like ! an octal integer, though the exponent may look like an octal literal ! but will always be interpreted using radix 10. For example, ! \samp{1e010} is legal, while \samp{07.1} is a syntax error. The allowed range of floating point literals is implementation-dependent. --- 528,535 ---- \end{productionlist} ! Note that the integer and exponent parts of floating point numbers ! can look like octal integers, but are interpreted using radix 10. For ! example, \samp{077e010} is legal, and denotes the same number ! as \samp{77e10}. The allowed range of floating point literals is implementation-dependent. *************** *** 537,541 **** \begin{verbatim} ! 3.14 10. .001 1e100 3.14e-10 \end{verbatim} --- 537,541 ---- \begin{verbatim} ! 3.14 10. .001 1e100 3.14e-10 0e0 \end{verbatim} From tim_one@users.sourceforge.net Thu Aug 30 21:52:01 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 30 Aug 2001 13:52:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Parser tokenizer.c,2.52,2.53 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory usw-pr-cvs1:/tmp/cvs-serv10452/python/Parser Modified Files: tokenizer.c Log Message: SF patch #455966: Allow leading 0 in float/imag literals. Consequences for Jython still unknown (but raised on Jython-Dev). Index: tokenizer.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/tokenizer.c,v retrieving revision 2.52 retrieving revision 2.53 diff -C2 -d -r2.52 -r2.53 *** tokenizer.c 2001/08/27 19:19:28 2.52 --- tokenizer.c 2001/08/30 20:51:59 2.53 *************** *** 723,727 **** if (isdigit(c)) { if (c == '0') { ! /* Hex or octal */ c = tok_nextc(tok); if (c == '.') --- 723,727 ---- if (isdigit(c)) { if (c == '0') { ! /* Hex or octal -- maybe. */ c = tok_nextc(tok); if (c == '.') *************** *** 738,743 **** } else { ! /* XXX This is broken! E.g., ! 09.9 should be accepted as float! */ /* Octal; c is first char of it */ /* There's no 'isoctdigit' macro, sigh */ --- 738,742 ---- } else { ! int found_decimal = 0; /* Octal; c is first char of it */ /* There's no 'isoctdigit' macro, sigh */ *************** *** 745,748 **** --- 744,766 ---- c = tok_nextc(tok); } + if (isdigit(c)) { + found_decimal = 1; + do { + c = tok_nextc(tok); + } while (isdigit(c)); + } + if (c == '.') + goto fraction; + else if (c == 'e' || c == 'E') + goto exponent; + #ifndef WITHOUT_COMPLEX + else if (c == 'j' || c == 'J') + goto imaginary; + #endif + else if (found_decimal) { + tok->done = E_TOKEN; + tok_backup(tok, c); + return ERRORTOKEN; + } } if (c == 'l' || c == 'L') *************** *** 766,769 **** --- 784,788 ---- } if (c == 'e' || c == 'E') { + exponent: /* Exponent part */ c = tok_nextc(tok); From tim_one@users.sourceforge.net Thu Aug 30 21:52:01 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 30 Aug 2001 13:52:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib tokenize.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10452/python/Lib Modified Files: tokenize.py Log Message: SF patch #455966: Allow leading 0 in float/imag literals. Consequences for Jython still unknown (but raised on Jython-Dev). Index: tokenize.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/tokenize.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tokenize.py 2001/08/08 05:04:07 1.27 --- tokenize.py 2001/08/30 20:51:58 1.28 *************** *** 57,63 **** Exponent = r'[eE][-+]?\d+' Pointfloat = group(r'\d+\.\d*', r'\.\d+') + maybe(Exponent) ! Expfloat = r'[1-9]\d*' + Exponent Floatnumber = group(Pointfloat, Expfloat) ! Imagnumber = group(r'0[jJ]', r'[1-9]\d*[jJ]', Floatnumber + r'[jJ]') Number = group(Imagnumber, Floatnumber, Intnumber) --- 57,63 ---- Exponent = r'[eE][-+]?\d+' Pointfloat = group(r'\d+\.\d*', r'\.\d+') + maybe(Exponent) ! Expfloat = r'\d+' + Exponent Floatnumber = group(Pointfloat, Expfloat) ! Imagnumber = group(r'\d+[jJ]', Floatnumber + r'[jJ]') Number = group(Imagnumber, Floatnumber, Intnumber) From gvanrossum@users.sourceforge.net Thu Aug 30 21:52:42 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 13:52:42 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv10900 Modified Files: test_descr.py Log Message: metaclass(): add some more examples of metaclasses, including one using cooperative multiple inheritance. inherits(): add a test for subclassing the unicode type. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** test_descr.py 2001/08/30 20:06:08 1.26 --- test_descr.py 2001/08/30 20:52:40 1.27 *************** *** 393,396 **** --- 393,397 ---- c = C() verify(c.__spam__ == 1) + class _instance(object): pass *************** *** 421,424 **** --- 422,515 ---- verify(c.spam() == 42) + # More metaclass examples + + class autosuper(type): + # Automatically add __super to the class + # This trick only works for dynamic classes + # so we force __dynamic__ = 1 + def __new__(metaclass, name, bases, dict): + # XXX Should check that name isn't already a base class name + dict["__dynamic__"] = 1 + cls = super(autosuper, metaclass).__new__(metaclass, + name, bases, dict) + while name[:1] == "_": + name = name[1:] + while name[-1:] == "_": + name = name[:-1] + if name: + name = "_%s__super" % name + else: + name = "__super" + setattr(cls, name, super(cls)) + return cls + class A: + __metaclass__ = autosuper + def meth(self): + return "A" + class B(A): + def meth(self): + return "B" + self.__super.meth() + class C(A): + def meth(self): + return "C" + self.__super.meth() + class D(C, B): + def meth(self): + return "D" + self.__super.meth() + verify(D().meth() == "DCBA") + class E(B, C): + def meth(self): + return "E" + self.__super.meth() + verify(E().meth() == "EBCA") + + class autogetset(type): + # Automatically create getset attributes when methods + # named _get_x and/or _set_x are found + def __new__(metaclass, name, bases, dict): + hits = {} + for key, val in dict.iteritems(): + if key.startswith("_get_"): + key = key[5:] + get, set = hits.get(key, (None, None)) + get = val + hits[key] = get, set + elif key.startswith("_set_"): + key = key[5:] + get, set = hits.get(key, (None, None)) + set = val + hits[key] = get, set + for key, (get, set) in hits.iteritems(): + dict[key] = getset(get, set) + return super(autogetset, metaclass).__new__(metaclass, + name, bases, dict) + class A: + __metaclass__ = autogetset + def _get_x(self): + return -self.__x + def _set_x(self, x): + self.__x = -x + a = A() + verify(not hasattr(a, "x")) + a.x = 12 + verify(a.x == 12) + verify(a._A__x == -12) + + class multimetaclass(autogetset, autosuper): + # Merge of multiple cooperating metaclasses + pass + class A: + __metaclass__ = multimetaclass + def _get_x(self): + return "A" + class B(A): + def _get_x(self): + return "B" + self.__super._get_x() + class C(A): + def _get_x(self): + return "C" + self.__super._get_x() + class D(C, B): + def _get_x(self): + return "D" + self.__super._get_x() + verify(D().x == "DCBA") + def pymods(): if verbose: print "Testing Python subclass of module..." *************** *** 1193,1196 **** --- 1284,1300 ---- u = t.rev() verify(u == s) + + class madunicode(unicode): + _rev = None + def rev(self): + if self._rev is not None: + return self._rev + L = list(self) + L.reverse() + self._rev = self.__class__(u"".join(L)) + return self._rev + u = madunicode("ABCDEF") + verify(u.rev() == madunicode(u"FEDCBA")) + verify(u.rev().rev() == madunicode(u"ABCDEF")) def all(): From gvanrossum@users.sourceforge.net Thu Aug 30 22:18:06 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 14:18:06 -0700 Subject: [Python-checkins] CVS: python/dist/src PLAN.txt,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv15776 Modified Files: PLAN.txt Log Message: Group some projects into "Done" and "To do". Get rid of Tim's merge scratchpad -- the merge is long behind us. Index: PLAN.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PLAN.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PLAN.txt 2001/08/09 20:25:58 1.6 --- PLAN.txt 2001/08/30 21:18:04 1.7 *************** *** 2,11 **** **************************** ! Tasks: ! ! Do binary operators properly. nb_add should try to call self.__add__ ! and other.__radd__. I think I'll exclude base types that define any ! binary operator without setting the CHECKTYPES flag. *** This is ! done, AFAICT. Even supports __truediv__ and __floordiv__. *** Fix comparisons. There's some nasty stuff here: when two types are --- 2,7 ---- **************************** ! Still to do ! ----------- Fix comparisons. There's some nasty stuff here: when two types are *************** *** 14,17 **** --- 10,39 ---- base type that defines a comparison. + Check for conflicts between base classes. I fear that the rules used + to decide whether multiple bases have conflicting instance variables + aren't strict enough. I think that sometimes two different classes + adding __dict__ may be incompatible after all. + + Check for order conflicts. Suppose there are two base classes X and + Y. Suppose class B derives from X and Y, and class C from Y and X (in + that order). Now suppose class D derives from B and C. In which + order should the base classes X and Y be searched? This is an order + conflict, and should be disallowed; currently the test for this is not + implemented. + + Allow __class__ assignment. + + Make __dynamic__ the default. + + Add __del__ handlers. + + Done (mostly) + ------------- + + Do binary operators properly. nb_add should try to call self.__add__ + and other.__radd__. I think I'll exclude base types that define any + binary operator without setting the CHECKTYPES flag. *** This is + done, AFAICT. Even supports __truediv__ and __floordiv__. *** + Fix subtype_dealloc(). This currently searches through the list of base types until it finds a type whose tp_dealloc is not *************** *** 33,48 **** called where PyType_IsSubtype() would be more appropriate. *** - Check for conflicts between base classes. I fear that the rules used - to decide whether multiple bases have conflicting instance variables - aren't strict enough. I think that sometimes two different classes - adding __dict__ may be incompatible after all. - - Check for order conflicts. Suppose there are two base classes X and - Y. Suppose class B derives from X and Y, and class C from Y and X (in - that order). Now suppose class D derives from B and C. In which - order should the base classes X and Y be searched? This is an order - conflict, and should be disallowed; currently the test for this is not - implemented. - Clean up the GC interface. Currently, tp_basicsize includes the GC head size iff tp_flags includes the GC flag bit. This makes object --- 55,58 ---- *************** *** 55,59 **** different flag bit). *** Tim proposed a better idea: macros to access tp_basicsize while hiding the nastiness. This is done now, so I think ! the rest of this task needn't be done. *** Make the __dict__ of types declared with Python class statements --- 65,70 ---- different flag bit). *** Tim proposed a better idea: macros to access tp_basicsize while hiding the nastiness. This is done now, so I think ! the rest of this task needn't be done. *** *** Neil checked in a ! much improved version of his idea, and it's all squared away. *** Make the __dict__ of types declared with Python class statements *************** *** 110,121 **** ************************************** ! Tasks: ! ! Make more (most?) built-in types act as their own factory functions. ! ! Make more (most?) built-in types subtypable -- with or without ! overridable allocation. *** This includes descriptors! It should be ! possible to write descriptors in Python, so metaclasses can do clever ! things with them. *** Exceptions should be types. This changes the rules, since now almost --- 121,126 ---- ************************************** ! Still to do ! ----------- Exceptions should be types. This changes the rules, since now almost *************** *** 145,149 **** --- 150,166 ---- parts. + Done (mostly) + ------------- + + Make more (most?) built-in types act as their own factory functions. + *** Done for all reasonable built-in types. *** + + Make more (most?) built-in types subtypable -- with or without + overridable allocation. *** This includes descriptors! It should be + possible to write descriptors in Python, so metaclasses can do clever + things with them. *** *** Done for most reasonable built-in types, + except for descriptors *** + Project: making classes use the new machinery ********************************************* *************** *** 155,159 **** compatibility? This is underspecified because I haven't thought much about it yet. Can we lose the use of PyInstance_Check() everywhere? ! I would hope so! --- 172,177 ---- compatibility? This is underspecified because I haven't thought much about it yet. Can we lose the use of PyInstance_Check() everywhere? ! I would hope so! *** I'm dropping this goal for now -- classic ! classes will be 99% unchanged. *** *************** *** 277,463 **** prototype implementation to test. Try to do this *before* casting everything in stone! - - MERGE BEGIN **************************************************************** - Merge details (this section is Tim's scratchpad, but should help a lot if - he dies of frustration while wrestling with CVS <0.9 wink>). - ---------------------------------------------------------------------------- - 2001-08-01 Merging descr-branch back into trunk. - - Tagged trunk about 22:05: - cvs tag date2001-08-01 python - - Merged trunk delta into branch: - cvs -q -z3 up -j date2001-07-30 -j date2001-08-01 descr - - No conflicts (! first time ever!) ... but problems with pythoncore.dsp. - Resolved. - - Rebuilt from scratch; ran all tests; checked into branch about 22:40. - - Merged descr-branch back into trunk (SEE BELOW -- this specific way of - doing it was a bad idea): - - cvs -q -z3 up -j descr-branch python - - 34 conflicts. Hmm! OK, looks like every file in the project with an - embedded RCS Id is "a conflict". Others make no sense, e.g., a dozen - conflicts in dictobject.c, sometimes enclosing identical(!) blobs of - source code. And CVS remains utterly baffled by Python type object decls. - Every line of ceval.c's generator code is in conflict blocks ... OK, - there's no pattern or sense here, I'll just deal with it. - - Conflicts resolved; rebuilt from scratch; test_weakref fails. Didn't find - an obvious reason and it was late, so committed it anyway. Tagged the - trunk then with tag: - - after-descr-branch-merge - - Tracked the test_weakref failure to a botched conflict resolution in - classobject.c; checked in a fix. - - LATER: The merge should have been done via: - - upd -j date2001-08-01 -j descr-branch python - - instead. This would have caused only one conflict, a baffler in - bltinmodule.c. It would have avoided the classobject.c error I made. - Luckily, except for that one, we got to the same place in the end anyway, - apart from a few curious tabs-vs-spaces differences. - ---------------------------------------------------------------------------- - 2001-07-30 - - Doing this again while the expat and Windows installer changes are still - fresh on my mind. - - Tagged trunk about 23:50 EDT on the 29th: - cvs tag date2001-07-30 python - - Merged trunk delta into branch: - - cvs -q -z3 up -j date2001-07-28 -j date2001-07-30 descr - - 2 conflicts, resolved. - ---------------------------------------------------------------------------- - 2001-07-28 - - Tagged trunk about 00:31 EDT: - cvs tag date2001-07-28 python - - Merged trunk delta into branch: - cvs -q -z3 up -j date2001-07-21 -j date2001-07-28 descr - - 4 conflicts, all RCS Ids. Resolved. - ---------------------------------------------------------------------------- - 2001-07-21 - - Tagged trunk about 01:00 EDT: - cvs tag date2001-07-21 python - - Merged trunk delta into branch: - cvs -q -z3 up -j date2001-07-17b -j date2001-07-21 descr - - 4 conflicts, mostly RCS Id thingies. Resolved. - - Legit failure in new test_repr, because repr.py dispatches on the exact - string returned by type(x). type(1L) and type('s') differ in descr-branch - now, and repr.py didn't realize that, falling back to the "unknown type" - case for longs and strings. Repaired descr-branch repr.py. - ---------------------------------------------------------------------------- - 2001-07-19 - - Removed the r22a1-branch tag (see next entry). Turns out Guido did add a - r22a1 tag, so the r22a1-branch tag served no point anymore. - ---------------------------------------------------------------------------- - 2001-07-18 2.2a1 releaase - - Immediately after the merge just below, I tagged descr-branch via - - cvs tag r22a1-branch descr - - Guido may or may not want to add another tag here (? maybe he wants to do - some more Unix fiddling first). - ---------------------------------------------------------------------------- - 2001-07-17 building 2.2a1 release, from descr-branch - - Tagged trunk about 22:00 EDT, like so: - cvs tag date2001-07-17b python - - Merged trunk delta into branch via: - cvs -q -z3 up -j date2001-07-17a -j date2001-07-17b descr - ---------------------------------------------------------------------------- - 2001-07-17 - - Tagged trunk about 00:05 EDT, like so: - cvs tag date2001-07-17a python - - Merged trunk delta into branch via: - cvs -q -z3 up -j date2001-07-16 -j date2001-07-17a descr - ---------------------------------------------------------------------------- - 2001-07-16 - - Tagged trunk about 15:20 EDT, like so: - cvs tag date2001-07-16 python - - Guido then added all the other dist/ directories to descr-branch from that - trunk tag. - - Tim then merged trunk delta into the branch via: - cvs -q -z3 up -j date2001-07-15 -j date2001-07-16 descr - ---------------------------------------------------------------------------- - 2001-07-15 - - Tagged trunk about 15:44 EDT, like so: - cvs tag date2001-07-15 python - - Merged trunk delta into branch via: - cvs -q -z3 up -j date2001-07-13 -j date2001-07-15 descr - - Four files with conflicts, all artificial RCS Id & Revision thingies. - Resolved and committed. - ---------------------------------------------------------------------------- - 2001-07-13 - - Tagged trunk about 22:13 EDT, like so: - cvs tag date2001-07-13 python - - Merged trunk delta into branch via: - cvs -q -z3 up -j date2001-07-06 -j date2001-07-13 descr - - Six(!) files with conflicts, mostly related to NeilS's generator gc patches. - Unsure why, but CVS seems always to think there are conflicts whenever a - line in a type object decl gets changed, and the conflict marking seems - maximally confused in these cases. Anyway, since I reviewed those patches - on the trunk, good thing I'm merging them, and darned glad it's still fresh - on my mind. - - Resolved the conflicts, and committed the changes in a few hours total. - ---------------------------------------------------------------------------- - 2001-07-07 - - Merge of trunk tag date2001-07-06 into descr-branch, via - cvs -q -z3 up -j date2001-07-06 mergedescr - was committed on 2001-07-07. - - Merge issues: - - (all resolved -- GvR) - ---------------------------------------------------------------------------- - 2001-07-06 - - Tagged trunk a bit after midnight, like so: - - C:\Code>cvs tag date2001-07-06 python - cvs server: Tagging python - cvs server: Tagging python/dist - cvs server: Tagging python/dist/src - T python/dist/src/.cvsignore - T python/dist/src/LICENSE - T python/dist/src/Makefile.pre.in - T python/dist/src/README - ... [& about 3000 lines more] ... - - This is the first trunk snapshot to be merged into the descr-branch. - Gave it a date instead of a goofy name because there's going to be more - than one of these, and at least it's obvious which of two ISO dates comes - earlier. These tags should go away after all merging is complete. - MERGE END ****************************************************************** --- 295,296 ---- From jackjansen@users.sourceforge.net Thu Aug 30 22:19:44 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 30 Aug 2001 14:19:44 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib macresource.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv16160/Python/Mac/Lib Modified Files: macresource.py Log Message: We should look in the directory containing the module, not in the module itself, when we're looking for the resource file. Index: macresource.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/macresource.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** macresource.py 2001/08/27 21:37:45 1.2 --- macresource.py 2001/08/30 21:19:42 1.3 *************** *** 50,54 **** mod = sys.modules[modname] if hasattr(mod, '__file__'): ! searchdirs = [mod.__file__] if not searchdirs: searchdirs = sys.path --- 50,54 ---- mod = sys.modules[modname] if hasattr(mod, '__file__'): ! searchdirs = [os.path.split(mod.__file__)[0]] if not searchdirs: searchdirs = sys.path From jackjansen@users.sourceforge.net Thu Aug 30 22:22:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 30 Aug 2001 14:22:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Contrib/BBPy PythonSlave.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/BBPy In directory usw-pr-cvs1:/tmp/cvs-serv16674/Python/Mac/Contrib/BBPy Modified Files: PythonSlave.py Log Message: Case mismatch in "import Types". Apparently nobody has looked at this for a looooong time. Reported by Chris Smith. Index: PythonSlave.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/BBPy/PythonSlave.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PythonSlave.py 2001/08/25 12:10:52 1.3 --- PythonSlave.py 2001/08/30 21:22:10 1.4 *************** *** 16,23 **** import string from Carbon import AE ! from Carbon import EasyDialogs import os from Carbon import Qd ! from Types import * from Carbon.Events import charCodeMask, cmdKey import MacOS --- 16,23 ---- import string from Carbon import AE ! import EasyDialogs import os from Carbon import Qd ! from types import * from Carbon.Events import charCodeMask, cmdKey import MacOS From jackjansen@users.sourceforge.net Thu Aug 30 22:29:59 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 30 Aug 2001 14:29:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build xx.prj,1.7,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv18680/Python/Mac/Build Removed Files: xx.prj Log Message: Superseded by the (generated) xx.mcp. --- xx.prj DELETED --- From tim_one@users.sourceforge.net Thu Aug 30 23:05:28 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 30 Aug 2001 15:05:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib ntpath.py,1.40,1.41 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv29850/python/Lib Modified Files: ntpath.py Log Message: SF bug #456621: normpath on Win32 not collapsing c:\\.. I actually rewrote normpath quite a bit: it had no test cases, and as soon as I starting writing some I found several cases that didn't make sense. Index: ntpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ntpath.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** ntpath.py 2001/07/27 08:09:54 1.40 --- ntpath.py 2001/08/30 22:05:26 1.41 *************** *** 408,412 **** ! # Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B. # Previously, this function also truncated pathnames to 8+3 format, # but as this module is called "ntpath", that's obviously wrong! --- 408,412 ---- ! # Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A\B. # Previously, this function also truncated pathnames to 8+3 format, # but as this module is called "ntpath", that's obviously wrong! *************** *** 422,434 **** i = 0 while i < len(comps): ! if comps[i] == '.': ! del comps[i] ! elif comps[i] == '..' and i > 0 and comps[i-1] not in ('', '..'): ! del comps[i-1:i+1] ! i = i - 1 ! elif comps[i] == '' and i > 0 and comps[i-1] != '': del comps[i] else: ! i = i + 1 # If the path is now empty, substitute '.' if not prefix and not comps: --- 422,437 ---- i = 0 while i < len(comps): ! if comps[i] in ('.', ''): del comps[i] + elif comps[i] == '..': + if i > 0 and comps[i-1] != '..': + del comps[i-1:i+1] + i -= 1 + elif i == 0 and prefix.endswith("\\"): + del comps[i] + else: + i += 1 else: ! i += 1 # If the path is now empty, substitute '.' if not prefix and not comps: From tim_one@users.sourceforge.net Thu Aug 30 23:05:28 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 30 Aug 2001 15:05:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_ntpath.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv29850/python/Lib/test Modified Files: test_ntpath.py Log Message: SF bug #456621: normpath on Win32 not collapsing c:\\.. I actually rewrote normpath quite a bit: it had no test cases, and as soon as I starting writing some I found several cases that didn't make sense. Index: test_ntpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_ntpath.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_ntpath.py 2001/07/27 08:09:54 1.11 --- test_ntpath.py 2001/08/30 22:05:26 1.12 *************** *** 75,78 **** --- 75,102 ---- tester("ntpath.join('c:/', 'd:/a/b')", 'd:/a/b') + tester("ntpath.normpath('A//////././//.//B')", r'A\B') + tester("ntpath.normpath('A/./B')", r'A\B') + tester("ntpath.normpath('A/foo/../B')", r'A\B') + tester("ntpath.normpath('C:A//B')", r'C:A\B') + tester("ntpath.normpath('D:A/./B')", r'D:A\B') + tester("ntpath.normpath('e:A/foo/../B')", r'e:A\B') + + # Next 3 seem dubious, and especially the 3rd, but normpath is possibly + # trying to leave UNC paths alone without actually knowing anything about + # them. + tester("ntpath.normpath('C:///A//B')", r'C:\\\A\B') + tester("ntpath.normpath('D:///A/./B')", r'D:\\\A\B') + tester("ntpath.normpath('e:///A/foo/../B')", r'e:\\\A\B') + + tester("ntpath.normpath('..')", r'..') + tester("ntpath.normpath('.')", r'.') + tester("ntpath.normpath('')", r'.') + tester("ntpath.normpath('/')", '\\') + tester("ntpath.normpath('c:/')", 'c:\\') + tester("ntpath.normpath('/../.././..')", '\\') + tester("ntpath.normpath('c:/../../..')", 'c:\\') + tester("ntpath.normpath('../.././..')", r'..\..\..') + tester("ntpath.normpath('K:../.././..')", r'K:..\..\..') + if errors: raise TestFailed(str(errors) + " errors.") From jackjansen@users.sourceforge.net Thu Aug 30 23:10:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 30 Aug 2001 15:10:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions/(vise) Python 2.2.vct,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory usw-pr-cvs1:/tmp/cvs-serv30893/Python/Mac/Distributions/(vise) Modified Files: Python 2.2.vct Log Message: Added all the new files in the right packages and file groups (I think, untested). Index: Python 2.2.vct =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/(vise)/Python 2.2.vct,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsKgzYI6 and /tmp/cvss35mP5 differ From gvanrossum@users.sourceforge.net Fri Aug 31 00:13:13 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 16:13:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.55,2.56 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13328 Modified Files: typeobject.c Log Message: Give 'super' a decent repr(), and readonly attributes to access the type and obj properties. The "bogus super object" message is gone -- this will now just raise an AttributeError. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.55 retrieving revision 2.56 diff -C2 -d -r2.55 -r2.56 *** typeobject.c 2001/08/30 20:07:55 2.55 --- typeobject.c 2001/08/30 23:13:11 2.56 *************** *** 3160,3163 **** --- 3160,3169 ---- } superobject; + static struct memberlist super_members[] = { + {"__type__", T_OBJECT, offsetof(superobject, type), READONLY}, + {"__obj__", T_OBJECT, offsetof(superobject, obj), READONLY}, + {0} + }; + static void super_dealloc(PyObject *self) *************** *** 3171,3174 **** --- 3177,3196 ---- static PyObject * + super_repr(PyObject *self) + { + superobject *su = (superobject *)self; + + if (su->obj) + return PyString_FromFormat( + ", <%s object>>", + su->type ? su->type->tp_name : "NULL", + su->obj->ob_type->tp_name); + else + return PyString_FromFormat( + ", NULL>", + su->type ? su->type->tp_name : "NULL"); + } + + static PyObject * super_getattro(PyObject *self, PyObject *name) { *************** *** 3181,3186 **** mro = su->obj->ob_type->tp_mro; ! assert(mro != NULL && PyTuple_Check(mro)); ! n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if ((PyObject *)(su->type) == PyTuple_GET_ITEM(mro, i)) --- 3203,3212 ---- mro = su->obj->ob_type->tp_mro; ! if (mro == NULL) ! n = 0; ! else { ! assert(PyTuple_Check(mro)); ! n = PyTuple_GET_SIZE(mro); ! } for (i = 0; i < n; i++) { if ((PyObject *)(su->type) == PyTuple_GET_ITEM(mro, i)) *************** *** 3189,3194 **** if (i >= n && PyType_Check(su->obj)) { mro = ((PyTypeObject *)(su->obj))->tp_mro; ! assert(mro != NULL && PyTuple_Check(mro)); ! n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if ((PyObject *)(su->type) == --- 3215,3224 ---- if (i >= n && PyType_Check(su->obj)) { mro = ((PyTypeObject *)(su->obj))->tp_mro; ! if (mro == NULL) ! n = 0; ! else { ! assert(PyTuple_Check(mro)); ! n = PyTuple_GET_SIZE(mro); ! } for (i = 0; i < n; i++) { if ((PyObject *)(su->type) == *************** *** 3196,3204 **** break; } - if (i >= n) { - PyErr_SetString(PyExc_TypeError, - "bogus super object"); - return NULL; - } } i++; --- 3226,3229 ---- *************** *** 3293,3297 **** 0, /* tp_setattr */ 0, /* tp_compare */ ! 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ --- 3318,3322 ---- 0, /* tp_setattr */ 0, /* tp_compare */ ! super_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ *************** *** 3312,3316 **** 0, /* tp_iternext */ 0, /* tp_methods */ ! 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ --- 3337,3341 ---- 0, /* tp_iternext */ 0, /* tp_methods */ ! super_members, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ From gvanrossum@users.sourceforge.net Fri Aug 31 05:35:16 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 30 Aug 2001 21:35:16 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv20206 Modified Files: test_descr.py Log Message: Correct name mangling algorithm, and add a comment. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** test_descr.py 2001/08/30 20:52:40 1.27 --- test_descr.py 2001/08/31 04:35:14 1.28 *************** *** 433,440 **** cls = super(autosuper, metaclass).__new__(metaclass, name, bases, dict) while name[:1] == "_": name = name[1:] - while name[-1:] == "_": - name = name[:-1] if name: name = "_%s__super" % name --- 433,439 ---- cls = super(autosuper, metaclass).__new__(metaclass, name, bases, dict) + # Name mangling for __super removes leading underscores while name[:1] == "_": name = name[1:] if name: name = "_%s__super" % name From gvanrossum@users.sourceforge.net Fri Aug 31 17:11:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 31 Aug 2001 09:11:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects stringobject.c,2.128,2.129 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv20697 Modified Files: stringobject.c Log Message: Fix a memory leak in str_subtype_new(). (All the other xxx_subtype_new() functions are OK, but I goofed up in this one. :-( ) Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.128 retrieving revision 2.129 diff -C2 -d -r2.128 -r2.129 *** stringobject.c 2001/08/30 03:11:59 2.128 --- stringobject.c 2001/08/31 16:11:15 2.129 *************** *** 2714,2720 **** assert(PyString_Check(tmp)); new = type->tp_alloc(type, n = PyString_GET_SIZE(tmp)); ! if (new == NULL) ! return NULL; ! memcpy(PyString_AS_STRING(new), PyString_AS_STRING(tmp), n+1); return new; } --- 2714,2720 ---- assert(PyString_Check(tmp)); new = type->tp_alloc(type, n = PyString_GET_SIZE(tmp)); ! if (new != NULL) ! memcpy(PyString_AS_STRING(new), PyString_AS_STRING(tmp), n+1); ! Py_DECREF(tmp); return new; } From gvanrossum@users.sourceforge.net Fri Aug 31 18:40:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 31 Aug 2001 10:40:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include pydebug.h,2.17,2.18 pythonrun.h,2.47,2.48 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv8024/Include Modified Files: pydebug.h pythonrun.h Log Message: Add warning mode for classic division, almost exactly as specified in PEP 238. Changes: - add a new flag variable Py_DivisionWarningFlag, declared in pydebug.h, defined in object.c, set in main.c, and used in {int,long,float,complex}object.c. When this flag is set, the classic division operator issues a DeprecationWarning message. - add a new API PyRun_SimpleStringFlags() to match PyRun_SimpleString(). The main() function calls this so that commands run with -c can also benefit from -Dnew. - While I was at it, I changed the usage message in main() somewhat: alphabetized the options, split it in *four* parts to fit in under 512 bytes (not that I still believe this is necessary -- doc strings elsewhere are much longer), and perhaps most visibly, don't display the full list of options on each command line error. Instead, the full list is only displayed when -h is used, and otherwise a brief reminder of -h is displayed. When -h is used, write to stdout so that you can do `python -h | more'. Notes: - I don't want to use the -W option to control whether the classic division warning is issued or not, because the machinery to decide whether to display the warning or not is very expensive (it involves calling into the warnings.py module). You can use -Werror to turn the warnings into exceptions though. - The -Dnew option doesn't select future division for all of the program -- only for the __main__ module. I don't know if I'll ever change this -- it would require changes to the .pyc file magic number to do it right, and a more global notion of compiler flags. - You can usefully combine -Dwarn and -Dnew: this gives the __main__ module new division, and warns about classic division everywhere else. Index: pydebug.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pydebug.h,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -d -r2.17 -r2.18 *** pydebug.h 2001/07/23 16:50:15 2.17 --- pydebug.h 2001/08/31 17:40:14 2.18 *************** *** 16,19 **** --- 16,20 ---- extern DL_IMPORT(int) Py_UnicodeFlag; extern DL_IMPORT(int) Py_IgnoreEnvironmentFlag; + extern DL_IMPORT(int) Py_DivisionWarningFlag; /* this is a wrapper around getenv() that pays attention to Index: pythonrun.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v retrieving revision 2.47 retrieving revision 2.48 diff -C2 -d -r2.47 -r2.48 *** pythonrun.h 2001/08/17 20:47:47 2.47 --- pythonrun.h 2001/08/31 17:40:14 2.48 *************** *** 34,37 **** --- 34,38 ---- DL_IMPORT(int) PyRun_SimpleString(char *); + DL_IMPORT(int) PyRun_SimpleStringFlags(char *, PyCompilerFlags *); DL_IMPORT(int) PyRun_SimpleFile(FILE *, char *); DL_IMPORT(int) PyRun_SimpleFileEx(FILE *, char *, int); From gvanrossum@users.sourceforge.net Fri Aug 31 18:40:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 31 Aug 2001 10:40:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python pythonrun.c,2.147,2.148 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv8024/Python Modified Files: pythonrun.c Log Message: Add warning mode for classic division, almost exactly as specified in PEP 238. Changes: - add a new flag variable Py_DivisionWarningFlag, declared in pydebug.h, defined in object.c, set in main.c, and used in {int,long,float,complex}object.c. When this flag is set, the classic division operator issues a DeprecationWarning message. - add a new API PyRun_SimpleStringFlags() to match PyRun_SimpleString(). The main() function calls this so that commands run with -c can also benefit from -Dnew. - While I was at it, I changed the usage message in main() somewhat: alphabetized the options, split it in *four* parts to fit in under 512 bytes (not that I still believe this is necessary -- doc strings elsewhere are much longer), and perhaps most visibly, don't display the full list of options on each command line error. Instead, the full list is only displayed when -h is used, and otherwise a brief reminder of -h is displayed. When -h is used, write to stdout so that you can do `python -h | more'. Notes: - I don't want to use the -W option to control whether the classic division warning is issued or not, because the machinery to decide whether to display the warning or not is very expensive (it involves calling into the warnings.py module). You can use -Werror to turn the warnings into exceptions though. - The -Dnew option doesn't select future division for all of the program -- only for the __main__ module. I don't know if I'll ever change this -- it would require changes to the .pyc file magic number to do it right, and a more global notion of compiler flags. - You can usefully combine -Dwarn and -Dnew: this gives the __main__ module new division, and warns about classic division everywhere else. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.147 retrieving revision 2.148 diff -C2 -d -r2.147 -r2.148 *** pythonrun.c 2001/08/17 18:39:25 2.147 --- pythonrun.c 2001/08/31 17:40:15 2.148 *************** *** 688,691 **** --- 688,697 ---- PyRun_SimpleString(char *command) { + return PyRun_SimpleStringFlags(command, NULL); + } + + int + PyRun_SimpleStringFlags(char *command, PyCompilerFlags *flags) + { PyObject *m, *d, *v; m = PyImport_AddModule("__main__"); *************** *** 693,697 **** return -1; d = PyModule_GetDict(m); ! v = PyRun_String(command, Py_file_input, d, d); if (v == NULL) { PyErr_Print(); --- 699,703 ---- return -1; d = PyModule_GetDict(m); ! v = PyRun_StringFlags(command, Py_file_input, d, d, flags); if (v == NULL) { PyErr_Print(); From gvanrossum@users.sourceforge.net Fri Aug 31 18:40:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 31 Aug 2001 10:40:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.39,2.40 floatobject.c,2.89,2.90 intobject.c,2.67,2.68 longobject.c,1.94,1.95 object.c,2.142,2.143 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv8024/Objects Modified Files: complexobject.c floatobject.c intobject.c longobject.c object.c Log Message: Add warning mode for classic division, almost exactly as specified in PEP 238. Changes: - add a new flag variable Py_DivisionWarningFlag, declared in pydebug.h, defined in object.c, set in main.c, and used in {int,long,float,complex}object.c. When this flag is set, the classic division operator issues a DeprecationWarning message. - add a new API PyRun_SimpleStringFlags() to match PyRun_SimpleString(). The main() function calls this so that commands run with -c can also benefit from -Dnew. - While I was at it, I changed the usage message in main() somewhat: alphabetized the options, split it in *four* parts to fit in under 512 bytes (not that I still believe this is necessary -- doc strings elsewhere are much longer), and perhaps most visibly, don't display the full list of options on each command line error. Instead, the full list is only displayed when -h is used, and otherwise a brief reminder of -h is displayed. When -h is used, write to stdout so that you can do `python -h | more'. Notes: - I don't want to use the -W option to control whether the classic division warning is issued or not, because the machinery to decide whether to display the warning or not is very expensive (it involves calling into the warnings.py module). You can use -Werror to turn the warnings into exceptions though. - The -Dnew option doesn't select future division for all of the program -- only for the __main__ module. I don't know if I'll ever change this -- it would require changes to the .pyc file magic number to do it right, and a more global notion of compiler flags. - You can usefully combine -Dwarn and -Dnew: this gives the __main__ module new division, and warns about classic division everywhere else. Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.39 retrieving revision 2.40 diff -C2 -d -r2.39 -r2.40 *** complexobject.c 2001/08/17 18:39:25 2.39 --- complexobject.c 2001/08/31 17:40:15 2.40 *************** *** 374,377 **** --- 374,398 ---- static PyObject * + complex_classic_div(PyComplexObject *v, PyComplexObject *w) + { + Py_complex quot; + + if (Py_DivisionWarningFlag && + PyErr_Warn(PyExc_DeprecationWarning, + "classic complex division") < 0) + return NULL; + + PyFPE_START_PROTECT("complex_classic_div", return 0) + errno = 0; + quot = c_quot(v->cval,w->cval); + PyFPE_END_PROTECT(quot) + if (errno == EDOM) { + PyErr_SetString(PyExc_ZeroDivisionError, "complex division"); + return NULL; + } + return PyComplex_FromCComplex(quot); + } + + static PyObject * complex_remainder(PyComplexObject *v, PyComplexObject *w) { *************** *** 855,859 **** (binaryfunc)complex_sub, /* nb_subtract */ (binaryfunc)complex_mul, /* nb_multiply */ ! (binaryfunc)complex_div, /* nb_divide */ (binaryfunc)complex_remainder, /* nb_remainder */ (binaryfunc)complex_divmod, /* nb_divmod */ --- 876,880 ---- (binaryfunc)complex_sub, /* nb_subtract */ (binaryfunc)complex_mul, /* nb_multiply */ ! (binaryfunc)complex_classic_div, /* nb_divide */ (binaryfunc)complex_remainder, /* nb_remainder */ (binaryfunc)complex_divmod, /* nb_divmod */ Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.89 retrieving revision 2.90 diff -C2 -d -r2.89 -r2.90 *** floatobject.c 2001/08/30 03:09:31 2.89 --- floatobject.c 2001/08/31 17:40:15 2.90 *************** *** 415,418 **** --- 415,437 ---- static PyObject * + float_classic_div(PyObject *v, PyObject *w) + { + double a,b; + CONVERT_TO_DOUBLE(v, a); + CONVERT_TO_DOUBLE(w, b); + if (Py_DivisionWarningFlag && + PyErr_Warn(PyExc_DeprecationWarning, "classic float division") < 0) + return NULL; + if (b == 0.0) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + return NULL; + } + PyFPE_START_PROTECT("divide", return 0) + a = a / b; + PyFPE_END_PROTECT(a) + return PyFloat_FromDouble(a); + } + + static PyObject * float_rem(PyObject *v, PyObject *w) { *************** *** 678,682 **** (binaryfunc)float_sub, /*nb_subtract*/ (binaryfunc)float_mul, /*nb_multiply*/ ! (binaryfunc)float_div, /*nb_divide*/ (binaryfunc)float_rem, /*nb_remainder*/ (binaryfunc)float_divmod, /*nb_divmod*/ --- 697,701 ---- (binaryfunc)float_sub, /*nb_subtract*/ (binaryfunc)float_mul, /*nb_multiply*/ ! (binaryfunc)float_classic_div, /*nb_divide*/ (binaryfunc)float_rem, /*nb_remainder*/ (binaryfunc)float_divmod, /*nb_divmod*/ Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.67 retrieving revision 2.68 diff -C2 -d -r2.67 -r2.68 *** intobject.c 2001/08/30 03:09:31 2.67 --- intobject.c 2001/08/31 17:40:15 2.68 *************** *** 513,516 **** --- 513,537 ---- static PyObject * + int_classic_div(PyIntObject *x, PyIntObject *y) + { + long xi, yi; + long d, m; + CONVERT_TO_LONG(x, xi); + CONVERT_TO_LONG(y, yi); + if (Py_DivisionWarningFlag && + PyErr_Warn(PyExc_DeprecationWarning, "classic int division") < 0) + return NULL; + switch (i_divmod(xi, yi, &d, &m)) { + case DIVMOD_OK: + return PyInt_FromLong(d); + case DIVMOD_OVERFLOW: + return PyLong_Type.tp_as_number->nb_divide((PyObject *)x, + (PyObject *)y); + default: + return NULL; + } + } + + static PyObject * int_mod(PyIntObject *x, PyIntObject *y) { *************** *** 745,749 **** int_true_divide(PyObject *v, PyObject *w) { ! return PyFloat_Type.tp_as_number->nb_divide(v, w); } --- 766,770 ---- int_true_divide(PyObject *v, PyObject *w) { ! return PyFloat_Type.tp_as_number->nb_true_divide(v, w); } *************** *** 856,860 **** (binaryfunc)int_sub, /*nb_subtract*/ (binaryfunc)int_mul, /*nb_multiply*/ ! (binaryfunc)int_div, /*nb_divide*/ (binaryfunc)int_mod, /*nb_remainder*/ (binaryfunc)int_divmod, /*nb_divmod*/ --- 877,881 ---- (binaryfunc)int_sub, /*nb_subtract*/ (binaryfunc)int_mul, /*nb_multiply*/ ! (binaryfunc)int_classic_div, /*nb_divide*/ (binaryfunc)int_mod, /*nb_remainder*/ (binaryfunc)int_divmod, /*nb_divmod*/ Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** longobject.c 2001/08/30 15:54:44 1.94 --- longobject.c 2001/08/31 17:40:15 1.95 *************** *** 1510,1513 **** --- 1510,1533 ---- static PyObject * + long_classic_div(PyObject *v, PyObject *w) + { + PyLongObject *a, *b, *div, *mod; + + CONVERT_BINOP(v, w, &a, &b); + + if (Py_DivisionWarningFlag && + PyErr_Warn(PyExc_DeprecationWarning, "classic long division") < 0) + div = NULL; + else if (l_divmod(a, b, &div, &mod) < 0) + div = NULL; + else + Py_DECREF(mod); + + Py_DECREF(a); + Py_DECREF(b); + return (PyObject *)div; + } + + static PyObject * long_mod(PyObject *v, PyObject *w) { *************** *** 2116,2120 **** (binaryfunc) long_sub, /*nb_subtract*/ (binaryfunc) long_mul, /*nb_multiply*/ ! (binaryfunc) long_div, /*nb_divide*/ (binaryfunc) long_mod, /*nb_remainder*/ (binaryfunc) long_divmod, /*nb_divmod*/ --- 2136,2140 ---- (binaryfunc) long_sub, /*nb_subtract*/ (binaryfunc) long_mul, /*nb_multiply*/ ! (binaryfunc) long_classic_div, /*nb_divide*/ (binaryfunc) long_mod, /*nb_remainder*/ (binaryfunc) long_divmod, /*nb_divmod*/ Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.142 retrieving revision 2.143 diff -C2 -d -r2.142 -r2.143 *** object.c 2001/08/30 20:26:05 2.142 --- object.c 2001/08/31 17:40:15 2.143 *************** *** 17,20 **** --- 17,22 ---- #endif + DL_IMPORT(int) Py_DivisionWarningFlag; + /* Object allocation routines used by NEWOBJ and NEWVAROBJ macros. These are used by the individual routines for object creation. From gvanrossum@users.sourceforge.net Fri Aug 31 18:40:17 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 31 Aug 2001 10:40:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules main.c,1.56,1.57 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv8024/Modules Modified Files: main.c Log Message: Add warning mode for classic division, almost exactly as specified in PEP 238. Changes: - add a new flag variable Py_DivisionWarningFlag, declared in pydebug.h, defined in object.c, set in main.c, and used in {int,long,float,complex}object.c. When this flag is set, the classic division operator issues a DeprecationWarning message. - add a new API PyRun_SimpleStringFlags() to match PyRun_SimpleString(). The main() function calls this so that commands run with -c can also benefit from -Dnew. - While I was at it, I changed the usage message in main() somewhat: alphabetized the options, split it in *four* parts to fit in under 512 bytes (not that I still believe this is necessary -- doc strings elsewhere are much longer), and perhaps most visibly, don't display the full list of options on each command line error. Instead, the full list is only displayed when -h is used, and otherwise a brief reminder of -h is displayed. When -h is used, write to stdout so that you can do `python -h | more'. Notes: - I don't want to use the -W option to control whether the classic division warning is issued or not, because the machinery to decide whether to display the warning or not is very expensive (it involves calling into the warnings.py module). You can use -Werror to turn the warnings into exceptions though. - The -Dnew option doesn't select future division for all of the program -- only for the __main__ module. I don't know if I'll ever change this -- it would require changes to the .pyc file magic number to do it right, and a more global notion of compiler flags. - You can usefully combine -Dwarn and -Dnew: this gives the __main__ module new division, and warns about classic division everywhere else. Index: main.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** main.c 2001/07/23 16:30:27 1.56 --- main.c 2001/08/31 17:40:15 1.57 *************** *** 3,6 **** --- 3,7 ---- #include "Python.h" #include "osdefs.h" + #include "compile.h" /* For CO_FUTURE_DIVISION */ #ifdef HAVE_UNISTD_H *************** *** 29,33 **** /* command line options */ ! #define BASE_OPTS "c:diOSEtuUvxXhVW:" #ifndef RISCOS --- 30,34 ---- /* command line options */ ! #define BASE_OPTS "c:dD:EhiOStuUvVWxX:" #ifndef RISCOS *************** *** 46,52 **** /* Long usage message, split into parts < 512 bytes */ ! static char *usage_top = "\ Options and arguments (and corresponding environment variables):\n\ -d : debug output from parser (also PYTHONDEBUG=x)\n\ -i : inspect interactively after running script, (also PYTHONINSPECT=x)\n\ and force prompts, even if stdin does not appear to be a terminal\n\ --- 47,59 ---- /* Long usage message, split into parts < 512 bytes */ ! static char *usage_1 = "\ Options and arguments (and corresponding environment variables):\n\ + -c cmd : program passed in as string (terminates option list)\n\ -d : debug output from parser (also PYTHONDEBUG=x)\n\ + -D arg : division options: -Dold (default), -Dwarn, -Dnew\n\ + -E : ignore environment variables (such as PYTHONPATH)\n\ + -h : print this help message and exit\n\ + "; + static char *usage_2 = "\ -i : inspect interactively after running script, (also PYTHONINSPECT=x)\n\ and force prompts, even if stdin does not appear to be a terminal\n\ *************** *** 54,73 **** -OO : remove doc-strings in addition to the -O optimizations\n\ -S : don't imply 'import site' on initialization\n\ - -E : ignore environment variables (such as PYTHONPATH)\n\ -t : issue warnings about inconsistent tab usage (-tt: issue errors)\n\ - "; - static char *usage_mid = "\ -u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\ -U : Unicode literals: treats '...' literals like u'...'\n\ -v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\ - -x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ - -h : print this help message and exit\n\ -V : print the Python version number and exit\n\ -W arg : warning control (arg is action:message:category:module:lineno)\n\ ! -c cmd : program passed in as string (terminates option list)\n\ file : program read from script file\n\ - : program read from stdin (default; interactive mode if a tty)\n\ "; ! static char *usage_bot = "\ arg ...: arguments passed to program in sys.argv[1:]\n\ Other environment variables:\n\ --- 61,77 ---- -OO : remove doc-strings in addition to the -O optimizations\n\ -S : don't imply 'import site' on initialization\n\ -t : issue warnings about inconsistent tab usage (-tt: issue errors)\n\ -u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\ + "; + static char *usage_3 = "\ -U : Unicode literals: treats '...' literals like u'...'\n\ -v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\ -V : print the Python version number and exit\n\ -W arg : warning control (arg is action:message:category:module:lineno)\n\ ! -x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ file : program read from script file\n\ - : program read from stdin (default; interactive mode if a tty)\n\ "; ! static char *usage_4 = "\ arg ...: arguments passed to program in sys.argv[1:]\n\ Other environment variables:\n\ *************** *** 84,91 **** usage(int exitcode, char* program) { ! fprintf(stderr, usage_line, program); ! fprintf(stderr, usage_top); ! fprintf(stderr, usage_mid); ! fprintf(stderr, usage_bot, DELIM, DELIM, PYTHONHOMEHELP); exit(exitcode); /*NOTREACHED*/ --- 88,102 ---- usage(int exitcode, char* program) { ! FILE *f = exitcode ? stderr : stdout; ! ! fprintf(f, usage_line, program); ! if (exitcode) ! fprintf(f, "Try `python -h' for more information.\n"); ! else { ! fprintf(f, usage_1); ! fprintf(f, usage_2); ! fprintf(f, usage_3); ! fprintf(f, usage_4, DELIM, DELIM, PYTHONHOMEHELP); ! } exit(exitcode); /*NOTREACHED*/ *************** *** 114,117 **** --- 125,130 ---- PyCompilerFlags cf; + cf.cf_flags = 0; + orig_argc = argc; /* For Py_GetArgcArgv() */ orig_argv = argv; *************** *** 136,140 **** break; } ! switch (c) { --- 149,153 ---- break; } ! switch (c) { *************** *** 143,146 **** --- 156,179 ---- break; + case 'D': + if (strcmp(_PyOS_optarg, "old") == 0) { + Py_DivisionWarningFlag = 0; + break; + } + if (strcmp(_PyOS_optarg, "warn") == 0) { + Py_DivisionWarningFlag++; + break; + } + if (strcmp(_PyOS_optarg, "new") == 0) { + /* XXX This only affects __main__ */ + cf.cf_flags |= CO_FUTURE_DIVISION; + break; + } + fprintf(stderr, + "-D option should be " + "`-Dold', `-Dwarn' or `-Dnew' only\n"); + usage(2, argv[0]); + /* NOTREACHED */ + case 'i': inspect++; *************** *** 291,296 **** fprintf(stderr, "Python %s on %s\n%s\n", Py_GetVersion(), Py_GetPlatform(), COPYRIGHT); ! ! if (command != NULL) { /* Backup _PyOS_optind and force sys.argv[0] = '-c' */ --- 324,328 ---- fprintf(stderr, "Python %s on %s\n%s\n", Py_GetVersion(), Py_GetPlatform(), COPYRIGHT); ! if (command != NULL) { /* Backup _PyOS_optind and force sys.argv[0] = '-c' */ *************** *** 311,318 **** } - cf.cf_flags = 0; - if (command) { ! sts = PyRun_SimpleString(command) != 0; free(command); } --- 343,348 ---- } if (command) { ! sts = PyRun_SimpleStringFlags(command, &cf) != 0; free(command); } From gvanrossum@users.sourceforge.net Fri Aug 31 18:46:37 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 31 Aug 2001 10:46:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib warnings.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv12729 Modified Files: warnings.py Log Message: Allow for the possibility that globals['__name__'] does not exist; substitute "" for the module name in that case. This actually occurred when running test_descr.py with -Dwarn. Index: warnings.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/warnings.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** warnings.py 2001/08/23 03:07:42 1.8 --- warnings.py 2001/08/31 17:46:35 1.9 *************** *** 25,29 **** globals = caller.f_globals lineno = caller.f_lineno ! module = globals['__name__'] filename = globals.get('__file__') if filename: --- 25,32 ---- globals = caller.f_globals lineno = caller.f_lineno ! if globals.has_key('__name__'): ! module = globals['__name__'] ! else: ! module = "" filename = globals.get('__file__') if filename: From gvanrossum@users.sourceforge.net Fri Aug 31 19:17:15 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 31 Aug 2001 11:17:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules main.c,1.57,1.58 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv20893 Modified Files: main.c Log Message: Oops. The -W option takes args, not -X. Index: main.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** main.c 2001/08/31 17:40:15 1.57 --- main.c 2001/08/31 18:17:13 1.58 *************** *** 30,34 **** /* command line options */ ! #define BASE_OPTS "c:dD:EhiOStuUvVWxX:" #ifndef RISCOS --- 30,34 ---- /* command line options */ ! #define BASE_OPTS "c:dD:EhiOStuUvVW:xX" #ifndef RISCOS From gvanrossum@users.sourceforge.net Fri Aug 31 19:31:37 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 31 Aug 2001 11:31:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.219,1.220 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv23528 Modified Files: NEWS Log Message: Add various and sundry news items -- most mine, one Barry's, one Michael Hudson's. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.219 retrieving revision 1.220 diff -C2 -d -r1.219 -r1.220 *** NEWS 2001/08/30 20:51:59 1.219 --- NEWS 2001/08/31 18:31:35 1.220 *************** *** 4,7 **** --- 4,44 ---- Core + + Overflowing operations on plain ints now return a long int rather + than raising OverflowError. This is a partial implementation of PEP + 237. You can use -Wdefault::OverflowWarning to enable a warning for + this situation, and -Werror::OverflowWarning to revert to the old + OverflowError exception. + + + A new command line option, -D, is added to control run-time + warnings for the use of classic division. (See PEP 238.) Possible + values are -Dold, -Dwarn, and -Dnew. The default is -Dold, meaning + the / operator has its classic meaning and no warnings are issued. + Using -Dwarn issues a run-time warning about all uses of classic + division for int, long, float and complex arguments. Using -Dnew is + questionable; it turns on new division by default, but only in the + __main__ module. You can usefully combine -Dwarn and -Dnew: this + gives the __main__ module new division, and warns about classic + division everywhere else. + + + Many built-in types can now be subclassed. This applies to int, + long, float, str, unicode, and tuple. (The types complex, list and + dictionary can also be subclassed; this was introduced earlier.) + Note that restrictions apply when subclassing immutable built-in + types: you can only affect the value of the instance by overloading + __new__. You can add mutable attributes, and the subclass instances + will have a __dict__ attribute, but you cannot change the "value" + (as implemented by the base class) of an immutable subclass instance + once it is created. + + + A new built-in type, super, has been added. This facilitates making + "cooperative super calls" in a multiple inheritance setting. For an + explanation, see http://www.python.org/2.2/descrintro.html#cooperation + + + A new built-in type, getset, has been added. This enables the + creation of "computed attributes". Such attributes are implemented + by getter and setter functions (or only one of these for read-only + or write-only attributes), without the need to override + __getattr__. See http://www.python.org/2.2/descrintro.html#getset + + The syntax of floating-point and imaginary literals has been liberalized, to allow leading zeroes. Examples of literals now *************** *** 23,26 **** --- 60,66 ---- converted to Python longs. + + In restricted execution mode (using the rexec module), unmarshalling + code objects is no longer allowed. This plugs a security hole. + Tools *************** *** 45,48 **** --- 85,92 ---- - remove calls to PyObject_AS_GC and PyObject_FROM_GC + + Two new functions: PyString_FromFormat() and PyString_FromFormatV(). + These can be used safely to construct string objects from a + sprintf-style format string (similar to the format string supported + by PyErr_Format()). New platforms